提交 1cd25a88 编写于 作者: A Anthony PERARD 提交者: Stefano Stabellini

xen: Fix vcpu initialization.

Each vcpu need a evtchn binded in qemu, even those that are
offline at QEMU initialisation.
Signed-off-by: NAnthony PERARD <anthony.perard@citrix.com>
Signed-off-by: NStefano Stabellini <stefano.stabellini@eu.citrix.com>
上级 11addd0a
...@@ -614,13 +614,13 @@ static ioreq_t *cpu_get_ioreq(XenIOState *state) ...@@ -614,13 +614,13 @@ static ioreq_t *cpu_get_ioreq(XenIOState *state)
} }
if (port != -1) { if (port != -1) {
for (i = 0; i < smp_cpus; i++) { for (i = 0; i < max_cpus; i++) {
if (state->ioreq_local_port[i] == port) { if (state->ioreq_local_port[i] == port) {
break; break;
} }
} }
if (i == smp_cpus) { if (i == max_cpus) {
hw_error("Fatal error while trying to get io event!\n"); hw_error("Fatal error while trying to get io event!\n");
} }
...@@ -1115,10 +1115,10 @@ int xen_hvm_init(MemoryRegion **ram_memory) ...@@ -1115,10 +1115,10 @@ int xen_hvm_init(MemoryRegion **ram_memory)
hw_error("map buffered IO page returned error %d", errno); hw_error("map buffered IO page returned error %d", errno);
} }
state->ioreq_local_port = g_malloc0(smp_cpus * sizeof (evtchn_port_t)); state->ioreq_local_port = g_malloc0(max_cpus * sizeof (evtchn_port_t));
/* FIXME: how about if we overflow the page here? */ /* FIXME: how about if we overflow the page here? */
for (i = 0; i < smp_cpus; i++) { for (i = 0; i < max_cpus; i++) {
rc = xc_evtchn_bind_interdomain(state->xce_handle, xen_domid, rc = xc_evtchn_bind_interdomain(state->xce_handle, xen_domid,
xen_vcpu_eport(state->shared_page, i)); xen_vcpu_eport(state->shared_page, i));
if (rc == -1) { if (rc == -1) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册