From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3ACEC10F13 for ; Thu, 11 Apr 2019 16:29:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A4D6F2133D for ; Thu, 11 Apr 2019 16:29:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726603AbfDKQ3y (ORCPT ); Thu, 11 Apr 2019 12:29:54 -0400 Received: from mga07.intel.com ([134.134.136.100]:5005 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726538AbfDKQ3y (ORCPT ); Thu, 11 Apr 2019 12:29:54 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Apr 2019 09:29:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,338,1549958400"; d="scan'208";a="160338017" Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.181]) by fmsmga002.fm.intel.com with ESMTP; 11 Apr 2019 09:29:52 -0700 Date: Thu, 11 Apr 2019 09:29:53 -0700 From: Sean Christopherson To: Paolo Bonzini Cc: Krish Sadhukhan , kvm@vger.kernel.org, rkrcmar@redhat.com, jmattson@google.com Subject: Re: [PATCH 5/6 v5][KVM nVMX]: nested_vmx_check_vmentry_postreqs() should return VMX_EXIT_REASONS_FAILED_VMENTRY | EXIT_REASON_INVALID_STATE for error conditions Message-ID: <20190411162952.GC29427@linux.intel.com> References: <20190408213516.17966-1-krish.sadhukhan@oracle.com> <20190408213516.17966-6-krish.sadhukhan@oracle.com> <15d3f7f7-f377-1295-55a7-5651d7d44349@redhat.com> <20190410160825.GA26808@linux.intel.com> <20190410175530.GA27893@linux.intel.com> <8e52d3b1-ba67-8d02-7fd9-20d2b279ba36@oracle.com> <651d20e2-dc37-e6b5-46c7-fed947b6f8ed@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <651d20e2-dc37-e6b5-46c7-fed947b6f8ed@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Thu, Apr 11, 2019 at 02:14:35PM +0200, Paolo Bonzini wrote: > On 11/04/19 02:15, Krish Sadhukhan wrote: > > May be we should also rename its counterpart > > (i.e.,nested_vmx_check_vmentry_prereqs) to something like > > nested_vmx_check_vmentry_pre_guest_state or something similar ? > > I think we should have three functions > nested_vmx_vmentry_check_{controls,host_state,guest_state}. Four if you count nested_vmx_load_msr(). But anyways, I agree. On a related subject, an invalid guest activity state results in a VM-Exit, not VM-Fail, i.e. nested_check_guest_non_reg_state() belongs in nested_vmx_check_vmentry_postreqs(). Moving that code to its proper location would eliminate the last odditiy for renaming "postreqs" to nested_vmx_vmentry_check_guest_state(). I'll send a series, including patches 1 and 2 (the PAT checks) from Krish's series?