On 30-01-2025 00:58, Randy MacLeod wrote:


Thanks for duplicating and explaining your testing. I noticed your test email after I had replied to the main thread because you didn't CC me on the testing email. Oops ... on both our parts.

Anyway, this started out being about just GCC ASan but if you're changing qemu's config, you'll have to build that emulator and use it a bit before sending in v2.  Perhaps run the full GCC test suite and say openssl's ptests. The rest of the ptest will likely be run as part of the YP AB
testing.


I tested openssl ptest and the results are positive.
The full GCC test suite is still running as it takes long time to be completed.
I would send a V2 after that.


Did you find out why sv39 isn't the default for qemu?
QEMU defaults to the max supported SATP mode. I'm not sure there is a
specific reason, that's just what we have always done since we allowed
a user to specify the SATP mode.
Supporting to the above comments, here is the commit that allows users to specify the SATP mode

https://github.com/qemu/qemu/commit/6f23aaeb9be13d4a26b7f863533c316105481640

It seems that Risc-V has multiple sizes for addressable memory and Linux probes for the machine's support at startup. Thus, the reason would be to give the flexibility to users to set it rather than having a fixed default SATP mode.
The authors/reviewers of the commit can put more light on this topic.

If not, please check the git history and it there isn't an answer there, ask 
one of the qemu developers
who work on risc-v. It would be nice to have a sentence about that in the 
commit log.

Did you consider a different RISC-V cpu sub-arch such as rva22s64 ?
I think defaulting to a profile (RVA22S64) would be the way to go,
that will also enable a known set of extensions.

Alistair

    https://github.com/qemu/qemu/commit/3ba8462c4ca55720239fdc6fa30b9870d22a8814

I'm only asking because it seems like it might be a good fit for us and I 
noticed it when
searching the qemu commit logs looking for sv39.
I added  "-cpu rv64,sv39=true" options for risc-v by default as mentioned in the bug requirements.

The support for RVA22S64 looks good to have  provided that it doesn't break other risc-v builds/tests being done in Yocto. Following commit adds the RVA22S64 profile and corresponding extensions in qemu.
https://github.com/qemu/qemu/commit/af651969eb23ecf018bcaa8e0761b58425de550c

<https://github.com/qemu/qemu/commit/af651969eb23ecf018bcaa8e0761b58425de550c>I also tested with passing /"QB_CPU = "-cpu rv64i, rva22s64=true"" /in /qemuriscv.inc/ file and asan works with that as well.


Good.



I will send a V2 with setting "rva22s64" profile for risc-v 64 only as follows:

*/QB_CPU:riscv64 ?= "-cpu rv64, rva22s64=true"/
*


Using the weak operator "?=" to allow overrides seems like a good choice at least for now.

Do you really need both
   "-cpu rv64, rva22s64=true"
rather than just:

   "-cpu rva22s64"

?

Remember, I don't know much about the qemu internals so maybe this is obvious to you.

Thanks for the suggestion. "-cpu rva22s64" does work.
Even I am new to the qemu internals.


Regards,
Yash

../Randy



-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#210441): 
https://lists.openembedded.org/g/openembedded-core/message/210441
Mute This Topic: https://lists.openembedded.org/mt/110856569/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to