From patchwork Wed Feb 12 05:47:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Axtens X-Patchwork-Id: 11377595 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E48AC13A4 for ; Wed, 12 Feb 2020 05:47:32 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B167A21734 for ; Wed, 12 Feb 2020 05:47:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=axtens.net header.i=@axtens.net header.b="c4McV3RO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B167A21734 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=axtens.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D04196B03D6; Wed, 12 Feb 2020 00:47:31 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id CB60F6B03D7; Wed, 12 Feb 2020 00:47:31 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BA3E46B03D8; Wed, 12 Feb 2020 00:47:31 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0238.hostedemail.com [216.40.44.238]) by kanga.kvack.org (Postfix) with ESMTP id A000E6B03D6 for ; Wed, 12 Feb 2020 00:47:31 -0500 (EST) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 362AA181AEF09 for ; Wed, 12 Feb 2020 05:47:31 +0000 (UTC) X-FDA: 76480392702.23.son20_419cfb887f254 X-Spam-Summary: 2,0,0,49bed8da195a8d5d,d41d8cd98f00b204,dja@axtens.net,:linux-kernel@vger.kernel.org::linuxppc-dev@lists.ozlabs.org:kasan-dev@googlegroups.com:christophe.leroy@c-s.fr:aneesh.kumar@linux.ibm.com:bsingharora@gmail.com:dja@axtens.net,RULES_HIT:41:355:379:541:973:988:989:1260:1311:1314:1345:1437:1515:1534:1541:1711:1730:1747:1777:1792:2393:2559:2562:2693:3138:3139:3140:3141:3142:3353:3865:3866:3867:3868:3870:3871:3872:3873:3874:4250:4605:5007:6119:6248:6261:6653:6755:7903:9040:10004:11026:11473:11658:11914:12048:12219:12296:12297:12517:12519:13069:13311:13357:13869:13894:14096:14384:14394:14721:14777:21080:21433:21444:21451:21627:21740:21819:30005:30012:30054:30070:30074,0,RBL:209.85.215.196:@axtens.net:.lbl8.mailshell.net-62.14.0.100 66.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:26,LUA_SUMMARY:none X-HE-Tag: son20_419cfb887f254 X-Filterd-Recvd-Size: 4441 Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) by imf14.hostedemail.com (Postfix) with ESMTP for ; Wed, 12 Feb 2020 05:47:30 +0000 (UTC) Received: by mail-pg1-f196.google.com with SMTP id 6so625607pgk.0 for ; Tue, 11 Feb 2020 21:47:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axtens.net; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=6HBUqCa4lDkvWVMth98gkOfMDQFMmsNejhaPRJd9h6k=; b=c4McV3ROy7K7TcNJZ6glqfJoozIqu3Imhuvwv+E6LR3U+3mruX/liResbEQ0Rlql4u VWt/THID8qk44T1vtXxAeK9ZFTX//XLXm6d7Cp9EITy49LHRunvA8LWxXvjSCzqFbF4d FtmE8q1jB13au00SutLTdNFEIpG6jEAQqbEF0= 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:date:message-id:mime-version :content-transfer-encoding; bh=6HBUqCa4lDkvWVMth98gkOfMDQFMmsNejhaPRJd9h6k=; b=ryXOHB2Ou9/yo1MqAECzeT0GF/AxCmn93tvOAxVAgIp6UWgcrUYHl88ioE2Lttho+r R7Q2Wpjb61iwnbkrbrNb+r5p+b6i6MP5ttxJFGuIfAxSPxQ9VyZ8UEsf8AdsgYnwGnMJ BjK8/zsXIGJgh+pXrVXSBg6s8uP6lH6h9m6Dyd4VMSSWVka08AAgXIeCLHqDl8KoggCp c9+KIP3P2t8IDvz5sCMG85z9GENBJVoxv3NXU1Lq4o5XacULhoonvzaCZsxU+amhTUd1 p4dfkX5UrH/Ka7Zij0D5N5eyFXpzQbEKaroqcxh/ueKkn8gW1VQktP4xfsDHlgZgpEcb DRqg== X-Gm-Message-State: APjAAAV8h1bWRJxnvDWgmmbAIS73K/NTm7d7E0I2CPChQLuOAtr2vLt5 hFQJ01syaAJ5QFi4Z9lyBLsJNQ== X-Google-Smtp-Source: APXvYqw/DN/0FTA1ZksYApAufAix2IStZs/anNdGfJUJ6f2vgfIGbcrigIYK8wZ/9ZVCpNCvP/aFbg== X-Received: by 2002:a63:5826:: with SMTP id m38mr10924864pgb.191.1581486449779; Tue, 11 Feb 2020 21:47: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 l69sm5969652pgd.1.2020.02.11.21.47.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2020 21:47:28 -0800 (PST) From: Daniel Axtens To: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, kasan-dev@googlegroups.com, christophe.leroy@c-s.fr, aneesh.kumar@linux.ibm.com, bsingharora@gmail.com Cc: Daniel Axtens Subject: [PATCH v6 0/4] KASAN for powerpc64 radix Date: Wed, 12 Feb 2020 16:47:20 +1100 Message-Id: <20200212054724.7708-1-dja@axtens.net> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 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: Building on the work of Christophe, Aneesh and Balbir, I've ported KASAN to 64-bit Book3S kernels running on the Radix MMU. This provides full inline instrumentation on radix, but does require that you be able to specify the amount of physically contiguous memory on the system at compile time. More details in patch 4. v6: Rebase on the latest changes in powerpc/merge. Minor tweaks to the documentation. Small tweaks to the header to work with the kasan_late_init() function that Christophe added for 32-bit kasan-vmalloc support. No functional change. v5: ptdump support. More cleanups, tweaks and fixes, thanks Christophe. Details in patch 4. I have seen another stack walk splat, but I don't think it's related to the patch set, I think there's a bug somewhere else, probably in stack frame manipulation in the kernel or (more unlikely) in the compiler. v4: More cleanups, split renaming out, clarify bits and bobs. Drop the stack walk disablement, that isn't needed. No other functional change. v3: Reduce the overly ambitious scope of the MAX_PTRS change. Document more things, including around why some of the restrictions apply. Clean up the code more, thanks Christophe. v2: The big change is the introduction of tree-wide(ish) MAX_PTRS_PER_{PTE,PMD,PUD} macros in preference to the previous approach, which was for the arch to override the page table array definitions with their own. (And I squashed the annoying intermittent crash!) Apart from that there's just a lot of cleanup. Christophe, I've addressed most of what you asked for and I will reply to your v1 emails to clarify what remains unchanged.