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

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