mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-16 18:57:26 +00:00
hv: Handling IO exits in ACRN for partition mode
There is no SOS and device model in strict partition mode. ACRN emulates IO for virtual devices. Any access to IO not backed by HV should return all FFs on read and writes should be discarded. Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com>
This commit is contained in:
parent
a8fcc0fa4b
commit
42cabf6965
@ -107,6 +107,18 @@ int32_t dm_emulate_mmio_post(struct vcpu *vcpu)
|
||||
return emulate_mmio_post(vcpu, io_req);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PARTITION_MODE
|
||||
static void io_instr_dest_handler(struct io_request *io_req)
|
||||
{
|
||||
struct pio_request *pio_req = &io_req->reqs.pio;
|
||||
|
||||
if (pio_req->direction == REQUEST_READ) {
|
||||
pio_req->value = 0xFFFFFFFFU;
|
||||
}
|
||||
io_req->processed = REQ_STATE_COMPLETE;
|
||||
}
|
||||
#endif
|
||||
|
||||
void emulate_io_post(struct vcpu *vcpu)
|
||||
{
|
||||
union vhm_request_buffer *req_buf;
|
||||
@ -296,6 +308,15 @@ emulate_io(struct vcpu *vcpu, struct io_request *io_req)
|
||||
}
|
||||
|
||||
if (status == -ENODEV) {
|
||||
#ifdef CONFIG_PARTITION_MODE
|
||||
/*
|
||||
* No handler from HV side, return all FFs on read
|
||||
* and discard writes.
|
||||
*/
|
||||
io_instr_dest_handler(io_req);
|
||||
status = 0;
|
||||
|
||||
#else
|
||||
/*
|
||||
* No handler from HV side, search from VHM in Dom0
|
||||
*
|
||||
@ -309,6 +330,7 @@ emulate_io(struct vcpu *vcpu, struct io_request *io_req)
|
||||
(pio_req->direction != REQUEST_READ) ? "read" : "write",
|
||||
pio_req->address, pio_req->size);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
return status;
|
||||
|
Loading…
Reference in New Issue
Block a user