9

We can examine /proc/cpuinfo on Intel and ARM machines to learn cpu features, like AES and SHA. I need to do the same for PowerPC under both AIX and Linux.

Testing with Linux is shown below. The output is produced by GCC112 on the compile farm.

$ cat /proc/cpuinfo
processor       : 0
cpu             : POWER8E (raw), altivec supported
clock           : 2061.000000MHz
revision        : 2.1 (pvr 004b 0201)
...

processor       : 159
cpu             : POWER8E (raw), altivec supported
clock           : 2061.000000MHz
revision        : 2.1 (pvr 004b 0201)

timebase        : 512000000
platform        : PowerNV
model           : 8247-22L
machine         : PowerNV 8247-22L
firmware        : OPAL v3

GCC112 is a Power 8 machine. I should be seeing flags like VMX, AES, SHA, PMULL, etc. VMX is roughly the PowerPC equivalent to Intel SSE and ARM NEON.

I've found some related discussions like /proc/cpuinfo on comp.os.linux.powerpc. I also found What do we check on a new system?, but it lacks useful details like cpu features. Finally, there's a related question at What do the flags in /proc/cpuinfo mean?, but it does not discuss PowerPC.

GCC appears to provide the information to C programs through its use of built-ins. For example, there's a vsx test and a vcrypto test. The problem is, I'm working from a Bash script and not a C program.

I also don't know what to use for AIX. AIX is available at GCC119 on the compile farm.

How do I get the PowerPC cpu features on AIX and Linux?

  • 4
    You might get some info from lscpu on Linux, and lscfg -v on AIX. – meuh Sep 9 '17 at 18:16
  • Thanks @meuh - No joy. Output available at PowerPC CPU information. – user56041 Sep 9 '17 at 19:26
  • I don't know about ARM, but SSE is an optional extension on x86, while everything you've mentioned for POWER is required by all POWER8 chips – Fox Sep 9 '17 at 20:52
  • I think we've covered the Linux case at stackoverflow.com/questions/46144668/… , do you want to edit this one to be more specific to AIX? – Jeremy Kerr Sep 12 '17 at 1:34
1

I am not sure why /proc/cpuinfo or lscpu does not reveal flag information. I have found the list of flags known to the linux kernel https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/tree/arch/powerpc/include/asm/cputable.h?id=refs/tags/v4.9

I've just found that you can lookup ELF auxiliary vectors which will show you some hardware capabilities.

$ LD_SHOW_AUXV=1 /bin/true
AT_SYSINFO_EHDR: 0x7ffdcd0e6000
AT_HWCAP:        bfebfbff
AT_PAGESZ:       4096
AT_CLKTCK:       100
AT_PHDR:         0x5591e6663040
AT_PHENT:        56
AT_PHNUM:        9
AT_BASE:         0x7f2ae4f79000
AT_FLAGS:        0x0
AT_ENTRY:        0x5591e6664670
AT_UID:          1000
AT_EUID:         1000
AT_GID:          1000
AT_EGID:         1000
AT_SECURE:       0
AT_RANDOM:       0x7ffdcd044399
AT_HWCAP2:       0x0
AT_EXECFN:       /bin/true
AT_PLATFORM:     x86_64

^^ your AT_HWCAP will have flag info. Masked. I've seen samples on the Internet that have this entry decoded for you. I don't have access to ppc hardware to test on unfortunately.

lscpu should be available on AIX, perhaps it would show CPU flags?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy