@@ -352,12 +352,6 @@ void arch_dump_shared_mem_info(void)
BUG_ON("unimplemented");
}
-int populate_pt_range(unsigned long virt, unsigned long nr_mfns)
-{
- BUG_ON("unimplemented");
- return -1;
-}
-
int xenmem_add_to_physmap_one(struct domain *d, unsigned int space,
union add_to_physmap_extra extra,
unsigned long idx, gfn_t gfn)
@@ -516,3 +510,8 @@ void __init setup_mm(void)
#else /* CONFIG_RISCV_32 */
#error setup_mm(), setup_{directmap,frametable}_mapping() should be implemented for RV_32
#endif
+
+void *__init arch_vmap_virt_end(void)
+{
+ return (void *)(VMAP_VIRT_START + VMAP_VIRT_SIZE);
+}
@@ -1,6 +1,7 @@
#include <xen/bug.h>
#include <xen/domain_page.h>
#include <xen/errno.h>
+#include <xen/init.h>
#include <xen/lib.h>
#include <xen/mm.h>
#include <xen/pfn.h>
@@ -419,3 +420,8 @@ int map_pages_to_xen(unsigned long virt,
return pt_update(virt, mfn, nr_mfns, flags);
}
+
+int __init populate_pt_range(unsigned long virt, unsigned long nr_mfns)
+{
+ return pt_update(virt, INVALID_MFN, nr_mfns, PTE_POPULATE);
+}
@@ -7,6 +7,7 @@
#include <xen/init.h>
#include <xen/mm.h>
#include <xen/shutdown.h>
+#include <xen/vmap.h>
#include <public/version.h>
@@ -62,6 +63,8 @@ void __init noreturn start_xen(unsigned long bootcpu_id,
setup_mm();
+ vm_init();
+
printk("All set up\n");
machine_halt();
Call vm_init() to initialize the VMAP_DEFAULT virtual range. To support this, introduce the populate_pt_range() and arch_vmap_virt_end() functions, which are used by vm_init()->vm_init_type(). Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com> --- xen/arch/riscv/mm.c | 11 +++++------ xen/arch/riscv/pt.c | 6 ++++++ xen/arch/riscv/setup.c | 3 +++ 3 files changed, 14 insertions(+), 6 deletions(-)