target/ppc: Handle AIL=0 in ppc_excp_vector_offset
PATCH 1/1 target/ppc: Handle AIL=0 in ppc_excp_vector_offset
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 <[email protected]>
--- target/ppc/excp_helper.c | 2 ++ 1 file changed, 2 insertions(+)
target/ppc/excp_helper.c +2 -0
@@ -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 ;
Signature · 1 line
2.23.0
David Gibson
AppliedQuoted 6 lines · Fabiano Rosas
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_offsetchecks the AIL before calling the function:
Quoted 8 lines
/* 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 <[email protected]>
Applied to ppc-for-5.0, thanks.
Quoted 17 lines
--- target/ppc/excp_helper.c | 2 ++ 1 file changed, 2 insertions(+)target/ppc/excp_helper.c +2
-0@@ -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 ;
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson