/kvm-unit-tests/lib/x86/ |
H A D | desc.c | 6 #include "apic-defs.h" 8 /* Boot-related data structures */ 14 .limit = sizeof(boot_idt) - 1, 22 {0xffff, 0, 0, .type_limit_flags = 0xcf9b}, /* flat 32-bit code segment */ 23 {0xffff, 0, 0, .type_limit_flags = 0xcf93}, /* flat 32-bit data segment */ 24 {0xffff, 0, 0, .type_limit_flags = 0xcf1b}, /* flat 32-bit code segment, not present */ 26 {0xffff, 0, 0, .type_limit_flags = 0x8f9b}, /* 16-bit code segment */ 27 {0xffff, 0, 0, .type_limit_flags = 0x8f93}, /* 16-bit data segment */ 28 {0xffff, 0, 0, .type_limit_flags = 0xcffb}, /* 32-bit code segment (user) */ 29 {0xffff, 0, 0, .type_limit_flags = 0xcff3}, /* 32-bit data segment (user) */ [all …]
|
H A D | apic.c | 100 return get_apic_ops()->reg_read(reg); in apic_read() 105 get_apic_ops()->reg_write(reg, val); in apic_write() 117 get_apic_ops()->icr_write(val, dest); in apic_icr_write() 122 return get_apic_ops()->id(); in apic_id() 197 void ioapic_write_redir(unsigned line, ioapic_redir_entry_t e) in ioapic_write_redir() argument 199 ioapic_write_reg(0x10 + line * 2 + 0, ((u32 *)&e)[0]); in ioapic_write_redir() 200 ioapic_write_reg(0x10 + line * 2 + 1, ((u32 *)&e)[1]); in ioapic_write_redir() 205 ioapic_redir_entry_t e; in ioapic_read_redir() local 207 ((u32 *)&e)[0] = ioapic_read_reg(0x10 + line * 2 + 0); in ioapic_read_redir() 208 ((u32 *)&e)[1] = ioapic_read_reg(0x10 + line * 2 + 1); in ioapic_read_redir() [all …]
|
/kvm-unit-tests/ |
H A D | .shellcheckrc | 2 external-sources=true 4 # Optional extras -- https://www.shellcheck.net/wiki/Optional 5 # Possibilities, e.g., - 7 # require-double-brackets 8 # require-variable-braces 9 # add-default-case 11 # Disable SC2004 style? I.e., 14 # ^------------------^ SC2004 (style): $/${} is unnecessary on arithmetic variable… 19 # (e.g., invoking commands with arguments) that break. Should have a 27 # kvm-unit-tests is negligible as it's not shell-heavy in the first
|
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" 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 81 [ -z "$processor" ] && processor=$(get_default_processor $arch) [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 25 ./configure --arc [all...] |
/kvm-unit-tests/x86/efi/ |
H A D | run | 3 set -e 5 if [ $# -eq 0 ]; then 10 if [ ! -f config.mak ]; then 11 echo "run './configure --enable-efi && make' first. See ./configure -h" 18 : "${EFI_TEST:=efi-tests}" 22 if [ ! -f "$EFI_UEFI" ]; then 37 # - Copy .efi file to host dir $EFI_TEST/$EFI_CASE/EFI/BOOT/BOOTX64.EFI 39 # - UEFI firmware by default loads the file EFI/BOOT/BOOTX64.EFI 43 mkdir -p "$EFI_CASE_DIR" 49 # run in UEFI, some test cases, e.g. `x86/pmu.c`, require more free memory. A [all …]
|
/kvm-unit-tests/x86/ |
H A D | ioapic.c | 109 g_78_rip = regs->rip; in ioapic_isr_78() 118 g_66_rip = regs->rip; in ioapic_isr_66() 136 static volatile int g_tmr_79 = -1; 186 g_tmr_79 = -1; in test_ioapic_edge_tmr_smp() 192 while(g_tmr_79 == -1) i++; in test_ioapic_edge_tmr_smp() 211 g_tmr_79 = -1; in test_ioapic_level_tmr_smp() 217 while(g_tmr_79 == -1) i++; in test_ioapic_level_tmr_smp() 381 ioapic_redir_entry_t e; in ioapic_isr_84() local 386 e = ioapic_read_redir(line); in ioapic_isr_84() 387 e.dest_id = 1; in ioapic_isr_84() [all …]
|
H A D | run | 3 if [ -z "$KUT_STANDALONE" ]; then 4 if [ ! -f config.mak ]; then 5 echo "run ./configure && make first. See ./configure -h" 9 source scripts/arch-run.bash 18 if ! ${qemu} -device '?' 2>&1 | grep -F -e \"testdev\" -e \"pc-testdev\" > /dev/null; 25 ${qemu} -device '?' 2>&1 | grep -F "pci-testdev" > /dev/null; 27 pci_testdev="-device pci-testdev" 33 ${qemu} -device '?' 2>&1 | grep -F "pc-testdev" > /dev/null; 35 pc_testdev="-device pc-testdev -device isa-debug-exit,iobase=0xf4,iosize=0x4" 37 pc_testdev="-device testdev,chardev=testlog -chardev file,id=testlog,path=msr.out" [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" \ 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() 229 * occur while running the measured code, e.g. if the host takes IRQs. 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() 281 (MSR_CORE_PERF_FIXED_CTR0 - FIXED_CNT_INDEX)); in event_to_global_idx() [all …]
|
H A D | access.c | 17 #define PT_BASE_ADDR_MASK ((pt_element_t)((((pt_element_t)1 << 36) - 1) & PAGE_MASK)) 31 (((address) >> (12 + ((level)-1) * 9)) & 511) 39 * toggled on every test, e.g. to keep entries in the TLB. 183 /* 5-level paging, 1-based to avoid math. */ 209 for (i = at->pt_levels; i >= min_level; --i) { in walk_va() 326 pt_env->pt_pool_pa = AT_PAGING_STRUCTURES_PHYS; in ac_env_int() 327 pt_env->pt_pool_current = 0; in ac_env_int() 328 pt_env->pt_levels = page_table_levels; in ac_env_int() 336 * Each test needs at most pt_levels-1 structures per virtual address, in ac_test_alloc_pt() 339 assert(pt_env->pt_pool_current < (4 * (pt_env->pt_levels - 1))); in ac_test_alloc_pt() [all …]
|
/kvm-unit-tests/scripts/ |
H A D | runtime.bash | 5 PASS() { echo -ne "\e[32mPASS\e[0m"; } 6 SKIP() { echo -ne "\e[33mSKIP\e[0m"; } 7 FAIL() { echo -ne "\e[31mFAIL\e[0m"; } 12 tail -5 | grep '^SUMMARY: ' | sed 's/^SUMMARY: /(/;s/'"$cr"'\{0,1\}$/)/' 42 read -r -p "Test marked not to be run by default, are you sure (y/N)? " yn 61 if [ -z "$reason" ]; then 70 grep -Fq " $1 " <<< " $2 " 83 local check="${CHECK:-$9}" 85 local timeout="${11:-$TIMEOUT}" # unittests.cfg overrides the default 92 if [ -z "$testname" ]; then [all …]
|
H A D | vmm.bash | 3 # --nodefaults: suppress VM configuration that cannot be disabled (like 6 # --network mode=none: do not create a network device. kvmtool tries to help the 9 # --loglevel=warning: reduce verbosity 10 : "${KVMTOOL_DEFAULT_OPTS:="--nodefaults --network mode=none --loglevel=warning"}" 17 # -------------------- 18 # 0 - Unexpected exit from QEMU (possible signal), or the unittest did 19 # not use debug-exit 20 # 1 - most likely unittest succeeded, or QEMU failed 23 # ------------------- 24 # 0 - Everything succeeded [all …]
|
H A D | arch-run.bash | 6 echo -n "$@" 7 [ "$ENVIRON_DEFAULT" = "yes" ] && echo -n " #" 14 exec {stdout}>&- 28 exec {stdout}>&- 30 if [ $ret -eq 1 ]; then 31 testret=$(grep '^EXIT: ' <<<"$lines" | head -n1 | sed 's/.*STATUS=\([0-9][0-9]*\).*/\1/') 33 if [ $testret -eq 1 ]; then 50 s=${TIMEOUT: -1} 52 TIMEOUT=${TIMEOUT:0:-1} 57 echo "timeout -k 1s --foreground $TIMEOUT" [all …]
|
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 …]
|
H A D | asm-offsets.mak | 2 # asm-offsets adapted from the kernel, see 10 define sed-y 12 /^->/{s:->#\(.*\):/* \1 */:; \ 13 s:^->\([^ ]*\) [\$$#]*\([-0-9]*\) \(.*\):#define \1 \2 /* \3 */:; \ 14 s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; \ 15 s:->::; p;}' 19 $(shell echo $(notdir $(1)) | tr [:lower:]- [:upper:]_) 23 (set -e; \ 31 sed -ne $(sed-y) $<; \ 38 $(CC) $(CFLAGS) -fverbose-asm -S -o $$@ $$< [all …]
|
/kvm-unit-tests/lib/ |
H A D | rand.c | 1 // SPDX-License-Identifier: GPL-2.0-only 4 * Currently uses SHA-256 to scramble the PRNG state. 13 /* Begin SHA-256 related definitions */ 49 return value >> count | value << (32 - count); in rot() 72 enum alphabet { A, B, C, D, E, F, G, H, }; enumerator 82 w[i] = lower_sig1(w[i - 2]) + w[i - 7] + lower_sig0(w[i - 15]) + w[i - 16]; in sha256_chunk() 90 upper_sig1(w_hash[E]) + in sha256_chunk() 91 ch(w_hash[E], w_hash[F], w_hash[G]) + in sha256_chunk() 99 w_hash[F] = w_hash[E]; in sha256_chunk() 100 w_hash[E] = w_hash[D] + t1; in sha256_chunk() [all …]
|
H A D | virtio-mmio.h | 4 * A minimal implementation of virtio-mmio. Adapted from the Linux Kernel. 41 * means the largest queue num for the minimum queue size is 128, i.e. 48 * + align - 1) & ~(align - 1))
|
H A D | alloc_phys.h | 10 * sophisticated allocator, e.g. a page allocator. 35 * <start_addr>-<end_addr> [<USED|FREE>]
|
H A D | util.h | 14 * the unit test on the command line, i.e. it helps parse QEMU 15 * command lines that include something like -append var1=1 var2=2 19 * Returns the offset of the '=', or -1 if no keyval pair is found. 33 "\tLHS: %#018lx - %s - %lu\n" \ 34 "\tRHS: %#018lx - %s - %lu%s" fmt, \
|
/kvm-unit-tests/lib/libfdt/ |
H A D | libfdt_internal.h | 1 /* SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause) */ 5 * libfdt - Flat Device Tree manipulation 10 #define FDT_ALIGN(x, a) (((x) + (a) - 1) & ~((a) - 1)) 91 * This does essentially no checks. Only the latest device-tree 108 * This assumes that the device tree is sane. i.e. header metadata 114 * device trees (e.g. those only partially loaded) can also cause 125 * functions are called with valid parameters, i.e. not trigger 136 * This disables checks for device-tree version and removes all code 149 * leave the tree in a sub-optimal state. 155 * order, i.e. the memory reservation block first, then the structure [all …]
|
/kvm-unit-tests/s390x/snippets/asm/ |
H A D | icpt-loop.S | 1 /* SPDX-License-Identifier: GPL-2.0-only */ 4 * control block intercepts. E.g. when manipulating the PV handles.
|
/kvm-unit-tests/lib/s390x/ |
H A D | fault.h | 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 17 /* Instruction execution prevention, i.e. no-execute, 101 */ 22 /* IEP installed -> ESOP2 installed */ in prot_is_iep()
|
H A D | gs.h | 1 /* SPDX-License-Identifier: GPL-2.0-only */ 29 uint8_t e : 1; member
|
/kvm-unit-tests/s390x/ |
H A D | migration-sck.c | 1 /* SPDX-License-Identifier: GPL-2.0-only */ 42 * sophisticated (e.g. slowly adjust to the host TOD). in test_sck_migration() 49 report_prefix_push("migration-sck"); in main()
|
/kvm-unit-tests/lib/x86/asm/ |
H A D | page.h | 16 #include <asm-generic/page.h> 44 * Without AMD SEV, the default address upper bound is 51 (i.e., pte bit 51 and 46 * bit lower than the c-bit position. 79 #define PGDIR_BITS(lvl) (((lvl) - 1) * PGDIR_WIDTH + PAGE_SHIFT)
|