Re: [PATCH v4 13/15] x86/sev: Take advantage of configfs visibility support in TSM

From: Dan Williams
Date: Wed May 01 2024 - 15:28:55 EST


Tom Lendacky wrote:
[..]
> >>> +static bool tsm_report_is_visible(struct config_item *item,
> >>> +                  struct configfs_attribute *attr, int n)
> >>
> >> Per the comment on where to find the is_visible() callbacks for a given
> >> item type, I expect the need to pass @item here goes away when this can
> >> assume that there is only one way to have is_visible() invoked for
> >> @attr, right?
> >
> > Yes.
>
> But as I look closer, there is only a single ops callback pair
> (is_visible() and is_bin_visible()), so as long there is never another
> group / subdir defined under the TSM report, this works. But if another
> group is added, then the item parameter would likely be needed or the
> ops callback would have to be updated to differentiate for the vendor
> (SNP/TDX).

Makes sense, for the tsm_report_is_visible() signature. Especially as
this is proposed as a generic configfs facility. It has symmetry with
sysfs that passes an @kobj parent anchor, to sysfs is_visible()
callbacks.

However, I still think neither @item nor @attr need to be passed down
from tsm_report_is_visible() to the vendor backend. Those can be added
when/if another item type is added, which I do not see on the horizon.