mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 10:13:56 -06:00
hw/xen: Add xen_evtchn device for event channel emulation
Include basic support for setting HVM_PARAM_CALLBACK_IRQ to the global vector method HVM_PARAM_CALLBACK_TYPE_VECTOR, which is handled in-kernel by raising the vector whenever the vCPU's vcpu_info->evtchn_upcall_pending flag is set. Signed-off-by: David Woodhouse <dwmw@amazon.co.uk> Reviewed-by: Paul Durrant <paul@xen.org>
This commit is contained in:
parent
5dbcd01a8d
commit
91cce75617
5 changed files with 194 additions and 1 deletions
|
@ -22,6 +22,7 @@
|
|||
#include "sysemu/runstate.h"
|
||||
|
||||
#include "hw/i386/kvm/xen_overlay.h"
|
||||
#include "hw/i386/kvm/xen_evtchn.h"
|
||||
|
||||
#include "hw/xen/interface/version.h"
|
||||
#include "hw/xen/interface/sched.h"
|
||||
|
@ -510,6 +511,10 @@ static bool handle_set_param(struct kvm_xen_exit *exit, X86CPU *cpu,
|
|||
}
|
||||
|
||||
switch (hp.index) {
|
||||
case HVM_PARAM_CALLBACK_IRQ:
|
||||
err = xen_evtchn_set_callback_param(hp.value);
|
||||
xen_set_long_mode(exit->u.hcall.longmode);
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
@ -719,6 +724,16 @@ int kvm_xen_soft_reset(void)
|
|||
|
||||
trace_kvm_xen_soft_reset();
|
||||
|
||||
/*
|
||||
* Zero is the reset/startup state for HVM_PARAM_CALLBACK_IRQ. Strictly,
|
||||
* it maps to HVM_PARAM_CALLBACK_TYPE_GSI with GSI#0, but Xen refuses to
|
||||
* to deliver to the timer interrupt and treats that as 'disabled'.
|
||||
*/
|
||||
err = xen_evtchn_set_callback_param(0);
|
||||
if (err) {
|
||||
return err;
|
||||
}
|
||||
|
||||
CPU_FOREACH(cpu) {
|
||||
async_run_on_cpu(cpu, do_vcpu_soft_reset, RUN_ON_CPU_NULL);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue