From patchwork Wed Feb 3 11:59:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Axtens X-Patchwork-Id: 12064189 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,URIBL_BLOCKED,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 610A7C433DB for ; Wed, 3 Feb 2021 12:00:13 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DDFBA64F6A for ; Wed, 3 Feb 2021 12:00:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DDFBA64F6A 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 683226B0075; Wed, 3 Feb 2021 07:00:12 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5C0BB6B0078; Wed, 3 Feb 2021 07:00:12 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4AE106B007B; Wed, 3 Feb 2021 07:00:12 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0060.hostedemail.com [216.40.44.60]) by kanga.kvack.org (Postfix) with ESMTP id 3404A6B0075 for ; Wed, 3 Feb 2021 07:00:12 -0500 (EST) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id EAC50180AD820 for ; Wed, 3 Feb 2021 12:00:11 +0000 (UTC) X-FDA: 77776813422.14.CE2A595 Received: from mail-pg1-f170.google.com (mail-pg1-f170.google.com [209.85.215.170]) by imf07.hostedemail.com (Postfix) with ESMTP id 755C2A0000FC for ; Wed, 3 Feb 2021 12:00:10 +0000 (UTC) Received: by mail-pg1-f170.google.com with SMTP id z21so17218017pgj.4 for ; Wed, 03 Feb 2021 04:00:11 -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=qiaBVEZpA8Xo3CJyOAtaUaP2kzBvWdhYRuLo/mSWVKU=; b=HGv0pMdLzfcs9yqvkpK455qLVU8no2RvlmsDHwHuIvCfo5lqmg0y+tjFQR1wreuHHz BH+ZoqGxgZ3jJ82CX0cgyLetkWii90iNoED1V5dLaXxaQgTOLKqdeQjUNUC0q8T5DlWx lP6Do60cMbZ+X7p/O4Zbeh5ABfjzvqaNzH8z4= 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=qiaBVEZpA8Xo3CJyOAtaUaP2kzBvWdhYRuLo/mSWVKU=; b=PxAGRyblSpeXikKmfZcT7rOl2Za+cH0SYfIcTo5q/gAWPGTfHSDDZ5qh/cGqDLo+Mp BjEuPnKfKaz5cpjQ9HCXohD7mqvYh2gYEdGdGNIPksGusp9nCo3bBpH89ceEMkeTmzjQ SoocGP+lO1ZRsYnyXKNBlQaCKO6n5QTRaFQgBKD+NfeY5MV24F8ju3YZ8YaJCBc0aIdH 18WLz8jo+YYNgR/B83HnzS1jlrfUAsSBfK86P1BJRYEL2WhYCvRlLgS/29unVXA2ru0j 97MVjQSweBR9YROs3ug/GYZGZSoU+G7GhnI7qzRDgsHBQwjS1c+WzS40jPLQlpZHo5Nn YUgg== X-Gm-Message-State: AOAM533hLPGYrBRyuTi/W3nNvscFPq1WeKb1CkSYVxd8juXQR7jwE58Q UFk85vlMTrlkCzB1XEmbxI8zlQ== X-Google-Smtp-Source: ABdhPJxFJ1tYSDB+nz4ocsXdc7DktJwVnAnbesODItHndkApfUngNGp46fA2hgEkXUBdkDxJapmh6w== X-Received: by 2002:a65:408c:: with SMTP id t12mr3287866pgp.157.1612353610461; Wed, 03 Feb 2021 04:00:10 -0800 (PST) Received: from localhost (2001-44b8-1113-6700-1c59-4eca-f876-fd51.static.ipv6.internode.on.net. [2001:44b8:1113:6700:1c59:4eca:f876:fd51]) by smtp.gmail.com with ESMTPSA id a19sm2226291pfg.75.2021.02.03.04.00.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 04:00:10 -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@csgroup.eu, aneesh.kumar@linux.ibm.com, bsingharora@gmail.com Cc: Daniel Axtens Subject: [PATCH v10 4/6] kasan: Document support on 32-bit powerpc Date: Wed, 3 Feb 2021 22:59:44 +1100 Message-Id: <20210203115946.663273-5-dja@axtens.net> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210203115946.663273-1-dja@axtens.net> References: <20210203115946.663273-1-dja@axtens.net> MIME-Version: 1.0 X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 755C2A0000FC X-Stat-Signature: g3p7zu4i48xyk4atjsjjwdn7yqubosnc Received-SPF: none (axtens.net>: No applicable sender policy available) receiver=imf07; identity=mailfrom; envelope-from=""; helo=mail-pg1-f170.google.com; client-ip=209.85.215.170 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1612353610-303433 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 --- 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 e022b7506e37..9cfc116cc6bf 100644 --- a/Documentation/dev-tools/kasan.rst +++ b/Documentation/dev-tools/kasan.rst @@ -22,7 +22,8 @@ out-of-bounds accesses for global variables is only supported since Clang 11. Tag-based KASAN is only supported in Clang. 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 ----- @@ -332,7 +333,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.