x86/ACPI: allow CMOS RTC use even when ACPI says there is none
RFC PATCH 1/1 x86/ACPI: allow CMOS RTC use even when ACPI says there is none
HP is setting the ACPI_FADT_NO_CMOS_RTC flag on newer systems, regardless of whether they're being booted from UEFI. Add a command line option to allow probing for a working RTC in that case.
Note that this still has some debugging code (//temp) in it (and no S-o-b for that reason).
docs/misc/xen-command-line.markdown +8 -0
@@ -218,6 +218,14 @@ If set, override Xen's calculation of th If set, override Xen's default choice for the platform timer. +### cmos-rtc-probe +> `= <boolean>` + +> Default: `false` + +Flag to indicate whether to probe for a CMOS Real Time Clock irrespective of +ACPI indicating none to be there. + ### com1,com2 > `= <baud>[/<clock_hz>][,[DPS][,[<io-base>|pci|amt][,[<irq>][,[<port-bdf>][,[<bridge-bdf>]]]]]]`
xen/arch/x86/time.c +72 -32
132 lines not on this page · raw message
x86/ACPI: allow CMOS RTC use even when ACPI says there is none
HP is setting the ACPI_FADT_NO_CMOS_RTC flag on newer systems, regardless of whether they're being booted from UEFI. Add a command line option to allow probing for a working RTC in that case.
Note that this still has some debugging code (//temp) in it (and no S-o-b for that reason).
docs/misc/xen-command-line.markdown +8 -0
@@ -218,6 +218,14 @@ If set, override Xen's calculation of th If set, override Xen's default choice for the platform timer. +### cmos-rtc-probe +> `= <boolean>` + +> Default: `false` + +Flag to indicate whether to probe for a CMOS Real Time Clock irrespective of +ACPI indicating none to be there. + ### com1,com2 > `= <baud>[/<clock_hz>][,[DPS][,[<io-base>|pci|amt][,[<irq>][,[<port-bdf>][,[<bridge-bdf>]]]]]]`
xen/arch/x86/time.c +72 -32
132 lines not on this page · raw message
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 3 lines · Jan Beulich
HP is setting the
ACPI_FADT_NO_CMOS_RTCflag on newer systems, regardless of whether they're being booted from UEFI. Add a command line option to allow probing for a working RTC in that case.
I like this general direction. I would add a printk in the case where we are probing, since the probe will stall boot for >= 1 sec.
Maybe also worth checking that the times returned on the two passes actually make sense (i.e. that the difference in RTC times matches the difference in NOW() to within +/- 10ms).
Thirdly, since get_cmos_time() can be called more than once, I think that just leaving cmos_rtc_probe == 0 could make us panic on the second invocation.
Cheers,
Tim.
Quoted 8 lines
Quoted 1 line
Quoted 1 line · On 26.06.14 at 13:12, <[email protected]> wrote:
Quoted 3 lines · Jan Beulich
HP is setting the
ACPI_FADT_NO_CMOS_RTCflag on newer systems, regardless of whether they're being booted from UEFI. Add a command line option to allow probing for a working RTC in that case.I like this general direction. I would add a printk in the case where we are probing, since the probe will stall boot for >= 1 sec.
Right now we stall for up to 1 sec already; since the probing doesn't happen without being asked for, I don't view it as a problem that now we stall for up to 2 sec.
Quoted 3 lines
Maybe also worth checking that the times returned on the two passes actually make sense (i.e. that the difference in RTC times matches the difference in
NOW()to within +/- 10ms).
I had considered this too, but intentionally dropped the idea, so that odd behavior when running in nested virtualization scenarios can be avoided.
Quoted 3 lines
Thirdly, since
get_cmos_time()can be called more than once, I think that just leavingcmos_rtc_probe== 0 could make us panic on the second invocation.
Very good point, this definitely needs fixing. I guess I'll just amend the condition with a system_state check.
Jan
Quoted 6 lines · Jan Beulich
Quoted 6 lines
Quoted 1 line
Quoted 1 line · On 26.06.14 at 13:12, <[email protected]> wrote:
Quoted 3 lines · Jan Beulich
HP is setting the
ACPI_FADT_NO_CMOS_RTCflag on newer systems, regardless of whether they're being booted from UEFI. Add a command line option to allow probing for a working RTC in that case.
Quoted 6 lines
Quoted 2 lines
I like this general direction. I would add a printk in the case where we are probing, since the probe will stall boot for >= 1 sec.
Right now we stall for up to 1 sec already; since the probing doesn't happen without being asked for, I don't view it as a problem that now we stall for up to 2 sec.
Ack.
Quoted 7 lines
Quoted 3 lines
Maybe also worth checking that the times returned on the two passes actually make sense (i.e. that the difference in RTC times matches the difference in
NOW()to within +/- 10ms).I had considered this too, but intentionally dropped the idea, so that odd behavior when running in nested virtualization scenarios can be avoided.
I guess so. We'd have to be running inside a hypervisor that has the same buggy tables as these HP machines, but OTOH anything that passes the tests you already have looks quite a lot like an RTC. :)
Tim.