]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
powerpc/pseries: Fixes for the "ibm,architecture-vec-5" options
authorPaul Mackerras <paulus@ozlabs.org>
Mon, 30 Jan 2017 10:21:35 +0000 (21:21 +1100)
committerTim Gardner <tim.gardner@canonical.com>
Mon, 6 Mar 2017 21:20:10 +0000 (14:20 -0700)
BugLink: http://bugs.launchpad.net/bugs/1670315
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 <paulus@ozlabs.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
(cherry picked from commit 3f4ab2f83b4e443c66549206eb88a9fa5a85d647)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
arch/powerpc/include/asm/prom.h
arch/powerpc/platforms/pseries/firmware.c

index 5e57705b47599973d19629a014035a7c1fb5a11d..e6d83d0fada7ea771eb1b137b6fb3c1a2341efc0 100644 (file)
@@ -151,10 +151,10 @@ struct of_drconf_cell {
 #define OV5_XCMO               0x0440  /* Page Coalescing */
 #define OV5_TYPE1_AFFINITY     0x0580  /* Type 1 NUMA affinity */
 #define OV5_PRRN               0x0540  /* Platform Resource Reassignment */
-#define OV5_PFO_HW_RNG         0x0E80  /* PFO Random Number Generator */
-#define OV5_PFO_HW_842         0x0E40  /* PFO Compression Accelerator */
-#define OV5_PFO_HW_ENCR                0x0E20  /* PFO Encryption Accelerator */
-#define OV5_SUB_PROCESSORS     0x0F01  /* 1,2,or 4 Sub-Processors supported */
+#define OV5_PFO_HW_RNG         0x1180  /* PFO Random Number Generator */
+#define OV5_PFO_HW_842         0x1140  /* PFO Compression Accelerator */
+#define OV5_PFO_HW_ENCR                0x1120  /* PFO Encryption Accelerator */
+#define OV5_SUB_PROCESSORS     0x1501  /* 1,2,or 4 Sub-Processors supported */
 
 /* Option Vector 6: IBM PAPR hints */
 #define OV6_LINUX              0x02    /* Linux is our OS */
index ea7f09bd73b14740a991e5a1cb90f330a83454ac..7d67623203b83ff1e77cf8a3d202ae363ea103b3 100644 (file)
@@ -126,7 +126,7 @@ static void __init fw_vec5_feature_init(const char *vec5, unsigned long len)
                index = OV5_INDX(vec5_fw_features_table[i].feature);
                feat = OV5_FEAT(vec5_fw_features_table[i].feature);
 
-               if (vec5[index] & feat)
+               if (index < len && (vec5[index] & feat))
                        powerpc_firmware_features |=
                                vec5_fw_features_table[i].val;
        }