* [PATCH] Arm: rename smp_clear_cpu_maps()
@ 2025-04-17 8:36 Jan Beulich
2025-04-17 8:48 ` Nicola Vetrini
2025-04-17 8:51 ` Orzel, Michal
0 siblings, 2 replies; 4+ messages in thread
From: Jan Beulich @ 2025-04-17 8:36 UTC (permalink / raw)
To: xen-devel@lists.xenproject.org
Cc: Julien Grall, Stefano Stabellini, Volodymyr Babchuk,
Bertrand Marquis, Michal Orzel, consulting@bugseng.com
The function has lost all clearing operations. Use the commonly
available name (declared in xen/smp.h), that x86 also uses.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
I would have expected this to also address a Misra violation
(declaration without definition), but I can't spot any rule (having
looked through 8.x in particular) to this effect.
--- a/xen/arch/arm/include/asm/smp.h
+++ b/xen/arch/arm/include/asm/smp.h
@@ -29,7 +29,6 @@ int cpu_up_send_sgi(int cpu);
extern void init_secondary(void);
extern void smp_init_cpus(void);
-extern void smp_clear_cpu_maps (void);
extern unsigned int smp_get_max_cpus(void);
#define cpu_physical_id(cpu) cpu_logical_map(cpu)
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -317,7 +317,7 @@ void asmlinkage __init start_xen(unsigne
/* Initialize traps early allow us to get backtrace when an error occurred */
init_traps();
- smp_clear_cpu_maps();
+ smp_prepare_boot_cpu();
device_tree_flattened = early_fdt_map(fdt_paddr);
if ( !device_tree_flattened )
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -107,8 +107,7 @@ static void remove_cpu_sibling_map(int c
free_cpumask_var(per_cpu(cpu_core_mask, cpu));
}
-void __init
-smp_clear_cpu_maps (void)
+void __init smp_prepare_boot_cpu(void)
{
cpumask_set_cpu(0, &cpu_online_map);
cpumask_set_cpu(0, &cpu_possible_map);
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] Arm: rename smp_clear_cpu_maps()
2025-04-17 8:36 [PATCH] Arm: rename smp_clear_cpu_maps() Jan Beulich
@ 2025-04-17 8:48 ` Nicola Vetrini
2025-04-17 9:14 ` Jan Beulich
2025-04-17 8:51 ` Orzel, Michal
1 sibling, 1 reply; 4+ messages in thread
From: Nicola Vetrini @ 2025-04-17 8:48 UTC (permalink / raw)
To: Jan Beulich
Cc: xen-devel, Julien Grall, Stefano Stabellini, Volodymyr Babchuk,
Bertrand Marquis, Michal Orzel, consulting
On 2025-04-17 10:36, Jan Beulich wrote:
> The function has lost all clearing operations. Use the commonly
> available name (declared in xen/smp.h), that x86 also uses.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> ---
> I would have expected this to also address a Misra violation
> (declaration without definition), but I can't spot any rule (having
> looked through 8.x in particular) to this effect.
>
The rule you are looking for is 8.6: " An identifier with external
linkage shall have exactly one external definition", which is explicitly
deviated in Xen to allow declarations that have no definition,
especially in the case where definitions may be optimized out by the
compiler or are simply compiled out. I don't recall the specific
discussion that led to this deviation, but I can dug it up, if needed.
> --- a/xen/arch/arm/include/asm/smp.h
> +++ b/xen/arch/arm/include/asm/smp.h
> @@ -29,7 +29,6 @@ int cpu_up_send_sgi(int cpu);
> extern void init_secondary(void);
>
> extern void smp_init_cpus(void);
> -extern void smp_clear_cpu_maps (void);
> extern unsigned int smp_get_max_cpus(void);
>
> #define cpu_physical_id(cpu) cpu_logical_map(cpu)
> --- a/xen/arch/arm/setup.c
> +++ b/xen/arch/arm/setup.c
> @@ -317,7 +317,7 @@ void asmlinkage __init start_xen(unsigne
> /* Initialize traps early allow us to get backtrace when an error
> occurred */
> init_traps();
>
> - smp_clear_cpu_maps();
> + smp_prepare_boot_cpu();
>
> device_tree_flattened = early_fdt_map(fdt_paddr);
> if ( !device_tree_flattened )
> --- a/xen/arch/arm/smpboot.c
> +++ b/xen/arch/arm/smpboot.c
> @@ -107,8 +107,7 @@ static void remove_cpu_sibling_map(int c
> free_cpumask_var(per_cpu(cpu_core_mask, cpu));
> }
>
> -void __init
> -smp_clear_cpu_maps (void)
> +void __init smp_prepare_boot_cpu(void)
> {
> cpumask_set_cpu(0, &cpu_online_map);
> cpumask_set_cpu(0, &cpu_possible_map);
--
Nicola Vetrini, B.Sc.
Software Engineer
BUGSENG (https://bugseng.com)
LinkedIn: https://www.linkedin.com/in/nicola-vetrini-a42471253
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] Arm: rename smp_clear_cpu_maps()
2025-04-17 8:48 ` Nicola Vetrini
@ 2025-04-17 9:14 ` Jan Beulich
0 siblings, 0 replies; 4+ messages in thread
From: Jan Beulich @ 2025-04-17 9:14 UTC (permalink / raw)
To: Nicola Vetrini
Cc: xen-devel, Julien Grall, Stefano Stabellini, Volodymyr Babchuk,
Bertrand Marquis, Michal Orzel, consulting
On 17.04.2025 10:48, Nicola Vetrini wrote:
> On 2025-04-17 10:36, Jan Beulich wrote:
>> The function has lost all clearing operations. Use the commonly
>> available name (declared in xen/smp.h), that x86 also uses.
>>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>> ---
>> I would have expected this to also address a Misra violation
>> (declaration without definition), but I can't spot any rule (having
>> looked through 8.x in particular) to this effect.
>
> The rule you are looking for is 8.6: " An identifier with external
> linkage shall have exactly one external definition", which is explicitly
> deviated in Xen to allow declarations that have no definition,
> especially in the case where definitions may be optimized out by the
> compiler or are simply compiled out. I don't recall the specific
> discussion that led to this deviation, but I can dug it up, if needed.
The respective deviation is imo bogus. Iirc if anything this is about
DCE, which isn't "definition is compiled-out or optimized-out by the
compiler" but "invocation is compiled-out or optimized-out by the
compiler": If the definition was optimized out, there necessarily _is_
a definition in source.
Jan
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Arm: rename smp_clear_cpu_maps()
2025-04-17 8:36 [PATCH] Arm: rename smp_clear_cpu_maps() Jan Beulich
2025-04-17 8:48 ` Nicola Vetrini
@ 2025-04-17 8:51 ` Orzel, Michal
1 sibling, 0 replies; 4+ messages in thread
From: Orzel, Michal @ 2025-04-17 8:51 UTC (permalink / raw)
To: Jan Beulich, xen-devel@lists.xenproject.org
Cc: Julien Grall, Stefano Stabellini, Volodymyr Babchuk,
Bertrand Marquis, consulting@bugseng.com
On 17/04/2025 10:36, Jan Beulich wrote:
> The function has lost all clearing operations. Use the commonly
> available name (declared in xen/smp.h), that x86 also uses.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Michal Orzel <michal.orzel@amd.com>
~Michal
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-04-17 9:14 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-17 8:36 [PATCH] Arm: rename smp_clear_cpu_maps() Jan Beulich
2025-04-17 8:48 ` Nicola Vetrini
2025-04-17 9:14 ` Jan Beulich
2025-04-17 8:51 ` Orzel, Michal
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.