* [PATCH] x86/xen: fix arbitrary_virt_to_machine()
@ 2008-05-15 12:24 Jan Beulich
2008-05-15 12:58 ` Jeremy Fitzhardinge
0 siblings, 1 reply; 5+ messages in thread
From: Jan Beulich @ 2008-05-15 12:24 UTC (permalink / raw)
To: mingo, Jeremy Fitzhardinge, tglx, hpa; +Cc: linux-kernel
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 <jbeulich@novell.com>
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -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);
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] x86/xen: fix arbitrary_virt_to_machine()
2008-05-15 12:24 [PATCH] x86/xen: fix arbitrary_virt_to_machine() Jan Beulich
@ 2008-05-15 12:58 ` Jeremy Fitzhardinge
2008-05-16 12:09 ` Ingo Molnar
0 siblings, 1 reply; 5+ messages in thread
From: Jeremy Fitzhardinge @ 2008-05-15 12:58 UTC (permalink / raw)
To: Jan Beulich; +Cc: mingo, tglx, hpa, linux-kernel
Jan Beulich wrote:
> 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 <jbeulich@novell.com>
>
> --- a/arch/x86/xen/mmu.c
> +++ b/arch/x86/xen/mmu.c
> @@ -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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] x86/xen: fix arbitrary_virt_to_machine()
2008-05-15 12:58 ` Jeremy Fitzhardinge
@ 2008-05-16 12:09 ` Ingo Molnar
2008-05-16 13:00 ` Jeremy Fitzhardinge
0 siblings, 1 reply; 5+ messages in thread
From: Ingo Molnar @ 2008-05-16 12:09 UTC (permalink / raw)
To: Jeremy Fitzhardinge; +Cc: Jan Beulich, tglx, hpa, linux-kernel
* Jeremy Fitzhardinge <jeremy@goop.org> wrote:
> Jan Beulich wrote:
>> 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 <jbeulich@novell.com>
>>
>> --- a/arch/x86/xen/mmu.c
>> +++ b/arch/x86/xen/mmu.c
>> @@ -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" <jbeulich@novell.com>
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.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Acked-by: Jeremy Fitzhardinge <jeremy@goop.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/xen/mmu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: linux/arch/x86/xen/mmu.c
===================================================================
--- linux.orig/arch/x86/xen/mmu.c
+++ linux/arch/x86/xen/mmu.c
@@ -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);
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] x86/xen: fix arbitrary_virt_to_machine()
2008-05-16 12:09 ` Ingo Molnar
@ 2008-05-16 13:00 ` Jeremy Fitzhardinge
2008-05-16 13:06 ` Ingo Molnar
0 siblings, 1 reply; 5+ messages in thread
From: Jeremy Fitzhardinge @ 2008-05-16 13:00 UTC (permalink / raw)
To: Ingo Molnar; +Cc: Jan Beulich, tglx, hpa, linux-kernel
Ingo Molnar wrote:
> unsigned 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] x86/xen: fix arbitrary_virt_to_machine()
2008-05-16 13:00 ` Jeremy Fitzhardinge
@ 2008-05-16 13:06 ` Ingo Molnar
0 siblings, 0 replies; 5+ messages in thread
From: Ingo Molnar @ 2008-05-16 13:06 UTC (permalink / raw)
To: Jeremy Fitzhardinge; +Cc: Jan Beulich, tglx, hpa, linux-kernel
* Jeremy Fitzhardinge <jeremy@goop.org> wrote:
> Ingo Molnar wrote:
>> unsigned 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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-05-16 13:06 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-15 12:24 [PATCH] x86/xen: fix arbitrary_virt_to_machine() Jan Beulich
2008-05-15 12:58 ` Jeremy Fitzhardinge
2008-05-16 12:09 ` Ingo Molnar
2008-05-16 13:00 ` Jeremy Fitzhardinge
2008-05-16 13:06 ` Ingo Molnar
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.