-
-
Notifications
You must be signed in to change notification settings - Fork 52
/
0604-x86-time-Don-t-use-EFI-s-GetTime-call-by-default.patch
52 lines (45 loc) · 1.58 KB
/
0604-x86-time-Don-t-use-EFI-s-GetTime-call-by-default.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
From d84e22ff2a88663e5dcb3cdced45faf2aac2fac1 Mon Sep 17 00:00:00 2001
From: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
Date: Tue, 1 Dec 2015 16:57:46 +0000
Subject: [PATCH] x86/time: Don't use EFI's GetTime call by default
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@xxxxxxxxxx>
---
xen/arch/x86/time.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index a97d78484105..45f6baf6270b 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -1245,20 +1245,25 @@ 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;
+ unsigned long flags;
struct rtc_time rtc;
unsigned int seconds = 60;
static bool __read_mostly cmos_rtc_probe;
boolean_param("cmos-rtc-probe", cmos_rtc_probe);
+#ifdef USE_EFI_GET_TIME
if ( efi_enabled(EFI_RS) )
{
- res = efi_get_time();
+ unsigned long res = efi_get_time();
if ( res )
return res;
}
+#endif
if ( likely(!(acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_CMOS_RTC)) )
cmos_rtc_probe = false;
--
2.44.0