Skip to content

Commit 174e5e9

Browse files
PatrickRudolphardbiesheuvel
authored andcommitted
efi/cper: Fix cper_ia_proc_ctx alignment
According to the UEFI Common Platform Error Record appendix, the IA32/X64 Processor Context Information Structure is a variable length structure, but "is padded with zeros if the size is not a multiple of 16 bytes". Currently this isn't honoured, causing all but the first structure to be garbage when printed. Thus align the size to be a multiple of 16. Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
1 parent bbc4578 commit 174e5e9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/firmware/efi/cper-x86.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ void cper_print_proc_ia(const char *pfx, const struct cper_sec_proc_ia *proc)
325325

326326
ctx_info = (struct cper_ia_proc_ctx *)err_info;
327327
for (i = 0; i < VALID_PROC_CXT_INFO_NUM(proc->validation_bits); i++) {
328-
int size = sizeof(*ctx_info) + ctx_info->reg_arr_size;
328+
int size = ALIGN(sizeof(*ctx_info) + ctx_info->reg_arr_size, 16);
329329
int groupsize = 4;
330330

331331
printk("%sContext Information Structure %d:\n", pfx, i);

0 commit comments

Comments
 (0)