mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-23 09:47:44 +00:00
HV Cx: allow guest to access host idle port
with this patch guest could access idle io port and enter idle normally. Signed-off-by: Victor Sun <victor.sun@intel.com> Acked-by: Kevin Tian <kevin.tian@intel.com>
This commit is contained in:
@@ -190,6 +190,22 @@ void free_io_emulation_resource(struct vm *vm)
|
||||
free(vm->arch_vm.iobitmap[1]);
|
||||
}
|
||||
|
||||
void allow_guest_io_access(struct vm *vm, uint32_t address, uint32_t nbytes)
|
||||
{
|
||||
uint32_t *b;
|
||||
uint32_t i;
|
||||
uint32_t a;
|
||||
|
||||
b = vm->arch_vm.iobitmap[0];
|
||||
for (i = 0; i < nbytes; i++) {
|
||||
if (address & 0x8000)
|
||||
b = vm->arch_vm.iobitmap[1];
|
||||
a = address & 0x7fff;
|
||||
b[a >> 5] &= ~(1 << (a & 0x1f));
|
||||
address++;
|
||||
}
|
||||
}
|
||||
|
||||
static void deny_guest_io_access(struct vm *vm, uint32_t address, uint32_t nbytes)
|
||||
{
|
||||
uint32_t *b;
|
||||
|
Reference in New Issue
Block a user