mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-01-05 15:45:05 +00:00
hv:Replace vioapic pointer with instance in structure vm
-- rename struct vioapic --> struct acrn_vioapic -- update 'vioapic' field in 'struct arch_vm' from pointer to instance -- change vm_ioapic(vm) to inline, and move it to vm.h -- change vioapic_init to void type Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com> Reviewed-by: Anthony Xu <anthony.xu@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -32,14 +32,25 @@
|
||||
#define _VIOAPIC_H_
|
||||
|
||||
#include <apicreg.h>
|
||||
#include <vm.h>
|
||||
|
||||
#define VIOAPIC_BASE 0xFEC00000UL
|
||||
#define VIOAPIC_SIZE 4096UL
|
||||
|
||||
struct vioapic *vioapic_init(struct vm *vm);
|
||||
void vioapic_cleanup(struct vioapic *vioapic);
|
||||
void vioapic_reset(struct vioapic *vioapic);
|
||||
#define REDIR_ENTRIES_HW 120U /* SOS align with native ioapic */
|
||||
|
||||
struct acrn_vioapic {
|
||||
struct vm *vm;
|
||||
spinlock_t mtx;
|
||||
uint32_t id;
|
||||
uint32_t ioregsel;
|
||||
union ioapic_rte rtbl[REDIR_ENTRIES_HW];
|
||||
/* sum of pin asserts (+1) and deasserts (-1) */
|
||||
int32_t acnt[REDIR_ENTRIES_HW];
|
||||
};
|
||||
|
||||
void vioapic_init(struct vm *vm);
|
||||
void vioapic_cleanup(struct acrn_vioapic *vioapic);
|
||||
void vioapic_reset(struct acrn_vioapic *vioapic);
|
||||
|
||||
void vioapic_assert_irq(struct vm *vm, uint32_t irq);
|
||||
void vioapic_deassert_irq(struct vm *vm, uint32_t irq);
|
||||
|
||||
@@ -98,7 +98,7 @@ struct vm_arch {
|
||||
void *tmp_pg_array; /* Page array for tmp guest paging struct */
|
||||
void *iobitmap[2];/* IO bitmap page array base address for this VM */
|
||||
void *msr_bitmap; /* MSR bitmap page base address for this VM */
|
||||
void *virt_ioapic; /* Virtual IOAPIC base address */
|
||||
struct acrn_vioapic vioapic; /* Virtual IOAPIC base address */
|
||||
struct acrn_vpic vpic; /* Virtual PIC */
|
||||
/**
|
||||
* A link to the IO handler of this VM.
|
||||
@@ -255,6 +255,12 @@ vm_pic(struct vm *vm)
|
||||
return (struct acrn_vpic *)&(vm->arch_vm.vpic);
|
||||
}
|
||||
|
||||
static inline struct acrn_vioapic *
|
||||
vm_ioapic(struct vm *vm)
|
||||
{
|
||||
return (struct acrn_vioapic *)&(vm->arch_vm.vioapic);
|
||||
}
|
||||
|
||||
int shutdown_vm(struct vm *vm);
|
||||
void pause_vm(struct vm *vm);
|
||||
void resume_vm(struct vm *vm);
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <host_pm.h>
|
||||
#include <vpic.h>
|
||||
#include <vuart.h>
|
||||
#include <vioapic.h>
|
||||
#include <vm.h>
|
||||
#include <cpuid.h>
|
||||
#include <mmu.h>
|
||||
@@ -35,7 +36,6 @@
|
||||
#include <vtd.h>
|
||||
|
||||
#include <vlapic.h>
|
||||
#include <vioapic.h>
|
||||
#include <guest.h>
|
||||
#include <vmexit.h>
|
||||
#include <cpufeatures.h>
|
||||
|
||||
Reference in New Issue
Block a user