hw/tpm: Add TPMIfClass::ppi_enabled field
Each TPM derived device has a @ppi_enabled field, itself exposed as a QOM property. External layers (like the ACPI subsystem) wanting to know whether a device implements PPI has to check for the QOM property available. This can be simplified by declaring a single field in the TPM interface. Here we add such field to TPMIfClass, before converting each TPM devices to use it in the following commits. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Stefan Berger <stefanb@linux.ibm.com> Message-Id: <20260317120241.16320-3-philmd@linaro.org>
Philippe Mathieu-Daudé committed
Mar 17, 2026 at 12:31 UTC
6f4a9599521a9a2feded3e0eaa000546fc9d9e77
1 file changed
+4
include/system/tpm.h
+4
@@ -43,6 +43,7 @@ struct TPMIfClass {
43
enum TpmModel model;
44
void (*request_completed)(TPMIf *obj, int ret);
45
enum TPMVersion (*get_version)(TPMIf *obj);
46
+ bool ppi_enabled;
47
};
48
49
#define TYPE_TPM_TIS_ISA "tpm-tis"
@@ -84,6 +85,9 @@ static inline bool tpm_ppi_enabled(TPMIf *ti)
85
if (!ti) {
86
return false;
87
}
88
+ if (TPM_IF_GET_CLASS(ti)->ppi_enabled) {
89
+ return true;
90
+ }
91
return object_property_get_bool(OBJECT(ti), "ppi", &error_abort);
92
}
93