diff options
author | Nicholas Piggin <npiggin@gmail.com> | 2017-10-10 02:13:03 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2017-10-15 20:08:14 -0500 |
commit | a6559413f07d4bc6c58b00858c48d2fc70165011 (patch) | |
tree | 2f7966426e1087b2501391d80af6a0b81a79c4bf | |
parent | 77dbac105a99c705b830410bd991a5fcd6d1ff4f (diff) | |
download | skiboot-a6559413f07d4bc6c58b00858c48d2fc70165011.zip skiboot-a6559413f07d4bc6c58b00858c48d2fc70165011.tar.gz skiboot-a6559413f07d4bc6c58b00858c48d2fc70165011.tar.bz2 |
xive: Fix VP free block group mode false-positive parameter check
The check to ensure the buddy allocation idx is aligned to its
allocation order was not taking into account the allocation split.
This would result in opal_xive_free_vp_block failures despite
giving the same value as returned by opal_xive_alloc_vp_block.
E.g., starting then stopping 4 KVM guests gives the following pattern
in the host:
opal_xive_alloc_vp_block(5)=0x45000020
opal_xive_alloc_vp_block(5)=0x45000040
opal_xive_alloc_vp_block(5)=0x45000060
opal_xive_alloc_vp_block(5)=0x45000080
opal_xive_free_vp_block(0x45000020)=-1
opal_xive_free_vp_block(0x45000040)=0
opal_xive_free_vp_block(0x45000060)=-1
opal_xive_free_vp_block(0x45000080)=0
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r-- | hw/xive.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -4463,12 +4463,14 @@ static int64_t opal_xive_free_vp_block(uint64_t vp_base) return OPAL_PARAMETER; if (order < (xive_chips_alloc_bits + 1)) return OPAL_PARAMETER; + if (idx & ((1 << (order - xive_chips_alloc_bits)) - 1)) + return OPAL_PARAMETER; #else if (order < 1) return OPAL_PARAMETER; -#endif if (idx & ((1 << order) - 1)) return OPAL_PARAMETER; +#endif count = 1 << order; for (i = 0; i < count; i++) { |