Fix Power CI build
v3 cover Fix Power CI build
Hello all,
This series contains a few minor fixes to the CI config and one additional patch to common/ that resolve ppc64-specific CI failures that Jan discovered.
Thanks,
Shawn Anastasio (2):
automation: Change build script to use arch defconfig xen/common: Add NUMA node id bounds check to
page_alloc.c/node_to_scrub
automation/scripts/build | 5 ++++- xen/common/page_alloc.c | 8 ++++++++ 2 files changed, 12 insertions(+), 1 deletion(-)
--
2.30.2
PATCH v3 2/2 xen/common: Add NUMA node id bounds check to page_alloc.c/node_to_scrub
When building for Power with CONFIG_DEBUG unset, a compiler error gets raised inside page_alloc.c's node_to_scrub function:
common/page_alloc.c: In function 'node_to_scrub.part.0':common/page_alloc.c:1217:29: error: array subscript 1 is above array
bounds of 'long unsigned int[1]' [-Werror=array-bounds]
1217 | if ( node_need_scrub[node] )
It appears that this is a false positive, given that in practice cycle_node should never return a node ID >= MAX_NUMNODES as long as the architecture's node_online_map is properly defined and initialized, so this additional bounds check is only to satisfy GCC.
---
v2: Add comment to explain the bounds check.
xen/common/page_alloc.c | 8 ++++++++ 1 file changed, 8 insertions(+)
xen/common/page_alloc.c +8 -0
@@ -1211,6 +1211,14 @@ static unsigned int node_to_scrub(bool get_node) }while ( !cpumask_empty (&node_to_cpumask (node)) && (node != local_node) ); +/* +* In practice `node` will always be within MAX_NUMNODES, but GCC can't +* always see that, so an explicit check is necessary to avoid tripping +* its out-of-bounds array access warning (-Warray-bounds). +*/ +if ( node >=MAX_NUMNODES ) +break ; +if ( node == local_node )break ;
--
2.30.2
PATCH v3 1/2 automation: Change build script to use arch defconfig
In reply to Shawn AnastasioChange automation build script to call the make defconfig target before setting CONFIG_DEBUG and extra options. This fixes issues on Power where the build fails without using the ppc64_defconfig.
---
v3: Drop unnecessary sed.
v2: No changes.
automation/scripts/build | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
automation/scripts/build +4 -1
@@ -22,7 +22,10 @@ if [[ "${RANDCONFIG}" == "y" ]]; then # RANDCONFIG implies HYPERVISOR_ONLY HYPERVISOR_ONLY="y" else - echo "CONFIG_DEBUG=${debug}" > xen/.config + # Start off with arch's defconfig + make -C xen defconfig + + echo "CONFIG_DEBUG=${debug}" >> xen/.config if [[ -n "${EXTRA_XEN_CONFIG}" ]]; then echo "${EXTRA_XEN_CONFIG}" >> xen/.config
--
2.30.2
Re: [PATCH v3 1/2] automation: Change build script to use arch defconfig
Hi Shawn,
Quoted 8 lines · Shawn Anastasio
Change automation build script to call the make defconfig target before setting
CONFIG_DEBUGand extra options. This fixes issues on Power where the build fails without using theppc64_defconfig.Reported-by Jan Beulich <[email protected]>Signed-off-by Shawn Anastasio <[email protected]>
As discussed in v1, CI fixes should be included in 4.18, so:
Kind regards,
Henry
Quoted 28 lines
---
v3: Drop unnecessary sed.v2: No changes.
automation/scripts/build | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)automation/scripts/build +0
-0@@ -22,7 +22,10 @@ if [[ "${RANDCONFIG}" == "y" ]]; then # RANDCONFIG implies HYPERVISOR_ONLY HYPERVISOR_ONLY="y"else
automation/scripts/build +4
-2- echo "CONFIG_DEBUG=${debug}" > xen/.config + # Start off with arch's defconfig + make -C xen defconfig + + echo "CONFIG_DEBUG=${debug}" >> xen/.config if [[ -n "${EXTRA_XEN_CONFIG}" ]]; then echo "${EXTRA_XEN_CONFIG}" >> xen/.config --2.30.2
Re: [PATCH v3 2/2] xen/common: Add NUMA node id bounds check to page_alloc.c/node_to_scrub
In reply to Shawn AnastasioHi,
Quoted 10 lines · Shawn Anastasio
When building for Power with
CONFIG_DEBUGunset, a compiler error gets raised inside page_alloc.c'snode_to_scrubfunction:
common/page_alloc.c: In function 'node_to_scrub.part.0':common/page_alloc.c:1217:29: error: array subscript 1 is above array
bounds of 'long unsigned int[1]' [-Werror=array-bounds]
1217 | if ( node_need_scrub[node] )
Quoted 7 lines
It appears that this is a false positive, given that in practice
cycle_nodeshould never return a node ID >=MAX_NUMNODESas long as the architecture'snode_online_mapis properly defined and initialized, so this additional bounds check is only to satisfy GCC.Signed-off-by Shawn Anastasio <[email protected]>Reviewed-by Stefano Stabellini <[email protected]>
I am seeing some discussions going on about this patch, but once this is patch is ready for merge please feel free to add:
Kind regards,
Henry
Quoted 29 lines
---
v2: Add comment to explain the bounds check.
xen/common/page_alloc.c| 8 ++++++++1 file changed, 8 insertions(+)xen/common/page_alloc.c +8
-1@@ -1211,6 +1211,14 @@ static unsigned int node_to_scrub(bool get_node) }while ( !cpumask_empty (&node_to_cpumask (node)) && (node != local_node) ); +/* +* In practice `node` will always be within MAX_NUMNODES, but GCC can't +* always see that, so an explicit check is necessary to avoid tripping +* its out-of-bounds array access warning (-Warray-bounds). +*/ +if ( node >=MAX_NUMNODES ) +break ; +if ( node == local_node )break ; --2.30.2
Re: [PATCH v3 1/2] automation: Change build script to use arch defconfig
In reply to Shawn AnastasioQuoted 6 lines · Shawn Anastasio
Change automation build script to call the make defconfig target before setting
CONFIG_DEBUGand extra options. This fixes issues on Power where the build fails without using theppc64_defconfig.Reported-by Jan Beulich <[email protected]>Signed-off-by Shawn Anastasio <[email protected]>
Quoted 27 lines
---
v3: Drop unnecessary sed.v2: No changes.
automation/scripts/build | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)automation/scripts/build +4
-2@@ -22,7 +22,10 @@ if [[ "${RANDCONFIG}" == "y" ]]; then # RANDCONFIG implies HYPERVISOR_ONLY HYPERVISOR_ONLY="y" else - echo "CONFIG_DEBUG=${debug}" > xen/.config + # Start off with arch's defconfig + make -C xen defconfig + + echo "CONFIG_DEBUG=${debug}" >> xen/.config if [[ -n "${EXTRA_XEN_CONFIG}" ]]; then echo "${EXTRA_XEN_CONFIG}" >> xen/.config --2.30.2
Re: [PATCH v3 2/2] xen/common: Add NUMA node id bounds check to page_alloc.c/node_to_scrub
In reply to Shawn AnastasioQuoted 6 lines · Shawn Anastasio
xen/common/page_alloc.c +0
-0@@ -1211,6 +1211,14 @@ static unsigned int node_to_scrub(bool get_node) }while ( !cpumask_empty (&node_to_cpumask (node)) && (node != local_node) );
xen/common/page_alloc.c static unsigned int node_to_scrub(bool get_node) · line 1223
Quoted 10 lines
xen/common/page_alloc.c +8
-0+/* +* In practice `node` will always be within MAX_NUMNODES, but GCC can't +* always see that, so an explicit check is necessary to avoid tripping +* its out-of-bounds array access warning (-Warray-bounds). +*/ +if ( node >=MAX_NUMNODES ) +break ; +if ( node == local_node )break ;
My comment on v1 wasn't addressed, either verbally or by a code change. Imo that would move us a tiny step closer to what Andrew was asking for as well.
Jan
Re: [PATCH v3 2/2] xen/common: Add NUMA node id bounds check to page_alloc.c/node_to_scrub
Quoted 7 lines · Jan Beulich
Quoted 6 lines · Shawn Anastasio
xen/common/page_alloc.c +0
-0@@ -1211,6 +1211,14 @@ static unsigned int node_to_scrub(bool get_node) }while ( !cpumask_empty (&node_to_cpumask (node)) && (node != local_node) );
Quoted 12 lines
xen/common/page_alloc.c static unsigned int node_to_scrub(bool get_node) · line 1223
Quoted 10 lines
xen/common/page_alloc.c +8
-0+/* +* In practice `node` will always be within MAX_NUMNODES, but GCC can't +* always see that, so an explicit check is necessary to avoid tripping +* its out-of-bounds array access warning (-Warray-bounds). +*/ +if ( node >=MAX_NUMNODES ) +break ; +if ( node == local_node )break ;My comment on v1 wasn't addressed, either verbally or by a code change.
I have to apologize, you did respond, and I didn't spot the response earlier on. I'm not happy about the added code, but at least it has a comment now. Hence I guess I simply withdraw my objection, so the change can go in.
Jan
Quoted 5 lines
Imo
that would move us a tiny step closer to what Andrew was asking for as well.Jan