gprintk(XENLOG_ERR, "Unsuccessful map-cache invalidate\n");
}
-int handle_mmio(void)
+bool handle_mmio(void)
{
struct hvm_emulate_ctxt ctxt;
struct vcpu *curr = current;
{
case X86EMUL_UNHANDLEABLE:
hvm_dump_emulation_state(XENLOG_G_WARNING "MMIO", &ctxt);
- return 0;
+ return false;
+
case X86EMUL_EXCEPTION:
if ( ctxt.ctxt.event_pending )
hvm_inject_event(&ctxt.ctxt.event);
break;
- default:
- break;
}
hvm_emulate_writeback(&ctxt);
- return 1;
+ return true;
}
-int handle_mmio_with_translation(unsigned long gla, unsigned long gpfn,
- struct npfec access)
+bool handle_mmio_with_translation(unsigned long gla, unsigned long gpfn,
+ struct npfec access)
{
struct hvm_vcpu_io *vio = ¤t->arch.hvm_vcpu.hvm_io;
return handle_mmio();
}
-int handle_pio(uint16_t port, unsigned int size, int dir)
+bool handle_pio(uint16_t port, unsigned int size, int dir)
{
struct vcpu *curr = current;
struct hvm_vcpu_io *vio = &curr->arch.hvm_vcpu.hvm_io;
memcpy(&guest_cpu_user_regs()->rax, &data, size);
}
break;
+
case X86EMUL_RETRY:
/* We should not advance RIP/EIP if the domain is shutting down */
if ( curr->domain->is_shutting_down )
- return 0;
-
+ return false;
break;
+
default:
gdprintk(XENLOG_ERR, "Weird HVM ioemulation status %d.\n", rc);
domain_crash(curr->domain);
- break;
+ return false;
}
- return 1;
+ return true;
}
static bool_t dpci_portio_accept(const struct hvm_io_handler *handler,
{
case HVMIO_no_completion:
break;
+
case HVMIO_mmio_completion:
- handle_mmio();
- break;
+ return handle_mmio();
+
case HVMIO_pio_completion:
- (void)handle_pio(vio->io_req.addr, vio->io_req.size,
- vio->io_req.dir);
- break;
+ return handle_pio(vio->io_req.addr, vio->io_req.size,
+ vio->io_req.dir);
+
case HVMIO_realmode_completion:
{
struct hvm_emulate_ctxt ctxt;
void send_timeoffset_req(unsigned long timeoff);
void send_invalidate_req(void);
-int handle_mmio(void);
-int handle_mmio_with_translation(unsigned long gla, unsigned long gpfn,
- struct npfec);
-int handle_pio(uint16_t port, unsigned int size, int dir);
+bool handle_mmio(void);
+bool handle_mmio_with_translation(unsigned long gla, unsigned long gpfn,
+ struct npfec);
+bool handle_pio(uint16_t port, unsigned int size, int dir);
void hvm_interrupt_post(struct vcpu *v, int vector, int type);
void hvm_dpci_eoi(struct domain *d, unsigned int guest_irq,
const union vioapic_redir_entry *ent);