summaryrefslogtreecommitdiff
path: root/sysutils
diff options
context:
space:
mode:
authorjnemeth <jnemeth@pkgsrc.org>2016-07-04 07:25:13 +0000
committerjnemeth <jnemeth@pkgsrc.org>2016-07-04 07:25:13 +0000
commit7a6017205418a9fa4a92c1eb601a8f28b0f45e6c (patch)
tree4465139db40e132d2333165c2640c54d7af959d3 /sysutils
parent8ffa9a9ca873f98ff6aa8ef9a60f37342b1e5b11 (diff)
downloadpkgsrc-7a6017205418a9fa4a92c1eb601a8f28b0f45e6c.tar.gz
Xen is a hypervisor which supports running multiple guest operating
systems on a single machine. Guest OSes (also called "domains") can be either paravirtualised (i.e. make hypercalls in order to access hardware), run in HVM (Hardware Virtualisation Mode) where they will be presented with virtual devices, or a combination where they use hypercalls to access hardware but manage memory themselves. At boot, the xen kernel is loaded along with the guest kernel for the first domain (called domain0). domain0 has privileges to access the physical hardware (PCI and ISA devices), administrate other domains and provide virtual devices (disks and network) to other domains. This package contains the 4.6 Xen kernel itself. PCI passthrough is not supported. PAE is mandatory; on i386 one must use XEN3PAE_DOM[0U].
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/xenkernel46/DESCR14
-rw-r--r--sysutils/xenkernel46/MESSAGE7
-rw-r--r--sysutils/xenkernel46/Makefile56
-rw-r--r--sysutils/xenkernel46/PLIST3
-rw-r--r--sysutils/xenkernel46/distinfo13
-rw-r--r--sysutils/xenkernel46/patches/patch-Config.mk13
-rw-r--r--sysutils/xenkernel46/patches/patch-xen_Makefile13
-rw-r--r--sysutils/xenkernel46/patches/patch-xen_arch_x86_Rules.mk12
-rw-r--r--sysutils/xenkernel46/patches/patch-xen_common_page__alloc.c13
-rw-r--r--sysutils/xenkernel46/patches/patch-xen_drivers_passthrough_vtd_x86_ats.c22
-rw-r--r--sysutils/xenkernel46/patches/patch-xen_include_asm-x86_current.h13
-rw-r--r--sysutils/xenkernel46/patches/patch-xen_include_xen_lib.h13
12 files changed, 192 insertions, 0 deletions
diff --git a/sysutils/xenkernel46/DESCR b/sysutils/xenkernel46/DESCR
new file mode 100644
index 00000000000..bcab56d85bc
--- /dev/null
+++ b/sysutils/xenkernel46/DESCR
@@ -0,0 +1,14 @@
+Xen is a hypervisor which supports running multiple guest operating
+systems on a single machine. Guest OSes (also called "domains")
+can be either paravirtualised (i.e. make hypercalls in order to
+access hardware), run in HVM (Hardware Virtualisation Mode) where
+they will be presented with virtual devices, or a combination where
+they use hypercalls to access hardware but manage memory themselves.
+At boot, the xen kernel is loaded along with the guest kernel for
+the first domain (called domain0). domain0 has privileges to access
+the physical hardware (PCI and ISA devices), administrate other
+domains and provide virtual devices (disks and network) to other
+domains.
+
+This package contains the 4.6 Xen kernel itself. PCI passthrough is
+not supported. PAE is mandatory; on i386 one must use XEN3PAE_DOM[0U].
diff --git a/sysutils/xenkernel46/MESSAGE b/sysutils/xenkernel46/MESSAGE
new file mode 100644
index 00000000000..31fca28f6a6
--- /dev/null
+++ b/sysutils/xenkernel46/MESSAGE
@@ -0,0 +1,7 @@
+===========================================================================
+$NetBSD: MESSAGE,v 1.1.1.1 2016/07/04 07:25:13 jnemeth Exp $
+
+The Xen hypervisor is installed under the following locations:
+ ${XENKERNELDIR}/xen.gz (standard hypervisor)
+ ${XENKERNELDIR}/xen-debug.gz (debug hypervisor)
+===========================================================================
diff --git a/sysutils/xenkernel46/Makefile b/sysutils/xenkernel46/Makefile
new file mode 100644
index 00000000000..1ab171695ad
--- /dev/null
+++ b/sysutils/xenkernel46/Makefile
@@ -0,0 +1,56 @@
+# $NetBSD: Makefile,v 1.1.1.1 2016/07/04 07:25:13 jnemeth Exp $
+
+VERSION= 4.6.3
+DISTNAME= xen-${VERSION}
+PKGNAME= xenkernel46-${VERSION}
+#PKGREVISION= 0
+CATEGORIES= sysutils
+MASTER_SITES= http://bits.xensource.com/oss-xen/release/${VERSION}/
+
+MAINTAINER= pkgsrc-users@NetBSD.org
+HOMEPAGE= http://xenproject.org/
+COMMENT= Xen 4.6.x Kernel
+
+LICENSE= gnu-gpl-v2
+
+ONLY_FOR_PLATFORM= Linux-2.6*-i386 Linux-2.6*-x86_64
+ONLY_FOR_PLATFORM+= NetBSD-[5-9].*-x86_64 NetBSD-[5-9].*-i386
+
+NO_CONFIGURE= yes
+USE_TOOLS+= gmake
+
+PYTHON_FOR_BUILD_ONLY= YES
+PYTHON_VERSIONS_INCOMPATIBLE= 33 34 35
+
+MAKE_ENV+= OCAML_TOOLS=no
+
+INSTALLATION_DIRS= xen46-kernel
+XENKERNELDIR= ${PREFIX}/${INSTALLATION_DIRS}
+
+MESSAGE_SUBST+= XENKERNELDIR=${XENKERNELDIR}
+
+.include "../../mk/compiler.mk"
+.if !empty(PKGSRC_COMPILER:Mclang)
+EXTRA_CFLAGS+= -Qunused-arguments -no-integrated-as -Wno-error=format \
+ -Wno-error=parentheses-equality -Wno-error=enum-conversion \
+ -Wno-error=unused-function -Wno-error=unused-const-variable \
+ -Wno-error=ignored-attributes -Wno-error=initializer-overrides
+.endif
+
+MAKE_ENV+= EXTRA_CFLAGS=${EXTRA_CFLAGS:Q}
+
+do-build:
+ cd ${WRKSRC}/xen && ${BUILD_MAKE_CMD} debug=n build
+ ${CP} ${WRKSRC}/xen/xen.gz ${WRKDIR}/xen.gz
+ cd ${WRKSRC}/xen && ${MAKE_PROGRAM} clean
+ cd ${WRKSRC}/xen && ${BUILD_MAKE_CMD} debug=y build
+ ${CP} ${WRKSRC}/xen/xen.gz ${WRKDIR}/xen-debug.gz
+
+do-install:
+ ${INSTALL_DATA} ${WRKDIR}/xen.gz \
+ ${DESTDIR}${XENKERNELDIR}/xen.gz
+ ${INSTALL_DATA} ${WRKDIR}/xen-debug.gz \
+ ${DESTDIR}${XENKERNELDIR}/xen-debug.gz
+
+.include "../../lang/python/application.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/sysutils/xenkernel46/PLIST b/sysutils/xenkernel46/PLIST
new file mode 100644
index 00000000000..91be081746a
--- /dev/null
+++ b/sysutils/xenkernel46/PLIST
@@ -0,0 +1,3 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2016/07/04 07:25:13 jnemeth Exp $
+xen46-kernel/xen-debug.gz
+xen46-kernel/xen.gz
diff --git a/sysutils/xenkernel46/distinfo b/sysutils/xenkernel46/distinfo
new file mode 100644
index 00000000000..9f44bb411f4
--- /dev/null
+++ b/sysutils/xenkernel46/distinfo
@@ -0,0 +1,13 @@
+$NetBSD: distinfo,v 1.1.1.1 2016/07/04 07:25:13 jnemeth Exp $
+
+SHA1 (xen-4.6.3.tar.gz) = 2aa59d0a05a6c5ac7f336f2069c66a54f95c4349
+RMD160 (xen-4.6.3.tar.gz) = 2798bd888ee001a4829165e55feb705a86af4f74
+SHA512 (xen-4.6.3.tar.gz) = 187a860b40c05139f22b8498a5fae1db173c3110d957147af29a56cb83b7111c9dc4946d65f9dffc847001fc01c5e9bf51886eaa1194bb9cfd0b6dbcd43a2c5c
+Size (xen-4.6.3.tar.gz) = 19707041 bytes
+SHA1 (patch-Config.mk) = a2a104d023cea4e551a3ad40927d4884d6c610bf
+SHA1 (patch-xen_Makefile) = be3f4577a205b23187b91319f91c50720919f70b
+SHA1 (patch-xen_arch_x86_Rules.mk) = 7b0894ba7311edb02118a021671f304cf3872154
+SHA1 (patch-xen_common_page__alloc.c) = c4d606de1cada8cf89b5abd16efada3d58c68a03
+SHA1 (patch-xen_drivers_passthrough_vtd_x86_ats.c) = f72fd4bb2aeeaeb0b167031dfd5498e73666aa4e
+SHA1 (patch-xen_include_asm-x86_current.h) = 8a21577be06383c0c7f53c15ba828f77fb6314ad
+SHA1 (patch-xen_include_xen_lib.h) = 82a219b7d9c5deaa2b8e0adc774f60395adc4815
diff --git a/sysutils/xenkernel46/patches/patch-Config.mk b/sysutils/xenkernel46/patches/patch-Config.mk
new file mode 100644
index 00000000000..43dbc4da4f2
--- /dev/null
+++ b/sysutils/xenkernel46/patches/patch-Config.mk
@@ -0,0 +1,13 @@
+$NetBSD: patch-Config.mk,v 1.1.1.1 2016/07/04 07:25:13 jnemeth Exp $
+
+--- Config.mk.orig 2015-01-12 17:53:24.000000000 +0100
++++ Config.mk 2015-01-19 12:29:14.000000000 +0100
+@@ -39,6 +39,8 @@
+ HOSTCC = gcc
+ HOSTCFLAGS = -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer
+ HOSTCFLAGS += -fno-strict-aliasing
++HOSTCFLAGS += ${EXTRA_CFLAGS}
++CFLAGS += ${EXTRA_CFLAGS}
+
+ DISTDIR ?= $(XEN_ROOT)/dist
+ DESTDIR ?= /
diff --git a/sysutils/xenkernel46/patches/patch-xen_Makefile b/sysutils/xenkernel46/patches/patch-xen_Makefile
new file mode 100644
index 00000000000..8e70e14f3c0
--- /dev/null
+++ b/sysutils/xenkernel46/patches/patch-xen_Makefile
@@ -0,0 +1,13 @@
+$NetBSD: patch-xen_Makefile,v 1.1.1.1 2016/07/04 07:25:13 jnemeth Exp $
+
+--- xen/Makefile.orig 2016-02-09 14:44:19.000000000 +0000
++++ xen/Makefile
+@@ -135,7 +135,7 @@ include/xen/compile.h: include/xen/compi
+ -e 's/@@whoami@@/$(XEN_WHOAMI)/g' \
+ -e 's/@@domain@@/$(XEN_DOMAIN)/g' \
+ -e 's/@@hostname@@/$(XEN_BUILD_HOST)/g' \
+- -e 's!@@compiler@@!$(shell $(CC) $(CFLAGS) --version 2>&1 | head -1)!g' \
++ -e 's!@@compiler@@!$(shell $(CC) $(EXTRA_CFLAGS) $(CFLAGS) --version 2>&1 | head -1)!g' \
+ -e 's/@@version@@/$(XEN_VERSION)/g' \
+ -e 's/@@subversion@@/$(XEN_SUBVERSION)/g' \
+ -e 's/@@extraversion@@/$(XEN_EXTRAVERSION)/g' \
diff --git a/sysutils/xenkernel46/patches/patch-xen_arch_x86_Rules.mk b/sysutils/xenkernel46/patches/patch-xen_arch_x86_Rules.mk
new file mode 100644
index 00000000000..23fa4835e15
--- /dev/null
+++ b/sysutils/xenkernel46/patches/patch-xen_arch_x86_Rules.mk
@@ -0,0 +1,12 @@
+$NetBSD: patch-xen_arch_x86_Rules.mk,v 1.1.1.1 2016/07/04 07:25:14 jnemeth Exp $
+
+--- xen/arch/x86/Rules.mk.orig 2015-01-12 17:53:24.000000000 +0100
++++ xen/arch/x86/Rules.mk 2015-01-19 12:29:14.000000000 +0100
+@@ -24,6 +24,7 @@
+ CFLAGS += -I$(BASEDIR)/include
+ CFLAGS += -I$(BASEDIR)/include/asm-x86/mach-generic
+ CFLAGS += -I$(BASEDIR)/include/asm-x86/mach-default
++CFLAGS += $(EXTRA_CFLAGS)
+
+ # Prevent floating-point variables from creeping into Xen.
+ CFLAGS += -msoft-float
diff --git a/sysutils/xenkernel46/patches/patch-xen_common_page__alloc.c b/sysutils/xenkernel46/patches/patch-xen_common_page__alloc.c
new file mode 100644
index 00000000000..6fdbbebcf46
--- /dev/null
+++ b/sysutils/xenkernel46/patches/patch-xen_common_page__alloc.c
@@ -0,0 +1,13 @@
+$NetBSD: patch-xen_common_page__alloc.c,v 1.1.1.1 2016/07/04 07:25:13 jnemeth Exp $
+
+--- xen/common/page_alloc.c.orig 2015-09-13 17:37:09.000000000 +0000
++++ xen/common/page_alloc.c
+@@ -1561,7 +1561,7 @@ void *alloc_xenheap_pages(unsigned int o
+ ASSERT(!in_irq());
+
+ if ( xenheap_bits && (memflags >> _MEMF_bits) > xenheap_bits )
+- memflags &= ~MEMF_bits(~0);
++ memflags &= ~MEMF_bits(~0U);
+ if ( !(memflags >> _MEMF_bits) )
+ memflags |= MEMF_bits(xenheap_bits);
+
diff --git a/sysutils/xenkernel46/patches/patch-xen_drivers_passthrough_vtd_x86_ats.c b/sysutils/xenkernel46/patches/patch-xen_drivers_passthrough_vtd_x86_ats.c
new file mode 100644
index 00000000000..e6f15e0d662
--- /dev/null
+++ b/sysutils/xenkernel46/patches/patch-xen_drivers_passthrough_vtd_x86_ats.c
@@ -0,0 +1,22 @@
+$NetBSD: patch-xen_drivers_passthrough_vtd_x86_ats.c,v 1.1.1.1 2016/07/04 07:25:14 jnemeth Exp $
+
+--- xen/drivers/passthrough/vtd/x86/ats.c.orig 2015-06-22 13:41:35.000000000 +0000
++++ xen/drivers/passthrough/vtd/x86/ats.c
+@@ -134,7 +134,7 @@ int dev_invalidate_iotlb(struct iommu *i
+ case DMA_TLB_GLOBAL_FLUSH:
+ /* invalidate all translations: sbit=1,bit_63=0,bit[62:12]=1 */
+ sbit = 1;
+- addr = (~0 << PAGE_SHIFT_4K) & 0x7FFFFFFFFFFFFFFF;
++ addr = (~0ULL << PAGE_SHIFT_4K) & 0x7FFFFFFFFFFFFFFF;
+ rc = qinval_device_iotlb(iommu, pdev->ats_queue_depth,
+ sid, sbit, addr);
+ break;
+@@ -146,7 +146,7 @@ int dev_invalidate_iotlb(struct iommu *i
+ sbit = size_order ? 1 : 0;
+
+ /* clear lower bits */
+- addr &= ~0 << PAGE_SHIFT_4K;
++ addr &= ~0ULL << PAGE_SHIFT_4K;
+
+ /* if sbit == 1, zero out size_order bit and set lower bits to 1 */
+ if ( sbit )
diff --git a/sysutils/xenkernel46/patches/patch-xen_include_asm-x86_current.h b/sysutils/xenkernel46/patches/patch-xen_include_asm-x86_current.h
new file mode 100644
index 00000000000..84ddfbbf63b
--- /dev/null
+++ b/sysutils/xenkernel46/patches/patch-xen_include_asm-x86_current.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-xen_include_asm-x86_current.h,v 1.1.1.1 2016/07/04 07:25:13 jnemeth Exp $
+
+--- xen/include/asm-x86/current.h.orig 2015-01-30 12:45:05.000000000 +0000
++++ xen/include/asm-x86/current.h
+@@ -25,7 +25,7 @@ struct cpu_info {
+
+ static inline struct cpu_info *get_cpu_info(void)
+ {
+- register unsigned long sp asm("rsp");
++ unsigned long sp = (unsigned long)__builtin_frame_address(0);
+
+ return (struct cpu_info *)((sp & ~(STACK_SIZE-1)) + STACK_SIZE) - 1;
+ }
diff --git a/sysutils/xenkernel46/patches/patch-xen_include_xen_lib.h b/sysutils/xenkernel46/patches/patch-xen_include_xen_lib.h
new file mode 100644
index 00000000000..12148fabb31
--- /dev/null
+++ b/sysutils/xenkernel46/patches/patch-xen_include_xen_lib.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-xen_include_xen_lib.h,v 1.1.1.1 2016/07/04 07:25:13 jnemeth Exp $
+
+--- xen/include/xen/lib.h.orig 2015-06-22 15:41:35.000000000 +0200
++++ xen/include/xen/lib.h 2015-06-23 18:32:26.000000000 +0200
+@@ -44,7 +44,7 @@
+ #define ASSERT_UNREACHABLE() assert_failed("unreachable")
+ #define debug_build() 1
+ #else
+-#define ASSERT(p) do { if ( 0 && (p) ); } while (0)
++#define ASSERT(p) do { if ( 0 && (p) ) (void)0; } while (0)
+ #define ASSERT_UNREACHABLE() do { } while (0)
+ #define debug_build() 0
+ #endif