[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [qemu-s390x] [PATCH v3 2/9] s390x/tcg: factor out and fix DATA excep
From: |
Thomas Huth |
Subject: |
Re: [qemu-s390x] [PATCH v3 2/9] s390x/tcg: factor out and fix DATA exception injection |
Date: |
Wed, 26 Sep 2018 13:37:57 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 |
On 2018-09-17 11:34, David Hildenbrand wrote:
> The DXC is to be stored in the low core, and only in the FPC in case AFP
> is enabled in CR0. Stub is not required in current code, but this way
> we never run into problems.
>
> Reviewed-by: Richard Henderson <address@hidden>
> Signed-off-by: David Hildenbrand <address@hidden>
> ---
> target/s390x/cpu.h | 1 +
> target/s390x/excp_helper.c | 23 +++++++++++++++++++++++
> target/s390x/fpu_helper.c | 13 +++----------
> target/s390x/helper.h | 1 +
> target/s390x/tcg-stub.c | 5 +++++
> target/s390x/tcg_s390x.h | 2 ++
> target/s390x/translate.c | 19 +++++++++----------
> 7 files changed, 44 insertions(+), 20 deletions(-)
>
> diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h
> index 6f8861e554..5e50c3a303 100644
> --- a/target/s390x/cpu.h
> +++ b/target/s390x/cpu.h
> @@ -322,6 +322,7 @@ extern const struct VMStateDescription vmstate_s390_cpu;
> #define CR0_LOWPROT 0x0000000010000000ULL
> #define CR0_SECONDARY 0x0000000004000000ULL
> #define CR0_EDAT 0x0000000000800000ULL
> +#define CR0_AFP 0x0000000000040000ULL
> #define CR0_EMERGENCY_SIGNAL_SC 0x0000000000004000ULL
> #define CR0_EXTERNAL_CALL_SC 0x0000000000002000ULL
> #define CR0_CKC_SC 0x0000000000000800ULL
> diff --git a/target/s390x/excp_helper.c b/target/s390x/excp_helper.c
> index 5dab3387c3..2b23105f41 100644
> --- a/target/s390x/excp_helper.c
> +++ b/target/s390x/excp_helper.c
> @@ -21,6 +21,7 @@
> #include "qemu/osdep.h"
> #include "cpu.h"
> #include "internal.h"
> +#include "exec/helper-proto.h"
> #include "qemu/timer.h"
> #include "exec/exec-all.h"
> #include "exec/cpu_ldst.h"
> @@ -61,6 +62,28 @@ void QEMU_NORETURN
> tcg_s390_program_interrupt(CPUS390XState *env, uint32_t code,
> cpu_loop_exit(cs);
> }
>
> +void QEMU_NORETURN tcg_s390_data_exception(CPUS390XState *env, uint32_t dxc,
> + uintptr_t ra)
> +{
> + g_assert(!(dxc & ~0xff));
I'd maybe rather use g_assert(dxc <= 0xff) instead (that's easier to read).
> +#if !defined(CONFIG_USER_ONLY)
> + /* Store the DXC into the lowcore */
> + stl_phys(CPU(s390_env_get_cpu(env))->as,
> + env->psa + offsetof(LowCore, data_exc_code), dxc);
> +#endif
> +
> + /* Store the DXC into the FPC if AFP is enabled */
> + if (env->cregs[0] & CR0_AFP) {
> + env->fpc = (env->fpc & ~0xff00) | (dxc << 8);
You could use deposit32() here instead.
> + }
> + tcg_s390_program_interrupt(env, PGM_DATA, ILEN_AUTO, ra);
> +}
[...]
Just nits ... patch looks also fine to me as it is:
Reviewed-by: Thomas Huth <address@hidden>
- [qemu-s390x] [PATCH v3 0/9] s390x: instruction flags and AFP registers for TCG, David Hildenbrand, 2018/09/17
- [qemu-s390x] [PATCH v3 1/9] s390x: move tcg_s390_program_interrupt() into TCG code and mark it noreturn, David Hildenbrand, 2018/09/17
- [qemu-s390x] [PATCH v3 2/9] s390x/tcg: factor out and fix DATA exception injection, David Hildenbrand, 2018/09/17
- Re: [qemu-s390x] [PATCH v3 2/9] s390x/tcg: factor out and fix DATA exception injection,
Thomas Huth <=
- [qemu-s390x] [PATCH v3 3/9] s390x/tcg: store in the TB flags if AFP is enabled, David Hildenbrand, 2018/09/17
- [qemu-s390x] [PATCH v3 4/9] s390x/tcg: support flags for instructions, David Hildenbrand, 2018/09/17
- [qemu-s390x] [PATCH v3 5/9] s390x/tcg: add instruction flags for floating point instructions, David Hildenbrand, 2018/09/17
- [qemu-s390x] [PATCH v3 6/9] s390x/tcg: check for AFP-register, BFP and DFP data exceptions, David Hildenbrand, 2018/09/17
- [qemu-s390x] [PATCH v3 8/9] s390x/tcg: fix FP register pair checks, David Hildenbrand, 2018/09/17