diff mbox series

[RFC,v4,3/5] powrepc/crash hp: update kimage_arch struct

Message ID 20220411084357.157308-4-sourabhjain@linux.ibm.com (mailing list archive)
State RFC
Headers show
Series [RFC,v4,1/5] powerpc/kexec: make update_cpus_node non-static | expand

Commit Message

Sourabh Jain April 11, 2022, 8:43 a.m. UTC
Two new members fdt_index and fdt_index_valid are added in kimage_arch
struct to track the FDT kexec segment. These new members of kimage_arch
struct will help the crash hotplug handler to easily access the FDT
segment from the kexec segment array. Otherwise, we have to loop through
all kexec segments to find the FDT segments.

Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com>
---
 arch/powerpc/include/asm/kexec.h | 2 ++
 1 file changed, 2 insertions(+)

Comments

Laurent Dufour April 14, 2022, 4:35 p.m. UTC | #1
On 11/04/2022, 10:43:55, Sourabh Jain wrote:
> Two new members fdt_index and fdt_index_valid are added in kimage_arch
> struct to track the FDT kexec segment. These new members of kimage_arch
> struct will help the crash hotplug handler to easily access the FDT
> segment from the kexec segment array. Otherwise, we have to loop through
> all kexec segments to find the FDT segments.
> 
> Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com>
> ---
>  arch/powerpc/include/asm/kexec.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/powerpc/include/asm/kexec.h b/arch/powerpc/include/asm/kexec.h
> index e1288826e22e..19c2cab6a880 100644
> --- a/arch/powerpc/include/asm/kexec.h
> +++ b/arch/powerpc/include/asm/kexec.h
> @@ -104,6 +104,8 @@ extern const struct kexec_file_ops kexec_elf64_ops;
>  struct kimage_arch {
>  	struct crash_mem *exclude_ranges;
>  
#ifdef CONFIG_CRASH_HOTPLUG ?
> +	int fdt_index;
> +	bool fdt_index_valid;
#endif

It seems that this is only used when CONFIG_CRASH_HOTPLUG is defined, isn't it?

>  	unsigned long backup_start;
>  	void *backup_buf;
>  	void *fdt;
Sourabh Jain April 19, 2022, 8:21 a.m. UTC | #2
On 14/04/22 22:05, Laurent Dufour wrote:
> On 11/04/2022, 10:43:55, Sourabh Jain wrote:
>> Two new members fdt_index and fdt_index_valid are added in kimage_arch
>> struct to track the FDT kexec segment. These new members of kimage_arch
>> struct will help the crash hotplug handler to easily access the FDT
>> segment from the kexec segment array. Otherwise, we have to loop through
>> all kexec segments to find the FDT segments.
>>
>> Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com>
>> ---
>>   arch/powerpc/include/asm/kexec.h | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/arch/powerpc/include/asm/kexec.h b/arch/powerpc/include/asm/kexec.h
>> index e1288826e22e..19c2cab6a880 100644
>> --- a/arch/powerpc/include/asm/kexec.h
>> +++ b/arch/powerpc/include/asm/kexec.h
>> @@ -104,6 +104,8 @@ extern const struct kexec_file_ops kexec_elf64_ops;
>>   struct kimage_arch {
>>   	struct crash_mem *exclude_ranges;
>>   
> #ifdef CONFIG_CRASH_HOTPLUG ?
>> +	int fdt_index;
>> +	bool fdt_index_valid;
> #endif
>
> It seems that this is only used when CONFIG_CRASH_HOTPLUG is defined, isn't it?

Yes it should be kept under CONFIG_CRASH_HOTPLUG config.

Thanks,
Sourabh Jain

>
>>   	unsigned long backup_start;
>>   	void *backup_buf;
>>   	void *fdt;
diff mbox series

Patch

diff --git a/arch/powerpc/include/asm/kexec.h b/arch/powerpc/include/asm/kexec.h
index e1288826e22e..19c2cab6a880 100644
--- a/arch/powerpc/include/asm/kexec.h
+++ b/arch/powerpc/include/asm/kexec.h
@@ -104,6 +104,8 @@  extern const struct kexec_file_ops kexec_elf64_ops;
 struct kimage_arch {
 	struct crash_mem *exclude_ranges;
 
+	int fdt_index;
+	bool fdt_index_valid;
 	unsigned long backup_start;
 	void *backup_buf;
 	void *fdt;