Commit a34adf60 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'efi-fixes-for-v6.10-2' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi

Pull EFI fixes from Ard Biesheuvel:

 - Ensure that .discard sections are really discarded in the EFI zboot
   image build

 - Return proper error numbers from efi-pstore

 - Add __nocfi annotations to EFI runtime wrappers

* tag 'efi-fixes-for-v6.10-2' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi:
  efi: Add missing __nocfi annotations to runtime wrappers
  efi: pstore: Return proper errors on UEFI failures
  efi/libstub: zboot.lds: Discard .discard sections
parents 2df0193e 99280413
...@@ -136,7 +136,7 @@ static int efi_pstore_read_func(struct pstore_record *record, ...@@ -136,7 +136,7 @@ static int efi_pstore_read_func(struct pstore_record *record,
&size, record->buf); &size, record->buf);
if (status != EFI_SUCCESS) { if (status != EFI_SUCCESS) {
kfree(record->buf); kfree(record->buf);
return -EIO; return efi_status_to_err(status);
} }
/* /*
...@@ -189,7 +189,7 @@ static ssize_t efi_pstore_read(struct pstore_record *record) ...@@ -189,7 +189,7 @@ static ssize_t efi_pstore_read(struct pstore_record *record)
return 0; return 0;
if (status != EFI_SUCCESS) if (status != EFI_SUCCESS)
return -EIO; return efi_status_to_err(status);
/* skip variables that don't concern us */ /* skip variables that don't concern us */
if (efi_guidcmp(guid, LINUX_EFI_CRASH_GUID)) if (efi_guidcmp(guid, LINUX_EFI_CRASH_GUID))
...@@ -227,7 +227,7 @@ static int efi_pstore_write(struct pstore_record *record) ...@@ -227,7 +227,7 @@ static int efi_pstore_write(struct pstore_record *record)
record->size, record->psi->buf, record->size, record->psi->buf,
true); true);
efivar_unlock(); efivar_unlock();
return status == EFI_SUCCESS ? 0 : -EIO; return efi_status_to_err(status);
}; };
static int efi_pstore_erase(struct pstore_record *record) static int efi_pstore_erase(struct pstore_record *record)
...@@ -238,7 +238,7 @@ static int efi_pstore_erase(struct pstore_record *record) ...@@ -238,7 +238,7 @@ static int efi_pstore_erase(struct pstore_record *record)
PSTORE_EFI_ATTRIBUTES, 0, NULL); PSTORE_EFI_ATTRIBUTES, 0, NULL);
if (status != EFI_SUCCESS && status != EFI_NOT_FOUND) if (status != EFI_SUCCESS && status != EFI_NOT_FOUND)
return -EIO; return efi_status_to_err(status);
return 0; return 0;
} }
......
...@@ -41,6 +41,7 @@ SECTIONS ...@@ -41,6 +41,7 @@ SECTIONS
} }
/DISCARD/ : { /DISCARD/ : {
*(.discard .discard.*)
*(.modinfo .init.modinfo) *(.modinfo .init.modinfo)
} }
} }
......
...@@ -213,7 +213,7 @@ extern struct semaphore __efi_uv_runtime_lock __alias(efi_runtime_lock); ...@@ -213,7 +213,7 @@ extern struct semaphore __efi_uv_runtime_lock __alias(efi_runtime_lock);
* Calls the appropriate efi_runtime_service() with the appropriate * Calls the appropriate efi_runtime_service() with the appropriate
* arguments. * arguments.
*/ */
static void efi_call_rts(struct work_struct *work) static void __nocfi efi_call_rts(struct work_struct *work)
{ {
const union efi_rts_args *args = efi_rts_work.args; const union efi_rts_args *args = efi_rts_work.args;
efi_status_t status = EFI_NOT_FOUND; efi_status_t status = EFI_NOT_FOUND;
...@@ -435,7 +435,7 @@ static efi_status_t virt_efi_set_variable(efi_char16_t *name, ...@@ -435,7 +435,7 @@ static efi_status_t virt_efi_set_variable(efi_char16_t *name,
return status; return status;
} }
static efi_status_t static efi_status_t __nocfi
virt_efi_set_variable_nb(efi_char16_t *name, efi_guid_t *vendor, u32 attr, virt_efi_set_variable_nb(efi_char16_t *name, efi_guid_t *vendor, u32 attr,
unsigned long data_size, void *data) unsigned long data_size, void *data)
{ {
...@@ -469,7 +469,7 @@ static efi_status_t virt_efi_query_variable_info(u32 attr, ...@@ -469,7 +469,7 @@ static efi_status_t virt_efi_query_variable_info(u32 attr,
return status; return status;
} }
static efi_status_t static efi_status_t __nocfi
virt_efi_query_variable_info_nb(u32 attr, u64 *storage_space, virt_efi_query_variable_info_nb(u32 attr, u64 *storage_space,
u64 *remaining_space, u64 *max_variable_size) u64 *remaining_space, u64 *max_variable_size)
{ {
...@@ -499,10 +499,9 @@ static efi_status_t virt_efi_get_next_high_mono_count(u32 *count) ...@@ -499,10 +499,9 @@ static efi_status_t virt_efi_get_next_high_mono_count(u32 *count)
return status; return status;
} }
static void virt_efi_reset_system(int reset_type, static void __nocfi
efi_status_t status, virt_efi_reset_system(int reset_type, efi_status_t status,
unsigned long data_size, unsigned long data_size, efi_char16_t *data)
efi_char16_t *data)
{ {
if (down_trylock(&efi_runtime_lock)) { if (down_trylock(&efi_runtime_lock)) {
pr_warn("failed to invoke the reset_system() runtime service:\n" pr_warn("failed to invoke the reset_system() runtime service:\n"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment