From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
"Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>,
"Andrew Cooper" <andrew.cooper3@citrix.com>,
"Julien Grall" <julien@xen.org>,
"Stefano Stabellini" <sstabellini@kernel.org>,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH v5 3/4] x86/time: introduce command line option to select wallclock
Date: Tue, 10 Sep 2024 15:10:14 +0200 [thread overview]
Message-ID: <ZuBFNu_GFygZwvil@macbook.local> (raw)
In-Reply-To: <985c0d70-55de-43ba-a1b3-811487bb05be@suse.com>
On Tue, Sep 10, 2024 at 11:32:05AM +0200, Jan Beulich wrote:
> On 09.09.2024 16:54, Roger Pau Monne wrote:
> > Allow setting the used wallclock from the command line. When the option is set
> > to a value different than `auto` the probing is bypassed and the selected
> > implementation is used (as long as it's available).
> >
> > The `xen` and `efi` options require being booted as a Xen guest (with Xen guest
> > supported built-in) or from UEFI firmware.
>
> Perhaps add "respectively"?
Sure.
>
> > --- a/xen/arch/x86/time.c
> > +++ b/xen/arch/x86/time.c
> > @@ -1550,6 +1550,36 @@ static const char *__init wallclock_type_to_string(void)
> > return "";
> > }
> >
> > +static int __init cf_check parse_wallclock(const char *arg)
> > +{
> > + if ( !arg )
> > + return -EINVAL;
> > +
> > + if ( !strcmp("auto", arg) )
> > + wallclock_source = WALLCLOCK_UNSET;
> > + else if ( !strcmp("xen", arg) )
> > + {
> > + if ( !xen_guest )
> > + return -EINVAL;
> > +
> > + wallclock_source = WALLCLOCK_XEN;
> > + }
> > + else if ( !strcmp("cmos", arg) )
> > + wallclock_source = WALLCLOCK_CMOS;
> > + else if ( !strcmp("efi", arg) )
> > + {
> > + if ( !efi_enabled(EFI_RS) )
> > + return -EINVAL;
>
> I'm afraid there's a problem here, and I'm sorry for not paying attention
> earlier: EFI_RS is possibly affected by "efi=" (and hence may change after
> this code ran). (It can also be cleared if ->SetVirtualAddressMap() fails,
> but I think that's strictly ahead of command line parsing.)
Hm, I see, thanks for noticing. Anyone using 'efi=no-rs
wallclock=efi' likely deserves to be punished. Would you be fine with
adding the following in init_xen_time():
/*
* EFI run time services can be disabled form the command line, hence the
* check for them cannot be done as part of the wallclock option parsing.
*/
if ( wallclock_source == WALLCLOCK_EFI && !efi_enabled(EFI_RS) )
wallclock_source = WALLCLOCK_UNSET;
if ( wallclock_source == WALLCLOCK_UNSET )
probe_wallclock();
Thanks, Roger.
next prev parent reply other threads:[~2024-09-10 13:10 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-09 14:54 [PATCH v5 0/4] x86/time: improvements to wallclock logic Roger Pau Monne
2024-09-09 14:54 ` [PATCH v5 1/4] x86/time: pull cmos_rtc_probe outside of function and rename Roger Pau Monne
2024-09-09 15:04 ` Jan Beulich
2024-09-09 14:54 ` [PATCH v5 2/4] x86/time: introduce probing logic for the wallclock Roger Pau Monne
2024-09-10 9:23 ` Jan Beulich
2024-09-09 14:54 ` [PATCH v5 3/4] x86/time: introduce command line option to select wallclock Roger Pau Monne
2024-09-10 9:32 ` Jan Beulich
2024-09-10 13:10 ` Roger Pau Monné [this message]
2024-09-10 13:49 ` Jan Beulich
2024-09-10 14:24 ` Roger Pau Monné
2024-09-10 14:29 ` Jan Beulich
2024-09-10 16:20 ` Roger Pau Monné
2024-09-09 14:54 ` [PATCH v5 4/4] x86/time: prefer CMOS over EFI_GET_TIME Roger Pau Monne
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=ZuBFNu_GFygZwvil@macbook.local \
--to=roger.pau@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=dpsmith@apertussolutions.com \
--cc=jbeulich@suse.com \
--cc=julien@xen.org \
--cc=marmarek@invisiblethingslab.com \
--cc=sstabellini@kernel.org \
--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.