Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752075AbdGMM4S (ORCPT ); Thu, 13 Jul 2017 08:56:18 -0400 Received: from mail-ve1eur01on0110.outbound.protection.outlook.com ([104.47.1.110]:59746 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751165AbdGMM4N (ORCPT ); Thu, 13 Jul 2017 08:56:13 -0400 Authentication-Results: googlegroups.com; dkim=none (message not signed) header.d=none;googlegroups.com; dmarc=none action=none header.from=virtuozzo.com; Subject: Re: KASAN vs. boot-time switching between 4- and 5-level paging To: "Kirill A. Shutemov" Cc: "Kirill A. Shutemov" , Andy Lutomirski , Dmitry Vyukov , Alexander Potapenko , Linus Torvalds , Andrew Morton , "x86@kernel.org" , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Andi Kleen , Dave Hansen , linux-arch , "linux-mm@kvack.org" , LKML , kasan-dev References: <20170710184704.realchrhzpblqqlk@node.shutemov.name> <20170710212403.7ycczkhhki3vrgac@node.shutemov.name> <20170711103548.mkv5w7dd5gpdenne@node.shutemov.name> <20170711170332.wlaudicepkg35dmm@node.shutemov.name> <20170711190554.zxkpjeg2bt65wtir@black.fi.intel.com> From: Andrey Ryabinin Message-ID: <20939b37-efd8-2d32-0040-3682fff927c2@virtuozzo.com> Date: Thu, 13 Jul 2017 15:58:29 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <20170711190554.zxkpjeg2bt65wtir@black.fi.intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: AM5PR0402CA0024.eurprd04.prod.outlook.com (2603:10a6:203:90::34) To AM4PR0801MB2722.eurprd08.prod.outlook.com (2603:10a6:200:14::24) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a3d6ae1f-8627-4c8e-4453-08d4c9ee883f X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:AM4PR0801MB2722; X-Microsoft-Exchange-Diagnostics: 1;AM4PR0801MB2722;3:RG/Z98iHg4WIMcsO0l8HNV2ExMVuXuqLOF5nzxTqDJoWguuqibC/6+EqUg7AZfcx/WBmALp1itf8NFy3ommCoX+l8a/evob/ILsiCGJXru55gZPpxceAJVNfUZGX8rG27yQUHLkC7vkHdWYagUv87fweNEAMfY31NbUyIEJ0aiN0Q7ZThtjOxSGK9j/L4TAkUiB3cLIlIaV9iticDu5d9fHuJJZabO2w0MSWTrrrXFNRLmT1o0ltCAdWRcdzeF2XZ9Z0fnNNxysD4LIsLUm8ekiOg+7RQ5Uxdjm9PJaKeLBJSZutOW0kBSA5TregcrJBNORSyN0CbfuBzF6m1FkZj9YsQ58Mj5Z3UlpvJpjhXVv/5GwaVeSwReX75GA6orIn+W1YuaiEHqTt3fUA/V4PXl1d7uGte8hdWq7qA4Di6QYeLWZIsYR+CaRqbLTvAv444rxcbo1cIdeWBITbipodN11oZ8chREpFrfW+sQQYxGzzNQGlrWUAsqhAhPvQhAEqx3DjxZpE7NuObJi/thh1Ep6GUDjdp5MAY0YsFHayeOBAFSxHvSRwEiyL74cfgIMfLCQFkgQruDRZSoXvWTmajguJSihkYfQrIXA4H2vgYbGkU/gTaGQtBJ7PJsnDaFECoWoTxkZ3lKUcbe8dD2EdrQYF/7FBftlaDmBkIi4nVR/upBwRXk5tyU1jIzbF66rqoKJa6gClfv0C+wqZcRYf1KW/wghyvGAO2IpLex7rOoU= X-MS-TrafficTypeDiagnostic: AM4PR0801MB2722: X-Microsoft-Exchange-Diagnostics: 1;AM4PR0801MB2722;25:AGmUpMy26VX2Z84i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7WHTsLFE28/ZXFDCDJnn5bgcV7r7HIV0q+Gns5ue4hgLcTMDTSDs3YU2mtXH0jh1B1sWDZTLGs4gu6lRsgytWVRj3wcup3fUMKClmfkxwhXxAb1HoiZagIZpbSHnM1JtjS597mJ+wwtgJR+dUcwVZae8DmN9LEbN5qJ8CTC1T6XEa/9pXXvu7ad97bfrgHfyc+yUzUg5pS1eNulaDhGgeZhi2O3dAgQaUvlTV+f1Ay8wemt+utaLCgeaAF1kfz0jD3b5DQ61Oo7ZNxMqXHhj//hPdxamo9Q6LRjzVJXtZtc5o6C8SxmmVr7v+PX6i6htN5LwdpinMyssCuon7iU9D715x8IDBBJCRKAJTkltUN9SVHR9G9n3r1IyJ+pqAVDh0keSZksMCZrnnGeWGkbLTCUQB2Af0y5xilFypVqCR8vH/dJ+UPQVBjiaY/JqZ+vV76y1WMe9H//RbRV/cKJoh0wZnCTIoPxWY0wP32aaBHXrnYAGv72Nvf9sBYDhbVQ/k3qOKIb02Hl5agtgprW4R3iG1RQ+lks3DDKiJSj1GXRn1cES1taj9ICwd X-Microsoft-Exchange-Diagnostics: 1;AM4PR0801MB2722;20:IFHxeQTtP7IOCwXzntaoo7q1ExVF2DDl7ae+sQ42x4S7r8rADBv1frqFwvjFsxHkdMwibmentq5pi6NMwNd+5Ey3BnFauEegBRVyKvM+peQUtDsaxfkCrOB3TIKCWE5HuLJhrHbXPFJRstXanNXktskHGBGC/imfw1CBMk563NzLK2UFkYzieRVtBfh7TzM25T/BH4Q66cQWXIdhix8s3XADiWUhHkzWiU9Y/NItHwNLP/hwAuIVPoiI/bI/DnQjezqwJwuw+2zZiGk8EyuTaCxvCGv+O1qFt09kUeWYllHag4MySr9W8hO6h4nsFqMbCqi74qbW9nQF8Wds0XiBQXIYhJp3INUziv0GUi+OsIrJQXiADo5ZOeHIB1YD4Hb2PmRX5KrlulMwQ9RB6uQBMS7oMYbG/yMdV0FzpFRa91g= X-Exchange-Antispam-Report-Test: UriScan:(236129657087228)(48057245064654)(158140799945019); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(2017060910075)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93001095)(100000703101)(100105400095)(6041248)(20161123560025)(20161123564025)(20161123558100)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:AM4PR0801MB2722;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:AM4PR0801MB2722; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtBTTRQUjA4MDFNQjI3MjI7NDpBdnpGK1dGdFVSYTZKMUNoQlRteDh6K1N5?= =?utf-8?B?VFRJUUFPUG9oU2M4TTFpSE1HTmhSbDJoMWs0MkhtYXhmWnpPbUNHY1FBNFZw?= =?utf-8?B?cnByZTFENjBJbHVJRGdwWUlJM3o3S2Z4ckZ6Q1BVVUpMQ3Q5VGJOdXM4ZFkr?= =?utf-8?B?SFk4NzQ1L3RtbUhRUjREYzMxYkQ2d2lVdTZRL3IycmNpVkhBMmFIZENJUmU5?= =?utf-8?B?OUFOZzZRMlN6Rkl2R1RDdlRiWXh4SjRxQVB6cWk2MUduWkc5STFQQTZzZEFG?= =?utf-8?B?Q0JmVGdLZS83akMxc0t3VFBXZlBSbXJQV0JiUUpramI4QUl4UUxDYlRWdFd3?= =?utf-8?B?SjdHS0ZYTmliY3FybGRkYXo0amZQdm5qUFI5bjJkWXRvenZYYjg2ZXZSQ2p4?= =?utf-8?B?cjc4UlhFN3dGWjhHOGd4V0t5aloyRzJCUnl3MFRwNGxCaGJ1N3U3WGsvbEZw?= =?utf-8?B?NEJmdVJPakRaQisxZnBoMmpRVFZaU3lyMHh6aDJJMDZOQU5H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JVUw0UDFGdERwNXEvSDZYT0RYMXpT?= =?utf-8?B?NSt6VXErY1Q4dHpsZ0JYemR5a3lQbFY3dXQ4WGVweDRWblZ6L2FOYmFEUmhl?= =?utf-8?B?Z0JaMThUODRvd0lzN0twNVl3SFdaMTBWd3hQT3QrekZqdEI0ZEtNKzI0TGR4?= =?utf-8?B?RFFxcGxrSHlTTVNETDFXUGxUaUxOZHJ4VEh2ME5nUklxSUk0SmRpY3BicC9P?= =?utf-8?B?dWhGNG5XajJqNnQvSkVJM1hRei8xYlo4eWdVTGlSVGJvYjNpUFB5aGNuczA3?= =?utf-8?B?U2JCUzRNOTduUDl3eTJLdUhNY2RTdEpLWHUyMzJ1cUZUQkh2cHNWbkNrMEtj?= =?utf-8?B?emNsNjBjcFU3SGJma2x3Nmc9PQ==?= X-Forefront-PRVS: 0367A50BB1 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(7370300001)(4630300001)(6009001)(6049001)(39450400003)(39410400002)(39840400002)(39400400002)(377454003)(24454002)(31696002)(77096006)(2906002)(3846002)(7416002)(6486002)(230700001)(81166006)(2950100002)(305945005)(6116002)(23676002)(229853002)(5660300001)(7350300001)(25786009)(50466002)(6916009)(65826007)(7736002)(6666003)(4326008)(110136004)(38730400002)(83506001)(54356999)(86362001)(53936002)(66066001)(189998001)(6246003)(54906002)(53546010)(31686004)(76176999)(42186005)(93886004)(8676002)(64126003)(47776003)(33646002)(4001350100001)(36756003)(478600001)(50986999);DIR:OUT;SFP:1102;SCL:1;SRVR:AM4PR0801MB2722;H:[172.16.25.12];FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtBTTRQUjA4MDFNQjI3MjI7MjM6Y2NycktyQ0RVUk53dkE2bFhTakJKVGh4?= =?utf-8?B?NlFWK0NMQ3kyTVJCQmFjaFI5ditwVW5RZXg3S2pEd1ZsbzBGSzY1YlozOFZz?= =?utf-8?B?OTdFY0ZIZENjaHlBM3ZWNUh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Kj7x7857lB+XaER5gHT6wi4Q0mTyggfPsJPnhEU37JsKDJieewkKir1FHuB9HMPfaE8l5ROQr2YYlDp3gGsaa8/vFVrb3gMa0wqTxc+sdvoPteJUmX2VaFVdGogSXSFxaGfmXxHsJimARHg= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2017 12:56:08.2266 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0801MB2722 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5824 Lines: 140 On 07/11/2017 10:05 PM, Kirill A. Shutemov wrote: >>> Can use your Signed-off-by for a [cleaned up version of your] patch? >> >> Sure. > > Another KASAN-releated issue: dumping page tables for KASAN shadow memory > region takes unreasonable time due to kasan_zero_p?? mapped there. > > The patch below helps. Any objections? > Well, page tables dump doesn't work at all on 5-level paging. E.g. I've got this nonsense: .... ---[ Kernel Space ]--- 0xffff800000000000-0xffff808000000000 512G pud ---[ Low Kernel Mapping ]--- 0xffff808000000000-0xffff810000000000 512G pud ---[ vmalloc() Area ]--- 0xffff810000000000-0xffff818000000000 512G pud ---[ Vmemmap ]--- 0xffff818000000000-0xffffff0000000000 128512G pud ---[ ESPfix Area ]--- 0xffffff0000000000-0x0000000000000000 1T pud 0x0000000000000000-0x0000000000000000 0E pgd 0x0000000000000000-0x0000000000001000 4K RW PCD GLB NX pte 0x0000000000001000-0x0000000000002000 4K pte 0x0000000000002000-0x0000000000003000 4K ro GLB NX pte 0x0000000000003000-0x0000000000004000 4K pte 0x0000000000004000-0x0000000000007000 12K RW GLB NX pte 0x0000000000007000-0x0000000000008000 4K pte 0x0000000000008000-0x0000000000108000 1M RW GLB NX pte 0x0000000000108000-0x0000000000109000 4K pte 0x0000000000109000-0x0000000000189000 512K RW GLB NX pte 0x0000000000189000-0x000000000018a000 4K pte 0x000000000018a000-0x000000000018e000 16K RW GLB NX pte 0x000000000018e000-0x000000000018f000 4K pte 0x000000000018f000-0x0000000000193000 16K RW GLB NX pte 0x0000000000193000-0x0000000000194000 4K pte ... 304 entries skipped ... ---[ EFI Runtime Services ]--- 0xffffffef00000000-0xffffffff80000000 66G pud ---[ High Kernel Mapping ]--- 0xffffffff80000000-0xffffffffc0000000 1G pud ... As for KASAN, I think it would be better just to make it work faster, the patch below demonstrates the idea. --- arch/x86/mm/dump_pagetables.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/arch/x86/mm/dump_pagetables.c b/arch/x86/mm/dump_pagetables.c index 0470826d2bdc..36515fba86b0 100644 --- a/arch/x86/mm/dump_pagetables.c +++ b/arch/x86/mm/dump_pagetables.c @@ -13,6 +13,7 @@ */ #include +#include #include #include #include @@ -307,16 +308,19 @@ static void walk_pte_level(struct seq_file *m, struct pg_state *st, pmd_t addr, static void walk_pmd_level(struct seq_file *m, struct pg_state *st, pud_t addr, unsigned long P) { int i; - pmd_t *start; + pmd_t *start, *pmd_addr; pgprotval_t prot; - start = (pmd_t *)pud_page_vaddr(addr); + pmd_addr = start = (pmd_t *)pud_page_vaddr(addr); for (i = 0; i < PTRS_PER_PMD; i++) { st->current_address = normalize_addr(P + i * PMD_LEVEL_MULT); if (!pmd_none(*start)) { if (pmd_large(*start) || !pmd_present(*start)) { prot = pmd_flags(*start); note_page(m, st, __pgprot(prot), 3); + } else if (__pa(pmd_addr) == __pa(kasan_zero_pmd)) { + prot = pte_flags(kasan_zero_pte[0]); + note_page(m, st, __pgprot(prot), 4); } else { walk_pte_level(m, st, *start, P + i * PMD_LEVEL_MULT); @@ -349,11 +353,11 @@ static bool pud_already_checked(pud_t *prev_pud, pud_t *pud, bool checkwx) static void walk_pud_level(struct seq_file *m, struct pg_state *st, p4d_t addr, unsigned long P) { int i; - pud_t *start; + pud_t *start, *pud_addr; pgprotval_t prot; pud_t *prev_pud = NULL; - start = (pud_t *)p4d_page_vaddr(addr); + pud_addr = start = (pud_t *)p4d_page_vaddr(addr); for (i = 0; i < PTRS_PER_PUD; i++) { st->current_address = normalize_addr(P + i * PUD_LEVEL_MULT); @@ -362,6 +366,9 @@ static void walk_pud_level(struct seq_file *m, struct pg_state *st, p4d_t addr, if (pud_large(*start) || !pud_present(*start)) { prot = pud_flags(*start); note_page(m, st, __pgprot(prot), 2); + } else if (__pa(pud_addr) == __pa(kasan_zero_pud)) { + prot = pte_flags(kasan_zero_pte[0]); + note_page(m, st, __pgprot(prot), 4); } else { walk_pmd_level(m, st, *start, P + i * PUD_LEVEL_MULT); @@ -385,10 +392,10 @@ static void walk_pud_level(struct seq_file *m, struct pg_state *st, p4d_t addr, static void walk_p4d_level(struct seq_file *m, struct pg_state *st, pgd_t addr, unsigned long P) { int i; - p4d_t *start; + p4d_t *start, *p4d_addr; pgprotval_t prot; - start = (p4d_t *)pgd_page_vaddr(addr); + p4d_addr = start = (p4d_t *)pgd_page_vaddr(addr); for (i = 0; i < PTRS_PER_P4D; i++) { st->current_address = normalize_addr(P + i * P4D_LEVEL_MULT); @@ -396,6 +403,9 @@ static void walk_p4d_level(struct seq_file *m, struct pg_state *st, pgd_t addr, if (p4d_large(*start) || !p4d_present(*start)) { prot = p4d_flags(*start); note_page(m, st, __pgprot(prot), 2); + } else if (__pa(p4d_addr) == __pa(kasan_zero_p4d)) { + prot = pte_flags(kasan_zero_pte[0]); + note_page(m, st, __pgprot(prot), 4); } else { walk_pud_level(m, st, *start, P + i * P4D_LEVEL_MULT); -- 2.13.0