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

14
sysutils/xenkernel3/DESCR Normal file
View File

@@ -0,0 +1,14 @@
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.1 Xen3 kernel itself. PCI passthrough is
supported. Both non-PAE and PAE versions of xen are provided for
i386; one must use XEN3_DOM[0U] and XEN3PAE_DOM[0U] kernels, respectively.
3.1 is no longer maintained upstream.

View File

@@ -0,0 +1,7 @@
===========================================================================
$NetBSD: MESSAGE,v 1.1 2011/11/20 03:48:10 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,9 @@
===========================================================================
$NetBSD: MESSAGE.i386,v 1.1 2011/11/20 03:48:10 jym Exp $
The Xen hypervisor is installed under the following locations:
${XENKERNELDIR}/xen.gz (standard hypervisor)
${XENKERNELDIR}/xen-debug.gz (debug hypervisor)
${XENKERNELDIR}/xen-PAE.gz (PAE standard hypervisor)
${XENKERNELDIR}/xen-PAE-debug.gz (PAE debug hypervisor)
===========================================================================

View File

@@ -0,0 +1,98 @@
# $NetBSD: Makefile,v 1.25 2013/06/19 14:03:41 gdt Exp $
#
VERSION= 3.1.4
DISTNAME= xen-${VERSION}
PKGNAME= xenkernel3-${VERSION}
PKGREVISION= 8
CATEGORIES= sysutils
MASTER_SITES= http://bits.xensource.com/oss-xen/release/${VERSION}/
MAINTAINER= bouyer@NetBSD.org
HOMEPAGE= http://xen.org/
COMMENT= Xen3 Kernel
ONLY_FOR_PLATFORM= Linux-2.[46]*-i386 NetBSD-*-i386 Linux-2.[46]*-x86_64 NetBSD-*-x86_64
CONFLICTS= xenkernel30-[0-9]*
LICENSE= gnu-gpl-v2
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/include/public/foreign/Makefile
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/python,${PYTHONBIN},g"
.if ${MACHINE_ARCH} == "x86_64"
USE_TOOLS+= bash
SUBST_CLASSES+= bash
SUBST_STAGE.bash= pre-build
SUBST_FILES.bash= xen/include/Makefile
SUBST_SED.bash= -e "s,/bin/bash,${PREFIX}/bin/bash,g"
.endif
.if ${MACHINE_ARCH} == "i386"
PLIST_SRC= PLIST.i386 PLIST
.else
PLIST_SRC= PLIST
.endif
INSTALLATION_DIRS+= xen3-kernel
XENKERNELDIR= ${PREFIX}/xen3-kernel
MESSAGE_SUBST+= XENKERNELDIR=${XENKERNELDIR:Q}
.include "../../mk/compiler.mk"
.if !empty(PKGSRC_COMPILER:Mclang)
EXTRA_CFLAGS+= -Wno-error=ignored-attributes -Wno-error=format \
-Wno-error=tautological-compare \
-Wno-error=parentheses-equality \
-Wno-error=sometimes-uninitialized -no-integrated-as \
-ffreestanding
.endif
do-build:
cd ${WRKSRC} && \
EXTRA_CFLAGS=${EXTRA_CFLAGS:Q} ${GMAKE} XEN_TARGET_X86_PAE=n debug=n xen
${CP} ${WRKSRC}/dist/install/boot/xen.gz ${WRKDIR}/xen.gz
cd ${WRKSRC} && ${GMAKE} clean && \
EXTRA_CFLAGS=${EXTRA_CFLAGS:Q} ${GMAKE} XEN_TARGET_X86_PAE=n debug=y xen
${CP} ${WRKSRC}/dist/install/boot/xen.gz ${WRKDIR}/xen-debug.gz
.if ${MACHINE_ARCH} == "i386"
cd ${WRKSRC} && ${GMAKE} clean && \
EXTRA_CFLAGS=${EXTRA_CFLAGS:Q} ${GMAKE} XEN_TARGET_X86_PAE=y debug=n xen
${CP} ${WRKSRC}/dist/install/boot/xen.gz ${WRKDIR}/xen-PAE.gz
cd ${WRKSRC} && ${GMAKE} clean && \
EXTRA_CFLAGS=${EXTRA_CFLAGS:Q} ${GMAKE} XEN_TARGET_X86_PAE=y debug=y xen
${CP} ${WRKSRC}/dist/install/boot/xen.gz ${WRKDIR}/xen-PAE-debug.gz
.endif
do-install:
${INSTALL_DATA} ${WRKDIR}/xen.gz \
${DESTDIR}${XENKERNELDIR}/xen.gz
${INSTALL_DATA} ${WRKDIR}/xen-debug.gz \
${DESTDIR}${XENKERNELDIR}/xen-debug.gz
.if ${MACHINE_ARCH} == "i386"
${INSTALL_DATA} ${WRKDIR}/xen-PAE.gz \
${DESTDIR}${XENKERNELDIR}/xen-PAE.gz
${INSTALL_DATA} ${WRKDIR}/xen-PAE-debug.gz \
${DESTDIR}${XENKERNELDIR}/xen-PAE-debug.gz
.endif
.include "../../lang/python/application.mk"
.include "../../mk/bsd.pkg.mk"

View File

@@ -0,0 +1,3 @@
@comment $NetBSD: PLIST,v 1.3 2009/06/14 18:16:21 joerg Exp $
xen3-kernel/xen.gz
xen3-kernel/xen-debug.gz

View File

@@ -0,0 +1,3 @@
@comment $NetBSD: PLIST.i386,v 1.1 2009/02/13 22:34:52 bouyer Exp $
xen3-kernel/xen-PAE.gz
xen3-kernel/xen-PAE-debug.gz

View File

@@ -0,0 +1,20 @@
$NetBSD: distinfo,v 1.17 2013/04/11 19:57:51 joerg Exp $
SHA1 (xen-3.1.4.tar.gz) = 0d784662776239195df10b3f29d40350f9d0644d
RMD160 (xen-3.1.4.tar.gz) = c02ad2bd64e6306b127a4f37a8aa370dadc11859
Size (xen-3.1.4.tar.gz) = 6894493 bytes
SHA1 (patch-SA45835) = 7af53cb3da8720954242c4c90165bceef362c184
SHA1 (patch-aa) = 1be644e7edd3735c2850d3e581002f53bd50eb59
SHA1 (patch-ac) = 4c237984832ef5532e0451845e8075b95744e48d
SHA1 (patch-ae) = 37b1c8d6cc66983d971fe41654cc8cefde87104a
SHA1 (patch-ba) = cadfa6f2626e95c9ccb85ae7e3a8a7f318ea343f
SHA1 (patch-bb) = 7338e5a512c909d4b043654dab882761de274f94
SHA1 (patch-bc) = fa35699da6ad2a4950418a02432c2ccdb5d34844
SHA1 (patch-bd) = 2a07955b1285d288458066813f8ebc801b8038c1
SHA1 (patch-cw) = b08804b3a6df64194d662c92af1f0738a52e67b2
SHA1 (patch-da) = 6db74e00d15615e71936fa8637a05159f378b454
SHA1 (patch-db) = 8e7b563fd816669fd39e1e8bf5137b5937060968
SHA1 (patch-dc) = 606ad2af582b88ddfd250b952831af9d3b2b1f5d
SHA1 (patch-gcc-version) = 1174ace3eee1d3707a2935498ac5a39671913f9f
SHA1 (patch-xen_arch_x86_hvm_io.c) = 0f6dfc3b3857c2ab43fabf2c9693e2932b442931
SHA1 (patch-xen_arch_x86_string.c) = 363d521a627d07cd9caffcfe1c529342b3b67321

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 2008-04-25 15:03:12.000000000 +0200
+++ xen/include/asm-x86/x86_64/uaccess.h 2011-09-10 20:26:42.000000000 +0200
@@ -8,7 +8,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) (__addr_ok(addr))

View File

@@ -0,0 +1,13 @@
$NetBSD: patch-aa,v 1.1 2007/08/17 17:26:04 bouyer Exp $
--- xen/include/asm-x86/page.h.orig 2007-08-16 22:23:58.000000000 +0200
+++ xen/include/asm-x86/page.h 2007-08-16 22:24:43.000000000 +0200
@@ -331,7 +331,7 @@
* WARNING: This will need to be disabled to run OSes that use the spare PTE
* bits themselves (e.g., *BSD).
*/
-#ifndef NDEBUG
+#if 0
#define _PAGE_GNTTAB _PAGE_AVAIL2
#else
#define _PAGE_GNTTAB 0

View File

@@ -0,0 +1,18 @@
$NetBSD: patch-ac,v 1.3 2011/03/24 12:43:53 drochner Exp $
CVE-2011-1166
--- xen/arch/x86/domain.c.orig 2008-04-25 13:03:12.000000000 +0000
+++ xen/arch/x86/domain.c
@@ -701,6 +701,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,25 @@
$NetBSD: patch-ae,v 1.3 2011/07/19 18:53:54 jym Exp $
- protect Xen's stdarg.h from multiple inclusion.
- build fix for stdarg under NetBSD.
Both backported from upstream.
http://xenbits.xensource.com/hg/xen-unstable.hg/file/a574bf2f5059/xen/include/xen/stdarg.h
--- xen/include/xen/stdarg.h.orig 2009-08-06 12:56:43.000000000 +0000
+++ xen/include/xen/stdarg.h
@@ -1,5 +1,15 @@
+#ifndef __XEN_STDARG_H__
+#define __XEN_STDARG_H__
+
#if defined(__OpenBSD__)
# include "/usr/include/stdarg.h"
+#elif defined (__NetBSD__)
+ typedef __builtin_va_list va_list;
+# define va_start(ap, last) __builtin_stdarg_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,14 @@
$NetBSD: patch-ba,v 1.5 2008/04/27 19:59:40 bouyer Exp $
--- xen/arch/x86/domain_build.c.orig 2008-04-25 15:03:12.000000000 +0200
+++ xen/arch/x86/domain_build.c 2008-04-26 18:23:30.000000000 +0200
@@ -308,6 +308,9 @@
parms.pae ? ", PAE" : "",
elf_msb(&elf) ? "msb" : "lsb",
elf.pstart, elf.pend);
+ if ( elf.bsd_symtab_pstart )
+ printk(" Dom0 symbol map 0x%" PRIx64 " -> 0x%" PRIx64 "\n",
+ elf.bsd_symtab_pstart, elf.bsd_symtab_pend);
if ( !compatible )
{

View File

@@ -0,0 +1,18 @@
$NetBSD: patch-bb,v 1.1 2007/08/17 17:26:04 bouyer Exp $
--- xen/common/libelf/libelf-dominfo.c.orig 2007-05-18 16:45:21.000000000 +0200
+++ xen/common/libelf/libelf-dominfo.c 2007-08-16 21:43:18.000000000 +0200
@@ -378,6 +378,13 @@
if ( parms->virt_entry == UNSET_ADDR )
parms->virt_entry = elf_uval(elf, elf->ehdr, e_entry);
+ if ( parms->bsd_symtab )
+ {
+ elf_parse_bsdsyms(elf, parms->virt_kend);
+ if ( elf->bsd_symtab_pend )
+ parms->virt_kend = elf->bsd_symtab_pend + parms->virt_offset;
+ }
+
elf_msg(elf, "%s: addresses:\n", __FUNCTION__);
elf_msg(elf, " virt_base = 0x%" PRIx64 "\n", parms->virt_base);
elf_msg(elf, " elf_paddr_offset = 0x%" PRIx64 "\n", parms->elf_paddr_offset);

View File

@@ -0,0 +1,166 @@
$NetBSD: patch-bc,v 1.1 2007/08/17 17:26:05 bouyer Exp $
--- xen/common/libelf/libelf-loader.c.orig 2007-05-18 16:45:21.000000000 +0200
+++ xen/common/libelf/libelf-loader.c 2007-08-16 21:43:18.000000000 +0200
@@ -20,11 +20,15 @@
memset(elf, 0, sizeof(*elf));
elf->image = image;
elf->size = size;
- elf->ehdr = (elf_ehdr *) image;
+ elf->ehdr = (elf_ehdr *)image;
elf->class = elf->ehdr->e32.e_ident[EI_CLASS];
elf->data = elf->ehdr->e32.e_ident[EI_DATA];
- /* sanity check phdr */
+#ifdef VERBOSE
+ elf_set_verbose(elf);
+#endif
+
+ /* Sanity check phdr. */
offset = elf_uval(elf, elf->ehdr, e_phoff) +
elf_uval(elf, elf->ehdr, e_phentsize) * elf_phdr_count(elf);
if ( offset > elf->size )
@@ -34,7 +38,7 @@
return -1;
}
- /* sanity check shdr */
+ /* Sanity check shdr. */
offset = elf_uval(elf, elf->ehdr, e_shoff) +
elf_uval(elf, elf->ehdr, e_shentsize) * elf_shdr_count(elf);
if ( offset > elf->size )
@@ -44,13 +48,13 @@
return -1;
}
- /* find section string table */
+ /* Find section string table. */
section = elf_uval(elf, elf->ehdr, e_shstrndx);
shdr = elf_shdr_by_index(elf, section);
if ( shdr != NULL )
elf->sec_strtab = elf_section_start(elf, shdr);
- /* find symbol table, symbol string table */
+ /* Find symbol table and symbol string table. */
count = elf_shdr_count(elf);
for ( i = 0; i < count; i++ )
{
@@ -67,6 +71,7 @@
elf->sym_strtab = elf_section_start(elf, shdr);
break;
}
+
return 0;
}
@@ -83,6 +88,101 @@
}
#endif
+/* Calculate the required additional kernel space for the elf image */
+void elf_parse_bsdsyms(struct elf_binary *elf, uint64_t pstart)
+{
+ uint64_t sz;
+ const elf_shdr *shdr;
+ int i, type;
+
+ if ( !elf->sym_tab )
+ return;
+
+ pstart = elf_round_up(elf, pstart);
+
+ /* Space to store the size of the elf image */
+ sz = sizeof(uint32_t);
+
+ /* Space for the elf and elf section headers */
+ sz += (elf_uval(elf, elf->ehdr, e_ehsize) +
+ elf_shdr_count(elf) * elf_uval(elf, elf->ehdr, e_shentsize));
+ sz = elf_round_up(elf, sz);
+
+ /* Space for the symbol and string tables. */
+ for ( i = 0; i < elf_shdr_count(elf); i++ )
+ {
+ shdr = elf_shdr_by_index(elf, i);
+ type = elf_uval(elf, (elf_shdr *)shdr, sh_type);
+ if ( (type == SHT_STRTAB) || (type == SHT_SYMTAB) )
+ sz = elf_round_up(elf, sz + elf_uval(elf, shdr, sh_size));
+ }
+
+ elf->bsd_symtab_pstart = pstart;
+ elf->bsd_symtab_pend = pstart + sz;
+}
+
+static void elf_load_bsdsyms(struct elf_binary *elf)
+{
+ elf_ehdr *sym_ehdr;
+ unsigned long sz;
+ char *maxva, *symbase, *symtab_addr;
+ elf_shdr *shdr;
+ int i, type;
+
+ if ( !elf->bsd_symtab_pstart )
+ return;
+
+#define elf_hdr_elm(_elf, _hdr, _elm, _val) \
+do { \
+ if ( elf_64bit(_elf) ) \
+ (_hdr)->e64._elm = _val; \
+ else \
+ (_hdr)->e32._elm = _val; \
+} while ( 0 )
+
+ symbase = elf_get_ptr(elf, elf->bsd_symtab_pstart);
+ symtab_addr = maxva = symbase + sizeof(uint32_t);
+
+ /* Set up Elf header. */
+ sym_ehdr = (elf_ehdr *)symtab_addr;
+ sz = elf_uval(elf, elf->ehdr, e_ehsize);
+ memcpy(sym_ehdr, elf->ehdr, sz);
+ maxva += sz; /* no round up */
+
+ elf_hdr_elm(elf, sym_ehdr, e_phoff, 0);
+ elf_hdr_elm(elf, sym_ehdr, e_shoff, elf_uval(elf, elf->ehdr, e_ehsize));
+ elf_hdr_elm(elf, sym_ehdr, e_phentsize, 0);
+ elf_hdr_elm(elf, sym_ehdr, e_phnum, 0);
+
+ /* Copy Elf section headers. */
+ shdr = (elf_shdr *)maxva;
+ sz = elf_shdr_count(elf) * elf_uval(elf, elf->ehdr, e_shentsize);
+ memcpy(shdr, elf->image + elf_uval(elf, elf->ehdr, e_shoff), sz);
+ maxva = (char *)(long)elf_round_up(elf, (long)maxva + sz);
+
+ for ( i = 0; i < elf_shdr_count(elf); i++ )
+ {
+ type = elf_uval(elf, shdr, sh_type);
+ if ( (type == SHT_STRTAB) || (type == SHT_SYMTAB) )
+ {
+ elf_msg(elf, "%s: shdr %i at 0x%p -> 0x%p\n", __func__, i,
+ elf_section_start(elf, shdr), maxva);
+ sz = elf_uval(elf, shdr, sh_size);
+ memcpy(maxva, elf_section_start(elf, shdr), sz);
+ /* Mangled to be based on ELF header location. */
+ elf_hdr_elm(elf, shdr, sh_offset, maxva - symtab_addr);
+ maxva = (char *)(long)elf_round_up(elf, (long)maxva + sz);
+ }
+ shdr = (elf_shdr *)((long)shdr +
+ (long)elf_uval(elf, elf->ehdr, e_shentsize));
+ }
+
+ /* Write down the actual sym size. */
+ *(uint32_t *)symbase = maxva - symtab_addr;
+
+#undef elf_ehdr_elm
+}
+
void elf_parse_binary(struct elf_binary *elf)
{
const elf_phdr *phdr;
@@ -133,6 +233,8 @@
memcpy(dest, elf->image + offset, filesz);
memset(dest + filesz, 0, memsz - filesz);
}
+
+ elf_load_bsdsyms(elf);
}
void *elf_get_ptr(struct elf_binary *elf, unsigned long addr)

View File

@@ -0,0 +1,112 @@
$NetBSD: patch-bd,v 1.1 2007/08/17 17:26:05 bouyer Exp $
--- xen/include/public/libelf.h.orig 2007-05-18 16:45:21.000000000 +0200
+++ xen/include/public/libelf.h 2007-08-16 21:43:18.000000000 +0200
@@ -69,6 +69,9 @@
uint64_t pend;
uint64_t reloc_offset;
+ uint64_t bsd_symtab_pstart;
+ uint64_t bsd_symtab_pend;
+
#ifndef __XEN__
/* misc */
FILE *log;
@@ -91,33 +94,32 @@
#define elf_lsb(elf) (ELFDATA2LSB == (elf)->data)
#define elf_swap(elf) (NATIVE_ELFDATA != (elf)->data)
-#define elf_uval(elf, str, elem) \
- ((ELFCLASS64 == (elf)->class) \
- ? elf_access_unsigned((elf), (str), \
- offsetof(typeof(*(str)),e64.elem), \
- sizeof((str)->e64.elem)) \
- : elf_access_unsigned((elf), (str), \
- offsetof(typeof(*(str)),e32.elem), \
- sizeof((str)->e32.elem)))
-
-#define elf_sval(elf, str, elem) \
- ((ELFCLASS64 == (elf)->class) \
- ? elf_access_signed((elf), (str), \
- offsetof(typeof(*(str)),e64.elem), \
- sizeof((str)->e64.elem)) \
- : elf_access_signed((elf), (str), \
- offsetof(typeof(*(str)),e32.elem), \
- sizeof((str)->e32.elem)))
-
-#define elf_size(elf, str) \
- ((ELFCLASS64 == (elf)->class) \
- ? sizeof((str)->e64) \
- : sizeof((str)->e32))
+#define elf_uval(elf, str, elem) \
+ ((ELFCLASS64 == (elf)->class) \
+ ? elf_access_unsigned((elf), (str), \
+ offsetof(typeof(*(str)),e64.elem), \
+ sizeof((str)->e64.elem)) \
+ : elf_access_unsigned((elf), (str), \
+ offsetof(typeof(*(str)),e32.elem), \
+ sizeof((str)->e32.elem)))
+
+#define elf_sval(elf, str, elem) \
+ ((ELFCLASS64 == (elf)->class) \
+ ? elf_access_signed((elf), (str), \
+ offsetof(typeof(*(str)),e64.elem), \
+ sizeof((str)->e64.elem)) \
+ : elf_access_signed((elf), (str), \
+ offsetof(typeof(*(str)),e32.elem), \
+ sizeof((str)->e32.elem)))
+
+#define elf_size(elf, str) \
+ ((ELFCLASS64 == (elf)->class) \
+ ? sizeof((str)->e64) : sizeof((str)->e32))
uint64_t elf_access_unsigned(struct elf_binary *elf, const void *ptr,
- uint64_t offset, size_t size);
+ uint64_t offset, size_t size);
int64_t elf_access_signed(struct elf_binary *elf, const void *ptr,
- uint64_t offset, size_t size);
+ uint64_t offset, size_t size);
uint64_t elf_round_up(struct elf_binary *elf, uint64_t addr);
@@ -165,6 +167,8 @@
void *elf_get_ptr(struct elf_binary *elf, unsigned long addr);
uint64_t elf_lookup_addr(struct elf_binary *elf, const char *symbol);
+void elf_parse_bsdsyms(struct elf_binary *elf, uint64_t pstart); /* private */
+
/* ------------------------------------------------------------------------ */
/* xc_libelf_relocate.c */
@@ -185,8 +189,8 @@
enum xen_elfnote_type type;
const char *name;
union {
- const char *str;
- uint64_t num;
+ const char *str;
+ uint64_t num;
} data;
};
@@ -228,14 +232,14 @@
}
int elf_xen_parse_features(const char *features,
- uint32_t *supported,
- uint32_t *required);
+ uint32_t *supported,
+ uint32_t *required);
int elf_xen_parse_note(struct elf_binary *elf,
- struct elf_dom_parms *parms,
- const elf_note *note);
+ struct elf_dom_parms *parms,
+ const elf_note *note);
int elf_xen_parse_guest_info(struct elf_binary *elf,
- struct elf_dom_parms *parms);
+ struct elf_dom_parms *parms);
int elf_xen_parse(struct elf_binary *elf,
- struct elf_dom_parms *parms);
+ struct elf_dom_parms *parms);
#endif /* __XC_LIBELF__ */

View File

@@ -0,0 +1,25 @@
$NetBSD: patch-cw,v 1.3 2013/04/11 19:57:51 joerg Exp $
--- Config.mk.orig 2007-11-21 13:26:05.000000000 +0100
+++ Config.mk 2007-11-21 13:26:40.000000000 +0100
@@ -4,7 +4,8 @@
debug ?= n
XEN_COMPILE_ARCH ?= $(shell uname -m | sed -e s/i.86/x86_32/ \
- -e s/ppc/powerpc/ -e s/i86pc/x86_32/)
+ -e s/ppc/powerpc/ -e s/i86pc/x86_32/ \
+ -e s/amd64/x86_64/)
XEN_TARGET_ARCH ?= $(XEN_COMPILE_ARCH)
XEN_OS ?= $(shell uname -s)
@@ -72,8 +73,8 @@ CFLAGS += -Wall -Wstrict-prototypes
# result of any casted expression causes a warning.
CFLAGS += -Wno-unused-value
-HOSTCFLAGS += $(call cc-option,$(HOSTCC),-Wdeclaration-after-statement,)
-CFLAGS += $(call cc-option,$(CC),-Wdeclaration-after-statement,)
+HOSTCFLAGS += $(call cc-option,$(HOSTCC),-Wdeclaration-after-statement,) ${EXTRA_CFLAGS}
+CFLAGS += $(call cc-option,$(CC),-Wdeclaration-after-statement,) ${EXTRA_CFLAGS}
LDFLAGS += $(foreach i, $(EXTRA_LIB), -L$(i))
CFLAGS += $(foreach i, $(EXTRA_INCLUDES), -I$(i))

View File

@@ -0,0 +1,24 @@
$NetBSD: patch-da,v 1.1 2009/01/24 18:57:59 bouyer Exp $
some device have I/O space but no mem space so checking iomem to grant
privileges is not enough.
--- xen/include/xen/iocap.h.orig 2009-01-24 17:21:41.000000000 +0100
+++ xen/include/xen/iocap.h 2009-01-24 17:22:05.000000000 +0100
@@ -29,7 +29,7 @@
rangeset_contains_singleton((d)->irq_caps, i)
#define multipage_allocation_permitted(d) \
- (!rangeset_is_empty((d)->iomem_caps))
+ (!rangeset_is_empty((d)->iomem_caps) || !rangeset_is_empty((d)->arch.ioport_caps))
/*
* Until TLB flushing issues are sorted out we consider it unsafe for
@@ -37,6 +37,6 @@
* operations.
*/
#define grant_operation_permitted(d) \
- (!rangeset_is_empty((d)->iomem_caps))
+ (!rangeset_is_empty((d)->iomem_caps) || !rangeset_is_empty((d)->arch.ioport_caps))
#endif /* __XEN_IOCAP_H__ */

View File

@@ -0,0 +1,15 @@
$NetBSD: patch-db,v 1.1 2009/01/24 18:57:59 bouyer Exp $
some device have I/O space but no mem space so checking iomem to grant
privileges is not enough.
--- xen/include/asm-x86/iocap.h.orig 2009-01-24 17:22:41.000000000 +0100
+++ xen/include/asm-x86/iocap.h 2009-01-24 17:23:24.000000000 +0100
@@ -15,6 +15,6 @@
rangeset_contains_range((d)->arch.ioport_caps, s, e)
#define cache_flush_permitted(d) \
- (!rangeset_is_empty((d)->iomem_caps))
+ (!rangeset_is_empty((d)->iomem_caps) || !rangeset_is_empty((d)->arch.ioport_caps))
#endif /* __X86_IOCAP_H__ */

View File

@@ -0,0 +1,16 @@
$NetBSD: patch-dc,v 1.1 2010/12/07 18:43:49 bouyer Exp $
Fix for CVE-2010-4255, from the xen-devel list and adapted for Xen 3.1
--- xen/arch/x86/traps.c.orig 2010-12-07 12:53:20.000000000 +0100
+++ xen/arch/x86/traps.c 2010-12-07 13:11:36.000000000 +0100
@@ -950,7 +950,8 @@
{
if ( paging_mode_external(d) && guest_mode(regs) )
return paging_fault(addr, regs);
- if ( (addr >= GDT_LDT_VIRT_START) && (addr < GDT_LDT_VIRT_END) )
+ if ( !(regs->error_code & PFEC_user_mode) &&
+ (addr >= GDT_LDT_VIRT_START) && (addr < GDT_LDT_VIRT_END) )
return handle_gdt_ldt_mapping_fault(
addr - GDT_LDT_VIRT_START, regs);
return 0;

View File

@@ -0,0 +1,14 @@
$NetBSD: patch-gcc-version,v 1.1 2011/11/20 03:43:30 jym Exp $
Improve the pattern matching a bit for compiler version. Otherwise we
get garbage in the match, and sed will choke on it.
--- ./xen/Makefile.orig 2008-04-25 13:03:12.000000000 +0000
+++ ./xen/Makefile
@@ -115,7 +115,7 @@ include/xen/compile.h: include/xen/compi
-e 's/@@whoami@@/$(USER)/g' \
-e 's/@@domain@@/$(shell ([ -x /bin/dnsdomainname ] && /bin/dnsdomainname) || ([ -x /bin/domainname ] && /bin/domainname || echo [unknown]))/g' \
-e 's/@@hostname@@/$(shell hostname)/g' \
- -e 's!@@compiler@@!$(shell $(CC) $(CFLAGS) -v 2>&1 | grep -i "gcc.*version")!g' \
+ -e 's!@@compiler@@!$(shell $(CC) $(CFLAGS) -v 2>&1 | grep -i "gcc.* version ")!g' \
-e 's/@@version@@/$(XEN_VERSION)/g' \
-e 's/@@subversion@@/$(XEN_SUBVERSION)/g' \
-e 's/@@extraversion@@/$(XEN_EXTRAVERSION)/g' \

View File

@@ -0,0 +1,13 @@
$NetBSD: patch-xen_arch_x86_hvm_io.c,v 1.1 2013/04/11 19:57:51 joerg Exp $
--- xen/arch/x86/hvm/io.c.orig 2013-03-25 12:44:51.000000000 +0000
+++ xen/arch/x86/hvm/io.c
@@ -338,7 +338,7 @@ static inline void set_eflags_OF(int siz
if ( instr == INSTR_ADD )
{
- if ((src ^ result) & (dst ^ result) & mask);
+ if ((src ^ result) & (dst ^ result) & mask)
regs->eflags |= X86_EFLAGS_OF;
}
else

View File

@@ -0,0 +1,26 @@
$NetBSD: patch-xen_arch_x86_string.c,v 1.1 2013/04/11 19:57:51 joerg Exp $
--- xen/arch/x86/string.c.orig 2013-03-25 12:54:07.000000000 +0000
+++ xen/arch/x86/string.c
@@ -8,6 +8,21 @@
#include <xen/config.h>
#include <xen/lib.h>
+#undef memcmp
+int
+memcmp(const void *s1, const void *s2, size_t n)
+{
+ const unsigned char *p1 = s1;
+ const unsigned char *p2 = s2;
+ while (n-- != 0) {
+ if (*p1 != *p2)
+ return *p1 - *p2;
+ ++p1;
+ ++p2;
+ }
+ return 0;
+}
+
#undef memcpy
void *memcpy(void *dest, const void *src, size_t n)
{