[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT PATCH] plat/xen: Fix memory set read-only



Function _init_mem_set_readonly should skip setting to read-only the
mapped _libxenplat_shared_info instead of HYPERVISOR_shared_info.

Signed-off-by: Bruno Alvisio <bruno.alvisio@xxxxxxxxx>
---
 plat/xen/x86/mm.c    | 3 ++-
 plat/xen/x86/setup.c | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/plat/xen/x86/mm.c b/plat/xen/x86/mm.c
index 4181df6..a77868a 100644
--- a/plat/xen/x86/mm.c
+++ b/plat/xen/x86/mm.c
@@ -226,6 +226,7 @@ void _init_mem_build_pagetable(unsigned long *start_pfn, 
unsigned long *max_pfn)
 /*
  * Mark portion of the address space read only.
  */
+extern struct shared_info _libxenplat_shared_info;
 void _init_mem_set_readonly(void *text, void *etext)
 {
     unsigned long start_address =
@@ -269,7 +270,7 @@ void _init_mem_set_readonly(void *text, void *etext)
             offset = l1_table_offset(start_address);
         }
 
-        if ( start_address != (unsigned long)&HYPERVISOR_shared_info )
+        if ( start_address != (unsigned long)&_libxenplat_shared_info )
         {
 #ifdef CONFIG_PARAVIRT
             mmu_updates[count].ptr = 
diff --git a/plat/xen/x86/setup.c b/plat/xen/x86/setup.c
index cf8bad2..c60657e 100644
--- a/plat/xen/x86/setup.c
+++ b/plat/xen/x86/setup.c
@@ -157,7 +157,7 @@ static inline void _init_mem(void)
 
        _init_mem_build_pagetable(&start_pfn, &max_pfn);
        //_init_mem_clear_bootstrap(); /* FIXME - stack or text screwed up? */
-       //_init_mem_set_readonly(&_text, &_erodata); /* FIXME - shared info ro? 
*/
+       _init_mem_set_readonly(&_text, &_erodata);
 
        /* Fill out mrd array */
        /* heap */
-- 
2.3.2 (Apple Git-55)


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.