2023-02-22 06:53:27

by Youling Tang

[permalink] [raw]
Subject: [PATCH 0/2] LoongArch: Add the same binary implementation for kdump

Add the same binary implementation for kdump.

kexec-tools needs to be updated to make sure it jumps to the correct
kernel entry.

When kaslr is enabled, it is best to add the "nokaslr" parameter when
performing kdump operations to ensure that the randomized kernel
position conflicts with other segments (such as initrd loading
position).
eg: sudo kexec -p vmlinux.efi --reuse-cmdline --append="nokaslr"

Based on the "[PATCH v6 0/5] LoongArch: Add kernel relocation and
KASLR support" series of patches.

Youling Tang (2):
LoongArch: kdump: Add the same binary implementation
LoongArch: kdump: Add crashkernel=YM handling

arch/loongarch/Kconfig | 12 +-----------
arch/loongarch/Makefile | 4 ----
arch/loongarch/configs/loongson3_defconfig | 1 +
arch/loongarch/include/asm/addrspace.h | 2 ++
arch/loongarch/kernel/head.S | 2 +-
arch/loongarch/kernel/setup.c | 15 ++++++++++++---
6 files changed, 17 insertions(+), 19 deletions(-)

--
2.37.3



2023-02-22 06:53:29

by Youling Tang

[permalink] [raw]
Subject: [PATCH 1/2] LoongArch: kdump: Add the same binary implementation

This feature depends on the relocation function, so the relocation configuration
CONFIG_RELOCATABLE will be enabled.

Add the same set of binary implementations for kdump, and then no longer need to
compile two kernels (the production kernel and the capture kernel share the same
binary).

CONFIG_CRASH_DUMP is enabled by default (CONFIG_RELOCATABLE is also enabled).

Signed-off-by: Youling Tang <[email protected]>
---
arch/loongarch/Kconfig | 12 +-----------
arch/loongarch/Makefile | 4 ----
arch/loongarch/configs/loongson3_defconfig | 1 +
arch/loongarch/include/asm/addrspace.h | 2 ++
arch/loongarch/kernel/head.S | 2 +-
5 files changed, 5 insertions(+), 16 deletions(-)

diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig
index ab4c2ab146ab..84f220273296 100644
--- a/arch/loongarch/Kconfig
+++ b/arch/loongarch/Kconfig
@@ -502,6 +502,7 @@ config KEXEC

config CRASH_DUMP
bool "Build kdump crash kernel"
+ select RELOCATABLE
help
Generate crash dump after being started by kexec. This should
be normally only set in special crash dump kernels which are
@@ -511,17 +512,6 @@ config CRASH_DUMP

For more details see Documentation/admin-guide/kdump/kdump.rst

-config PHYSICAL_START
- hex "Physical address where the kernel is loaded"
- default "0x90000000a0000000"
- depends on CRASH_DUMP
- help
- This gives the XKPRANGE address where the kernel is loaded.
- If you plan to use kernel for capturing the crash dump change
- this value to start of the reserved region (the "X" value as
- specified in the "crashkernel=YM@XM" command line boot parameter
- passed to the panic-ed kernel).
-
config RELOCATABLE
bool "Relocatable kernel"
help
diff --git a/arch/loongarch/Makefile b/arch/loongarch/Makefile
index 2aba6ff30436..8304fed7aa42 100644
--- a/arch/loongarch/Makefile
+++ b/arch/loongarch/Makefile
@@ -79,11 +79,7 @@ endif
cflags-y += -ffreestanding
cflags-y += $(call cc-option, -mno-check-zero-division)

-ifndef CONFIG_PHYSICAL_START
load-y = 0x9000000000200000
-else
-load-y = $(CONFIG_PHYSICAL_START)
-endif
bootvars-y = VMLINUX_LOAD_ADDRESS=$(load-y)

drivers-$(CONFIG_PCI) += arch/loongarch/pci/
diff --git a/arch/loongarch/configs/loongson3_defconfig b/arch/loongarch/configs/loongson3_defconfig
index cb52774c80e8..7885f6e5de93 100644
--- a/arch/loongarch/configs/loongson3_defconfig
+++ b/arch/loongarch/configs/loongson3_defconfig
@@ -48,6 +48,7 @@ CONFIG_HOTPLUG_CPU=y
CONFIG_NR_CPUS=64
CONFIG_NUMA=y
CONFIG_KEXEC=y
+CONFIG_CRASH_DUMP=y
CONFIG_SUSPEND=y
CONFIG_HIBERNATION=y
CONFIG_ACPI=y
diff --git a/arch/loongarch/include/asm/addrspace.h b/arch/loongarch/include/asm/addrspace.h
index d342935e5a72..4edcb3c21cf5 100644
--- a/arch/loongarch/include/asm/addrspace.h
+++ b/arch/loongarch/include/asm/addrspace.h
@@ -125,4 +125,6 @@ extern unsigned long vm_map_base;
#define ISA_IOSIZE SZ_16K
#define IO_SPACE_LIMIT (PCI_IOSIZE - 1)

+#define PHYS_LINK_ADDR PHYSADDR(VMLINUX_LOAD_ADDRESS)
+
#endif /* _ASM_ADDRSPACE_H */
diff --git a/arch/loongarch/kernel/head.S b/arch/loongarch/kernel/head.S
index b12f459ad73a..57962ff08f6d 100644
--- a/arch/loongarch/kernel/head.S
+++ b/arch/loongarch/kernel/head.S
@@ -24,7 +24,7 @@ _head:
.org 0x8
.dword kernel_entry /* Kernel entry point */
.dword _end - _text /* Kernel image effective size */
- .quad 0 /* Kernel image load offset from start of RAM */
+ .quad PHYS_LINK_ADDR /* Kernel image load offset from start of RAM */
.org 0x38 /* 0x20 ~ 0x37 reserved */
.long LINUX_PE_MAGIC
.long pe_header - _head /* Offset to the PE header */
--
2.37.3


2023-02-22 06:53:31

by Youling Tang

[permalink] [raw]
Subject: [PATCH 2/2] LoongArch: kdump: Add crashkernel=YM handling

When the kernel crashkernel parameter is specified with just a size,
we are supposed to allocate a region from RAM to store the crashkernel,
"crashkernel=512M" would be recommended for kdump.

Fix this by lifting similar code from x86, importing it to LoongArch
with the LoongArch specific parameters added. We allocate the crashkernel
region from the first 4G of physical memory (SWIOTLB needs to be allocated
on low 4G). Currently LoongArch does not implement crashkernel_low and
crashkernel_high like x86.

When X is not specified, crash_base defaults to 0 (crashkernel=YM@XM).

Signed-off-by: Youling Tang <[email protected]>
---
arch/loongarch/kernel/setup.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/arch/loongarch/kernel/setup.c b/arch/loongarch/kernel/setup.c
index 4344502c0b31..ac2aad988fdb 100644
--- a/arch/loongarch/kernel/setup.c
+++ b/arch/loongarch/kernel/setup.c
@@ -234,11 +234,14 @@ static void __init arch_reserve_vmcore(void)
#endif
}

+/* 16M alignment for crash kernel regions */
+#define CRASH_ALIGN SZ_16M
+#define CRASH_ADDR_MAX SZ_4G
+
static void __init arch_parse_crashkernel(void)
{
#ifdef CONFIG_KEXEC
int ret;
- unsigned long long start;
unsigned long long total_mem;
unsigned long long crash_base, crash_size;

@@ -247,8 +250,14 @@ static void __init arch_parse_crashkernel(void)
if (ret < 0 || crash_size <= 0)
return;

- start = memblock_phys_alloc_range(crash_size, 1, crash_base, crash_base + crash_size);
- if (start != crash_base) {
+ if (crash_base <= 0) {
+ crash_base = memblock_phys_alloc_range(crash_size, CRASH_ALIGN, CRASH_ALIGN,
+ CRASH_ADDR_MAX);
+ if (!crash_base) {
+ pr_warn("crashkernel reservation failed - No suitable area found.\n");
+ return;
+ }
+ } else if (!memblock_phys_alloc_range(crash_size, 1, crash_base, crash_base + crash_size)) {
pr_warn("Invalid memory region reserved for crash kernel\n");
return;
}
--
2.37.3


2023-02-22 09:05:41

by WANG Xuerui

[permalink] [raw]
Subject: Re: [PATCH 1/2] LoongArch: kdump: Add the same binary implementation

On 2023/2/22 14:53, Youling Tang wrote:
> This feature depends on the relocation function, so the relocation configuration
> CONFIG_RELOCATABLE will be enabled.

In general try to describe things briefly: "This depends on the kernel
being relocatable" would be enough in this case.

>
> Add the same set of binary implementations for kdump, and then no longer need to
> compile two kernels (the production kernel and the capture kernel share the same
> binary).

Sorry but what do you mean by "same set of binary implementation",
where's the "first set of binary implementation"?

Judging from the patch content, I guess it's kinda wrong translation,
and what you actually mean is something like "enable using the same
image for crashkernel"?

>
> CONFIG_CRASH_DUMP is enabled by default (CONFIG_RELOCATABLE is also enabled).

No it's not: you didn't add "default y" anywhere. What you actually did
is to enable it *in the defconfig*. And the latter part about
CONFIG_RELOCATABLE shouldn't be necessary, it's implementation detail
after all, and the users likely don't have to be aware of it.

Better reword a little bit, like "Also enable CONFIG_CRASH_DUMP in
loongson3_defconfig".

>
> Signed-off-by: Youling Tang <[email protected]>
> ---
> arch/loongarch/Kconfig | 12 +-----------
> arch/loongarch/Makefile | 4 ----
> arch/loongarch/configs/loongson3_defconfig | 1 +
> arch/loongarch/include/asm/addrspace.h | 2 ++
> arch/loongarch/kernel/head.S | 2 +-
> 5 files changed, 5 insertions(+), 16 deletions(-)
>
> diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig
> index ab4c2ab146ab..84f220273296 100644
> --- a/arch/loongarch/Kconfig
> +++ b/arch/loongarch/Kconfig
> @@ -502,6 +502,7 @@ config KEXEC
>
> config CRASH_DUMP
> bool "Build kdump crash kernel"
> + select RELOCATABLE
> help
> Generate crash dump after being started by kexec. This should
> be normally only set in special crash dump kernels which are
> @@ -511,17 +512,6 @@ config CRASH_DUMP
>
> For more details see Documentation/admin-guide/kdump/kdump.rst
>
> -config PHYSICAL_START
> - hex "Physical address where the kernel is loaded"
> - default "0x90000000a0000000"
> - depends on CRASH_DUMP
> - help
> - This gives the XKPRANGE address where the kernel is loaded.
> - If you plan to use kernel for capturing the crash dump change
> - this value to start of the reserved region (the "X" value as
> - specified in the "crashkernel=YM@XM" command line boot parameter
> - passed to the panic-ed kernel).
> -
> config RELOCATABLE
> bool "Relocatable kernel"
> help
> diff --git a/arch/loongarch/Makefile b/arch/loongarch/Makefile
> index 2aba6ff30436..8304fed7aa42 100644
> --- a/arch/loongarch/Makefile
> +++ b/arch/loongarch/Makefile
> @@ -79,11 +79,7 @@ endif
> cflags-y += -ffreestanding
> cflags-y += $(call cc-option, -mno-check-zero-division)
>
> -ifndef CONFIG_PHYSICAL_START
> load-y = 0x9000000000200000
> -else
> -load-y = $(CONFIG_PHYSICAL_START)
> -endif
> bootvars-y = VMLINUX_LOAD_ADDRESS=$(load-y)

Both load-y and VMLINUX_LOAD_ADDRESS are kinda LoongArch-ism (stemming
from similar usage in arch/mips apparently), so why not just drop load-y
and fold the constant into the bootvars-y definition? So we have one
piece of "special" definition instead of two.

>
> drivers-$(CONFIG_PCI) += arch/loongarch/pci/
> diff --git a/arch/loongarch/configs/loongson3_defconfig b/arch/loongarch/configs/loongson3_defconfig
> index cb52774c80e8..7885f6e5de93 100644
> --- a/arch/loongarch/configs/loongson3_defconfig
> +++ b/arch/loongarch/configs/loongson3_defconfig
> @@ -48,6 +48,7 @@ CONFIG_HOTPLUG_CPU=y
> CONFIG_NR_CPUS=64
> CONFIG_NUMA=y
> CONFIG_KEXEC=y
> +CONFIG_CRASH_DUMP=y
> CONFIG_SUSPEND=y
> CONFIG_HIBERNATION=y
> CONFIG_ACPI=y
> diff --git a/arch/loongarch/include/asm/addrspace.h b/arch/loongarch/include/asm/addrspace.h
> index d342935e5a72..4edcb3c21cf5 100644
> --- a/arch/loongarch/include/asm/addrspace.h
> +++ b/arch/loongarch/include/asm/addrspace.h
> @@ -125,4 +125,6 @@ extern unsigned long vm_map_base;
> #define ISA_IOSIZE SZ_16K
> #define IO_SPACE_LIMIT (PCI_IOSIZE - 1)
>
> +#define PHYS_LINK_ADDR PHYSADDR(VMLINUX_LOAD_ADDRESS)
> +
> #endif /* _ASM_ADDRSPACE_H */
> diff --git a/arch/loongarch/kernel/head.S b/arch/loongarch/kernel/head.S
> index b12f459ad73a..57962ff08f6d 100644
> --- a/arch/loongarch/kernel/head.S
> +++ b/arch/loongarch/kernel/head.S
> @@ -24,7 +24,7 @@ _head:
> .org 0x8
> .dword kernel_entry /* Kernel entry point */
> .dword _end - _text /* Kernel image effective size */
> - .quad 0 /* Kernel image load offset from start of RAM */
> + .quad PHYS_LINK_ADDR /* Kernel image load offset from start of RAM */
> .org 0x38 /* 0x20 ~ 0x37 reserved */
> .long LINUX_PE_MAGIC
> .long pe_header - _head /* Offset to the PE header */

--
WANG "xen0n" Xuerui

Linux/LoongArch mailing list: https://lore.kernel.org/loongarch/


2023-02-22 09:56:16

by Youling Tang

[permalink] [raw]
Subject: Re: [PATCH 1/2] LoongArch: kdump: Add the same binary implementation

Hi, Xuerui

On 02/22/2023 05:05 PM, WANG Xuerui wrote:
> On 2023/2/22 14:53, Youling Tang wrote:
>> This feature depends on the relocation function, so the relocation
>> configuration
>> CONFIG_RELOCATABLE will be enabled.
>
> In general try to describe things briefly: "This depends on the kernel
> being relocatable" would be enough in this case.
OK.

>
>>
>> Add the same set of binary implementations for kdump, and then no
>> longer need to
>> compile two kernels (the production kernel and the capture kernel
>> share the same
>> binary).
>
> Sorry but what do you mean by "same set of binary implementation",
> where's the "first set of binary implementation"?

kdump requires two kernels, the production kernel and the capture
kernel, which made the final link address different through different
configuration options in the previous implementation. Now it is
possible to share a kernel, and after entering the capture kernel, it
can be corrected by relocation.

>
> Judging from the patch content, I guess it's kinda wrong translation,
> and what you actually mean is something like "enable using the same
> image for crashkernel"?

Or "LoongArch: kdump: Add support for using a single image" ?

>
>>
>> CONFIG_CRASH_DUMP is enabled by default (CONFIG_RELOCATABLE is also
>> enabled).
>
> No it's not: you didn't add "default y" anywhere. What you actually did
> is to enable it *in the defconfig*. And the latter part about
> CONFIG_RELOCATABLE shouldn't be necessary, it's implementation detail
> after all, and the users likely don't have to be aware of it.
>
> Better reword a little bit, like "Also enable CONFIG_CRASH_DUMP in
> loongson3_defconfig".

Thanks, I'll rewrite the commit message.

>
>>
>> Signed-off-by: Youling Tang <[email protected]>
>> ---
>> arch/loongarch/Kconfig | 12 +-----------
>> arch/loongarch/Makefile | 4 ----
>> arch/loongarch/configs/loongson3_defconfig | 1 +
>> arch/loongarch/include/asm/addrspace.h | 2 ++
>> arch/loongarch/kernel/head.S | 2 +-
>> 5 files changed, 5 insertions(+), 16 deletions(-)
>>
>> diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig
>> index ab4c2ab146ab..84f220273296 100644
>> --- a/arch/loongarch/Kconfig
>> +++ b/arch/loongarch/Kconfig
>> @@ -502,6 +502,7 @@ config KEXEC
>> config CRASH_DUMP
>> bool "Build kdump crash kernel"
>> + select RELOCATABLE
>> help
>> Generate crash dump after being started by kexec. This should
>> be normally only set in special crash dump kernels which are
>> @@ -511,17 +512,6 @@ config CRASH_DUMP
>> For more details see Documentation/admin-guide/kdump/kdump.rst
>> -config PHYSICAL_START
>> - hex "Physical address where the kernel is loaded"
>> - default "0x90000000a0000000"
>> - depends on CRASH_DUMP
>> - help
>> - This gives the XKPRANGE address where the kernel is loaded.
>> - If you plan to use kernel for capturing the crash dump change
>> - this value to start of the reserved region (the "X" value as
>> - specified in the "crashkernel=YM@XM" command line boot parameter
>> - passed to the panic-ed kernel).
>> -
>> config RELOCATABLE
>> bool "Relocatable kernel"
>> help
>> diff --git a/arch/loongarch/Makefile b/arch/loongarch/Makefile
>> index 2aba6ff30436..8304fed7aa42 100644
>> --- a/arch/loongarch/Makefile
>> +++ b/arch/loongarch/Makefile
>> @@ -79,11 +79,7 @@ endif
>> cflags-y += -ffreestanding
>> cflags-y += $(call cc-option, -mno-check-zero-division)
>> -ifndef CONFIG_PHYSICAL_START
>> load-y = 0x9000000000200000
>> -else
>> -load-y = $(CONFIG_PHYSICAL_START)
>> -endif
>> bootvars-y = VMLINUX_LOAD_ADDRESS=$(load-y)
>
> Both load-y and VMLINUX_LOAD_ADDRESS are kinda LoongArch-ism (stemming
> from similar usage in arch/mips apparently), so why not just drop load-y
> and fold the constant into the bootvars-y definition? So we have one
> piece of "special" definition instead of two.

This series of patches will not modify it, perhaps it can be submitted
and discussed separately later.

Thanks,
Youling.

>
>> drivers-$(CONFIG_PCI) += arch/loongarch/pci/
>> diff --git a/arch/loongarch/configs/loongson3_defconfig
>> b/arch/loongarch/configs/loongson3_defconfig
>> index cb52774c80e8..7885f6e5de93 100644
>> --- a/arch/loongarch/configs/loongson3_defconfig
>> +++ b/arch/loongarch/configs/loongson3_defconfig
>> @@ -48,6 +48,7 @@ CONFIG_HOTPLUG_CPU=y
>> CONFIG_NR_CPUS=64
>> CONFIG_NUMA=y
>> CONFIG_KEXEC=y
>> +CONFIG_CRASH_DUMP=y
>> CONFIG_SUSPEND=y
>> CONFIG_HIBERNATION=y
>> CONFIG_ACPI=y
>> diff --git a/arch/loongarch/include/asm/addrspace.h
>> b/arch/loongarch/include/asm/addrspace.h
>> index d342935e5a72..4edcb3c21cf5 100644
>> --- a/arch/loongarch/include/asm/addrspace.h
>> +++ b/arch/loongarch/include/asm/addrspace.h
>> @@ -125,4 +125,6 @@ extern unsigned long vm_map_base;
>> #define ISA_IOSIZE SZ_16K
>> #define IO_SPACE_LIMIT (PCI_IOSIZE - 1)
>> +#define PHYS_LINK_ADDR PHYSADDR(VMLINUX_LOAD_ADDRESS)
>> +
>> #endif /* _ASM_ADDRSPACE_H */
>> diff --git a/arch/loongarch/kernel/head.S b/arch/loongarch/kernel/head.S
>> index b12f459ad73a..57962ff08f6d 100644
>> --- a/arch/loongarch/kernel/head.S
>> +++ b/arch/loongarch/kernel/head.S
>> @@ -24,7 +24,7 @@ _head:
>> .org 0x8
>> .dword kernel_entry /* Kernel entry point */
>> .dword _end - _text /* Kernel image effective size */
>> - .quad 0 /* Kernel image load offset from start of
>> RAM */
>> + .quad PHYS_LINK_ADDR /* Kernel image load offset from
>> start of RAM */
>> .org 0x38 /* 0x20 ~ 0x37 reserved */
>> .long LINUX_PE_MAGIC
>> .long pe_header - _head /* Offset to the PE header */
>


2023-02-22 10:12:32

by WANG Xuerui

[permalink] [raw]
Subject: Re: [PATCH 1/2] LoongArch: kdump: Add the same binary implementation

On 2023/2/22 17:54, Youling Tang wrote:
> Hi, Xuerui
>
> On 02/22/2023 05:05 PM, WANG Xuerui wrote:
>> On 2023/2/22 14:53, Youling Tang wrote:
>>> This feature depends on the relocation function, so the relocation
>>> configuration
>>> CONFIG_RELOCATABLE will be enabled.
>>
>> In general try to describe things briefly: "This depends on the kernel
>> being relocatable" would be enough in this case.
> OK.
>
>>
>>>
>>> Add the same set of binary implementations for kdump, and then no
>>> longer need to
>>> compile two kernels (the production kernel and the capture kernel
>>> share the same
>>> binary).
>>
>> Sorry but what do you mean by "same set of binary implementation",
>> where's the "first set of binary implementation"?
>
> kdump requires two kernels, the production kernel and the capture
> kernel, which made the final link address different through different
> configuration options in the previous implementation. Now it is
> possible to share a kernel, and after entering the capture kernel, it
> can be corrected by relocation.
>
>>
>> Judging from the patch content, I guess it's kinda wrong translation,
>> and what you actually mean is something like "enable using the same
>> image for crashkernel"?
>
> Or "LoongArch: kdump: Add support for using a single image" ?
>

Whatever you prefer, literally anything else would be better than the
original. I don't have strong opinion over this.

>>
>>>
>>> CONFIG_CRASH_DUMP is enabled by default (CONFIG_RELOCATABLE is also
>>> enabled).
>>
>> No it's not: you didn't add "default y" anywhere. What you actually did
>> is to enable it *in the defconfig*. And the latter part about
>> CONFIG_RELOCATABLE shouldn't be necessary, it's implementation detail
>> after all, and the users likely don't have to be aware of it.
>>
>> Better reword a little bit, like "Also enable CONFIG_CRASH_DUMP in
>> loongson3_defconfig".
>
> Thanks, I'll rewrite the commit message.
>
>>
>>>
>>> Signed-off-by: Youling Tang <[email protected]>
>>> ---
>>>   arch/loongarch/Kconfig                     | 12 +-----------
>>>   arch/loongarch/Makefile                    |  4 ----
>>>   arch/loongarch/configs/loongson3_defconfig |  1 +
>>>   arch/loongarch/include/asm/addrspace.h     |  2 ++
>>>   arch/loongarch/kernel/head.S               |  2 +-
>>>   5 files changed, 5 insertions(+), 16 deletions(-)
>>>
>>> diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig
>>> index ab4c2ab146ab..84f220273296 100644
>>> --- a/arch/loongarch/Kconfig
>>> +++ b/arch/loongarch/Kconfig
>>> @@ -502,6 +502,7 @@ config KEXEC
>>>     config CRASH_DUMP
>>>       bool "Build kdump crash kernel"
>>> +    select RELOCATABLE
>>>       help
>>>         Generate crash dump after being started by kexec. This should
>>>         be normally only set in special crash dump kernels which are
>>> @@ -511,17 +512,6 @@ config CRASH_DUMP
>>>           For more details see Documentation/admin-guide/kdump/kdump.rst
>>>   -config PHYSICAL_START
>>> -    hex "Physical address where the kernel is loaded"
>>> -    default "0x90000000a0000000"
>>> -    depends on CRASH_DUMP
>>> -    help
>>> -      This gives the XKPRANGE address where the kernel is loaded.
>>> -      If you plan to use kernel for capturing the crash dump change
>>> -      this value to start of the reserved region (the "X" value as
>>> -      specified in the "crashkernel=YM@XM" command line boot parameter
>>> -      passed to the panic-ed kernel).
>>> -
>>>   config RELOCATABLE
>>>       bool "Relocatable kernel"
>>>       help
>>> diff --git a/arch/loongarch/Makefile b/arch/loongarch/Makefile
>>> index 2aba6ff30436..8304fed7aa42 100644
>>> --- a/arch/loongarch/Makefile
>>> +++ b/arch/loongarch/Makefile
>>> @@ -79,11 +79,7 @@ endif
>>>   cflags-y += -ffreestanding
>>>   cflags-y += $(call cc-option, -mno-check-zero-division)
>>>   -ifndef CONFIG_PHYSICAL_START
>>>   load-y        = 0x9000000000200000
>>> -else
>>> -load-y        = $(CONFIG_PHYSICAL_START)
>>> -endif
>>>   bootvars-y    = VMLINUX_LOAD_ADDRESS=$(load-y)
>>
>> Both load-y and VMLINUX_LOAD_ADDRESS are kinda LoongArch-ism (stemming
>> from similar usage in arch/mips apparently), so why not just drop load-y
>> and fold the constant into the bootvars-y definition? So we have one
>> piece of "special" definition instead of two.
>
> This series of patches will not modify it, perhaps it can be submitted
> and discussed separately later.

I mean since you're already touching this part, you might be better off
just simplify along the way because it's used by nowhere else. But
splitting commits would be indeed cleaner and of course you can add such
a followup commit in the next revision.

--
WANG "xen0n" Xuerui

Linux/LoongArch mailing list: https://lore.kernel.org/loongarch/