lkml.org 
[lkml]   [2008]   [Jul]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] xen: fix allocation and use of large ldts
Ingo Molnar wrote:
> * Jeremy Fitzhardinge <jeremy@goop.org> wrote:
>
>
>> When the ldt gets to more than 1 page in size, the kernel uses vmalloc
>> to allocate it. This means that:
>> - when making the ldt RO, we must update the pages in both the vmalloc
>> mapping and the linear mapping to make sure there are no RW aliases.
>> - we need to use arbitrary_virt_to_machine to compute the machine addr
>> for each update
>>
>
> applied to tip/x86/xen, thanks Jeremy.
>

Thanks. Here's a follow-up tidy patch.

Subject: xen: tidy up ldt fixes

Add a proper comment for set_aliased_prot() and fix an
unsigned long/void * warning.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
---
arch/x86/xen/enlighten.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)

===================================================================
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -395,8 +395,10 @@
}

/*
- * If 'v' is a vmalloc mapping, then find the linear mapping of the
- * page (if any) and also set its protections to match:
+ * Set the page permissions for a particular virtual address. If the
+ * address is a vmalloc mapping (or other non-linear mapping), then
+ * find the linear mapping of the page and also set its protections to
+ * match.
*/
static void set_aliased_prot(void *v, pgprot_t prot)
{
@@ -545,8 +547,7 @@
static void xen_write_ldt_entry(struct desc_struct *dt, int entrynum,
const void *ptr)
{
- unsigned long lp = (unsigned long)&dt[entrynum];
- xmaddr_t mach_lp = arbitrary_virt_to_machine(lp);
+ xmaddr_t mach_lp = arbitrary_virt_to_machine(&dt[entrynum]);
u64 entry = *(u64 *)ptr;

preempt_disable();



\
 
 \ /
  Last update: 2008-07-28 22:37    [W:0.084 / U:0.312 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site