All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: xen-devel@lists.xenproject.org,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Julien Grall" <julien@xen.org>,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	"Anthony PERARD" <anthony.perard@vates.tech>,
	"Michal Orzel" <michal.orzel@amd.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>,
	"Teddy Astie" <teddy.astie@vates.tech>
Subject: Re: [PATCH 1/2] x86/time: address Misra C:2012 rule 8.3
Date: Thu, 21 May 2026 16:24:51 +0200	[thread overview]
Message-ID: <1b9724be44ac321a7efa0852014312f6@bugseng.com> (raw)
In-Reply-To: <09e58463-4eda-46da-83e0-bc66c84afb25@suse.com>

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


  reply	other threads:[~2026-05-21 14:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1b9724be44ac321a7efa0852014312f6@bugseng.com \
    --to=nicola.vetrini@bugseng.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=anthony.perard@vates.tech \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=michal.orzel@amd.com \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=teddy.astie@vates.tech \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.