Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp645176imm; Fri, 22 Jun 2018 02:52:56 -0700 (PDT) X-Google-Smtp-Source: ADUXVKL8uI7TlY0FkW+nFrtf6SZnz/hvVO3FI3wyT7RMpgipnoJ0CQaKWMqlmPW7ELi16I3IURWp X-Received: by 2002:a62:8f8c:: with SMTP id n134-v6mr1003335pfd.66.1529661176098; Fri, 22 Jun 2018 02:52:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529661176; cv=none; d=google.com; s=arc-20160816; b=VfqrLlMF6AQygk89/Vx4QkgnMQ3VudNp+RWGPnt2Zi1Ac0Vp1iMo3AKYZjoUdfPlDX rpkzoAwgudXFXoOA6JA1yThjN7IPK6YyGjNXChD4Bg7LsJmgKG4Vel8/rKYEubIMJap9 01L50MUdkFOvi14bA13D6vSnDXcl1nbW0GzkwK4MKqhpp8Iotp/WpiVATKeH/PaWA9FB +hhtzJBC7VSn3qsx5okhHGFnJzlxHUg9AnmAoaJkgc3s13fbyYI6pG1Wd/oDbqmf0lKJ gUTyw+mKP6r/y5W1QL4PjU71tVrLCm0kA47QwGLze2yecBWEMJycgMIobKPAtk5WplBC Rrig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=eNNXNSnTtRZUzNF/YyaOHmhrhYJGpKmFiZIN6xNct+s=; b=mZKRn1vRGPya4xwnsj1ImoyRgLN/O1PUziTEDbjH6xTpPaQEoys5OKxdfnEmFWAu2m IHwXA6MZIEpinJZ3KOiDcx14+HUZDd4DydlxeO641lFv4lxC2di0aYVX0jhmZobgNetk csFiWLWTQ+AdlIlr288I2vMhy9Y3nl638hdTHcVUPTYjXUcjK5d6+rgys21BYHkF6IGR TriFzzQ+OPJmuSAmPL6Q/5OarC9bqWgaGk4e7LiKHzzW+203OrpSbD8vh98Mi02q2ltM M3Flbs9AOhKoAy0HpLa3KMon3qWptFLv/BpLkjyA0drTaDx8Ef7ICpSijTLc/i0KgL4w Ar9w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bj7-v6si3859459plb.119.2018.06.22.02.52.42; Fri, 22 Jun 2018 02:52:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754393AbeFVJve (ORCPT + 99 others); Fri, 22 Jun 2018 05:51:34 -0400 Received: from mail.skyhub.de ([5.9.137.197]:41156 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751242AbeFVJvS (ORCPT ); Fri, 22 Jun 2018 05:51:18 -0400 X-Virus-Scanned: Nedap ESD1 at mail.skyhub.de Received: from mail.skyhub.de ([127.0.0.1]) by localhost (blast.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id k0WCwwJQ1QIX; Fri, 22 Jun 2018 11:51:17 +0200 (CEST) Received: from zn.tnic (p200300EC2BCF3400329C23FFFEA6A903.dip0.t-ipconnect.de [IPv6:2003:ec:2bcf:3400:329c:23ff:fea6:a903]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id DE9A61EC0236; Fri, 22 Jun 2018 11:51:16 +0200 (CEST) From: Borislav Petkov To: KVM Cc: Joerg Roedel , Tom Lendacky , Tony Luck , Yazen Ghannam , LKML Subject: [PATCH 3/3] x86/kvm: Handle all MCA banks Date: Fri, 22 Jun 2018 11:51:01 +0200 Message-Id: <20180622095101.32587-4-bp@alien8.de> X-Mailer: git-send-email 2.17.0.582.gccdcbd54c In-Reply-To: <20180622095101.32587-1-bp@alien8.de> References: <20180622095101.32587-1-bp@alien8.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Borislav Petkov Extend the range of MCA banks which get passed to set/get_msr_mce() to include all the MSRs of the last bank too. Signed-off-by: Borislav Petkov --- arch/x86/kvm/x86.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 80452b0f0e8c..a7d344823356 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -2466,7 +2466,7 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info) case MSR_IA32_MCG_CTL: case MSR_IA32_MCG_STATUS: - case MSR_IA32_MC0_CTL ... MSR_IA32_MCx_CTL(KVM_MAX_MCE_BANKS) - 1: + case MSR_IA32_MC0_CTL ... MSR_IA32_MCx_MISC(KVM_MAX_MCE_BANKS) - 1: return set_msr_mce(vcpu, msr_info); case MSR_K7_PERFCTR0 ... MSR_K7_PERFCTR3: @@ -2588,9 +2588,10 @@ static int get_msr_mce(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata) case MSR_IA32_MCG_STATUS: data = vcpu->arch.mcg_status; break; + default: if (msr >= MSR_IA32_MC0_CTL && - msr < MSR_IA32_MCx_CTL(bank_num)) { + msr < MSR_IA32_MCx_MISC(bank_num)) { u32 offset = msr - MSR_IA32_MC0_CTL; data = vcpu->arch.mce_banks[offset]; break; -- 2.17.0.582.gccdcbd54c