From: vdso@mailbox.org
To: Naman Jain <namjain@linux.microsoft.com>
Cc: glx@kernel.org, mingo@redhat.com, bp@alien8.de,
dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com,
decui@microsoft.com, yunhong.jiang@linux.intel.com,
ricardo.neri-calderon@linux.intel.com,
rahul.tanwar@linux.intel.com, linux-kernel@vger.kernel.org,
linux-hyperv@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] x86/init: Initialize wall clock in get_rtc_noop()
Date: Fri, 18 Sep 2026 21:11:50 -0700 (PDT) [thread overview]
Message-ID: <15750262.186413.1789791110042@app.mailbox.org> (raw)
In-Reply-To: <210aa40c-88e1-4d88-ba6b-9224b05b0820@linux.microsoft.com>
> On 09/14/2026 4:31 AM PDT Naman Jain <namjain@linux.microsoft.com> wrote:
>
>
> On 9/12/2026 9:05 AM, Roman Kisel wrote:
> > On Mon, Aug 31, 2026 at 08:25:28AM +0000, Naman Jain wrote:
[...]
> >> +void get_rtc_noop(struct timespec64 *now) { *now = (struct timespec64){0}; }
> >
> > Hi Naman,
> >
> > Could be
> >
> > *now = (struct timespec64){};
> >
> > to save a byte :)
>
> hi Roman,
> Thanks for reviewing.
>
> Tianyu pointed out offline that this is handled in yet another way in
> jailhouse code:
>
> arch/x86/kernel/jailhouse.c
> static void jailhouse_get_wallclock(struct timespec64 *now)
> {
> memset(now, 0, sizeof(now));
> }
Appreciate sharing! Makes sense to me, looks way more explicit. Most
importantly imo, the memset isn't actually producing a call here so
the clock no-op stays cheap when choosing `memset` over ` = {}`.
One can see that the kernel build compiles ` = {0}`, ` = {}` into
pxor ...
movups ...
on x64 in the above. I made sure the memset "call" is relaxed/optimized
away into the same sequence `pxor ...; movups ...`.
>
> Regards,
> Naman
>
> >
> > LGTM.
> > Reviewed-by: Roman Kisel <vdso@mailbox.org>
> >
> >>
> >> static __initconst const struct of_device_id of_cmos_match[] = {
> >> { .compatible = "motorola,mc146818" },
> >> --
> >> 2.43.0
> >>
prev parent reply other threads:[~2026-09-19 4:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-31 8:25 [PATCH] x86/init: Initialize wall clock in get_rtc_noop() Naman Jain
2026-09-09 18:42 ` Dexuan Cui
2026-09-11 4:23 ` Hardik Garg
2026-09-12 3:35 ` Roman Kisel
2026-09-14 11:31 ` Naman Jain
2026-09-19 4:11 ` vdso [this message]
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=15750262.186413.1789791110042@app.mailbox.org \
--to=vdso@mailbox.org \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=decui@microsoft.com \
--cc=glx@kernel.org \
--cc=hpa@zytor.com \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=namjain@linux.microsoft.com \
--cc=rahul.tanwar@linux.intel.com \
--cc=ricardo.neri-calderon@linux.intel.com \
--cc=stable@vger.kernel.org \
--cc=x86@kernel.org \
--cc=yunhong.jiang@linux.intel.com \
/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.