Am 06.06.2010 um 16:53 schrieb Faidon Liambotis:

> Peter Lieven wrote:
>>>> i was looking for a generic way to disable it in the hypervisor
>>>> without the need to touch every guests kernel commandline.
>>>> this would be easy revertible once its all working as expected.
>>> This is a huge hack but for the same reason I've made an LD_PRELOAD
>>> wrapper that wraps ioctl masking the hsot kernel's kvmclock feature from
>>> userspace kvm. I'll be happy to share it if you're interested.
>> 
>> i would be grateful if you can sent it to me offlist.
> http://people.debian.org/~paravoid/kvm-noclock-3.tar.gz
> 
>> however, i came up with this hack,
>> that seems to work also:
> <snip>
> 
> Yes, that's equivalent. We didn't use that since we wanted to use our
> distribution's binaries and be able to upgrade without modifying the source.

thank you. 

i want to share this patch for stable until -cpu xxx,-kvmclock works in the 
stable
tree.

diff -ur qemu-kvm-0.12.4.orig/qemu-kvm.c qemu-kvm-0.12.4/qemu-kvm.c
--- qemu-kvm-0.12.4.orig/qemu-kvm.c     2010-05-09 13:05:19.000000000 +0200
+++ qemu-kvm-0.12.4/qemu-kvm.c  2010-06-06 16:58:12.000000000 +0200
@@ -54,7 +54,7 @@
 int kvm_pit = 1;
 int kvm_pit_reinject = 1;
 int kvm_nested = 0;
-
+int kvm_clock = 1;
 
 KVMState *kvm_state;
 kvm_context_t kvm_context;
diff -ur qemu-kvm-0.12.4.orig/qemu-kvm.h qemu-kvm-0.12.4/qemu-kvm.h
--- qemu-kvm-0.12.4.orig/qemu-kvm.h     2010-05-09 13:05:19.000000000 +0200
+++ qemu-kvm-0.12.4/qemu-kvm.h  2010-06-06 17:04:02.000000000 +0200
@@ -1035,6 +1035,7 @@
 extern int kvm_pit;
 extern int kvm_pit_reinject;
 extern int kvm_nested;
+extern int kvm_clock;
 extern kvm_context_t kvm_context;
 
 struct ioperm_data {
diff -ur qemu-kvm-0.12.4.orig/qemu-kvm-x86.c qemu-kvm-0.12.4/qemu-kvm-x86.c
--- qemu-kvm-0.12.4.orig/qemu-kvm-x86.c 2010-05-09 13:05:19.000000000 +0200
+++ qemu-kvm-0.12.4/qemu-kvm-x86.c      2010-06-06 16:46:08.000000000 +0200
@@ -1259,6 +1259,7 @@
        int i, features = 0;
 
        for (i = 0; i < ARRAY_SIZE(para_features)-1; i++) {
+                if (para_features[i].cap == KVM_CAP_CLOCKSOURCE && !kvm_clock) 
continue;
                if (kvm_check_extension(kvm_state, para_features[i].cap))
                        features |= (1 << para_features[i].feature);
        }
diff -ur qemu-kvm-0.12.4.orig/qemu-options.hx qemu-kvm-0.12.4/qemu-options.hx
--- qemu-kvm-0.12.4.orig/qemu-options.hx        2010-05-09 13:05:19.000000000 
+0200
+++ qemu-kvm-0.12.4/qemu-options.hx     2010-06-06 16:38:46.000000000 +0200
@@ -1959,6 +1959,9 @@
     "-no-kvm-pit     disable KVM kernel mode PIT\n")
 DEF("no-kvm-pit-reinjection", 0, QEMU_OPTION_no_kvm_pit_reinjection,
     "-no-kvm-pit-reinjection disable KVM kernel mode PIT interrupt 
reinjection\n")
+DEF("no-kvm-clock", 0, QEMU_OPTION_no_kvm_clock,
+    "-no-kvm-clock   disable KVM pvclock\n")
+
 #if defined(TARGET_I386) || defined(TARGET_X86_64) || defined(TARGET_IA64) || 
defined(__linux__)
 DEF("pcidevice", HAS_ARG, QEMU_OPTION_pcidevice,
     "-pcidevice host=bus:dev.func[,dma=none][,name=string]\n"
diff -ur qemu-kvm-0.12.4.orig/vl.c qemu-kvm-0.12.4/vl.c
--- qemu-kvm-0.12.4.orig/vl.c   2010-05-09 13:05:19.000000000 +0200
+++ qemu-kvm-0.12.4/vl.c        2010-06-06 17:05:53.000000000 +0200
@@ -5530,6 +5530,10 @@
                 kvm_pit_reinject = 0;
                 break;
             }
+            case QEMU_OPTION_no_kvm_clock: {
+                kvm_clock = 0;
+                break;
+            }
            case QEMU_OPTION_enable_nesting: {
                kvm_nested = 1;
                break;


> 
> Regards,
> Faidon
> 

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to