/[pkg-src]/tags/kernel26-xen-2_6_25_r1-fedora9-patches/kernel26-xen/patches-2.6.25-r1/1113-2.6.25-xen-Multi-pagetable-write_cr3-implementation-FIXME.patch |
Contents of /tags/kernel26-xen-2_6_25_r1-fedora9-patches/kernel26-xen/patches-2.6.25-r1/1113-2.6.25-xen-Multi-pagetable-write_cr3-implementation-FIXME.patch
Parent Directory | Revision Log
Revision 608 -
(show annotations)
(download)
Fri May 23 12:17:32 2008 UTC (16 years ago) by (unknown author)
File size: 2105 byte(s)
Fri May 23 12:17:32 2008 UTC (16 years ago) by (unknown author)
File size: 2105 byte(s)
This commit was manufactured by cvs2svn to create tag 'kernel26-xen-2_6_25_r1-fedora9-patches'.
1 | From 88886a2a53f3bc5761bc27c1fbe0b50a0deacd02 Mon Sep 17 00:00:00 2001 |
2 | From: Eduardo Habkost <ehabkost@redhat.com> |
3 | Date: Mon, 14 Jan 2008 20:02:02 -0200 |
4 | Subject: [PATCH] Multi-pagetable write_cr3() implementation (FIXME) |
5 | |
6 | x86_64-specific. Needs #ifdefs. |
7 | |
8 | Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> |
9 | --- |
10 | arch/x86/xen/enlighten.c | 31 ++++++++++++++++++++++++++++++- |
11 | 1 files changed, 30 insertions(+), 1 deletions(-) |
12 | |
13 | diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c |
14 | index b383376..83aaa69 100644 |
15 | --- a/arch/x86/xen/enlighten.c |
16 | +++ b/arch/x86/xen/enlighten.c |
17 | @@ -37,6 +37,7 @@ |
18 | |
19 | #include <asm/paravirt.h> |
20 | #include <asm/page.h> |
21 | +#include <asm/pgalloc.h> |
22 | #include <asm/xen/hypercall.h> |
23 | #include <asm/xen/hypervisor.h> |
24 | #include <asm/fixmap.h> |
25 | @@ -711,7 +712,10 @@ static void xen_write_cr3(unsigned long cr3) |
26 | |
27 | BUG_ON(preemptible()); |
28 | |
29 | - mcs = xen_mc_entry(sizeof(*op)); /* disables interrupts */ |
30 | + xen_mc_batch(); /* disables interrupts */ |
31 | + |
32 | + |
33 | + mcs = __xen_mc_entry(sizeof(*op)); |
34 | |
35 | /* Update while interrupts are disabled, so its atomic with |
36 | respect to ipis */ |
37 | @@ -727,9 +731,32 @@ static void xen_write_cr3(unsigned long cr3) |
38 | been submitted. */ |
39 | xen_mc_callback(set_current_cr3, (void *)cr3); |
40 | |
41 | +#ifdef CONFIG_X86_64 |
42 | + { |
43 | + pgd_t *pgd = __va(cr3); |
44 | + unsigned long user_mfn = virt_to_mfn(__user_pgd(pgd)); |
45 | + |
46 | + mcs = __xen_mc_entry(sizeof(*op)); |
47 | + |
48 | + op = mcs.args; |
49 | + op->cmd = MMUEXT_NEW_USER_BASEPTR; |
50 | + /* pgd_alloc() allocates two pages for us. the second one is the |
51 | + * user page table |
52 | + */ |
53 | + op->arg1.mfn = user_mfn; |
54 | + |
55 | + MULTI_mmuext_op(mcs.mc, op, 1, NULL, DOMID_SELF); |
56 | + } |
57 | +#endif |
58 | + |
59 | xen_mc_issue(PARAVIRT_LAZY_CPU); /* interrupts restored */ |
60 | } |
61 | |
62 | +#ifdef CONFIG_X86_64 |
63 | +#if 0 |
64 | +/* |
65 | + * FIXME: unused |
66 | + */ |
67 | static void xen_new_user_baseptr(unsigned long pfn) |
68 | { |
69 | struct mmuext_op *op; |
70 | @@ -748,6 +775,8 @@ static void xen_new_user_baseptr(unsigned long pfn) |
71 | |
72 | xen_mc_issue(PARAVIRT_LAZY_CPU); /* interrupts restored */ |
73 | } |
74 | +#endif |
75 | +#endif |
76 | |
77 | /* Early in boot, while setting up the initial pagetable, assume |
78 | everything is pinned. */ |
79 | -- |
80 | 1.5.4.1 |
81 |