All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/time: Don't use EFI's GetTime call by default
@ 2015-12-01 16:57 Ross Lagerwall
  2015-12-01 17:17 ` David Vrabel
  2015-12-01 17:26 ` Jan Beulich
  0 siblings, 2 replies; 10+ messages in thread
From: Ross Lagerwall @ 2015-12-01 16:57 UTC (permalink / raw)
  To: xen-devel; +Cc: Andrew Cooper, Jan Beulich, Ross Lagerwall

When EFI is used, don't use EFI's GetTime() to get the time, because it
is broken on many platforms. From Linux commit 7efe665903d0 ("rtc:
Disable EFI rtc for x86"):
"Disable it explicitly for x86 so that we don't give users false
hope that this driver will work - it won't, and your machine is likely
to crash."

Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
---
 xen/arch/x86/time.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 30d52c4..28895c2 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -679,20 +679,28 @@ static void __get_cmos_time(struct rtc_time *rtc)
         rtc->year += 100;
 }
 
+/* EFI's GetTime() is frequently broken so don't use it by default. */
+#undef USE_EFI_GET_TIME
+
 static unsigned long get_cmos_time(void)
 {
-    unsigned long res, flags;
+#ifdef USE_EFI_GET_TIME
+    unsigned long res;
+#endif
+    unsigned long flags;
     struct rtc_time rtc;
     unsigned int seconds = 60;
     static bool_t __read_mostly cmos_rtc_probe;
     boolean_param("cmos-rtc-probe", cmos_rtc_probe);
 
+#ifdef USE_EFI_GET_TIME
     if ( efi_enabled )
     {
         res = efi_get_time();
         if ( res )
             return res;
     }
+#endif
 
     if ( likely(!(acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_CMOS_RTC)) )
         cmos_rtc_probe = 0;
-- 
2.4.3

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-12-15 14:58 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-01 16:57 [PATCH] x86/time: Don't use EFI's GetTime call by default Ross Lagerwall
2015-12-01 17:17 ` David Vrabel
2015-12-01 17:26 ` Jan Beulich
2015-12-01 19:26   ` Andrew Cooper
2015-12-02  9:33     ` Jan Beulich
2015-12-08 11:02       ` Ian Campbell
2015-12-14 16:53         ` Konrad Rzeszutek Wilk
2015-12-14 17:04           ` Jan Beulich
2015-12-15  7:19         ` Jan Beulich
     [not found]           ` <20151215145032.GD2496@char.us.oracle.com>
2015-12-15 14:58             ` Jan Beulich

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.