mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-23 17:58:30 +00:00
hv:Replace vlapic pointer with instance in vcpu_arch
-- update 'vlapic' in 'struct vcpu_arch' from pointer to instance -- add inline function(vcpu_vlapic) in vcpu.h Tracked-On: #861 Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -132,7 +132,7 @@ static inline void cpuid_subleaf(uint32_t leaf, uint32_t subleaf,
|
||||
}
|
||||
|
||||
int set_vcpuid_entries(struct vm *vm);
|
||||
void guest_cpuid(const struct vcpu *vcpu,
|
||||
void guest_cpuid(struct vcpu *vcpu,
|
||||
uint32_t *eax, uint32_t *ebx,
|
||||
uint32_t *ecx, uint32_t *edx);
|
||||
|
||||
|
@@ -166,6 +166,8 @@ struct cpu_context {
|
||||
struct vcpu_arch {
|
||||
/* vmcs region for this vcpu, MUST be 4KB-aligned */
|
||||
uint8_t vmcs[CPU_PAGE_SIZE];
|
||||
/* per vcpu lapic */
|
||||
struct acrn_vlapic vlapic;
|
||||
int cur_context;
|
||||
struct cpu_context contexts[NR_WORLD];
|
||||
|
||||
@@ -203,8 +205,6 @@ struct vcpu_arch {
|
||||
bool inject_event_pending;
|
||||
struct event_injection_info inject_info;
|
||||
|
||||
/* per vcpu lapic */
|
||||
void *vlapic;
|
||||
} __aligned(CPU_PAGE_SIZE);
|
||||
|
||||
struct vm;
|
||||
@@ -264,6 +264,12 @@ static inline void vcpu_retain_rip(struct vcpu *vcpu)
|
||||
(vcpu)->arch_vcpu.inst_len = 0U;
|
||||
}
|
||||
|
||||
static inline struct acrn_vlapic *
|
||||
vcpu_vlapic(struct vcpu *vcpu)
|
||||
{
|
||||
return &(vcpu->arch_vcpu.vlapic);
|
||||
}
|
||||
|
||||
/* External Interfaces */
|
||||
uint64_t vcpu_get_gpreg(struct vcpu *vcpu, uint32_t reg);
|
||||
void vcpu_set_gpreg(struct vcpu *vcpu, uint32_t reg, uint64_t val);
|
||||
|
Reference in New Issue
Block a user