Re: Dev Passthrough QEMU patch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

On Tue, Jun 11, 2013 at 10:15 AM, Mario Smarduch <mario.smarduch@xxxxxxxxxx> wrote: 
diff --git a/cpus.c b/cpus.c
index c15ff6c..0c19214 100644
--- a/cpus.c
+++ b/cpus.c
@@ -737,6 +737,26 @@ static void *qemu_kvm_cpu_thread_fn(void *arg)
     CPUState *cpu = ENV_GET_CPU(env);
     int r;

+    /* For now just do a 1:1 vCPU binding as they come online for device
+     * pass through
+     */
+    cpu_set_t cpuset;
+    int ret, i;
+    unsigned long cpu_index = kvm_arch_vcpu_id(cpu);
+
+    CPU_ZERO(&cpuset);
+    CPU_SET(cpu_index, &cpuset);
+    ret = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
+    if(ret != 0) {
+       printf("pthread_setaffinity_np failed to setaffinity to CPU 0\n");
+        exit(-1);
+    }
+
+    CPU_ZERO(&cpuset);
+    pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
+    if(CPU_ISSET(cpu_index,&cpuset))
+        printf("Binding: vCPU %ld --> CPU %d\n", cpu_index, i);
+
     qemu_mutex_lock(&qemu_global_mutex);
     qemu_thread_get_self(cpu->thread);
     cpu->thread_id = qemu_get_thread_id();

 
I'm still testing your newer patches. However taken your new version into account this can now be removed from the QEMU patch, is that not the case?

Best regards,
Antonios
_______________________________________________
kvmarm mailing list
kvmarm@xxxxxxxxxxxxxxxxxxxxx
https://lists.cs.columbia.edu/cucslists/listinfo/kvmarm

[Index of Archives]     [Linux KVM]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux