diff options
author | Jan Beulich <jbeulich@suse.com> | 2013-01-23 14:08:44 +0100 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2013-01-23 14:08:44 +0100 |
commit | 03b4fd14aca0456b413a1855024d5e5326cc95ec (patch) | |
tree | 125427a412fed9545188c4a0dd970cf54b0a5339 /xen/arch/x86/domain_page.c | |
parent | 4b28bf6ae90bd83fd1113d8bdc53c3266ffeb328 (diff) | |
download | xen-03b4fd14aca0456b413a1855024d5e5326cc95ec.tar.gz xen-03b4fd14aca0456b413a1855024d5e5326cc95ec.tar.bz2 xen-03b4fd14aca0456b413a1855024d5e5326cc95ec.zip |
x86: properly use map_domain_page() when building Dom0
This requires a minor hack to allow the correct page tables to be used
while running on Dom0's page tables (as they can't be determined from
"current" at that time).
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/arch/x86/domain_page.c')
-rw-r--r-- | xen/arch/x86/domain_page.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/xen/arch/x86/domain_page.c b/xen/arch/x86/domain_page.c index 6a219947d5..3eec769b8b 100644 --- a/xen/arch/x86/domain_page.c +++ b/xen/arch/x86/domain_page.c @@ -15,10 +15,12 @@ #include <asm/flushtlb.h> #include <asm/hardirq.h> +static struct vcpu *__read_mostly override; + static inline struct vcpu *mapcache_current_vcpu(void) { /* In the common case we use the mapcache of the running VCPU. */ - struct vcpu *v = current; + struct vcpu *v = override ?: current; /* * When current isn't properly set up yet, this is equivalent to @@ -44,6 +46,11 @@ static inline struct vcpu *mapcache_current_vcpu(void) return v; } +void __init mapcache_override_current(struct vcpu *v) +{ + override = v; +} + #define mapcache_l2_entry(e) ((e) >> PAGETABLE_ORDER) #define MAPCACHE_L2_ENTRIES (mapcache_l2_entry(MAPCACHE_ENTRIES - 1) + 1) #define DCACHE_L1ENT(dc, idx) \ |