Skip to contentSkip to conversation

bootconfig: Increase size and node limit of bootconfig for DCC support

PATCH In review Souradeep Chowdhury 3 participants 11 messages Jan 9, 2023 – Jan 19, 2023

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

cover bootconfig: Increase size and node limit of bootconfig for DCC support

The Data Capture and Compare(DCC) is a debugging tool that uses the bootconfig for configuring the register values during boot-time. Increased the max size and nodes supported by bootconfig to catre to the needs of the Data Capture and Compare Driver. Further details on DCC is available on the below links:-

https://lore.kernel.org/linux-arm-kernel/[email protected]/T/

https://lore.kernel.org/linux-arm-kernel/[email protected]/

Souradeep Chowdhury (1):
bootconfig: Increase max size of bootconfig from 32 KB to 256 KB for
DCC support

 include/linux/bootconfig.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--
2.7.4

#1 lore raw

PATCH 1/1 bootconfig: Increase max size of bootconfig from 32 KB to 256 KB for DCC support

Increasing the memory size of bootconfig to be able to handle a max number of 8192 nodes to be fitted in memory size of 256KB.

---
 include/linux/bootconfig.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
include/linux/bootconfig.h +3 -3
index 1611f9d..64d233b 100644
@@ -55,11 +55,11 @@ struct xbc_node {
 } __attribute__ ((__packed__));
 
 #define XBC_KEY		0
-#define XBC_VALUE	(1 << 15)
-/* Maximum size of boot config is 32KB - 1 */
+#define XBC_VALUE	(1 << 18)
+/* Maximum size of boot config is 256KB - 1 */
 #define XBC_DATA_MAX	(XBC_VALUE - 1)
 
-#define XBC_NODE_MAX	1024
+#define XBC_NODE_MAX	8192
 #define XBC_KEYLEN_MAX	256
 #define XBC_DEPTH_MAX	16
 
Signature · 1 line
2.7.4
#2 lore raw

Re: [PATCH V0 1/1] bootconfig: Increase max size of bootconfig from 32 KB to 256 KB for DCC support

Quoted 3 lines · Souradeep Chowdhury

Increasing the memory size of bootconfig to be able to handle a max number of 8192 nodes to be fitted in memory size of 256KB.

This states what the patch does, but not why.

The description you put in the cover letter does capture the why, but the cover-letter won't be part of the git history (and if it was, there's no reason to keep the motivation separate from the change). So please move the motivation into the commit message.

Also, there's generally no reason to have a cover-letter for a single patch "series". So please skip the --cover-letter.

Regards,
Bjorn

Quoted 27 lines
---
 include/linux/bootconfig.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
include/linux/bootconfig.h +3 -3
index 1611f9d..64d233b 100644
@@ -55,11 +55,11 @@ struct xbc_node {
 } __attribute__ ((__packed__));
 
 #define XBC_KEY		0
-#define XBC_VALUE	(1 << 15)
-/* Maximum size of boot config is 32KB - 1 */
+#define XBC_VALUE	(1 << 18)
+/* Maximum size of boot config is 256KB - 1 */
 #define XBC_DATA_MAX	(XBC_VALUE - 1)
 
-#define XBC_NODE_MAX	1024
+#define XBC_NODE_MAX	8192
 #define XBC_KEYLEN_MAX	256
 #define XBC_DEPTH_MAX	16
 
Signature · 1 line
2.7.4

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#3 lore raw

Re: [PATCH V0 1/1] bootconfig: Increase max size of bootconfig from 32 KB to 256 KB for DCC support

Quoted 12 lines · Bjorn Andersson
Quoted 3 lines · Souradeep Chowdhury

Increasing the memory size of bootconfig to be able to handle a max number of 8192 nodes to be fitted in memory size of 256KB.

This states what the patch does, but not why.

The description you put in the cover letter does capture the why, but the cover-letter won't be part of the git history (and if it was, there's no reason to keep the motivation separate from the change). So please move the motivation into the commit message.

Quoted 5 lines

Also, there's generally no reason to have a cover-letter for a single patch "series". So please skip the --cover-letter.

Regards,
Bjorn

Ack

Quoted 20 lines
Quoted 20 lines
---
  include/linux/bootconfig.h | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
include/linux/bootconfig.h +2 -2
index 1611f9d..64d233b 100644
@@ -55,11 +55,11 @@ struct xbc_node {
  } __attribute__ ((__packed__));
 
  #define XBC_KEY		0
-#define XBC_VALUE	(1 << 15)
-/* Maximum size of boot config is 32KB - 1 */
+#define XBC_VALUE	(1 << 18)
+/* Maximum size of boot config is 256KB - 1 */
  #define XBC_DATA_MAX	(XBC_VALUE - 1)
 
Quoted 8 lines
Quoted 8 lines
include/linux/bootconfig.h +1 -1
-#define XBC_NODE_MAX	1024
+#define XBC_NODE_MAX	8192
  #define XBC_KEYLEN_MAX	256
  #define XBC_DEPTH_MAX	16
 
Signature · 1 line
2.7.4

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#4 lore raw

Re: [PATCH V0 1/1] bootconfig: Increase max size of bootconfig from 32 KB to 256 KB for DCC support

In reply to Souradeep Chowdhury
Quoted 2 lines · On Mon, 9 Jan 2023 20:01:05 +0530 Souradeep Chowdhury…

Increasing the memory size of bootconfig to be able to handle a max number of 8192 nodes to be fitted in memory size of 256KB.

Sorry, but you missed the 'xbc_node::data' stores the index of the data and that is uint16_t. So the XBC_DATA_MAX is fixed limitation.

The number of nodes (XBC_NODE_MAX) can be expanded because I just decided it to keep the pre-compiled array size ~8KB. Maybe expanding it to 64KB just increase the size of kernel on init memory (and freed after boot).

Could you tell me why you need such a big data for your DCC?

Thank you,

Quoted 28 lines
---
 include/linux/bootconfig.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
include/linux/bootconfig.h +3 -3
index 1611f9d..64d233b 100644
@@ -55,11 +55,11 @@ struct xbc_node {
 } __attribute__ ((__packed__));
 
 #define XBC_KEY		0
-#define XBC_VALUE	(1 << 15)
-/* Maximum size of boot config is 32KB - 1 */
+#define XBC_VALUE	(1 << 18)
+/* Maximum size of boot config is 256KB - 1 */
 #define XBC_DATA_MAX	(XBC_VALUE - 1)
 
-#define XBC_NODE_MAX	1024
+#define XBC_NODE_MAX	8192
 #define XBC_KEYLEN_MAX	256
 #define XBC_DEPTH_MAX	16
 
Signature · 1 line
2.7.4
Signature · 1 line
Masami Hiramatsu (Google) <[email protected]>
#5 lore raw

Re: [PATCH V0 1/1] bootconfig: Increase max size of bootconfig from 32 KB to 256 KB for DCC support

Quoted 9 lines · Masami Hiramatsu (Google)
Quoted 2 lines · On Mon, 9 Jan 2023 20:01:05 +0530 Souradeep Chowdhury…

Increasing the memory size of bootconfig to be able to handle a max number of 8192 nodes to be fitted in memory size of 256KB.

Sorry, but you missed the 'xbc_node::data' stores the index of the data and that is uint16_t. So the XBC_DATA_MAX is fixed limitation.

Quoted 7 lines

The number of nodes (XBC_NODE_MAX) can be expanded because I just decided it to keep the pre-compiled array size ~8KB. Maybe expanding it to 64KB just increase the size of kernel on init memory (and freed after boot).

Could you tell me why you need such a big data for your DCC?

Thank you,

DCC is a debugging tool used in qcom which is needed to debug crashes
that can happen at boot-time. For debugging purposes a large number of
registers need to be configured in DCC driver which is to be fed via the
bootconfig file. For that we need to expand the nodes as well as memory
for using bootconfig.
Can you let us know the changes that you suggest for doing the same? Is it fine to just increase the XBC_NODE_MAX, do we also need to change the uint16_t to u32 for proper storing of index values?

Quoted 31 lines
Quoted 29 lines
---
  include/linux/bootconfig.h | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
include/linux/bootconfig.h +3 -3
index 1611f9d..64d233b 100644
@@ -55,11 +55,11 @@ struct xbc_node {
  } __attribute__ ((__packed__));
 
  #define XBC_KEY		0
-#define XBC_VALUE	(1 << 15)
-/* Maximum size of boot config is 32KB - 1 */
+#define XBC_VALUE	(1 << 18)
+/* Maximum size of boot config is 256KB - 1 */
  #define XBC_DATA_MAX	(XBC_VALUE - 1)
 
-#define XBC_NODE_MAX	1024
+#define XBC_NODE_MAX	8192
  #define XBC_KEYLEN_MAX	256
  #define XBC_DEPTH_MAX	16
 
Signature · 1 line
2.7.4
#6 lore raw

Re: [PATCH V0 1/1] bootconfig: Increase max size of bootconfig from 32 KB to 256 KB for DCC support

Quoted 18 lines · On Tue, 10 Jan 2023 17:26:07 +0530 Souradeep Chowdhury…
Quoted 15 lines · Masami Hiramatsu (Google)
Quoted 2 lines · On Mon, 9 Jan 2023 20:01:05 +0530 Souradeep Chowdhury…

Increasing the memory size of bootconfig to be able to handle a max number of 8192 nodes to be fitted in memory size of 256KB.

Sorry, but you missed the 'xbc_node::data' stores the index of the data and that is uint16_t. So the XBC_DATA_MAX is fixed limitation.

The number of nodes (XBC_NODE_MAX) can be expanded because I just decided it to keep the pre-compiled array size ~8KB. Maybe expanding it to 64KB just increase the size of kernel on init memory (and freed after boot).

Could you tell me why you need such a big data for your DCC?

Quoted 7 lines
Quoted 1 line

Thank you,

DCC is a debugging tool used in qcom which is needed to debug crashes that can happen at boot-time. For debugging purposes a large number of registers need to be configured in DCC driver which is to be fed via the bootconfig file. For that we need to expand the nodes as well as memory for using bootconfig.

Hmm, how many registers does DCC usually use? And how big the bootconfig file is usually? I have no idea about that.

Quoted 3 lines

Can you let us know the changes that you suggest for doing the same? Is it fine to just increase the XBC_NODE_MAX, do we also need to change the uint16_t to u32 for proper storing of index values?

Expanding the number of max nodes is easy, just increase the XBC_NODE_MAX (must be less than 64k). That will also increase the memory consumption during the boot time even if the bootconfig is small. Anyway, it will be freed after boot, so it maybe OK.

But expanding the size of max bootconfig needs to change the type of the 'data' field to uint32_t (since that will be used for building bootconfig tool) and you also must confirm that tools/bootconfig/bootconfig can be built and pass the test-bootconfig.sh.
Hmm, comparing with expanding the max number of XBC node, changing the 'data' type to uint32_t may not have much impact on memory consumption point of view, because it may increase only 20% of memory, but expanding the MAX_XBC_NODE always increases more than double.

Thus, if we can accept increasing the number of node, it should be OK to change the 'data' type.

BTW, I think now we don't need the ' __attribute__ ((__packed__))' for struct xbc_node. It was packed for reducing the size of array and able to pass 'compiled' bootconfig, but now it is just passed as a text data for safety.

Thank you,

Quoted 33 lines
Quoted 33 lines
Quoted 31 lines
---
  include/linux/bootconfig.h | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
include/linux/bootconfig.h +3 -3
index 1611f9d..64d233b 100644
@@ -55,11 +55,11 @@ struct xbc_node {
  } __attribute__ ((__packed__));
 
  #define XBC_KEY		0
-#define XBC_VALUE	(1 << 15)
-/* Maximum size of boot config is 32KB - 1 */
+#define XBC_VALUE	(1 << 18)
+/* Maximum size of boot config is 256KB - 1 */
  #define XBC_DATA_MAX	(XBC_VALUE - 1)
 
-#define XBC_NODE_MAX	1024
+#define XBC_NODE_MAX	8192
  #define XBC_KEYLEN_MAX	256
  #define XBC_DEPTH_MAX	16
 
Signature · 1 line
2.7.4
Signature · 1 line
Masami Hiramatsu (Google) <[email protected]>
#7 lore raw

Re: [PATCH V0 1/1] bootconfig: Increase max size of bootconfig from 32 KB to 256 KB for DCC support

Quoted 23 lines · Masami Hiramatsu (Google)
Quoted 20 lines · On Tue, 10 Jan 2023 17:26:07 +0530 Souradeep Chowdhury…
Quoted 16 lines · Masami Hiramatsu (Google)
Quoted 2 lines · On Mon, 9 Jan 2023 20:01:05 +0530 Souradeep Chowdhury…

Increasing the memory size of bootconfig to be able to handle a max number of 8192 nodes to be fitted in memory size of 256KB.

Sorry, but you missed the 'xbc_node::data' stores the index of the data and that is uint16_t. So the XBC_DATA_MAX is fixed limitation.

The number of nodes (XBC_NODE_MAX) can be expanded because I just decided it to keep the pre-compiled array size ~8KB. Maybe expanding it to 64KB just increase the size of kernel on init memory (and freed after boot).

Could you tell me why you need such a big data for your DCC?

Thank you,

Quoted 8 lines
Quoted 5 lines

DCC is a debugging tool used in qcom which is needed to debug crashes that can happen at boot-time. For debugging purposes a large number of registers need to be configured in DCC driver which is to be fed via the bootconfig file. For that we need to expand the nodes as well as memory for using bootconfig.

Hmm, how many registers does DCC usually use? And how big the bootconfig file is usually? I have no idea about that.

So a typical bootconfig file for consumption of DCC looks like as follows

dcc_config {
        link_list_0 {
                qcom-curr-link-list = 6
                qcom-link-list = R_0x1781005c_1_apb,
                                 R_0x1782005c_1_apb
        }
        link_list_1 {
                qcom-curr-link-list = 5
                qcom-link-list = R_0x1784005c_1_apb
        }
}

The "qcom-link-list" field can have 1000s of register , based on that max nodes is increased to 8192.

Quoted 9 lines
Quoted 4 lines

Can you let us know the changes that you suggest for doing the same? Is it fine to just increase the XBC_NODE_MAX, do we also need to change the uint16_t to u32 for proper storing of index values?

Expanding the number of max nodes is easy, just increase the XBC_NODE_MAX (must be less than 64k). That will also increase the memory consumption during the boot time even if the bootconfig is small. Anyway, it will be freed after boot, so it maybe OK.

So since the limit is 64K, 8192 is a valid value for max nodes.

Quoted 10 lines

But expanding the size of max bootconfig needs to change the type of the 'data' field to uint32_t (since that will be used for building bootconfig tool) and you also must confirm that tools/bootconfig/bootconfig can be built and pass the test-bootconfig.sh.
Hmm, comparing with expanding the max number of XBC node, changing the 'data' type to uint32_t may not have much impact on memory consumption point of view, because it may increase only 20% of memory, but expanding the MAX_XBC_NODE always increases more than double.

Quoted 2 lines

Thus, if we can accept increasing the number of node, it should be OK to change the 'data' type.

That means from DCC point of view only increasing the max nodes is enough as increasing the data size is unrelated to increasing the max nodes?

Quoted 44 lines

BTW, I think now we don't need the ' __attribute__ ((__packed__))' for struct xbc_node. It was packed for reducing the size of array and able to pass 'compiled' bootconfig, but now it is just passed as a text data for safety.

Thank you,

Quoted 33 lines
Quoted 33 lines
Quoted 31 lines
---
   include/linux/bootconfig.h | 6 +++---
   1 file changed, 3 insertions(+), 3 deletions(-)
include/linux/bootconfig.h +3 -3
index 1611f9d..64d233b 100644
@@ -55,11 +55,11 @@ struct xbc_node {
   } __attribute__ ((__packed__));
 
   #define XBC_KEY		0
-#define XBC_VALUE	(1 << 15)
-/* Maximum size of boot config is 32KB - 1 */
+#define XBC_VALUE	(1 << 18)
+/* Maximum size of boot config is 256KB - 1 */
   #define XBC_DATA_MAX	(XBC_VALUE - 1)
 
-#define XBC_NODE_MAX	1024
+#define XBC_NODE_MAX	8192
   #define XBC_KEYLEN_MAX	256
   #define XBC_DEPTH_MAX	16
 
Signature · 1 line
2.7.4

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#8 lore raw

Re: [PATCH V0 1/1] bootconfig: Increase max size of bootconfig from 32 KB to 256 KB for DCC support

Quoted 49 lines · On Tue, 10 Jan 2023 20:38:54 +0530 Souradeep Chowdhury…
Quoted 23 lines · Masami Hiramatsu (Google)
Quoted 20 lines · On Tue, 10 Jan 2023 17:26:07 +0530 Souradeep Chowdhury…
Quoted 16 lines · Masami Hiramatsu (Google)
Quoted 2 lines · On Mon, 9 Jan 2023 20:01:05 +0530 Souradeep Chowdhury…

Increasing the memory size of bootconfig to be able to handle a max number of 8192 nodes to be fitted in memory size of 256KB.

Sorry, but you missed the 'xbc_node::data' stores the index of the data and that is uint16_t. So the XBC_DATA_MAX is fixed limitation.

The number of nodes (XBC_NODE_MAX) can be expanded because I just decided it to keep the pre-compiled array size ~8KB. Maybe expanding it to 64KB just increase the size of kernel on init memory (and freed after boot).

Could you tell me why you need such a big data for your DCC?

Thank you,

Quoted 8 lines
Quoted 5 lines

DCC is a debugging tool used in qcom which is needed to debug crashes that can happen at boot-time. For debugging purposes a large number of registers need to be configured in DCC driver which is to be fed via the bootconfig file. For that we need to expand the nodes as well as memory for using bootconfig.

Hmm, how many registers does DCC usually use? And how big the bootconfig file is usually? I have no idea about that.

So a typical bootconfig file for consumption of DCC looks like as follows

dcc_config {
         link_list_0 {
                 qcom-curr-link-list = 6
                 qcom-link-list = R_0x1781005c_1_apb,
                                  R_0x1782005c_1_apb
         }
         link_list_1 {
                 qcom-curr-link-list = 5
                 qcom-link-list = R_0x1784005c_1_apb
         }
}
Quoted 2 lines

The "qcom-link-list" field can have 1000s of register , based on that max nodes is increased to 8192.

OK, then the number of fields can be larger than 1000. I got it.

Quoted 6 lines
Quoted 6 lines
Quoted 5 lines

Can you let us know the changes that you suggest for doing the same? Is it fine to just increase the XBC_NODE_MAX, do we also need to change the uint16_t to u32 for proper storing of index values?

Quoted 6 lines
Quoted 4 lines

Expanding the number of max nodes is easy, just increase the XBC_NODE_MAX (must be less than 64k). That will also increase the memory consumption during the boot time even if the bootconfig is small. Anyway, it will be freed after boot, so it maybe OK.

So since the limit is 64K, 8192 is a valid value for max nodes.

Yes. Expanding the number of node is OK to me.

Quoted 11 lines
Quoted 11 lines

But expanding the size of max bootconfig needs to change the type of the 'data' field to uint32_t (since that will be used for building bootconfig tool) and you also must confirm that tools/bootconfig/bootconfig can be built and pass the test-bootconfig.sh.
Hmm, comparing with expanding the max number of XBC node, changing the 'data' type to uint32_t may not have much impact on memory consumption point of view, because it may increase only 20% of memory, but expanding the MAX_XBC_NODE always increases more than double.

Quoted 5 lines
Quoted 2 lines

Thus, if we can accept increasing the number of node, it should be OK to change the 'data' type.

That means from DCC point of view only increasing the max nodes is enough as increasing the data size is unrelated to increasing the max nodes?

Yes, if it is less than 32KB, you just need to increase the XBC_NODE_MAX. But if you think the size of bootconfig, we have to change the type of xbc_node::data field.

Can you check the DCC also need to expand the size of bootconfig limitation?

Thank you!

Quoted 45 lines
Quoted 45 lines

BTW, I think now we don't need the ' __attribute__ ((__packed__))' for struct xbc_node. It was packed for reducing the size of array and able to pass 'compiled' bootconfig, but now it is just passed as a text data for safety.

Thank you,

Quoted 33 lines
Quoted 33 lines
Quoted 31 lines
---
   include/linux/bootconfig.h | 6 +++---
   1 file changed, 3 insertions(+), 3 deletions(-)
include/linux/bootconfig.h +3 -3
index 1611f9d..64d233b 100644
@@ -55,11 +55,11 @@ struct xbc_node {
   } __attribute__ ((__packed__));
 
   #define XBC_KEY		0
-#define XBC_VALUE	(1 << 15)
-/* Maximum size of boot config is 32KB - 1 */
+#define XBC_VALUE	(1 << 18)
+/* Maximum size of boot config is 256KB - 1 */
   #define XBC_DATA_MAX	(XBC_VALUE - 1)
 
-#define XBC_NODE_MAX	1024
+#define XBC_NODE_MAX	8192
   #define XBC_KEYLEN_MAX	256
   #define XBC_DEPTH_MAX	16
 
Signature · 1 line
2.7.4
Signature · 1 line
Masami Hiramatsu (Google) <[email protected]>
#9 lore raw

Re: [PATCH V0 1/1] bootconfig: Increase max size of bootconfig from 32 KB to 256 KB for DCC support

Quoted 89 lines · Masami Hiramatsu (Google)
Quoted 49 lines · On Tue, 10 Jan 2023 20:38:54 +0530 Souradeep Chowdhury…
Quoted 23 lines · Masami Hiramatsu (Google)
Quoted 20 lines · On Tue, 10 Jan 2023 17:26:07 +0530 Souradeep Chowdhury…
Quoted 16 lines · Masami Hiramatsu (Google)
Quoted 2 lines · On Mon, 9 Jan 2023 20:01:05 +0530 Souradeep Chowdhury…

Increasing the memory size of bootconfig to be able to handle a max number of 8192 nodes to be fitted in memory size of 256KB.

Sorry, but you missed the 'xbc_node::data' stores the index of the data and that is uint16_t. So the XBC_DATA_MAX is fixed limitation.

The number of nodes (XBC_NODE_MAX) can be expanded because I just decided it to keep the pre-compiled array size ~8KB. Maybe expanding it to 64KB just increase the size of kernel on init memory (and freed after boot).

Could you tell me why you need such a big data for your DCC?

Thank you,

Quoted 8 lines
Quoted 5 lines

DCC is a debugging tool used in qcom which is needed to debug crashes that can happen at boot-time. For debugging purposes a large number of registers need to be configured in DCC driver which is to be fed via the bootconfig file. For that we need to expand the nodes as well as memory for using bootconfig.

Hmm, how many registers does DCC usually use? And how big the bootconfig file is usually? I have no idea about that.

So a typical bootconfig file for consumption of DCC looks like as follows

dcc_config {
          link_list_0 {
                  qcom-curr-link-list = 6
                  qcom-link-list = R_0x1781005c_1_apb,
                                   R_0x1782005c_1_apb
          }
          link_list_1 {
                  qcom-curr-link-list = 5
                  qcom-link-list = R_0x1784005c_1_apb
          }
}
Quoted 2 lines

The "qcom-link-list" field can have 1000s of register , based on that max nodes is increased to 8192.

OK, then the number of fields can be larger than 1000. I got it.

Quoted 6 lines
Quoted 6 lines
Quoted 5 lines

Can you let us know the changes that you suggest for doing the same? Is it fine to just increase the XBC_NODE_MAX, do we also need to change the uint16_t to u32 for proper storing of index values?

Quoted 6 lines
Quoted 4 lines

Expanding the number of max nodes is easy, just increase the XBC_NODE_MAX (must be less than 64k). That will also increase the memory consumption during the boot time even if the bootconfig is small. Anyway, it will be freed after boot, so it maybe OK.

So since the limit is 64K, 8192 is a valid value for max nodes.

Yes. Expanding the number of node is OK to me.

Quoted 11 lines
Quoted 11 lines

But expanding the size of max bootconfig needs to change the type of the 'data' field to uint32_t (since that will be used for building bootconfig tool) and you also must confirm that tools/bootconfig/bootconfig can be built and pass the test-bootconfig.sh.
Hmm, comparing with expanding the max number of XBC node, changing the 'data' type to uint32_t may not have much impact on memory consumption point of view, because it may increase only 20% of memory, but expanding the MAX_XBC_NODE always increases more than double.

Quoted 5 lines
Quoted 2 lines

Thus, if we can accept increasing the number of node, it should be OK to change the 'data' type.

That means from DCC point of view only increasing the max nodes is enough as increasing the data size is unrelated to increasing the max nodes?

Quoted 7 lines

Yes, if it is less than 32KB, you just need to increase the XBC_NODE_MAX. But if you think the size of bootconfig, we have to change the type of xbc_node::data field.

Can you check the DCC also need to expand the size of bootconfig limitation?

Thank you!

Yes, I don't think the index needs to be increased from u16 to u32 for dcc. Will be sending out the next version accordingly.

Thanks

Quoted 48 lines
Quoted 46 lines
Quoted 46 lines

BTW, I think now we don't need the ' __attribute__ ((__packed__))' for struct xbc_node. It was packed for reducing the size of array and able to pass 'compiled' bootconfig, but now it is just passed as a text data for safety.

Thank you,

Quoted 33 lines
Quoted 33 lines
Quoted 31 lines
---
    include/linux/bootconfig.h | 6 +++---
    1 file changed, 3 insertions(+), 3 deletions(-)
include/linux/bootconfig.h +3 -3
index 1611f9d..64d233b 100644
@@ -55,11 +55,11 @@ struct xbc_node {
    } __attribute__ ((__packed__));
 
    #define XBC_KEY		0
-#define XBC_VALUE	(1 << 15)
-/* Maximum size of boot config is 32KB - 1 */
+#define XBC_VALUE	(1 << 18)
+/* Maximum size of boot config is 256KB - 1 */
    #define XBC_DATA_MAX	(XBC_VALUE - 1)
 
-#define XBC_NODE_MAX	1024
+#define XBC_NODE_MAX	8192
    #define XBC_KEYLEN_MAX	256
    #define XBC_DEPTH_MAX	16
 
Signature · 1 line
2.7.4
#10 lore raw

Re: [PATCH V0 1/1] bootconfig: Increase max size of bootconfig from 32 KB to 256 KB for DCC support

Quoted 96 lines · On Thu, 19 Jan 2023 22:21:27 +0530 Souradeep Chowdhury…
Quoted 93 lines · Masami Hiramatsu (Google)
Quoted 49 lines · On Tue, 10 Jan 2023 20:38:54 +0530 Souradeep Chowdhury…
Quoted 23 lines · Masami Hiramatsu (Google)
Quoted 20 lines · On Tue, 10 Jan 2023 17:26:07 +0530 Souradeep Chowdhury…
Quoted 16 lines · Masami Hiramatsu (Google)
Quoted 2 lines · On Mon, 9 Jan 2023 20:01:05 +0530 Souradeep Chowdhury…

Increasing the memory size of bootconfig to be able to handle a max number of 8192 nodes to be fitted in memory size of 256KB.

Sorry, but you missed the 'xbc_node::data' stores the index of the data and that is uint16_t. So the XBC_DATA_MAX is fixed limitation.

The number of nodes (XBC_NODE_MAX) can be expanded because I just decided it to keep the pre-compiled array size ~8KB. Maybe expanding it to 64KB just increase the size of kernel on init memory (and freed after boot).

Could you tell me why you need such a big data for your DCC?

Thank you,

Quoted 8 lines
Quoted 5 lines

DCC is a debugging tool used in qcom which is needed to debug crashes that can happen at boot-time. For debugging purposes a large number of registers need to be configured in DCC driver which is to be fed via the bootconfig file. For that we need to expand the nodes as well as memory for using bootconfig.

Hmm, how many registers does DCC usually use? And how big the bootconfig file is usually? I have no idea about that.

So a typical bootconfig file for consumption of DCC looks like as follows

dcc_config {
          link_list_0 {
                  qcom-curr-link-list = 6
                  qcom-link-list = R_0x1781005c_1_apb,
                                   R_0x1782005c_1_apb
          }
          link_list_1 {
                  qcom-curr-link-list = 5
                  qcom-link-list = R_0x1784005c_1_apb
          }
}
Quoted 2 lines

The "qcom-link-list" field can have 1000s of register , based on that max nodes is increased to 8192.

OK, then the number of fields can be larger than 1000. I got it.

Quoted 6 lines
Quoted 6 lines
Quoted 5 lines

Can you let us know the changes that you suggest for doing the same? Is it fine to just increase the XBC_NODE_MAX, do we also need to change the uint16_t to u32 for proper storing of index values?

Quoted 6 lines
Quoted 4 lines

Expanding the number of max nodes is easy, just increase the XBC_NODE_MAX (must be less than 64k). That will also increase the memory consumption during the boot time even if the bootconfig is small. Anyway, it will be freed after boot, so it maybe OK.

So since the limit is 64K, 8192 is a valid value for max nodes.

Yes. Expanding the number of node is OK to me.

Quoted 11 lines
Quoted 11 lines

But expanding the size of max bootconfig needs to change the type of the 'data' field to uint32_t (since that will be used for building bootconfig tool) and you also must confirm that tools/bootconfig/bootconfig can be built and pass the test-bootconfig.sh.
Hmm, comparing with expanding the max number of XBC node, changing the 'data' type to uint32_t may not have much impact on memory consumption point of view, because it may increase only 20% of memory, but expanding the MAX_XBC_NODE always increases more than double.

Quoted 5 lines
Quoted 2 lines

Thus, if we can accept increasing the number of node, it should be OK to change the 'data' type.

That means from DCC point of view only increasing the max nodes is enough as increasing the data size is unrelated to increasing the max nodes?

Yes, if it is less than 32KB, you just need to increase the XBC_NODE_MAX. But if you think the size of bootconfig, we have to change the type of xbc_node::data field.

Quoted 6 lines
Quoted 3 lines

Can you check the DCC also need to expand the size of bootconfig limitation?

Thank you!

Yes, I don't think the index needs to be increased from u16 to u32 for dcc. Will be sending out the next version accordingly.

OK, thanks for the confirmation!

Signature · 1 line
Masami Hiramatsu (Google) <[email protected]>