/kvm-unit-tests/lib/ |
H A D | alloc_page.h | 29 * Initializes a memory area. 41 * Allocate aligned memory with the specified flags. 48 * Allocate aligned memory from any area and with default flags. 82 * Frees a memory block allocated with any of the memalign_pages* or 107 * Reserves the specified physical memory range if possible. 108 * If the specified range cannot be reserved in its entirety, no action is 109 * performed and -1 is returned. 111 * Returns 0 in case of success, -1 otherwise. 116 * Frees a reserved memory range that had been reserved with 118 * The memory range does not need to match a previous allocation
|
/kvm-unit-tests/lib/s390x/ |
H A D | malloc_io.h | 1 /* SPDX-License-Identifier: GPL-2.0-only */ 16 * absolute memory in the DMA31 region large enough to contain size 20 * If all the pages for the specified size cannot be reserved, 37 * Frees a previously memory space allocated by alloc_io_mem.
|
H A D | css.h | 1 /* SPDX-License-Identifier: GPL-2.0-only */ 59 uint32_t reserved[4]; member 100 #define PMCW_CHANNEL_TYPE(pmcw) (pmcw->flags2 >> 21) 121 uint8_t reserved; /* always 0x'FF' */ member 127 uint8_t padding[256 - 8]; /* Extended part */ 143 : "cc", "memory"); in ssch() 285 : "cc", "memory"); in stcrw() 333 uint8_t reserved[9]; member 384 #define css_test_general_feature(bit) test_bit_inv(bit, chsc_scsc->general_char) 385 #define css_test_chsc_feature(bit) test_bit_inv(bit, chsc_scsc->chsc_char)
|
/kvm-unit-tests/s390x/ |
H A D | diag258.c | 1 /* SPDX-License-Identifier: GPL-2.0-only */ 12 #include <asm-generic/barrier.h> 13 #include <asm/asm-offsets.h> 34 u64 reserved; member 47 .reserved = __PF_RES_FIELD 58 .reserved = 0 63 int rc = -1; in diag258() 96 * for the refbk that is outside of the bounds of our (guest-)physical 107 /* Set up virtual memory and allocate a physical page for storing the refbk */ in test_refbk_real() 111 /* Map refblk page outside of physical memory identity mapping */ in test_refbk_real() [all …]
|
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> 27 uint32_t old_prefix = -1U, tst_prefix = -1U; in test_stpx() 48 asm volatile(" stpx 0(%0) " : : "a"(-8L)); in test_stpx() 77 report_prefix_push("operand outside memory"); in test_spx() 79 asm volatile(" spx 0(%0) " : : "a"(-8L)); in test_spx() 83 report_prefix_push("new prefix outside memory"); in test_spx() 86 if (!host_is_tcg() && (get_ram_size() - new_prefix < 2 * PAGE_SIZE)) { in test_spx() 125 asm volatile ("stap 0(%0)\n" : : "a"(-8L)); in test_stap() [all …]
|
H A D | mvpg.c | 1 /* SPDX-License-Identifier: GPL-2.0-only */ 11 #include <asm/asm-offsets.h> 27 /* How much memory to allocate for the test */ 38 /* Keep track of fresh memory */ 52 : "memory", "cc"); in mvpg() 92 return *(uint8_t *)(lowcore.pgm_old_psw.addr - 1) == lowcore.op_acc_id; in check_oai() 103 * state, and even then, only if the move-page-and-set-key facility in test_exceptions() 124 * reserved bits, should result in a specification exception in test_exceptions() 138 /* Operands outside memory result in addressing exceptions, as usual */ in test_exceptions() 143 report(clear_pgm_int() == expected, "Second operand outside memory"); in test_exceptions() [all …]
|
H A D | css.c | 1 /* SPDX-License-Identifier: GPL-2.0-only */ 21 #define DEFAULT_CU_TYPE 0x3832 /* virtio-ccw */ 56 * Pre-requisites: 57 * - We need the test device as the first recognized 108 len = sizeof(*senseid) - ret; in test_sense() 116 if (senseid->reserved != 0xff) { in test_sense() 117 report_fail("transferred garbage: 0x%02x", senseid->reserved); in test_sense() 123 report_info("reserved 0x%02x cu_type 0x%04x cu_model 0x%02x dev_type 0x%04x dev_model 0x%02x", in test_sense() 124 senseid->reserved, senseid->cu_type, senseid->cu_model, in test_sense() 125 senseid->dev_type, senseid->dev_model); in test_sense() [all …]
|
H A D | skey.c | 1 /* SPDX-License-Identifier: GPL-2.0-only */ 12 #include <asm/asm-offsets.h> 26 void *addr = (void *)0x10000 - 2 * PAGE_SIZE; in test_set_mb() 37 ret1.val = get_storage_key(end - PAGE_SIZE) & (SKEY_ACC | SKEY_FP); in test_set_mb() 38 ret2.val = get_storage_key(end - PAGE_SIZE * 2) & (SKEY_ACC | SKEY_FP); in test_set_mb() 64 * CH are set by the machine for memory references and changes in test_set() 99 void *inv_addr = (void *)-1ull; in test_invalid_address() 142 report_prefix_push("fetch-protection override"); in test_test_protection() 155 "storage-protection override: no protection"); in test_test_protection() 194 /* ESOP-2: no need to check facility */ in check_key_prot_exc() [all …]
|
/kvm-unit-tests/x86/ |
H A D | hyperv.h | 94 /* Memory access messages. */ 109 /* Platform-specific processor intercept messages. */ 123 uint8_t reserved:7; member 131 uint32_t reserved:8; member 147 uint8_t reserved[2]; member 157 uint32_t reserved; member 194 u32 reserved; member
|
H A D | vmx_tests.c | 28 * are legal in DR6 are reserved in vmcs.GUEST_PENDING_DEBUG. And if any data 51 int pos = -1; in ffs() 156 if (((rdtsc() - tsc_val) >> preempt_scale) in preemption_timer_main() 183 report(((rdtsc() - tsc_val) >> preempt_scale) >= preempt_val, in preemption_timer_exit_handler() 184 "busy-wait for preemption timer"); in preemption_timer_exit_handler() 191 report(((rdtsc() - tsc_val) >> preempt_scale) >= preempt_val in preemption_timer_exit_handler() 228 report_fail("busy-wait for preemption timer"); in preemption_timer_exit_handler() 510 :"rsi", "memory", "cc"); in cr_shadowing_main() 518 :"rsi", "memory", "cc"); in cr_shadowing_main() 526 :"rsi", "memory", "cc"); in cr_shadowing_main() [all …]
|
H A D | svm_tests.c | 46 return vmcb->control.exit_code == SVM_EXIT_VMMCALL; in null_check() 51 vmcb->control.intercept &= ~(1ULL << INTERCEPT_VMRUN); in prepare_no_vmrun_int() 56 return vmcb->control.exit_code == SVM_EXIT_ERR; in check_no_vmrun_int() 66 return vmcb->control.exit_code == SVM_EXIT_VMRUN; in check_vmrun() 72 vmcb->control.intercept |= 1 << INTERCEPT_RSM; in prepare_rsm_intercept() 73 vmcb->control.intercept_exceptions |= (1ULL << UD_VECTOR); in prepare_rsm_intercept() 78 asm volatile ("rsm" : : : "memory"); in test_rsm_intercept() 90 if (vmcb->control.exit_code != SVM_EXIT_RSM) { in finished_rsm_intercept() 92 vmcb->control.exit_code); in finished_rsm_intercept() 95 vmcb->control.intercept &= ~(1 << INTERCEPT_RSM); in finished_rsm_intercept() [all …]
|
/kvm-unit-tests/lib/linux/ |
H A D | pci_regs.h | 6 * Copyright 1997--1999 Martin Mares <mj@ucw.cz> 34 #define PCI_COMMAND_MEMORY 0x2 /* Enable response in Memory space */ 37 #define PCI_COMMAND_INVALIDATE 0x10 /* Use memory write and invalidate */ 42 #define PCI_COMMAND_FAST_BACK 0x200 /* Enable back-to-back writes */ 50 #define PCI_STATUS_FAST_BACK 0x80 /* Accept fast-back to back */ 80 * Base addresses specify locations in memory or I/O space. 91 #define PCI_BASE_ADDRESS_SPACE 0x01 /* 0 = memory, 1 = I/O */ 101 /* bit 1 is reserved if address_space = 1 */ 107 #define PCI_ROM_ADDRESS 0x30 /* Bits 31..11 are address, 10..1 reserved */ 113 /* 0x35-0x3b are reserved */ [all …]
|
H A D | efi.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 17 #define EFI_LOAD_ERROR ( 1 | (1UL << (BITS_PER_LONG-1))) 18 #define EFI_INVALID_PARAMETER ( 2 | (1UL << (BITS_PER_LONG-1))) 19 #define EFI_UNSUPPORTED ( 3 | (1UL << (BITS_PER_LONG-1))) 20 #define EFI_BAD_BUFFER_SIZE ( 4 | (1UL << (BITS_PER_LONG-1))) 21 #define EFI_BUFFER_TOO_SMALL ( 5 | (1UL << (BITS_PER_LONG-1))) 22 #define EFI_NOT_READY ( 6 | (1UL << (BITS_PER_LONG-1))) 23 #define EFI_DEVICE_ERROR ( 7 | (1UL << (BITS_PER_LONG-1))) 24 #define EFI_WRITE_PROTECTED ( 8 | (1UL << (BITS_PER_LONG-1))) 25 #define EFI_OUT_OF_RESOURCES ( 9 | (1UL << (BITS_PER_LONG-1))) [all …]
|
/kvm-unit-tests/lib/s390x/asm/ |
H A D | arch_def.h | 1 /* SPDX-License-Identifier: GPL-2.0-only */ 13 uint64_t reserved; member 14 /* GRs 2 - 5 */ 16 /* GRs 6 - 15 */ 24 uint64_t reserved; member 29 /* GRs 2 - 15 */ 105 #define CTL0_TRANSACT_EX_CTL (63 - 8) 106 #define CTL0_LOW_ADDR_PROT (63 - 35) 107 #define CTL0_EDAT (63 - 40) 108 #define CTL0_FETCH_PROTECTION_OVERRIDE (63 - 38) [all …]
|
H A D | uv.h | 109 u8 reserved88[158 - 136]; /* 0x0088 */ 112 uint8_t reserveda8[224 - 168]; /* 0x00a8 */ 115 uint8_t reservedf0[256 - 240]; /* 0x00f0 */ 141 u64 reserved[4]; member 229 : "memory", "cc"); in uv_call_once() 233 ((struct uv_cb_header *)r2)->cmd, in uv_call_once() 234 ((struct uv_cb_header *)r2)->rc, in uv_call_once() 235 ((struct uv_cb_header *)r2)->rrc); in uv_call_once() 245 * CC 2 and 3 tell us to re-execute because the instruction in uv_call()
|
/kvm-unit-tests/lib/x86/ |
H A D | processor.h | 18 * Get a linear address by combining @addr with a non-canonical pattern in the 148 /* RESERVED 0 (3) */ 151 /* RESERVED 0 (5) */ 167 /* RESERVED 0 (15) */ 239 * Each X86_FEATURE_XXX definition is 64-bit and contains the following 240 * CPUID meta-data: 343 asm volatile (".byte 0x0f, 0x01, 0xca" : : : "memory"); in clac() 348 asm volatile (".byte 0x0f, 0x01, 0xcb" : : : "memory"); in stac() 408 asm volatile ("mov %0, %%ds" : : "rm"(val) : "memory"); in write_ds() 413 asm volatile ("mov %0, %%es" : : "rm"(val) : "memory"); in write_es() [all …]
|
H A D | setup.c | 15 #include "apic-defs.h" 32 u32 reserved[4]; /* 28-43 */ member 35 u32 reserved0[3]; /* 52-63 */ 37 u32 reserved1[5]; /* 68-87 */ 71 /* Memory above 4 GB is only supported on 64-bit systems. */ in find_highmem() 72 if (!(bootinfo->flags & 64)) in find_highmem() 75 u64 upper_end = bootinfo->mem_upper * 1024ull; in find_highmem() 80 max_end = -1ull; in find_highmem() 83 uintptr_t mmap = bootinfo->mmap_addr; in find_highmem() 84 while (mmap < bootinfo->mmap_addr + bootinfo->mmap_length) { in find_highmem() [all …]
|
H A D | intel-iommu.c | 13 #include "intel-iommu.h" 20 * VT-d in QEMU currently only support 39 bits address width, which is 21 * 3-level translation. 62 uint32_t __reserved_0:3; /* Reserved 0 */ 65 uint32_t __reserved_1:8; /* Reserved 1 */ 67 uint16_t source_id:16; /* Source-ID */ 68 uint64_t sid_q:2; /* Source-ID Qualifier */ 69 uint64_t sid_vtype:2; /* Source-ID Validation Type */ 70 uint64_t __reserved_2:44; /* Reserved 2 */ 101 /* One-shot bits are taking effect immediately */ in vtd_gcmd_or() [all …]
|
H A D | desc.h | 5 * selector 32-bit 64-bit 7 * 0x08 ring-0 code segment (32-bit) ring-0 code segment (64-bit) 8 * 0x10 ring-0 data segment (32-bit) ring-0 data segment (32/64-bit) 9 * 0x18 ring-0 code segment (P=0) ring-0 code segment (64-bit, P=0) 10 * 0x20 intr_alt_stack TSS ring-0 code segment (32-bit) 11 * 0x28 ring-0 code segment (16-bit) same 12 * 0x30 ring-0 data segment (16-bit) same 13 * 0x38 (0x3b) ring-3 code segment (32-bit) same 14 * 0x40 (0x43) ring-3 data segment (32-bit) ring-3 data segment (32/64-bit) 15 * 0x48 (0x4b) **unused** ring-3 code segment (64-bit) [all …]
|
/kvm-unit-tests/lib/riscv/ |
H A D | setup.c | 1 // SPDX-License-Identifier: GPL-2.0-only 16 #include <on-cpus.h> 89 phys_addr_t freemem_end = freemem->end; in mem_allocator_init() 96 * The assert below is mostly checking that the free memory doesn't in mem_allocator_init() 97 * start in the 3G-4G range, which is reserved for virtual addresses, in mem_allocator_init() 98 * but it also confirms that there is some free memory (the amount in mem_allocator_init() 109 rest->flags = MR_F_UNUSED; in mem_allocator_init() 111 assert(freemem_end - freemem_start >= SZ_1M * 16); in mem_allocator_init() 120 phys_alloc_init(freemem_start, freemem_end - freemem_start); in mem_allocator_init() 139 code->flags |= MR_F_CODE; in mem_init() [all …]
|
/kvm-unit-tests/arm/ |
H A D | mte.c | 1 /* SPDX-License-Identifier: GPL-2.0 */ 4 * All rights reserved. 12 #include <asm/pgtable-hwdef.h> 29 #define MTE_GRANULE_MASK (~(MTE_GRANULE_SIZE - 1)) 66 : "r" (addr), "r" (res) : "memory"); in mem_read() 76 : "memory"); in mem_write() 88 report_info("Unexpected non-zero FnV"); in mte_fault_handler() 100 regs->pc += 8; in mte_fault_handler() 161 asm volatile(".arch armv8.5-a+memtag\n" in mte_set_tag() 165 : "memory"); in mte_set_tag() [all …]
|
H A D | fpu.c | 1 /* SPDX-License-Identifier: GPL-2.0 */ 4 * All rights reserved. 15 #define FPU_RESULT_PASS (-1U) 69 "v30", "v31", "memory"); \ 103 "v30", "v31", "memory"); \ 154 "z30", "z31", "memory"); \ 204 "z30", "z31", "memory"); \ 226 [0 ... ((FPU_QREG_MAX * 2) - 1)] = 0 }; in __fpuregs_testall() 266 /* allocate 128b aligned memory */ in __fpuregs_writeall_random() 270 /* Populate memory with random data */ in __fpuregs_writeall_random() [all …]
|
H A D | cstart.S | 11 #include <asm/asm-offsets.h> 12 #include <asm/pgtable-hwdef.h> 16 #define THREAD_START_SP ((THREAD_SIZE - S_FRAME_SIZE * 8) & ~7) 61 * bootloader params are in r0-r2 72 push {r0-r1} 81 pop {r0-r1} 83 ldr r2, =stacktop @ r2,r3 is the base of free memory 101 * r0 -- function_id 102 * r1 -- arg0 103 * r2 -- arg1 [all …]
|
/kvm-unit-tests/riscv/ |
H A D | sbi-fwft.c | 1 // SPDX-License-Identifier: GPL-2.0-only 18 #include "sbi-tests.h" 63 sbiret_report_error(&ret, SBI_ERR_DENIED, "get reserved feature 0x%lx", id); in fwft_check_reserved() 66 sbiret_report_error(&ret, SBI_ERR_DENIED, "set reserved feature 0x%lx", id); in fwft_check_reserved() 129 regs->epc += 4; in misaligned_handler() 198 ".option arch,-c\n" in fwft_check_misaligned_exc_deleg() 203 : "memory"); in fwft_check_misaligned_exc_deleg() 206 * Even though the SBI delegated the misaligned exception to S-mode, it might not trap on in fwft_check_misaligned_exc_deleg() 210 report_skip("Misaligned load exception does not trap in S-mode"); in fwft_check_misaligned_exc_deleg() 212 report_pass("Misaligned load exception trap in S-mode"); in fwft_check_misaligned_exc_deleg() [all …]
|
/kvm-unit-tests/powerpc/ |
H A D | spapr_vpa.c | 24 printf("descriptor: 0x%08x\n", be32_to_cpu(vpa->descriptor)); in print_vpa() 25 printf("size: 0x%04x\n", be16_to_cpu(vpa->size)); in print_vpa() 26 printf("status: 0x%02x\n", vpa->status); in print_vpa() 27 printf("fru_node_id: 0x%08x\n", be32_to_cpu(vpa->fru_node_id)); in print_vpa() 28 printf("fru_proc_id: 0x%08x\n", be32_to_cpu(vpa->fru_proc_id)); in print_vpa() 29 …->vhpn_change_counters[0], vpa->vhpn_change_counters[1], vpa->vhpn_change_counters[2], vpa->vhpn_c… in print_vpa() 30 printf("vp_dispatch_count: 0x%08x\n", be32_to_cpu(vpa->vp_dispatch_count)); in print_vpa() 31 printf("vp_dispatch_dispersion: 0x%08x\n", be32_to_cpu(vpa->vp_dispatch_dispersion)); in print_vpa() 32 printf("vp_fault_count: 0x%08lx\n", be64_to_cpu(vpa->vp_fault_count)); in print_vpa() 33 printf("vp_fault_tb: 0x%08lx\n", be64_to_cpu(vpa->vp_fault_tb)); in print_vpa() [all …]
|