Skip to contentSkip to conversation

kvm: qemu: support ioperm for vcpu hotplug

PATCH Guillaume Thouvenin 2 participants 2 messages Nov 12, 2008 1 message not in the archive KVM

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

Review static void *ap_main_loop(void *_env) · line 463

Quoted 11 lines · On Tue, 11 Nov 2008 16:28:04 -0000 Avi Kivity <[email protected]> wrote:
(quoted diff) +4 -0
@@ -450,6 +454,10 @@ static void *ap_main_loop(void *_env)
     kvm_create_vcpu(kvm_context, env->cpu_index);
     kvm_qemu_init_env(env);
 
+    /* do ioperm for io ports of assigned devices */
+    LIST_FOREACH(data, &ioperm_head, entries)
+	on_vcpu(env, kvm_arch_do_ioperm, data);
+
     /* signal VCPU creation */
     pthread_mutex_lock(&qemu_mutex);
     vcpu->created = 1;

kvm_arch_do_ioperm() is defined if USE_KVM_DEVICE_ASSIGNMENT is defined. So this should be wrapped by:

#ifdef USE_KVM_DEVICE_ASSIGNMENT 
     /* do ioperm for io ports of assigned devices */
     LIST_FOREACH(data, &ioperm_head, entries)
        on_vcpu(env, kvm_arch_do_ioperm, data);

#endif

no?

Best regards,
Guillaume

#2 lore raw
Quoted 19 lines · Guillaume Thouvenin

Review static void *ap_main_loop(void *_env) · line 463

Quoted 11 lines · On Tue, 11 Nov 2008 16:28:04 -0000 Avi Kivity <[email protected]> wrote:
(quoted diff) +4 -0
@@ -450,6 +454,10 @@ static void *ap_main_loop(void *_env)
     kvm_create_vcpu(kvm_context, env->cpu_index);
     kvm_qemu_init_env(env);
 
+    /* do ioperm for io ports of assigned devices */
+    LIST_FOREACH(data, &ioperm_head, entries)
+	on_vcpu(env, kvm_arch_do_ioperm, data);
+
     /* signal VCPU creation */
     pthread_mutex_lock(&qemu_mutex);
     vcpu->created = 1;

kvm_arch_do_ioperm() is defined if USE_KVM_DEVICE_ASSIGNMENT is defined. So this should be wrapped by:

Quoted 7 lines
#ifdef USE_KVM_DEVICE_ASSIGNMENT
     /* do ioperm for io ports of assigned devices */
     LIST_FOREACH(data, &ioperm_head, entries)
        on_vcpu(env, kvm_arch_do_ioperm, data);

#endif

no?

yes, it is better to wrap it. Thanks.

Regards,
Weidong

Quoted 3 lines

Best regards,
Guillaume