PR 256897
Details
chroot into a 32-bit ARMv7 dist on a FreeBSD/arm64 system and run 'procstat -x' to verify that HWCAP/HWCAP2 are present in the aux array. Tested with qemu-aarch64 with cortexA53 and A72 cpu types, and also on AWS Graviton (backport to 13)
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 40466 Build 37355: arc lint + arc unit
Event Timeline
sys/arm64/arm64/identcpu.c | ||
---|---|---|
1507 | These registers could be different in a big.LITTLE system so we need a consistent view of them in user_cpu_desc and to use that here. |
sys/arm64/arm64/identcpu.c | ||
---|---|---|
1878–1881 | We should only read these if EL0 supports AArch32. The docs say direct access is unknown if no exception levels support AArch32, however I'm unsure if that means the values are unknown, or the hw could raise an exception. |
sys/arm64/arm64/identcpu.c | ||
---|---|---|
1507 | I'll fix that. Will there ever be a big.LITTLE case where some PEs don't support EL0-32 ? |
sys/arm64/arm64/identcpu.c | ||
---|---|---|
1507 | I don't know of any current SoCs, however (based on what I've been told) there's a strong possibility in future SoCs. |
sys/arm64/include/elf.h | ||
---|---|---|
153 | This does raise the issue, btw, that 'cc -m32' probably doesn't work today on aarch64. For that to work, we'd need to merge the MD headers the way sys/x86/include works. However, we can tell people to setup a armv7 chroot and use --sysroot to point to that along with -m32 as a workaround. If we really care about freebsd32 on aarch64 we should figure out a solution for /usr/include/machine to support both eventually. |
sys/arm64/include/elf.h | ||
---|---|---|
153 | We decided a long time ago that we didn't care about that. |
- Remove HWCAP32_THUMBEE as this is unused in ARMv8
- Update COMPAT HWCAP comments to reflect ARMv8 usage.
A few comments on register macro names & values.
I've also created D31201 to rework how we set the HWCAPS values. I'm happy to move the 32-bit HWCAPS to that format based on this change after the register and HWCAP32* macros have been committed.
sys/arm64/include/armreg.h | ||
---|---|---|
776 | We don't normally add _EL1 on these definitions | |
812 | UL(0x01) | |
816 | I've been following capitalisation from the documentation to help auto generate these registers so these would be ID_PFR0_State... | |
842 | Maybe call this ID_PFR0_EL1_CSV2_HWCTX as later revisions of the architecture add a variant that branch targets trained on both different hardware contexts and different addresses can control speculative execution on different hardware contexts and addresses respectively. | |
859 | UL(0x2) | |
905 | FPShVec | |
947–948 | Maybe MVFR1_SIMDHP_CONV (or _CONV_SP) and MVFR1_SIMDHP_ARITH so it's obvious the former only allows for conversion, while the latter adds arithmetic operations. | |
953–954 | Maybe MVFR1_FPHP_CONV_SP and MVFR1_FPHP_CONV_DP and add MVFR1_FPHP_CONV_ARITH (UL(0x3)...) to indicate support for half-precision arithmetic operations. |
- Remove HWCAP32_THUMBEE as this is unused in ARMv8
- Update COMPAT HWCAP comments to reflect ARMv8 usage.
- Print aarch32 regs, and compare across all CPUs.
- Remove _EL1 from register defines.
- Fix typo in ID_ISAR5_VCMA_IMPL constant.
- FPshVec -> FPShVec in register defines.
- Review feedback on register names
The register printing may be a bit verbose: feedback welcome.
AArch32 Instruction Set Attributes 5 = <CRC32,SHA2,SHA1,AES+VMULL> AArch32 Media and VFP Features 0 = <FPRound,FPSqrt,FPDivide,DP VFPv3+v4,SP VFPv3+v4,AdvSIMD> AArch32 Media and VFP Features 1 = <SIMDFMAC,FPHP DP Conv,SIMDHP SP Conv,SIMDSP,SIMDInt,SIMDLS,FPDNaN,FPFtZ>
The case of no EL0 32-bit should work, though untested.
Tested on a M1 Mac under Parallels:
AArch32 Instruction Set Attributes 5 = <SEVL Nop> AArch32 Media and VFP Features 0 = <> AArch32 Media and VFP Features 1 = <>
sys/arm64/arm64/identcpu.c | ||
---|---|---|
1034–1035 | I would swap these so we print when SEVL is implemented, otherwise we print something when no 32-bit support is present. |
Verified to build lang/go on a FreeBSD 13 AWS c6g.8xlarge in a poudriere armv7 jail with this patch applied to the kernel.