diff mbox series

[PULL,07/11] sysemu: tpm: Add a stub function for TPM_IS_CRB

Message ID 165187011323.4166595.4846048800121434051.stgit@omen (mailing list archive)
State New, archived
Headers show
Series [PULL,01/11] vfio: simplify the conditional statements in vfio_msi_enable | expand

Commit Message

Alex Williamson May 6, 2022, 8:48 p.m. UTC
From: Eric Auger <eric.auger@redhat.com>

In a subsequent patch, VFIO will need to recognize if
a memory region owner is a TPM CRB device. Hence VFIO
needs to use TPM_IS_CRB() even if CONFIG_TPM is unset. So
let's add a stub function.

Signed-off-by: Eric Auger <eric.auger@redhat.com>
Suggested-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linnux.ibm.com>
Link: https://lore.kernel.org/r/20220506132510.1847942-2-eric.auger@redhat.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
---
 include/sysemu/tpm.h |    6 ++++++
 1 file changed, 6 insertions(+)

Comments

Stefan Berger May 19, 2022, 12:46 a.m. UTC | #1
On 5/6/22 16:48, Alex Williamson wrote:
> From: Eric Auger <eric.auger@redhat.com>
> 
> In a subsequent patch, VFIO will need to recognize if
> a memory region owner is a TPM CRB device. Hence VFIO
> needs to use TPM_IS_CRB() even if CONFIG_TPM is unset. So
> let's add a stub function.
> 
> Signed-off-by: Eric Auger <eric.auger@redhat.com>
> Suggested-by: Cornelia Huck <cohuck@redhat.com>
> Reviewed-by: Stefan Berger <stefanb@linnux.ibm.com>

Oops, a typo here: linnux -> linux
Alex Williamson May 19, 2022, 1:17 a.m. UTC | #2
On Wed, 18 May 2022 20:46:02 -0400
Stefan Berger <stefanb@linux.ibm.com> wrote:

> On 5/6/22 16:48, Alex Williamson wrote:
> > From: Eric Auger <eric.auger@redhat.com>
> > 
> > In a subsequent patch, VFIO will need to recognize if
> > a memory region owner is a TPM CRB device. Hence VFIO
> > needs to use TPM_IS_CRB() even if CONFIG_TPM is unset. So
> > let's add a stub function.
> > 
> > Signed-off-by: Eric Auger <eric.auger@redhat.com>
> > Suggested-by: Cornelia Huck <cohuck@redhat.com>
> > Reviewed-by: Stefan Berger <stefanb@linnux.ibm.com>  
> 
> Oops, a typo here: linnux -> linux

Yup, sorry, didn't notice until it was too late, but that was as
provided by you:

https://lore.kernel.org/all/96940f79-a6e0-d14f-5d74-abe280846f26@linux.ibm.com/

Thanks,

Alex
Stefan Berger May 19, 2022, 1:31 a.m. UTC | #3
On 5/18/22 21:17, Alex Williamson wrote:
> On Wed, 18 May 2022 20:46:02 -0400
> Stefan Berger <stefanb@linux.ibm.com> wrote:
> 
>> On 5/6/22 16:48, Alex Williamson wrote:
>>> From: Eric Auger <eric.auger@redhat.com>
>>>
>>> In a subsequent patch, VFIO will need to recognize if
>>> a memory region owner is a TPM CRB device. Hence VFIO
>>> needs to use TPM_IS_CRB() even if CONFIG_TPM is unset. So
>>> let's add a stub function.
>>>
>>> Signed-off-by: Eric Auger <eric.auger@redhat.com>
>>> Suggested-by: Cornelia Huck <cohuck@redhat.com>
>>> Reviewed-by: Stefan Berger <stefanb@linnux.ibm.com>
>>
>> Oops, a typo here: linnux -> linux
> 
> Yup, sorry, didn't notice until it was too late, but that was as
> provided by you:

I know...

> 
> https://lore.kernel.org/all/96940f79-a6e0-d14f-5d74-abe280846f26@linux.ibm.com/
> 
> Thanks,
> 
> Alex
>
diff mbox series

Patch

diff --git a/include/sysemu/tpm.h b/include/sysemu/tpm.h
index 68b2206463c5..fb40e30ff60e 100644
--- a/include/sysemu/tpm.h
+++ b/include/sysemu/tpm.h
@@ -80,6 +80,12 @@  static inline TPMVersion tpm_get_version(TPMIf *ti)
 #define tpm_init()  (0)
 #define tpm_cleanup()
 
+/* needed for an alignment check in non-tpm code */
+static inline Object *TPM_IS_CRB(Object *obj)
+{
+     return NULL;
+}
+
 #endif /* CONFIG_TPM */
 
 #endif /* QEMU_TPM_H */