kvm clock : userspace part
cover kvm clock : userspace part
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
PATCH 1/2 add kvm_para.h header to qemu-kvm-x86.c
With this, functions such as cpuid can make
use of paravirt definitions
Signed-off-by Glauber de Oliveira Costa <[email protected]>
--- qemu/qemu-kvm-x86.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
qemu/qemu-kvm-x86.c +1 -0
@@ -9,6 +9,7 @@ #include "qemu-kvm.h"#include <libkvm.h> #include <pthread.h> #include <sys/utsname.h> +#include <linux/kvm_para.h> #define MSR_IA32_TSC 0x10
Signature · 7 lines
1.4.2 ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
PATCH 2/2 fill cpuid with clock information
we advertise the presence of our paravirt clock
through cpuid, if it is defined in headers
Signed-off-by Glauber de Oliveira Costa <[email protected]>
--- qemu/qemu-kvm-x86.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
qemu/qemu-kvm-x86.c +5 -1
@@ -513,6 +513,10 @@ #endifint cpuid_nent =0 ;CPUState copy;uint32_t i, limit; +int has_clocksource =0 ; +#ifdef KVM_CAP_CLOCKSOURCE + has_clocksource =kvm_check_extension (kvm_context,KVM_CAP_CLOCKSOURCE ); +#endif copy = *cenv;
@@ -530,7 +534,7 @@ #ifdef KVM_CPUID_SIGNATURE pv_ent = &cpuid_ent[cpuid_nent++];memset (pv_ent,0 ,sizeof (*pv_ent)); pv_ent->function =KVM_CPUID_FEATURES ; - pv_ent->eax =0 ; + pv_ent->eax = (has_clocksource <<KVM_FEATURE_CLOCKSOURCE );#endif copy.regs[R_EAX ] =0 ;
Signature · 7 lines
1.4.2 ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/