Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5914337ybv; Wed, 12 Feb 2020 02:37:40 -0800 (PST) X-Google-Smtp-Source: APXvYqydtl0MDHWDtyVDAMcy2EiSWm1O/eAhvdiadsF7kZqETrppycI1Ok2zKv53J8l4BGewcI3z X-Received: by 2002:aca:d5d3:: with SMTP id m202mr5531541oig.161.1581503859936; Wed, 12 Feb 2020 02:37:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581503859; cv=none; d=google.com; s=arc-20160816; b=dwgIyhk6SIrf58oy8vWF7MTn99kSlDzLCeMvi1tNnN8sHuKhiX/suThFFPK0Atjqtg wkg6EDwYARkU+QfQEsuwq3akMjYqhHOKzv8RDIElHutvGfs1EK0GSDbhUG4UvdCZgV61 Iwt6YhwfrM0LwOgQKDvXcaimtUhX9RgbK0TePtmnW022H6N7NHkiRPxRgzyMs9b50DyB mnpqz5sR2Ebt2VXW216HA6+2Z9uc33PrPraFJUHJwf2079lL5pkcseI9hOP/sJDHp25d jmnOL2VdYqn/bWlmt5fbi29nbPXgG4qq7Eux+Z1pGPb55ataspC3MG+W18E3CZGitXvE ybjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=JvA0CG6jDvr0RSzi8Qrt1q4uSzBaTaD34CT+eJj09s4=; b=vHGNdVAMU9Kfn5vUJmBopL75cCT+TMkTfeeDNEAzwO7GOlQI5rzkorGZk89F/h0csu tLjgKpi6TlSeQCrXPQmj+WroxBN11Ogpvby14JxbMdFjXg6EdX1MX3AaWHuSYlMfg197 OZe8qS6gsJgEiHNQ8d3140tyW3/sIvBLB/YLF2ZqsdmUe7AXj096Bdsh2UySwTZbAnda 5H7UFAjnzJ+9Nko9j/TMw8PGaHYwaFXB5Tikfq9NOJCqsBDKk61/8yl+Da+622dOI6f2 8/hDNVoIFuTnC5zxPJ/tJyfaTRzR/o58Uh5ooa2mWzJAi9sMlm4UG6bIJ6IIQ5fngNbO Mrjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b="lstPK/Ib"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q195si3089518oic.83.2020.02.12.02.37.27; Wed, 12 Feb 2020 02:37:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b="lstPK/Ib"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727847AbgBLKfn (ORCPT + 99 others); Wed, 12 Feb 2020 05:35:43 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:1353 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727781AbgBLKfn (ORCPT ); Wed, 12 Feb 2020 05:35:43 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 48HbdS2CM5z9tyYb; Wed, 12 Feb 2020 11:35:40 +0100 (CET) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=lstPK/Ib; dkim-adsp=pass; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id HsF2zY7jBGR0; Wed, 12 Feb 2020 11:35:40 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 48HbdS0h0Gz9v3Yf; Wed, 12 Feb 2020 11:35:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1581503740; bh=JvA0CG6jDvr0RSzi8Qrt1q4uSzBaTaD34CT+eJj09s4=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=lstPK/Ib2+8vie8poXNbqVcythLXlR1tHLuUJC3GNGwZ2L+6Yx1mtqVuGZHnqoc65 Ycr1ncLWk+lBEYO05/YVLVbZMj0KStRymMZB01DQ9saxxVIM9UCuMHyIXogAKZjM40 XDMiL8zqJ/kXJE4oGa+LlzkUYftB1ialHc1HXzM4= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 417A58B80C; Wed, 12 Feb 2020 11:35:41 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id wbLwY91DPYyD; Wed, 12 Feb 2020 11:35:41 +0100 (CET) Received: from [172.25.230.102] (po15451.idsi0.si.c-s.fr [172.25.230.102]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 13B278B806; Wed, 12 Feb 2020 11:35:41 +0100 (CET) Subject: Re: [PATCH v6 4/4] powerpc: Book3S 64-bit "heavyweight" KASAN support To: Daniel Axtens , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, kasan-dev@googlegroups.com, aneesh.kumar@linux.ibm.com, bsingharora@gmail.com Cc: Michael Ellerman References: <20200212054724.7708-1-dja@axtens.net> <20200212054724.7708-5-dja@axtens.net> <224745f3-db66-fe46-1459-d1d41867b4f3@c-s.fr> <87imkcru6b.fsf@dja-thinkpad.axtens.net> From: Christophe Leroy Message-ID: <5e392944-50ac-ed06-5896-2664894335d9@c-s.fr> Date: Wed, 12 Feb 2020 11:35:40 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 In-Reply-To: <87imkcru6b.fsf@dja-thinkpad.axtens.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 12/02/2020 à 11:12, Daniel Axtens a écrit : > Christophe Leroy writes: > >> Le 12/02/2020 à 06:47, Daniel Axtens a écrit : >>> diff --git a/arch/powerpc/include/asm/kasan.h b/arch/powerpc/include/asm/kasan.h >>> index fbff9ff9032e..2911fdd3a6a0 100644 >>> --- a/arch/powerpc/include/asm/kasan.h >>> +++ b/arch/powerpc/include/asm/kasan.h >>> @@ -2,6 +2,8 @@ >>> #ifndef __ASM_KASAN_H >>> #define __ASM_KASAN_H >>> >>> +#include >>> + >>> #ifdef CONFIG_KASAN >>> #define _GLOBAL_KASAN(fn) _GLOBAL(__##fn) >>> #define _GLOBAL_TOC_KASAN(fn) _GLOBAL_TOC(__##fn) >>> @@ -14,29 +16,41 @@ >>> >>> #ifndef __ASSEMBLY__ >>> >>> -#include >>> - >>> #define KASAN_SHADOW_SCALE_SHIFT 3 >>> >>> #define KASAN_SHADOW_START (KASAN_SHADOW_OFFSET + \ >>> (PAGE_OFFSET >> KASAN_SHADOW_SCALE_SHIFT)) >>> >>> +#ifdef CONFIG_KASAN_SHADOW_OFFSET >>> #define KASAN_SHADOW_OFFSET ASM_CONST(CONFIG_KASAN_SHADOW_OFFSET) >>> +#endif >>> >>> +#ifdef CONFIG_PPC32 >>> #define KASAN_SHADOW_END 0UL >>> >>> -#define KASAN_SHADOW_SIZE (KASAN_SHADOW_END - KASAN_SHADOW_START) >>> +#ifdef CONFIG_KASAN >>> +void kasan_late_init(void); >>> +#else >>> +static inline void kasan_late_init(void) { } >>> +#endif >>> + >>> +#endif >>> + >>> +#ifdef CONFIG_PPC_BOOK3S_64 >>> +#define KASAN_SHADOW_END (KASAN_SHADOW_OFFSET + \ >>> + (RADIX_VMEMMAP_END >> KASAN_SHADOW_SCALE_SHIFT)) >>> + >>> +static inline void kasan_late_init(void) { } >>> +#endif >>> >>> #ifdef CONFIG_KASAN >>> void kasan_early_init(void); >>> void kasan_mmu_init(void); >>> void kasan_init(void); >>> -void kasan_late_init(void); >>> #else >>> static inline void kasan_init(void) { } >>> static inline void kasan_mmu_init(void) { } >>> -static inline void kasan_late_init(void) { } >>> #endif >> >> Why modify all this kasan_late_init() stuff ? >> >> This function is only called from kasan init_32.c, it is never called by >> PPC64, so you should not need to modify anything at all. > > I got a compile error for a missing symbol. I'll repro it and attach it. > Oops, sorry. I looked too quickly. It is defined in kasan_init_32.c and called from mm/mem.c We don't have a performance issue here, since this is called only once during startup. Could you define an empty kasan_late_init() in init_book3s_64.c instead ? Christophe