Skip to content

Conversation

@xiulipan
Copy link
Contributor

@xiulipan xiulipan commented Mar 11, 2020

Fix ABI version to 3.15.0 on master first.

There is a bug in the Cadence XCC compiler that give us different
linkage section sizes for flex length struct sof_ipc_ext_data in
ELF file compared to GCC version. And there are appending struct
in the same ELF section, this will bring wrong offset for those
struct binary in ELF file.

Example:
When the CC_DESC is " RG-2017.8-linux", we should have struct
length for 0x50 in header size, but the binary length in ELF file
is 0x4c. When the CC_DESC is " RG-2017.8-win", size are both 0x4c

All existing compiler description has length less than
24 bytes. So use a fixed length 24 in this structure.

ABI version 3.16.0

Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com

fix #2507

Copy link
Member

@ktrzcinx ktrzcinx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add in comment comment that sof_ipc_cc_version.desc is read as flex array from kernel side. This solution also resolve compilation problem from #2427.

@xiulipan xiulipan requested a review from lgirdwood March 11, 2020 15:08
@xiulipan
Copy link
Contributor Author

@kakulesza it seems from the log, there is not change needed for kernel https://sof-ci.01.org/sofpr/PR2522/build5231/devicetest/APL_UP2_PCM512X/verify-sof-firmware-load.sh/verify-sof-firmware-load.sh.txt
Change flex into static will not have any side effect if the string size is big enough.
kernel: [ 4.157801] sof-audio-pci 0000:00:0e.0: Firmware info: used compiler XCC 12:0:8 RG-2017.8-linux used optimization flags O2

@lgirdwood Please help to review this fix for the logger regression.

@jajanusz
Copy link
Contributor

@lgirdwood This is hard one, cos it's in abi header, but it's not really abi change, cos these fields are null-terminated strings anyway, so it doesn't matter for parsing if it's flex array or const array. It's fixed-size array just to overcome some embedded compiler limitations that are not up-to-date with gcc.

Copy link
Member

@lgirdwood lgirdwood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pends on kernel update.

@xiulipan
Copy link
Contributor Author

@lgirdwood @ktrzcinx @jajanusz Thanks for remind about the Kernel part. There is indeed a need to make align on both side.
PR thesofproject/linux#1890 send.

@lgirdwood
Copy link
Member

@xiulipan thanks, ping me once kernel one is approved. Can you assign ABI number too in classifier.

@xiulipan
Copy link
Contributor Author

@lgirdwood It seems I did not have access for the project

@lgirdwood
Copy link
Member

@xiulipan updated, I've given all member W access bow to align their ABI updates.

@xiulipan
Copy link
Contributor Author

@lgirdwood Should this be go with an ABI patch or an ABI minor?

@lgirdwood
Copy link
Member

@xiulipan Lets make it minor since it's impact is user & developer confusion if version is wrong

@xiulipan xiulipan changed the title cc_version: use static array for CC_DESC cc_version: use fixed length for CC_DESC Mar 18, 2020
@xiulipan
Copy link
Contributor Author

@lgirdwood update the PR with ABI to 3.15.0

@lgirdwood
Copy link
Member

@xiulipan ok, please ping when kernel is approved and we can merge.

@kv2019i
Copy link
Collaborator

kv2019i commented Mar 20, 2020

@xiulipan @lgirdwood Kernel change is ready to go, but a concern was raised by @plbossart why we pick 24 chars as the length here. Is that future-proof enough? @paulstelian97 also had concerns on this. Let's agree on this, and then we can merge.

@jajanusz
Copy link
Contributor

@xiulipan you need to rebase

@xiulipan
Copy link
Contributor Author

@lgirdwood @plbossart I also find another mismatch in the info.h header. #2338
Do we need a ABI for the probe also? Or we just take it as ABI 14 also?

@lgirdwood
Copy link
Member

@xiulipan I've assigned to ABI 14
For #2338 do you mean kernel ABI +1 FW ABI ? I cannot see the the kernel PR in the list (other kernel PRs missing too ?)
@ranj063 @plbossart @kv2019i it looks like we are missing the matching kernel PRs in the ABI tool. These have to be manually added atm in the "Projects" button on the PR (then you can align on a suitable ABI version)

@xiulipan
Copy link
Contributor Author

@lgirdwood So here is my thinking, we will need fix for FW to make
#2338 to add ABI 14
#2398 to change ABI 14 => 15
@ranj063 @plbossart @kv2019i
For above FW side ABI change I got a simple fix in thesofproject/linux#1929 but not sure if I got the right ABI version or header change.
I will also send an email to discuss about this issue.

@lgirdwood
Copy link
Member

@xiulipan anything in your plan preventing this PR merging into 14 ?

@xiulipan
Copy link
Contributor Author

@lgirdwood I have updated thesofproject/linux#1890 to make each ABI change has its own ABI.
Probe support should have ABI 3.14.0
Debug support should fixed to be ABI 3.15.0
This cc_version length should be ABI 3.16.0

@lgirdwood
Copy link
Member

@lgirdwood I have updated thesofproject/linux#1890 to make each ABI change has its own ABI.
Probe support should have ABI 3.14.0
Debug support should fixed to be ABI 3.15.0
This cc_version length should be ABI 3.16.0

ok, I can see the classifier has been updated. Does this now fully reflect your plan.
https://github.com/orgs/thesofproject/projects/2
@plbossart are you good with @xiulipan ABI update plan ?

@jajanusz
Copy link
Contributor

@xiulipan @plbossart @lgirdwood Please prioritize merging this PR. Logs are already broken for like 2 weeks.

@jajanusz jajanusz added the P1 Blocker bugs or important features label Mar 27, 2020
@kv2019i
Copy link
Collaborator

kv2019i commented Mar 27, 2020

ok, I can see the classifier has been updated. Does this now fully reflect your plan.
https://github.com/orgs/thesofproject/projects/2
@plbossart are you good with @xiulipan ABI update plan ?

@lgirdwood I think we we are good to go now. We hit issues by merging FW patches for ABI bumps that were not approved on kernel side, but we gain nothing by delaying this. I.e. let's put this in, and then @xiulipan linux#1890 and then we are aligned again.

Copy link
Member

@lgirdwood lgirdwood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xiulipan it looks like #2398 should be in MINOR 14, @kv2019i does this being 14 align with kernel too ? If so, I can update classifier and we can put this PR in 15 ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xiulipan This does not align with the classifier or the commit message. Can you double check this.

Copy link
Collaborator

@kv2019i kv2019i Mar 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lgirdwood @xiulipan D'oh, you are right. The kernel patch (not yet merged) puts cc_version as ABI16:
thesofproject/linux@3552e9c
So definitely commit message and patch are not in sync here.

This probably happened because FW PRs for ABI15 have been merged without bumping the version. E.g.
e6940da
... was the last PR for ABI14, but it was merged with abi.h of ABI14.

I think we can probably still go ahead with this. The abi.h version needs to be changed to 16 when the last PR for ABI16 is merged. As @lyakh commented on the kernel side, if this is the norm to have multiple changes done in a single bump, we need to separate the commits that add functionality from commits that bump the version. I.e. we open ABIxx for development, have interface changes approved for this ABI level, and then we have a closing commit that freezes ABIxx. No binary FW releases should be done from master during this time.

Copy link
Member

@lgirdwood lgirdwood Mar 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kv2019i I see why I'm not finding the kernel PR's - @xiulipan can you split your kernel PR into 3, one PR per ABI bump. That way we can align the with the FW on the classifier and follow. Once this is done and ABIs bumps aligned we can merge all at one go.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xiulipan ping ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace char with uint8_t to have fixed lenght for string.
char has minimum 8 bits length.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
There is a bug in the Cadence XCC compiler that give us different
linkage section sizes for flex length struct sof_ipc_ext_data in
ELF file compared to GCC version. And there are appending struct
in the same ELF section, this will bring wrong offset for those
struct binary in ELF file.

Example:
When the CC_DESC is " RG-2017.8-linux", we should have struct
length for 0x50 in header size, but the binary length in ELF file
is 0x4c. When the CC_DESC is " RG-2017.8-win", size are both 0x4c

All existing compiler description has length less than
32 bytes. So use a fixed length 32 in this structure.

ABI version changes to 3.15.0

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
@kv2019i
Copy link
Collaborator

kv2019i commented Mar 31, 2020

@lgirdwood Kernel side now ready to go.

@lgirdwood
Copy link
Member

CI know issues.

@lgirdwood lgirdwood merged commit beea8e5 into thesofproject:master Apr 1, 2020
@lgirdwood
Copy link
Member

@kv2019i Merged, I think we are good now

@kv2019i
Copy link
Collaborator

kv2019i commented Apr 1, 2020

@lgirdwood wrote:

@kv2019i Merged, I think we are good now

Ack, all changes for ABI versions 14&15 are now good in both kernel and fw.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ABI ABI change involved P1 Blocker bugs or important features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]Sof-logger ABI version is mismatch with .ldc file built by xcc

8 participants