From: Juergen Gross <jgross@suse.com>
To: Jan Beulich <JBeulich@suse.com>,
mingo@elte.hu, Thomas Gleixner <tglx@linutronix.de>,
hpa@zytor.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] ix86: fix types used in pgprot cachability flags translations
Date: Tue, 26 Jan 2016 12:20:56 +0100 [thread overview]
Message-ID: <56A75698.9080706@suse.com> (raw)
In-Reply-To: <56A7635602000078000CAFF1@prv-mh.provo.novell.com>
On 26/01/16 12:15, Jan Beulich wrote:
> For PAE kernels "unsigned long" is not suitable to hold page protection
> flags, since _PAGE_NX doesn't fit there. This is the reason for quite a
> few W+X pages getting reported as insecure during boot (observed namely
> for the entire initrd range).
>
> Fixes: 281d4078be ("x86: Make page cache mode a real type")
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> Cc: Juergen Gross <jgross@suse.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
> ---
> v2: Remove code enhancement part, as requested by tglx.
> ---
> arch/x86/include/asm/pgtable_types.h | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)
>
> --- 4.5-rc1/arch/x86/include/asm/pgtable_types.h
> +++ 4.5-rc1-ix86-PAE-pgprot-xlat/arch/x86/include/asm/pgtable_types.h
> @@ -367,9 +367,8 @@ static inline enum page_cache_mode pgpro
> static inline pgprot_t pgprot_4k_2_large(pgprot_t pgprot)
> {
> pgprot_t new;
> - unsigned long val;
> + pgprotval_t val = pgprot_val(pgprot);
>
> - val = pgprot_val(pgprot);
> pgprot_val(new) = (val & ~(_PAGE_PAT | _PAGE_PAT_LARGE)) |
> ((val & _PAGE_PAT) << (_PAGE_BIT_PAT_LARGE - _PAGE_BIT_PAT));
> return new;
> @@ -377,9 +376,8 @@ static inline pgprot_t pgprot_4k_2_large
> static inline pgprot_t pgprot_large_2_4k(pgprot_t pgprot)
> {
> pgprot_t new;
> - unsigned long val;
> + pgprotval_t val = pgprot_val(pgprot);
>
> - val = pgprot_val(pgprot);
> pgprot_val(new) = (val & ~(_PAGE_PAT | _PAGE_PAT_LARGE)) |
> ((val & _PAGE_PAT_LARGE) >>
> (_PAGE_BIT_PAT_LARGE - _PAGE_BIT_PAT));
>
>
>
>
next prev parent reply other threads:[~2016-01-26 11:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-25 16:43 [PATCH] " Jan Beulich
2016-01-25 16:59 ` Thomas Gleixner
2016-01-26 11:15 ` [PATCH v2] " Jan Beulich
2016-01-26 11:20 ` Juergen Gross [this message]
2016-01-26 20:12 ` [tip:x86/urgent] x86/mm: Fix types used in pgprot cacheability " tip-bot for Jan Beulich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56A75698.9080706@suse.com \
--to=jgross@suse.com \
--cc=JBeulich@suse.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome