Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp812434imm; Wed, 18 Jul 2018 11:04:45 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcs8AkmQKovWSNCB2OZSleoF4SBfYdZGRxsdNhYQt/zzv/yU9/rcVhnuNhCMBbf9BkpEvLI X-Received: by 2002:a17:902:6946:: with SMTP id k6-v6mr6965524plt.268.1531937085503; Wed, 18 Jul 2018 11:04:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531937085; cv=none; d=google.com; s=arc-20160816; b=UjywPTT+1eaNJcl8asaqwaYhsu2kc4YxxmhUTvz0mfv8OIpId8BtrbBfcgM7z4QH8f YV1fyUG/Y1DZJrw+XCpnXUciLo6BZMr1iU/QjbtdhNQNWVLw6oqRnRez+gwIL/k2O6jj YfHrMQPvAymBRfE1rEsgPNYgEnmbldHwaQQUJABghItKg3Mrin10YNrpyPFgNPcpHI1v 5KUq7gyLv130dWGR8vC1D/tDTaZaqWr4VMXbZoKAj/evyWWjasZa6SXdnDn9G6sP1Eb3 uPp3l9Bxa7XfX+a8+qKI9Dn60ye/o5nc9lN6z7l2IQW5LNKry6uyv8EpS6KKtKlz/LCn CCZQ== 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:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature:arc-authentication-results; bh=XqE/GkBOO5tMh416y9sQ8QJef5kVVvRJiE3AHzbQi+8=; b=B6QnOuNpR8EOsR/+PXdxFPHUghwnPEFG8m8nNVnK3nW/fblb4V9beRpCh/Hi1WBblp ogLpYkiCICy7SzzlN1h4CVNPkEPHyQinDQ8x03jzf6CurjYjMEknV+mUOMVdaM13IIoh W8SWHey0UL7qGlcTD04g3/Gkxd5K8OKfbQ+K501NKmw0EzHvJuj5fqmXCr3PSNEGodEv ayOS7p+LLLq7k1LXRlpcoDNX8vxlIG1HJV0R72zAeI8O75RXLGsVPiX7pyenn0C6lceo rygRZ4xI9GVPNX52ZlOAqFGAh4+bLT1tD3FXomCEAjM0xajpFcXFEF9Yl2dVhFpadFe0 gduw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=m56tjqQI; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n1-v6si3495559pgv.641.2018.07.18.11.04.29; Wed, 18 Jul 2018 11:04:45 -0700 (PDT) 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=@google.com header.s=20161025 header.b=m56tjqQI; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731524AbeGRSm6 (ORCPT + 99 others); Wed, 18 Jul 2018 14:42:58 -0400 Received: from mail-oi0-f68.google.com ([209.85.218.68]:39525 "EHLO mail-oi0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731221AbeGRSm6 (ORCPT ); Wed, 18 Jul 2018 14:42:58 -0400 Received: by mail-oi0-f68.google.com with SMTP id d189-v6so10479411oib.6 for ; Wed, 18 Jul 2018 11:03:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=XqE/GkBOO5tMh416y9sQ8QJef5kVVvRJiE3AHzbQi+8=; b=m56tjqQIeMUCr2VI0D4zOTwRaUidffw0/UXPxUBvSpZ7Lwt8m+o253iCSAERkPS07g c9tSDGAtKiJAE3bzcR4kHNuXo8/Vm/yBV6hCQyaIRydQXK1FcbPDi/LW5vU3cqCVI11C CzC+N0OZYhQJIwHVLA69iDb1USoAA7duSTpByiAZxS9Hg4ze+23c95uTOAxBmy1I1igj X+sgJvs26pWx6AjUcAbsvXFjwc4imO1EDjaO9CqCyV60wIPzC9ukjQgnLikYJ64RY5t5 4mzIw0dmxRpEiiOjhtzf7Cqyw2nZX7KyL+Ljjui6rF0mX8snJSGsMaLAB7THRIs/SZi4 T9Wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=XqE/GkBOO5tMh416y9sQ8QJef5kVVvRJiE3AHzbQi+8=; b=evceMSsnf+m21muL9WHZLw/87HLTmcDsun9EcxQ4xo9kKLtu36I0UQkLdDb5kcpQki w+LWE9nwo+OmkO7Bl7+yFQIAiIYftrSLD6tmaJ968EQxNeDt0hYjrgbzdSeR3WbctJKu S0JURRNnrNaUt2kcFssdIYORt5QQ6ptWlF4pVsClOhjNBMvRqMWeQAlGL641qu6eNULq gpQHLC6Ax0r3WeFCOezXrvoh7faRfLF02eqzkgNiDUIndDAzKeqjeixdBh7iRy4nHDp7 QiFq8oYDT6JfIv/tQyB37CjSelJM2U1Nsy1NdLPfbpbV31u+pCL6HtzCYx++qd5xOcbI ebTg== X-Gm-Message-State: AOUpUlGWr12l/j6++7of+9g84dpSw50wL838KO7Asy0XXtWP+XS05Hzq gODsEEJUe18Y1qKJeL6xe+uIrsUaDqS0PUpaAf0q8pan X-Received: by 2002:aca:c585:: with SMTP id v127-v6mr8256199oif.348.1531937035722; Wed, 18 Jul 2018 11:03:55 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ac9:3404:0:0:0:0:0 with HTTP; Wed, 18 Jul 2018 11:03:55 -0700 (PDT) In-Reply-To: <20180718175545.GA11749@flask> References: <1531214840-24686-1-git-send-email-karahmed@amazon.de> <1531214840-24686-2-git-send-email-karahmed@amazon.de> <20180718175545.GA11749@flask> From: Jim Mattson Date: Wed, 18 Jul 2018 11:03:55 -0700 Message-ID: Subject: Re: [PATCH v5 2/2] kvm: nVMX: Introduce KVM_CAP_NESTED_STATE To: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= Cc: KarimAllah Ahmed , LKML , kvm list , Paolo Bonzini , Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , "the arch/x86 maintainers" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 18, 2018 at 10:55 AM, Radim Kr=C4=8Dm=C3=A1=C5=99 wrote: >> + vmx->nested.nested_run_pending =3D 1; > > This is not necessary. We're only copying state and do not add anything > that would be lost on a nested VM exit without prior VM entry. If nested_run_pending is blindly set on restore, then prepare_vmcs02 will do the wrong thing. For example, if there was an injected event in the vmcs12, it will get injected again, even if the vCPU has been in L2 for some time. The value of nested_run_pending should always come from the saved VMX state (a few lines above).