Re: [PATCH 06/17] prmem: test cases for memory protection

2018-10-29 Thread Igor Stoppa
On 25/10/2018 17:43, Dave Hansen wrote: +static bool is_address_protected(void *p) +{ + struct page *page; + struct vmap_area *area; + + if (unlikely(!is_vmalloc_addr(p))) + return false; + page = vmalloc_to_page(p); + if (unlikely(!page)) +

Re: [PATCH 06/17] prmem: test cases for memory protection

2018-10-25 Thread Dave Hansen
> +static bool is_address_protected(void *p) > +{ > + struct page *page; > + struct vmap_area *area; > + > + if (unlikely(!is_vmalloc_addr(p))) > + return false; > + page = vmalloc_to_page(p); > + if (unlikely(!page)) > + return false; > + wmb(); /* F

Re: [PATCH 06/17] prmem: test cases for memory protection

2018-10-24 Thread Igor Stoppa
Hi, On 24/10/18 06:27, Randy Dunlap wrote: a. It seems backwards (or upside down) to have a test case select a feature (PRMEM) instead of depending on that feature. b. Since PRMEM depends on MMU (in patch 04/17), the "select" here could try to enabled PRMEM even when MMU is not enabled. Chan

Re: [PATCH 06/17] prmem: test cases for memory protection

2018-10-23 Thread Randy Dunlap
On 10/23/18 2:34 PM, Igor Stoppa wrote: > diff --git a/mm/Kconfig.debug b/mm/Kconfig.debug > index 9a7b8b049d04..57de5b3c0bae 100644 > --- a/mm/Kconfig.debug > +++ b/mm/Kconfig.debug > @@ -94,3 +94,12 @@ config DEBUG_RODATA_TEST > depends on STRICT_KERNEL_RWX > ---help--- >This op