From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 47C81C433DB for ; Mon, 22 Mar 2021 02:59:42 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CCD1C61930 for ; Mon, 22 Mar 2021 02:59:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CCD1C61930 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id AF4F76B0036; Sun, 21 Mar 2021 22:40:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AA8726B006C; Sun, 21 Mar 2021 22:40:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 91F4F6B0070; Sun, 21 Mar 2021 22:40:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0176.hostedemail.com [216.40.44.176]) by kanga.kvack.org (Postfix) with ESMTP id 6E72A6B0036 for ; Sun, 21 Mar 2021 22:40:50 -0400 (EDT) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id C940E1730877 for ; Mon, 22 Mar 2021 02:59:40 +0000 (UTC) X-FDA: 77946004920.02.0EC80C9 Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) by imf06.hostedemail.com (Postfix) with ESMTP id 5219AC0007C0 for ; Mon, 22 Mar 2021 02:59:40 +0000 (UTC) Received: by mail-pf1-f172.google.com with SMTP id y5so9984140pfn.1 for ; Sun, 21 Mar 2021 19:59:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=8PSyfDnBNxdEv0JuzVsHXHjHmPcZoANyRQWH8adKcPU=; b=KeQ2EZhFTYagfAjvaNMYRY2V8nza7K0AVpdfi9X2lo8Gs3x7mT7i06esVkHvO3ZvU4 lebgmxwhNqqUNxEOyZB+LLlOzZGqdINNcOrS5xMouPK7ioJkYNfJMcWj2C4Xk3ThbZRm 8GKB6ZEdQA4FaSOrfEWq1IzQ59N0bVKT/RlsuZShrfAINBb3nFG+k3SvJ8H1DkZwRXii 6rmpMRrm4lgT3oOiXCaydKA3ksPUrGXt6qz3Gmu1VOTrPhM6SwqZY7F40NJZ8bUjmyN3 aQ8wjtQ42ctdLsXzmpPtVnhYx+ohKZvxauXtiqKdhk8igcIeeFQ17gBe7K77JoALBN1X lsYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=8PSyfDnBNxdEv0JuzVsHXHjHmPcZoANyRQWH8adKcPU=; b=epZwMFqICGvxzfvowL77bhDoLiPEX8o4znRtwu1b62dPS7iZYKiTiJ6hPz4WX+luW1 eHN72+esRXaNZ+AJx5wLg1k/ElNwRRyAynF/9AgxLPa1uLrJSAKjxIgxADAc3kvQLjTm I5Sgveh1QAfpbE0uhuDmEOr/Ro+2aV1aCME/X5VcCXNKLdsKTuBC6SC+Ul9qtoXiQHlu QWSsJ3IJzXbytYFsrqBzI+ejqTksp36tfNzTiWL2Wgf+M4s+6G4YU2Q9xMXA4jSpX+qU 7Z2vVEWuLbXS0BjCBHiFDYLjDhcwrAIILTppMJUrb3GI5YED8kUMPM+xOLdw/uOp+QC9 zC/Q== X-Gm-Message-State: AOAM533msRkF8MT2T45tUIyj7T7fDmjx4YDs5QBwN2lSc5RGHVu/fMY2 et2ud1WKap1Z4WpCNDohVVE= X-Google-Smtp-Source: ABdhPJzP+wfmDE3n90GIkMs5FVkBLmsqxwWI8xoZ7BBqinIpDh/WojCEAWo5OUMjof16ChcmAc4HzQ== X-Received: by 2002:aa7:86d9:0:b029:1ff:275c:b67a with SMTP id h25-20020aa786d90000b02901ff275cb67amr19223972pfo.69.1616381979110; Sun, 21 Mar 2021 19:59:39 -0700 (PDT) Received: from localhost (121-45-173-48.tpgi.com.au. [121.45.173.48]) by smtp.gmail.com with ESMTPSA id mp19sm14599055pjb.2.2021.03.21.19.59.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Mar 2021 19:59:38 -0700 (PDT) Date: Mon, 22 Mar 2021 13:59:34 +1100 From: Balbir Singh To: Daniel Axtens Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, kasan-dev@googlegroups.com, christophe.leroy@csgroup.eu, aneesh.kumar@linux.ibm.com Subject: Re: [PATCH v11 6/6] powerpc: Book3S 64-bit outline-only KASAN support Message-ID: <20210322025934.GG77072@balbir-desktop> References: <20210319144058.772525-1-dja@axtens.net> <20210319144058.772525-7-dja@axtens.net> <20210320060259.GF77072@balbir-desktop> <87o8fcatxv.fsf@dja-thinkpad.axtens.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87o8fcatxv.fsf@dja-thinkpad.axtens.net> X-Stat-Signature: hyyp5m3gjfej4y3bfd8hky3psf8h9o9o X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 5219AC0007C0 Received-SPF: none (gmail.com>: No applicable sender policy available) receiver=imf06; identity=mailfrom; envelope-from=""; helo=mail-pf1-f172.google.com; client-ip=209.85.210.172 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1616381980-715793 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Mar 22, 2021 at 11:55:08AM +1100, Daniel Axtens wrote: > Hi Balbir, > > > Could you highlight the changes from > > https://patchwork.ozlabs.org/project/linuxppc-dev/patch/20170729140901.5887-1-bsingharora@gmail.com/? > > > > Feel free to use my signed-off-by if you need to and add/update copyright > > headers if appropriate. > > There's not really anything in common any more: > > - ppc32 KASAN landed, so there was already a kasan.h for powerpc, the > explicit memcpy changes, the support for non-instrumented files, > prom_check.sh, etc. all already landed. > > - I locate the shadow region differently and don't resize any virtual > memory areas. > > - The ARCH_DEFINES_KASAN_ZERO_PTE handling changed upstream and our > handling for that is now handled more by patch 3. > > - The outline hook is now an inline function rather than a #define. > > - The init function has been totally rewritten as it's gone from > supporting real mode to not supporting real mode and back. > > - The list of non-instrumented files has grown a lot. > > - There's new stuff: stack walking is now safe, KASAN vmalloc support > means modules are better supported now, ptdump works, and there's > documentation. > > It's been a while now, but I don't think when I started this process 2 > years ago that I directly reused much of your code. So I'm not sure that > a signed-off-by makes sense here? Would a different tag (Originally-by?) > make more sense? > Sure > >> + * The shadow ends before the highest accessible address > >> + * because we don't need a shadow for the shadow. Instead: > >> + * c00e000000000000 << 3 + a80e 0000 0000 0000 000 = c00fc00000000000 > > > > The comment has one extra 0 in a80e.., I did the math and had to use > > the data from the defines :) > > 3 extra 0s, even! Fixed. > > >> +void __init kasan_init(void) > >> +{ > >> + /* > >> + * We want to do the following things: > >> + * 1) Map real memory into the shadow for all physical memblocks > >> + * This takes us from c000... to c008... > >> + * 2) Leave a hole over the shadow of vmalloc space. KASAN_VMALLOC > >> + * will manage this for us. > >> + * This takes us from c008... to c00a... > >> + * 3) Map the 'early shadow'/zero page over iomap and vmemmap space. > >> + * This takes us up to where we start at c00e... > >> + */ > >> + > > > > assuming we have > > #define VMEMMAP_END R_VMEMMAP_END > > and ditto for hash we probably need > > > > BUILD_BUG_ON(VMEMMAP_END + KASAN_SHADOW_OFFSET != KASAN_SHADOW_END); > > Sorry, I'm not sure what this is supposed to be testing? In what > situation would this trigger? > I am bit concerned that we have hard coded (IIR) 0xa80e... in the config, any changes to VMEMMAP_END, KASAN_SHADOW_OFFSET/END should be guarded. Balbir Singh.