qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v25 14/20] i386: separate fpu_helper into user and sysemu par


From: Richard Henderson
Subject: Re: [PATCH v25 14/20] i386: separate fpu_helper into user and sysemu parts
Date: Fri, 26 Feb 2021 10:42:51 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

On 2/26/21 9:51 AM, Claudio Fontana wrote:
> +/* fpu_helper.c */
> +
> +void do_fsave(CPUX86State *env, target_ulong ptr, int data32, uintptr_t ra);
> +void do_frstor(CPUX86State *env, target_ulong ptr, int data32, uintptr_t ra);
> +void do_fxsave(CPUX86State *env, target_ulong ptr, uintptr_t ra);
> +void do_fxrstor(CPUX86State *env, target_ulong ptr, uintptr_t ra);

Is this really worth it?  It means that we unnecessarily expose these functions
in system mode, where they are still not safe.

I had thought about doing something like

#ifdef CONFIG_USER_ONLY
#define SYSEMU_STATIC
#else
#define SYSEMU_STATIC static
#endif

SYSEMU_STATIC void
cpu_x86_fsave(...)
{
  ...
}

void helper_fsave(...)
{
    cpu_x86_fsave(..., GETPC());
}

but I thought the existing example of "do_" functions within that file to be
compelling.  I think small sections of this CONFIG within a file should be
fine, especially where it interacts with other functions like this.

I guess either way,
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~



reply via email to

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