Bug 217037

Summary: cmb attributes missing from the nvme class under sysfs
Product: Drivers Reporter: michallinuxstuff
Component: OtherAssignee: drivers_other
Status: NEW ---    
Severity: low CC: regressions
Priority: P1    
Hardware: Intel   
OS: Linux   
Kernel Version: 6.1.{9,10} (fedora37's builds) Subsystem:
Regression: No Bisected commit-id:
Attachments: dmesg (6.1.8)
dmesg (6.1.9)
nvme_pci (6.1.8)
nvme_pci (6.1.9)

Description michallinuxstuff 2023-02-14 14:16:26 UTC
For the CMB-capable nvme ctrls, kernel was exposing couple of related attributes under the sysfs. E.g.


# grep . /sys/class/nvme/nvme0/cmb*
/sys/class/nvme/nvme0/cmb:cmbloc : x00000062
/sys/class/nvme/nvme0/cmb:cmbsz  : x0008021d
/sys/class/nvme/nvme0/cmbloc:98
/sys/class/nvme/nvme0/cmbsz:524829
#

The above was taken from fedora37 running under 6.1.8 kernel build. In 6.1.{9,10} all these attributes are gone. 

I am running fedora37 under QEMU 7.{0,2}.0, all nvmes are emulated.

I've tried to understand what change in 6.1.9 might have caused it (suspected that maybe fedora's src is applying some weird patches on top but that's not it), but I could not pinpoint anything specific. 

The latest commit that indirectly touches these attributes is https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=86adbf0cdb9ec but my C-fu is to weak to understand if this really could somehow hide|remove these attrs. 

Also from the look of nvme_pci_attrs_are_visible() nothing has recently changed. I use same QEMU params for setting up the nvmes across all the VMs - is it possible that the way QEMU exposes CMB is not valid anymore? 

If I check proper BARs with setpci + /proc/iomem it seems like CMB is there. SPDK also tells me that given nvme comes with CMB.

Any hints would be appreciated. I have couple of scripts which depend on these so I am a bit biased if it comes to prio on this. :)
Comment 1 The Linux kernel's regression tracker (Thorsten Leemhuis) 2023-02-15 06:35:01 UTC
(In reply to michallinuxstuff from comment #0)
>
> The above was taken from fedora37 running under 6.1.8 kernel build. In
> 6.1.{9,10} all these attributes are gone. 

This likely needs a bisection. But quick question first: did you try if latest mainline is affected as well? There are packages available for easy installation on Fedora here: https://fedoraproject.org/wiki/Kernel_Vanilla_Repositories
Comment 2 The Linux kernel's regression tracker (Thorsten Leemhuis) 2023-02-15 09:03:30 UTC
Ohh, a lspci -nn and a dmesg (maybe two: one from 6.1.8, one from a later kernel) might be helpful to have (you can attach them here)
Comment 3 michallinuxstuff 2023-02-15 12:22:36 UTC
Created attachment 303735 [details]
dmesg (6.1.8)
Comment 4 michallinuxstuff 2023-02-15 12:23:03 UTC
Created attachment 303736 [details]
dmesg (6.1.9)
Comment 5 michallinuxstuff 2023-02-15 12:23:42 UTC
Created attachment 303737 [details]
nvme_pci (6.1.8)
Comment 6 michallinuxstuff 2023-02-15 12:24:11 UTC
Created attachment 303738 [details]
nvme_pci (6.1.9)
Comment 7 michallinuxstuff 2023-02-15 12:27:24 UTC
(In reply to The Linux kernel's regression tracker (Thorsten Leemhuis) from comment #2)
> Ohh, a lspci -nn and a dmesg (maybe two: one from 6.1.8, one from a later
> kernel) might be helpful to have (you can attach them here)

All attached. :) I limited the lspci to just the target ctrls and left some notes on the BAR setup - I am running under VM where the pci bus is quite small anyway so hope that kind of snippet is ok.
Comment 8 michallinuxstuff 2023-02-15 12:28:26 UTC
(In reply to The Linux kernel's regression tracker (Thorsten Leemhuis) from comment #1)
> (In reply to michallinuxstuff from comment #0)
> >
> > The above was taken from fedora37 running under 6.1.8 kernel build. In
> > 6.1.{9,10} all these attributes are gone. 
> 
> This likely needs a bisection. But quick question first: did you try if
> latest mainline is affected as well? There are packages available for easy
> installation on Fedora here:
> https://fedoraproject.org/wiki/Kernel_Vanilla_Repositories

I did not, but that's a good suggestion. I will try to spin it up and see if there's any improvement.
Comment 9 michallinuxstuff 2023-02-15 18:08:22 UTC
(In reply to michallinuxstuff from comment #8)
> (In reply to The Linux kernel's regression tracker (Thorsten Leemhuis) from
> comment #1)
> > (In reply to michallinuxstuff from comment #0)
> > >
> > > The above was taken from fedora37 running under 6.1.8 kernel build. In
> > > 6.1.{9,10} all these attributes are gone. 
> > 
> > This likely needs a bisection. But quick question first: did you try if
> > latest mainline is affected as well? There are packages available for easy
> > installation on Fedora here:
> > https://fedoraproject.org/wiki/Kernel_Vanilla_Repositories
> 
> I did not, but that's a good suggestion. I will try to spin it up and see if
> there's any improvement.

So I did install the latest available build, 6.2.0-0.rc8.20230215gte1c04510.258.vanilla.fc37.x86_64 to be exact, but there's no change - /cmb* stuff is still missing (remaining parts, lspci output, etc. look exactly the same as in the case of previously mentioned versions).