From patchwork Thu Feb 13 00:47:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Axtens X-Patchwork-Id: 11379501 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 D90751395 for ; Thu, 13 Feb 2020 00:48:10 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9D2A720873 for ; Thu, 13 Feb 2020 00:48:10 +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="f3+zjZPL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9D2A720873 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 C46296B04EB; Wed, 12 Feb 2020 19:48:09 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id BF5C26B04ED; Wed, 12 Feb 2020 19:48:09 -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 B31BC6B04EE; Wed, 12 Feb 2020 19:48:09 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0218.hostedemail.com [216.40.44.218]) by kanga.kvack.org (Postfix) with ESMTP id 9A3126B04EB for ; Wed, 12 Feb 2020 19:48:09 -0500 (EST) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 3B7961EF0 for ; Thu, 13 Feb 2020 00:48:09 +0000 (UTC) X-FDA: 76483267098.15.home02_8152efeb36e5f X-Spam-Summary: 2,0,0,d3a1bb908be55a63,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:800:960:973:988:989:1260:1311:1314:1345:1359:1437:1515:1535:1542:1711:1730:1747:1777:1792:1981:2194:2199:2393:2559:2562:2740:3138:3139:3140:3141:3142:3354:3865:3866:3867:3868:3870:3871:3872:4250:4321:5007:6119:6261:6653:7875:7903:10004:11026:11232:11473:11658:11914:12043:12048:12296:12297:12438:12517:12519:12555:12895:12986:13141:13200:13229:13230:13894:14096:14181:14394:14721:21080:21444:21451:21627:21740:30054,0,RBL:209.85.214.195:@axtens.net:.lbl8.mailshell.net-62.2.0.100 66.100.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:23,LUA_SUMMARY:none X-HE-Tag: home02_8152efeb36e5f X-Filterd-Recvd-Size: 5301 Received: from mail-pl1-f195.google.com (mail-pl1-f195.google.com [209.85.214.195]) by imf26.hostedemail.com (Postfix) with ESMTP for ; Thu, 13 Feb 2020 00:48:08 +0000 (UTC) Received: by mail-pl1-f195.google.com with SMTP id d9so1601470plo.11 for ; Wed, 12 Feb 2020 16:48:08 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=CaOpE+RnykMge29WfCqnRai8zpZuPSzzYfJQc7CCb6s=; b=f3+zjZPLroh9v/srLMResHUURGulEqa1TIn2eNJbsZT02ZxhHsRPkA9k0qw76MvdTd CsvJWPkuISec5SALYDCzKnkeMg0By2NuPdP9hKr5vwQQphWe7SO0/Sq0X91W6zF9B9z6 ZeG+15K1Hk5r2SlBuRh5E7wT/B8cJA9YraLL8= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=CaOpE+RnykMge29WfCqnRai8zpZuPSzzYfJQc7CCb6s=; b=T+ICgexoDSBxUzENmu/rAqD2RyC5gCvu9npjCcNQBkScff3fwrxYt+IXwxd6TomsF9 cUQGAY5fb3DSoyOq+nso6hyHZ1UkmJlltPmkPzwyQDLrkln3Y7LDd89+/At1wpgzjKQI gnmYcnI12N/SLH/ocmtj5SPX2ukBH0tzIhlze6+ekztpWESja8QLZamDRrpt57cwMcYh g0Esgist6V3J8vkkoWN/p/C3h3so0fmJ7v1CuOBdS/VohwoO4Ojl7+HDgZIKHyPSq0Hr A1OggMavnPlTbH6PKtXzHDkA953iHWHjfpKTlpJFZrGe75l/CRCO1fMK+M4yni198eUl 4Q2w== X-Gm-Message-State: APjAAAWba0g0sHMYhtaYaULeSn/BZjy/ewGOH2kLDGWNGpx6Wcs3uGMg 5AJh8FZoLRurSipFapgcJzouWA== X-Google-Smtp-Source: APXvYqyeOHjQf5Bxk67rYMg6dqoxPmAvSH1SohWbFDUDX4cuyAdfkJPx7JAuve/KqUZz4YX4tZ+rcQ== X-Received: by 2002:a17:902:7c88:: with SMTP id y8mr11104973pll.321.1581554887611; Wed, 12 Feb 2020 16:48:07 -0800 (PST) Received: from localhost (2001-44b8-1113-6700-f1ea-0ab5-027b-8841.static.ipv6.internode.on.net. [2001:44b8:1113:6700:f1ea:ab5:27b:8841]) by smtp.gmail.com with ESMTPSA id q7sm297478pgk.62.2020.02.12.16.48.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Feb 2020 16:48:06 -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 v7 2/4] kasan: Document support on 32-bit powerpc Date: Thu, 13 Feb 2020 11:47:50 +1100 Message-Id: <20200213004752.11019-3-dja@axtens.net> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200213004752.11019-1-dja@axtens.net> References: <20200213004752.11019-1-dja@axtens.net> 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: KASAN is supported on 32-bit powerpc and the docs should reflect this. Document s390 support while we're at it. Suggested-by: Christophe Leroy Reviewed-by: Christophe Leroy Signed-off-by: Daniel Axtens --- Changes since v5: - rebase - riscv has now got support. - document s390 support while we're at it - clarify when kasan_vmalloc support is required --- Documentation/dev-tools/kasan.rst | 7 +++++-- Documentation/powerpc/kasan.txt | 12 ++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 Documentation/powerpc/kasan.txt diff --git a/Documentation/dev-tools/kasan.rst b/Documentation/dev-tools/kasan.rst index c652d740735d..012ef3d91d1f 100644 --- a/Documentation/dev-tools/kasan.rst +++ b/Documentation/dev-tools/kasan.rst @@ -22,7 +22,8 @@ global variables yet. Tag-based KASAN is only supported in Clang and requires version 7.0.0 or later. Currently generic KASAN is supported for the x86_64, arm64, xtensa, s390 and -riscv architectures, and tag-based KASAN is supported only for arm64. +riscv architectures. It is also supported on 32-bit powerpc kernels. Tag-based +KASAN is supported only on arm64. Usage ----- @@ -255,7 +256,9 @@ CONFIG_KASAN_VMALLOC ~~~~~~~~~~~~~~~~~~~~ With ``CONFIG_KASAN_VMALLOC``, KASAN can cover vmalloc space at the -cost of greater memory usage. Currently this is only supported on x86. +cost of greater memory usage. Currently this supported on x86, s390 +and 32-bit powerpc. It is optional, except on 32-bit powerpc kernels +with module support, where it is required. This works by hooking into vmalloc and vmap, and dynamically allocating real shadow memory to back the mappings. diff --git a/Documentation/powerpc/kasan.txt b/Documentation/powerpc/kasan.txt new file mode 100644 index 000000000000..26bb0e8bb18c --- /dev/null +++ b/Documentation/powerpc/kasan.txt @@ -0,0 +1,12 @@ +KASAN is supported on powerpc on 32-bit only. + +32 bit support +============== + +KASAN is supported on both hash and nohash MMUs on 32-bit. + +The shadow area sits at the top of the kernel virtual memory space above the +fixmap area and occupies one eighth of the total kernel virtual memory space. + +Instrumentation of the vmalloc area is optional, unless built with modules, +in which case it is required.