sv57 breaks Go since Go uses the upper bits of a pointer to store data, and it is not ready for sv57 yet. It probably breaks other type of software using this "pointer tagging" technic. The following patch fixes this: at the moment, there is no way to indicate to the kernel to downgrade to sv48, so we must patch the kernel.
[ Impact ]
sv57 breaks Go since Go uses the upper bits of a pointer to store data, and it is not ready for sv57 yet. It probably breaks other type of software using this "pointer tagging" technic. The following patch fixes this: at the moment, there is no way to indicate to the kernel to downgrade to sv48, so we must patch the kernel.
diff --git a/arch/ riscv/mm/ init.c b/arch/ riscv/mm/ init.c .18a0c70ed313 100644 riscv/mm/ init.c riscv/mm/ init.c
disable_ pgtable_ l4();
index 2c4a64e97aec.
--- a/arch/
+++ b/arch/
@@ -775,6 +775,10 @@ static __init void set_satp_mode(void)
}
+ /* UBUNTU: Force disable sv57 and fallback to sv48 */ l5_enabled) pgtable_ l5();
memset( early_pg_ dir, 0, PAGE_SIZE);
memset( early_p4d, 0, PAGE_SIZE);
memset( early_pud, 0, PAGE_SIZE);
+ if (pgtable_
+ disable_
+
[ Test Plan ]
Build an image with the new kernel and make sure snapd started correctly, or that you can compile a simple helloworld written in Go.
[ Where problems could occur ]
The patch could be wrong, but I already built a kernel with it and it worked fine.