From: zhong jiang <zhongjiang@huawei.com>
To: <dave.hansen@linux.intel.com>, <peterz@infradead.org>,
<tglx@linutronix.de>, <mingo@redhat.com>
Cc: <luto@kernel.org>, <bp@alien8.de>, <hpa@zytor.com>,
<zhongjiang@huawei.com>, <x86@kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: [RFC PATCH] x86/mm: Mask out unsupported bit when it set noexec=off
Date: Mon, 11 Nov 2019 17:53:14 +0800 [thread overview]
Message-ID: <1573465994-33249-1-git-send-email-zhongjiang@huawei.com> (raw)
Commit 510bb96fe5b3 ("x86/mm: Prevent bogus warnings with "noexec=off"")
use __supported_pte_mask to replace __default_kernel_pte_mask to mask
out the unsupported bits. It works when the command line set noexec=off.
It also seems to works to use __supported_pte_mask instead in native_set_fixmap.
Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
arch/x86/mm/pgtable.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c
index 7bd2c3a..13933b9 100644
--- a/arch/x86/mm/pgtable.c
+++ b/arch/x86/mm/pgtable.c
@@ -647,7 +647,7 @@ void native_set_fixmap(unsigned /* enum fixed_addresses */ idx,
phys_addr_t phys, pgprot_t flags)
{
/* Sanitize 'prot' against any unsupported bits: */
- pgprot_val(flags) &= __default_kernel_pte_mask;
+ pgprot_val(flags) &= __supported_pte_mask;
__native_set_fixmap(idx, pfn_pte(phys >> PAGE_SHIFT, flags));
}
--
1.7.12.4
next reply other threads:[~2019-11-11 9:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-11 9:53 zhong jiang [this message]
2019-11-11 23:32 ` Thomas Gleixner
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=1573465994-33249-1-git-send-email-zhongjiang@huawei.com \
--to=zhongjiang@huawei.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/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
all inboxes | Powered by JetHome®