Import of pkgsrc-2013Q2

This commit is contained in:
2013-09-26 17:14:40 +02:00
commit 785076ae39
74991 changed files with 4380255 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
Xen is a virtual machine monitor for x86 hardware (runs only on
i686-class CPUs), which supports running multiple guests operating
systems on a single machine. Guest OSes (also called "domains")
require a modified kernel which supports Xen hypercalls in replacement
to access to the physical hardware. At boot, the xen kernel is loaded
(via grub) 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 3.3 Xen3 kernel itself. PCI passthrough is
not supported. PAE is mandatory; on i386 one must use XEN3PAE_DOM[0U].
3.3 is no longer maintained upstream.

View File

@@ -0,0 +1,7 @@
===========================================================================
$NetBSD: MESSAGE,v 1.1 2011/11/20 03:21:37 jym Exp $
The Xen hypervisor is installed under the following locations:
${XENKERNELDIR}/xen.gz (standard hypervisor)
${XENKERNELDIR}/xen-debug.gz (debug hypervisor)
===========================================================================

View File

@@ -0,0 +1,70 @@
# $NetBSD: Makefile,v 1.23 2013/06/19 14:03:41 gdt Exp $
#
VERSION= 3.3.2
DISTNAME= xen-${VERSION}
PKGNAME= xenkernel33-${VERSION}
PKGREVISION= 7
CATEGORIES= sysutils
MASTER_SITES= http://bits.xensource.com/oss-xen/release/${VERSION}/
MAINTAINER= cegger@NetBSD.org
HOMEPAGE= http://xen.org/
COMMENT= Xen 3.3.2 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
CONFLICTS= xenkernel30-* xentools30-*
CONFLICTS+= xenkernel3-* xentools3-*
CONFLICTS+= xenkernel32-* xentools32-*
WRKSRC= ${WRKDIR}/xen-${VERSION}
NO_CONFIGURE= yes
USE_TOOLS+= gmake
PYTHON_FOR_BUILD_ONLY= yes
PY_PATCHPLIST= NO
SUBST_CLASSES+= py
SUBST_STAGE.py= pre-build
SUBST_FILES.py+= xen/tools/get-fields.sh
SUBST_SED.py= -e "s,python,${PYTHONBIN},g"
#PY_PATCHPLIST doesn't work because we have NO_CONFIGURE
SUBST_CLASSES+= py2
SUBST_STAGE.py2= pre-build
SUBST_FILES.py2= xen/tools/compat-build-source.py
SUBST_FILES.py2+= xen/tools/compat-build-header.py
SUBST_SED.py2= -e "s,/usr/bin/env python,${PYTHONBIN},g"
INSTALLATION_DIRS= xen3-kernel
XENKERNELDIR= ${PREFIX}/${INSTALLATION_DIRS}
MESSAGE_SUBST+= XENKERNELDIR=${XENKERNELDIR:Q}
.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=tautological-compare
.endif
do-build:
cd ${WRKSRC} && EXTRA_CFLAGS=${EXTRA_CFLAGS:Q} ${GMAKE} debug=n xen
${CP} ${WRKSRC}/dist/install/boot/xen.gz ${WRKDIR}/xen.gz
cd ${WRKSRC} && ${GMAKE} clean
cd ${WRKSRC} && EXTRA_CFLAGS=${EXTRA_CFLAGS:Q} ${GMAKE} debug=y xen
${CP} ${WRKSRC}/dist/install/boot/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"

View File

@@ -0,0 +1,3 @@
@comment $NetBSD: PLIST,v 1.1.1.1 2008/08/07 20:31:34 cegger Exp $
xen3-kernel/xen.gz
xen3-kernel/xen-debug.gz

View File

@@ -0,0 +1,17 @@
$NetBSD: distinfo,v 1.17 2013/04/11 19:57:51 joerg Exp $
SHA1 (xen-3.3.2.tar.gz) = 7f438e73ac81b25cf5e1570709e87001066bafe4
RMD160 (xen-3.3.2.tar.gz) = 28faa56286f2a418e35dcba6079570ea871d6c7b
Size (xen-3.3.2.tar.gz) = 11357576 bytes
SHA1 (patch-CVE-2012-3432) = aed03164e9d05379c0a768bf29643c3e94eefce1
SHA1 (patch-Config.mk) = a70e4e1f19d8a8f935a3f2b1b9d24e23e845b920
SHA1 (patch-SA45835) = 7d27c26ba947354bb5e279f3add9eb073a151477
SHA1 (patch-aa) = 0d11c758ad0a0ca657bf2e0f89ca23ff67b76bb7
SHA1 (patch-ab) = bba70c6a0f884a4bbfd2ce56e41ce0d649300edc
SHA1 (patch-ac) = ed1dc87e4f1d80112befc63372bc91ee621f57e6
SHA1 (patch-ad) = e53ac3abf2a6a10c60cf288b994b3cf52a0d6486
SHA1 (patch-ae) = 9608381987e82b05ea34e16f82b88189cc415653
SHA1 (patch-compat_memory_c) = f45daded92c0dac30213d6d7dcc81ac72ead7c47
SHA1 (patch-include_xen_compat_h) = 96ba96ba31792f48c989f033f7706f09fd1171c2
SHA1 (patch-xen_Makefile) = 30d27b40fb8f5c4ee663a6a82abf36db3b7ebd1c
SHA1 (patch-xen_arch_x86_Rules.mk) = 81bdc8a653b57b5fcb9ae7d835f0284ab800dc21

View File

@@ -0,0 +1,15 @@
$NetBSD: patch-CVE-2012-3432,v 1.1 2012/07/28 12:02:16 drochner Exp $
see http://lists.xen.org/archives/html/xen-devel/2012-07/msg01649.html
--- xen/arch/x86/hvm/io.c.orig 2009-08-06 12:56:41.000000000 +0000
+++ xen/arch/x86/hvm/io.c
@@ -181,6 +181,8 @@ int handle_mmio(void)
rc = hvm_emulate_one(&ctxt);
+ if ( rc != X86EMUL_RETRY )
+ curr->arch.hvm_vcpu.io_state = HVMIO_none;
if ( curr->arch.hvm_vcpu.io_state == HVMIO_awaiting_completion )
curr->arch.hvm_vcpu.io_state = HVMIO_handle_mmio_awaiting_completion;
else

View File

@@ -0,0 +1,13 @@
$NetBSD: patch-Config.mk,v 1.1 2013/04/11 19:57:51 joerg Exp $
--- Config.mk.orig 2009-08-06 13:17:07.000000000 +0000
+++ Config.mk
@@ -16,6 +16,8 @@ SHELL ?= /bin/sh
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 ?= /

View File

@@ -0,0 +1,13 @@
$NetBSD: patch-SA45835,v 1.1 2011/09/10 18:35:51 bouyer Exp $
--- xen/include/asm-x86/x86_64/uaccess.h.orig 2011-09-10 20:10:52.000000000 +0200
+++ xen/include/asm-x86/x86_64/uaccess.h 2011-09-10 20:11:28.000000000 +0200
@@ -19,7 +19,7 @@
* non-canonical address (and thus fault) before ever reaching VIRT_START.
*/
#define __addr_ok(addr) \
- (((unsigned long)(addr) < (1UL<<48)) || \
+ (((unsigned long)(addr) < (1UL<<47)) || \
((unsigned long)(addr) >= HYPERVISOR_VIRT_END))
#define access_ok(addr, size) \

View File

@@ -0,0 +1,13 @@
$NetBSD: patch-aa,v 1.2 2009/01/13 13:48:33 cegger Exp $
--- xen/include/asm-x86/page.h.orig 2009-01-05 11:27:00.000000000 +0000
+++ xen/include/asm-x86/page.h
@@ -301,7 +301,7 @@ void setup_idle_pagetable(void);
* WARNING: This will need to be disabled to run OSes that use the spare PTE
* bits themselves (e.g., *BSD).
*/
-#ifdef NDEBUG
+#if 1
#undef _PAGE_GNTTAB
#endif
#ifndef _PAGE_GNTTAB

View File

@@ -0,0 +1,15 @@
$NetBSD: patch-ab,v 1.1 2010/12/07 18:44:25 bouyer Exp $
Fix for CVE-2010-4255, from the xen-devel list
--- xen/arch/x86/traps.c.orig 2010-12-07 13:28:23.000000000 +0100
+++ xen/arch/x86/traps.c 2010-12-07 13:28:43.000000000 +0100
@@ -1157,7 +1157,7 @@
trace_trap_two_addr(TRC_PV_PAGING_FIXUP, regs->eip, addr);
return ret;
}
- if ( !(regs->error_code & PFEC_reserved_bit) &&
+ if ( !(regs->error_code & (PFEC_user_mode | PFEC_reserved_bit)) &&
(addr >= GDT_LDT_VIRT_START) && (addr < GDT_LDT_VIRT_END) )
return handle_gdt_ldt_mapping_fault(
addr - GDT_LDT_VIRT_START, regs);

View File

@@ -0,0 +1,18 @@
$NetBSD: patch-ac,v 1.1 2011/03/24 12:04:57 drochner Exp $
CVE-2011-1166
--- xen/arch/x86/domain.c.orig 2009-08-06 12:56:41.000000000 +0000
+++ xen/arch/x86/domain.c
@@ -680,6 +680,11 @@ int arch_set_info_guest(
v->arch.guest_table_user = pagetable_from_pfn(cr3_pfn);
}
+ else if ( !(flags & VGCF_in_kernel) )
+ {
+ destroy_gdt(v);
+ return -EINVAL;
+ }
#endif
}
#ifdef CONFIG_COMPAT

View File

@@ -0,0 +1,32 @@
$NetBSD: patch-ad,v 1.1 2011/04/04 09:07:06 hauke Exp $
Turn this non-fatal condition from a panic into a warning, pulling up a 3.4 change
<http://xenbits.xensource.com/hg/staging/xen-3.4-testing.hg/rev/60ed1226a37c#>
as proposed by cegger.
--- xen/arch/x86/cpu/mcheck/amd_nonfatal.c.orig 2009-08-06 12:56:41.000000000 +0000
+++ xen/arch/x86/cpu/mcheck/amd_nonfatal.c
@@ -208,14 +208,19 @@ static void mce_amd_work_fn(void *data)
/* HW does not count *all* kinds of correctable errors.
* Thus it is possible, that the polling routine finds an
- * correctable error even if the HW reports nothing.
- * However, the other way around is not possible (= BUG).
- */
+ * correctable error even if the HW reports nothing. */
if (counter > 0) {
/* HW reported correctable errors,
* the polling routine did not find...
*/
- BUG_ON(adjust == 0);
+ if (adjust == 0) {
+ printk("CPU counter reports %"PRIu32
+ " correctable hardware error%s that %s"
+ " not reported by the status MSRs\n",
+ counter,
+ (counter == 1 ? "" : "s"),
+ (counter == 1 ? "was" : "were"));
+ }
/* subtract 1 to not double count the error
* from the polling service routine */
adjust += (counter - 1);

View File

@@ -0,0 +1,31 @@
$NetBSD: patch-ae,v 1.2 2012/01/05 12:02:38 cegger Exp $
--- xen/include/xen/stdarg.h.orig 2012-01-05 11:29:11.000000000 +0000
+++ xen/include/xen/stdarg.h
@@ -1,5 +1,26 @@
+#ifndef __XEN_STDARG_H__
+#define __XEN_STDARG_H__
+
#if defined(__OpenBSD__)
# include "/usr/include/stdarg.h"
+#elif defined (__NetBSD__)
+ /* Why not just include stdarg.h like everyone else? should explain */
+ typedef __builtin_va_list va_list;
+# ifdef __GNUC__
+# define __GNUC_PREREQ__(x, y) \
+ ((__GNUC__ == (x) && __GNUC_MINOR__ >= (y)) || \
+ (__GNUC__ > (x)))
+# else
+# define __GNUC_PREREQ__(x, y) 0
+# endif
+# if !__GNUC_PREREQ__(4, 5)
+# define __builtin_va_start(ap, last) __builtin_stdarg_start((ap), (last))
+# endif
+# define va_start(ap, last) __builtin_va_start((ap), (last))
+# define va_end(ap) __builtin_va_end(ap)
+# define va_arg __builtin_va_arg
#else
# include <stdarg.h>
#endif
+
+#endif /* __XEN_STDARG_H__ */

View File

@@ -0,0 +1,31 @@
$NetBSD: patch-compat_memory_c,v 1.1 2012/01/05 12:02:38 cegger Exp $
--- xen/common/compat/memory.c.orig 2009-08-06 12:56:41.000000000 +0000
+++ xen/common/compat/memory.c
@@ -7,6 +7,12 @@
#include <asm/current.h>
#include <compat/memory.h>
+#define xen_domid_t domid_t
+#define compat_domid_t domid_compat_t
+CHECK_TYPE(domid);
+#undef compat_domid_t
+#undef xen_domid_t
+
int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE(void) compat)
{
int rc, split, op = cmd & MEMOP_CMD_MASK;
@@ -171,13 +177,6 @@ int compat_memory_op(unsigned int cmd, X
case XENMEM_current_reservation:
case XENMEM_maximum_reservation:
case XENMEM_maximum_gpfn:
- {
-#define xen_domid_t domid_t
-#define compat_domid_t domid_compat_t
- CHECK_TYPE(domid);
-#undef compat_domid_t
-#undef xen_domid_t
- }
case XENMEM_maximum_ram_page:
nat.hnd = compat;
break;

View File

@@ -0,0 +1,89 @@
$NetBSD: patch-include_xen_compat_h,v 1.1 2012/01/05 12:02:38 cegger Exp $
--- xen/include/xen/compat.h.orig 2009-08-06 12:56:43.000000000 +0000
+++ xen/include/xen/compat.h
@@ -128,44 +128,61 @@
})
+#define CHECK_NAME(name, tag) __check ## tag ## name
+#define CHECK_NAME_(k, n, tag) __check ## tag ## k ## _ ## n
+
#define CHECK_TYPE(name) \
- typedef int __checkT ## name[1 - ((xen_ ## name ## _t *)0 != \
- (compat_ ## name ## _t *)0) * 2]
+static inline int CHECK_NAME(name, T)(xen_ ## name ## _t *x, \
+ compat_ ## name ## _t *c) \
+{ \
+ return x == c; \
+}
#define CHECK_TYPE_(k, n) \
- typedef int __checkT ## k ## _ ## n[1 - ((k xen_ ## n *)0 != \
- (k compat_ ## n *)0) * 2]
+static inline int CHECK_NAME_(k, n, T)(k xen_ ## n *x, \
+ k compat_ ## n *c) \
+{ \
+ return x == c; \
+}
#define CHECK_SIZE(name) \
- typedef int __checkS ## name[1 - (sizeof(xen_ ## name ## _t) != \
- sizeof(compat_ ## name ## _t)) * 2]
+ typedef int CHECK_NAME(name, S)[1 - (sizeof(xen_ ## name ## _t) != \
+ sizeof(compat_ ## name ## _t)) * 2]
#define CHECK_SIZE_(k, n) \
- typedef int __checkS ## k ## _ ## n[1 - (sizeof(k xen_ ## n) != \
+ typedef int CHECK_NAME_(k, n, S)[1 - (sizeof(k xen_ ## n) != \
sizeof(k compat_ ## n)) * 2]
+#define CHECK_FIELD_COMMON(name, t, f) \
+static inline int name(xen_ ## t ## _t *x, compat_ ## t ## _t *c) \
+{ \
+ BUILD_BUG_ON(offsetof(xen_ ## t ## _t, f) != \
+ offsetof(compat_ ## t ## _t, f)); \
+ return &x->f == &c->f; \
+}
+#define CHECK_FIELD_COMMON_(k, name, n, f) \
+static inline int name(k xen_ ## n *x, k compat_ ## n *c) \
+{ \
+ BUILD_BUG_ON(offsetof(k xen_ ## n, f) != \
+ offsetof(k compat_ ## n, f)); \
+ return &x->f == &c->f; \
+}
+
#define CHECK_FIELD(t, f) \
- typedef int __checkF ## t ## __ ## f[1 - (&((xen_ ## t ## _t *)0)->f != \
- &((compat_ ## t ## _t *)0)->f) * 2]
+ CHECK_FIELD_COMMON(CHECK_NAME(t ## __ ## f, F), t, f)
#define CHECK_FIELD_(k, n, f) \
- typedef int __checkF ## k ## _ ## n ## __ ## f[1 - (&((k xen_ ## n *)0)->f != \
- &((k compat_ ## n *)0)->f) * 2]
+ CHECK_FIELD_COMMON_(k, CHECK_NAME_(k, n ## __ ## f, F), n, f)
#define CHECK_SUBFIELD_1(t, f1, f2) \
- typedef int __checkF1 ## t ## __ ## f1 ## __ ## f2 \
- [1 - (&((xen_ ## t ## _t *)0)->f1.f2 != \
- &((compat_ ## t ## _t *)0)->f1.f2) * 2]
+ CHECK_FIELD_COMMON(CHECK_NAME(t ## __ ## f1 ## __ ## f2, F1), t, f1.f2)
#define CHECK_SUBFIELD_1_(k, n, f1, f2) \
- typedef int __checkF1 ## k ## _ ## n ## __ ## f1 ## __ ## f2 \
- [1 - (&((k xen_ ## n *)0)->f1.f2 != \
- &((k compat_ ## n *)0)->f1.f2) * 2]
+ CHECK_FIELD_COMMON_(k, CHECK_NAME_(k, n ## __ ## f1 ## __ ## f2, F1), \
+ n, f1.f2)
#define CHECK_SUBFIELD_2(t, f1, f2, f3) \
- typedef int __checkF2 ## t ## __ ## f1 ## __ ## f2 ## __ ## f3 \
- [1 - (&((xen_ ## t ## _t *)0)->f1.f2.f3 != \
- &((compat_ ## t ## _t *)0)->f1.f2.f3) * 2]
+ CHECK_FIELD_COMMON(CHECK_NAME(t ## __ ## f1 ## __ ## f2 ## __ ## f3, F2), \
+ t, f1.f2.f3)
#define CHECK_SUBFIELD_2_(k, n, f1, f2, f3) \
- typedef int __checkF2 ## k ## _ ## n ## __ ## f1 ## __ ## f2 ## __ ## f3 \
- [1 - (&((k xen_ ## n *)0)->f1.f2.f3 != \
- &((k compat_ ## n *)0)->f1.f2.f3) * 2]
+ CHECK_FIELD_COMMON_(k, CHECK_NAME_(k, n ## __ ## f1 ## __ ## f2 ## __ ## \
+ f3, F2), n, f1.f2.f3)
int hypercall_xlat_continuation(unsigned int *id, unsigned int mask, ...);

View File

@@ -0,0 +1,13 @@
$NetBSD: patch-xen_Makefile,v 1.1 2013/04/11 19:57:51 joerg Exp $
--- xen/Makefile.orig 2009-08-06 12:56:39.000000000 +0000
+++ xen/Makefile
@@ -87,7 +87,7 @@ include/xen/compile.h: include/xen/compi
-e 's/@@whoami@@/$(XEN_WHOAMI)/g' \
-e 's/@@domain@@/$(XEN_DOMAIN)/g' \
-e 's/@@hostname@@/$(shell hostname)/g' \
- -e 's!@@compiler@@!$(shell $(CC) $(CFLAGS) -v 2>&1 | tail -1)!g' \
+ -e 's!@@compiler@@!$(shell $(CC) $(EXTRA_CFLAGS) $(CFLAGS) -v 2>&1 | tail -1)!g' \
-e 's/@@version@@/$(XEN_VERSION)/g' \
-e 's/@@subversion@@/$(XEN_SUBVERSION)/g' \
-e 's/@@extraversion@@/$(XEN_EXTRAVERSION)/g' \

View File

@@ -0,0 +1,12 @@
$NetBSD: patch-xen_arch_x86_Rules.mk,v 1.1 2013/04/11 19:57:51 joerg Exp $
--- xen/arch/x86/Rules.mk.orig 2009-08-06 12:56:40.000000000 +0000
+++ xen/arch/x86/Rules.mk
@@ -21,6 +21,7 @@ CFLAGS += -iwithprefix include -Werror -
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