xref: /freebsd/crypto/openssl/doc/man3/OPENSSL_ppccap.pod (revision f25b8c9fb4f58cf61adb47d7570abe7caa6d385d)
1*f25b8c9fSEnji Cooper=pod
2*f25b8c9fSEnji Cooper
3*f25b8c9fSEnji Cooper=head1 NAME
4*f25b8c9fSEnji Cooper
5*f25b8c9fSEnji CooperOPENSSL_ppccap - the PowerPC processor capabilities vector
6*f25b8c9fSEnji Cooper
7*f25b8c9fSEnji Cooper=head1 SYNOPSIS
8*f25b8c9fSEnji Cooper
9*f25b8c9fSEnji Cooper env OPENSSL_ppccap=... <application>
10*f25b8c9fSEnji Cooper
11*f25b8c9fSEnji Cooper=head1 DESCRIPTION
12*f25b8c9fSEnji Cooper
13*f25b8c9fSEnji Cooperlibcrypto supports PowerPC instruction set extensions. These extensions are
14*f25b8c9fSEnji Cooperrepresented by bits in the PowerPC capabilities vector. When libcrypto
15*f25b8c9fSEnji Cooperinitializes, it stores the results returned by PowerPC CPU capabilities detection
16*f25b8c9fSEnji Cooperlogic in the PowerPC capabilities vector. The CPU capabilities detection methods
17*f25b8c9fSEnji Cooperare OS-dependent and use a combination of information gathered by the kernel
18*f25b8c9fSEnji Cooperduring boot and probe functions that attempt to execute instructions and trap
19*f25b8c9fSEnji Cooperillegal instruction signals with a signal handler.
20*f25b8c9fSEnji Cooper
21*f25b8c9fSEnji CooperTo override the set of extensions available to an application, you can set the
22*f25b8c9fSEnji CooperB<OPENSSL_ppccap> environment variable before you start the application. The
23*f25b8c9fSEnji Cooperenvironment variable is assigned a numerical value that denotes the bits in
24*f25b8c9fSEnji Cooperthe PowerPC capabilities vector. The ppc_arch.h header file states that, "Flags'
25*f25b8c9fSEnji Cooperusage can appear ambiguous, because they are set rather to reflect OpenSSL
26*f25b8c9fSEnji Cooperperformance preferences than actual processor capabilities."
27*f25b8c9fSEnji Cooper
28*f25b8c9fSEnji CooperMultiple extensions are enabled by logically OR-ing the values that represent the
29*f25b8c9fSEnji Cooperdesired extensions.
30*f25b8c9fSEnji Cooper
31*f25b8c9fSEnji CooperB<Notes>: Enabling an extension on a CPU that does not support the extension
32*f25b8c9fSEnji Cooperwill result in a SIGILL crash. On AIX, all vector instructions can be disabled
33*f25b8c9fSEnji Cooperwith the schedo -ro allow_vmx=0 command. DO NOT USE THIS COMMAND to disable
34*f25b8c9fSEnji Coopervector instructions in the OS when it is running on a CPU level that supports the
35*f25b8c9fSEnji Cooperinstructions without also disabling them in libcrpto via the OPENSSL_ppccap
36*f25b8c9fSEnji Cooperenvironment variable or the application will crash with a SIGILL.
37*f25b8c9fSEnji Cooper
38*f25b8c9fSEnji CooperCurrently, the following extensions are defined:
39*f25b8c9fSEnji Cooper
40*f25b8c9fSEnji Cooper=over 4
41*f25b8c9fSEnji Cooper
42*f25b8c9fSEnji Cooper=item 0x01
43*f25b8c9fSEnji Cooper
44*f25b8c9fSEnji CooperName: B<PPC_FPU64>
45*f25b8c9fSEnji Cooper
46*f25b8c9fSEnji CooperThis flag is obsolete.
47*f25b8c9fSEnji Cooper
48*f25b8c9fSEnji Cooper=item 0x02
49*f25b8c9fSEnji Cooper
50*f25b8c9fSEnji CooperName: B<PPC_ALTIVEC>
51*f25b8c9fSEnji Cooper
52*f25b8c9fSEnji CooperMeaning: Use AltiVec (aka VMX) instructions. In some but not all cases, this
53*f25b8c9fSEnji Coopercapability gates the use of later ISA vector instructions. The associated probe
54*f25b8c9fSEnji Cooperinstruction is vor (vector logical or).
55*f25b8c9fSEnji Cooper
56*f25b8c9fSEnji CooperEffect: Enables use of vector instructions but does not enable extensions added
57*f25b8c9fSEnji Cooperat specific ISA levels. However, disabling this capability disables a subset of
58*f25b8c9fSEnji Coopervector extensions added at specific ISA levels even if they are otherwise
59*f25b8c9fSEnji Cooperenabled.
60*f25b8c9fSEnji Cooper
61*f25b8c9fSEnji Cooper=item 0x04
62*f25b8c9fSEnji Cooper
63*f25b8c9fSEnji CooperName: B<PPC_CRYPTO207>
64*f25b8c9fSEnji Cooper
65*f25b8c9fSEnji CooperMeaning: Use instructions added in ISA level 2.07. The associated probe
66*f25b8c9fSEnji Cooperinstruction instruction is vcipher (vector AES cipher round).
67*f25b8c9fSEnji Cooper
68*f25b8c9fSEnji CooperEffect: Enables AES, SHA-2 sigma, and other ISA 2.07 instructions for AES, SHA-2,
69*f25b8c9fSEnji CooperGHASH, and Poly1305.
70*f25b8c9fSEnji Cooper
71*f25b8c9fSEnji Cooper=item 0x08
72*f25b8c9fSEnji Cooper
73*f25b8c9fSEnji CooperName: B<PPC_FPU>
74*f25b8c9fSEnji Cooper
75*f25b8c9fSEnji CooperMeaning: Use FPU instructions. The associated probe instruction is fmr (floating
76*f25b8c9fSEnji Coopermove register).
77*f25b8c9fSEnji Cooper
78*f25b8c9fSEnji CooperEffect: Enables Poly1305 FPU implementation. The PPC_CRYPTO207 capability
79*f25b8c9fSEnji Cooperoverrides this effect.
80*f25b8c9fSEnji Cooper
81*f25b8c9fSEnji Cooper=item 0x10
82*f25b8c9fSEnji Cooper
83*f25b8c9fSEnji CooperName: B<PPC_MADD300>
84*f25b8c9fSEnji Cooper
85*f25b8c9fSEnji CooperMeaning: Use instructions added in ISA level 3.00. The associated probe
86*f25b8c9fSEnji Cooperinstruction is maddhdu (multiply-add high doubleword unsigned).
87*f25b8c9fSEnji Cooper
88*f25b8c9fSEnji CooperEffect: Enables use of the polynomial multiply and other ISA 3.00 instructions
89*f25b8c9fSEnji Cooperfor AES-GCM, P-384, and P-521.
90*f25b8c9fSEnji Cooper
91*f25b8c9fSEnji Cooper=item 0x20
92*f25b8c9fSEnji Cooper
93*f25b8c9fSEnji CooperName: B<PPC_MFTB>
94*f25b8c9fSEnji Cooper
95*f25b8c9fSEnji CooperMeaning: Use the mftb (move from time base) instruction. The associated probe
96*f25b8c9fSEnji Cooperinstruction is mftb.
97*f25b8c9fSEnji Cooper
98*f25b8c9fSEnji CooperEffect: Enables use of the mftb instruction to sample the lower 32 bits of the
99*f25b8c9fSEnji CooperCPU time base register in order to acquire entropy. Considered obsolete.  The
100*f25b8c9fSEnji CooperPPC_MFSPR268 capability overrides this capability.
101*f25b8c9fSEnji Cooper
102*f25b8c9fSEnji Cooper=item 0x40
103*f25b8c9fSEnji Cooper
104*f25b8c9fSEnji CooperName: B<PPC_MFSPR268>
105*f25b8c9fSEnji Cooper
106*f25b8c9fSEnji CooperMeaning: Use the mfspr (move from special purpose register) instruction to
107*f25b8c9fSEnji Cooperread SPR 268. The associated probe instruction is mfspr 268.
108*f25b8c9fSEnji Cooper
109*f25b8c9fSEnji CooperEffect: Enables use of the mfspr instruction to sample the lower 32 bits of the
110*f25b8c9fSEnji CooperCPU time base register from SPR 268, the TBL (time base lower) register, in order
111*f25b8c9fSEnji Cooperto acquire entropy.
112*f25b8c9fSEnji Cooper
113*f25b8c9fSEnji Cooper=item 0x80
114*f25b8c9fSEnji Cooper
115*f25b8c9fSEnji CooperName: B<PPC_BRD31>
116*f25b8c9fSEnji Cooper
117*f25b8c9fSEnji CooperMeaning: Use instructions added in ISA level 3.1. The associated probe instruction
118*f25b8c9fSEnji Cooperis brd (byte-reverse doubleword).
119*f25b8c9fSEnji Cooper
120*f25b8c9fSEnji CooperEffect: Enables use of ISA 3.1 instructions in ChaCha20.
121*f25b8c9fSEnji Cooper
122*f25b8c9fSEnji Cooper=back
123*f25b8c9fSEnji Cooper
124*f25b8c9fSEnji Cooper=head1 RETURN VALUES
125*f25b8c9fSEnji Cooper
126*f25b8c9fSEnji CooperNot available.
127*f25b8c9fSEnji Cooper
128*f25b8c9fSEnji Cooper=head1 EXAMPLES
129*f25b8c9fSEnji Cooper
130*f25b8c9fSEnji CooperCheck currently detected capabilities:
131*f25b8c9fSEnji Cooper
132*f25b8c9fSEnji Cooper $ openssl info -cpusettings
133*f25b8c9fSEnji Cooper OPENSSL_ppccap=0x2E
134*f25b8c9fSEnji Cooper
135*f25b8c9fSEnji CooperThe detected capabilities in the above example indicate that PPC_MFTB, PPC_FPU,
136*f25b8c9fSEnji CooperPPC_CRYPTO207, PPC_MFSPR268, and PPC_ALTIVEC are enabled.
137*f25b8c9fSEnji Cooper
138*f25b8c9fSEnji CooperDisable all instruction set extensions:
139*f25b8c9fSEnji Cooper
140*f25b8c9fSEnji Cooper OPENSSL_ppccap=0x00
141*f25b8c9fSEnji Cooper
142*f25b8c9fSEnji CooperEnable base AltiVec extensions:
143*f25b8c9fSEnji Cooper
144*f25b8c9fSEnji Cooper OPENSSL_ppccap=0x02
145*f25b8c9fSEnji Cooper
146*f25b8c9fSEnji Cooper=head1 COPYRIGHT
147*f25b8c9fSEnji Cooper
148*f25b8c9fSEnji CooperCopyright 2025 The OpenSSL Project Authors. All Rights Reserved.
149*f25b8c9fSEnji Cooper
150*f25b8c9fSEnji CooperLicensed under the Apache License 2.0 (the "License").  You may not use
151*f25b8c9fSEnji Cooperthis file except in compliance with the License.  You can obtain a copy
152*f25b8c9fSEnji Cooperin the file LICENSE in the source distribution or at
153*f25b8c9fSEnji CooperL<https://www.openssl.org/source/license.html>.
154*f25b8c9fSEnji Cooper
155*f25b8c9fSEnji Cooper=cut
156