Re: [PATCH] [PATCH] Firmware security information in SYSFS

From: Arnd Bergmann
Date: Tue Jul 21 2020 - 16:50:30 EST


On Mon, Jul 20, 2020 at 9:49 PM Daniel Gutson <daniel@xxxxxxxxxxxxx> wrote:
> On Fri, Jul 17, 2020 at 12:39 PM Arnd Bergmann <arnd@xxxxxxxx> wrote:
>>
>> My impression was that the state of the registers you read would
>> be the same if you read them multiple times, at least until you
>> reboot and the firmware has a chance to change them.
>
>
> That's not always the case, for example for the SMI count.
> Another example is WPD, a driver (such as the intel-spi for instance) can change its value if it is unlocked.
> But many others don't change so it might be a good idea to add another function to the API to register constant values.

Ok, if the value can change, then I suppose you can pass a pointer to the
'struct class_attribute' or 'struct file_operations' with the appropriate
'show' callbacks, this should be easier than creating another callback
abstraction.

For values that can not change, passing the value should be easier.

Arnd