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 D3E9DC38142 for ; Tue, 24 Jan 2023 11:29:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233967AbjAXL3A (ORCPT ); Tue, 24 Jan 2023 06:29:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233925AbjAXL26 (ORCPT ); Tue, 24 Jan 2023 06:28:58 -0500 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04897B74D; Tue, 24 Jan 2023 03:28:56 -0800 (PST) Received: from zn.tnic (p5de8e9fe.dip0.t-ipconnect.de [93.232.233.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 916DF1EC05DD; Tue, 24 Jan 2023 12:28:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1674559735; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=T/Ams73IS9pldjpzsGFlcABahyaCKghXFaudjYvUOgE=; b=cXgUcsNUfF6P+SjHqCuNAxT84nV5oe/5u+2t5INvDnnNWPn5Q7ARhf+Pb18qGAYifk/0XE znw6/Rvere9W8D/xW7u0qTYsyGIh9gTN2wzuWOs3VJGRsaN3RkElclAwOslWbw+F1vS1ie wf0z59faKNsNTHDm1/yA9bE+rnqkrFU= Date: Tue, 24 Jan 2023 12:28:51 +0100 From: Borislav Petkov To: "Luck, Tony" Cc: "Moger, Babu" , "corbet@lwn.net" , "Chatre, Reinette" , "tglx@linutronix.de" , "mingo@redhat.com" , "Yu, Fenghua" , "dave.hansen@linux.intel.com" , "x86@kernel.org" , "hpa@zytor.com" , "paulmck@kernel.org" , "akpm@linux-foundation.org" , "quic_neeraju@quicinc.com" , "rdunlap@infradead.org" , "damien.lemoal@opensource.wdc.com" , "songmuchun@bytedance.com" , "peterz@infradead.org" , "jpoimboe@kernel.org" , "pbonzini@redhat.com" , "Bae, Chang Seok" , "pawan.kumar.gupta@linux.intel.com" , "jmattson@google.com" , "daniel.sneddon@linux.intel.com" , "sandipan.das@amd.com" , "james.morse@arm.com" , "linux-doc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "bagasdotme@gmail.com" , "Eranian, Stephane" , "christophe.leroy@csgroup.eu" , "jarkko@kernel.org" , "Hunter, Adrian" , "quic_jiles@quicinc.com" , "peternewman@google.com" Subject: Re: [PATCH v11 04/13] x86/cpufeatures: Add Bandwidth Monitoring Event Configuration feature flag Message-ID: References: <20230109164405.569714-1-babu.moger@amd.com> <20230109164405.569714-5-babu.moger@amd.com> <5afd0a7c-3fbe-dfea-f1b4-2fc35fbb4f13@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 09, 2023 at 09:50:20PM +0000, Luck, Tony wrote: > But that allows for the flimsiest of reasons to used to justify making a > flag visible. How's that for starters? c: The naming override can be "", which means it will not appear in /proc/cpuinfo. ---------------------------------------------------------------------------------- The feature shall be omitted from /proc/cpuinfo if there is no valid use case for userspace to query this flag and cannot rely on other means for detecting feature support. For example, toolchains do use CPUID directly instead of relying on the kernel providing that info. If unsure, that flag can always be omitted initially and, once a valid use case presents itself, be shown later. Not the other way around. Another example is X86_FEATURE_ALWAYS, defined in cpufeatures.h. That flag is an internal kernel feature used in the alternative runtime patching functionality. So, its name is overridden with "". Its flag will not appear in /proc/cpuinfo because it absolutely does not make any sense to appear there. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette