From patchwork Mon Jan 31 10:55:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 538851 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BDEA1C4332F for ; Mon, 31 Jan 2022 11:11:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359419AbiAaLLN (ORCPT ); Mon, 31 Jan 2022 06:11:13 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:42434 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376372AbiAaLIU (ORCPT ); Mon, 31 Jan 2022 06:08:20 -0500 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 7238060F96; Mon, 31 Jan 2022 11:08:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3B0BEC340E8; Mon, 31 Jan 2022 11:08:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643627298; bh=SJVbZ4ndkvI29KQrm+pGAliRpePgPYkwDJRiSLl383g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YtW9FGYlHSkyEY3l83+r5jF9pQ8SowV069p6YVqRA4k2RY50Q3sRhCbgdCqktxWlF brI4RZb8YROxY0N1cCC/luGbUhkk0VTtNEpSrL/mlVXHrvtgvOTbH3nY/5WnHlmxcC RCkvzAuWfvBiDtMh0igKOX2BLDr86g1LNSuHHpw4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xiaoyao Li , Sean Christopherson , Paolo Bonzini Subject: [PATCH 5.15 039/171] KVM: x86: Keep MSR_IA32_XSS unchanged for INIT Date: Mon, 31 Jan 2022 11:55:04 +0100 Message-Id: <20220131105231.341874862@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220131105229.959216821@linuxfoundation.org> References: <20220131105229.959216821@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Xiaoyao Li commit be4f3b3f82271c3193ce200a996dc70682c8e622 upstream. It has been corrected from SDM version 075 that MSR_IA32_XSS is reset to zero on Power up and Reset but keeps unchanged on INIT. Fixes: a554d207dc46 ("KVM: X86: Processor States following Reset or INIT") Cc: stable@vger.kernel.org Signed-off-by: Xiaoyao Li Signed-off-by: Sean Christopherson Message-Id: <20220126172226.2298529-2-seanjc@google.com> Signed-off-by: Paolo Bonzini Signed-off-by: Greg Kroah-Hartman --- arch/x86/kvm/x86.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -10990,6 +10990,7 @@ void kvm_vcpu_reset(struct kvm_vcpu *vcp vcpu->arch.msr_misc_features_enables = 0; vcpu->arch.xcr0 = XFEATURE_MASK_FP; + vcpu->arch.ia32_xss = 0; } memset(vcpu->arch.regs, 0, sizeof(vcpu->arch.regs)); @@ -11008,8 +11009,6 @@ void kvm_vcpu_reset(struct kvm_vcpu *vcp eax = 0x600; kvm_rdx_write(vcpu, eax); - vcpu->arch.ia32_xss = 0; - static_call(kvm_x86_vcpu_reset)(vcpu, init_event); kvm_set_rflags(vcpu, X86_EFLAGS_FIXED);