Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp860860pxb; Tue, 1 Feb 2022 11:58:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJwiXSb3R4E1LkJVRu6n8hcS0rLBzSmYnR5lKshDVSx4rQu4PlsO+ZZZbpYAvsHsLdvCn2We X-Received: by 2002:a17:907:7412:: with SMTP id gj18mr22942557ejc.381.1643745501737; Tue, 01 Feb 2022 11:58:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643745501; cv=none; d=google.com; s=arc-20160816; b=v62aAjI6abdQozY58mEIY973ckYcxTSlld+QjE5j+wzIJo5aWKryXIp6z3qLsWPMk+ P3iDcdHlE5QS0NvZKkHi37n1VdxEUkzmSgt/DBrriYyb9WwDb2y2tzwFyGfcZJpBDGCf Sxb9oUy447D56XsVQphZUC5lPFkdD4rYaP987RUacMp2OtpJru6yTbUp/oF+EJ1uCZlS QodHftMegJN8bGgLV/D8JURt3IJj185qYwR8jJOAK7mdXgtQWwd9LI0wgyyxupZotByQ Q+OhcP1v27bO8kQnwfZkllTg3jvgEjYNLk72/4MVEBSaRlUgCShF/zqs5/sKQWB66shi Zl+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=unEZvsFKRrEvs3PGXsi1CU8JM2eQvGhwNJVjezqQu0k=; b=hoQOC9V2gZsQYD71kUQhzKEmMGKgnWt74IoQ2S+qYk5bes8TX2dmtq9/YZFgIUgS8s Y5gQQNukPPIF5f06vVxOOKnnXs3/gWXPI1U7/xl9apxZFmPFDSlaQWebIAIxJcAhakuy ECSvCupSin8sLPRsrh8dTh0YpONBA6ndoCG1v+w2vJlQEp1l171qk1ZvP9akuYVdbXQQ Lso1VMTpIIniiJqJ3PoorViPmuRPRv2D0rW/wrPaJdGXaWIjLRpQnLwJDvT4L3X2pYvD x8uN+RptG98SN4mTTEWZGCtQ/hFyHJ9f3ErYdr6TGWHDd0iOhLod62McSHI+n4ptD5Ru IAIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Lk/WdaT+"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u8si9873136eds.8.2022.02.01.11.57.56; Tue, 01 Feb 2022 11:58:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Lk/WdaT+"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359515AbiAaLFo (ORCPT + 99 others); Mon, 31 Jan 2022 06:05:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358594AbiAaLDZ (ORCPT ); Mon, 31 Jan 2022 06:03:25 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 184C0C06174A; Mon, 31 Jan 2022 03:02:15 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A9FAE60BA1; Mon, 31 Jan 2022 11:02:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6E11AC340E8; Mon, 31 Jan 2022 11:02:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643626934; bh=Df7srRIny91wfHefzruMmZfr2afVsQg7wEVJd0IxqL4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Lk/WdaT+wSxCjI0CjsXKGPFm85WrmS6XEu5VHWJfkLBxd4IZvEiHa/MB8bLBk2qkD BmEGSelIN8JGcePyVsY6g0iULrKAvfJUqMz8YRVTEl6O0iNlWljjNggAL8ZgA+kbv8 jMdv/kDz8qyDVM259i/IOS1qigAh3vfzS+Tn2FSI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Like Xu , Sean Christopherson , Paolo Bonzini Subject: [PATCH 5.10 021/100] KVM: x86: Update vCPUs runtime CPUID on write to MSR_IA32_XSS Date: Mon, 31 Jan 2022 11:55:42 +0100 Message-Id: <20220131105221.174993972@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220131105220.424085452@linuxfoundation.org> References: <20220131105220.424085452@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Like Xu commit 4c282e51e4450b94680d6ca3b10f830483b1f243 upstream. Do a runtime CPUID update for a vCPU if MSR_IA32_XSS is written, as the size in bytes of the XSAVE area is affected by the states enabled in XSS. Fixes: 203000993de5 ("kvm: vmx: add MSR logic for XSAVES") Cc: stable@vger.kernel.org Signed-off-by: Like Xu [sean: split out as a separate patch, adjust Fixes tag] Signed-off-by: Sean Christopherson Message-Id: <20220126172226.2298529-3-seanjc@google.com> Signed-off-by: Paolo Bonzini Signed-off-by: Greg Kroah-Hartman --- arch/x86/kvm/x86.c | 1 + 1 file changed, 1 insertion(+) --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -3171,6 +3171,7 @@ int kvm_set_msr_common(struct kvm_vcpu * if (data & ~supported_xss) return 1; vcpu->arch.ia32_xss = data; + kvm_update_cpuid_runtime(vcpu); break; case MSR_SMI_COUNT: if (!msr_info->host_initiated)