[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230419222350.3604274-10-atishp@rivosinc.com>
Date: Wed, 19 Apr 2023 15:23:49 -0700
From: Atish Patra <atishp@...osinc.com>
To: linux-kernel@...r.kernel.org
Cc: Rajnesh Kanwal <rkanwal@...osinc.com>,
Alexandre Ghiti <alex@...ti.fr>,
Andrew Jones <ajones@...tanamicro.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Anup Patel <anup@...infault.org>,
Atish Patra <atishp@...shpatra.org>,
Suzuki K Poulose <suzuki.poulose@....com>,
Will Deacon <will@...nel.org>, Marc Zyngier <maz@...nel.org>,
Sean Christopherson <seanjc@...gle.com>,
linux-coco@...ts.linux.dev, Dylan Reid <dylan@...osinc.com>,
abrestic@...osinc.com, Samuel Ortiz <sameo@...osinc.com>,
Jiri Slaby <jirislaby@...nel.org>,
kvm-riscv@...ts.infradead.org, kvm@...r.kernel.org,
linux-mm@...ck.org, linux-riscv@...ts.infradead.org,
Palmer Dabbelt <palmer@...belt.com>,
Paolo Bonzini <pbonzini@...hat.com>,
Uladzislau Rezki <urezki@...il.com>
Subject: [RFC kvmtool 09/10] riscv: Don't emit MMIO devices for CoVE VM.
From: Rajnesh Kanwal <rkanwal@...osinc.com>
The CoVE VMs do not support MMIO devices yet. Do not emit
MMIO device nodes for CoVE VMs.
Signed-off-by: Rajnesh Kanwal <rkanwal@...osinc.com>
---
riscv/fdt.c | 33 ++++++++++++++++++---------------
1 file changed, 18 insertions(+), 15 deletions(-)
diff --git a/riscv/fdt.c b/riscv/fdt.c
index 07ec336..a7d32b3 100644
--- a/riscv/fdt.c
+++ b/riscv/fdt.c
@@ -210,22 +210,25 @@ static int setup_fdt(struct kvm *kvm)
riscv_irqchip_phandle));
_FDT(fdt_property(fdt, "ranges", NULL, 0));
- /* Virtio MMIO devices */
- dev_hdr = device__first_dev(DEVICE_BUS_MMIO);
- while (dev_hdr) {
- generate_mmio_fdt_nodes = dev_hdr->data;
- generate_mmio_fdt_nodes(fdt, dev_hdr,
- riscv__generate_irq_prop);
- dev_hdr = device__next_dev(dev_hdr);
- }
+ /* CoVE VMs do not support MMIO devices yet */
+ if (!kvm->cfg.arch.cove_vm) {
+ /* Virtio MMIO devices */
+ dev_hdr = device__first_dev(DEVICE_BUS_MMIO);
+ while (dev_hdr) {
+ generate_mmio_fdt_nodes = dev_hdr->data;
+ generate_mmio_fdt_nodes(fdt, dev_hdr,
+ riscv__generate_irq_prop);
+ dev_hdr = device__next_dev(dev_hdr);
+ }
- /* IOPORT devices */
- dev_hdr = device__first_dev(DEVICE_BUS_IOPORT);
- while (dev_hdr) {
- generate_mmio_fdt_nodes = dev_hdr->data;
- generate_mmio_fdt_nodes(fdt, dev_hdr,
- riscv__generate_irq_prop);
- dev_hdr = device__next_dev(dev_hdr);
+ /* IOPORT devices */
+ dev_hdr = device__first_dev(DEVICE_BUS_IOPORT);
+ while (dev_hdr) {
+ generate_mmio_fdt_nodes = dev_hdr->data;
+ generate_mmio_fdt_nodes(fdt, dev_hdr,
+ riscv__generate_irq_prop);
+ dev_hdr = device__next_dev(dev_hdr);
+ }
}
/* PCI host controller */
--
2.25.1
Powered by blists - more mailing lists