From patchwork Tue Jun 15 01:47:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Axtens X-Patchwork-Id: 12320387 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=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham 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 34894C2B9F4 for ; Tue, 15 Jun 2021 01:47:30 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CDC516140B for ; Tue, 15 Jun 2021 01:47:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CDC516140B 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 6E3396B0072; Mon, 14 Jun 2021 21:47:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 692436B0073; Mon, 14 Jun 2021 21:47:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4E5476B0074; Mon, 14 Jun 2021 21:47:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0033.hostedemail.com [216.40.44.33]) by kanga.kvack.org (Postfix) with ESMTP id 1BE666B0072 for ; Mon, 14 Jun 2021 21:47:29 -0400 (EDT) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id AB24FBBFF for ; Tue, 15 Jun 2021 01:47:28 +0000 (UTC) X-FDA: 78254270976.11.825C744 Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) by imf16.hostedemail.com (Postfix) with ESMTP id E21BB801934C for ; Tue, 15 Jun 2021 01:47:19 +0000 (UTC) Received: by mail-pg1-f177.google.com with SMTP id t17so10146476pga.5 for ; Mon, 14 Jun 2021 18:47:28 -0700 (PDT) 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=l3K1BTqaM5pKy65dpCEo3lZI1RCD2stLd5UR2x4SDMk=; b=X0nswPKSD51xx5SUUNgPTOxx9Nzx2H96D/YduRYRZHo+ejqCQzThCbpTVUia8QeV9R HdIR5kd9RP86hki3k4UkBoiYhfysqZ1n0rn+upB0o0TRnfoK96DT08O5/uKpVd6JcNjt W/u6S+e7PCOUhEJSpkXQzLSmHd4ODdHjB47m8= 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=l3K1BTqaM5pKy65dpCEo3lZI1RCD2stLd5UR2x4SDMk=; b=EeR0NL1axAXRJB5GR6lNoCPLDxN4ve6jc6C3q+Cw5rYCaGiOqolUSCFsgAX+y6eKqf oTQ/Hk9TePkIcQ4bPnQq+ATs/h9ycTIPD3FPH2KYLqhHqgY37MXGEtW8tzHYPQlKHigl GeUm7y3l9K9BCq4l+i1WZAvLCg2PERC1Tvv/sgyivtnNbPBj8exNTaIDhP4oG5ED2PLt PF/PKCGeb9PFzIQ3BHpij3mLtxXykztAvkOOO4CrifTh6WmCpmyfn5OSw463vqydH6G0 Cfki4hjjqm+c156zj+9HrwZlEXafoumimaokfvcygVkDJeuK4I7cHnDQzW0NL7jqu8uk vSVQ== X-Gm-Message-State: AOAM5323W4clcAAzazHzSqRGuRmr8sLoayQUmRZZTsi+sgEtaZSGugVW U5h5fsNWim8b4s8hIUl/RXk67Q== X-Google-Smtp-Source: ABdhPJw7o9IChYHT/R02LwCZbPFFEfQ7b/20+CtiE7nlvaJ6m/AvsWXKO7fqTTME6tiaz6HvSr0q9g== X-Received: by 2002:a63:5d52:: with SMTP id o18mr19853904pgm.440.1623721647575; Mon, 14 Jun 2021 18:47:27 -0700 (PDT) Received: from localhost ([203.206.29.204]) by smtp.gmail.com with ESMTPSA id n6sm14378524pgm.79.2021.06.14.18.47.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Jun 2021 18:47:27 -0700 (PDT) From: Daniel Axtens To: 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, bsingharora@gmail.com Cc: elver@google.com, Daniel Axtens Subject: [PATCH v12 4/6] kasan: Document support on 32-bit powerpc Date: Tue, 15 Jun 2021 11:47:03 +1000 Message-Id: <20210615014705.2234866-5-dja@axtens.net> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210615014705.2234866-1-dja@axtens.net> References: <20210615014705.2234866-1-dja@axtens.net> MIME-Version: 1.0 Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=axtens.net header.s=google header.b=X0nswPKS; dmarc=none; spf=pass (imf16.hostedemail.com: domain of dja@axtens.net designates 209.85.215.177 as permitted sender) smtp.mailfrom=dja@axtens.net X-Stat-Signature: qmeqduk8f7ihgxkwe8zkj43kfhmhb3kx X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: E21BB801934C X-HE-Tag: 1623721639-802356 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. Suggested-by: Christophe Leroy Reviewed-by: Christophe Leroy Signed-off-by: Daniel Axtens --- Documentation/dev-tools/kasan.rst | 8 ++++++-- Documentation/powerpc/kasan.txt | 12 ++++++++++++ 2 files changed, 18 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 83ec4a556c19..05d2d428a332 100644 --- a/Documentation/dev-tools/kasan.rst +++ b/Documentation/dev-tools/kasan.rst @@ -36,7 +36,8 @@ Both software KASAN modes work with SLUB and SLAB memory allocators, while the hardware tag-based KASAN currently only supports SLUB. Currently, generic KASAN is supported for the x86_64, arm, arm64, xtensa, s390, -and riscv architectures, and tag-based KASAN modes are supported only for arm64. +and riscv architectures. It is also supported on 32-bit powerpc kernels. +Tag-based KASAN modes are supported only for arm64. Usage ----- @@ -343,7 +344,10 @@ CONFIG_KASAN_VMALLOC With ``CONFIG_KASAN_VMALLOC``, KASAN can cover vmalloc space at the cost of greater memory usage. Currently, this is supported on x86, -riscv, s390, and powerpc. +riscv, 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.