Skip to content

Commit 3f4ab2f

Browse files
paulusmackmpe
authored andcommitted
powerpc/pseries: Fixes for the "ibm,architecture-vec-5" options
This fixes the byte index values for some of the option bits in the "ibm,architectur-vec-5" property. The "platform facilities options" bits are in byte 17 not byte 14, so the upper 8 bits of their definitions need to be 0x11 not 0x0E. The "sub processor support" option is in byte 21 not byte 15. Note none of these options are actually looked up in "ibm,architecture-vec-5" at this time, so there is no bug. When checking whether option bits are set, we should check that the offset of the byte being checked is less than the vector length that we got from the hypervisor. Signed-off-by: Paul Mackerras <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
1 parent 18569c1 commit 3f4ab2f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

arch/powerpc/include/asm/prom.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,10 @@ struct of_drconf_cell {
151151
#define OV5_XCMO 0x0440 /* Page Coalescing */
152152
#define OV5_TYPE1_AFFINITY 0x0580 /* Type 1 NUMA affinity */
153153
#define OV5_PRRN 0x0540 /* Platform Resource Reassignment */
154-
#define OV5_PFO_HW_RNG 0x0E80 /* PFO Random Number Generator */
155-
#define OV5_PFO_HW_842 0x0E40 /* PFO Compression Accelerator */
156-
#define OV5_PFO_HW_ENCR 0x0E20 /* PFO Encryption Accelerator */
157-
#define OV5_SUB_PROCESSORS 0x0F01 /* 1,2,or 4 Sub-Processors supported */
154+
#define OV5_PFO_HW_RNG 0x1180 /* PFO Random Number Generator */
155+
#define OV5_PFO_HW_842 0x1140 /* PFO Compression Accelerator */
156+
#define OV5_PFO_HW_ENCR 0x1120 /* PFO Encryption Accelerator */
157+
#define OV5_SUB_PROCESSORS 0x1501 /* 1,2,or 4 Sub-Processors supported */
158158

159159
/* Option Vector 6: IBM PAPR hints */
160160
#define OV6_LINUX 0x02 /* Linux is our OS */

arch/powerpc/platforms/pseries/firmware.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ static void __init fw_vec5_feature_init(const char *vec5, unsigned long len)
126126
index = OV5_INDX(vec5_fw_features_table[i].feature);
127127
feat = OV5_FEAT(vec5_fw_features_table[i].feature);
128128

129-
if (vec5[index] & feat)
129+
if (index < len && (vec5[index] & feat))
130130
powerpc_firmware_features |=
131131
vec5_fw_features_table[i].val;
132132
}

0 commit comments

Comments
 (0)