efi/libstub/arm*: Set default address and size cells values for an empty dtb
PATCH 1/1 efi/libstub/arm*: Set default address and size cells values for an empty dtb
From: Sameer Goel <[email protected]>
In cases where a device tree is not provided (ie ACPI based system), an empty fdt is generated by efistub. Sets the address and size cell values in a generated fdt to support 64 bit addressing.
This enables kexec/kdump on Qualcomm Technologies QDF24XX platforms as those utilities will read the address/size values from the fdt, and such values may exceed the range provided by the 32 bit default.
--- drivers/firmware/efi/libstub/fdt.c | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-)
drivers/firmware/efi/libstub/fdt.c +37 -1
@@ -16,6 +16,34 @@#include "efistub.h" +#define EFI_DT_ADDR_CELLS_DEFAULT 2 +#define EFI_DT_SIZE_CELLS_DEFAULT 2 + +static void fdt_update_cell_size (efi_system_table_t *sys_table,void *fdt) +{ +int offset; +int status; + + offset =fdt_path_offset (fdt,"/" ); +/* Set the #address-cells and #size-cells values for an empty tree */ + + status =fdt_setprop_u32 (fdt, offset,"#address-cells" , +EFI_DT_ADDR_CELLS_DEFAULT ); +if (status) { +pr_efi (sys_table, +"Failed to set #address-cells for empty dtb\n" ); +return ; + } + + status =fdt_setprop_u32 (fdt, offset,"#size-cells" , +EFI_DT_SIZE_CELLS_DEFAULT ); +if (status) { +pr_efi (sys_table, +"Failed to set #size-cells for empty dtb\n" ); +return ; + } +} + static efi_status_t update_fdt(efi_system_table_t *sys_table, void *orig_fdt, unsigned long orig_fdt_size, void *fdt, int new_fdt_size, char *cmdline_ptr,
@@ -44,8 +72,16 @@ static efi_status_t update_fdt(efi_system_table_t *sys_table, void *orig_fdt,if (orig_fdt) status =fdt_open_into (orig_fdt, fdt, new_fdt_size); -else +else { status =fdt_create_empty_tree (fdt, new_fdt_size); +if (status ==0 ) { +/* +* Any failure from the following function is non +* critical +*/ +fdt_update_cell_size (sys_table, fdt); + } + }if (status !=0 ) goto fdt_set_fail;
Signature · 3 lines
Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.
PATCH 1/1 efi/libstub/arm*: Set default address and size cells values for an empty dtb
Hi Jeffrey,
(adding Mark)
Quoted 10 lines · Jeffrey Hugo
From: Sameer Goel <[email protected]>
In cases where a device tree is not provided (ie ACPI based system), an empty fdt is generated by efistub. Sets the address and size cell values in a generated fdt to support 64 bit addressing.
This enables kexec/kdump on Qualcomm Technologies QDF24XX platforms as those utilities will read the address/size values from the fdt, and such values may exceed the range provided by the 32 bit default.
As far as I know, those properties are explicitly associated with the 'reg' properties of subordinate nodes. So which nodes are we talking about here? Are we producing an incorrect DT by not setting these? Or is this simply a convenience to work around bugs in the tooling?
Quoted 1 line
Change-Id: Ie7f3637e375bd6631c6bda1f7b3c9003765ff4a5
Please drop these IDs when you post
Quoted 72 lines
Signed-off-by Sameer Goel <[email protected]>Signed-off-by Jeffrey Hugo <[email protected]>--- drivers/firmware/efi/libstub/fdt.c | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-)drivers/firmware/efi/libstub/fdt.c +37
-2@@ -16,6 +16,34 @@#include "efistub.h" +#define EFI_DT_ADDR_CELLS_DEFAULT 2 +#define EFI_DT_SIZE_CELLS_DEFAULT 2 + +static void fdt_update_cell_size (efi_system_table_t *sys_table,void *fdt) +{ +int offset; +int status; + + offset =fdt_path_offset (fdt,"/" ); +/* Set the #address-cells and #size-cells values for an empty tree */ + + status =fdt_setprop_u32 (fdt, offset,"#address-cells" , +EFI_DT_ADDR_CELLS_DEFAULT ); +if (status) { +pr_efi (sys_table, +"Failed to set #address-cells for empty dtb\n" ); +return ; + } + + status =fdt_setprop_u32 (fdt, offset,"#size-cells" , +EFI_DT_SIZE_CELLS_DEFAULT ); +if (status) { +pr_efi (sys_table, +"Failed to set #size-cells for empty dtb\n" ); +return ; + } +} + static efi_status_t update_fdt(efi_system_table_t *sys_table, void *orig_fdt, unsigned long orig_fdt_size, void *fdt, int new_fdt_size, char *cmdline_ptr,@@ -44,8 +72,16 @@ static efi_status_t update_fdt(efi_system_table_t *sys_table, void *orig_fdt,if (orig_fdt) status =fdt_open_into (orig_fdt, fdt, new_fdt_size); -else +else { status =fdt_create_empty_tree (fdt, new_fdt_size); +if (status ==0 ) { +/* +* Any failure from the following function is non +* critical +*/ +fdt_update_cell_size (sys_table, fdt); + } + }if (status !=0 ) goto fdt_set_fail; --Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.--
To unsubscribe from this list: send the line "unsubscribe linux-efi" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 1/1 efi/libstub/arm*: Set default address and size cells values for an empty dtb
Quoted 16 lines · Ard Biesheuvel
Hi Jeffrey,
(adding Mark)
Quoted 10 lines · Jeffrey Hugo
From: Sameer Goel <[email protected]>
In cases where a device tree is not provided (ie ACPI based system), an empty fdt is generated by efistub. Sets the address and size cell values in a generated fdt to support 64 bit addressing.
This enables kexec/kdump on Qualcomm Technologies QDF24XX platforms as those utilities will read the address/size values from the fdt, and such values may exceed the range provided by the 32 bit default.
Quoted 4 lines
As far as I know, those properties are explicitly associated with the 'reg' properties of subordinate nodes. So which nodes are we talking about here? Are we producing an incorrect DT by not setting these? Or is this simply a convenience to work around bugs in the tooling?
I think we are producing an incorrect DT, in some instances.
So we are starting from the same baseline, this is specific to ACPI systems, as an ACPI system won't have a DT from the bootloader. DT based systems will already have a DT from the bootloader which is assumed to be correct. On ACPI systems without a DT, efistub generates a default one.
That default is assumed to be for a 32-bit system. The cell width defaults to 1, which is 4 bytes. You cannot represent a 64-bit value in that instance.
What happens is that kexec inserts properties into the fdt which contain the start address and size on the crash kernel. On our system, the start address is a 64-bit value, and while its not the case today, I see no reason why size could not also be a 64-bit value. However the values that are inserted into the fdt are governed by the address and size cell values already present in the fdt.
Kexec attempts to insert these values in the fdt. The fdt only accepts 32-bit values, so it truncates what is put in. Then later kexec/kdump read the values from the fdt, and get garbage.
By changing the defaults to 2 (the proposed change), 64-bit values can be inserted into the fdt, so the values we put in don't get truncated, and thus kexec/kdump read the correct thing when they need the values.
I don't see how the tools could be fixed - fdt is truncating the values, and the generated fdt is already "static" at the point the tools run. We haven't had luck changing the cell size at the point the tools run. Additionally, this seems to be an issue for everything using the fdt - pushing the problem to every tool instead of fixing once at the top seems like playing a game of whack-a-mole.
Does that clarify that issue for you? Obviously the commit text needs some work, but I'd like to get on the same page first.
Quoted 83 lines
Quoted 2 lines
Change-Id: Ie7f3637e375bd6631c6bda1f7b3c9003765ff4a5
Please drop these IDs when you post
Quoted 68 lines
Signed-off-by Sameer Goel <[email protected]>Signed-off-by Jeffrey Hugo <[email protected]>--- drivers/firmware/efi/libstub/fdt.c | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-)drivers/firmware/efi/libstub/fdt.c +37
-2@@ -16,6 +16,34 @@#include "efistub.h" +#define EFI_DT_ADDR_CELLS_DEFAULT 2 +#define EFI_DT_SIZE_CELLS_DEFAULT 2 + +static void fdt_update_cell_size (efi_system_table_t *sys_table,void *fdt) +{ +int offset; +int status; + + offset =fdt_path_offset (fdt,"/" ); +/* Set the #address-cells and #size-cells values for an empty tree */ + + status =fdt_setprop_u32 (fdt, offset,"#address-cells" , +EFI_DT_ADDR_CELLS_DEFAULT ); +if (status) { +pr_efi (sys_table, +"Failed to set #address-cells for empty dtb\n" ); +return ; + } + + status =fdt_setprop_u32 (fdt, offset,"#size-cells" , +EFI_DT_SIZE_CELLS_DEFAULT ); +if (status) { +pr_efi (sys_table, +"Failed to set #size-cells for empty dtb\n" ); +return ; + } +} + static efi_status_t update_fdt(efi_system_table_t *sys_table, void *orig_fdt, unsigned long orig_fdt_size, void *fdt, int new_fdt_size, char *cmdline_ptr,@@ -44,8 +72,16 @@ static efi_status_t update_fdt(efi_system_table_t *sys_table, void *orig_fdt,if (orig_fdt) status =fdt_open_into (orig_fdt, fdt, new_fdt_size); -else +else { status =fdt_create_empty_tree (fdt, new_fdt_size); +if (status ==0 ) { +/* +* Any failure from the following function is non +* critical +*/ +fdt_update_cell_size (sys_table, fdt); + } + }if (status !=0 ) goto fdt_set_fail; --Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.Quoted 4 lines
--
To unsubscribe from this list: send the line "unsubscribe linux-efi" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 5 lines
Jeffrey Hugo Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.
PATCH 1/1 efi/libstub/arm*: Set default address and size cells values for an empty dtb
Quoted 38 lines · Jeffrey Hugo
Quoted 12 lines · Ard Biesheuvel
Quoted 10 lines · Jeffrey Hugo
From: Sameer Goel <[email protected]>
In cases where a device tree is not provided (ie ACPI based system), an empty fdt is generated by efistub. Sets the address and size cell values in a generated fdt to support 64 bit addressing.
This enables kexec/kdump on Qualcomm Technologies QDF24XX platforms as those utilities will read the address/size values from the fdt, and such values may exceed the range provided by the 32 bit default.
Quoted 4 lines
As far as I know, those properties are explicitly associated with the 'reg' properties of subordinate nodes. So which nodes are we talking about here? Are we producing an incorrect DT by not setting these? Or is this simply a convenience to work around bugs in the tooling?
I think we are producing an incorrect DT, in some instances.
So we are starting from the same baseline, this is specific to ACPI systems, as an ACPI system won't have a DT from the bootloader. DT based systems will already have a DT from the bootloader which is assumed to be correct. On ACPI systems without a DT, efistub generates a default one.
That default is assumed to be for a 32-bit system. The cell width defaults to 1, which is 4 bytes. You cannot represent a 64-bit value in that instance.
What happens is that kexec inserts properties into the fdt which contain the start address and size on the crash kernel. On our system, the start address is a 64-bit value, and while its not the case today, I see no reason why size could not also be a 64-bit value. However the values that are inserted into the fdt are governed by the address and size cell values already present in the fdt.
Quoted 3 lines
Kexec attempts to insert these values in the fdt. The fdt only accepts 32-bit values, so it truncates what is put in. Then later kexec/kdump read the values from the fdt, and get garbage.
I take it this is specific to the kdump properties?
I can't immediately see what would matter for the !kdump case. properties inserted under /chosen are not truncated?
Quoted 12 lines
By changing the defaults to 2 (the proposed change), 64-bit values can be inserted into the fdt, so the values we put in don't get truncated, and thus kexec/kdump read the correct thing when they need the values.
I don't see how the tools could be fixed - fdt is truncating the values, and the generated fdt is already "static" at the point the tools run. We haven't had luck changing the cell size at the point the tools run. Additionally, this seems to be an issue for everything using the fdt - pushing the problem to every tool instead of fixing once at the top seems like playing a game of whack-a-mole.
Quoted 2 lines
Does that clarify that issue for you? Obviously the commit text needs some work, but I'd like to get on the same page first.
If you could update the commit message to explicitly mention the properties being inserted for which this matters, this generally sounds fine to me.
Please Cc me on v2.
Thanks,
Mark.
PATCH 1/1 efi/libstub/arm*: Set default address and size cells values for an empty dtb
Quoted 10 lines · Mark Rutland
Quoted 3 lines · Jeffrey Hugo
Kexec attempts to insert these values in the fdt. The fdt only accepts 32-bit values, so it truncates what is put in. Then later kexec/kdump read the values from the fdt, and get garbage.
I take it this is specific to the kdump properties?
I can't immediately see what would matter for the !kdump case. properties inserted under /chosen are not truncated?
Whoops; please ignore the last line. I'd meant to delete that (and it obviously makes no sense).
Mark.
PATCH 1/1 efi/libstub/arm*: Set default address and size cells values for an empty dtb
In reply to Mark RutlandQuoted 39 lines · Mark Rutland
Quoted 38 lines · Jeffrey Hugo
Quoted 12 lines · Ard Biesheuvel
Quoted 10 lines · Jeffrey Hugo
From: Sameer Goel <[email protected]>
In cases where a device tree is not provided (ie ACPI based system), an empty fdt is generated by efistub. Sets the address and size cell values in a generated fdt to support 64 bit addressing.
This enables kexec/kdump on Qualcomm Technologies QDF24XX platforms as those utilities will read the address/size values from the fdt, and such values may exceed the range provided by the 32 bit default.
Quoted 4 lines
As far as I know, those properties are explicitly associated with the 'reg' properties of subordinate nodes. So which nodes are we talking about here? Are we producing an incorrect DT by not setting these? Or is this simply a convenience to work around bugs in the tooling?
I think we are producing an incorrect DT, in some instances.
So we are starting from the same baseline, this is specific to ACPI systems, as an ACPI system won't have a DT from the bootloader. DT based systems will already have a DT from the bootloader which is assumed to be correct. On ACPI systems without a DT, efistub generates a default one.
That default is assumed to be for a 32-bit system. The cell width defaults to 1, which is 4 bytes. You cannot represent a 64-bit value in that instance.
What happens is that kexec inserts properties into the fdt which contain the start address and size on the crash kernel. On our system, the start address is a 64-bit value, and while its not the case today, I see no reason why size could not also be a 64-bit value. However the values that are inserted into the fdt are governed by the address and size cell values already present in the fdt.
Quoted 8 lines
Quoted 3 lines
Kexec attempts to insert these values in the fdt. The fdt only accepts 32-bit values, so it truncates what is put in. Then later kexec/kdump read the values from the fdt, and get garbage.
I take it this is specific to the kdump properties?
I can't immediately see what would matter for the !kdump case. properties inserted under /chosen are not truncated?
The kexec/kdump properties are added under /chosen, therefore yes, properties added under /chosen are truncated, per our observations.
Quoted 30 lines
Quoted 13 lines
By changing the defaults to 2 (the proposed change), 64-bit values can be inserted into the fdt, so the values we put in don't get truncated, and thus kexec/kdump read the correct thing when they need the values.
I don't see how the tools could be fixed - fdt is truncating the values, and the generated fdt is already "static" at the point the tools run. We haven't had luck changing the cell size at the point the tools run. Additionally, this seems to be an issue for everything using the fdt - pushing the problem to every tool instead of fixing once at the top seems like playing a game of whack-a-mole.
Quoted 2 lines
Does that clarify that issue for you? Obviously the commit text needs some work, but I'd like to get on the same page first.
If you could update the commit message to explicitly mention the properties being inserted for which this matters, this generally sounds fine to me.
Please Cc me on v2.
Thanks,
Mark._______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 5 lines
Jeffrey Hugo Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.
PATCH 1/1 efi/libstub/arm*: Set default address and size cells values for an empty dtb
Quoted 53 lines · Jeffrey Hugo
Quoted 52 lines · Mark Rutland
Quoted 48 lines · Jeffrey Hugo
Quoted 17 lines · Ard Biesheuvel
Quoted 8 lines · Jeffrey Hugo
From: Sameer Goel <[email protected]>
In cases where a device tree is not provided (ie ACPI based system), an empty fdt is generated by efistub. Sets the address and size cell values
in a generated fdt to support 64 bit addressing.Quoted 6 lines
This enables kexec/kdump on Qualcomm Technologies QDF24XX platforms as those
utilities will read the address/size values from the fdt, and such values
may exceed the range provided by the 32 bit default.Quoted 4 lines
As far as I know, those properties are explicitly associated with the 'reg' properties of subordinate nodes. So which nodes are we talking about here? Are we producing an incorrect DT by not setting these? Or is this simply a convenience to work around bugs in the tooling?
I think we are producing an incorrect DT, in some instances.
So we are starting from the same baseline, this is specific to ACPI systems, as an ACPI system won't have a DT from the bootloader. DT based systems will already have a DT from the bootloader which is assumed to be correct. On ACPI systems without a DT, efistub generates a default one.
That default is assumed to be for a 32-bit system. The cell width defaults to 1, which is 4 bytes. You cannot represent a 64-bit value in that instance.
What happens is that kexec inserts properties into the fdt which contain the start address and size on the crash kernel. On our system, the start address is a 64-bit value, and while its not the case today, I see no reason why size could not also be a 64-bit value. However the values that are inserted into the fdt are governed by the address and size cell values already present in the fdt.
Kexec attempts to insert these values in the fdt. The fdt only accepts 32-bit values, so it truncates what is put in. Then later kexec/kdump read the values from the fdt, and get garbage.
Quoted 9 lines
Quoted 4 lines
I take it this is specific to the kdump properties?
I can't immediately see what would matter for the !kdump case. properties inserted under /chosen are not truncated?
The kexec/kdump properties are added under /chosen, therefore yes, properties added under /chosen are truncated, per our observations.
You still haven't told use the name of those properties :-)
If they are not 'reg' properties, why do #address-cells & #size-cells matter at all? Is it the dtc tool that does this internally?
Quoted 17 lines
Quoted 17 lines
Quoted 15 lines
By changing the defaults to 2 (the proposed change), 64-bit values can be inserted into the fdt, so the values we put in don't get truncated, and thus kexec/kdump read the correct thing when they need the values.
I don't see how the tools could be fixed - fdt is truncating the values, and the generated fdt is already "static" at the point the tools run. We haven't had luck changing the cell size at the point the tools run. Additionally, this seems to be an issue for everything using the fdt - pushing the problem to every tool instead of fixing once at the top seems like playing a game of whack-a-mole.
Does that clarify that issue for you? Obviously the commit text needs some work, but I'd like to get on the same page first.
Quoted 6 lines
Quoted 6 lines
If you could update the commit message to explicitly mention the properties being inserted for which this matters, this generally sounds fine to me.
Please Cc me on v2.
Likewise
PATCH 1/1 efi/libstub/arm*: Set default address and size cells values for an empty dtb
In reply to Jeffrey HugoQuoted 44 lines · Jeffrey Hugo
Quoted 43 lines · Mark Rutland
Quoted 41 lines · Jeffrey Hugo
Quoted 12 lines · Ard Biesheuvel
Quoted 10 lines · Jeffrey Hugo
From: Sameer Goel <[email protected]>
In cases where a device tree is not provided (ie ACPI based system), an empty fdt is generated by efistub. Sets the address and size cell values in a generated fdt to support 64 bit addressing.
This enables kexec/kdump on Qualcomm Technologies QDF24XX platforms as those utilities will read the address/size values from the fdt, and such values may exceed the range provided by the 32 bit default.
Quoted 4 lines
As far as I know, those properties are explicitly associated with the 'reg' properties of subordinate nodes. So which nodes are we talking about here? Are we producing an incorrect DT by not setting these? Or is this simply a convenience to work around bugs in the tooling?
I think we are producing an incorrect DT, in some instances.
So we are starting from the same baseline, this is specific to ACPI systems, as an ACPI system won't have a DT from the bootloader. DT based systems will already have a DT from the bootloader which is assumed to be correct. On ACPI systems without a DT, efistub generates a default one.
That default is assumed to be for a 32-bit system. The cell width defaults to 1, which is 4 bytes. You cannot represent a 64-bit value in that instance.
What happens is that kexec inserts properties into the fdt which contain the start address and size on the crash kernel. On our system, the start address is a 64-bit value, and while its not the case today, I see no reason why size could not also be a 64-bit value. However the values that are inserted into the fdt are governed by the address and size cell values already present in the fdt.
Kexec attempts to insert these values in the fdt. The fdt only accepts 32-bit values, so it truncates what is put in. Then later kexec/kdump read the values from the fdt, and get garbage.
Quoted 7 lines
Quoted 4 lines
I take it this is specific to the kdump properties?
I can't immediately see what would matter for the !kdump case. properties inserted under /chosen are not truncated?
The kexec/kdump properties are added under /chosen, therefore yes, properties added under /chosen are truncated, per our observations.
Sorry for the dodgy (and confusing) reply above.
What I was trying to ask was does this *only* affect kdump properties? I note that kdump is not yet upstream for arm64.
Or are there regular kexec properties that this affects?
Or !kdump && !kexec properties?
Can you please enumerate the set of properties for which this matters?
Thanks,
Mark.
PATCH 1/1 efi/libstub/arm*: Set default address and size cells values for an empty dtb
Quoted 55 lines · Mark Rutland
Quoted 44 lines · Jeffrey Hugo
Quoted 43 lines · Mark Rutland
Quoted 41 lines · Jeffrey Hugo
Quoted 12 lines · Ard Biesheuvel
Quoted 10 lines · Jeffrey Hugo
From: Sameer Goel <[email protected]>
In cases where a device tree is not provided (ie ACPI based system), an empty fdt is generated by efistub. Sets the address and size cell values in a generated fdt to support 64 bit addressing.
This enables kexec/kdump on Qualcomm Technologies QDF24XX platforms as those utilities will read the address/size values from the fdt, and such values may exceed the range provided by the 32 bit default.
Quoted 4 lines
As far as I know, those properties are explicitly associated with the 'reg' properties of subordinate nodes. So which nodes are we talking about here? Are we producing an incorrect DT by not setting these? Or is this simply a convenience to work around bugs in the tooling?
I think we are producing an incorrect DT, in some instances.
So we are starting from the same baseline, this is specific to ACPI systems, as an ACPI system won't have a DT from the bootloader. DT based systems will already have a DT from the bootloader which is assumed to be correct. On ACPI systems without a DT, efistub generates a default one.
That default is assumed to be for a 32-bit system. The cell width defaults to 1, which is 4 bytes. You cannot represent a 64-bit value in that instance.
What happens is that kexec inserts properties into the fdt which contain the start address and size on the crash kernel. On our system, the start address is a 64-bit value, and while its not the case today, I see no reason why size could not also be a 64-bit value. However the values that are inserted into the fdt are governed by the address and size cell values already present in the fdt.
Kexec attempts to insert these values in the fdt. The fdt only accepts 32-bit values, so it truncates what is put in. Then later kexec/kdump read the values from the fdt, and get garbage.
Quoted 7 lines
Quoted 4 lines
I take it this is specific to the kdump properties?
I can't immediately see what would matter for the !kdump case. properties inserted under /chosen are not truncated?
The kexec/kdump properties are added under /chosen, therefore yes, properties added under /chosen are truncated, per our observations.
Sorry for the dodgy (and confusing) reply above.
Quoted 8 lines
What I was trying to ask was does this *only* affect kdump properties? I note that kdump is not yet upstream for arm64.
Or are there regular kexec properties that this affects?
Or !kdump && !kexec properties?
Can you please enumerate the set of properties for which this matters?
"linux,elfcorehdr" and "linux,usable-memory-range"
We are not aware of !kdump && !kexec properties where this is an issue.
Quoted 9 lines
Thanks,
Mark._______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 5 lines
Jeffrey Hugo Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.
PATCH 1/1 efi/libstub/arm*: Set default address and size cells values for an empty dtb
Quoted 18 lines · Jeffrey Hugo
Quoted 17 lines · Mark Rutland
Quoted 8 lines · Jeffrey Hugo
Quoted 4 lines · Mark Rutland
I take it this is specific to the kdump properties?
I can't immediately see what would matter for the !kdump case. properties inserted under /chosen are not truncated?
The kexec/kdump properties are added under /chosen, therefore yes, properties added under /chosen are truncated, per our observations.
Sorry for the dodgy (and confusing) reply above.
What I was trying to ask was does this *only* affect kdump properties? I note that kdump is not yet upstream for arm64.
Or are there regular kexec properties that this affects?
Quoted 7 lines
Quoted 3 lines
Or !kdump && !kexec properties?
Can you please enumerate the set of properties for which this matters?
"linux,elfcorehdr" and "linux,usable-memory-range"
We are not aware of !kdump && !kexec properties where this is an issue.
Ok, I understand the problem now. Thanks for clarifying the !kdump situation.
As per my reply to Timur, given this only affects kdump, this is all happening in code that is not upstream, and therefore this is not *currently* an issue.
In future, please report this kind of issue in reply to relevant postings (e.g. [1]). At the very least, refer to these, with relevant people Cc'd (e.g. Takahiro-san in this case).
I think there are three things which should happen:
(a) The userspace kexec-tools kdump code should take /#address-cells and /#size-cells into account when inserting the linux,elfcorehdr and linux,usable-memory-range properties. There can be DTs for 64 bit platforms where these are not 2.
Takahiro-san, from looking at your kexec-tools repo, this is not currently the case. Could you address that?
(b) The kdump documentation should updated to explicitly state that these properties are #address-cells + #size-cells tuples, since this is clearly going to be confusing either way. I'll try to come up with wording for that, and I'll reply on the current [1] kdump thread.
(c) Regardless, when creating the empty DT the EFI stub should insert /#address-cells = <2> and /#size-cells = <2>. That better aligns with the usual requirements for an otherwise empty DTB, and avoids a tonne of fragility when the DTB is passed on or altered by other agents.
So, please respin this patch, stating explicitly what this matters for.
Thanks,
Mark.
[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2017-February/486234.html
PATCH 1/1 efi/libstub/arm*: Set default address and size cells values for an empty dtb
Hi Mark,
Thank you for this heads-up.
Quoted 40 lines · Mark Rutland
Quoted 18 lines · Jeffrey Hugo
Quoted 17 lines · Mark Rutland
Quoted 8 lines · Jeffrey Hugo
Quoted 4 lines · Mark Rutland
I take it this is specific to the kdump properties?
I can't immediately see what would matter for the !kdump case. properties inserted under /chosen are not truncated?
The kexec/kdump properties are added under /chosen, therefore yes, properties added under /chosen are truncated, per our observations.
Sorry for the dodgy (and confusing) reply above.
What I was trying to ask was does this *only* affect kdump properties? I note that kdump is not yet upstream for arm64.
Or are there regular kexec properties that this affects?
Quoted 7 lines
Quoted 3 lines
Or !kdump && !kexec properties?
Can you please enumerate the set of properties for which this matters?
"linux,elfcorehdr" and "linux,usable-memory-range"
We are not aware of !kdump && !kexec properties where this is an issue.
Ok, I understand the problem now. Thanks for clarifying the !kdump situation.
As per my reply to Timur, given this only affects kdump, this is all happening in code that is not upstream, and therefore this is not *currently* an issue.
In future, please report this kind of issue in reply to relevant postings (e.g. [1]). At the very least, refer to these, with relevant people Cc'd (e.g. Takahiro-san in this case).
I think there are three things which should happen:
Quoted 7 lines
(a) The userspace kexec-tools kdump code should take /#address-cells and /#size-cells into account when inserting the linux,elfcorehdr and linux,usable-memory-range properties. There can be DTs for 64 bit platforms where these are not 2.
Takahiro-san, from looking at your kexec-tools repo, this is not currently the case. Could you address that?
Yup, I will, but if this is the case,
we might need to think about another case where /#address-cells and /#size-cells are <1> but the range of crash dump kernel can be still 64-bit wide since the system memory information comes from ACPI table (not DT).
Therefore, the properties in this case should look like:
/ {
#address-cells = <1>;
#size-cells = <1>;
chosen {
...
linux,usable-memory-range {
#address-cells = <2>;
#size-cells = <2>; may be omitted if possible
reg = < ... >;
}
linux,elfcorehdr {
#address-cells = <2>;
#size-cells = <2>; may be omitted if possible
reg = < ... >;
}
...
}
}Is this what you meant?
(Obviously, I will have to modify the kernel patches as well.)
Thanks,
-Takahiro AKASHI
Quoted 18 lines
(b) The kdump documentation should updated to explicitly state that these properties are #address-cells + #size-cells tuples, since this is clearly going to be confusing either way. I'll try to come up with wording for that, and I'll reply on the current [1] kdump thread.
(c) Regardless, when creating the empty DT the EFI stub should insert /#address-cells = <2> and /#size-cells = <2>. That better aligns with the usual requirements for an otherwise empty DTB, and avoids a tonne of fragility when the DTB is passed on or altered by other agents.
So, please respin this patch, stating explicitly what this matters for.
Thanks,
Mark.[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2017-February/486234.html
PATCH 1/1 efi/libstub/arm*: Set default address and size cells values for an empty dtb
Quoted 78 lines · Takahiro
Hi Mark,
Thank you for this heads-up.
Quoted 40 lines · Mark Rutland
Quoted 18 lines · Jeffrey Hugo
Quoted 17 lines · Mark Rutland
Quoted 8 lines · Jeffrey Hugo
Quoted 4 lines · Mark Rutland
I take it this is specific to the kdump properties?
I can't immediately see what would matter for the !kdump case. properties inserted under /chosen are not truncated?
The kexec/kdump properties are added under /chosen, therefore yes, properties added under /chosen are truncated, per our observations.
Sorry for the dodgy (and confusing) reply above.
What I was trying to ask was does this *only* affect kdump properties? I note that kdump is not yet upstream for arm64.
Or are there regular kexec properties that this affects?
Quoted 7 lines
Quoted 3 lines
Or !kdump && !kexec properties?
Can you please enumerate the set of properties for which this matters?
"linux,elfcorehdr" and "linux,usable-memory-range"
We are not aware of !kdump && !kexec properties where this is an issue.
Ok, I understand the problem now. Thanks for clarifying the !kdump situation.
As per my reply to Timur, given this only affects kdump, this is all happening in code that is not upstream, and therefore this is not *currently* an issue.
In future, please report this kind of issue in reply to relevant postings (e.g. [1]). At the very least, refer to these, with relevant people Cc'd (e.g. Takahiro-san in this case).
I think there are three things which should happen:
Quoted 7 lines
(a) The userspace kexec-tools kdump code should take /#address-cells and /#size-cells into account when inserting the linux,elfcorehdr and linux,usable-memory-range properties. There can be DTs for 64 bit platforms where these are not 2.
Takahiro-san, from looking at your kexec-tools repo, this is not currently the case. Could you address that?
Yup, I will, but if this is the case,
we might need to think about another case where /#address-cells and /#size-cells are <1> but the range of crash dump kernel can be still 64-bit wide since the system memory information comes from ACPI table (not DT).Therefore, the properties in this case should look like:
/ { #address-cells = <1>; #size-cells = <1>; chosen { ... linux,usable-memory-range { #address-cells = <2>; #size-cells = <2>; may be omitted if possible reg = < ... >; } linux,elfcorehdr { #address-cells = <2>; #size-cells = <2>; may be omitted if possible reg = < ... >; } ... } }
Quoted 3 lines
Is this what you meant?
(Obviously, I will have to modify the kernel patches as well.)
I think the cell sizes of reg properties are defined in terms of the #address/size-cells attributes of the parent node. This makes sense when you think of it, because the regs of all nodes under the same parent should have the same size, given that they all live in their parent's address space. Of course, /chosen is special since it does not describe a bus.
So that means the tooling /could/ inject #address-cells/size-cells properties either at the root, or in /chosen, but not in the kdump properties themselves. However, that is not the point.
The point is that the tooling should take *existing* cell counts into
account: if there are no address-cells/size-cells properties under /chosen or under the root node, the tooling should use 32-bit quantities for address and size. If there are such properties, it should emit reg tuples of the same size as the cells properties describe.
PATCH 1/1 efi/libstub/arm*: Set default address and size cells values for an empty dtb
Quoted 84 lines · Ard Biesheuvel
Quoted 78 lines · Takahiro
Hi Mark,
Thank you for this heads-up.
Quoted 40 lines · Mark Rutland
Quoted 18 lines · Jeffrey Hugo
Quoted 17 lines · Mark Rutland
Quoted 8 lines · Jeffrey Hugo
Quoted 4 lines · Mark Rutland
I take it this is specific to the kdump properties?
I can't immediately see what would matter for the !kdump case. properties inserted under /chosen are not truncated?
The kexec/kdump properties are added under /chosen, therefore yes, properties added under /chosen are truncated, per our observations.
Sorry for the dodgy (and confusing) reply above.
What I was trying to ask was does this *only* affect kdump properties? I note that kdump is not yet upstream for arm64.
Or are there regular kexec properties that this affects?
Quoted 7 lines
Quoted 3 lines
Or !kdump && !kexec properties?
Can you please enumerate the set of properties for which this matters?
"linux,elfcorehdr" and "linux,usable-memory-range"
We are not aware of !kdump && !kexec properties where this is an issue.
Ok, I understand the problem now. Thanks for clarifying the !kdump situation.
As per my reply to Timur, given this only affects kdump, this is all happening in code that is not upstream, and therefore this is not *currently* an issue.
In future, please report this kind of issue in reply to relevant postings (e.g. [1]). At the very least, refer to these, with relevant people Cc'd (e.g. Takahiro-san in this case).
I think there are three things which should happen:
Quoted 7 lines
(a) The userspace kexec-tools kdump code should take /#address-cells and /#size-cells into account when inserting the linux,elfcorehdr and linux,usable-memory-range properties. There can be DTs for 64 bit platforms where these are not 2.
Takahiro-san, from looking at your kexec-tools repo, this is not currently the case. Could you address that?
Yup, I will, but if this is the case,
we might need to think about another case where /#address-cells and /#size-cells are <1> but the range of crash dump kernel can be still 64-bit wide since the system memory information comes from ACPI table (not DT).Therefore, the properties in this case should look like:
/ { #address-cells = <1>; #size-cells = <1>; chosen { ... linux,usable-memory-range { #address-cells = <2>; #size-cells = <2>; may be omitted if possible reg = < ... >; } linux,elfcorehdr { #address-cells = <2>; #size-cells = <2>; may be omitted if possible reg = < ... >; } ... } }Quoted 3 lines
Is this what you meant?
(Obviously, I will have to modify the kernel patches as well.)
Quoted 6 lines
I think the cell sizes of reg properties are defined in terms of the #address/size-cells attributes of the parent node. This makes sense when you think of it, because the regs of all nodes under the same parent should have the same size, given that they all live in their parent's address space. Of course, /chosen is special since it does not describe a bus.
I see.
Quoted 2 lines
So that means the tooling /could/ inject #address-cells/size-cells properties either at the root, or in /chosen, but not in the kdump
/chosen, too?
Now I believe that /chosen should not have #address-cells/size-cells because there is no assumption that all the nodes under /chosen have the same values for #address-cells/#size-cells. (Anyhow, this is very exceptional given the meanings of /chosen.)
Quoted 8 lines
properties themselves. However, that is not the point.
The point is that the tooling should take *existing* cell counts into
account: if there are no address-cells/size-cells properties under /chosen or under the root node, the tooling should use 32-bit quantities for address and size. If there are such properties, it should emit reg tuples of the same size as the cells properties describe.
Let me make sure one thing:
is there a requirement that the root node must have #address-cells/ #size-cells?
I found such a statement, at least, in booting-without-of.txt (only applied to ppc? See III-5-a).
Thanks,
-Takahiro AKASHI
PATCH 1/1 efi/libstub/arm*: Set default address and size cells values for an empty dtb
Quoted 5 lines · Takahiro
is there a requirement that the root node must have #address-cells/ #size-cells?
I found such a statement, at least, in booting-without-of.txt (only applied to ppc? See III-5-a).
If you want to be able to represent 64-bit 'reg' addresses anywhere in the device tree, then you will need #address-cells = <2> and #size-cells = <2> at any appropriate location, which is usually the root node for a 64-bit processor.
Signature · 3 lines
Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.
PATCH 1/1 efi/libstub/arm*: Set default address and size cells values for an empty dtb
In reply to Ard BiesheuvelQuoted 7 lines · Ard Biesheuvel
The point is that the tooling should take *existing* cell counts into
account: if there are no address-cells/size-cells properties under /chosen or under the root node, the tooling should use 32-bit quantities for address and size. If there are such properties, it should emit reg tuples of the same size as the cells properties describe.
I agree with this 100%, but that means that we need to be able to inject address-cells/size-cells properties at some point, otherwise we'll never be able to store 64-bit addresses. And that's what Sameer's patch does. It injects those properties at the appropriate time. Any code that parses 'reg' properties without taking the address-cells/size-cells properties into account is technically incorrect and should be fixed..
Signature · 3 lines
Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.
PATCH 1/1 efi/libstub/arm*: Set default address and size cells values for an empty dtb
In reply to AKASHI, TakahiroQuoted 7 lines · Takahiro
Quoted 5 lines · Mark Rutland
(a) The userspace kexec-tools kdump code should take /#address-cells and /#size-cells into account when inserting the linux,elfcorehdr and linux,usable-memory-range properties. There can be DTs for 64 bit platforms where these are not 2.
Quoted 7 lines
Quoted 2 lines
Takahiro-san, from looking at your kexec-tools repo, this is not currently the case. Could you address that?
Yup, I will, but if this is the case,
we might need to think about another case where /#address-cells and /#size-cells are <1> but the range of crash dump kernel can be still 64-bit wide since the system memory information comes from ACPI table (not DT).
That should only happen on an ACPI system for which the vendor has also provided a DT in the FW, and also chose to use /#address-cells = <1> and/or /#size-cells = <1>. We could log a warning and give up in this case.
In the Purely DT case it shouldn't be a problem, since that would imply all memory is within 32 bits.
... the other option Ard suggested was that we make these properties always take 64-bit address and size values, and don't use #address-cells or #size-cells at all when parsing them. I wasn't keen on this since the properties would be reg-like, but potentially different in size. Maybe that is the better option, though. :/
Quoted 20 lines
Therefore, the properties in this case should look like:
/ { #address-cells = <1>; #size-cells = <1>; chosen { ... linux,usable-memory-range { #address-cells = <2>; #size-cells = <2>; may be omitted if possible reg = < ... >; } linux,elfcorehdr { #address-cells = <2>; #size-cells = <2>; may be omitted if possible reg = < ... >; } ... } }
Quoted 2 lines
Is this what you meant?
(Obviously, I will have to modify the kernel patches as well.)
No; I was assuming we'd only change the userspace code, not the binding or the kernel parsing.
If nothing else, the root /#address-cells and /#size-cells would have to be widened to handle the translation, so the above alone is not sufficient.
Thanks,
Mark.
PATCH 1/1 efi/libstub/arm*: Set default address and size cells values for an empty dtb
In reply to Jeffrey HugoHi,
Quoted 9 lines · Jeffrey Hugo
From: Sameer Goel <[email protected]>
In cases where a device tree is not provided (ie ACPI based system), an empty fdt is generated by efistub. Sets the address and size cell values in a generated fdt to support 64 bit addressing.
This enables kexec/kdump on Qualcomm Technologies QDF24XX platforms as those utilities will read the address/size values from the fdt, and such values may exceed the range provided by the 32 bit default.
The description here doesn't state why this is a problem for ACPI.
What values are being read by the tools, and for what purpose?
Are they extracting data from the DTB, or is this part of inserting a new property?
Why does this adversely affect ACPI?
Quoted 1 line
Change-Id: Ie7f3637e375bd6631c6bda1f7b3c9003765ff4a5
Please remove this kind of tags from upstream patches. It's irrelevant.
Quoted 31 lines
Signed-off-by Sameer Goel <[email protected]>Signed-off-by Jeffrey Hugo <[email protected]>--- drivers/firmware/efi/libstub/fdt.c | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-)drivers/firmware/efi/libstub/fdt.c +17
-0@@ -16,6 +16,34 @@#include "efistub.h" +#define EFI_DT_ADDR_CELLS_DEFAULT 2 +#define EFI_DT_SIZE_CELLS_DEFAULT 2 + +static void fdt_update_cell_size (efi_system_table_t *sys_table,void *fdt) +{ +int offset; +int status; + + offset =fdt_path_offset (fdt,"/" ); +/* Set the #address-cells and #size-cells values for an empty tree */ + + status =fdt_setprop_u32 (fdt, offset,"#address-cells" , +EFI_DT_ADDR_CELLS_DEFAULT ); +if (status) { +pr_efi (sys_table, +"Failed to set #address-cells for empty dtb\n" ); +return ;
drivers/firmware/efi/libstub/fdt.c line 45
Quoted 10 lines
drivers/firmware/efi/libstub/fdt.c +10
-0+ } + + status =fdt_setprop_u32 (fdt, offset,"#size-cells" , +EFI_DT_SIZE_CELLS_DEFAULT ); +if (status) { +pr_efi (sys_table, +"Failed to set #size-cells for empty dtb\n" ); +return ; + } +}
We don't seem to log anything for most other failures within update_fdt() where this is called.
Are these really much more special?
drivers/firmware/efi/libstub/fdt.c static efi_status_t update_fdt(efi_system_table_t *sys_table, void *orig_fdt, · line 75
Quoted 9 lines
drivers/firmware/efi/libstub/fdt.c +1
-1static efi_status_t update_fdt(efi_system_table_t *sys_table, void *orig_fdt, unsigned long orig_fdt_size, void *fdt, int new_fdt_size, char *cmdline_ptr,@@ -44,8 +72,16 @@ static efi_status_t update_fdt(efi_system_table_t *sys_table, void *orig_fdt,if (orig_fdt) status =fdt_open_into (orig_fdt, fdt, new_fdt_size); -else +else {
Nit: if one side of an if-else has braces, the other should too per the usual kernel coding style.
Thanks,
Mark.
PATCH 1/1 efi/libstub/arm*: Set default address and size cells values for an empty dtb
Quoted 13 lines · Mark Rutland
Hi,
Quoted 9 lines · Jeffrey Hugo
From: Sameer Goel <[email protected]>
In cases where a device tree is not provided (ie ACPI based system), an empty fdt is generated by efistub. Sets the address and size cell values in a generated fdt to support 64 bit addressing.
This enables kexec/kdump on Qualcomm Technologies QDF24XX platforms as those utilities will read the address/size values from the fdt, and such values may exceed the range provided by the 32 bit default.
Quoted 8 lines
The description here doesn't state why this is a problem for ACPI.
What values are being read by the tools, and for what purpose?
Are they extracting data from the DTB, or is this part of inserting a new property?
Why does this adversely affect ACPI?
I think the response I am about to send to Ard will address these questions.
Quoted 4 lines
Quoted 2 lines
Change-Id: Ie7f3637e375bd6631c6bda1f7b3c9003765ff4a5
Please remove this kind of tags from upstream patches. It's irrelevant.
Yep, sorry about that. I should know better.
Quoted 53 lines
Quoted 32 lines
Signed-off-by Sameer Goel <[email protected]>Signed-off-by Jeffrey Hugo <[email protected]>--- drivers/firmware/efi/libstub/fdt.c | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-)drivers/firmware/efi/libstub/fdt.c +17
-0@@ -16,6 +16,34 @@#include "efistub.h" +#define EFI_DT_ADDR_CELLS_DEFAULT 2 +#define EFI_DT_SIZE_CELLS_DEFAULT 2 + +static void fdt_update_cell_size (efi_system_table_t *sys_table,void *fdt) +{ +int offset; +int status; + + offset =fdt_path_offset (fdt,"/" ); +/* Set the #address-cells and #size-cells values for an empty tree */ + + status =fdt_setprop_u32 (fdt, offset,"#address-cells" , +EFI_DT_ADDR_CELLS_DEFAULT ); +if (status) { +pr_efi (sys_table, +"Failed to set #address-cells for empty dtb\n" ); +return ;drivers/firmware/efi/libstub/fdt.c line 45
Quoted 10 lines
drivers/firmware/efi/libstub/fdt.c +10
-0+ } + + status =fdt_setprop_u32 (fdt, offset,"#size-cells" , +EFI_DT_SIZE_CELLS_DEFAULT ); +if (status) { +pr_efi (sys_table, +"Failed to set #size-cells for empty dtb\n" ); +return ; + } +}We don't seem to log anything for most other failures within
update_fdt()where this is called.Are these really much more special?
Quoted 5 lines
drivers/firmware/efi/libstub/fdt.c +0
-0static efi_status_t update_fdt(efi_system_table_t *sys_table, void *orig_fdt, unsigned long orig_fdt_size, void *fdt, int new_fdt_size, char *cmdline_ptr,@@ -44,8 +72,16 @@ static efi_status_t update_fdt(efi_system_table_t *sys_table, void *orig_fdt,
Quoted 7 lines
drivers/firmware/efi/libstub/fdt.c static efi_status_t update_fdt(efi_system_table_t *sys_table, void *orig_fdt, · line 75
Quoted 4 lines
drivers/firmware/efi/libstub/fdt.c +1
-1if (orig_fdt) status =fdt_open_into (orig_fdt, fdt, new_fdt_size); -else +else {Nit: if one side of an if-else has braces, the other should too per the usual kernel coding style.
Will fix.
Quoted 4 lines
Thanks,
Mark.
Signature · 5 lines
Jeffrey Hugo Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.
PATCH 1/1 efi/libstub/arm*: Set default address and size cells values for an empty dtb
In reply to Mark RutlandQuoted 10 lines · Mark Rutland
Quoted 8 lines
In cases where a device tree is not provided (ie ACPI based system), an empty fdt is generated by efistub. Sets the address and size cell values in a generated fdt to support 64 bit addressing.
This enables kexec/kdump on Qualcomm Technologies QDF24XX platforms as those utilities will read the address/size values from the fdt, and such values may exceed the range provided by the 32 bit default.
The description here doesn't state why this is a problem for ACPI.
The patch description could use some work. It's a problem for ACPI because EFI-based systems call typically fdt_create_empty_tree(), which is where the problem lies.
The bug is that fdt_create_empty_tree() literally creates an empty tree. By default if a node is missing #address-cells and #size-cells properties, then it's assume that both values are equal to 1, i.e. 32-bit addresses.
When update_fdt() in drivers/firmware/efi/libstub/fdt.c creates an empty tree, it then proceeds to inject 64-bit addresses into that tree. When kdump tries to process the address properties, it reads the wrong values because it thinks they are all 32-bit addresses.
Signature · 3 lines
Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.
PATCH 1/1 efi/libstub/arm*: Set default address and size cells values for an empty dtb
Quoted 12 lines · Timur Tabi
Quoted 10 lines · Mark Rutland
Quoted 8 lines
In cases where a device tree is not provided (ie ACPI based system), an empty fdt is generated by efistub. Sets the address and size cell values in a generated fdt to support 64 bit addressing.
This enables kexec/kdump on Qualcomm Technologies QDF24XX platforms as those utilities will read the address/size values from the fdt, and such values may exceed the range provided by the 32 bit default.
The description here doesn't state why this is a problem for ACPI.
Quoted 8 lines
The patch description could use some work. It's a problem for ACPI because EFI-based systems call typically
fdt_create_empty_tree(), which is where the problem lies.The bug is that
fdt_create_empty_tree()literally creates an empty tree. By default if a node is missing #address-cells and #size-cells properties, then it's assume that both values are equal to 1, i.e. 32-bit addresses.
Sure, I understand this.
Quoted 4 lines
When
update_fdt()indrivers/firmware/efi/libstub/fdt.ccreates an empty tree, it then proceeds to inject 64-bit addresses into that tree. When kdump tries to process the address properties, it reads the wrong values because it thinks they are all 32-bit addresses.
This is *not* true.
The EFI stub only injects values which are always defined to be 64 bits in width.
In Takahiro-san's arm64/kdump branch, the userspace kdump code doesn't parse properties out of the DT.
In fact, it simply assumes that the kdump-specific properties always have 64 bits of address, and 64-bits of size, and inserts these sized accordingly.
The kdump kernel, however, tries to use /#address-cells and /#size-cells. That is where I assume things go wrong.
There is no upstream kdump code for arm64.
Thanks,
Mark.