Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp645972imm; Fri, 22 Jun 2018 02:53:57 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLHejw3NOh9iVy30IP1QB0JS9tUWL3QijpQ74YkvLnN+d8ZfDgjZSlx1UHRflj1gHcHwldj X-Received: by 2002:a63:4346:: with SMTP id q67-v6mr792185pga.328.1529661237021; Fri, 22 Jun 2018 02:53:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529661237; cv=none; d=google.com; s=arc-20160816; b=h7P38glSTsnvz7PUhR+Izp8UASR12HDJZ/AOLIjS23hLoWkwy/IyW/iimEY9tXgGkv SLh96468VFLnzQpq7vVOZ2tx7ZLENJJHPrxV8ZJ9If5LGspfhi9NuIRjpZXKFyAEdcMR AVAw8elMN3v7GcUM+xwBjPDI6CtTcRyc54x3N6Z2cRvY5MFYvJOQeiGNDaREq+YDbLCw 1FnJKCWqfkkqhpiT5MIMZkoM6M2CG3wjBDsllUIiGcXHYpu3pTo5FpsgulqH3ItniyN5 5OmoQCtsfljRk2SntH27wRU5XpLZLyypQ4O32TO3EGHpsPX6AXnpH9WKUUeBXgI7QIwv QiyA== 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=N5yLmPV/rbPdUdWYcj9XAt/bFxRGvblXZUrtOz1iBVI=; b=rmV0WiuHd+RIcpnLiKfJrHA5h2eF0rhF2xGXDm+5sSTNAPFMc5uvZQXkQz8qQBZtnO PrZnK6Ur32Z1lAqCqTfz39HNp179UK0ckXbt9utm9pIb3r5fuJ73EwxcfD+ZMd6dvGly NnCTMazY7v5/bW6/tJCV24D20fK7qneHE9KXm+GORfsAX9eQFJ+vfiIDCL04z5RoH8/6 auYYJ0lKca+LgEusL2dO1m1mKjliNVz/zs8oCTqR5mQ2mvCJHXGTjL6Tnd8LaB3/k5Vu W5URzWSaFwBbCzvRnlX/oXN9nBPSzQ3VohvQH88zaEMAu/FML3SlzpUodrsUv7vQNXXS 6LLw== 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 b94-v6si7955673plb.135.2018.06.22.02.53.42; Fri, 22 Jun 2018 02:53: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 S1754531AbeFVJwA (ORCPT + 99 others); Fri, 22 Jun 2018 05:52:00 -0400 Received: from mail.skyhub.de ([5.9.137.197]:41138 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754177AbeFVJvQ (ORCPT ); Fri, 22 Jun 2018 05:51:16 -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 69WrBG1Jg2ba; Fri, 22 Jun 2018 11:51:15 +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 59F0C1EC0236; Fri, 22 Jun 2018 11:51:15 +0200 (CEST) From: Borislav Petkov To: KVM Cc: Joerg Roedel , Tom Lendacky , Tony Luck , Yazen Ghannam , LKML Subject: [PATCH 1/3] kvm/x86: Move MSR_K7_HWCR to svm.c Date: Fri, 22 Jun 2018 11:50:59 +0200 Message-Id: <20180622095101.32587-2-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 This is an AMD-specific MSR. Put it where it belongs. Signed-off-by: Borislav Petkov --- arch/x86/kvm/svm.c | 14 ++++++++++++++ arch/x86/kvm/x86.c | 12 ------------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index f059a73f0fd0..72e60daf3ab8 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -4153,6 +4153,9 @@ static int svm_get_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info) case MSR_F10H_DECFG: msr_info->data = svm->msr_decfg; break; + case MSR_K7_HWCR: + msr_info->data = 0; + break; default: return kvm_get_msr_common(vcpu, msr_info); } @@ -4357,6 +4360,17 @@ static int svm_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr) svm->msr_decfg = data; break; } + case MSR_K7_HWCR: + data &= ~(u64)0x40; /* ignore flush filter disable */ + data &= ~(u64)0x100; /* ignore ignne emulation enable */ + data &= ~(u64)0x8; /* ignore TLB cache disable */ + data &= ~(u64)0x40000; /* ignore Mc status write enable */ + if (data != 0) { + vcpu_unimpl(vcpu, "unimplemented HWCR wrmsr: 0x%llx\n", + data); + return 1; + } + break; case MSR_IA32_APICBASE: if (kvm_vcpu_apicv_active(vcpu)) avic_update_vapic_bar(to_svm(vcpu), data); diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 0046aa70205a..3bf721c22124 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -2317,17 +2317,6 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info) break; case MSR_EFER: return set_efer(vcpu, data); - case MSR_K7_HWCR: - data &= ~(u64)0x40; /* ignore flush filter disable */ - data &= ~(u64)0x100; /* ignore ignne emulation enable */ - data &= ~(u64)0x8; /* ignore TLB cache disable */ - data &= ~(u64)0x40000; /* ignore Mc status write enable */ - if (data != 0) { - vcpu_unimpl(vcpu, "unimplemented HWCR wrmsr: 0x%llx\n", - data); - return 1; - } - break; case MSR_FAM10H_MMIO_CONF_BASE: if (data != 0) { vcpu_unimpl(vcpu, "unimplemented MMIO_CONF_BASE wrmsr: " @@ -2597,7 +2586,6 @@ int kvm_get_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info) case MSR_K8_SYSCFG: case MSR_K8_TSEG_ADDR: case MSR_K8_TSEG_MASK: - case MSR_K7_HWCR: case MSR_VM_HSAVE_PA: case MSR_K8_INT_PENDING_MSG: case MSR_AMD64_NB_CFG: -- 2.17.0.582.gccdcbd54c