x86/xen: fix arbitrary_virt_to_machine()
Subsystems (2)
PATCH 1/1 x86/xen: fix arbitrary_virt_to_machine()
While I realize that the function isn't currently being used, I still think an obvious mistake like this should be corrected.
arch/x86/xen/mmu.c +1 -1
@@ -60,7 +60,7 @@ xmaddr_t arbitrary_virt_to_machine(unsig {unsigned int level;pte_t *pte =lookup_address (address, &level); -unsigned offset = address &PAGE_MASK ; +unsigned offset = address & (PAGE_SIZE -1 );BUG_ON (pte ==NULL );
Quoted 8 lines · Jan Beulich
While I realize that the function isn't currently being used, I still think an obvious mistake like this should be corrected.
Signed-off-by Jan Beulich <[email protected]>
arch/x86/xen/mmu.c xmaddr_t arbitrary_virt_to_machine(unsig · line 64
Quoted 6 lines
arch/x86/xen/mmu.c +1
-1@@ -60,7 +60,7 @@ xmaddr_t arbitrary_virt_to_machine(unsig {unsigned int level;pte_t *pte =lookup_address (address, &level); -unsigned offset = address &PAGE_MASK ; +unsigned offset = address & (PAGE_SIZE -1 );
Yeah. But I'd prefer "~PAGE_MASK".
J
Ingo Molnar
Acked-by Jeremy FitzhardingeQuoted 6 lines · Jeremy Fitzhardinge
Quoted 5 lines · Jan Beulich
While I realize that the function isn't currently being used, I still think an obvious mistake like this should be corrected.
Signed-off-by Jan Beulich <[email protected]>
Quoted 11 lines
arch/x86/xen/mmu.c xmaddr_t arbitrary_virt_to_machine(unsig · line 64
Quoted 9 lines
arch/x86/xen/mmu.c +1
-1@@ -60,7 +60,7 @@ xmaddr_t arbitrary_virt_to_machine(unsig {unsigned int level;pte_t *pte =lookup_address (address, &level); -unsigned offset = address &PAGE_MASK ; +unsigned offset = address & (PAGE_SIZE -1 );Yeah. But I'd prefer "~PAGE_MASK".
ok - queued up the patch below in -tip.
Ingo
----------------------->
Subject: x86/xen: fix arbitrary_virt_to_machine()
From: "Jan Beulich" <[email protected]>
Date: Thu, 15 May 2008 13:24:52 +0100
While I realize that the function isn't currently being used, I still think an obvious mistake like this should be corrected.
--- arch/x86/xen/mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/xen/mmu.c +1 -1
@@ -60,7 +60,7 @@ xmaddr_t arbitrary_virt_to_machine(unsig {unsigned int level;pte_t *pte =lookup_address (address, &level); -unsigned offset = address &PAGE_MASK ; +unsigned offset = address & ~PAGE_SIZE ;BUG_ON (pte ==NULL );
arch/x86/xen/mmu.c xmaddr_t arbitrary_virt_to_machine(unsig · line 63
Quoted 5 lines · Ingo Molnar
arch/x86/xen/mmu.c +1
-1unsigned int level;pte_t *pte =lookup_address (address, &level); -unsigned offset = address &PAGE_MASK ; +unsigned offset = address & ~PAGE_SIZE ;
Ah, no, you have the worst of both worlds there ;) Should be ~PAGE_*MASK*.
J
Quoted 8 lines · Jeremy Fitzhardinge
arch/x86/xen/mmu.c xmaddr_t arbitrary_virt_to_machine(unsig · line 63
Quoted 5 lines · Ingo Molnar
arch/x86/xen/mmu.c +1
-1unsigned int level;pte_t *pte =lookup_address (address, &level); -unsigned offset = address &PAGE_MASK ; +unsigned offset = address & ~PAGE_SIZE ;Ah, no, you have the worst of both worlds there ;) Should be ~PAGE_*MASK*.
argh :-) fixed.
Ingo