Skip to content

Commit a6c1b79

Browse files
mdouchapevik
authored andcommitted
kvm_x86: Define CR0 flags and additional CPUID/MSR constants
Link: https://lore.kernel.org/ltp/[email protected]/ Reviewed-by: Petr Vorel <[email protected]> Signed-off-by: Martin Doucha <[email protected]>
1 parent 097786b commit a6c1b79

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

testcases/kernel/kvm/include/kvm_x86.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,14 @@
6262

6363

6464
/* CPUID constants */
65+
#define CPUID_GET_MODEL_INFO 0x1
6566
#define CPUID_GET_INPUT_RANGE 0x80000000
6667
#define CPUID_GET_EXT_FEATURES 0x80000001
6768
#define CPUID_GET_SVM_FEATURES 0x8000000a
6869

6970

7071
/* Model-specific CPU register constants */
72+
#define MSR_IA32_FEATURE_CONTROL 0x3a
7173
#define MSR_SYSENTER_CS 0x174
7274
#define MSR_SYSENTER_ESP 0x175
7375
#define MSR_SYSENTER_EIP 0x176
@@ -95,6 +97,18 @@
9597
#define VM_CR_SVMDIS (1 << 4)
9698

9799
/* Control register constants */
100+
#define CR0_PE (1 << 0)
101+
#define CR0_MP (1 << 1)
102+
#define CR0_EM (1 << 2)
103+
#define CR0_TS (1 << 3)
104+
#define CR0_ET (1 << 4)
105+
#define CR0_NE (1 << 5)
106+
#define CR0_WP (1 << 16)
107+
#define CR0_AM (1 << 18)
108+
#define CR0_NW (1 << 29)
109+
#define CR0_CD (1 << 30)
110+
#define CR0_PG (1 << 31)
111+
98112
#define CR4_VME (1 << 0)
99113
#define CR4_PVI (1 << 1)
100114
#define CR4_TSD (1 << 2)

0 commit comments

Comments
 (0)