Re: Has any work 3.3 kvm-kmod for rhel 6.2 kernel successfully?

ya su
2012-04-16T14:34:15Z

[-- Attachment #1: Type: text/plain, Size: 986 bytes --]

I first notice 3.3 release notes, it says it can compile against
2.6.32-40, so I think it can work with 2.6.32, then I change it with
rhel 2.6.32 kernel.

I just re-change orginal kvm-kmod 3.3 with rhel 2.6.32, only to change
compile redefination errors, but the problem remains the same. the
patch attached.

I don't go through git commits, as so many changes from 2.6.32 to 3.3 in kernel.

I think the problem may come from memory change notification.

2012/4/16, Jan Kiszka <jan.kiszka@siemens.com>:
> On 2012-04-16 14:23, ya su wrote:
>> kvm-kmod 3.3 patch attached.
>>
>> I also change kernel to export __get_user_pages_fast.
>
> Ugh, that's huge. How did you select which feature to enable? Based on
> compile tests? The risk would then be to miss some bits that are
> additionally required. Or did you step through the git commits to
> identify corresponding parts?
>
> Jan
>
> --
> Siemens AG, Corporate Technology, CT T DE IT 1
> Corporate Competence Center Embedded Linux
>

[-- Attachment #2: kvm-kmod-min.patch --]
[-- Type: application/octet-stream, Size: 3664 bytes --]

diff -ur -i /root/src/kvm-kmod-3.3/external-module-compat-comm.h kvm-kmod-3.3/external-module-compat-comm.h
--- /root/src/kvm-kmod-3.3/external-module-compat-comm.h 2012-03-20 06:00:42.000000000 +0800
+++ kvm-kmod-3.3/external-module-compat-comm.h 2012-04-16 22:00:59.815810075 +0800
@@ -718,7 +718,8 @@
#endif
}

-#if defined(CONFIG_PCI) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33) && \
+#if 0
+defined(CONFIG_PCI) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33) && \
(!defined(CONFIG_SUSE_KERNEL) || LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32))
#include <linux/pci.h>
static inline struct pci_dev *
@@ -743,7 +744,7 @@

#endif

-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)
+#if 0 //LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)
struct perf_guest_info_callbacks {
int (*is_in_guest) (void);
int (*is_user_mode) (void);
@@ -901,7 +902,8 @@
#define __rcu
#endif

-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37) && \
+#if 0
+LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37) && \
(!defined(CONFIG_FEDORA_KERNEL) || \
(LINUX_VERSION_CODE == KERNEL_VERSION(2,6,35) && \
KERNEL_EXTRAVERSION < 11) || \
@@ -932,7 +934,8 @@
#define kvm_request_threaded_irq request_threaded_irq
#endif

-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)
+#if 0
+LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)
#define compound_trans_head(page) compound_head(page)

static inline int PageTransCompound(struct page *page)
@@ -984,7 +987,7 @@
#define __set_bit_le ext2_set_bit
#endif

-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,0,0)
+#if 0 //LINUX_VERSION_CODE < KERNEL_VERSION(3,0,0)
static inline void rcu_virt_note_context_switch(int cpu)
{
}
@@ -1008,7 +1011,7 @@
#endif /* >= 3.1 */
#endif /* CONFIG_COMPAT */

-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
+#if 0 //LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)

#ifdef CONFIG_PRINTK
#define printk_ratelimited(fmt, ...) \
@@ -1021,7 +1024,7 @@
printk(fmt, ##__VA_ARGS__); \
})
#else
-#define printk_ratelimited(fmt, ...)
+//#define printk_ratelimited(fmt, ...)
#endif

#define pr_err_ratelimited(fmt, ...) \
diff -ur -i /root/src/kvm-kmod-3.3/x86/external-module-compat.h kvm-kmod-3.3/x86/external-module-compat.h
--- /root/src/kvm-kmod-3.3/x86/external-module-compat.h 2012-03-20 06:00:42.000000000 +0800
+++ kvm-kmod-3.3/x86/external-module-compat.h 2012-04-16 22:01:35.657969473 +0800
@@ -1115,7 +1115,8 @@

#endif /* >= 2.6.36 */

-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37) && \
+#if 0
+LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37) && \
(LINUX_VERSION_CODE != KERNEL_VERSION(2,6,32) || KERNEL_EXTRAVERSION < 40)
static inline u64 pvclock_scale_delta(u64 delta, u32 mul_frac, int shift)
{
@@ -1173,7 +1174,7 @@
asm("mov %%" #seg ",%0":"=r" (value) : : "memory")
#endif

-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)
+#if 0 //LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)
#define static_cpu_has(bit) boot_cpu_has(bit)
#endif

diff -ur -i /root/src/kvm-kmod-3.3/x86/mmu.c kvm-kmod-3.3/x86/mmu.c
--- /root/src/kvm-kmod-3.3/x86/mmu.c 2012-03-20 06:00:56.000000000 +0800
+++ kvm-kmod-3.3/x86/mmu.c 2012-04-16 22:02:46.925967148 +0800
@@ -3939,9 +3939,9 @@
kvm_mmu_prepare_zap_page(kvm, page, invalid_list);
}

-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0)
+#if 0 // LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0)
static int mmu_shrink(struct shrinker *shrink, struct shrink_control *sc)
-#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)
+#elif 1 //LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)
static int mmu_shrink(struct shrinker *shrink, int nr_to_scan, gfp_t gfp_mask)
#else
static int mmu_shrink(int nr_to_scan, gfp_t gfp_mask)