-
Notifications
You must be signed in to change notification settings - Fork 1
/
ignore_xen_on_arm.patch
47 lines (45 loc) · 1.9 KB
/
ignore_xen_on_arm.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Author: Luca Boccassi <[email protected]>
Description: Undef CONFIG_XEN and CONFIG_XEN_DOM0 if building on ARM
Currently armmp kernel headers (3.16, 4.0, 4.1) have CONFIG_XEN enabled and
CONFIG_PARAVIRT disabled. This causes a build failure of the armhf dkms modules
in all current versions of the Nvidia driver.
Since running this driver on Xen is currently not supported anyway on Debian,
this patch undefines CONFIG_XEN and CONFIG_XEN_DOM0 if building on ARM, and
avoid including asm/maddr.h and xen/interface/memory.h.
Note that this has been tested only on qemu.
It is recommended to build an armmp kernel with CONFIG_XEN disabled (or with
CONFIG_XEN_PARAVIRT enabled) to use the Nvidia drivers.
--- a/common/inc/nv-linux.h
+++ b/common/inc/nv-linux.h
@@ -43,6 +43,11 @@
#include <linux/version.h>
#include <linux/utsname.h>
+#if defined(NVCPU_ARM) && LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0)
+#undef CONFIG_XEN
+#undef CONFIG_XEN_DOM0
+#endif
+
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 9)
#error "This driver does not support kernels older than 2.6.9!"
#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 7, 0)
@@ -284,7 +289,7 @@ NV_STATUS nvos_forward_error_to_cray(str
* NVIDIA graphics driver has no way of knowing and is unlikely
* to work correctly.
*/
-#if defined(CONFIG_XEN) && !defined(CONFIG_PARAVIRT)
+#if defined(CONFIG_XEN) && !defined(CONFIG_PARAVIRT) && !defined(NVCPU_ARM)
#include <asm/maddr.h>
#include <xen/interface/memory.h>
#define NV_XEN_SUPPORT_FULLY_VIRTUALIZED_KERNEL
--- a/conftest.sh
+++ b/conftest.sh
@@ -48,7 +48,8 @@ test_xen() {
# CONFIG_XEN and CONFIG_PARAVIRT are present, text_xen() treats
# the kernel as a stand-alone kernel.
#
- if ! test_configuration_option CONFIG_XEN ||
+ if [ "$ARCH" = "arm" ] ||
+ ! test_configuration_option CONFIG_XEN ||
test_configuration_option CONFIG_PARAVIRT; then
XEN_PRESENT=0
fi