All of lore.kernel.org
 help / color / mirror / Atom feed
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 v3 7/7] x86/time: probe the CMOS RTC by default
Date: Wed, 4 Sep 2024 14:45:00 +0200	[thread overview]
Message-ID: <ZthWTO6rOgAob-z_@macbook.local> (raw)
In-Reply-To: <66465a2a-f7a0-412d-b1af-98a28fd38472@suse.com>

On Tue, Sep 03, 2024 at 05:48:09PM +0200, Jan Beulich wrote:
> On 03.09.2024 15:03, Roger Pau Monne wrote:
> > Probing for the CMOS RTC registers consist in reading IO ports, and we expect
> > those reads to have no side effects even when the CMOS RTC is not present.
> 
> But what do we gain from this besides possible being slower to boot?

The intent is that Xen can successfully boot on more systems without
having to pass specific command line options.

> > --- a/docs/misc/xen-command-line.pandoc
> > +++ b/docs/misc/xen-command-line.pandoc
> > @@ -326,11 +326,14 @@ Interrupts.  Specifying zero disables CMCI handling.
> >  ### cmos-rtc-probe (x86)
> >  > `= <boolean>`
> >  
> > -> Default: `false`
> > +> Default: `true`
> >  
> >  Flag to indicate whether to probe for a CMOS Real Time Clock irrespective of
> >  ACPI indicating none to be there.
> >  
> > +**WARNING: The `cmos-rtc-probe` option is deprecated and superseded by
> > +_wallclock=no-cmos-probe_ using both options in combination is undefined.**
> 
> Hmm, but then ...
> 
> > @@ -2822,7 +2825,7 @@ suboptimal scheduling decisions, but only when the system is
> >  oversubscribed (i.e., in total there are more vCPUs than pCPUs).
> >  
> >  ### wallclock (x86)
> > -> `= auto | xen | cmos | efi`
> > +> `= auto | xen | cmos | no-cmos-probe | efi`
> 
> ... this wants to be a boolean sub-option "cmos-probe", such that the flag
> can still be set both ways (in particular for a later command line option
> to override an earlier one).

What's the point in overriding?  Either the users selects a specific
wallclock to use, or it's left for Xen to decide which wallclock to
pick, either with (auto) or without (no-cmos-probe) possibly probing
the CMOS RTC.

Multiple different wallclock options being passed on the command line
will result in just the last one taking effect.

> > @@ -2836,6 +2839,11 @@ Allow forcing the usage of a specific wallclock source.
> >  
> >   * `cmos` force usage of the CMOS RTC wallclock.
> >  
> > + * `no-cmos-probe` do not probe for the CMOS RTC presence if the ACPI FADT
> > +   table signals there's no CMOS RTC.  Implies using the same heuristics as
> > +   the `auto` option.  By default Xen will probe for the CMOS RTC presence
> > +   even when ACPI FADT signals no CMOS RTC available.
> 
> "By default ..." reads as if this would always occur, which I don't think
> is the case.

Hm, not when using the Xen timer source indeed, there's no probing
then.

> > @@ -1560,6 +1560,8 @@ static int __init cf_check parse_wallclock(const char *arg)
> >      if ( !arg )
> >          return -EINVAL;
> >  
> > +    cmos_rtc_probe = true;
> > +
> >      if ( !strcmp("auto", arg) )
> >          wallclock_source = WALLCLOCK_UNSET;
> >      else if ( !strcmp("xen", arg) )
> > @@ -1571,6 +1573,8 @@ static int __init cf_check parse_wallclock(const char *arg)
> >      }
> >      else if ( !strcmp("cmos", arg) )
> >          wallclock_source = WALLCLOCK_CMOS;
> > +    else if ( !strcmp("no-cmos-probe", arg) )
> > +        cmos_rtc_probe = false;
> >      else if ( !strcmp("efi", arg) )
> >      {
> >          if ( !efi_enabled(EFI_RS) )
> 
> And to request a particular wallclock _and_ control the probing one then
> needs two wallclock= on the command line? And - because of the forcing to
> true of cmos_rtc_probe - even in a particular order. Not very nice from a
> usability pov.

If you request a specific wallclock then there's no probing, so
nothing to control.  I agree the interface is not great, but I
couldn't come up with anything better.

I'm kind of fine with not introducing an extra option to wallclock= to
control the CMOS RTC probing, but would you agree to switching
cmos-rtc-probe to true by default?

Thanks, Roger.


  reply	other threads:[~2024-09-04 12:45 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-03 13:02 [PATCH v3 0/7] x86/time: improvements to wallclock logic Roger Pau Monne
2024-09-03 13:02 ` [PATCH v3 1/7] x86/time: introduce helper to fetch Xen wallclock when running as a guest Roger Pau Monne
2024-09-03 14:48   ` Jan Beulich
2024-09-04  9:29     ` Roger Pau Monné
2024-09-03 13:02 ` [PATCH v3 2/7] x86/time: move CMOS edge detection into read helper Roger Pau Monne
2024-09-03 15:02   ` Jan Beulich
2024-09-04  9:46     ` Roger Pau Monné
2024-09-03 13:02 ` [PATCH v3 3/7] x86/time: split CMOS read and probe logic into function Roger Pau Monne
2024-09-03 15:16   ` Jan Beulich
2024-09-04 10:48     ` Roger Pau Monné
2024-09-03 13:03 ` [PATCH v3 4/7] x86/time: introduce probing logic for the wallclock Roger Pau Monne
2024-09-03 15:32   ` Jan Beulich
2024-09-04 10:58     ` Roger Pau Monné
2024-09-04 11:49       ` Jan Beulich
2024-09-04 12:30         ` Roger Pau Monné
2024-09-04 12:41           ` Jan Beulich
2024-09-03 13:03 ` [PATCH v3 5/7] x86/time: prefer CMOS over EFI_GET_TIME Roger Pau Monne
2024-09-03 13:03 ` [PATCH v3 6/7] x86/time: introduce command line option to select wallclock Roger Pau Monne
2024-09-03 15:37   ` Jan Beulich
2024-09-03 13:03 ` [PATCH v3 7/7] x86/time: probe the CMOS RTC by default Roger Pau Monne
2024-09-03 15:48   ` Jan Beulich
2024-09-04 12:45     ` Roger Pau Monné [this message]
2024-09-04 13:21       ` Jan Beulich
2024-09-03 15:38 ` [PATCH v3 0/7] x86/time: improvements to wallclock logic Jan Beulich

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=ZthWTO6rOgAob-z_@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.