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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3637C4332F for ; Tue, 8 Nov 2022 10:24:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233638AbiKHKYE (ORCPT ); Tue, 8 Nov 2022 05:24:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233214AbiKHKYB (ORCPT ); Tue, 8 Nov 2022 05:24:01 -0500 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7218B873; Tue, 8 Nov 2022 02:24:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667903040; x=1699439040; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=YJMYXGLA4KEN/fGjMp9iTmRLlIV2wOamv31dHoqNe+8=; b=f2GQg1MxVNbv4+v7C3tRyoUy/I+QUmicl0hTv1uOoIlZR/+46LZ4Bamh //+Bw1zcmpik2KZrq8WMQ+4VIin1KcZvp6SKWfv//MnnbGnUe27+CRVCu 2uW6Ofzmzb4JAZZPIAcGV4mS19cAWZIg08oMEzuwdAb5idW1obRRmZGsm lfB88i0otf2oLuOCGTHaTzTMgh7qiO/YCqwu/URCnMU0Ju1iiNPj5K6YO KCAHcY92Sgo1Jovc6+r7lw3f/rMhvwYTVAP366n11FGKC5crOVBDzQ0r6 mOJ7yJTp0nFwOmjXzPVaSpNbgyRE+yWRZSXWBcOpTKdq17FhKqy7tv7iT Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10524"; a="337387021" X-IronPort-AV: E=Sophos;i="5.96,147,1665471600"; d="scan'208";a="337387021" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Nov 2022 02:24:00 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10524"; a="587321941" X-IronPort-AV: E=Sophos;i="5.96,147,1665471600"; d="scan'208";a="587321941" Received: from wanglin4-mobl.ccr.corp.intel.com (HELO localhost) ([10.249.173.199]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Nov 2022 02:23:58 -0800 Date: Tue, 8 Nov 2022 18:23:57 +0800 From: Yu Zhang To: Sean Christopherson Cc: Paolo Bonzini , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] KVM: VMX: Do not trap VMFUNC instructions for L1 guests. Message-ID: <20221108102357.ikrskv7shtp3o6lx@linux.intel.com> References: <20221107082727.1355797-1-yu.c.zhang@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20171215 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 07, 2022 at 05:36:21PM +0000, Sean Christopherson wrote: > On Mon, Nov 07, 2022, Paolo Bonzini wrote: > > On 11/7/22 09:27, Yu Zhang wrote: > > > VMFUNC is not supported for L1 guests, and executing VMFUNC in > > > L1 shall generate a #UD directly. Just disable it in secondary > > > proc-based execution control for L1, instead of intercepting it > > > and inject the #UD again. > > > > > > Signed-off-by: Yu Zhang > > > > Is this for TDX or similar? The reason for a patch should be mentioned in > > the commit message. > > It's just a cleanup, but (a) it should be split over two patches as disabling > VMFUNC for L1 is technically a functional change, where as the changes to > nested_vmx_setup_ctls_msrs() are pure cleanups, and (b) the !guest_mode path in > handle_vmfunc() should either be removed or turned into a KVM_BUG_ON(). > Got it. Will do in V2. And thanks! B.R. Yu