Move Xen ECLAIR configuration to analyze.yaml
v2 cover Move Xen ECLAIR configuration to analyze.yaml
The initial configuration for the ECLAIR MISRA C analysis integration into Xen consisted of two fixed configuration files (one for arm64 and one for x86_64). This approach shows its downsides as configuration options may change over time.
To address this issues, the configuration can be derived from the architecture's defconfig and overridden in analyze.yaml via EXTRA_XEN_CONFIG. While doing this, some inconsistencies that were overlooked in the hand-crafted configuration files have been resolved following the advice of Stefano Stabellini and Michal Orzel.
A few regressions on clean guidelines result from such configuration changes, therefore both patches are prerequisite to the last one to keep avoid pipeline failures.
---
Changes in v2:
- changed subject prefix and parameter name of patch 2
Nicola Vetrini (3):
xen/arm: platform: address violation of MISRA C Rule 7.2 xen/rt: address violation of MISRA C Rule 8.2
automation: Update ECLAIR analysis configuration
automation/eclair_analysis/prepare.sh | 8 +- automation/eclair_analysis/xen_arm_config | 141 -------------------- automation/eclair_analysis/xen_x86_config | 143 --------------------- automation/gitlab-ci/analyze.yaml | 68 ++++++++++ xen/arch/arm/platforms/brcm-raspberry-pi.c | 6 +- xen/common/sched/rt.c | 2 +- 6 files changed, 77 insertions(+), 291 deletions(-) delete mode 100644 automation/eclair_analysis/xen_arm_config delete mode 100644 automation/eclair_analysis/xen_x86_config
Signature · 1 line
2.43.0
PATCH v2 1/3 xen/arm: platform: address violation of MISRA C Rule 7.2
Rule 7.2 states: "A u or U suffix shall be applied to all integer constants that are represented in an unsigned type".
Some PM_* constants are unsigned quantities, despite some of them being representable in a signed type, so a 'U' suffix should be present.
No functional change.
---
This fix is needed in order to keep the rule clean when the Xen configuration under static analysis is changed later in patch 3 of this series.
Only PM_RSTC_WRCFG_CLR is strictly needed to conform to the rule, but the other constants have a 'U' added for consistency. PM_RSTC and PM_WDOG are used as offsets, so in principle they can be negative, therefore they are left as is.
--- xen/arch/arm/platforms/brcm-raspberry-pi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
xen/arch/arm/platforms/brcm-raspberry-pi.c +3 -3
@@ -47,11 +47,11 @@ static const struct dt_device_match rpi4_blacklist_dev[] __initconst = }; -#define PM_PASSWORD 0x5a000000 +#define PM_PASSWORD 0x5a000000U#define PM_RSTC 0x1c#define PM_WDOG 0x24 -#define PM_RSTC_WRCFG_FULL_RESET 0x00000020 -#define PM_RSTC_WRCFG_CLR 0xffffffcf +#define PM_RSTC_WRCFG_FULL_RESET 0x00000020U +#define PM_RSTC_WRCFG_CLR 0xffffffcfUstatic void __iomem *rpi4_map_watchdog (void ) {
Signature · 1 line
2.43.0
PATCH v2 2/3 xen/rt: address violation of MISRA C Rule 8.2
In reply to Nicola VetriniRule 8.2 states: "Function types shall be in prototype form with named parameters".
The parameter name is missing from the function pointer type that constitutes the first parameter.
No functional change.
---
Changes in v2:
- renamed function parameter name to "elem"
- changed prefix to xen/rt since only that scheduler is touched
--- xen/common/sched/rt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
xen/common/sched/rt.c +1 -1
@@ -500,7 +500,7 @@ deadline_queue_remove(struct list_head *queue, struct list_head *elem) }static inline bool -deadline_queue_insert (struct rt_unit * (*qelem)(struct list_head *), +deadline_queue_insert (struct rt_unit * (*qelem)(struct list_head *elem),struct rt_unit *svc,struct list_head *elem,struct list_head *queue) {
Signature · 1 line
2.43.0
Re: [XEN PATCH v2 2/3] xen/rt: address violation of MISRA C Rule 8.2
Quoted 8 lines · Nicola Vetrini
Rule 8.2 states: "Function types shall be in prototype form with named parameters".
The parameter name is missing from the function pointer type that constitutes the first parameter.
No functional change.
Quoted 7 lines
Signed-off-by Nicola Vetrini <[email protected]>Reviewed-by Stefano Stabellini <[email protected]>Reviewed-by Juergen Gross <[email protected]>---
Changes in v2:
- renamed function parameter name to "elem"
- changed prefix to xen/rt since only that scheduler is touched
Looks like you committed v1 of this, and without a maintainer ack?
Jan
Re: [XEN PATCH v2 2/3] xen/rt: address violation of MISRA C Rule 8.2
Quoted 17 lines · Jan Beulich
Quoted 8 lines · Nicola Vetrini
Rule 8.2 states: "Function types shall be in prototype form with named parameters".
The parameter name is missing from the function pointer type that constitutes the first parameter.
No functional change.
Quoted 7 lines
Signed-off-by Nicola Vetrini <[email protected]>Reviewed-by Stefano Stabellini <[email protected]>Reviewed-by Juergen Gross <[email protected]>---
Changes in v2:
- renamed function parameter name to "elem"
- changed prefix to xen/rt since only that scheduler is touched
Quoted 1 line
Looks like you committed v1 of this, and without a maintainer ack?
Hi Jan, I took Juergen's comment and his maintainer ack, making the change on commit: https://marc.info/?l=xen-devel&m=173978187314898
Re: [XEN PATCH v2 2/3] xen/rt: address violation of MISRA C Rule 8.2
Quoted 18 lines · Stefano Stabellini
Quoted 17 lines · Jan Beulich
Quoted 15 lines · Nicola Vetrini
Rule 8.2 states: "Function types shall be in prototype form with named parameters".
The parameter name is missing from the function pointer type that constitutes the first parameter.
No functional change.
Signed-off-by Nicola Vetrini <[email protected]>Reviewed-by Stefano Stabellini <[email protected]>Reviewed-by Juergen Gross <[email protected]>---
Changes in v2:
- renamed function parameter name to "elem"
- changed prefix to xen/rt since only that scheduler is touched
Quoted 4 lines
Quoted 1 line
Looks like you committed v1 of this, and without a maintainer ack?
Hi Jan, I took Juergen's comment and his maintainer ack, making the change on commit: https://marc.info/?l=xen-devel&m=173978187314898
I think Jan's comment is due to the subject prefix of the commit being xen/sched, rather than xen/rt, as I touched only the rt scheduler, but that's too late to change.
Signature · 4 lines
Nicola Vetrini, B.Sc. Software Engineer BUGSENG (https://bugseng.com) LinkedIn: https://www.linkedin.com/in/nicola-vetrini-a42471253
Re: [XEN PATCH v2 2/3] xen/rt: address violation of MISRA C Rule 8.2
In reply to Stefano StabelliniQuoted 18 lines · Stefano Stabellini
Quoted 17 lines · Jan Beulich
Quoted 15 lines · Nicola Vetrini
Rule 8.2 states: "Function types shall be in prototype form with named parameters".
The parameter name is missing from the function pointer type that constitutes the first parameter.
No functional change.
Signed-off-by Nicola Vetrini <[email protected]>Reviewed-by Stefano Stabellini <[email protected]>Reviewed-by Juergen Gross <[email protected]>---
Changes in v2:
- renamed function parameter name to "elem"
- changed prefix to xen/rt since only that scheduler is touched
Quoted 4 lines
Quoted 1 line
Looks like you committed v1 of this, and without a maintainer ack?
Hi Jan, I took Juergen's comment and his maintainer ack, making the change on commit: https://marc.info/?l=xen-devel&m=173978187314898
Except that aiui Jürgen isn't formally a maintainer of the RT scheduler. Nor did you change the patch subject (as requested by me, and as reflected in v2) to properly express that it's an RT scheduler change (only). (Less formally, with the lack of response by the actual maintainers, taking Jürgen's R-b to fill in for the missing maintainer ack is likely okay, but probably should have been mentioned explicitly. Recurring lack of response by maintainers ought to perhaps result in reconsideration of their maintainership.)
Jan
PATCH v2 3/3 automation: Update ECLAIR analysis configuration
In reply to Nicola VetriniThe Xen configurations for the ARM64 and X86_64 ECLAIR analyses is currently held in fixed files under 'automation/eclair_analysis/xen_{arm,x86}_config'. The values of the configuration options there are susceptible to going stale due to configuration option changes.
To enhance maintainability, the configuration under analysis is derived from the respective architecture's defconfig, with suitable changes added via EXTRA_XEN_CONFIG.
---
This patch should be applied on top of the other two in the series to ensure that the CI has no failures related to clean guidelines.
Note that any out of date values taken by configuration options currently in xen_*_config were determined to be benign with respect to the analysis results, but this wasn't the right approach in the long term.
--- automation/eclair_analysis/prepare.sh | 8 +- automation/eclair_analysis/xen_arm_config | 141 --------------------- automation/eclair_analysis/xen_x86_config | 143 ---------------------- automation/gitlab-ci/analyze.yaml | 68 ++++++++++ 4 files changed, 73 insertions(+), 287 deletions(-) delete mode 100644 automation/eclair_analysis/xen_arm_config delete mode 100644 automation/eclair_analysis/xen_x86_config
automation/eclair_analysis/prepare.sh +5 -3
@@ -25,18 +25,20 @@ fi export XEN_TARGET_ARCH if [ "$1" = "X86_64" ]; then - CONFIG_FILE="${script_dir}/xen_x86_config" XEN_TARGET_ARCH=x86_64 elif [ "$1" = "ARM64" ]; then - CONFIG_FILE="${script_dir}/xen_arm_config" XEN_TARGET_ARCH=arm64 else fatal "Unknown configuration: $1" fi ( + make -C xen defconfig + if [[ -n "${EXTRA_XEN_CONFIG}" ]]; then + echo "${EXTRA_XEN_CONFIG}" >> xen/.config + fi + ./configure - cp "${CONFIG_FILE}" xen/.config make clean find . -type f -name "*.safparse" -print -delete "${script_dir}/build.sh" "$1"
automation/eclair_analysis/xen_arm_config deleted +0 -141
141 lines not on this page · raw message
automation/eclair_analysis/xen_x86_config deleted +0 -143
143 lines not on this page · raw message
automation/gitlab-ci/analyze.yaml +68 -0
80 lines not on this page · raw message
Signature · 1 line
2.43.0