Received: by 10.192.165.148 with SMTP id m20csp37438imm; Thu, 26 Apr 2018 15:29:50 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+brI8JfLQQyNeKe4dLapLovEDK/FpiM823CsM3LUKAnKKanL/ZPsR5JIfUP/MWOU/li6k4 X-Received: by 2002:a17:902:2468:: with SMTP id m37-v6mr36370501plg.388.1524781790312; Thu, 26 Apr 2018 15:29:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524781790; cv=none; d=google.com; s=arc-20160816; b=Of772CT65GKSAwZX3b6OcqM5WOm7OsNhzgI7jaOCZKwYvyXVhSWkjzl2qhSrtsWAQ+ fIOJPBHzVMjtVLH5KHWcJKPAU3i78ZeJpCGxSeNm1UrbNBD+/6WwWu3neXtdMkdq2S3s yVEBSbDTLkSrVjpxT16K3iFBC3P08V6OfbLr7/+Crroz9Tu0NzLHnY+ZeO2lpIikTYet cwxUGypXV7XCQg8CLk1BG+m8pDKLPTeWBMmKY7mIGbxktOZvSYfKvB+d5GeYOuKR5EjZ c4NgbXe/5NaBqSOKqWLcaSEKamsokb023e40C/dgdhFQxr2h06a4YAGYXIf/59TW3Qx6 ra+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=333TWPCI2vZ1w33DCI9eNDgDcq3UT9r61qiVD1Qmdk8=; b=kalWIL8vm4xgSSF4JUut/sOC5WtzuYUhYzc2Q+8pQ9g3d1C4rOcl8jBFI0Ao6vmeDl 3EVvTEQxEE6W7DCFi5kdmOMj3clx54NGuZ/BaXlO0yc+VYpp5V5VKVHh5A/USPbuSzPr jshPPzjWhqJF6tXVQJs1Lju/PA2a8h0uCDAq0ZNkTq0+eu1c7CTXLGcqgHrB86P1r6Np 6fHzv9lNvob2/ifdKqql/TgiHvxFDFspHmOmdnMgdRYhmYg2S/vvYknB3WRMVXRw+9TV fVm+1tSCxlmBzCizA5qkwpkXRnVer/I9IiNLquzDsX9xRtSmvHTV0rEGklJg8ro1aalB 221Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=RAJW5pOQ; 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 d9si15792068pge.290.2018.04.26.15.29.32; Thu, 26 Apr 2018 15:29:50 -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=RAJW5pOQ; 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 S1754750AbeDZW2R (ORCPT + 99 others); Thu, 26 Apr 2018 18:28:17 -0400 Received: from mail-ot0-f180.google.com ([74.125.82.180]:33790 "EHLO mail-ot0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753881AbeDZW2P (ORCPT ); Thu, 26 Apr 2018 18:28:15 -0400 Received: by mail-ot0-f180.google.com with SMTP id l22-v6so20711698otj.0 for ; Thu, 26 Apr 2018 15:28:15 -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; bh=333TWPCI2vZ1w33DCI9eNDgDcq3UT9r61qiVD1Qmdk8=; b=RAJW5pOQKXx9plk9Pp0qdzgJjxJ5Db9mLV9RbnzUklaxR04+pomyxMo23/N1xeYA1K A//V31Y77xYvNVy8rv+BNJ0IGkRt7P1Qr4XuHRk0XJinsCAerFwUV5+J4WIfjR7MN/Wb iCJsHU+J5i+z+HLFpA84miJBVNZyLBzXLr7vBNv1iaPnwwpW65CmOsSCbBotHzruCXi0 ZIh+b0aSRErvIh8QvjXtwRq0lyJxmNdvtIia9bPk5v8x1WaABumpsBlZf5hL2W2XdeHe NUVYGvdtTJD85URT+vwRbZDCR5norebIMUMx7JCWJd7H0UdMP1xbSgsEPzDSDF9DQsE/ yb1g== 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; bh=333TWPCI2vZ1w33DCI9eNDgDcq3UT9r61qiVD1Qmdk8=; b=VX1jPbJYNSadp/6e9AHOnBG5q0LFslsG2WzvTHQKOnVg3tphe67Xj4mW+BxknwBsAx ZHvFDOwkDFwlzhcZ41mcJvDj4FBklkNARusb+lZGJdQ62JatArv827BKrktpHETOy3c7 P3Gofmrkp1pJoJGtHw20Mwkscb2wV68v9D/8P+SutIEznPcNtSligk1ZJ8oCW5PvKxkR UqltXiwCKj+59deO7wIRfOz3o/CZ0qnFjhUy8ph1kH1OJ7hl2tzo7qieSQPqmV3tYJfx DfrQIbhPDAzyKEuuWVK8q1g72ULBdr5PHw8hhaf5f55CBgMjj1TN4MkTdW3ib0aQizJ6 C10g== X-Gm-Message-State: ALQs6tD2ge3h9GygpC2krKEujvcX20x44zvP/lTissOxkaz0kMAkb4Pt krbOiJKx12fHsutadnjRp4uLqLhCbFL1iCaIv1jLxg== X-Received: by 2002:a9d:e6d:: with SMTP id n42-v6mr19037996otd.171.1524781694585; Thu, 26 Apr 2018 15:28:14 -0700 (PDT) MIME-Version: 1.0 Received: by 10.201.52.2 with HTTP; Thu, 26 Apr 2018 15:28:13 -0700 (PDT) In-Reply-To: <1523898937.22952.13.camel@amazon.de> References: <1523545958-28059-1-git-send-email-karahmed@amazon.de> <1523545958-28059-2-git-send-email-karahmed@amazon.de> <1523898937.22952.13.camel@amazon.de> From: Jim Mattson Date: Thu, 26 Apr 2018 15:28:13 -0700 Message-ID: Subject: Re: [PATCH 2/2] kvm: nVMX: Introduce KVM_CAP_STATE To: "Raslan, KarimAllah" Cc: "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "tglx@linutronix.de" , "x86@kernel.org" , "hpa@zytor.com" , "mingo@redhat.com" , "pbonzini@redhat.com" , "rkrcmar@redhat.com" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I'll send out a patch to deal with nested_run_pending. The other thing that comes to mind is that there are some new fields in the VMCS12 since I first implemented this. One potentially troublesome field is the VMX preemption timer. If the current timer value is not saved on VM-exit, then it won't be stashed in the shadow VMCS12 by sync_vmcs12. Post-migration, the timer will be reset to its original value. Do we care? Is this any different from what happens on real hardware when there's an SMI? According to the SDM, this appears to be exacty what happens when the dual-monitor treatment of SMIs and SMM is active, but it's not clear what happens with the default treatment of SMIs and SMM. On Mon, Apr 16, 2018 at 10:15 AM, Raslan, KarimAllah wrote: > On Mon, 2018-04-16 at 09:22 -0700, Jim Mattson wrote: >> On Thu, Apr 12, 2018 at 8:12 AM, KarimAllah Ahmed wrote: >> >> > >> > v2 -> v3: >> > - Remove the forced VMExit from L2 after reading the kvm_state. The actual >> > problem is solved. >> > - Rebase again! >> > - Set nested_run_pending during restore (not sure if it makes sense yet or >> > not). >> >> This doesn't actually make sense. Nested_run_pending should only be >> set between L1 doing a VMLAUNCH/VMRESUME and the first instruction >> executing in L2. That is extremely unlikely at a restore point. > > Yeah, I am afraid I put very little thought into it as I was focused > on the TSC issue :) > > Will handle it properly in next version. > >> >> To deal with nested_run_pending and nested save/restore, >> nested_run_pending should be set to 1 before calling >> enter_vmx_non_root_mode, as it was prior to commit 7af40ad37b3f. That >> means that it has to be cleared when emulating VM-entry to the halted >> state (prior to calling kvm_vcpu_halt). And all of the from_vmentry >> arguments that Paolo added when rebasing commit cf8b84f48a59 should be >> removed, so that nested_run_pending is propagated correctly duting a >> restore. >> >> It should be possible to eliminate this strange little wart, but I >> haven't looked deeply into it. >> > Amazon Development Center Germany GmbH > Berlin - Dresden - Aachen > main office: Krausenstr. 38, 10117 Berlin > Geschaeftsfuehrer: Dr. Ralf Herbrich, Christian Schlaeger > Ust-ID: DE289237879 > Eingetragen am Amtsgericht Charlottenburg HRB 149173 B