From: Mostafa Saleh <smostafa@google.com>
To: kvm@vger.kernel.org
Cc: will@kernel.org, julien.thierry.kdev@gmail.com, praan@google.com,
eric.auger@redhat.com, alex@shazbot.org,
Mostafa Saleh <smostafa@google.com>
Subject: [PATCH kvmtool 6/9] vfio: Reserve guest address space for VFIO platform
Date: Sat, 24 Oct 2026 16:18:59 +0000 [thread overview]
Message-ID: <20261024161902.2093581-7-smostafa@google.com> (raw)
In-Reply-To: <20261024161902.2093581-1-smostafa@google.com>
Assigned platform devices need guest physical addresses for their
MMIO regions.
Reserve an area called KVM_VFIO_MMIO_AREA.
Signed-off-by: Mostafa Saleh <smostafa@google.com>
---
arm64/include/kvm/kvm-arch.h | 10 ++++++----
mips/include/kvm/kvm-arch.h | 2 ++
powerpc/include/kvm/kvm-arch.h | 2 ++
riscv/include/kvm/kvm-arch.h | 3 +++
x86/include/kvm/kvm-arch.h | 2 ++
5 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/arm64/include/kvm/kvm-arch.h b/arm64/include/kvm/kvm-arch.h
index e7dd526..cddb404 100644
--- a/arm64/include/kvm/kvm-arch.h
+++ b/arm64/include/kvm/kvm-arch.h
@@ -19,8 +19,8 @@
* +-------+----+-------+-------+--------+-----+---------+---......
* | PCI |////| plat | | | | |
* | I/O |////| MMIO: | Flash | virtio | GIC | PCI | DRAM
- * | space |////| UART, | | MMIO | | (AXI) |
- * | |////| RTC, | | | | |
+ * | space |////| UART, | | /VFIO | | (AXI) |
+ * | |////| RTC, | | MMIO | | |
* | |////| PVTIME| | | | |
* +-------+----+-------+-------+--------+-----+---------+---......
*/
@@ -47,8 +47,10 @@
#define KVM_FLASH_MAX_SIZE 0x1000000
#define KVM_VIRTIO_MMIO_AREA (KVM_FLASH_MMIO_BASE + KVM_FLASH_MAX_SIZE)
-#define ARM_VIRTIO_MMIO_SIZE (ARM_AXI_AREA - \
- (KVM_VIRTIO_MMIO_AREA + ARM_GIC_SIZE))
+#define ARM_VIRTIO_MMIO_SIZE SZ_128M
+
+#define KVM_VFIO_MMIO_AREA (KVM_VIRTIO_MMIO_AREA + ARM_VIRTIO_MMIO_SIZE)
+#define KVM_VFIO_MMIO_SIZE SZ_32M
#define ARM_GIC_DIST_BASE (ARM_AXI_AREA - ARM_GIC_DIST_SIZE)
#define ARM_GIC_CPUI_BASE (ARM_GIC_DIST_BASE - ARM_GIC_CPUI_SIZE)
diff --git a/mips/include/kvm/kvm-arch.h b/mips/include/kvm/kvm-arch.h
index f5b9044..d9a9a64 100644
--- a/mips/include/kvm/kvm-arch.h
+++ b/mips/include/kvm/kvm-arch.h
@@ -15,6 +15,8 @@
#define KVM_PCI_CFG_AREA KVM_MMIO_START
#define KVM_PCI_MMIO_AREA (KVM_MMIO_START + 0x1000000)
#define KVM_VIRTIO_MMIO_AREA (KVM_MMIO_START + 0x2000000)
+#define KVM_VFIO_MMIO_AREA (KVM_MMIO_START + 0x3000000)
+#define KVM_VFIO_MMIO_SIZE SZ_32M
#define KVM_MMIO_SIZE 0x10000000
/*
diff --git a/powerpc/include/kvm/kvm-arch.h b/powerpc/include/kvm/kvm-arch.h
index ff42c13..cebf73c 100644
--- a/powerpc/include/kvm/kvm-arch.h
+++ b/powerpc/include/kvm/kvm-arch.h
@@ -42,6 +42,8 @@
#define KVM_PCI_CFG_AREA 0x1000000
#define KVM_PCI_MMIO_AREA 0x2000000
#define KVM_VIRTIO_MMIO_AREA 0x3000000
+#define KVM_VFIO_MMIO_AREA 0x4000000
+#define KVM_VFIO_MMIO_SIZE SZ_32M
#define KVM_IRQ_OFFSET 16
diff --git a/riscv/include/kvm/kvm-arch.h b/riscv/include/kvm/kvm-arch.h
index 460b90b..b347216 100644
--- a/riscv/include/kvm/kvm-arch.h
+++ b/riscv/include/kvm/kvm-arch.h
@@ -45,6 +45,9 @@
#define KVM_PCI_CFG_AREA RISCV_PCI
#define KVM_PCI_MMIO_AREA (KVM_PCI_CFG_AREA + RISCV_PCI_CFG_SIZE)
#define KVM_VIRTIO_MMIO_AREA (RISCV_RTC_MMIO_BASE + RISCV_RTC_MMIO_SIZE)
+#define KVM_VIRTIO_MMIO_SIZE SZ_128M
+#define KVM_VFIO_MMIO_AREA (KVM_VIRTIO_MMIO_AREA + KVM_VIRTIO_MMIO_SIZE)
+#define KVM_VFIO_MMIO_SIZE SZ_32M
#define KVM_IOEVENTFD_HAS_PIO 0
diff --git a/x86/include/kvm/kvm-arch.h b/x86/include/kvm/kvm-arch.h
index 73a957b..cc2defa 100644
--- a/x86/include/kvm/kvm-arch.h
+++ b/x86/include/kvm/kvm-arch.h
@@ -24,6 +24,8 @@
#define KVM_PCI_CFG_AREA (KVM_MMIO_START + 0x1000000)
#define KVM_PCI_MMIO_AREA (KVM_MMIO_START + 0x2000000)
#define KVM_VIRTIO_MMIO_AREA (KVM_MMIO_START + 0x3000000)
+#define KVM_VFIO_MMIO_AREA (KVM_MMIO_START + 0x4000000)
+#define KVM_VFIO_MMIO_SIZE SZ_32M
#define KVM_IRQ_OFFSET 5
--
2.56.0.307.g5fe7bd680c-goog
next prev parent reply other threads:[~2026-10-24 16:20 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-24 16:18 [PATCH kvmtool 0/9] vfio: Add support for platform devices Mostafa Saleh
2026-10-24 16:18 ` [PATCH kvmtool 1/9] vfio: Fix fd leak in vfio_group_get_for_dev() Mostafa Saleh
2026-10-24 16:18 ` [PATCH kvmtool 2/9] vfio: Factor out wired IRQ setup and teardown Mostafa Saleh
2026-10-24 16:18 ` [PATCH kvmtool 3/9] vfio: Support edge-triggered wired IRQs Mostafa Saleh
2026-10-24 16:18 ` [PATCH kvmtool 4/9] fdt: Allow fdt_irq_fn to generate multiple interrupts Mostafa Saleh
2026-10-24 16:18 ` [PATCH kvmtool 5/9] fdt: Add helper to copy an FDT node Mostafa Saleh
2026-10-24 16:18 ` Mostafa Saleh [this message]
2026-10-24 16:19 ` [PATCH kvmtool 7/9] vfio: Add basic support for vfio-platform Mostafa Saleh
2026-10-24 16:19 ` [PATCH kvmtool 8/9] vfio: platform: Add interrupts support Mostafa Saleh
2026-10-24 16:19 ` [PATCH kvmtool 9/9] vfio: platform: Take the guest node from a device tree template Mostafa Saleh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261024161902.2093581-7-smostafa@google.com \
--to=smostafa@google.com \
--cc=alex@shazbot.org \
--cc=eric.auger@redhat.com \
--cc=julien.thierry.kdev@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=praan@google.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.