@@ -7,6 +7,7 @@
#include <xen/init.h>
#include <xen/libfdt/libfdt.h>
+#include <xen/pfn.h>
#include <xen/sections.h>
#include <xen/sizes.h>
#include <xen/vmap.h>
@@ -309,16 +310,17 @@ void *__init arch_vmap_virt_end(void)
void free_init_memory(void)
{
paddr_t pa = virt_to_maddr(__init_begin);
+ unsigned long inittext_end = round_pgup((unsigned long)_einittext);
unsigned long len = __init_end - __init_begin;
uint32_t insn;
unsigned int i, nr = len / sizeof(insn);
uint32_t *p;
int rc;
- rc = modify_xen_mappings((unsigned long)__init_begin,
- (unsigned long)__init_end, PAGE_HYPERVISOR_RW);
+ rc = modify_xen_mappings((unsigned long)__init_begin, inittext_end,
+ PAGE_HYPERVISOR_RW);
if ( rc )
- panic("Unable to map RW the init section (rc = %d)\n", rc);
+ panic("Unable to map RW the init text section (rc = %d)\n", rc);
/*
* From now on, init will not be used for execution anymore,