Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp974538pxp; Wed, 16 Mar 2022 23:09:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3AZMr1zRGxDToiupHXg+aQAQbit9hgMwfvfU+MGrsqn5GM7AUZJt+jZmaZ+yKH13xFXAO X-Received: by 2002:a05:6a00:2450:b0:4f7:bf07:c063 with SMTP id d16-20020a056a00245000b004f7bf07c063mr3376498pfj.51.1647497362736; Wed, 16 Mar 2022 23:09:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647497362; cv=none; d=google.com; s=arc-20160816; b=aoGdBiaOs1mFkOA1SSRHb5jBjN6o6Ru6QZ2+1oXG12MtnKlC9bQ2t4BY0k4jD5VPXv 7mKQj10UbmX9Fz/RC3jykinJiA2GDgcIpWMDUZzQzge/ENN/6iYH8aI/he4jxY1QqWhE pyAY/sVhbb5Kgnyuk/E+X1eBtuJV6LDw0WgFYITdEV8t2D5krCNQHCbo0YRRcU5i3Jwk HI2GI4HPZY2FShtJ5IaWJ+ipKUYO/mNm/1e6rUwKipqDZr8B0YXqU5pIDSbr9eCT/Y2a JTr/FVFxNlTPYPTj9CNd6W//rnYQvKPaws49Dmfwf2vUZbXFbjuzBPpL++xiIwOc+kS4 pLsQ== 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=RssrwB4EZuwDQ3laBJvfw7aP8gz+5e1ShTZoMqTNXpc=; b=GUvHy+FWnhTHhiFBT5sFl3nLvX6bjPwEVZAQMACPlIiEV1eeDPTCua0niBh14Ys8wd I28K+CnwLDWd8o3jWU/Sp7CircXTykBi5bVgy/4ym5gtkUn+OcqVx5R7H1iWCHQQR9pd qCgOcrDhuJYJIBhlt9QU253bTGWf5iPQYKVm5UkpApDPfGeByvnw6sJzBHPSsVZiMIAk dAAjGEHvNNO6RjS9Z5xkBVk4h0F1Cj/h2/+8360ghUjE/SVWrboQ3R/zpohKh8kXNYui yHapsc0YBbL3Fol1t1Px56dAAuU2BFAQJdUJqos/iBYGSINuJ6O2OSlAiHRbqrmRY/4F myMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Jm403LWa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id l7-20020a170903244700b00151f8999d9fsi4239257pls.419.2022.03.16.23.09.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 23:09:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Jm403LWa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EAF611A8FC0; Wed, 16 Mar 2022 22:20:49 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349270AbiCOOas (ORCPT + 99 others); Tue, 15 Mar 2022 10:30:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349231AbiCOOae (ORCPT ); Tue, 15 Mar 2022 10:30:34 -0400 Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AD6D55226; Tue, 15 Mar 2022 07:29:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1647354562; x=1678890562; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=/mS+54xXu2SFAlGhBp7YqEHtIogY0AEeVDsBdXLfN6M=; b=Jm403LWaisBLQzo8W1B1s1Hrsn7AL9bfhJrQdQ7tXSWv8EPu8H03bxbT apCGJYina4XuaClmMq3TShuzI7BmRVF21wv8YyozuJ/THYAJPo9wDktHW 6n8patcuaansppEMLNgjOdzfX+qDUKtgLpEh3BRhYgsR3Y+IHJ91RjW9R JiUw8IAuzE0Vaa8Q+rGmMh/ZMypYLF+s84S+Vvll4mebrQeGSEqELq+Bk 7OwZxFjr9nkU71vTZ9WTbFU5OHNu85S7WHjFzJDsQiftmwXhWQ3sF6OTk D4Rl5W+zmlxODOE5XefmSas433LN3rPLaLR6yQQk0mHwb040EfQpGtGIQ w==; X-IronPort-AV: E=McAfee;i="6200,9189,10286"; a="317038755" X-IronPort-AV: E=Sophos;i="5.90,183,1643702400"; d="scan'208";a="317038755" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Mar 2022 07:29:21 -0700 X-IronPort-AV: E=Sophos;i="5.90,183,1643702400"; d="scan'208";a="556951856" Received: from gao-cwp.sh.intel.com (HELO gao-cwp) ([10.239.159.23]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Mar 2022 07:29:19 -0700 Date: Tue, 15 Mar 2022 22:42:50 +0800 From: Chao Gao To: Sean Christopherson Cc: Paolo Bonzini , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/3] KVM: x86: Trace all APICv inhibit changes and capture overall status Message-ID: <20220315144249.GA5496@gao-cwp> References: <20220311043517.17027-1-seanjc@google.com> <20220311043517.17027-4-seanjc@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220311043517.17027-4-seanjc@google.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Fri, Mar 11, 2022 at 04:35:17AM +0000, Sean Christopherson wrote: >--- a/arch/x86/kvm/x86.c >+++ b/arch/x86/kvm/x86.c >@@ -9053,15 +9053,29 @@ bool kvm_apicv_activated(struct kvm *kvm) > } > EXPORT_SYMBOL_GPL(kvm_apicv_activated); > >+ stray newline. >+static void set_or_clear_apicv_inhibit(unsigned long *inhibits, >+ enum kvm_apicv_inhibit reason, bool set) >+{ >+ if (set) >+ __set_bit(reason, inhibits); >+ else >+ __clear_bit(reason, inhibits); >+ >+ trace_kvm_apicv_inhibit_changed(reason, set, *inhibits); Note that some calls may not toggle any bit. Do you want to log them? I am afraid that a VM with many vCPUs may get a lot of traces that actually doesn't change inhibits. Anyway, this series looks good to me.