Re: [PATCH] KVM: X86: Expose KVM_HINTS_REALTIME in KVM_GET_SUPPORTED_CPUID

2020-10-23 Thread Jim Mattson
On Fri, Oct 23, 2020 at 2:07 AM Paolo Bonzini wrote: > > On 22/10/20 19:13, Jim Mattson wrote: > > We don't actually use KVM_GET_SUPPORTED_CPUID at all today. If it's > > commonly being misinterpreted as you say, perhaps we should add a > > KVM_GET_TRUE_SUPPORTED_CPUID ioctl. Or, perhaps we can

Re: [PATCH] KVM: X86: Expose KVM_HINTS_REALTIME in KVM_GET_SUPPORTED_CPUID

2020-10-23 Thread Paolo Bonzini
On 22/10/20 19:13, Jim Mattson wrote: > We don't actually use KVM_GET_SUPPORTED_CPUID at all today. If it's > commonly being misinterpreted as you say, perhaps we should add a > KVM_GET_TRUE_SUPPORTED_CPUID ioctl. Or, perhaps we can just fix this > in the documentation? Yes, I think we should fix

Re: [PATCH] KVM: X86: Expose KVM_HINTS_REALTIME in KVM_GET_SUPPORTED_CPUID

2020-10-22 Thread Wanpeng Li
On Thu, 22 Oct 2020 at 21:02, Paolo Bonzini wrote: > > On 22/10/20 03:34, Wanpeng Li wrote: > > From: Wanpeng Li > > > > Per KVM_GET_SUPPORTED_CPUID ioctl documentation: > > > > This ioctl returns x86 cpuid features which are supported by both the > > hardware and kvm in its default

Re: [PATCH] KVM: X86: Expose KVM_HINTS_REALTIME in KVM_GET_SUPPORTED_CPUID

2020-10-22 Thread Jim Mattson
On Thu, Oct 22, 2020 at 9:37 AM Paolo Bonzini wrote: > > On 22/10/20 18:35, Jim Mattson wrote: > > On Thu, Oct 22, 2020 at 6:02 AM Paolo Bonzini wrote: > >> > >> On 22/10/20 03:34, Wanpeng Li wrote: > >>> From: Wanpeng Li > >>> > >>> Per KVM_GET_SUPPORTED_CPUID ioctl documentation: > >>> > >>>

Re: [PATCH] KVM: X86: Expose KVM_HINTS_REALTIME in KVM_GET_SUPPORTED_CPUID

2020-10-22 Thread Paolo Bonzini
On 22/10/20 18:35, Jim Mattson wrote: > On Thu, Oct 22, 2020 at 6:02 AM Paolo Bonzini wrote: >> >> On 22/10/20 03:34, Wanpeng Li wrote: >>> From: Wanpeng Li >>> >>> Per KVM_GET_SUPPORTED_CPUID ioctl documentation: >>> >>> This ioctl returns x86 cpuid features which are supported by both the >>>

Re: [PATCH] KVM: X86: Expose KVM_HINTS_REALTIME in KVM_GET_SUPPORTED_CPUID

2020-10-22 Thread Jim Mattson
On Thu, Oct 22, 2020 at 6:02 AM Paolo Bonzini wrote: > > On 22/10/20 03:34, Wanpeng Li wrote: > > From: Wanpeng Li > > > > Per KVM_GET_SUPPORTED_CPUID ioctl documentation: > > > > This ioctl returns x86 cpuid features which are supported by both the > > hardware and kvm in its default

Re: [PATCH] KVM: X86: Expose KVM_HINTS_REALTIME in KVM_GET_SUPPORTED_CPUID

2020-10-22 Thread Paolo Bonzini
On 22/10/20 16:28, Xiaoyao Li wrote: > On 10/22/2020 10:06 PM, Paolo Bonzini wrote: >> On 22/10/20 15:31, Xiaoyao Li wrote: It's common for userspace to copy all supported CPUID bits to KVM_SET_CPUID2, I don't think this is the right behavior for KVM_HINTS_REALTIME. >>> >>> It

Re: [PATCH] KVM: X86: Expose KVM_HINTS_REALTIME in KVM_GET_SUPPORTED_CPUID

2020-10-22 Thread Xiaoyao Li
On 10/22/2020 10:06 PM, Paolo Bonzini wrote: On 22/10/20 15:31, Xiaoyao Li wrote: It's common for userspace to copy all supported CPUID bits to KVM_SET_CPUID2, I don't think this is the right behavior for KVM_HINTS_REALTIME. It reminds of X86_FEATURE_WAITPKG, which is added to supported

Re: [PATCH] KVM: X86: Expose KVM_HINTS_REALTIME in KVM_GET_SUPPORTED_CPUID

2020-10-22 Thread Paolo Bonzini
On 22/10/20 15:31, Xiaoyao Li wrote: >> >> It's common for userspace to copy all supported CPUID bits to >> KVM_SET_CPUID2, I don't think this is the right behavior for >> KVM_HINTS_REALTIME. > > It reminds of X86_FEATURE_WAITPKG, which is added to supported CPUID > recently as a fix but QEMU

Re: [PATCH] KVM: X86: Expose KVM_HINTS_REALTIME in KVM_GET_SUPPORTED_CPUID

2020-10-22 Thread Xiaoyao Li
On 10/22/2020 9:02 PM, Paolo Bonzini wrote: On 22/10/20 03:34, Wanpeng Li wrote: From: Wanpeng Li Per KVM_GET_SUPPORTED_CPUID ioctl documentation: This ioctl returns x86 cpuid features which are supported by both the hardware and kvm in its default configuration. A well-behaved userspace

Re: [PATCH] KVM: X86: Expose KVM_HINTS_REALTIME in KVM_GET_SUPPORTED_CPUID

2020-10-22 Thread Vitaly Kuznetsov
Paolo Bonzini writes: > On 22/10/20 03:34, Wanpeng Li wrote: >> From: Wanpeng Li >> >> Per KVM_GET_SUPPORTED_CPUID ioctl documentation: >> >> This ioctl returns x86 cpuid features which are supported by both the >> hardware and kvm in its default configuration. >> >> A well-behaved

Re: [PATCH] KVM: X86: Expose KVM_HINTS_REALTIME in KVM_GET_SUPPORTED_CPUID

2020-10-22 Thread Paolo Bonzini
On 22/10/20 03:34, Wanpeng Li wrote: > From: Wanpeng Li > > Per KVM_GET_SUPPORTED_CPUID ioctl documentation: > > This ioctl returns x86 cpuid features which are supported by both the > hardware and kvm in its default configuration. > > A well-behaved userspace should not set the bit if it is

[PATCH] KVM: X86: Expose KVM_HINTS_REALTIME in KVM_GET_SUPPORTED_CPUID

2020-10-21 Thread Wanpeng Li
From: Wanpeng Li Per KVM_GET_SUPPORTED_CPUID ioctl documentation: This ioctl returns x86 cpuid features which are supported by both the hardware and kvm in its default configuration. A well-behaved userspace should not set the bit if it is not supported. Suggested-by: Jim Mattson