2011-02-20 04:44:42

by Matt Domsch

[permalink] [raw]
Subject: Re: [PATCH v1 3/6] driver: Google EFI SMI

On Thu, Jan 27, 2011 at 03:41:06PM -0800, Mike Waychison wrote:
> On Wed, Jan 26, 2011 at 5:22 PM, Mike Waychison <[email protected]> wrote:
>
> I've spent the last few hours looking at efivars.c and working out how
> I can refactor it to reuse all the kobject bits it uses. Does anybody
> use this thing though?
>
> I can't believe I was just lectured for crappy ABI when this thing
> takes a binary packed struct on write() and process it:
> - without regard to write length, and
> - in a way that isn't compatible across compat (both DataSize and
> Status are unsigned long!).
>
> struct efi_variable {
> efi_char16_t VariableName[1024/sizeof(efi_char16_t)];
> efi_guid_t VendorGuid;
> unsigned long DataSize;
> __u8 Data[1024];
> efi_status_t Status;
> __u32 Attributes;
> } __attribute__((packed));
>
> :(

I wrote that long before anyone believed there could be a 32-bit EFI
or 32-bit kernel running on a 64-bit EFI. Remember, this originated
on Itanium. I knew it was ugly, but the EFI spec itself defined the
DataSize and Status as they did.

--
Matt Domsch
Technology Strategist
Dell | Office of the CTO


2011-02-21 13:59:15

by Matthew Garrett

[permalink] [raw]
Subject: Re: [PATCH v1 3/6] driver: Google EFI SMI

On Sat, Feb 19, 2011 at 10:44:40PM -0600, Matt Domsch wrote:

> I wrote that long before anyone believed there could be a 32-bit EFI
> or 32-bit kernel running on a 64-bit EFI. Remember, this originated
> on Itanium. I knew it was ugly, but the EFI spec itself defined the
> DataSize and Status as they did.

How can a 32-bit kernel run on 64-bit EFI? I've seen vendors who keep
their EFI code above 4GB.

--
Matthew Garrett | [email protected]