* [PATCH] qemu: fix cpuid eax for kvm cpu
@ 2012-04-30 14:42 Michael S. Tsirkin
2012-05-01 12:38 ` Avi Kivity
0 siblings, 1 reply; 4+ messages in thread
From: Michael S. Tsirkin @ 2012-04-30 14:42 UTC (permalink / raw)
To: Avi Kivity, Marcelo Tosatti, qemu-devel, kvm; +Cc: davej
cpuid eax should return the max leaf so that
guests can find out the valid range.
This matches Xen et al.
Tested using -cpu kvm64.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
target-i386/kvm.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index e74a9e4..c097248 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -379,7 +379,7 @@ int kvm_arch_init_vcpu(CPUX86State *env)
c->function = KVM_CPUID_SIGNATURE;
if (!hyperv_enabled()) {
memcpy(signature, "KVMKVMKVM\0\0\0", 12);
- c->eax = 0;
+ c->eax = KVM_CPUID_FEATURES;
} else {
memcpy(signature, "Microsoft Hv", 12);
c->eax = HYPERV_CPUID_MIN;
--
MST
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] qemu: fix cpuid eax for kvm cpu
2012-04-30 14:42 [PATCH] qemu: fix cpuid eax for kvm cpu Michael S. Tsirkin
@ 2012-05-01 12:38 ` Avi Kivity
2012-05-01 12:49 ` Michael S. Tsirkin
0 siblings, 1 reply; 4+ messages in thread
From: Avi Kivity @ 2012-05-01 12:38 UTC (permalink / raw)
To: Michael S. Tsirkin; +Cc: Marcelo Tosatti, qemu-devel, kvm, davej
On 04/30/2012 05:42 PM, Michael S. Tsirkin wrote:
> cpuid eax should return the max leaf so that
> guests can find out the valid range.
> This matches Xen et al.
>
> Tested using -cpu kvm64.
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
> target-i386/kvm.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/target-i386/kvm.c b/target-i386/kvm.c
> index e74a9e4..c097248 100644
> --- a/target-i386/kvm.c
> +++ b/target-i386/kvm.c
> @@ -379,7 +379,7 @@ int kvm_arch_init_vcpu(CPUX86State *env)
> c->function = KVM_CPUID_SIGNATURE;
> if (!hyperv_enabled()) {
> memcpy(signature, "KVMKVMKVM\0\0\0", 12);
> - c->eax = 0;
> + c->eax = KVM_CPUID_FEATURES;
> } else {
> memcpy(signature, "Microsoft Hv", 12);
> c->eax = HYPERV_CPUID_MIN;
Should only change for -M 1.1+?
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] qemu: fix cpuid eax for kvm cpu
2012-05-01 12:38 ` Avi Kivity
@ 2012-05-01 12:49 ` Michael S. Tsirkin
2012-05-01 13:02 ` Avi Kivity
0 siblings, 1 reply; 4+ messages in thread
From: Michael S. Tsirkin @ 2012-05-01 12:49 UTC (permalink / raw)
To: Avi Kivity; +Cc: Marcelo Tosatti, qemu-devel, kvm, davej
On Tue, May 01, 2012 at 03:38:43PM +0300, Avi Kivity wrote:
> On 04/30/2012 05:42 PM, Michael S. Tsirkin wrote:
> > cpuid eax should return the max leaf so that
> > guests can find out the valid range.
> > This matches Xen et al.
> >
> > Tested using -cpu kvm64.
> >
> > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> > ---
> > target-i386/kvm.c | 2 +-
> > 1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/target-i386/kvm.c b/target-i386/kvm.c
> > index e74a9e4..c097248 100644
> > --- a/target-i386/kvm.c
> > +++ b/target-i386/kvm.c
> > @@ -379,7 +379,7 @@ int kvm_arch_init_vcpu(CPUX86State *env)
> > c->function = KVM_CPUID_SIGNATURE;
> > if (!hyperv_enabled()) {
> > memcpy(signature, "KVMKVMKVM\0\0\0", 12);
> > - c->eax = 0;
> > + c->eax = KVM_CPUID_FEATURES;
> > } else {
> > memcpy(signature, "Microsoft Hv", 12);
> > c->eax = HYPERV_CPUID_MIN;
>
> Should only change for -M 1.1+?
I don't think we should: it's a bug fix and we don't try to be bug for
bug compatible unless fixing the bug actually affects guest behaviour.
> --
> error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] qemu: fix cpuid eax for kvm cpu
2012-05-01 12:49 ` Michael S. Tsirkin
@ 2012-05-01 13:02 ` Avi Kivity
0 siblings, 0 replies; 4+ messages in thread
From: Avi Kivity @ 2012-05-01 13:02 UTC (permalink / raw)
To: Michael S. Tsirkin; +Cc: Marcelo Tosatti, qemu-devel, kvm, davej
On 05/01/2012 03:49 PM, Michael S. Tsirkin wrote:
> On Tue, May 01, 2012 at 03:38:43PM +0300, Avi Kivity wrote:
> > On 04/30/2012 05:42 PM, Michael S. Tsirkin wrote:
> > > cpuid eax should return the max leaf so that
> > > guests can find out the valid range.
> > > This matches Xen et al.
> > >
> > > Tested using -cpu kvm64.
> > >
> > > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> > > ---
> > > target-i386/kvm.c | 2 +-
> > > 1 files changed, 1 insertions(+), 1 deletions(-)
> > >
> > > diff --git a/target-i386/kvm.c b/target-i386/kvm.c
> > > index e74a9e4..c097248 100644
> > > --- a/target-i386/kvm.c
> > > +++ b/target-i386/kvm.c
> > > @@ -379,7 +379,7 @@ int kvm_arch_init_vcpu(CPUX86State *env)
> > > c->function = KVM_CPUID_SIGNATURE;
> > > if (!hyperv_enabled()) {
> > > memcpy(signature, "KVMKVMKVM\0\0\0", 12);
> > > - c->eax = 0;
> > > + c->eax = KVM_CPUID_FEATURES;
> > > } else {
> > > memcpy(signature, "Microsoft Hv", 12);
> > > c->eax = HYPERV_CPUID_MIN;
> >
> > Should only change for -M 1.1+?
>
> I don't think we should: it's a bug fix and we don't try to be bug for
> bug compatible unless fixing the bug actually affects guest behaviour.
>
I agree.
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-05-01 13:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-30 14:42 [PATCH] qemu: fix cpuid eax for kvm cpu Michael S. Tsirkin
2012-05-01 12:38 ` Avi Kivity
2012-05-01 12:49 ` Michael S. Tsirkin
2012-05-01 13:02 ` Avi Kivity
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox