public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/10] Trivial: /dev/kvm interface is no longer experimental.
@ 2007-07-17 13:12 Rusty Russell
       [not found] ` <1184677946.10380.4.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
  0 siblings, 1 reply; 30+ messages in thread
From: Rusty Russell @ 2007-07-17 13:12 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm-devel

KVM interface is no longer experimental.

Signed-off-by: Rusty Russell <rusty-8n+1lVoiYb80n/F98K4Iww@public.gmane.org>

diff -r 4e57f5c6d4a9 include/linux/kvm.h
--- a/include/linux/kvm.h	Tue Jul 17 13:04:58 2007 +1000
+++ b/include/linux/kvm.h	Tue Jul 17 13:09:54 2007 +1000
@@ -4,8 +4,7 @@
 /*
  * Userspace interface for /dev/kvm - kernel based virtual machine
  *
- * Note: this interface is considered experimental and may change without
- *       notice.
+ * Note: you must update KVM_API_VERSION if you change this interface.
  */
 
 #include <asm/types.h>



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH 2/10] Trivial: Remove KVM_IRQ_BITMAP macro
       [not found] ` <1184677946.10380.4.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
@ 2007-07-17 13:14   ` Rusty Russell
       [not found]     ` <1184678060.10380.7.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
  2007-07-17 13:28   ` [PATCH 1/10] Trivial: /dev/kvm interface is no longer experimental Avi Kivity
  2007-07-17 16:35   ` Arnd Bergmann
  2 siblings, 1 reply; 30+ messages in thread
From: Rusty Russell @ 2007-07-17 13:14 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm-devel

Creating one's own BITMAP macro seems suboptimal: if we use manual
arithmetic in the one place exposed to userspace, we can use standard
macros elsewhere.

The - 7 + 8 calc is overkill: can NR_IRQ_WORDS ever really change?

Signed-off-by: Rusty Russell <rusty-8n+1lVoiYb80n/F98K4Iww@public.gmane.org>

diff -r 85a8c51d3df8 drivers/kvm/kvm.h
--- a/drivers/kvm/kvm.h	Tue Jul 17 13:10:00 2007 +1000
+++ b/drivers/kvm/kvm.h	Tue Jul 17 13:15:22 2007 +1000
@@ -342,8 +342,7 @@ struct kvm_vcpu {
 	int guest_mode;
 	unsigned long requests;
 	unsigned long irq_summary; /* bit vector: 1 per word in irq_pending */
-#define NR_IRQ_WORDS KVM_IRQ_BITMAP_SIZE(unsigned long)
-	unsigned long irq_pending[NR_IRQ_WORDS];
+	DECLARE_BITMAP(irq_pending, KVM_NR_INTERRUPTS);
 	unsigned long regs[NR_VCPU_REGS]; /* for rsp: vcpu_load_rsp_rip() */
 	unsigned long rip;      /* needs vcpu_load_rsp_rip() */
 
diff -r 85a8c51d3df8 drivers/kvm/kvm_main.c
--- a/drivers/kvm/kvm_main.c	Tue Jul 17 13:10:00 2007 +1000
+++ b/drivers/kvm/kvm_main.c	Tue Jul 17 16:26:10 2007 +1000
@@ -2122,7 +2122,7 @@ static int kvm_vcpu_ioctl_set_sregs(stru
 	memcpy(vcpu->irq_pending, sregs->interrupt_bitmap,
 	       sizeof vcpu->irq_pending);
 	vcpu->irq_summary = 0;
-	for (i = 0; i < NR_IRQ_WORDS; ++i)
+	for (i = 0; i < ARRAY_SIZE(vcpu->irq_pending); ++i)
 		if (vcpu->irq_pending[i])
 			__set_bit(i, &vcpu->irq_summary);
 
diff -r 85a8c51d3df8 include/linux/kvm.h
--- a/include/linux/kvm.h	Tue Jul 17 13:10:00 2007 +1000
+++ b/include/linux/kvm.h	Tue Jul 17 13:25:48 2007 +1000
@@ -12,14 +12,8 @@
 
 #define KVM_API_VERSION 12
 
-/*
- * Architectural interrupt line count, and the size of the bitmap needed
- * to hold them.
- */
+/* Architectural interrupt line count. */
 #define KVM_NR_INTERRUPTS 256
-#define KVM_IRQ_BITMAP_SIZE_BYTES    ((KVM_NR_INTERRUPTS + 7) / 8)
-#define KVM_IRQ_BITMAP_SIZE(type)    (KVM_IRQ_BITMAP_SIZE_BYTES / sizeof(type))
-
 
 /* for KVM_CREATE_MEMORY_REGION */
 struct kvm_memory_region {
@@ -163,7 +157,7 @@ struct kvm_sregs {
 	__u64 cr0, cr2, cr3, cr4, cr8;
 	__u64 efer;
 	__u64 apic_base;
-	__u64 interrupt_bitmap[KVM_IRQ_BITMAP_SIZE(__u64)];
+	__u64 interrupt_bitmap[(KVM_NR_INTERRUPTS + 7) / 8];
 };
 
 struct kvm_msr_entry {



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH 3/10] Trivial: Remove unused struct cpu_user_regs declaration
       [not found]     ` <1184678060.10380.7.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
@ 2007-07-17 13:15       ` Rusty Russell
       [not found]         ` <1184678129.10380.10.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
  2007-07-17 13:25       ` [PATCH 2/10] Trivial: Remove KVM_IRQ_BITMAP macro Avi Kivity
  1 sibling, 1 reply; 30+ messages in thread
From: Rusty Russell @ 2007-07-17 13:15 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm-devel

Signed-off-by: Rusty Russell <rusty-8n+1lVoiYb80n/F98K4Iww@public.gmane.org>

diff -r 725f52d66cc0 drivers/kvm/x86_emulate.h
--- a/drivers/kvm/x86_emulate.h	Tue Jul 17 13:25:52 2007 +1000
+++ b/drivers/kvm/x86_emulate.h	Tue Jul 17 13:33:34 2007 +1000
@@ -112,8 +112,6 @@ struct x86_emulate_ops {
 
 };
 
-struct cpu_user_regs;
-
 struct x86_emulate_ctxt {
 	/* Register state before/after emulation. */
 	struct kvm_vcpu *vcpu;



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH 4/10] Trivial: Make decode_register() static
       [not found]         ` <1184678129.10380.10.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
@ 2007-07-17 13:16           ` Rusty Russell
       [not found]             ` <1184678171.10380.12.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
  2007-07-17 13:28           ` [PATCH 3/10] Trivial: Remove unused struct cpu_user_regs declaration Avi Kivity
  1 sibling, 1 reply; 30+ messages in thread
From: Rusty Russell @ 2007-07-17 13:16 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm-devel

I have shied away from touching x86_emulate.c (it could definitely use
some love, but it is forked from the Xen code, and it would be more
productive to cross-merge fixes).

Signed-off-by: Rusty Russell <rusty-8n+1lVoiYb80n/F98K4Iww@public.gmane.org>

diff -r c7348ac9677f drivers/kvm/x86_emulate.c
--- a/drivers/kvm/x86_emulate.c	Tue Jul 17 13:33:39 2007 +1000
+++ b/drivers/kvm/x86_emulate.c	Tue Jul 17 13:35:19 2007 +1000
@@ -443,8 +443,13 @@ struct operand {
 			   (((reg) + _inc) & ((1UL << (ad_bytes << 3)) - 1)); \
 	} while (0)
 
-void *decode_register(u8 modrm_reg, unsigned long *regs,
-		      int highbyte_regs)
+/*
+ * Given the 'reg' portion of a ModRM byte, and a register block, return a
+ * pointer into the block that addresses the relevant register.
+ * @highbyte_regs specifies whether to decode AH,CH,DH,BH.
+ */
+static void *decode_register(u8 modrm_reg, unsigned long *regs,
+			     int highbyte_regs)
 {
 	void *p;
 
diff -r c7348ac9677f drivers/kvm/x86_emulate.h
--- a/drivers/kvm/x86_emulate.h	Tue Jul 17 13:33:39 2007 +1000
+++ b/drivers/kvm/x86_emulate.h	Tue Jul 17 13:35:06 2007 +1000
@@ -152,12 +152,4 @@ int x86_emulate_memop(struct x86_emulate
 int x86_emulate_memop(struct x86_emulate_ctxt *ctxt,
 		      struct x86_emulate_ops *ops);
 
-/*
- * Given the 'reg' portion of a ModRM byte, and a register block, return a
- * pointer into the block that addresses the relevant register.
- * @highbyte_regs specifies whether to decode AH,CH,DH,BH.
- */
-void *decode_register(u8 modrm_reg, unsigned long *regs,
-		      int highbyte_regs);
-
 #endif				/* __X86_EMULATE_H__ */



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH 5/10] Trivial: Comment spelling may escape grep
       [not found]             ` <1184678171.10380.12.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
@ 2007-07-17 13:16               ` Rusty Russell
       [not found]                 ` <1184678216.10380.14.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
  2007-07-17 13:29               ` [PATCH 4/10] Trivial: Make decode_register() static Avi Kivity
  1 sibling, 1 reply; 30+ messages in thread
From: Rusty Russell @ 2007-07-17 13:16 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm-devel

Speling error in comment.

Signed-off-by: Rusty Russell <rusty-8n+1lVoiYb80n/F98K4Iww@public.gmane.org>

diff -r f8a814265118 drivers/kvm/x86_emulate.c
--- a/drivers/kvm/x86_emulate.c	Tue Jul 17 13:35:26 2007 +1000
+++ b/drivers/kvm/x86_emulate.c	Tue Jul 17 13:36:15 2007 +1000
@@ -6,7 +6,7 @@
  * Copyright (c) 2005 Keir Fraser
  *
  * Linux coding style, mod r/m decoder, segment base fixes, real-mode
- * privieged instructions:
+ * privileged instructions:
  *
  * Copyright (C) 2006 Qumranet
  *



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH 6/10] Trivial: Avoid hardware_disable predeclaration
       [not found]                 ` <1184678216.10380.14.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
@ 2007-07-17 13:17                   ` Rusty Russell
       [not found]                     ` <1184678275.10380.16.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
  2007-07-17 13:29                   ` [PATCH 5/10] Trivial: Comment spelling may escape grep Avi Kivity
  1 sibling, 1 reply; 30+ messages in thread
From: Rusty Russell @ 2007-07-17 13:17 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm-devel

Don't pre-declare hardware_disable: shuffle the reboot hook down.

Signed-off-by: Rusty Russell <rusty-8n+1lVoiYb80n/F98K4Iww@public.gmane.org>

diff -r 1bfd3798620c drivers/kvm/kvm_main.c
--- a/drivers/kvm/kvm_main.c	Tue Jul 17 13:36:23 2007 +1000
+++ b/drivers/kvm/kvm_main.c	Tue Jul 17 16:25:23 2007 +1000
@@ -53,8 +53,6 @@ static cpumask_t cpus_hardware_enabled;
 static cpumask_t cpus_hardware_enabled;
 
 struct kvm_arch_ops *kvm_arch_ops;
-
-static void hardware_disable(void *ignored);
 
 #define STAT_OFFSET(x) offsetof(struct kvm_vcpu, stat.x)
 
@@ -2930,25 +2928,6 @@ static struct miscdevice kvm_dev = {
 	&kvm_chardev_ops,
 };
 
-static int kvm_reboot(struct notifier_block *notifier, unsigned long val,
-                       void *v)
-{
-	if (val == SYS_RESTART) {
-		/*
-		 * Some (well, at least mine) BIOSes hang on reboot if
-		 * in vmx root mode.
-		 */
-		printk(KERN_INFO "kvm: exiting hardware virtualization\n");
-		on_each_cpu(hardware_disable, NULL, 0, 1);
-	}
-	return NOTIFY_OK;
-}
-
-static struct notifier_block kvm_reboot_notifier = {
-	.notifier_call = kvm_reboot,
-	.priority = 0,
-};
-
 /*
  * Make sure that a cpu that is being hot-unplugged does not have any vcpus
  * cached on it.
@@ -3027,6 +3006,25 @@ static int kvm_cpu_hotplug(struct notifi
 	return NOTIFY_OK;
 }
 
+static int kvm_reboot(struct notifier_block *notifier, unsigned long val,
+                       void *v)
+{
+	if (val == SYS_RESTART) {
+		/*
+		 * Some (well, at least mine) BIOSes hang on reboot if
+		 * in vmx root mode.
+		 */
+		printk(KERN_INFO "kvm: exiting hardware virtualization\n");
+		on_each_cpu(hardware_disable, NULL, 0, 1);
+	}
+	return NOTIFY_OK;
+}
+
+static struct notifier_block kvm_reboot_notifier = {
+	.notifier_call = kvm_reboot,
+	.priority = 0,
+};
+
 void kvm_io_bus_init(struct kvm_io_bus *bus)
 {
 	memset(bus, 0, sizeof(*bus));



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH 7/10] Trivial: Use standard CR0 flags macros from asm/cpu-features.h
       [not found]                     ` <1184678275.10380.16.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
@ 2007-07-17 13:19                       ` Rusty Russell
       [not found]                         ` <1184678348.10380.19.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
  2007-07-17 13:32                       ` [PATCH 6/10] Trivial: Avoid hardware_disable predeclaration Avi Kivity
  1 sibling, 1 reply; 30+ messages in thread
From: Rusty Russell @ 2007-07-17 13:19 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm-devel

The kernel now has asm/cpu-features.h: use those macros instead of inventing our own.

Also spell out definition of CR0_RESEVED_BITS (no code change) and fix typo.

Signed-off-by: Rusty Russell <rusty-8n+1lVoiYb80n/F98K4Iww@public.gmane.org>

diff -r 6deb1d1318f4 drivers/kvm/kvm.h
--- a/drivers/kvm/kvm.h	Tue Jul 17 16:27:26 2007 +1000
+++ b/drivers/kvm/kvm.h	Tue Jul 17 19:36:32 2007 +1000
@@ -19,15 +19,6 @@
 #include <linux/kvm.h>
 #include <linux/kvm_para.h>
 
-#define CR0_PE_MASK (1ULL << 0)
-#define CR0_MP_MASK (1ULL << 1)
-#define CR0_TS_MASK (1ULL << 3)
-#define CR0_NE_MASK (1ULL << 5)
-#define CR0_WP_MASK (1ULL << 16)
-#define CR0_NW_MASK (1ULL << 29)
-#define CR0_CD_MASK (1ULL << 30)
-#define CR0_PG_MASK (1ULL << 31)
-
 #define CR3_WPT_MASK (1ULL << 3)
 #define CR3_PCD_MASK (1ULL << 4)
 
@@ -42,11 +33,11 @@
 #define CR4_VMXE_MASK (1ULL << 13)
 
 #define KVM_GUEST_CR0_MASK \
-	(CR0_PG_MASK | CR0_PE_MASK | CR0_WP_MASK | CR0_NE_MASK \
-	 | CR0_NW_MASK | CR0_CD_MASK)
+	(X86_CR0_PG | X86_CR0_PE | X86_CR0_WP | X86_CR0_NE \
+	 | X86_CR0_NW | X86_CR0_CD)
 #define KVM_VM_CR0_ALWAYS_ON \
-	(CR0_PG_MASK | CR0_PE_MASK | CR0_WP_MASK | CR0_NE_MASK | CR0_TS_MASK \
-	 | CR0_MP_MASK)
+	(X86_CR0_PG | X86_CR0_PE | X86_CR0_WP | X86_CR0_NE | X86_CR0_TS \
+	 | X86_CR0_MP)
 #define KVM_GUEST_CR4_MASK \
 	(CR4_PSE_MASK | CR4_PAE_MASK | CR4_PGE_MASK | CR4_VMXE_MASK | CR4_VME_MASK)
 #define KVM_PMODE_VM_CR4_ALWAYS_ON (CR4_VMXE_MASK | CR4_PAE_MASK)
@@ -660,7 +651,7 @@ static inline int is_pse(struct kvm_vcpu
 
 static inline int is_paging(struct kvm_vcpu *vcpu)
 {
-	return vcpu->cr0 & CR0_PG_MASK;
+	return vcpu->cr0 & X86_CR0_PG;
 }
 
 static inline int memslot_id(struct kvm *kvm, struct kvm_memory_slot *slot)
diff -r 6deb1d1318f4 drivers/kvm/kvm_main.c
--- a/drivers/kvm/kvm_main.c	Tue Jul 17 16:27:26 2007 +1000
+++ b/drivers/kvm/kvm_main.c	Tue Jul 17 19:37:36 2007 +1000
@@ -82,7 +82,10 @@ static struct dentry *debugfs_dir;
 
 #define MAX_IO_MSRS 256
 
-#define CR0_RESEVED_BITS 0xffffffff1ffaffc0ULL
+#define CR0_RESERVED_BITS						\
+	(~(unsigned long)(X86_CR0_PE | X86_CR0_MP | X86_CR0_EM | X86_CR0_TS \
+			  | X86_CR0_ET | X86_CR0_NE | X86_CR0_WP | X86_CR0_AM \
+			  | X86_CR0_NW | X86_CR0_CD | X86_CR0_PG))
 #define LMSW_GUEST_MASK 0x0eULL
 #define CR4_RESEVED_BITS (~((1ULL << 11) - 1))
 #define CR8_RESEVED_BITS (~0x0fULL)
@@ -483,27 +486,27 @@ out:
 
 void set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0)
 {
-	if (cr0 & CR0_RESEVED_BITS) {
+	if (cr0 & CR0_RESERVED_BITS) {
 		printk(KERN_DEBUG "set_cr0: 0x%lx #GP, reserved bits 0x%lx\n",
 		       cr0, vcpu->cr0);
 		inject_gp(vcpu);
 		return;
 	}
 
-	if ((cr0 & CR0_NW_MASK) && !(cr0 & CR0_CD_MASK)) {
+	if ((cr0 & X86_CR0_NW) && !(cr0 & X86_CR0_CD)) {
 		printk(KERN_DEBUG "set_cr0: #GP, CD == 0 && NW == 1\n");
 		inject_gp(vcpu);
 		return;
 	}
 
-	if ((cr0 & CR0_PG_MASK) && !(cr0 & CR0_PE_MASK)) {
+	if ((cr0 & X86_CR0_PG) && !(cr0 & X86_CR0_PE)) {
 		printk(KERN_DEBUG "set_cr0: #GP, set PG flag "
 		       "and a clear PE flag\n");
 		inject_gp(vcpu);
 		return;
 	}
 
-	if (!is_paging(vcpu) && (cr0 & CR0_PG_MASK)) {
+	if (!is_paging(vcpu) && (cr0 & X86_CR0_PG)) {
 #ifdef CONFIG_X86_64
 		if ((vcpu->shadow_efer & EFER_LME)) {
 			int cs_db, cs_l;
@@ -1190,7 +1193,7 @@ int emulate_clts(struct kvm_vcpu *vcpu)
 {
 	unsigned long cr0;
 
-	cr0 = vcpu->cr0 & ~CR0_TS_MASK;
+	cr0 = vcpu->cr0 & ~X86_CR0_TS;
 	kvm_arch_ops->set_cr0(vcpu, cr0);
 	return X86EMUL_CONTINUE;
 }
diff -r 6deb1d1318f4 drivers/kvm/mmu.c
--- a/drivers/kvm/mmu.c	Tue Jul 17 16:27:26 2007 +1000
+++ b/drivers/kvm/mmu.c	Tue Jul 17 19:38:07 2007 +1000
@@ -159,7 +159,7 @@ static struct kmem_cache *mmu_page_heade
 
 static int is_write_protection(struct kvm_vcpu *vcpu)
 {
-	return vcpu->cr0 & CR0_WP_MASK;
+	return vcpu->cr0 & X86_CR0_WP;
 }
 
 static int is_cpuid_PSE36(void)
diff -r 6deb1d1318f4 drivers/kvm/svm.c
--- a/drivers/kvm/svm.c	Tue Jul 17 16:27:26 2007 +1000
+++ b/drivers/kvm/svm.c	Tue Jul 17 19:38:22 2007 +1000
@@ -99,7 +99,7 @@ static unsigned get_addr_size(struct kvm
 	struct vmcb_save_area *sa = &vcpu->svm->vmcb->save;
 	u16 cs_attrib;
 
-	if (!(sa->cr0 & CR0_PE_MASK) || (sa->rflags & X86_EFLAGS_VM))
+	if (!(sa->cr0 & X86_CR0_PE) || (sa->rflags & X86_EFLAGS_VM))
 		return 2;
 
 	cs_attrib = sa->cs.attrib;
@@ -563,7 +563,7 @@ static void init_vmcb(struct vmcb *vmcb)
 	 * cr0 val on cpu init should be 0x60000010, we enable cpu
 	 * cache by default. the orderly way is to enable cache in bios.
 	 */
-	save->cr0 = 0x00000010 | CR0_PG_MASK | CR0_WP_MASK;
+	save->cr0 = 0x00000010 | X86_CR0_PG | X86_CR0_WP;
 	save->cr4 = CR4_PAE_MASK;
 	/* rdx = ?? */
 }
@@ -756,25 +756,25 @@ static void svm_set_cr0(struct kvm_vcpu 
 {
 #ifdef CONFIG_X86_64
 	if (vcpu->shadow_efer & KVM_EFER_LME) {
-		if (!is_paging(vcpu) && (cr0 & CR0_PG_MASK)) {
+		if (!is_paging(vcpu) && (cr0 & X86_CR0_PG)) {
 			vcpu->shadow_efer |= KVM_EFER_LMA;
 			vcpu->svm->vmcb->save.efer |= KVM_EFER_LMA | KVM_EFER_LME;
 		}
 
-		if (is_paging(vcpu) && !(cr0 & CR0_PG_MASK) ) {
+		if (is_paging(vcpu) && !(cr0 & X86_CR0_PG) ) {
 			vcpu->shadow_efer &= ~KVM_EFER_LMA;
 			vcpu->svm->vmcb->save.efer &= ~(KVM_EFER_LMA | KVM_EFER_LME);
 		}
 	}
 #endif
-	if ((vcpu->cr0 & CR0_TS_MASK) && !(cr0 & CR0_TS_MASK)) {
+	if ((vcpu->cr0 & X86_CR0_TS) && !(cr0 & X86_CR0_TS)) {
 		vcpu->svm->vmcb->control.intercept_exceptions &= ~(1 << NM_VECTOR);
 		vcpu->fpu_active = 1;
 	}
 
 	vcpu->cr0 = cr0;
-	cr0 |= CR0_PG_MASK | CR0_WP_MASK;
-	cr0 &= ~(CR0_CD_MASK | CR0_NW_MASK);
+	cr0 |= X86_CR0_PG | X86_CR0_WP;
+	cr0 &= ~(X86_CR0_CD | X86_CR0_NW);
 	vcpu->svm->vmcb->save.cr0 = cr0;
 }
 
@@ -945,8 +945,8 @@ static int nm_interception(struct kvm_vc
 static int nm_interception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
 {
        vcpu->svm->vmcb->control.intercept_exceptions &= ~(1 << NM_VECTOR);
-       if (!(vcpu->cr0 & CR0_TS_MASK))
-               vcpu->svm->vmcb->save.cr0 &= ~CR0_TS_MASK;
+       if (!(vcpu->cr0 & X86_CR0_TS))
+               vcpu->svm->vmcb->save.cr0 &= ~X86_CR0_TS;
        vcpu->fpu_active = 1;
 
        return 1;
@@ -1702,7 +1702,7 @@ static void svm_set_cr3(struct kvm_vcpu 
 
 	if (vcpu->fpu_active) {
 		vcpu->svm->vmcb->control.intercept_exceptions |= (1 << NM_VECTOR);
-		vcpu->svm->vmcb->save.cr0 |= CR0_TS_MASK;
+		vcpu->svm->vmcb->save.cr0 |= X86_CR0_TS;
 		vcpu->fpu_active = 0;
 	}
 }
diff -r 6deb1d1318f4 drivers/kvm/vmx.c
--- a/drivers/kvm/vmx.c	Tue Jul 17 16:27:26 2007 +1000
+++ b/drivers/kvm/vmx.c	Tue Jul 17 19:38:59 2007 +1000
@@ -436,9 +436,9 @@ static void vmx_fpu_activate(struct kvm_
 	if (vcpu->fpu_active)
 		return;
 	vcpu->fpu_active = 1;
-	vmcs_clear_bits(GUEST_CR0, CR0_TS_MASK);
-	if (vcpu->cr0 & CR0_TS_MASK)
-		vmcs_set_bits(GUEST_CR0, CR0_TS_MASK);
+	vmcs_clear_bits(GUEST_CR0, X86_CR0_TS);
+	if (vcpu->cr0 & X86_CR0_TS)
+		vmcs_set_bits(GUEST_CR0, X86_CR0_TS);
 	update_exception_bitmap(vcpu);
 }
 
@@ -447,7 +447,7 @@ static void vmx_fpu_deactivate(struct kv
 	if (!vcpu->fpu_active)
 		return;
 	vcpu->fpu_active = 0;
-	vmcs_set_bits(GUEST_CR0, CR0_TS_MASK);
+	vmcs_set_bits(GUEST_CR0, X86_CR0_TS);
 	update_exception_bitmap(vcpu);
 }
 
@@ -1002,17 +1002,17 @@ static void vmx_set_cr0(struct kvm_vcpu 
 {
 	vmx_fpu_deactivate(vcpu);
 
-	if (vcpu->rmode.active && (cr0 & CR0_PE_MASK))
+	if (vcpu->rmode.active && (cr0 & X86_CR0_PE))
 		enter_pmode(vcpu);
 
-	if (!vcpu->rmode.active && !(cr0 & CR0_PE_MASK))
+	if (!vcpu->rmode.active && !(cr0 & X86_CR0_PE))
 		enter_rmode(vcpu);
 
 #ifdef CONFIG_X86_64
 	if (vcpu->shadow_efer & EFER_LME) {
-		if (!is_paging(vcpu) && (cr0 & CR0_PG_MASK))
+		if (!is_paging(vcpu) && (cr0 & X86_CR0_PG))
 			enter_lmode(vcpu);
-		if (is_paging(vcpu) && !(cr0 & CR0_PG_MASK))
+		if (is_paging(vcpu) && !(cr0 & X86_CR0_PG))
 			exit_lmode(vcpu);
 	}
 #endif
@@ -1022,14 +1022,14 @@ static void vmx_set_cr0(struct kvm_vcpu 
 		    (cr0 & ~KVM_GUEST_CR0_MASK) | KVM_VM_CR0_ALWAYS_ON);
 	vcpu->cr0 = cr0;
 
-	if (!(cr0 & CR0_TS_MASK) || !(cr0 & CR0_PE_MASK))
+	if (!(cr0 & X86_CR0_TS) || !(cr0 & X86_CR0_PE))
 		vmx_fpu_activate(vcpu);
 }
 
 static void vmx_set_cr3(struct kvm_vcpu *vcpu, unsigned long cr3)
 {
 	vmcs_writel(GUEST_CR3, cr3);
-	if (vcpu->cr0 & CR0_PE_MASK)
+	if (vcpu->cr0 & X86_CR0_PE)
 		vmx_fpu_deactivate(vcpu);
 }
 
@@ -1778,7 +1778,7 @@ static int handle_cr(struct kvm_vcpu *vc
 	case 2: /* clts */
 		vcpu_load_rsp_rip(vcpu);
 		vmx_fpu_deactivate(vcpu);
-		vcpu->cr0 &= ~CR0_TS_MASK;
+		vcpu->cr0 &= ~X86_CR0_TS;
 		vmcs_writel(CR0_READ_SHADOW, vcpu->cr0);
 		vmx_fpu_activate(vcpu);
 		skip_emulated_instruction(vcpu);



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 2/10] Trivial: Remove KVM_IRQ_BITMAP macro
       [not found]     ` <1184678060.10380.7.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
  2007-07-17 13:15       ` [PATCH 3/10] Trivial: Remove unused struct cpu_user_regs declaration Rusty Russell
@ 2007-07-17 13:25       ` Avi Kivity
       [not found]         ` <469CC367.1000107-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
  1 sibling, 1 reply; 30+ messages in thread
From: Avi Kivity @ 2007-07-17 13:25 UTC (permalink / raw)
  To: Rusty Russell; +Cc: kvm-devel

Rusty Russell wrote:
> Creating one's own BITMAP macro seems suboptimal: if we use manual
> arithmetic in the one place exposed to userspace, we can use standard
> macros elsewhere.
>
> The - 7 + 8 calc is overkill: can NR_IRQ_WORDS ever really change?
>   

Looks like it can:

>  
>  /* for KVM_CREATE_MEMORY_REGION */
>  struct kvm_memory_region {
> @@ -163,7 +157,7 @@ struct kvm_sregs {
>  	__u64 cr0, cr2, cr3, cr4, cr8;
>  	__u64 efer;
>  	__u64 apic_base;
> -	__u64 interrupt_bitmap[KVM_IRQ_BITMAP_SIZE(__u64)];
> +	__u64 interrupt_bitmap[(KVM_NR_INTERRUPTS + 7) / 8];
>  };
>  
>   

The size is in bytes, but the element type is __u64.


-- 
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 1/10] Trivial: /dev/kvm interface is no longer experimental.
       [not found] ` <1184677946.10380.4.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
  2007-07-17 13:14   ` [PATCH 2/10] Trivial: Remove KVM_IRQ_BITMAP macro Rusty Russell
@ 2007-07-17 13:28   ` Avi Kivity
  2007-07-17 16:35   ` Arnd Bergmann
  2 siblings, 0 replies; 30+ messages in thread
From: Avi Kivity @ 2007-07-17 13:28 UTC (permalink / raw)
  To: Rusty Russell; +Cc: kvm-devel

Rusty Russell wrote:
> KVM interface is no longer experimental.
>
> Signed-off-by: Rusty Russell <rusty-8n+1lVoiYb80n/F98K4Iww@public.gmane.org>
>
> diff -r 4e57f5c6d4a9 include/linux/kvm.h
> --- a/include/linux/kvm.h	Tue Jul 17 13:04:58 2007 +1000
> +++ b/include/linux/kvm.h	Tue Jul 17 13:09:54 2007 +1000
> @@ -4,8 +4,7 @@
>  /*
>   * Userspace interface for /dev/kvm - kernel based virtual machine
>   *
> - * Note: this interface is considered experimental and may change without
> - *       notice.
> + * Note: you must update KVM_API_VERSION if you change this interface.
>   */
>  
>  #include <asm/types.h>
>
>
>   

Applied, thanks.  What about CONFIG_EXPERIMENTAL?

-- 
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 3/10] Trivial: Remove unused struct cpu_user_regs declaration
       [not found]         ` <1184678129.10380.10.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
  2007-07-17 13:16           ` [PATCH 4/10] Trivial: Make decode_register() static Rusty Russell
@ 2007-07-17 13:28           ` Avi Kivity
  1 sibling, 0 replies; 30+ messages in thread
From: Avi Kivity @ 2007-07-17 13:28 UTC (permalink / raw)
  To: Rusty Russell; +Cc: kvm-devel

Rusty Russell wrote:
> Signed-off-by: Rusty Russell <rusty-8n+1lVoiYb80n/F98K4Iww@public.gmane.org>
>
> diff -r 725f52d66cc0 drivers/kvm/x86_emulate.h
> --- a/drivers/kvm/x86_emulate.h	Tue Jul 17 13:25:52 2007 +1000
> +++ b/drivers/kvm/x86_emulate.h	Tue Jul 17 13:33:34 2007 +1000
> @@ -112,8 +112,6 @@ struct x86_emulate_ops {
>  
>  };
>  
> -struct cpu_user_regs;
> -
>  struct x86_emulate_ctxt {
>  	/* Register state before/after emulation. */
>  	struct kvm_vcpu *vcpu;
>
>   

Applied, thanks.

-- 
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 4/10] Trivial: Make decode_register() static
       [not found]             ` <1184678171.10380.12.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
  2007-07-17 13:16               ` [PATCH 5/10] Trivial: Comment spelling may escape grep Rusty Russell
@ 2007-07-17 13:29               ` Avi Kivity
  1 sibling, 0 replies; 30+ messages in thread
From: Avi Kivity @ 2007-07-17 13:29 UTC (permalink / raw)
  To: Rusty Russell; +Cc: kvm-devel

Rusty Russell wrote:
> I have shied away from touching x86_emulate.c (it could definitely use
> some love, but it is forked from the Xen code, and it would be more
> productive to cross-merge fixes).
>
>   

Applied, thanks.

-- 
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 5/10] Trivial: Comment spelling may escape grep
       [not found]                 ` <1184678216.10380.14.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
  2007-07-17 13:17                   ` [PATCH 6/10] Trivial: Avoid hardware_disable predeclaration Rusty Russell
@ 2007-07-17 13:29                   ` Avi Kivity
  1 sibling, 0 replies; 30+ messages in thread
From: Avi Kivity @ 2007-07-17 13:29 UTC (permalink / raw)
  To: Rusty Russell; +Cc: kvm-devel

Rusty Russell wrote:
> Speling error in comment.
>
>   

Aplied, thanks.


-- 
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 6/10] Trivial: Avoid hardware_disable predeclaration
       [not found]                     ` <1184678275.10380.16.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
  2007-07-17 13:19                       ` [PATCH 7/10] Trivial: Use standard CR0 flags macros from asm/cpu-features.h Rusty Russell
@ 2007-07-17 13:32                       ` Avi Kivity
  1 sibling, 0 replies; 30+ messages in thread
From: Avi Kivity @ 2007-07-17 13:32 UTC (permalink / raw)
  To: Rusty Russell; +Cc: kvm-devel

Rusty Russell wrote:
> Don't pre-declare hardware_disable: shuffle the reboot hook down.
>   

Applied, thanks.

-- 
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH 8/10] Use standard CR3 flags, tighten checking
       [not found]                         ` <1184678348.10380.19.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
@ 2007-07-17 13:32                           ` Rusty Russell
       [not found]                             ` <1184679175.10380.25.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
  2007-07-17 13:33                           ` [PATCH 7/10] Trivial: Use standard CR0 flags macros from asm/cpu-features.h Avi Kivity
  1 sibling, 1 reply; 30+ messages in thread
From: Rusty Russell @ 2007-07-17 13:32 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm-devel

The kernel now has asm/cpu-features.h: use those macros instead of inventing our own.

Also spell out definition of CR3_RESEVED_BITS, fix spelling and
tighten it for the non-PAE case.

Signed-off-by: Rusty Russell <rusty-8n+1lVoiYb80n/F98K4Iww@public.gmane.org>

diff -r a253a0af3da6 drivers/kvm/kvm.h
--- a/drivers/kvm/kvm.h	Tue Jul 17 19:39:18 2007 +1000
+++ b/drivers/kvm/kvm.h	Tue Jul 17 23:21:14 2007 +1000
@@ -19,12 +19,9 @@
 #include <linux/kvm.h>
 #include <linux/kvm_para.h>
 
-#define CR3_WPT_MASK (1ULL << 3)
-#define CR3_PCD_MASK (1ULL << 4)
-
-#define CR3_RESEVED_BITS 0x07ULL
-#define CR3_L_MODE_RESEVED_BITS (~((1ULL << 40) - 1) | 0x0fe7ULL)
-#define CR3_FLAGS_MASK ((1ULL << 5) - 1)
+#define CR3_PAE_RESERVED_BITS ((X86_CR3_PWT | X86_CR3_PCD) - 1)
+#define CR3_NONPAE_RESERVED_BITS ((PAGE_SIZE-1) & ~(X86_CR3_PWT | X86_CR3_PCD))
+#define CR3_L_MODE_RESERVED_BITS (CR3_NONPAE_RESERVED_BITS|0xFFFFFF0000000000ULL)
 
 #define CR4_VME_MASK (1ULL << 0)
 #define CR4_PSE_MASK (1ULL << 4)
diff -r a253a0af3da6 drivers/kvm/kvm_main.c
--- a/drivers/kvm/kvm_main.c	Tue Jul 17 19:39:18 2007 +1000
+++ b/drivers/kvm/kvm_main.c	Tue Jul 17 23:26:07 2007 +1000
@@ -588,23 +588,32 @@ void set_cr3(struct kvm_vcpu *vcpu, unsi
 void set_cr3(struct kvm_vcpu *vcpu, unsigned long cr3)
 {
 	if (is_long_mode(vcpu)) {
-		if (cr3 & CR3_L_MODE_RESEVED_BITS) {
+		if (cr3 & CR3_L_MODE_RESERVED_BITS) {
 			printk(KERN_DEBUG "set_cr3: #GP, reserved bits\n");
 			inject_gp(vcpu);
 			return;
 		}
 	} else {
-		if (cr3 & CR3_RESEVED_BITS) {
-			printk(KERN_DEBUG "set_cr3: #GP, reserved bits\n");
-			inject_gp(vcpu);
-			return;
-		}
-		if (is_paging(vcpu) && is_pae(vcpu) &&
-		    !load_pdptrs(vcpu, cr3)) {
-			printk(KERN_DEBUG "set_cr3: #GP, pdptrs "
-			       "reserved bits\n");
-			inject_gp(vcpu);
-			return;
+		if (is_pae(vcpu)) {
+			if (cr3 & CR3_PAE_RESERVED_BITS) {
+				printk(KERN_DEBUG 
+				       "set_cr3: #GP, reserved bits\n");
+				inject_gp(vcpu);
+				return;
+			}
+			if (is_paging(vcpu) && !load_pdptrs(vcpu, cr3)) {
+				printk(KERN_DEBUG "set_cr3: #GP, pdptrs "
+				       "reserved bits\n");
+				inject_gp(vcpu);
+				return;
+			}
+		} else {
+			if (cr3 & CR3_NONPAE_RESERVED_BITS) {
+				printk(KERN_DEBUG
+				       "set_cr3: #GP, reserved bits\n");
+				inject_gp(vcpu);
+				return;
+			}
 		}
 	}
 
diff -r a253a0af3da6 drivers/kvm/paging_tmpl.h
--- a/drivers/kvm/paging_tmpl.h	Tue Jul 17 19:39:18 2007 +1000
+++ b/drivers/kvm/paging_tmpl.h	Tue Jul 17 23:23:19 2007 +1000
@@ -99,7 +99,7 @@ static int FNAME(walk_addr)(struct guest
 	walker->table = kmap_atomic(pfn_to_page(hpa >> PAGE_SHIFT), KM_USER0);
 
 	ASSERT((!is_long_mode(vcpu) && is_pae(vcpu)) ||
-	       (vcpu->cr3 & ~(PAGE_MASK | CR3_FLAGS_MASK)) == 0);
+	       (vcpu->cr3 & CR3_NONPAE_RESERVED_BITS) == 0);
 
 	walker->inherited_ar = PT_USER_MASK | PT_WRITABLE_MASK;
 



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 7/10] Trivial: Use standard CR0 flags macros from asm/cpu-features.h
       [not found]                         ` <1184678348.10380.19.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
  2007-07-17 13:32                           ` [PATCH 8/10] Use standard CR3 flags, tighten checking Rusty Russell
@ 2007-07-17 13:33                           ` Avi Kivity
  1 sibling, 0 replies; 30+ messages in thread
From: Avi Kivity @ 2007-07-17 13:33 UTC (permalink / raw)
  To: Rusty Russell; +Cc: kvm-devel

Rusty Russell wrote:
> The kernel now has asm/cpu-features.h: use those macros instead of inventing our own.
>
> Also spell out definition of CR0_RESEVED_BITS (no code change) and fix typo.
>
>   

Long overdue.  Applied, thanks.

-- 
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH 9/10] Use standard CR4 flags, tighten checking
       [not found]                             ` <1184679175.10380.25.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
@ 2007-07-17 13:34                               ` Rusty Russell
       [not found]                                 ` <1184679256.10380.27.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
  2007-07-17 13:36                               ` [PATCH 8/10] Use standard CR3 " Avi Kivity
  1 sibling, 1 reply; 30+ messages in thread
From: Rusty Russell @ 2007-07-17 13:34 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm-devel

On this machine (Intel), writing to the CR4 bits 0x00000800 and
0x00001000 cause a GPF.  The Intel manual is a little unclear, but
AFIACT they're reserved, too.

Also fix spelling of CR4_RESEVED_BITS.

Signed-off-by: Rusty Russell <rusty-8n+1lVoiYb80n/F98K4Iww@public.gmane.org>

diff -r 4197dcc91984 drivers/kvm/kvm.h
--- a/drivers/kvm/kvm.h	Tue Jul 17 22:49:08 2007 +1000
+++ b/drivers/kvm/kvm.h	Tue Jul 17 22:50:29 2007 +1000
@@ -23,12 +23,6 @@
 #define CR3_NONPAE_RESERVED_BITS ((PAGE_SIZE-1) & ~(X86_CR3_PWT | X86_CR3_PCD))
 #define CR3_L_MODE_RESERVED_BITS (CR3_NONPAE_RESERVED_BITS|0xFFFFFF0000000000ULL)
 
-#define CR4_VME_MASK (1ULL << 0)
-#define CR4_PSE_MASK (1ULL << 4)
-#define CR4_PAE_MASK (1ULL << 5)
-#define CR4_PGE_MASK (1ULL << 7)
-#define CR4_VMXE_MASK (1ULL << 13)
-
 #define KVM_GUEST_CR0_MASK \
 	(X86_CR0_PG | X86_CR0_PE | X86_CR0_WP | X86_CR0_NE \
 	 | X86_CR0_NW | X86_CR0_CD)
@@ -36,9 +30,9 @@
 	(X86_CR0_PG | X86_CR0_PE | X86_CR0_WP | X86_CR0_NE | X86_CR0_TS \
 	 | X86_CR0_MP)
 #define KVM_GUEST_CR4_MASK \
-	(CR4_PSE_MASK | CR4_PAE_MASK | CR4_PGE_MASK | CR4_VMXE_MASK | CR4_VME_MASK)
-#define KVM_PMODE_VM_CR4_ALWAYS_ON (CR4_VMXE_MASK | CR4_PAE_MASK)
-#define KVM_RMODE_VM_CR4_ALWAYS_ON (CR4_VMXE_MASK | CR4_PAE_MASK | CR4_VME_MASK)
+	(X86_CR4_VME | X86_CR4_PSE | X86_CR4_PAE | X86_CR4_PGE | X86_CR4_VMXE)
+#define KVM_PMODE_VM_CR4_ALWAYS_ON (X86_CR4_PAE | X86_CR4_VMXE)
+#define KVM_RMODE_VM_CR4_ALWAYS_ON (X86_CR4_VME | X86_CR4_PAE | X86_CR4_VMXE)
 
 #define INVALID_PAGE (~(hpa_t)0)
 #define UNMAPPED_GVA (~(gpa_t)0)
@@ -638,12 +632,12 @@ static inline int is_long_mode(struct kv
 
 static inline int is_pae(struct kvm_vcpu *vcpu)
 {
-	return vcpu->cr4 & CR4_PAE_MASK;
+	return vcpu->cr4 & X86_CR4_PAE;
 }
 
 static inline int is_pse(struct kvm_vcpu *vcpu)
 {
-	return vcpu->cr4 & CR4_PSE_MASK;
+	return vcpu->cr4 & X86_CR4_PSE;
 }
 
 static inline int is_paging(struct kvm_vcpu *vcpu)
diff -r 4197dcc91984 drivers/kvm/kvm_main.c
--- a/drivers/kvm/kvm_main.c	Tue Jul 17 22:49:08 2007 +1000
+++ b/drivers/kvm/kvm_main.c	Tue Jul 17 22:50:29 2007 +1000
@@ -86,8 +86,12 @@ static struct dentry *debugfs_dir;
 	(~(unsigned long)(X86_CR0_PE | X86_CR0_MP | X86_CR0_EM | X86_CR0_TS \
 			  | X86_CR0_ET | X86_CR0_NE | X86_CR0_WP | X86_CR0_AM \
 			  | X86_CR0_NW | X86_CR0_CD | X86_CR0_PG))
-#define LMSW_GUEST_MASK 0x0eULL
-#define CR4_RESEVED_BITS (~((1ULL << 11) - 1))
+#define CR4_RESERVED_BITS						\
+	(~(unsigned long)(X86_CR4_VME | X86_CR4_PVI | X86_CR4_TSD | X86_CR4_DE\
+			  | X86_CR4_PSE | X86_CR4_PAE | X86_CR4_MCE	\
+			  | X86_CR4_PGE | X86_CR4_PCE | X86_CR4_OSFXSR	\
+			  | X86_CR4_OSXMMEXCPT | X86_CR4_VMXE))
+
 #define CR8_RESEVED_BITS (~0x0fULL)
 #define EFER_RESERVED_BITS 0xfffffffffffff2fe
 
@@ -554,26 +558,26 @@ EXPORT_SYMBOL_GPL(lmsw);
 
 void set_cr4(struct kvm_vcpu *vcpu, unsigned long cr4)
 {
-	if (cr4 & CR4_RESEVED_BITS) {
+	if (cr4 & CR4_RESERVED_BITS) {
 		printk(KERN_DEBUG "set_cr4: #GP, reserved bits\n");
 		inject_gp(vcpu);
 		return;
 	}
 
 	if (is_long_mode(vcpu)) {
-		if (!(cr4 & CR4_PAE_MASK)) {
+		if (!(cr4 & X86_CR4_PAE)) {
 			printk(KERN_DEBUG "set_cr4: #GP, clearing PAE while "
 			       "in long mode\n");
 			inject_gp(vcpu);
 			return;
 		}
-	} else if (is_paging(vcpu) && !is_pae(vcpu) && (cr4 & CR4_PAE_MASK)
+	} else if (is_paging(vcpu) && !is_pae(vcpu) && (cr4 & X86_CR4_PAE)
 		   && !load_pdptrs(vcpu, vcpu->cr3)) {
 		printk(KERN_DEBUG "set_cr4: #GP, pdptrs reserved bits\n");
 		inject_gp(vcpu);
 	}
 
-	if (cr4 & CR4_VMXE_MASK) {
+	if (cr4 & X86_CR4_VMXE) {
 		printk(KERN_DEBUG "set_cr4: #GP, setting VMXE\n");
 		inject_gp(vcpu);
 		return;
diff -r 4197dcc91984 drivers/kvm/svm.c
--- a/drivers/kvm/svm.c	Tue Jul 17 22:49:08 2007 +1000
+++ b/drivers/kvm/svm.c	Tue Jul 17 22:50:30 2007 +1000
@@ -38,7 +38,6 @@ MODULE_LICENSE("GPL");
 
 #define DR7_GD_MASK (1 << 13)
 #define DR6_BD_MASK (1 << 13)
-#define CR4_DE_MASK (1UL << 3)
 
 #define SEG_TYPE_LDT 2
 #define SEG_TYPE_BUSY_TSS16 3
@@ -564,7 +563,7 @@ static void init_vmcb(struct vmcb *vmcb)
 	 * cache by default. the orderly way is to enable cache in bios.
 	 */
 	save->cr0 = 0x00000010 | X86_CR0_PG | X86_CR0_WP;
-	save->cr4 = CR4_PAE_MASK;
+	save->cr4 = X86_CR4_PAE;
 	/* rdx = ?? */
 }
 
@@ -781,7 +780,7 @@ static void svm_set_cr4(struct kvm_vcpu 
 static void svm_set_cr4(struct kvm_vcpu *vcpu, unsigned long cr4)
 {
        vcpu->cr4 = cr4;
-       vcpu->svm->vmcb->save.cr4 = cr4 | CR4_PAE_MASK;
+       vcpu->svm->vmcb->save.cr4 = cr4 | X86_CR4_PAE;
 }
 
 static void svm_set_segment(struct kvm_vcpu *vcpu,
@@ -877,7 +876,7 @@ static void svm_set_dr(struct kvm_vcpu *
 		vcpu->svm->db_regs[dr] = value;
 		return;
 	case 4 ... 5:
-		if (vcpu->cr4 & CR4_DE_MASK) {
+		if (vcpu->cr4 & X86_CR4_DE) {
 			*exception = UD_VECTOR;
 			return;
 		}
diff -r 4197dcc91984 drivers/kvm/vmx.c
--- a/drivers/kvm/vmx.c	Tue Jul 17 22:49:08 2007 +1000
+++ b/drivers/kvm/vmx.c	Tue Jul 17 22:50:30 2007 +1000
@@ -764,7 +764,7 @@ static void hardware_enable(void *garbag
 	if ((old & 5) != 5)
 		/* enable and lock */
 		wrmsrl(MSR_IA32_FEATURE_CONTROL, old | 5);
-	write_cr4(read_cr4() | CR4_VMXE); /* FIXME: not cpu hotplug safe */
+	write_cr4(read_cr4() | X86_CR4_VMXE); /* FIXME: not cpu hotplug safe */
 	asm volatile (ASM_VMX_VMXON_RAX : : "a"(&phys_addr), "m"(phys_addr)
 		      : "memory", "cc");
 }
@@ -879,8 +879,8 @@ static void enter_pmode(struct kvm_vcpu 
 	flags |= (vcpu->rmode.save_iopl << IOPL_SHIFT);
 	vmcs_writel(GUEST_RFLAGS, flags);
 
-	vmcs_writel(GUEST_CR4, (vmcs_readl(GUEST_CR4) & ~CR4_VME_MASK) |
-			(vmcs_readl(CR4_READ_SHADOW) & CR4_VME_MASK));
+	vmcs_writel(GUEST_CR4, (vmcs_readl(GUEST_CR4) & ~X86_CR4_VME) |
+			(vmcs_readl(CR4_READ_SHADOW) & X86_CR4_VME));
 
 	update_exception_bitmap(vcpu);
 
@@ -937,7 +937,7 @@ static void enter_rmode(struct kvm_vcpu 
 	flags |= IOPL_MASK | X86_EFLAGS_VM;
 
 	vmcs_writel(GUEST_RFLAGS, flags);
-	vmcs_writel(GUEST_CR4, vmcs_readl(GUEST_CR4) | CR4_VME_MASK);
+	vmcs_writel(GUEST_CR4, vmcs_readl(GUEST_CR4) | X86_CR4_VME);
 	update_exception_bitmap(vcpu);
 
 	vmcs_write16(GUEST_SS_SELECTOR, vmcs_readl(GUEST_SS_BASE) >> 4);
diff -r 4197dcc91984 drivers/kvm/vmx.h
--- a/drivers/kvm/vmx.h	Tue Jul 17 22:49:08 2007 +1000
+++ b/drivers/kvm/vmx.h	Tue Jul 17 22:50:30 2007 +1000
@@ -285,8 +285,6 @@ enum vmcs_field {
 
 #define AR_RESERVD_MASK 0xfffe0f00
 
-#define CR4_VMXE 0x2000
-
 #define MSR_IA32_VMX_BASIC   		0x480
 #define MSR_IA32_FEATURE_CONTROL 		0x03a
 #define MSR_IA32_VMX_PINBASED_CTLS		0x481



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 8/10] Use standard CR3 flags, tighten checking
       [not found]                             ` <1184679175.10380.25.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
  2007-07-17 13:34                               ` [PATCH 9/10] Use standard CR4 " Rusty Russell
@ 2007-07-17 13:36                               ` Avi Kivity
  1 sibling, 0 replies; 30+ messages in thread
From: Avi Kivity @ 2007-07-17 13:36 UTC (permalink / raw)
  To: Rusty Russell; +Cc: kvm-devel

Rusty Russell wrote:
> The kernel now has asm/cpu-features.h: use those macros instead of inventing our own.
>
> Also spell out definition of CR3_RESEVED_BITS, fix spelling and
> tighten it for the non-PAE case.
>
>   

Applied, thanks.  Watch out for trailing whitespace!

-- 
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH 10/10] Use standard CR8 flags, and fix TPR definition
       [not found]                                 ` <1184679256.10380.27.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
@ 2007-07-17 13:37                                   ` Rusty Russell
       [not found]                                     ` <1184679437.10380.31.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
  2007-07-17 13:40                                   ` [PATCH 9/10] Use standard CR4 flags, tighten checking Avi Kivity
  1 sibling, 1 reply; 30+ messages in thread
From: Rusty Russell @ 2007-07-17 13:37 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm-devel, lkml - Kernel Mailing List, H. Peter Anvin

Intel manual (and KVM definition) say it's TPR is 4 bits wide.  Also fix
CR8_RESEVED_BITS typo.

Signed-off-by: Rusty Russell <rusty-8n+1lVoiYb80n/F98K4Iww@public.gmane.org>

diff -r 6ef0b4c0d6f7 drivers/kvm/kvm_main.c
--- a/drivers/kvm/kvm_main.c	Tue Jul 17 18:07:48 2007 +1000
+++ b/drivers/kvm/kvm_main.c	Tue Jul 17 18:20:22 2007 +1000
@@ -92,7 +92,7 @@ static struct dentry *debugfs_dir;
 			  | X86_CR4_PGE | X86_CR4_PCE | X86_CR4_OSFXSR	\
 			  | X86_CR4_OSXMMEXCPT | X86_CR4_VMXE))
 
-#define CR8_RESEVED_BITS (~0x0fULL)
+#define CR8_RESERVED_BITS (~(unsigned long)X86_CR8_TPR)
 #define EFER_RESERVED_BITS 0xfffffffffffff2fe
 
 #ifdef CONFIG_X86_64
@@ -633,7 +633,7 @@ EXPORT_SYMBOL_GPL(set_cr3);
 
 void set_cr8(struct kvm_vcpu *vcpu, unsigned long cr8)
 {
-	if ( cr8 & CR8_RESEVED_BITS) {
+	if (cr8 & CR8_RESERVED_BITS) {
 		printk(KERN_DEBUG "set_cr8: #GP, reserved bits 0x%lx\n", cr8);
 		inject_gp(vcpu);
 		return;
diff -r 6ef0b4c0d6f7 include/asm-i386/processor-flags.h
--- a/include/asm-i386/processor-flags.h	Tue Jul 17 18:07:48 2007 +1000
+++ b/include/asm-i386/processor-flags.h	Tue Jul 17 18:12:54 2007 +1000
@@ -63,7 +63,7 @@
 /*
  * x86-64 Task Priority Register, CR8
  */
-#define X86_CR8_TPR	0x00000007 /* task priority register */
+#define X86_CR8_TPR	0x0000000F /* task priority register */
 
 /*
  * AMD and Transmeta use MSRs for configuration; see <asm/msr-index.h>



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 9/10] Use standard CR4 flags, tighten checking
       [not found]                                 ` <1184679256.10380.27.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
  2007-07-17 13:37                                   ` [PATCH 10/10] Use standard CR8 flags, and fix TPR definition Rusty Russell
@ 2007-07-17 13:40                                   ` Avi Kivity
  1 sibling, 0 replies; 30+ messages in thread
From: Avi Kivity @ 2007-07-17 13:40 UTC (permalink / raw)
  To: Rusty Russell; +Cc: kvm-devel

Rusty Russell wrote:
> On this machine (Intel), writing to the CR4 bits 0x00000800 and
> 0x00001000 cause a GPF.  The Intel manual is a little unclear, but
> AFIACT they're reserved, too.
>
> Also fix spelling of CR4_RESEVED_BITS.
>
>   

Applied, thanks.

-- 
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 10/10] Use standard CR8 flags, and fix TPR definition
       [not found]                                     ` <1184679437.10380.31.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
@ 2007-07-17 13:44                                       ` Avi Kivity
       [not found]                                         ` <469CC7CC.7050102-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
  2007-07-17 16:00                                       ` H. Peter Anvin
  1 sibling, 1 reply; 30+ messages in thread
From: Avi Kivity @ 2007-07-17 13:44 UTC (permalink / raw)
  To: Rusty Russell; +Cc: kvm-devel, lkml - Kernel Mailing List, H. Peter Anvin

Rusty Russell wrote:
> Intel manual (and KVM definition) say it's TPR is 4 bits wide.  Also fix
> CR8_RESEVED_BITS typo.
>
> Signed-off-by: Rusty Russell <rusty-8n+1lVoiYb80n/F98K4Iww@public.gmane.org>
> diff -r 6ef0b4c0d6f7 include/asm-i386/processor-flags.h
> --- a/include/asm-i386/processor-flags.h	Tue Jul 17 18:07:48 2007 +1000
> +++ b/include/asm-i386/processor-flags.h	Tue Jul 17 18:12:54 2007 +1000
> @@ -63,7 +63,7 @@
>  /*
>   * x86-64 Task Priority Register, CR8
>   */
> -#define X86_CR8_TPR	0x00000007 /* task priority register */
> +#define X86_CR8_TPR	0x0000000F /* task priority register */
>  
>  /*
>   * AMD and Transmeta use MSRs for configuration; see <asm/msr-index.h>
>
>
>   


X86_CR8_TPR is not used in the kernel.  But is this meant to be a mask, 
or something else?

-- 
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 10/10] Use standard CR8 flags, and fix TPR definition
       [not found]                                     ` <1184679437.10380.31.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
  2007-07-17 13:44                                       ` Avi Kivity
@ 2007-07-17 16:00                                       ` H. Peter Anvin
       [not found]                                         ` <469CE79D.7030001-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
  1 sibling, 1 reply; 30+ messages in thread
From: H. Peter Anvin @ 2007-07-17 16:00 UTC (permalink / raw)
  To: Rusty Russell; +Cc: kvm-devel, lkml - Kernel Mailing List

Rusty Russell wrote:
> Intel manual (and KVM definition) say it's TPR is 4 bits wide.  Also fix
> CR8_RESEVED_BITS typo.
> 
> Signed-off-by: Rusty Russell <rusty-8n+1lVoiYb80n/F98K4Iww@public.gmane.org>

Indeed it is.

Acked-by: H. Peter Anvin <hpa-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>

	-hpa

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 10/10] Use standard CR8 flags, and fix TPR definition
       [not found]                                         ` <469CC7CC.7050102-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
@ 2007-07-17 16:01                                           ` H. Peter Anvin
  0 siblings, 0 replies; 30+ messages in thread
From: H. Peter Anvin @ 2007-07-17 16:01 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm-devel, lkml - Kernel Mailing List

Avi Kivity wrote:
> 
> X86_CR8_TPR is not used in the kernel.  But is this meant to be a mask,
> or something else?
> 

Yes, a mask.

And no, it's not used, except for KVM...

	-hpa

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 1/10] Trivial: /dev/kvm interface is no longer experimental.
       [not found] ` <1184677946.10380.4.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
  2007-07-17 13:14   ` [PATCH 2/10] Trivial: Remove KVM_IRQ_BITMAP macro Rusty Russell
  2007-07-17 13:28   ` [PATCH 1/10] Trivial: /dev/kvm interface is no longer experimental Avi Kivity
@ 2007-07-17 16:35   ` Arnd Bergmann
       [not found]     ` <200707171835.53092.arnd-r2nGTMty4D4@public.gmane.org>
  2 siblings, 1 reply; 30+ messages in thread
From: Arnd Bergmann @ 2007-07-17 16:35 UTC (permalink / raw)
  To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

On Tuesday 17 July 2007, Rusty Russell wrote:
> KVM interface is no longer experimental.
> 
> Signed-off-by: Rusty Russell <rusty-8n+1lVoiYb80n/F98K4Iww@public.gmane.org>
> 
> diff -r 4e57f5c6d4a9 include/linux/kvm.h
> --- a/include/linux/kvm.h       Tue Jul 17 13:04:58 2007 +1000
> +++ b/include/linux/kvm.h       Tue Jul 17 13:09:54 2007 +1000
> @@ -4,8 +4,7 @@
>  /*
>   * Userspace interface for /dev/kvm - kernel based virtual machine
>   *
> - * Note: this interface is considered experimental and may change without
> - *       notice.
> + * Note: you must update KVM_API_VERSION if you change this interface.
>   */

I don't like the idea of making this interface official. If this is the
point where we think it's perfect, it should become a set of real system
calls instead.

At that point, incompatible API changes are simply not acceptable any
more, and the bar should be raised as high as possible. With a system
call, you basically have to allocate a new syscall number if you need
to add another parameter or similar, and yuo need to keep the behaviour
of the old number for eternity.

The equivalent of the current set of ioctls comes down to roughtly this
set of syscalls:

int kvm_create_vm(void);
int kvm_get_msr_index_list(int fd, sttuct kvm_msr_list);
size_t kvm_get_vcpu_mmap_size(int fd);
int kvm_set_memory_region(int fd, unsigned slot, unsigned flags,
	__u64 guest_phys_addr, __u64 size);
int kvm_create_vcpu(int fd);
int kvm_get_dirty_log(int fd, unsigned slot, void *dirty_bitmap);
int kvm_get_memory_alias(int fd, struct kvm_memory_region *region);
int kvm_run(int fd);
int kvm_get_regs(int fd, struct kvm_regs *regs);
int kvm_set_regs(int fd, const struct kvm_regs *regs);
int kvm_get_sregs(int fd, struct kvm_sregs *sregs);
int kvm_set_sregs(int fd, const struct kvm_sregs *sregs);
int kvm_translate(int fd, __u64 linear_address, __u64 *physical_address,
		__u8  *valid, __u8 *writeable, __u8 *usemode);
int kvm_interrupt(int fd, __u32 irq);
int kvm_debug_guest(...);
int kvm_get_msrs(...);
int kvm_set_msrs(...);
int kvm_set_cpuid(...);
int kvm_set_signal_mask(...);
int kvm_get_fpu(...);
int kvm_set_fpu(...);

That's a lot of system calls! The only ioctl calls that can immediately
go away are KVM_GET_API_VERSION and KVM_CHECK_EXTENSION, if the API
is fixed.

Before moving to the final syscall interface, I'd wait for the memory
model to have moved to using a region of the host process address instead
of a separate address range. As I understood Carsten, that's what was
discussed in Ottawa anyway. It can probably remove a few of the
existing ioctl calls.

Some more can be saved by changing the interface for the kvm_get/set_*
calls. One way I can see this done at the syscall level is to replace
kvm_get_regs() with

regsfd = openat(vcpu, "regs", O_RDWR);
(void)read(regsfs, &regs, sizeof (regs);

Some of the others can also be done with files like this, e.g. writing
to an "interrupt" file. Of course, you would keep the file descriptors
open for the life time of the guest.

	Arnd <><

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 1/10] Trivial: /dev/kvm interface is no longer experimental.
       [not found]     ` <200707171835.53092.arnd-r2nGTMty4D4@public.gmane.org>
@ 2007-07-17 23:49       ` Rusty Russell
       [not found]         ` <1184716197.10380.45.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
  2007-07-18  9:31       ` Avi Kivity
  1 sibling, 1 reply; 30+ messages in thread
From: Rusty Russell @ 2007-07-17 23:49 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

On Tue, 2007-07-17 at 18:35 +0200, Arnd Bergmann wrote:
> On Tuesday 17 July 2007, Rusty Russell wrote:
> > KVM interface is no longer experimental.
> > 
> > Signed-off-by: Rusty Russell <rusty-8n+1lVoiYb80n/F98K4Iww@public.gmane.org>
> > 
> > diff -r 4e57f5c6d4a9 include/linux/kvm.h
> > --- a/include/linux/kvm.h       Tue Jul 17 13:04:58 2007 +1000
> > +++ b/include/linux/kvm.h       Tue Jul 17 13:09:54 2007 +1000
> > @@ -4,8 +4,7 @@
> >  /*
> >   * Userspace interface for /dev/kvm - kernel based virtual machine
> >   *
> > - * Note: this interface is considered experimental and may change without
> > - *       notice.
> > + * Note: you must update KVM_API_VERSION if you change this interface.
> >   */
> 
> I don't like the idea of making this interface official. If this is the
> point where we think it's perfect, it should become a set of real system
> calls instead.

I don't either, but I thought Avi had announced interface stability.
That doesn't preclude a new API, but it does mean that the old one must
be supported...

Rusty.



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 2/10] Trivial: Remove KVM_IRQ_BITMAP macro
       [not found]         ` <469CC367.1000107-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
@ 2007-07-18  3:05           ` Rusty Russell
       [not found]             ` <1184727958.10380.54.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
  0 siblings, 1 reply; 30+ messages in thread
From: Rusty Russell @ 2007-07-18  3:05 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm-devel

On Tue, 2007-07-17 at 16:25 +0300, Avi Kivity wrote:
> Rusty Russell wrote:
> > Creating one's own BITMAP macro seems suboptimal: if we use manual
> > arithmetic in the one place exposed to userspace, we can use standard
> > macros elsewhere.
> >
> > The - 7 + 8 calc is overkill: can NR_IRQ_WORDS ever really change?
> >   
> 
> Looks like it can:

Sure, but the number 256 is part of the x86 architecture.  A paravirt
guest could choose to have more interrupts, but is there really a point?

> >  /* for KVM_CREATE_MEMORY_REGION */
> >  struct kvm_memory_region {
> > @@ -163,7 +157,7 @@ struct kvm_sregs {
> >  	__u64 cr0, cr2, cr3, cr4, cr8;
> >  	__u64 efer;
> >  	__u64 apic_base;
> > -	__u64 interrupt_bitmap[KVM_IRQ_BITMAP_SIZE(__u64)];
> > +	__u64 interrupt_bitmap[(KVM_NR_INTERRUPTS + 7) / 8];
> >  };
> >  
> >   
> 
> The size is in bytes, but the element type is __u64.

Doh, fixed here:
==
Use standard BITMAP macros, open-code userspace-exposed header.

Creating one's own BITMAP macro seems suboptimal: if we use manual
arithmetic in the one place exposed to userspace, we can use standard
macros elsewhere.

Signed-off-by: Rusty Russell <rusty-8n+1lVoiYb80n/F98K4Iww@public.gmane.org>

diff -r 85a8c51d3df8 drivers/kvm/kvm.h
--- a/drivers/kvm/kvm.h	Tue Jul 17 13:10:00 2007 +1000
+++ b/drivers/kvm/kvm.h	Tue Jul 17 13:15:22 2007 +1000
@@ -342,8 +342,7 @@ struct kvm_vcpu {
 	int guest_mode;
 	unsigned long requests;
 	unsigned long irq_summary; /* bit vector: 1 per word in irq_pending */
-#define NR_IRQ_WORDS KVM_IRQ_BITMAP_SIZE(unsigned long)
-	unsigned long irq_pending[NR_IRQ_WORDS];
+	DECLARE_BITMAP(irq_pending, KVM_NR_INTERRUPTS);
 	unsigned long regs[NR_VCPU_REGS]; /* for rsp: vcpu_load_rsp_rip() */
 	unsigned long rip;      /* needs vcpu_load_rsp_rip() */
 
diff -r 85a8c51d3df8 drivers/kvm/kvm_main.c
--- a/drivers/kvm/kvm_main.c	Tue Jul 17 13:10:00 2007 +1000
+++ b/drivers/kvm/kvm_main.c	Tue Jul 17 16:26:10 2007 +1000
@@ -2122,7 +2122,7 @@ static int kvm_vcpu_ioctl_set_sregs(stru
 	memcpy(vcpu->irq_pending, sregs->interrupt_bitmap,
 	       sizeof vcpu->irq_pending);
 	vcpu->irq_summary = 0;
-	for (i = 0; i < NR_IRQ_WORDS; ++i)
+	for (i = 0; i < ARRAY_SIZE(vcpu->irq_pending); ++i)
 		if (vcpu->irq_pending[i])
 			__set_bit(i, &vcpu->irq_summary);
 
diff -r 85a8c51d3df8 include/linux/kvm.h
--- a/include/linux/kvm.h	Tue Jul 17 13:10:00 2007 +1000
+++ b/include/linux/kvm.h	Tue Jul 17 13:25:48 2007 +1000
@@ -12,14 +12,8 @@
 
 #define KVM_API_VERSION 12
 
-/*
- * Architectural interrupt line count, and the size of the bitmap needed
- * to hold them.
- */
+/* Architectural interrupt line count. */
 #define KVM_NR_INTERRUPTS 256
-#define KVM_IRQ_BITMAP_SIZE_BYTES    ((KVM_NR_INTERRUPTS + 7) / 8)
-#define KVM_IRQ_BITMAP_SIZE(type)    (KVM_IRQ_BITMAP_SIZE_BYTES / sizeof(type))
-
 
 /* for KVM_CREATE_MEMORY_REGION */
 struct kvm_memory_region {
@@ -163,7 +157,7 @@ struct kvm_sregs {
 	__u64 cr0, cr2, cr3, cr4, cr8;
 	__u64 efer;
 	__u64 apic_base;
-	__u64 interrupt_bitmap[KVM_IRQ_BITMAP_SIZE(__u64)];
+	__u64 interrupt_bitmap[(KVM_NR_INTERRUPTS + 63) / 64];
 };
 
 struct kvm_msr_entry {



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 2/10] Trivial: Remove KVM_IRQ_BITMAP macro
       [not found]             ` <1184727958.10380.54.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
@ 2007-07-18  9:12               ` Avi Kivity
  0 siblings, 0 replies; 30+ messages in thread
From: Avi Kivity @ 2007-07-18  9:12 UTC (permalink / raw)
  To: Rusty Russell; +Cc: kvm-devel

Rusty Russell wrote:
> On Tue, 2007-07-17 at 16:25 +0300, Avi Kivity wrote:
>   
>> Rusty Russell wrote:
>>     
>>> Creating one's own BITMAP macro seems suboptimal: if we use manual
>>> arithmetic in the one place exposed to userspace, we can use standard
>>> macros elsewhere.
>>>
>>> The - 7 + 8 calc is overkill: can NR_IRQ_WORDS ever really change?
>>>   
>>>       
>> Looks like it can:
>>     
>
> Sure, but the number 256 is part of the x86 architecture.  A paravirt
> guest could choose to have more interrupts, but is there really a point?
>
>   

I meant that you yourself, Rusty Russell, extended it to 2048 with your
arithmetic.  Sorry for being unclear.

> Doh, fixed here:
> ==
> Use standard BITMAP macros, open-code userspace-exposed header.
>
> Creating one's own BITMAP macro seems suboptimal: if we use manual
> arithmetic in the one place exposed to userspace, we can use standard
> macros elsewhere.
>
>   

Applied, thanks.

-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 1/10] Trivial: /dev/kvm interface is no longer experimental.
       [not found]         ` <1184716197.10380.45.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
@ 2007-07-18  9:23           ` Avi Kivity
  0 siblings, 0 replies; 30+ messages in thread
From: Avi Kivity @ 2007-07-18  9:23 UTC (permalink / raw)
  To: Rusty Russell; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Rusty Russell wrote:
> On Tue, 2007-07-17 at 18:35 +0200, Arnd Bergmann wrote:
>   
>> On Tuesday 17 July 2007, Rusty Russell wrote:
>>     
>>> KVM interface is no longer experimental.
>>>
>>> Signed-off-by: Rusty Russell <rusty-8n+1lVoiYb80n/F98K4Iww@public.gmane.org>
>>>
>>> diff -r 4e57f5c6d4a9 include/linux/kvm.h
>>> --- a/include/linux/kvm.h       Tue Jul 17 13:04:58 2007 +1000
>>> +++ b/include/linux/kvm.h       Tue Jul 17 13:09:54 2007 +1000
>>> @@ -4,8 +4,7 @@
>>>  /*
>>>   * Userspace interface for /dev/kvm - kernel based virtual machine
>>>   *
>>> - * Note: this interface is considered experimental and may change without
>>> - *       notice.
>>> + * Note: you must update KVM_API_VERSION if you change this interface.
>>>   */
>>>       
>> I don't like the idea of making this interface official. If this is the
>> point where we think it's perfect, it should become a set of real system
>> calls instead.
>>     
>
> I don't either, but I thought Avi had announced interface stability.
> That doesn't preclude a new API, but it does mean that the old one must
> be supported...
>   

This interface is official as there is userspace deployed that uses it
that we are committed not to break.

In case we do switch to a syscall based interface, this is a positive
thing:  it allows us to make the syscall interface unofficial as long as
we like, and when we are finally satisfied we can deprecate the old
interface.



-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 1/10] Trivial: /dev/kvm interface is no longer experimental.
       [not found]     ` <200707171835.53092.arnd-r2nGTMty4D4@public.gmane.org>
  2007-07-17 23:49       ` Rusty Russell
@ 2007-07-18  9:31       ` Avi Kivity
       [not found]         ` <469DDDEB.9070009-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
  1 sibling, 1 reply; 30+ messages in thread
From: Avi Kivity @ 2007-07-18  9:31 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Arnd Bergmann wrote:
> The equivalent of the current set of ioctls comes down to roughtly this
> set of syscalls:
>
> int kvm_create_vm(void);
> int kvm_get_msr_index_list(int fd, sttuct kvm_msr_list);
> size_t kvm_get_vcpu_mmap_size(int fd);
> int kvm_set_memory_region(int fd, unsigned slot, unsigned flags,
> 	__u64 guest_phys_addr, __u64 size);
> int kvm_create_vcpu(int fd);
> int kvm_get_dirty_log(int fd, unsigned slot, void *dirty_bitmap);
> int kvm_get_memory_alias(int fd, struct kvm_memory_region *region);
> int kvm_run(int fd);
> int kvm_get_regs(int fd, struct kvm_regs *regs);
> int kvm_set_regs(int fd, const struct kvm_regs *regs);
> int kvm_get_sregs(int fd, struct kvm_sregs *sregs);
> int kvm_set_sregs(int fd, const struct kvm_sregs *sregs);
> int kvm_translate(int fd, __u64 linear_address, __u64 *physical_address,
> 		__u8  *valid, __u8 *writeable, __u8 *usemode);
> int kvm_interrupt(int fd, __u32 irq);
> int kvm_debug_guest(...);
> int kvm_get_msrs(...);
> int kvm_set_msrs(...);
> int kvm_set_cpuid(...);
> int kvm_set_signal_mask(...);
> int kvm_get_fpu(...);
> int kvm_set_fpu(...);
>
> That's a lot of system calls! The only ioctl calls that can immediately
> go away are KVM_GET_API_VERSION and KVM_CHECK_EXTENSION, if the API
> is fixed.
>   

Many can be merged (set_fpu, set_regs, set_sregs).  We will need
CHECK_EXTENSION as long as we are unable to predict the future (well,
for syscalls that are intended to be invoked on initialization only we
can use ENOSYS).

> Before moving to the final syscall interface, I'd wait for the memory
> model to have moved to using a region of the host process address instead
> of a separate address range. As I understood Carsten, that's what was
> discussed in Ottawa anyway. It can probably remove a few of the
> existing ioctl calls.
>   

We will also wait until we get most ports working, so we get a chance to
test it in real life.

> Some more can be saved by changing the interface for the kvm_get/set_*
> calls. One way I can see this done at the syscall level is to replace
> kvm_get_regs() with
>
> regsfd = openat(vcpu, "regs", O_RDWR);
> (void)read(regsfs, &regs, sizeof (regs);
>
> Some of the others can also be done with files like this, e.g. writing
> to an "interrupt" file. Of course, you would keep the file descriptors
> open for the life time of the guest.
>   

Once we're back to using fds, we might as well use ioctls.  If anything,
an ioctl has an explicit mention of the structure it manipulates in its
definition.  I don't care that it came in last in the last 15 annual
kernel beauty contests.

For me, the difference between syscalls and ioctls is whether the vcpu
is bound to a task (and the vm bound to the mm) rather than whether the
names are spelled in lowercase or uppercase.

-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 10/10] Use standard CR8 flags, and fix TPR definition
       [not found]                                         ` <469CE79D.7030001-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
@ 2007-07-18 18:09                                           ` Avi Kivity
  0 siblings, 0 replies; 30+ messages in thread
From: Avi Kivity @ 2007-07-18 18:09 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: kvm-devel, lkml - Kernel Mailing List

H. Peter Anvin wrote:
> Rusty Russell wrote:
>   
>> Intel manual (and KVM definition) say it's TPR is 4 bits wide.  Also fix
>> CR8_RESEVED_BITS typo.
>>
>> Signed-off-by: Rusty Russell <rusty-8n+1lVoiYb80n/F98K4Iww@public.gmane.org>
>>     
>
> Indeed it is.
>
> Acked-by: H. Peter Anvin <hpa-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
>
>   

Applied-by: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>

-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 1/10] Trivial: /dev/kvm interface is no longer experimental.
       [not found]         ` <469DDDEB.9070009-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
@ 2007-07-18 23:43           ` Arnd Bergmann
  0 siblings, 0 replies; 30+ messages in thread
From: Arnd Bergmann @ 2007-07-18 23:43 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

On Wednesday 18 July 2007, Avi Kivity wrote:
> 
> Once we're back to using fds, we might as well use ioctls.  If anything,
> an ioctl has an explicit mention of the structure it manipulates in its
> definition.  I don't care that it came in last in the last 15 annual
> kernel beauty contests.
> 
> For me, the difference between syscalls and ioctls is whether the vcpu
> is bound to a task (and the vm bound to the mm) rather than whether the
> names are spelled in lowercase or uppercase.

Ok, good point. If we go to syscalls, it absolutely makes sense to do
the automatic mm_struct<->guest and thread<->vcpu association and
not pass any file descriptors around, while as long as we're using
ioctl, having the fds point to the objects is logical.

My point regarding the move to system calls instead of ioctl was
more about emphasizing kvm as a core kernel functionality, not a device
driver, the same way that we don't have /dev/fork or /dev/epoll but
use system calls for those.

	Arnd <><

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2007-07-18 23:43 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-17 13:12 [PATCH 1/10] Trivial: /dev/kvm interface is no longer experimental Rusty Russell
     [not found] ` <1184677946.10380.4.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2007-07-17 13:14   ` [PATCH 2/10] Trivial: Remove KVM_IRQ_BITMAP macro Rusty Russell
     [not found]     ` <1184678060.10380.7.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2007-07-17 13:15       ` [PATCH 3/10] Trivial: Remove unused struct cpu_user_regs declaration Rusty Russell
     [not found]         ` <1184678129.10380.10.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2007-07-17 13:16           ` [PATCH 4/10] Trivial: Make decode_register() static Rusty Russell
     [not found]             ` <1184678171.10380.12.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2007-07-17 13:16               ` [PATCH 5/10] Trivial: Comment spelling may escape grep Rusty Russell
     [not found]                 ` <1184678216.10380.14.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2007-07-17 13:17                   ` [PATCH 6/10] Trivial: Avoid hardware_disable predeclaration Rusty Russell
     [not found]                     ` <1184678275.10380.16.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2007-07-17 13:19                       ` [PATCH 7/10] Trivial: Use standard CR0 flags macros from asm/cpu-features.h Rusty Russell
     [not found]                         ` <1184678348.10380.19.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2007-07-17 13:32                           ` [PATCH 8/10] Use standard CR3 flags, tighten checking Rusty Russell
     [not found]                             ` <1184679175.10380.25.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2007-07-17 13:34                               ` [PATCH 9/10] Use standard CR4 " Rusty Russell
     [not found]                                 ` <1184679256.10380.27.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2007-07-17 13:37                                   ` [PATCH 10/10] Use standard CR8 flags, and fix TPR definition Rusty Russell
     [not found]                                     ` <1184679437.10380.31.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2007-07-17 13:44                                       ` Avi Kivity
     [not found]                                         ` <469CC7CC.7050102-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-07-17 16:01                                           ` H. Peter Anvin
2007-07-17 16:00                                       ` H. Peter Anvin
     [not found]                                         ` <469CE79D.7030001-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
2007-07-18 18:09                                           ` Avi Kivity
2007-07-17 13:40                                   ` [PATCH 9/10] Use standard CR4 flags, tighten checking Avi Kivity
2007-07-17 13:36                               ` [PATCH 8/10] Use standard CR3 " Avi Kivity
2007-07-17 13:33                           ` [PATCH 7/10] Trivial: Use standard CR0 flags macros from asm/cpu-features.h Avi Kivity
2007-07-17 13:32                       ` [PATCH 6/10] Trivial: Avoid hardware_disable predeclaration Avi Kivity
2007-07-17 13:29                   ` [PATCH 5/10] Trivial: Comment spelling may escape grep Avi Kivity
2007-07-17 13:29               ` [PATCH 4/10] Trivial: Make decode_register() static Avi Kivity
2007-07-17 13:28           ` [PATCH 3/10] Trivial: Remove unused struct cpu_user_regs declaration Avi Kivity
2007-07-17 13:25       ` [PATCH 2/10] Trivial: Remove KVM_IRQ_BITMAP macro Avi Kivity
     [not found]         ` <469CC367.1000107-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-07-18  3:05           ` Rusty Russell
     [not found]             ` <1184727958.10380.54.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2007-07-18  9:12               ` Avi Kivity
2007-07-17 13:28   ` [PATCH 1/10] Trivial: /dev/kvm interface is no longer experimental Avi Kivity
2007-07-17 16:35   ` Arnd Bergmann
     [not found]     ` <200707171835.53092.arnd-r2nGTMty4D4@public.gmane.org>
2007-07-17 23:49       ` Rusty Russell
     [not found]         ` <1184716197.10380.45.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2007-07-18  9:23           ` Avi Kivity
2007-07-18  9:31       ` Avi Kivity
     [not found]         ` <469DDDEB.9070009-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-07-18 23:43           ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox