Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5166125imu; Wed, 19 Dec 2018 06:44:04 -0800 (PST) X-Google-Smtp-Source: AFSGD/V+NTeJu9Ut3rv/XftXLUTNVS6J3lh+sEKz6kpz1/tdtg/SRNw92WreF11elHKIp+JDfFJe X-Received: by 2002:a63:fe0a:: with SMTP id p10mr19417158pgh.265.1545230643880; Wed, 19 Dec 2018 06:44:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545230643; cv=none; d=google.com; s=arc-20160816; b=jws3kCTKKsT/F/kRVkCkHGdtIRqFasab32AWJcE/afOXO7ddYanmKc4yYDGoPTKXBK /rZsYUQcq21gaVoDx/087ykpyxICIjK+mdQ/knz/kdgOlV+3O0x6YDepJKBttaQjH3Mi ORP1WrJ1SXz8sEWzcIHrW0wzRNWc7k4/+yX4RKV1/mhE2x5+H6xujbjPLnc96M/N3R4A /tdswT+S1vJ90HDqx67SjCJevvT0jl173q7lWRu66lP2odpsZmPJHZ6YwoeFbjHe/+Cc Jc0M0jPMC/9Nr+7uRqo39AO1nAkowi7HepR7KcPPSBD9CrzEN1ikv3kn7J4gODDvZP1C oYlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=OJAYYVFECAVi59OlvgxDGJCcT69tYIG5dDj8MukNzLk=; b=AfqmxnZ5EqIsLQd0a8A2nvDHwBsflGqN6DnXfo39sfea/bX4K3w7bu516u/Wp416uX FNwq34ifkY/ac+oMJhHTHdJAUt0A5kd42nEzJw3GTliV6dqDb0fvLWy/rt368k6nOY+p HHbLP+GFxPkzvFMsWXvBXXoFlM8Ws6RJ2J7TEtvz3T1iUPFsccW8LbToXVZ6zoMa6Dvf V5AEW2wnYkaSOJGD0bXYTcH68kdgX0IURTvTYuPulM/vJcL6JEBP0bVp1tAUsY/fIPIK UHNjgmb339sldddUbyW11P3uPFfFb2IaFzY6TdxSSKvdl4V3RzUfq3KsYdCfEzH9ha44 ljzQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z128si16458349pgb.372.2018.12.19.06.43.48; Wed, 19 Dec 2018 06:44:03 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729184AbeLSLGR (ORCPT + 99 others); Wed, 19 Dec 2018 06:06:17 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34554 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728471AbeLSLGR (ORCPT ); Wed, 19 Dec 2018 06:06:17 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C4F56C050069; Wed, 19 Dec 2018 11:06:16 +0000 (UTC) Received: from vitty.brq.redhat.com (unknown [10.43.2.155]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0AC4B60159; Wed, 19 Dec 2018 11:06:14 +0000 (UTC) From: Vitaly Kuznetsov To: kvm@vger.kernel.org Cc: Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , linux-kernel@vger.kernel.org, Tom Lendacky , Joerg Roedel , x86@kernel.org Subject: [PATCH] KVM: x86: svm: report MSR_IA32_MCG_EXT_CTL as unsupported Date: Wed, 19 Dec 2018 12:06:13 +0100 Message-Id: <20181219110613.24459-1-vkuznets@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 19 Dec 2018 11:06:16 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org AMD doesn't seem to implement MSR_IA32_MCG_EXT_CTL and svm code in kvm knows nothing about it, however, this MSR is among emulated_msrs and thus returned with KVM_GET_MSR_INDEX_LIST. The consequent KVM_GET_MSRS, of course, fails. Report the MSR as unsupported to not confuse userspace. Signed-off-by: Vitaly Kuznetsov --- arch/x86/kvm/svm.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 2acb42b74a51..dfdf7d0b7f88 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -5845,6 +5845,13 @@ static bool svm_cpu_has_accelerated_tpr(void) static bool svm_has_emulated_msr(int index) { + switch (index) { + case MSR_IA32_MCG_EXT_CTL: + return false; + default: + break; + } + return true; } -- 2.19.2