[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH 12/13] HACK: use memory region API to inject memory to gu
From: |
Peter Maydell |
Subject: |
Re: [RFC PATCH 12/13] HACK: use memory region API to inject memory to guest |
Date: |
Sat, 22 Apr 2023 20:22:00 +0100 |
On Fri, 21 Apr 2023 at 02:13, Gurchetan Singh
<gurchetansingh@chromium.org> wrote:
> Though the api does make an exception:
>
> "There is an exception to the above rule: it is okay to call
> object_unparent at any time for an alias or a container region. It is
> therefore also okay to create or destroy alias and container regions
> dynamically during a device’s lifetime."
>
> I believe we are trying to create a container subregion, but that's
> still failing?
> @@ -671,6 +677,14 @@ rutabaga_cmd_resource_map_blob(VirtIOGPU *g,
> result = rutabaga_resource_map(rutabaga, mblob.resource_id, &mapping);
> CHECK_RESULT(result, cmd);
>
> + memory_region_transaction_begin();
> + memory_region_init_ram_device_ptr(&res->region, OBJECT(g), NULL,
> + mapping.size, (void *)mapping.ptr);
This isn't a container MemoryRegion -- it is a RAM MR. That is,
accesses to it are backed by a lump of host memory (viz, the
one provided here via the mapping.ptr). A container MR is one
which provides no backing mechanism (neither host RAM, nor
MMIO read/write callbacks), and whose contents are purely
those of any other MemoryRegions that you add to it via
memory_region_add_subregion(). So the exception listed in the
API docs does not apply here.
-- PMM
- [RFC PATCH 09/13] gfxstream + rutabaga: add required meson changes, (continued)
- [RFC PATCH 09/13] gfxstream + rutabaga: add required meson changes, Gurchetan Singh, 2023/04/20
- [RFC PATCH 03/13] virtio-gpu blob prep: improve decoding and add memory region, Gurchetan Singh, 2023/04/20
- [RFC PATCH 02/13] virtio-gpu: hostmem, Gurchetan Singh, 2023/04/20
- [RFC PATCH 01/13] virtio: Add shared memory capability, Gurchetan Singh, 2023/04/20
- [RFC PATCH 10/13] gfxstream + rutabaga: add initial support for gfxstream, Gurchetan Singh, 2023/04/20
- [RFC PATCH 11/13] gfxstream + rutabaga: enable rutabaga, Gurchetan Singh, 2023/04/20
- [RFC PATCH 12/13] HACK: use memory region API to inject memory to guest, Gurchetan Singh, 2023/04/20
- [RFC PATCH 07/13] gfxstream + rutabaga prep: define callbacks in realize function, Gurchetan Singh, 2023/04/20
- [RFC PATCH 08/13] gfxstream + rutabaga prep: added need defintions, fields, and options, Gurchetan Singh, 2023/04/20
- [RFC PATCH 13/13] HACK: schedule fence return on main AIO context, Gurchetan Singh, 2023/04/20
- Re: [RFC PATCH 00/13] gfxstream + rutabaga_gfx: a surprising delight or startling epiphany?, Stefan Hajnoczi, 2023/04/21