[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1370316933.30695.7.camel@linux-s257.site>
Date: Tue, 04 Jun 2013 11:35:33 +0800
From: joeyli <jlee@...e.com>
To: Matthew Garrett <matthew.garrett@...ula.com>
Cc: "rja@....com" <rja@....com>, "mingo@...nel.org" <mingo@...nel.org>,
"torvalds@...ux-foundation.org" <torvalds@...ux-foundation.org>,
"bp@...en8.de" <bp@...en8.de>, "jkosina@...e.cz" <jkosina@...e.cz>,
"matt.fleming@...el.com" <matt.fleming@...el.com>,
"linux-efi@...r.kernel.org" <linux-efi@...r.kernel.org>,
"x86@...nel.org" <x86@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"hpa@...ux.intel.com" <hpa@...ux.intel.com>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"oneukum@...e.de" <oneukum@...e.de>
Subject: Re: [PATCH] Modify UEFI anti-bricking code
於 一,2013-06-03 於 16:31 +0000,Matthew Garrett 提到:
> On Tue, 2013-06-04 at 00:13 +0800, joeyli wrote:
>
> > Oliver raised a question for if power fails between that succesful
> > attempt and the deletion?
>
> It's a pretty tiny window, but sure. Making sure we delete it seems
> sensible. In that case we should make the GUID a #define rather than
> write it out twice.
>
Base on your patch, the following diff moved DUMMY GUID to #define, and
add a static efi name string:
Thanks a lot!
Joey Lee
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index 63e167a..cc3cfe8 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -53,6 +53,11 @@
#define EFI_DEBUG 1
+#define EFI_DUMMY_GUID \
+ EFI_GUID(0x4424ac57, 0xbe4b, 0x47dd, 0x9e, 0x97, 0xed, 0x50, 0xf0, 0x9f, 0x92, 0xa9)
+
+static efi_char16_t efi_dummy_name[6] = { 'D', 'U', 'M', 'M', 'Y', 0 };
+
struct efi __read_mostly efi = {
.mps = EFI_INVALID_TABLE_ADDR,
.acpi = EFI_INVALID_TABLE_ADDR,
@@ -981,6 +986,9 @@ void __init efi_enter_virtual_mode(void)
runtime_code_page_mkexec();
kfree(new_memmap);
+
+ /* clean DUMMY object */
+ efi.set_variable(efi_dummy_name, &EFI_DUMMY_GUID, 0, 0, NULL);
}
/*
@@ -1051,21 +1059,17 @@ efi_status_t efi_query_variable_store(u32 attributes, unsigned long size)
*/
unsigned long dummy_size = remaining_size + 1024;
void *dummy = kmalloc(dummy_size, GFP_ATOMIC);
- efi_char16_t efi_name[6] = { 'D', 'U', 'M', 'M', 'Y', 0 };
- efi_guid_t guid = EFI_GUID(0x4424ac57, 0xbe4b, 0x47dd, 0x9e,
- 0x97, 0xed, 0x50, 0xf0, 0x9f, 0x92,
- 0xa9);
- status = efi.set_variable(efi_name, &guid, attributes,
- dummy_size, dummy);
+ status = efi.set_variable(efi_dummy_name, &EFI_DUMMY_GUID,
+ attributes, dummy_size, dummy);
if (status == EFI_SUCCESS) {
/*
* This should have failed, so if it didn't make sure
* that we delete it...
*/
- efi.set_variable(efi_name, &guid, attributes, 0,
- dummy);
+ efi.set_variable(efi_dummy_name, &EFI_DUMMY_GUID,
+ attributes, 0, dummy);
}
/*
--
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