[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 12/23] hyperv: address HvSintRoute by X86CPU poin
From: |
Roman Kagan |
Subject: |
[Qemu-devel] [PATCH v2 12/23] hyperv: address HvSintRoute by X86CPU pointer |
Date: |
Wed, 21 Jun 2017 19:24:13 +0300 |
Use X86CPU pointer to refer to the respective HvSintRoute instead of
vp_index. This is more convenient and also paves the way for future
enhancements.
Signed-off-by: Roman Kagan <address@hidden>
---
v1 -> v2:
- was patch 11 in v1
- pass vp_index to sint_route_create, and lookup X86CPU * inside
target/i386/hyperv.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/target/i386/hyperv.c b/target/i386/hyperv.c
index 84ea228..b5831bf 100644
--- a/target/i386/hyperv.c
+++ b/target/i386/hyperv.c
@@ -18,7 +18,7 @@
struct HvSintRoute {
uint32_t sint;
- uint32_t vcpu_id;
+ X86CPU *cpu;
int gsi;
EventNotifier sint_set_notifier;
EventNotifier sint_ack_notifier;
@@ -97,6 +97,12 @@ HvSintRoute *kvm_hv_sint_route_create(uint32_t vp_index,
uint32_t sint,
HvSintRoute *sint_route;
EventNotifier *ack_notifier;
int r, gsi;
+ X86CPU *cpu;
+
+ cpu = hyperv_find_vcpu(vp_index);
+ if (!cpu) {
+ return NULL;
+ }
sint_route = g_new0(HvSintRoute, 1);
r = event_notifier_init(&sint_route->sint_set_notifier, false);
@@ -128,7 +134,7 @@ HvSintRoute *kvm_hv_sint_route_create(uint32_t vp_index,
uint32_t sint,
sint_route->gsi = gsi;
sint_route->sint_ack_clb = sint_ack_clb;
sint_route->sint_ack_clb_data = sint_ack_clb_data;
- sint_route->vcpu_id = vp_index;
+ sint_route->cpu = cpu;
sint_route->sint = sint;
return sint_route;
--
2.9.4
- Re: [Qemu-devel] [PATCH v2 07/23] hyperv: ensure VP index equal to QEMU cpu_index, (continued)
- Re: [Qemu-devel] [PATCH v2 07/23] hyperv: ensure VP index equal to QEMU cpu_index, Igor Mammedov, 2017/06/28
- Re: [Qemu-devel] [PATCH v2 07/23] hyperv: ensure VP index equal to QEMU cpu_index, Roman Kagan, 2017/06/29
- Re: [Qemu-devel] [PATCH v2 07/23] hyperv: ensure VP index equal to QEMU cpu_index, Igor Mammedov, 2017/06/29
- Re: [Qemu-devel] [PATCH v2 07/23] hyperv: ensure VP index equal to QEMU cpu_index, Roman Kagan, 2017/06/29
- Re: [Qemu-devel] [PATCH v2 07/23] hyperv: ensure VP index equal to QEMU cpu_index, Igor Mammedov, 2017/06/29
- Re: [Qemu-devel] [PATCH v2 07/23] hyperv: ensure VP index equal to QEMU cpu_index, Roman Kagan, 2017/06/29
[Qemu-devel] [PATCH v2 08/23] hyperv_testdev: refactor for readability, Roman Kagan, 2017/06/21
[Qemu-devel] [PATCH v2 09/23] hyperv: cosmetic: g_malloc -> g_new, Roman Kagan, 2017/06/21
[Qemu-devel] [PATCH v2 10/23] hyperv: synic: only setup ack notifier if there's a callback, Roman Kagan, 2017/06/21
[Qemu-devel] [PATCH v2 11/23] hyperv: allow passing arbitrary data to sint ack callback, Roman Kagan, 2017/06/21
[Qemu-devel] [PATCH v2 12/23] hyperv: address HvSintRoute by X86CPU pointer,
Roman Kagan <=
[Qemu-devel] [PATCH v2 13/23] hyperv: make HvSintRoute reference-counted, Roman Kagan, 2017/06/21
[Qemu-devel] [PATCH v2 14/23] hyperv: qom-ify SynIC, Roman Kagan, 2017/06/21
[Qemu-devel] [PATCH v2 15/23] hyperv: block SynIC use in QEMU in incompatible configurations, Roman Kagan, 2017/06/21
[Qemu-devel] [PATCH v2 16/23] hyperv: make overlay pages for SynIC, Roman Kagan, 2017/06/21
[Qemu-devel] [PATCH v2 18/23] hyperv: add synic event flag signaling, Roman Kagan, 2017/06/21
[Qemu-devel] [PATCH v2 19/23] hyperv: process SIGNAL_EVENT hypercall, Roman Kagan, 2017/06/21
[Qemu-devel] [PATCH v2 20/23] hyperv: process POST_MESSAGE hypercall, Roman Kagan, 2017/06/21
[Qemu-devel] [PATCH v2 21/23] hyperv_testdev: add SynIC message and event testmodes, Roman Kagan, 2017/06/21