This series introduces support for AMD's Extended CPU Topology CPUID leaf
(0x80000026) and Bus Lock Detect in QEMU. 

AMD's Extended CPU Topology presents the complete topology information to
guests via a single CPUID with multiple subleafs, each describing a specific
hierarchy level, viz. core, complex, die, socket. 

A new CPU property is added to gate this CPUID to AMD Zen 4+ CPUs. New
versions of EPYC-Genoa and EPYC-Turin are also created to include the
property. Tested the VM migrations with both newer and older CPU versions.

Bus Lock Detect signals when a process has acquired a bus lock. It is
enumerated with cpuid Fn0000_0007_ECX_x0 bit [24 / BUSLOCKTRAP]. It can be
enabled through MSR_IA32_DEBUGCTLMSR. When enabled, hardware clears DR6[11]
and raises a #DB exception on occurrence of Bus Lock if CPL > 0. More detail
about the feature can be found in AMD APM[1]. 

It is enabled for EPYC-Turin-v2. The KVM patch enabling Bus Lock Detect
for SVM can be found here:
https://lore.kernel.org/kvm/[email protected]/

Patches are prepared on master (4481234e).

[1]: AMD64 Architecture Programmer's Manual Pub. 40332, Rev. 4.07 - June
     2023, Vol 2, 13.1.3.6 Bus Lock Trap
     https://bugzilla.kernel.org/attachment.cgi?id=304653

Best regards,
Shivansh
---
Ravi Bangoria (1):
  i386: Add Bus Lock Detect support

Shivansh Dhiman (4):
  i386: Implement CPUID 0x80000026
  i386: Add CPU property x-force-cpuid-0x80000026
  i386: Enable CPUID 80000026 for EPYC-Genoa/Turin vCPU
  i386: Add Bus Lock Detect support for EPYC-Turin-v2 model

 target/i386/cpu.c     | 103 ++++++++++++++++++++++++++++++++++++++++++
 target/i386/cpu.h     |  19 ++++++++
 target/i386/kvm/kvm.c |  21 ++++++++-
 3 files changed, 141 insertions(+), 2 deletions(-)

-- 
2.43.0


Reply via email to