From mboxrd@z Thu Jan 1 00:00:00 1970 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=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 13DD0C433C1 for ; Sat, 20 Mar 2021 01:46:17 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8EC0C61975 for ; Sat, 20 Mar 2021 01:46:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8EC0C61975 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id DDAD26B006E; Fri, 19 Mar 2021 21:46:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D895C6B0080; Fri, 19 Mar 2021 21:46:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BDC466B0081; Fri, 19 Mar 2021 21:46:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0206.hostedemail.com [216.40.44.206]) by kanga.kvack.org (Postfix) with ESMTP id 9F7066B006E for ; Fri, 19 Mar 2021 21:46:15 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 574232C88 for ; Sat, 20 Mar 2021 01:46:15 +0000 (UTC) X-FDA: 77938562310.24.8E6AB18 Received: from mail-pg1-f180.google.com (mail-pg1-f180.google.com [209.85.215.180]) by imf19.hostedemail.com (Postfix) with ESMTP id EF78A90009EC for ; Sat, 20 Mar 2021 01:46:14 +0000 (UTC) Received: by mail-pg1-f180.google.com with SMTP id n11so4850672pgm.12 for ; Fri, 19 Mar 2021 18:46:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=uQvJ/OVGn44ohP4ik8L4ZCZvo4WeHXCrQuFyrKsQHDw=; b=Xdpq21dUz7V9qN45GVpK0ttINSmgVso50PVIYAq2wxwT4Sa5OMn3CQXxR7sPGQmM4o Wx8vUCJ0dMTNHvC4WhJ6CEK7TADg7yZTvmT1fr1Ov8Px0b9S8z05ow8oScmFaVr7Z1xl /zYUUxGzie9IMiqFHkPcYHWd75ou415dNwkA3WR5f7/qewRsTExSnHtX0+P36IQdpBQR Ap3PgnVNAOGRqe79Khp7Er1fZzdfoz+0vxQJSuoYSn+/haqNNSycTYhA3lISx/RCN/wX hplEdwF2KCQNy2Nvm1yqQfcX0FNBrA7frf8FcyRZzQPq1knvkwGVb55MUsAld/RPgCTe b0yA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=uQvJ/OVGn44ohP4ik8L4ZCZvo4WeHXCrQuFyrKsQHDw=; b=LktTP7eFZQaTyhhAiNcv6HRCKcffC+aMTahFGbTfuIWcXDMV0s95xPevzbjalJnJXT UDC4wAMKoz/niRp9qTlEsXbOQcArcaFpl7aWqkOSNJv0BZ5J+s1eanaQbGr1kIXPNBqA LJJKrOA+mYw6hkXxJCA/pv5rlRwZcMHGBPYQfUKxAJdb/DkF0D2oWaVzsNgEIzZZST6l 1t+uycyfTTfUxKv0gVbPt0XjJaEw1bOdPlRiWQRC6oj111hmuZPC/OuOE9RCMLGH30bm Rzba70M6lstX9TlWaI3R2M/p/nwhe5FGxQ19Yd7xXrLoe//q7O2OdLYrolesXqBDC25A xxiw== X-Gm-Message-State: AOAM530uFXBc0Lvk30Jcq1CRQ657sdGFpfzwkSEo0+ngOJ7dggtl56AH GcZv2xvRs+BApzUdzffDq+g= X-Google-Smtp-Source: ABdhPJy85vWAJ0ffrRU9D1z+8S6L5Y3HLtFgLcOlzwnwwwwu0cw1eYJ/p42aWZAD/9tXd2KW53CR6A== X-Received: by 2002:a65:6a44:: with SMTP id o4mr13646992pgu.312.1616204774010; Fri, 19 Mar 2021 18:46:14 -0700 (PDT) Received: from localhost ([103.250.185.142]) by smtp.gmail.com with ESMTPSA id p11sm6305703pjo.48.2021.03.19.18.46.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 18:46:13 -0700 (PDT) Date: Sat, 20 Mar 2021 12:46:06 +1100 From: Balbir Singh To: Daniel Axtens Cc: 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 Subject: Re: [PATCH v11 1/6] kasan: allow an architecture to disable inline instrumentation Message-ID: <20210320014606.GB77072@balbir-desktop> References: <20210319144058.772525-1-dja@axtens.net> <20210319144058.772525-2-dja@axtens.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210319144058.772525-2-dja@axtens.net> X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: EF78A90009EC X-Stat-Signature: k6htuimmx3ny1ccugjoex4mhds8rdw7x Received-SPF: none (gmail.com>: No applicable sender policy available) receiver=imf19; identity=mailfrom; envelope-from=""; helo=mail-pg1-f180.google.com; client-ip=209.85.215.180 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1616204774-907762 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: On Sat, Mar 20, 2021 at 01:40:53AM +1100, Daniel Axtens wrote: > For annoying architectural reasons, it's very difficult to support inline > instrumentation on powerpc64. I think we can expand here and talk about how in hash mode, the vmalloc address space is in a region of memory different than where kernel virtual addresses are mapped. Did I recollect the reason correctly? > > Add a Kconfig flag to allow an arch to disable inline. (It's a bit > annoying to be 'backwards', but I'm not aware of any way to have > an arch force a symbol to be 'n', rather than 'y'.) > > We also disable stack instrumentation in this case as it does things that > are functionally equivalent to inline instrumentation, namely adding > code that touches the shadow directly without going through a C helper. > > Signed-off-by: Daniel Axtens > --- > lib/Kconfig.kasan | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/lib/Kconfig.kasan b/lib/Kconfig.kasan > index cffc2ebbf185..7e237dbb6df3 100644 > --- a/lib/Kconfig.kasan > +++ b/lib/Kconfig.kasan > @@ -12,6 +12,9 @@ config HAVE_ARCH_KASAN_HW_TAGS > config HAVE_ARCH_KASAN_VMALLOC > bool > > +config ARCH_DISABLE_KASAN_INLINE > + def_bool n > + Some comments on what arch's want to disable kasan inline would be helpful and why. Balbir Singh.