Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2751184imj; Mon, 11 Feb 2019 07:58:03 -0800 (PST) X-Google-Smtp-Source: AHgI3IYC2jx416rqX0rvcJK6v4JDjFd+mOL5fECm7BEh+WQY5PzzcXEFqtPFjhUwX3wRkFRdvR8z X-Received: by 2002:a17:902:4324:: with SMTP id i33mr37466421pld.227.1549900683453; Mon, 11 Feb 2019 07:58:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549900683; cv=none; d=google.com; s=arc-20160816; b=t4th+4lAe/fdPB93BzJgicVoHFsNKtgRNi1rcDJH+u+4N0KbaZfHMzXdx2DUDBHy4W qJT6FaSeuNuJ0Z+od1PAS0ff9TKHlxRa42yt85zHtEDrgicgzk6rZB1ycPkuRx3AIjY2 p6VmYVxcKGy7HeiMhm7Zucb8PmBnqfv51dhFsLnecBn82hh8vELf3gWryWI8b1S4QK4J 03UHFrF87oLWxXyjhojgefjOHI7q+XPX/n27sredkNvq7SGRdmGgTsdLppt4VhrDwQu2 PA35+ETEfi6gYR6lqUKpWuV10y6VKFPYDAkB91jakGM8rHdPQLu9DTXQM379WhKkAbgu sItw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=su968zpsMijMdWVH0k+tCICk54PCmIyvKB2NC7iLkxw=; b=ncPnqiNXm90lKLKevrq+W3NgtL4KxUm6nsvJFBR/NSWw9Se0hrshiXJrrzoYVvtl4G pATIxkwL9d/rvza3Hl3G8+m+NxD4AchY6Y0Uzo4C+xykyf8fpjkD/H5R/PJOXAy/XE5i UMfKbkPUev8FN0VgNL0TsUmjUgs0zIWBp5u1sDLhS1kExtUh9yUwHweEjgY/NMbGpwxq oPGeKZgrt5Vj3qfFZD3NILNdaQeUkwKp9KhTwRneRk0A51cw9yccWqGOE+7KkWTUKCph yWchbX0umg1RtDqceQbWbWn2IUWVxsREjcDYrvv/hRrNsUqmI+rnt8JzVLuk9YbbkA0v 9+ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0hJ0IsZB; 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 f9si9548652pgc.85.2019.02.11.07.57.47; Mon, 11 Feb 2019 07:58: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; dkim=pass header.i=@kernel.org header.s=default header.b=0hJ0IsZB; 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 S1731094AbfBKP45 (ORCPT + 99 others); Mon, 11 Feb 2019 10:56:57 -0500 Received: from mail.kernel.org ([198.145.29.99]:42026 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730467AbfBKOd7 (ORCPT ); Mon, 11 Feb 2019 09:33:59 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0D060218A3; Mon, 11 Feb 2019 14:33:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549895638; bh=KpFAjQoWUx4b55EwkKa8aj76oFHaXpuar5iA0KEs/NU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0hJ0IsZB/4Owtrzm+/BwGEMQGjYR/UwL8fMvc3yTRBBHwGh2R9pJw7tDh2ESc6tYJ K9vLeVJ0Pzr1HPPlc5WKpJjA2bjDE6fYePbHp4tpMDb3SGIjz3z+VcUBJs8mC7WvHC V0n+n8ensTYUNJfdZjfGvAp0UnEkhoBUktDHSHoE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vitaly Kuznetsov , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , Sasha Levin Subject: [PATCH 4.20 245/352] KVM: x86: svm: report MSR_IA32_MCG_EXT_CTL as unsupported Date: Mon, 11 Feb 2019 15:17:52 +0100 Message-Id: <20190211141902.711191937@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141846.543045703@linuxfoundation.org> References: <20190211141846.543045703@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ [ 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 101f53ccf571..11641d9e7f6f 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -5836,6 +5836,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