Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp783109ybl; Wed, 4 Dec 2019 10:48:21 -0800 (PST) X-Google-Smtp-Source: APXvYqwlwnVluP8RN7Sb3a9YmdCHlyAsMUGWwguqZImVDIJdR/wAua1EUQ3ZYS/RBPiYt7g44lfE X-Received: by 2002:a05:6830:1cc4:: with SMTP id p4mr3502239otg.349.1575485301282; Wed, 04 Dec 2019 10:48:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575485301; cv=none; d=google.com; s=arc-20160816; b=KtRi5LkzPrU98DF1rboMgMrcdQdS9p79rzA13IsP0E3zypNzanzA5+zhmmH5GDeCK7 fnkii1PoVc+tBkG5zGFYOzIxuK4aUZemI8LtEvKkxRsA/MKq1eJBNhivIZLDhCB1/iWr EiC54+mFeUftReNOoHC5Lmkh+FsJZa2SEcxzvE0zN/F+9qAyi+a6fbUkIRUl2mSvhP+M tWmZ11vm8lYzC8IrpxAQi8/ioiyFYRxbewYdbxbUXmnoOlKcU6Rrjp1DDIzJ+/EYQSBt JUQ/+O86cRUfV59QAeGZQ+d5djFtRDk+WmXhXwwo/pHyaMezb/AeVROK/M4v0VuW0Beq PXZA== 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=TeAcDw9r1twHj7MlWZVEGGHkOn4NNgX/nZFZTFL2GrY=; b=rofRjtO3MKc+WerbiS+LjMnFTDov6Z4PUNIt7iH+8ix/KaD65k6XaU0mCOWtqNDu85 DI4xKGZC56UCRE/AZ7bXg1v63On2p+KuQQ0YFJutxoe63o92KDlJDkdmAIAv4awZxlvX rx6WB6LeYMEQ9E1sHn/9BqPSxEiZjmsnVNG+DscUG1ZrIRPDj7tJcon1n11fBKPOdlOq 9bZj0T2ETK+rsbUILFdiA1Ga+EWLup0kiwCYR5dks8hu5rlIO2nqkduINLk5pstHB7ER UpYuDTj5xMy5TWRKEwDaYbm4y+MSvYYt8l/BJnuK3oGPelxQEwNR/b6+r9SR3SWq9fWH H+BA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AWTRPIh4; 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 e5si3794344otr.247.2019.12.04.10.48.08; Wed, 04 Dec 2019 10:48:21 -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=AWTRPIh4; 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 S1728142AbfLDRuh (ORCPT + 99 others); Wed, 4 Dec 2019 12:50:37 -0500 Received: from mail-yb1-f193.google.com ([209.85.219.193]:34611 "EHLO mail-yb1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727852AbfLDRuh (ORCPT ); Wed, 4 Dec 2019 12:50:37 -0500 Received: by mail-yb1-f193.google.com with SMTP id k17so318376ybp.1 for ; Wed, 04 Dec 2019 09:50:36 -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=TeAcDw9r1twHj7MlWZVEGGHkOn4NNgX/nZFZTFL2GrY=; b=AWTRPIh4806nX1sp0olNxaEw/rTmOJaREKiTvC1dn2tylnhBSeGXRUkrYHT/rLfXIm WbwEW3tQb78Povu626dqPs/7SgaZ1Fmb+ohDR8JDU4G/sqlcDY6mY1yN9UVuEhUa2E5t j4RFDFze86uCm6XSdS2okkq/WG5iLetbSt0QhXgpYlSOETKHtvZurAxaqX2eZM1v40GS ohC7J6DfKODtzAsxDGUhb5NK/Ul1E1vWXlMP79VQOwnmeY6NOnR+85t1vCph1kUt8bXS yYkaKCR0Qo91Oze2L8BxNZNWmag6FHHtkRJkBl7dTWmPgazCCLAywqullgN/I8g5ubN1 Ys6Q== 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=TeAcDw9r1twHj7MlWZVEGGHkOn4NNgX/nZFZTFL2GrY=; b=Q2kFY4dsR5qTGIekM5bOjs4vWhHh2CJKfmkLKv2h5FDkhsazz/NlZzwDhHfEsogzbJ YQvrXXePpmC2t2nBKJRiL4oefKT4Cn+UZFlXZsFu4GEKXxbXEGFJ3XHpD8Jf61JEOPKP zSNVp/9gbWs8CjekBdufJOi/0hdpxbEOxpu0s3UPFzTA8ffRMt2zwkSe7UtWdewHzArX ReQ8XHqsT1QmqVOSRed/cNWeewMLCt+mywT12mC91d67qiR8h9hfn5LDkW2YGvAuhjaU DS1E2MMCydN6op7xMdvUdWb75QxLTA+obPBQATh3OMSg09oZBsCvxFrtvbPehzSza0jh Nkew== X-Gm-Message-State: APjAAAWsJ6KPwRgfDJ64RtSIisu+S8fIUrPJMBlngs7JlbA89Bs69f8g PTHSOyTq4iyUDoXNphM8k+VohQ== X-Received: by 2002:a25:b3ce:: with SMTP id x14mr3291798ybf.251.1575481835367; Wed, 04 Dec 2019 09:50:35 -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 y9sm3298731ywc.19.2019.12.04.09.50.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Dec 2019 09:50:34 -0800 (PST) Date: Wed, 4 Dec 2019 11:50:33 -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: <20191204175033.smve4dleem2ht7st@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> 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 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 > d63907dc7dd1 ("KVM: nVMX: rename enter_vmx_non_root_mode to > nested_vmx_enter_non_root_mode") > a633e41e7362 ("KVM: nVMX: assimilate nested_vmx_entry_failure() into > nested_vmx_enter_non_root_mode()") > > Regards, > Jack Wang > 1 & 1 IONOS SE -- Linaro LKFT https://lkft.linaro.org