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

Re: [PATCH 2/2] tools/ocaml: Fix stubs the introduction of domain_create.cpupool_id


  • To: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
  • From: Edwin Torok <edvin.torok@xxxxxxxxxx>
  • Date: Wed, 18 May 2022 09:51:58 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=aOGDflMWIOfR5MxxCXCWhCTvA1AZ+nhFSl7QzeI64rU=; b=dbspFz5GO+fdr3HNUfWwW4bO8N//CWjGSL+UbIkrereMyapGghnmQQlb2RyipHciVuNsgU29Dip3W6kH/MDv0IJQxTYN7lLl1mnmGjppPeldMD21EcKMTCLk4DsTLBu6UF4qyQJuHKF/uik7CndSTYU+2wlBIM+pTi+OT+GiIVYAyATeKRj+LDuJPV+5/E+znxQ8PxNzUm+YS61BBWlgGf8KgwWjgWzWgWPAN7HCzYt8/FqBP6IPOJh9pLF7bjJsujQbHViEC7v71Uzf3J7WA2HYSv/hYB5DTWHWaz8FtrxGHiVT0G7mt42zULjhNigPkVZzUBOqK4bg2bhqKfUe+A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R4no75c9D/1fvtvDdb4rCPIaVR+2pMyMT4sEQFWOAwr2G2NL6kiiXYXSzpDLYeBOy9HJJgjsu+kluFoJVmN5cZ9lBacG3TbUJ88+Pwgoe+KTBlbCK6Yx67wwHsegLWtVJ+8duVS1GgvntC+cTZD7GNJOGATyVmZFyG3svzxj/7VKfHfNGaea6a0U4T9MrEl/T854+ntdiCctVF8D44cqNmECZjgZapjQY4OgiBUKlShhag0c/xz/wjMeRiXGrByP94KauJ8SBVfmS9CPM/LLwKAA5twX4EAFy50VjqMXcpW9M7FZpvRXbEk9g+SBDiFDGGkwDYiI7ctDpx5Bmkl9PQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Christian Lindig <christian.lindig@xxxxxxxxxx>, Luca Fancellu <luca.fancellu@xxxxxxx>
  • Delivery-date: Wed, 18 May 2022 09:52:15 +0000
  • Ironport-data: A9a23:N1vYu624II5BojFrBvbD5b1wkn2cJEfYwER7XKvMYLTBsI5bp2cBm mscWTrTbPyCYmbweNEkbIS/oU4EupHWyNI2SwNopC1hF35El5HIVI+TRqvS04J+DSFhoGZPt Zh2hgzodZhsJpPkjk7xdOCn9xGQ7InQLlbGILes1htZGEk1EU/NtTo5w7Rj2tMx0YDga++wk YiaT/P3aQfNNwFcagr424rbwP+4lK2v0N+wlgVWicFj5DcypVFMZH4sDfjZw0/DaptVBoaHq 9Prl9lVyI97EyAFUbtJmp6jGqEDryW70QKm0hK6UID66vROS7BbPg/W+5PwZG8O4whlkeydx /1Xjb6bSgs1NZfHs94kFCh2Fgd1H7V/reqvzXiX6aR/zmXgWl61mrBFKxhzOocVvOFqHWtJ6 PoUbigXaQyOjP63x7T9TfRwgsMkL4/gO4Z3VnNIlGmFS6p5B82dBfyVvLe03x9p7ixKNfvSe csfLyZodhPDSxZOJk0WGNQ1m+LAanzXLGQJ9w7J/PNfD277lil295fyNfrvVoLaHflFtE2Ag EL54DGsav0dHJnFodafyVq8i+mKkS7lVYY6ELyj6uUskFCV3nYUChAdSR28u/bRokqjUNsZJ UUS8ScqqbUa/VauCNL6WnWFTGWsuxcdX59bFLQ84QTUk67MuV/GXy4DUyJLb8EguIkuXzs22 1SVntTvQztyrLmSTnHb/bCRxd+vBRUowaY5TXdsZWM4DxPL/enfUjqnog5fLZOI
  • Ironport-hdrordr: A9a23:Hw41FKyDeAjQfoo181T2KrPxdegkLtp133Aq2lEZdPULSKGlfp GV9sjziyWetN9IYgBapTiBUJPwIk81bfZOkMUs1MSZLXPbUQyTXc5fBOrZsnDd8kjFmtK1up 0QFJSWZOeQMbE+t7eD3ODaKadv/DDkytHPuQ629R4EIm9XguNbnn5E422gYy9LrXx9dP4E/e 2nl696TlSbGUg/X4CePD0oTuLDr9rEmNbNehgdHSMq7wGIkHeB9KP6OwLw5GZfbxp/hZMZtU TVmQ3w4auu99uhzAXH6mPV55NK3PP819p4AtCWgMR9EESutu/oXvUiZ1SxhkFwnAid0idsrD AKmWZnAy1H0QKVQohym2q15+Cv6kd315ao8y7kvZKqm72EeNt9MbsBuWsRSGqm12Mw+N57y6 5FxGSfqt5eCg7Bhj3045zSWwhtjVfcmwtrrQaC50YvLrf2RYUh27D3xnklWavo3RiKmrwPAa 1rFoXR9fxWeVSVYzTQuXRu2sWlWjA2Eg2dSkYPt8SJ23wO9UoJhXcw1YgahDMN5Zg9Q55L66 DNNblpjqhHSosTYbhmDOkMTMOrAijGQA7KMmiVPVP7fZt3cE7lutry+vE49euqcJsHwN87n4 nASkpRsSood0fnGaS1rep2G9D2MRGAtBjWu7FjDsJCy8zBrZLQQF6+YUFrlde8qPMCBcCeU+ qvOfttcoreEVc=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHYaiYn6m40FzHJf0irMsT2T+YW1K0kZYcA
  • Thread-topic: [PATCH 2/2] tools/ocaml: Fix stubs the introduction of domain_create.cpupool_id


> On 17 May 2022, at 20:41, Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx> wrote:
> 
> Sadly, cpupool IDs are chosen by the caller, not assigned sequentially, so
> this does need to have a full 32 bits of range.
> 
> Also leave a BUILD_BUG_ON() to catch more obvious ABI changes in the future.
> 
> Fixes: 92ea9c54fc81 ("arm/dom0less: assign dom0less guests to cpupools")
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

Thanks for the fix.


> ---
> CC: Christian Lindig <christian.lindig@xxxxxxxxxx>
> CC: Edwin Török <edvin.torok@xxxxxxxxxx>
> CC: Luca Fancellu <luca.fancellu@xxxxxxx>
> ---
> tools/ocaml/libs/xc/xenctrl.ml      | 1 +
> tools/ocaml/libs/xc/xenctrl.mli     | 1 +
> tools/ocaml/libs/xc/xenctrl_stubs.c | 8 +++++++-
> 3 files changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/ocaml/libs/xc/xenctrl.ml b/tools/ocaml/libs/xc/xenctrl.ml
> index 7503031d8f61..8eab6f60eb14 100644
> --- a/tools/ocaml/libs/xc/xenctrl.ml
> +++ b/tools/ocaml/libs/xc/xenctrl.ml
> @@ -85,6 +85,7 @@ type domctl_create_config =
>       max_grant_frames: int;
>       max_maptrack_frames: int;
>       max_grant_version: int;
> +     cpupool_id: int32;

What are the valid values for a CPU pool id, in particular what value should be 
passed here to get back the behaviour prior to these changes in Xen?
(i.e. would it be cpu pool id 0 or -1 if cpu pools aren't otherwise explicitly 
configured on the system)

Thanks,
--Edwin

>       arch: arch_domainconfig;
> }
> 
> diff --git a/tools/ocaml/libs/xc/xenctrl.mli b/tools/ocaml/libs/xc/xenctrl.mli
> index d1d9c9247afc..d3014a2708d8 100644
> --- a/tools/ocaml/libs/xc/xenctrl.mli
> +++ b/tools/ocaml/libs/xc/xenctrl.mli
> @@ -77,6 +77,7 @@ type domctl_create_config = {
>   max_grant_frames: int;
>   max_maptrack_frames: int;
>   max_grant_version: int;
> +  cpupool_id: int32;
>   arch: arch_domainconfig;
> }
> 
> diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c 
> b/tools/ocaml/libs/xc/xenctrl_stubs.c
> index 5b4fe72c8dec..513ee142d2a0 100644
> --- a/tools/ocaml/libs/xc/xenctrl_stubs.c
> +++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
> @@ -189,7 +189,8 @@ CAMLprim value stub_xc_domain_create(value xch, value 
> wanted_domid, value config
> #define VAL_MAX_GRANT_FRAMES    Field(config, 6)
> #define VAL_MAX_MAPTRACK_FRAMES Field(config, 7)
> #define VAL_MAX_GRANT_VERSION   Field(config, 8)
> -#define VAL_ARCH                Field(config, 9)
> +#define VAL_CPUPOOL_ID          Field(config, 9)
> +#define VAL_ARCH                Field(config, 10)
> 
>       uint32_t domid = Int_val(wanted_domid);
>       int result;
> @@ -201,6 +202,7 @@ CAMLprim value stub_xc_domain_create(value xch, value 
> wanted_domid, value config
>               .max_maptrack_frames = Int_val(VAL_MAX_MAPTRACK_FRAMES),
>               .grant_opts =
>                   XEN_DOMCTL_GRANT_version(Int_val(VAL_MAX_GRANT_VERSION)),
> +             .cpupool_id = Int32_val(VAL_CPUPOOL_ID),
>       };
> 
>       domain_handle_of_uuid_string(cfg.handle, String_val(VAL_HANDLE));
> @@ -225,6 +227,9 @@ CAMLprim value stub_xc_domain_create(value xch, value 
> wanted_domid, value config
>       case 1: /* X86 - emulation flags in the block */
> #if defined(__i386__) || defined(__x86_64__)
> 
> +             /* Quick & dirty check for ABI changes. */
> +             BUILD_BUG_ON(sizeof(cfg) != 64);
> +
>         /* Mnemonics for the named fields inside xen_x86_arch_domainconfig */
> #define VAL_EMUL_FLAGS          Field(arch_domconfig, 0)
> 
> @@ -254,6 +259,7 @@ CAMLprim value stub_xc_domain_create(value xch, value 
> wanted_domid, value config
>       }
> 
> #undef VAL_ARCH
> +#undef VAL_CPUPOOL_ID
> #undef VAL_MAX_GRANT_VERSION
> #undef VAL_MAX_MAPTRACK_FRAMES
> #undef VAL_MAX_GRANT_FRAMES
> -- 
> 2.11.0
> 


 


Rackspace

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