Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754527AbbGFPh3 (ORCPT ); Mon, 6 Jul 2015 11:37:29 -0400 Received: from terminus.zytor.com ([198.137.202.10]:49070 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753423AbbGFPhW (ORCPT ); Mon, 6 Jul 2015 11:37:22 -0400 Date: Mon, 6 Jul 2015 08:36:19 -0700 From: tip-bot for Andrey Ryabinin Message-ID: Cc: tglx@linutronix.de, linux-kernel@vger.kernel.org, alpopov@ptsecurity.com, peterz@infradead.org, hpa@zytor.com, adech.fo@gmail.com, dvyukov@google.com, glider@google.com, bp@alien8.de, torvalds@linux-foundation.org, mingo@kernel.org, a.ryabinin@samsung.com Reply-To: glider@google.com, dvyukov@google.com, adech.fo@gmail.com, peterz@infradead.org, hpa@zytor.com, mingo@kernel.org, a.ryabinin@samsung.com, torvalds@linux-foundation.org, bp@alien8.de, alpopov@ptsecurity.com, linux-kernel@vger.kernel.org, tglx@linutronix.de In-Reply-To: <1435828178-10975-2-git-send-email-a.ryabinin@samsung.com> References: <1435828178-10975-2-git-send-email-a.ryabinin@samsung.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/urgent] x86/init: Clear 'init_level4_pgt' earlier Git-Commit-ID: d0f77d4d04b222a817925d33ba3589b190bfa863 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2332 Lines: 59 Commit-ID: d0f77d4d04b222a817925d33ba3589b190bfa863 Gitweb: http://git.kernel.org/tip/d0f77d4d04b222a817925d33ba3589b190bfa863 Author: Andrey Ryabinin AuthorDate: Thu, 2 Jul 2015 12:09:33 +0300 Committer: Ingo Molnar CommitDate: Mon, 6 Jul 2015 14:53:13 +0200 x86/init: Clear 'init_level4_pgt' earlier Currently x86_64_start_kernel() has two KASAN related function calls. The first call maps shadow to early_level4_pgt, the second maps shadow to init_level4_pgt. If we move clear_page(init_level4_pgt) earlier, we could hide KASAN low level detail from generic x86_64 initialization code. The next patch will do it. Signed-off-by: Andrey Ryabinin Cc: # 4.0+ Cc: Alexander Popov Cc: Alexander Potapenko Cc: Andrey Konovalov Cc: Borislav Petkov Cc: Dmitry Vyukov Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1435828178-10975-2-git-send-email-a.ryabinin@samsung.com Signed-off-by: Ingo Molnar --- arch/x86/kernel/head64.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c index 5a46681..65c8985 100644 --- a/arch/x86/kernel/head64.c +++ b/arch/x86/kernel/head64.c @@ -166,6 +166,8 @@ asmlinkage __visible void __init x86_64_start_kernel(char * real_mode_data) /* clear bss before set_intr_gate with early_idt_handler */ clear_bss(); + clear_page(init_level4_pgt); + for (i = 0; i < NUM_EXCEPTION_VECTORS; i++) set_intr_gate(i, early_idt_handler_array[i]); load_idt((const struct desc_ptr *)&idt_descr); @@ -177,7 +179,6 @@ asmlinkage __visible void __init x86_64_start_kernel(char * real_mode_data) */ load_ucode_bsp(); - clear_page(init_level4_pgt); /* set init_level4_pgt kernel high mapping*/ init_level4_pgt[511] = early_level4_pgt[511]; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/