Re: [PATCH 1/6] signal x86: Propage RF EFLAGS bit throught thesignal restore call

From: Frederic Weisbecker
Date: Mon Apr 15 2013 - 21:05:49 EST


On Sun, Mar 10, 2013 at 07:41:06PM +0100, Jiri Olsa wrote:
> Adding RF EFLAGS bit to be restored on return from signal from
> the original register context before the signal was entered.
>
> This will prevent the RF flag to disappear when returning
> from exception due to the signal handler being executed.

So that happens if, say, we get a breakpoint exception and then we
run a signal handler before returning to the ip that triggered the
breakpoint?

[...]
> --- a/arch/x86/include/asm/sighandling.h
> +++ b/arch/x86/include/asm/sighandling.h
> @@ -7,10 +7,10 @@
>
> #include <asm/processor-flags.h>
>
> -#define __FIX_EFLAGS (X86_EFLAGS_AC | X86_EFLAGS_OF | \
> +#define FIX_EFLAGS (X86_EFLAGS_AC | X86_EFLAGS_OF | \
> X86_EFLAGS_DF | X86_EFLAGS_TF | X86_EFLAGS_SF | \
> X86_EFLAGS_ZF | X86_EFLAGS_AF | X86_EFLAGS_PF | \
> - X86_EFLAGS_CF)
> + X86_EFLAGS_CF | X86_EFLAGS_RF)
>
> void signal_fault(struct pt_regs *regs, void __user *frame, char *where);
>
> diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c
> index 6956299..9df4c0b 100644
> --- a/arch/x86/kernel/signal.c
> +++ b/arch/x86/kernel/signal.c
> @@ -43,12 +43,6 @@
>
> #include <asm/sigframe.h>
>
> -#ifdef CONFIG_X86_32
> -# define FIX_EFLAGS (__FIX_EFLAGS | X86_EFLAGS_RF)
> -#else
> -# define FIX_EFLAGS __FIX_EFLAGS
> -#endif

So, I'm a bit confused here. Why was that only hapenning in X86_64?

> -
> #define COPY(x) do { \
> get_user_ex(regs->x, &sc->x); \
> } while (0)
> --
> 1.7.11.7
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/