Messages in this thread | | | Date | Sun, 16 Nov 2014 22:26:41 +0100 (CET) | From | Thomas Gleixner <> | Subject | Re: [PATCH v2] x86, mm: set NX across entire PMD at boot |
| |
On Sat, 15 Nov 2014, Yinghai Lu wrote: > +static pmd_t *last_pmd; > /* > * The head.S code sets up the kernel high mapping: > * > @@ -408,9 +409,26 @@ void __init cleanup_highmap(void) > continue; > if (vaddr < (unsigned long) _text || vaddr > end) > set_pmd(pmd, __pmd(0)); > + else > + last_pmd = pmd;
Why do you need to store this? You can compute this.
> +static void __init cleanup_highmap_tail(unsigned long addr)
Brilliant stuff. mark_rodata_ro() is called AFTER free_initmem() which will free exactly that code.
> +{ > + int i; > + pte_t *pte; > + > + if (!last_pmd || pmd_none(*last_pmd)) > + return;
Aside of the above: This is complete and utter crap. Just another useless function which can be avoided by switching on brain before coding.
> Index: linux-2.6/arch/x86/mm/pageattr.c > =================================================================== > --- linux-2.6.orig/arch/x86/mm/pageattr.c > +++ linux-2.6/arch/x86/mm/pageattr.c > @@ -100,7 +100,7 @@ static inline unsigned long highmap_star > > static inline unsigned long highmap_end_pfn(void) > { > - return __pa_symbol(roundup(_brk_end, PMD_SIZE)) >> PAGE_SHIFT; > + return __pa_symbol(PFN_ALIGN(_brk_end)) >> PAGE_SHIFT; > }
Wrong as well for CONFIG_DEBUG_RODATA=n for obvious reasons.
I know why I have your patches on blacklist ....
Thanks,
tglx
| |