Skip to content

Commit 06e878b

Browse files
Qiangcybonzini
authored andcommitted
target/i386: Add bus lock debug exception support
Bus lock debug exception is a feature that can notify the kernel by generate an #DB trap after the instruction acquires a bus lock when CPL>0. This allows the kernel to enforce user application throttling or mitigations. This feature is enumerated via CPUID.(EAX=7,ECX=0).ECX[bit 24]. Signed-off-by: Chenyi Qiang <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 3a2e982 commit 06e878b

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

target/i386/cpu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -963,7 +963,7 @@ static FeatureWordInfo feature_word_info[FEATURE_WORDS] = {
963963
"avx512bitalg", NULL, "avx512-vpopcntdq", NULL,
964964
"la57", NULL, NULL, NULL,
965965
NULL, NULL, "rdpid", NULL,
966-
NULL, "cldemote", NULL, "movdiri",
966+
"bus-lock-detect", "cldemote", NULL, "movdiri",
967967
"movdir64b", NULL, NULL, "pks",
968968
},
969969
.cpuid = {

target/i386/cpu.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,8 @@ typedef uint64_t FeatureWordArray[FEATURE_WORDS];
769769
#define CPUID_7_0_ECX_LA57 (1U << 16)
770770
/* Read Processor ID */
771771
#define CPUID_7_0_ECX_RDPID (1U << 22)
772+
/* Bus Lock Debug Exception */
773+
#define CPUID_7_0_ECX_BUS_LOCK_DETECT (1U << 24)
772774
/* Cache Line Demote Instruction */
773775
#define CPUID_7_0_ECX_CLDEMOTE (1U << 25)
774776
/* Move Doubleword as Direct Store Instruction */

0 commit comments

Comments
 (0)