* [RFC] external module: compatibility with older kernels (SMP and non SMP)
@ 2007-12-18 13:00 Carlo Marcelo Arenas Belon
2007-12-18 16:32 ` Avi Kivity
0 siblings, 1 reply; 6+ messages in thread
From: Carlo Marcelo Arenas Belon @ 2007-12-18 13:00 UTC (permalink / raw)
To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
The following patch (which is composed of 3 different patches from a series)
has been validated to solve compilation issues observed with kvm-56 in x86
with kernels older than 2.6.21 and are posted here for testing and debate.
The main points accomplished (in the same sequence that the snippets) are :
* kernel <= 2.6.16 doesn't define memcpy or strcmp before used by kvm_para.h
* complement f2601fd2874b94d14dfcb21a3e1b84d7f3262b17 reverting the inclusion
of io_apic.h which to simplify handling of older kernels
* kernel < 2.6.21 define MAX_IO_APICS to fix non SMP compilations
Remaining issues not yet covered for this patch or the series are :
* kernel < 2.6.19 undefined cpu_online_map in non SMP
* kernel <= 2.6.16 undefined hrtimer-{init,start,cancel}
A fix for the first issue was reverted after regressions were found with non
SMP hosts having SMP guests (which are anyway unreliable even with the last
kernel), the second issue is still open to debate in a separate thread with
the most likely fix (if any) done outside of the external module.
Carlo
--
diff --git a/kernel/external-module-compat.h b/kernel/external-module-compat.h
index 1dc5a96..c6a7d03 100644
--- a/kernel/external-module-compat.h
+++ b/kernel/external-module-compat.h
@@ -9,6 +9,7 @@
#include <linux/compiler.h>
#include <linux/version.h>
+#include <linux/string.h>
#include "include/linux/kvm.h"
#include "include/linux/kvm_para.h"
#include <linux/cpu.h>
@@ -537,21 +538,6 @@ out:
#define CONFIG_HAS_IOMEM 1
#endif
-/* Some kernels don't make dest_* available with some configs. */
-
-#include <asm/io_apic.h>
-
-#ifndef dest_Fixed
-#define dest_Fixed 0
-#define dest_LowestPrio 1
-#define dest_SMI 2
-#define dest__reserved_1 3
-#define dest_NMI 4
-#define dest_INIT 5
-#define dest__reserved_2 6
-#define dest_ExtINT 7
-#endif
-
/* empty_zero_page isn't exported in all kernels */
#include <asm/pgtable.h>
@@ -573,6 +559,11 @@ static inline void blahblah(void)
#endif
+/* apicdef.h doesn't get included before 2.6.21 if non-smp */
+#ifndef MAX_IO_APICS
+#define MAX_IO_APICS 64
+#endif
+
/* X86_FEATURE_NX is missing in some x86_64 kernels */
#include <asm/cpufeature.h>
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [RFC] external module: compatibility with older kernels (SMP and non SMP)
2007-12-18 13:00 [RFC] external module: compatibility with older kernels (SMP and non SMP) Carlo Marcelo Arenas Belon
@ 2007-12-18 16:32 ` Avi Kivity
[not found] ` <4767F63A.9020701-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
0 siblings, 1 reply; 6+ messages in thread
From: Avi Kivity @ 2007-12-18 16:32 UTC (permalink / raw)
To: Carlo Marcelo Arenas Belon; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
Carlo Marcelo Arenas Belon wrote:
> The following patch (which is composed of 3 different patches from a series)
> has been validated to solve compilation issues observed with kvm-56 in x86
> with kernels older than 2.6.21 and are posted here for testing and debate.
>
> The main points accomplished (in the same sequence that the snippets) are :
>
> * kernel <= 2.6.16 doesn't define memcpy or strcmp before used by kvm_para.h
> * complement f2601fd2874b94d14dfcb21a3e1b84d7f3262b17 reverting the inclusion
> of io_apic.h which to simplify handling of older kernels
> * kernel < 2.6.21 define MAX_IO_APICS to fix non SMP compilations
>
>
Looks good, but please split into separate patches.
--
error compiling committee.c: too many arguments to function
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] external module: remove dependency on <asm/io_apic.h>
[not found] ` <4767F63A.9020701-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
@ 2007-12-19 12:18 ` Carlo Marcelo Arenas Belon
2007-12-19 15:44 ` Avi Kivity
2007-12-19 12:20 ` [PATCH] external module: define MAX_IO_APICS if missing Carlo Marcelo Arenas Belon
2007-12-19 12:26 ` [PATCH] external module: <linux/string.h> needed for kernel<=2.6.16 to define strcmp and memcpy Carlo Marcelo Arenas Belon
2 siblings, 1 reply; 6+ messages in thread
From: Carlo Marcelo Arenas Belon @ 2007-12-19 12:18 UTC (permalink / raw)
To: Avi Kivity; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
Complements f2601fd2874b94d14dfcb21a3e1b84d7f3262b17 which made obsolete
the use of io_apic provided defines that were not being included for x86
when the host kernel didn't have IO_APIC support.
Reverts :
5d6ea6b370ff9aae1dd7671b71e89351749fbeee
26e6e6a8681f1041b61fccdf2fdf2aacb88cee36
Signed-off-by: Carlo Marcelo Arenas Belon <carenas-kLeDWSohozoJb6fo7hG9ng@public.gmane.org>
---
kernel/external-module-compat.h | 15 ---------------
1 files changed, 0 insertions(+), 15 deletions(-)
diff --git a/kernel/external-module-compat.h b/kernel/external-module-compat.h
index 1dc5a96..acd7ea5 100644
--- a/kernel/external-module-compat.h
+++ b/kernel/external-module-compat.h
@@ -537,21 +537,6 @@ out:
#define CONFIG_HAS_IOMEM 1
#endif
-/* Some kernels don't make dest_* available with some configs. */
-
-#include <asm/io_apic.h>
-
-#ifndef dest_Fixed
-#define dest_Fixed 0
-#define dest_LowestPrio 1
-#define dest_SMI 2
-#define dest__reserved_1 3
-#define dest_NMI 4
-#define dest_INIT 5
-#define dest__reserved_2 6
-#define dest_ExtINT 7
-#endif
-
/* empty_zero_page isn't exported in all kernels */
#include <asm/pgtable.h>
--
1.5.2.5
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] external module: define MAX_IO_APICS if missing
[not found] ` <4767F63A.9020701-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-12-19 12:18 ` [PATCH] external module: remove dependency on <asm/io_apic.h> Carlo Marcelo Arenas Belon
@ 2007-12-19 12:20 ` Carlo Marcelo Arenas Belon
2007-12-19 12:26 ` [PATCH] external module: <linux/string.h> needed for kernel<=2.6.16 to define strcmp and memcpy Carlo Marcelo Arenas Belon
2 siblings, 0 replies; 6+ messages in thread
From: Carlo Marcelo Arenas Belon @ 2007-12-19 12:20 UTC (permalink / raw)
To: Avi Kivity; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
Defines MAX_IO_APICS if not defined already with the same value used in
<asm/apicdef.h> and which wasn't loaded for non-smp kernels before 2.6.21
Signed-off-by: Carlo Marcelo Arenas Belon <carenas-kLeDWSohozoJb6fo7hG9ng@public.gmane.org>
---
kernel/external-module-compat.h | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/kernel/external-module-compat.h b/kernel/external-module-compat.h
index acd7ea5..3794a99 100644
--- a/kernel/external-module-compat.h
+++ b/kernel/external-module-compat.h
@@ -558,6 +558,11 @@ static inline void blahblah(void)
#endif
+/* apicdef.h doesn't get included before 2.6.21 if non-smp */
+#ifndef MAX_IO_APICS
+#define MAX_IO_APICS 64
+#endif
+
/* X86_FEATURE_NX is missing in some x86_64 kernels */
#include <asm/cpufeature.h>
--
1.5.2.5
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] external module: <linux/string.h> needed for kernel<=2.6.16 to define strcmp and memcpy
[not found] ` <4767F63A.9020701-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-12-19 12:18 ` [PATCH] external module: remove dependency on <asm/io_apic.h> Carlo Marcelo Arenas Belon
2007-12-19 12:20 ` [PATCH] external module: define MAX_IO_APICS if missing Carlo Marcelo Arenas Belon
@ 2007-12-19 12:26 ` Carlo Marcelo Arenas Belon
2 siblings, 0 replies; 6+ messages in thread
From: Carlo Marcelo Arenas Belon @ 2007-12-19 12:26 UTC (permalink / raw)
To: Avi Kivity; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
Fixes the following compilation error :
in file included from kernel/include/linux/kvm_para.h:19,
from kernel/external-module-compat.h:13,
from <command line>:1:
kernel/include/asm/kvm_para.h: In function 'kvm_para_available':
kernel/include/asm/kvm_para.h:87: warning: implicit declaration of function 'memcpy'
kernel/include/asm/kvm_para.h:92: warning: implicit declaration of function 'strcmp'
In file included from include/linux/string.h:24,
from include/linux/bitmap.h:8,
from include/linux/cpumask.h:86,
from include/linux/node.h:23,
from include/linux/cpu.h:23,
from kernel/external-module-compat.h:14,
from <command line>:1:
include/asm/string.h: At top level:
include/asm/string.h:104: error: static declaration of 'strcmp' follows non-static declaration
Signed-off-by: Carlo Marcelo Arenas Belon <carenas-kLeDWSohozoJb6fo7hG9ng@public.gmane.org>
---
kernel/external-module-compat.h | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/kernel/external-module-compat.h b/kernel/external-module-compat.h
index 3794a99..c6a7d03 100644
--- a/kernel/external-module-compat.h
+++ b/kernel/external-module-compat.h
@@ -9,6 +9,7 @@
#include <linux/compiler.h>
#include <linux/version.h>
+#include <linux/string.h>
#include "include/linux/kvm.h"
#include "include/linux/kvm_para.h"
#include <linux/cpu.h>
--
1.5.2.5
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] external module: remove dependency on <asm/io_apic.h>
2007-12-19 12:18 ` [PATCH] external module: remove dependency on <asm/io_apic.h> Carlo Marcelo Arenas Belon
@ 2007-12-19 15:44 ` Avi Kivity
0 siblings, 0 replies; 6+ messages in thread
From: Avi Kivity @ 2007-12-19 15:44 UTC (permalink / raw)
To: Carlo Marcelo Arenas Belon; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
Carlo Marcelo Arenas Belon wrote:
> Complements f2601fd2874b94d14dfcb21a3e1b84d7f3262b17 which made obsolete
> the use of io_apic provided defines that were not being included for x86
> when the host kernel didn't have IO_APIC support.
>
> Reverts :
> 5d6ea6b370ff9aae1dd7671b71e89351749fbeee
> 26e6e6a8681f1041b61fccdf2fdf2aacb88cee36
>
>
Thanks; applied this and the other two patches.
--
error compiling committee.c: too many arguments to function
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2007-12-19 15:44 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-18 13:00 [RFC] external module: compatibility with older kernels (SMP and non SMP) Carlo Marcelo Arenas Belon
2007-12-18 16:32 ` Avi Kivity
[not found] ` <4767F63A.9020701-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-12-19 12:18 ` [PATCH] external module: remove dependency on <asm/io_apic.h> Carlo Marcelo Arenas Belon
2007-12-19 15:44 ` Avi Kivity
2007-12-19 12:20 ` [PATCH] external module: define MAX_IO_APICS if missing Carlo Marcelo Arenas Belon
2007-12-19 12:26 ` [PATCH] external module: <linux/string.h> needed for kernel<=2.6.16 to define strcmp and memcpy Carlo Marcelo Arenas Belon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox