Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 340e01248478ba8b78a6d4d1809b1eff > files > 74

kvm-83-270.el5_11.src.rpm

From f7ed19d97b1fc703569db28ba84e80205eb2b129 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost@redhat.com>
Date: Thu, 5 Nov 2009 14:09:55 -0200
Subject: [PATCH] Add smp_call_function_many to compat_apis

RH-Author: Eduardo Habkost <ehabkost@redhat.com>
Message-id: <20091104215348.GE3351@blackpad.lan.raisama.net>
Patchwork-id: 3680
O-Subject: [RHEL-5.5 KVM PATCH] Add smp_call_function_many to compat_apis
Bugzilla: 533059
RH-Acked-by: Glauber Costa <glommer@redhat.com>
RH-Acked-by: Juan Quintela <quintela@redhat.com>
RH-Acked-by: Avi Kivity <avi@redhat.com>

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=533059

Newer RHEL-5.5 kernels (2.6.18-169.el5 and higher) provide a
smp_call_function_many() function, causing conflicts with the compat
version of the the function on KVM. This ensures that a "kvm_" prefix is
added to the compat function to avoid conflicts.

Note that we may change KVM to use the new native
smp_call_function_many() function, too. But we should do this in small
steps: first we need to make KVM build properly again (without any
functional change), and then we can change it to use the new function.
This will ensure that we will have a working tree even if we find the
(to be written) use-native-smp_call_function_many patch to be buggy and
need to revert it.

Please ACK this ASAP, because this blocks us from submitting RHEL-5.5 KVM
builds on Brew.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 kernel/external-module-compat-comm.h |    2 +-
 kernel/x86/hack-module.awk           |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 kernel/external-module-compat-comm.h |    2 +-
 kernel/x86/hack-module.awk           |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/kernel/external-module-compat-comm.h b/kernel/external-module-compat-comm.h
index 8fb2269..e26be1a 100644
--- a/kernel/external-module-compat-comm.h
+++ b/kernel/external-module-compat-comm.h
@@ -716,7 +716,7 @@ static inline void cpumask_set_cpu(int cpu, cpumask_var_t mask)
 	cpu_set(cpu, *mask);
 }
 
-static inline int smp_call_function_many(cpumask_var_t cpus,
+static inline int kvm_smp_call_function_many(cpumask_var_t cpus,
 					 void (*func)(void *data), void *data,
 					 int sync)
 {
diff --git a/kernel/x86/hack-module.awk b/kernel/x86/hack-module.awk
index 5a49183..5f1cb41 100644
--- a/kernel/x86/hack-module.awk
+++ b/kernel/x86/hack-module.awk
@@ -2,7 +2,8 @@ BEGIN { split("INIT_WORK tsc_khz desc_struct ldttss_desc64 desc_ptr " \
 	      "hrtimer_add_expires_ns hrtimer_get_expires " \
 	      "hrtimer_get_expires_ns hrtimer_start_expires " \
 	      "hrtimer_expires_remaining smp_send_reschedule " \
-	      "on_each_cpu relay_open request_irq free_irq get_user_pages_fast" , compat_apis); }
+	      "on_each_cpu relay_open request_irq free_irq " \
+	      "get_user_pages_fast smp_call_function_many" , compat_apis); }
 
 /^int kvm_init\(/ { anon_inodes = 1 }
 
-- 
1.6.3.rc4.29.g8146