Hi,
On 4/15/24 12:16 PM, Tom Lendacky wrote:
On 4/12/24 10:52, Tom Lendacky wrote:
On 4/9/24 13:12, Kuppuswamy Sathyanarayanan wrote:
On 3/25/24 3:26 PM, Tom Lendacky wrote:
Config-fs provides support to hide individual attribute entries. Using
this support, base the display of the SVSM related entries on the presence
of an SVSM.
Cc: Joel Becker <jlbec@xxxxxxxxxxxx>
Cc: Christoph Hellwig <hch@xxxxxx>
Signed-off-by: Tom Lendacky <thomas.lendacky@xxxxxxx>
---
arch/x86/coco/core.c | 4 ++++
drivers/virt/coco/tsm.c | 14 ++++++++++----
include/linux/cc_platform.h | 8 ++++++++
3 files changed, 22 insertions(+), 4 deletions(-)
Any comment about the following query? I think introducing a CC flag for this use
case is over kill.
https://lore.kernel.org/lkml/6b90b223-46e0-4e6d-a17c-5caf72e3c949@xxxxxxxxxxxxxxx/
If you don't think TDX will be able to make use of the SVSM attribute I can look at adding a callback. But I was waiting to see if anyone else had comments, for or against, before re-doing it all.
What about something like this (applied on top of patch 13):
diff --git a/include/linux/tsm.h b/include/linux/tsm.h
index 27cc97fe8dcd..5aaf626d178d 100644
--- a/include/linux/tsm.h
+++ b/include/linux/tsm.h
@@ -74,7 +74,20 @@ extern const struct config_item_type tsm_report_default_type;
/* publish @privlevel, @privlevel_floor, and @auxblob attributes */
extern const struct config_item_type tsm_report_extra_type;
+/*
+ * Used to indicate the attribute group type to the visibility callback to
+ * avoid the callback having to examine the attribute name.
Checking the attribute name will give more flexibility, right? Since it is one time
check, it should not be costly, right?
+enum tsm_type {
+ TSM_TYPE_SERVICE_PROVIDER,
+
+ TSM_TYPE_MAX
+};
+
+typedef bool (*tsm_visibility_t)(enum tsm_type type);
+
int tsm_register(const struct tsm_ops *ops, void *priv,
- const struct config_item_type *type);
+ const struct config_item_type *type,
+ tsm_visibility_t visibility);
int tsm_unregister(const struct tsm_ops *ops);
#endif /* __TSM_H */
Why not add a callback in tsm_ops?
Thanks,
Tom