[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 10/19] target/s390x: use program_interrupt()
From: |
Cornelia Huck |
Subject: |
Re: [Qemu-devel] [PATCH v2 10/19] target/s390x: use program_interrupt() in per_check_exception() |
Date: |
Thu, 7 Sep 2017 15:32:59 +0200 |
On Mon, 4 Sep 2017 17:43:07 +0200
David Hildenbrand <address@hidden> wrote:
> Clean it up by reusing program_interrupt(). Add a concern regarding
> ilen.
>
> Signed-off-by: David Hildenbrand <address@hidden>
> ---
> target/s390x/misc_helper.c | 15 +++++++++------
> 1 file changed, 9 insertions(+), 6 deletions(-)
>
> diff --git a/target/s390x/misc_helper.c b/target/s390x/misc_helper.c
> index 57c02ddf1b..5096286157 100644
> --- a/target/s390x/misc_helper.c
> +++ b/target/s390x/misc_helper.c
> @@ -446,14 +446,17 @@ void HELPER(chsc)(CPUS390XState *env, uint64_t inst)
> #ifndef CONFIG_USER_ONLY
> void HELPER(per_check_exception)(CPUS390XState *env)
> {
> - CPUState *cs = CPU(s390_env_get_cpu(env));
> + uint32_t ilen;
>
> if (env->per_perc_atmid) {
> - env->int_pgm_code = PGM_PER;
> - env->int_pgm_ilen = get_ilen(cpu_ldub_code(env, env->per_address));
> -
> - cs->exception_index = EXCP_PGM;
> - cpu_loop_exit(cs);
> + /*
> + * FIXME: ILEN_AUTO is most probably the right thing to use. ilen
> + * always has to match the instruction referenced in the PSW. E.g.
> + * if a PER interrupt is triggered via EXECUTE, we have to use ilen
> + * of EXECUTE, while per_address contains the target of EXECUTE.
> + */
> + ilen = get_ilen(cpu_ldub_code(env, env->per_address));
> + program_interrupt(env, PGM_PER, ilen);
> }
> }
>
Wrapping my head around it: You preserve the current behavior, which
should probably be changed to use ILEN_AUTO to handle cases like
EXECUTE correctly?
Do you plan to do a follow up? (Should I spend some cycles on it?)
- Re: [Qemu-devel] [PATCH v2 07/19] s390x: move two function declarations to s390-virtio-ccw.h, (continued)
[Qemu-devel] [PATCH v2 09/19] target/s390x: use trigger_pgm_exception() in s390_cpu_handle_mmu_fault(), David Hildenbrand, 2017/09/04
[Qemu-devel] [PATCH v2 10/19] target/s390x: use program_interrupt() in per_check_exception(), David Hildenbrand, 2017/09/04
- Re: [Qemu-devel] [PATCH v2 10/19] target/s390x: use program_interrupt() in per_check_exception(),
Cornelia Huck <=
[Qemu-devel] [PATCH v2 11/19] s390x: allow only 1 CPU with TCG, David Hildenbrand, 2017/09/04
[Qemu-devel] [PATCH v2 12/19] target/s390x: set cpu->id for linux user when realizing, David Hildenbrand, 2017/09/04