diff options
author | Avi Kivity <avi@redhat.com> | 2011-04-21 05:35:41 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-05-22 08:39:37 -0400 |
commit | 40e19b519caeb93def89c45082d776fccfb96dbb (patch) | |
tree | 1f513c1a623ec94fd7bf13e01a7edc3e4a57b9a1 /arch/x86/kvm/svm.c | |
parent | 5ef39c71d8398115245a5974b488f8703ba3a6b0 (diff) |
KVM: SVM: Get rid of x86_intercept_map::valid
By reserving 0 as an invalid x86_intercept_stage, we no longer
need to store a valid flag in x86_intercept_map.
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/svm.c')
-rw-r--r-- | arch/x86/kvm/svm.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index de4bba99160d..9cff0368e1fc 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c | |||
@@ -3959,19 +3959,15 @@ static void svm_fpu_deactivate(struct kvm_vcpu *vcpu) | |||
3959 | } | 3959 | } |
3960 | 3960 | ||
3961 | #define PRE_EX(exit) { .exit_code = (exit), \ | 3961 | #define PRE_EX(exit) { .exit_code = (exit), \ |
3962 | .stage = X86_ICPT_PRE_EXCEPT, \ | 3962 | .stage = X86_ICPT_PRE_EXCEPT, } |
3963 | .valid = true } | ||
3964 | #define POST_EX(exit) { .exit_code = (exit), \ | 3963 | #define POST_EX(exit) { .exit_code = (exit), \ |
3965 | .stage = X86_ICPT_POST_EXCEPT, \ | 3964 | .stage = X86_ICPT_POST_EXCEPT, } |
3966 | .valid = true } | ||
3967 | #define POST_MEM(exit) { .exit_code = (exit), \ | 3965 | #define POST_MEM(exit) { .exit_code = (exit), \ |
3968 | .stage = X86_ICPT_POST_MEMACCESS, \ | 3966 | .stage = X86_ICPT_POST_MEMACCESS, } |
3969 | .valid = true } | ||
3970 | 3967 | ||
3971 | static struct __x86_intercept { | 3968 | static struct __x86_intercept { |
3972 | u32 exit_code; | 3969 | u32 exit_code; |
3973 | enum x86_intercept_stage stage; | 3970 | enum x86_intercept_stage stage; |
3974 | bool valid; | ||
3975 | } x86_intercept_map[] = { | 3971 | } x86_intercept_map[] = { |
3976 | [x86_intercept_cr_read] = POST_EX(SVM_EXIT_READ_CR0), | 3972 | [x86_intercept_cr_read] = POST_EX(SVM_EXIT_READ_CR0), |
3977 | [x86_intercept_cr_write] = POST_EX(SVM_EXIT_WRITE_CR0), | 3973 | [x86_intercept_cr_write] = POST_EX(SVM_EXIT_WRITE_CR0), |
@@ -4039,7 +4035,7 @@ static int svm_check_intercept(struct kvm_vcpu *vcpu, | |||
4039 | 4035 | ||
4040 | icpt_info = x86_intercept_map[info->intercept]; | 4036 | icpt_info = x86_intercept_map[info->intercept]; |
4041 | 4037 | ||
4042 | if (!icpt_info.valid || stage != icpt_info.stage) | 4038 | if (stage != icpt_info.stage) |
4043 | goto out; | 4039 | goto out; |
4044 | 4040 | ||
4045 | switch (icpt_info.exit_code) { | 4041 | switch (icpt_info.exit_code) { |