[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251020131218.68932-1-fangyu.yu@linux.alibaba.com>
Date: Mon, 20 Oct 2025 21:12:18 +0800
From: fangyu.yu@...ux.alibaba.com
To: ajones@...tanamicro.com
Cc: alex.williamson@...hat.com,
alex@...ti.fr,
anup@...infault.org,
atish.patra@...ux.dev,
iommu@...ts.linux.dev,
jgg@...dia.com,
joro@...tes.org,
kvm-riscv@...ts.infradead.org,
kvm@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux-riscv@...ts.infradead.org,
palmer@...belt.com,
paul.walmsley@...ive.com,
robin.murphy@....com,
tglx@...utronix.de,
tjeznach@...osinc.com,
will@...nel.org,
zong.li@...ive.com
Subject: Re: [RFC PATCH v2 18/18] DO NOT UPSTREAM: RISC-V: KVM: Workaround kvm_riscv_gstage_ioremap() bug
>Workaround a bug that breaks guest booting with device assignment that
>was introduced with commit 9bca8be646e0 ("RISC-V: KVM: Fix pte settings
>within kvm_riscv_gstage_ioremap()")
The root cause of the guest booting failure is that an HPA is obtained
in the kvm_arch_prepare_memory_region.
Here [1] might be the correct fixes for this issue.
[1] https://lore.kernel.org/linux-riscv/20251020130801.68356-1-fangyu.yu@linux.alibaba.com/T/#u
>---
> arch/riscv/kvm/mmu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/arch/riscv/kvm/mmu.c b/arch/riscv/kvm/mmu.c
>index 525fb5a330c0..994f18b92143 100644
>--- a/arch/riscv/kvm/mmu.c
>+++ b/arch/riscv/kvm/mmu.c
>@@ -56,7 +56,7 @@ int kvm_riscv_mmu_ioremap(struct kvm *kvm, gpa_t gpa, phys_addr_t hpa,
>
> end = (gpa + size + PAGE_SIZE - 1) & PAGE_MASK;
> pfn = __phys_to_pfn(hpa);
>- prot = pgprot_noncached(PAGE_WRITE);
>+ prot = pgprot_noncached(__pgprot(_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_READ | _PAGE_WRITE));
>
> for (addr = gpa; addr < end; addr += PAGE_SIZE) {
> map.addr = addr;
>--
>2.49.0
Thanks,
Fangyu
Powered by blists - more mailing lists