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

2023-06-21 Thread Peter Xu
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.au...@redhat.com/
> https://lore.kernel.org/all/20220524091405.416256-1-eric.au...@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 

-- 
Peter Xu




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

2023-06-20 Thread Laurent Vivier
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.au...@redhat.com/
https://lore.kernel.org/all/20220524091405.416256-1-eric.au...@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(-)

-- 
2.41.0