OSDN Git Service

powerpc: Implement user_access_save() and user_access_restore()
authorChristophe Leroy <christophe.leroy@c-s.fr>
Fri, 24 Jan 2020 11:54:45 +0000 (11:54 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 28 Jan 2020 12:14:44 +0000 (23:14 +1100)
commit3d7dfd632f9b60cfce069b4da517e6b1a1c3f613
tree02ec1e93d286d7c49dce90a4294f8ddc1edb3af4
parent5cd623333e7cf4e3a334c70529268b65f2a6c2c7
powerpc: Implement user_access_save() and user_access_restore()

Implement user_access_save() and user_access_restore()

On 8xx and radix:
  - On save, get the value of the associated special register then
    prevent user access.
  - On restore, set back the saved value to the associated special
    register.

On book3s/32:
  - On save, get the value stored in current->thread.kuap and prevent
    user access.
  - On restore, regenerate address range from the stored value and
    reopen read/write access for that range.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/54f2f74938006b33c55a416674807b42ef222068.1579866752.git.christophe.leroy@c-s.fr
arch/powerpc/include/asm/book3s/32/kup.h
arch/powerpc/include/asm/book3s/64/kup-radix.h
arch/powerpc/include/asm/kup.h
arch/powerpc/include/asm/nohash/32/kup-8xx.h
arch/powerpc/include/asm/uaccess.h