/kvm-unit-tests/s390x/ |
H A D | intercept.c | 1 /* SPDX-License-Identifier: GPL-2.0-only */ 3 * Interception tests - for s390x CPU instruction that cause a VM exit 12 #include <asm/asm-offsets.h> 24 /* Test the STORE PREFIX instruction */ 27 uint32_t old_prefix = -1U, tst_prefix = -1U; in test_stpx() 30 /* Can we successfully change the prefix? */ in test_stpx() 35 report(old_prefix == 0 && tst_prefix == new_prefix, "store prefix"); in test_stpx() 48 asm volatile(" stpx 0(%0) " : : "a"(-8L)); in test_stpx() 52 /* Test the SET PREFIX instruction */ 61 * Temporarily change the prefix page to our buffer, and store in test_spx() [all …]
|
H A D | smp.c | 1 /* SPDX-License-Identifier: GPL-2.0-only */ 11 #include <asm/asm-offsets.h> 15 #include <asm-generic/barrier.h> 23 #define INVALID_CPU_ADDRESS -4711 47 char name[20]; member 71 cc = sigp(INVALID_CPU_ADDRESS, c->order, 0, &status); in test_invalid() 72 report(cc == 3, "%s", c->message); in test_invalid() 77 cc = smp_sigp(1, c->order, 0, &status); in test_invalid() 78 report(cc == 1, "%s", c->message); in test_invalid() 113 struct lowcore *lc = cpu->lowcore; in test_restart() [all …]
|
H A D | exittime.c | 1 /* SPDX-License-Identifier: GPL-2.0-only */ 124 unsigned int prefix; in test_stpx() local 127 "stpx %[prefix]" in test_stpx() 128 : [prefix] "=Q" (prefix) in test_stpx() 171 sccb->h.length = 8; in test_servc() 181 const char *name; member 184 * When non-null, will be called once before running the test loop. 237 uint64_t total = tod_to_ns(normalize_iters(test_result->total, test->iters)), in report_iteration_result() 238 best = tod_to_ns(normalize_iters(test_result->best, test->iters)), in report_iteration_result() 239 average = tod_to_ns(normalize_iters(test_result->average, test->iters)), in report_iteration_result() [all …]
|
/kvm-unit-tests/ |
H A D | configure | 3 if [ -z "${BASH_VERSINFO[0]}" ] || [ "${BASH_VERSINFO[0]}" -lt 4 ] ; then 4 echo "Error: Bash version 4 or newer is required for the kvm-unit-tests" 15 echo "cortex-a15" 18 echo "cortex-a57" 33 echo "cortex-a15" 42 prefix=/usr/local 51 arch=$(uname -m | sed -e 's/i.86/i386/;s/arm64/aarch64/;s/arm.*/arm/;s/ppc64.*/ppc64/') 72 # Enable -Werror by default for git repositories only (i.e. developer builds) 73 if [ -e "$srcdir"/.git ]; then 74 werror=-Werror [all …]
|
H A D | README | 1 # Welcome to kvm-unit-tests 3 See http://www.linux-kvm.org/page/KVM-unit-tests for a high-level 18 NOTE: GCC cross-compiler is required for [build on macOS](README.macOS.md). 20 ## Cross-compiling 22 A cross compiler may be configured by specifying a cross prefix. For example, 25 ./configure --arch=arm64 --cross-prefix=aarch64-linux-gnu- 32 ./configure --cc=clang 35 clang may also be used with cross binutils when cross-compiling. For example, 38 ./configure --arch=riscv64 --cc=clang --cflags='--target=riscv64' \ 39 --cross-prefix=riscv64-linux-gnu- [all …]
|
H A D | README.md | 1 # Welcome to kvm-unit-tests 3 See http://www.linux-kvm.org/page/KVM-unit-tests for a high-level 18 NOTE: GCC cross-compiler is required for [build on macOS](README.macOS.md). 20 ## Cross-compiling 22 A cross compiler may be configured by specifying a cross prefix. For example, 25 ./configure --arch=arm64 --cross-prefix=aarch64-linux-gnu- 32 ./configure --cc=clang 35 clang may also be used with cross binutils when cross-compiling. For example, 38 ./configure --arch=riscv64 --cc=clang --cflags='--target=riscv64' \ 39 --cross-prefix=riscv64-linux-gnu- [all …]
|
H A D | Makefile | 4 $(error run ./configure first. See ./configure -h) 14 libdirs-get = $(shell [ -d "lib/$(1)" ] && echo "lib/$(1) lib/$(1)/asm") 15 ARCH_LIBDIRS := $(call libdirs-get,$(ARCH_LIBDIR)) $(call libdirs-get,$(TEST_DIR)) 18 DESTDIR := $(PREFIX)/share/kvm-unit-tests/ 22 # cc-option 23 # Usage: OP_CFLAGS+=$(call cc-option, -falign-functions=0, -malign-functions=0) 24 cc-option = $(shell if $(CC) $(CFLAGS) -Werror $(1) -S -o /dev/null -xc /dev/null \ 46 EFI_CFLAGS := -DCONFIG_EFI -DCONFIG_RELOC 48 # - GNU-EFI/Makefile.defaults 49 # - GNU-EFI/apps/Makefile [all …]
|
/kvm-unit-tests/x86/ |
H A D | la57.c | 142 * breaks the wrmsr_safe macro (it uses GS for per-CPU data). in test_register_write() 184 /* 57-canonical value will work on CPUs that *support* LA57 */ in test_register() 194 #define TEST_REGISTER(name, force_emulation) \ argument 195 test_register(#name, TEST_REGISTER_ ##name, force_emulation) 217 "Tested invpcid type 0 with 0x%lx value - %s", in __test_invpcid() 260 * on Intel, to support cross-vendor migration. This includes nested in __test_canonical_checks() 287 report_skip("Skipping MSR_IA32_DS_AREA - PEBS not supported"); in __test_canonical_checks() 302 report_skip("Skipping MSR_IA32_RTIT_ADDR* - Intel PT is not supported"); in __test_canonical_checks() 309 report_skip("Skipping INVPCID - not supported"); in __test_canonical_checks() 319 report_skip("Force emulation prefix not enabled"); in test_canonical_checks() [all …]
|
H A D | pmu.c | 5 #include "x86/apic-defs.h" 27 "add $(2f-1b), %%eax\n\t" \ 38 "add $(2f-1b), %%rax\n\t" \ 74 * KVM_FEP is a magic prefix that forces emulation so 111 const char *name; member 196 u32 eax = cntrs & (BIT_ULL(32) - 1); in __precise_loop() 228 * as the counts will vary depending on how many asynchronous VM-Exits in adjust_events_range() 273 return evt->ctr < MSR_CORE_PERF_FIXED_CTR0 || in is_gp() 274 evt->ctr >= MSR_IA32_PMC0; in is_gp() 280 return cnt->ctr - (is_gp(cnt) ? pmu.msr_gp_counter_base : in event_to_global_idx() [all …]
|
/kvm-unit-tests/lib/ |
H A D | libcflat.h | 13 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 36 #define __ALIGN(x, a) __ALIGN_MASK(x, (typeof(x))(a) - 1) 38 #define ALIGN_DOWN(x, a) __ALIGN((x) - ((a) - 1), (a)) 39 #define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0) 84 extern char *getenv(const char *name); 97 extern void report_prefix_push(const char *prefix); 128 const typeof( ((type *)0)->member ) *__mptr = (ptr); \ 129 (type *)( (char *)__mptr - offsetof(type,member) );})
|
/kvm-unit-tests/scripts/ |
H A D | checkpatch.pl | 2 # SPDX-License-Identifier: GPL-2.0 7 # (c) 2008-2010 Andy Whitcroft <apw@canonical.com> 8 # (c) 2010-2018 Joe Perches <joe@perches.com> 73 my $docsfile = "$D/../Documentation/dev-tools/checkpatch.rst"; 76 my $allow_c99_comments = 1; # Can be overridden by --ignore C99_COMMENT_TOLERANCE 78 my $git_command ='export LANGUAGE=en_US.UTF-8; git'; 92 -q, --quiet quiet 93 -v, --verbose verbose mode 94 --no-tree run without a kernel tree 95 --no-signoff do not check for 'Signed-off-by' line [all …]
|
/kvm-unit-tests/arm/ |
H A D | pmu.c | 4 * Copyright (c) 2015-2016, The Linux Foundation. All rights reserved. 75 #define PRE_OVERFLOW2_32 (ALL_SET_32 - COUNT - MARGIN) 76 #define PRE_OVERFLOW2_64 (ALL_SET_64 - COUNT - MARGIN) 144 /* PMCCFILTR is an obsolete name for PMXEVTYPER31 in ARMv7 */ 260 * The low 32-bits of PMCEID0/1 respectively describe in is_event_supported() 261 * event support for events 0-31/32-63. Their High in is_event_supported() 262 * 32-bits describe support for extended events in is_event_supported() 451 * Bits [63:0] are always incremented for 64-bit counters, in pmevcntr_mask() 456 * pseudo-code in the ARM ARM DDI 0487I.a, section J1.1.1. in pmevcntr_mask() 486 implemented_counter_mask = BIT(pmu.nb_implemented_counters) - 1; in test_basic_event_count() [all …]
|