[PATCH] nvme-pci: expose active quirks in sysfs
Maurizio Lombardi
mlombard at bsdbackstore.eu
Wed Oct 29 01:02:12 PDT 2025
On Wed Oct 29, 2025 at 6:47 AM CET, Chaitanya Kulkarni wrote:
> On 10/28/25 10:00, Maurizio Lombardi wrote:
>> On Tue Oct 28, 2025 at 5:32 PM CET, Bart Van Assche wrote:
>>> On 10/28/25 7:29 AM, Maurizio Lombardi wrote:
>>>> Currently, there is no straightforward way for a user to inspect
>>>> the quirks value from userspace.
>>>> Add a new read-only sysfs attribute "quirks";
>>>> reading this file will display the hexadecimal
>>>> value of the ctrl->quirks bitmask for the given NVMe device.
>>> This patch changes the constants in enum nvme_quirks from
>>> kernel-internal constants into an ABI. I'm not sure that's what we
>>> want.
>> I understand your concern.
>> I could respin it to export the names of the active quirks
>> rather than the raw bitmask, if there is an interest in having
>> this feature.
>>
>> Maurizio
>>
> question here: do we need to care about some kind of security before we
> expose controller information that is internal to the driver ?
> CAP_SYS_ADMIN ? -ck
IMO I don't think it's an information that needs to be hidden.
After all, any user could run "lscpi -nn", get the vendor and device
id and cross-reference them with the pci table in the source code
to get the enabled quirks, this sysfs entry would just make it faster.
Maurizio
More information about the Linux-nvme
mailing list