Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2146159ybl; Thu, 5 Dec 2019 12:52:55 -0800 (PST) X-Google-Smtp-Source: APXvYqz/OHH4jUruZ13ZVgj21RuQUW2RJqw36w4TjFO26nfVu1rfFsw1/gXMLOAX/Fxji/pqWFJM X-Received: by 2002:a9d:708f:: with SMTP id l15mr8710292otj.286.1575579175274; Thu, 05 Dec 2019 12:52:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575579175; cv=none; d=google.com; s=arc-20160816; b=DxAKOeygVqg/5f2rW1sHwg0310fte+P/fghrs5NRFNhQwAYdF4VGQYnhLN2C2JIXZ+ FnSqtEvy5/IaN/WBFvwmRFQwMfO76b0iLQQEoIUD97Y/ihxLiehRCwSd0c9WPnKOXdkw wIoIm7TsEuSXMmavjYQvlcQADyGh5ScgRPz33tgiUMBolV563ok4lCZjWXIC0U/gzVV3 fJxrPwdLd6Z4dxfUn1qmYhtBuUffcJsWnyDJdt8vsDfFebIDvlfHVVulTNpcHNjuUA7V 3+xIL9FRK/PEj6yeLQ1XLczYv2xfNPMxiu6QuF4zdagl4WcsLzwhneUigJfylezXhsSF GuJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=esyZevaXdkhJjUMNx13nyp+9Eluo1ToosFQUPVH2VNs=; b=GUA1o/Ewk+Qtg+q+SmzERXEiTwTSl5Er13anXXVMzPc1JjRM3EiD0T/V0o+7jQOcvs OPfo5I50AEToA9uEzC3qvoy7ftZ2qf/onjFnNwMkmsge0kcKmq+1ZECHoTUkaRgaPLTK d056wax4sLyGSKtgCFJ0OIPDfAya8gk762JC6cyrQtAAHCsyxDUqCsBancza2uJ2f6bt 36HYnDCPvX7aGx4ZqK2WbCxOnt4p4K7fktqTeCSMqtpmrP7s2s6rovMOcJMxjhAJaLVh cgQwqc4jcuLEE6qTlzmLogOQ4v+I7JqOjfoB0XrL7fMfXB1z0gzBagOvcIR4PhBmZBd8 R3SQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=epHmOUmV; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f188si5905910oia.70.2019.12.05.12.52.41; Thu, 05 Dec 2019 12:52:55 -0800 (PST) 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=@linaro.org header.s=google header.b=epHmOUmV; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730675AbfLEUwM (ORCPT + 99 others); Thu, 5 Dec 2019 15:52:12 -0500 Received: from mail-yb1-f194.google.com ([209.85.219.194]:40777 "EHLO mail-yb1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730264AbfLEUwL (ORCPT ); Thu, 5 Dec 2019 15:52:11 -0500 Received: by mail-yb1-f194.google.com with SMTP id n3so2057823ybm.7 for ; Thu, 05 Dec 2019 12:52:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=esyZevaXdkhJjUMNx13nyp+9Eluo1ToosFQUPVH2VNs=; b=epHmOUmVY5XkxCHYw6AAnfY9JySDXyEZKHaF6sJV4EyJ+bSwyM1GK54ZM1ailY+lV3 0Nn8ofg9UOzrfqHhstT6+V1J8dp1S6GUk3GaXYRaEp4zV6R37ZUkRxlcQ/c7xBqZDjDf 5l+JW4DDsiuYkaRkCF9f1HpLDPJb5/RHjHQEa7l1E7L+0Uzm7qStowX6lY825AjlSUHk 9Bc3lSgjBOhhquvmlFXzSoYCXi/uX8v+rUeerc/1jNz/R7/StUnAKsY6Zd8YIWWBay5c fPZlwbiE9nc6uR+uedEJFOhetl59OSR/hH7G38atXZU7zQ2+hHXZHnA5uUUo2oDiFUcd wHIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :content-transfer-encoding:in-reply-to; bh=esyZevaXdkhJjUMNx13nyp+9Eluo1ToosFQUPVH2VNs=; b=Tja7TKjESE2jNG8AzA1N1GC7PG+ngNLm1pklp+5KtG4C6lVVBn/U2z5yQgilO9OjzV AlNFzE2VUf3YpFm8R1H0W5CXQl8721wcbZNwos4tyAqD+/hNpVxfmCsfb51MAUsEsSt4 D/I150Irx2i8gJZkmYLQh7fWB5xID6/X6GGD3I4GqfqzD/tkyY92CHailVA773J00q5G PQ1xmiF2NA46BdH1P6BM9E/WyaImVvEn/mSO8IyRze3zWzge63R/Fdoe+GAVCOf19lrc XymJYPh1DruIoAFV76/bjEzfxyQ6TZwyCXOjpO9t0edfqkxsrGkhBlbXU5qEnI2C1t0Z rRow== X-Gm-Message-State: APjAAAX0ELdRaE8/Azk7LSiuyBQDKGGRBU3JbeOKxI+DiS4CwxSbHDdO iOj+PsnivG7U4DGdRRzMdZxfKA== X-Received: by 2002:a25:bb87:: with SMTP id y7mr8259383ybg.473.1575579129251; Thu, 05 Dec 2019 12:52:09 -0800 (PST) Received: from localhost (c-75-72-120-115.hsd1.mn.comcast.net. [75.72.120.115]) by smtp.gmail.com with ESMTPSA id 199sm5159675ywn.52.2019.12.05.12.52.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Dec 2019 12:52:08 -0800 (PST) Date: Thu, 5 Dec 2019 14:52:06 -0600 From: Dan Rue To: Jack Wang Cc: Greg Kroah-Hartman , linux-kernel@vger.kernel.org, stable , Sean Christopherson , Jim Mattson , Paolo Bonzini , Sasha Levin Subject: Re: [PATCH 4.19 067/306] KVM: nVMX: move check_vmentry_postreqs() call to nested_vmx_enter_non_root_mode() Message-ID: <20191205205206.2mnr3dj2slamuhrl@xps.therub.org> Mail-Followup-To: Jack Wang , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, stable , Sean Christopherson , Jim Mattson , Paolo Bonzini , Sasha Levin References: <20191127203114.766709977@linuxfoundation.org> <20191127203119.676489279@linuxfoundation.org> <20191204175033.smve4dleem2ht7st@xps.therub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 05, 2019 at 10:51:18AM +0100, Jack Wang wrote: > Dan Rue 于2019年12月4日周三 下午6:50写道: > > > > On Mon, Dec 02, 2019 at 03:40:04PM +0100, Jack Wang wrote: > > > Greg Kroah-Hartman 于2019年11月27日周三 下午10:30写道: > > > > > > > > From: Sean Christopherson > > > > > > > > [ Upstream commit 7671ce21b13b9596163a29f4712cb2451a9b97dc ] > > > > > > > > In preparation of supporting checkpoint/restore for nested state, > > > > commit ca0bde28f2ed ("kvm: nVMX: Split VMCS checks from nested_vmx_run()") > > > > modified check_vmentry_postreqs() to only perform the guest EFER > > > > consistency checks when nested_run_pending is true. But, in the > > > > normal nested VMEntry flow, nested_run_pending is only set after > > > > check_vmentry_postreqs(), i.e. the consistency check is being skipped. > > > > > > > > Alternatively, nested_run_pending could be set prior to calling > > > > check_vmentry_postreqs() in nested_vmx_run(), but placing the > > > > consistency checks in nested_vmx_enter_non_root_mode() allows us > > > > to split prepare_vmcs02() and interleave the preparation with > > > > the consistency checks without having to change the call sites > > > > of nested_vmx_enter_non_root_mode(). In other words, the rest > > > > of the consistency check code in nested_vmx_run() will be joining > > > > the postreqs checks in future patches. > > > > > > > > Fixes: ca0bde28f2ed ("kvm: nVMX: Split VMCS checks from nested_vmx_run()") > > > > Signed-off-by: Sean Christopherson > > > > Cc: Jim Mattson > > > > Reviewed-by: Jim Mattson > > > > Signed-off-by: Paolo Bonzini > > > > Signed-off-by: Sasha Levin > > > > --- > > > > arch/x86/kvm/vmx.c | 10 +++------- > > > > 1 file changed, 3 insertions(+), 7 deletions(-) > > > > > > > > diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c > > > > index fe7fdd666f091..bdf019f322117 100644 > > > > --- a/arch/x86/kvm/vmx.c > > > > +++ b/arch/x86/kvm/vmx.c > > > > @@ -12694,6 +12694,9 @@ static int enter_vmx_non_root_mode(struct kvm_vcpu *vcpu, u32 *exit_qual) > > > > if (likely(!evaluate_pending_interrupts) && kvm_vcpu_apicv_active(vcpu)) > > > > evaluate_pending_interrupts |= vmx_has_apicv_interrupt(vcpu); > > > > > > > > + if (from_vmentry && check_vmentry_postreqs(vcpu, vmcs12, exit_qual)) > > > > + return EXIT_REASON_INVALID_STATE; > > > > + > > > > enter_guest_mode(vcpu); > > > > > > > > if (!(vmcs12->vm_entry_controls & VM_ENTRY_LOAD_DEBUG_CONTROLS)) > > > > @@ -12836,13 +12839,6 @@ static int nested_vmx_run(struct kvm_vcpu *vcpu, bool launch) > > > > */ > > > > skip_emulated_instruction(vcpu); > > > > > > > > - ret = check_vmentry_postreqs(vcpu, vmcs12, &exit_qual); > > > > - if (ret) { > > > > - nested_vmx_entry_failure(vcpu, vmcs12, > > > > - EXIT_REASON_INVALID_STATE, exit_qual); > > > > - return 1; > > > > - } > > > > - > > > > /* > > > > * We're finally done with prerequisite checking, and can start with > > > > * the nested entry. > > > > -- > > > > 2.20.1 > > > > > > > > > > > > > > > Hi all, > > > > > > This commit caused many kvm-unit-tests regression, cherry-pick > > > following commits from 4.20 fix the regression: > > > > Hi Jack - can you be more specific about the failing tests? What type of > > environment and which tests failed, which version of kvm-unit-tests? Do > > you have any logs available? I ask because we do run kvm-unit-tests on > > x86 and arm64 but we did not see these regressions. > > > > Thanks, > > Dan > > > Hi Dan, > > I'm running at kvm-unit-tests commit b1414c5f0142 ("x86: vmx: fix > required alignment for posted interrupt descriptor") > > using "run_tests.sh -a -t -j8" with qemu-2.7.1 > > Left side has only 78 tests ok, and right side has 112 tests ok. Thanks - so we run it with "run_tests.sh -v" and only see 43 passes in the best case. Besides missing -a, we see a skip for the vmx related tests because vmx isn't enabled in our environment. We will fix those problems in LKFT so that we can catch regressions like this before they are released. Dan