Home
last modified time | relevance | path

Searched +full:gpa +full:- +full:1 (Results 1 – 25 of 169) sorted by relevance

1234567

/Linux-v6.1/arch/powerpc/kvm/
Dbook3s_64_mmu_radix.c1 // SPDX-License-Identifier: GPL-2.0-only
21 #include <asm/pte-walk.h>
42 /* Can't access quadrants 1 or 2 in non-HV mode, call the HV to do it */ in __kvmhv_copy_tofrom_guest_radix()
51 quadrant = 1; in __kvmhv_copy_tofrom_guest_radix()
67 if (quadrant == 1) { in __kvmhv_copy_tofrom_guest_radix()
84 if (quadrant == 1 && pid != old_pid) in __kvmhv_copy_tofrom_guest_radix()
98 int lpid = vcpu->kvm->arch.lpid; in kvmhv_copy_tofrom_guest_radix()
99 int pid = vcpu->arch.pid; in kvmhv_copy_tofrom_guest_radix()
103 return -EINVAL; in kvmhv_copy_tofrom_guest_radix()
106 if (vcpu->arch.nested) in kvmhv_copy_tofrom_guest_radix()
[all …]
Dbook3s_hv_uvmem.c1 // 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 …]
Dbook3s_hv_nested.c1 // SPDX-License-Identifier: GPL-2.0
7 * Description: KVM functions specific to running nested KVM-HV guests
20 #include <asm/pte-walk.h>
32 struct kvmppc_vcore *vc = vcpu->arch.vcore; in kvmhv_save_hv_regs()
34 hr->pcr = vc->pcr | PCR_MASK; in kvmhv_save_hv_regs()
35 hr->dpdes = vc->dpdes; in kvmhv_save_hv_regs()
36 hr->hfscr = vcpu->arch.hfscr; in kvmhv_save_hv_regs()
37 hr->tb_offset = vc->tb_offset; in kvmhv_save_hv_regs()
38 hr->dawr0 = vcpu->arch.dawr0; in kvmhv_save_hv_regs()
39 hr->dawrx0 = vcpu->arch.dawrx0; in kvmhv_save_hv_regs()
[all …]
/Linux-v6.1/tools/testing/selftests/kvm/
Dmax_guest_memory_test.c1 // SPDX-License-Identifier: GPL-2.0
22 uint64_t gpa; in guest_code() local
24 for (gpa = start_gpa; gpa < end_gpa; gpa += stride) in guest_code()
25 *((volatile uint64_t *)gpa) = gpa; in guest_code()
63 struct kvm_vcpu *vcpu = info->vcpu; in vcpu_worker()
64 struct kvm_vm *vm = vcpu->vm; in vcpu_worker()
68 vcpu_args_set(vcpu, 3, info->start_gpa, info->end_gpa, vm->page_size); in vcpu_worker()
95 uint64_t gpa, nr_bytes; in spawn_workers() local
103 TEST_ASSERT(info, "Failed to allocate vCPU gpa ranges"); in spawn_workers()
105 nr_bytes = ((end_gpa - start_gpa) / nr_vcpus) & in spawn_workers()
[all …]
Dmemslot_perf_test.c1 // SPDX-License-Identifier: GPL-2.0
3 * A memslot-related performance benchmark.
34 #define MEM_TEST_SIZE (MEM_SIZE - 4096)
46 #define MEM_TEST_MAP_SIZE (MEM_SIZE_MAP - 4096)
60 #define MEM_TEST_UNMAP_CHUNK_PAGES (2U << (20 - 12))
110 * Technically, we need also for the atomic bool to be address-free, which
114 * all KVM-supported platforms.
131 TEST_ASSERT(data->mmio_ok, "Unexpected mmio exit"); in check_mmio_access()
132 TEST_ASSERT(run->mmio.is_write, "Unexpected mmio read"); in check_mmio_access()
133 TEST_ASSERT(run->mmio.len == 8, in check_mmio_access()
[all …]
Dmemslot_modification_stress_test.c1 // SPDX-License-Identifier: GPL-2.0
34 static int nr_vcpus = 1;
41 struct kvm_vcpu *vcpu = vcpu_args->vcpu; in vcpu_worker()
45 run = vcpu->run; in vcpu_worker()
57 exit_reason_str(run->exit_reason)); in vcpu_worker()
70 uint64_t pages = max_t(int, vm->page_size, getpagesize()) / vm->page_size; in add_remove_memslot()
71 uint64_t gpa; in add_remove_memslot() local
78 gpa = perf_test_args.gpa - pages * vm->page_size; in add_remove_memslot()
82 vm_userspace_mem_region_add(vm, VM_MEM_SRC_ANONYMOUS, gpa, in add_remove_memslot()
100 vm = perf_test_create_vm(mode, nr_vcpus, guest_percpu_mem_size, 1, in run_test()
[all …]
/Linux-v6.1/arch/mips/kvm/
Dmmu.c19 * 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 …]
Dtlb.c42 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 …]
/Linux-v6.1/tools/testing/selftests/kvm/lib/
Dperf_test_util.c1 // SPDX-License-Identifier: GPL-2.0
48 struct perf_test_vcpu_args *vcpu_args = &pta->vcpu_args[vcpu_idx]; in perf_test_guest_code()
53 gva = vcpu_args->gva; in perf_test_guest_code()
54 pages = vcpu_args->pages; in perf_test_guest_code()
57 GUEST_ASSERT(vcpu_args->vcpu_idx == vcpu_idx); in perf_test_guest_code()
61 uint64_t addr = gva + (i * pta->guest_page_size); in perf_test_guest_code()
63 if (i % pta->wr_fract == 0) in perf_test_guest_code()
69 GUEST_SYNC(1); in perf_test_guest_code()
83 vcpu_args = &pta->vcpu_args[i]; in perf_test_setup_vcpus()
85 vcpu_args->vcpu = vcpus[i]; in perf_test_setup_vcpus()
[all …]
/Linux-v6.1/tools/testing/selftests/kvm/lib/aarch64/
Ducall.c1 // SPDX-License-Identifier: GPL-2.0
11 static bool ucall_mmio_init(struct kvm_vm *vm, vm_paddr_t gpa) in ucall_mmio_init() argument
13 if (kvm_userspace_memory_region_find(vm, gpa, gpa + 1)) in ucall_mmio_init()
16 virt_pg_map(vm, gpa, gpa); in ucall_mmio_init()
18 ucall_exit_mmio_addr = (vm_vaddr_t *)gpa; in ucall_mmio_init()
26 vm_paddr_t gpa, start, end, step, offset; in ucall_init() local
31 gpa = (vm_paddr_t)arg; in ucall_init()
32 ret = ucall_mmio_init(vm, gpa); in ucall_init()
33 TEST_ASSERT(ret, "Can't set ucall mmio address to %lx", gpa); in ucall_init()
46 * up from there in 1/16th allowed space sized steps. in ucall_init()
[all …]
/Linux-v6.1/arch/loongarch/include/asm/
Dtlb.h1 /* 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 …]
/Linux-v6.1/arch/s390/kvm/
Dgaccess.c1 // 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 …]
Dvsie.c1 // 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 …]
Dgaccess.h1 /* 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 …]
/Linux-v6.1/arch/x86/kvm/
Dcpuid.h1 /* SPDX-License-Identifier: GPL-2.0 */
42 return vcpu->arch.maxphyaddr; in cpuid_maxphyaddr()
45 static inline bool kvm_vcpu_is_legal_gpa(struct kvm_vcpu *vcpu, gpa_t gpa) in kvm_vcpu_is_legal_gpa() argument
47 return !(gpa & vcpu->arch.reserved_gpa_bits); in kvm_vcpu_is_legal_gpa()
50 static inline bool kvm_vcpu_is_illegal_gpa(struct kvm_vcpu *vcpu, gpa_t gpa) in kvm_vcpu_is_illegal_gpa() argument
52 return !kvm_vcpu_is_legal_gpa(vcpu, gpa); in kvm_vcpu_is_illegal_gpa()
56 gpa_t gpa, gpa_t alignment) in kvm_vcpu_is_legal_aligned_gpa() argument
58 return IS_ALIGNED(gpa, alignment) && kvm_vcpu_is_legal_gpa(vcpu, gpa); in kvm_vcpu_is_legal_aligned_gpa()
61 static inline bool page_address_valid(struct kvm_vcpu *vcpu, gpa_t gpa) in page_address_valid() argument
63 return kvm_vcpu_is_legal_aligned_gpa(vcpu, gpa, PAGE_SIZE); in page_address_valid()
[all …]
Dxen.c1 // SPDX-License-Identifier: GPL-2.0
35 struct gfn_to_pfn_cache *gpc = &kvm->arch.xen.shinfo_cache; in kvm_xen_shared_info_init()
37 gpa_t gpa = gfn_to_gpa(gfn); in kvm_xen_shared_info_init() local
42 int idx = srcu_read_lock(&kvm->srcu); in kvm_xen_shared_info_init()
50 ret = kvm_gpc_activate(kvm, gpc, NULL, KVM_HOST_USES_PFN, gpa, in kvm_xen_shared_info_init()
59 wall_nsec = ktime_get_real_ns() - get_kvmclock_ns(kvm); in kvm_xen_shared_info_init()
62 read_lock_irq(&gpc->lock); in kvm_xen_shared_info_init()
64 if (gpc->valid) in kvm_xen_shared_info_init()
67 read_unlock_irq(&gpc->lock); in kvm_xen_shared_info_init()
68 } while (1); in kvm_xen_shared_info_init()
[all …]
/Linux-v6.1/arch/riscv/kvm/
Dtlb.c1 // SPDX-License-Identifier: GPL-2.0
16 #include <asm/insn-def.h>
22 gpa_t gpa, gpa_t gpsz, in kvm_riscv_local_hfence_gvma_vmid_gpa() argument
34 for (pos = gpa; pos < (gpa + gpsz); pos += BIT(order)) in kvm_riscv_local_hfence_gvma_vmid_gpa()
35 asm volatile (HINVAL_GVMA(%0, %1) in kvm_riscv_local_hfence_gvma_vmid_gpa()
39 for (pos = gpa; pos < (gpa + gpsz); pos += BIT(order)) in kvm_riscv_local_hfence_gvma_vmid_gpa()
40 asm volatile (HFENCE_GVMA(%0, %1) in kvm_riscv_local_hfence_gvma_vmid_gpa()
50 void kvm_riscv_local_hfence_gvma_gpa(gpa_t gpa, gpa_t gpsz, in kvm_riscv_local_hfence_gvma_gpa() argument
62 for (pos = gpa; pos < (gpa + gpsz); pos += BIT(order)) in kvm_riscv_local_hfence_gvma_gpa()
67 for (pos = gpa; pos < (gpa + gpsz); pos += BIT(order)) in kvm_riscv_local_hfence_gvma_gpa()
[all …]
Dmmu.c1 // 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 …]
/Linux-v6.1/arch/x86/include/asm/uv/
Duv_hub.h9 * 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 …]
/Linux-v6.1/Documentation/virt/kvm/x86/
Dmmu.rst1 .. 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 …]
/Linux-v6.1/arch/x86/kvm/vmx/
Dsgx.c1 // SPDX-License-Identifier: GPL-2.0
13 bool __read_mostly enable_sgx = 1;
29 /* Skip vmcs.GUEST_DS retrieval for 64-bit mode to avoid VMREADs. */ in sgx_get_encls_gva()
46 (((u64)*gva + size - 1) > s.limit + 1)); in sgx_get_encls_gva()
50 return fault ? -EINVAL : 0; in sgx_get_encls_gva()
66 return -EFAULT; in sgx_read_hva()
73 gpa_t *gpa) in sgx_gva_to_gpa() argument
78 *gpa = kvm_mmu_gva_to_gpa_write(vcpu, gva, &ex); in sgx_gva_to_gpa()
80 *gpa = kvm_mmu_gva_to_gpa_read(vcpu, gva, &ex); in sgx_gva_to_gpa()
82 if (*gpa == INVALID_GPA) { in sgx_gva_to_gpa()
[all …]
/Linux-v6.1/Documentation/virt/hyperv/
Doverview.rst1 .. 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 …]
/Linux-v6.1/tools/testing/selftests/kvm/lib/s390x/
Dprocessor.c1 // 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 memset(addr_gpa2hva(vm, paddr), 0xff, PAGES_PER_REGION * vm->page_size); in virt_arch_pgd_alloc()
27 vm->pgd = paddr; in virt_arch_pgd_alloc()
28 vm->pgd_created = true; in virt_arch_pgd_alloc()
40 taddr = vm_phy_pages_alloc(vm, ri < 4 ? PAGES_PER_REGION : 1, in virt_alloc_region()
42 memset(addr_gpa2hva(vm, taddr), 0xff, PAGES_PER_REGION * vm->page_size); in virt_alloc_region()
[all …]
/Linux-v6.1/drivers/virt/acrn/
Dmm.c1 // SPDX-License-Identifier: GPL-2.0
25 return -ENOMEM; in modify_region()
27 regions->vmid = vm->vmid; in modify_region()
28 regions->regions_num = 1; in modify_region()
29 regions->regions_gpa = virt_to_phys(region); in modify_region()
34 "Failed to set memory region for VM[%u]!\n", vm->vmid); in modify_region()
41 * acrn_mm_region_add() - Set up the EPT mapping of a memory region.
43 * @user_gpa: A GPA of User VM.
44 * @service_gpa: A GPA of Service VM.
59 return -ENOMEM; in acrn_mm_region_add()
[all …]
/Linux-v6.1/drivers/gpu/drm/i915/gvt/
Dopregion.c2 * Copyright(c) 2011-2016 Intel Corporation. All rights reserved.
29 * Note: Only for GVT-g virtual VBT generation, other usage must
36 #define MBOX_VBT (1<<3)
78 u8 edidless_efp:1; /* 161 */
79 u8 compression_enable:1; /* 198 */
80 u8 compression_method:1; /* 198 */
81 u8 ganged_edp:1; /* 202 */
88 u8 i2c_pin; /* for add-in card */
89 u8 slave_addr; /* for add-in card */
93 u8 efp_docked_port:1; /* 158 */
[all …]

1234567