From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A8FE7606A32D for ; Thu, 3 Dec 2026 15:47:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=pU3ridhO Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xZ91j-0003Qf-3u; Thu, 03 Dec 2026 10:47:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xZ91f-0003OV-E0 for qemu-arm@nongnu.org; Thu, 03 Dec 2026 10:47:15 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xZ91d-0001iJ-CU for qemu-arm@nongnu.org; Thu, 03 Dec 2026 10:47:15 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-4a018493d57so75025e9.0 for ; Thu, 03 Dec 2026 07:47:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1796312830; x=1796917630; darn=nongnu.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=zOBAGSygbgqjBaMkpnYce6ojy/mfsafaipFMYKRnMHQ=; b=pU3ridhO09dPsY9VnSXv8AM4EI2dXYQSnH2b/hiW06AnlD0+oil8aial2uofKU3D+X PJD/3iHMUN/k+BNHzMbZsLkYQH3ETnbaKeo1EN5lmQlIKx/aUZ3F6lDnnQ6vN6uxnu3O OLiasbiwi9Iw5wQqwSPxKBvhy3ih0R6MB/ChL7ptdIz/VBZ1pQXgwfb9QzcxCl45sA1L w8DXEdAWKCpcY3pyeoLBJKm8bCmNM60HevgMEErm3/vfztzHyZEw/z4PUAP4V5C9uoFy SjgTT38xw3tVqRhjFP9V0ubwZmNJ+odDDoRVeRxmO9V2J+KNjXlFgPQKp+kyltTLIaFG vwlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796312830; x=1796917630; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=zOBAGSygbgqjBaMkpnYce6ojy/mfsafaipFMYKRnMHQ=; b=zRVz/YcF0H2gQHIrv47iKoRynTCwNyQb9ZRic+rrbYYqXxI0Rdgdc+LkMnrnGuhOMt fMiFjMlPOtNuQojKqgyk3jkLxbPgqLf6SLm76xREHDkFvMvryUas7JYeDDc1tceF1q7k WEJBpaCeVcLhGSqLXyC+f7aTuxSvalvRI+eQvZdzJUOLCJTQiFYcOH9LFq2VbBA5NUJQ MZ94wLpBaYTcb/HnSY0XVyYPhhemQGS0P4ZglJXe5t8gwSBoMcJpiWQRfCrznjzbEOw2 Rx1xLcHEhhLTRyZ6kIi9zkyvWyqK43YWQ/1chF4DxBC9u1jnzYFjafRwIYm+mV+1tNn9 CsaA== X-Forwarded-Encrypted: i=1; AL+hErGxcimO772iFkDpvVF0OhSc3xSqDvSIRCOw+r7CO90Zwm4g7Ppy7L2eU2rH/KHmgynSZiIxJPbJ8g==@nongnu.org X-Gm-Message-State: APuU4Z/s25PKFkdu5006jLvglCLRpTR5CZolwsVUYsgk2zqxaqD4Jy5Q XE2b2iBnr1Qg3FRi6eCsQJGrCf42Vf8GDZWoFKzooMkiafsK6P70gnnoIxnOAn1JEg== X-Gm-Gg: AZFdTZczBoKx2YXeVWc5Qu3WC/+TTWxJ+D0896xIcKY7f/81V6oHlh+tMFTyLEXma+9 Z63/ALawqx1jnZk+eh2Q5zzXXYFLmrghkHEl78RoGIe6FJDofbif2QSoBBVg8KONG4aKMgYTprX Q9EgeB2VjkOotiobmQsHKJXk3blC/8Z6o8XqqzNfDDUqEQP/SR+30y62nu99CQdBH3/5VVbhH5O 6rbda7EG4tXgrCCEGMqTjpDpUSLM/f+/6AFAabTdsCTD0UnUZfdHgjoWfHbLjM0IJe2HCycTn28 XJ5oWM6gbJcUVIQH/M3aHb0pCF1sfmKkGbd2uS3DbQmJG4HWSmMHpAeRfzvO3W+c2XgFHD5yS9W uu53RLQeHBfOHLRGAkbqZ7p9LUmMzwh+28Jmti6neyuAGpPltl7JZ9BpPYgzUwxONlGVN9kLcpb iBDeZ8JBH/Bnl3vZa+geZKpLOherjYd3KVkhxvIlJ4ElTOtTCYqRcdLE2I2CFKm6HoBQJfyj3d2 8jNm8v517dxInoNYYsBi2XzErUImYs8ZvsWZ/c2uy3OKFwyl7HGmQRU12XiMqG8NuTWrnRUgoum rdpvGNCbimE/rI9vjFbYeqOFY6JR/bylVPjHtDI/SRXLxgaSZuGzlYl0tMrsgAiTGm96jBPu1Rg Kq95zhjPhqXCV09w= X-Received: by 2002:a05:600c:a00f:b0:4bb:bd37:251f with SMTP id 5b1f17b1804b1-4bbe25117bdmr783235e9.5.1796312829517; Thu, 03 Dec 2026 07:47:09 -0800 (PST) Received: from google.com (160.193.189.35.bc.googleusercontent.com. [35.189.193.160]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bb906635c7sm828010955e9.2.2026.12.03.07.47.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Dec 2026 07:47:08 -0800 (PST) Date: Thu, 3 Dec 2026 15:47:04 +0000 From: Mostafa Saleh To: Tao Tang Cc: Peter Maydell , Eric Auger , Philippe =?iso-8859-1?Q?Mathieu-Daud=E9?= , qemu-devel@nongnu.org, qemu-arm@nongnu.org, Pierrick Bouvier , Chao Liu , Chen Baozi , Jim MacArthur Subject: Re: [PATCH v6 06/35] hw/arm/smmuv3: Plumb transaction attributes into config helpers Message-ID: References: <20261114154623.3599750-1-tangtao1634@phytium.com.cn> <20261114161610.3642721-1-tangtao1634@phytium.com.cn> X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261114161610.3642721-1-tangtao1634@phytium.com.cn> Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=smostafa@google.com; helo=mail-wm1-x334.google.com X-Spam_score_int: -144 X-Spam_score: -14.5 X-Spam_bar: -------------- X-Spam_report: (-14.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, ENV_AND_HDR_SPF_MATCH=-0.5, FSL_HELO_FAKE=3.099, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5, USER_IN_DEF_SPF_WL=-7.5 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-arm@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-arm-bounces+qemu-arm=archiver.kernel.org@nongnu.org X-Spam-Status: No, score=-23.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On Sun, Nov 15, 2026 at 12:16:10AM +0800, Tao Tang wrote: > Introduce helpers that derive MemTxAttrs and select an AddressSpace from > SEC_SID, then pass SEC_SID through the Stream Table and Context Descriptor > fetch paths. This makes reads of SMMU configuration structures use the > corresponding Non-secure or Secure memory context. > > To support these helpers, include hw/arm/arm-security.h from smmu-common.h, > making the Arm security-space definitions available to the common SMMU code. > > The accelerated path remains Non-secure-only and therefore passes > SMMU_SEC_SID_NS explicitly. > > For now, the configuration cache lookup key remains based solely on the > SMMUDevice pointer. It is extended with SEC_SID in a later commit. Other > SEC_SID-sensitive memory accesses that still use the Non-secure address > space are converted in follow-up commits. > > Signed-off-by: Tao Tang > Reviewed-by: Pierrick Bouvier > --- > hw/arm/smmuv3-internal.h | 3 ++- > include/hw/arm/smmu-common.h | 10 +++++++++ > hw/arm/smmu-common.c | 27 ++++++++++++++++++++++ > hw/arm/smmuv3-accel.c | 2 +- > hw/arm/smmuv3.c | 43 ++++++++++++++++++++++-------------- > 5 files changed, 66 insertions(+), 19 deletions(-) > > diff --git a/hw/arm/smmuv3-internal.h b/hw/arm/smmuv3-internal.h > index 202cd533636..1f2f426da01 100644 > --- a/hw/arm/smmuv3-internal.h > +++ b/hw/arm/smmuv3-internal.h > @@ -367,7 +367,8 @@ typedef struct SMMUEventInfo { > > void smmuv3_record_event(SMMUv3State *s, SMMUEventInfo *event); > void smmuv3_propagate_event(SMMUv3State *s, Evt *evt, SMMUSecSID sec_sid); > -int smmu_find_ste(SMMUv3State *s, uint32_t sid, STE *ste, SMMUEventInfo *event); > +int smmu_find_ste(SMMUv3State *s, uint32_t sid, STE *ste, SMMUEventInfo *event, > + SMMUSecSID sec_sid); > > #define STE_SIZE 6 > #define L1STD_SIZE 3 > diff --git a/include/hw/arm/smmu-common.h b/include/hw/arm/smmu-common.h > index 9d6e2d3038f..a31ffcf6e71 100644 > --- a/include/hw/arm/smmu-common.h > +++ b/include/hw/arm/smmu-common.h > @@ -22,6 +22,7 @@ > #include "hw/core/sysbus.h" > #include "hw/pci/pci.h" > #include "qom/object.h" > +#include "hw/arm/arm-security.h" > > #define SMMU_PCI_BUS_MAX 256 > #define SMMU_PCI_DEVFN_MAX 256 > @@ -47,6 +48,9 @@ typedef enum SMMUSecSID { > SMMU_SEC_SID_NUM, > } SMMUSecSID; > > +MemTxAttrs smmu_get_txattrs(SMMUSecSID sec_sid); > +ARMSecuritySpace smmu_get_security_space(SMMUSecSID sec_sid); This is only used by this file, it should be made static and the header declaration removed. > + > /* > * Page table walk error types > */ > @@ -200,6 +204,12 @@ SMMUPciBus *smmu_get_sbus(SMMUState *s, PCIBus *bus); > /* Initialize SMMUDevice handle associated to a SMMUPciBus */ > void smmu_init_sdev(SMMUState *s, SMMUDevice *sdev, PCIBus *bus, int devfn); > > + No need for double blank line. Otherwise, Reviewed-by: Mostafa Saleh Thanks, Mostafa