mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-23 05:57:33 +00:00
ioreq: only clear vcpu->req when io request needed
Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
This commit is contained in:
parent
65233802f0
commit
95b6661540
@ -416,8 +416,6 @@ int ept_violation_handler(struct vcpu *vcpu)
|
||||
/* Handle page fault from guest */
|
||||
exit_qual = vcpu->arch_vcpu.exit_qualification;
|
||||
|
||||
memset(&vcpu->req, 0, sizeof(struct vhm_request));
|
||||
|
||||
/* Specify if read or write operation */
|
||||
if (exit_qual & 0x2) {
|
||||
/* Write operation */
|
||||
@ -486,6 +484,8 @@ int ept_violation_handler(struct vcpu *vcpu)
|
||||
* instruction emulation. For MMIO read, ask DM to run MMIO
|
||||
* emulation at first.
|
||||
*/
|
||||
memset(&vcpu->req, 0, sizeof(struct vhm_request));
|
||||
|
||||
status = dm_emulate_mmio_pre(vcpu, exit_qual);
|
||||
if (status != 0)
|
||||
goto out;
|
||||
|
@ -103,8 +103,6 @@ int io_instr_handler(struct vcpu *vcpu)
|
||||
direction = VM_EXIT_IO_INSTRUCTION_ACCESS_DIRECTION(exit_qual);
|
||||
mask = 0xfffffffful >> (32 - 8 * sz);
|
||||
|
||||
memset(&vcpu->req, 0, sizeof(struct vhm_request));
|
||||
|
||||
TRACE_4I(TRC_VMEXIT_IO_INSTRUCTION, port, direction, sz,
|
||||
cur_context_idx);
|
||||
|
||||
@ -149,6 +147,7 @@ int io_instr_handler(struct vcpu *vcpu)
|
||||
if (status != 0) {
|
||||
uint64_t *rax = &cur_context->guest_cpu_regs.regs.rax;
|
||||
|
||||
memset(&vcpu->req, 0, sizeof(struct vhm_request));
|
||||
dm_emulate_pio_pre(vcpu, exit_qual, sz, *rax);
|
||||
status = acrn_insert_request_wait(vcpu, &vcpu->req);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user