• Paul Mackerras's avatar
    powerpc: Fix VRSAVE handling · 408a7e08
    Paul Mackerras authored
    Since 2002, the kernel has not saved VRSAVE on exception entry and
    restored it on exit; rather, VRSAVE gets context-switched in _switch.
    This means that when executing in process context in the kernel, the
    userspace VRSAVE value is live in the VRSAVE register.
    
    However, the signal code assumes that current->thread.vrsave holds
    the current VRSAVE value, which is incorrect.  Therefore, this
    commit changes it to use the actual VRSAVE register instead.  (It
    still uses current->thread.vrsave as a temporary location to store
    it in, as __get_user and __put_user can only transfer to/from a
    variable, not an SPR.)
    
    This also modifies the transactional memory code to save and restore
    VRSAVE regardless of whether VMX is enabled in the MSR.  This is
    because accesses to VRSAVE are not controlled by the MSR.VEC bit,
    but can happen at any time.
    Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
    Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
    408a7e08
signal_32.c 43.8 KB