aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2017-01-15 22:36:33 -0600
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-02-02 18:22:42 +1100
commitfe796b5f51bfd58c8e007961ac13f639dc801657 (patch)
tree1513fe5fcef9daf97872f2292b4378a9591a933c /hw
parent598db01e44442b4f07b2bf22eaef2fa5db243f19 (diff)
downloadskiboot-fe796b5f51bfd58c8e007961ac13f639dc801657.zip
skiboot-fe796b5f51bfd58c8e007961ac13f639dc801657.tar.gz
skiboot-fe796b5f51bfd58c8e007961ac13f639dc801657.tar.bz2
xive: Fix opal_xive_check_pending()
We were calculating the mask all wrong... we got lucky in the normal case though. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/xive.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/xive.c b/hw/xive.c
index 18e0bb7..2a25a72 100644
--- a/hw/xive.c
+++ b/hw/xive.c
@@ -2916,7 +2916,7 @@ static uint8_t xive_sanitize_cppr(uint8_t cppr)
static inline uint8_t opal_xive_check_pending(struct xive_cpu_state *xs,
uint8_t cppr)
{
- uint8_t mask = (cppr > 7) ? 0xff : ((1 << cppr) - 1);
+ uint8_t mask = (cppr > 7) ? 0xff : ~((0x100 >> cppr) - 1);
return xs->pending & mask;
}
@@ -2926,9 +2926,9 @@ static int64_t opal_xive_eoi(uint32_t xirr)
struct cpu_thread *c = this_cpu();
struct xive_cpu_state *xs = c->xstate;
uint32_t isn = xirr & 0x00ffffff;
- uint8_t cppr, irqprio;
struct xive *src_x;
bool special_ipi = false;
+ uint8_t cppr;
/*
* In exploitation mode, this is supported as a way to perform