[PATCH] x86: address Misra C:2012 rule 8.4

Jan Beulich posted 1 patch 2 weeks, 2 days ago
Failed in applying to current master (apply log)
[PATCH] x86: address Misra C:2012 rule 8.4
Posted by Jan Beulich 2 weeks, 2 days ago
... ("A compatible declaration shall be visible when an object or function
with external linkage is defined"). Three variables lack asmlinkage
annotations.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
https://gitlab.com/xen-project/hardware/xen-staging/-/jobs/14351897188
(covering more than just this)

--- a/xen/arch/x86/guest/xen/pvh-boot.c
+++ b/xen/arch/x86/guest/xen/pvh-boot.c
@@ -22,7 +22,7 @@
 
 /* Initialised in head.S, before .bss is zeroed. */
 bool __initdata pvh_boot;
-uint32_t __initdata pvh_start_info_pa;
+uint32_t asmlinkage __initdata pvh_start_info_pa;
 
 static multiboot_info_t __initdata pvh_mbi;
 static module_t __initdata pvh_mbi_mods[8];
--- a/xen/arch/x86/guest/xen/xen.c
+++ b/xen/arch/x86/guest/xen/xen.c
@@ -40,7 +40,7 @@ DEFINE_PER_CPU(struct vcpu_info *, vcpu_
  *     0 vmcall
  *   > 0 vmmcall
  */
-int8_t __initdata early_hypercall_insn = -1;
+int8_t asmlinkage __initdata early_hypercall_insn = -1;
 
 /*
  * Called once during the first hypercall to figure out which instruction to
--- a/xen/arch/x86/pv/hypercall.c
+++ b/xen/arch/x86/pv/hypercall.c
@@ -180,7 +180,7 @@ void pv_ring1_init_hypercall_page(void *
     }
 }
 
-void do_entry_int82(struct cpu_user_regs *regs)
+void asmlinkage do_entry_int82(struct cpu_user_regs *regs)
 {
     if ( unlikely(untrusted_msi) )
         check_for_unexpected_msi((uint8_t)regs->entry_vector);
Re: [PATCH] x86: address Misra C:2012 rule 8.4
Posted by Nicola Vetrini 2 weeks, 2 days ago
On 2026-05-13 16:03, Jan Beulich wrote:
> ... ("A compatible declaration shall be visible when an object or 
> function
> with external linkage is defined"). Three variables lack asmlinkage
> annotations.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Nicola Vetrini <nicola.vetrini@bugseng.com>

> ---
> https://gitlab.com/xen-project/hardware/xen-staging/-/jobs/14351897188
> (covering more than just this)
> 
> --- a/xen/arch/x86/guest/xen/pvh-boot.c
> +++ b/xen/arch/x86/guest/xen/pvh-boot.c
> @@ -22,7 +22,7 @@
> 
>  /* Initialised in head.S, before .bss is zeroed. */
>  bool __initdata pvh_boot;
> -uint32_t __initdata pvh_start_info_pa;
> +uint32_t asmlinkage __initdata pvh_start_info_pa;
> 
>  static multiboot_info_t __initdata pvh_mbi;
>  static module_t __initdata pvh_mbi_mods[8];
> --- a/xen/arch/x86/guest/xen/xen.c
> +++ b/xen/arch/x86/guest/xen/xen.c
> @@ -40,7 +40,7 @@ DEFINE_PER_CPU(struct vcpu_info *, vcpu_
>   *     0 vmcall
>   *   > 0 vmmcall
>   */
> -int8_t __initdata early_hypercall_insn = -1;
> +int8_t asmlinkage __initdata early_hypercall_insn = -1;
> 
>  /*
>   * Called once during the first hypercall to figure out which 
> instruction to
> --- a/xen/arch/x86/pv/hypercall.c
> +++ b/xen/arch/x86/pv/hypercall.c
> @@ -180,7 +180,7 @@ void pv_ring1_init_hypercall_page(void *
>      }
>  }
> 
> -void do_entry_int82(struct cpu_user_regs *regs)
> +void asmlinkage do_entry_int82(struct cpu_user_regs *regs)
>  {
>      if ( unlikely(untrusted_msi) )
>          check_for_unexpected_msi((uint8_t)regs->entry_vector);

-- 
Nicola Vetrini, B.Sc.
Software Engineer
BUGSENG (https://bugseng.com)
LinkedIn: https://www.linkedin.com/in/nicola-vetrini-a42471253