Message ID | 20230619101224.22978-1-chanho.min@lge.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2893632vqr; Mon, 19 Jun 2023 03:22:17 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6Qz7kNuyS8TiOCKLkBFiwJUjMlVlyz+Xt1/UYiAE8GExN311VgC2aHAh7ntOW3Wh/+hrFq X-Received: by 2002:a17:90a:fb52:b0:25b:b4c6:d13e with SMTP id iq18-20020a17090afb5200b0025bb4c6d13emr4900574pjb.8.1687170137640; Mon, 19 Jun 2023 03:22:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687170137; cv=none; d=google.com; s=arc-20160816; b=lwgaQfoCp30CXGxQcmTzDhilpOuhZ/+Zwaxn3/YSNyXskq1/C/2PO2B+MbIf0aX5+w NkRF+tiDTeAOKaGw68q7LjU8aPJUnm/P7kz7aemAWhMNCgtfX8YhJ7jwa/dz/hJYufC+ IkzdVJpawjTHWl/ClAsZPJ7zX4NzEahaG5lOfBLlHL+1cJLqC+jBwOKfGXaMF0KFQMYy NEpk/ZMBcPfgpcSkpJ/Ci6Succ8gYnO6sJloYz73JXXNW6W04r45majnA5JR7tsmfD6N BRj89vTWNZ5soIlH7+xDnK0pMyW8ZZ522cYDwyypzvJhRbJbdzx08aTxIhypYmZ47R4Q skMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=dDL3HfnfFnFVUg7hlBOR/VHB5GPixD1jEBHXrBBxcNA=; b=poC09QxhS+rj6yin4U9ZtMkIMSvZgR0rrLwShrIs+nvjgprlNv2RdaFlwglfQ86dTQ kGEPjGOO/d0DtMrpJPyXC1tkCfFJLnoEEtobl3/bNphvS7EzAG8w8wsGv098LAjYD2K3 v1tIs81VpK9iMM+z1JygkIy1P1MXsPww5dDOKQQqyX54ffIF3MLdBewLSQAeb17BRLrr SEWx7VQqvlP05AZeAM5sK/f8tmp6QvdL5adOmBGYkwy3G0HS+6vbeqTi8d9Z+zl5lPTA euPbNNaJOdn32rqm1aO8nuRC00YWLHOUgLlzQMdj+0xIezT5auW4h5nELByWbc+KkfUK ipCA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k21-20020a637b55000000b0054f993d039bsi8747318pgn.490.2023.06.19.03.22.02; Mon, 19 Jun 2023 03:22:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231492AbjFSKMl (ORCPT <rfc822;duw91626@gmail.com> + 99 others); Mon, 19 Jun 2023 06:12:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229818AbjFSKMf (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 19 Jun 2023 06:12:35 -0400 Received: from lgeamrelo11.lge.com (lgeamrelo12.lge.com [156.147.23.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 37FE412F for <linux-kernel@vger.kernel.org>; Mon, 19 Jun 2023 03:12:31 -0700 (PDT) Received: from unknown (HELO lgeamrelo01.lge.com) (156.147.1.125) by 156.147.23.52 with ESMTP; 19 Jun 2023 19:12:29 +0900 X-Original-SENDERIP: 156.147.1.125 X-Original-MAILFROM: chanho.min@lge.com Received: from unknown (HELO localhost.localdomain) (10.178.31.96) by 156.147.1.125 with ESMTP; 19 Jun 2023 19:12:29 +0900 X-Original-SENDERIP: 10.178.31.96 X-Original-MAILFROM: chanho.min@lge.com From: Chanho Min <chanho.min@lge.com> To: Andrey Ryabinin <ryabinin.a.a@gmail.com>, Alexander Potapenko <glider@google.com>, Andrey Konovalov <andreyknvl@gmail.com>, Dmitry Vyukov <dvyukov@google.com>, Vincenzo Frascino <vincenzo.frascino@arm.com> Cc: elver@google.com, kasan-dev@googlegroups.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, gunho.lee@lge.com, Chanho Min <chanho.min@lge.com> Subject: [PATCH] kasan: fix mention for KASAN_HW_TAGS Date: Mon, 19 Jun 2023 19:12:24 +0900 Message-Id: <20230619101224.22978-1-chanho.min@lge.com> X-Mailer: git-send-email 2.17.1 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769126114589219327?= X-GMAIL-MSGID: =?utf-8?q?1769126114589219327?= |
Series |
kasan: fix mention for KASAN_HW_TAGS
|
|
Commit Message
Chanho Min
June 19, 2023, 10:12 a.m. UTC
This patch removes description of the KASAN_HW_TAGS's memory consumption.
KASAN_HW_TAGS does not set 1/32nd shadow memory.
Signed-off-by: Chanho Min <chanho.min@lge.com>
---
lib/Kconfig.kasan | 2 --
1 file changed, 2 deletions(-)
Comments
On Mon, 19 Jun 2023 at 12:12, Chanho Min <chanho.min@lge.com> wrote: > > This patch removes description of the KASAN_HW_TAGS's memory consumption. > KASAN_HW_TAGS does not set 1/32nd shadow memory. The hardware still allocates/uses shadow in MTE. Though, it may be 1/16-th, not sure. > Signed-off-by: Chanho Min <chanho.min@lge.com> > --- > lib/Kconfig.kasan | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/lib/Kconfig.kasan b/lib/Kconfig.kasan > index fdca89c05745..5be1740234b9 100644 > --- a/lib/Kconfig.kasan > +++ b/lib/Kconfig.kasan > @@ -124,8 +124,6 @@ config KASAN_HW_TAGS > Supported only on arm64 CPUs starting from ARMv8.5 and relies on > Memory Tagging Extension and Top Byte Ignore. > > - Consumes about 1/32nd of available memory. > - > May potentially introduce problems related to pointer casting and > comparison, as it embeds a tag into the top byte of each pointer. > > -- > 2.17.1 >
On Mon, 19 Jun 2023 at 12:15, Dmitry Vyukov <dvyukov@google.com> wrote: > On Mon, 19 Jun 2023 at 12:12, Chanho Min <chanho.min@lge.com> wrote: > > > > This patch removes description of the KASAN_HW_TAGS's memory consumption. > > KASAN_HW_TAGS does not set 1/32nd shadow memory. > > The hardware still allocates/uses shadow in MTE. > Though, it may be 1/16-th, not sure. I think the point is that it depends on the hardware implementation of MTE. There are a range of possibilities, but enabling KASAN_HW_TAGS doesn't consume any extra memory for tags itself if the hardware has to enable MTE and provision tag space via firmware to begin with. > > Signed-off-by: Chanho Min <chanho.min@lge.com> I think you just have to be a bit clearer in the commit description, just briefly mentioning how/where the tag space is allocated in hardware that do support MTE. Then removing this line is probably fair, if KASAN_HW_TAGS isn't the direct reason for tag memory being allocated.
On Mon, Jun 19, 2023 at 1:36 PM Marco Elver <elver@google.com> wrote: > > On Mon, 19 Jun 2023 at 12:15, Dmitry Vyukov <dvyukov@google.com> wrote: > > On Mon, 19 Jun 2023 at 12:12, Chanho Min <chanho.min@lge.com> wrote: > > > > > > This patch removes description of the KASAN_HW_TAGS's memory consumption. > > > KASAN_HW_TAGS does not set 1/32nd shadow memory. > > > > The hardware still allocates/uses shadow in MTE. > > Though, it may be 1/16-th, not sure. 1/32 is correct: 4 bits for every 16 bytes. > I think the point is that it depends on the hardware implementation of > MTE. There are a range of possibilities, but enabling KASAN_HW_TAGS > doesn't consume any extra memory for tags itself if the hardware has > to enable MTE and provision tag space via firmware to begin with. Yeah, saying that HW_TAGS consumes memory is wrong. But it might reasonable to spell out what happens with memory in the config options description. Something like: "Does not consume memory by itself but relies on the 1/32nd of available memory being reserved by the firmware when MTE is enabled."
diff --git a/lib/Kconfig.kasan b/lib/Kconfig.kasan index fdca89c05745..5be1740234b9 100644 --- a/lib/Kconfig.kasan +++ b/lib/Kconfig.kasan @@ -124,8 +124,6 @@ config KASAN_HW_TAGS Supported only on arm64 CPUs starting from ARMv8.5 and relies on Memory Tagging Extension and Top Byte Ignore. - Consumes about 1/32nd of available memory. - May potentially introduce problems related to pointer casting and comparison, as it embeds a tag into the top byte of each pointer.