Skip to contentSkip to conversation

efi/loongarch: Directly position the loaded image file

PATCH In review [email protected] 3 participants 10 messages Dec 19, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 efi/loongarch: Directly position the loaded image file

From: Wang Yao <[email protected]>

The use of the 'kernel_offset' variable to position the image file that has been loaded by UEFI or GRUB is unnecessary, because we can directly position the loaded image file through using the image_base field of the efi_loaded_image struct provided by UEFI.

Replace kernel_offset with image_base to positon the image file that has been loaded by UEFI or GRUB.

---

v1->v2:
Rewrite the commit log include 'why', not just include 'how'.

 arch/loongarch/include/asm/efi.h              | 2 --
 arch/loongarch/kernel/head.S                  | 1 -
 arch/loongarch/kernel/image-vars.h            | 1 -
 arch/loongarch/kernel/vmlinux.lds.S           | 1 -
 drivers/firmware/efi/libstub/loongarch-stub.c | 9 +++++----
 drivers/firmware/efi/libstub/loongarch-stub.h | 4 ++++
 drivers/firmware/efi/libstub/loongarch.c      | 6 ++++--
 7 files changed, 13 insertions(+), 11 deletions(-)
 create mode 100644 drivers/firmware/efi/libstub/loongarch-stub.h
arch/loongarch/include/asm/efi.h +0 -2
index 91d81f9730ab..eddc8e79b3fa 100644
@@ -32,6 +32,4 @@ static inline unsigned long efi_get_kimg_min_align(void)
 
 #define EFI_KIMG_PREFERRED_ADDRESS	PHYSADDR(VMLINUX_LOAD_ADDRESS)
 
-unsigned long kernel_entry_address(unsigned long kernel_addr);
-
 #endif /* _ASM_LOONGARCH_EFI_H */
arch/loongarch/kernel/head.S +0 -1
index 53b883db0786..0ecab4216392 100644
@@ -34,7 +34,6 @@ pe_header:
 
 SYM_DATA(kernel_asize, .long _kernel_asize);
 SYM_DATA(kernel_fsize, .long _kernel_fsize);
-SYM_DATA(kernel_offset, .long _kernel_offset);
 
 #endif
 
arch/loongarch/kernel/image-vars.h +0 -1
index 5087416b9678..41ddcf56d21c 100644
@@ -11,7 +11,6 @@ __efistub_strcmp		= strcmp;
 __efistub_kernel_entry		= kernel_entry;
 __efistub_kernel_asize		= kernel_asize;
 __efistub_kernel_fsize		= kernel_fsize;
-__efistub_kernel_offset		= kernel_offset;
 #if defined(CONFIG_EFI_EARLYCON) || defined(CONFIG_SYSFB)
 __efistub_screen_info		= screen_info;
 #endif
arch/loongarch/kernel/vmlinux.lds.S +0 -1
index bb2ec86f37a8..a5d0cd2035da 100644
@@ -143,7 +143,6 @@ SECTIONS
 	_kernel_fsize = _edata - _text;
 	_kernel_vsize = _end - __initdata_begin;
 	_kernel_rsize = _edata - __initdata_begin;
-	_kernel_offset = kernel_offset - _text;
 #endif
 
 	.gptab.sdata : {
drivers/firmware/efi/libstub/loongarch-stub.c +5 -4
index d6ec5d4b8dbe..736b6aae323d 100644
@@ -8,10 +8,10 @@
 #include <asm/efi.h>
 #include <asm/addrspace.h>
 #include "efistub.h"
+#include "loongarch-stub.h"
 
 extern int kernel_asize;
 extern int kernel_fsize;
-extern int kernel_offset;
 extern int kernel_entry;
 
 efi_status_t handle_kernel_image(unsigned long *image_addr,
@@ -24,7 +24,7 @@ efi_status_t handle_kernel_image(unsigned long *image_addr,
 	efi_status_t status;
 	unsigned long kernel_addr = 0;
 
-	kernel_addr = (unsigned long)&kernel_offset - kernel_offset;
+	kernel_addr = (unsigned long)image->image_base;
 
 	status = efi_relocate_kernel(&kernel_addr, kernel_fsize, kernel_asize,
 		     EFI_KIMG_PREFERRED_ADDRESS, efi_get_kimg_min_align(), 0x0);
@@ -35,9 +35,10 @@ efi_status_t handle_kernel_image(unsigned long *image_addr,
 	return status;
 }
 
-unsigned long kernel_entry_address(unsigned long kernel_addr)
+unsigned long kernel_entry_address(unsigned long kernel_addr,
+		efi_loaded_image_t *image)
 {
-	unsigned long base = (unsigned long)&kernel_offset - kernel_offset;
+	unsigned long base = (unsigned long)image->image_base;
 
 	return (unsigned long)&kernel_entry - base + kernel_addr;
 }
drivers/firmware/efi/libstub/loongarch-stub.h new file +4 -0
new file mode 100644
index 000000000000..cd015955a015
@@ -0,0 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+unsigned long kernel_entry_address(unsigned long kernel_addr,
+		efi_loaded_image_t *image);
drivers/firmware/efi/libstub/loongarch.c +4 -2
index 0e0aa6cda73f..684c9354637c 100644
@@ -8,6 +8,7 @@
 #include <asm/efi.h>
 #include <asm/addrspace.h>
 #include "efistub.h"
+#include "loongarch-stub.h"
 
 typedef void __noreturn (*kernel_entry_t)(bool efi, unsigned long cmdline,
 					  unsigned long systab);
@@ -37,7 +38,8 @@ static efi_status_t exit_boot_func(struct efi_boot_memmap *map, void *priv)
 	return EFI_SUCCESS;
 }
 
-unsigned long __weak kernel_entry_address(unsigned long kernel_addr)
+unsigned long __weak kernel_entry_address(unsigned long kernel_addr,
+		efi_loaded_image_t *image)
 {
 	return *(unsigned long *)(kernel_addr + 8) - VMLINUX_LOAD_ADDRESS + kernel_addr;
 }
@@ -73,7 +75,7 @@ efi_status_t efi_boot_kernel(void *handle, efi_loaded_image_t *image,
 	csr_write64(CSR_DMW0_INIT, LOONGARCH_CSR_DMWIN0);
 	csr_write64(CSR_DMW1_INIT, LOONGARCH_CSR_DMWIN1);
 
-	real_kernel_entry = (void *)kernel_entry_address(kernel_addr);
+	real_kernel_entry = (void *)kernel_entry_address(kernel_addr, image);
 
 	real_kernel_entry(true, (unsigned long)cmdline_ptr,
 			  (unsigned long)efi_system_table);
Signature · 1 line
2.27.0
maintainer
#1 lore raw
Quoted 32 lines · On Tue, 19 Dec 2023 at 10:14, <[email protected]> wrote:

From: Wang Yao <[email protected]>

The use of the 'kernel_offset' variable to position the image file that has been loaded by UEFI or GRUB is unnecessary, because we can directly position the loaded image file through using the image_base field of the efi_loaded_image struct provided by UEFI.

Replace kernel_offset with image_base to positon the image file that has been loaded by UEFI or GRUB.

---

v1->v2:
Rewrite the commit log include 'why', not just include 'how'.

 arch/loongarch/include/asm/efi.h              | 2 --
 arch/loongarch/kernel/head.S                  | 1 -
 arch/loongarch/kernel/image-vars.h            | 1 -
 arch/loongarch/kernel/vmlinux.lds.S           | 1 -
 drivers/firmware/efi/libstub/loongarch-stub.c | 9 +++++----
 drivers/firmware/efi/libstub/loongarch-stub.h | 4 ++++
 drivers/firmware/efi/libstub/loongarch.c      | 6 ++++--
 7 files changed, 13 insertions(+), 11 deletions(-)
 create mode 100644 drivers/firmware/efi/libstub/loongarch-stub.h
arch/loongarch/include/asm/efi.h +0 -0
index 91d81f9730ab..eddc8e79b3fa 100644

arch/loongarch/include/asm/efi.h static inline unsigned long efi_get_kimg_min_align(void) · line 36

Quoted 5 lines
arch/loongarch/include/asm/efi.h +0 -2
@@ -32,6 +32,4 @@ static inline unsigned long efi_get_kimg_min_align(void)
 
 #define EFI_KIMG_PREFERRED_ADDRESS     PHYSADDR(VMLINUX_LOAD_ADDRESS)
 
-unsigned long kernel_entry_address(unsigned long kernel_addr);
-

Why are you removing this? Won't that cause missing prototype warnings?

The rest of the patch looks fine to me, but I haven't tested it.

Quoted 119 lines
arch/loongarch/include/asm/efi.h +0 -0
 #endif /* _ASM_LOONGARCH_EFI_H */
arch/loongarch/kernel/head.S +0 -1
index 53b883db0786..0ecab4216392 100644
@@ -34,7 +34,6 @@ pe_header:
 
 SYM_DATA(kernel_asize, .long _kernel_asize);
 SYM_DATA(kernel_fsize, .long _kernel_fsize);
-SYM_DATA(kernel_offset, .long _kernel_offset);
 
 #endif
 
arch/loongarch/kernel/image-vars.h +0 -1
index 5087416b9678..41ddcf56d21c 100644
@@ -11,7 +11,6 @@ __efistub_strcmp              = strcmp;
 __efistub_kernel_entry         = kernel_entry;
 __efistub_kernel_asize         = kernel_asize;
 __efistub_kernel_fsize         = kernel_fsize;
-__efistub_kernel_offset                = kernel_offset;
 #if defined(CONFIG_EFI_EARLYCON) || defined(CONFIG_SYSFB)
 __efistub_screen_info          = screen_info;
 #endif
arch/loongarch/kernel/vmlinux.lds.S +0 -1
index bb2ec86f37a8..a5d0cd2035da 100644
@@ -143,7 +143,6 @@ SECTIONS
        _kernel_fsize = _edata - _text;
        _kernel_vsize = _end - __initdata_begin;
        _kernel_rsize = _edata - __initdata_begin;
-       _kernel_offset = kernel_offset - _text;
 #endif
 
        .gptab.sdata : {
drivers/firmware/efi/libstub/loongarch-stub.c +5 -4
index d6ec5d4b8dbe..736b6aae323d 100644
@@ -8,10 +8,10 @@
 #include <asm/efi.h>
 #include <asm/addrspace.h>
 #include "efistub.h"
+#include "loongarch-stub.h"
 
 extern int kernel_asize;
 extern int kernel_fsize;
-extern int kernel_offset;
 extern int kernel_entry;
 
 efi_status_t handle_kernel_image(unsigned long *image_addr,
@@ -24,7 +24,7 @@ efi_status_t handle_kernel_image(unsigned long *image_addr,
        efi_status_t status;
        unsigned long kernel_addr = 0;
 
-       kernel_addr = (unsigned long)&kernel_offset - kernel_offset;
+       kernel_addr = (unsigned long)image->image_base;
 
        status = efi_relocate_kernel(&kernel_addr, kernel_fsize, kernel_asize,
                     EFI_KIMG_PREFERRED_ADDRESS, efi_get_kimg_min_align(), 0x0);
@@ -35,9 +35,10 @@ efi_status_t handle_kernel_image(unsigned long *image_addr,
        return status;
 }
 
-unsigned long kernel_entry_address(unsigned long kernel_addr)
+unsigned long kernel_entry_address(unsigned long kernel_addr,
+               efi_loaded_image_t *image)
 {
-       unsigned long base = (unsigned long)&kernel_offset - kernel_offset;
+       unsigned long base = (unsigned long)image->image_base;
 
        return (unsigned long)&kernel_entry - base + kernel_addr;
 }
drivers/firmware/efi/libstub/loongarch-stub.h new file +4 -0
new file mode 100644
index 000000000000..cd015955a015
@@ -0,0 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+unsigned long kernel_entry_address(unsigned long kernel_addr,
+               efi_loaded_image_t *image);
drivers/firmware/efi/libstub/loongarch.c +4 -3
index 0e0aa6cda73f..684c9354637c 100644
@@ -8,6 +8,7 @@
 #include <asm/efi.h>
 #include <asm/addrspace.h>
 #include "efistub.h"
+#include "loongarch-stub.h"
 
 typedef void __noreturn (*kernel_entry_t)(bool efi, unsigned long cmdline,
                                          unsigned long systab);
@@ -37,7 +38,8 @@ static efi_status_t exit_boot_func(struct efi_boot_memmap *map, void *priv)
        return EFI_SUCCESS;
 }
 
-unsigned long __weak kernel_entry_address(unsigned long kernel_addr)
+unsigned long __weak kernel_entry_address(unsigned long kernel_addr,
+               efi_loaded_image_t *image)
 {
        return *(unsigned long *)(kernel_addr + 8) - VMLINUX_LOAD_ADDRESS + kernel_addr;
 }
@@ -73,7 +75,7 @@ efi_status_t efi_boot_kernel(void *handle, efi_loaded_image_t *image,
        csr_write64(CSR_DMW0_INIT, LOONGARCH_CSR_DMWIN0);
        csr_write64(CSR_DMW1_INIT, LOONGARCH_CSR_DMWIN1);
 
-       real_kernel_entry = (void *)kernel_entry_address(kernel_addr);
+       real_kernel_entry = (void *)kernel_entry_address(kernel_addr, image);
 
        real_kernel_entry(true, (unsigned long)cmdline_ptr,
                          (unsigned long)efi_system_table);
--

2.27.0

#2 lore raw
Quoted 35 lines · Ard Biesheuvel <[email protected]> 于2023年12月19日周二 17:22写道:
Quoted 33 lines · On Tue, 19 Dec 2023 at 10:14, <[email protected]> wrote:

From: Wang Yao <[email protected]>

The use of the 'kernel_offset' variable to position the image file that has been loaded by UEFI or GRUB is unnecessary, because we can directly position the loaded image file through using the image_base field of the efi_loaded_image struct provided by UEFI.

Replace kernel_offset with image_base to positon the image file that has been loaded by UEFI or GRUB.

---

v1->v2:
Rewrite the commit log include 'why', not just include 'how'.

 arch/loongarch/include/asm/efi.h              | 2 --
 arch/loongarch/kernel/head.S                  | 1 -
 arch/loongarch/kernel/image-vars.h            | 1 -
 arch/loongarch/kernel/vmlinux.lds.S           | 1 -
 drivers/firmware/efi/libstub/loongarch-stub.c | 9 +++++----
 drivers/firmware/efi/libstub/loongarch-stub.h | 4 ++++
 drivers/firmware/efi/libstub/loongarch.c      | 6 ++++--
 7 files changed, 13 insertions(+), 11 deletions(-)
 create mode 100644 drivers/firmware/efi/libstub/loongarch-stub.h
arch/loongarch/include/asm/efi.h +0 -0
index 91d81f9730ab..eddc8e79b3fa 100644
@@ -32,6 +32,4 @@ static inline unsigned long efi_get_kimg_min_align(void)
 
Quoted 9 lines

arch/loongarch/include/asm/efi.h static inline unsigned long efi_get_kimg_min_align(void) · line 36

Quoted 4 lines
arch/loongarch/include/asm/efi.h +0 -2
 #define EFI_KIMG_PREFERRED_ADDRESS     PHYSADDR(VMLINUX_LOAD_ADDRESS)
 
-unsigned long kernel_entry_address(unsigned long kernel_addr);
-

Why are you removing this? Won't that cause missing prototype warnings?

The rest of the patch looks fine to me, but I haven't tested it.

Because the efi_loaded_image_t struct is defined in the efistub.h.

Quoted 119 lines
Quoted 119 lines
arch/loongarch/include/asm/efi.h +0 -0
 #endif /* _ASM_LOONGARCH_EFI_H */
arch/loongarch/kernel/head.S +0 -1
index 53b883db0786..0ecab4216392 100644
@@ -34,7 +34,6 @@ pe_header:
 
 SYM_DATA(kernel_asize, .long _kernel_asize);
 SYM_DATA(kernel_fsize, .long _kernel_fsize);
-SYM_DATA(kernel_offset, .long _kernel_offset);
 
 #endif
 
arch/loongarch/kernel/image-vars.h +0 -1
index 5087416b9678..41ddcf56d21c 100644
@@ -11,7 +11,6 @@ __efistub_strcmp              = strcmp;
 __efistub_kernel_entry         = kernel_entry;
 __efistub_kernel_asize         = kernel_asize;
 __efistub_kernel_fsize         = kernel_fsize;
-__efistub_kernel_offset                = kernel_offset;
 #if defined(CONFIG_EFI_EARLYCON) || defined(CONFIG_SYSFB)
 __efistub_screen_info          = screen_info;
 #endif
arch/loongarch/kernel/vmlinux.lds.S +0 -1
index bb2ec86f37a8..a5d0cd2035da 100644
@@ -143,7 +143,6 @@ SECTIONS
        _kernel_fsize = _edata - _text;
        _kernel_vsize = _end - __initdata_begin;
        _kernel_rsize = _edata - __initdata_begin;
-       _kernel_offset = kernel_offset - _text;
 #endif
 
        .gptab.sdata : {
drivers/firmware/efi/libstub/loongarch-stub.c +5 -4
index d6ec5d4b8dbe..736b6aae323d 100644
@@ -8,10 +8,10 @@
 #include <asm/efi.h>
 #include <asm/addrspace.h>
 #include "efistub.h"
+#include "loongarch-stub.h"
 
 extern int kernel_asize;
 extern int kernel_fsize;
-extern int kernel_offset;
 extern int kernel_entry;
 
 efi_status_t handle_kernel_image(unsigned long *image_addr,
@@ -24,7 +24,7 @@ efi_status_t handle_kernel_image(unsigned long *image_addr,
        efi_status_t status;
        unsigned long kernel_addr = 0;
 
-       kernel_addr = (unsigned long)&kernel_offset - kernel_offset;
+       kernel_addr = (unsigned long)image->image_base;
 
        status = efi_relocate_kernel(&kernel_addr, kernel_fsize, kernel_asize,
                     EFI_KIMG_PREFERRED_ADDRESS, efi_get_kimg_min_align(), 0x0);
@@ -35,9 +35,10 @@ efi_status_t handle_kernel_image(unsigned long *image_addr,
        return status;
 }
 
-unsigned long kernel_entry_address(unsigned long kernel_addr)
+unsigned long kernel_entry_address(unsigned long kernel_addr,
+               efi_loaded_image_t *image)
 {
-       unsigned long base = (unsigned long)&kernel_offset - kernel_offset;
+       unsigned long base = (unsigned long)image->image_base;
 
        return (unsigned long)&kernel_entry - base + kernel_addr;
 }
drivers/firmware/efi/libstub/loongarch-stub.h new file +4 -0
new file mode 100644
index 000000000000..cd015955a015
@@ -0,0 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+unsigned long kernel_entry_address(unsigned long kernel_addr,
+               efi_loaded_image_t *image);
drivers/firmware/efi/libstub/loongarch.c +4 -3
index 0e0aa6cda73f..684c9354637c 100644
@@ -8,6 +8,7 @@
 #include <asm/efi.h>
 #include <asm/addrspace.h>
 #include "efistub.h"
+#include "loongarch-stub.h"
 
 typedef void __noreturn (*kernel_entry_t)(bool efi, unsigned long cmdline,
                                          unsigned long systab);
@@ -37,7 +38,8 @@ static efi_status_t exit_boot_func(struct efi_boot_memmap *map, void *priv)
        return EFI_SUCCESS;
 }
 
-unsigned long __weak kernel_entry_address(unsigned long kernel_addr)
+unsigned long __weak kernel_entry_address(unsigned long kernel_addr,
+               efi_loaded_image_t *image)
 {
        return *(unsigned long *)(kernel_addr + 8) - VMLINUX_LOAD_ADDRESS + kernel_addr;
 }
@@ -73,7 +75,7 @@ efi_status_t efi_boot_kernel(void *handle, efi_loaded_image_t *image,
        csr_write64(CSR_DMW0_INIT, LOONGARCH_CSR_DMWIN0);
        csr_write64(CSR_DMW1_INIT, LOONGARCH_CSR_DMWIN1);
 
-       real_kernel_entry = (void *)kernel_entry_address(kernel_addr);
+       real_kernel_entry = (void *)kernel_entry_address(kernel_addr, image);
 
        real_kernel_entry(true, (unsigned long)cmdline_ptr,
                          (unsigned long)efi_system_table);
--

2.27.0

maintainer
#3 lore raw
Quoted 44 lines · Ainux Wang
Quoted 42 lines · Ard Biesheuvel <[email protected]> 于2023年12月19日周二 17:22写道:
Quoted 32 lines · On Tue, 19 Dec 2023 at 10:14, <[email protected]> wrote:

From: Wang Yao <[email protected]>

The use of the 'kernel_offset' variable to position the image file that has been loaded by UEFI or GRUB is unnecessary, because we can directly position the loaded image file through using the image_base field of the efi_loaded_image struct provided by UEFI.

Replace kernel_offset with image_base to positon the image file that has been loaded by UEFI or GRUB.

---

v1->v2:
Rewrite the commit log include 'why', not just include 'how'.

 arch/loongarch/include/asm/efi.h              | 2 --
 arch/loongarch/kernel/head.S                  | 1 -
 arch/loongarch/kernel/image-vars.h            | 1 -
 arch/loongarch/kernel/vmlinux.lds.S           | 1 -
 drivers/firmware/efi/libstub/loongarch-stub.c | 9 +++++----
 drivers/firmware/efi/libstub/loongarch-stub.h | 4 ++++
 drivers/firmware/efi/libstub/loongarch.c      | 6 ++++--
 7 files changed, 13 insertions(+), 11 deletions(-)
 create mode 100644 drivers/firmware/efi/libstub/loongarch-stub.h
arch/loongarch/include/asm/efi.h +0 -0
index 91d81f9730ab..eddc8e79b3fa 100644

arch/loongarch/include/asm/efi.h static inline unsigned long efi_get_kimg_min_align(void) · line 36

Quoted 5 lines
arch/loongarch/include/asm/efi.h +0 -2
@@ -32,6 +32,4 @@ static inline unsigned long efi_get_kimg_min_align(void)
 
 #define EFI_KIMG_PREFERRED_ADDRESS     PHYSADDR(VMLINUX_LOAD_ADDRESS)
 
-unsigned long kernel_entry_address(unsigned long kernel_addr);
-

Why are you removing this? Won't that cause missing prototype warnings?

Quoted 5 lines
Quoted 2 lines

The rest of the patch looks fine to me, but I haven't tested it.

Because the efi_loaded_image_t struct is defined in the efistub.h.

And the other question?

maintainer
#4 lore raw
Quoted 46 lines · Ard Biesheuvel
Quoted 44 lines · Ainux Wang
Quoted 42 lines · Ard Biesheuvel <[email protected]> 于2023年12月19日周二 17:22写道:
Quoted 32 lines · On Tue, 19 Dec 2023 at 10:14, <[email protected]> wrote:

From: Wang Yao <[email protected]>

The use of the 'kernel_offset' variable to position the image file that has been loaded by UEFI or GRUB is unnecessary, because we can directly position the loaded image file through using the image_base field of the efi_loaded_image struct provided by UEFI.

Replace kernel_offset with image_base to positon the image file that has been loaded by UEFI or GRUB.

---

v1->v2:
Rewrite the commit log include 'why', not just include 'how'.

 arch/loongarch/include/asm/efi.h              | 2 --
 arch/loongarch/kernel/head.S                  | 1 -
 arch/loongarch/kernel/image-vars.h            | 1 -
 arch/loongarch/kernel/vmlinux.lds.S           | 1 -
 drivers/firmware/efi/libstub/loongarch-stub.c | 9 +++++----
 drivers/firmware/efi/libstub/loongarch-stub.h | 4 ++++
 drivers/firmware/efi/libstub/loongarch.c      | 6 ++++--
 7 files changed, 13 insertions(+), 11 deletions(-)
 create mode 100644 drivers/firmware/efi/libstub/loongarch-stub.h
arch/loongarch/include/asm/efi.h +0 -0
index 91d81f9730ab..eddc8e79b3fa 100644

arch/loongarch/include/asm/efi.h static inline unsigned long efi_get_kimg_min_align(void) · line 36

Quoted 5 lines
arch/loongarch/include/asm/efi.h +0 -2
@@ -32,6 +32,4 @@ static inline unsigned long efi_get_kimg_min_align(void)
 
 #define EFI_KIMG_PREFERRED_ADDRESS     PHYSADDR(VMLINUX_LOAD_ADDRESS)
 
-unsigned long kernel_entry_address(unsigned long kernel_addr);
-

Why are you removing this? Won't that cause missing prototype warnings?

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

The rest of the patch looks fine to me, but I haven't tested it.

Because the efi_loaded_image_t struct is defined in the efistub.h.

And the other question?

OK, you replied to me in private

Quoted 3 lines

So move the kernel_entry_address to the
drivers/firmware/efi/libstub/loongarch-stub.h

which I missed when looking at the patch. So no, this should not cause missing prototypes warnings.

I'll queue this up.

Thanks,

maintainer
#5 lore raw
Quoted 1 line · Ard Biesheuvel

...

Quoted 2 lines

I'll queue this up.

This patch does not apply. What commit is it based on?

---8<---
Applying: efi/loongarch: Directly position the loaded image file
error: patch failed: arch/loongarch/include/asm/efi.h:32
error: arch/loongarch/include/asm/efi.h: patch does not apply
error: patch failed: drivers/firmware/efi/libstub/loongarch-stub.c:35
error: drivers/firmware/efi/libstub/loongarch-stub.c: patch does not apply
error: patch failed: drivers/firmware/efi/libstub/loongarch.c:37
error: drivers/firmware/efi/libstub/loongarch.c: patch does not apply Patch failed at 0001 efi/loongarch: Directly position the loaded image file

#6 lore raw
Quoted 9 lines · Ard Biesheuvel <[email protected]> 于2023年12月19日周二 17:35写道:
Quoted 1 line · Ard Biesheuvel

...

Quoted 2 lines

I'll queue this up.

This patch does not apply. What commit is it based on?

It based on the newest loongarch-next branch that based on the v6.7-rc6.

Link:
https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson.git/log/?h=loongarch-next

Quoted 9 lines

---8<---
Applying: efi/loongarch: Directly position the loaded image file
error: patch failed: arch/loongarch/include/asm/efi.h:32
error: arch/loongarch/include/asm/efi.h: patch does not apply
error: patch failed: drivers/firmware/efi/libstub/loongarch-stub.c:35
error: drivers/firmware/efi/libstub/loongarch-stub.c: patch does not apply
error: patch failed: drivers/firmware/efi/libstub/loongarch.c:37
error: drivers/firmware/efi/libstub/loongarch.c: patch does not apply Patch failed at 0001 efi/loongarch: Directly position the loaded image file

maintainer
#7 lore raw
Quoted 9 lines · Ainux Wang
Quoted 7 lines · Ard Biesheuvel <[email protected]> 于2023年12月19日周二 17:35写道:
Quoted 1 line · Ard Biesheuvel

...

Quoted 2 lines

I'll queue this up.

Quoted 8 lines
Quoted 2 lines

This patch does not apply. What commit is it based on?

It based on the newest loongarch-next branch that based on the v6.7-rc6.

Link:
https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson.git/log/?h=loongarch-next

Please rebase it onto v6.7-rc6, notably, this patch:

https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git/commit/?h=urgent&id=271f2a4a9576b87ed1f8584909d6d270039e52ea

which is now in mainline.

maintainer
#8 lore raw
Quoted 20 lines · Ard Biesheuvel
Quoted 9 lines · Ainux Wang
Quoted 7 lines · Ard Biesheuvel <[email protected]> 于2023年12月19日周二 17:35写道:
Quoted 1 line · Ard Biesheuvel

...

Quoted 2 lines

I'll queue this up.

Quoted 8 lines
Quoted 2 lines

This patch does not apply. What commit is it based on?

It based on the newest loongarch-next branch that based on the v6.7-rc6.

Link:
https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson.git/log/?h=loongarch-next

Quoted 5 lines

Please rebase it onto v6.7-rc6, notably, this patch:

https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git/commit/?h=urgent&id=271f2a4a9576b87ed1f8584909d6d270039e52ea

which is now in mainline.

Apologies, I got that the wrong way around.

Merged now, thanks.

#9 lore raw
Quoted 24 lines · Ard Biesheuvel <[email protected]> 于2023年12月19日周二 18:11写道:
Quoted 22 lines · Ard Biesheuvel
Quoted 9 lines · Ainux Wang
Quoted 7 lines · Ard Biesheuvel <[email protected]> 于2023年12月19日周二 17:35写道:
Quoted 1 line · Ard Biesheuvel

...

Quoted 2 lines

I'll queue this up.

Quoted 8 lines
Quoted 2 lines

This patch does not apply. What commit is it based on?

It based on the newest loongarch-next branch that based on the v6.7-rc6.

Link:
https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson.git/log/?h=loongarch-next

Please rebase it onto v6.7-rc6, notably, this patch:

Quoted 7 lines
Quoted 3 lines

https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git/commit/?h=urgent&id=271f2a4a9576b87ed1f8584909d6d270039e52ea

which is now in mainline.

Apologies, I got that the wrong way around.

Merged now, thanks.

It's all right.