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 F3086606A31A for ; Wed, 2 Dec 2026 11:48:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=XmkkUiq0 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xYiol-0004ws-Jl; Wed, 02 Dec 2026 06:48:11 -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 1xYioi-0004wZ-9K for qemu-riscv@nongnu.org; Wed, 02 Dec 2026 06:48:10 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xYiog-0006uR-CK for qemu-riscv@nongnu.org; Wed, 02 Dec 2026 06:48:07 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-4a35a60499eso100729135e9.0 for ; Wed, 02 Dec 2026 03:48:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1796212083; x=1796816883; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:message-id:date :user-agent:references:in-reply-to:subject:cc:to:from:from:to:cc :subject:date:message-id:reply-to:content-type; bh=+H24lkpNJ+tfyxbusKvzSNN/21jOd/4sIO3Rv0by6K8=; b=XmkkUiq0NIk6/tOTfg+u+SQ8O+CchseG+JYA3oCnUUJIuYCDZbs5dVN8zpA7CV9M+p J12An04Qx8v0V/0s5HbUXvV0+MgtSqixIo0GyaC1lzJ+UMV1n7f/8VNt7yz0IS5VDI6G qY6IhFFP01rUt3U8LqY8qJGuLFejYtlfKzgOFU8gysHXWt+Blxni+pyoVkTAUNrNtzBX N3mAuOpgNsCPMPgG1TOQeyeMacrRrqxaAZO4muuOwaRt6pT5hUJ7VYDnizeS7J7wXNyH OH3swCRXZQqyiX47z4OY2pLxZfGRqPOm0gJQzO0FMvJqn7qcewBip+Bc3ntuz2aRncOG GOiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796212083; x=1796816883; h=content-transfer-encoding:content-type:mime-version:message-id:date :user-agent:references:in-reply-to:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=+H24lkpNJ+tfyxbusKvzSNN/21jOd/4sIO3Rv0by6K8=; b=D9NaEFrAPoAYh/Fh0t9KHln60DTPqThWmYqDu7mbcdPL5kxoS928Mb/lHz2wpkq9ZW L7WRWpJEo83z2lmuyyPd42fARwx4jr/VXPJdKLbXBgnvM9MBvYV56tRU5Ynr0KXJIrAS c2Lk+AllksPu5hiRzMKwfSpUL6fuQQxQYai8hnLQ8g7CGsPPsUYfeTh3iAPH7uZuX/wG Vt9Ef9KrtKgV5PMVM6fM65P4E761USojuLRoQRLnDS+5w2fRfyYZfhddWTrCpq5x1SKJ VqUaGk1KIy91Q4GRyRDLlAepU8QDz3qh4fb8p26qGOBM6mLhkwqTbRzdGnEAGb3RM2+y JUDw== X-Forwarded-Encrypted: i=1; AL+hErGscW7eqXcC1QbaNSQO/tBH0m2nNC8clyPWfxNC7jMqKU04b+ffBKWxdE8P/D/YRIeAuLskFAQwzDja@nongnu.org X-Gm-Message-State: APuU4Z/MFlggtGxhFFIG5jqG5EKNLoUZLLIbBiOQ1Bb02oU7LdL2TBHS D5JQz5xLXX/ozFANCQInYO/Kz0imLqFu6OdHlrIwbd+eFwZKV8BD7oEto1nVR3xB4w0= X-Gm-Gg: AZFdTZfFFEqgmpW9vp9IuKT7Mp4X1Dn2WFjdGdWLxx60joUWo01nJvB61lfPOcFG4CP 6i4Ci7GZH+3OSlAZ35cpzlOt6sNbjz9xUs6+BpaVSKMkgPkVrmcG+A3Bwqhcapvb0F+A1ekGWKg h1vl+HKcot4a93Oegb5qTZeRA0P9eHKuZWRybDNHB4TjYF7VOt3i2D1fKO8pcnkezzhI+IG9cBZ Vxnl+TrWwzC+LwHpbtipJ2Dl4SBplcraUayfGE+3u3JBCjxmNWNyOwhjMQAuBefW3Zh34SY/eqf RWCT86l7misxXMEu4ChqbWQOCiTwxWcX3lPI0297Hoc7SltJZMY0NgA9Tgb9b8/eyrsVEAOAdio lFf+avglF8b6Jad1Otru1w8+8wVlqnG8KDwC8Qqt8jDc9YglhZOKlBpLD6I1sD7i9nSG0qDqde4 0g/0xZiDiV7Pte/MX6uD387P/GSWxQ9KQCdtrUHjYY14HyHMhMkub9IQygeqAtY4e7rs6N2t8u5 YJQ4c2fqSHwR3BEqlmxc9Cou3hL154S62WIZhSjkJpf/EmbmCGxCvoKxgil2S65J5i/qJ4B9lKa XoZ05ubvDGRsxNluvNGuFlgUa3T9 X-Received: by 2002:a05:600c:3547:b0:4a2:a6e:80f5 with SMTP id 5b1f17b1804b1-4bb888098bfmr807446645e9.11.1796212083449; Wed, 02 Dec 2026 03:48:03 -0800 (PST) Received: from draig.lan ([185.124.0.158]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bb8849e598sm1112254595e9.8.2026.12.02.03.48.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2026 03:48:02 -0800 (PST) Received: from draig (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 9ABCD5F9CE; Wed, 02 Dec 2026 11:48:01 +0000 (GMT) From: =?utf-8?Q?Alex_Benn=C3=A9e?= To: Daniel Henrique Barboza 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?= =?utf-8?Q?=C3=A9ment?= Mathieu--Drif , Paolo Bonzini , Zhao Liu , "Edgar E. Iglesias" , =?utf-8?Q?Cl=C3=A9ment?= Chigot , Frederic Konrad , philmd@mailo.com Subject: Re: [PATCH] exec: Add RISC-V WorldGuard WID field to MemTxAttrs In-Reply-To: (Daniel Henrique Barboza's message of "Wed, 2 Dec 2026 07:17:52 -0300") References: <20260209115846.2276651-1-jim.shu@sifive.com> <7be3b4f7-7516-40ab-8a95-b3b4a2aea095@linaro.org> <08c5f243-5aaa-4fe2-bc71-6a3fd9a1914e@linaro.org> User-Agent: mu4e 1.14.5-pre2; emacs 30.1 Date: Wed, 02 Dec 2026 11:48:01 +0000 Message-ID: <87jylr3nv2.fsf@draig.linaro.org> X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x335.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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=-5.8 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 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 Daniel Henrique Barboza writes: > Hi everyone, > > > Sorry for arriving 5 months late. From what I read from these discussion= s this > patch has no blockers and all we need is probably a rebase and a resend a= s 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? > > Thanks, > Daniel > > > On 7/21/2026 3:36 AM, Jim Shu wrote: >> On Fri, Jul 17, 2026 at 4:59=E2=80=AFPM Peter Maydell wrote: >>> >>> On Thu, 16 Jul 2026 at 04:12, Jim Shu wrote: >>>> >>=20 >>>> >>>> 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. >>=20 >>>>>>> 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 --=20 Alex Benn=C3=A9e Virtualisation Tech Lead @ Linaro