Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5728413ybv; Tue, 11 Feb 2020 22:37:04 -0800 (PST) X-Google-Smtp-Source: APXvYqzbztMnXef3mtfW6lAV7upXV718cKW3kdk+sZ3+37scxKa3xUfzSf0AmlLPqNbWJal7g+3w X-Received: by 2002:a05:6808:b15:: with SMTP id s21mr4926279oij.123.1581489424320; Tue, 11 Feb 2020 22:37:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581489424; cv=none; d=google.com; s=arc-20160816; b=Hw2/0F+5Z7fh93h8qi8Cde6gvFZfD9dpIIPGRxx2dXQ3mGHUI5EfdPSEkeJLC+7KaS 6qf8TEIeSdr/rvoB5a+M0h25ZExaAOaYwt+fYJ4uBXFyeeJ4D8tWGBBzzFm0zwocf1JQ 9iP08u9VxyG68Pk7vd+3jBokJUIqPLZ6LrXwCUpha3hJR/imUUilNXYXQ9LU+KDWBBiT cLNsxHHSF2ulNETn5DBxhjnHZP0SlW80hw4XOQYXeUWIxgFJ2cGqwYyRfD4z/inAH2df joF+y2saQ5Nc1r/8h3znzRkXIZlXzLk/ycBZCqbZpD+0mhlmwGOORJDPZYuaDco+Hi0d jODg== 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=mlBXvnRSGUCMJcLvyWdPUsSnuUQABm7mYvYTkvnlvKQ=; b=gizfm73elfnOCsrzsihKYNXRmLKd967tPhl0ogqPt7pvm1CpQQ7rMphZGjvXCl+vGR aNWDpJFka+D7UnS13pryQTkvdXhBFfWV4fOBdAJAM2wxo6pYbswMjh8BmFeHOOHgM/Ya aVz0w86Yr8DTf7Zp4Jp2yBpvXlHYHnfzLQUkqojCUGRyqMGqtv2S8g5If/RfM4U4EhTB S5JD8UMq0ZxBr7/XSBaNLA/JCCxKD626uyQALGRGlkwLdAi/SOIuKp9tzp3wm9fJSaHJ 0iSp/DgPJvXfblUM1E9vyqP7FovJbRJr16YsRr7wUFn+p+ESs9ColgUTL8ZIH+jP/MVX EuOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=gFtlJ2xh; 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 n203si2487663oia.112.2020.02.11.22.36.51; Tue, 11 Feb 2020 22:37:04 -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=gFtlJ2xh; 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 S1728213AbgBLGff (ORCPT + 99 others); Wed, 12 Feb 2020 01:35:35 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:36244 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728085AbgBLGff (ORCPT ); Wed, 12 Feb 2020 01:35:35 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 48HVJN3wSdz9v06n; Wed, 12 Feb 2020 07:35:32 +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=gFtlJ2xh; 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 PvBBu-t-JaUP; Wed, 12 Feb 2020 07:35:32 +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 48HVJN2lyTz9v06f; Wed, 12 Feb 2020 07:35:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1581489332; bh=mlBXvnRSGUCMJcLvyWdPUsSnuUQABm7mYvYTkvnlvKQ=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=gFtlJ2xhwbWh4Vdp/x6dY5YLM1BIT7PaMh3LwZ3vY6YtDgtifOwEessIltwhksQ5J Pil+ErH8sbKpTy4eVbENdNudj4LU302HjybNQV8MqKMPPxbTTw1DWFoJrCMJpCcc5B GUKsSkzRdsVdvXTkWfVdMAJ4kPxs7L1ZgloAr9cI= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 37B568B7FF; Wed, 12 Feb 2020 07:35:33 +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 mOVzraGcf1N3; Wed, 12 Feb 2020 07:35:33 +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 0D1FD8B75B; Wed, 12 Feb 2020 07:35:33 +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> From: Christophe Leroy Message-ID: <224745f3-db66-fe46-1459-d1d41867b4f3@c-s.fr> Date: Wed, 12 Feb 2020 07:35:32 +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: <20200212054724.7708-5-dja@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 à 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. Christophe