All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Arm: drop memguard_{,un}guard_range() stubs
@ 2021-12-14 15:16 Jan Beulich
  2021-12-14 15:55 ` Julien Grall
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Beulich @ 2021-12-14 15:16 UTC (permalink / raw)
  To: xen-devel
  Cc: Andrew Cooper, George Dunlap, Julien Grall, Stefano Stabellini, Wei Liu

These exist for no reason: The code using them is only ever built for
Arm32. And memguard_guard_stack() has no use outside of x86-specific
code at all.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -2152,8 +2152,6 @@ void init_xenheap_pages(paddr_t ps, padd
     if ( !is_xen_heap_mfn(maddr_to_mfn(pe)) )
         pe -= PAGE_SIZE;
 
-    memguard_guard_range(maddr_to_virt(ps), pe - ps);
-
     init_heap_pages(maddr_to_page(ps), (pe - ps) >> PAGE_SHIFT);
 }
 
@@ -2169,8 +2167,6 @@ void *alloc_xenheap_pages(unsigned int o
     if ( unlikely(pg == NULL) )
         return NULL;
 
-    memguard_unguard_range(page_to_virt(pg), 1 << (order + PAGE_SHIFT));
-
     return page_to_virt(pg);
 }
 
@@ -2182,8 +2178,6 @@ void free_xenheap_pages(void *v, unsigne
     if ( v == NULL )
         return;
 
-    memguard_guard_range(v, 1 << (order + PAGE_SHIFT));
-
     free_heap_pages(virt_to_page(v), order, false);
 }
 
--- a/xen/include/asm-arm/mm.h
+++ b/xen/include/asm-arm/mm.h
@@ -341,10 +341,6 @@ long arch_memory_op(int op, XEN_GUEST_HA
 
 unsigned long domain_get_maximum_gpfn(struct domain *d);
 
-#define memguard_guard_stack(_p)       ((void)0)
-#define memguard_guard_range(_p,_l)    ((void)0)
-#define memguard_unguard_range(_p,_l)  ((void)0)
-
 /* Release all __init and __initdata ranges to be reused */
 void free_init_memory(void);
 



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Arm: drop memguard_{,un}guard_range() stubs
  2021-12-14 15:16 [PATCH] Arm: drop memguard_{,un}guard_range() stubs Jan Beulich
@ 2021-12-14 15:55 ` Julien Grall
  0 siblings, 0 replies; 2+ messages in thread
From: Julien Grall @ 2021-12-14 15:55 UTC (permalink / raw)
  To: Jan Beulich, xen-devel
  Cc: Andrew Cooper, George Dunlap, Stefano Stabellini, Wei Liu

Hi Jan,

On 14/12/2021 15:16, Jan Beulich wrote:
> These exist for no reason: The code using them is only ever built for
> Arm32. And memguard_guard_stack() has no use outside of x86-specific
> code at all.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Julien Grall <jgrall@amazon.com>

> 
> --- a/xen/common/page_alloc.c
> +++ b/xen/common/page_alloc.c
> @@ -2152,8 +2152,6 @@ void init_xenheap_pages(paddr_t ps, padd
>       if ( !is_xen_heap_mfn(maddr_to_mfn(pe)) )
>           pe -= PAGE_SIZE;
>   
> -    memguard_guard_range(maddr_to_virt(ps), pe - ps);
> -
>       init_heap_pages(maddr_to_page(ps), (pe - ps) >> PAGE_SHIFT);
>   }
>   
> @@ -2169,8 +2167,6 @@ void *alloc_xenheap_pages(unsigned int o
>       if ( unlikely(pg == NULL) )
>           return NULL;
>   
> -    memguard_unguard_range(page_to_virt(pg), 1 << (order + PAGE_SHIFT));
> -
>       return page_to_virt(pg);
>   }
>   
> @@ -2182,8 +2178,6 @@ void free_xenheap_pages(void *v, unsigne
>       if ( v == NULL )
>           return;
>   
> -    memguard_guard_range(v, 1 << (order + PAGE_SHIFT));
> -
>       free_heap_pages(virt_to_page(v), order, false);
>   }
>   
> --- a/xen/include/asm-arm/mm.h
> +++ b/xen/include/asm-arm/mm.h
> @@ -341,10 +341,6 @@ long arch_memory_op(int op, XEN_GUEST_HA
>   
>   unsigned long domain_get_maximum_gpfn(struct domain *d);
>   
> -#define memguard_guard_stack(_p)       ((void)0)
> -#define memguard_guard_range(_p,_l)    ((void)0)
> -#define memguard_unguard_range(_p,_l)  ((void)0)
> -
>   /* Release all __init and __initdata ranges to be reused */
>   void free_init_memory(void);
>   
> 

Cheers,

-- 
Julien Grall


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-14 15:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-14 15:16 [PATCH] Arm: drop memguard_{,un}guard_range() stubs Jan Beulich
2021-12-14 15:55 ` Julien Grall

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.