diff options
author | Jeremy Fitzhardinge <jeremy@goop.org> | 2008-07-08 18:06:55 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-16 05:01:17 -0400 |
commit | ce803e705f1cbdd2703e83061622089b5b4a5417 (patch) | |
tree | f6f0bb63a2062bc983ca45b823982ed1b5a3bb63 /arch/x86/xen | |
parent | ebd879e397f6361727c36267a12d1650710e465a (diff) |
xen64: use arbitrary_virt_to_machine for xen_set_pmd
When building initial pagetables in 64-bit kernel the pud/pmd pointer may
be in ioremap/fixmap space, so we need to walk the pagetable to look up the
physical address.
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: Stephen Tweedie <sct@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/xen')
-rw-r--r-- | arch/x86/xen/mmu.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index 05d7392a7a4c..a8f023271819 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c | |||
@@ -178,8 +178,9 @@ void set_phys_to_machine(unsigned long pfn, unsigned long mfn) | |||
178 | p2m_top[topidx][idx] = mfn; | 178 | p2m_top[topidx][idx] = mfn; |
179 | } | 179 | } |
180 | 180 | ||
181 | xmaddr_t arbitrary_virt_to_machine(unsigned long address) | 181 | xmaddr_t arbitrary_virt_to_machine(void *vaddr) |
182 | { | 182 | { |
183 | unsigned long address = (unsigned long)vaddr; | ||
183 | unsigned int level; | 184 | unsigned int level; |
184 | pte_t *pte = lookup_address(address, &level); | 185 | pte_t *pte = lookup_address(address, &level); |
185 | unsigned offset = address & ~PAGE_MASK; | 186 | unsigned offset = address & ~PAGE_MASK; |
@@ -253,7 +254,8 @@ void xen_set_pmd_hyper(pmd_t *ptr, pmd_t val) | |||
253 | 254 | ||
254 | xen_mc_batch(); | 255 | xen_mc_batch(); |
255 | 256 | ||
256 | u.ptr = virt_to_machine(ptr).maddr; | 257 | /* ptr may be ioremapped for 64-bit pagetable setup */ |
258 | u.ptr = arbitrary_virt_to_machine(ptr).maddr; | ||
257 | u.val = pmd_val_ma(val); | 259 | u.val = pmd_val_ma(val); |
258 | extend_mmu_update(&u); | 260 | extend_mmu_update(&u); |
259 | 261 | ||
@@ -415,7 +417,8 @@ void xen_set_pud_hyper(pud_t *ptr, pud_t val) | |||
415 | 417 | ||
416 | xen_mc_batch(); | 418 | xen_mc_batch(); |
417 | 419 | ||
418 | u.ptr = virt_to_machine(ptr).maddr; | 420 | /* ptr may be ioremapped for 64-bit pagetable setup */ |
421 | u.ptr = arbitrary_virt_to_machine(ptr).maddr; | ||
419 | u.val = pud_val_ma(val); | 422 | u.val = pud_val_ma(val); |
420 | extend_mmu_update(&u); | 423 | extend_mmu_update(&u); |
421 | 424 | ||