Re: [PATCH 03/19] x86, mpx: Use new get_xsave_field_ptr()

From: Thomas Gleixner
Date: Tue May 19 2015 - 04:16:09 EST


On Mon, 18 May 2015, Dave Hansen wrote:
> From: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>
>
> The MPX registers (bndcsr/bndcfgu/bndstatus) are not directly
> accessible via normal instructions. They essentially act as
> if they were floating point registers and are saved/restored
> along with those registers.
>
> There are two main paths in the MPX code where we care about
> the contents of these registers:
> 1. #BR (bounds) faults
> 2. the prctl() code where we are setting MPX up
>
> Both of those paths _might_ be called without the FPU having
> been used. That means that 'tsk->thread.fpu.state' might
> never be allocated.
>
> Also, fpu_save_init() is not preempt-safe. It was a bug to
> call it without disabling preemption. The new
> get_xsave_addr() calls unlazy_fpu() instead and properly
> disables preemption.
>
> Signed-off-by: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>

Reviewed-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
--
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/