[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/2] tools/arm: Reject configuration with incorrect nr_spis value
- To: Michal Orzel <michal.orzel@xxxxxxx>
- From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
- Date: Tue, 11 Mar 2025 09:21:36 +0000
- Accept-language: en-GB, en-US
- Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
- Arc-message-signature: i=2; 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=eKPZAcBtiJPiQl5rw8hVDTUtkHylNPFXj8eZ+gcclz0=; b=U/U6FZWXunhkmUtgbuEICOjv31OuqKgvW+E8FMwwOO0Fe/NaOa8oOAo/XleQfliDzULBwB1wtPrN2Yh9pJAvuFN0WLr+WQDJIoaGsBJiNiwbxgnp+4q9ZvtgbuspKL/++P7IzDUvZ+tC/IP3lAUi7BngGs06B8r2Rb7PKhtxwhBqnLcXqpE5L5BKPo+7qslDeRjkGAixejD3CxnnXJZVwEulL4rh3zrawT/yA5A8ImRIk4Ee4xe+MF9QyqHuYg/0fiytcqWGAGnCTIyp0PzRTsadapEtdMBJ80lxsYfnn0cNIr8DkWdXEk0MiVb+wT9kV/IPPfu6PdkMMZfzDYVkpw==
- 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=eKPZAcBtiJPiQl5rw8hVDTUtkHylNPFXj8eZ+gcclz0=; b=ZG5662mWGseqR4tLV2kqxnClg6fnm3/dWL/2ehYjOc/3JyUPVUbdGtQjznLSMW5/YfwrxZqnuRwb7ApSDXsMa9CP7zYcFk4JXANMP0w6qgUBiHY9PJF67xd0nFCC8/uFhcCD76ndOeueC0eG1B2I7RTHRPLlwfsz5bivMfSL0epOuAgfEf3G/ijvJk/BeW8xVTVU+YTsXvwyN/TNZiiuEM/7APxNM+eRgFp4YanOJ5avu/lJhMI46iVlVCpLj1OHDltiyM3mkAmjQSfmhzlMrcWI+IfUT4xqTZ7zawnr1kyUnJd0bnATe2jVlHoLFq075++yrQ3v4euqz71b99snig==
- Arc-seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=QxT32H242i9Wfxr1wveGJmZ4RjNDxo19s+E8jBooYXJkRZ/OLohTN2ROjiIn4W1hlq+i7JHJzR1r6wAVxoysoMZxTTTL8GRLPI2U9CpdEG0DAjKgLv8T47rpjA1EeODilrsZZbcQJ0dqTAuHXoux0nv0SJaN/VZ2Cn0GxHhvrIDArNQJoAJFdhpOddAdQldEVQTlX9bWNrhzfffcb/CpDQj06pW0sR4sBXhG8GfzJqj0lzHT1mteMisy2teVqdMUyAqL8aOeVjbIWFCsvCQjmuS+ypSxRaBtdnqrdEIyWLImUIrVKokTmmMfevJlJdGDRjah7deV/WX1h7YRRj1azg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=aL18dc0rzL9WPTZC266CEMh/xF+1/umNVU+9aZkzMwaQKTxmWYKr4H0gGbvRFLtSNKO5N4tEVzJ2Cmc8T0IiMdHibYq7qQ1jBajurKWVvURg0hvgvz4CCbiMDFZnzfRVnJokD2t3uT4/KQMSixQfdf9D2lIyHUnIZzjP/oEw1kkZxK6YXcS7BIlWMMiSDgovoE/YKDxtuioBQtr+7+kbnysvj8L9FUwjNhzd+HDc0LfSwFXrC7zx3kJHllJHEsM2tX3dW9Dzjww0FMtAPXygqHuFyI99PwSryGJ+ynJj1NeSA14/SFZ/S+krZks+Q3Z85QdFuNKl/DQn4+Bt05pzPA==
- Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>
- Delivery-date: Tue, 11 Mar 2025 09:21:57 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Nodisclaimer: true
- Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Thread-index: AQHbkmSbRQWO9wYiMUWUu1bb3L8uxLNtqSKA
- Thread-topic: [PATCH 2/2] tools/arm: Reject configuration with incorrect nr_spis value
Hi Michal,
> On 11 Mar 2025, at 10:04, Michal Orzel <michal.orzel@xxxxxxx> wrote:
>
> If the calculated value for nr_spis by the toolstack is bigger than the
> value provided by the user, we silently ignore the latter. This is not
> consistent with the approach we have in Xen on Arm when we try to reject
> incorrect configuration. Also, the documentation for nr_spis is
> incorrect as it mentions 991 as the number of max SPIs, where it should
> be 960 i.e. (1020 - 32) rounded down to the nearest multiple of 32.
>
> Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
Reviewed-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>
With a small NIT...
> ---
> docs/man/xl.cfg.5.pod.in | 13 +++++--------
> tools/libs/light/libxl_arm.c | 6 ++++++
> 2 files changed, 11 insertions(+), 8 deletions(-)
>
> diff --git a/docs/man/xl.cfg.5.pod.in b/docs/man/xl.cfg.5.pod.in
> index 8e1422104e50..7339c44efd54 100644
> --- a/docs/man/xl.cfg.5.pod.in
> +++ b/docs/man/xl.cfg.5.pod.in
> @@ -3083,14 +3083,11 @@ interval of colors (such as "0-4").
> =item B<nr_spis="NR_SPIS">
>
> An optional integer parameter specifying the number of SPIs (Shared
> -Peripheral Interrupts) to allocate for the domain. Max is 991 SPIs. If
> -the value specified by the `nr_spis` parameter is smaller than the
> -number of SPIs calculated by the toolstack based on the devices
> -allocated for the domain, or the `nr_spis` parameter is not specified,
> -the value calculated by the toolstack will be used for the domain.
> -Otherwise, the value specified by the `nr_spis` parameter will be used.
> -The number of SPIs should match the highest interrupt ID that will be
> -assigned to the domain.
> +Peripheral Interrupts) to allocate for the domain. Max is 960 SPIs. If
> +the `nr_spis` parameter is not specified, the value calculated by the
> toolstack
> +will be used for the domain. Otherwise, the value specified by the `nr_spis`
> +parameter will be used. The number of SPIs should match the highest interrupt
> +ID that will be assigned to the domain.
>
> =back
>
> diff --git a/tools/libs/light/libxl_arm.c b/tools/libs/light/libxl_arm.c
> index 5a9db5e85f6f..ee9154298f2a 100644
> --- a/tools/libs/light/libxl_arm.c
> +++ b/tools/libs/light/libxl_arm.c
> @@ -181,6 +181,12 @@ int libxl__arch_domain_prepare_config(libxl__gc *gc,
>
> LOG(DEBUG, "Configure the domain");
>
> + if (nr_spis > d_config->b_info.arch_arm.nr_spis) {
> + LOG(ERROR, "Provided nr_spis value is too small (required %u)\n",
I would say "minimum required" here.
Cheers
Bertrand
> + nr_spis);
> + return ERROR_FAIL;
> + }
> +
> config->arch.nr_spis = max(nr_spis, d_config->b_info.arch_arm.nr_spis);
> LOG(DEBUG, " - Allocate %u SPIs", config->arch.nr_spis);
>
> --
> 2.25.1
>
|