aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2010-06-29 18:18:42 +0100
committerKeir Fraser <keir.fraser@citrix.com>2010-06-29 18:18:42 +0100
commit79bdfbb5885dc09a3739d17ca8f3ae45714bffec (patch)
tree3f8d7cd56f91416bd7a15301c81307c661c055b4
parentcecde1f9670adb95274c56e126d62d8a6d86f8cf (diff)
downloadxen-79bdfbb5885dc09a3739d17ca8f3ae45714bffec.tar.gz
xen-79bdfbb5885dc09a3739d17ca8f3ae45714bffec.tar.bz2
xen-79bdfbb5885dc09a3739d17ca8f3ae45714bffec.zip
trace: share t_info pages only in read-only mode
There's no need to share writably the t_info pages (Dom0 only wants [and needs] to read it) Signed-off-by: Jan Beulich <jbeulich@novell.com> Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
-rw-r--r--tools/xenmon/xenbaked.c10
-rw-r--r--tools/xentrace/xentrace.c10
-rw-r--r--xen/common/trace.c2
3 files changed, 11 insertions, 11 deletions
diff --git a/tools/xenmon/xenbaked.c b/tools/xenmon/xenbaked.c
index f44a3e8c44..478fac2bcb 100644
--- a/tools/xenmon/xenbaked.c
+++ b/tools/xenmon/xenbaked.c
@@ -84,7 +84,7 @@ typedef struct settings_st {
} settings_t;
struct t_struct {
- struct t_info *t_info; /* Structure with information about individual buffers */
+ const struct t_info *t_info; /* Structure with information about individual buffers */
struct t_buf **meta; /* Pointers to trace buffer metadata */
unsigned char **data; /* Pointers to trace buffer data areas */
};
@@ -376,9 +376,8 @@ static struct t_struct *map_tbufs(unsigned long tbufs_mfn, unsigned int num,
}
/* Map t_info metadata structure */
- tbufs.t_info = xc_map_foreign_range(xc_handle, DOMID_XEN,
- tinfo_size, PROT_READ | PROT_WRITE,
- tbufs_mfn);
+ tbufs.t_info = xc_map_foreign_range(xc_handle, DOMID_XEN, tinfo_size,
+ PROT_READ, tbufs_mfn);
if ( tbufs.t_info == 0 )
{
@@ -404,7 +403,8 @@ static struct t_struct *map_tbufs(unsigned long tbufs_mfn, unsigned int num,
for(i=0; i<num; i++)
{
- uint32_t *mfn_list = ((uint32_t *)tbufs.t_info) + tbufs.t_info->mfn_offset[i];
+ const uint32_t *mfn_list = (const uint32_t *)tbufs.t_info
+ + tbufs.t_info->mfn_offset[i];
int j;
xen_pfn_t pfn_list[tbufs.t_info->tbuf_size];
diff --git a/tools/xentrace/xentrace.c b/tools/xentrace/xentrace.c
index 6291cde033..8812bfdf3b 100644
--- a/tools/xentrace/xentrace.c
+++ b/tools/xentrace/xentrace.c
@@ -63,7 +63,7 @@ typedef struct settings_st {
} settings_t;
struct t_struct {
- struct t_info *t_info; /* Structure with information about individual buffers */
+ const struct t_info *t_info; /* Structure with information about individual buffers */
struct t_buf **meta; /* Pointers to trace buffer metadata */
unsigned char **data; /* Pointers to trace buffer data areas */
};
@@ -475,9 +475,8 @@ static struct t_struct *map_tbufs(unsigned long tbufs_mfn, unsigned int num,
int i;
/* Map t_info metadata structure */
- tbufs.t_info = xc_map_foreign_range(xc_handle, DOMID_XEN,
- tinfo_size, PROT_READ | PROT_WRITE,
- tbufs_mfn);
+ tbufs.t_info = xc_map_foreign_range(xc_handle, DOMID_XEN, tinfo_size,
+ PROT_READ, tbufs_mfn);
if ( tbufs.t_info == 0 )
{
@@ -503,7 +502,8 @@ static struct t_struct *map_tbufs(unsigned long tbufs_mfn, unsigned int num,
for(i=0; i<num; i++)
{
- uint32_t *mfn_list = ((uint32_t *)tbufs.t_info) + tbufs.t_info->mfn_offset[i];
+ const uint32_t *mfn_list = (const uint32_t *)tbufs.t_info
+ + tbufs.t_info->mfn_offset[i];
int j;
xen_pfn_t pfn_list[tbufs.t_info->tbuf_size];
diff --git a/xen/common/trace.c b/xen/common/trace.c
index 9884f6ad6e..17819d0d69 100644
--- a/xen/common/trace.c
+++ b/xen/common/trace.c
@@ -309,7 +309,7 @@ void __init init_trace_bufs(void)
for(i=0; i<T_INFO_PAGES; i++)
share_xen_page_with_privileged_guests(
- virt_to_page(t_info) + i, XENSHARE_writable);
+ virt_to_page(t_info) + i, XENSHARE_readonly);
if ( opt_tbuf_size == 0 )
{