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>
This commit is contained in:
Keir Fraser committed 2010-06-29 18:18:42 +01:00
1 parent cecde1f967
commit 79bdfbb588
3 files changed
+11 -11

No files matched your search

+5 -5
View File
@@ -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];
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.