qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] target/ppc: Handle AIL=0 in ppc_excp_vector_offset
@ 2019-12-17 14:25 Fabiano Rosas
  2019-12-18  3:11 ` David Gibson
  0 siblings, 1 reply; 2+ messages in thread
From: Fabiano Rosas @ 2019-12-17 14:25 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-ppc, David Gibson

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>
---
 target/ppc/excp_helper.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c
index 50b004d00d..5752ed4a4d 100644
--- a/target/ppc/excp_helper.c
+++ b/target/ppc/excp_helper.c
@@ -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;
-- 
2.23.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] target/ppc: Handle AIL=0 in ppc_excp_vector_offset
  2019-12-17 14:25 [PATCH] target/ppc: Handle AIL=0 in ppc_excp_vector_offset Fabiano Rosas
@ 2019-12-18  3:11 ` David Gibson
  0 siblings, 0 replies; 2+ messages in thread
From: David Gibson @ 2019-12-18  3:11 UTC (permalink / raw)
  To: Fabiano Rosas; +Cc: qemu-ppc, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1344 bytes --]

On Tue, Dec 17, 2019 at 11:25:12AM -0300, Fabiano Rosas wrote:
> 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>

Applied to ppc-for-5.0, thanks.

> ---
>  target/ppc/excp_helper.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c
> index 50b004d00d..5752ed4a4d 100644
> --- a/target/ppc/excp_helper.c
> +++ b/target/ppc/excp_helper.c
> @@ -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;

-- 
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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-12-18  3:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-17 14:25 [PATCH] target/ppc: Handle AIL=0 in ppc_excp_vector_offset Fabiano Rosas
2019-12-18  3:11 ` David Gibson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).