Closed atopia closed 1 year ago
@alex-ab volunteered to look into this (thanks, Alex!). As it seems more a tooling than a genuine seoul issue, maybe conclusions from the other alignment issues apply, @chelmuth ?
I assume you're referring to the following code.
If no idea how to adapt the code comes up, we could just disable vector-loop optimization for this compilation unit or function...
Or align
https://github.com/alex-ab/seoul/blob/47c73dc55004523e0ac79267ad05e3c1563e8a78/model/satadrive.cc#LL322C4-L322C33
identify
to 16 Byte stack address?
Or align https://github.com/alex-ab/seoul/blob/47c73dc55004523e0ac79267ad05e3c1563e8a78/model/satadrive.cc#LL322C4-L322C33
identify
to 16 Byte stack address?
Good point, but I myself I don't feel competent when it comes to making alignment constraints and properties clear to the compiler... still hope to learn more.
Or align https://github.com/alex-ab/seoul/blob/47c73dc55004523e0ac79267ad05e3c1563e8a78/model/satadrive.cc#LL322C4-L322C33
identify
to 16 Byte stack address?Good point, but I myself I don't feel competent when it comes to making alignment constraints and properties clear to the compiler... still hope to learn more.
__builtin_alloca
maybe?
I can trigger the fault, but the address of identify is 16 bit aligned (0x403fe5e0). The fault code 6 means undefined instruction. If it would be an alignment fault it would be 13. The faulting instruction is pshufb. According to my investigation, the cpu model we use for qemu+svm (-cpu phenom) does not support this feature at all (AMD Phenom has no pshufb support). Switching to some newer model "-cpu EPYC", seoul-auto works for me. I would suggest to switch to a an newer qemu cpu model for SVM virtualization, what do you think ?
According to https://qemu-project.gitlab.io/qemu/system/qemu-cpu-models.html "-cpu phenom" is "non-recommended x86 CPUs".
Good catch! I didn't know what runtime error to expect from alignment issues, hence I attributed the effect of the novel use of SSSE3 instructions to the alignment instead of to the SIMD extension as such (especially when they were introduced in Core2 on Intel). I can confirm that changing the emulated CPU to EPYC fixes the error for me.
Excellent, would you mind to also check genodelabs/genode for improper qemu -cpu
configurations?
Excellent, would you mind to also check genodelabs/genode for improper
qemu -cpu
configurations?
No problem, commit on genode staging adjusts all phenom occurrences
Last night we got the error again despite df651ac1d388897cff14c49eaa5bde01d8751cc7.
Sorry, looked into the wrong log file.
My tests with the
seoul-auto
script trigger an alignment issue in seoul:make -C build/x86_64 BOARD=pc run/seoul-auto
With
KERNEL=nova
:With my hw branch and
KERNEL=hw
:objdump:
C++ code:
This looks like an SSSE3 alignment issue but I'm unsure what the the best resolution for this case would be, as far as I've followed the discussion in genodelabs/genode#4827, previous issues involved bootstrap or ARM?
src/app/seoul/target.mk
enables SSSE3 via the-march=core2
switch.