[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v22 12/17] i386: separate fpu_helper into user and sysemu par
From: |
Richard Henderson |
Subject: |
Re: [PATCH v22 12/17] i386: separate fpu_helper into user and sysemu parts |
Date: |
Wed, 24 Feb 2021 19:28:58 -0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
On 2/24/21 5:34 AM, Claudio Fontana wrote:
> #if !defined(CONFIG_USER_ONLY)
> - else if (ferr_irq && !(env->hflags2 & HF2_IGNNE_MASK)) {
> - qemu_irq_raise(ferr_irq);
> + else {
> + (void)fpu_check_raise_ferr_irq(env);
Given this is the only use, why split out the function at all, much less make
it return bool and then cast the return value to void?
> -#if defined(CONFIG_USER_ONLY)
> -void cpu_x86_fsave(CPUX86State *env, target_ulong ptr, int data32)
> -{
> - helper_fsave(env, ptr, data32);
> -}
Not your bug, obviously, but these usages are broken.
For the record:
In helper_fsave() we reference GETPC(). Which is *only* valid when directly
called from code_gen_buffer.
The signature of cpu_x86_foo must be changed to add a "uintptr_t retaddr"
argument, the callers from linux-user/i386/signal.c must pass 0 for this new
argument (meaning no unwind required), and the helpers must do
void helper_fsave(CPUX86State *env, target_ulong ptr, int data32)
{
cpu_x86_fsave(env, ptr, data32, GETPC());
}
etc.
r~
- Re: [PATCH v22 06/17] meson: add target_user_arch, (continued)
[PATCH v22 09/17] i386: split tcg excp_helper into sysemu and user parts, Claudio Fontana, 2021/02/24
[PATCH v22 10/17] i386: move TCG btp_helper into sysemu/, Claudio Fontana, 2021/02/24
[PATCH v22 13/17] i386: split svm_helper into sysemu and stub-only user, Claudio Fontana, 2021/02/24
[PATCH v22 12/17] i386: separate fpu_helper into user and sysemu parts, Claudio Fontana, 2021/02/24
- Re: [PATCH v22 12/17] i386: separate fpu_helper into user and sysemu parts,
Richard Henderson <=
[PATCH v22 14/17] i386: split seg_helper into user-only and sysemu parts, Claudio Fontana, 2021/02/24
[PATCH v22 11/17] i386: split misc helper into user and sysemu parts, Claudio Fontana, 2021/02/24
[PATCH v22 17/17] i386: move cpu_load_efer into sysemu-only section of cpu.h, Claudio Fontana, 2021/02/24
[PATCH v22 16/17] i386: gdbstub: only write CR0/CR2/CR3/EFER for SOFTMMU, Claudio Fontana, 2021/02/24