Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3695801imu; Mon, 28 Jan 2019 09:11:47 -0800 (PST) X-Google-Smtp-Source: ALg8bN4Z3Hu+7C5UqCe3JVoCAH9Oysc08wEgdQxeG5gNtNfVk0VlkuOS+auLM/IpGsq5oAcbK03l X-Received: by 2002:a63:26c1:: with SMTP id m184mr19146211pgm.367.1548695507726; Mon, 28 Jan 2019 09:11:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548695507; cv=none; d=google.com; s=arc-20160816; b=cwAVhzRgyUQqOo8TUsfO9wIClt0dAGQ1WGvKlyQJ3RETMuMGTfikuzmxbgSmN/6o5g FqhmDFBk86zfrpu0Hm5wzreb2Pg6kSca6bLAXVZ8zHfl6J2F3++2LrtH+NgIiMcJpBaX HoI4KsBzBC89qaKRqV9Y0c9MlMjDTl8ZsCuiIp4uclwBAiOU9zrzguxTtAjiUMxHMlAm +vo/naAy3UZuvNdQnGwJNJ5OXZa8udRpxeuPPbTwwY5ODmVcztlTNRCVpLvR3AMiWlMv yP9bXzN7UZeUCiripLeyYOnEuVOsQsVA851IYMIIpx9TdPaAuSQBPTBIf3l4nel0Yvgp /dwA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=OJGyGOu9YTcC0zQRyAG8Yqk4bp7ieOLUEqAdVEJYQSM=; b=UZclex5Hwpt9BKQ6DXkb7v32pxrkqxQdB6fhlANGtk4iZyOMr2HLZiXxfYEFyAcIRT RxOgx6KLH4/Z6E86PsW2E/ru+K9OKiqemUHMmxCkIFOSEogJH0vvx600jUwnTJruIBcM BrFfoQO51z2HQrDoJZVROIHyNzgtCu5ABPrP0IN05d+MadfBoasOhSs8HMt+9xstrNhS dUcDlXRB/BflcqfK57nxxEse5IEw2JR85Ss746j8tIk/BBHgtMzHmWGdiVpctiLkVd9W CQNaiB6ziPOgnwJlaxIGIurjQit1nhRvgnAfwxEnNoJx6uFdCYPW+acOM2HPiwy4pRtR W9ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JWGQ75AU; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d9si32515336plr.127.2019.01.28.09.11.32; Mon, 28 Jan 2019 09:11:47 -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; dkim=pass header.i=@kernel.org header.s=default header.b=JWGQ75AU; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732663AbfA1QJq (ORCPT + 99 others); Mon, 28 Jan 2019 11:09:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:34730 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731968AbfA1QJk (ORCPT ); Mon, 28 Jan 2019 11:09:40 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1D3832084A; Mon, 28 Jan 2019 16:09:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548691780; bh=sJdydmKzAp2rJ6z6ss40IveaxoUYMGUfskY4/xHNGhs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JWGQ75AUpZQtnXpkMn0EMIqER5C7LU8zm6erXxZwQM7jA9ejsPWjaEEUABiO5qn3G SS6VX4Ztb+/20t7siy2eM3eBNIPbmDNajY5IzhRyI+U89Dvh9q7/6hlEEozQGGBMr8 7Rarx8pevZZLu8LINEiN/ExGk0C5b2ZobNEq6odQ= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Vitaly Kuznetsov , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , Sasha Levin , kvm@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 215/258] KVM: x86: svm: report MSR_IA32_MCG_EXT_CTL as unsupported Date: Mon, 28 Jan 2019 10:58:41 -0500 Message-Id: <20190128155924.51521-215-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190128155924.51521-1-sashal@kernel.org> References: <20190128155924.51521-1-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vitaly Kuznetsov [ Upstream commit e87555e550cef4941579cd879759a7c0dee24e68 ] 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 Signed-off-by: Radim Krčmář Signed-off-by: Sasha Levin --- 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 f1d3fe5a0c65..02ac8fa0cd6d 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -5837,6 +5837,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.1