Commit b4385abd authored by Andy Whitcroft's avatar Andy Whitcroft Committed by Kleber Sacilotto de Souza

Revert "x86/cpu/amd, kvm: Satisfy guest kernel reads of IC_CFG MSR"

CVE-2017-5753 (revert embargoed)
CVE-2017-5715 (revert embargoed)

This reverts commit 44c314e1.
Signed-off-by: default avatarAndy Whitcroft <apw@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 688d5160
...@@ -332,7 +332,6 @@ ...@@ -332,7 +332,6 @@
#define MSR_F15H_PERF_CTR 0xc0010201 #define MSR_F15H_PERF_CTR 0xc0010201
#define MSR_F15H_NB_PERF_CTL 0xc0010240 #define MSR_F15H_NB_PERF_CTL 0xc0010240
#define MSR_F15H_NB_PERF_CTR 0xc0010241 #define MSR_F15H_NB_PERF_CTR 0xc0010241
#define MSR_F15H_IC_CFG 0xc0011021
/* Fam 10h MSRs */ /* Fam 10h MSRs */
#define MSR_FAM10H_MMIO_CONF_BASE 0xc0010058 #define MSR_FAM10H_MMIO_CONF_BASE 0xc0010058
......
...@@ -685,9 +685,9 @@ static void init_amd_bd(struct cpuinfo_x86 *c) ...@@ -685,9 +685,9 @@ static void init_amd_bd(struct cpuinfo_x86 *c)
* Disable it on the affected CPUs. * Disable it on the affected CPUs.
*/ */
if ((c->x86_model >= 0x02) && (c->x86_model < 0x20)) { if ((c->x86_model >= 0x02) && (c->x86_model < 0x20)) {
if (!rdmsrl_safe(MSR_F15H_IC_CFG, &value) && !(value & 0x1E)) { if (!rdmsrl_safe(0xc0011021, &value) && !(value & 0x1E)) {
value |= 0x1E; value |= 0x1E;
wrmsrl_safe(MSR_F15H_IC_CFG, value); wrmsrl_safe(0xc0011021, value);
} }
} }
} }
......
#ifndef ARCH_X86_KVM_CPUID_H #ifndef ARCH_X86_KVM_CPUID_H
#define ARCH_X86_KVM_CPUID_H #define ARCH_X86_KVM_CPUID_H
#include <asm/microcode.h>
#include "x86.h" #include "x86.h"
int kvm_update_cpuid(struct kvm_vcpu *vcpu); int kvm_update_cpuid(struct kvm_vcpu *vcpu);
...@@ -121,28 +119,6 @@ static inline bool guest_cpuid_is_amd(struct kvm_vcpu *vcpu) ...@@ -121,28 +119,6 @@ static inline bool guest_cpuid_is_amd(struct kvm_vcpu *vcpu)
return best && best->ebx == X86EMUL_CPUID_VENDOR_AuthenticAMD_ebx; return best && best->ebx == X86EMUL_CPUID_VENDOR_AuthenticAMD_ebx;
} }
static inline int guest_cpuid_family(struct kvm_vcpu *vcpu)
{
struct kvm_cpuid_entry2 *best;
best = kvm_find_cpuid_entry(vcpu, 0x1, 0);
if (!best)
return -1;
return __x86_family(best->eax);
}
static inline int guest_cpuid_model(struct kvm_vcpu *vcpu)
{
struct kvm_cpuid_entry2 *best;
best = kvm_find_cpuid_entry(vcpu, 0x1, 0);
if (!best)
return -1;
return x86_model(best->eax);
}
static inline bool guest_cpuid_has_gbpages(struct kvm_vcpu *vcpu) static inline bool guest_cpuid_has_gbpages(struct kvm_vcpu *vcpu)
{ {
struct kvm_cpuid_entry2 *best; struct kvm_cpuid_entry2 *best;
......
...@@ -3053,23 +3053,6 @@ static int svm_get_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info) ...@@ -3053,23 +3053,6 @@ static int svm_get_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
case MSR_IA32_UCODE_REV: case MSR_IA32_UCODE_REV:
msr_info->data = 0x01000065; msr_info->data = 0x01000065;
break; break;
case MSR_F15H_IC_CFG: {
int family, model;
family = guest_cpuid_family(vcpu);
model = guest_cpuid_model(vcpu);
if (family < 0 || model < 0)
return kvm_get_msr_common(vcpu, msr_info);
msr_info->data = 0;
if (family == 0x15 &&
(model >= 0x2 && model < 0x20))
msr_info->data = 0x1E;
}
break;
default: default:
return kvm_get_msr_common(vcpu, msr_info); return kvm_get_msr_common(vcpu, msr_info);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment