x86: pkeys: add test for memory protection-key
PATCH v2 1/1 x86: pkeys: add test for memory protection-key
Changes in v2:
* Move pku.flat from config-x86-common.mak to config-x86_64.mak.
The protection-key feature provides an additional mechanism by which IA-32e paging controls access to usermode addresses.
The specification of Protection Keys can be found at SDM (4.6.2, volume 3)
http://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-manual-325462.pdf.
Signed-off-by Huaitong Han <[email protected]>
config/config-x86-common.mak +2 -0
@@ -104,6 +104,8 @@ $(TEST_DIR)/pcid.elf: $(cstart.o) $(TEST_DIR)/pcid.o $(TEST_DIR)/smap.elf: $(cstart.o) $(TEST_DIR)/smap.o +$(TEST_DIR)/pku.elf: $(cstart.o) $(TEST_DIR)/pku.o + $(TEST_DIR)/vmx.elf: $(cstart.o) $(TEST_DIR)/vmx.o $(TEST_DIR)/vmx_tests.o $(TEST_DIR)/debug.elf: $(cstart.o) $(TEST_DIR)/debug.o
config/config-x86_64.mak +1 -0
@@ -11,5 +11,6 @@ tests = $(TEST_DIR)/access.flat $(TEST_DIR)/apic.flat \ tests += $(TEST_DIR)/svm.flat tests += $(TEST_DIR)/vmx.flat tests += $(TEST_DIR)/tscdeadline_latency.flat +tests += $(TEST_DIR)/pku.flat include config/config-x86-common.mak
lib/x86/processor.h +1 -0
@@ -28,6 +28,7 @@#define X86_CR4_PAE 0x00000020#define X86_CR4_PCIDE 0x00020000#define X86_CR4_SMAP 0x00200000 +#define X86_CR4_PKE 0x00400000#define X86_EFLAGS_CF 0x00000001#define X86_EFLAGS_ZF 0x00000040
x86/pku.c new file +162 -0
162 lines not on this page · raw message
x86/unittests.cfg +5 -0
@@ -76,6 +76,11 @@ arch = x86_64 file = smap.flat extra_params = -cpu host +[pku] +file = pku.flat +arch = x86_64 +extra_params = -cpu host + #[asyncpf] #file = asyncpf.flat
Signature · 1 line
2.4.3