Closed Bug 1575843 Opened 5 years ago Closed 4 years ago

Detect AArch64 CPU features on FreeBSD

Categories

(NSS :: Libraries, enhancement, P2)

ARM64
FreeBSD
enhancement

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jbeich, Assigned: val)

Details

Attachments

(1 file, 3 obsolete files)

No description provided.
Attached patch v2 (obsolete) — Splinter Review

Wait a second..

ID_AA64ISAR0_AES(id_aa64isar0) == ID_AA64ISAR0_AES_BASE
ID_AA64ISAR0_AES(id_aa64isar0) == ID_AA64ISAR0_AES_PMULL

That == looks like having PMULL support would detect as not having AES

(In reply to Jan Beich from comment #5)

Created attachment 9087997 [details] [diff] [review]
v3
Does this work? Make sure you have https://github.com/freebsd/freebsd/commit/8d6dc914b6ab

uhh.. why? Don't use hwcap on aarch64, everything was good in v2, except one thing – I just said you need to compare the register value differently.

The AES field is 1 when only AES is supported and 2 when AES+PMULL are.
If you check it == 1 for AES, systems with PMULL (which is like all of them) would detect as not having AES.

I think just using >= on these fields is the best option.

Assignee: nobody → jbeich
Status: NEW → ASSIGNED
Priority: -- → P2
Attachment #9087997 - Flags: feedback?(greg) → feedback-

Environment checks are reogranized to be separate from platform code
to make it impossible to forget to check disable_FEATURE on one platform
but not the other.

Comment on attachment 9112745 [details]
Bug 1575843 - Detect AArch64 CPU features on FreeBSD

Don't forget to pick up -CURRENT fixes from
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=242104

(In reply to greg v [:myfreeweb] from comment #6)

(In reply to Jan Beich from comment #5)

Created attachment 9087997 [details] [diff] [review]
v3
Does this work? Make sure you have https://github.com/freebsd/freebsd/commit/8d6dc914b6ab

uhh.. why?

Less FreeBSD-specific code to maintain and works under qemu-user.
If someone else does upstreaming (like you did in comment 7) then I don't care. ;) armv7 is a lower priority and doesn't support Firefox on FreeBSD yet without patching.

Don't use hwcap on aarch64

Not convincing unless you answer "why?" as well. Is it because big.LITTLE may support different features?

Is it because big.LITTLE may support different features?

haha, no, that would actually make the register read more concerning, but FreeBSD always returns the intersection of features of all cores, whatever method you use to access the values.

why?

It's not in 12.x, right? Mostly because of that. I don't follow STABLE though, maybe it's there now and will be in the next 12.something…

@jcj, due to bug 1536716 Phabricator is read-only for me as I can't log in. Adding me as a reviewer is only useful to keep me in the loop as mail notification does work.

Agh, I'm sorry Jan, I knew that but ::waves hand at the mess today with him forgetting the new release schedule:: I forgot.

Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 3.50
Attachment #9087997 - Attachment is obsolete: true

Adjusting Summary as armv6/armv7 bits were discarded (to be moved in a separate bug).

Summary: Detect ARM CPU features on FreeBSD → Detect AArch64 CPU features on FreeBSD
Hardware: ARM → ARM64
Assignee: jbeich → greg
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: