Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp6001739ybv; Wed, 12 Feb 2020 04:18:17 -0800 (PST) X-Google-Smtp-Source: APXvYqzDgpLNTDJ04sCAgSwx0E0Hd9R/fqy7RY55jUzMq2L5r8rZ47ShyL8PuviptTsdS9FCXlRn X-Received: by 2002:a05:6830:2111:: with SMTP id i17mr8519493otc.24.1581509896849; Wed, 12 Feb 2020 04:18:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581509896; cv=none; d=google.com; s=arc-20160816; b=WrrDQvSEMc8ozQ7RlIkzeMcX3Apze8/mA92uxbC9DIdBWTmDz7UjY7sfHzTGHMFP+Z lg33Y39ZhOM0yQXpP4u//tIhOgvnd0fNdvAQMa5H2JeuRCVyYsNNRF4N+y49bVM8nh/C og33SDbNcLEGdbuhtbKALwyStTF4vkr0ejKZVsHjXaycGHtPYkcNddm/mNw6TV8h7CKC G96q52Iia/UfVu6d3wrB7jCHZQxaRcV7PeZ6FyheZ3UV8uqmj772q1tG+r6PD7/Jiyig Gx8aZxfT44JSNvEIdVW2vzIqhVt34CVrk/xnAH64IXbDk0+KXzNKOFNiZnOOgRe4ApnC twbg== 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:mime-version :message-id:date:references:in-reply-to:subject:cc:to:from :dkim-signature; bh=ORoK11ERH5m7YuJvIylQ/MWzmpJfOKr+pxcrwqBrMvQ=; b=FBqKjr7ANElmcdkOwRiUhOwc+AY2YOyAOpjYyUdff044gyBd4CuUg9NabSs26/pfAJ ribJZS5P6IvrXtwMNnJjiOmCbfS+tZu9AoIIwJwL+7hmssxjzcZ8M4x8VinaS/x1fzxY oVo4L57SIa7Ot5lKfiIjsS0HP6yEP25VFOU2TTD7G2kM7Burik1fE7QKqCC2nw9vyvbV eU3sUZr+ScffiDdzn27RsmRJBoUZxyAFZy0CNgK2+ld1KsamMFOZDGvfSE/u6gcL5Z+j SOgBCoEhRS2cJy6K6PqOsOe7C5769ECh/JqsE+g6IyrABMBtUMIT71CCqL8fxAxb+tDH ruEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@axtens.net header.s=google header.b=XWCVr0we; 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 o13si138808otp.27.2020.02.12.04.18.04; Wed, 12 Feb 2020 04:18:16 -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=@axtens.net header.s=google header.b=XWCVr0we; 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 S1727667AbgBLMQb (ORCPT + 99 others); Wed, 12 Feb 2020 07:16:31 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:35869 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725945AbgBLMQb (ORCPT ); Wed, 12 Feb 2020 07:16:31 -0500 Received: by mail-pl1-f193.google.com with SMTP id a6so909076plm.3 for ; Wed, 12 Feb 2020 04:16:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axtens.net; s=google; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-transfer-encoding; bh=ORoK11ERH5m7YuJvIylQ/MWzmpJfOKr+pxcrwqBrMvQ=; b=XWCVr0we/B0Dnr38QeVN0NAFBB7OHmJ6catF4Y/m8KUXV6l1ibCWIyD6aROfJdFo9Q ys5FzIM1S4R9WZVpjIF+j0u96+EHCi/Uhcf05fseXW6fudw77tn/uCmRGDs36XDbemzz 0r6x9Ef6eJ3zC+P5L1ag/zMCrB7t/hSxhwWhM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=ORoK11ERH5m7YuJvIylQ/MWzmpJfOKr+pxcrwqBrMvQ=; b=maTzdFyOTAYdUoy9kwHFV+K7PJ7R6WZq/tJhxweFh44wmUYrnxWK8ZHY7P4Fw59k/c ILZpIu1Xd27+P2T9uhs7bL7a2MJWhXZzdegwBAs3kLbVI98PTD5E29QRX7l+8Zdgy3FH Y++5WI/JSAbqwy/Z95HlakxY9ZxsgEd4z1a+rNnTUzgyRZFZNiqpvBB1hopjlmFygMwB ury9tHprFU9Y8ZDUqpaxk4/omCP+EhQhGxzZanMMnejRrq/UJ1gYut5luJ3FLWWWOn/S /oXIneecWGF73azmFSxixEiMFJxcfLQXqDJqbSIhZdggiqAWHOQNkhx1kPw/3OUG88HK ZcQQ== X-Gm-Message-State: APjAAAVPbzxAR/0ZhsrEE6Txdc5SXEjAWVWp8L0Wl0uhqrSSFl3Tes2u tg4ROYDJWGCCP8LAfJhthgcXXA== X-Received: by 2002:a17:902:34d:: with SMTP id 71mr7957844pld.140.1581509789395; Wed, 12 Feb 2020 04:16:29 -0800 (PST) Received: from localhost (2001-44b8-1113-6700-65dc-9b98-63a7-c7a4.static.ipv6.internode.on.net. [2001:44b8:1113:6700:65dc:9b98:63a7:c7a4]) by smtp.gmail.com with ESMTPSA id z27sm749357pfj.107.2020.02.12.04.16.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Feb 2020 04:16:25 -0800 (PST) From: Daniel Axtens To: Christophe Leroy , 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 Subject: Re: [PATCH v6 4/4] powerpc: Book3S 64-bit "heavyweight" KASAN support In-Reply-To: <5e392944-50ac-ed06-5896-2664894335d9@c-s.fr> 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> <5e392944-50ac-ed06-5896-2664894335d9@c-s.fr> Date: Wed, 12 Feb 2020 23:16:21 +1100 Message-ID: <87ftfgrofe.fsf@dja-thinkpad.axtens.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Christophe Leroy writes: > Le 12/02/2020 =C3=A0 11:12, Daniel Axtens a =C3=A9crit=C2=A0: >> Christophe Leroy writes: >>=20 >>> Le 12/02/2020 =C3=A0 06:47, Daniel Axtens a =C3=A9crit=C2=A0: >>>> diff --git a/arch/powerpc/include/asm/kasan.h b/arch/powerpc/include/a= sm/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 >>>>=20=20=20=20 >>>> +#include >>>> + >>>> #ifdef CONFIG_KASAN >>>> #define _GLOBAL_KASAN(fn) _GLOBAL(__##fn) >>>> #define _GLOBAL_TOC_KASAN(fn) _GLOBAL_TOC(__##fn) >>>> @@ -14,29 +16,41 @@ >>>>=20=20=20=20 >>>> #ifndef __ASSEMBLY__ >>>>=20=20=20=20 >>>> -#include >>>> - >>>> #define KASAN_SHADOW_SCALE_SHIFT 3 >>>>=20=20=20=20 >>>> #define KASAN_SHADOW_START (KASAN_SHADOW_OFFSET + \ >>>> (PAGE_OFFSET >> KASAN_SHADOW_SCALE_SHIFT)) >>>>=20=20=20=20 >>>> +#ifdef CONFIG_KASAN_SHADOW_OFFSET >>>> #define KASAN_SHADOW_OFFSET ASM_CONST(CONFIG_KASAN_SHADOW_OFFSET) >>>> +#endif >>>>=20=20=20=20 >>>> +#ifdef CONFIG_PPC32 >>>> #define KASAN_SHADOW_END 0UL >>>>=20=20=20=20 >>>> -#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 >>>>=20=20=20=20 >>>> #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. >>=20 >> I got a compile error for a missing symbol. I'll repro it and attach it. >>=20 > > Oops, sorry. I looked too quickly. It is defined in kasan_init_32.c and=20 > called from mm/mem.c > > We don't have a performance issue here, since this is called only once=20 > during startup. Could you define an empty kasan_late_init() in=20 > init_book3s_64.c instead ? Yeah, I can do that, will respin tomorrow. Would you mind having a quick check of the documentation changes in patches 2 and 4? I just want to confirm I've accurately captured the state of ppc32 kasan work. Thanks! Daniel > > Christophe