Blame SOURCES/kvm-sysemu-tpm-Add-a-stub-function-for-TPM_IS_CRB.patch

29b115
From 74b3e92dcb9e343e135a681259514b4fd28086ea Mon Sep 17 00:00:00 2001
29b115
From: Eric Auger <eric.auger@redhat.com>
29b115
Date: Fri, 6 May 2022 15:25:09 +0200
29b115
Subject: [PATCH 4/5] sysemu: tpm: Add a stub function for TPM_IS_CRB
29b115
29b115
RH-Author: Eric Auger <eric.auger@redhat.com>
29b115
RH-MergeRequest: 84: vfio/common: Remove spurious tpm-crb-cmd misalignment warning
29b115
RH-Commit: [1/2] 0ab55ca1aa12a3a7cbdef5a378928f75e030e536 (eauger1/centos-qemu-kvm)
29b115
RH-Bugzilla: 2037612
29b115
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
29b115
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
29b115
RH-Acked-by: Andrew Jones <drjones@redhat.com>
29b115
29b115
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2037612
29b115
Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=45166961
29b115
Upstream Status: YES
29b115
Tested: With TPM-CRB and VFIO
29b115
29b115
In a subsequent patch, VFIO will need to recognize if
29b115
a memory region owner is a TPM CRB device. Hence VFIO
29b115
needs to use TPM_IS_CRB() even if CONFIG_TPM is unset. So
29b115
let's add a stub function.
29b115
29b115
Signed-off-by: Eric Auger <eric.auger@redhat.com>
29b115
Suggested-by: Cornelia Huck <cohuck@redhat.com>
29b115
Reviewed-by: Stefan Berger <stefanb@linnux.ibm.com>
29b115
Link: https://lore.kernel.org/r/20220506132510.1847942-2-eric.auger@redhat.com
29b115
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
29b115
(cherry picked from commit 4168cdad398843ed53d650a27651868b4d3e21c9)
29b115
Signed-off-by: Eric Auger <eric.auger@redhat.com>
29b115
---
29b115
 include/sysemu/tpm.h | 6 ++++++
29b115
 1 file changed, 6 insertions(+)
29b115
29b115
diff --git a/include/sysemu/tpm.h b/include/sysemu/tpm.h
29b115
index 68b2206463..fb40e30ff6 100644
29b115
--- a/include/sysemu/tpm.h
29b115
+++ b/include/sysemu/tpm.h
29b115
@@ -80,6 +80,12 @@ static inline TPMVersion tpm_get_version(TPMIf *ti)
29b115
 #define tpm_init()  (0)
29b115
 #define tpm_cleanup()
29b115
 
29b115
+/* needed for an alignment check in non-tpm code */
29b115
+static inline Object *TPM_IS_CRB(Object *obj)
29b115
+{
29b115
+     return NULL;
29b115
+}
29b115
+
29b115
 #endif /* CONFIG_TPM */
29b115
 
29b115
 #endif /* QEMU_TPM_H */
29b115
-- 
29b115
2.31.1
29b115