NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/53130: Building modules for XEN API doesn't work



>Number:         53130
>Category:       kern
>Synopsis:       Building modules for XEN API doesn't work
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Mar 26 06:35:01 +0000 2018
>Originator:     Paul Goyette
>Release:        NetBSD 8.99.14
>Organization:
+------------------+--------------------------+----------------------------+
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:          |
| (Retired)        | FA29 0E3B 35AF E8AE 6651 | paul at whooppee dot com   |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd dot org |
+------------------+--------------------------+----------------------------+
>Environment:
	
	
System: NetBSD speedy.whooppee.com 8.99.14 NetBSD 8.99.14 (SPEEDY 2018-03-20 11:25:00 UTC) #0: Wed Mar 21 10:38:29 UTC 2018 paul%speedy.whooppee.com@localhost:/build/netbsd-local/obj/amd64/sys/arch/amd64/compile/SPEEDY amd64
Architecture: x86_64
Machine: amd64
>Description:
The build infrastructure has code to build both "normal" and "xen" 
variants of kernel modules (for amd;  for i386, there's also "xen-pae").
However, it fails to define the macro XEN (in CPPFLAGS), so conditional
code does not get built correctly.

It is possible to modify the various files in src/share/mk (see Fix
section below) to define the needed macros.  However, code which attempts 
to #include header files from xen/ directory does not succeed, since
the build infrastructure does not create the requisite sym-link in the
module object directories.
	
>How-To-Repeat:
For an example of the problem, checkout a copy of the pgoyette-compat
branch (from March 26th) and try to 'build.sh modules'.  Both the
compat and compat_60 modules will fail trying to build the source file
src/sys/arch/x86/x86/compat_60_cpu_ucode.c
	
>Fix:
The following diff fixes part 1 of the problem, by defining the XEN and
PAE macros as appropriate.  However, I do not have a correct fix for
craeting the required sym-links in the object directories.


Index: modules/arch/x86/amd64-xen/bsd.amd64-xen.mk
===================================================================
RCS file: /cvsroot/src/sys/modules/arch/x86/amd64-xen/bsd.amd64-xen.mk,v
retrieving revision 1.1
diff -u -p -r1.1 bsd.amd64-xen.mk
--- modules/arch/x86/amd64-xen/bsd.amd64-xen.mk	11 Aug 2014 03:43:25 -0000	1.1
+++ modules/arch/x86/amd64-xen/bsd.amd64-xen.mk	26 Mar 2018 06:28:24 -0000
@@ -7,4 +7,6 @@ KMODULEARCHDIR:=	amd64-xen
 
 XEN=	1
 
+CPPFLAGS+=	-DXEN
+
 .endif # _BSD_AMD64_XEN_MK_
Index: modules/arch/x86/i386-xen/bsd.i386-xen.mk
===================================================================
RCS file: /cvsroot/src/sys/modules/arch/x86/i386-xen/bsd.i386-xen.mk,v
retrieving revision 1.1
diff -u -p -r1.1 bsd.i386-xen.mk
--- modules/arch/x86/i386-xen/bsd.i386-xen.mk	11 Aug 2014 03:43:26 -0000	1.1
+++ modules/arch/x86/i386-xen/bsd.i386-xen.mk	26 Mar 2018 06:28:24 -0000
@@ -7,4 +7,6 @@ KMODULEARCHDIR:=	i386-xen
 
 XEN=	1
 
+CPPFLAGS+=	-DXEN
+
 .endif # _BSD_I386_XEN_MK_
Index: modules/arch/x86/i386pae-xen/bsd.i386pae-xen.mk
===================================================================
RCS file: /cvsroot/src/sys/modules/arch/x86/i386pae-xen/bsd.i386pae-xen.mk,v
retrieving revision 1.1
diff -u -p -r1.1 bsd.i386pae-xen.mk
--- modules/arch/x86/i386pae-xen/bsd.i386pae-xen.mk	11 Aug 2014 03:43:26 -0000	1.1
+++ modules/arch/x86/i386pae-xen/bsd.i386pae-xen.mk	26 Mar 2018 06:28:24 -0000
@@ -8,4 +8,6 @@ KMODULEARCHDIR:=	i386pae-xen
 XEN=	1
 PAE=	1
 
+CPPFLAGS+=	-DPAE -DXEN
+
 .endif # _BSD_I386PAE_XEN_MK_

	

>Unformatted:
 	
 	


Home | Main Index | Thread Index | Old Index