Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp1676592pxb; Thu, 7 Oct 2021 12:39:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgt/iR/UvXee2N9HjVCDkyNYLkaFRUQXAWrSuVR5EBAHtp190GdmkihaCqkVXbOfgMYBD0 X-Received: by 2002:a17:90a:4414:: with SMTP id s20mr6872723pjg.144.1633635579998; Thu, 07 Oct 2021 12:39:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633635579; cv=none; d=google.com; s=arc-20160816; b=jqurCCOygwxRn9BmS5B1iGMGb6tUiwvCx5BYfvH6Gk9tgOroSioTwfviVvXG9KK/SG YvNmEfBAhmn8fp0wv7mkKT6GRt005gZFqG2ZfXzR2y/uwsvOFWBqyO2z7U1sueh/Ntnv QYzthC/xvoG/qfAOGXRWBmIuGIqPGhbOTlAM1fQNcMVYREGGJDF8Du4TLCg2FwU7nfGr gEtGxxxqm0eH5odzFwMif/wvE8FMkG57kPbtp7IXzRebbkDFGJxBLwChrKbn91LFSp+l 5uCEI9eo9dcmR8UIsRVWvWEotjbMVJqnretfJtvQXEdsPn6Xd5Lk/eTxVR5wFbhEHLFL mV5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=gHDuZTlGc2rJpzUr8UKQVYIrwD7USNVlq1NIiYVhYfw=; b=pwnuAZwP94dHNM1qFB462zBV76pB0uKCS+sk9dc7sUgWdK5y09yuuJSJHjK8b/R3fz NXpn5VWtp2ZLXh+TqzK6mC9NQh9vEw1/9ZauNtrn4RZ3aSonH0N9DKS/6YjWO+H1yIWj g9c7Nu5UY+Mdw2dh3U7PV/lqZ4GzKgzEv0HtatGFmBtk8R7xrypiY+D9aRCOOh2sxjfk t8+PrYe8Do/sfHiaYhPCA2tQ9DBsIs9m7j10TlN2K/HEl3AwF3VDsUGLwynfwNwN+Mba wV590hr/7Y9wKpCx8M8FhjSDzoRtnZat6gtHDLMqiV3+4DR/2A3fwUSrwlIQttEWXgyb jEJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mDcKpPSJ; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v5si360412plg.23.2021.10.07.12.39.26; Thu, 07 Oct 2021 12:39:39 -0700 (PDT) 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=@linaro.org header.s=google header.b=mDcKpPSJ; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240989AbhJGPZ4 (ORCPT + 99 others); Thu, 7 Oct 2021 11:25:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230410AbhJGPZz (ORCPT ); Thu, 7 Oct 2021 11:25:55 -0400 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC936C061570 for ; Thu, 7 Oct 2021 08:24:01 -0700 (PDT) Received: by mail-ed1-x52f.google.com with SMTP id g10so23978611edj.1 for ; Thu, 07 Oct 2021 08:24:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gHDuZTlGc2rJpzUr8UKQVYIrwD7USNVlq1NIiYVhYfw=; b=mDcKpPSJ2ovp2qaHHZZU+Pv3JPFKAItNwoNirvaUfu8rWw/zVQviJym/hwXiOsuqsm 3yizOVJfWskSZ2toc+lfAaqMilOE0Fbwgh8nrgOPQPHz97sYE736T26FDoc25wGrOVh8 yI/fjTOuVRiSpi8ptiMixbpo4Kr5EpGwqsI5fZkHjp/YqKziz3pwgNlvDGC1xWjZ8oa0 aDB4HFQTQTXZ/6mREfakyGUvahUpBsGZHO3Dz9YgHPXXQczs12xYghxq08P3cWkNTYwM lfPGBnsnXHcbiBfAp/tj6BYC6C0qy1AAb9uv4BfWiYgBGnTWIhlPIKBILpkZhjXiwgEb FVwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gHDuZTlGc2rJpzUr8UKQVYIrwD7USNVlq1NIiYVhYfw=; b=rsGq73K6A/+MpM/R7a3APXLXohTPifnXJ0CqvVmnyZMrcRuR85OAC7HCm/4ykiM6pM kFVKVyz22Q7oxQcmpXLt0fQ6R74fzziGCG94BDAspir/+drIc4F1uC0qKnSuYUprXQN1 ty+0gcvCeaoSQyxiEJ1kbJb7/+/rcaMQZ2O8HoHOwlKiA9Qm2DKHWsWzjwKEj41ktj/r 7ZW6Z0XvPr2+Q1/l/wD3NwmIPAGtweElX5XGOsPSKX/VTjUr01+vpT8mGdhnafVQQAS6 lBnPmysO3YN7BjW9R8ORLf3Dk/hzl5sqERb8QCFGq4HYTAcmUrUvivW/QYF+WnxpnAU4 HTZw== X-Gm-Message-State: AOAM531+l67cPPaL2OKZDkpKWNIH1gGm8VgCIE018QNBsgvV8jbzwAoM 77mV10ZKsrdfQkzOXzoH2f4+lX6yREvF327NjQwN4A== X-Received: by 2002:a17:906:c302:: with SMTP id s2mr2419953ejz.499.1633620237988; Thu, 07 Oct 2021 08:23:57 -0700 (PDT) MIME-Version: 1.0 References: <20211006133021.271905-1-sashal@kernel.org> <20211006133021.271905-4-sashal@kernel.org> In-Reply-To: From: Naresh Kamboju Date: Thu, 7 Oct 2021 20:53:46 +0530 Message-ID: Subject: Re: [PATCH MANUALSEL 5.14 4/9] KVM: x86: reset pdptrs_from_userspace when exiting smm To: Paolo Bonzini Cc: Sasha Levin , open list , linux-stable , Maxim Levitsky , Thomas Gleixner , Ingo Molnar , Borislav Petkov , X86 ML , kvm list Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 6 Oct 2021 at 19:06, Paolo Bonzini wrote: > > On 06/10/21 15:30, Sasha Levin wrote: > > From: Maxim Levitsky > > > > [ Upstream commit 37687c403a641f251cb2ef2e7830b88aa0647ba9 ] > > > > When exiting SMM, pdpts are loaded again from the guest memory. > > > > This fixes a theoretical bug, when exit from SMM triggers entry to the > > nested guest which re-uses some of the migration > > code which uses this flag as a workaround for a legacy userspace. > > > > Signed-off-by: Maxim Levitsky > > Message-Id: <20210913140954.165665-4-mlevitsk@redhat.com> > > Signed-off-by: Paolo Bonzini > > Signed-off-by: Sasha Levin > > --- > > arch/x86/kvm/x86.c | 7 +++++++ > > 1 file changed, 7 insertions(+) > > > > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > > index b3f855d48f72..1e7d629bbf36 100644 > > --- a/arch/x86/kvm/x86.c > > +++ b/arch/x86/kvm/x86.c > > @@ -7659,6 +7659,13 @@ static void kvm_smm_changed(struct kvm_vcpu *vcpu, bool entering_smm) > > > > /* Process a latched INIT or SMI, if any. */ > > kvm_make_request(KVM_REQ_EVENT, vcpu); > > + > > + /* > > + * Even if KVM_SET_SREGS2 loaded PDPTRs out of band, > > + * on SMM exit we still need to reload them from > > + * guest memory > > + */ > > + vcpu->arch.pdptrs_from_userspace = false; > > } > > > > kvm_mmu_reset_context(vcpu); > > > > Acked-by: Paolo Bonzini Is this expected to be in stable-rc 5.10 and below ? Because it is breaking the builds on queue/5.10, queue/5.4 and older branches. arch/x86/kvm/x86.c: In function 'kvm_smm_changed': arch/x86/kvm/x86.c:6612:27: error: 'struct kvm_vcpu_arch' has no member named 'pdptrs_from_userspace' 6612 | vcpu->arch.pdptrs_from_userspace = false; | ^ make[3]: *** [scripts/Makefile.build:262: arch/x86/kvm/x86.o] Error 1 ref: https://gitlab.com/Linaro/lkft/mirrors/stable/linux-stable-rc-queues/-/jobs/1658987088#L443 - Naresh