From: "tip-bot for Kirill A. Shutemov" <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: kirill.shutemov@linux.intel.com, tglx@linutronix.de,
luto@kernel.org, dvlasenk@redhat.com, arnd@arndb.de,
bp@alien8.de, mhocko@suse.com, mingo@kernel.org,
linux-kernel@vger.kernel.org, dave.hansen@intel.com,
luto@amacapital.net, jpoimboe@redhat.com,
akpm@linux-foundation.org, torvalds@linux-foundation.org,
dvyukov@google.com, peterz@infradead.org, hpa@zytor.com,
brgerst@gmail.com
Subject: [tip:x86/mm] x86/kasan: Prepare clear_pgds() to switch to <asm-generic/pgtable-nop4d.h>
Date: Mon, 27 Mar 2017 03:24:37 -0700 [thread overview]
Message-ID: <tip-d691a3cf8004784303f0a4c1c036edfaa7d64d0b@git.kernel.org> (raw)
In-Reply-To: <20170317185515.8636-5-kirill.shutemov@linux.intel.com>
Commit-ID: d691a3cf8004784303f0a4c1c036edfaa7d64d0b
Gitweb: http://git.kernel.org/tip/d691a3cf8004784303f0a4c1c036edfaa7d64d0b
Author: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
AuthorDate: Fri, 17 Mar 2017 21:55:13 +0300
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Mon, 27 Mar 2017 08:56:41 +0200
x86/kasan: Prepare clear_pgds() to switch to <asm-generic/pgtable-nop4d.h>
With folded p4d, pgd_clear() is a nop. Change clear_pgds() to use
p4d_clear() instead.
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: linux-arch@vger.kernel.org
Cc: linux-mm@kvack.org
Link: http://lkml.kernel.org/r/20170317185515.8636-5-kirill.shutemov@linux.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
arch/x86/mm/kasan_init_64.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/arch/x86/mm/kasan_init_64.c b/arch/x86/mm/kasan_init_64.c
index 8d63d7a..7b81f01 100644
--- a/arch/x86/mm/kasan_init_64.c
+++ b/arch/x86/mm/kasan_init_64.c
@@ -32,8 +32,19 @@ static int __init map_range(struct range *range)
static void __init clear_pgds(unsigned long start,
unsigned long end)
{
- for (; start < end; start += PGDIR_SIZE)
- pgd_clear(pgd_offset_k(start));
+ pgd_t *pgd;
+
+ for (; start < end; start += PGDIR_SIZE) {
+ pgd = pgd_offset_k(start);
+ /*
+ * With folded p4d, pgd_clear() is nop, use p4d_clear()
+ * instead.
+ */
+ if (CONFIG_PGTABLE_LEVELS < 5)
+ p4d_clear(p4d_offset(pgd, start));
+ else
+ pgd_clear(pgd);
+ }
}
static void __init kasan_map_early_shadow(pgd_t *pgd)
next prev parent reply other threads:[~2017-03-27 10:33 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-17 18:55 [PATCH 0/6] x86: 5-level paging enabling for v4.12, Part 2 Kirill A. Shutemov
2017-03-17 18:55 ` [PATCH 1/6] x86/kexec: Add 5-level paging support Kirill A. Shutemov
2017-03-27 10:22 ` [tip:x86/mm] " tip-bot for Kirill A. Shutemov
2017-03-17 18:55 ` [PATCH 2/6] x86/efi: " Kirill A. Shutemov
2017-03-27 10:23 ` [tip:x86/mm] " tip-bot for Kirill A. Shutemov
2017-03-17 18:55 ` [PATCH 3/6] x86/mm/pat: " Kirill A. Shutemov
2017-03-17 19:49 ` Thomas Gleixner
2017-03-27 10:24 ` [tip:x86/mm] " tip-bot for Kirill A. Shutemov
2017-03-17 18:55 ` [PATCH 4/6] x86/kasan: Prepare clear_pgds() to switch to <asm-generic/pgtable-nop4d.h> Kirill A. Shutemov
2017-03-20 16:21 ` Andrey Ryabinin
2017-03-22 7:31 ` Ingo Molnar
2017-03-24 9:07 ` Kirill A. Shutemov
2017-03-24 10:58 ` Ingo Molnar
2017-03-27 10:24 ` tip-bot for Kirill A. Shutemov [this message]
2017-03-17 18:55 ` [PATCH 5/6] x86/xen: Change __xen_pgd_walk() and xen_cleanmfnmap() to support p4d Kirill A. Shutemov
2017-03-27 6:34 ` Ingo Molnar
2017-03-27 13:13 ` Kirill A. Shutemov
2017-03-27 10:25 ` [tip:x86/mm] " tip-bot for Xiong Zhang
2017-03-17 18:55 ` [PATCH 6/6] x86: Convert the rest of the code to support p4d_t Kirill A. Shutemov
2017-03-27 10:25 ` [tip:x86/mm] " tip-bot for Kirill A. Shutemov
2017-04-23 19:56 ` Dan Williams
2017-04-24 16:57 ` Kirill A. Shutemov
2017-04-24 18:42 ` Dan Williams
2017-04-25 0:57 ` Kirill A. Shutemov
2017-04-25 6:38 ` Ingo Molnar
2017-04-25 9:02 ` Kirill A. Shutemov
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=tip-d691a3cf8004784303f0a4c1c036edfaa7d64d0b@git.kernel.org \
--to=tipbot@zytor.com \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=bp@alien8.de \
--cc=brgerst@gmail.com \
--cc=dave.hansen@intel.com \
--cc=dvlasenk@redhat.com \
--cc=dvyukov@google.com \
--cc=hpa@zytor.com \
--cc=jpoimboe@redhat.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=luto@kernel.org \
--cc=mhocko@suse.com \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).