[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f7dca1db-8e4f-a793-231b-a69423451463@suse.com>
Date: Wed, 27 Apr 2022 08:20:54 +0200
From: Juergen Gross <jgross@...e.com>
To: Borislav Petkov <bp@...en8.de>
Cc: linux-kernel@...r.kernel.org, x86@...nel.org,
linux-arch@...r.kernel.org, linux-s390@...r.kernel.org,
linux-hyperv@...r.kernel.org,
virtualization@...ts.linux-foundation.org,
Arnd Bergmann <arnd@...db.de>,
Heiko Carstens <hca@...ux.ibm.com>,
Vasily Gorbik <gor@...ux.ibm.com>,
Alexander Gordeev <agordeev@...ux.ibm.com>,
Christian Borntraeger <borntraeger@...ux.ibm.com>,
Sven Schnelle <svens@...ux.ibm.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
"H. Peter Anvin" <hpa@...or.com>,
"K. Y. Srinivasan" <kys@...rosoft.com>,
Haiyang Zhang <haiyangz@...rosoft.com>,
Stephen Hemminger <sthemmin@...rosoft.com>,
Wei Liu <wei.liu@...nel.org>, Dexuan Cui <decui@...rosoft.com>,
Andy Lutomirski <luto@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
"Michael S. Tsirkin" <mst@...hat.com>,
Jason Wang <jasowang@...hat.com>,
Christoph Hellwig <hch@...radead.org>,
Oleksandr Tyshchenko <olekstysh@...il.com>
Subject: Re: [PATCH 1/2] kernel: add platform_has() infrastructure
On 26.04.22 19:31, Borislav Petkov wrote:
> On Tue, Apr 26, 2022 at 03:40:20PM +0200, Juergen Gross wrote:
>> diff --git a/kernel/platform-feature.c b/kernel/platform-feature.c
>> new file mode 100644
>> index 000000000000..2d52f8442cd5
>> --- /dev/null
>> +++ b/kernel/platform-feature.c
>> @@ -0,0 +1,7 @@
>> +// SPDX-License-Identifier: GPL-2.0
>> +
>> +#include <linux/cache.h>
>> +#include <linux/platform-feature.h>
>> +
>> +unsigned long __read_mostly platform_features[PLATFORM_FEAT_ARRAY_SZ];
>
> Probably __ro_after_init.
Yes, good idea.
>
>> +EXPORT_SYMBOL_GPL(platform_features);
>
> You probably should make that thing static and use only accessors to
> modify it in case you wanna change the underlying data structure in the
> future.
The question is whether we think that those platform features will be used
in hot paths or not. If so the inline accessors (at least the platform_has()
one) would be preferred IMO.
OTOH really performance critical cases could use static_branch or such.
Juergen
Download attachment "OpenPGP_0xB0DE9DD628BF132F.asc" of type "application/pgp-keys" (3099 bytes)
Download attachment "OpenPGP_signature" of type "application/pgp-signature" (496 bytes)
Powered by blists - more mailing lists