[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] x86: Conditionalise init_dom0_cpu_policy()


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>
  • Date: Fri, 25 Jul 2025 12:02:18 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=citrix.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=DLC19927iBqBiiZ2J++ijex9DMu8LOXlT2UYfpvM/Qk=; b=SxvF8JEJr85zlAdhx/HgPhGMjg7AAaYlPVRX9nbEwFPgs4abMavqZPltRmfX3ALgCgTWFyDqWw71t04/yu3bVwKfWfrbSqVlMZQzWXM+yWB8+Myjo7r2CNCMzFg4raHe/Fpa5EqdtkHK21uaIG6+DGKoIvwzcHGgGWnCPvEc/FNDih1Pl4hBFFb7TqC8gWmSY7p+w7J+v/yL0Zk3O+KD5gflMCmTYYdHSwOicDpQAC6Zvv9yyFC+8i6/TOoKVnNpT2qKENiG4NyGMrKBFSo5IL+rhorDVPZB9eQS5Zo0xT49wU/RwiE9/bEht1xJ4tifH84HuBH67B+4ZX7DmJ3kAQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=xXcaHx+v7xe7UZur8yxt+ojdM8fpUikDd0LyT3cehSc6ZH2PMN/iV72/SZ5VcxRatGRQj0OlcQUiTYnHeYm3dzTz/20N0IHP60qOEC9CpmVSEEoiiunnKZ4xTImUqKUGi/a3twypcjoBB5ViVXpEcp+Ty5FPCo1371+VLuFXa/9NsNDJmLGU7/C+JH6YtADOZBfAojNCGVEVFzqIOWoVOFOFTiPcCbbGBzKq56ui8bIvHC8b6hIVEiQ2c3iGg1t+TD9Dff4Mptt3ACrWx3fJa0dIdZWLmsT1lgNEXiTIC1cSBL3rntSSY49+zZHx64unQdtrAzavimIMho1RgStu+w==
  • Cc: <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 25 Jul 2025 10:02:43 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Wed Jul 23, 2025 at 9:18 AM CEST, Roger Pau Monné wrote:
> On Thu, Jul 17, 2025 at 07:58:24PM +0200, Alejandro Vallejo wrote:
>> Later patches will keep refactoring create_dom0()
>> until it can create arbitrary domains. This is one
>> small step in that direction.
>> 
>> Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>
>> ---
>>  xen/arch/x86/setup.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>> 
>> diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
>> index c6890669b9..6943ffba79 100644
>> --- a/xen/arch/x86/setup.c
>> +++ b/xen/arch/x86/setup.c
>> @@ -1054,7 +1054,8 @@ static struct domain *__init create_dom0(struct 
>> boot_info *bi)
>>      if ( IS_ERR(d) )
>>          panic("Error creating d%u: %ld\n", bd->domid, PTR_ERR(d));
>>  
>> -    init_dom0_cpuid_policy(d);
>> +    if ( pv_shim || d->cdf & (CDF_privileged | CDF_hardware) )
>
> You possibly want this to be:
>
> (d->cdf & (CDF_privileged | CDF_hardware)) == (CDF_privileged | CDF_hardware)
>
> To ensure the contents of dom0_cpuid_cmdline is only applied to dom0,
> and not to the hardware or control domains.  I assume it should be
> possible to pass a different set of cpuid options for the hardware vs
> the control domains.
>
> Thanks, Roger.

Why only a hwdom+ctldom, surely a single hwdom should get it too. I can see
the argument for a ctldom not getting it. For our use case having dom0
disaggregated is of the essence, so what happens with a hwdom that is not a
ctldom is fairly important.

That said, I'm thinking moving in a different direction and have a generic
init_cpuid_policy() that internally checks for hw or control, or leave the
default policy or something else.

This would remove the conditional and allow much finer selection. e.g: a domain
brought up through a "nomigrate" DTB node (TBD: nonexisting binding atm) would
get itsc reported, just as dom0 does today.

Cheers,
Alejandro



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.