From patchwork Fri Mar 19 14:40:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Axtens X-Patchwork-Id: 12151205 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 29B13C433DB for ; Fri, 19 Mar 2021 14:41:37 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CAB7F64E41 for ; Fri, 19 Mar 2021 14:41:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CAB7F64E41 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 664316B007E; Fri, 19 Mar 2021 10:41:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6159B6B0080; Fri, 19 Mar 2021 10:41:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 48CFF6B0081; Fri, 19 Mar 2021 10:41:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0020.hostedemail.com [216.40.44.20]) by kanga.kvack.org (Postfix) with ESMTP id 280BF6B007E for ; Fri, 19 Mar 2021 10:41:36 -0400 (EDT) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id E2C101730840 for ; Fri, 19 Mar 2021 14:41:35 +0000 (UTC) X-FDA: 77936887350.21.3A5A3EF Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) by imf27.hostedemail.com (Postfix) with ESMTP id 3DBE38019AD8 for ; Fri, 19 Mar 2021 14:41:26 +0000 (UTC) Received: by mail-pj1-f54.google.com with SMTP id nh23-20020a17090b3657b02900c0d5e235a8so4989896pjb.0 for ; Fri, 19 Mar 2021 07:41:26 -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=dCC3AVfnj1w2eD4KT8qv23tgUysFvODW8V6tvYzpnj0=; b=Kcj5V4JO6UXzdOoeJYTdGv3hGZ0yiAZ4YA1dMGC+BWrEwefW0Qhg42b9QG27UfIZz+ uf8r2JJzyEWmiIGbkR+DyB3Cyv7gPflBIA9aFiPnFfODIyrgnN84967czC0raJWhAown P0aP8rySNsA8usPv4NxILaGKNQmu0E7Ap02sM= 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=dCC3AVfnj1w2eD4KT8qv23tgUysFvODW8V6tvYzpnj0=; b=GQFFs+c5pLXma/sMmBVnDtdMQu8WiRAzT0fxarIpXPt4av2VWs7/JHiaYgGuadekKM 6XaIglhMbwrRp+AOOukHokMsM7ohz07x9q74bXaylTH2I9spWHFxlT8dlzc+tjyEm1hG K9HQG7NuW7AW+ipcOhWBmLVAneg3yP74vQQB6vS+q7qKutUuoHYNg4YY2ZygPxS1iDky Ab+y0O3Ry1lxe/odEliaOZkU4f4U7v5O9LQ35Lx6K5j1B+1TNUDElqcSxxW24O1eqFsd iXxtxAir9y5jVa+Dk3ys3tXBUOe/fKCYEk3a1dg+bj/mnAsA6wYgIu650DTG1XNrfh+c uotw== X-Gm-Message-State: AOAM532Xy/SejJViRSm5pKRUexYnjuEfRMoqx2c6hK+c/xpvPZ7lch3S v2/jk+ppB172DeffYudfDcC0jg== X-Google-Smtp-Source: ABdhPJy9qheq4CMOyD57S1I8GxJvr41ZOEKYLEQSvW8ZHFsQj8D1wGZJuqJfJaHplnp4QE646Q++8A== X-Received: by 2002:a17:902:ac93:b029:e6:548b:d61 with SMTP id h19-20020a170902ac93b02900e6548b0d61mr14570825plr.80.1616164880480; Fri, 19 Mar 2021 07:41:20 -0700 (PDT) Received: from localhost (2001-44b8-111e-5c00-674e-5c6f-efc9-136d.static.ipv6.internode.on.net. [2001:44b8:111e:5c00:674e:5c6f:efc9:136d]) by smtp.gmail.com with ESMTPSA id o197sm5984619pfd.42.2021.03.19.07.41.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 07:41:20 -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: Daniel Axtens Subject: [PATCH v11 4/6] kasan: Document support on 32-bit powerpc Date: Sat, 20 Mar 2021 01:40:56 +1100 Message-Id: <20210319144058.772525-5-dja@axtens.net> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210319144058.772525-1-dja@axtens.net> References: <20210319144058.772525-1-dja@axtens.net> MIME-Version: 1.0 X-Stat-Signature: ax95quh7a6knexfjoft6kf3e98qmh53x X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 3DBE38019AD8 Received-SPF: none (axtens.net>: No applicable sender policy available) receiver=imf27; identity=mailfrom; envelope-from=""; helo=mail-pj1-f54.google.com; client-ip=209.85.216.54 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1616164886-213693 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 a8c3e0cff88d..2cfd5d9068c0 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 ----- @@ -334,7 +335,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.