Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1686515pxb; Mon, 8 Mar 2021 04:04:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJzz6wNzZLqEC22kiY7KVjzAjHvEdGZbFruT7IQ4r2HrZ+XRWRsJ17gDaXJ8pXSnINoagh0j X-Received: by 2002:a17:906:11d1:: with SMTP id o17mr14655672eja.517.1615205044759; Mon, 08 Mar 2021 04:04:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615205044; cv=none; d=google.com; s=arc-20160816; b=WYt3dHWXV5Vmvezco+2McMr+wt/EJ2r156VJ5r3eNQWNwRAuVAjw87UscbmZWC2VZ2 lJ/p/NSOebiuIWmL2yH3vF9dvIx/osgOJlPJV6LVgm5y193BrYJBqtNdSdcGhB6XxONs ppwsvN0kJZy0MHDaVBNvo4uwAsGVPCMx+ZQvDgVZ5ob4xS6vhod5n5GGjNdMh7fWMQiU pj9ru/9xOMLw5eM9+s+IE5razMtJqVoEFhzAsvno23LbSMfH99fp40Z0sYrG1HHrQsB8 Z84/2C9aeE9aKwo6uzlcyKQSg/vg9xTM45kJjswZ9Kq1hnHkRl5SfkKReymcN97LFTR3 Wqbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:ironport-sdr:ironport-sdr; bh=6TlKHQ/Ret+K8aUuZSJPNFdDqUWO8fG1TUbLpOOIuS0=; b=YllAd/xIt1kaQdYuQ5WpEBnqQe4O7ln/0cX+D5P7A2oV9RB+2fseA1Qj++kzYGIVT8 ApqeV5RdV+wtrvh4GQCNaYpmVpL93b2gRtHhId0GUMS0tQAvzzSMUi6oERcohdg9PVvL 5XhyBD8xMpfJ3o7PqTHzdueiyUTNgabAhq7S9InVDtRB8QErb0UBI46A0GSTtyFQcH5i +YkLSZo49pOpIAqvpdIgpVZKt25lsIS/KvlgvfiVuxsWENP6ZlWw5uufsKkV8w0fsZHE 5yH/S0qi3omfcFS9HgxFXN0Tue4A3AAgaOSIfdw3klkoUMUtwxguyRF/UkgpuXlqzGfN pISw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f16si6819825edy.306.2021.03.08.04.03.41; Mon, 08 Mar 2021 04:04:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231996AbhCHMCX (ORCPT + 99 others); Mon, 8 Mar 2021 07:02:23 -0500 Received: from mga06.intel.com ([134.134.136.31]:31226 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231592AbhCHMCC (ORCPT ); Mon, 8 Mar 2021 07:02:02 -0500 IronPort-SDR: idO0w4Gj6XLmgMnobkU4djBrbbO4bQERtFgUUxkmoj5sA34CY8wjafbLa/qsU4Zl3JK3ZInsxK mxKE2pDINK5w== X-IronPort-AV: E=McAfee;i="6000,8403,9916"; a="249392912" X-IronPort-AV: E=Sophos;i="5.81,232,1610438400"; d="scan'208";a="249392912" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Mar 2021 04:02:01 -0800 IronPort-SDR: E4eWEzz3M91SoK7Ba57k2QiKDBTD3PA3L0Gt/Fil8oVrwjzYX6GsV16oQ92n6/FNrSKGPPtK03 xQSr9NGyHsWA== X-IronPort-AV: E=Sophos;i="5.81,232,1610438400"; d="scan'208";a="409271094" Received: from likexu-mobl1.ccr.corp.intel.com (HELO [10.249.171.152]) ([10.249.171.152]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Mar 2021 04:01:57 -0800 Subject: Re: [PATCH] x86/perf: Fix guest_get_msrs static call if there is no PMU To: Peter Zijlstra Cc: Sean Christopherson , Dmitry Vyukov , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , "H. Peter Anvin" , linux-kernel@vger.kernel.org, Like Xu , Paolo Bonzini , Jim Mattson , kvm@vger.kernel.org, Thomas Gleixner "(x86/pti/timer/core/smp/irq/perf/efi/locking/ras/objtool)" "(x86@kernel.org)" , Borislav Petkov , Arnaldo Carvalho de Melo , Ingo Molnar References: <20210305223331.4173565-1-seanjc@google.com> <053d0a22-394d-90d0-8d3b-3cd37ca3f378@intel.com> From: "Xu, Like" Message-ID: Date: Mon, 8 Mar 2021 20:01:52 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/3/8 16:53, Peter Zijlstra wrote: > Still, it calling atomic_switch_perf_msrs() and > intel_pmu_lbr_is_enabled() when there isn't a PMU at all is of course, a > complete waste of cycles. This suggestion is reminiscent of a sad regression of optimizing it: https://lore.kernel.org/kvm/20200619094046.654019-1-vkuznets@redhat.com/ https://lore.kernel.org/kvm/20210209225653.1393771-1-jmattson@google.com/