Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp3410844pxx; Mon, 2 Nov 2020 08:10:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJxWhWRWzdxdK6xAoRZQXLweFzpMFszEatXsRouPzO6AWJRNJo3YsqZP42eWAVQ7djNZrJKh X-Received: by 2002:a17:906:c0d8:: with SMTP id bn24mr15655265ejb.480.1604333456863; Mon, 02 Nov 2020 08:10:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604333456; cv=none; d=google.com; s=arc-20160816; b=Ng2RtzWfawbQ6YMWDhsMPS7lSMwAbR7tylBrysMmmYvL7qhTYqCtx83qNdSUUBJJ78 Nsc5LjYo80QzLeyWifabe/fJqwd+8ezNopwVaDX4zabX/q6oD/tDdhjGs2zGQEBb72BG ZzF+sJa+EQ5kItBDPfVny2ZsFuOPk/Z4sp+QWYrfBErfi7lsK/lXEqDLCBgI4tcAOSKV M1xvHpxyru1bvAcjDY+wmgWrn1fvO2sopJ9WldnxZd+A5KCabfraHJ9gntxo2SvtJlgY X8nY8pu6i2+zGMnAUqkH8sKeuqx9Gcg+3sxJMAIwTMUSuIIz3kZ54G8dYiETdTDGhfZJ e4ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:sender:dkim-signature; bh=E7M1YMbMIR4yMAYd8ymzpiiG9f9KaGeAaRDscMDAbI8=; b=aMJ4fzB4K/nro6c7MjB5SBPbZYzgKNecADm4ganbvi9l4ZMug89NYIVSTdPfMolMDH j0lPYLdaf0OnHhFaMPytWU+ycDq0n92WGJKWUZuZTnjEmNlO9VCFn/GO/XfbUmPfqHiX GeK+CncWasea0rkt+IrYQRvf/acQLFuA1DtZD0e13GGYOVquzqXm1UuR9gTPs5BvBu8q ovoosx2osRlyQ77dvtYL/IyccrPCJL7+2eb6ORzMDHWygazQi6ZnleKfobvrDpakidwt passd0s7gKa5jS2UkzwJX4E4cU/ekGRNk2kDKb1Ku9U1z6ZX3iIt4uxxYIpViJWoXhfs PX1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=B+b74HQO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g15si13479107edp.174.2020.11.02.08.10.34; Mon, 02 Nov 2020 08:10:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=B+b74HQO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727194AbgKBQF4 (ORCPT + 99 others); Mon, 2 Nov 2020 11:05:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727164AbgKBQFr (ORCPT ); Mon, 2 Nov 2020 11:05:47 -0500 Received: from mail-qt1-x849.google.com (mail-qt1-x849.google.com [IPv6:2607:f8b0:4864:20::849]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FF06C0617A6 for ; Mon, 2 Nov 2020 08:05:47 -0800 (PST) Received: by mail-qt1-x849.google.com with SMTP id i39so8345179qtb.1 for ; Mon, 02 Nov 2020 08:05:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=E7M1YMbMIR4yMAYd8ymzpiiG9f9KaGeAaRDscMDAbI8=; b=B+b74HQOp3f/kfOxXBITIRBEll8gls2oSrKFlkytGbLYfoRHHu1uMoDCIY1/QpTreR 1OWKmsbQ3kb79xzISbXlnmxB2nFKPH9xGsspSZnhWewaaEzeQQzpYHdE+Tvylc9ZEy1C Ynm9YJUeyl+VKHbYnn3nmDML3XSJTKgfLfCPTEHNx4Yj+yOt3oFEMIQaUDLmJGta7A6s +CZAF+bpODT0CKwxt9FAzMVIgqHaDyQzk6/HgFfJyDbRWtMk9xod5t/V99ooccHzwWKh mR2nvhRCb+Ky6uhyTKye5Xm1E2L9ta9OLifCVWA+NfdRlyOE/FFvrXthJ3hePSrMPK9z 3dQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=E7M1YMbMIR4yMAYd8ymzpiiG9f9KaGeAaRDscMDAbI8=; b=ZSSVi6TLxIGKgRSBrl0mKDav+R0ICRcH9m3ZU/IQa38OcAfFMTiOUE0y8y9G9oX3vs Ikh7m1RfvQu9N/hkgzIS3az3boY7Ey//HPMe6wZz8QUvHSkuuL+WY8iJOsNVIs1GLF+e EqlgYvmyozAr2/F1kt5vAY+MSztdz50n0tNo8SxkrPQNYd031zkuOGqqqDrMr6Lpk8wP oITz17AFrGVWPMIYq/oTzxnfbefikm0dfeYuBOohP4ZdM5fx/Hpf5H6opf0h+dGjtQNZ o+5LgTOe+6O/NE41oP5h3OqKao78NI9Us/YKCrgh5T2SmS5O6ABFppSq+ezi1e7NoyUY 1X4g== X-Gm-Message-State: AOAM533AWLR6KEBlXWBPJWDlbLCtmFFEs64xW2AUM2P78QFdYLIV9o7O YPKeXq1jYPnkaTyWA+M5wqdwP79/AWQWnLmp Sender: "andreyknvl via sendgmr" X-Received: from andreyknvl3.muc.corp.google.com ([2a00:79e0:15:13:7220:84ff:fe09:7e9d]) (user=andreyknvl job=sendgmr) by 2002:a0c:f70e:: with SMTP id w14mr23027576qvn.10.1604333146336; Mon, 02 Nov 2020 08:05:46 -0800 (PST) Date: Mon, 2 Nov 2020 17:04:13 +0100 In-Reply-To: Message-Id: Mime-Version: 1.0 References: X-Mailer: git-send-email 2.29.1.341.ge80a0c044ae-goog Subject: [PATCH v7 33/41] kasan: define KASAN_GRANULE_SIZE for HW_TAGS From: Andrey Konovalov To: Catalin Marinas , Will Deacon Cc: Vincenzo Frascino , kasan-dev@googlegroups.com, Dmitry Vyukov , Andrey Ryabinin , Alexander Potapenko , Marco Elver , Evgenii Stepanov , Elena Petrova , Branislav Rankov , Kevin Brodsky , Andrew Morton , linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrey Konovalov Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hardware tag-based KASAN has granules of MTE_GRANULE_SIZE. Define KASAN_GRANULE_SIZE to MTE_GRANULE_SIZE for CONFIG_KASAN_HW_TAGS. Signed-off-by: Andrey Konovalov Signed-off-by: Vincenzo Frascino Reviewed-by: Marco Elver --- Change-Id: I5d1117e6a991cbca00d2cfb4ba66e8ae2d8f513a --- mm/kasan/kasan.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mm/kasan/kasan.h b/mm/kasan/kasan.h index e3cd6a3d2b23..618e69d12f61 100644 --- a/mm/kasan/kasan.h +++ b/mm/kasan/kasan.h @@ -5,7 +5,13 @@ #include #include +#if defined(CONFIG_KASAN_GENERIC) || defined(CONFIG_KASAN_SW_TAGS) #define KASAN_GRANULE_SIZE (1UL << KASAN_SHADOW_SCALE_SHIFT) +#else +#include +#define KASAN_GRANULE_SIZE MTE_GRANULE_SIZE +#endif + #define KASAN_GRANULE_MASK (KASAN_GRANULE_SIZE - 1) #define KASAN_GRANULE_PAGE (KASAN_GRANULE_SIZE << PAGE_SHIFT) -- 2.29.1.341.ge80a0c044ae-goog