On 9/7/26 12:25 PM, Tao Tang wrote:
> Hi Mostafa, Eric,
>
> On 2026/9/1 22:01, Mostafa Saleh wrote:
>> On Fri, Aug 14, 2026 at 12:24:43AM +0800, Tao Tang wrote:
>>> Pass sec_sid into decode_ste() and treat a secure STE that enables
>>> stage-2
>>> translation as an illegal STE.
>>>
>>> The current model does not implement Secure stage-2 translation, so
>>> reject
>>> Secure STE configurations that enable stage 2 and report BAD_STE. This
>>> restriction can be relaxed when SEL2 and Secure stage-2 support are
>>> implemented.
>>>
>>> Signed-off-by: Tao Tang <[email protected]>
>>> ---
>>> hw/arm/smmuv3.c | 12 ++++++++++--
>>> 1 file changed, 10 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c
>>> index b5dc67dcb01..3ff2f498a3b 100644
>>> --- a/hw/arm/smmuv3.c
>>> +++ b/hw/arm/smmuv3.c
>>> @@ -597,7 +597,7 @@ static void decode_ste_config(SMMUTransCfg *cfg,
>>> uint32_t config)
>>> /* Returns < 0 in case of invalid STE, 0 otherwise */
>>> static int decode_ste(SMMUv3State *s, SMMUTransCfg *cfg,
>>> - STE *ste, SMMUEventInfo *event)
>>> + STE *ste, SMMUEventInfo *event, SMMUSecSID
>>> sec_sid)
>>> {
>>> uint32_t config;
>>> /* OAS field only presents on NS-IDR5 so we use hardcoded
>>> SMMU_SEC_SID_NS */
>>> @@ -651,6 +651,14 @@ static int decode_ste(SMMUv3State *s,
>>> SMMUTransCfg *cfg,
>>> if (ret) {
>>> goto bad_ste;
>>> }
>>> +
>>> + /*
>>> + * It is ILLEGAL to set STE.Config == 0b11x according to
>>> (IHI 0070G.b)
>>> + * 5.2 STE, Stream Table Entry, Page 218.
>>> + */
>> This is not the latest spec, and there is no need to mention the page.
>> It might be more clear to mention that Qemu doesn’t support secure
>> stage-2 rather than say it is ILLEGAL.
>
> Agreed. I'll change the comment to say that the model does not support
> Secure stage 2 translation, and remove the spec version/page
> reference. I'll also clarify SMMU_S_IDR1.SEL2 in the commit message.
>
> @Eric, I've replied to your questions about the S2 plumbing and the
> temporary SEL2 override in the threads for patches 6 [1] and 28 [2].
>
> [1]
> https://lore.kernel.org/qemu-devel/[email protected]/
> [2]
> https://lore.kernel.org/qemu-devel/[email protected]/
>
OK thanks!
Eric
>
> Best regards,
> Tao
>