Skip to contentSkip to conversation

KVM: add basic paravirt support

PATCH In review Avi Kivity 1 participant 1 message Mar 2, 2008

Subsystems (3)
lore
Share & tools
lore

Avi Kivity

author
#0 lore raw

PATCH 1/8 KVM: add basic paravirt support

From: Marcelo Tosatti <[email protected]>

Add basic KVM paravirt support. Avoid vm-exits on IO delays.

v1->v2:
- replace KVM_CAP_CLOCKSOURCE with KVM_CAP_PARA_FEATURES
- cover FEATURE_CLOCKSOURCE

v2->v3:
- switch to one ioctl per paravirt feature

---
 arch/x86/kvm/x86.c         |    1 +
 include/asm-x86/kvm_para.h |    3 ++-
 include/linux/kvm.h        |    1 +
 3 files changed, 4 insertions(+), 1 deletions(-)
arch/x86/kvm/x86.c +1 -0
index 6f09840..cafed91 100644
@@ -805,6 +805,7 @@ int kvm_dev_ioctl_check_extension(long ext)
 	case KVM_CAP_SET_TSS_ADDR:
 	case KVM_CAP_EXT_CPUID:
 	case KVM_CAP_CLOCKSOURCE:
+	case KVM_CAP_NOP_IO_DELAY:
 		r = 1;
 		break;
 	case KVM_CAP_VAPIC:
include/asm-x86/kvm_para.h +2 -1
index 5ab7d3d..ed5df3a 100644
@@ -10,7 +10,8 @@
  * paravirtualization, the appropriate feature bit should be checked.
  */
 #define KVM_CPUID_FEATURES	0x40000001
-#define KVM_FEATURE_CLOCKSOURCE 0
+#define KVM_FEATURE_CLOCKSOURCE		0
+#define KVM_FEATURE_NOP_IO_DELAY	1
 
 #define MSR_KVM_WALL_CLOCK  0x11
 #define MSR_KVM_SYSTEM_TIME 0x12
include/linux/kvm.h +1 -0
index e92e703..ea7907d 100644
@@ -236,6 +236,7 @@ struct kvm_vapic_addr {
 #define KVM_CAP_CLOCKSOURCE 8
 #define KVM_CAP_NR_VCPUS 9       /* returns max vcpus per vm */
 #define KVM_CAP_NR_MEMSLOTS 10   /* returns max memory slots per vm */
+#define KVM_CAP_NOP_IO_DELAY 11
 
 /*
  * ioctls for VM fds
Signature · 7 lines
1.5.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/