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 6A4A4606A31A for ; Wed, 2 Dec 2026 14:58:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=jNjaW2fS; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=G5My65FF Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xYln1-0007p1-CC; Wed, 02 Dec 2026 09:58:35 -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 1xYlmo-0007mD-Cp for qemu-devel@nongnu.org; Wed, 02 Dec 2026 09:58:23 -0500 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xYlmm-0000Tk-9d for qemu-devel@nongnu.org; Wed, 02 Dec 2026 09:58:22 -0500 Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6B2EQF1Q1708454 for ; Wed, 2 Dec 2026 14:58:15 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 1vjJ/1CUMs+DW75Vvr+NnmKINV/BvowHAgdlrjdPKqo=; b=jNjaW2fSKaPBqRdv 1N0sQmwV+7QDYfgoiQB+51bEIUbCfWmSN3zg+lrOfjyErhJiXN+uBlnULqBHianT SPy3TLgRVbEkv8h5hXwUNjtHLgdI/tbwPKxkoidfssXumkRxrVHiNDdMcSkWvaeX +yIRLzqbFZ2W4+gxWRip4GRvD3hVYMdcyX8zHaT/p+8XiqV5CZZOR7r/lQo8jwj4 OOSTLOfhOY6fqqMyszhE+9TUnkRWi++TGjA7SxKXNdR+YpXJS9WiMecdRa6w/RHS 4RxYFbmTACewWFNRfxlFQBY13DVO8/YwHN14dX1beFwLa+dsGtFQUONOM5lNJ6aY RNBa8w== Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4jamykg7a8-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 02 Dec 2026 14:58:15 +0000 (GMT) Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-2f02c63901aso120890385ad.3 for ; Wed, 02 Dec 2026 06:58:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1796223495; x=1796828295; darn=nongnu.org; h=content-transfer-encoding:content-type:in-reply-to:content-language :from:references:cc:to:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to:content-type; bh=1vjJ/1CUMs+DW75Vvr+NnmKINV/BvowHAgdlrjdPKqo=; b=G5My65FFAK2TatwznPaLqEJ/b52L4R0dI+ZI6Xwz9/Uud38w02zsFckqon2DzL3ba5 8SEwg/znXsXoLEfdIzm8XF99AEt7bAbiN5Ed7eY6VBiJW/MB2+lQtAN3IMMGAbB3jYdi CcVYsQsa2S382l6+aMaIuoz7kMkiu9ejtyngRvjuoKQ9SxEVogk6YatiwnyB/F0Mgemn vB66zOnh2yaHpf0mjrhrVpFllTMByIVUzBVxWFdsCXYQzpCCGfblhdVaJky+iWta9ngd TW9pz+gOsavQ1CYmBo9Yw2+c4ZIIqzd0kQLR14xTJ2LwlaSq+Pzd1Ob6PfMw2bfx8pIW KD4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796223495; x=1796828295; h=content-transfer-encoding:content-type:in-reply-to:content-language :from:references:cc:to:subject:user-agent:mime-version:date :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=1vjJ/1CUMs+DW75Vvr+NnmKINV/BvowHAgdlrjdPKqo=; b=WPd8UO/7ZzxtK1y3Sr92rN/6g97iHNd6qbe7pTL960i/SnWmHqgTw8K8ZgaQpvWdHY KwpVuqH1h7UR9TrcEsXKrs4s3AN6huPqr9M5lfykSxrPboJ8a4so7DqkZSVl4faiBQ7V zSpJnLeNuMzx3FORrIBGHYEICLjnrTyFmauBjdkEIk1zQqa35jMEMks8RrEwaqSkjVzn 0TvRI0j/pDY2rD/VikDixIw0dthl+TaChr4kMXKV+L5Y3wuNKrc3dmnWDbXmIiNwSy6J a1IILuSalJBjFqxmo6yYTIrCv8uxcDJxRBiHtz+odxLEet3uRwqtCkmj07l1LQxD5mQB IT8g== X-Forwarded-Encrypted: i=1; AL+hErGtE9z/U3Blj+Jt+F/5Wno18TFHE3X3m7twQWFtmKeJs9WFgOxE2QntBau+orLzZEHyhqDH318xyOCq@nongnu.org X-Gm-Message-State: APuU4Z8NGBrpst46wT9X82tDdC58zzYFiVR6ykrbNo+mVTR6jwhp30xW A+dipAppNSU6XAFsuwJxFssJwfl11Imuebgy5zbfIknYquyxCjm/TsuJRO/Q9oDZ3suBhogDoJ/ M+nvH1RO4fvaO3RzasRlbdHEeTcLKnzTWe4AZQR4UpC5cwpLzYTG8MqqAaw== X-Gm-Gg: AZFdTZeQq/tjWo4LlgbAWqyjgzA9XS/C5gcbqMk7/xcOFTEtBkx8SHoMkXVwS9iSINk u1kxsrUHiZ1E7kAB8nyk0+vJaIVLkCWsJIRP0GZxzPUdCdDFw+ojrkkaQO0kY+d+pcqAnrqoo0u dPvkAImlxrNaKkyU8mEk4lNmapddk7BEZ60Xy1XsE9cunPhpOjhcxcVVo+4+1QanW36u8COBGI0 BSTLGbiMRk6uKLX2iKj4bHm8NvkK+LcGPWuodHIex5zjV7mZdkr/AtHpZn9E4X+RQ/rRl/+aEB0 LCAbKr1gQmnoxjGYyC7ncrObahSoW6IEb1HHYLpMSJubU1TqdfJGrPqD1qx1GhZ4FSvluTKrVC2 gm6KDHNXK38T453XzqfvQURL0RWF5xePspOg14FCnPdqjbkURkVJm2nQKf54ml4Z3YGr0hIiszt 54YyZDE54E X-Received: by 2002:a17:902:f603:b0:2ef:a639:8b2e with SMTP id d9443c01a7336-2f03f1aff83mr442521875ad.33.1796223494540; Wed, 02 Dec 2026 06:58:14 -0800 (PST) X-Received: by 2002:a17:902:f603:b0:2ef:a639:8b2e with SMTP id d9443c01a7336-2f03f1aff83mr442521375ad.33.1796223494018; Wed, 02 Dec 2026 06:58:14 -0800 (PST) Received: from [192.168.68.101] ([187.101.184.216]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2f03ee85466sm200457255ad.4.2026.12.02.06.58.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Dec 2026 06:58:13 -0800 (PST) Message-ID: Date: Wed, 2 Dec 2026 11:58:08 -0300 X-Archived-By: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] exec: Add RISC-V WorldGuard WID field to MemTxAttrs To: =?UTF-8?Q?Alex_Benn=C3=A9e?= Cc: Jim Shu , Peter Maydell , Richard Henderson , qemu-devel@nongnu.org, qemu-riscv@nongnu.org, "Michael S. Tsirkin" , Peter Xu , David Hildenbrand , =?UTF-8?Q?Cl=C3=A9ment_Mathieu--Drif?= , Paolo Bonzini , Zhao Liu , "Edgar E. Iglesias" , =?UTF-8?Q?Cl=C3=A9ment_Chigot?= , Frederic Konrad , philmd@mailo.com References: <20260209115846.2276651-1-jim.shu@sifive.com> <7be3b4f7-7516-40ab-8a95-b3b4a2aea095@linaro.org> <08c5f243-5aaa-4fe2-bc71-6a3fd9a1914e@linaro.org> <87jylr3nv2.fsf@draig.linaro.org> From: Daniel Henrique Barboza Content-Language: en-US In-Reply-To: <87jylr3nv2.fsf@draig.linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Proofpoint-Spam-Info: AW1haW4tMjYxMjAyMDA1OSBTYWx0ZWRfX4zAciYGxU8Rn WIvEKZhjeL9XDObQM6dcnDDlZPSQzxgXsVblfQJhOXL94bjHfJwX5WNmUZQ9LFgKiiEc93iRmOE I0WUED10ATFq7qikDfmVHbCxzA6D8Is= X-Proofpoint-ORIG-GUID: uFQlamSPV21sNaemLdJTo1SxD7nb_poq X-Authority-Analysis: v=2.4 cv=R7WWitRX c=1 sm=1 tr=0 ts=6b103207 cx=c_pps a=IZJwPbhc+fLeJZngyXXI0A==:117 a=oV8YuB1CG/W4MzZqpn4HVQ==:17 a=IkcTkHD0fZMA:10 a=pUM-KoujPXoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22 a=EUspDBNiAAAA:8 a=KKAkSRfTAAAA:8 a=pFyQfRViAAAA:8 a=dCZIKzRbdA-MD7N1i-YA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=uG9DUKGECoFWVXl0Dc02:22 a=cvBusfyB2V15izCimMoJ:22 a=oJz5jJLG1JtSoe7EL652:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjAyMDA1OSBTYWx0ZWRfX0nxmD3nTN+ho VtEn11/+HCGo2G9ZWBZUmdf1J5g9Thzn9X0hcOTCOgoNYFko1Y+GIH6k83T1BATZVsWBFtoC+jB NYY81llG6abrkv0FxE9BwJQxGF+nd+pynIqfE9jkqP+Exnm2sDTXboaZbmH0wod7EPJPaEoPx1Z twZLXSC7CcpjZE69X++j9nojoNKnpFNkT6SelmKYmiaxR5QHkQMy1arwMvPsLaGg0VwE/rCv/Fx fBwAaeJAqNLfHI4grBJzJHKBqdvQ70lAw1t8CjGELu79cmmE4qy1KwaWVBz9wyaFU84yZvtOTQZ l/8OFpF3DImU92ynoirim1V4/YSGSuUbxAsQHGWp2ue55Hm6ljy/OArluSkL7Y/+LjsNRVvDE1E pkaMmdge/4K3z1mtZs2hqtkRiNbjYyS9NW28HnZs6cS2Q6nfna1vs/ZL5deZjyRuFKcwiYc7Fef 3OPwWmGjwyH/W6u970w== X-Proofpoint-GUID: uFQlamSPV21sNaemLdJTo1SxD7nb_poq X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-12-02_04,2026-12-01_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 suspectscore=0 priorityscore=1501 malwarescore=0 bulkscore=0 lowpriorityscore=0 phishscore=0 spamscore=0 impostorscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2612020059 Received-SPF: pass client-ip=205.220.180.131; envelope-from=daniel.barboza@oss.qualcomm.com; helo=mx0b-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org X-Spam-Status: No, score=-7.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 12/2/2026 8:48 AM, Alex Bennée wrote: > Daniel Henrique Barboza writes: > >> Hi everyone, >> >> >> Sorry for arriving 5 months late. From what I read from these discussions this >> patch has no blockers and all we need is probably a rebase and a resend as soon >> as the next merge window opens. Is this a fair understanding? > > I think the general idea is ok, did you get a chance to look at my > previous approach that I mentioned up-thread? I did. Seems like we can use that MemTxRequesterType approach, or something close to it, to handle this WorldGuard requirement. Jim, care to comment? Cheers, Daniel > >> >> Thanks, >> Daniel >> >> >> On 7/21/2026 3:36 AM, Jim Shu wrote: >>> On Fri, Jul 17, 2026 at 4:59 PM Peter Maydell wrote: >>>> >>>> On Thu, 16 Jul 2026 at 04:12, Jim Shu wrote: >>>>> >>> >>>>> >>>>> Thanks for mentioning it! I think re-use requester_id is better. >>>>> Then, I think we only need a boolean flag `src_is_cpu` and we can >>>>> rename it to `requester_is_cpu` to match the naming of `requester_id`. >>>> >>>> But, what do you now want it for? If we put the world ID in the >>>> MemTxAttrs, do you still need a CPU ID? (There are some situations >>>> where it might be useful, but if we don't need it right now we >>>> shouldn't put doing that rework in the path of implementing >>>> the worldguard work you want to do.) >>> Yes, Adding the world ID to MemTxAttrs is totally enough for me and >>> the worldguard patch series. >>> I just explain the idea if someone still wants to use CPU ID. >>> Sorry for the confusion. >>> I will try to add a field that combines ARM secure/space and RISC-V >>> World ID bits in the next series. >>> >>>>>>>> The whole plan is to add the following 2 fields >>>>>>>> :: >>>>>>>> unsigned int src_is_cpu:1; >>>>>>>> uint16_t src_cpu_id; >>>>>>>> >>>>>>>> src_cpu_id is the CPU ID from 'CPUState->cpu_index'. src_is_cpu is a boolean flag to check if the transaction is from CPU. >>>>>>>> >>>>>>>> Moreover, I think this idea is extensible. DMA device >>>>>>>> transactions can also have security attributes like world_id. >>>>>>>> We can also add src_device field to 'MemTxAttr' to store the >>>>>>>> 'DeviceState *', so we can get the DeviceState from MemTxAttr >>>>>>>> to get security attributes. If 'DeviceState *' is too large to >>>>>>>> add to 'MemTxAttr', re-use requester_id as DMA device ID is >>>>>>>> another possible method to support this. >>>>>>> >>>>>>> I don't think that having the thing that receives the memory >>>>>>> transaction get or get hold of a pointer to the source of the >>>>>>> transaction that it then uses to get the world ID is a good idea. >>>>>>> (Especially not putting a DeviceState* into MemTxAttrs: the >>>>>>> size of the type needs to be kept small so we can conveniently >>>>>>> pass it around by value: we currently assert that it is 8 bytes.) >>>>> >>>>> OK, I think store the DMA device ID in the `requester_id` is another >>>>> way to keep the small size. >>>>> However, IIUC, the current SysbusDevice doesn't have the concept of a >>>>> device ID. We need to add an additional device ID to the device to >>>>> support this idea. >>>> >>>> What exactly is it that you need a device ID for? Earlier you >>>> suggest that you would want it to get the world ID -- but we >>>> should just put the world ID directly in the MemTxAttrs. >>> Same as previous responce. Adding the world ID is enough for me. >>> Sorry for the confusion. >>> Thanks, >>> Jim >