/openbmc/linux/tools/testing/selftests/kvm/ |
H A D | max_guest_memory_test.c | 1 // SPDX-License-Identifier: GPL-2.0 23 uint64_t gpa; in guest_code() local 25 for (gpa = start_gpa; gpa < end_gpa; gpa += stride) in guest_code() 26 *((volatile uint64_t *)gpa) = gpa; in guest_code() 64 struct kvm_vcpu *vcpu = info->vcpu; in vcpu_worker() 65 struct kvm_vm *vm = vcpu->vm; in vcpu_worker() 69 vcpu_args_set(vcpu, 3, info->start_gpa, info->end_gpa, vm->page_size); in vcpu_worker() 96 uint64_t gpa, nr_bytes; in spawn_workers() local 104 TEST_ASSERT(info, "Failed to allocate vCPU gpa ranges"); in spawn_workers() 106 nr_bytes = ((end_gpa - start_gpa) / nr_vcpus) & in spawn_workers() [all …]
|
H A D | memslot_perf_test.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * A memslot-related performance benchmark. 36 #define MEM_TEST_SIZE (MEM_SIZE - MEM_EXTRA_SIZE) 45 #define MEM_TEST_MAP_SIZE (MEM_SIZE_MAP - MEM_EXTRA_SIZE) 68 * architecture slots memory-per-slot memory-on-last-slot 69 * -------------------------------------------------------------- 70 * x86-4KB 32763 16KB 160KB 71 * arm64-4KB 32766 16KB 112KB 72 * arm64-16KB 32766 16KB 112KB 73 * arm64-64KB 8192 64KB 128KB [all …]
|
/openbmc/linux/arch/powerpc/kvm/ |
H A D | book3s_64_mmu_radix.c | 1 // SPDX-License-Identifier: GPL-2.0-only 22 #include <asm/pte-walk.h> 43 /* Can't access quadrants 1 or 2 in non-HV mode, call the HV to do it */ in __kvmhv_copy_tofrom_guest_radix() 52 quadrant = 1; in __kvmhv_copy_tofrom_guest_radix() 68 if (quadrant == 1) { in __kvmhv_copy_tofrom_guest_radix() 85 if (quadrant == 1 && pid != old_pid) in __kvmhv_copy_tofrom_guest_radix() 99 int lpid = vcpu->kvm->arch.lpid; in kvmhv_copy_tofrom_guest_radix() 100 int pid = vcpu->arch.pid; in kvmhv_copy_tofrom_guest_radix() 104 return -EINVAL; in kvmhv_copy_tofrom_guest_radix() 107 if (vcpu->arch.nested) in kvmhv_copy_tofrom_guest_radix() [all …]
|
H A D | book3s_hv_uvmem.c | 1 // SPDX-License-Identifier: GPL-2.0 10 * A pseries guest can be run as secure guest on Ultravisor-enabled 15 * The page-in or page-out requests from UV will come to HV as hcalls and 31 * kvm->arch.uvmem_lock is a per-guest lock that prevents concurrent 32 * page-in and page-out requests for the same GPA. Concurrent accesses 37 * migrate_vma routines and page-in/out routines. 39 * Per-guest mutex comes with a cost though. Mainly it serializes the 40 * fault path as page-out can occur when HV faults on accessing secure 41 * guest pages. Currently UV issues page-in requests for all the guest 43 * not a cause for concern. Also currently the number of page-outs caused [all …]
|
/openbmc/qemu/target/i386/hvf/ |
H A D | x86_mmu.c | 39 #define PAE_PTE_PAGE_MASK ((-1llu << 12) & ((1llu << 52) - 1)) 40 #define PAE_PTE_LARGE_PAGE_MASK ((-1llu << (21)) & ((1llu << 52) - 1)) 41 #define PAE_PTE_SUPER_PAGE_MASK ((-1llu << (30)) & ((1llu << 52) - 1)) 45 uint64_t gpa; member 68 return (addr >> (level_shift * (level - 1) + 12)) & ((1 << level_shift) - 1); in gpt_entry() 83 uint64_t gpa = pt->pte[level] & page_mask; in get_pt_entry() local 86 gpa = pt->pte[level]; in get_pt_entry() 89 index = gpt_entry(pt->gva, level, pae); in get_pt_entry() 90 address_space_read(&address_space_memory, gpa + index * pte_size(pae), in get_pt_entry() 93 pt->pte[level - 1] = pte; in get_pt_entry() [all …]
|
/openbmc/linux/arch/mips/kvm/ |
H A D | mmu.c | 19 * KVM_MMU_CACHE_MIN_PAGES is the number of GPA page table translation levels 23 #define KVM_MMU_CACHE_MIN_PAGES 1 30 kvm_mmu_free_memory_cache(&vcpu->arch.mmu_page_cache); in kvm_mmu_free_memory_caches() 34 * kvm_pgd_init() - Initialise KVM GPA page directory. 35 * @page: Pointer to page directory (PGD) for KVM GPA. 37 * Initialise a KVM GPA page directory with pointers to the invalid table, i.e. 59 p[1] = entry; in kvm_pgd_init() 64 p[-3] = entry; in kvm_pgd_init() 65 p[-2] = entry; in kvm_pgd_init() 66 p[-1] = entry; in kvm_pgd_init() [all …]
|
H A D | tlb.c | 42 struct mm_struct *gpa_mm = &vcpu->kvm->arch.gpa_mm; in kvm_mips_get_root_asid() 79 * clear_root_gid() - Set GuestCtl1.RID for normal root operation. 90 * set_root_gid_to_guest_gid() - Set GuestCtl1.RID to match GuestCtl1.ID. 93 * on the GPA->RPA mappings in the root TLB. 153 * kvm_vz_guest_tlb_lookup() - Lookup a guest VZ TLB mapping. 155 * @gpa: Guest virtual address in a TLB mapped guest segment. 156 * @gpa: Pointer to output guest physical address it maps to. 161 * Returns: 0 if guest TLB mapping exists for @gva. *@gpa will have been 163 * -EFAULT if no guest TLB mapping exists for @gva. *@gpa may not 167 unsigned long *gpa) in kvm_vz_guest_tlb_lookup() argument [all …]
|
/openbmc/linux/tools/testing/selftests/kvm/lib/ |
H A D | memstress.c | 1 // SPDX-License-Identifier: GPL-2.0 51 struct memstress_vcpu_args *vcpu_args = &args->vcpu_args[vcpu_idx]; in memstress_guest_code() 59 rand_state = new_guest_random_state(args->random_seed + vcpu_idx); in memstress_guest_code() 61 gva = vcpu_args->gva; in memstress_guest_code() 62 pages = vcpu_args->pages; in memstress_guest_code() 65 GUEST_ASSERT(vcpu_args->vcpu_idx == vcpu_idx); in memstress_guest_code() 68 for (i = 0; i < sizeof(memstress_args); i += args->guest_page_size) in memstress_guest_code() 72 if (args->random_access) in memstress_guest_code() 77 addr = gva + (page * args->guest_page_size); in memstress_guest_code() 79 if (guest_random_u32(&rand_state) % 100 < args->write_percent) in memstress_guest_code() [all …]
|
/openbmc/linux/arch/loongarch/include/asm/ |
H A D | tlb.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 3 * Copyright (C) 2020-2022 Loongson Technology Corporation Limited 9 #include <asm/cpu-features.h> 53 /* Invalid all global=1 lines in current tlb */ 61 /* Invalid addr with global=1 or matched asid in current tlb */ 65 /* Invalid global=1, matched gid in guest tlb */ 73 /* Invalid global=1 , matched gid, asid and addr in guest tlb */ 75 /* Invalid all gid gva-->gpa guest tlb */ 77 /* Invalid all gid gpa-->hpa tlb */ 79 /* Invalid all gid tlb, including gva-->gpa and gpa-->hpa */ [all …]
|
/openbmc/linux/arch/s390/kvm/ |
H A D | gaccess.c | 1 // SPDX-License-Identifier: GPL-2.0 16 #include "kvm-s390.h" 23 unsigned long origin : 52; /* Region- or Segment-Table Origin */ 25 unsigned long g : 1; /* Subspace Group Control */ 26 unsigned long p : 1; /* Private Space Control */ 27 unsigned long s : 1; /* Storage-Alteration-Event Control */ 28 unsigned long x : 1; /* Space-Switch-Event Control */ 29 unsigned long r : 1; /* Real-Space Control */ 30 unsigned long : 1; 31 unsigned long dt : 2; /* Designation-Type Control */ [all …]
|
H A D | vsie.c | 1 // SPDX-License-Identifier: GPL-2.0 22 #include "kvm-s390.h" 48 __u8 reserved[0x0700 - 0x0258]; /* 0x0258 */ 57 scb->ipa = 0x1000; in set_validity_icpt() 58 scb->ipb = ((__u32) reason_code) << 16; in set_validity_icpt() 59 scb->icptcode = ICPT_VALIDITY; in set_validity_icpt() 60 return 1; in set_validity_icpt() 66 atomic_or(PROG_REQUEST, &vsie_page->scb_s.prog20); in prefix_unmapped() 73 if (vsie_page->scb_s.prog0c & PROG_IN_SIE) in prefix_unmapped_sync() 74 atomic_or(CPUSTAT_STOP_INT, &vsie_page->scb_s.cpuflags); in prefix_unmapped_sync() [all …]
|
H A D | gaccess.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 17 #include "kvm-s390.h" 20 * kvm_s390_real_to_abs - convert guest real address to guest absolute address 21 * @prefix - guest prefix 22 * @gra - guest real address 32 gra -= prefix; in _kvm_s390_real_to_abs() 37 * kvm_s390_real_to_abs - convert guest real address to guest absolute address 38 * @vcpu - guest virtual cpu 39 * @gra - guest real address 51 * _kvm_s390_logical_to_effective - convert guest logical to effective address [all …]
|
/openbmc/qemu/hw/i386/kvm/ |
H A D | xen_overlay.c | 9 * See the COPYING file in the top-level directory. 13 #include "qemu/host-utils.h" 15 #include "qemu/main-loop.h" 19 #include "exec/address-spaces.h" 33 #define TYPE_XEN_OVERLAY "xen-overlay" 37 #define XEN_PAGE_SIZE (1ULL << XEN_PAGE_SHIFT) 52 void xen_overlay_do_map_page(MemoryRegion *page, uint64_t gpa) in xen_overlay_do_map_page() argument 62 if (gpa == INVALID_GPA) { in xen_overlay_do_map_page() 66 memory_region_set_address(page, gpa); in xen_overlay_do_map_page() 68 } else if (gpa != INVALID_GPA) { in xen_overlay_do_map_page() [all …]
|
/openbmc/u-boot/doc/ |
H A D | README.s5pc1xx | 5 This README is about U-Boot support for SAMSUNG's ARM Cortex-A8 based S5PC1xx 6 family of SoCs (S5PC100 [1] and S5PC110). 15 While ARM Cortex-A8 support ARM v7 instruction set (-march=armv7a) we compile 16 with -march=armv5 to allow more compilers to work. For U-Boot code this has 47 /* GPA[0] pin set to irq */ 48 gpio_cfg_pin(&gpio->gpio_a, 0, GPIO_IRQ); 50 /* GPA[0] pin set to input */ 51 gpio_direction_input(&gpio->gpio_a, 0); 53 /* GPA[0] pin set to output/high */ 54 gpio_direction_output(&gpio->gpio_a, 0, 1); [all …]
|
/openbmc/qemu/target/i386/kvm/ |
H A D | xen-emu.c | 8 * See the COPYING file in the top-level directory. 14 #include "qemu/main-loop.h" 15 #include "qemu/error-report.h" 20 #include "exec/address-spaces.h" 21 #include "xen-emu.h" 26 #include "hw/i386/apic-msidef.h" 43 #include "xen-compat.h" 55 static bool kvm_gva_to_gpa(CPUState *cs, uint64_t gva, uint64_t *gpa, in kvm_gva_to_gpa() argument 63 *len = TARGET_PAGE_SIZE - (gva & ~TARGET_PAGE_MASK); in kvm_gva_to_gpa() 70 *gpa = tr.physical_address; in kvm_gva_to_gpa() [all …]
|
/openbmc/linux/arch/x86/kvm/ |
H A D | cpuid.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 43 return vcpu->arch.maxphyaddr; in cpuid_maxphyaddr() 46 static inline bool kvm_vcpu_is_legal_gpa(struct kvm_vcpu *vcpu, gpa_t gpa) in kvm_vcpu_is_legal_gpa() 48 return !(gpa & vcpu->arch.reserved_gpa_bits); in kvm_vcpu_is_legal_gpa() 51 static inline bool kvm_vcpu_is_illegal_gpa(struct kvm_vcpu *vcpu, gpa_t gpa) in kvm_vcpu_is_illegal_gpa() 53 return !kvm_vcpu_is_legal_gpa(vcpu, gpa); in kvm_vcpu_is_illegal_gpa() 57 gpa_t gpa, gpa_ in kvm_vcpu_is_legal_aligned_gpa() 45 kvm_vcpu_is_legal_gpa(struct kvm_vcpu * vcpu,gpa_t gpa) kvm_vcpu_is_legal_gpa() argument 50 kvm_vcpu_is_illegal_gpa(struct kvm_vcpu * vcpu,gpa_t gpa) kvm_vcpu_is_illegal_gpa() argument 56 kvm_vcpu_is_legal_aligned_gpa(struct kvm_vcpu * vcpu,gpa_t gpa,gpa_t alignment) kvm_vcpu_is_legal_aligned_gpa() argument 61 page_address_valid(struct kvm_vcpu * vcpu,gpa_t gpa) page_address_valid() argument [all...] |
/openbmc/linux/arch/x86/include/asm/uv/ |
H A D | uv_hub.h | 9 * Copyright (C) 2007-2014 Silicon Graphics, Inc. All rights reserved. 33 * M - The low M bits of a physical address represent the offset 38 * N - Number of bits in the node portion of a socket physical 41 * NASID - network ID of a router, Mbrick or Cbrick. Nasid values of 42 * routers always have low bit of 1, C/MBricks have low bit 44 * right shift the NASID by 1 to exclude the always-zero bit. 47 * GNODE - NASID right shifted by 1 bit. Most mmrs contain gnodes instead 50 * PNODE - the low N bits of the GNODE. The PNODE is the most useful variant 53 * GPA - (global physical address) a socket physical address converted 55 * physical addresses 1) need additional NASID (node) bits added [all …]
|
/openbmc/linux/arch/riscv/kvm/ |
H A D | mmu.c | 1 // SPDX-License-Identifier: GPL-2.0 33 #define gstage_pgd_size (1UL << (HGATP_PAGE_SHIFT + gstage_pgd_xbits)) 37 #define gstage_gpa_size ((gpa_t)(1ULL << gstage_gpa_bits)) 47 if (level == (gstage_pgd_levels - 1)) in gstage_pte_index() 48 mask = (PTRS_PER_PTE * (1UL << gstage_pgd_xbits)) - 1; in gstage_pte_index() 50 mask = PTRS_PER_PTE - 1; in gstage_pte_index() 63 unsigned long psz = 1UL << 12; in gstage_page_size_to_level() 72 return -EINVAL; in gstage_page_size_to_level() 78 return -EINVAL; in gstage_level_to_page_order() 101 u32 current_level = gstage_pgd_levels - 1; in gstage_get_leaf_entry() [all …]
|
H A D | tlb.c | 1 // SPDX-License-Identifier: GPL-2.0 16 #include <asm/insn-def.h> 21 gpa_t gpa, gpa_t gpsz, in kvm_riscv_local_hfence_gvma_vmid_gpa() argument 33 for (pos = gpa; pos < (gpa + gpsz); pos += BIT(order)) in kvm_riscv_local_hfence_gvma_vmid_gpa() 34 asm volatile (HINVAL_GVMA(%0, %1) in kvm_riscv_local_hfence_gvma_vmid_gpa() 38 for (pos = gpa; pos < (gpa + gpsz); pos += BIT(order)) in kvm_riscv_local_hfence_gvma_vmid_gpa() 39 asm volatile (HFENCE_GVMA(%0, %1) in kvm_riscv_local_hfence_gvma_vmid_gpa() 49 void kvm_riscv_local_hfence_gvma_gpa(gpa_t gpa, gpa_t gpsz, in kvm_riscv_local_hfence_gvma_gpa() argument 61 for (pos = gpa; pos < (gpa + gpsz); pos += BIT(order)) in kvm_riscv_local_hfence_gvma_gpa() 66 for (pos = gpa; pos < (gpa + gpsz); pos += BIT(order)) in kvm_riscv_local_hfence_gvma_gpa() [all …]
|
/openbmc/linux/Documentation/virt/kvm/x86/ |
H A D | mmu.rst | 1 .. SPDX-License-Identifier: GPL-2.0 13 - correctness: 18 - security: 21 - performance: 23 - scaling: 25 - hardware: 27 - integration: 31 - dirty tracking: 33 and framebuffer-based displays 34 - footprint: [all …]
|
/openbmc/linux/arch/x86/kvm/vmx/ |
H A D | sgx.c | 1 // SPDX-License-Identifier: GPL-2.0 14 bool __read_mostly enable_sgx = 1; 30 /* Skip vmcs.GUEST_DS retrieval for 64-bit mode to avoid VMREADs. */ in sgx_get_encls_gva() 47 (((u64)*gva + size - 1) > s.limit + 1)); in sgx_get_encls_gva() 51 return fault ? -EINVAL : 0; in sgx_get_encls_gva() 67 return -EFAULT; in sgx_read_hva() 74 gpa_t *gpa) in sgx_gva_to_gpa() argument 79 *gpa = kvm_mmu_gva_to_gpa_write(vcpu, gva, &ex); in sgx_gva_to_gpa() 81 *gpa = kvm_mmu_gva_to_gpa_read(vcpu, gva, &ex); in sgx_gva_to_gpa() 83 if (*gpa == INVALID_GPA) { in sgx_gva_to_gpa() [all …]
|
/openbmc/qemu/hw/vfio/ |
H A D | spapr.c | 8 * the COPYING file in the top-level directory. 18 #include "exec/address-spaces.h" 20 #include "hw/vfio/vfio-common.h" 23 #include "qemu/error-report.h" 37 if (memory_region_is_iommu(section->mr)) { in vfio_prereg_listener_skipped_section() 41 return !memory_region_is_ram(section->mr) || in vfio_prereg_listener_skipped_section() 42 memory_region_is_ram_device(section->mr); in vfio_prereg_listener_skipped_section() 45 static void *vfio_prereg_gpa_to_vaddr(MemoryRegionSection *section, hwaddr gpa) in vfio_prereg_gpa_to_vaddr() argument 47 return memory_region_get_ram_ptr(section->mr) + in vfio_prereg_gpa_to_vaddr() 48 section->offset_within_region + in vfio_prereg_gpa_to_vaddr() [all …]
|
/openbmc/linux/tools/testing/selftests/kvm/lib/s390x/ |
H A D | processor.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * KVM selftest s390x library code - CPU-related functions (page tables...) 17 TEST_ASSERT(vm->page_size == 4096, "Unsupported page size: 0x%x", in virt_arch_pgd_alloc() 18 vm->page_size); in virt_arch_pgd_alloc() 20 if (vm->pgd_created) in virt_arch_pgd_alloc() 25 vm->memslots[MEM_REGION_PT]); in virt_arch_pgd_alloc() 26 memset(addr_gpa2hva(vm, paddr), 0xff, PAGES_PER_REGION * vm->page_size); in virt_arch_pgd_alloc() 28 vm->pgd = paddr; in virt_arch_pgd_alloc() 29 vm->pgd_created = true; in virt_arch_pgd_alloc() 41 taddr = vm_phy_pages_alloc(vm, ri < 4 ? PAGES_PER_REGION : 1, in virt_alloc_region() [all …]
|
/openbmc/linux/Documentation/virt/hyperv/ |
H A D | overview.rst | 1 .. SPDX-License-Identifier: GPL-2.0 6 enlightened guest on Microsoft's Hyper-V hypervisor. Hyper-V 7 consists primarily of a bare-metal hypervisor plus a virtual machine 10 partitions. In this documentation, references to Hyper-V usually 15 Hyper-V runs on x86/x64 and arm64 architectures, and Linux guests 16 are supported on both. The functionality and behavior of Hyper-V is 19 Linux Guest Communication with Hyper-V 20 -------------------------------------- 21 Linux guests communicate with Hyper-V in four different ways: 24 some guest actions trap to Hyper-V. Hyper-V emulates the action and [all …]
|
/openbmc/qemu/hw/i386/ |
H A D | pc_sysfw.c | 4 * Copyright (c) 2003-2004 Fabrice Bellard 5 * Copyright (c) 2011-2012 Intel Corporation 28 #include "sysemu/block-backend.h" 29 #include "qemu/error-report.h" 36 #include "hw/qdev-properties.h" 55 memory_region_init_ram_guest_memfd(isa_bios, NULL, "isa-bios", in pc_isa_bios_init() 58 memory_region_init_ram(isa_bios, NULL, "isa-bios", isa_bios_size, in pc_isa_bios_init() 62 0x100000 - isa_bios_size, in pc_isa_bios_init() 64 1); in pc_isa_bios_init() 70 ((uint8_t*)flash_ptr) + (flash_size - isa_bios_size), in pc_isa_bios_init() [all …]
|