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

Re: [PATCH] arinc653: clear entire .dom_handle[] for Dom0 slots


  • To: Jan Beulich <jbeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
  • Date: Tue, 24 Mar 2026 13:10:13 -0400
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.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=T0Ycnt3TcU5xZ6fDy6W+2rUveknrflnOUoPUpGf64OQ=; b=BuuhzFfAMEWg/hsKN4Hd6NLVciLsEIXXl0/nXO3h9fuKnYNs8gUrzSb0wjoagc0SlJK7H7RIGXweahwwKHVg6OdAwcw+Pnw5WW/1//3mGiLng5rq0NdLUKJaT9HHa+2/sXWPcqXQU/Z+lHsj9PvHW6/Rsc9u2OPMNHfz3/ctBixDuq5GR8Nl/ZIywyYb2lm5jCLWJm9ebz9wVYlvW3sn/PH9wpe5/miz1f/KIXD9+xtPYvUXAJvWLCu9Mh4eKg4jzlKF/6FlOlIpbzQTCz3JT/7KyzxRTM5D41vp0Rpsgm29/d02fm4zo5I+3ec/M9EkQBn1vVKTzlPfhV/3zx+oJw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=JL4Gs6tjlx1h81wcV9aSS4C5ubNfVesAtrYhNMLaxP8UmHsFaY0938VFby1Qx2U6Ak9DUL6YaitaT9HqplKmWWe4cLf4pBk849oTQIJNOnqlUxLVMzlUpGdm/fi89NGUpa9V+ZaWXtDgywmIlqrS5kx4HLzhlCerYYdXiXonaPeOOkSrXBb9iqBUMUWCJQPtxW/fRok122pxTVq4WeCIcbFOK0L27Y1pgSMEY68WdUFdPH3vUf4ERrnC4OqpNhGukDnz3Obl4rfQ3p/gbZlenRVR8NB0AtB+VqmUDMnzgZ7H2jLAE8jb7p48aqX6yiUJB+1JhN724iMZDCd27GGpug==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Cc: Nathan Studer <nathan.studer@xxxxxxxxxxxxxxx>, Stewart Hildebrand <stewart@xxxxxxx>
  • Delivery-date: Tue, 24 Mar 2026 17:10:34 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 3/24/26 11:54, Jan Beulich wrote:
> When that code still lived in a653sched_init(), it was redundant with the
> earlier memset() / xzalloc(). Once moved, the full structure field needs
> setting, as dom_handle_cmp() uses memcmp().

The whole a653sched_priv_t *sched_priv is still allocated in a653sched_init()
with xzalloc(), so it's still redundant post-move. With that said, the code is
only setting the first element (of an already-zeroed array), which is suspicious
and misleading. What we really should be doing here is copy unit->domain->handle
to sched_priv->schedule[entry].dom_handle.

> Fixes: 9f0c658baedc ("arinc: add cpu-pool support to scheduler")
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> ---
> There being no "else" to the if(), what about other Dom0 vCPU-s?

The condition is checking minor frame entries (i.e. available slots in the
schedule). Once those are exhausted, Dom0 units beyond
ARINC653_MAX_DOMAINS_PER_SCHEDULE would never be scheduled. Currently the
scheduler only supports scheduling a single unit at a time, so this way of
adding units to the schedule would result in Dom0 vCPUs being scheduled
sequentially, which is incredibly inefficient and unlikely to be what anyone
would actually want, but I don't think there are other possibilities given the
current lack of multicore support.

There was an effort some time ago to introduce multicore scheduling, see [1].
I'd be happy to review if somebody wants to pick that up again.

[1] 
https://lore.kernel.org/xen-devel/20200916181854.75563-1-jeff.kubascik@xxxxxxxxxxxxxxx/T/#t

> And why
> is it that domain ID 0 is special here, rather than the hardware and/or
> control domain(s)? (Likely the latter as that's what would invoke
> XEN_SYSCTL_SCHEDOP_putinfo, and hence needs to be able to run without
> that having been issued first.)

This likely should be updated to is_control_domain(unit->domain).

> 
> --- a/xen/common/sched/arinc653.c
> +++ b/xen/common/sched/arinc653.c
> @@ -420,7 +420,8 @@ a653sched_alloc_udata(const struct sched
>  
>          if ( entry < ARINC653_MAX_DOMAINS_PER_SCHEDULE )
>          {
> -            sched_priv->schedule[entry].dom_handle[0] = '\0';
> +            memset(sched_priv->schedule[entry].dom_handle, '\0',
> +                   sizeof(sched_priv->schedule[entry].dom_handle));
>              sched_priv->schedule[entry].unit_id = unit->unit_id;
>              sched_priv->schedule[entry].runtime = DEFAULT_TIMESLICE;
>              sched_priv->schedule[entry].unit = unit;
> 




 


Rackspace

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