lkml.org 
[lkml]   [2014]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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


\
 
 \ /
  Last update: 2014-11-16 23:01    [W:0.784 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site