Skip to contentSkip to conversation

kvm-73 release

ANNOUNCE Avi Kivity 8 participants 20 messages Aug 20, 2008 – Aug 27, 2008 KVM

lore
Share & tools
lore

Avi Kivity

author
#0 lore raw

The big change is of course full swapping support, finally delivering the full range of Linux memory management operations to kvm. You will need a 2.6.27 host to use this functionality, however.

Other noteworthy changes: speedups of both virtio-net and qcow2 with cache=off. Two important works-in-progress: device assignment (not usable yet, as dma support is still missing) and the real-mode emulation framework.

Changes from kvm-72:
- merge qemu-svn
- improve qcow2 performance with cache=off
- ide fixes
- ia64 external module (Xiantao Zhang)
- external module compatibility with 2.6.27 hosts
- fix sysenter msrs save/restore (Alexander Graf)
- fix 2.6.26 host support (Nikola Ciprich)
- fix linux-user build (Philippe Gerum)
- virtio-net speedup (Mark McLoughlin)
- fix ./configure with multiple arguments
- support Windows hibernation on non-FlexPriority hosts
- fix makefile dependencies (Sheng Yang)
- fix compiler warnings (Jan Kiszka)
- work around dhclient checksum offload brokenness (Anthony Liguori)
- full swapping support (Andrea Arcangeli)
- needs 2.6.27 hosts
- internal irq ack notification api
(Marcelo Tosatti, Amit Shah, Ben-Ami Yassour, me)
- fix pit timer interrupt injection logic (Marcelo Tosatti)
- paravirt guest: query tsc frequency from host (Glauber Costa)
- pci device assignment (Amit Shah, Ben-Ami Yassour, Weidong Han)
- still lacking dma
- fix large page crash on z10 mainframes (Christian Borntraeger)
- stack usage reduction (Dave Hansen, Sheng Yang)
- code cleanup (Sheng Yang)
- fix debug register corruption on Intel hosts (Marcelo Tosatti)
- fix -no-kvm-irqchip
- fix irq acking on pic reset (Marcelo Tosatti)
- ignore spurious timer interrupt acks
- limit device assignment to privileged user (Amit Shah)
- big real mode emulation framework (Mohammed Gamal)
- simpify irq injection (Amit Shah)
- dummy irq ack notifier for ia64 (Xiantao Zhang)

Notes:
If you use the modules bundled with kvm-73, you can use any version
of Linux from 2.6.16 upwards. You may also use kvm-73 userspace with the kvm modules provided by Linux 2.6.22 or above. Some features may only be available in newer releases.

http://kvm.qumranet.com

Signature · 1 line
error compiling committee.c: too many arguments to function
#1 lore raw

ons 2008-08-20 klockan 18:04 +0300 skrev Avi Kivity:

Quoted 45 lines

The big change is of course full swapping support, finally delivering the full range of Linux memory management operations to kvm. You will need a 2.6.27 host to use this functionality, however.

Other noteworthy changes: speedups of both virtio-net and qcow2 with cache=off. Two important works-in-progress: device assignment (not usable yet, as dma support is still missing) and the real-mode emulation framework.

Changes from kvm-72:
- merge qemu-svn
- improve qcow2 performance with cache=off
- ide fixes
- ia64 external module (Xiantao Zhang)
- external module compatibility with 2.6.27 hosts
- fix sysenter msrs save/restore (Alexander Graf)
- fix 2.6.26 host support (Nikola Ciprich)
- fix linux-user build (Philippe Gerum)
- virtio-net speedup (Mark McLoughlin)
- fix ./configure with multiple arguments
- support Windows hibernation on non-FlexPriority hosts
- fix makefile dependencies (Sheng Yang)
- fix compiler warnings (Jan Kiszka)
- work around dhclient checksum offload brokenness (Anthony Liguori)
- full swapping support (Andrea Arcangeli)
- needs 2.6.27 hosts
- internal irq ack notification api
(Marcelo Tosatti, Amit Shah, Ben-Ami Yassour, me)
- fix pit timer interrupt injection logic (Marcelo Tosatti)
- paravirt guest: query tsc frequency from host (Glauber Costa)
- pci device assignment (Amit Shah, Ben-Ami Yassour, Weidong Han)
- still lacking dma
- fix large page crash on z10 mainframes (Christian Borntraeger)
- stack usage reduction (Dave Hansen, Sheng Yang)
- code cleanup (Sheng Yang)
- fix debug register corruption on Intel hosts (Marcelo Tosatti)
- fix -no-kvm-irqchip
- fix irq acking on pic reset (Marcelo Tosatti)
- ignore spurious timer interrupt acks
- limit device assignment to privileged user (Amit Shah)
- big real mode emulation framework (Mohammed Gamal)
- simpify irq injection (Amit Shah)
- dummy irq ack notifier for ia64 (Xiantao Zhang)

Quoted 8 lines

Notes:
If you use the modules bundled with kvm-73, you can use any version
of Linux from 2.6.16 upwards. You may also use kvm-73 userspace with the kvm modules provided by Linux 2.6.22 or above. Some features may only be available in newer releases.

http://kvm.qumranet.com

Scsi and virtio block devices still do not survive a guest reboot (that is after a guest reboot the bios cannot find any bootable devices and thus halts). Using extboot.bin from kvm-71 makes it work so there is still something very strange going on.

I have tried to locate what it might be but cannot find why ide devices survives the reboot while scsi and virtio does not...

On the plus side it seams like kvm-73 fixed one issue for us where a ubuntu-8.04-i386 server guest running on a amd64 host had troubles using a scsi device (for example a mkfs.ext3 would never finish).

/Henrik Holst

#2 lore raw
In reply to Avi Kivity
Quoted 4 lines · Avi Kivity

Other noteworthy changes: speedups of both virtio-net and qcow2 with cache=off. Two important works-in-progress: device assignment (not usable yet, as dma support is still missing) and the real-mode emulation framework.

Hi Avi,

The latest version of the VT-d patches for device assignment was posted by Ben on Aug 7th[1][2]. There were no substantial review comments, so... what are we waiting for?

[1] http://www.mail-archive.com/[email protected]/msg02554.html
[2] http://www.mail-archive.com/[email protected]/msg02553.html

Cheers,
Muli

Signature · 3 lines
Workshop on I/O Virtualization (WIOV '08)
Co-located with OSDI '08, Dec 2008, San Diego, CA
http://www.usenix.org/wiov08
#3 lore raw
Quoted 6 lines · On Thursday 21 August 2008 00:43:22 Muli Ben-Yehuda wrote:
Quoted 4 lines · Avi Kivity

Other noteworthy changes: speedups of both virtio-net and qcow2 with cache=off. Two important works-in-progress: device assignment (not usable yet, as dma support is still missing) and the real-mode emulation framework.

Quoted 9 lines

Hi Avi,

The latest version of the VT-d patches for device assignment was posted by Ben on Aug 7th[1][2]. There were no substantial review comments, so... what are we waiting for?

[1] http://www.mail-archive.com/[email protected]/msg02554.html
[2] http://www.mail-archive.com/[email protected]/msg02553.html

Hi Muli

The next step should be send the first patch to linux-pci(and CC Jesse Barnes and other guys) to have review, for it related to DMAR modification... I think we mentioned that in recent comments, and I meant to remind Ben about that, but forgot it...

--
regards
Yang, Sheng

#4 lore raw
Quoted 16 lines · Sheng
Quoted 6 lines · On Thursday 21 August 2008 00:43:22 Muli Ben-Yehuda wrote:
Quoted 4 lines · Avi Kivity

Other noteworthy changes: speedups of both virtio-net and qcow2 with cache=off. Two important works-in-progress: device assignment (not usable yet, as dma support is still missing) and the real-mode emulation framework.

Quoted 9 lines

Hi Avi,

The latest version of the VT-d patches for device assignment was posted by Ben on Aug 7th[1][2]. There were no substantial review comments, so... what are we waiting for?

[1] http://www.mail-archive.com/[email protected]/msg02554.html
[2] http://www.mail-archive.com/[email protected]/msg02553.html

Quoted 7 lines

Hi Muli

The next step should be send the first patch to linux-pci(and CC Jesse Barnes and other guys) to have review, for it related to DMAR modification... I think we mentioned that in recent comments, and I meant to remind Ben about that, but forgot it...

I thought the patches would be merged into KVM mainline first. Avi, is it possible? If not, we should send the patch to LKML soon.

Randy (Weidong)

#5 lore raw
Quoted 2 lines · Weidong

I thought the patches would be merged into KVM mainline first. Avi, is it possible? If not, we should send the patch to LKML soon.

That was my understanding too from previous discussions.

Cheers,
Muli

Signature · 3 lines
Workshop on I/O Virtualization (WIOV '08)
Co-located with OSDI '08, Dec 2008, San Diego, CA
http://www.usenix.org/wiov08
#6 lore raw
In reply to Yang, Sheng
Quoted 16 lines · Sheng
Quoted 6 lines · On Thursday 21 August 2008 00:43:22 Muli Ben-Yehuda wrote:
Quoted 4 lines · Avi Kivity

Other noteworthy changes: speedups of both virtio-net and qcow2 with cache=off. Two important works-in-progress: device assignment (not usable yet, as dma support is still missing) and the real-mode emulation framework.

Quoted 8 lines

Hi Avi,

The latest version of the VT-d patches for device assignment was posted by Ben on Aug 7th[1][2]. There were no substantial review comments, so... what are we waiting for?

[1] http://www.mail-archive.com/[email protected]/msg02554.html
[2] http://www.mail-archive.com/[email protected]/msg02553.html

Quoted 6 lines

Hi Muli

The next step should be send the first patch to linux-pci(and CC Jesse Barnes and other guys) to have review, for it related to DMAR modification... I think we mentioned that in recent comments, and I meant to remind Ben about that, but forgot it...

Hi Ben

I think you can CC Jesse Barnes, David Woodhouse([email protected], current VT-d maintainer) and Mark Gross(former VT-d maintainer).

Signature · 2 lines
regards
Yang, Sheng
author
#7 lore raw
In reply to Yang, Sheng
Quoted 15 lines · Sheng
Quoted 13 lines · On Thursday 21 August 2008 00:43:22 Muli Ben-Yehuda wrote:
Quoted 5 lines · Avi Kivity

Other noteworthy changes: speedups of both virtio-net and qcow2 with cache=off. Two important works-in-progress: device assignment (not usable yet, as dma support is still missing) and the real-mode emulation framework.

Hi Avi,

The latest version of the VT-d patches for device assignment was posted by Ben on Aug 7th[1][2]. There were no substantial review comments, so... what are we waiting for?

Quoted 8 lines
Quoted 4 lines

[1] http://www.mail-archive.com/[email protected]/msg02554.html
[2] http://www.mail-archive.com/[email protected]/msg02553.html

Hi Muli

The next step should be send the first patch to linux-pci(and CC Jesse Barnes and other guys) to have review, for it related to DMAR modification... I think we mentioned that in recent comments, and I meant to remind Ben about that, but forgot it...

Yeah. I can queue the patch, provided it is acked by the VT-d maintainer.

Signature · 1 line
error compiling committee.c: too many arguments to function
#8 lore raw
In reply to Avi Kivity
Quoted 8 lines · Avi Kivity

The big change is of course full swapping support, finally delivering the full range of Linux memory management operations to kvm. You will need a 2.6.27 host to use this functionality, however.

Other noteworthy changes: speedups of both virtio-net and qcow2 with cache=off. Two important works-in-progress: device assignment (not usable yet, as dma support is still missing) and the real-mode emulation framework.

Changes from kvm-72:
- merge qemu-svn
- improve qcow2 performance with cache=off
- ide fixes

The snapshot you pulled from SVN had a broken monitor. Usually, the symptom is that you have two '(qemu)' prompts. This probably will break management tools (like libvirt) although I haven't confirmed. It's fixed in the very latest SVN.

Regards,

Anthony Liguori

Quoted 41 lines

- ia64 external module (Xiantao Zhang)
- external module compatibility with 2.6.27 hosts
- fix sysenter msrs save/restore (Alexander Graf)
- fix 2.6.26 host support (Nikola Ciprich)
- fix linux-user build (Philippe Gerum)
- virtio-net speedup (Mark McLoughlin)
- fix ./configure with multiple arguments
- support Windows hibernation on non-FlexPriority hosts
- fix makefile dependencies (Sheng Yang)
- fix compiler warnings (Jan Kiszka)
- work around dhclient checksum offload brokenness (Anthony Liguori)
- full swapping support (Andrea Arcangeli)
- needs 2.6.27 hosts
- internal irq ack notification api
(Marcelo Tosatti, Amit Shah, Ben-Ami Yassour, me)
- fix pit timer interrupt injection logic (Marcelo Tosatti)
- paravirt guest: query tsc frequency from host (Glauber Costa)
- pci device assignment (Amit Shah, Ben-Ami Yassour, Weidong Han)
- still lacking dma
- fix large page crash on z10 mainframes (Christian Borntraeger)
- stack usage reduction (Dave Hansen, Sheng Yang)
- code cleanup (Sheng Yang)
- fix debug register corruption on Intel hosts (Marcelo Tosatti)
- fix -no-kvm-irqchip
- fix irq acking on pic reset (Marcelo Tosatti)
- ignore spurious timer interrupt acks
- limit device assignment to privileged user (Amit Shah)
- big real mode emulation framework (Mohammed Gamal)
- simpify irq injection (Amit Shah)
- dummy irq ack notifier for ia64 (Xiantao Zhang)

Notes:
If you use the modules bundled with kvm-73, you can use any version
of Linux from 2.6.16 upwards. You may also use kvm-73 userspace with the kvm modules provided by Linux 2.6.22 or above. Some features may only be available in newer releases.

http://kvm.qumranet.com

#9 lore raw
In reply to Avi Kivity

Hi, Avi
Since ia64 has supported userspace's build, could we include ia64
bits in next release?
Thanks
Xiantao

Quoted 56 lines · Avi Kivity

The big change is of course full swapping support, finally delivering the full range of Linux memory management operations to kvm. You will need a 2.6.27 host to use this functionality, however.

Other noteworthy changes: speedups of both virtio-net and qcow2 with cache=off. Two important works-in-progress: device assignment (not usable yet, as dma support is still missing) and the real-mode emulation framework.

Changes from kvm-72:
- merge qemu-svn
- improve qcow2 performance with cache=off
- ide fixes
- ia64 external module (Xiantao Zhang)
- external module compatibility with 2.6.27 hosts
- fix sysenter msrs save/restore (Alexander Graf)
- fix 2.6.26 host support (Nikola Ciprich)
- fix linux-user build (Philippe Gerum)
- virtio-net speedup (Mark McLoughlin)
- fix ./configure with multiple arguments
- support Windows hibernation on non-FlexPriority hosts
- fix makefile dependencies (Sheng Yang)
- fix compiler warnings (Jan Kiszka)
- work around dhclient checksum offload brokenness (Anthony Liguori)
- full swapping support (Andrea Arcangeli)
- needs 2.6.27 hosts
- internal irq ack notification api
(Marcelo Tosatti, Amit Shah, Ben-Ami Yassour, me)
- fix pit timer interrupt injection logic (Marcelo Tosatti)
- paravirt guest: query tsc frequency from host (Glauber Costa)
- pci device assignment (Amit Shah, Ben-Ami Yassour, Weidong Han)
- still lacking dma
- fix large page crash on z10 mainframes (Christian Borntraeger)
- stack usage reduction (Dave Hansen, Sheng Yang)
- code cleanup (Sheng Yang)
- fix debug register corruption on Intel hosts (Marcelo Tosatti)
- fix -no-kvm-irqchip
- fix irq acking on pic reset (Marcelo Tosatti)
- ignore spurious timer interrupt acks
- limit device assignment to privileged user (Amit Shah)
- big real mode emulation framework (Mohammed Gamal)
- simpify irq injection (Amit Shah)
- dummy irq ack notifier for ia64 (Xiantao Zhang)

Notes:
If you use the modules bundled with kvm-73, you can use any
version of Linux from 2.6.16 upwards. You may also use kvm-73 userspace with the kvm modules provided by Linux 2.6.22 or above. Some features may only be available in newer releases.

http://kvm.qumranet.com

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

author
#10 lore raw
Quoted 4 lines · Xiantao

Hi, Avi
Since ia64 has supported userspace's build, could we include ia64
bits in next release?

I updated my scripts. I'll send you a test tarball via private mail to see I hadn't missed any files.

Signature · 1 line
error compiling committee.c: too many arguments to function
author
#11 lore raw
Quoted 8 lines · Avi Kivity
Quoted 3 lines · Xiantao

Hi, Avi Since ia64 has supported userspace's build, could we
include ia64
bits in next release?

I updated my scripts. I'll send you a test tarball via private mail to see I hadn't missed any files.

Better a link: http://userweb.kernel.org/~avi/test.tar.gz

Signature · 1 line
error compiling committee.c: too many arguments to function
#12 lore raw
Quoted 10 lines · Avi Kivity
Quoted 7 lines · Avi Kivity
Quoted 2 lines · Xiantao

Hi, Avi Since ia64 has supported userspace's build, could we
include ia64 bits in next release?

I updated my scripts. I'll send you a test tarball via private mail to see I hadn't missed any files.

Better a link: http://userweb.kernel.org/~avi/test.tar.gz

Hi, Avi
You may need to apply this patch, and regenerate the package again
to keep kvm/ia64 compatible with Linux-2.6.26 and newer versions. :) Thannks
Xiantao

From e552da3b1e7d2d30bcd09982d313ebf74c348be1 Mon Sep 17 00:00:00 2001
From: Xiantao Zhang <[email protected]>
Date: Fri, 22 Aug 2008 11:07:37 +0800
Subject: [PATCH] KVM: external module: keep kvm/ia64 compatible with Linux-2.6.26 and newer version.

Add some compatibility hack for Linux-2.6.26 and newer versions for ia64

---
 kernel/Makefile                      |    4 ++--
 kernel/external-module-compat-comm.h |   13 -------------
 kernel/ia64/Kbuild                   |    2 +-
 kernel/ia64/external-module-compat.h |   34
++++++++++++++++++++++++++++++++++
 kernel/ia64/hack-module.awk          |   14 ++++++++++++++
 kernel/x86/external-module-compat.h  |   14 ++++++++++++++
 kernel/{ => x86}/hack-module.awk     |    0 
 7 files changed, 65 insertions(+), 16 deletions(-)
 create mode 100644 kernel/ia64/hack-module.awk
 rename kernel/{ => x86}/hack-module.awk (100%)
kernel/Makefile +1 -1
index 6f8cc9d..3f5f6da 100644
@@ -19,7 +19,7 @@ LINUX = ../linux-2.6
 version = $(shell cd $(LINUX); git describe)
 
 _hack = mv $1 $1.orig && \
-	gawk -v version=$(version) -f hack-module.awk $1.orig \
+	gawk -v version=$(version) -f $(ARCH_DIR)/hack-module.awk

$1.orig \
| sed '/\#include/! s/\blapic\b/l_apic/g' > $1 && rm $1.orig

unifdef = mv $1 $1.orig && \
@@ -29,7 +29,7 @@ unifdef = mv $1 $1.orig && \
hack = $(call _hack,$T/$(strip $1))

hack-files-x86 = kvm_main.c mmu.c vmx.c svm.c x86.c irq.h lapic.c
i8254.c
-hack-files-ia64 =
+hack-files-ia64 = kvm_main.c kvm_fw.c

hack-files = $(hack-files-$(ARCH_DIR))

(quoted diff) +0 -0

b/kernel/external-module-compat-comm.h
index 97e921b..fcffb1f 100644

kernel/external-module-compat-comm.h +0 -3
@@ -17,7 +17,6 @@
 #include <asm/processor.h>
 #include <linux/hrtimer.h>
 #include <asm/bitops.h>
-#include <asm/msr.h>
 
 /*
  * 2.6.16 does not have GFP_NOWAIT
@@ -40,18 +39,6 @@
 #define prof_on       4321
 #endif
 
-/*
- * smp_call_function_single() is not exported below 2.6.20, and has

different
- * semantics below 2.6.23. The 'nonatomic' argument was removed in 2.6.27.
- */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
-
-int kvm_smp_call_function_single(int cpu, void (*func)(void *info),
- void *info, int wait);
-
-#define smp_call_function_single kvm_smp_call_function_single -
-#endif

/* on_each_cpu() lost an argument in 2.6.27. */
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)

kernel/ia64/Kbuild +1 -1
index 764a493..50af491 100644
@@ -1,6 +1,6 @@
 obj-m := kvm.o kvm-intel.o
 
-kvm-objs := kvm_main.o ioapic.o coalesced_mmio.o kvm-ia64.o kvm_fw.o
+kvm-objs := kvm_main.o ioapic.o coalesced_mmio.o kvm-ia64.o kvm_fw.o

../anon_inodes.o

EXTRA_CFLAGS_vcpu.o += -mfixed-range=f2-f5,f12-f127 kvm-intel-objs := vmm.o vmm_ivt.o trampoline.o vcpu.o optvfault.o
mmio.o \

(quoted diff) +0 -0

b/kernel/ia64/external-module-compat.h
index 3c4001c..1f8dc9b 100644

kernel/ia64/external-module-compat.h +8 -0
@@ -2,8 +2,11 @@
  * Compatibility header for building as an external module.
  */
 
+#ifndef __ASSEMBLY__
 #include <linux/version.h>
 
+#include "../external-module-compat-comm.h"
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
 #error "KVM/IA-64 Can't be compiled if kernel version < 2.6.26"
 #endif
@@ -13,3 +16,34 @@
   TODO: Implement it later! */
 #error "KVM/IA-64 depends on preempt notifiers in kernel."
 #endif
+
+/* on_each_cpu() lost an argument in 2.6.27. */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
+
+#define kvm_smp_call_function(func, info, wait) smp_call_function(func,

info, 0, wait)
+
+#else
+
+#define kvm_smp_call_function(func, info, wait) smp_call_function(func, info, wait)
+
+#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
+
+/* The 'nonatomic' argument was removed in 2.6.27. */
+
+#undef smp_call_function_single
+
+#include <linux/smp.h>
+
+static inline int kvm_smp_call_function_single(int cpu, void (*func)(void *info),
+ void *info, int wait)
+{
+ return smp_call_function_single(cpu, func, info, 0, wait);
+}
+
+#define smp_call_function_single kvm_smp_call_function_single +
+#endif
+
+#endif

kernel/ia64/hack-module.awk new file +1 -0
new file mode 100644
index 0000000..b9b24c0
@@ -0,0 +1,14 @@
+BEGIN { split("INIT_WORK on_each_cpu smp_call_function" , compat_apis);

}
+
+/MODULE_AUTHOR/ {
+ printf("MODULE_INFO(version, \"%s\");\n", version)
+}
+
+{
+ for (i in compat_apis) {
+ ident = compat_apis[i]
+ sub("\\<" ident "\\>", "kvm_" ident)
+ }
+}
+
+{ print }

(quoted diff) +0 -0

b/kernel/x86/external-module-compat.h
index f6e3e34..8ab8f26 100644

kernel/x86/external-module-compat.h +3 -0
@@ -5,9 +5,23 @@
 
 #include <linux/compiler.h>
 #include <linux/version.h>
+#include <asm/msr.h>
 
 #include "../external-module-compat-comm.h"
 
+/*
+ * smp_call_function_single() is not exported below 2.6.20, and has

different
+ * semantics below 2.6.23. The 'nonatomic' argument was removed in 2.6.27.
+ */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
+
+int kvm_smp_call_function_single(int cpu, void (*func)(void *info),
+ void *info, int wait);
+
+#define smp_call_function_single kvm_smp_call_function_single +
+#endif
+
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)

#ifndef _EFER_SCE

kernel/x86/hack-module.awk renamed from kernel/hack-module.awk +0 -0
similarity index 100%
rename from kernel/hack-module.awk
rename to kernel/x86/hack-module.awk
Signature · 1 line
1.5.1

From e552da3b1e7d2d30bcd09982d313ebf74c348be1 Mon Sep 17 00:00:00 2001
From: Xiantao Zhang <[email protected]>
Date: Fri, 22 Aug 2008 11:07:37 +0800
Subject: [PATCH] KVM: external module: keep kvm/ia64 compatible with Linux-2.6.26 and newer version.

Add some compatibility hack for Linux-2.6.26 and newer versions for ia64

---
 kernel/Makefile                      |    4 ++--
 kernel/external-module-compat-comm.h |   13 -------------
 kernel/ia64/Kbuild                   |    2 +-
 kernel/ia64/external-module-compat.h |   34 ++++++++++++++++++++++++++++++++++
 kernel/ia64/hack-module.awk          |   14 ++++++++++++++
 kernel/x86/external-module-compat.h  |   14 ++++++++++++++
 kernel/{ => x86}/hack-module.awk     |    0 
 7 files changed, 65 insertions(+), 16 deletions(-)
 create mode 100644 kernel/ia64/hack-module.awk
 rename kernel/{ => x86}/hack-module.awk (100%)
kernel/Makefile +2 -2
index 6f8cc9d..3f5f6da 100644
@@ -19,7 +19,7 @@ LINUX = ../linux-2.6
 version = $(shell cd $(LINUX); git describe)
 
 _hack = mv $1 $1.orig && \
-	gawk -v version=$(version) -f hack-module.awk $1.orig \
+	gawk -v version=$(version) -f $(ARCH_DIR)/hack-module.awk $1.orig \
 	    | sed '/\#include/! s/\blapic\b/l_apic/g' > $1 && rm $1.orig
 
 unifdef = mv $1 $1.orig && \
@@ -29,7 +29,7 @@ unifdef = mv $1 $1.orig && \
 hack = $(call _hack,$T/$(strip $1))
 
 hack-files-x86 = kvm_main.c mmu.c vmx.c svm.c x86.c irq.h lapic.c i8254.c
-hack-files-ia64 =
+hack-files-ia64 = kvm_main.c kvm_fw.c
 
 hack-files = $(hack-files-$(ARCH_DIR))
 
kernel/external-module-compat-comm.h +0 -13
index 97e921b..fcffb1f 100644
@@ -17,7 +17,6 @@
 #include <asm/processor.h>
 #include <linux/hrtimer.h>
 #include <asm/bitops.h>
-#include <asm/msr.h>
 
 /*
  * 2.6.16 does not have GFP_NOWAIT
@@ -40,18 +39,6 @@
 #define prof_on       4321
 #endif
 
-/*
- * smp_call_function_single() is not exported below 2.6.20, and has different
- * semantics below 2.6.23.  The 'nonatomic' argument was removed in 2.6.27.
- */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
-
-int kvm_smp_call_function_single(int cpu, void (*func)(void *info),
-				 void *info, int wait);
-
-#define smp_call_function_single kvm_smp_call_function_single
-
-#endif
 
 /* on_each_cpu() lost an argument in 2.6.27. */
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
kernel/ia64/Kbuild +1 -1
index 764a493..50af491 100644
@@ -1,6 +1,6 @@
 obj-m := kvm.o kvm-intel.o
 
-kvm-objs := kvm_main.o ioapic.o coalesced_mmio.o kvm-ia64.o kvm_fw.o
+kvm-objs := kvm_main.o ioapic.o coalesced_mmio.o kvm-ia64.o kvm_fw.o ../anon_inodes.o
 
 EXTRA_CFLAGS_vcpu.o += -mfixed-range=f2-f5,f12-f127
 kvm-intel-objs := vmm.o vmm_ivt.o trampoline.o vcpu.o optvfault.o mmio.o \
kernel/ia64/external-module-compat.h +34 -0
index 3c4001c..1f8dc9b 100644
@@ -2,8 +2,11 @@
  * Compatibility header for building as an external module.
  */
 
+#ifndef __ASSEMBLY__
 #include <linux/version.h>
 
+#include "../external-module-compat-comm.h"
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
 #error "KVM/IA-64 Can't be compiled if kernel version < 2.6.26"
 #endif
@@ -13,3 +16,34 @@
   TODO: Implement it later! */
 #error "KVM/IA-64 depends on preempt notifiers in kernel."
 #endif
+
+/* on_each_cpu() lost an argument in 2.6.27. */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
+
+#define kvm_smp_call_function(func, info, wait) smp_call_function(func, info, 0, wait)
+
+#else
+
+#define kvm_smp_call_function(func, info, wait) smp_call_function(func, info, wait)
+
+#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
+
+/* The 'nonatomic' argument was removed in 2.6.27. */
+
+#undef smp_call_function_single
+
+#include <linux/smp.h>
+
+static inline int kvm_smp_call_function_single(int cpu, void (*func)(void *info),
+				 void *info, int wait)
+{
+	return smp_call_function_single(cpu, func, info, 0, wait);
+}
+
+#define smp_call_function_single kvm_smp_call_function_single
+
+#endif
+
+#endif
kernel/ia64/hack-module.awk new file +14 -0
new file mode 100644
index 0000000..b9b24c0
@@ -0,0 +1,14 @@
+BEGIN { split("INIT_WORK on_each_cpu smp_call_function" , compat_apis); }
+
+/MODULE_AUTHOR/ {
+    printf("MODULE_INFO(version, \"%s\");\n", version)
+}
+
+{
+    for (i in compat_apis) {
+	ident = compat_apis[i]
+	sub("\\<" ident "\\>", "kvm_" ident)
+    }
+}
+
+{ print }
kernel/x86/external-module-compat.h +14 -0
index f6e3e34..8ab8f26 100644
@@ -5,9 +5,23 @@
 
 #include <linux/compiler.h>
 #include <linux/version.h>
+#include <asm/msr.h>
 
 #include "../external-module-compat-comm.h"
 
+/*
+ * smp_call_function_single() is not exported below 2.6.20, and has different
+ * semantics below 2.6.23.  The 'nonatomic' argument was removed in 2.6.27.
+ */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
+
+int kvm_smp_call_function_single(int cpu, void (*func)(void *info),
+				 void *info, int wait);
+
+#define smp_call_function_single kvm_smp_call_function_single
+
+#endif
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
 
 #ifndef _EFER_SCE
kernel/x86/hack-module.awk renamed from kernel/hack-module.awk +0 -0
similarity index 100%
rename from kernel/hack-module.awk
rename to kernel/x86/hack-module.awk
Signature · 1 line
1.5.1
#13 lore raw

Hi, Avi
A updated version. Please review again. Thanks.
Xiantao
From 689bdb4c0506a1b6b24e9c481634593052ee2cc0 Mon Sep 17 00:00:00 2001
From: Xiantao Zhang <[email protected]>
Date: Tue, 26 Aug 2008 19:20:03 +0800
Subject: [PATCH] KVM: external module: keep kvm/ia64 compatible with Linux-2.6.26 and newer version.

Add some compatibility hack for Linux-2.6.26 and newer versions for ia64

---
 kernel/Makefile                           |    4 ++--
 kernel/external-module-compat-comm.h      |    1 -
 kernel/{x86 => }/external-module-compat.c |    0 
 kernel/ia64/Kbuild                        |    3 ++-
 kernel/ia64/external-module-compat.h      |   16 ++++++++++++++++
 kernel/ia64/hack-module.awk               |   14 ++++++++++++++
 kernel/x86/Kbuild                         |    6 +++---
 kernel/x86/external-module-compat.h       |    1 +
 kernel/{ => x86}/hack-module.awk          |    0 
 9 files changed, 38 insertions(+), 7 deletions(-)
 rename kernel/{x86 => }/external-module-compat.c (100%)
 create mode 100644 kernel/ia64/hack-module.awk
 rename kernel/{ => x86}/hack-module.awk (100%)
kernel/Makefile +1 -1
index 6f8cc9d..3f5f6da 100644
@@ -19,7 +19,7 @@ LINUX = ../linux-2.6
 version = $(shell cd $(LINUX); git describe)
 
 _hack = mv $1 $1.orig && \
-	gawk -v version=$(version) -f hack-module.awk $1.orig \
+	gawk -v version=$(version) -f $(ARCH_DIR)/hack-module.awk

$1.orig \
| sed '/\#include/! s/\blapic\b/l_apic/g' > $1 && rm $1.orig

unifdef = mv $1 $1.orig && \
@@ -29,7 +29,7 @@ unifdef = mv $1 $1.orig && \
hack = $(call _hack,$T/$(strip $1))

hack-files-x86 = kvm_main.c mmu.c vmx.c svm.c x86.c irq.h lapic.c
i8254.c
-hack-files-ia64 =
+hack-files-ia64 = kvm_main.c kvm_fw.c

hack-files = $(hack-files-$(ARCH_DIR))

(quoted diff) +0 -0

b/kernel/external-module-compat-comm.h
index 97e921b..2e87c57 100644

kernel/external-module-compat-comm.h +0 -1
@@ -17,7 +17,6 @@
 #include <asm/processor.h>
 #include <linux/hrtimer.h>
 #include <asm/bitops.h>
-#include <asm/msr.h>
 
 /*
  * 2.6.16 does not have GFP_NOWAIT
(quoted diff) +0 -0

b/kernel/external-module-compat.c
similarity index 100%
rename from kernel/x86/external-module-compat.c
rename to kernel/external-module-compat.c

kernel/ia64/Kbuild +2 -1
index 764a493..8561476 100644
@@ -1,6 +1,7 @@
 obj-m := kvm.o kvm-intel.o
 
-kvm-objs := kvm_main.o ioapic.o coalesced_mmio.o kvm-ia64.o kvm_fw.o
+kvm-objs := kvm_main.o ioapic.o coalesced_mmio.o kvm-ia64.o kvm_fw.o \
+	../anon_inodes.o ../external-module-compat.o
 
 EXTRA_CFLAGS_vcpu.o += -mfixed-range=f2-f5,f12-f127
 kvm-intel-objs := vmm.o vmm_ivt.o trampoline.o vcpu.o optvfault.o

mmio.o \

(quoted diff) +0 -0

b/kernel/ia64/external-module-compat.h
index 3c4001c..2a11d39 100644

kernel/ia64/external-module-compat.h +8 -0
@@ -2,8 +2,11 @@
  * Compatibility header for building as an external module.
  */
 
+#ifndef __ASSEMBLY__
 #include <linux/version.h>
 
+#include "../external-module-compat-comm.h"
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
 #error "KVM/IA-64 Can't be compiled if kernel version < 2.6.26"
 #endif
@@ -13,3 +16,16 @@
   TODO: Implement it later! */
 #error "KVM/IA-64 depends on preempt notifiers in kernel."
 #endif
+
+/* smp_call_function() lost an argument in 2.6.27. */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
+
+#define kvm_smp_call_function(func, info, wait) smp_call_function(func,

info, 0, wait)
+
+#else
+
+#define kvm_smp_call_function(func, info, wait) smp_call_function(func, info, wait)
+
+#endif
+
+#endif

kernel/ia64/hack-module.awk new file +1 -0
new file mode 100644
index 0000000..b9b24c0
@@ -0,0 +1,14 @@
+BEGIN { split("INIT_WORK on_each_cpu smp_call_function" , compat_apis);

}
+
+/MODULE_AUTHOR/ {
+ printf("MODULE_INFO(version, \"%s\");\n", version)
+}
+
+{
+ for (i in compat_apis) {
+ ident = compat_apis[i]
+ sub("\\<" ident "\\>", "kvm_" ident)
+ }
+}
+
+{ print }

kernel/x86/Kbuild +0 -0
index ee81a1e..8dc0483 100644
@@ -1,11 +1,11 @@
 obj-m := kvm.o kvm-intel.o kvm-amd.o
 kvm-objs := kvm_main.o x86.o mmu.o x86_emulate.o ../anon_inodes.o irq.o

i8259.o \
lapic.o ioapic.o preempt.o i8254.o coalesced_mmio.o \
- external-module-compat.o
+ ../external-module-compat.o
ifeq ($(CONFIG_KVM_TRACE),y)
kvm-objs += kvm_trace.o
endif
-kvm-intel-objs := vmx.o vmx-debug.o external-module-compat.o -kvm-amd-objs := svm.o external-module-compat.o +kvm-intel-objs := vmx.o vmx-debug.o ../external-module-compat.o +kvm-amd-objs := svm.o ../external-module-compat.o

CFLAGS_kvm_main.o = -DKVM_MAIN

(quoted diff) +0 -0

b/kernel/x86/external-module-compat.h
index f6e3e34..0b70a53 100644

kernel/x86/external-module-compat.h +1 -0
@@ -5,6 +5,7 @@
 
 #include <linux/compiler.h>
 #include <linux/version.h>
+#include <asm/msr.h>
 
 #include "../external-module-compat-comm.h"
 
kernel/x86/hack-module.awk renamed from kernel/hack-module.awk +0 -0
similarity index 100%
rename from kernel/hack-module.awk
rename to kernel/x86/hack-module.awk
Signature · 1 line
1.5.1
Quoted 10 lines · Xiantao
Quoted 9 lines · Avi Kivity
Quoted 7 lines · Avi Kivity
Quoted 2 lines · Xiantao

Hi, Avi Since ia64 has supported userspace's build, could we
include ia64 bits in next release?

I updated my scripts. I'll send you a test tarball via private mail to see I hadn't missed any files.

Quoted 7 lines
Quoted 1 line

Better a link: http://userweb.kernel.org/~avi/test.tar.gz

Hi, Avi
You may need to apply this patch, and regenerate the package
again to keep kvm/ia64 compatible with Linux-2.6.26 and newer versions. :) Thannks
Xiantao

From 689bdb4c0506a1b6b24e9c481634593052ee2cc0 Mon Sep 17 00:00:00 2001
From: Xiantao Zhang <[email protected]>
Date: Tue, 26 Aug 2008 19:20:03 +0800
Subject: [PATCH] KVM: external module: keep kvm/ia64 compatible with Linux-2.6.26 and newer version.

Add some compatibility hack for Linux-2.6.26 and newer versions for ia64

---
 kernel/Makefile                           |    4 ++--
 kernel/external-module-compat-comm.h      |    1 -
 kernel/{x86 => }/external-module-compat.c |    0 
 kernel/ia64/Kbuild                        |    3 ++-
 kernel/ia64/external-module-compat.h      |   16 ++++++++++++++++
 kernel/ia64/hack-module.awk               |   14 ++++++++++++++
 kernel/x86/Kbuild                         |    6 +++---
 kernel/x86/external-module-compat.h       |    1 +
 kernel/{ => x86}/hack-module.awk          |    0 
 9 files changed, 38 insertions(+), 7 deletions(-)
 rename kernel/{x86 => }/external-module-compat.c (100%)
 create mode 100644 kernel/ia64/hack-module.awk
 rename kernel/{ => x86}/hack-module.awk (100%)
kernel/Makefile +2 -2
index 6f8cc9d..3f5f6da 100644
@@ -19,7 +19,7 @@ LINUX = ../linux-2.6
 version = $(shell cd $(LINUX); git describe)
 
 _hack = mv $1 $1.orig && \
-	gawk -v version=$(version) -f hack-module.awk $1.orig \
+	gawk -v version=$(version) -f $(ARCH_DIR)/hack-module.awk $1.orig \
 	    | sed '/\#include/! s/\blapic\b/l_apic/g' > $1 && rm $1.orig
 
 unifdef = mv $1 $1.orig && \
@@ -29,7 +29,7 @@ unifdef = mv $1 $1.orig && \
 hack = $(call _hack,$T/$(strip $1))
 
 hack-files-x86 = kvm_main.c mmu.c vmx.c svm.c x86.c irq.h lapic.c i8254.c
-hack-files-ia64 =
+hack-files-ia64 = kvm_main.c kvm_fw.c
 
 hack-files = $(hack-files-$(ARCH_DIR))
 
kernel/external-module-compat-comm.h +0 -1
index 97e921b..2e87c57 100644
@@ -17,7 +17,6 @@
 #include <asm/processor.h>
 #include <linux/hrtimer.h>
 #include <asm/bitops.h>
-#include <asm/msr.h>
 
 /*
  * 2.6.16 does not have GFP_NOWAIT
kernel/external-module-compat.c renamed from kernel/x86/external-module-compat.c +0 -0
similarity index 100%
rename from kernel/x86/external-module-compat.c
rename to kernel/external-module-compat.c
kernel/ia64/Kbuild +2 -1
index 764a493..8561476 100644
@@ -1,6 +1,7 @@
 obj-m := kvm.o kvm-intel.o
 
-kvm-objs := kvm_main.o ioapic.o coalesced_mmio.o kvm-ia64.o kvm_fw.o
+kvm-objs := kvm_main.o ioapic.o coalesced_mmio.o kvm-ia64.o kvm_fw.o \
+	../anon_inodes.o ../external-module-compat.o
 
 EXTRA_CFLAGS_vcpu.o += -mfixed-range=f2-f5,f12-f127
 kvm-intel-objs := vmm.o vmm_ivt.o trampoline.o vcpu.o optvfault.o mmio.o \
kernel/ia64/external-module-compat.h +16 -0
index 3c4001c..2a11d39 100644
@@ -2,8 +2,11 @@
  * Compatibility header for building as an external module.
  */
 
+#ifndef __ASSEMBLY__
 #include <linux/version.h>
 
+#include "../external-module-compat-comm.h"
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
 #error "KVM/IA-64 Can't be compiled if kernel version < 2.6.26"
 #endif
@@ -13,3 +16,16 @@
   TODO: Implement it later! */
 #error "KVM/IA-64 depends on preempt notifiers in kernel."
 #endif
+
+/* smp_call_function() lost an argument in 2.6.27. */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
+
+#define kvm_smp_call_function(func, info, wait) smp_call_function(func, info, 0, wait)
+
+#else
+
+#define kvm_smp_call_function(func, info, wait) smp_call_function(func, info, wait)
+
+#endif
+
+#endif
kernel/ia64/hack-module.awk new file +14 -0
new file mode 100644
index 0000000..b9b24c0
@@ -0,0 +1,14 @@
+BEGIN { split("INIT_WORK on_each_cpu smp_call_function" , compat_apis); }
+
+/MODULE_AUTHOR/ {
+    printf("MODULE_INFO(version, \"%s\");\n", version)
+}
+
+{
+    for (i in compat_apis) {
+	ident = compat_apis[i]
+	sub("\\<" ident "\\>", "kvm_" ident)
+    }
+}
+
+{ print }
kernel/x86/Kbuild +3 -3
index ee81a1e..8dc0483 100644
@@ -1,11 +1,11 @@
 obj-m := kvm.o kvm-intel.o kvm-amd.o
 kvm-objs := kvm_main.o x86.o mmu.o x86_emulate.o ../anon_inodes.o irq.o i8259.o \
 	 lapic.o ioapic.o preempt.o i8254.o coalesced_mmio.o \
-	 external-module-compat.o
+	 ../external-module-compat.o
 ifeq ($(CONFIG_KVM_TRACE),y)
 kvm-objs += kvm_trace.o
 endif
-kvm-intel-objs := vmx.o vmx-debug.o external-module-compat.o
-kvm-amd-objs := svm.o external-module-compat.o
+kvm-intel-objs := vmx.o vmx-debug.o ../external-module-compat.o
+kvm-amd-objs := svm.o ../external-module-compat.o
 
 CFLAGS_kvm_main.o = -DKVM_MAIN
kernel/x86/external-module-compat.h +1 -0
index f6e3e34..0b70a53 100644
@@ -5,6 +5,7 @@
 
 #include <linux/compiler.h>
 #include <linux/version.h>
+#include <asm/msr.h>
 
 #include "../external-module-compat-comm.h"
 
kernel/x86/hack-module.awk renamed from kernel/hack-module.awk +0 -0
similarity index 100%
rename from kernel/hack-module.awk
rename to kernel/x86/hack-module.awk
Signature · 1 line
1.5.1
author
#14 lore raw
Quoted 11 lines · Xiantao

Hi, Avi
A updated version. Please review again. Thanks.
Xiantao
From 689bdb4c0506a1b6b24e9c481634593052ee2cc0 Mon Sep 17 00:00:00 2001
From: Xiantao Zhang <[email protected]>
Date: Tue, 26 Aug 2008 19:20:03 +0800
Subject: [PATCH] KVM: external module: keep kvm/ia64 compatible with Linux-2.6.26 and newer version.

Add some compatibility hack for Linux-2.6.26 and newer versions for ia64

Unfortunately it breaks x86 build (2.6.25 host). Please test that.

Also, please separate the x86 file movement from the ia64 additions.

Signature · 1 line
error compiling committee.c: too many arguments to function
#15 lore raw
Quoted 10 lines · Avi Kivity
Quoted 9 lines · Xiantao

Hi, Avi
A updated version. Please review again. Thanks.
Xiantao
From 689bdb4c0506a1b6b24e9c481634593052ee2cc0 Mon Sep 17 00:00:00 2001 From: Xiantao Zhang <[email protected]>
Date: Tue, 26 Aug 2008 19:20:03 +0800
Subject: [PATCH] KVM: external module: keep kvm/ia64 compatible with Linux-2.6.26 and newer version.

Quoted 6 lines
Quoted 3 lines

Add some compatibility hack for Linux-2.6.26 and newer versions for ia64

Unfortunately it breaks x86 build (2.6.25 host). Please test that.

Oops, my mistake! I should put asm/msr.h after external-module-compat-comm.h due to dependcies issue.

Quoted 1 line

Also, please separate the x86 file movement from the ia64 additions.

Attached! First is for x86 file movement, and the other targets for hacking ia64 source for back-ward compatibility.
Thanks
Xiantao

From 0583db6c105df8870084ba866ca08bfb681eaf2d Mon Sep 17 00:00:00 2001
From: Zhang Xiantao <[email protected]>
Date: Wed, 27 Aug 2008 09:23:17 +0800
Subject: [PATCH] KVM: External Module: Moving two files for cross-arch support.

x86/external-module-compat.c -> external-module-compat.c. hack-module.awk -> x86/hack-module.awk.

---
 kernel/Makefile                           |    2 +-
 kernel/external-module-compat-comm.h      |    1 -
 kernel/{x86 => }/external-module-compat.c |    0 
 kernel/x86/Kbuild                         |    6 +++---
 kernel/x86/external-module-compat.h       |    2 ++
 kernel/{ => x86}/hack-module.awk          |    0 
 6 files changed, 6 insertions(+), 5 deletions(-)
 rename kernel/{x86 => }/external-module-compat.c (100%)
 rename kernel/{ => x86}/hack-module.awk (100%)
kernel/Makefile +1 -1
index 6f8cc9d..d2913a9 100644
@@ -19,7 +19,7 @@ LINUX = ../linux-2.6
 version = $(shell cd $(LINUX); git describe)
 
 _hack = mv $1 $1.orig && \
-	gawk -v version=$(version) -f hack-module.awk $1.orig \
+	gawk -v version=$(version) -f $(ARCH_DIR)/hack-module.awk $1.orig \
 	    | sed '/\#include/! s/\blapic\b/l_apic/g' > $1 && rm $1.orig
 
 unifdef = mv $1 $1.orig && \
kernel/external-module-compat-comm.h +0 -1
index 97e921b..2e87c57 100644
@@ -17,7 +17,6 @@
 #include <asm/processor.h>
 #include <linux/hrtimer.h>
 #include <asm/bitops.h>
-#include <asm/msr.h>
 
 /*
  * 2.6.16 does not have GFP_NOWAIT
kernel/external-module-compat.c renamed from kernel/x86/external-module-compat.c +0 -0
similarity index 100%
rename from kernel/x86/external-module-compat.c
rename to kernel/external-module-compat.c
kernel/x86/Kbuild +3 -3
index ee81a1e..8dc0483 100644
@@ -1,11 +1,11 @@
 obj-m := kvm.o kvm-intel.o kvm-amd.o
 kvm-objs := kvm_main.o x86.o mmu.o x86_emulate.o ../anon_inodes.o irq.o i8259.o \
 	 lapic.o ioapic.o preempt.o i8254.o coalesced_mmio.o \
-	 external-module-compat.o
+	 ../external-module-compat.o
 ifeq ($(CONFIG_KVM_TRACE),y)
 kvm-objs += kvm_trace.o
 endif
-kvm-intel-objs := vmx.o vmx-debug.o external-module-compat.o
-kvm-amd-objs := svm.o external-module-compat.o
+kvm-intel-objs := vmx.o vmx-debug.o ../external-module-compat.o
+kvm-amd-objs := svm.o ../external-module-compat.o
 
 CFLAGS_kvm_main.o = -DKVM_MAIN
kernel/x86/external-module-compat.h +2 -0
index f6e3e34..c53e0d6 100644
@@ -8,6 +8,8 @@
 
 #include "../external-module-compat-comm.h"
 
+#include <asm/msr.h>
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
 
 #ifndef _EFER_SCE
kernel/x86/hack-module.awk renamed from kernel/hack-module.awk +0 -0
similarity index 100%
rename from kernel/hack-module.awk
rename to kernel/x86/hack-module.awk
Signature · 1 line
1.5.6.2

From d7c633f32c16606a06a1c2df97cb36e76c439757 Mon Sep 17 00:00:00 2001
From: Zhang Xiantao <[email protected]>
Date: Wed, 27 Aug 2008 09:33:45 +0800
Subject: [PATCH] kvm/ia64: External module: Some hacks for the compability with 2.6.26.

Add one hack-module.awk scripts to hack ia64 source.

---
 kernel/Makefile                      |    2 +-
 kernel/ia64/Kbuild                   |    3 ++-
 kernel/ia64/external-module-compat.h |   16 ++++++++++++++++
 kernel/ia64/hack-module.awk          |   14 ++++++++++++++
 4 files changed, 33 insertions(+), 2 deletions(-)
 create mode 100644 kernel/ia64/hack-module.awk
kernel/Makefile +1 -1
index d2913a9..3f5f6da 100644
@@ -29,7 +29,7 @@ unifdef = mv $1 $1.orig && \
 hack = $(call _hack,$T/$(strip $1))
 
 hack-files-x86 = kvm_main.c mmu.c vmx.c svm.c x86.c irq.h lapic.c i8254.c
-hack-files-ia64 =
+hack-files-ia64 = kvm_main.c kvm_fw.c
 
 hack-files = $(hack-files-$(ARCH_DIR))
 
kernel/ia64/Kbuild +2 -1
index 764a493..8561476 100644
@@ -1,6 +1,7 @@
 obj-m := kvm.o kvm-intel.o
 
-kvm-objs := kvm_main.o ioapic.o coalesced_mmio.o kvm-ia64.o kvm_fw.o
+kvm-objs := kvm_main.o ioapic.o coalesced_mmio.o kvm-ia64.o kvm_fw.o \
+	../anon_inodes.o ../external-module-compat.o
 
 EXTRA_CFLAGS_vcpu.o += -mfixed-range=f2-f5,f12-f127
 kvm-intel-objs := vmm.o vmm_ivt.o trampoline.o vcpu.o optvfault.o mmio.o \
kernel/ia64/external-module-compat.h +16 -0
index 3c4001c..d6b67fe 100644
@@ -2,8 +2,11 @@
  * Compatibility header for building as an external module.
  */
 
+#ifndef __ASSEMBLY__
 #include <linux/version.h>
 
+#include "../external-module-compat-comm.h"
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
 #error "KVM/IA-64 Can't be compiled if kernel version < 2.6.26"
 #endif
@@ -13,3 +16,16 @@
   TODO: Implement it later! */
 #error "KVM/IA-64 depends on preempt notifiers in kernel."
 #endif
+
+/* smp_call_function() lost an argument in 2.6.27. */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
+
+#define kvm_smp_call_function(func, info, wait) smp_call_function(func, info, 0, wait)
+
+#else
+
+#define kvm_smp_call_function(func, info, wait) smp_call_function(func, info, wait)
+
+#endif
+
+#endif
kernel/ia64/hack-module.awk new file +14 -0
new file mode 100644
index 0000000..b9b24c0
@@ -0,0 +1,14 @@
+BEGIN { split("INIT_WORK on_each_cpu smp_call_function" , compat_apis); }
+
+/MODULE_AUTHOR/ {
+    printf("MODULE_INFO(version, \"%s\");\n", version)
+}
+
+{
+    for (i in compat_apis) {
+	ident = compat_apis[i]
+	sub("\\<" ident "\\>", "kvm_" ident)
+    }
+}
+
+{ print }
Signature · 1 line
1.5.6.2
author
#16 lore raw
Quoted 3 lines · Xiantao

Attached! First is for x86 file movement, and the other targets for hacking ia64 source for back-ward compatibility.

Both applied, thanks.

Signature · 1 line
error compiling committee.c: too many arguments to function
#17 lore raw
In reply to Avi Kivity
Quoted 8 lines · Avi Kivity
Quoted 4 lines · Xiantao

Hi, Avi
Since ia64 has supported userspace's build, could we include ia64
bits in next release?

I updated my scripts. I'll send you a test tarball via private mail to see I hadn't missed any files.

Great! I will guarantee it can work well on ia64 platforms. Thanks! Xiantao

#18 lore raw
In reply to Avi Kivity
Quoted 8 lines · Avi Kivity

The big change is of course full swapping support, finally delivering the full range of Linux memory management operations to kvm. You will need a 2.6.27 host to use this functionality, however.

Other noteworthy changes: speedups of both virtio-net and qcow2 with cache=off. Two important works-in-progress: device assignment (not usable yet, as dma support is still missing) and the real-mode emulation framework.

what is the current recommended way to build kernel module for kvm? until now it was a simple
make KDIR=...
in the linux dir, but it's no longer working. first of all now is required to run configure for kernel module too, second the above make now get into an infinite recursive loop.
anyway it's be useful a few lines of INSTALL file for both userspace and kernel module config, build and install procedure.

Signature · 1 line
  Levente                               "Si vis pacem para bellum!"
author
#19 lore raw
Quoted 9 lines · Farkas Levente

what is the current recommended way to build kernel module for kvm? until now it was a simple
make KDIR=...
in the linux dir, but it's no longer working. first of all now is required to run configure for kernel module too, second the above make now get into an infinite recursive loop.
anyway it's be useful a few lines of INSTALL file for both userspace and kernel module config, build and install procedure.

cd kvm-73
./configure
make
sudo make install

Signature · 1 line
Do not meddle in the internals of kernels, for they are subtle and quick to panic.