Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp655095ioo; Thu, 26 May 2022 11:26:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxOcvVe6JlPelT8NksDVate//1j00MB/TrgQDx+w+bt+LsBRYxYw2JccefC7Ts5P8TqCezV X-Received: by 2002:a17:907:6090:b0:6fa:14ca:fba2 with SMTP id ht16-20020a170907609000b006fa14cafba2mr36312545ejc.564.1653589573489; Thu, 26 May 2022 11:26:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653589573; cv=none; d=google.com; s=arc-20160816; b=0pIv0A6MSijTQSYX+8IycV8xLL1W3Y88Oek5XskZsRLbV1hnO7AtWyiX/PUZsUrwlm aBoesJSYingVnW8/DeDTUaSqsoCHS4ajUSNDqQsRZ8PXG0thOLO7DKyI5u1hRK9TeKhB VTWrng1MzW23HasVkyjbnjUJNP4ktwi0ce27hxmsJ04wRagC5IfvPllESWKH3I4N+aPF 0atQrb6KmYdCVdkdtyY0JcsYzEGGvQYZFKrdNH+nP0TgDJuzRh5lg2Dlu6GeqP0KxK8X znxbG2jIjmsWQuLGJ5c2ZfYsAH0ZjTrRDEQ0E2SxnOV5iwKac9c3ieFS+TOITNZgiveU cdTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=cm5SVlYYVV5jLPx28l5zaOC9oaSkxOktU8GGXq/as84=; b=Q/mVhXND6UAyJytvXT9C3qrW4LXkJQ8eN4h3Xmv3XNiWFy6gWYGdwBJrkNBGfQmhK9 cErx+VfLcZYytQvVfdCy5oc+pRymzreibK5A3sbaDndSV2ik7Fkw344R8S6sr4+e6jTu gXsM+WUwHlkHuvjiTl2jAzoeaf/KuifqpcHAwZYxpQyhNVRskIGDd9cZLlERCgUoV4xt O5rhPxYZWKzGiQZ2RpQI6k2Qcl+VzEJXS9JS7bHCw3Ji+Rp4s7L9JHoOF8yZmZpVxFBk iBtMS9YDimo4BXm0UALY4h66i1QKHWPoMGFrI5HvwubbbH3RuzmNI9hT+8oxkjKkrfbN UkQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=mFNXTHGV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oz16-20020a1709077d9000b006feaddadd6csi1653065ejc.718.2022.05.26.11.25.46; Thu, 26 May 2022 11:26:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=mFNXTHGV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345427AbiEZBEg (ORCPT + 99 others); Wed, 25 May 2022 21:04:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235621AbiEZBEb (ORCPT ); Wed, 25 May 2022 21:04:31 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D5E58D691; Wed, 25 May 2022 18:04:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653527070; x=1685063070; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=o9Dut7uwRK4DimJ5k0okbFXL72hzra19bcCoT9j7B4s=; b=mFNXTHGVSsEkel2jdOWQMP1UDW8ZO06zketPhX60ZAoPa6tsvBDHjc2Q fia5l9ovVrukOwvqOaip8zVgOoVpxuSk+YOxbF6277DCqAgkslcqJ5C09 JO4RVKb3EUCa2XnCsHtmnV6bkH60mdSzyikyayuXY9eiKyV0gtqp6EKEo qfeQYFjl/E30wfX1/+ZRguEaoQgdvuywb7+hAcidNhanI+tcPZlVs1pjA fJvWEvMwGBlQxeXuyqtg5EX78RJ0KE/ELLDANn4w6ZgXW0Gs2sotyWdZc WQRwySMVo3vJCcXwj1SsRmnfM7OULFjd+Vub1sxA1SXJ70dlU+H0td0a4 A==; X-IronPort-AV: E=McAfee;i="6400,9594,10358"; a="253854254" X-IronPort-AV: E=Sophos;i="5.91,252,1647327600"; d="scan'208";a="253854254" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 May 2022 18:04:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,252,1647327600"; d="scan'208";a="559940686" Received: from yy-desk-7060.sh.intel.com (HELO localhost) ([10.239.159.76]) by orsmga002.jf.intel.com with ESMTP; 25 May 2022 18:04:27 -0700 Date: Thu, 26 May 2022 09:04:26 +0800 From: Yuan Yao To: Sean Christopherson Cc: Paolo Bonzini , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Chenyi Qiang , Lei Wang Subject: Re: [PATCH 1/2] KVM: VMX: Sanitize VM-Entry/VM-Exit control pairs at kvm_intel load time Message-ID: <20220526010426.aayo3qmgylatnkdt@yy-desk-7060> References: <20220525210447.2758436-1-seanjc@google.com> <20220525210447.2758436-2-seanjc@google.com> <20220525232744.e6g77merw7pita3s@yy-desk-7060> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20171215 X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_PASS, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 26, 2022 at 12:42:31AM +0000, Sean Christopherson wrote: > On Thu, May 26, 2022, Yuan Yao wrote: > > On Wed, May 25, 2022 at 09:04:46PM +0000, Sean Christopherson wrote: > > > @@ -2614,6 +2635,20 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf, > > > &_vmentry_control) < 0) > > > return -EIO; > > > > > > + for (i = 0; i < ARRAY_SIZE(vmcs_entry_exit_pairs); i++) { > > > + u32 n_ctrl = vmcs_entry_exit_pairs[i].entry_control; > > > + u32 x_ctrl = vmcs_entry_exit_pairs[i].exit_control; > > > + > > > + if (!(_vmentry_control & n_ctrl) == !(_vmexit_control & x_ctrl)) > > > + continue; > > > + > > > + pr_warn_once("Inconsistent VM-Entry/VM-Exit pair, entry = %x, exit = %x\n", > > > + _vmentry_control & n_ctrl, _vmexit_control & x_ctrl); > > > > How about "n_ctrl, x_ctrl);" ? In 0/1 or 1/0 case this > > outputs all information of real inconsistent bits but not 0. > > I thought about adding the stringified control name to the output (yay macros), > but opted for the simplest approach because this should be a very, very rare > event. All the necessary info is there, it just takes a bit of leg work to get > from a single control bit to the related control name and finally to its pair. > > I'm not totally against printing more info, but if we're going to bother doing so, > my vote is to print names instead of numbers. Agree for simplest approach because this should be rare event, thanks.