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 94D68606A334 for ; Wed, 2 Dec 2026 10:18:26 +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=WGVXx03w; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=CzSyJEni Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xYhPg-0007ON-Lc; Wed, 02 Dec 2026 05:18:13 -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 1xYhPb-0007O0-Az for qemu-riscv@nongnu.org; Wed, 02 Dec 2026 05:18:07 -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 1xYhPY-0003Q6-J7 for qemu-riscv@nongnu.org; Wed, 02 Dec 2026 05:18:06 -0500 Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6B26qFgs1566948 for ; Wed, 2 Dec 2026 10:18:00 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= NaAluRoVmlUiGBREDynUMStWhXdZw7fixPGpLcW3DLY=; b=WGVXx03wNOukXNal 7eg8bv5dhTyBkHsBftcSbZPvGLeYrDKrc6ETKHicQN2+RTsRjI0ZrltL0/dMRpi+ iNV2MPSEmUhdSEyYiM3EfnyAEjXbNaHadx3HazEhTQHtbPkBVc2PsDzIA81TZb0a e+3O5uqNE4T+SwaKhonpkWJG2zo0n60mORhsSMoYY5dzZclhGtPMhPw858Gqzf9G JTQufiYSpHI60dOBYKGjqX6EX5E94LOfloBWd72LEPeTWiH5oRkTvRueNLvQy8pc BXpeQtcRkuWw8AWbToHb2a8HZB/+2arXjYIfsti6TRmuAZQTMAilhT8Xv8cH15hh jFxCuw== Received: from mail-dy1-f199.google.com (mail-dy1-f199.google.com [74.125.82.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ja4m8b0y0-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 02 Dec 2026 10:18:00 +0000 (GMT) Received: by mail-dy1-f199.google.com with SMTP id 5a478bee46e88-382af5cfc58so6326568eec.0 for ; Wed, 02 Dec 2026 02:18:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1796206679; x=1796811479; 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=NaAluRoVmlUiGBREDynUMStWhXdZw7fixPGpLcW3DLY=; b=CzSyJEnieC0nfyLuNeiXvPONrG7M8T0JE6OQDbg7EUbImyzSgrg2rjnwQM0EsywHkG xJNroxoOT2sqBh1Ty7k5mf4Ms9piGEkbXr4a56Bi6wgXWNZv05JEzNZ32fGijx80NtmD 35wfKBjBfHI61RRq/go9ZAuilsW2x69bw2Ai0rcNtS3ILM5swgh5koMdO3xZrf2c+k80 p4qc+eBUcDXPuUsc+X4p8ScT77CaXOdmpxBZCbsjkCk5Jg4NTdGtpXTZfQRwRNQPS56B h/DbZWuXnqvGZwPVScf5F4RN6bQQINLf5iHxwlViJSHsFfGmuZoDbskTbnZtgcwbyOjS MmYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796206679; x=1796811479; 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=NaAluRoVmlUiGBREDynUMStWhXdZw7fixPGpLcW3DLY=; b=ixRzqbuowwNzpvjIM1huKlkuH7Tl9ToV8f1GmUBl+LxW7Xzg4SgMzAC5sejgb83awO 3ewowz0xgCOc/ryHibKs/fwV5PQrBfh3Opj3vt5jSTbANinbujt7UjwzAfnioVxp9Ghy KmNrbkb3krXMuu6Lto+CM2OfVKDGNQKQjAbV3moBsfzMcv0iCH4XH3ARebXmUYagWT5R 0JgbdPPc5kinEej9JxViLDrbPW+F7Q0t4A96ZJfciXTWNT1GRiTI3Orct7fklk/L1wlW 4x3/mh7dh1vvXvP+Y9yui6SFaRX3QSMPQqZid8ZnbJF5SiizTmVM6pJno2BQJIEDvOuD Bs0A== X-Forwarded-Encrypted: i=1; AL+hErHnVjX53C4ZXJAVNEeHtC90qpNqtDsGZJoahE6NcT2hTQHEQ6fOEEyYNbirsmgEOSuhGPBeSQAU6T/5@nongnu.org X-Gm-Message-State: APuU4Z/e3322NXAgJHzX/Xcgvg5CwRDtaegptfGInIkC8TH2mqnpjnQ2 j5DFkJKeqKgYP4epGB6DXRfNhIKxbfAA6IsVvgVvMsugXt58qohVTEe3OLphRfkrMLwQOrd1/i9 fSWy7IdAAQJTpzJgyhl/uHOkWhzPp3QZ5kH8LtmImxfym12PNYcPGt37zEQ== X-Gm-Gg: AZFdTZe0VFTx9mDso2xKDhvUAbj/Vd/o0o0+WoOIHu80ArPNhILONDrJafC3qGjCTnF 5VaSx/1Kbm/xAx2stV/4y+jhTioAIzGHMClMc8VSXxsNN64kIfCh0J94suiyN/2k3p4sB+uYNDW JuZJzD3yQ0PWJo0H8RowrzLvrIsscDmfSxsdKn1EudK3oyTKEQik+x55Cl8xzqIoAvFq3jjtqZA fME7dklsE2yhqTaS7BzPB9DeYwviiTIbLYr/UdA0Gvzvy/2jiyv/Q7TBdnp4+XGGiCDNRgyFEWV p/38Luxmu7QdIYkzvlZJuPg4GdqKnCX+Q/iyMI5bCOCmP2wYee9I3b3nDoEF8zlbZ4tDik9V4xh sBZLuUd4haod2kMOd+MbQNWA2zcpoj/C0+k7DK+MO00S6tLBocSgoQCBMJDgoU6rm56T6rUNBU+ Gamivs0axV X-Received: by 2002:a05:693c:87cc:20b0:358:3426:d601 with SMTP id 5a478bee46e88-3856c0d0961mr39250946eec.2.1796206679200; Wed, 02 Dec 2026 02:17:59 -0800 (PST) X-Received: by 2002:a05:693c:87cc:20b0:358:3426:d601 with SMTP id 5a478bee46e88-3856c0d0961mr39250908eec.2.1796206678445; Wed, 02 Dec 2026 02:17:58 -0800 (PST) Received: from [192.168.68.101] ([187.101.184.216]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-38566cd46c5sm148513381eec.11.2026.12.02.02.17.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Dec 2026 02:17:57 -0800 (PST) Message-ID: Date: Wed, 2 Dec 2026 07:17:52 -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: Jim Shu , Peter Maydell Cc: 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 , =?UTF-8?Q?Alex_Benn=C3=A9e?= , 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> From: Daniel Henrique Barboza Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Proofpoint-Spam-Info: AW1haW4tMjYxMjAyMDA0MCBTYWx0ZWRfX72Wj+oRQ+a9e GZLEddRFMLhuKWfBQNHM2WHCX+0Lve6wr9X8D3PEViGEBPr0WxTbgQ42c2jgTtukTyunPhUQ1g/ ewQDvG4Bsh+hFhs7KW2WcZg3jE6OZHQ= X-Authority-Analysis: v=2.4 cv=P6CvFSAu c=1 sm=1 tr=0 ts=6b0ff058 cx=c_pps a=cFYjgdjTJScbgFmBucgdfQ==:117 a=oV8YuB1CG/W4MzZqpn4HVQ==:17 a=IkcTkHD0fZMA:10 a=pUM-KoujPXoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=3WHJM1ZQz_JShphwDgj5:22 a=KKAkSRfTAAAA:8 a=pFyQfRViAAAA:8 a=6hzS8rSQS-QJ1RNth1cA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=scEy_gLbYbu1JhEsrz4S:22 a=cvBusfyB2V15izCimMoJ:22 a=oJz5jJLG1JtSoe7EL652:22 X-Proofpoint-ORIG-GUID: pRIRExV0B0yMTNEETec4pOwRKITGU4dM X-Proofpoint-GUID: pRIRExV0B0yMTNEETec4pOwRKITGU4dM X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjAyMDA0MCBTYWx0ZWRfXzGIOezPSYIbl 5NSaL1WMVTKwkfikmNbg0lqh/p5ShEB/azcY1U9rCzyClrMBsR++cb8NE8crD4jVHff5+G36wMA CiuugXXm52lmbjvGEJ/kW+aeG0y82zkHzv/dM3pywN1a7ikeiEHPAIVNpsI5IYrXg2jdLMW/FSd X/9f97As97KgwNYiKHN5HCw9qYJL4QjtaegiwOSbzdQoTgNaOKM2VmWvsv8HZ346jfs7eojpK8H 0036LJSLprPIQN8YNRRdJb3F6gfWDD6pJt2/b4Ug+SZO24Z8sj5FoXpEOuch7zhwD+ug5G8Px23 QZ1M3plyTQLw3rmbAjuTdWPxJztCh3vEgk9QbrbahH6N9yJBHDBdheiOhfClrtp0ECmPAQygEdR SEsUSU43ar5hxTWLVQ7BF1qhxIhBrRNtj/hxkk741te7BSxZwQQyelnS86Wytvk/JyBR9Vw0Or8 89jYEihYK1Yl3GWOd8g== 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_02,2026-12-01_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 lowpriorityscore=0 adultscore=0 clxscore=1015 priorityscore=1501 bulkscore=0 malwarescore=0 spamscore=0 phishscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2612020040 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-riscv@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-riscv-bounces+qemu-riscv=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 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? 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