Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp74045lqb; Tue, 28 May 2024 09:09:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWSPJ3OwEz7vbhpwx3PgA2H+9WR8wDH6O2jhToOz1MlgeRwwmUZVzZ52PJhBfKe1W1Tmp2PXyILxziotxb7D3vsvI+PVsAIUCWUU/mKFg== X-Google-Smtp-Source: AGHT+IHO1VWO8+zQpRh8F3EElh1LyBFaqtpIVBicxd5bQkocoScM0F3hDLl7uLoJ3xd/AJjmECLX X-Received: by 2002:a05:6402:901:b0:578:6832:8c38 with SMTP id 4fb4d7f45d1cf-57868328cf1mr5823316a12.24.1716912591739; Tue, 28 May 2024 09:09:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716912591; cv=pass; d=google.com; s=arc-20160816; b=H6r0WojXUhBafxJR5oqfkty73X+jvm7eNxhgmvvzR6QfnvK9n+crSneafmTA56p7SF wWilxHhljvCybd+iTAkQ99V+knW3YhsSieuZLBfwqubg0JSAiCmAz0dUKPSXqDEIxSEy WkAOAy9T4CO9GnSLof47vaz+KDfAZcQ2OtRVdapd45j85z+pX+Tnxahd5z3yjB+W/ids 1jlzzMgoBIHE/Hdd7E40C+W5v3l7v80ATuapYToluJh6q6PvtQ6YzrmOtAgPNTkFNNad /bmBvvliJNdacR4w29lGrVatyJEt81eBSItlE9/FSuIkse7d02BEa56rTxY1q5SsSxpR N9Dw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=OdTwRGM/xFqjxVW5C5kGI3vl1niJryR3wCIYGtbgqIg=; fh=G9yuJ6sFzGjQE0CoalsWcZr3S98nA8onen3KrpSxW8s=; b=RjH3w3KCfzXYiIN+fE004bHnthamYZ3b+JTypB6ZTEcvUCFHE6FMbViPlylKD7fDQp Dwcy9bVlIiHbN23nD3s3kGz80hOa8gfSpfxA6wJ98+gzU3tVYGo4N4/oIoVhQm/dNc/d 6QloogKrSGWj6P5Lx7gqAgiTSX1lRaoKQOy4uAOdHcXoLREtsqRtMKDoCXgfvIX/OtRU 76h5jhm+KtoNDO6P46Xn7PrWma5UlAeTF/RWUAwNNRqkBBk4v38IByl5akKYUx6CzY6Y EdZAFHGC31HtSh/I6MEImMputy6D+1lCXuXPLyADFO4zA179SOFpAK2JqL7GaPOJHP/4 CcFg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=SvYNv29w; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-192722-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192722-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-579c1caafcesi3466804a12.461.2024.05.28.09.09.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 09:09:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-192722-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=SvYNv29w; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-192722-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192722-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 1D5FA1F23F13 for ; Tue, 28 May 2024 16:09:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E7131172BD6; Tue, 28 May 2024 16:08:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SvYNv29w" Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 36F46172760; Tue, 28 May 2024 16:08:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716912520; cv=none; b=sGQbSCvE6Or3v4w6N7SZDWULMjwQJjgd3vEJ5Ylxd6aNryH+T0COa1oo1spe0L5qhnU9W69YpHcXFt2otdU/6xaisnS9B+tukciGvrR/y8k1H23dj8inX/J2J2AGKHCTiMaIam3BNImQAoa4fO6OwFsvy31iMGugFgFrPqwJxVI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716912520; c=relaxed/simple; bh=98Dp7GRPIN0v3q4FFW0kItcSjOoGd3KVZoxUHaBLd/4=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=jSmmv46GXL6sUaYpmd+CAyNcrUCgxCg8XF9eDpjiEAlUjYsoppTruhiG82CllTmjE+CIpbloo9cW4uBsH/Y3GKN30CQMtdMeEwxh72CxA15VeFn4R4AXA4+poYRexJXi7thOPTvZWney2WoeocrTx+9ClekP3PuESg201TvDidw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=SvYNv29w; arc=none smtp.client-ip=209.85.167.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-f42.google.com with SMTP id 2adb3069b0e04-529b79609cbso1760099e87.3; Tue, 28 May 2024 09:08:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716912517; x=1717517317; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=OdTwRGM/xFqjxVW5C5kGI3vl1niJryR3wCIYGtbgqIg=; b=SvYNv29wSw9haepMKYlvkxSvBMNyO9JomKKKHWK8USlwxZp7wE0G5i/KFvvNRyU/hd qXOiqVwiZKkFzYwBf/3AbHHFlZQAcZiJDboOniHtTXH1+CzPDNwnuxNFu/M3iFqPP8lf 9heOyRGlglTn50hAekKZk0zZfLrYFHsARii0XWS4Eq+1+MVd9kEs40B/QjrYVYJEhqwn QSkU3lR4MLIRAL+8O80ahejvyULysDYBdLlNlAkIl5G6AY0ijsKElvRFFSnz4J7dKATb bO97ZgoRUMz87JY6iF+CdQ1CHrkkfNCzYWvo58w1dozylZWKiNcdtrOPA2WGeIv852LK nABQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716912517; x=1717517317; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OdTwRGM/xFqjxVW5C5kGI3vl1niJryR3wCIYGtbgqIg=; b=BAHjJK556k1TBqs/LGHN7ii20xNfcvB5jj6dErMCZdWyWn4qqvv9cfb71uXne1GSek 0Mz4mT2TGjvWwktlHoarP0Ws6evYDQJ+q1g4ntDRl5J2nlRKB8lqxikhFt23l8ee9gFn 9dXhO6aObW2nfPVXK1dzxB2I7tIaiq3qo4m1TvgGx45xf23rRjYg58GrkfK0aa6eF4AT SCuOVn7l0CEmrPJd19NfLhVlkLJFTODLGqGnQCP4PZQKQ220XVp4Tc5sNIQArjsDEIoo oERhIvPqBACbirAoz3IDHD/I4qPgQyxYOdXb+hGnILWTyZW1PHXxmWyG/IOaDkTxSaOx fjbg== X-Forwarded-Encrypted: i=1; AJvYcCUjk+q3EcuciDPWGEc9V199zGVvPmUmoRseLcY8dmbTP3lMpmGitOsSY0ucEggB/AJSqNaeE6tujdAO8eZmgaTGT3+cB4p7b+Da8J8pXgwPX9JUNkMqqCNE8Y7YcU9ZypnFE8+WLpOyqFtOPA== X-Gm-Message-State: AOJu0YwH024zoMs7U2dSyiHV3kJ9mTSIDQogRE35f9Vzc7Uwm4Gn3PBA VMvUWGkb3pOeNxwoaEKaH1iwmlCU+5GZ2qWDjmYFM9v14PbPPhlCHkKK7Woihh3z7Jy5ox0N/mA 5rqDAytxepKNVgY+m4rz6PtCxC6eHGQ== X-Received: by 2002:a19:8c47:0:b0:529:3da2:ad01 with SMTP id 2adb3069b0e04-5296410a314mr8054332e87.12.1716912517068; Tue, 28 May 2024 09:08:37 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240123144543.9405-1-quic_bibekkum@quicinc.com> <20240123144543.9405-4-quic_bibekkum@quicinc.com> <51b2bd40-888d-4ee4-956f-c5239c5be9e9@linaro.org> <0a867cd1-8d99-495e-ae7e-a097fc9c00e9@quicinc.com> <7140cdb8-eda4-4dcd-b5e3-c4acdd01befb@linaro.org> In-Reply-To: From: Rob Clark Date: Tue, 28 May 2024 09:08:24 -0700 Message-ID: Subject: Re: [PATCH v9 3/5] iommu/arm-smmu: introduction of ACTLR for custom prefetcher settings To: Dmitry Baryshkov Cc: Konrad Dybcio , Bibek Kumar Patro , will@kernel.org, robin.murphy@arm.com, joro@8bytes.org, jsnitsel@redhat.com, quic_bjorande@quicinc.com, mani@kernel.org, quic_eberman@quicinc.com, robdclark@chromium.org, u.kleine-koenig@pengutronix.de, robh@kernel.org, vladimir.oltean@nxp.com, quic_pkondeti@quicinc.com, quic_molvera@quicinc.com, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, iommu@lists.linux.dev, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, May 28, 2024 at 6:06=E2=80=AFAM Dmitry Baryshkov wrote: > > On Tue, May 28, 2024 at 02:59:51PM +0200, Konrad Dybcio wrote: > > > > > > On 5/15/24 15:59, Bibek Kumar Patro wrote: > > > > > > > > > On 5/10/2024 6:32 PM, Konrad Dybcio wrote: > > > > On 10.05.2024 2:52 PM, Bibek Kumar Patro wrote: > > > > > > > > > > > > > > > On 5/1/2024 12:30 AM, Rob Clark wrote: > > > > > > On Tue, Jan 23, 2024 at 7:00=E2=80=AFAM Bibek Kumar Patro > > > > > > wrote: > > > > > > > > > > > > > > Currently in Qualcomm SoCs the default prefetch is set to 1 = which allows > > > > > > > the TLB to fetch just the next page table. MMU-500 features A= CTLR > > > > > > > register which is implementation defined and is used for Qual= comm SoCs > > > > > > > to have a custom prefetch setting enabling TLB to prefetch th= e next set > > > > > > > of page tables accordingly allowing for faster translations. > > > > > > > > > > > > > > ACTLR value is unique for each SMR (Stream matching register)= and stored > > > > > > > in a pre-populated table. This value is set to the register d= uring > > > > > > > context bank initialisation. > > > > > > > > > > > > > > Signed-off-by: Bibek Kumar Patro > > > > > > > --- > > > > > > > > [...] > > > > > > > > > > > + > > > > > > > + for_each_cfg_sme(cfg, fwspec, j, idx) { > > > > > > > + smr =3D &smmu->smrs[idx]; > > > > > > > + if (smr_is_subset(smr, id, mask)) { > > > > > > > + arm_smmu_cb_write(smmu, cbndx= , ARM_SMMU_CB_ACTLR, > > > > > > > + actlrcfg[i].a= ctlr); > > > > > > > > > > > > So, this makes ACTLR look like kind of a FIFO. But I'm looking= at > > > > > > downstream kgsl's PRR thing (which we'll need to implement vulk= an > > > > > > sparse residency), and it appears to be wanting to set BIT(5) i= n ACTLR > > > > > > to enable PRR. > > > > > > > > > > > > val =3D KGSL_IOMMU_GET_CTX_REG(ctx, KGSL_IOMMU_CTX_AC= TLR); > > > > > > val |=3D FIELD_PREP(KGSL_IOMMU_ACTLR_PRR_ENABLE, 1); > > > > > > KGSL_IOMMU_SET_CTX_REG(ctx, KGSL_IOMMU_CTX_ACTLR, val= ); > > > > > > > > > > > > Any idea how this works? And does it need to be done before or= after > > > > > > the ACTLR programming done in this patch? > > > > > > > > > > > > BR, > > > > > > -R > > > > > > > > > > > > > > > > Hi Rob, > > > > > > > > > > Can you please help provide some more clarification on the FIFO p= art? By FIFO are you referring to the storing of ACTLR data in the table? > > > > > > > > > > Thanks for pointing to the downstream implementation of kgsl driv= er for > > > > > the PRR bit. Since kgsl driver is already handling this PRR bit's > > > > > setting, this makes setting the PRR BIT(5) by SMMU driver redunda= nt. > > > > > > > > The kgsl driver is not present upstream. > > > > > > > > > > Right kgsl is not present upstream, it would be better to avoid confi= guring the PRR bit and can be handled by kgsl directly in downstream. > > > > No! Upstream is not a dumping ground to reduce your technical debt. > > > > There is no kgsl driver upstream, so this ought to be handled here, in > > the iommu driver (as poking at hardware A from driver B is usually not = good > > practice). > > I'd second the request here. If another driver has to control the > behaviour of another driver, please add corresponding API for that. We have adreno_smmu_priv for this purpose ;-) BR, -R > > > > > > > > > > Thanks for bringing up this point. > > > > > I will send v10 patch series removing this BIT(5) setting from th= e ACTLR > > > > > table. > > > > > > > > I think it's generally saner to configure the SMMU from the SMMU dr= iver.. > > > > > > Yes, agree on this. But since PRR bit is not directly related to SMMU > > > configuration so I think it would be better to remove this PRR bit > > > setting from SMMU driver based on my understanding. > > > > Why is it not related? We still don't know what it does. > > > > Konrad > > -- > With best wishes > Dmitry