target/i86: implement PKS
commite7e7bdababeefff10736c6adf410c66d2f0d46fe
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 27 Jan 2021 08:28:49 +0000 (27 09:28 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 8 Feb 2021 13:43:55 +0000 (8 14:43 +0100)
tree51083d40362f1a247b4aa24a92611d5d7f534a7d
parent51909241d26fe6fe18a08def93ccc8273f61a8b3
target/i86: implement PKS

Protection Keys for Supervisor-mode pages is a simple extension of
the PKU feature that QEMU already implements.  For supervisor-mode
pages, protection key restrictions come from a new MSR.  The MSR
has no XSAVE state associated to it.

PKS is only respected in long mode.  However, in principle it is
possible to set the MSR even outside long mode, and in fact
even the XSAVE state for PKRU could be set outside long mode
using XRSTOR.  So do not limit the migration subsections for
PKRU and PKRS to long mode.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target/i386/cpu.c
target/i386/cpu.h
target/i386/helper.c
target/i386/machine.c
target/i386/tcg/excp_helper.c
target/i386/tcg/misc_helper.c