summaryrefslogtreecommitdiffstats
path: root/arch/x86/include
diff options
context:
space:
mode:
authorBabu Moger <babu.moger@amd.com>2020-09-11 14:28:05 -0500
committerPaolo Bonzini <pbonzini@redhat.com>2020-09-28 07:57:13 -0400
commit03bfeeb988a970995479eb6d108c398027ab7525 (patch)
treef98608f9c6646e16ecac123715464b5b8f856bdf /arch/x86/include
parentc45ad7229d139ad48e894a271f8df6975e53d12e (diff)
downloadlinux-stable-03bfeeb988a970995479eb6d108c398027ab7525.tar.gz
linux-stable-03bfeeb988a970995479eb6d108c398027ab7525.tar.bz2
linux-stable-03bfeeb988a970995479eb6d108c398027ab7525.zip
KVM: SVM: Change intercept_cr to generic intercepts
Change intercept_cr to generic intercepts in vmcb_control_area. Use the new vmcb_set_intercept, vmcb_clr_intercept and vmcb_is_intercept where applicable. Signed-off-by: Babu Moger <babu.moger@amd.com> Reviewed-by: Jim Mattson <jmattson@google.com> Message-Id: <159985248506.11252.9081085950784508671.stgit@bmoger-ubuntu> [Change constant names. - Paolo] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/include')
-rw-r--r--arch/x86/include/asm/svm.h23
1 files changed, 13 insertions, 10 deletions
diff --git a/arch/x86/include/asm/svm.h b/arch/x86/include/asm/svm.h
index debe71f0226c..20b63418ae36 100644
--- a/arch/x86/include/asm/svm.h
+++ b/arch/x86/include/asm/svm.h
@@ -10,10 +10,23 @@
*/
enum intercept_words {
+ INTERCEPT_CR = 0,
MAX_INTERCEPT,
};
enum {
+ /* Byte offset 000h (word 0) */
+ INTERCEPT_CR0_READ = 0,
+ INTERCEPT_CR3_READ = 3,
+ INTERCEPT_CR4_READ = 4,
+ INTERCEPT_CR8_READ = 8,
+ INTERCEPT_CR0_WRITE = 16,
+ INTERCEPT_CR3_WRITE = 16 + 3,
+ INTERCEPT_CR4_WRITE = 16 + 4,
+ INTERCEPT_CR8_WRITE = 16 + 8,
+};
+
+enum {
INTERCEPT_INTR,
INTERCEPT_NMI,
INTERCEPT_SMI,
@@ -66,7 +79,6 @@ enum {
struct __attribute__ ((__packed__)) vmcb_control_area {
u32 intercepts[MAX_INTERCEPT];
- u32 intercept_cr;
u32 intercept_dr;
u32 intercept_exceptions;
u64 intercept;
@@ -296,15 +308,6 @@ struct vmcb {
#define SVM_SELECTOR_READ_MASK SVM_SELECTOR_WRITE_MASK
#define SVM_SELECTOR_CODE_MASK (1 << 3)
-#define INTERCEPT_CR0_READ 0
-#define INTERCEPT_CR3_READ 3
-#define INTERCEPT_CR4_READ 4
-#define INTERCEPT_CR8_READ 8
-#define INTERCEPT_CR0_WRITE (16 + 0)
-#define INTERCEPT_CR3_WRITE (16 + 3)
-#define INTERCEPT_CR4_WRITE (16 + 4)
-#define INTERCEPT_CR8_WRITE (16 + 8)
-
#define INTERCEPT_DR0_READ 0
#define INTERCEPT_DR1_READ 1
#define INTERCEPT_DR2_READ 2