target/ppc: Handle AIL=0 in ppc_excp_vector_offset
authorFabiano Rosas <farosas@linux.ibm.com>
Tue, 17 Dec 2019 14:25:12 +0000 (11:25 -0300)
committerDavid Gibson <david@gibson.dropbear.id.au>
Wed, 8 Jan 2020 00:01:59 +0000 (11:01 +1100)
The exception vector offset calculation was moved into a function but
the case when AIL=0 was not checked.

The reason we got away with this is that the sole caller of
ppc_excp_vector_offset checks the AIL before calling the function:

    /* Handle AIL */
    if (ail) {
        ...
        vector |= ppc_excp_vector_offset(cs, ail);
    }

Fixes: 2586a4d7a0 ("target/ppc: Move exception vector offset computation into a function")
Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
Message-Id: <20191217142512.574075-1-farosas@linux.ibm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
target/ppc/excp_helper.c

index 50b004d00d1e555e721effdc40be0d11a775c1d9..5752ed4a4d8335d8996c0f0037d7e31717b8d6e0 100644 (file)
@@ -112,6 +112,8 @@ static uint64_t ppc_excp_vector_offset(CPUState *cs, int ail)
     uint64_t offset = 0;
 
     switch (ail) {
+    case AIL_NONE:
+        break;
     case AIL_0001_8000:
         offset = 0x18000;
         break;