KVM: x86: Allow ARAT CPU feature
PATCH 1/1 KVM: x86: Allow ARAT CPU feature
From: Jan Kiszka <[email protected]>
There is no reason to deny this feature to guests. We are emulating the APIC timer, thus are exposing it without stops in power-saving states.
--- arch/x86/kvm/cpuid.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
arch/x86/kvm/cpuid.c +6 -1
@@ -411,6 +411,12 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function, }break ; } +case 6 :/* Thermal management */ + entry->eax =0x4 ;/* allow ARAT */ + entry->ebx =0 ; + entry->ecx =0 ; + entry->edx =0 ; +break ;case 7 : { entry->flags |=KVM_CPUID_FLAG_SIGNIFCANT_INDEX ;/* Mask ebx against host capability word 9 */
@@ -587,7 +593,6 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,break ;case 3 :/* Processor serial number */ case 5 :/* MONITOR/MWAIT */ -case 6 :/* Thermal management */ case 0xC0000002 :case 0xC0000003 :case 0xC0000004 :
Paolo Bonzini
maintainer-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Quoted 7 lines · Jan Kiszka
From: Jan Kiszka <[email protected]>
There is no reason to deny this feature to guests. We are emulating the APIC timer, thus are exposing it without stops in power-saving states.
Signed-off-by Jan Kiszka <[email protected]>
Thanks, looks good.
Paolo
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQEcBAEBCAAGBQJVYyJyAAoJEL/70l94x66DuA8H/isaX6grqCJRUAj15LJAJJrw nP39iVN+pMcmivoOxWRzIJspZerb06pEZMWAlSaxdkykYVkD23agCqXGBbFO1YTX pB3X4y+5TPbhwxkJs0ElusThUr0R/I4Y5Nj9rwfA13+JA9IRDJhlAZJKfQvNFNqj Q8PV/JD/c1ScWFsfVys9oZfjFKa5Wg9js9ayeWP0dLKiLRNQC/6LJJwHPN9zOouP tYf6HejpHqybF89g7nLfP3ihIPHHoIWtn8pikBN+idCqB7szpwNpBoe0RVcCDA7k 3rdJk6zGxss7Fruw3qVtKk5ze9u5H4kCrLovOGgboYvRYC5flS/0y/zH/4dHiOQ= =/JKw
-----END PGP SIGNATURE-----
Quoted 8 lines · Paolo Bonzini
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256Quoted 2 lines · Jan Kiszka
From: Jan Kiszka <[email protected]>
Quoted 8 lines
Quoted 5 lines
There is no reason to deny this feature to guests. We are emulating the APIC timer, thus are exposing it without stops in power-saving states.
Signed-off-by Jan Kiszka <[email protected]>Thanks, looks good.
What's the motivation of exposing ARAT to guests?
Thanks
-Yong
Quoted 13 lines · Yong Wang
Quoted 12 lines · Paolo Bonzini
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256Quoted 6 lines · Jan Kiszka
From: Jan Kiszka <[email protected]>
There is no reason to deny this feature to guests. We are emulating the APIC timer, thus are exposing it without stops in power-saving states.
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Signed-off-by Jan Kiszka <[email protected]>Thanks, looks good.
What's the motivation of exposing ARAT to guests?
First of all, another step towards feature correctness for real CPU models. But I also have a setup where Linux only has APICs as clockevents (Jailhouse non-root cells), thus has no broadcast source. In that case it depends on ARAT to switch to highres mode.
Jan