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=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 A3FDFC4743C for ; Wed, 23 Jun 2021 09:25:19 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3A23B61002 for ; Wed, 23 Jun 2021 09:25:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3A23B61002 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 39B888D0001; Wed, 23 Jun 2021 05:25:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 34B336B006C; Wed, 23 Jun 2021 05:25:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 19D8C8D0001; Wed, 23 Jun 2021 05:25:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0026.hostedemail.com [216.40.44.26]) by kanga.kvack.org (Postfix) with ESMTP id D5EBC6B0036 for ; Wed, 23 Jun 2021 05:25:17 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 0E5FE243B4 for ; Wed, 23 Jun 2021 09:25:18 +0000 (UTC) X-FDA: 78284455116.22.EF74D7D Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) by imf05.hostedemail.com (Postfix) with ESMTP id 9FA54E000278 for ; Wed, 23 Jun 2021 09:25:17 +0000 (UTC) Received: by mail-pj1-f53.google.com with SMTP id g6-20020a17090adac6b029015d1a9a6f1aso3334622pjx.1 for ; Wed, 23 Jun 2021 02:25:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axtens.net; s=google; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=ZT/7Ux0bhzXpS+rf3sIBrRKhCNZmq/T8COWEpsyT4vY=; b=jT/xShcVdMcKeL4oR84DmNjF8Ol0x/t28pcCP6UWjmojgFpGCDTaWbUhUey+D9/VjC Fa1Y1LWPaxwZ54WdnRJaxarvAujXv6r//5mDcLAh6xR8aB6179P598fcqJpgFw/O8e9I yTn+mPdLFKs3Hhdq5aEBdwyy6yLqfaIjFuu+A= 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:in-reply-to:references:date :message-id:mime-version; bh=ZT/7Ux0bhzXpS+rf3sIBrRKhCNZmq/T8COWEpsyT4vY=; b=uczn7UozJX2eKE0riWvi9tfJZrr0BrV7II1BOE1MM1P8AwfZ28uPu8h5HumPaBmZxp 0pemol4SKz6rS74Wqg98lMHMHG/gGKGDtP+MpjePiSKyFJYoTORJinZpObR/BUbNxHKd UNoFHjMSRbUgCm78tf68/Sg+qDtgr025oMloe5cdd1yh6JIypWYFQRMlk7roe2Ou6gfr PqjoAQz4LpQX9PhcQ6gZwiRYfgljyutZEnDSyw3N9ZmOKX5ggyX45+bgEKxn4HabtLVb 8Fk3kceNkQEup3K99bSZa5vkZXxmJJW5uoIK7u3qasqWh8ZW4FE14tRBuej8PrdhE7y/ LP0A== X-Gm-Message-State: AOAM532WAA0H/t3RqufW/T3k2Fo60NGFdsjRks5oW68NEyD4oLEpadvB ROiymUZ4gCj8pfKpKXbGBu+KIw== X-Google-Smtp-Source: ABdhPJzbsZxUgHYE+5c9jK/6f3Rta4+H0JAMzKESDJRylXWtH/o0U6l0mxh/tTrGSKf7QzJuynjyCw== X-Received: by 2002:a17:90a:ee88:: with SMTP id i8mr8603384pjz.71.1624440316495; Wed, 23 Jun 2021 02:25:16 -0700 (PDT) Received: from localhost ([203.206.29.204]) by smtp.gmail.com with ESMTPSA id u10sm1860501pfh.123.2021.06.23.02.25.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Jun 2021 02:25:15 -0700 (PDT) From: Daniel Axtens To: Andrey Konovalov Cc: LKML , Linux Memory Management List , kasan-dev , Marco Elver , Andrew Morton , linuxppc-dev@lists.ozlabs.org, christophe.leroy@csgroup.eu, aneesh.kumar@linux.ibm.com, bsingharora@gmail.com Subject: Re: [PATCH v15 2/4] kasan: allow architectures to provide an outline readiness check In-Reply-To: References: <20210617093032.103097-1-dja@axtens.net> <20210617093032.103097-3-dja@axtens.net> Date: Wed, 23 Jun 2021 19:25:12 +1000 Message-ID: <878s31hr0n.fsf@dja-thinkpad.axtens.net> MIME-Version: 1.0 Content-Type: text/plain Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=axtens.net header.s=google header.b="jT/xShcV"; spf=pass (imf05.hostedemail.com: domain of dja@axtens.net designates 209.85.216.53 as permitted sender) smtp.mailfrom=dja@axtens.net; dmarc=none X-Stat-Signature: x7ich8oncobf9rekr9heka8tpnyr6fph X-Rspamd-Queue-Id: 9FA54E000278 X-Rspamd-Server: rspam06 X-HE-Tag: 1624440317-968853 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: >> diff --git a/mm/kasan/common.c b/mm/kasan/common.c >> index 10177cc26d06..0ad615f3801d 100644 >> --- a/mm/kasan/common.c >> +++ b/mm/kasan/common.c >> @@ -331,6 +331,10 @@ static inline bool ____kasan_slab_free(struct kmem_cache *cache, void *object, >> u8 tag; >> void *tagged_object; >> >> + /* Bail if the arch isn't ready */ > > This comment brings no value. The fact that we bail is clear from the > following line. The comment should explain why we bail. > >> + if (!kasan_arch_is_ready()) >> + return false; Fair enough, I've just dropped the comments as I don't think there's really a lot of scope for the generic/core comment to explain why a particular architecture might not be ready. > Have you considered including these checks into the high-level > wrappers in include/linux/kasan.h? Would that work? I don't think those wrappers will catch the outline check functions like __asan_load*, which also need guarding. Kind regards, Daniel