[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 05/51] hw/display/qxl: Document qxl_phys2virt()
From: |
Juan Quintela |
Subject: |
[PATCH v2 05/51] hw/display/qxl: Document qxl_phys2virt() |
Date: |
Mon, 5 Dec 2022 10:51:42 +0100 |
From: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20221128202741.4945-3-philmd@linaro.org>
---
hw/display/qxl.h | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/hw/display/qxl.h b/hw/display/qxl.h
index e74de9579d..78b3a6c9ba 100644
--- a/hw/display/qxl.h
+++ b/hw/display/qxl.h
@@ -147,6 +147,25 @@ OBJECT_DECLARE_SIMPLE_TYPE(PCIQXLDevice, PCI_QXL)
#define QXL_DEFAULT_REVISION (QXL_REVISION_STABLE_V12 + 1)
/* qxl.c */
+/**
+ * qxl_phys2virt: Get a pointer within a PCI VRAM memory region.
+ *
+ * @qxl: QXL device
+ * @phys: physical offset of buffer within the VRAM
+ * @group_id: memory slot group
+ *
+ * Returns a host pointer to a buffer placed at offset @phys within the
+ * active slot @group_id of the PCI VGA RAM memory region associated with
+ * the @qxl device. If the slot is inactive, or the offset is out
+ * of the memory region, returns NULL.
+ *
+ * Use with care; by the time this function returns, the returned pointer is
+ * not protected by RCU anymore. If the caller is not within an RCU critical
+ * section and does not hold the iothread lock, it must have other means of
+ * protecting the pointer, such as a reference to the region that includes
+ * the incoming ram_addr_t.
+ *
+ */
void *qxl_phys2virt(PCIQXLDevice *qxl, QXLPHYSICAL phys, int group_id);
void qxl_set_guest_bug(PCIQXLDevice *qxl, const char *msg, ...)
G_GNUC_PRINTF(2, 3);
--
2.38.1
- [PATCH v2 00/51] migration patches for VFIO, Juan Quintela, 2022/12/05
- [PATCH v2 01/51] update seabios source from 1.16.0 to 1.16.1, Juan Quintela, 2022/12/05
- [PATCH v2 03/51] replay: Fix declaration of replay_read_next_clock, Juan Quintela, 2022/12/05
- [PATCH v2 04/51] hw/display/qxl: Have qxl_log_command Return early if no log_cmd handler, Juan Quintela, 2022/12/05
- [PATCH v2 02/51] update seabios binaries to 1.16.1, Juan Quintela, 2022/12/05
- [PATCH v2 05/51] hw/display/qxl: Document qxl_phys2virt(),
Juan Quintela <=
- [PATCH v2 06/51] hw/display/qxl: Pass requested buffer size to qxl_phys2virt(), Juan Quintela, 2022/12/05
- [PATCH v2 07/51] hw/display/qxl: Avoid buffer overrun in qxl_phys2virt (CVE-2022-4144), Juan Quintela, 2022/12/05
- [PATCH v2 08/51] hw/display/qxl: Assert memory slot fits in preallocated MemoryRegion, Juan Quintela, 2022/12/05
- [PATCH v2 09/51] block-backend: avoid bdrv_unregister_buf() NULL pointer deref, Juan Quintela, 2022/12/05
- [PATCH v2 10/51] target/arm: Set TCGCPUOps.restore_state_to_opc for v7m, Juan Quintela, 2022/12/05
- [PATCH v2 11/51] Update VERSION for v7.2.0-rc3, Juan Quintela, 2022/12/05
- [PATCH v2 12/51] tests/qtests: override "force-legacy" for gpio virtio-mmio tests, Juan Quintela, 2022/12/05
- [PATCH v2 13/51] vhost: enable vrings in vhost_dev_start() for vhost-user devices, Juan Quintela, 2022/12/05
- [PATCH v2 15/51] hw/virtio: generalise CHR_EVENT_CLOSED handling, Juan Quintela, 2022/12/05
- [PATCH v2 14/51] hw/virtio: add started_vu status field to vhost-user-gpio, Juan Quintela, 2022/12/05