Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.2/patches/2219888/?format=api
{ "id": 2219888, "url": "http://patchwork.ozlabs.org/api/1.2/patches/2219888/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260405072857.66484-6-scottjgo@gmail.com/", "project": { "id": 14, "url": "http://patchwork.ozlabs.org/api/1.2/projects/14/?format=api", "name": "QEMU Development", "link_name": "qemu-devel", "list_id": "qemu-devel.nongnu.org", "list_email": "qemu-devel@nongnu.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260405072857.66484-6-scottjgo@gmail.com>", "list_archive_url": null, "date": "2026-04-05T07:28:49", "name": "[RFC,05/10] vfio: Add region_map and region_unmap callbacks to VFIODeviceIOOps", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "d79d5377db3893dcd5f997ef51dab23e78739457", "submitter": { "id": 93060, "url": "http://patchwork.ozlabs.org/api/1.2/people/93060/?format=api", "name": "Scott J. Goldman", "email": "scottjgo@gmail.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260405072857.66484-6-scottjgo@gmail.com/mbox/", "series": [ { "id": 498765, "url": "http://patchwork.ozlabs.org/api/1.2/series/498765/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=498765", "date": "2026-04-05T07:28:44", "name": "vfio: PCI device passthrough on Apple Silicon Macs", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/498765/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2219888/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2219888/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=W1RFJG1F;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)" ], "Received": [ "from lists.gnu.org (lists.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fpPJx0R6qz1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Sun, 05 Apr 2026 17:31:13 +1000 (AEST)", "from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1w9HvN-0003wN-C2; Sun, 05 Apr 2026 03:29:37 -0400", "from eggs.gnu.org ([2001:470:142:3::10])\n by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <scottjgo@gmail.com>)\n id 1w9HvL-0003w3-Uh\n for qemu-devel@nongnu.org; Sun, 05 Apr 2026 03:29:35 -0400", "from mail-dy1-x1336.google.com ([2607:f8b0:4864:20::1336])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.90_1) (envelope-from <scottjgo@gmail.com>)\n id 1w9HvJ-0007Io-SA\n for qemu-devel@nongnu.org; Sun, 05 Apr 2026 03:29:35 -0400", "by mail-dy1-x1336.google.com with SMTP id\n 5a478bee46e88-2ce102afb0aso738817eec.1\n for <qemu-devel@nongnu.org>; Sun, 05 Apr 2026 00:29:33 -0700 (PDT)", "from localhost.localdomain ([2601:645:8200:47:41e4:ff2b:ff70:4d75])\n by smtp.gmail.com with ESMTPSA id\n 5a478bee46e88-2cb92ea0ef1sm7636502eec.21.2026.04.05.00.29.30\n (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256);\n Sun, 05 Apr 2026 00:29:31 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1775374172; x=1775978972; darn=nongnu.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=bRcv4xt6lJaEweEPbwSohpIgPBQdb1KaetHX8GecBts=;\n b=W1RFJG1F3xTUI/Sq9LdkTx7VutsXVm1jS+6CURFXdLjbQ/ymnl6+yA757jSqaIqy3f\n oRrcHZSniLFiXgc7tEcxcFORw9d9F220kzcVg9LQ5fwYC8G714cVL9F9V8dsiat3aNFN\n dltSrPYbVEYvMpMpZrWofNK+v/8ZDWqelkwdL5j85GVKFAtxcs++8BFGA8jJFoW0/Tz8\n ulscVAXzhQnJUXQRxKoZQcytE+IzAjSZduTMksYfmGb1MB15IOzDoEf8KBZp0uosqSGI\n 9ja9MiCK3j+EB59XAMIMuSHkDFOkaGV4Zm1M6Q7JfqT5jiuWH/r/bvybrrwP/ENgzluz\n q7Qg==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775374172; x=1775978972;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=bRcv4xt6lJaEweEPbwSohpIgPBQdb1KaetHX8GecBts=;\n b=r1fXCEay7os4GBqiMOJ8aZMtpcErhC0GBH7tgBKZkCCr/QIexgOXE0vGOXvea8KXGT\n MBH7RdL+NJDwGZsnQRamhXBs2lHT+Pwu0zn3K3WL9iuoI6it+E/BoAlYVLLtUKCScNMs\n OW1iMevLNfZtKsVmwNtIC33U1hjpCE/2bH1c7RyhHLGMLqhnRLObYHtCjN3AtBsI1LPv\n vlmKb3nAx1vPEL2xU+FY23wPYjJd2LMBz7eaYHjVeueD6QJV4RzRsdpCuqykGHWSQZiP\n Jd3zuTurezplilvKJss1/KobdU6ylJd9Uj/gw4nounHJYNb4QdBejVoaL5DzI31ZKUOo\n h4+w==", "X-Gm-Message-State": "AOJu0YyIRWnCKEwTBUAuNCfqk1UBmlInUqlVatr/8hf1nvKOal+8Gl/L\n OxjAPTm60UNlezZoOweJaX93F8fLhQAzvRjx7aK1qpaS4U2DinATZ6yUPYIE0JDf3hY=", "X-Gm-Gg": "AeBDievF6Kd746PxHwulPcBlxho0WpUEA6W59vLddZNaxmsUM3Vzmte8m7ObQip6QvA\n XOLbwKtAWAFvj7+305Q6LzAOU2kC82W4y0RGsiKhoA3Qsd4dqoUHfD/m7B5wEnqlnb+/NMHUapm\n 2JBwTvz+sfI6NiKJHmbiBPQkFvNVjGNRQnc0iwQxGMQUwj5PidqCgPrk94Bt9cDScGsfdBbwIbO\n 0NGPjvpo/P8H7DShFqkLtlx0yR5VMDckQCZ9vv/g0l+2UqDE2Dc/1ebjxdbrKPUbdjGA8FYWRIw\n icuCiyCw4co/FNE0WlLKSxsxarcjZSFPVTd7XrEciAOZersB3+H6ShQ4Z11bwT5LsdWagWivxf2\n qDBVPM5QfwRb4duQ9V9x16e8lB+hoB3XuLt9P0GzTyNisGi/fgX/Po4efiymJBC1dk/MugwU9rf\n QUAFDKuZyHlS+srwQDwgunL83HbGn/17BrXXQSM7QhU6yg6F4taMd7bSsH/UYYgtw7o5oS2kdPW\n SNxUcR1Umvoj4nZV8lEeGHFWsk=", "X-Received": "by 2002:a05:7301:1688:b0:2c4:a862:2372 with SMTP id\n 5a478bee46e88-2cbf9af888dmr3972848eec.9.1775374172077;\n Sun, 05 Apr 2026 00:29:32 -0700 (PDT)", "From": "\"Scott J. Goldman\" <scottjgo@gmail.com>", "To": "qemu-devel@nongnu.org", "Cc": "alex@shazbot.org, clg@redhat.com, pbonzini@redhat.com, rbolshakov@ddn.com,\n phil@philjordan.eu, mst@redhat.com, john.levon@nutanix.com,\n thanos.makatos@nutanix.com, qemu-s390x@nongnu.org,\n \"Scott J. Goldman\" <scottjgo@gmail.com>", "Subject": "[RFC PATCH 05/10] vfio: Add region_map and region_unmap callbacks to\n VFIODeviceIOOps", "Date": "Sun, 5 Apr 2026 00:28:49 -0700", "Message-ID": "<20260405072857.66484-6-scottjgo@gmail.com>", "X-Mailer": "git-send-email 2.50.1", "In-Reply-To": "<20260405072857.66484-1-scottjgo@gmail.com>", "References": "<20260405072857.66484-1-scottjgo@gmail.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Received-SPF": "pass client-ip=2607:f8b0:4864:20::1336;\n envelope-from=scottjgo@gmail.com; helo=mail-dy1-x1336.google.com", "X-Spam_score_int": "-20", "X-Spam_score": "-2.1", "X-Spam_bar": "--", "X-Spam_report": "(-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,\n DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,\n RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,\n SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no", "X-Spam_action": "no action", "X-BeenThere": "qemu-devel@nongnu.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "qemu development <qemu-devel.nongnu.org>", "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>", "List-Archive": "<https://lists.nongnu.org/archive/html/qemu-devel>", "List-Post": "<mailto:qemu-devel@nongnu.org>", "List-Help": "<mailto:qemu-devel-request@nongnu.org?subject=help>", "List-Subscribe": "<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>", "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org", "Sender": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org" }, "content": "Rename vfio_region_mmap() and vfio_region_unmap() to\nvfio_region_mmap_fd() and vfio_region_unmap_fd() respectively, and\nintroduce new region_map and region_unmap callbacks in\nVFIODeviceIOOps.\n\nThe new vfio_region_mmap() and vfio_region_unmap() functions now\ndispatch through these io_ops callbacks, allowing different backends\nto provide their own region mapping implementations. Both the ioctl\nand vfio-user backends implement the callbacks by calling the renamed\nfd-based variants.\n\nThis refactor enables future backends that may require alternate\nregion mapping strategies.\n\nSigned-off-by: Scott J. Goldman <scottjgo@gmail.com>\n---\n hw/vfio-user/device.c | 16 ++++-\n hw/vfio/device.c | 14 +++++\n hw/vfio/region.c | 108 +++++++++++++++++++++++-----------\n hw/vfio/vfio-region.h | 4 ++\n include/hw/vfio/vfio-device.h | 25 ++++++++\n 5 files changed, 131 insertions(+), 36 deletions(-)", "diff": "diff --git a/hw/vfio-user/device.c b/hw/vfio-user/device.c\nindex 64ef35b320..957d19217b 100644\n--- a/hw/vfio-user/device.c\n+++ b/hw/vfio-user/device.c\n@@ -12,6 +12,7 @@\n #include \"qemu/lockable.h\"\n #include \"qemu/thread.h\"\n \n+#include \"hw/vfio/vfio-region.h\"\n #include \"hw/vfio-user/device.h\"\n #include \"hw/vfio-user/trace.h\"\n \n@@ -428,6 +429,18 @@ static int vfio_user_device_io_region_write(VFIODevice *vbasedev, uint8_t index,\n return ret;\n }\n \n+static int vfio_user_device_io_region_map(VFIODevice *vbasedev,\n+ VFIORegion *region)\n+{\n+ return vfio_region_mmap_fd(region);\n+}\n+\n+static void vfio_user_device_io_region_unmap(VFIODevice *vbasedev,\n+ VFIORegion *region)\n+{\n+ vfio_region_unmap_fd(region);\n+}\n+\n /*\n * Socket-based io_ops\n */\n@@ -437,5 +450,6 @@ VFIODeviceIOOps vfio_user_device_io_ops_sock = {\n .set_irqs = vfio_user_device_io_set_irqs,\n .region_read = vfio_user_device_io_region_read,\n .region_write = vfio_user_device_io_region_write,\n-\n+ .region_map = vfio_user_device_io_region_map,\n+ .region_unmap = vfio_user_device_io_region_unmap,\n };\ndiff --git a/hw/vfio/device.c b/hw/vfio/device.c\nindex 338becffa7..1b703dcbec 100644\n--- a/hw/vfio/device.c\n+++ b/hw/vfio/device.c\n@@ -23,6 +23,7 @@\n \n #include \"hw/vfio/vfio-device.h\"\n #include \"hw/vfio/pci.h\"\n+#include \"hw/vfio/vfio-region.h\"\n #include \"hw/core/iommu.h\"\n #include \"hw/core/hw-error.h\"\n #include \"trace.h\"\n@@ -656,6 +657,17 @@ static int vfio_device_io_region_write(VFIODevice *vbasedev, uint8_t index,\n return ret < 0 ? -errno : ret;\n }\n \n+static int vfio_device_io_region_map(VFIODevice *vbasedev, VFIORegion *region)\n+{\n+ return vfio_region_mmap_fd(region);\n+}\n+\n+static void vfio_device_io_region_unmap(VFIODevice *vbasedev,\n+ VFIORegion *region)\n+{\n+ vfio_region_unmap_fd(region);\n+}\n+\n static VFIODeviceIOOps vfio_device_io_ops_ioctl = {\n .device_feature = vfio_device_io_device_feature,\n .get_region_info = vfio_device_io_get_region_info,\n@@ -663,4 +675,6 @@ static VFIODeviceIOOps vfio_device_io_ops_ioctl = {\n .set_irqs = vfio_device_io_set_irqs,\n .region_read = vfio_device_io_region_read,\n .region_write = vfio_device_io_region_write,\n+ .region_map = vfio_device_io_region_map,\n+ .region_unmap = vfio_device_io_region_unmap,\n };\ndiff --git a/hw/vfio/region.c b/hw/vfio/region.c\nindex 47fdc2df34..9f7780e06c 100644\n--- a/hw/vfio/region.c\n+++ b/hw/vfio/region.c\n@@ -273,15 +273,48 @@ int vfio_region_setup(Object *obj, VFIODevice *vbasedev, VFIORegion *region,\n return 0;\n }\n \n-static void vfio_subregion_unmap(VFIORegion *region, int index)\n+void vfio_region_register_mmap(VFIORegion *region, int index)\n {\n+ char *name;\n+\n+ if (!region->mmaps[index].mmap) {\n+ return;\n+ }\n+\n+ name = g_strdup_printf(\"%s mmaps[%d]\",\n+ memory_region_name(region->mem), index);\n+ memory_region_init_ram_device_ptr(®ion->mmaps[index].mem,\n+ memory_region_owner(region->mem),\n+ name, region->mmaps[index].size,\n+ region->mmaps[index].mmap);\n+ g_free(name);\n+ memory_region_add_subregion(region->mem, region->mmaps[index].offset,\n+ ®ion->mmaps[index].mem);\n+\n+ trace_vfio_region_mmap(memory_region_name(®ion->mmaps[index].mem),\n+ region->mmaps[index].offset,\n+ region->mmaps[index].offset +\n+ region->mmaps[index].size - 1);\n+}\n+\n+void vfio_region_unregister_mmap(VFIORegion *region, int index)\n+{\n+ if (!region->mmaps[index].mmap) {\n+ return;\n+ }\n+\n trace_vfio_region_unmap(memory_region_name(®ion->mmaps[index].mem),\n region->mmaps[index].offset,\n region->mmaps[index].offset +\n region->mmaps[index].size - 1);\n memory_region_del_subregion(region->mem, ®ion->mmaps[index].mem);\n- munmap(region->mmaps[index].mmap, region->mmaps[index].size);\n object_unparent(OBJECT(®ion->mmaps[index].mem));\n+}\n+\n+static void vfio_region_unmap_fd_one(VFIORegion *region, int index)\n+{\n+ vfio_region_unregister_mmap(region, index);\n+ munmap(region->mmaps[index].mmap, region->mmaps[index].size);\n region->mmaps[index].mmap = NULL;\n }\n \n@@ -342,14 +375,13 @@ static bool vfio_region_create_dma_buf(VFIORegion *region, Error **errp)\n return true;\n }\n \n-int vfio_region_mmap(VFIORegion *region)\n+int vfio_region_mmap_fd(VFIORegion *region)\n {\n void *map_base, *map_align;\n Error *local_err = NULL;\n int i, ret, prot = 0;\n off_t map_offset = 0;\n size_t align;\n- char *name;\n int fd;\n \n if (!region->mem || !region->nr_mmaps) {\n@@ -417,21 +449,7 @@ int vfio_region_mmap(VFIORegion *region)\n goto no_mmap;\n }\n \n- name = g_strdup_printf(\"%s mmaps[%d]\",\n- memory_region_name(region->mem), i);\n- memory_region_init_ram_device_ptr(®ion->mmaps[i].mem,\n- memory_region_owner(region->mem),\n- name, region->mmaps[i].size,\n- region->mmaps[i].mmap);\n- g_free(name);\n- memory_region_add_subregion(region->mem, region->mmaps[i].offset,\n- ®ion->mmaps[i].mem);\n-\n- trace_vfio_region_mmap(memory_region_name(®ion->mmaps[i].mem),\n- region->mmaps[i].offset,\n- region->mmaps[i].offset +\n- region->mmaps[i].size - 1);\n-\n+ vfio_region_register_mmap(region, i);\n map_offset = region->mmaps[i].offset + region->mmaps[i].size;\n }\n \n@@ -457,13 +475,13 @@ no_mmap:\n region->mmaps[i].mmap = NULL;\n \n for (i--; i >= 0; i--) {\n- vfio_subregion_unmap(region, i);\n+ vfio_region_unmap_fd_one(region, i);\n }\n \n return ret;\n }\n \n-void vfio_region_unmap(VFIORegion *region)\n+void vfio_region_unmap_fd(VFIORegion *region)\n {\n int i;\n \n@@ -473,41 +491,61 @@ void vfio_region_unmap(VFIORegion *region)\n \n for (i = 0; i < region->nr_mmaps; i++) {\n if (region->mmaps[i].mmap) {\n- vfio_subregion_unmap(region, i);\n+ vfio_region_unmap_fd_one(region, i);\n }\n }\n }\n \n-void vfio_region_exit(VFIORegion *region)\n+int vfio_region_mmap(VFIORegion *region)\n {\n- int i;\n+ VFIODevice *vbasedev;\n+\n+ if (!region->mem) {\n+ return 0;\n+ }\n+\n+ vbasedev = region->vbasedev;\n+ if (!vbasedev->io_ops || !vbasedev->io_ops->region_map) {\n+ return -EINVAL;\n+ }\n+\n+ return vbasedev->io_ops->region_map(vbasedev, region);\n+}\n+\n+void vfio_region_unmap(VFIORegion *region)\n+{\n+ VFIODevice *vbasedev;\n \n if (!region->mem) {\n return;\n }\n \n- for (i = 0; i < region->nr_mmaps; i++) {\n- if (region->mmaps[i].mmap) {\n- memory_region_del_subregion(region->mem, ®ion->mmaps[i].mem);\n- }\n+ vbasedev = region->vbasedev;\n+ if (!vbasedev->io_ops || !vbasedev->io_ops->region_unmap) {\n+ return;\n+ }\n+\n+ vbasedev->io_ops->region_unmap(vbasedev, region);\n+}\n+\n+void vfio_region_exit(VFIORegion *region)\n+{\n+ if (!region->mem) {\n+ return;\n }\n \n+ vfio_region_unmap(region);\n+\n trace_vfio_region_exit(region->vbasedev->name, region->nr);\n }\n \n void vfio_region_finalize(VFIORegion *region)\n {\n- int i;\n-\n if (!region->mem) {\n return;\n }\n \n- for (i = 0; i < region->nr_mmaps; i++) {\n- if (region->mmaps[i].mmap) {\n- munmap(region->mmaps[i].mmap, region->mmaps[i].size);\n- }\n- }\n+ vfio_region_unmap(region);\n \n g_free(region->mem);\n g_free(region->mmaps);\ndiff --git a/hw/vfio/vfio-region.h b/hw/vfio/vfio-region.h\nindex 9b21d4ee5b..afdce466b1 100644\n--- a/hw/vfio/vfio-region.h\n+++ b/hw/vfio/vfio-region.h\n@@ -39,6 +39,10 @@ uint64_t vfio_region_read(void *opaque,\n hwaddr addr, unsigned size);\n int vfio_region_setup(Object *obj, VFIODevice *vbasedev, VFIORegion *region,\n int index, const char *name, Error **errp);\n+void vfio_region_register_mmap(VFIORegion *region, int index);\n+void vfio_region_unregister_mmap(VFIORegion *region, int index);\n+int vfio_region_mmap_fd(VFIORegion *region);\n+void vfio_region_unmap_fd(VFIORegion *region);\n int vfio_region_mmap(VFIORegion *region);\n void vfio_region_mmaps_set_enabled(VFIORegion *region, bool enabled);\n void vfio_region_unmap(VFIORegion *region);\ndiff --git a/include/hw/vfio/vfio-device.h b/include/hw/vfio/vfio-device.h\nindex 17c5db369c..1a3b42bcaf 100644\n--- a/include/hw/vfio/vfio-device.h\n+++ b/include/hw/vfio/vfio-device.h\n@@ -44,6 +44,7 @@ enum {\n typedef struct VFIODeviceOps VFIODeviceOps;\n typedef struct VFIODeviceIOOps VFIODeviceIOOps;\n typedef struct VFIOMigration VFIOMigration;\n+typedef struct VFIORegion VFIORegion;\n \n typedef struct IOMMUFDBackend IOMMUFDBackend;\n typedef struct VFIOIOASHwpt VFIOIOASHwpt;\n@@ -260,6 +261,30 @@ struct VFIODeviceIOOps {\n */\n int (*region_write)(VFIODevice *vdev, uint8_t nr, off_t off, uint32_t size,\n void *data, bool post);\n+\n+ /**\n+ * @region_map\n+ *\n+ * Map a region's directly accessible subranges and register any mmap-backed\n+ * subregions with QEMU.\n+ *\n+ * @vdev: #VFIODevice to use\n+ * @region: #VFIORegion to map\n+ *\n+ * Returns 0 on success or -errno.\n+ */\n+ int (*region_map)(VFIODevice *vdev, VFIORegion *region);\n+\n+ /**\n+ * @region_unmap\n+ *\n+ * Unregister any mmap-backed subregions for a region and release their\n+ * backend mappings.\n+ *\n+ * @vdev: #VFIODevice to use\n+ * @region: #VFIORegion to unmap\n+ */\n+ void (*region_unmap)(VFIODevice *vdev, VFIORegion *region);\n };\n \n void vfio_device_prepare(VFIODevice *vbasedev, VFIOContainer *bcontainer,\n", "prefixes": [ "RFC", "05/10" ] }