mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-28 16:27:01 +00:00
hv:cleanup header file for vm.c & vm.h
-- now hypervisor.h is the universal set of header file, this patch doesn't include hypervisor.h, only include some necessary header files for vm.c and vm.h -- move 'struct vcpuid_entry' from vm.h to vcpuid.h -- remove dead code 'enum vm_privilege_level' -- move 'enum vpic_wire_mode' from vm.h to vpic.h Tracked-On: #1842 Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com> Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
parent
b5f4757650
commit
3d878a9123
@ -4,12 +4,21 @@
|
|||||||
* SPDX-License-Identifier: BSD-3-Clause
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <hypervisor.h>
|
#include <types.h>
|
||||||
#include <bsp_extern.h>
|
#include <errno.h>
|
||||||
#include <multiboot.h>
|
#include <sprintf.h>
|
||||||
|
#include <vm.h>
|
||||||
|
#include <bits.h>
|
||||||
#include <e820.h>
|
#include <e820.h>
|
||||||
|
#include <multiboot.h>
|
||||||
#include <vtd.h>
|
#include <vtd.h>
|
||||||
#include <reloc.h>
|
#include <reloc.h>
|
||||||
|
#include <ept.h>
|
||||||
|
#include <guest_pm.h>
|
||||||
|
#include <console.h>
|
||||||
|
#include <ptdev.h>
|
||||||
|
#include <vmcs.h>
|
||||||
|
#include <logmsg.h>
|
||||||
|
|
||||||
vm_sw_loader_t vm_sw_loader;
|
vm_sw_loader_t vm_sw_loader;
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
#ifndef TRUSTY_H_
|
#ifndef TRUSTY_H_
|
||||||
#define TRUSTY_H_
|
#define TRUSTY_H_
|
||||||
|
#include <acrn_hv_defs.h>
|
||||||
|
|
||||||
#define BOOTLOADER_SEED_MAX_ENTRIES 10U
|
#define BOOTLOADER_SEED_MAX_ENTRIES 10U
|
||||||
#define RPMB_MAX_PARTITION_NUMBER 6U
|
#define RPMB_MAX_PARTITION_NUMBER 6U
|
||||||
|
@ -52,6 +52,11 @@
|
|||||||
|
|
||||||
#include <guest_memory.h>
|
#include <guest_memory.h>
|
||||||
#include <virtual_cr.h>
|
#include <virtual_cr.h>
|
||||||
|
#include <vlapic.h>
|
||||||
|
#include <vmtrr.h>
|
||||||
|
#include <schedule.h>
|
||||||
|
#include <io_req.h>
|
||||||
|
#include <msr.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief vcpu
|
* @brief vcpu
|
||||||
|
@ -7,6 +7,19 @@
|
|||||||
#ifndef VCPUID_H_
|
#ifndef VCPUID_H_
|
||||||
#define VCPUID_H_
|
#define VCPUID_H_
|
||||||
|
|
||||||
|
#define CPUID_CHECK_SUBLEAF (1U << 0U)
|
||||||
|
#define MAX_VM_VCPUID_ENTRIES 64U
|
||||||
|
struct vcpuid_entry {
|
||||||
|
uint32_t eax;
|
||||||
|
uint32_t ebx;
|
||||||
|
uint32_t ecx;
|
||||||
|
uint32_t edx;
|
||||||
|
uint32_t leaf;
|
||||||
|
uint32_t subleaf;
|
||||||
|
uint32_t flags;
|
||||||
|
uint32_t padding;
|
||||||
|
};
|
||||||
|
|
||||||
int32_t set_vcpuid_entries(struct acrn_vm *vm);
|
int32_t set_vcpuid_entries(struct acrn_vm *vm);
|
||||||
void guest_cpuid(struct acrn_vcpu *vcpu,
|
void guest_cpuid(struct acrn_vcpu *vcpu,
|
||||||
uint32_t *eax, uint32_t *ebx,
|
uint32_t *eax, uint32_t *ebx,
|
||||||
|
@ -31,6 +31,8 @@
|
|||||||
#define VLAPIC_H
|
#define VLAPIC_H
|
||||||
|
|
||||||
#include <page.h>
|
#include <page.h>
|
||||||
|
#include <timer.h>
|
||||||
|
#include <apicreg.h>
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -13,9 +13,18 @@
|
|||||||
|
|
||||||
#ifndef ASSEMBLER
|
#ifndef ASSEMBLER
|
||||||
|
|
||||||
|
#include <types.h>
|
||||||
|
#include <spinlock.h>
|
||||||
|
#include <acrn_common.h>
|
||||||
#include <bsp_extern.h>
|
#include <bsp_extern.h>
|
||||||
|
#include <vcpu.h>
|
||||||
|
#include <vioapic.h>
|
||||||
|
#include <vpic.h>
|
||||||
|
#include <io_emul.h>
|
||||||
|
#include <vuart.h>
|
||||||
|
#include <trusty.h>
|
||||||
|
#include <vcpuid.h>
|
||||||
#include <vpci.h>
|
#include <vpci.h>
|
||||||
#include <page.h>
|
|
||||||
#include <cpu_caps.h>
|
#include <cpu_caps.h>
|
||||||
#include <e820.h>
|
#include <e820.h>
|
||||||
|
|
||||||
@ -75,14 +84,6 @@ struct vm_pm_info {
|
|||||||
/* VM guest types */
|
/* VM guest types */
|
||||||
#define VM_LINUX_GUEST 0x02
|
#define VM_LINUX_GUEST 0x02
|
||||||
#define VM_MONO_GUEST 0x01
|
#define VM_MONO_GUEST 0x01
|
||||||
|
|
||||||
enum vpic_wire_mode {
|
|
||||||
VPIC_WIRE_INTR = 0,
|
|
||||||
VPIC_WIRE_LAPIC,
|
|
||||||
VPIC_WIRE_IOAPIC,
|
|
||||||
VPIC_WIRE_NULL
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Enumerated type for VM states */
|
/* Enumerated type for VM states */
|
||||||
enum vm_state {
|
enum vm_state {
|
||||||
VM_STATE_UNKNOWN = 0,
|
VM_STATE_UNKNOWN = 0,
|
||||||
@ -115,20 +116,6 @@ struct vm_arch {
|
|||||||
/* reference to virtual platform to come here (as needed) */
|
/* reference to virtual platform to come here (as needed) */
|
||||||
} __aligned(PAGE_SIZE);
|
} __aligned(PAGE_SIZE);
|
||||||
|
|
||||||
|
|
||||||
#define CPUID_CHECK_SUBLEAF (1U << 0U)
|
|
||||||
#define MAX_VM_VCPUID_ENTRIES 64U
|
|
||||||
struct vcpuid_entry {
|
|
||||||
uint32_t eax;
|
|
||||||
uint32_t ebx;
|
|
||||||
uint32_t ecx;
|
|
||||||
uint32_t edx;
|
|
||||||
uint32_t leaf;
|
|
||||||
uint32_t subleaf;
|
|
||||||
uint32_t flags;
|
|
||||||
uint32_t padding;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct acrn_vm {
|
struct acrn_vm {
|
||||||
struct vm_arch arch_vm; /* Reference to this VM's arch information */
|
struct vm_arch arch_vm; /* Reference to this VM's arch information */
|
||||||
struct vm_hw_info hw; /* Reference to this VM's HW information */
|
struct vm_hw_info hw; /* Reference to this VM's HW information */
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
#define VM_FAIL -1
|
#define VM_FAIL -1
|
||||||
|
|
||||||
#ifndef ASSEMBLER
|
#ifndef ASSEMBLER
|
||||||
|
#include <vmx.h>
|
||||||
|
|
||||||
#define VMX_VMENTRY_FAIL 0x80000000U
|
#define VMX_VMENTRY_FAIL 0x80000000U
|
||||||
|
|
||||||
|
@ -30,7 +30,6 @@
|
|||||||
#include <vioapic.h>
|
#include <vioapic.h>
|
||||||
#include <vm.h>
|
#include <vm.h>
|
||||||
#include <cpuid.h>
|
#include <cpuid.h>
|
||||||
#include <vcpuid.h>
|
|
||||||
#include <page.h>
|
#include <page.h>
|
||||||
#include <ept.h>
|
#include <ept.h>
|
||||||
#include <mmu.h>
|
#include <mmu.h>
|
||||||
|
@ -53,6 +53,7 @@
|
|||||||
/* IA32E Paging constants */
|
/* IA32E Paging constants */
|
||||||
#define IA32E_REF_MASK ((get_cpu_info())->physical_address_mask)
|
#define IA32E_REF_MASK ((get_cpu_info())->physical_address_mask)
|
||||||
|
|
||||||
|
struct acrn_vcpu;
|
||||||
static inline uint64_t round_page_up(uint64_t addr)
|
static inline uint64_t round_page_up(uint64_t addr)
|
||||||
{
|
{
|
||||||
return (((addr + (uint64_t)PAGE_SIZE) - 1UL) & PAGE_MASK);
|
return (((addr + (uint64_t)PAGE_SIZE) - 1UL) & PAGE_MASK);
|
||||||
|
@ -7,6 +7,8 @@
|
|||||||
#ifndef TIMER_H
|
#ifndef TIMER_H
|
||||||
#define TIMER_H
|
#define TIMER_H
|
||||||
|
|
||||||
|
#include <list.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Timer
|
* @brief Timer
|
||||||
*
|
*
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
#ifndef VTD_H
|
#ifndef VTD_H
|
||||||
#define VTD_H
|
#define VTD_H
|
||||||
|
#include <ptdev.h>
|
||||||
/*
|
/*
|
||||||
* Intel IOMMU register specification per version 1.0 public spec.
|
* Intel IOMMU register specification per version 1.0 public spec.
|
||||||
*/
|
*/
|
||||||
|
@ -38,6 +38,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <apicreg.h>
|
#include <apicreg.h>
|
||||||
|
#include <util.h>
|
||||||
|
|
||||||
#define VIOAPIC_BASE 0xFEC00000UL
|
#define VIOAPIC_BASE 0xFEC00000UL
|
||||||
#define VIOAPIC_SIZE 4096UL
|
#define VIOAPIC_SIZE 4096UL
|
||||||
|
@ -95,6 +95,13 @@
|
|||||||
#define NR_VPIC_PINS_PER_CHIP 8U
|
#define NR_VPIC_PINS_PER_CHIP 8U
|
||||||
#define NR_VPIC_PINS_TOTAL 16U
|
#define NR_VPIC_PINS_TOTAL 16U
|
||||||
|
|
||||||
|
enum vpic_wire_mode {
|
||||||
|
VPIC_WIRE_INTR = 0,
|
||||||
|
VPIC_WIRE_LAPIC,
|
||||||
|
VPIC_WIRE_IOAPIC,
|
||||||
|
VPIC_WIRE_NULL
|
||||||
|
};
|
||||||
|
|
||||||
enum vpic_trigger {
|
enum vpic_trigger {
|
||||||
EDGE_TRIGGER,
|
EDGE_TRIGGER,
|
||||||
LEVEL_TRIGGER
|
LEVEL_TRIGGER
|
||||||
|
Loading…
Reference in New Issue
Block a user