mbox series

[0/2] vhost-vdpa: skip TPM CRB memory section

Message ID 20230620195054.23929-1-lvivier@redhat.com
Headers show
Series vhost-vdpa: skip TPM CRB memory section | expand

Message

Laurent Vivier June 20, 2023, 7:50 p.m. UTC
An error is reported for vhost-vdpa case:
qemu-kvm: vhost_vdpa_listener_region_add received unaligned region

Marc-André has proposed a fix to this problem by skipping
the memory region owned by the TPM CRB but it seems more generic
to skip not DMA-able memory.

We have a memory flag for that, RAM_PROTECTED.

This series expands the memory API to provide a way to initialize
a "protected" memory region and use it with the TPM CRB object.

For the previous discussions, see

https://lists.nongnu.org/archive/html/qemu-devel/2022-11/msg03670.html

and from Eric for VFIO:

https://lore.kernel.org/all/20220506132510.1847942-1-eric.auger@redhat.com/
https://lore.kernel.org/all/20220524091405.416256-1-eric.auger@redhat.com/

Bug: https://bugzilla.redhat.com/show_bug.cgi?id=2141965

Thanks,
Laurent

Laurent Vivier (2):
  memory: introduce memory_region_init_ram_protected()
  tpm_crb: mark memory as protected

 hw/tpm/tpm_crb.c      |  2 +-
 include/exec/memory.h | 33 +++++++++++++++++++++++++++++++++
 softmmu/memory.c      | 33 +++++++++++++++++++++++++++------
 softmmu/physmem.c     |  4 ++--
 4 files changed, 63 insertions(+), 9 deletions(-)

Comments

Peter Xu June 21, 2023, 3:32 p.m. UTC | #1
On Tue, Jun 20, 2023 at 09:50:52PM +0200, Laurent Vivier wrote:
> An error is reported for vhost-vdpa case:
> qemu-kvm: vhost_vdpa_listener_region_add received unaligned region
> 
> Marc-André has proposed a fix to this problem by skipping
> the memory region owned by the TPM CRB but it seems more generic
> to skip not DMA-able memory.
> 
> We have a memory flag for that, RAM_PROTECTED.
> 
> This series expands the memory API to provide a way to initialize
> a "protected" memory region and use it with the TPM CRB object.
> 
> For the previous discussions, see
> 
> https://lists.nongnu.org/archive/html/qemu-devel/2022-11/msg03670.html
> 
> and from Eric for VFIO:
> 
> https://lore.kernel.org/all/20220506132510.1847942-1-eric.auger@redhat.com/
> https://lore.kernel.org/all/20220524091405.416256-1-eric.auger@redhat.com/
> 
> Bug: https://bugzilla.redhat.com/show_bug.cgi?id=2141965
> 
> Thanks,
> Laurent
> 
> Laurent Vivier (2):
>   memory: introduce memory_region_init_ram_protected()
>   tpm_crb: mark memory as protected

Reviewed-by: Peter Xu <peterx@redhat.com>