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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E0695C52D7B for ; Tue, 13 Aug 2024 17:02:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=zqcYDyfx63llFdcrlT+i8nPzWoVuQ+JI9Z24vWzRXhc=; b=fzrxUqk1Y0TiisESrFqFtK6qTy elZGOYySjqlMW0Ur+29ODxyXgaB527NqMAyGHE+qD1sTP4LwGPeIffEgtsihmF7HaMgqcX1WRdao+ S7VEuRMyMqKk3JP/kG9bqpG+t+CEnJ4yaCrckuckafSn5bHItpkxrBV/BDaSoEKUrGygyDoZoV2X5 H1wXnqu2CTbZwM5qreGz2Ler33o346WjBd+uZwZ1eIIl+MgfTOXHP9WPbeeFENLW2jyY213C2/jF+ gtz31xYtR3KAWHikNtljqTD+bxi4sDaAxJDJWJge6Mm2KfuAyETmmncHl7D1dvzEm64BmvMDgi1ao 9z6oyDtw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sduuU-00000004RX7-3Qgh; Tue, 13 Aug 2024 17:02:14 +0000 Received: from mail-qk1-x736.google.com ([2607:f8b0:4864:20::736]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdutq-00000004RLQ-2Ihg for linux-arm-kernel@lists.infradead.org; Tue, 13 Aug 2024 17:01:35 +0000 Received: by mail-qk1-x736.google.com with SMTP id af79cd13be357-7a1d81dc0beso363629685a.2 for ; Tue, 13 Aug 2024 10:01:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1723568493; x=1724173293; darn=lists.infradead.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=zqcYDyfx63llFdcrlT+i8nPzWoVuQ+JI9Z24vWzRXhc=; b=n2qS4vlrXrhM07QLMUfaMrFCVCD34qQC0ij0CttWTZGuHa90CrXpmk1z/rzHkmVnVX 0B4QfmUs/Qs5yGwqn4Z0kR2GkpepQqPW57RxFiPKp4Sz5LpY9ohkEnfZyqPeoeebt5BQ zuM2jJfiBA+GuUfWqCwejDuFndn1Yf4Ky+RdD8YdS0muoYAldNVXRNUKtpDptmfJCFK3 4XcckeRM7FiDKhommCMrdC57praDT9Odhcvf+sg2GnZ0/WP3KyUEBnnW+l4E5Aqp48cp 6EQIYbq8pHIZopl3HkUorDKvYZx6rFtlh1rbPtu93chCsPJdutmPK6Uz1qxGJAhfmmJI F6hQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723568493; x=1724173293; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=zqcYDyfx63llFdcrlT+i8nPzWoVuQ+JI9Z24vWzRXhc=; b=k5yGWVWNFcLuJ+uxBfPBFeoVjEgBTXt5SseDue/bRrCz4tcVeQck3XkCV+SPCLtvDZ ISI3ubNauSkjyozQBB5lJSzRVLK2E10mb2cZ5XG8cVKtNkjdEZGDgTzjHPq996n0/jpm UJoOqf2N1n59ou4LDclJsHEJGQ5sc5sgMZHGi3KUwizegS7WopdnGYEcyK9S6r3zC+Ti h/rGJhUwlIpAUW36VNQKb4nVilNtWgwko4+7PCztlK4vdAoAHJINPhQkbO5US4Wx6SuO KIEzGxef/e9o5qvXJm1u7xMqK1gM13FsvNY1eB4tB7sIxBEPpCU3tcRRvvC9Lhf1gG1E Krow== X-Forwarded-Encrypted: i=1; AJvYcCU5bMqkRSnYdtkG79t9yGlEUvuNQNcH3h9vKdT6xujyfXdNhS2maRvcKJz/UOG4uHk1BC3sHiaAh5XXTwWANM8riFuAbThUq+updoCoqb/hSdbWJo0= X-Gm-Message-State: AOJu0Yx1qxe+WeDEpkNx89dCNG2WoYhjuDv6MC4uOlBn4B+nYTYWjv2a WhdYzNHGftAfGr4J4MikC0wQOi6dtvl0oveLtvCzllt1Vsw0+yZ9XaLgGXoSo5c= X-Google-Smtp-Source: AGHT+IH9qH6c+uE5D7rTpZcL15JqZ+BNudgq7vqqsZepyxSSqNlsyYLjo+0/hLQXF6OoqZycQcsP+A== X-Received: by 2002:a05:620a:40d5:b0:7a3:6dd9:efa6 with SMTP id af79cd13be357-7a4ee33e36fmr32897085a.33.1723568492820; Tue, 13 Aug 2024 10:01:32 -0700 (PDT) Received: from ziepe.ca ([128.77.69.90]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7a4c7d7122bsm354386885a.40.2024.08.13.10.01.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Aug 2024 10:01:31 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.95) (envelope-from ) id 1sdutm-008ZLC-Ba; Tue, 13 Aug 2024 14:01:30 -0300 Date: Tue, 13 Aug 2024 14:01:30 -0300 From: Jason Gunthorpe To: Mostafa Saleh Cc: linux-kernel@vger.kernel.org, iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, will@kernel.org, robin.murphy@arm.com, joro@8bytes.org, nicolinc@nvidia.com, mshavit@google.com Subject: Re: [PATCH 1/2] iommu/arm-smmu-v3: Match Stall behaviour for S2 Message-ID: <20240813170130.GM1985367@ziepe.ca> References: <20240812205255.97781-1-smostafa@google.com> <20240812205255.97781-2-smostafa@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240812205255.97781-2-smostafa@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240813_100134_607943_23CFFDBF X-CRM114-Status: GOOD ( 21.73 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Aug 12, 2024 at 08:52:54PM +0000, Mostafa Saleh wrote: > S2S must be set when stall model is forced "ARM_SMMU_FEAT_STALL_FORCE". > But at the moment the driver ignores that, instead of doing the minimum > and only set S2S for “ARM_SMMU_FEAT_STALL_FORCE” we can just match what > S1 does which also set it for “ARM_SMMU_FEAT_STALL” and the master > has requested stalls. > This makes the driver more consistent when running on different SMMU > instances with different supported stages. > > Signed-off-by: Mostafa Saleh > --- > drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 5 +++++ > drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 1 + > 2 files changed, 6 insertions(+) > > diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c > index a31460f9f3d4..8d573d9ca93c 100644 > --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c > +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c > @@ -1562,6 +1562,11 @@ void arm_smmu_make_cdtable_ste(struct arm_smmu_ste *target, > (cd_table->cdtab_dma & STRTAB_STE_0_S1CTXPTR_MASK) | > FIELD_PREP(STRTAB_STE_0_S1CDMAX, cd_table->s1cdmax)); > > + /* S2S is ignored if stage-2 exists but not enabled. */ > + if (master->stall_enabled && > + smmu->features & ARM_SMMU_FEAT_TRANS_S2) > + target->data[0] |= FIELD_PREP(STRTAB_STE_2_S2S, 1); The style semes to be to just use target->data[] |= STRTAB_xx For single bit, not FIELD_PREP, even though it does work. And as Robin noted it is data[2], the naming is supposed to make that apparent with _2_ indicating the word.. But it is quite easy to make this typo. Jason