Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp976923imm; Wed, 18 Jul 2018 14:12:28 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeybW1umoDeSeovLstZFZmuiYtGZOpS2sCkzUh5qi3cU/geEXXwTLA81CGC2xrA6rX9z2fu X-Received: by 2002:a17:902:f83:: with SMTP id 3-v6mr7365672plz.282.1531948348297; Wed, 18 Jul 2018 14:12:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531948348; cv=none; d=google.com; s=arc-20160816; b=A70XDc4oztjvu0spWN5TKHr4B4WBLCC2vigBBPp1AQnGFuBspczS36C6CpGiKe+4+I x3khmUBCOGJ1jHzXXlxmQKd/m9r/XtVqv+1eBlz9THzZQFCk3IRuUqC78VPIO8TImzk+ //7ikdWhekW/tN5eQiH+1RZdO2TZl7FqClWLuqzxem233x0IIAKRGoPUMA+GSez3R2BP 28ThlJQJFbeWBf9DTDBiI72WFG3xvlgKtWIxJLzDZbsY8tWz9n67Ftb63jEFMX5ICVTn 8996fOShpZ7KboGbpZKXBXXqTzy1pu6RrZqU3Wm8/QiCqm7ihAbSui+nLOES8Jn/aZiz jGDg== 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=2m6PcbCBII0gfP0WfVMQlfKrHwq3IqseGAR3Fiwiaq8=; b=iT4sXc3trsHn9DLUZkbuxL5UWAhS63Uca8Xr3Z7Zn8D/4mbHddOXE57N4n3FWUUYTA +ZNY80WeC4+ENzrCZ1uLmhnLrTva2xM7o7N7iJF/nNEenNmbIt53/1/kp8GxbC8x1Vte vZCSQburYgc/ve1w8/A4skSPW+W89ZWlAUWdm8teIiv1vKUFqcSrS/wzOZd7LkzOkDo3 w0tRg6pvJ7t7u2F7jevrLLtep/DVsi7fC+GWeNvmr1T3uMdF4uuyLjk7WNyhD2+T1xIP l/MaB1hurYtHwUf8Ow0YvUT9W1lmgbkiYOMI+7UgpPmsXGyO2a9WfvK2UcPUs/j2/Y8D MDLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b="S+le/n6b"; 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 x6-v6si4178843pgk.597.2018.07.18.14.11.49; Wed, 18 Jul 2018 14:12:28 -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="S+le/n6b"; 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 S1729638AbeGRVt6 (ORCPT + 99 others); Wed, 18 Jul 2018 17:49:58 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:40913 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726992AbeGRVt6 (ORCPT ); Wed, 18 Jul 2018 17:49:58 -0400 Received: by mail-wm0-f68.google.com with SMTP id z13-v6so4207179wma.5; Wed, 18 Jul 2018 14:10:14 -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=2m6PcbCBII0gfP0WfVMQlfKrHwq3IqseGAR3Fiwiaq8=; b=S+le/n6bUgYuwzP36ffn57WUdXlH3xrNTN4l8xfDXuz8239cQPfudNosrFQKXFDL6l Vyb5SRCuzWz4WTKQ+QUVsYO8BRT9Sy5Zam4sgcmLbtCIHsM9oyNPdXHiwPEh/BxDlvox /YgGuanz6TtuzBNSM//FpSsvHfudC6vKuXiTDjZsmxto+1TfYz/pkok9RI8wD5/I1w81 kt6qpsvgnnR7jR9tEac8/NB+ad3Zwt51hkr4V19IjxcqEUgtVqi3/idkwZTMB/CXhzcZ dVqKkdTGDk3O82RCnZm+AoV3AmXPeBZAwnaCSSOLEOKSdfZ1z5kYXm4jDR45nPgyd3RH IMQA== 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=2m6PcbCBII0gfP0WfVMQlfKrHwq3IqseGAR3Fiwiaq8=; b=pMCuTF0PXrO+BEtd6rGi23TJpZ1FfaNrd2Ib5QhYM2smuqvymy7W8RsbZyHI/Ku2Yl 64mBdOtRW71sGajGTWmtkK5zW+y9TcWpZnikd7CBEO52ij23O+UgZ6G1nwT+cHgih0r5 URtDKpkHwHi+ztkmvnXTvvdgXyfBq/PLOUBwqoId8ekc/O9qlz6tOWrzBHQa+SewVGfz E8SlhqXKnDReepbAq0QEpAmA+EsViAe6V22IGDayw7i1qLPqTIyNn1CbZ/RzlBl+f0WU my9l6gYFzp1/3ZMFpZGdvrx9GzYNlkWxsYg2lW5lTUfFTsYaPWqtlklsBMmRXYamgi51 z8ew== X-Gm-Message-State: AOUpUlGi0ffocFLRvk98y3VWWS//KiNZeLSEJTf6vvgkNvp0qieqXuik gcOjXfigmyDU953xCDFfrQE= X-Received: by 2002:a1c:e708:: with SMTP id e8-v6mr2613611wmh.134.1531948213491; Wed, 18 Jul 2018 14:10:13 -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 l16-v6sm2247446wme.36.2018.07.18.14.10.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Jul 2018 14:10:12 -0700 (PDT) Subject: Re: [PATCH v5 2/2] kvm: nVMX: Introduce KVM_CAP_NESTED_STATE To: Jim Mattson , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= Cc: KarimAllah Ahmed , LKML , kvm list , Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , the arch/x86 maintainers References: <1531214840-24686-1-git-send-email-karahmed@amazon.de> <1531214840-24686-2-git-send-email-karahmed@amazon.de> <20180718175545.GA11749@flask> 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+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rePYhSY4uuIV02v02 8TVAaYbIhxvDY0hUQE4r8ZbGRLn52bEzaIPgl1p/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: <8653119f-0ac4-7937-225b-16ef0977528b@redhat.com> Date: Wed, 18 Jul 2018 23:10:10 +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: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 18/07/2018 20:03, Jim Mattson wrote: > On Wed, Jul 18, 2018 at 10:55 AM, Radim Krčmář wrote: > >>> + vmx->nested.nested_run_pending = 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). > Yep, and there are a couple other things that need adjustment. Stay tuned... Paolo