/freebsd/usr.sbin/bhyve/ |
H A D | bootrom.c | 1 /*- 2 * SPDX-License-Identifier: BSD-2-Clause 60 * It is allocated in page-multiple blocks on a first-come first-serve basis, 63 static char *romptr; /* Pointer to userspace-mapped bootrom region. */ 64 static vm_paddr_t gpa_base; /* GPA of low end of region. */ 65 static vm_paddr_t gpa_allocbot; /* Low GPA of free region. */ 66 static vm_paddr_t gpa_alloctop; /* High GPA, minus 1, of free region. */ 68 #define CFI_BCS_WRITE_BYTE 0x10 69 #define CFI_BCS_CLEAR_STATUS 0x50 70 #define CFI_BCS_READ_STATUS 0x70 [all …]
|
H A D | basl.c | 1 /*- 2 * SPDX-License-Identifier: BSD-2-Clause 73 return ((uint8_t *)pp)[0]; in basl_le_dec() 82 return 0; in basl_le_dec() 99 const ACPI_TABLE_HEADER *const header = table->data; in basl_dump_table() 103 data = table->data; in basl_dump_table() 105 data = vm_map_gpa(table->ctx, BHYVE_ACPI_BASE + table->off, in basl_dump_table() 106 table->len); in basl_dump_table() 112 printf("%.4s @ %8x (%s)\n", header->Signature, in basl_dump_table() 113 BHYVE_ACPI_BASE + table->off, mem ? "Memory" : "FwCfg"); in basl_dump_table() [all …]
|
H A D | mem.c | 1 /*- 2 * SPDX-License-Identifier: BSD-2-Clause 63 * Per-vCPU cache. Since most accesses from a vCPU will be to 75 if (a->mr_end < b->mr_base) in mmio_rb_range_compare() 76 return (-1); in mmio_rb_range_compare() 77 else if (a->mr_base > b->mr_end) in mmio_rb_range_compare() 79 return (0); in mmio_rb_range_compare() 94 return (0); in mmio_rb_lookup() 111 new->mr_base, new->mr_end, in mmio_rb_add() 112 overlap->mr_base, overlap->mr_end, in mmio_rb_add() [all …]
|
H A D | gdb.c | 1 /*- 2 * SPDX-License-Identifier: BSD-2-Clause 4 * Copyright (c) 2017-2018 John H. Baldwin <jhb@FreeBSD.org> 85 #define GDB_BP_INSTR (uint8_t []){0xcc} 90 #define GDB_BP_INSTR (uint8_t []){0x00, 0x00, 0x20, 0xd4} 109 static int xml_dfd = -1; 126 uint64_t gpa; member 159 static int cur_fd = -1; 268 if (caph_limit_stream(fileno(logfile), CAPH_WRITE) == -1) { in debug() 298 if (vm_get_register_set(vcpu, nitems(regset), regset, regs) == -1) in guest_paging_info() [all …]
|
/freebsd/sys/riscv/vmm/ |
H A D | vmm.c | 1 /*- 2 * SPDX-License-Identifier: BSD-2-Clause 90 void *cookie; /* (i) cpu-specific data */ 94 #define vcpu_lock_initialized(v) mtx_initialized(&((v)->mtx)) 95 #define vcpu_lock_init(v) mtx_init(&((v)->mtx), "vcpu lock", 0, MTX_SPIN) 96 #define vcpu_lock_destroy(v) mtx_destroy(&((v)->mtx)) 97 #define vcpu_lock(v) mtx_lock_spin(&((v)->mtx)) 98 #define vcpu_unlock(v) mtx_unlock_spin(&((v)->mtx)) 99 #define vcpu_assert_locked(v) mtx_assert(&((v)->mtx), MA_OWNED) 102 uint64_t gpa; member [all …]
|
/freebsd/sys/amd64/vmm/ |
H A D | vmm.c | 1 /*- 2 * SPDX-License-Identifier: BSD-2-Clause 109 void *cookie; /* (i) cpu-specific data */ 128 #define vcpu_lock_init(v) mtx_init(&((v)->mtx), "vcpu lock", 0, MTX_SPIN) 129 #define vcpu_lock_destroy(v) mtx_destroy(&((v)->mtx)) 130 #define vcpu_lock(v) mtx_lock_spin(&((v)->mtx)) 131 #define vcpu_unlock(v) mtx_unlock_spin(&((v)->mtx)) 132 #define vcpu_assert_locked(v) mtx_assert(&((v)->mtx), MA_OWNED) 142 vm_paddr_t gpa; member 163 void *cookie; /* (i) cpu-specific data */ [all …]
|
H A D | vmm_instruction_emul.c | 1 /*- 2 * SPDX-License-Identifier: BSD-2-Clause 68 VIE_OP_TYPE_NONE = 0, 91 #define VIE_OP_F_IMM (1 << 0) /* 16/32-bit immediate operand */ 92 #define VIE_OP_F_IMM8 (1 << 1) /* 8-bit immediate operand */ 93 #define VIE_OP_F_MOFFSET (1 << 2) /* 16/32/64-bit immediate moffset */ 98 [0xF7] = { 99 .op_byte = 0xF7, 105 [0xAE] = { 106 .op_byte = 0xAE, [all …]
|
H A D | vmm_dev_machdep.c | 1 /*- 2 * SPDX-License-Identifier: BSD-2-Clause 149 VMMDEV_IOCTL(VM_PPTDEV_MSI, 0), 150 VMMDEV_IOCTL(VM_PPTDEV_MSIX, 0), 151 VMMDEV_IOCTL(VM_PPTDEV_DISABLE_MSIX, 0), 152 VMMDEV_IOCTL(VM_LAPIC_MSI, 0), 153 VMMDEV_IOCTL(VM_IOAPIC_ASSERT_IRQ, 0), 154 VMMDEV_IOCTL(VM_IOAPIC_DEASSERT_IRQ, 0), 155 VMMDEV_IOCTL(VM_IOAPIC_PULSE_IRQ, 0), 156 VMMDEV_IOCTL(VM_IOAPIC_PINCOUNT, 0), [all …]
|
H A D | vmm_mem.c | 1 /*- 2 * SPDX-License-Identifier: BSD-2-Clause 52 return (0); in vmm_mem_init() 56 vmm_mmio_alloc(struct vmspace *vmspace, vm_paddr_t gpa, size_t len, in vmm_mmio_alloc() argument 65 KASSERT(error == 0, ("error %d appending physaddr to sglist", error)); in vmm_mmio_alloc() 67 obj = vm_pager_allocate(OBJT_SG, sg, len, VM_PROT_RW, 0, NULL); in vmm_mmio_alloc() 70 * VT-x ignores the MTRR settings when figuring out the in vmm_mmio_alloc() 83 error = vm_map_find(&vmspace->vm_map, obj, 0, &gpa, len, 0, in vmm_mmio_alloc() 84 VMFS_NO_SPACE, VM_PROT_RW, VM_PROT_RW, 0); in vmm_mmio_alloc() 108 vmm_mmio_free(struct vmspace *vmspace, vm_paddr_t gpa, size_t len) in vmm_mmio_free() argument [all …]
|
H A D | vmm_lapic.c | 1 /*- 2 * SPDX-License-Identifier: BSD-2-Clause 45 #define MSI_X86_ADDR_MASK 0xfff00000 46 #define MSI_X86_ADDR_BASE 0xfee00000 47 #define MSI_X86_ADDR_RH 0x00000008 /* Redirection Hint */ 48 #define MSI_X86_ADDR_LOG 0x00000004 /* Destination Mode */ 65 return (0); in lapic_set_intr() 76 error = 0; in lapic_set_local_intr() 103 return (-1); in lapic_intr_msi() 107 * Extract the x86-specific fields from the MSI addr/msg in lapic_intr_msi() [all …]
|
/freebsd/lib/libvmmapi/ |
H A D | vmmapi.c | 1 /*- 2 * SPDX-License-Identifier: BSD-2-Clause 69 #define VM_LOWMEM_LIMIT 0 98 memset(&vmc, 0, sizeof(vmc)); in vm_ctl_create() 101 return (-1); in vm_ctl_create() 112 if (modfind("vmm") < 0) { in vm_create() 114 if (error != 0) in vm_create() 115 return (-1); in vm_create() 118 fd = open("/dev/vmmctl", O_RDWR, 0); in vm_create() 119 if (fd < 0) in vm_create() [all …]
|
H A D | vmmapi.h | 1 /*- 2 * SPDX-License-Identifier: BSD-2-Clause 40 * API version for out-of-tree consumers like grub-bhyve for making compile 58 VM_MMAP_SPARSE, /* mappings created on-demand */ 64 #define VM_MEM_F_INCORE 0x01 /* include guest memory in core file */ 65 #define VM_MEM_F_WIRED 0x02 /* guest memory is wired */ 69 * - vm_setup_memory() uses VM_SYSMEM for the system memory segment. 70 * - the remaining identifiers can be used to create devmem segments. 84 * Returns 0 on success and non-zero otherwise. 91 * that starts at an address >= *gpa. [all …]
|
/freebsd/sys/arm64/vmm/ |
H A D | vmm.c | 1 /*- 2 * SPDX-License-Identifier: BSD-2-Clause 86 void *cookie; /* (i) cpu-specific data */ 90 #define vcpu_lock_initialized(v) mtx_initialized(&((v)->mtx)) 91 #define vcpu_lock_init(v) mtx_init(&((v)->mtx), "vcpu lock", 0, MTX_SPIN) 92 #define vcpu_lock_destroy(v) mtx_destroy(&((v)->mtx)) 93 #define vcpu_lock(v) mtx_lock_spin(&((v)->mtx)) 94 #define vcpu_unlock(v) mtx_unlock_spin(&((v)->mtx)) 95 #define vcpu_assert_locked(v) mtx_assert(&((v)->mtx), MA_OWNED) 98 uint64_t gpa; member [all …]
|
/freebsd/sys/amd64/vmm/intel/ |
H A D | vtd.c | 1 /*- 2 * SPDX-License-Identifier: BSD-2-Clause 49 #define VTD_DRHD_INCLUDE_PCI_ALL(Flags) (((Flags) >> 0) & 0x1) 63 #define VTD_CAP_SAGAW(cap) (((cap) >> 8) & 0x1F) 64 #define VTD_CAP_ND(cap) ((cap) & 0x7) 65 #define VTD_CAP_CM(cap) (((cap) >> 7) & 0x1) 66 #define VTD_CAP_SPS(cap) (((cap) >> 34) & 0xF) 67 #define VTD_CAP_RWBF(cap) (((cap) >> 4) & 0x1) 69 #define VTD_ECAP_DI(ecap) (((ecap) >> 2) & 0x1) 70 #define VTD_ECAP_COHERENCY(ecap) ((ecap) & 0x1) [all …]
|
/freebsd/sys/amd64/vmm/io/ |
H A D | iommu.c | 1 /*- 2 * SPDX-License-Identifier: BSD-2-Clause 46 SYSCTL_NODE(_hw_vmm, OID_AUTO, iommu, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, 51 0, "bhyve iommu initialized?"); 54 SYSCTL_INT(_hw_vmm_iommu, OID_AUTO, enable, CTLFLAG_RDTUN, &iommu_enable, 0, 65 return ((*ops->init)()); in IOMMU_INIT() 74 (*ops->cleanup)(); in IOMMU_CLEANUP() 82 return ((*ops->create_domain)(maxaddr)); in IOMMU_CREATE_DOMAIN() 92 (*ops->destroy_domain)(dom); in IOMMU_DESTROY_DOMAIN() 96 IOMMU_CREATE_MAPPING(void *domain, vm_paddr_t gpa, vm_paddr_t hpa, uint64_t len) in IOMMU_CREATE_MAPPING() argument [all …]
|
H A D | ppt.c | 1 /*- 2 * SPDX-License-Identifier: BSD-2-Clause 59 * If the MSI-X table is located in the middle of a BAR then that MMIO 60 * region gets split into two segments - one segment above the MSI-X table 61 * and the other segment below the MSI-X table - with a hole in place of 62 * the MSI-X table so accesses to it can be trapped and emulated. 68 MALLOC_DEFINE(M_PPTMSIX, "pptmsix", "Passthru MSI-X resources"); 77 vm_paddr_t gpa; member 110 SYSCTL_NODE(_hw_vmm, OID_AUTO, ppt, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, 114 SYSCTL_INT(_hw_vmm_ppt, OID_AUTO, devices, CTLFLAG_RD, &num_pptdevs, 0, [all …]
|
/freebsd/sys/amd64/include/ |
H A D | vmm_instruction_emul.h | 1 /*- 2 * SPDX-License-Identifier: BSD-2-Clause 37 typedef int (*mem_region_read_t)(struct vcpu *vcpu, uint64_t gpa, 40 typedef int (*mem_region_write_t)(struct vcpu *vcpu, uint64_t gpa, 47 * containing 'gpa'. 'mrarg' is an opaque argument that is passed into the 54 int vmm_emulate_instruction(struct vcpu *vcpu, uint64_t gpa, struct vie *vie, 62 * Returns 1 if an alignment check exception should be injected and 0 otherwise. 67 /* Returns 1 if the 'gla' is not canonical and 0 otherwise. */ 91 * 0 0 'gpa' contains result of the translation 92 * 0 1 An exception was injected into the guest [all …]
|
H A D | vmm.h | 1 /*- 2 * SPDX-License-Identifier: BSD-2-Clause 114 #define VM_INTINFO_VECTOR(info) ((info) & 0xff) 115 #define VM_INTINFO_DEL_ERRCODE 0x800 116 #define VM_INTINFO_RSVD 0x7ffff000 117 #define VM_INTINFO_VALID 0x80000000 118 #define VM_INTINFO_TYPE 0x700 119 #define VM_INTINFO_HWINTR (0 << 8) 144 (SPECNAMELEN - VM_MAX_PREFIXLEN - VM_MAX_SUFFIXLEN - 1) 199 vmi_init_func_t init; /* vm-specific initialization */ [all …]
|
H A D | vmm_dev.h | 1 /*- 2 * SPDX-License-Identifier: BSD-2-Clause 36 vm_paddr_t gpa; member 43 #define VM_MEMMAP_F_WIRED 0x01 44 #define VM_MEMMAP_F_IOMMU 0x02 47 vm_paddr_t gpa; member 51 #define VM_MEMSEG_NAME(m) ((m)->name[0] != '\0' ? (m)->name : NULL) 133 vm_paddr_t gpa; member 143 int numvec; /* 0 means disabled */ 183 uint64_t gpa; /* in */ member [all …]
|
/freebsd/sys/arm64/include/ |
H A D | vmm.h | 52 VM_REG_GUEST_X0 = 0, 95 #define VM_INTINFO_VECTOR(info) ((info) & 0xff) 96 #define VM_INTINFO_DEL_ERRCODE 0x800 97 #define VM_INTINFO_RSVD 0x7ffff000 98 #define VM_INTINFO_VALID 0x80000000 99 #define VM_INTINFO_TYPE 0x700 100 #define VM_INTINFO_HWINTR (0 << 8) 105 #define VM_GUEST_BASE_IPA 0x80000000UL /* Guest kernel start ipa */ 126 (SPECNAMELEN - VM_MAX_PREFIXLEN - VM_MAX_SUFFIXLEN - 1) 159 int vm_mmap_memseg(struct vm *vm, vm_paddr_t gpa, int segid, vm_ooffset_t off, [all …]
|
/freebsd/sys/riscv/include/ |
H A D | vmm.h | 2 * SPDX-License-Identifier: BSD-2-Clause 59 VM_REG_GUEST_ZERO = 0, 95 #define VM_INTINFO_VECTOR(info) ((info) & 0xff) 96 #define VM_INTINFO_DEL_ERRCODE 0x800 97 #define VM_INTINFO_RSVD 0x7ffff000 98 #define VM_INTINFO_VALID 0x80000000 99 #define VM_INTINFO_TYPE 0x700 100 #define VM_INTINFO_HWINTR (0 << 8) 140 int vm_mmap_memseg(struct vm *vm, vm_paddr_t gpa, int segid, vm_ooffset_t off, 142 int vm_munmap_memseg(struct vm *vm, vm_paddr_t gpa, size_t len); [all …]
|
/freebsd/usr.sbin/bhyve/amd64/ |
H A D | pci_gvt-d.c | 1 /*- 2 * SPDX-License-Identifier: BSD-2-Clause 21 #include "pci_gvt-d-opregion.h" 32 #define PCI_VENDOR_INTEL 0x8086 34 #define PCIR_BDSM 0x5C /* Base of Data Stolen Memory register */ 35 #define PCIR_ASLS_CTL 0xFC /* Opregion start address register */ 38 0x00100000 /* Graphics Stolen Memory is 1 MB aligned */ 40 #define GVT_D_MAP_GSM 0 50 sc = pi->pi_arg; in gvt_d_probe() 52 vendor = pci_host_read_config(passthru_get_sel(sc), PCIR_VENDOR, 0x02); in gvt_d_probe() [all …]
|
/freebsd/sys/dev/vmm/ |
H A D | vmm_dev.c | 1 /*- 2 * SPDX-License-Identifier: BSD-2-Clause 80 !(ucred->cr_prison->pr_allow & pr_allow_flag)) in vmm_priv_check() 83 return (0); in vmm_priv_check() 113 error = 0; in vcpu_lock_all() 114 vm_slock_vcpus(sc->vm); in vcpu_lock_all() 115 maxcpus = vm_get_maxcpus(sc->vm); in vcpu_lock_all() 116 for (i = 0; i < maxcpus; i++) { in vcpu_lock_all() 117 vcpu = vm_vcpu(sc->vm, i); in vcpu_lock_all() 126 for (j = 0; j < i; j++) { in vcpu_lock_all() [all …]
|
/freebsd/sys/contrib/device-tree/src/arm/samsung/ |
H A D | s3c64xx-pinctrl.dtsi | 1 // SPDX-License-Identifier: GPL-2.0 4 * - pin control-related definitions 8 * Samsung's S3C64xx SoCs pin banks, pin-mux and pin-config options are 12 #include "s3c64xx-pinctrl.h" 19 gpa: gpa-gpio-bank { label 20 gpio-controller; 21 #gpio-cells = <2>; 22 interrupt-controller; 23 #interrupt-cells = <2>; 26 gpb: gpb-gpio-bank { [all …]
|
/freebsd/sys/dev/hyperv/netvsc/ |
H A D | hn_nvs.h | 1 /*- 2 * Copyright (c) 2009-2012,2016-2017 Microsoft Corp. 3 * Copyright (c) 2010-2012 Citrix Inc. 55 sndc->hn_cb = cb; in hn_nvs_sendctx_init() 56 sndc->hn_cbarg = cbarg; in hn_nvs_sendctx_init() 79 struct hn_nvs_sendctx *sndc, struct vmbus_gpa *gpa, int gpa_cnt) in hn_nvs_send_rndis_sglist() argument 86 rndis.nvs_chim_sz = 0; in hn_nvs_send_rndis_sglist() 88 return (hn_nvs_send_sglist(chan, gpa, gpa_cnt, in hn_nvs_send_rndis_sglist() 99 struct hn_nvs_sendctx *sndc, struct vmbus_gpa *gpa,
|