diff options
author | Brian Gerst <brgerst@gmail.com> | 2010-07-17 09:03:26 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2010-07-22 00:23:05 -0400 |
commit | 8c06585d6431addadd94903843dfbcd315b42d4e (patch) | |
tree | 4d673e4d190361e2d73aa06980601ac57a100b59 /arch/x86/kvm | |
parent | cd5b8f8755a89a57fc8c408d284b8b613f090345 (diff) |
x86: Remove redundant K6 MSRs
MSR_K6_EFER is unused, and MSR_K6_STAR is redundant with MSR_STAR.
Signed-off-by: Brian Gerst <brgerst@gmail.com>
LKML-Reference: <1279371808-24804-1-git-send-email-brgerst@gmail.com>
Reviewed-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r-- | arch/x86/kvm/svm.c | 6 | ||||
-rw-r--r-- | arch/x86/kvm/vmx.c | 8 | ||||
-rw-r--r-- | arch/x86/kvm/x86.c | 2 |
3 files changed, 8 insertions, 8 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index ce438e0fdd26..24a220696298 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c | |||
@@ -130,7 +130,7 @@ static struct svm_direct_access_msrs { | |||
130 | u32 index; /* Index of the MSR */ | 130 | u32 index; /* Index of the MSR */ |
131 | bool always; /* True if intercept is always on */ | 131 | bool always; /* True if intercept is always on */ |
132 | } direct_access_msrs[] = { | 132 | } direct_access_msrs[] = { |
133 | { .index = MSR_K6_STAR, .always = true }, | 133 | { .index = MSR_STAR, .always = true }, |
134 | { .index = MSR_IA32_SYSENTER_CS, .always = true }, | 134 | { .index = MSR_IA32_SYSENTER_CS, .always = true }, |
135 | #ifdef CONFIG_X86_64 | 135 | #ifdef CONFIG_X86_64 |
136 | { .index = MSR_GS_BASE, .always = true }, | 136 | { .index = MSR_GS_BASE, .always = true }, |
@@ -2431,7 +2431,7 @@ static int svm_get_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 *data) | |||
2431 | *data = tsc_offset + native_read_tsc(); | 2431 | *data = tsc_offset + native_read_tsc(); |
2432 | break; | 2432 | break; |
2433 | } | 2433 | } |
2434 | case MSR_K6_STAR: | 2434 | case MSR_STAR: |
2435 | *data = svm->vmcb->save.star; | 2435 | *data = svm->vmcb->save.star; |
2436 | break; | 2436 | break; |
2437 | #ifdef CONFIG_X86_64 | 2437 | #ifdef CONFIG_X86_64 |
@@ -2555,7 +2555,7 @@ static int svm_set_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 data) | |||
2555 | 2555 | ||
2556 | break; | 2556 | break; |
2557 | } | 2557 | } |
2558 | case MSR_K6_STAR: | 2558 | case MSR_STAR: |
2559 | svm->vmcb->save.star = data; | 2559 | svm->vmcb->save.star = data; |
2560 | break; | 2560 | break; |
2561 | #ifdef CONFIG_X86_64 | 2561 | #ifdef CONFIG_X86_64 |
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index ee03679efe78..b42ad25d5647 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
@@ -231,14 +231,14 @@ static u64 host_efer; | |||
231 | static void ept_save_pdptrs(struct kvm_vcpu *vcpu); | 231 | static void ept_save_pdptrs(struct kvm_vcpu *vcpu); |
232 | 232 | ||
233 | /* | 233 | /* |
234 | * Keep MSR_K6_STAR at the end, as setup_msrs() will try to optimize it | 234 | * Keep MSR_STAR at the end, as setup_msrs() will try to optimize it |
235 | * away by decrementing the array size. | 235 | * away by decrementing the array size. |
236 | */ | 236 | */ |
237 | static const u32 vmx_msr_index[] = { | 237 | static const u32 vmx_msr_index[] = { |
238 | #ifdef CONFIG_X86_64 | 238 | #ifdef CONFIG_X86_64 |
239 | MSR_SYSCALL_MASK, MSR_LSTAR, MSR_CSTAR, | 239 | MSR_SYSCALL_MASK, MSR_LSTAR, MSR_CSTAR, |
240 | #endif | 240 | #endif |
241 | MSR_EFER, MSR_TSC_AUX, MSR_K6_STAR, | 241 | MSR_EFER, MSR_TSC_AUX, MSR_STAR, |
242 | }; | 242 | }; |
243 | #define NR_VMX_MSR ARRAY_SIZE(vmx_msr_index) | 243 | #define NR_VMX_MSR ARRAY_SIZE(vmx_msr_index) |
244 | 244 | ||
@@ -1057,10 +1057,10 @@ static void setup_msrs(struct vcpu_vmx *vmx) | |||
1057 | if (index >= 0 && vmx->rdtscp_enabled) | 1057 | if (index >= 0 && vmx->rdtscp_enabled) |
1058 | move_msr_up(vmx, index, save_nmsrs++); | 1058 | move_msr_up(vmx, index, save_nmsrs++); |
1059 | /* | 1059 | /* |
1060 | * MSR_K6_STAR is only needed on long mode guests, and only | 1060 | * MSR_STAR is only needed on long mode guests, and only |
1061 | * if efer.sce is enabled. | 1061 | * if efer.sce is enabled. |
1062 | */ | 1062 | */ |
1063 | index = __find_msr_index(vmx, MSR_K6_STAR); | 1063 | index = __find_msr_index(vmx, MSR_STAR); |
1064 | if ((index >= 0) && (vmx->vcpu.arch.efer & EFER_SCE)) | 1064 | if ((index >= 0) && (vmx->vcpu.arch.efer & EFER_SCE)) |
1065 | move_msr_up(vmx, index, save_nmsrs++); | 1065 | move_msr_up(vmx, index, save_nmsrs++); |
1066 | } | 1066 | } |
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 05d571f6f196..6127468ebbd2 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -671,7 +671,7 @@ static u32 msrs_to_save[] = { | |||
671 | HV_X64_MSR_GUEST_OS_ID, HV_X64_MSR_HYPERCALL, | 671 | HV_X64_MSR_GUEST_OS_ID, HV_X64_MSR_HYPERCALL, |
672 | HV_X64_MSR_APIC_ASSIST_PAGE, | 672 | HV_X64_MSR_APIC_ASSIST_PAGE, |
673 | MSR_IA32_SYSENTER_CS, MSR_IA32_SYSENTER_ESP, MSR_IA32_SYSENTER_EIP, | 673 | MSR_IA32_SYSENTER_CS, MSR_IA32_SYSENTER_ESP, MSR_IA32_SYSENTER_EIP, |
674 | MSR_K6_STAR, | 674 | MSR_STAR, |
675 | #ifdef CONFIG_X86_64 | 675 | #ifdef CONFIG_X86_64 |
676 | MSR_CSTAR, MSR_KERNEL_GS_BASE, MSR_SYSCALL_MASK, MSR_LSTAR, | 676 | MSR_CSTAR, MSR_KERNEL_GS_BASE, MSR_SYSCALL_MASK, MSR_LSTAR, |
677 | #endif | 677 | #endif |