aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/boot/compressed/eboot.c6
-rw-r--r--drivers/firmware/efi/libstub/arm64-stub.c10
-rw-r--r--include/linux/efi.h8
3 files changed, 18 insertions, 6 deletions
diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c
index 47d3efff6805..09f36c0d9d4f 100644
--- a/arch/x86/boot/compressed/eboot.c
+++ b/arch/x86/boot/compressed/eboot.c
@@ -163,7 +163,8 @@ __setup_efi_pci32(efi_pci_io_protocol_32 *pci, struct pci_setup_rom **__rom)
163 if (status != EFI_SUCCESS) 163 if (status != EFI_SUCCESS)
164 goto free_struct; 164 goto free_struct;
165 165
166 memcpy(rom->romdata, pci->romimage, pci->romsize); 166 memcpy(rom->romdata, (void *)(unsigned long)pci->romimage,
167 pci->romsize);
167 return status; 168 return status;
168 169
169free_struct: 170free_struct:
@@ -269,7 +270,8 @@ __setup_efi_pci64(efi_pci_io_protocol_64 *pci, struct pci_setup_rom **__rom)
269 if (status != EFI_SUCCESS) 270 if (status != EFI_SUCCESS)
270 goto free_struct; 271 goto free_struct;
271 272
272 memcpy(rom->romdata, pci->romimage, pci->romsize); 273 memcpy(rom->romdata, (void *)(unsigned long)pci->romimage,
274 pci->romsize);
273 return status; 275 return status;
274 276
275free_struct: 277free_struct:
diff --git a/drivers/firmware/efi/libstub/arm64-stub.c b/drivers/firmware/efi/libstub/arm64-stub.c
index b9bd827caa22..1b4d465cc5d9 100644
--- a/drivers/firmware/efi/libstub/arm64-stub.c
+++ b/drivers/firmware/efi/libstub/arm64-stub.c
@@ -98,6 +98,16 @@ efi_status_t handle_kernel_image(efi_system_table_t *sys_table_arg,
98 (phys_seed >> 32) & mask : TEXT_OFFSET; 98 (phys_seed >> 32) & mask : TEXT_OFFSET;
99 99
100 /* 100 /*
101 * With CONFIG_RANDOMIZE_TEXT_OFFSET=y, TEXT_OFFSET may not
102 * be a multiple of EFI_KIMG_ALIGN, and we must ensure that
103 * we preserve the misalignment of 'offset' relative to
104 * EFI_KIMG_ALIGN so that statically allocated objects whose
105 * alignment exceeds PAGE_SIZE appear correctly aligned in
106 * memory.
107 */
108 offset |= TEXT_OFFSET % EFI_KIMG_ALIGN;
109
110 /*
101 * If KASLR is enabled, and we have some randomness available, 111 * If KASLR is enabled, and we have some randomness available,
102 * locate the kernel at a randomized offset in physical memory. 112 * locate the kernel at a randomized offset in physical memory.
103 */ 113 */
diff --git a/include/linux/efi.h b/include/linux/efi.h
index f1b7d68ac460..3016d8c456bc 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -395,8 +395,8 @@ typedef struct {
395 u32 attributes; 395 u32 attributes;
396 u32 get_bar_attributes; 396 u32 get_bar_attributes;
397 u32 set_bar_attributes; 397 u32 set_bar_attributes;
398 uint64_t romsize; 398 u64 romsize;
399 void *romimage; 399 u32 romimage;
400} efi_pci_io_protocol_32; 400} efi_pci_io_protocol_32;
401 401
402typedef struct { 402typedef struct {
@@ -415,8 +415,8 @@ typedef struct {
415 u64 attributes; 415 u64 attributes;
416 u64 get_bar_attributes; 416 u64 get_bar_attributes;
417 u64 set_bar_attributes; 417 u64 set_bar_attributes;
418 uint64_t romsize; 418 u64 romsize;
419 void *romimage; 419 u64 romimage;
420} efi_pci_io_protocol_64; 420} efi_pci_io_protocol_64;
421 421
422typedef struct { 422typedef struct {