Skip to content
This repository has been archived by the owner on Feb 23, 2021. It is now read-only.

Rneri/umip exceptions #125

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
4d10d5d
core-image-efi-initramfs: remove unneeded components for UMIP
ricardon Dec 5, 2016
865a8a3
live-vm-common: hack: bloat boot partition with a useless file
ricardon Dec 7, 2016
d7aa262
meta-luv: add recipe for User-Mode Instruction Prevention
ricardon Dec 5, 2016
a72a7fe
luv-yocto-efi-test: add kernel selftests for UMIP
ricardon Jan 24, 2017
30e7b0f
meta-luv: add recipe for virtual-8086 mode kernel selftests
ricardon Mar 2, 2017
883c533
umip: umip_test2: correct print size of expected values
ricardon Mar 24, 2017
2034f42
umip: umip_test2: cast shorts to unsigned longs
ricardon Mar 24, 2017
3d01575
umip: remove unused variables
ricardon Mar 24, 2017
fef1137
umip: make main functions return an int
ricardon Mar 24, 2017
5488c56
umip: umip_test: remove unneeded function get_mask
ricardon Mar 24, 2017
1ce8f54
umip: umip_test: utilize %p instead of %lx to print pointers
ricardon Mar 24, 2017
170aeb8
umip: umip_ldt_16: Fix warning about implicit declaration of syscall
ricardon Mar 24, 2017
264eab1
umip: umip_ldt_64: fix printing of uninitialized variable
ricardon Mar 24, 2017
88849df
umip: rework INIT_VAL macro
ricardon Mar 24, 2017
42427f4
umip: umip_test_gen_*: utilize a custom to-hex function
ricardon Mar 24, 2017
f3f0584
umip: umip_ldt_*: remove mmap MAP_32BIT option
ricardon Mar 25, 2017
2bcdd67
umip: umip_ldt_*: do not run tests from main
ricardon Mar 25, 2017
0925de9
umip: normal_pf: relocate page fault tests to its own function
ricardon Mar 28, 2017
645549b
umip: normal_pf: add support for SIGILL signal
ricardon Mar 28, 2017
4215dbc
umip: normal_pf: add tests for the LOCK prefix
ricardon Mar 28, 2017
d6ba694
umip: normal_pf: add tests for SGDT/SIDT with registers as operands
ricardon Mar 28, 2017
eaa827a
umip: normal_pf: test the use of null segment selectors
ricardon Mar 29, 2017
2b0d680
umip: normal_pf: add tests for effective address outside of segment l…
ricardon Mar 30, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions meta-luv/recipes-core/images/core-image-efi-initramfs.bb
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,15 @@ DESCRIPTION = "Small image capable of booting a device and running the suite of
EFI tests."

IMAGE_INSTALL = "\
base-files base-passwd netbase udev sysvinit initscripts keymaps \
kernel-image fwts bash coreutils gawk grep util-linux-agetty \
util-linux-mount util-linux-umount kmod sed tar net-tools \
shadow util-linux procps efivarfs-test \
psplash kernel-efi-warnings linux-firmware kexec \
base-files base-passwd udev sysvinit initscripts keymaps \
kernel-image bash coreutils util-linux-agetty util-linux-mount \
util-linux-umount kmod shadow util-linux procps grep \
"

X86_ADDITIONS = "chipsec python-codecs python-subprocess vmcore-dmesg bits \
kernel-modules"
X86_ADDITIONS = ""

IMAGE_INSTALL_append_qemux86 = "${X86_ADDITIONS}"
IMAGE_INSTALL_append_qemux86-64 = "${X86_ADDITIONS} ndctl"
IMAGE_INSTALL_append_qemux86 = "${X86_ADDITIONS} vm86-test umip-tests"
IMAGE_INSTALL_append_qemux86-64 = "${X86_ADDITIONS} umip-tests lib32-umip-tests"

export IMAGE_BASENAME = "core-image-efi-initramfs"

Expand Down
339 changes: 339 additions & 0 deletions meta-luv/recipes-core/umip/files/COPYING

Large diffs are not rendered by default.

39 changes: 39 additions & 0 deletions meta-luv/recipes-core/umip/files/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
x86_64:
$(CC) -o umip_test2_64 umip_test2.c
$(CC) -o umip_test_64 umip_test.c
$(CC) -o umip_pf_64 normal_pf.c

python umip_test_gen_64.py
$(CC) -c test_umip_ldt_64.c
$(CC) -c umip_ldt_64.c
$(CC) -o umip_ldt_64 test_umip_ldt_64.o umip_ldt_64.o

i586: i686

i686:
# fo 32-bit builds, use -m32 if building independently
$(CC) -o umip_test2_32 umip_test2.c
$(CC) -o umip_test_32 umip_test.c
$(CC) -o umip_pf_32 normal_pf.c

python umip_test_gen_32.py
$(CC) -c test_umip_ldt_32.c
$(CC) -c umip_ldt_32.c
$(CC) -o umip_ldt_32 test_umip_ldt_32.o umip_ldt_32.o

python umip_test_gen_16.py
$(CC) -c test_umip_ldt_16.c
$(CC) -c umip_ldt_16.c
$(CC) -o umip_ldt_16 test_umip_ldt_16.o umip_ldt_16.o


.PHONY: clean
clean:
rm -f *.o
rm -f umip_test
rm -f umip_test2_64
rm -f umip_test2_32
rm -f umip_pf
rm -f umip_ldt_64
rm -f umip_ldt_32
rm -f umip_ldt_16
32 changes: 32 additions & 0 deletions meta-luv/recipes-core/umip/files/UMIP_README
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
A quick guide for UMIP testing

* Use umip_test for a very basic test that exercises the instructions smsw,
str, sidt, sldt and sgdt from protected mode using the global descriptor
table.
* Use test2_32 for a collection of tests that exercises the instructions
str, sldt and smsw for register and memory operands. For registers,
operand sizes are of 16 and 32 bits. Memory operands are always 16-bits
long. Addresses in these tests are computed using only the ModRM
byte. Also, these tests use the normal __USER_DS segment with a base
address of zero.
* DEPRECATED. Now UMIP is made to support only 32-bit builds of the kernel.
Use test2_64 for a collection of tests that exercises the instructions
str, sldt and smsw for register and memory operands. For registers,
operand sizes are of 16, 32 and 64 bits. Memory operands are always
16-bit long. Addresses in these tests are computed using only the ModRM
byte. Also, these tests use the normal __USER_DS segment with a base
address of zero.
* Use umip_pf to verify that a page fault is correctly issued when UMIP-
emulated code tries to write in an invalid memory address of the user
space memory.
* Use umip_ldt to verify all the possible 32-bit address encodings in the
UMIP-emulated instructions. This includes all the ModRM, and SiB displacement
combinations. Furthermore, this test configure a Local Descriptor Table
whose segments have base addresses that are different from the __USER_DS
segment.
* Use umip_ldt_16 to verify all the possible 16-bit address encodings in the
UMIP-emulated instructions. This includes all the ModRM and displacement
combinations. Furthermore, this test configure a Local Descriptor Table
whose segments have base addresses that are different from the __USER_DS
segment. Also, the code segment is configured for 16-bit addresses.

Loading