[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1358927532.2496.24.camel@mfleming-mobl1.ger.corp.intel.com>
Date: Wed, 23 Jan 2013 07:52:12 +0000
From: Matt Fleming <matt@...sole-pimps.org>
To: Ben Hutchings <ben@...adent.org.uk>
Cc: "H. Peter Anvin" <hpa@...or.com>, linux-kernel@...r.kernel.org,
linux-efi@...r.kernel.org, Tim Gardner <rtg.canonical@...il.com>,
Matthew Garrett <mjg59@...f.ucam.org>,
Olof Johansson <olof@...om.net>,
Tony Luck <tony.luck@...el.com>,
Steve Langasek <steve.langasek@...onical.com>,
Colin Ian King <colin.king@...onical.com>,
David Airlie <airlied@...ux.ie>,
Corentin Chary <corentincj@...aif.net>,
Dave Jiang <dave.jiang@...el.com>,
Peter Jones <pjones@...hat.com>,
Konrad Rzeszutek Wilk <konrad@...nel.org>,
"Rafael J. Wysocki" <rjw@...k.pl>, stable@...r.kernel.org
Subject: Re: [PATCH 1/2] efi: Make 'efi_enabled' a function to query EFI
facilities
On Wed, 2013-01-23 at 04:16 +0000, Ben Hutchings wrote:
> On Mon, 2013-01-21 at 21:12 +0000, Matt Fleming wrote:
> [...]
> > From 92e73f936e40a8c6562e47425d434a4e62d2b8e2 Mon Sep 17 00:00:00 2001
> > From: Matt Fleming <matt.fleming@...el.com>
> > Date: Wed, 14 Nov 2012 09:42:35 +0000
> > Subject: [PATCH] efi: Make 'efi_enabled' a function to query EFI facilities
> >
> > Originally 'efi_enabled' indicated whether a kernel was booted from
> > EFI firmware. Over time its semantics have changed, and it now
> > indicates whether or not we are booted on an EFI machine with
> > bit-native firmware, e.g. 64-bit kernel with 64-bit firmware.
> >
> > The immediate motivation for this patch is the bug report at,
> >
> > https://bugs.launchpad.net/ubuntu-cdimage/+bug/1040557
> >
> > which details how running a platform driver on an EFI machine that is
> > designed to run under BIOS can cause the machine to become
> > bricked. Also, the following report,
> >
> > https://bugzilla.kernel.org/show_bug.cgi?id=47121
> >
> > details how running said driver can also cause Machine Check
> > Exceptions. Drivers need a new means of detecting whether they're
> > running on an EFI machine, as sadly the expression,
> >
> > if (!efi_enabled)
> >
> > hasn't been a sufficient condition for quite some time.
> [...]
>
> This patch maps the old efi_enabled flag to efi_enabled(EFI_BOOT). Your
> second patch adds a test for efi_enabled(EFI_BOOT) to the samsung-laptop
> driver. So the samsung-laptop driver could be fixed by adding a check
> for the old flag; it doesn't depend on the addition of new flags at all.
> The changes elsewhere may well be important, but the cited motivation
> here just doesn't make sense.
If we instead check for the old flag then the samsung-laptop driver
would run if booting a 32-bit kernel with 64-bit EFI firmware, or vice
versa, because efi_enabled == 0 in that case.
It's not sufficient to just check the old flag, the samsung-laptop
driver really can't be allowed to run at all if booting from EFI, and
the old flag doesn't provide us with that guarantee.
--
Matt Fleming, Intel Open Source Technology Center
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists