mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
x86 hvm: Do not incorrectly retire an instruction emulation when a
read/write cycle to qemu is dropped due to guest suspend. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
This commit is contained in:
1 parent
7cb99e3e81
commit
bac0999325
4 files changed
+9
-7
No files matched your search
@@ -163,8 +163,8 @@ static int hvmemul_do_io(
|
||||
curr->arch.hvm_vcpu.io_state = HVMIO_none;
|
||||
break;
|
||||
case X86EMUL_UNHANDLEABLE:
|
||||
hvm_send_assist_req(curr);
|
||||
rc = (p_data != NULL) ? X86EMUL_RETRY : X86EMUL_OKAY;
|
||||
rc = (!hvm_send_assist_req(curr) || (p_data != NULL)
|
||||
? X86EMUL_RETRY : X86EMUL_OKAY);
|
||||
break;
|
||||
default:
|
||||
BUG();
|
||||
|
||||
@@ -858,12 +858,12 @@ void hvm_vcpu_down(struct vcpu *v)
|
||||
}
|
||||
}
|
||||
|
||||
void hvm_send_assist_req(struct vcpu *v)
|
||||
bool_t hvm_send_assist_req(struct vcpu *v)
|
||||
{
|
||||
ioreq_t *p;
|
||||
|
||||
if ( unlikely(!vcpu_start_shutdown_deferral(v)) )
|
||||
return; /* implicitly bins the i/o operation */
|
||||
return 0; /* implicitly bins the i/o operation */
|
||||
|
||||
p = &get_ioreq(v)->vp_ioreq;
|
||||
if ( unlikely(p->state != STATE_IOREQ_NONE) )
|
||||
@@ -871,7 +871,7 @@ void hvm_send_assist_req(struct vcpu *v)
|
||||
/* This indicates a bug in the device model. Crash the domain. */
|
||||
gdprintk(XENLOG_ERR, "Device model set bad IO state %d.\n", p->state);
|
||||
domain_crash(v->domain);
|
||||
return;
|
||||
return 0;
|
||||
}
|
||||
|
||||
prepare_wait_on_xen_event_channel(v->arch.hvm_vcpu.xen_port);
|
||||
@@ -882,6 +882,8 @@ void hvm_send_assist_req(struct vcpu *v)
|
||||
*/
|
||||
p->state = STATE_IOREQ_READY;
|
||||
notify_via_xen_event_channel(v->arch.hvm_vcpu.xen_port);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
void hvm_hlt(unsigned long rflags)
|
||||
|
||||
@@ -168,7 +168,7 @@ void send_invalidate_req(void)
|
||||
p->data = ~0UL; /* flush all */
|
||||
p->io_count++;
|
||||
|
||||
hvm_send_assist_req(v);
|
||||
(void)hvm_send_assist_req(v);
|
||||
}
|
||||
|
||||
int handle_mmio(void)
|
||||
|
||||
@@ -148,7 +148,7 @@ int hvm_vcpu_cacheattr_init(struct vcpu *v);
|
||||
void hvm_vcpu_cacheattr_destroy(struct vcpu *v);
|
||||
void hvm_vcpu_reset_state(struct vcpu *v, uint16_t cs, uint16_t ip);
|
||||
|
||||
void hvm_send_assist_req(struct vcpu *v);
|
||||
bool_t hvm_send_assist_req(struct vcpu *v);
|
||||
|
||||
void hvm_set_guest_tsc(struct vcpu *v, u64 guest_tsc);
|
||||
u64 hvm_get_guest_tsc(struct vcpu *v);
|
||||
|
||||