Skip to content

Commit a9dc9ec

Browse files
kimphillamdbp3tk0v
authored andcommitted
x86/cpu, kvm: Add the NO_NESTED_DATA_BP feature
The "Processor ignores nested data breakpoints" feature was being open-coded for KVM. Add the feature to its newly introduced CPUID leaf 0x80000021 EAX proper. Signed-off-by: Kim Phillips <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Acked-by: Sean Christopherson <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent c35ac8c commit a9dc9ec

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

arch/x86/include/asm/cpufeatures.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,9 @@
427427
#define X86_FEATURE_V_TSC_AUX (19*32+ 9) /* "" Virtual TSC_AUX */
428428
#define X86_FEATURE_SME_COHERENT (19*32+10) /* "" AMD hardware-enforced cache coherency */
429429

430+
/* AMD-defined Extended Feature 2 EAX, CPUID level 0x80000021 (EAX), word 20 */
431+
#define X86_FEATURE_NO_NESTED_DATA_BP (20*32+ 0) /* "" No Nested Data Breakpoints */
432+
430433
/*
431434
* BUG word(s)
432435
*/

arch/x86/kvm/cpuid.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ void kvm_set_cpu_caps(void)
742742
F(SME_COHERENT));
743743

744744
kvm_cpu_cap_mask(CPUID_8000_0021_EAX,
745-
BIT(0) /* NO_NESTED_DATA_BP */ |
745+
F(NO_NESTED_DATA_BP) |
746746
BIT(2) /* LFENCE Always serializing */ | 0 /* SmmPgCfgLock */ |
747747
BIT(6) /* NULL_SEL_CLR_BASE */ | 0 /* PrefetchCtlMsr */
748748
);

0 commit comments

Comments
 (0)