Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp783168imm; Wed, 18 Jul 2018 10:33:54 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdRH+dojv5+0hOgOiljhpC5E3QIcpVBxeMfKqVUFIScw2+rRrWHidIV6cHunnoJtsESbYAJ X-Received: by 2002:a17:902:8645:: with SMTP id y5-v6mr6816427plt.334.1531935234800; Wed, 18 Jul 2018 10:33:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531935234; cv=none; d=google.com; s=arc-20160816; b=iHjZ53hNXH7CxEkZTe63vQJJ+cQHzCAwAFweIJK26MhM+bpDR1Lr8lZJ2wTtJa/0NL MFuYarojUzMQDgAAov1pL0UnbcX9UHGCcj+6e+jSoPOngTp83dkwex00UajEd8zE4Qah 1oQcPZSx3i+HxYbgUz89AVOD2uEAsZiLtrjo1kwzZTc+Bj3rQnkYPkNhlGJ7ytbwL5Th kr3P73iRuLJbQ7kwquK1xpWnIDRk+pqA2cvWK8hl/37gp5OF7zfvQ7BC0HDOkVF5Trbz eV4qaSfSaweG0Abvr7Kf2mnNtkbHBUIg/fOO+YT0ahoS/QzVszTgHJcDP2IwStYK9M3V OTHA== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:cc:to:subject :dkim-signature:arc-authentication-results; bh=meYHRy8zPiPrtj05PyilguAX+u6D6hfb0GLpsDJAwAU=; b=j3386/oentykOytBV0+aKwEdb8fnCLKiZcn7g2eB02mOFMNpL6LTAGPHjAa99VFN5M 2M8v6oxbMDH3OSc4NLKD31IjzMFtc3ERe7nmoMEQCt0UCzn199JzoVlYUN+BJt7af/rF Fs4+sSxiKYKxVRkBmMEO9ieIWMZBWmNrUmxAkdWQPzDAkdz5Jckl0nYNA1F1bMeMdt37 t+xNDmkyhjXm1kBO8WbaY5UcsW7r0SZR0MB+8WfdzhKKXrkQ341ksifoC4jEriktl3lm V4LVX2wr9ZhJZX1qX1BSFiPy7NS7KNZeQQQuLcAiK2R3vXcfpdNLbRJc1tcyp++B1ALq hgKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=p74W0xjc; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n20-v6si3562021plp.298.2018.07.18.10.33.39; Wed, 18 Jul 2018 10:33:54 -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=fail header.i=@gmail.com header.s=20161025 header.b=p74W0xjc; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731567AbeGRSMA (ORCPT + 99 others); Wed, 18 Jul 2018 14:12:00 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:34082 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731025AbeGRSMA (ORCPT ); Wed, 18 Jul 2018 14:12:00 -0400 Received: by mail-wr1-f66.google.com with SMTP id c13-v6so5493440wrt.1; Wed, 18 Jul 2018 10:33:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:openpgp:autocrypt:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=meYHRy8zPiPrtj05PyilguAX+u6D6hfb0GLpsDJAwAU=; b=p74W0xjcnt5j0HRD5H7I+klawZMxxtd4bxx9NFgXoSMB0TD+RhNkMVVe7oPLEEbftL Se+df77jCElYo2OoLqWsEgq6pvDkNB34s05Dvq8JLgzekHAuuwLbTwrVHPEQRt9SZAJC OAn9ytRczDmVURu2w42PNplCG4wa+q2Ynvb98wiZED+Idain1NyPWn2MP9CZM+NcokFz yJ9IRw75mSQuAlFnmuKpUTbMnzhTfB3VLXEO+fZ5x5jp2tqLFpKpZO0geykOH89FTaRP WGrkVLKmcQWeSPhlkpKRzBlz5OeLjc/KB0whVtrgc5XJhS78V6UWA8I3ybhOo8Ll/XA7 +b5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:openpgp :autocrypt:message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=meYHRy8zPiPrtj05PyilguAX+u6D6hfb0GLpsDJAwAU=; b=lEgTypvmOuh3XF/kZseuDNlmhDig9pSEYclrP6yjGAzUaI/m6AooscVQmXR9y8mJ66 RJzF+4bj3FKE0GTifsUpdkyQr0AjIckxI3M17MgZ1R2VX4jMrkDywPod363O9E/xIm2+ R8TKxSxpErAKbkYl5jynGG547yiS+xw5UzoPUujXwxA+mVGWjQm/BsaATbeM15YV4AES 0R7torU6yI1NUuLXGPzf45afj/IN9F0QqMhoJ7t8zyuLAMbRwMMZC+4gsx5hgca+eOXW FhWvh6uvFU0HXn+/rDFVnbCghDe/zPbNuwJmm/WzFJKS7wumgT996Pe96DnJ50Op+XS+ GqfA== X-Gm-Message-State: AOUpUlHRwnXVNQveU9zae98PcAkh2tH/a/VJuAvid7TAjLCn1bBs5YRK dO0GNeVTH2q8bFAyFndeM58= X-Received: by 2002:adf:fe8f:: with SMTP id l15-v6mr5317010wrr.165.1531935183408; Wed, 18 Jul 2018 10:33:03 -0700 (PDT) Received: from [192.168.10.150] (dynamic-adsl-78-12-156-57.clienti.tiscali.it. [78.12.156.57]) by smtp.googlemail.com with ESMTPSA id l10-v6sm10214130wrv.23.2018.07.18.10.33.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Jul 2018 10:33:02 -0700 (PDT) Subject: Re: [PATCH v5 2/2] kvm: nVMX: Introduce KVM_CAP_NESTED_STATE To: KarimAllah Ahmed , linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: Jim Mattson , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , x86@kernel.org References: <1531214840-24686-1-git-send-email-karahmed@amazon.de> <1531214840-24686-2-git-send-email-karahmed@amazon.de> From: Paolo Bonzini Openpgp: preference=signencrypt Autocrypt: addr=pbonzini@redhat.com; keydata= xsEhBFRCcBIBDqDGsz4K0zZun3jh+U6Z9wNGLKQ0kSFyjN38gMqU1SfP+TUNQepFHb/Gc0E2 CxXPkIBTvYY+ZPkoTh5xF9oS1jqI8iRLzouzF8yXs3QjQIZ2SfuCxSVwlV65jotcjD2FTN04 hVopm9llFijNZpVIOGUTqzM4U55sdsCcZUluWM6x4HSOdw5F5Utxfp1wOjD/v92Lrax0hjiX DResHSt48q+8FrZzY+AUbkUS+Jm34qjswdrgsC5uxeVcLkBgWLmov2kMaMROT0YmFY6A3m1S P/kXmHDXxhe23gKb3dgwxUTpENDBGcfEzrzilWueOeUWiOcWuFOed/C3SyijBx3Av/lbCsHU Vx6pMycNTdzU1BuAroB+Y3mNEuW56Yd44jlInzG2UOwt9XjjdKkJZ1g0P9dwptwLEgTEd3Fo UdhAQyRXGYO8oROiuh+RZ1lXp6AQ4ZjoyH8WLfTLf5g1EKCTc4C1sy1vQSdzIRu3rBIjAvnC tGZADei1IExLqB3uzXKzZ1BZ+Z8hnt2og9hb7H0y8diYfEk2w3R7wEr+Ehk5NQsT2MPI2QBd wEv1/A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IhxvDY0hUQE4r8ZbGRLn52bEzaIPgl1p/adKfeOUeMReg/CkyzQpmyB1TSk8lDMxQ zCYHXAzwnGi8WU9iuE1P0wARAQABwsEzBBgBAgAJBQJUQnHuAhsMAAoJEH4VEAzNNmmxp1EO oJy0uZggJm7gZKeJ7iUpeX4eqUtqelUw6gU2daz2hE/jsxsTbC/w5piHmk1H1VWDKEM4bQBT uiJ0bfo55SWsUNN+c9hhIX+Y8LEe22izK3w7mRpvGcg+/ZRG4DEMHLP6JVsv5GMpoYwYOmHn plOzCXHvmdlW0i6SrMsBDl9rw4AtIa6bRwWLim1lQ6EM3PWifPrWSUPrPcw4OLSwFk0CPqC4 HYv/7ZnASVkR5EERFF3+6iaaVi5OgBd81F1TCvCX2BEyIDRZLJNvX3TOd5FEN+lIrl26xecz 876SvcOb5SL5SKg9/rCBufdPSjojkGFWGziHiFaYhbuI2E+NfWLJtd+ZvWAAV+O0d8vFFSvr iy9enJ8kxJwhC0ECbSKFY+W1eTIhMD3aeAKY90drozWEyHhENf4l/V+Ja5vOnW+gCDQkGt2Y 1lJAPPSIqZKvHzGShdh8DduC0U3xYkfbGAUvbxeepjgzp0uEnBXfPTy09JGpgWbg0w91GyfT /ujKaGd4vxG2Ei+MMNDmS1SMx7wu0evvQ5kT9NPzyq8R2GIhVSiAd2jioGuTjX6AZCFv3ToO 53DliFMkVTecLptsXaesuUHgL9dKIfvpm+rNXRn9wAwGjk0X/A== Message-ID: Date: Wed, 18 Jul 2018 19:33:01 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <1531214840-24686-2-git-send-email-karahmed@amazon.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/07/2018 11:27, KarimAllah Ahmed wrote: > @@ -11772,7 +11772,6 @@ static int enter_vmx_non_root_mode(struct kvm_vcpu *vcpu) > if (prepare_vmcs02(vcpu, vmcs12, &exit_qual)) > goto fail; > > - nested_get_vmcs12_pages(vcpu, vmcs12); > > r = EXIT_REASON_MSR_LOAD_FAIL; > msr_entry_idx = nested_vmx_load_msr(vcpu, I think this is not enough, the MSR load should not be redone on KVM_SET_NESTED_STATE. This issue is preexisting and happens for SMM exit as well. SMM exit in fact also needs to defer nested_get_vmcs12_pages, or the pages could be read from SMRAM. I'll send a v6 patch and a testcase, and in the meanwhile I have applied patch 1. Paolo