#
a106b30d |
| 26-Jul-2022 |
Paolo Bonzini <pbonzini@redhat.com> |
x86: add and use *_BIT constants for CR0, CR4, EFLAGS
The "BIT" macro cannot be used in top-level assembly statements (it can be used in functions through the "i" constraint), because old binutils s
x86: add and use *_BIT constants for CR0, CR4, EFLAGS
The "BIT" macro cannot be used in top-level assembly statements (it can be used in functions through the "i" constraint), because old binutils such as the one in CentOS 7 do not support the "1UL" syntax for numerals.
To avoid having to hard-code EFLAGS.AC being bit 18, define the constants for CR0, CR4 and EFLAGS bits in terms of new macros for just the bit number.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
92a6c9b9 |
| 18-Jan-2022 |
Paolo Bonzini <pbonzini@redhat.com> |
Merge remote-tracking branch 'upstream/uefi' into master
Merge UEFI test support into the master branch.
|
#
91abf0b9 |
| 10-Nov-2021 |
Paolo Bonzini <pbonzini@redhat.com> |
Merge branch 'gdt-idt-cleanup' into master
|
#
7bf8144e |
| 31-Oct-2021 |
Zixuan Wang <zixuanwang@google.com> |
x86 UEFI: Convert x86 test cases to PIC
UEFI loads EFI applications to dynamic runtime addresses, so it requires all applications to be compiled as PIC (position independent code). PIC does not allo
x86 UEFI: Convert x86 test cases to PIC
UEFI loads EFI applications to dynamic runtime addresses, so it requires all applications to be compiled as PIC (position independent code). PIC does not allow the usage of compile time absolute address.
This commit converts multiple x86 test cases to PIC so they can compile and run in UEFI:
- x86/cet.efi
- x86/emulator.c: x86/emulator.c depends on lib/x86/usermode.c. But usermode.c contains non-PIC inline assembly code. This commit converts lib/x86/usermode.c and x86/emulator.c to PIC, so x86/emulator.c can compile and run in UEFI.
- x86/vmware_backdoors.c: it depends on lib/x86/usermode.c and now works without modifications
- x86/eventinj.c
- x86/smap.c
- x86/access.c
- x86/umip.c
Signed-off-by: Zixuan Wang <zixuanwang@google.com> Message-Id: <20211031055634.894263-4-zxwang42@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
7e33895d |
| 21-Oct-2021 |
Paolo Bonzini <pbonzini@redhat.com> |
x86: Move 32-bit GDT and TSS to desc.c
Move the GDT and TSS data structures from x86/cstart.S to lib/x86/desc.c, for consistency with the 64-bit version.
Signed-off-by: Paolo Bonzini <pbonzini@redh
x86: Move 32-bit GDT and TSS to desc.c
Move the GDT and TSS data structures from x86/cstart.S to lib/x86/desc.c, for consistency with the 64-bit version.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
35ba8a2d |
| 21-Jan-2021 |
Claudio Imbrenda <imbrenda@linux.ibm.com> |
x86: smap: fix the test to work with new allocator
The test used to simply take a chunk of memory and use it, hoping the memory allocator would never touch it. The memory area used was exactly at th
x86: smap: fix the test to work with new allocator
The test used to simply take a chunk of memory and use it, hoping the memory allocator would never touch it. The memory area used was exactly at the beginning of the 16M boundary.
The new allocator stores metadata information there, and causes the test to fail.
This patch uses the new features of the allocator to properly reserve a memory block. To make things easier and cleaner, the memory area used is now smaller and starts at 8M.
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Reported-by: David Matlack <dmatlack@google.com> Message-Id: <20210121111808.619347-2-imbrenda@linux.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
a299895b |
| 06-Dec-2019 |
Thomas Huth <thuth@redhat.com> |
Switch the order of the parameters in report() and report_xfail()
Commit c09c54c66b1df ("lib: use an argument which doesn't require default argument promotion") fixed a warning that occurs with Clan
Switch the order of the parameters in report() and report_xfail()
Commit c09c54c66b1df ("lib: use an argument which doesn't require default argument promotion") fixed a warning that occurs with Clang, but introduced a regression: If the "pass" parameter is a value which has only set the condition bits in the upper 32 bits of a 64 bit value, the condition is now false since the value is truncated to "unsigned int" so that the upper bits are simply discarded.
We fixed it by reverting the commit, but that of course also means trouble with Clang again. We can not use "bool" if it is the last parameter before the variable argument list. The proper fix is to swap the parameters around and make the format string the last parameter.
This patch (except the changes in lib/libcflat.h and lib/report.c and some rebase conflicts along the way) has basically been created with following coccinelle script (with some additional manual tweaking of long and disabled lines afterwards):
@@ expression fmt; expression pass; expression list args; @@ report( -fmt, pass +pass, fmt , args);
@@ expression fmt; expression pass; expression list args; @@ report_xfail( -fmt, xfail, pass +xfail, pass, fmt , args);
Tested-by: Andrew Jones <drjones@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com> Message-Id: <20191206113102.14914-1-thuth@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
5771d942 |
| 25-Oct-2019 |
Chenyi Qiang <chenyi.qiang@intel.com> |
x86: smap: Use correct reg to pass a parameter
The first parameter is passed using rdi in x86_64.
Signed-off-by: Chenyi Qiang <chenyi.qiang@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.
x86: smap: Use correct reg to pass a parameter
The first parameter is passed using rdi in x86_64.
Signed-off-by: Chenyi Qiang <chenyi.qiang@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
badc98ca |
| 30-Jul-2019 |
Krish Sadhukhan <krish.sadhukhan@oracle.com> |
kvm-unit-test: x86: Replace cpuid/cpuid_indexed calls with this_cpu_has()
Signed-off-by: Krish Sadhukhan <krish.sadhukhan@oracle.com> Reviewed-by: Karl Heubaum <karl.heubaum@oracle.com> Signed-off-b
kvm-unit-test: x86: Replace cpuid/cpuid_indexed calls with this_cpu_has()
Signed-off-by: Krish Sadhukhan <krish.sadhukhan@oracle.com> Reviewed-by: Karl Heubaum <karl.heubaum@oracle.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
06846df5 |
| 28-Sep-2018 |
Thomas Huth <thuth@redhat.com> |
x86: Add missing prototypes and mark more local functions as static
To be able to compile with -Wmissing-prototypes, we also need prototypes for functions that are called from assembler code. We put
x86: Add missing prototypes and mark more local functions as static
To be able to compile with -Wmissing-prototypes, we also need prototypes for functions that are called from assembler code. We put the prototypes into the .c files and not into header files here, since these functions are not called from other .c files. While we're at it, also mark some more functions as static in these files which are only used locally.
Signed-off-by: Thomas Huth <thuth@redhat.com> Message-Id: <1538123582-17442-3-git-send-email-thuth@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
d10d16e1 |
| 06-Jun-2016 |
Alexander Gordeev <agordeev@redhat.com> |
x86: Cleanup PT_*_MASK flags
Cc: Andrew Jones <drjones@redhat.com> Cc: Thomas Huth <thuth@redhat.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Radim Krčmář <rkrcmar@redhat.com> Reviewed-by: Andre
x86: Cleanup PT_*_MASK flags
Cc: Andrew Jones <drjones@redhat.com> Cc: Thomas Huth <thuth@redhat.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Radim Krčmář <rkrcmar@redhat.com> Reviewed-by: Andrew Jones <drjones@redhat.com> Signed-off-by: Alexander Gordeev <agordeev@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
32b9603c |
| 11-May-2016 |
Radim Krčmář <rkrcmar@redhat.com> |
x86/*: report skipped tests
Some care to consistency was given. A test that ended in report_summary without any report is considered as skipped; only x86/hyperv_synic used report_skip resulting in
x86/*: report skipped tests
Some care to consistency was given. A test that ended in report_summary without any report is considered as skipped; only x86/hyperv_synic used report_skip resulting in
SKIP hyperv_synic (1 tests, 1 skipped)
instead of the more consistent
SKIP hyperv_syinc (0 tests)
Drew pointed out that tscdeadline_latency.c doesn't report skipped tests. tscdeadline_latency needs complete refactoring and is not run with ./run_tests, so I ignored it.
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com> Message-Id: <1462983171-4208-3-git-send-email-rkrcmar@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
ff
show more ...
|
#
a2b7c499 |
| 02-Mar-2016 |
Andrew Jones <drjones@redhat.com> |
x86: clean up exit use, use abort
Change all exit()'s for the purpose of aborts to abort()'s. This changes a handful of exit(-1)'s, which resulted in a 255 exit status (putting the status in signal
x86: clean up exit use, use abort
Change all exit()'s for the purpose of aborts to abort()'s. This changes a handful of exit(-1)'s, which resulted in a 255 exit status (putting the status in signal territory) to a 127 exit status (just below signal territory), as 127 is defined as the unittest abort. Yes, stdlib would use SIGABRT resulting in 134, but, well, we do what we can...
Signed-off-by: Andrew Jones <drjones@redhat.com> Reviewed-by: Radim KrÄmář <rkrcmar@redhat.com> Message-Id: <1456939982-13178-2-git-send-email-drjones@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
7488d290 |
| 12-Nov-2015 |
Paolo Bonzini <pbonzini@redhat.com> |
KVM: x86: a few more x86-specific functions
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
#
682045d3 |
| 07-May-2015 |
Paolo Bonzini <pbonzini@redhat.com> |
x86: smap: Undo changes at end of check_smap_nowp
This makes it simpler to add more tests in the future.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
#
fd0898ba |
| 07-May-2015 |
Xiao Guangrong <guangrong.xiao@linux.intel.com> |
x86: smap: check smap and !cr0.wp
This test case is used to produce the bug that:
KVM may turn a user page to a kernel page when kernel writes a readonly user page if CR0.WP = 1. This shadow page e
x86: smap: check smap and !cr0.wp
This test case is used to produce the bug that:
KVM may turn a user page to a kernel page when kernel writes a readonly user page if CR0.WP = 1. This shadow page entry will be reused after SMAP is enabled so that kernel is allowed to access this user page
Signed-off-by: Xiao Guangrong <guangrong.xiao@linux.intel.com> Message-Id: <1430988242-7186-1-git-send-email-guangrong.xiao@linux.intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
761db0bd |
| 11-Jun-2014 |
Andrew Jones <drjones@redhat.com> |
clean root dir of all x86-ness
Remove all references to x86 from the root dir (except from in configure). Also remove references from the root dir README by moving that documentation to the x86/REA
clean root dir of all x86-ness
Remove all references to x86 from the root dir (except from in configure). Also remove references from the root dir README by moving that documentation to the x86/README, and touch up the READMEs at the same time.
Signed-off-by: Andrew Jones <drjones@redhat.com> Acked-by: Christoffer Dall <christoffer.dall@linaro.org> [Drop --test-dir, adjust includes. - Paolo] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
fa6318d1 |
| 03-Apr-2014 |
Paolo Bonzini <pbonzini@redhat.com> |
x86: smap: new testcase
Test various combinations of the AC bit and reading/writing into user pages at CPL=0.
One notable missing test is implicit kernel reads and writes (e.g. reading the IDT/GDT/
x86: smap: new testcase
Test various combinations of the AC bit and reading/writing into user pages at CPL=0.
One notable missing test is implicit kernel reads and writes (e.g. reading the IDT/GDT/LDT/TSS). The interesting part of this is that AC must be ignored in ring 3; the processor always behaves as if AC=0. I skipped this because QEMU doesn't emulate this correctly, and because right now there's no kvm-unit-tests infrastructure to run code in ring 3 at all.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|