mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-25 15:02:13 +00:00
hv:cleanup header file for guest folder
cleanup arch/x86/guest, only include some necessary header files, doesn't include hypervisor.h Tracked-On: #1842 Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com> Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com> modified: arch/x86/guest/assign.c modified: arch/x86/guest/ept.c modified: arch/x86/guest/guest_memory.c modified: arch/x86/guest/instr_emul.c modified: arch/x86/guest/io_emul.c modified: arch/x86/guest/pm.c modified: arch/x86/guest/trusty.c modified: arch/x86/guest/ucode.c modified: arch/x86/guest/vcpu.c modified: arch/x86/guest/vcpuid.c modified: arch/x86/guest/virq.c modified: arch/x86/guest/virtual_cr.c modified: arch/x86/guest/vlapic.c modified: arch/x86/guest/vm.c modified: arch/x86/guest/vmcall.c modified: arch/x86/guest/vmcs.c modified: arch/x86/guest/vmexit.c modified: arch/x86/guest/vmsr.c modified: arch/x86/guest/vmtrr.c modified: arch/x86/pm.c modified: include/arch/x86/guest/assign.h modified: include/arch/x86/guest/ept.h modified: include/arch/x86/guest/guest_memory.h modified: include/arch/x86/guest/instr_emul.h modified: include/arch/x86/guest/io_emul.h modified: include/arch/x86/guest/trusty.h modified: include/arch/x86/guest/vcpu.h modified: include/arch/x86/guest/vmcs.h modified: include/arch/x86/io_req.h modified: include/arch/x86/irq.h modified: include/arch/x86/lapic.h modified: include/arch/x86/mmu.h modified: include/arch/x86/pgtable.h modified: include/common/ptdev.h modified: include/debug/console.h
This commit is contained in:
parent
75f6cab554
commit
b24a8a0f59
@ -4,9 +4,13 @@
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <hypervisor.h>
|
||||
#include <ioapic.h>
|
||||
#include <types.h>
|
||||
#include <errno.h>
|
||||
#include <bits.h>
|
||||
#include <vm.h>
|
||||
#include <vtd.h>
|
||||
#include <per_cpu.h>
|
||||
#include <ioapic.h>
|
||||
|
||||
/*
|
||||
* lookup a ptdev entry by sid
|
||||
@ -789,6 +793,21 @@ void ptirq_remove_intx_remapping(struct acrn_vm *vm, uint32_t virt_pin, bool pic
|
||||
spinlock_release(&ptdev_lock);
|
||||
}
|
||||
|
||||
/*
|
||||
* @pre vm != NULL
|
||||
*/
|
||||
void ptirq_remove_msix_remapping(const struct acrn_vm *vm, uint16_t virt_bdf,
|
||||
uint32_t vector_count)
|
||||
{
|
||||
uint32_t i;
|
||||
|
||||
for (i = 0U; i < vector_count; i++) {
|
||||
spinlock_obtain(&ptdev_lock);
|
||||
remove_msix_remapping(vm, virt_bdf, i);
|
||||
spinlock_release(&ptdev_lock);
|
||||
}
|
||||
}
|
||||
|
||||
/* except sos_vm, Device Model should call this function to pre-hold ptdev msi
|
||||
* entries:
|
||||
* - the entry is identified by phys_bdf:msi_idx:
|
||||
@ -817,18 +836,3 @@ int32_t ptirq_add_msix_remapping(struct acrn_vm *vm, uint16_t virt_bdf,
|
||||
|
||||
return (vector_added == vector_count) ? 0 : -ENODEV;
|
||||
}
|
||||
|
||||
/*
|
||||
* @pre vm != NULL
|
||||
*/
|
||||
void ptirq_remove_msix_remapping(const struct acrn_vm *vm, uint16_t virt_bdf,
|
||||
uint32_t vector_count)
|
||||
{
|
||||
uint32_t i;
|
||||
|
||||
for (i = 0U; i < vector_count; i++) {
|
||||
spinlock_obtain(&ptdev_lock);
|
||||
remove_msix_remapping(vm, virt_bdf, i);
|
||||
spinlock_release(&ptdev_lock);
|
||||
}
|
||||
}
|
||||
|
@ -4,10 +4,17 @@
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <hypervisor.h>
|
||||
|
||||
#include <instr_emul.h>
|
||||
#include <types.h>
|
||||
#include <errno.h>
|
||||
#include <vm.h>
|
||||
#include <irq.h>
|
||||
#include <pgtable.h>
|
||||
#include <mmu.h>
|
||||
#include <ept.h>
|
||||
#include <vmx.h>
|
||||
#include <vtd.h>
|
||||
#include <logmsg.h>
|
||||
#include <trace.h>
|
||||
|
||||
#define ACRN_DBG_EPT 6U
|
||||
|
||||
|
@ -4,10 +4,15 @@
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <hypervisor.h>
|
||||
#include <multiboot.h>
|
||||
#include <reloc.h>
|
||||
#include <e820.h>
|
||||
#include <types.h>
|
||||
#include <errno.h>
|
||||
#include <guest_memory.h>
|
||||
#include <vcpu.h>
|
||||
#include <vm.h>
|
||||
#include <vmcs.h>
|
||||
#include <mmu.h>
|
||||
#include <ept.h>
|
||||
#include <logmsg.h>
|
||||
|
||||
#define ACRN_DBG_GUEST 6U
|
||||
|
||||
|
@ -28,8 +28,14 @@
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#include <hypervisor.h>
|
||||
#include <types.h>
|
||||
#include <errno.h>
|
||||
#include <instr_emul.h>
|
||||
#include <vmx.h>
|
||||
#include <vmcs.h>
|
||||
#include <mmu.h>
|
||||
#include <per_cpu.h>
|
||||
#include <logmsg.h>
|
||||
|
||||
#define CPU_REG_FIRST CPU_REG_RAX
|
||||
#define CPU_REG_LAST CPU_REG_GDTR
|
||||
|
@ -4,9 +4,18 @@
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <hypervisor.h>
|
||||
|
||||
#include <types.h>
|
||||
#include <errno.h>
|
||||
#include <atomic.h>
|
||||
#include <io_req.h>
|
||||
#include <vcpu.h>
|
||||
#include <vm.h>
|
||||
#include <instr_emul.h>
|
||||
#include <vmexit.h>
|
||||
#include <vmx.h>
|
||||
#include <ept.h>
|
||||
#include <trace.h>
|
||||
#include <logmsg.h>
|
||||
|
||||
/**
|
||||
* @brief General complete-work for port I/O emulation
|
||||
|
@ -4,7 +4,11 @@
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <hypervisor.h>
|
||||
#include <types.h>
|
||||
#include <host_pm.h>
|
||||
#include <vm.h>
|
||||
#include <io.h>
|
||||
#include <logmsg.h>
|
||||
|
||||
int32_t validate_pstate(const struct acrn_vm *vm, uint64_t perf_ctl)
|
||||
{
|
||||
|
@ -4,9 +4,18 @@
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <hypervisor.h>
|
||||
#include <types.h>
|
||||
#include <bits.h>
|
||||
#include <crypto_api.h>
|
||||
#include <trusty.h>
|
||||
#include <page.h>
|
||||
#include <pgtable.h>
|
||||
#include <mmu.h>
|
||||
#include <ept.h>
|
||||
#include <vm.h>
|
||||
#include <vmx.h>
|
||||
#include <security.h>
|
||||
#include <logmsg.h>
|
||||
|
||||
#define TRUSTY_VERSION 1U
|
||||
#define TRUSTY_VERSION_2 2U
|
||||
|
@ -4,8 +4,16 @@
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <hypervisor.h>
|
||||
#include <types.h>
|
||||
#include <errno.h>
|
||||
#include <spinlock.h>
|
||||
#include <cpu.h>
|
||||
#include <msr.h>
|
||||
#include <cpuid.h>
|
||||
#include <ucode.h>
|
||||
#include <guest_memory.h>
|
||||
#include <irq.h>
|
||||
#include <logmsg.h>
|
||||
|
||||
#define MICRO_CODE_SIZE_MAX 0x40000U
|
||||
static uint8_t micro_code[MICRO_CODE_SIZE_MAX];
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include <atomic.h>
|
||||
#include <vm.h>
|
||||
#include <vmcs.h>
|
||||
#include <mmu.h>
|
||||
#include <sprintf.h>
|
||||
|
||||
inline uint64_t vcpu_get_gpreg(const struct acrn_vcpu *vcpu, uint32_t reg)
|
||||
|
@ -4,7 +4,15 @@
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <hypervisor.h>
|
||||
#include <types.h>
|
||||
#include <errno.h>
|
||||
#include <bits.h>
|
||||
#include <vcpu.h>
|
||||
#include <vm.h>
|
||||
#include <cpuid.h>
|
||||
#include <cpufeatures.h>
|
||||
#include <vmx.h>
|
||||
#include <logmsg.h>
|
||||
|
||||
static inline const struct vcpuid_entry *local_find_vcpuid_entry(const struct acrn_vcpu *vcpu,
|
||||
uint32_t leaf, uint32_t subleaf)
|
||||
|
@ -4,7 +4,17 @@
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <hypervisor.h>
|
||||
#include <types.h>
|
||||
#include <errno.h>
|
||||
#include <bits.h>
|
||||
#include <irq.h>
|
||||
#include <lapic.h>
|
||||
#include <mmu.h>
|
||||
#include <vmx.h>
|
||||
#include <vcpu.h>
|
||||
#include <vm.h>
|
||||
#include <trace.h>
|
||||
#include <logmsg.h>
|
||||
|
||||
#define EXCEPTION_ERROR_CODE_VALID 8U
|
||||
|
||||
|
@ -6,10 +6,19 @@
|
||||
* this file contains vmcs operations which is vcpu related
|
||||
*/
|
||||
|
||||
#include <hypervisor.h>
|
||||
#include <cpu.h>
|
||||
#include <virtual_cr.h>
|
||||
#include <types.h>
|
||||
#include <errno.h>
|
||||
#include <bits.h>
|
||||
#include <irq.h>
|
||||
#include <mmu.h>
|
||||
#include <vcpu.h>
|
||||
#include <vm.h>
|
||||
#include <vmx.h>
|
||||
#include <vtd.h>
|
||||
#include <vmexit.h>
|
||||
#include <pgtable.h>
|
||||
#include <trace.h>
|
||||
#include <logmsg.h>
|
||||
|
||||
/* CR0 bits hv want to trap to track status change */
|
||||
#define CR0_TRAP_MASK (CR0_PE | CR0_PG | CR0_WP | CR0_CD | CR0_NW)
|
||||
|
@ -29,12 +29,22 @@
|
||||
|
||||
#define pr_prefix "vlapic: "
|
||||
|
||||
#include <hypervisor.h>
|
||||
|
||||
#include <instr_emul.h>
|
||||
|
||||
#include <types.h>
|
||||
#include <errno.h>
|
||||
#include <bits.h>
|
||||
#include <atomic.h>
|
||||
#include <per_cpu.h>
|
||||
#include <pgtable.h>
|
||||
#include <lapic.h>
|
||||
#include <vmcs.h>
|
||||
#include <vlapic.h>
|
||||
#include <ptdev.h>
|
||||
#include <vmx.h>
|
||||
#include <vm.h>
|
||||
#include <ept.h>
|
||||
#include <trace.h>
|
||||
#include <logmsg.h>
|
||||
#include "vlapic_priv.h"
|
||||
#include "vlapic.h"
|
||||
|
||||
#define VLAPIC_VERBOS 0
|
||||
|
||||
|
@ -18,6 +18,8 @@
|
||||
#include <console.h>
|
||||
#include <ptdev.h>
|
||||
#include <vmcs.h>
|
||||
#include <pgtable.h>
|
||||
#include <mmu.h>
|
||||
#include <logmsg.h>
|
||||
|
||||
vm_sw_loader_t vm_sw_loader;
|
||||
|
@ -4,8 +4,15 @@
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <hypervisor.h>
|
||||
#include <types.h>
|
||||
#include <errno.h>
|
||||
#include <spinlock.h>
|
||||
#include <vcpu.h>
|
||||
#include <vm.h>
|
||||
#include <acrn_hv_defs.h>
|
||||
#include <hypercall.h>
|
||||
#include <trace.h>
|
||||
#include <logmsg.h>
|
||||
|
||||
static spinlock_t vmm_hypercall_lock = {
|
||||
.head = 0U,
|
||||
|
@ -6,9 +6,19 @@
|
||||
* this file contains vmcs operations which is vcpu related
|
||||
*/
|
||||
|
||||
#include <hypervisor.h>
|
||||
#include <cpu.h>
|
||||
#include <virtual_cr.h>
|
||||
#include <types.h>
|
||||
#include <errno.h>
|
||||
#include <vmcs.h>
|
||||
#include <vcpu.h>
|
||||
#include <vm.h>
|
||||
#include <vmx.h>
|
||||
#include <gdt.h>
|
||||
#include <pgtable.h>
|
||||
#include <per_cpu.h>
|
||||
#include <cpu_caps.h>
|
||||
#include <cpufeatures.h>
|
||||
#include <vmexit.h>
|
||||
#include <logmsg.h>
|
||||
|
||||
uint64_t vmx_rdmsr_pat(const struct acrn_vcpu *vcpu)
|
||||
{
|
||||
|
@ -4,9 +4,19 @@
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <hypervisor.h>
|
||||
#include <virtual_cr.h>
|
||||
#include <types.h>
|
||||
#include <errno.h>
|
||||
#include <vmx.h>
|
||||
#include <irq.h>
|
||||
#include <mmu.h>
|
||||
#include <vcpu.h>
|
||||
#include <vm.h>
|
||||
#include <vmexit.h>
|
||||
#include <io_emul.h>
|
||||
#include <ept.h>
|
||||
#include <vtd.h>
|
||||
#include <vcpuid.h>
|
||||
#include <trace.h>
|
||||
|
||||
/*
|
||||
* According to "SDM APPENDIX C VMX BASIC EXIT REASONS",
|
||||
|
@ -4,8 +4,18 @@
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <hypervisor.h>
|
||||
#include <types.h>
|
||||
#include <errno.h>
|
||||
#include <pgtable.h>
|
||||
#include <msr.h>
|
||||
#include <vcpu.h>
|
||||
#include <vm.h>
|
||||
#include <vmcs.h>
|
||||
#include <vmx.h>
|
||||
#include <guest_pm.h>
|
||||
#include <ucode.h>
|
||||
#include <trace.h>
|
||||
#include <logmsg.h>
|
||||
|
||||
#define INTERCEPT_DISABLE (0U)
|
||||
#define INTERCEPT_READ (1U << 0U)
|
||||
|
@ -3,7 +3,14 @@
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <hypervisor.h>
|
||||
#include <types.h>
|
||||
#include <vmtrr.h>
|
||||
#include <msr.h>
|
||||
#include <pgtable.h>
|
||||
#include <ept.h>
|
||||
#include <vcpu.h>
|
||||
#include <vm.h>
|
||||
#include <logmsg.h>
|
||||
|
||||
#ifdef CONFIG_MTRR_ENABLED
|
||||
|
||||
|
@ -2,10 +2,21 @@
|
||||
* Copyright (C) <2018> Intel Corporation
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
#include <hypervisor.h>
|
||||
#include <trampoline.h>
|
||||
#include <ioapic.h>
|
||||
#include <vtd.h>
|
||||
|
||||
#include <types.h>
|
||||
#include <acrn_common.h>
|
||||
#include <default_acpi_info.h>
|
||||
#include <platform_acpi_info.h>
|
||||
#include <per_cpu.h>
|
||||
#include <io.h>
|
||||
#include <pgtable.h>
|
||||
#include <host_pm.h>
|
||||
#include <trampoline.h>
|
||||
#include <vmx.h>
|
||||
#include <console.h>
|
||||
#include <ioapic.h>
|
||||
#include <vtd.h>
|
||||
#include <lapic.h>
|
||||
|
||||
struct cpu_context cpu_ctx;
|
||||
|
||||
|
@ -7,6 +7,7 @@
|
||||
#ifndef ASSIGN_H
|
||||
#define ASSIGN_H
|
||||
|
||||
#include <types.h>
|
||||
#include <ptdev.h>
|
||||
|
||||
/**
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#ifndef EPT_H
|
||||
#define EPT_H
|
||||
#include <types.h>
|
||||
|
||||
/**
|
||||
* Invalid HPA is defined for error checking,
|
||||
|
@ -13,8 +13,10 @@
|
||||
|
||||
#ifndef ASSEMBLER
|
||||
|
||||
#include <mmu.h>
|
||||
#include <types.h>
|
||||
|
||||
struct acrn_vcpu;
|
||||
struct acrn_vm;
|
||||
/* Use # of paging level to identify paging mode */
|
||||
enum vm_paging_mode {
|
||||
PAGING_MODE_0_LEVEL = 0U, /* Flat */
|
||||
|
@ -30,6 +30,8 @@
|
||||
#ifndef INSTR_EMUL_H
|
||||
#define INSTR_EMUL_H
|
||||
|
||||
#include <types.h>
|
||||
#include <cpu.h>
|
||||
#include <vcpu.h>
|
||||
|
||||
struct instr_emul_vie_op {
|
||||
|
@ -7,6 +7,7 @@
|
||||
#ifndef IO_EMUL_H
|
||||
#define IO_EMUL_H
|
||||
|
||||
#include <types.h>
|
||||
|
||||
/* Define emulated port IO index */
|
||||
#define PIC_MASTER_PIO_IDX 0U
|
||||
|
@ -20,6 +20,9 @@
|
||||
|
||||
#define NON_TRUSTY_PDPT_ENTRIES 511U
|
||||
|
||||
struct acrn_vcpu;
|
||||
struct acrn_vm;
|
||||
|
||||
/* Structure of seed info */
|
||||
struct seed_info {
|
||||
uint8_t cse_svn;
|
||||
|
@ -59,6 +59,7 @@
|
||||
#include <schedule.h>
|
||||
#include <io_req.h>
|
||||
#include <msr.h>
|
||||
#include <cpu.h>
|
||||
|
||||
/**
|
||||
* @brief vcpu
|
||||
|
@ -11,7 +11,9 @@
|
||||
#define VM_FAIL -1
|
||||
|
||||
#ifndef ASSEMBLER
|
||||
#include <types.h>
|
||||
#include <vmx.h>
|
||||
#include <vcpu.h>
|
||||
|
||||
#define VMX_VMENTRY_FAIL 0x80000000U
|
||||
|
||||
|
@ -9,6 +9,7 @@
|
||||
|
||||
#include <types.h>
|
||||
#include <acrn_common.h>
|
||||
#include <list.h>
|
||||
|
||||
/**
|
||||
* @brief I/O Emulation
|
||||
|
@ -9,6 +9,7 @@
|
||||
|
||||
#include <acrn_common.h>
|
||||
#include <util.h>
|
||||
#include <spinlock.h>
|
||||
|
||||
/**
|
||||
* @file arch/x86/irq.h
|
||||
@ -63,6 +64,8 @@
|
||||
#define IRQF_LEVEL (1U << 1U) /* 1: level trigger; 0: edge trigger */
|
||||
#define IRQF_PT (1U << 2U) /* 1: for passthrough dev */
|
||||
|
||||
struct acrn_vcpu;
|
||||
|
||||
/*
|
||||
* Definition of the stack frame layout
|
||||
*/
|
||||
|
@ -7,6 +7,9 @@
|
||||
#ifndef INTR_LAPIC_H
|
||||
#define INTR_LAPIC_H
|
||||
|
||||
#include <types.h>
|
||||
#include <apicreg.h>
|
||||
|
||||
/* intr_lapic_icr_delivery_mode */
|
||||
#define INTR_LAPIC_ICR_FIXED 0x0U
|
||||
#define INTR_LAPIC_ICR_LP 0x1U
|
||||
|
@ -46,6 +46,7 @@
|
||||
#include <cpu.h>
|
||||
#include <page.h>
|
||||
#include <pgtable.h>
|
||||
#include <cpu_caps.h>
|
||||
|
||||
/* Define cache line size (in bytes) */
|
||||
#define CACHE_LINE_SIZE 64U
|
||||
|
@ -11,6 +11,8 @@
|
||||
#ifndef PGTABLE_H
|
||||
#define PGTABLE_H
|
||||
|
||||
#include <page.h>
|
||||
|
||||
#define PAGE_PRESENT (1UL << 0U)
|
||||
#define PAGE_RW (1UL << 1U)
|
||||
#define PAGE_USER (1UL << 2U)
|
||||
|
@ -6,6 +6,10 @@
|
||||
|
||||
#ifndef PTDEV_H
|
||||
#define PTDEV_H
|
||||
#include <list.h>
|
||||
#include <spinlock.h>
|
||||
#include <pci.h>
|
||||
#include <timer.h>
|
||||
|
||||
#define ACTIVE_FLAG 0x1U /* any non zero should be okay */
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
#ifndef CONSOLE_H
|
||||
#define CONSOLE_H
|
||||
|
||||
#include <pci.h>
|
||||
|
||||
/* Switching key combinations for shell and uart console */
|
||||
#define GUEST_CONSOLE_TO_HV_SWITCH_KEY 0 /* CTRL + SPACE */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user