From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752782AbdI1Kmu (ORCPT ); Thu, 28 Sep 2017 06:42:50 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:46095 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751082AbdI1Kmr (ORCPT ); Thu, 28 Sep 2017 06:42:47 -0400 X-Google-Smtp-Source: AOwi7QD+6cVljlXiIC5O+aF09vxEixlMH+va/wQz4FM5qJQjGID781RJkmtSzTDPRgCu7+iXFOEohg== Date: Thu, 28 Sep 2017 12:42:43 +0200 From: Ingo Molnar To: "Kirill A. Shutemov" Cc: "Kirill A. Shutemov" , 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 Subject: Re: [PATCHv7 10/19] x86/mm: Make __PHYSICAL_MASK_SHIFT and __VIRTUAL_MASK_SHIFT dynamic Message-ID: <20170928104243.dubif4ayw2spbyfn@gmail.com> References: <20170918105553.27914-1-kirill.shutemov@linux.intel.com> <20170918105553.27914-11-kirill.shutemov@linux.intel.com> <20170928082813.lvr45p53niznhycx@gmail.com> <20170928102254.t34en42ruek6d3lu@node.shutemov.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170928102254.t34en42ruek6d3lu@node.shutemov.name> 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: > On Thu, Sep 28, 2017 at 10:28:13AM +0200, Ingo Molnar wrote: > > > > * Kirill A. Shutemov wrote: > > > > > --- a/arch/x86/mm/dump_pagetables.c > > > +++ b/arch/x86/mm/dump_pagetables.c > > > @@ -82,8 +82,8 @@ static struct addr_marker address_markers[] = { > > > { 0/* VMALLOC_START */, "vmalloc() Area" }, > > > { 0/* VMEMMAP_START */, "Vmemmap" }, > > > #ifdef CONFIG_KASAN > > > - { KASAN_SHADOW_START, "KASAN shadow" }, > > > - { KASAN_SHADOW_END, "KASAN shadow end" }, > > > + { 0/* KASAN_SHADOW_START */, "KASAN shadow" }, > > > + { 0/* KASAN_SHADOW_END */, "KASAN shadow end" }, > > > > What's this? Looks hacky. > > KASAN_SHADOW_START and KASAN_SHADOW_END depend on __VIRTUAL_MASK_SHIFT, > which is dynamic for boot-time switching case. It means we cannot > initialize the corresponding address_markers fields compile-time, so we do > it boot-time. Yes, so please instead of just commenting out the values, please do something like this: /* * This field gets initialized with the (dynamic) KASAN_SHADOW_END value * in boot_fn_foo() */ { 0, "KASAN shadow end" }, where boot_fn_foo() is the function where this all gets set up. Thanks, Ingo