Re: [PATCH RFC 01/39] KVM: x86: fix Xen hypercall page msr handling

2020-11-30 Thread David Woodhouse
On Mon, 2020-11-30 at 12:03 +0100, Paolo Bonzini wrote: > You can use CPUID too (search for Hv#1 in leaf 0x4000)? That's leaf 0x4001. Which is also the leaf used for Xen to indicate the Xen version. So as long as we don't pretend to be Xen version 12759.30280 I suppose that's OK. Or we

Re: [PATCH RFC 01/39] KVM: x86: fix Xen hypercall page msr handling

2020-11-30 Thread Paolo Bonzini
On 30/11/20 11:39, David Woodhouse wrote: ... except that's a bit icky because that trick of falling through to the default case only works for *one* case statement. And more to the point, the closest thing I can find to a 'kvm_hyperv_enabled()' flag is what we do for setting the

Re: [PATCH RFC 01/39] KVM: x86: fix Xen hypercall page msr handling

2020-11-30 Thread David Woodhouse
On Fri, 2019-02-22 at 13:51 +0100, Paolo Bonzini wrote: > On 22/02/19 02:30, Sean Christopherson wrote: > >if (kvm_advertise_kvm()) { > >if () > >return ...; > >} else if (kvm_advertise_hyperv()) { > >if () > >

Re: [PATCH RFC 01/39] KVM: x86: fix Xen hypercall page msr handling

2019-02-22 Thread Paolo Bonzini
On 22/02/19 02:30, Sean Christopherson wrote: > if (kvm_advertise_kvm()) { > if () > return ...; > } else if (kvm_advertise_hyperv()) { > if () > return ...; > } else if (kvm_advertise_xen()) { >

Re: [PATCH RFC 01/39] KVM: x86: fix Xen hypercall page msr handling

2019-02-22 Thread Joao Martins
On 2/22/19 1:30 AM, Sean Christopherson wrote: > On Wed, Feb 20, 2019 at 08:15:31PM +, Joao Martins wrote: >> Xen usually places its MSR at 0x400 or 0x4000200 depending on >> whether it is running in viridian mode or not. Note that this is not >> ABI guaranteed, so it is possible for Xen

Re: [PATCH RFC 01/39] KVM: x86: fix Xen hypercall page msr handling

2019-02-21 Thread Sean Christopherson
On Wed, Feb 20, 2019 at 08:15:31PM +, Joao Martins wrote: > Xen usually places its MSR at 0x400 or 0x4000200 depending on > whether it is running in viridian mode or not. Note that this is not > ABI guaranteed, so it is possible for Xen to advertise the MSR some > place else. > > Given

[PATCH RFC 01/39] KVM: x86: fix Xen hypercall page msr handling

2019-02-20 Thread Joao Martins
Xen usually places its MSR at 0x400 or 0x4000200 depending on whether it is running in viridian mode or not. Note that this is not ABI guaranteed, so it is possible for Xen to advertise the MSR some place else. Given the way xen_hvm_config() is handled, if the former address is selected, this