diff mbox series

[kvmtool] riscv: Allow initrd to be above 256MB on 64 bit

Message ID 20250126073843.4005907-1-antonb@tenstorrent.com (mailing list archive)
State New
Headers show
Series [kvmtool] riscv: Allow initrd to be above 256MB on 64 bit | expand

Commit Message

Anton Blanchard Jan. 26, 2025, 7:38 a.m. UTC
Signed-off-by: Anton Blanchard <antonb@tenstorrent.com>
---
 riscv/kvm.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/riscv/kvm.c b/riscv/kvm.c
index 1d49479..191fc31 100644
--- a/riscv/kvm.c
+++ b/riscv/kvm.c
@@ -109,16 +109,17 @@  bool kvm__arch_load_kernel_image(struct kvm *kvm, int fd_kernel, int fd_initrd,
 	unsigned long guest_addr, kernel_offset;
 	ssize_t file_size;
 
+#if __riscv_xlen == 64
+	limit = kvm->ram_start + kvm->ram_size - 1;
+	/* Linux expects to be booted at 2M boundary for RV64 */
+	kernel_offset = 0x200000;
+#else
 	/*
 	 * Linux requires the initrd and dtb to be mapped inside lowmem,
 	 * so we can't just place them at the top of memory.
 	 */
 	limit = kvm->ram_start + min(kvm->ram_size, (u64)SZ_256M) - 1;
 
-#if __riscv_xlen == 64
-	/* Linux expects to be booted at 2M boundary for RV64 */
-	kernel_offset = 0x200000;
-#else
 	/* Linux expects to be booted at 4M boundary for RV32 */
 	kernel_offset = 0x400000;
 #endif