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=-11.4 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=no 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 EB172C43464 for ; Fri, 18 Sep 2020 15:46:08 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7B9B323730 for ; Fri, 18 Sep 2020 15:46:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="DuSddiKU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7B9B323730 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D58296B0037; Fri, 18 Sep 2020 11:46:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CE1AB6B0055; Fri, 18 Sep 2020 11:46:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BCEF76B005A; Fri, 18 Sep 2020 11:46:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0131.hostedemail.com [216.40.44.131]) by kanga.kvack.org (Postfix) with ESMTP id A5AB16B0037 for ; Fri, 18 Sep 2020 11:46:07 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 68097181AEF23 for ; Fri, 18 Sep 2020 15:46:07 +0000 (UTC) X-FDA: 77276608374.30.duck28_5a021a22712c Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin30.hostedemail.com (Postfix) with ESMTP id 4A65B180B3C8B for ; Fri, 18 Sep 2020 15:46:07 +0000 (UTC) X-HE-Tag: duck28_5a021a22712c X-Filterd-Recvd-Size: 4812 Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) by imf09.hostedemail.com (Postfix) with ESMTP for ; Fri, 18 Sep 2020 15:46:06 +0000 (UTC) Received: by mail-pl1-f193.google.com with SMTP id u9so3194356plk.4 for ; Fri, 18 Sep 2020 08:46:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=hkgDDbxZ0ilYITjWl8C63+E3bk69jBdfnUZGv0u3+yE=; b=DuSddiKU58AUP/n7xqynLIDV6aGggzLwPpQvdlS76i6QN2Pq/fmkGuOEID2Ld5Xk/w SOA/gNLariAGcorvyKjcSDpm0434qHkSdWD16ADHmyP4auPFVXp2aIxXyk+R+yItxLOn 2Ygls0aSH1HZOuPc8x+skY2EnXESAvg6/DO0mqq8mxmS2y3HgUgocuyL17frrSF7mgXv B483rs51EK2Sef8QG8uPSeGEiQBhaYtGR3+qRJQF5X/qwGwF4WRfwn9n/hJz3ssS2HXS zGbn1uROFj0NFHIpjP7HDQ3hR8jk+opplnatdx6WOa2StX9ahda3qrdeDnfOnrVxtvse jhmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hkgDDbxZ0ilYITjWl8C63+E3bk69jBdfnUZGv0u3+yE=; b=pHtKxIvc0I52FHFl6Mm2jQ6hpeG9pTaJvIvvs+i0PQDYWPCLITooZ3ORsUp36HK2IM a31gOZ0sYmCaZSRfeanhYiEr/4aIpzCYFNEiJ1aUTpDVb+KqeQuNi5DeVVGzVOpDkiWW Vx/I2cAELKAewOqaSoF8TxdmAwHbIbPzyfiPpHU8bDFxKkGQD4duZZw0zh3cGaj+FZ23 8oc7CdvcmutQ68hzfGcOXQ5O5BjmSZDr7ATpcUBUUgwebS0Q6w99WkXEdwCAEhHwV8gE 3OZPE/ceqe5h8YoxXC5M50zqvthXi02SVauKujfXo7Ust/o1o8J+HZwEGOk5VBuJIGZB CIqQ== X-Gm-Message-State: AOAM530/5hCf5YBR+9IicbPGZvsVrOJygzIDrC5Ho4bBegWv7gSG/G1m /koADX2LdqmMSQkXb8KtrqUq2SqZcCXvqyghCccTQA== X-Google-Smtp-Source: ABdhPJxGorRTMUyDtWd2xSOIntBilFG3dQo44Ho+eGPonH84X6ooJ+So+Qk32Bqicn7FQje2enaN7vNH3BuA5SSHppg= X-Received: by 2002:a17:90a:cc0e:: with SMTP id b14mr12978124pju.166.1600443965540; Fri, 18 Sep 2020 08:46:05 -0700 (PDT) MIME-Version: 1.0 References: <329ece34759c5208ae32a126dc5c978695ab1776.1600204505.git.andreyknvl@google.com> <20200918123249.GC2384246@elver.google.com> In-Reply-To: From: Andrey Konovalov Date: Fri, 18 Sep 2020 17:45:54 +0200 Message-ID: Subject: Re: [PATCH v2 21/37] kasan: introduce CONFIG_KASAN_HW_TAGS To: Marco Elver Cc: Dmitry Vyukov , Vincenzo Frascino , Catalin Marinas , kasan-dev , Andrey Ryabinin , Alexander Potapenko , Evgenii Stepanov , Elena Petrova , Branislav Rankov , Kevin Brodsky , Will Deacon , Andrew Morton , Linux ARM , Linux Memory Management List , LKML Content-Type: text/plain; charset="UTF-8" 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 Fri, Sep 18, 2020 at 5:36 PM Marco Elver wrote: > > > > How about something like the below change (introduce KASAN_INSTRUMENTED > > > Kconfig var) to avoid the repeated "KASAN_GENERIC || KASAN_SW_TAGS". > > > This could then also be used in the various .c/.h files (and make some > > > of the code more readable hopefully). > > > > I tried doing that initially, but it didn't really look good. The > > reason is that we actually have two properties that are currently > > common for the software modes, but aren't actually tied to each other: > > instrumentation and shadow memory. Therefore we will end up with two > > new configs: KASAN_INSTRUMENTED and KASAN_USES_SHADOW (or something), > > and things get quite confusing. I think it's better to keep > > KASAN_GENERIC || KASAN_SW_TAGS everywhere. > > Ah, I see. So in some cases the reason the #ifdef exists is because of > instrumentation, in other cases because there is some shadow memory > (right?). Correct. > The only other option I see is to call it what it is ("KASAN_SW" or > "KASAN_SOFTWARE"), but other than that, I don't mind if it stays > as-is. Let's leave it as is then. I don't think the code will get much better in terms of readability if we add KASAN_SOFTWARE, but we'll get another "indirect" config option, which makes things a bit more confusing.