Skip to content

Commit a34adf6

Browse files
committed
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
2 parents 2df0193 + 9928041 commit a34adf6

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

drivers/firmware/efi/efi-pstore.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ static int efi_pstore_read_func(struct pstore_record *record,
136136
&size, record->buf);
137137
if (status != EFI_SUCCESS) {
138138
kfree(record->buf);
139-
return -EIO;
139+
return efi_status_to_err(status);
140140
}
141141

142142
/*
@@ -189,7 +189,7 @@ static ssize_t efi_pstore_read(struct pstore_record *record)
189189
return 0;
190190

191191
if (status != EFI_SUCCESS)
192-
return -EIO;
192+
return efi_status_to_err(status);
193193

194194
/* skip variables that don't concern us */
195195
if (efi_guidcmp(guid, LINUX_EFI_CRASH_GUID))
@@ -227,7 +227,7 @@ static int efi_pstore_write(struct pstore_record *record)
227227
record->size, record->psi->buf,
228228
true);
229229
efivar_unlock();
230-
return status == EFI_SUCCESS ? 0 : -EIO;
230+
return efi_status_to_err(status);
231231
};
232232

233233
static int efi_pstore_erase(struct pstore_record *record)
@@ -238,7 +238,7 @@ static int efi_pstore_erase(struct pstore_record *record)
238238
PSTORE_EFI_ATTRIBUTES, 0, NULL);
239239

240240
if (status != EFI_SUCCESS && status != EFI_NOT_FOUND)
241-
return -EIO;
241+
return efi_status_to_err(status);
242242
return 0;
243243
}
244244

drivers/firmware/efi/libstub/zboot.lds

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ SECTIONS
4141
}
4242

4343
/DISCARD/ : {
44+
*(.discard .discard.*)
4445
*(.modinfo .init.modinfo)
4546
}
4647
}

drivers/firmware/efi/runtime-wrappers.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ extern struct semaphore __efi_uv_runtime_lock __alias(efi_runtime_lock);
213213
* Calls the appropriate efi_runtime_service() with the appropriate
214214
* arguments.
215215
*/
216-
static void efi_call_rts(struct work_struct *work)
216+
static void __nocfi efi_call_rts(struct work_struct *work)
217217
{
218218
const union efi_rts_args *args = efi_rts_work.args;
219219
efi_status_t status = EFI_NOT_FOUND;
@@ -435,7 +435,7 @@ static efi_status_t virt_efi_set_variable(efi_char16_t *name,
435435
return status;
436436
}
437437

438-
static efi_status_t
438+
static efi_status_t __nocfi
439439
virt_efi_set_variable_nb(efi_char16_t *name, efi_guid_t *vendor, u32 attr,
440440
unsigned long data_size, void *data)
441441
{
@@ -469,7 +469,7 @@ static efi_status_t virt_efi_query_variable_info(u32 attr,
469469
return status;
470470
}
471471

472-
static efi_status_t
472+
static efi_status_t __nocfi
473473
virt_efi_query_variable_info_nb(u32 attr, u64 *storage_space,
474474
u64 *remaining_space, u64 *max_variable_size)
475475
{
@@ -499,10 +499,9 @@ static efi_status_t virt_efi_get_next_high_mono_count(u32 *count)
499499
return status;
500500
}
501501

502-
static void virt_efi_reset_system(int reset_type,
503-
efi_status_t status,
504-
unsigned long data_size,
505-
efi_char16_t *data)
502+
static void __nocfi
503+
virt_efi_reset_system(int reset_type, efi_status_t status,
504+
unsigned long data_size, efi_char16_t *data)
506505
{
507506
if (down_trylock(&efi_runtime_lock)) {
508507
pr_warn("failed to invoke the reset_system() runtime service:\n"

0 commit comments

Comments
 (0)