lkml.org 
[lkml]   [2018]   [Nov]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRE: [RFC PATCH v2 1/2] x86/fpu: detect AVX task
    Date
    From: Li, Aubrey
    > Sent: 13 November 2018 13:07
    ...
    > > Isn't there an obvious optimisation to execute VZEROALL during system call
    > > entry?
    >
    > I'm not aware of this in the kernel, maybe you are talking about some
    > optimization in glibc?

    I've not seen it anywhere either.

    IIRC all the xmm and ymm registers are 'caller saved'.
    Since system calls all look like function calls the compiler
    has to assume that the registers can be modified.
    This means that it is safe for the system call code to change them.
    It mustn't leak kernel values out to userspace, but it can zero them.

    So adding VZEROALL on system call entry would save the FP save code having
    to save and restore any of the xmm/ymm registers.
    IIRC the hardware just saves a flag indicating that they are all zero.

    All the registers do need saving if the kernel is entered by an
    interrupt or fault.

    David

    -
    Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
    Registration No: 1397386 (Wales)
    \
     
     \ /
      Last update: 2018-11-13 15:57    [W:2.186 / U:1.420 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site