[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [QEMU][PATCH v1 5/7] memory: add MemoryRegion map and unmap callback
|
From: |
Stefano Stabellini |
|
Subject: |
Re: [QEMU][PATCH v1 5/7] memory: add MemoryRegion map and unmap callbacks |
|
Date: |
Wed, 25 Oct 2023 18:41:46 -0700 (PDT) |
|
User-agent: |
Alpine 2.22 (DEB 394 2020-01-19) |
On Wed, 11 Oct 2023, Juergen Gross wrote:
> On 10.10.23 02:17, Stefano Stabellini wrote:
> > On Thu, 5 Oct 2023, Vikram Garhwal wrote:
> > > From: Juergen Gross <jgross@suse.com>
> > >
> > > In order to support mapping and unmapping guest memory dynamically to
> > > and from qemu during address_space_[un]map() operations add the map()
> > > and unmap() callbacks to MemoryRegionOps.
> > >
> > > Those will be used e.g. for Xen grant mappings when performing guest
> > > I/Os.
> > >
> > > Signed-off-by: Juergen Gross <jgross@suse.com>
> > > Signed-off-by: Vikram Garhwal <vikram.garhwal@amd.com>
> >
> > Can't we just use the existing Xen hooks in qemu_ram_ptr_length and
> > xen_invalidate_map_cache_entry? Do we really need new ones?
>
> I tried your idea first and it didn't work out.
>
> The existing hooks are invoked not only when explicitly [un]mapping memory
> regions, but in some other cases, too. Have a look for qemu_ram_ptr_length()
> call in flatview_write_continue().
Hi Juergen, thanks for the explanation and sorry for my late reply. I
missed your email when it came out.
If that is the only problem, it seems to me that it could be solved. The
call to qemu_ram_ptr_length() in flatview_write_continue is unlocked. It
should be also distinguishable by address (the grants have the top bit
set?)
So from qemu_ram_ptr_length() we could call xen_map_grant_dyn only when
locked. And in xen_map_grant_dyn we could also check that
XEN_GRANT_ADDR_OFF is set before continuing.
Do you see any other issues with it?
- Re: [QEMU][PATCH v1 2/7] xen: add pseudo RAM region for grant mappings, (continued)
[QEMU][PATCH v1 3/7] softmmu: let qemu_map_ram_ptr() use qemu_ram_ptr_length(), Vikram Garhwal, 2023/10/05
[QEMU][PATCH v1 4/7] xen: let xen_ram_addr_from_mapcache() return -1 in case of not found entry, Vikram Garhwal, 2023/10/05
[QEMU][PATCH v1 5/7] memory: add MemoryRegion map and unmap callbacks, Vikram Garhwal, 2023/10/05
[QEMU][PATCH v1 6/7] xen: add map and unmap callbacks for grant region, Vikram Garhwal, 2023/10/05
[QEMU][PATCH v1 7/7] hw: arm: Add grant mapping., Vikram Garhwal, 2023/10/05
[QEMU][PATCH v1 1/7] xen: when unplugging emulated devices skip virtio devices, Vikram Garhwal, 2023/10/05