linux_dsm_epyc7002/arch
James Hogan 4c881451d3 KVM: MIPS: Don't clobber CP0_Status.UX
On 64-bit kernels, MIPS KVM will clear CP0_Status.UX to prevent the
guest (running in user mode) from accessing the 64-bit memory segments.
However the previous value of CP0_Status.UX is never restored when
exiting from the guest.

If the user process uses 64-bit addressing (the n64 ABI) this can result
in address error exceptions from the kernel if it needs to deliver a
signal before returning to user mode, as the kernel will need to write a
sigframe to high user addresses on the user stack which are disallowed
by CP0_Status.UX=0.

This is fixed by explicitly setting SX and UX again when exiting from
the guest, and explicitly clearing those bits when returning to the
guest. Having the SX and UX bits set when handling guest exits (rather
than only when exiting to userland) will be helpful when we support VZ,
since we shouldn't need to directly read or write guest memory, so it
will be valid for cache management IPIs to access host user addresses.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Radim Krčmář" <rkrcmar@redhat.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Cc: kvm@vger.kernel.org
Cc: <stable@vger.kernel.org> # 4.8.x-
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
2017-01-05 14:56:32 +01:00
..
alpha Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-12-12 19:56:15 -08:00
arc Merge branch 'linus' into locking/core, to pick up fixes 2016-12-11 13:07:13 +01:00
arm xen: features and fixes for 4.10 rc0 2016-12-13 16:07:55 -08:00
arm64 arm64 updates for 4.10: 2016-12-13 16:39:21 -08:00
avr32 Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-12-12 10:48:02 -08:00
blackfin Char/Misc driver patches for 4.10-rc1 2016-12-13 12:11:01 -08:00
c6x locking/core: Provide common cpu_relax_yield() definition 2016-11-17 08:17:36 +01:00
cris Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-12-12 10:48:02 -08:00
frv Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-12-12 10:48:02 -08:00
h8300 locking/core: Provide common cpu_relax_yield() definition 2016-11-17 08:17:36 +01:00
hexagon locking/core: Provide common cpu_relax_yield() definition 2016-11-17 08:17:36 +01:00
ia64 Merge branch 'akpm' (patches from Andrew) 2016-12-12 20:50:02 -08:00
m32r m32r: fix build warning 2016-12-12 18:55:06 -08:00
m68k Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-12-12 10:48:02 -08:00
metag locking/core: Provide common cpu_relax_yield() definition 2016-11-17 08:17:36 +01:00
microblaze Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-12-12 20:23:11 -08:00
mips KVM: MIPS: Don't clobber CP0_Status.UX 2017-01-05 14:56:32 +01:00
mn10300 Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-12-12 10:48:02 -08:00
nios2 Merge branch 'linus' into locking/core, to pick up fixes 2016-11-22 12:37:38 +01:00
openrisc Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-12-12 10:48:02 -08:00
parisc Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-12-12 10:48:02 -08:00
powerpc Small release, the most interesting stuff is x86 nested virt improvements. 2016-12-13 15:47:02 -08:00
s390 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2016-12-13 16:33:33 -08:00
score locking/core: Provide common cpu_relax_yield() definition 2016-11-17 08:17:36 +01:00
sh mm: remove the page size change check in tlb_remove_page 2016-12-12 18:55:07 -08:00
sparc Merge branch 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-12-12 19:25:04 -08:00
tile Merge branch 'locking/urgent' into locking/core, to pick up dependent fixes 2016-12-02 11:13:44 +01:00
um mm: remove the page size change check in tlb_remove_page 2016-12-12 18:55:07 -08:00
unicore32 locking/core: Provide common cpu_relax_yield() definition 2016-11-17 08:17:36 +01:00
x86 KVM: x86: reset MMU on KVM_SET_VCPU_EVENTS 2016-12-24 10:16:04 +01:00
xtensa Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-12-12 10:48:02 -08:00
.gitignore
Kconfig Minor changes to the gcc plugins: 2016-12-13 09:22:21 -08:00