Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 44479C678DC for ; Wed, 11 Jun 2025 13:18:23 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.1011721.1390169 (Exim 4.92) (envelope-from ) id 1uPLL7-0007uN-N3; Wed, 11 Jun 2025 13:18:01 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1011721.1390169; Wed, 11 Jun 2025 13:18:01 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uPLL7-0007uG-KY; Wed, 11 Jun 2025 13:18:01 +0000 Received: by outflank-mailman (input) for mailman id 1011721; Wed, 11 Jun 2025 13:18:00 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uPLL6-0007uA-0r for xen-devel@lists.xenproject.org; Wed, 11 Jun 2025 13:18:00 +0000 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [2a00:1450:4864:20::435]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 7dca2e23-46c6-11f0-b894-0df219b8e170; Wed, 11 Jun 2025 15:17:57 +0200 (CEST) Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-3a54700a463so664030f8f.1 for ; Wed, 11 Jun 2025 06:17:57 -0700 (PDT) Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de. [37.24.206.209]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7482b083ae1sm9109663b3a.74.2025.06.11.06.17.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 11 Jun 2025 06:17:56 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 7dca2e23-46c6-11f0-b894-0df219b8e170 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1749647877; x=1750252677; darn=lists.xenproject.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=XcFxeSfuko84GH6tSOHY91XfHiENIfUGAW0GnF0KzK4=; b=hAfJb+lwP7jOdU2PLu7lBkG32f6ZvUYz8ROR5nChk6a6EVoeC9KDg1z9oueBpE5fgT lZHRnW46EdYdLljmuGF9RHwnNfQJkiBkS6oSkeCU7cHYy30TrKHNUoSqsfr2fL91nvWn 6B0xEjqG95DIDuaI7kdbh5oylb5JElt+8jgpqRnYyOn2UB/wZmTph+h4QlFodMpOLWay UB2DlQzCdy/vDXUCkmP3/tNM147FrTE1UNRmF/CTydWx6Jr5D4H/dlDwMxjAB7lD6Khh fhA3gSSVihAK2ooV9gP84RcDqbrJVyeQ3IKc7zOQNB4uwDeiGBlJgBn/idUGiVDIqwKk qFHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749647877; x=1750252677; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=XcFxeSfuko84GH6tSOHY91XfHiENIfUGAW0GnF0KzK4=; b=qG7BoSCAgXTfjwlBp6cMIhRgQyB3XkkT/OhrXkLavEFBGVgilYJAM2dBy5SV+bO3Qk ZZ6m3sDepEMlBZZ/RVQBI0MgIpH+u7JaDEd4u/yHNR+ssYXMNVIy9q0MY+jFk/aQuRBr 9lAufWiSGQd+pauBZJQL9r0UDNCFi/0F0R2x4BXzlSR8BMqb4Cr2j2f1K+wOJkShxd+5 HTpdmEdM95KcttIsDZZqHlXlzQy1Jwfoqu8QvAmWPQsxDFgxyassu6YRoi775KSTz0wN xTnba8SzCfEMxmdWbBoHIQ9NMZgsGh3FlDIP7FQI61ks98IjFtZTAh9UxY5vFpDiEkcX dwUw== X-Forwarded-Encrypted: i=1; AJvYcCU9waOQXbBPOMAZx4/XpnNQSSkvnlUGLkRLeQkTHy4JGfdUhQmfvksSMMA39kBVO+kkFRGg8aPAGgU=@lists.xenproject.org X-Gm-Message-State: AOJu0YxzvMDzKFa/cVyNacaz3eVDHeYr9nd5+KHvaGfZXYBNv59h3Q8I DeX4H0xglZMZTkasliUE/ZWJxg8XV5Ei/FdckOmGjylPidWcBjkwxE4MDzaXsZorNA== X-Gm-Gg: ASbGncsU6gvNOf+6VtCpViPYaeepI47+6k8Bp0hZxEfLHbBXHHxr7gozu/uav3hmyLW vW6UkqG+uZjvp4Sn17qJAUv3u4e3gt0GFwMz7NA80FzWG1cqTZ35yI0I/Fo3y3ppLhQrJabq/r8 SMpQzjwvt/UQOA/t/VMoxjCIyOS3nOE+6cE0EUM9fQPjN2y3SzoStHXvgbF42ajVpHhT3M03efT TgWoOkVUYtTvPY8SBgmvlRVuUjts4+lBsT5XcPPtZ9SvDDPUiGWT7DWIdKSzRtt3xbD16C/Vtk5 ehrL37rXiifX9etCzFv/F9QYbGbdHFpmt6eAjY7qMxUyzZp+I9DYvE+VTSB89RXL4Oiq5Rt5PyH pN5vJu1J2M6NixsBjuIGEFAj0nmFZAkA7JiUfFhgFL61N3XXmRwqAuJFInQ== X-Google-Smtp-Source: AGHT+IG5czkLSUgJWGoKUtq1nahTfBbvNSW0GYqM+DsTEw0cF701c8OJdxkpznK6KxKB/f4B7SybmQ== X-Received: by 2002:a05:6000:430e:b0:3a4:cec5:b59c with SMTP id ffacd0b85a97d-3a55826b355mr3069867f8f.25.1749647877117; Wed, 11 Jun 2025 06:17:57 -0700 (PDT) Message-ID: <0f47268e-0674-46e7-bfd4-8a395ee1ddf6@suse.com> Date: Wed, 11 Jun 2025 15:17:50 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/4] xsm/silo: Support hwdom/control domains To: Jason Andryuk Cc: "Daniel P. Smith" , xen-devel@lists.xenproject.org References: <20250610225737.469690-1-jason.andryuk@amd.com> <20250610225737.469690-3-jason.andryuk@amd.com> Content-Language: en-US From: Jan Beulich Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL In-Reply-To: <20250610225737.469690-3-jason.andryuk@amd.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 11.06.2025 00:57, Jason Andryuk wrote: > In a disaggregated environment, dom0 is split into Control, Hardware, > and Xenstore domains, along with domUs. The is_control_domain() check > is not sufficient to handle all these cases. Add is_priv_domain() to > support allowing for the various domains. > > The purpose of SILO mode is to prevent domUs from interacting with each > other. But dom0 was allowed to communicate with domUs to provide > services. As the disaggregation of dom0, Control, Hardware and Xenstore > are all service domains that need to communicate with other domains. > > To provide xenstore connections, the Xenstore domain must be allowed to > connect via grants and event channels. Xenstore domain must also be > allowed to connect to Control and Hardware to provide xenstore to them. Are you suggesting that SILO at present is incompatible with a Xenstore domain? silo_mode_dom_check() in its original form has no special precautions, after all. > Hardware domain will provide PV devices to domains, so it must be > allowed to connect to domains. As a built-in policy, isn't this already going too far? There could conceivably be configurations with only pass-through devices in use, in which case neither grants nor the event channels operations intercepted by SILO would be required. > That leaves Control. Xenstore and Hardware would already allow access > to Control, so it can obtain services that way. Control should be > "privileged", which would mean it can make the connections. But with > Xenstore and Hardware providing their services to domUs, there may not > be a reason to allow Control to use grants or event channels with domUs. > Still, Control is privileged, so it should be allowed to do something if > it chooses. Establishing a grant, or event channel requires action on > both sides, so allow for the possibility. This does open up an argo > wildcard ring from domUs, FWIW. Along the lines of my reply to patch 1, I think Hardware and Control need to have a pretty strong boundary between them. It's hard to see, for example, whether grant map/copy/transfer would indeed make sense between the two. Similarly I'm not convinced a strong boundary isn't also needed between Xenstore and Hardware. > --- a/xen/xsm/silo.c > +++ b/xen/xsm/silo.c > @@ -20,6 +20,12 @@ > #define XSM_NO_WRAPPERS > #include > > +static bool is_priv_domain(const struct domain *d) > +{ > + return is_xenstore_domain(d) || is_hardware_domain(d) || > + is_control_domain(d); > +} This construct expands to two evaluate_nospec(), which likely isn't wanted. Some open-coding may be pretty much unavoidable here. (I'm surprised it's not three, i.e. I find it odd that is_xenstore_domain() doesn't also use that guard.) Jan