All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] x86: don't exclude time.c from scanning
@ 2026-05-21 12:25 Jan Beulich
  2026-05-21 12:26 ` [PATCH 1/2] x86/time: address Misra C:2012 rule 8.3 Jan Beulich
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Jan Beulich @ 2026-05-21 12:25 UTC (permalink / raw)
  To: xen-devel@lists.xenproject.org
  Cc: Andrew Cooper, Roger Pau Monné, Teddy Astie, Nicola Vetrini

1: x86/time: address Misra C:2012 rule 8.3
2: x86/time: don't exclude from Eclair scanning

https://gitlab.com/xen-project/hardware/xen-staging/-/pipelines/2543286982

Jan


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/2] x86/time: address Misra C:2012 rule 8.3
  2026-05-21 12:25 [PATCH 0/2] x86: don't exclude time.c from scanning Jan Beulich
@ 2026-05-21 12:26 ` Jan Beulich
  2026-05-21 14:24   ` Nicola Vetrini
  2026-05-21 12:27 ` [PATCH 2/2] x86/time: don't exclude from Eclair scanning Jan Beulich
  2026-05-21 14:34 ` [PATCH for-4.22? 0/2] x86: don't exclude time.c from scanning Jan Beulich
  2 siblings, 1 reply; 7+ messages in thread
From: Jan Beulich @ 2026-05-21 12:26 UTC (permalink / raw)
  To: xen-devel@lists.xenproject.org
  Cc: Andrew Cooper, Julien Grall, Stefano Stabellini, Anthony PERARD,
	Michal Orzel, Roger Pau Monné, Teddy Astie, Nicola Vetrini

Before we can enable scanning of time.c, it needs to be clean wrt blocking
rules. Bring boot_tsc_stamp's definition in line with its declaration. For
get_s_time_fixed() go a little farther and move it to the x86 header (the
function only exists in x86) and do, along with correcting the parameter
name, the u64 -> uint64_t a little more widely than strictly necessary.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/include/asm/time.h
+++ b/xen/arch/x86/include/asm/time.h
@@ -13,6 +13,8 @@ static inline cycles_t get_cycles(void)
     return rdtsc_ordered();
 }
 
+s_time_t get_s_time_fixed(uint64_t at_tsc);
+
 unsigned long
 mktime (unsigned int year, unsigned int mon,
         unsigned int day, unsigned int hour,
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -95,7 +95,7 @@ static u32 pit_stamp32;
 static bool __read_mostly using_pit;
 
 /* Boot timestamp, filled in head.S */
-u64 __initdata boot_tsc_stamp;
+uint64_t __initdata boot_tsc_stamp;
 
 /* Per-socket TSC_ADJUST values, for secondary cores/threads to sync to. */
 static uint64_t *__read_mostly tsc_adjust;
@@ -1656,10 +1656,10 @@ static unsigned long get_wallclock_time(
  * System Time
  ***************************************************************************/
 
-s_time_t get_s_time_fixed(u64 at_tsc)
+s_time_t get_s_time_fixed(uint64_t at_tsc)
 {
     const struct cpu_time *t = &this_cpu(cpu_time);
-    u64 tsc, delta;
+    uint64_t tsc, delta;
 
     if ( at_tsc )
         tsc = at_tsc;
--- a/xen/include/xen/time.h
+++ b/xen/include/xen/time.h
@@ -33,7 +33,6 @@ struct vcpu;
 typedef int64_t s_time_t;
 #define PRI_stime PRId64
 
-s_time_t get_s_time_fixed(u64 at_tick);
 s_time_t get_s_time(void);
 unsigned long get_localtime(struct domain *d);
 uint64_t get_localtime_us(struct domain *d);



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 2/2] x86/time: don't exclude from Eclair scanning
  2026-05-21 12:25 [PATCH 0/2] x86: don't exclude time.c from scanning Jan Beulich
  2026-05-21 12:26 ` [PATCH 1/2] x86/time: address Misra C:2012 rule 8.3 Jan Beulich
@ 2026-05-21 12:27 ` Jan Beulich
  2026-05-21 14:25   ` Nicola Vetrini
  2026-05-21 14:34 ` [PATCH for-4.22? 0/2] x86: don't exclude time.c from scanning Jan Beulich
  2 siblings, 1 reply; 7+ messages in thread
From: Jan Beulich @ 2026-05-21 12:27 UTC (permalink / raw)
  To: xen-devel@lists.xenproject.org
  Cc: Andrew Cooper, Roger Pau Monné, Teddy Astie, Nicola Vetrini

The justification is wrong, and the file hence shouldn't really be
excluded.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -214,11 +214,6 @@ const-qualified."
 -doc_end
 
 -doc_begin="The following file is imported from Linux: ignore for now."
--file_tag+={adopted_time_r8_3,"^xen/arch/x86/time\\.c$"}
--config=MC3A2.R8.3,reports+={deliberate,"any_area(any_loc(file(adopted_time_r8_3)))&&(any_area(any_loc(file(^xen/include/xen/time\\.h$)))||any_area(any_loc(file(^xen/arch/x86/include/asm/setup\\.h$))))"}
--doc_end
-
--doc_begin="The following file is imported from Linux: ignore for now."
 -file_tag+={adopted_cpu_idle_r8_3,"^xen/arch/x86/acpi/cpu_idle\\.c$"}
 -config=MC3A2.R8.3,reports+={deliberate,"any_area(any_loc(file(adopted_cpu_idle_r8_3)))&&any_area(any_loc(file(^xen/include/xen/pmstat\\.h$)))"}
 -doc_end



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] x86/time: address Misra C:2012 rule 8.3
  2026-05-21 12:26 ` [PATCH 1/2] x86/time: address Misra C:2012 rule 8.3 Jan Beulich
@ 2026-05-21 14:24   ` Nicola Vetrini
  0 siblings, 0 replies; 7+ messages in thread
From: Nicola Vetrini @ 2026-05-21 14:24 UTC (permalink / raw)
  To: Jan Beulich
  Cc: xen-devel, Andrew Cooper, Julien Grall, Stefano Stabellini,
	Anthony PERARD, Michal Orzel, Roger Pau Monné, Teddy Astie

On 2026-05-21 14:26, Jan Beulich wrote:
> Before we can enable scanning of time.c, it needs to be clean wrt 
> blocking
> rules. Bring boot_tsc_stamp's definition in line with its declaration. 
> For
> get_s_time_fixed() go a little farther and move it to the x86 header 
> (the
> function only exists in x86) and do, along with correcting the 
> parameter
> name, the u64 -> uint64_t a little more widely than strictly necessary.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 

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

> --- a/xen/arch/x86/include/asm/time.h
> +++ b/xen/arch/x86/include/asm/time.h
> @@ -13,6 +13,8 @@ static inline cycles_t get_cycles(void)
>      return rdtsc_ordered();
>  }
> 
> +s_time_t get_s_time_fixed(uint64_t at_tsc);
> +
>  unsigned long
>  mktime (unsigned int year, unsigned int mon,
>          unsigned int day, unsigned int hour,
> --- a/xen/arch/x86/time.c
> +++ b/xen/arch/x86/time.c
> @@ -95,7 +95,7 @@ static u32 pit_stamp32;
>  static bool __read_mostly using_pit;
> 
>  /* Boot timestamp, filled in head.S */
> -u64 __initdata boot_tsc_stamp;
> +uint64_t __initdata boot_tsc_stamp;
> 
>  /* Per-socket TSC_ADJUST values, for secondary cores/threads to sync 
> to. */
>  static uint64_t *__read_mostly tsc_adjust;
> @@ -1656,10 +1656,10 @@ static unsigned long get_wallclock_time(
>   * System Time
>   
> ***************************************************************************/
> 
> -s_time_t get_s_time_fixed(u64 at_tsc)
> +s_time_t get_s_time_fixed(uint64_t at_tsc)
>  {
>      const struct cpu_time *t = &this_cpu(cpu_time);
> -    u64 tsc, delta;
> +    uint64_t tsc, delta;
> 
>      if ( at_tsc )
>          tsc = at_tsc;
> --- a/xen/include/xen/time.h
> +++ b/xen/include/xen/time.h
> @@ -33,7 +33,6 @@ struct vcpu;
>  typedef int64_t s_time_t;
>  #define PRI_stime PRId64
> 
> -s_time_t get_s_time_fixed(u64 at_tick);
>  s_time_t get_s_time(void);
>  unsigned long get_localtime(struct domain *d);
>  uint64_t get_localtime_us(struct domain *d);

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] x86/time: don't exclude from Eclair scanning
  2026-05-21 12:27 ` [PATCH 2/2] x86/time: don't exclude from Eclair scanning Jan Beulich
@ 2026-05-21 14:25   ` Nicola Vetrini
  0 siblings, 0 replies; 7+ messages in thread
From: Nicola Vetrini @ 2026-05-21 14:25 UTC (permalink / raw)
  To: Jan Beulich; +Cc: xen-devel, Andrew Cooper, Roger Pau Monné, Teddy Astie

On 2026-05-21 14:27, Jan Beulich wrote:
> The justification is wrong, and the file hence shouldn't really be
> excluded.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 

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

Thanks for addressing this

> --- a/automation/eclair_analysis/ECLAIR/deviations.ecl
> +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
> @@ -214,11 +214,6 @@ const-qualified."
>  -doc_end
> 
>  -doc_begin="The following file is imported from Linux: ignore for 
> now."
> --file_tag+={adopted_time_r8_3,"^xen/arch/x86/time\\.c$"}
> --config=MC3A2.R8.3,reports+={deliberate,"any_area(any_loc(file(adopted_time_r8_3)))&&(any_area(any_loc(file(^xen/include/xen/time\\.h$)))||any_area(any_loc(file(^xen/arch/x86/include/asm/setup\\.h$))))"}
> --doc_end
> -
> --doc_begin="The following file is imported from Linux: ignore for 
> now."
>  -file_tag+={adopted_cpu_idle_r8_3,"^xen/arch/x86/acpi/cpu_idle\\.c$"}
>  
> -config=MC3A2.R8.3,reports+={deliberate,"any_area(any_loc(file(adopted_cpu_idle_r8_3)))&&any_area(any_loc(file(^xen/include/xen/pmstat\\.h$)))"}
>  -doc_end

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH for-4.22? 0/2] x86: don't exclude time.c from scanning
  2026-05-21 12:25 [PATCH 0/2] x86: don't exclude time.c from scanning Jan Beulich
  2026-05-21 12:26 ` [PATCH 1/2] x86/time: address Misra C:2012 rule 8.3 Jan Beulich
  2026-05-21 12:27 ` [PATCH 2/2] x86/time: don't exclude from Eclair scanning Jan Beulich
@ 2026-05-21 14:34 ` Jan Beulich
  2026-05-22  7:13   ` Oleksii Kurochko
  2 siblings, 1 reply; 7+ messages in thread
From: Jan Beulich @ 2026-05-21 14:34 UTC (permalink / raw)
  To: Oleksii Kurochko
  Cc: Andrew Cooper, Roger Pau Monné, Teddy Astie, Nicola Vetrini,
	xen-devel@lists.xenproject.org

On 21.05.2026 14:25, Jan Beulich wrote:
> 1: x86/time: address Misra C:2012 rule 8.3
> 2: x86/time: don't exclude from Eclair scanning
> 
> https://gitlab.com/xen-project/hardware/xen-staging/-/pipelines/2543286982

With the quick R-b from Nicola (thanks much!), what's you're view towards
including this in 4.22?

Jan


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH for-4.22? 0/2] x86: don't exclude time.c from scanning
  2026-05-21 14:34 ` [PATCH for-4.22? 0/2] x86: don't exclude time.c from scanning Jan Beulich
@ 2026-05-22  7:13   ` Oleksii Kurochko
  0 siblings, 0 replies; 7+ messages in thread
From: Oleksii Kurochko @ 2026-05-22  7:13 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Andrew Cooper, Roger Pau Monné, Teddy Astie, Nicola Vetrini,
	xen-devel@lists.xenproject.org



On 5/21/26 4:34 PM, Jan Beulich wrote:
> On 21.05.2026 14:25, Jan Beulich wrote:
>> 1: x86/time: address Misra C:2012 rule 8.3
>> 2: x86/time: don't exclude from Eclair scanning
>>
>> https://gitlab.com/xen-project/hardware/xen-staging/-/pipelines/2543286982
> 
> With the quick R-b from Nicola (thanks much!), what's you're view towards
> including this in 4.22?

I am okay with having it in 4.22:
  Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>

Thanks.

~ Oleksii


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-05-22  7:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-21 12:25 [PATCH 0/2] x86: don't exclude time.c from scanning Jan Beulich
2026-05-21 12:26 ` [PATCH 1/2] x86/time: address Misra C:2012 rule 8.3 Jan Beulich
2026-05-21 14:24   ` Nicola Vetrini
2026-05-21 12:27 ` [PATCH 2/2] x86/time: don't exclude from Eclair scanning Jan Beulich
2026-05-21 14:25   ` Nicola Vetrini
2026-05-21 14:34 ` [PATCH for-4.22? 0/2] x86: don't exclude time.c from scanning Jan Beulich
2026-05-22  7:13   ` Oleksii Kurochko

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.