mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-08-08 11:39:39 +00:00
hv: move 'emul_pio[]' from strcut vm_arch to acrn_vm
Move ‘emul_pio[]/default_io_read/default_io_write’ from struct vm_arch to struct acrn_vm Tracked-On: #1842 Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com> Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
parent
35c8437bbc
commit
0a1c016dbb
@ -262,14 +262,14 @@ hv_emulate_pio(struct acrn_vcpu *vcpu, struct io_request *io_req)
|
|||||||
struct acrn_vm *vm = vcpu->vm;
|
struct acrn_vm *vm = vcpu->vm;
|
||||||
struct pio_request *pio_req = &io_req->reqs.pio;
|
struct pio_request *pio_req = &io_req->reqs.pio;
|
||||||
struct vm_io_handler_desc *handler;
|
struct vm_io_handler_desc *handler;
|
||||||
io_read_fn_t io_read = vm->arch_vm.default_io_read;
|
io_read_fn_t io_read = vm->default_io_read;
|
||||||
io_write_fn_t io_write = vm->arch_vm.default_io_write;
|
io_write_fn_t io_write = vm->default_io_write;
|
||||||
|
|
||||||
port = (uint16_t)pio_req->address;
|
port = (uint16_t)pio_req->address;
|
||||||
size = (uint16_t)pio_req->size;
|
size = (uint16_t)pio_req->size;
|
||||||
|
|
||||||
for (idx = 0U; idx < EMUL_PIO_IDX_MAX; idx++) {
|
for (idx = 0U; idx < EMUL_PIO_IDX_MAX; idx++) {
|
||||||
handler = &(vm->arch_vm.emul_pio[idx]);
|
handler = &(vm->emul_pio[idx]);
|
||||||
|
|
||||||
if ((port < handler->port_start) || (port >= handler->port_end)) {
|
if ((port < handler->port_start) || (port >= handler->port_end)) {
|
||||||
continue;
|
continue;
|
||||||
@ -598,10 +598,10 @@ void register_pio_emulation_handler(struct acrn_vm *vm, uint32_t pio_idx,
|
|||||||
if (is_sos_vm(vm)) {
|
if (is_sos_vm(vm)) {
|
||||||
deny_guest_pio_access(vm, range->base, range->len);
|
deny_guest_pio_access(vm, range->base, range->len);
|
||||||
}
|
}
|
||||||
vm->arch_vm.emul_pio[pio_idx].port_start = range->base;
|
vm->emul_pio[pio_idx].port_start = range->base;
|
||||||
vm->arch_vm.emul_pio[pio_idx].port_end = range->base + range->len;
|
vm->emul_pio[pio_idx].port_end = range->base + range->len;
|
||||||
vm->arch_vm.emul_pio[pio_idx].io_read = io_read_fn_ptr;
|
vm->emul_pio[pio_idx].io_read = io_read_fn_ptr;
|
||||||
vm->arch_vm.emul_pio[pio_idx].io_write = io_write_fn_ptr;
|
vm->emul_pio[pio_idx].io_write = io_write_fn_ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -669,8 +669,8 @@ int32_t register_mmio_emulation_handler(struct acrn_vm *vm,
|
|||||||
*/
|
*/
|
||||||
void register_pio_default_emulation_handler(struct acrn_vm *vm)
|
void register_pio_default_emulation_handler(struct acrn_vm *vm)
|
||||||
{
|
{
|
||||||
vm->arch_vm.default_io_read = pio_default_read;
|
vm->default_io_read = pio_default_read;
|
||||||
vm->arch_vm.default_io_write = pio_default_write;
|
vm->default_io_write = pio_default_write;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -111,9 +111,6 @@ struct vm_arch {
|
|||||||
void *tmp_pg_array; /* Page array for tmp guest paging struct */
|
void *tmp_pg_array; /* Page array for tmp guest paging struct */
|
||||||
struct acrn_vioapic vioapic; /* Virtual IOAPIC base address */
|
struct acrn_vioapic vioapic; /* Virtual IOAPIC base address */
|
||||||
struct acrn_vpic vpic; /* Virtual PIC */
|
struct acrn_vpic vpic; /* Virtual PIC */
|
||||||
struct vm_io_handler_desc emul_pio[EMUL_PIO_IDX_MAX];
|
|
||||||
io_read_fn_t default_io_read;
|
|
||||||
io_write_fn_t default_io_write;
|
|
||||||
|
|
||||||
/* reference to virtual platform to come here (as needed) */
|
/* reference to virtual platform to come here (as needed) */
|
||||||
} __aligned(PAGE_SIZE);
|
} __aligned(PAGE_SIZE);
|
||||||
@ -136,6 +133,10 @@ struct acrn_vm {
|
|||||||
struct mem_io_node emul_mmio[CONFIG_MAX_EMULATED_MMIO_REGIONS];
|
struct mem_io_node emul_mmio[CONFIG_MAX_EMULATED_MMIO_REGIONS];
|
||||||
hv_mem_io_handler_t default_read_write;
|
hv_mem_io_handler_t default_read_write;
|
||||||
|
|
||||||
|
struct vm_io_handler_desc emul_pio[EMUL_PIO_IDX_MAX];
|
||||||
|
io_read_fn_t default_io_read;
|
||||||
|
io_write_fn_t default_io_write;
|
||||||
|
|
||||||
uint8_t GUID[16];
|
uint8_t GUID[16];
|
||||||
struct secure_world_control sworld_control;
|
struct secure_world_control sworld_control;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user