Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp904pxb; Wed, 13 Jan 2021 21:11:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJxpUcDDi/yznMzZuf/gWtB1TpBNTbCMr7XO+8QKBS8AtrakyuOE0Wv1ehpO59aN83NcI2Sk X-Received: by 2002:a17:906:edca:: with SMTP id sb10mr4074270ejb.284.1610601116198; Wed, 13 Jan 2021 21:11:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610601116; cv=none; d=google.com; s=arc-20160816; b=095Sr+nrLpCCvz/GhYJklpyU9Fdbkf0Sp52gyfxY8xmaL0gSEq9IJSBuJnGSBQEvtz 9Ik7OKh4QJcv+IwOtuM2sXM6qZekQbNfzGZHsiqOPKC84Wrq3t0KbXjhEsCPnGnlcgMN umPNOGLq/SyajCD7hh5GUgO9IJmz2YUHB7Me8aGxun4OisIyvlGdg4eGnJbMbxxCu96P Y0w/orGkO3VyStW+qXfGK1wH2O1fbTKjcxUEhlkjHH4mm5Np+4PIh1fJH69/ohmfM2CQ wtBqAHOgUMcf/6d3kqTnQt/aPYmdETsDpOYW/5Nvscsr/b/e6H6Ts3ld6qNM9rsHL7W0 ZUdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:to:from:cc:in-reply-to:subject:date:dkim-signature; bh=l0SVd2Z6z2wiunvJxS4KRqjbI/ytm6ARhNhbn0IZGIA=; b=cuOU7HLf8LkXDj6tRSehxCNkSnVd91lnLTTcSAZ/FGtwXmiR686dxqa+RB7PdUe9fF U8yvETYUMIIgmXm1wHyIQBl9fvTEbrNyonUMZt9aP3CiHf5umUykQrnMcRH0MeQ/BPAQ 4ifpgtqmmht05AMUUc2wo26LXGLrtM+FVHsjHo9IoG+kP+O/Zq4enF6Ow41ZjZbUUrp/ hbZ3l2GZL/0nEqztaRIPKCV67RB+UVT8t8FP6zu/lE8z7JTSXAi+gj3CwabND6+bzjAy 0z9Vc6gtZ/TrblR21woKg2mvpsbty2khveC7OAIwOt/7TJLrjDX7xn30xEInfYo3zmO6 OaJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dabbelt-com.20150623.gappssmtp.com header.s=20150623 header.b=q8RNlcBR; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r6si1299082eji.619.2021.01.13.21.11.32; Wed, 13 Jan 2021 21:11: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=@dabbelt-com.20150623.gappssmtp.com header.s=20150623 header.b=q8RNlcBR; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726396AbhANFKR (ORCPT + 99 others); Thu, 14 Jan 2021 00:10:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726204AbhANFKP (ORCPT ); Thu, 14 Jan 2021 00:10:15 -0500 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3E21C061575 for ; Wed, 13 Jan 2021 21:09:35 -0800 (PST) Received: by mail-pg1-x52c.google.com with SMTP id c132so2996293pga.3 for ; Wed, 13 Jan 2021 21:09:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20150623.gappssmtp.com; s=20150623; h=date:subject:in-reply-to:cc:from:to:message-id:mime-version :content-transfer-encoding; bh=l0SVd2Z6z2wiunvJxS4KRqjbI/ytm6ARhNhbn0IZGIA=; b=q8RNlcBRjFP2BNecOlGAIXcVb2tcLxP0m95wws3L5nfz3R/bj6jLK6ZSlQyqecVGBH baWhTyopNPQiosVcCHCn5G2V+Cz0RbU9VjcuMuUGuwJRSsmFix4TpJVcBMM6Gl9DJceK QZxFMOVhh2CGrfq/kKFRKbyl91TauSsfMJVrrl7NB9lRvt32B9Ev3N3IxOhGKeznjVdH ouOAtgS9qv+pwl2EoqItCQgCZn7OBqxrxPImdq8oqFLcPE9qhbgY/IAWQpD4QjbSZ1hP cqeple8OV0xEa6wqT5Fd4Oi6OEoElfJuVi5MxdB7XX1rwn6hwD5G9sPAd2XUkLBDQ/Pe hrsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:subject:in-reply-to:cc:from:to:message-id :mime-version:content-transfer-encoding; bh=l0SVd2Z6z2wiunvJxS4KRqjbI/ytm6ARhNhbn0IZGIA=; b=eeO7x+oBzOWV9vCmm6lMGU/VbgJqF4CnrJVaL5QPzF/CVAMbEwtmVsy/+/f5ObVUwN WJhU5bZ5R0G5PE8fwPjnSLa60XjwTEpTZNMuenmeKtjZ86MMDvZWqmFof2sbiYwI822R d/JupT7RVXl3O6rVjMP1OxBrg4iSZbEUkqQod2FtSVhsZ2uiQYeJPrFuXBE6yQcEdY+7 9c561WqmdFpiqQNAyzs2Dp7OdJuQunU12UHBPMScbh3wWHgSSppJsKpQikW9EOqLyZ2u 49LqIUMgI05ta2EczM0r0PMRzXeyzMkMzMPzhBcn378pMxe0NVkjq01CAOuGtPTTGD/Q om5Q== X-Gm-Message-State: AOAM5328AChzIW3HfJfXytkMI7XdftKsyDkirCJIABwkwvIWJH5femiH E8MFvUXkh1hNXBqTozLrJ/i+di5YXJQgbg== X-Received: by 2002:a65:6659:: with SMTP id z25mr5697984pgv.427.1610600975227; Wed, 13 Jan 2021 21:09:35 -0800 (PST) Received: from localhost (76-210-143-223.lightspeed.sntcca.sbcglobal.net. [76.210.143.223]) by smtp.gmail.com with ESMTPSA id p8sm4103108pjo.21.2021.01.13.21.09.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Jan 2021 21:09:34 -0800 (PST) Date: Wed, 13 Jan 2021 21:09:34 -0800 (PST) X-Google-Original-Date: Wed, 13 Jan 2021 21:08:16 PST (-0800) Subject: Re: [PATCH 3/4] RISC-V: Fix L1_CACHE_BYTES for RV32 In-Reply-To: <20210107092652.3438696-4-atish.patra@wdc.com> CC: linux-kernel@vger.kernel.org, Atish Patra , aou@eecs.berkeley.edu, akpm@linux-foundation.org, Anup Patel , ardb@kernel.org, linux-riscv@lists.infradead.org, rppt@kernel.org, Paul Walmsley , mick@ics.forth.gr From: Palmer Dabbelt To: Atish Patra Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 07 Jan 2021 01:26:51 PST (-0800), Atish Patra wrote: > SMP_CACHE_BYTES/L1_CACHE_BYTES should be defined as 32 instead of > 64 for RV32. Otherwise, there will be hole of 32 bytes with each memblock > allocation if it is requested to be aligned with SMP_CACHE_BYTES. > > Signed-off-by: Atish Patra > --- > arch/riscv/include/asm/cache.h | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/arch/riscv/include/asm/cache.h b/arch/riscv/include/asm/cache.h > index 9b58b104559e..c9c669ea2fe6 100644 > --- a/arch/riscv/include/asm/cache.h > +++ b/arch/riscv/include/asm/cache.h > @@ -7,7 +7,11 @@ > #ifndef _ASM_RISCV_CACHE_H > #define _ASM_RISCV_CACHE_H > > +#ifdef CONFIG_64BIT > #define L1_CACHE_SHIFT 6 > +#else > +#define L1_CACHE_SHIFT 5 > +#endif > > #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) Should we not instead just #define SMP_CACHE_BYTES L1_CACHE_BYTES like a handful of architectures do? The cache size is sort of fake here, as we don't have any non-coherent mechanisms, but IIRC we wrote somewhere that it's recommended to have 64-byte cache lines in RISC-V implementations as software may assume that for performance reasons. Not really a strong reason, but I'd prefer to just make these match.