mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] KVM: pass through CPUID 0x80000005
@ 2023-07-12 18:31 Takahiro Itazuri
  2023-08-03  0:04 ` Sean Christopherson
  0 siblings, 1 reply; 2+ messages in thread
From: Takahiro Itazuri @ 2023-07-12 18:31 UTC (permalink / raw)
  To: Sean Christopherson, Paolo Bonzini, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, Dave Hansen, x86, H . Peter Anvin, kvm,
	linux-kernel
  Cc: Takahiro Itazuri, Takahiro Itazuri

Pass CPUID 0x80000005 (L1 cache and TLB info).

CPUID 0x80000006 (L2 cache and TLB and L3 cache info) has been returned
since commit 43d05de2bee7 ("KVM: pass through CPUID(0x80000006)").
Enumerating both 0x80000005 and 0x80000006 with KVM_GET_SUPPORTED_CPUID
would be better than reporting either, and 0x80000005 could be helpful
for VMM to pass it to KVM_SET_CPUID{,2} for the same reason with
0x80000006..

Signed-off-by: Takahiro Itazuri <itazur@amazon.com>
---

Discussion was made a bit on
https://lore.kernel.org/all/20230712170258.75355-1-itazur@amazon.com/.
If there is any reason that leaf 0x80000005 should not be enumerated or
dropping leaf 0x80000006 is preferred, please feel free to share your
thoughts.

---
 arch/x86/kvm/cpuid.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
index 0c9660a07b23..54a5b256c484 100644
--- a/arch/x86/kvm/cpuid.c
+++ b/arch/x86/kvm/cpuid.c
@@ -1152,6 +1152,9 @@ static inline int __do_cpuid_func(struct kvm_cpuid_array *array, u32 function)
 		cpuid_entry_override(entry, CPUID_8000_0001_EDX);
 		cpuid_entry_override(entry, CPUID_8000_0001_ECX);
 		break;
+	case 0x80000005:
+		/*  Pass host L1 cache and TLB info. */
+		break;
 	case 0x80000006:
 		/* Drop reserved bits, pass host L2 cache and TLB info. */
 		entry->edx &= ~GENMASK(17, 16);
-- 
2.38.0


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

* Re: [PATCH] KVM: pass through CPUID 0x80000005
  2023-07-12 18:31 [PATCH] KVM: pass through CPUID 0x80000005 Takahiro Itazuri
@ 2023-08-03  0:04 ` Sean Christopherson
  0 siblings, 0 replies; 2+ messages in thread
From: Sean Christopherson @ 2023-08-03  0:04 UTC (permalink / raw)
  To: Sean Christopherson, Paolo Bonzini, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, Dave Hansen, x86, H . Peter Anvin, kvm,
	linux-kernel, Takahiro Itazuri
  Cc: Takahiro Itazuri

On Wed, 12 Jul 2023 19:31:36 +0100, Takahiro Itazuri wrote:
> Pass CPUID 0x80000005 (L1 cache and TLB info).
> 
> CPUID 0x80000006 (L2 cache and TLB and L3 cache info) has been returned
> since commit 43d05de2bee7 ("KVM: pass through CPUID(0x80000006)").
> Enumerating both 0x80000005 and 0x80000006 with KVM_GET_SUPPORTED_CPUID
> would be better than reporting either, and 0x80000005 could be helpful
> for VMM to pass it to KVM_SET_CPUID{,2} for the same reason with
> 0x80000006..
> 
> [...]

Applied to kvm-x86 misc, thanks!

[1/1] KVM: pass through CPUID 0x80000005
      https://github.com/kvm-x86/linux/commit/af8e2ccfa6f1

--
https://github.com/kvm-x86/linux/tree/next
https://github.com/kvm-x86/linux/tree/fixes

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

end of thread, other threads:[~2023-08-03  0:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-12 18:31 [PATCH] KVM: pass through CPUID 0x80000005 Takahiro Itazuri
2023-08-03  0:04 ` Sean Christopherson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome