LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* KVM: x86: expose HINTS_REALTIME ablility to qemu
@ 2021-08-13  9:54 Aili Yao
  2021-08-16  6:10 ` Aili Yao
  0 siblings, 1 reply; 2+ messages in thread
From: Aili Yao @ 2021-08-13  9:54 UTC (permalink / raw)
  To: Paolo Bonzini, Sean Christopherson, Vitaly Kuznetsov, Wanpeng Li,
	Jim Mattson, Joerg Roedel, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov
  Cc: yaoaili126, x86, H. Peter Anvin, kvm, linux-kernel

When I do a test that try to enable hint-dedicated for one VM, but qemu
says "warning: host doesn't support requested feature:
CPUID.40000001H:EDX.kvm-hint-dedicated [bit 0]".

It seems the kernel hasn't expose this ability even when supporting it;
So expose it.

Signed-off-by: Aili Yao <yaoaili@kingsoft.com>
---
 arch/x86/kvm/cpuid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
index 739be5da3bca..2153014742d7 100644
--- a/arch/x86/kvm/cpuid.c
+++ b/arch/x86/kvm/cpuid.c
@@ -917,7 +917,7 @@ static inline int __do_cpuid_func(struct kvm_cpuid_array *array, u32 function)
 
 		entry->ebx = 0;
 		entry->ecx = 0;
-		entry->edx = 0;
+		entry->edx = (1 << KVM_HINTS_REALTIME);
 		break;
 	case 0x80000000:
 		entry->eax = min(entry->eax, 0x8000001f);
-- 
2.25.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: KVM: x86: expose HINTS_REALTIME ablility to qemu
  2021-08-13  9:54 KVM: x86: expose HINTS_REALTIME ablility to qemu Aili Yao
@ 2021-08-16  6:10 ` Aili Yao
  0 siblings, 0 replies; 2+ messages in thread
From: Aili Yao @ 2021-08-16  6:10 UTC (permalink / raw)
  To: Paolo Bonzini, Sean Christopherson, Vitaly Kuznetsov, Wanpeng Li,
	Jim Mattson, Joerg Roedel, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov
  Cc: yaoaili126, x86, H. Peter Anvin, kvm, linux-kernel

On Fri, 13 Aug 2021 17:54:20 +0800
Aili Yao <yaoaili@kingsoft.com> wrote:

> When I do a test that try to enable hint-dedicated for one VM, but qemu
> says "warning: host doesn't support requested feature:
> CPUID.40000001H:EDX.kvm-hint-dedicated [bit 0]".
> 
> It seems the kernel hasn't expose this ability even when supporting it;
> So expose it.

Sorry, I check it again:
Ihe issue I met is because of my qemu's mis-backport,

In qemu, kvm_arch_get_supported_cpuid() will set the feature bit:
    if (function == KVM_CPUID_FEATURES && reg == R_EDX) {
        ret |= KVM_HINTS_DEDICATED;
        found = 1;
    }
But I have mis-ported the KVM_HINTS_DEDICATED and KVM_HINTS_REALTIME macro; And it lead to
the error I met;

And it's right that kernel don't expose this ability!

Sorry again!


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-16  6:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-13  9:54 KVM: x86: expose HINTS_REALTIME ablility to qemu Aili Yao
2021-08-16  6:10 ` Aili Yao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).