qemu-riscv
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH 04/24] accel/tcg: Rename user-mode do_interrupt hack as f


From: Philippe Mathieu-Daudé
Subject: Re: [RFC PATCH 04/24] accel/tcg: Rename user-mode do_interrupt hack as fake_user_exception
Date: Sun, 5 Sep 2021 01:26:08 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0

On 9/3/21 9:07 PM, Richard Henderson wrote:
> On 9/2/21 5:16 PM, Philippe Mathieu-Daudé wrote:
>> do_interrupt() is sysemu specific. However due to some X86
>> specific hack, it is also used in user-mode emulation, which
>> is why it couldn't be restricted to CONFIG_SOFTMMU (see the
>> comment around added in commit 78271684719: "cpu: tcg_ops:
>> move to tcg-cpu-ops.h, keep a pointer in CPUClass").
>> Keep the hack but rename the handler as fake_user_exception()
>> and restrict do_interrupt() to sysemu.
>>
>> Signed-off-by: Philippe Mathieu-Daudé<f4bug@amsat.org>
>> ---
>> RFC: Any better name / idea here?
> 
> I guess I'm ok with fake_user_interrupt.

I can use do_fake_user_interrupt (closer match to do_interrupt
equivalent). Alternative name is "do_interrupt_user", same as
the handler:

/*
 * fake user mode interrupt. is_int is TRUE if coming from the int
 * instruction. next_eip is the env->eip value AFTER the interrupt
 * instruction. It is only relevant if is_int is TRUE or if intno
 * is EXCP_SYSCALL.
 */
static void do_interrupt_user(CPUX86State *env, int intno, int is_int,
                              int error_code, target_ulong next_eip)

> But I believe that this could all be moved into cpu_loop.c.

I tried to give it a try, but seems out of my comfort zone.
I'll create an issue to do it as a future cleanup on top of
this series.

> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

Thanks,

Phil.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]