hv:move instr_emul_ctxt instance to struct vcpu

move instr_emul_ctxt instance from struct per_cpu_region
to struct vcpu, and rename it from g_inst_ctxt to inst_ctxt

Tracked-On: #1842
Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Jason Chen CJ
2019-02-24 20:19:33 +08:00
committed by Eddie Dong
parent 5331b39520
commit 286731d9d1
8 changed files with 57 additions and 67 deletions

View File

@@ -32,8 +32,9 @@
#include <types.h>
#include <cpu.h>
#include <vcpu.h>
#include <guest_memory.h>
struct acrn_vcpu;
struct instr_emul_vie_op {
uint8_t op_type; /* type of operation (e.g. MOV) */
uint16_t op_flags;
@@ -94,10 +95,9 @@ struct vm_guest_paging {
struct instr_emul_ctxt {
struct instr_emul_vie vie;
struct vm_guest_paging paging;
struct acrn_vcpu *vcpu;
};
int32_t emulate_instruction(const struct acrn_vcpu *vcpu);
int32_t emulate_instruction(struct acrn_vcpu *vcpu);
int32_t decode_instruction(struct acrn_vcpu *vcpu);
#endif

View File

@@ -60,6 +60,7 @@
#include <io_req.h>
#include <msr.h>
#include <cpu.h>
#include <instr_emul.h>
/**
* @brief vcpu
@@ -326,6 +327,7 @@ struct acrn_vcpu {
bool launched; /* Whether the vcpu is launched on target pcpu */
uint32_t running; /* vcpu is picked up and run? */
struct instr_emul_ctxt inst_ctxt;
struct io_request req; /* used by io/ept emulation */
uint64_t reg_cached;

View File

@@ -10,10 +10,13 @@
#include <types.h>
#include <sbuf.h>
#include <irq.h>
#include <page.h>
#include <timer.h>
#include <instr_emul.h>
#include <profiling.h>
#include <logmsg.h>
#include <gdt.h>
#include <schedule.h>
#include <security.h>
struct per_cpu_region {
@@ -36,7 +39,6 @@ struct per_cpu_region {
struct per_cpu_timers cpu_timers;
struct sched_context sched_ctx;
struct sched_object idle;
struct instr_emul_ctxt g_inst_ctxt;
struct host_gdt gdt;
struct tss_64 tss;
enum pcpu_boot_state boot_state;