[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH v3 1/7] target/ppc: Move exception vector of
From: |
Alexey Kardashevskiy |
Subject: |
Re: [Qemu-devel] [RFC PATCH v3 1/7] target/ppc: Move exception vector offset computation into a function |
Date: |
Fri, 25 Jan 2019 12:22:38 +1100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 |
On 19/01/2019 01:07, Fabiano Rosas wrote:
> Signed-off-by: Fabiano Rosas <address@hidden>
> ---
> target/ppc/excp_helper.c | 31 ++++++++++++++++++++-----------
> 1 file changed, 20 insertions(+), 11 deletions(-)
>
> diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c
> index 0ec7ae1ad4..337a3ef8bb 100644
> --- a/target/ppc/excp_helper.c
> +++ b/target/ppc/excp_helper.c
> @@ -65,6 +65,25 @@ static inline void dump_syscall(CPUPPCState *env)
> ppc_dump_gpr(env, 6), env->nip);
> }
>
> +static uint64_t ppc_excp_vector_offset(CPUState *cs, int ail)
> +{
> + uint64_t offset;
nit: uninitialized variable. It should not matter though as cpu_abort()
has __attribute__ ((__noreturn__)) but still inaccurate imho.
Other than that
Reviewed-by: Alexey Kardashevskiy <address@hidden>
> +
> + switch (ail) {
> + case AIL_0001_8000:
> + offset = 0x18000;
> + break;
> + case AIL_C000_0000_0000_4000:
> + offset = 0xc000000000004000ull;
> + break;
> + default:
> + cpu_abort(cs, "Invalid AIL combination %d\n", ail);
> + break;
> + }
> +
> + return offset;
> +}
> +
> /* Note that this function should be greatly optimized
> * when called with a constant excp, from ppc_hw_interrupt
> */
> @@ -685,17 +704,7 @@ static inline void powerpc_excp(PowerPCCPU *cpu, int
> excp_model, int excp)
> /* Handle AIL */
> if (ail) {
> new_msr |= (1 << MSR_IR) | (1 << MSR_DR);
> - switch(ail) {
> - case AIL_0001_8000:
> - vector |= 0x18000;
> - break;
> - case AIL_C000_0000_0000_4000:
> - vector |= 0xc000000000004000ull;
> - break;
> - default:
> - cpu_abort(cs, "Invalid AIL combination %d\n", ail);
> - break;
> - }
> + vector |= ppc_excp_vector_offset(cs, ail);
> }
>
> #if defined(TARGET_PPC64)
>
--
Alexey
- [Qemu-devel] [RFC PATCH v3 0/7] target/ppc: single step for KVM HV, Fabiano Rosas, 2019/01/18
- [Qemu-devel] [RFC PATCH v3 1/7] target/ppc: Move exception vector offset computation into a function, Fabiano Rosas, 2019/01/18
- Re: [Qemu-devel] [RFC PATCH v3 1/7] target/ppc: Move exception vector offset computation into a function,
Alexey Kardashevskiy <=
- [Qemu-devel] [RFC PATCH v3 3/7] kvm: support checking for single step capability, Fabiano Rosas, 2019/01/18
- [Qemu-devel] [RFC PATCH v3 2/7] target/ppc: Add ppc_get_trace_int_handler_addr, Fabiano Rosas, 2019/01/18
- [Qemu-devel] [RFC PATCH v3 4/7] kvm-all: Introduce kvm_set_singlestep, Fabiano Rosas, 2019/01/18
- [Qemu-devel] [RFC PATCH v3 5/7] target/ppc: Move handling of hardware breakpoints to a separate function, Fabiano Rosas, 2019/01/18
- [Qemu-devel] [RFC PATCH v3 6/7] target/ppc: Refactor kvm_handle_debug, Fabiano Rosas, 2019/01/18
- [Qemu-devel] [RFC PATCH v3 7/7] target/ppc: support single stepping with KVM HV, Fabiano Rosas, 2019/01/18