Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp593411pxb; Wed, 11 Nov 2020 11:08:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJzsvmfJgOj7Vxj3rgWTwytvi/ihuOINAw4I3QgrZPAGmXfcw/yTuF6DgVRRRWsnRHFRyVPI X-Received: by 2002:a17:906:3641:: with SMTP id r1mr27853745ejb.391.1605121695093; Wed, 11 Nov 2020 11:08:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605121695; cv=none; d=google.com; s=arc-20160816; b=gPjO8EtjdzE6JsFdBgkfS5aVfTpQj/5PKJZzIHSBfWBTIQIqkkTH+ayBkeC4uzMBwG 3wCdF1PLEyvv+FFR1hTKrBgHtQNt21iSoDQClZbc83IfqWtgK7bzEAEXSE829d2HS6O7 upZn8hcBH9yP91D0MuEAGdfXh69mPgbMGl2Frz5NFUvdoGmoiuiXnAWk22+ZIVzELBEU gymzWcTJSgdhVjGGyPjIw8iyAr4wRGe6vwiNQBse5sZRMAEoGPYXhc35uSjbOW2GEIcd NRlbbaZFT57D1QguLoKCC5InIsNIqnL+zG0iBQzIY2mTIbkrwsBlwFtx4etelNNlAJCr 1ccg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=dqQUt8nF2kgPMW+WfpdEe9JIcv1VB4HVulAU3CTX4MU=; b=Dh3Oee+juHWafJLL6ihJYOatCZ39VD0vm/iWlOe3QdCkwLrNgCFxDAX1U0EdPywXdi K2DVbxRtP05l5Vr21k+EyjOr/XUFpZwd4UMCLFAH6z0fKUpfNMDHLy9efC4Z3TszbRxX YIF8R99EFwc0Avjvd9o6ZCz2Wtqtq5jPG29yzucwFY6+ZZUnl9dO641sXgcyk9j7WuO7 5TXXvbwSkD48m6of4AHdqLiiNgUwvdz6z3QuX+MfO1r2FmLNBT+tOp9NZB+255W7dSpR OKrk0BBtb4ptM3/e1yCacErqN7luUAhfDI+yjQ61EIphzLJz2R3HIqVrbHWVpTTVEdgJ OTRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="IHIZ/9tF"; 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 x2si2238750ejy.195.2020.11.11.11.07.51; Wed, 11 Nov 2020 11:08:15 -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="IHIZ/9tF"; 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 S1725949AbgKKTFL (ORCPT + 99 others); Wed, 11 Nov 2020 14:05:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725860AbgKKTFK (ORCPT ); Wed, 11 Nov 2020 14:05:10 -0500 Received: from mail-ot1-x342.google.com (mail-ot1-x342.google.com [IPv6:2607:f8b0:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D911C0613D1 for ; Wed, 11 Nov 2020 11:05:10 -0800 (PST) Received: by mail-ot1-x342.google.com with SMTP id n11so3179814ota.2 for ; Wed, 11 Nov 2020 11:05:10 -0800 (PST) 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=dqQUt8nF2kgPMW+WfpdEe9JIcv1VB4HVulAU3CTX4MU=; b=IHIZ/9tFgR6oUqI2s20AR2vQEbvYVpaiSYLJuPVf3iwe2ZQV1VwFJ9+pAW89ziWPTO 9dlpBiurvBMFq0/RivSJhV1RO9wMucn8oyQ/k8VPIc0KiK+mL+wcfVOwXQAYdACEdDiy Z1EtjzXKr4mVitKEWIKdU9HTi2vZdEXGthD/g42ZTPEfS/pgLTCxhjwev1uXzFhoO+WO 5PC2y9Kp0PNdwULAeFnTowPwEyAVV7srzimiCunf/CzRr+vzc+SoT5gnQGNjiQIxLC9o 5K1alRUaaVRVStwgo/41+Sxg8AIJE0nGGsCWwN6EgKZZ+dsBOyp8oawS5ER6EBBNZ6xY sFVw== 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=dqQUt8nF2kgPMW+WfpdEe9JIcv1VB4HVulAU3CTX4MU=; b=j4PXk5dzey0vCGzx7g7AsFZddvw/XC/DQdJphn9PAUzArg6lWlgt0VL18HUV5dqCOK 7KwGCW2FhF1i0OP/7mZ7j7rmMa1FLjBZrwVQ+Ynltazb+7RzX5kAiDM/dbO8T3asCukJ 6YPnGeWsQkWrAWCFHPWfomIop0ebwNuSgkqYUeJkeTcmAjdd+9aIxv7WIqQucjWwUBmz rBhLaHiIXRnjN/uWpSQMEviR94IhCLrMfKpKAffo366Xs4drvgDmTFDxNT/h0BmQThfV VH45ms5Xza1LyTEjKTMc8u8UrdxMyWgeu6dewTuhm9+t2mHK8Ywk2/sefzzWZgopIIMi UMTQ== X-Gm-Message-State: AOAM5312c4BV5+mvmYFZDRMYnN0PvlRRbeNjPjH579mdBJM/1U7fk4Xn 5ys1WwU8gFkZizN9FVFCyV8YEiIZVDcovwmUaDDT3g== X-Received: by 2002:a9d:65d5:: with SMTP id z21mr17412658oth.251.1605121509540; Wed, 11 Nov 2020 11:05:09 -0800 (PST) MIME-Version: 1.0 References: <85aba371903b749412fac34e44e54c89e5ddae30.1605046192.git.andreyknvl@google.com> In-Reply-To: From: Marco Elver Date: Wed, 11 Nov 2020 20:04:58 +0100 Message-ID: Subject: Re: [PATCH v9 10/44] kasan: define KASAN_GRANULE_PAGE To: Andrey Konovalov Cc: Alexander Potapenko , Catalin Marinas , Will Deacon , Vincenzo Frascino , Dmitry Vyukov , Andrey Ryabinin , Evgenii Stepanov , Branislav Rankov , Kevin Brodsky , Andrew Morton , kasan-dev , Linux ARM , Linux Memory Management List , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 11 Nov 2020 at 19:48, Andrey Konovalov wrote: > > On Wed, Nov 11, 2020 at 3:13 PM Alexander Potapenko wrote: > > > > On Tue, Nov 10, 2020 at 11:11 PM Andrey Konovalov wrote: > > > > > > Define KASAN_GRANULE_PAGE as (KASAN_GRANULE_SIZE << PAGE_SHIFT), which is > > > the same as (KASAN_GRANULE_SIZE * PAGE_SIZE), and use it across KASAN code > > > to simplify it. > > > > What's the physical sense behind KASAN_GRANULE_PAGE? Is it something > > more than just a product of two constants? > > No, just a product. > > > The name suggests it might be something page-sized, but in reality it is not. > > What name would you prefer? Is it actually KASAN_GRANULES_PER_SHADOW_PAGE ? AFAIK we're trying to calculate the granules that we can fit into a page of shadow memory.