From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752186AbdI1IPU (ORCPT ); Thu, 28 Sep 2017 04:15:20 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:48139 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751873AbdI1IPQ (ORCPT ); Thu, 28 Sep 2017 04:15:16 -0400 X-Google-Smtp-Source: AOwi7QDdBhYJsFER0uojNxwp4grQm03WrlFubSbjz3AApZpwTnvP/e6T/nQuhWuieAYF0AqJfQOFHw== Date: Thu, 28 Sep 2017 10:15:12 +0200 From: Ingo Molnar To: "Kirill A. Shutemov" Cc: Ingo Molnar , Linus Torvalds , x86@kernel.org, Thomas Gleixner , "H. Peter Anvin" , Andrew Morton , Andy Lutomirski , Cyrill Gorcunov , Borislav Petkov , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrey Ryabinin Subject: Re: [PATCHv7 03/19] x86/kasan: Use the same shadow offset for 4- and 5-level paging Message-ID: <20170928081512.3zakiygb3uknbtr3@gmail.com> References: <20170918105553.27914-1-kirill.shutemov@linux.intel.com> <20170918105553.27914-4-kirill.shutemov@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170918105553.27914-4-kirill.shutemov@linux.intel.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Kirill A. Shutemov wrote: > We are going to support boot-time switching between 4- and 5-level > paging. For KASAN it means we cannot have different KASAN_SHADOW_OFFSET > for different paging modes: the constant is passed to gcc to generate > code and cannot be changed at runtime. > > This patch changes KASAN code to use 0xdffffc0000000000 as shadow offset > for both 4- and 5-level paging. > > For 5-level paging it means that shadow memory region is not aligned to > PGD boundary anymore and we have to handle unaligned parts of the region > properly. > > In addition, we have to exclude paravirt code from KASAN instrumentation > as we now use set_pgd() before KASAN is fully ready. > > Signed-off-by: Andrey Ryabinin > [kirill.shutemov@linux.intel.com: clenaup, changelog message] > Signed-off-by: Kirill A. Shutemov Bad SOB chain. If Andrey the true author of this patch then it be reflected in a "From:" line. > --- > arch/x86/Kconfig | 1 - > arch/x86/kernel/Makefile | 3 +- > arch/x86/mm/kasan_init_64.c | 86 ++++++++++++++++++++++++++++++++++----------- > 3 files changed, 67 insertions(+), 23 deletions(-) This is a lot of complex code added with exactly zero lines of comments that explains all the complexity ... Thanks, Ingo From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f199.google.com (mail-wr0-f199.google.com [209.85.128.199]) by kanga.kvack.org (Postfix) with ESMTP id E28F56B025F for ; Thu, 28 Sep 2017 04:15:16 -0400 (EDT) Received: by mail-wr0-f199.google.com with SMTP id h16so1288340wrf.0 for ; Thu, 28 Sep 2017 01:15:16 -0700 (PDT) Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id 1sor59013wmw.52.2017.09.28.01.15.15 for (Google Transport Security); Thu, 28 Sep 2017 01:15:15 -0700 (PDT) Date: Thu, 28 Sep 2017 10:15:12 +0200 From: Ingo Molnar Subject: Re: [PATCHv7 03/19] x86/kasan: Use the same shadow offset for 4- and 5-level paging Message-ID: <20170928081512.3zakiygb3uknbtr3@gmail.com> References: <20170918105553.27914-1-kirill.shutemov@linux.intel.com> <20170918105553.27914-4-kirill.shutemov@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170918105553.27914-4-kirill.shutemov@linux.intel.com> Sender: owner-linux-mm@kvack.org List-ID: To: "Kirill A. Shutemov" Cc: Ingo Molnar , Linus Torvalds , x86@kernel.org, Thomas Gleixner , "H. Peter Anvin" , Andrew Morton , Andy Lutomirski , Cyrill Gorcunov , Borislav Petkov , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrey Ryabinin * Kirill A. Shutemov wrote: > We are going to support boot-time switching between 4- and 5-level > paging. For KASAN it means we cannot have different KASAN_SHADOW_OFFSET > for different paging modes: the constant is passed to gcc to generate > code and cannot be changed at runtime. > > This patch changes KASAN code to use 0xdffffc0000000000 as shadow offset > for both 4- and 5-level paging. > > For 5-level paging it means that shadow memory region is not aligned to > PGD boundary anymore and we have to handle unaligned parts of the region > properly. > > In addition, we have to exclude paravirt code from KASAN instrumentation > as we now use set_pgd() before KASAN is fully ready. > > Signed-off-by: Andrey Ryabinin > [kirill.shutemov@linux.intel.com: clenaup, changelog message] > Signed-off-by: Kirill A. Shutemov Bad SOB chain. If Andrey the true author of this patch then it be reflected in a "From:" line. > --- > arch/x86/Kconfig | 1 - > arch/x86/kernel/Makefile | 3 +- > arch/x86/mm/kasan_init_64.c | 86 ++++++++++++++++++++++++++++++++++----------- > 3 files changed, 67 insertions(+), 23 deletions(-) This is a lot of complex code added with exactly zero lines of comments that explains all the complexity ... Thanks, Ingo -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org