Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753043AbbGBJKc (ORCPT ); Thu, 2 Jul 2015 05:10:32 -0400 Received: from mailout3.w1.samsung.com ([210.118.77.13]:17857 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751960AbbGBJJx (ORCPT ); Thu, 2 Jul 2015 05:09:53 -0400 X-AuditID: cbfec7f4-f79c56d0000012ee-db-5594ffdaa30d From: Andrey Ryabinin To: Ingo Molnar , "H. Peter Anvin" , Thomas Gleixner , x86@kernel.org Cc: Andrey Konovalov , Andrew Morton , Borislav Petkov , Alexander Popov , Dmitry Vyukov , Alexander Potapenko , linux-kernel@vger.kernel.org, Andrey Ryabinin , stable@vger.kernel.org Subject: [PATCH v2 1/6] x86_64, init: clear init_level4_pgt earlier Date: Thu, 02 Jul 2015 12:09:33 +0300 Message-id: <1435828178-10975-2-git-send-email-a.ryabinin@samsung.com> X-Mailer: git-send-email 2.4.5 In-reply-to: <1435828178-10975-1-git-send-email-a.ryabinin@samsung.com> References: <1435828178-10975-1-git-send-email-a.ryabinin@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrLLMWRmVeSWpSXmKPExsVy+t/xa7q3/k8JNfh6Q99i269HbBa/985k tZizfg2bxfQdfewWnzf8Y7OY8LCN3aL9415mi2kbxS0u75rDZnHpwAImiwUbHzFabN40ldni x4bHrA68Ht9b+1g8ds66y+6xYFOpx6ZVnWwe786dY/c4MeM3i8f2R1NZPN7vu8rm0bdlFaPH 501yHidavrAGcEdx2aSk5mSWpRbp2yVwZTRd+MJYMJOrovvlHqYGxhMcXYwcHBICJhIHVpp1 MXICmWISF+6tZ+ti5OIQEljKKDH512Z2CKeJSWJ/23tGkCo2AT2Jf7O2s4HYIgI1Eh2t3cwg RcwCl5kkHk/tZwdJCAs4S+y7uw+siEVAVaJn9QQwm1fATeLujb/sEJvlJJY214KEOQXcJTqb 3oC1CgGVXGu+yzSBkXcBI8MqRtHU0uSC4qT0XEO94sTc4tK8dL3k/NxNjJBA/rKDcfExq0OM AhyMSjy8K2qmhAqxJpYVV+YeYpTgYFYS4V3/EijEm5JYWZValB9fVJqTWnyIUZqDRUmcd+6u 9yFCAumJJanZqakFqUUwWSYOTqkGRsOX4a8P6ip2ZNRXzZgqLakoLrTyys4lATxpZ8O6XkxY ssvZVvT/FO8v1+bz/fWeYRbCy8JX+GXnuQzp7Pplh3gWNFs7x8v29gdXpFZ8XPXsfrbx54m1 t0LC9eNuJ9iKSUY5BtaJpz59ftnG19O/avU1t/fWPw5mL5lS+PxSmQofQ/aDs2r9SizFGYmG WsxFxYkAllrW1mACAAA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1512 Lines: 43 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+ --- 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]; -- 2.4.5 -- 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/