[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-4.0-testing] trace: share t_info pages only in read-only mode



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1277918623 -3600
# Node ID cda6a326d30e764b3e1ae1bed077c282a97efc66
# Parent  e149a68b98100b480e1a3f52fc6e312958312cb1
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@xxxxxxxxxx>
Acked-by: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
xen-unstable changeset:   21695:c5f3fe17374c
xen-unstable date:        Tue Jun 29 18:18:42 2010 +0100
---
 tools/xenmon/xenbaked.c   |   10 +++++-----
 tools/xentrace/xentrace.c |   10 +++++-----
 xen/common/trace.c        |    2 +-
 3 files changed, 11 insertions(+), 11 deletions(-)

diff -r e149a68b9810 -r cda6a326d30e tools/xenmon/xenbaked.c
--- a/tools/xenmon/xenbaked.c   Wed Jun 30 18:23:19 2010 +0100
+++ b/tools/xenmon/xenbaked.c   Wed Jun 30 18:23:43 2010 +0100
@@ -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(unsign
     }
 
     /* 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(unsign
     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 -r e149a68b9810 -r cda6a326d30e tools/xentrace/xentrace.c
--- a/tools/xentrace/xentrace.c Wed Jun 30 18:23:19 2010 +0100
+++ b/tools/xentrace/xentrace.c Wed Jun 30 18:23:43 2010 +0100
@@ -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(unsign
     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(unsign
     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 -r e149a68b9810 -r cda6a326d30e xen/common/trace.c
--- a/xen/common/trace.c        Wed Jun 30 18:23:19 2010 +0100
+++ b/xen/common/trace.c        Wed Jun 30 18:23:43 2010 +0100
@@ -295,7 +295,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 )
     {

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.