Hi Mark, On Thu, 2026-10-22 at 22:01 +0100, Mark Cave-Ayland wrote: > > > Hmmm. Feels like we're getting a bit blurred here between the crypto > feature and other sun4v features, however I think we're just going to > have to go with this for now.
Yes. The approach was discussed on the list. As Richard mentioned, ideally the sun4v platform could be used, but since it's incomplete, it would require a lot of work. > Presumably no other interesting ASIs have showed up in your tests so > far? > Thanks for the review, but your question made me think about openssl, and I found a real problem that I didn't see before. Please don't apply 7/8 and 8/8. On real hardware, a store to ASI 0xe2 at an aligned address also zeroes the rest of the block. I measured it: the T4 zeroes the 32-byte block, the M7 the whole 64-byte line. Other offsets are plain stores. glibc's niagara4 memset depends on this. For zeroing it only stores two of every eight words and lets the hardware clear the rest. QEMU does a plain 8-byte store, so with 7/8 and 8/8 a memset(p, 0, n) of more than about 120 bytes leaves stale data behind. OpenSSL from a Gentoo stage3 crashes at startup because of it. So 7/8 only turns the SIGILL into silent corruption. And then I found a second gap..! QEMU rejects the FP form (stda %f, 0xe2), which OpenSSL's T4 AES code uses for large buffers. OpenSSL probes the CFR itself rather than AT_HWCAP, so with only 1-6 and -cpu ...,+vis3,+crypto, AES-CBC/CTR on large inputs gets SIGILL. SHA and the other instructions work fine with OpenSSL. My suggestion: 1-6 can go in as Philippe proposed, since the feature is opt-in. I'll withdraw 7/8 and 8/8 and send a separate series that models block-init stores properly (integer and FP, zero-fill as on the T4), with the hwcap patch on top. I have a memset/memcpy test that passes natively on the T4 and catches this, so that series will come with better testing. Sorry for the churn, and thanks for asking the right question. /Stian
signature.asc
Description: This is a digitally signed message part
