[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/2] tpm_crb: mark memory as protected
From: |
Peter Maydell |
Subject: |
Re: [PATCH 2/2] tpm_crb: mark memory as protected |
Date: |
Thu, 22 Jun 2023 14:53:07 +0100 |
On Thu, 22 Jun 2023 at 14:39, Laurent Vivier <lvivier@redhat.com> wrote:
>
> On 6/22/23 15:12, Peter Maydell wrote:
> > On Tue, 20 Jun 2023 at 20:51, Laurent Vivier <lvivier@redhat.com> wrote:
> >>
> >> This memory is not correctly aligned and cannot be registered
> >> by vDPA and VFIO.
> >
> > Isn't this a vDPA/VFIO problem? There's no requirement
> > for RAM MemoryRegions to be aligned in any way. Code
> > that doesn't want to work with small or weirdly aligned
> > regions should skip them if that's the right behaviour
> > for that particular code IMHO.
> >
>
> Marc-André proposed to modify vDPA code to skip the region but Michal
> disagreed:
>
> https://lists.nongnu.org/archive/html/qemu-devel/2022-11/msg03670.html
"Special case the TPM device in the vhost-vdpa" is clearly also
not the right way to solve the issue, so I agree with Michael
about that.
The vhost-vdpa code already seems able to correctly detect
whether a region is unaligned and ignores it. If that's the
right thing to do, maybe we should just remove the
error_report() ? Listeners are going to see MemoryRegions
which are RAM and which aren't necessarily page-aligned,
so they should handle them, not complain about them.
thanks
-- PMM
- Re: [PATCH 1/2] memory: introduce memory_region_init_ram_protected(), (continued)