Re: [PATCH] KVM: Fix MAXPHYADDR calculation when cpuid does not support it

2010-04-12 Thread Marcelo Tosatti
On Sun, Apr 11, 2010 at 03:33:32PM +0300, Avi Kivity wrote: > MAXPHYADDR is derived from cpuid 0x8008, but when that isn't present, we > get some random value. > > Fix by checking first that cpuid 0x8008 is supported. > > Pekka Enberg > Signed-off-by: Avi Kivity Applied, thanks. -- To

Re: [PATCH] KVM: Fix MAXPHYADDR calculation when cpuid does not support it

2010-04-11 Thread Pekka Enberg
Avi Kivity wrote: OK, then it's a bug of my own doing and we don't need to do anything in the kernel. I think the patch is nevertheless correct, not sure why it worked so far. Yes, agreed. I'm guessing most 64-bit CPUs support 0x8008 and qemu does the right thing so the bug doesn't trig

Re: [PATCH] KVM: Fix MAXPHYADDR calculation when cpuid does not support it

2010-04-11 Thread Avi Kivity
On 04/11/2010 04:53 PM, Pekka Enberg wrote: Avi Kivity wrote: On 04/11/2010 04:45 PM, Pekka Enberg wrote: Pekka Enberg wrote: Avi Kivity wrote: Hmm, doesn't seem to work here. I still that triple fault in guest. Can you add a printk to see what value is returned and why? Argh, it's a off-

Re: [PATCH] KVM: Fix MAXPHYADDR calculation when cpuid does not support it

2010-04-11 Thread Pekka Enberg
Avi Kivity wrote: On 04/11/2010 04:45 PM, Pekka Enberg wrote: Pekka Enberg wrote: Avi Kivity wrote: Hmm, doesn't seem to work here. I still that triple fault in guest. Can you add a printk to see what value is returned and why? Argh, it's a off-by one bug in my userspace tool... So the CPU

Re: [PATCH] KVM: Fix MAXPHYADDR calculation when cpuid does not support it

2010-04-11 Thread Avi Kivity
On 04/11/2010 04:45 PM, Pekka Enberg wrote: Pekka Enberg wrote: Avi Kivity wrote: Hmm, doesn't seem to work here. I still that triple fault in guest. Can you add a printk to see what value is returned and why? Argh, it's a off-by one bug in my userspace tool... So the CPU really does suppo

Re: [PATCH] KVM: Fix MAXPHYADDR calculation when cpuid does not support it

2010-04-11 Thread Pekka Enberg
Pekka Enberg wrote: Avi Kivity wrote: Hmm, doesn't seem to work here. I still that triple fault in guest. Can you add a printk to see what value is returned and why? Argh, it's a off-by one bug in my userspace tool... So the CPU really does support 0x8008 and I'm just an idiot. :-) So

Re: [PATCH] KVM: Fix MAXPHYADDR calculation when cpuid does not support it

2010-04-11 Thread Pekka Enberg
Avi Kivity wrote: Hmm, doesn't seem to work here. I still that triple fault in guest. Can you add a printk to see what value is returned and why? Argh, it's a off-by one bug in my userspace tool... So the CPU really does support 0x8008 and I'm just an idiot. :-)

Re: [PATCH] KVM: Fix MAXPHYADDR calculation when cpuid does not support it

2010-04-11 Thread Avi Kivity
On 04/11/2010 04:32 PM, Pekka Enberg wrote: Avi Kivity wrote: MAXPHYADDR is derived from cpuid 0x8008, but when that isn't present, we get some random value. Fix by checking first that cpuid 0x8008 is supported. Pekka Enberg Signed-off-by: Avi Kivity --- arch/x86/kvm/x86.c |4 +

Re: [PATCH] KVM: Fix MAXPHYADDR calculation when cpuid does not support it

2010-04-11 Thread Pekka Enberg
Avi Kivity wrote: MAXPHYADDR is derived from cpuid 0x8008, but when that isn't present, we get some random value. Fix by checking first that cpuid 0x8008 is supported. Pekka Enberg Signed-off-by: Avi Kivity --- arch/x86/kvm/x86.c |4 1 files changed, 4 insertions(+), 0 delet

Re: [PATCH] KVM: Fix MAXPHYADDR calculation when cpuid does not support it

2010-04-11 Thread Avi Kivity
On 04/11/2010 03:33 PM, Avi Kivity wrote: MAXPHYADDR is derived from cpuid 0x8008, but when that isn't present, we get some random value. Fix by checking first that cpuid 0x8008 is supported. Pekka Enberg ^ += Reported-by: (looking forward to Tested-by: too) -- error compiling co

[PATCH] KVM: Fix MAXPHYADDR calculation when cpuid does not support it

2010-04-11 Thread Avi Kivity
MAXPHYADDR is derived from cpuid 0x8008, but when that isn't present, we get some random value. Fix by checking first that cpuid 0x8008 is supported. Pekka Enberg Signed-off-by: Avi Kivity --- arch/x86/kvm/x86.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git