From: Konrad Rzeszutek Wilk Subject: Re: [PATCH] x86/time: Don't use EFI's GetTime call by default Date: Mon, 14 Dec 2015 11:53:16 -0500 Message-ID: <20151214165316.GB9191@char.us.oracle.com> References: <1448989066-20343-1-git-send-email-ross.lagerwall@citrix.com> <565DE63902000078000BAFA2@prv-mh.provo.novell.com> <565DF463.9000908@citrix.com> <565EC8EC02000078000BB24F@prv-mh.provo.novell.com> <1449572536.16124.42.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline In-Reply-To: <1449572536.16124.42.camel@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: Andrew Cooper , xen-devel@lists.xen.org, Jan Beulich , Ross Lagerwall List-Id: xen-devel@lists.xenproject.org On Tue, Dec 08, 2015 at 11:02:16AM +0000, Ian Campbell wrote: > On Wed, 2015-12-02 at 02:33 -0700, Jan Beulich wrote: > > > > > On 01.12.15 at 20:26, wrote: > > > On 01/12/15 17:26, Jan Beulich wrote: > > > > > > > On 01.12.15 at 17:57, wrote: > > > > > 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 > > > > NAK, since being conceptually wrong (and both of my systems work > > > > fine). Vendors should get their firmware fixed, and by not using > > > > runtime service functions we would give them even less reason to > > > > do so. Until then we have "efi=3Dno-rs". > > > = > > > This is completely unreasonable. > > > = > > > It is not conceptually wrong. > > = > > I'm sorry, but no. Otherwise you mean to state that specifications > > don't even need to be written, since if people don't play by them, > > workarounds will get implemented anyway. > = > In an ideal world such specifications would indeed be worth the paper they > are written on. But the reality is that firmware implementations are often > complete rubbish and the Xen project has nowhere near the leverage needed > to actually get this fixed, even Linux lacks such leverage AFAICT. > = > In reality only Microsoft (and perhaps to a lesser extent Apple) have any > sort of ability to force things in this way (even so it is alleged in this > thread that even Windows avoids the GetTime call as too broken in the fie= ld > as well). We could confirm this right? We can run OVMF and instrument the 'GetTime' a= nd see what Windows does? > = > Given we have no leverage in this it seems to me that punishing our users > by ensuring that Xen won't work on the majority of EFI systems (based on > anecdotal evidence from both Andrew and yourself) is counter productive. > All it means is that at best we will get a continuous stream of bug repor= ts > from such users, or worse those users will just silently disappear and use > something else which Just Works on their hardware and tell their friends > that Xen is broken on modern hardware. > = > There is only the smallest chance they will actually report a bug to their > firmware vendor and even if they do there is basically an infinitesimal > chance that the vendor will care in the slightest given that Windows > presumably boots and works on that system. Plus I have had no luck actually finding a way to report this. Take for example my Lenovo hardware which has EFI holes everywhere.. > = > Realistically about all we can do is support efforts such as > http://biosbits.org/ > https://wiki.ubuntu.com/Kernel/Reference/fwts > https://01.org/linux-uefi-validation > and hope that they gain sufficient momentum, we certainly cannot effect a= ny > kind of change in the x86 firmware world directly ourselves by holding > basic Xen functionality to ransom. > = > > > =A0GetTime() is very well known completely > > > broken, especially after ExitBootServices(), to the point that every > > > other EFI implementation (including windows) completely avoids it. > > = > > I'm not sure about the order of things. I started working with EFI on > > IA64, where using runtime services is a must. Windows started > > using EFI on IA64 too, so I'm pretty convinced they used GetTime() > > there. Whether they didn't on x86 because x86 implementations > > because Windows never used those functions is simply an unknown. > = > I don't think it is relevant to use why x86 UEFI implementations are brok= en > in this way, just that it seems that the reality is that they mostly are. At least on Lenovo equipment they seem to assume a lot of things after ExitBootServicers - especially as we don't follow the same mechanism of switching to virtual addresses. (And Lenovo EFI code will blindly use virtual addresses after ExitBootServi= ces which is why hack allows me to run Xen on Lenovo equipment). > = > > > Vendors will not fix their firmware.=A0=A0Disabling all runtime servi= ces is > > > not a reasonable alternative. > > = > > Then we should see about adding support for "efi=3Dno-time". > = > And based on what I'm reading in this thread about the reliability of the > time RS in the field it seems to me we should make it the default (on x86 > at least) and provide efi=3Dtime to opt in. > = > Ian. > = > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel