From: Aravind Gopalakrishnan Subject: [PATCH 2/2 V2] mcheck, vmce: Allow vmce_amd_* functions to handle AMD thresolding MSRs Date: Mon, 27 Jan 2014 16:44:15 -0600 Message-ID: <1390862655-3461-3-git-send-email-aravind.gopalakrishnan@amd.com> References: <1390862655-3461-1-git-send-email-aravind.gopalakrishnan@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1390862655-3461-1-git-send-email-aravind.gopalakrishnan@amd.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: chegger@amazon.de, jinsong.liu@intel.com, boris.ostrovsky@oracle.com, suravee.suthikulpanit@amd.com, xen-devel@lists.xen.org Cc: Aravind Gopalakrishnan List-Id: xen-devel@lists.xenproject.org vmce_amd_[rd|wr]msr functions can handle accesses to AMD thresholding registers. But due to this statement here: switch ( msr & (MSR_IA32_MC0_CTL | 3) ) we are wrongly masking off top two bits and bit 4 which meant the register accesses never made it to vmce_amd_* functions. We correct this problem by modifying the mask in this patch to allow AMD thresholding registers to fall to 'default' case which in turn allows vmce_amd_* functions to handle access to the registers. Signed-off-by: Aravind Gopalakrishnan Reviewed-by: Suravee Suthikulpanit --- xen/arch/x86/cpu/mcheck/vmce.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/cpu/mcheck/vmce.c b/xen/arch/x86/cpu/mcheck/vmce.c index f6c35db..cb4fd12 100644 --- a/xen/arch/x86/cpu/mcheck/vmce.c +++ b/xen/arch/x86/cpu/mcheck/vmce.c @@ -107,7 +107,7 @@ static int bank_mce_rdmsr(const struct vcpu *v, uint32_t msr, uint64_t *val) *val = 0; - switch ( msr & (MSR_IA32_MC0_CTL | 3) ) + switch ( msr & (MSR_IA32_MC0_CTL | (0x3 << 30) | 0x13)) { case MSR_IA32_MC0_CTL: /* stick all 1's to MCi_CTL */ @@ -210,7 +210,7 @@ static int bank_mce_wrmsr(struct vcpu *v, uint32_t msr, uint64_t val) int ret = 1; unsigned int bank = (msr - MSR_IA32_MC0_CTL) / 4; - switch ( msr & (MSR_IA32_MC0_CTL | 3) ) + switch ( msr & (MSR_IA32_MC0_CTL | (0x3 << 30) | 0x13)) { case MSR_IA32_MC0_CTL: /* -- 1.7.9.5