Skip to contentSkip to conversation

firmware: ti_sci: fix the secure_hdr in do_xfer

PATCH Superseded Dhruva Gole 4 participants 10 messages Jan 24, 2024 – Jan 25, 2024 Texas instruments' system control interface (TISCI) protocol driver

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 firmware: ti_sci: fix the secure_hdr in do_xfer

The secure_hdr needs to be 0 init-ed however this was never being put into the secure_buf, leading to possibility of the first 4 bytes of secure_buf being possibly garbage.

Fix this by initialising the secure_hdr itself to the secure_buf location, thus when we make it 0, it automatically ensures the first 4 bytes are 0.

Fixes 32cd25128bd849 ("firmware: Add basic support for TI System Control Interface (TI SCI)")

---

Boot tested for sanity on AM62x SK
https://gist.github.com/DhruvaG2000/724ceba3a0db03f4b0bff47de1160074

Cc Nishanth Menon <[email protected]>
Cc Tom Rini <[email protected]>
 drivers/firmware/ti_sci.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/firmware/ti_sci.c +3 -3
index f5f659c11274..83ee8401a731 100644
@@ -236,13 +236,13 @@ static int ti_sci_do_xfer(struct ti_sci_info *info,
 {
 	struct k3_sec_proxy_msg *msg = &xfer->tx_message;
 	u8 secure_buf[info->desc->max_msg_size];
-	struct ti_sci_secure_msg_hdr secure_hdr;
+	struct ti_sci_secure_msg_hdr *secure_hdr = (struct ti_sci_secure_msg_hdr *)secure_buf;
 	int ret;
 
 	if (info->is_secure) {
 		/* ToDo: get checksum of the entire message */
-		secure_hdr.checksum = 0;
-		secure_hdr.reserved = 0;
+		secure_hdr->checksum = 0;
+		secure_hdr->reserved = 0;
 		memcpy(&secure_buf[sizeof(secure_hdr)], xfer->tx_message.buf,
 		       xfer->tx_message.len);
 

base-commit: a1448e3cf9a0602d284566d6cacf60b96c3c1316

Signature · 1 line
2.34.1
#1 lore raw
Quoted 12 lines · Dhruva Gole

The secure_hdr needs to be 0 init-ed however this was never being put into the secure_buf, leading to possibility of the first 4 bytes of secure_buf being possibly garbage.

Fix this by initialising the secure_hdr itself to the secure_buf location, thus when we make it 0, it automatically ensures the first 4 bytes are 0.

Fixes 32cd25128bd849 ("firmware: Add basic support for TI System Control Interface (TI SCI)")

---

Quoted 9 lines

Boot tested for sanity on AM62x SK
https://gist.github.com/DhruvaG2000/724ceba3a0db03f4b0bff47de1160074

Cc Nishanth Menon <[email protected]>
Cc Tom Rini <[email protected]>
 drivers/firmware/ti_sci.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Kindly ignore this patch, seems like it's from an older u-boot. I have rebased an sent new patch with updated boot logs.

Please forgive the spam.

Signature · 2 lines
Best regards,
Dhruva Gole <[email protected]>
#2 lore raw
In reply to Dhruva Gole
Quoted 30 lines · Dhruva Gole

The secure_hdr needs to be 0 init-ed however this was never being put into the secure_buf, leading to possibility of the first 4 bytes of secure_buf being possibly garbage.

Fix this by initialising the secure_hdr itself to the secure_buf location, thus when we make it 0, it automatically ensures the first 4 bytes are 0.

Fixes 32cd25128bd849 ("firmware: Add basic support for TI System Control Interface (TI SCI)")

---

Boot tested for sanity on AM62x SK
https://gist.github.com/DhruvaG2000/724ceba3a0db03f4b0bff47de1160074

Cc Nishanth Menon <[email protected]>
Cc Tom Rini <[email protected]>
 drivers/firmware/ti_sci.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/firmware/ti_sci.c +0 -1
index f5f659c11274..83ee8401a731 100644
@@ -236,13 +236,13 @@ static int ti_sci_do_xfer(struct ti_sci_info *info,
 {
 	struct k3_sec_proxy_msg *msg = &xfer->tx_message;
 	u8 secure_buf[info->desc->max_msg_size];
-	struct ti_sci_secure_msg_hdr secure_hdr;

drivers/firmware/ti_sci.c static int ti_sci_do_xfer(struct ti_sci_info *info, · line 246

Quoted 10 lines
drivers/firmware/ti_sci.c +3 -2
+	struct ti_sci_secure_msg_hdr *secure_hdr = (struct ti_sci_secure_msg_hdr *)secure_buf;
 	int ret;
 
 	if (info->is_secure) {
 		/* ToDo: get checksum of the entire message */
-		secure_hdr.checksum = 0;
-		secure_hdr.reserved = 0;
+		secure_hdr->checksum = 0;
+		secure_hdr->reserved = 0;
 		memcpy(&secure_buf[sizeof(secure_hdr)],xfer->tx_message.buf,

secure_hdr is pointer now, the value may be same but (struct ti_sci_secure_msg_hdr) would make more sense

Regards,
Kamlesh

Quoted 6 lines
drivers/firmware/ti_sci.c +0 -0
 		       xfer->tx_message.len);
 

base-commit: a1448e3cf9a0602d284566d6cacf60b96c3c1316

Signature · 1 line
2.34.1
#3 lore raw
Quoted 35 lines · Kamlesh Gurudasani
Quoted 33 lines · Dhruva Gole

The secure_hdr needs to be 0 init-ed however this was never being put into the secure_buf, leading to possibility of the first 4 bytes of secure_buf being possibly garbage.

Fix this by initialising the secure_hdr itself to the secure_buf location, thus when we make it 0, it automatically ensures the first 4 bytes are 0.

Fixes 32cd25128bd849 ("firmware: Add basic support for TI System Control Interface (TI SCI)")

---

Boot tested for sanity on AM62x SK
https://gist.github.com/DhruvaG2000/724ceba3a0db03f4b0bff47de1160074

Cc Nishanth Menon <[email protected]>
Cc Tom Rini <[email protected]>
 drivers/firmware/ti_sci.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/firmware/ti_sci.c +1 -1
index f5f659c11274..83ee8401a731 100644
@@ -236,13 +236,13 @@ static int ti_sci_do_xfer(struct ti_sci_info *info,
 {
 	struct k3_sec_proxy_msg *msg = &xfer->tx_message;
 	u8 secure_buf[info->desc->max_msg_size];
-	struct ti_sci_secure_msg_hdr secure_hdr;
+	struct ti_sci_secure_msg_hdr *secure_hdr = (struct ti_sci_secure_msg_hdr *)secure_buf;
 	int ret;
 
Quoted 9 lines

drivers/firmware/ti_sci.c static int ti_sci_do_xfer(struct ti_sci_info *info,

Quoted 7 lines
drivers/firmware/ti_sci.c +2 -2
 	if (info->is_secure) {
 		/* ToDo: get checksum of the entire message */
-		secure_hdr.checksum = 0;
-		secure_hdr.reserved = 0;
+		secure_hdr->checksum = 0;
+		secure_hdr->reserved = 0;
 		memcpy(&secure_buf[sizeof(secure_hdr)],xfer->tx_message.buf,

secure_hdr is pointer now, the value may be same but (struct ti_sci_secure_msg_hdr) would make more sense

Good catch Kamlesh! I have sent a new revision addressing this.

Signature · 2 lines
Best regards,
Dhruva Gole <[email protected]>
maintainer
#4 lore raw
Quoted 46 lines · Dhruva Gole
Quoted 35 lines · Kamlesh Gurudasani
Quoted 33 lines · Dhruva Gole

The secure_hdr needs to be 0 init-ed however this was never being put into the secure_buf, leading to possibility of the first 4 bytes of secure_buf being possibly garbage.

Fix this by initialising the secure_hdr itself to the secure_buf location, thus when we make it 0, it automatically ensures the first 4 bytes are 0.

Fixes 32cd25128bd849 ("firmware: Add basic support for TI System Control Interface (TI SCI)")

---

Boot tested for sanity on AM62x SK
https://gist.github.com/DhruvaG2000/724ceba3a0db03f4b0bff47de1160074

Cc Nishanth Menon <[email protected]>
Cc Tom Rini <[email protected]>
 drivers/firmware/ti_sci.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/firmware/ti_sci.c +1 -1
index f5f659c11274..83ee8401a731 100644
@@ -236,13 +236,13 @@ static int ti_sci_do_xfer(struct ti_sci_info *info,
 {
 	struct k3_sec_proxy_msg *msg = &xfer->tx_message;
 	u8 secure_buf[info->desc->max_msg_size];
-	struct ti_sci_secure_msg_hdr secure_hdr;
+	struct ti_sci_secure_msg_hdr *secure_hdr = (struct ti_sci_secure_msg_hdr *)secure_buf;
 	int ret;
 
Quoted 9 lines

drivers/firmware/ti_sci.c static int ti_sci_do_xfer(struct ti_sci_info *info,

Quoted 7 lines
drivers/firmware/ti_sci.c +2 -2
 	if (info->is_secure) {
 		/* ToDo: get checksum of the entire message */
-		secure_hdr.checksum = 0;
-		secure_hdr.reserved = 0;
+		secure_hdr->checksum = 0;
+		secure_hdr->reserved = 0;
 		memcpy(&secure_buf[sizeof(secure_hdr)],xfer->tx_message.buf,

secure_hdr is pointer now, the value may be same but (struct ti_sci_secure_msg_hdr) would make more sense

Quoted 2 lines

Good catch Kamlesh! I have sent a new revision addressing this.

Makes no sense why we have secure API support in U-Boot. what is using this?

Signature · 3 lines
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D
#5 lore raw
Quoted 47 lines · Nishanth Menon
Quoted 46 lines · Dhruva Gole
Quoted 44 lines · Kamlesh Gurudasani
Quoted 30 lines · Dhruva Gole

The secure_hdr needs to be 0 init-ed however this was never being put into the secure_buf, leading to possibility of the first 4 bytes of secure_buf being possibly garbage.

Fix this by initialising the secure_hdr itself to the secure_buf location, thus when we make it 0, it automatically ensures the first 4 bytes are 0.

Fixes 32cd25128bd849 ("firmware: Add basic support for TI System Control Interface (TI SCI)")

---

Boot tested for sanity on AM62x SK
https://gist.github.com/DhruvaG2000/724ceba3a0db03f4b0bff47de1160074

Cc Nishanth Menon <[email protected]>
Cc Tom Rini <[email protected]>
 drivers/firmware/ti_sci.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/firmware/ti_sci.c +0 -1
index f5f659c11274..83ee8401a731 100644
@@ -236,13 +236,13 @@ static int ti_sci_do_xfer(struct ti_sci_info *info,
 {
 	struct k3_sec_proxy_msg *msg = &xfer->tx_message;
 	u8 secure_buf[info->desc->max_msg_size];
-	struct ti_sci_secure_msg_hdr secure_hdr;

drivers/firmware/ti_sci.c static int ti_sci_do_xfer(struct ti_sci_info *info, · line 246

Quoted 10 lines
drivers/firmware/ti_sci.c +3 -2
+	struct ti_sci_secure_msg_hdr *secure_hdr = (struct ti_sci_secure_msg_hdr *)secure_buf;
 	int ret;
 
 	if (info->is_secure) {
 		/* ToDo: get checksum of the entire message */
-		secure_hdr.checksum = 0;
-		secure_hdr.reserved = 0;
+		secure_hdr->checksum = 0;
+		secure_hdr->reserved = 0;
 		memcpy(&secure_buf[sizeof(secure_hdr)],xfer->tx_message.buf,

secure_hdr is pointer now, the value may be same but (struct ti_sci_secure_msg_hdr) would make more sense

Quoted 5 lines
Quoted 2 lines

Good catch Kamlesh! I have sent a new revision addressing this.

Makes no sense why we have secure API support in U-Boot. what is using this?

In my understanding of generic K3 boot flow, things like proc_boot and even applying or removing of firewalls will need a secure channel to talk to TIFS right? From my understanding secure host can only talk to TIFS and make such requests hence secure API.

Signature · 2 lines
Best regards,
Dhruva Gole <[email protected]>
maintainer
#6 lore raw
Quoted 51 lines · Dhruva Gole
Quoted 50 lines · Nishanth Menon
Quoted 48 lines · Dhruva Gole
Quoted 35 lines · Kamlesh Gurudasani
Quoted 33 lines · Dhruva Gole

The secure_hdr needs to be 0 init-ed however this was never being put into the secure_buf, leading to possibility of the first 4 bytes of secure_buf being possibly garbage.

Fix this by initialising the secure_hdr itself to the secure_buf location, thus when we make it 0, it automatically ensures the first 4 bytes are 0.

Fixes 32cd25128bd849 ("firmware: Add basic support for TI System Control Interface (TI SCI)")

---

Boot tested for sanity on AM62x SK
https://gist.github.com/DhruvaG2000/724ceba3a0db03f4b0bff47de1160074

Cc Nishanth Menon <[email protected]>
Cc Tom Rini <[email protected]>
 drivers/firmware/ti_sci.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/firmware/ti_sci.c +1 -1
index f5f659c11274..83ee8401a731 100644
@@ -236,13 +236,13 @@ static int ti_sci_do_xfer(struct ti_sci_info *info,
 {
 	struct k3_sec_proxy_msg *msg = &xfer->tx_message;
 	u8 secure_buf[info->desc->max_msg_size];
-	struct ti_sci_secure_msg_hdr secure_hdr;
+	struct ti_sci_secure_msg_hdr *secure_hdr = (struct ti_sci_secure_msg_hdr *)secure_buf;
 	int ret;
 
Quoted 9 lines

drivers/firmware/ti_sci.c static int ti_sci_do_xfer(struct ti_sci_info *info,

Quoted 7 lines
drivers/firmware/ti_sci.c +2 -2
 	if (info->is_secure) {
 		/* ToDo: get checksum of the entire message */
-		secure_hdr.checksum = 0;
-		secure_hdr.reserved = 0;
+		secure_hdr->checksum = 0;
+		secure_hdr->reserved = 0;
 		memcpy(&secure_buf[sizeof(secure_hdr)],xfer->tx_message.buf,

secure_hdr is pointer now, the value may be same but (struct ti_sci_secure_msg_hdr) would make more sense

Good catch Kamlesh! I have sent a new revision addressing this.

Quoted 7 lines
Quoted 2 lines

Makes no sense why we have secure API support in U-Boot. what is using this?

In my understanding of generic K3 boot flow, things like proc_boot and even applying or removing of firewalls will need a secure channel to talk to TIFS right? From my understanding secure host can only talk to TIFS and make such requests hence secure API.

U-boot runs in NS world, you cant even talk to the Trustzone Sec proxy without triggering a firewall violation.

https://software-dl.ti.com/tisci/esd/latest/2_tisci_msgs/general/TISCI_header.html?highlight=header#secure-messaging-header
"The Secure Messaging Header is only required when sending messages over secure transport. Messages sent over non-secure transport must not contain the secure messaging header."

btw, that checksum field should be renamed integ_check, but anyways..

So, I do not see a reason to even have that if condition in the first place and what real bug was getting fixed in this patch.

Signature · 3 lines
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D
#7 lore raw
Quoted 55 lines · Nishanth Menon
Quoted 54 lines · Dhruva Gole
Quoted 52 lines · Nishanth Menon
Quoted 46 lines · Dhruva Gole
Quoted 35 lines · Kamlesh Gurudasani
Quoted 33 lines · Dhruva Gole

The secure_hdr needs to be 0 init-ed however this was never being put into the secure_buf, leading to possibility of the first 4 bytes of secure_buf being possibly garbage.

Fix this by initialising the secure_hdr itself to the secure_buf location, thus when we make it 0, it automatically ensures the first 4 bytes are 0.

Fixes 32cd25128bd849 ("firmware: Add basic support for TI System Control Interface (TI SCI)")

---

Boot tested for sanity on AM62x SK
https://gist.github.com/DhruvaG2000/724ceba3a0db03f4b0bff47de1160074

Cc Nishanth Menon <[email protected]>
Cc Tom Rini <[email protected]>
 drivers/firmware/ti_sci.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/firmware/ti_sci.c +1 -1
index f5f659c11274..83ee8401a731 100644
@@ -236,13 +236,13 @@ static int ti_sci_do_xfer(struct ti_sci_info *info,
 {
 	struct k3_sec_proxy_msg *msg = &xfer->tx_message;
 	u8 secure_buf[info->desc->max_msg_size];
-	struct ti_sci_secure_msg_hdr secure_hdr;
+	struct ti_sci_secure_msg_hdr *secure_hdr = (struct ti_sci_secure_msg_hdr *)secure_buf;
 	int ret;
 
Quoted 9 lines

drivers/firmware/ti_sci.c static int ti_sci_do_xfer(struct ti_sci_info *info,

Quoted 7 lines
drivers/firmware/ti_sci.c +2 -2
 	if (info->is_secure) {
 		/* ToDo: get checksum of the entire message */
-		secure_hdr.checksum = 0;
-		secure_hdr.reserved = 0;
+		secure_hdr->checksum = 0;
+		secure_hdr->reserved = 0;
 		memcpy(&secure_buf[sizeof(secure_hdr)],xfer->tx_message.buf,

secure_hdr is pointer now, the value may be same but (struct ti_sci_secure_msg_hdr) would make more sense

Quoted 2 lines

Good catch Kamlesh! I have sent a new revision addressing this.

Makes no sense why we have secure API support in U-Boot. what is using this?

Quoted 7 lines
Quoted 4 lines

In my understanding of generic K3 boot flow, things like proc_boot and even applying or removing of firewalls will need a secure channel to talk to TIFS right? From my understanding secure host can only talk to TIFS and make such requests hence secure API.

U-boot runs in NS world, you cant even talk to the Trustzone Sec proxy without triggering a firewall violation.

I am not going to debate on whether U-Boot is or isn't a secure entity. The original code base was making secure_hdr.checksum = 0;

But this wasn't really being used anywhere. I am just making sure what the original code base intended to do is being actually done.

Quoted 6 lines

https://software-dl.ti.com/tisci/esd/latest/2_tisci_msgs/general/TISCI_header.html?highlight=header#secure-messaging-header
"The Secure Messaging Header is only required when sending messages over secure transport. Messages sent over non-secure transport must not contain the secure messaging header."

Yes, understood. I do not have the context behind the commit 32cd25128bd849 ("firmware: Add basic support for TI System Control Interface (TI SCI)") but perhaps you do. So please help me understand why there's this code:
memcpy(&secure_buf[sizeof(secure_hdr)], xfer->tx_message.buf, xfer->tx_message.len);

which is basically trying to create a 4 byte offset (trying to abide by the secure msg format?)
If UBoot as you say is non secure let's just send regular TISCI messages. Are you suggesting that we trim all of if (info->is_secure) and related "secure" code from uboot? Then that's a separate cleanup we need to have.

Quoted 5 lines

btw, that checksum field should be renamed integ_check, but anyways..

So, I do not see a reason to even have that if condition in the first place and what real bug was getting fixed in this patch.

"Real" bug or "potential" bug, the code did not seem to be doing what it should have been doing, that's all. For anyone reading the checksum = 0 that is there in today's code it's super confusing.

Either get rid of it completely, or else make it do what it was trying to do. Let me know how we should proceed.

Signature · 2 lines
Best regards,
Dhruva Gole <[email protected]>
#8 lore raw
Quoted 77 lines · Dhruva Gole
Quoted 55 lines · Nishanth Menon
Quoted 54 lines · Dhruva Gole
Quoted 52 lines · Nishanth Menon
Quoted 46 lines · Dhruva Gole
Quoted 35 lines · Kamlesh Gurudasani
Quoted 33 lines · Dhruva Gole

The secure_hdr needs to be 0 init-ed however this was never being put into the secure_buf, leading to possibility of the first 4 bytes of secure_buf being possibly garbage.

Fix this by initialising the secure_hdr itself to the secure_buf location, thus when we make it 0, it automatically ensures the first 4 bytes are 0.

Fixes 32cd25128bd849 ("firmware: Add basic support for TI System Control Interface (TI SCI)")

---

Boot tested for sanity on AM62x SK
https://gist.github.com/DhruvaG2000/724ceba3a0db03f4b0bff47de1160074

Cc Nishanth Menon <[email protected]>
Cc Tom Rini <[email protected]>
  drivers/firmware/ti_sci.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
drivers/firmware/ti_sci.c +1 -1
index f5f659c11274..83ee8401a731 100644
@@ -236,13 +236,13 @@ static int ti_sci_do_xfer(struct ti_sci_info *info,
  {
  	struct k3_sec_proxy_msg *msg = &xfer->tx_message;
  	u8 secure_buf[info->desc->max_msg_size];
-	struct ti_sci_secure_msg_hdr secure_hdr;
+	struct ti_sci_secure_msg_hdr *secure_hdr = (struct ti_sci_secure_msg_hdr *)secure_buf;
  	int ret;
 
Quoted 9 lines

drivers/firmware/ti_sci.c static int ti_sci_do_xfer(struct ti_sci_info *info, · line 246

Quoted 7 lines
drivers/firmware/ti_sci.c +2 -2
  	if (info->is_secure) {
  		/* ToDo: get checksum of the entire message */
-		secure_hdr.checksum = 0;
-		secure_hdr.reserved = 0;
+		secure_hdr->checksum = 0;
+		secure_hdr->reserved = 0;
  		memcpy(&secure_buf[sizeof(secure_hdr)],xfer->tx_message.buf,

secure_hdr is pointer now, the value may be same but (struct ti_sci_secure_msg_hdr) would make more sense

Quoted 2 lines

Good catch Kamlesh! I have sent a new revision addressing this.

Makes no sense why we have secure API support in U-Boot. what is using this?

Quoted 7 lines
Quoted 4 lines

In my understanding of generic K3 boot flow, things like proc_boot and even applying or removing of firewalls will need a secure channel to talk to TIFS right? From my understanding secure host can only talk to TIFS and make such requests hence secure API.

U-boot runs in NS world, you cant even talk to the Trustzone Sec proxy without triggering a firewall violation.

I am not going to debate on whether U-Boot is or isn't a secure entity. The original code base was making secure_hdr.checksum = 0;

But this wasn't really being used anywhere. I am just making sure what the original code base intended to do is being actually done.

Quoted 6 lines

https://software-dl.ti.com/tisci/esd/latest/2_tisci_msgs/general/TISCI_header.html?highlight=header#secure-messaging-header
"The Secure Messaging Header is only required when sending messages over secure transport. Messages sent over non-secure transport must not contain the secure messaging header."

Quoted 4 lines

Yes, understood. I do not have the context behind the commit 32cd25128bd849 ("firmware: Add basic support for TI System Control Interface (TI SCI)") but perhaps you do. So please help me understand why there's this code:

A little background, this checksum was envisioned to help protect messages from glitches in-flight for security/safety reasons. For whatever reason it was only ever added for messages sent over "secure" channels. Which means the message sent changes based on what channel you use to send the message (which is a bit of a layering violation IMHO but anyway..).

In TFA/OP-TEE which *can* send messages over secure channels we append this header in the transport layer (secure proxy driver), not here in the message protocol driver. If we decide to keep this secure header code then it should be moved into the transport driver (mailbox/k3-sec-proxy.c) as only it would know what channel the message will be sent on (and so if it should have the header).

I'd say since U-Boot today cannot send over secure channels anyway, lets just drop this code and if we ever need it then we add it back over in the right spot at that time.

Andrew

Quoted 23 lines

memcpy(&secure_buf[sizeof(secure_hdr)], xfer->tx_message.buf, xfer->tx_message.len);

which is basically trying to create a 4 byte offset (trying to abide by the secure msg format?)
If UBoot as you say is non secure let's just send regular TISCI messages. Are you suggesting that we trim all of if (info->is_secure) and related "secure" code from uboot? Then that's a separate cleanup we need to have.

Quoted 5 lines

btw, that checksum field should be renamed integ_check, but anyways..

So, I do not see a reason to even have that if condition in the first place and what real bug was getting fixed in this patch.

"Real" bug or "potential" bug, the code did not seem to be doing what it should have been doing, that's all. For anyone reading the checksum = 0 that is there in today's code it's super confusing.

Either get rid of it completely, or else make it do what it was trying to do. Let me know how we should proceed.

maintainer
#9 lore raw
Quoted 3 lines · Andrew Davis

I'd say since U-Boot today cannot send over secure channels anyway, lets just drop this code and if we ever need it then we add it back over in the right spot at that time.

Chatting with manorit, the reason why we need the secure code is because of boot R5. boot R5 starts of in "secure mode" when it hands off from Boot ROM over to the Secondary bootloader. The initial set of calls we have to make unfortunately needs to be on secure pipe (think j721e load sysfw call, board config load call etc..) - which needs this support - which again, we should probably document in the code so that people don't go scratching our heads again.

That is unfortunately confusing enough for code since 99% of rest of u-boot flow does not use secure comm path.

Signature · 3 lines
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D