Date: Mon, 20 Jan 2014 19:38:45 +0000 (UTC) From: Kai Wang <kaiw@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r260920 - in projects/elftoolchain: bin/df cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zinject cddl/usr.bin/zinject contrib/gcc/cp gnu/lib/libgcc include lib/libc lib/... Message-ID: <201401201938.s0KJcjoO037115@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kaiw Date: Mon Jan 20 19:38:44 2014 New Revision: 260920 URL: http://svnweb.freebsd.org/changeset/base/260920 Log: MFH@260917. Added: projects/elftoolchain/release/pkg_repos/ - copied from r260917, head/release/pkg_repos/ projects/elftoolchain/share/man/man4/virtio_random.4 - copied unchanged from r260917, head/share/man/man4/virtio_random.4 projects/elftoolchain/sys/amd64/conf/VT - copied unchanged from r260917, head/sys/amd64/conf/VT projects/elftoolchain/sys/arm/at91/at91_gpio.h - copied unchanged from r260917, head/sys/arm/at91/at91_gpio.h projects/elftoolchain/sys/arm/at91/at91_smc.c - copied unchanged from r260917, head/sys/arm/at91/at91_smc.c projects/elftoolchain/sys/arm/at91/at91_smc.h - copied unchanged from r260917, head/sys/arm/at91/at91_smc.h projects/elftoolchain/sys/dev/nand/nfc_at91.h - copied unchanged from r260917, head/sys/dev/nand/nfc_at91.h projects/elftoolchain/sys/dev/virtio/random/ - copied from r260917, head/sys/dev/virtio/random/ projects/elftoolchain/sys/i386/conf/VT - copied unchanged from r260917, head/sys/i386/conf/VT projects/elftoolchain/sys/modules/virtio/random/ - copied from r260917, head/sys/modules/virtio/random/ Deleted: projects/elftoolchain/release/amd64/pkg-stage.conf projects/elftoolchain/release/i386/pkg-stage.conf Modified: projects/elftoolchain/bin/df/df.1 projects/elftoolchain/cddl/contrib/opensolaris/cmd/zdb/zdb.c projects/elftoolchain/cddl/contrib/opensolaris/cmd/zinject/zinject.c projects/elftoolchain/cddl/usr.bin/zinject/Makefile projects/elftoolchain/contrib/gcc/cp/ChangeLog.apple projects/elftoolchain/contrib/gcc/cp/parser.c projects/elftoolchain/gnu/lib/libgcc/Makefile projects/elftoolchain/include/ttyent.h projects/elftoolchain/lib/libc/Makefile projects/elftoolchain/lib/libc/gen/getttyent.c projects/elftoolchain/lib/libfetch/common.c projects/elftoolchain/lib/libkvm/kvm_ia64.c projects/elftoolchain/libexec/getty/ttys.5 projects/elftoolchain/libexec/rtld-elf/Makefile projects/elftoolchain/release/Makefile projects/elftoolchain/release/doc/en_US.ISO8859-1/errata/article.xml projects/elftoolchain/release/doc/en_US.ISO8859-1/relnotes/article.xml projects/elftoolchain/release/scripts/pkg-stage.sh projects/elftoolchain/share/man/man4/Makefile projects/elftoolchain/share/man/man9/malloc.9 projects/elftoolchain/share/man/man9/mbuf.9 projects/elftoolchain/share/mk/bsd.libnames.mk projects/elftoolchain/sys/amd64/conf/NOTES projects/elftoolchain/sys/amd64/vmm/intel/vmcs.h projects/elftoolchain/sys/amd64/vmm/intel/vmx.c projects/elftoolchain/sys/arm/at91/at91rm9200.c projects/elftoolchain/sys/arm/at91/at91sam9260.c projects/elftoolchain/sys/arm/at91/at91sam9g20.c projects/elftoolchain/sys/arm/at91/at91sam9g45.c projects/elftoolchain/sys/arm/at91/at91sam9x5.c projects/elftoolchain/sys/arm/at91/at91var.h projects/elftoolchain/sys/arm/at91/board_hl201.c projects/elftoolchain/sys/arm/at91/board_sam9260ek.c projects/elftoolchain/sys/arm/at91/files.at91 projects/elftoolchain/sys/arm/at91/uart_dev_at91usart.c projects/elftoolchain/sys/arm/conf/ATMEL projects/elftoolchain/sys/arm/conf/HL201 projects/elftoolchain/sys/arm/conf/SAM9260EK projects/elftoolchain/sys/arm/freescale/imx/imx51_ipuv3_fbd.c projects/elftoolchain/sys/arm/s3c2xx0/uart_dev_s3c2410.c projects/elftoolchain/sys/arm/sa11x0/uart_dev_sa1110.c projects/elftoolchain/sys/arm/xilinx/uart_dev_cdnc.c projects/elftoolchain/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c projects/elftoolchain/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c projects/elftoolchain/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c projects/elftoolchain/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c projects/elftoolchain/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c projects/elftoolchain/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c projects/elftoolchain/sys/compat/freebsd32/freebsd32_misc.c projects/elftoolchain/sys/conf/files.amd64 projects/elftoolchain/sys/conf/files.i386 projects/elftoolchain/sys/contrib/ipfilter/netinet/ip_compat.h projects/elftoolchain/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c (contents, props changed) projects/elftoolchain/sys/dev/aha/aha.c projects/elftoolchain/sys/dev/ahci/ahci.c projects/elftoolchain/sys/dev/altera/atse/if_atse.c projects/elftoolchain/sys/dev/bxe/bxe.c projects/elftoolchain/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c projects/elftoolchain/sys/dev/nand/nfc_at91.c projects/elftoolchain/sys/dev/netmap/netmap.c projects/elftoolchain/sys/dev/netmap/netmap_generic.c projects/elftoolchain/sys/dev/netmap/netmap_vale.c projects/elftoolchain/sys/dev/qlxge/qls_os.c projects/elftoolchain/sys/dev/uart/uart_core.c projects/elftoolchain/sys/dev/uart/uart_cpu.h projects/elftoolchain/sys/dev/uart/uart_dev_imx.c projects/elftoolchain/sys/dev/uart/uart_dev_lpc.c projects/elftoolchain/sys/dev/uart/uart_dev_ns8250.c projects/elftoolchain/sys/dev/uart/uart_dev_ns8250.h projects/elftoolchain/sys/dev/uart/uart_dev_pl011.c projects/elftoolchain/sys/dev/uart/uart_dev_quicc.c projects/elftoolchain/sys/dev/uart/uart_dev_sab82532.c projects/elftoolchain/sys/dev/uart/uart_dev_z8530.c projects/elftoolchain/sys/dev/uart/uart_if.m projects/elftoolchain/sys/dev/usb/net/uhso.c projects/elftoolchain/sys/dev/usb/usb_dev.c projects/elftoolchain/sys/dev/usb/usb_device.c projects/elftoolchain/sys/dev/vt/hw/xboxfb/xboxfb.c projects/elftoolchain/sys/geom/multipath/g_multipath.c projects/elftoolchain/sys/i386/conf/NOTES projects/elftoolchain/sys/ia64/conf/GENERIC projects/elftoolchain/sys/ia64/ia64/pmap.c projects/elftoolchain/sys/kern/kern_event.c projects/elftoolchain/sys/kern/subr_witness.c projects/elftoolchain/sys/kern/uipc_mbuf.c projects/elftoolchain/sys/kern/uipc_sockbuf.c projects/elftoolchain/sys/kern/uipc_socket.c projects/elftoolchain/sys/kern/uipc_syscalls.c projects/elftoolchain/sys/mips/adm5120/uart_dev_adm5120.c projects/elftoolchain/sys/mips/atheros/uart_dev_ar933x.c projects/elftoolchain/sys/mips/cavium/ciu.c projects/elftoolchain/sys/mips/cavium/uart_dev_oct16550.c projects/elftoolchain/sys/mips/rt305x/uart_dev_rt305x.c projects/elftoolchain/sys/modules/virtio/Makefile projects/elftoolchain/sys/net/ieee8023ad_lacp.c projects/elftoolchain/sys/net/if.c projects/elftoolchain/sys/net/if_arcsubr.c projects/elftoolchain/sys/net/if_dl.h projects/elftoolchain/sys/net/if_ethersubr.c projects/elftoolchain/sys/net/if_fddisubr.c projects/elftoolchain/sys/net/if_iso88025subr.c projects/elftoolchain/sys/net/if_lagg.c projects/elftoolchain/sys/net/netmap_user.h projects/elftoolchain/sys/net80211/ieee80211_mesh.c projects/elftoolchain/sys/netinet/in.c projects/elftoolchain/sys/netinet/in_mcast.c projects/elftoolchain/sys/netinet/ip_carp.c projects/elftoolchain/sys/netinet/ip_output.c projects/elftoolchain/sys/netinet/tcp_syncache.c projects/elftoolchain/sys/netinet6/in6.c projects/elftoolchain/sys/netinet6/in6_ifattach.c projects/elftoolchain/sys/netinet6/in6_var.h projects/elftoolchain/sys/netinet6/nd6.c projects/elftoolchain/sys/netinet6/nd6.h projects/elftoolchain/sys/netinet6/nd6_rtr.c projects/elftoolchain/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c projects/elftoolchain/sys/powerpc/powermac/pmu.c projects/elftoolchain/sys/sys/mbuf.h projects/elftoolchain/sys/sys/random.h projects/elftoolchain/sys/sys/sf_base.h projects/elftoolchain/sys/sys/sf_sync.h projects/elftoolchain/sys/sys/socket.h projects/elftoolchain/sys/vm/vm_pageout.c projects/elftoolchain/sys/vm/vnode_pager.c projects/elftoolchain/sys/x86/x86/nexus.c projects/elftoolchain/tools/tools/mcgrab/mcgrab.cc projects/elftoolchain/tools/tools/netmap/Makefile projects/elftoolchain/tools/tools/netmap/bridge.c projects/elftoolchain/tools/tools/netmap/nm_util.c projects/elftoolchain/tools/tools/netmap/nm_util.h projects/elftoolchain/tools/tools/netmap/pcap.c projects/elftoolchain/tools/tools/netmap/pkt-gen.c projects/elftoolchain/tools/tools/netmap/vale-ctl.c projects/elftoolchain/usr.bin/killall/killall.c projects/elftoolchain/usr.bin/ktrdump/ktrdump.c projects/elftoolchain/usr.bin/script/script.c projects/elftoolchain/usr.sbin/bsdconfig/share/strings.subr projects/elftoolchain/usr.sbin/bsdinstall/scripts/services projects/elftoolchain/usr.sbin/pciconf/pciconf.8 projects/elftoolchain/usr.sbin/pciconf/pciconf.c Directory Properties: projects/elftoolchain/ (props changed) projects/elftoolchain/cddl/ (props changed) projects/elftoolchain/cddl/contrib/opensolaris/ (props changed) projects/elftoolchain/contrib/gcc/ (props changed) projects/elftoolchain/gnu/lib/ (props changed) projects/elftoolchain/include/ (props changed) projects/elftoolchain/lib/libc/ (props changed) projects/elftoolchain/share/man/man4/ (props changed) projects/elftoolchain/sys/ (props changed) projects/elftoolchain/sys/amd64/vmm/ (props changed) projects/elftoolchain/sys/cddl/contrib/opensolaris/ (props changed) projects/elftoolchain/sys/conf/ (props changed) projects/elftoolchain/sys/contrib/ipfilter/ (props changed) projects/elftoolchain/sys/dev/hyperv/ (props changed) Modified: projects/elftoolchain/bin/df/df.1 ============================================================================== --- projects/elftoolchain/bin/df/df.1 Mon Jan 20 19:38:16 2014 (r260919) +++ projects/elftoolchain/bin/df/df.1 Mon Jan 20 19:38:44 2014 (r260920) @@ -29,7 +29,7 @@ .\" @(#)df.1 8.3 (Berkeley) 5/8/95 .\" $FreeBSD$ .\" -.Dd January 24, 2013 +.Dd January 16, 2014 .Dt DF 1 .Os .Sh NAME @@ -83,13 +83,13 @@ Use 1073741824 byte (1 Gibibyte) blocks This overrides any .Ev BLOCKSIZE specification from the environment. -.It Fl H +.It Fl h .Dq Human-readable output. Use unit suffixes: Byte, Kibibyte, Mebibyte, Gibibyte, Tebibyte and Pebibyte (based on powers of 1024) in order to reduce the number of digits to four or fewer. -.It Fl h +.It Fl H .Dq Human-readable output. Use unit suffixes: Byte, Kilobyte, Megabyte, Modified: projects/elftoolchain/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- projects/elftoolchain/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Jan 20 19:38:16 2014 (r260919) +++ projects/elftoolchain/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Jan 20 19:38:44 2014 (r260920) @@ -3012,6 +3012,7 @@ zdb_read_block(char *thing, spa_t *spa) free(dup); return; } + i += p - &flagstr[i + 1]; /* skip over the number */ } } Modified: projects/elftoolchain/cddl/contrib/opensolaris/cmd/zinject/zinject.c ============================================================================== --- projects/elftoolchain/cddl/contrib/opensolaris/cmd/zinject/zinject.c Mon Jan 20 19:38:16 2014 (r260919) +++ projects/elftoolchain/cddl/contrib/opensolaris/cmd/zinject/zinject.c Mon Jan 20 19:38:44 2014 (r260920) @@ -148,6 +148,7 @@ #include <sys/mount.h> #include <libzfs.h> +#include <libzfs_compat.h> #undef verify /* both libzfs.h and zfs_context.h want to define this */ Modified: projects/elftoolchain/cddl/usr.bin/zinject/Makefile ============================================================================== --- projects/elftoolchain/cddl/usr.bin/zinject/Makefile Mon Jan 20 19:38:16 2014 (r260919) +++ projects/elftoolchain/cddl/usr.bin/zinject/Makefile Mon Jan 20 19:38:44 2014 (r260920) @@ -16,6 +16,7 @@ CFLAGS+= -I${.CURDIR}/../../contrib/open CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common +CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs/ CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/head CFLAGS+= -I${.CURDIR}/../../lib/libumem Modified: projects/elftoolchain/contrib/gcc/cp/ChangeLog.apple ============================================================================== --- projects/elftoolchain/contrib/gcc/cp/ChangeLog.apple Mon Jan 20 19:38:16 2014 (r260919) +++ projects/elftoolchain/contrib/gcc/cp/ChangeLog.apple Mon Jan 20 19:38:44 2014 (r260920) @@ -302,15 +302,6 @@ (cp_parser_objc_declaration): Parses attribute list and passes it down to cp_parser_objc_class_interface/cp_parser_objc_protocol_declaration. -2007-07-24 Fariborz Jahanian <fjahanian@apple.com> - - Radar 5355344 - * cp-tree.h (cp_objc_protocol_id_list): New declaration - * cp-lang.c (cp_objc_protocol_id_list): New stub - * parser.c (cp_parser_type_name): Added code to disambiguate - conditional from a protocol type. - (cp_parser_objc_tentative_protocol_refs_opt): New - 2007-07-13 Fariborz Jahanian <fjahanian@apple.com> Radar 5277239 Modified: projects/elftoolchain/contrib/gcc/cp/parser.c ============================================================================== --- projects/elftoolchain/contrib/gcc/cp/parser.c Mon Jan 20 19:38:16 2014 (r260919) +++ projects/elftoolchain/contrib/gcc/cp/parser.c Mon Jan 20 19:38:44 2014 (r260920) @@ -1827,10 +1827,6 @@ static tree cp_parser_objc_identifier_li /* APPLE LOCAL end radar 3803157 - objc attribute */ static tree cp_parser_objc_protocol_refs_opt (cp_parser *); -/* APPLE LOCAL begin radar 5355344 */ -static bool cp_parser_objc_tentative_protocol_refs_opt - (cp_parser *, tree *); -/* APPLE LOCAL end radar 5355344 */ static void cp_parser_objc_declaration (cp_parser *); static tree cp_parser_objc_statement @@ -17873,32 +17869,6 @@ cp_parser_objc_protocol_refs_opt (cp_par return protorefs; } -/* APPLE LOCAL begin radar 5355344 */ -/* This routine also parses a list of Objective-C protocol references; except that - if list is not valid, it returns FALSE and back-tracks parsing. */ - -static bool -cp_parser_objc_tentative_protocol_refs_opt (cp_parser* parser, tree *protorefs) -{ - *protorefs = NULL_TREE; - if(cp_lexer_next_token_is (parser->lexer, CPP_LESS)) - { - cp_parser_parse_tentatively (parser); - cp_lexer_consume_token (parser->lexer); /* Eat '<'. */ - *protorefs = cp_parser_objc_identifier_list (parser); - if (!cp_objc_protocol_id_list (*protorefs)) - { - cp_parser_abort_tentative_parse (parser); - return false; - } - if (cp_parser_parse_definitely (parser)) - cp_parser_require (parser, CPP_GREATER, "`>'"); - } - - return true; -} -/* APPLE LOCAL end radar 5355344 */ - /* Parse a Objective-C visibility specification. */ static void Modified: projects/elftoolchain/gnu/lib/libgcc/Makefile ============================================================================== --- projects/elftoolchain/gnu/lib/libgcc/Makefile Mon Jan 20 19:38:16 2014 (r260919) +++ projects/elftoolchain/gnu/lib/libgcc/Makefile Mon Jan 20 19:38:44 2014 (r260920) @@ -34,9 +34,9 @@ OBJS= # added to below in various ways #--------------------------------------------------------------------------- # -# When upgrading GCC, get the following defintions straight from Makefile.in -# # Library members defined in libgcc2.c. +# When upgrading GCC, obtain the following list from mklibgcc.in +# LIB2FUNCS= _muldi3 _negdi2 _lshrdi3 _ashldi3 _ashrdi3 \ _cmpdi2 _ucmpdi2 \ _enable_execute_stack _trampoline __main _absvsi2 _absvdi2 _addvsi3 \ @@ -44,7 +44,7 @@ LIB2FUNCS= _muldi3 _negdi2 _lshrdi3 _ash _ffssi2 _ffsdi2 _clz _clzsi2 _clzdi2 _ctzsi2 _ctzdi2 _popcount_tab \ _popcountsi2 _popcountdi2 _paritysi2 _paritydi2 _powisf2 _powidf2 \ _powixf2 _powitf2 _mulsc3 _muldc3 _mulxc3 _multc3 _divsc3 _divdc3 \ - _divxc3 _divtc3 + _divxc3 _divtc3 _bswapsi2 _bswapdi2 .if ${COMPILER_TYPE} != "clang" || ${TARGET_CPUARCH} != "arm" LIB2FUNCS+= _clear_cache .endif @@ -119,8 +119,8 @@ LIB1ASMFUNCS = _dvmd_tls _bb_init_func .if ${MK_ARM_EABI} != "no" LIB2ADDEH = unwind-arm.c libunwind.S pr-support.c unwind-c.c # Some compilers generate __aeabi_ functions libgcc_s is missing -DPADD+= ${LIBGCC} -LDADD+= -lgcc +DPADD+= ${LIBCOMPILER_RT} +LDADD+= -lcompiler_rt .else LIB2FUNCS_EXTRA = floatunsidf.c floatunsisf.c .endif Modified: projects/elftoolchain/include/ttyent.h ============================================================================== --- projects/elftoolchain/include/ttyent.h Mon Jan 20 19:38:16 2014 (r260919) +++ projects/elftoolchain/include/ttyent.h Mon Jan 20 19:38:44 2014 (r260920) @@ -37,6 +37,7 @@ #define _TTYS_OFF "off" #define _TTYS_ON "on" +#define _TTYS_ONIFCONSOLE "onifconsole" #define _TTYS_SECURE "secure" #define _TTYS_INSECURE "insecure" #define _TTYS_WINDOW "window" Modified: projects/elftoolchain/lib/libc/Makefile ============================================================================== --- projects/elftoolchain/lib/libc/Makefile Mon Jan 20 19:38:16 2014 (r260919) +++ projects/elftoolchain/lib/libc/Makefile Mon Jan 20 19:38:44 2014 (r260920) @@ -40,11 +40,11 @@ CFLAGS+=${CANCELPOINTS_CFLAGS} .endif # -# Only link with static libgcc.a (no libgcc_eh.a). +# Link with static libcompiler_rt.a. # -DPADD+= ${LIBGCC} +DPADD+= ${LIBCOMPILER_RT} LDFLAGS+= -nodefaultlibs -LDADD+= -lgcc +LDADD+= -lcompiler_rt .if ${MK_SSP} != "no" LDADD+= -lssp_nonshared Modified: projects/elftoolchain/lib/libc/gen/getttyent.c ============================================================================== --- projects/elftoolchain/lib/libc/gen/getttyent.c Mon Jan 20 19:38:16 2014 (r260919) +++ projects/elftoolchain/lib/libc/gen/getttyent.c Mon Jan 20 19:38:44 2014 (r260920) @@ -39,6 +39,9 @@ __FBSDID("$FreeBSD$"); #include <ctype.h> #include <string.h> +#include <sys/types.h> +#include <sys/sysctl.h> + static char zapchar; static FILE *tf; static size_t lbsize; @@ -64,6 +67,36 @@ getttynam(const char *tty) return (t); } +static int +auto_tty_status(const char *ty_name) +{ + size_t len; + char *buf, *cons, *nextcons; + + /* Check if this is an enabled kernel console line */ + buf = NULL; + if (sysctlbyname("kern.console", NULL, &len, NULL, 0) == -1) + return (0); /* Errors mean don't enable */ + buf = malloc(len); + if (sysctlbyname("kern.console", buf, &len, NULL, 0) == -1) + goto done; + + if ((cons = strchr(buf, '/')) == NULL) + goto done; + *cons = '\0'; + nextcons = buf; + while ((cons = strsep(&nextcons, ",")) != NULL && strlen(cons) != 0) { + if (strcmp(cons, ty_name) == 0) { + free(buf); + return (TTY_ON); + } + } + +done: + free(buf); + return (0); +} + struct ttyent * getttyent(void) { @@ -126,6 +159,8 @@ getttyent(void) tty.ty_status &= ~TTY_ON; else if (scmp(_TTYS_ON)) tty.ty_status |= TTY_ON; + else if (scmp(_TTYS_ONIFCONSOLE)) + tty.ty_status |= auto_tty_status(tty.ty_name); else if (scmp(_TTYS_SECURE)) tty.ty_status |= TTY_SECURE; else if (scmp(_TTYS_INSECURE)) Modified: projects/elftoolchain/lib/libfetch/common.c ============================================================================== --- projects/elftoolchain/lib/libfetch/common.c Mon Jan 20 19:38:16 2014 (r260919) +++ projects/elftoolchain/lib/libfetch/common.c Mon Jan 20 19:38:44 2014 (r260920) @@ -679,7 +679,7 @@ fetch_ssl_setup_transport_layer(SSL_CTX if (getenv("SSL_NO_TLS1") != NULL) ssl_ctx_options |= SSL_OP_NO_TLSv1; if (verbose) - fetch_info("SSL options: %x", ssl_ctx_options); + fetch_info("SSL options: %lx", ssl_ctx_options); SSL_CTX_set_options(ctx, ssl_ctx_options); } Modified: projects/elftoolchain/lib/libkvm/kvm_ia64.c ============================================================================== --- projects/elftoolchain/lib/libkvm/kvm_ia64.c Mon Jan 20 19:38:16 2014 (r260919) +++ projects/elftoolchain/lib/libkvm/kvm_ia64.c Mon Jan 20 19:38:44 2014 (r260920) @@ -371,5 +371,5 @@ _kvm_kvatop(kvm_t *kd, u_long va, off_t size_t sz; sz = kd->vmst->kvatop(kd, va, ofs); - return (sz); + return ((sz > INT_MAX) ? INT_MAX : sz); } Modified: projects/elftoolchain/libexec/getty/ttys.5 ============================================================================== --- projects/elftoolchain/libexec/getty/ttys.5 Mon Jan 20 19:38:16 2014 (r260919) +++ projects/elftoolchain/libexec/getty/ttys.5 Mon Jan 20 19:38:44 2014 (r260920) @@ -102,8 +102,11 @@ ttys as a group. .Pp As flag values, the strings ``on'' and ``off'' specify that .Xr init 8 -should (should not) execute the command given in the second field, -while ``secure'' (if ``on'' is also specified) allows users with a +should (should not) execute the command given in the second field. +``onifconsole'' will cause this line to be enabled if and only if it is +an active kernel console device (it is equivalent to ``on'' in this +case). +The flag ``secure'' (if the console is enabled) allows users with a uid of 0 to login on this line. The flag ``dialin'' indicates that a tty entry describes a dialin Modified: projects/elftoolchain/libexec/rtld-elf/Makefile ============================================================================== --- projects/elftoolchain/libexec/rtld-elf/Makefile Mon Jan 20 19:38:16 2014 (r260919) +++ projects/elftoolchain/libexec/rtld-elf/Makefile Mon Jan 20 19:38:44 2014 (r260920) @@ -43,11 +43,12 @@ DPADD= ${LIBC_PIC} LDADD= -lc_pic .if ${MACHINE_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no" -# Some of the required math functions (div & mod) are implemented in libgcc -# on ARM. The library also needs to be placed first to be correctly linked. -# As some of the functions are used before we have shared libraries. -DPADD+= ${LIBGCC} -LDADD+= -lgcc +# Some of the required math functions (div & mod) are implemented in +# libcompiler_rt on ARM. The library also needs to be placed first to be +# correctly linked. As some of the functions are used before we have +# shared libraries. +DPADD+= ${LIBCOMPILER_RT} +LDADD+= -lcompiler_rt .endif Modified: projects/elftoolchain/release/Makefile ============================================================================== --- projects/elftoolchain/release/Makefile Mon Jan 20 19:38:16 2014 (r260919) +++ projects/elftoolchain/release/Makefile Mon Jan 20 19:38:44 2014 (r260920) @@ -224,9 +224,9 @@ packagesystem: base.txz kernel.txz ${EXT touch ${.TARGET} pkg-stage: -.if !defined(NOPKG) && exists(${.CURDIR}/${TARGET}/pkg-stage.conf) - sh ${.CURDIR}/scripts/pkg-stage.sh ${.CURDIR}/${TARGET}/pkg-stage.conf \ - ${REVISION} +.if !defined(NOPKG) + env REPOS_DIR=${.CURDIR}/pkg_repos/ \ + sh ${.CURDIR}/scripts/pkg-stage.sh mkdir -p ${.OBJDIR}/dvd/packages/repos/ cp ${.CURDIR}/scripts/FreeBSD_install_cdrom.conf \ ${.OBJDIR}/dvd/packages/repos/ Modified: projects/elftoolchain/release/doc/en_US.ISO8859-1/errata/article.xml ============================================================================== --- projects/elftoolchain/release/doc/en_US.ISO8859-1/errata/article.xml Mon Jan 20 19:38:16 2014 (r260919) +++ projects/elftoolchain/release/doc/en_US.ISO8859-1/errata/article.xml Mon Jan 20 19:38:44 2014 (r260920) @@ -1,45 +1,24 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE article PUBLIC "-//FreeBSD//DTD DocBook XML V5.0-Based Extension//EN" - "../../../share/xml/freebsd50.dtd" [ -<!ENTITY % release PUBLIC "-//FreeBSD//ENTITIES Release Specification//EN" "release.ent"> + "http://www.FreeBSD.org/XML/share/xml/freebsd50.dtd" [ +<!ENTITY % release PUBLIC "-//FreeBSD//ENTITIES Release Specification//EN" + "http://www.FreeBSD.org/release/XML/release.ent"> %release; ]> -<!-- - FreeBSD errata document. Unlike some of the other RELNOTESng - files, this file should remain as a single SGML file, so that - the dollar FreeBSD dollar header has a meaningful modification - time. This file is all but useless without a datestamp on it, - so we'll take some extra care to make sure it has one. - - (If we didn't do this, then the file with the datestamp might - not be the one that received the last change in the document.) - ---> -<article xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0"> - <info><title>&os; &release; Errata </title> - - - <author><orgname> - The &os; Project - </orgname></author> + +<article xmlns="http://docbook.org/ns/docbook" + xmlns:xlink="http://www.w3.org/1999/xlink" + version="5.0"> + <info> + <title>&os; &release; Errata </title> + + <author><orgname>The &os; Project</orgname></author> <pubdate>$FreeBSD$</pubdate> <copyright> - <year>2000</year> - <year>2001</year> - <year>2002</year> - <year>2003</year> - <year>2004</year> - <year>2005</year> - <year>2006</year> - <year>2007</year> - <year>2008</year> - <year>2009</year> - <year>2010</year> - <year>2011</year> - <year>2012</year> - <year>2013</year> + <year>2014</year> + <holder role="mailto:doc@FreeBSD.org">The &os; Documentation Project</holder> </copyright> @@ -50,20 +29,20 @@ &tm-attrib.general; </legalnotice> - <abstract> - <para>This document lists errata items for &os; &release;, - containing significant information discovered after the release - or too late in the release cycle to be otherwise included in the - release documentation. - This information includes security advisories, as well as news - relating to the software or documentation that could affect its - operation or usability. An up-to-date version of this document - should always be consulted before installing this version of - &os;.</para> - - <para>This errata document for &os; &release; - will be maintained until the release of &os; &release.next;.</para> - </abstract> + <abstract> + <para>This document lists errata items for &os; &release;, + containing significant information discovered after the release + or too late in the release cycle to be otherwise included in the + release documentation. + This information includes security advisories, as well as news + relating to the software or documentation that could affect its + operation or usability. An up-to-date version of this document + should always be consulted before installing this version of + &os;.</para> + + <para>This errata document for &os; &release; + will be maintained until the release of &os; &release.next;.</para> + </abstract> </info> <sect1 xml:id="intro"> @@ -80,44 +59,35 @@ out of date by definition, but other copies are kept updated on the Internet and should be consulted as the <quote>current errata</quote> for this release. These other copies of the - errata are located at <uri xlink:href="http://www.FreeBSD.org/releases/">http://www.FreeBSD.org/releases/</uri>, plus any sites + errata are located at + <link xlink:href="http://www.FreeBSD.org/releases/" />, + plus any sites which keep up-to-date mirrors of this location.</para> <para>Source and binary snapshots of &os; &release.branch; also contain up-to-date copies of this document (as of the time of the snapshot).</para> - <para>For a list of all &os; CERT security advisories, see <uri xlink:href="http://www.FreeBSD.org/security/">http://www.FreeBSD.org/security/</uri> or <uri xlink:href="ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/">ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/</uri>.</para> - + <para>For a list of all &os; CERT security advisories, see + <link xlink:href="http://www.FreeBSD.org/security/" /> + or <link xlink:href="ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/" />.</para> </sect1> <sect1 xml:id="security"> <title>Security Advisories</title> - <para releasetype="current">No advisories.</para> - - <para releasetype="release">No advisories.</para> - - <para releasetype="snapshot">No advisories.</para> + <para>No advisory.</para> </sect1> <sect1 xml:id="open-issues"> <title>Open Issues</title> - <para releasetype="current">No open issues.</para> - - <para releasetype="release">No open issues.</para> - - <para releasetype="snapshot">No open issues.</para> + <para>No open issues.</para> </sect1> <sect1 xml:id="late-news"> <title>Late-Breaking News</title> - <para releasetype="current">No news.</para> - - <para releasetype="release">No news.</para> - - <para releasetype="snapshot">No news.</para> + <para>No news.</para> </sect1> </article> Modified: projects/elftoolchain/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- projects/elftoolchain/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon Jan 20 19:38:16 2014 (r260919) +++ projects/elftoolchain/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon Jan 20 19:38:44 2014 (r260920) @@ -723,14 +723,13 @@ hv_vmbus_load="YES"</programlisting> Al <sect1 xml:id="upgrade"> <title>Upgrading from previous releases of &os;</title> - <para arch="amd64,i386">Beginning with &os; 6.2-RELEASE, - binary upgrades between RELEASE versions (and snapshots of the - various security branches) are supported using the - &man.freebsd-update.8; utility. The binary upgrade procedure will - update unmodified userland utilities, as well as unmodified GENERIC or - SMP kernels distributed as a part of an official &os; release. - The &man.freebsd-update.8; utility requires that the host being - upgraded have Internet connectivity.</para> + <para arch="amd64,i386">Binary upgrades between RELEASE versions + (and snapshots of the various security branches) are supported + using the &man.freebsd-update.8; utility. The binary upgrade + procedure will update unmodified userland utilities, as well as + unmodified GENERIC kernels distributed as a part of an official + &os; release. The &man.freebsd-update.8; utility requires that + the host being upgraded have Internet connectivity.</para> <para>Source-based upgrades (those based on recompiling the &os; base system from source code) from previous versions are @@ -738,7 +737,7 @@ hv_vmbus_load="YES"</programlisting> Al <filename>/usr/src/UPDATING</filename>.</para> <important> - <para>Upgrading &os; should, of course, only be attempted after + <para>Upgrading &os; should only be attempted after backing up <emphasis>all</emphasis> data and configuration files.</para> </important> Modified: projects/elftoolchain/release/scripts/pkg-stage.sh ============================================================================== --- projects/elftoolchain/release/scripts/pkg-stage.sh Mon Jan 20 19:38:16 2014 (r260919) +++ projects/elftoolchain/release/scripts/pkg-stage.sh Mon Jan 20 19:38:44 2014 (r260920) @@ -5,24 +5,31 @@ set -e -usage() { - echo "$(basename ${0}) /path/to/pkg-stage.conf revision" - exit 1 -} - -if [ ! -e "${1}" ]; then - echo "Configuration file not specified." - echo - usage -fi - -if [ "$#" -lt 2 ]; then - usage -fi - -# Source config file for this architecture. -REVISION="${2}" -. "${1}" || exit 1 +export ASSUME_ALWAYS_YES=1 +export PKG_DBDIR="/tmp/pkg" +export PERMISSIVE="YES" +export REPO_AUTOUPDATE="NO" +export PKGCMD="/usr/sbin/pkg -d" + +DVD_PACKAGES="archivers/unzip +devel/subversion +devel/subversion-static +emulators/linux_base-f10 +misc/freebsd-doc-all +net/mpd5 +net/rsync +ports-mgmt/pkg +ports-mgmt/portmaster +shells/bash +shells/zsh +security/sudo +sysutils/screen +www/firefox +www/links +x11-drivers/xf86-video-vmware +x11/gnome2 +x11/kde4 +x11/xorg" # If NOPORTS is set for the release, do not attempt to build pkg(8). if [ ! -f /usr/ports/Makefile ]; then @@ -33,8 +40,13 @@ if [ ! -x /usr/local/sbin/pkg ]; then /usr/bin/make -C /usr/ports/ports-mgmt/pkg install clean fi +export PKG_ABI=$(pkg -vv | grep ^ABI | awk '{print $3}') +export PKG_CACHEDIR="dvd/packages/${PKG_ABI}" + /bin/mkdir -p ${PKG_CACHEDIR} +# Print pkg(8) information to make debugging easier. +${PKGCMD} -vv ${PKGCMD} update -f ${PKGCMD} fetch -d ${DVD_PACKAGES} Modified: projects/elftoolchain/share/man/man4/Makefile ============================================================================== --- projects/elftoolchain/share/man/man4/Makefile Mon Jan 20 19:38:16 2014 (r260919) +++ projects/elftoolchain/share/man/man4/Makefile Mon Jan 20 19:38:44 2014 (r260920) @@ -543,6 +543,7 @@ MAN= aac.4 \ ${_virtio.4} \ ${_virtio_balloon.4} \ ${_virtio_blk.4} \ + ${_virtio_random.4} \ ${_virtio_scsi.4} \ vkbd.4 \ vlan.4 \ @@ -787,6 +788,7 @@ _nxge.4= nxge.4 _virtio.4= virtio.4 _virtio_balloon.4=virtio_balloon.4 _virtio_blk.4= virtio_blk.4 +_virtio_random.4= virtio_random.4 _virtio_scsi.4= virtio_scsi.4 _vmx.4= vmx.4 _vtnet.4= vtnet.4 Copied: projects/elftoolchain/share/man/man4/virtio_random.4 (from r260917, head/share/man/man4/virtio_random.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/elftoolchain/share/man/man4/virtio_random.4 Mon Jan 20 19:38:44 2014 (r260920, copy of r260917, head/share/man/man4/virtio_random.4) @@ -0,0 +1,61 @@ +.\" Copyright (c) 2013 Bryan Venteicher +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd December 28, 2013 +.Dt VIRTIO_RANDOM 4 +.Os +.Sh NAME +.Nm virtio_random +.Nd VirtIO Entropy driver +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device virtio_random" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +virtio_random_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +device driver provides support for VirtIO entropy devices. +.Pp +The entropy device supplies high-quality randomness from the +hypervisor to the guest. +.Sh SEE ALSO +.Xr random 4 +.Xr virtio 4 +.Sh HISTORY +The +.Nm +driver was written by +.An Bryan Venteicher Aq bryanv@FreeBSD.org . Modified: projects/elftoolchain/share/man/man9/malloc.9 ============================================================================== --- projects/elftoolchain/share/man/man9/malloc.9 Mon Jan 20 19:38:16 2014 (r260919) +++ projects/elftoolchain/share/man/man9/malloc.9 Mon Jan 20 19:38:44 2014 (r260920) @@ -29,7 +29,7 @@ .\" $NetBSD: malloc.9,v 1.3 1996/11/11 00:05:11 lukem Exp $ .\" $FreeBSD$ .\" -.Dd November 15, 2012 +.Dd January 16, 2014 .Dt MALLOC 9 .Os .Sh NAME @@ -214,17 +214,6 @@ of two for requests up to the size of a For larger requests, one or more pages is allocated. While it should not be relied upon, this information may be useful for optimizing the efficiency of memory use. -.Pp -Programmers should be careful not to confuse the malloc flags -.Dv M_NOWAIT -and -.Dv M_WAITOK -with the -.Xr mbuf 9 -flags -.Dv M_DONTWAIT -and -.Dv M_WAIT . .Sh CONTEXT .Fn malloc , .Fn realloc Modified: projects/elftoolchain/share/man/man9/mbuf.9 ============================================================================== --- projects/elftoolchain/share/man/man9/mbuf.9 Mon Jan 20 19:38:16 2014 (r260919) +++ projects/elftoolchain/share/man/man9/mbuf.9 Mon Jan 20 19:38:44 2014 (r260920) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 20, 2013 +.Dd January 16, 2014 .Dt MBUF 9 .Os .\" @@ -381,17 +381,6 @@ A number of other functions and macros r have the same argument because they may at some point need to allocate new .Vt mbufs . -.Pp -Historical -.Vt mbuf -allocator (See -.Sx HISTORY -section) used allocation flags -.Dv M_WAIT -and -.Dv M_DONTWAIT . -These constants are kept for compatibility -and their use in new code is discouraged. .It Fn MGETHDR mbuf how type Allocate an .Vt mbuf Modified: projects/elftoolchain/share/mk/bsd.libnames.mk ============================================================================== --- projects/elftoolchain/share/mk/bsd.libnames.mk Mon Jan 20 19:38:16 2014 (r260919) +++ projects/elftoolchain/share/mk/bsd.libnames.mk Mon Jan 20 19:38:44 2014 (r260920) @@ -36,6 +36,7 @@ LIBCAPSICUM?= ${DESTDIR}${LIBDIR}/libcap LIBCASPER?= ${DESTDIR}${LIBDIR}/libcasper.a LIBCOM_ERR?= ${DESTDIR}${LIBDIR}/libcom_err.a LIBCOMPAT?= ${DESTDIR}${LIBDIR}/libcompat.a +LIBCOMPILER_RT?=${DESTDIR}${LIBDIR}/libcompiler_rt.a LIBCRYPT?= ${DESTDIR}${LIBDIR}/libcrypt.a LIBCRYPTO?= ${DESTDIR}${LIBDIR}/libcrypto.a LIBCTF?= ${DESTDIR}${LIBDIR}/libctf.a @@ -53,8 +54,6 @@ LIBFETCH?= ${DESTDIR}${LIBDIR}/libfetch. LIBFL?= "don't use LIBFL, use LIBL" LIBFORM?= ${DESTDIR}${LIBDIR}/libform.a LIBG2C?= ${DESTDIR}${LIBDIR}/libg2c.a -LIBGCC?= ${DESTDIR}${LIBDIR}/libgcc.a -LIBGCC_PIC?= ${DESTDIR}${LIBDIR}/libgcc_pic.a LIBGEOM?= ${DESTDIR}${LIBDIR}/libgeom.a LIBGNUREGEX?= ${DESTDIR}${LIBDIR}/libgnuregex.a LIBGSSAPI?= ${DESTDIR}${LIBDIR}/libgssapi.a Modified: projects/elftoolchain/sys/amd64/conf/NOTES ============================================================================== --- projects/elftoolchain/sys/amd64/conf/NOTES Mon Jan 20 19:38:16 2014 (r260919) +++ projects/elftoolchain/sys/amd64/conf/NOTES Mon Jan 20 19:38:44 2014 (r260920) @@ -472,6 +472,7 @@ device vtnet # VirtIO Ethernet device device virtio_blk # VirtIO Block device device virtio_scsi # VirtIO SCSI device device virtio_balloon # VirtIO Memory Balloon device +device virtio_random # VirtIO Entropy device device hyperv # HyperV drivers Copied: projects/elftoolchain/sys/amd64/conf/VT (from r260917, head/sys/amd64/conf/VT) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/elftoolchain/sys/amd64/conf/VT Mon Jan 20 19:38:44 2014 (r260920, copy of r260917, head/sys/amd64/conf/VT) @@ -0,0 +1,14 @@ +# VT -- kernel config using the vt(9) system console instead of legacy syscons +# +# For more information see https://wiki.freebsd.org/Newcons +# +# $FreeBSD$ + +include GENERIC +ident VT + +nodevice sc +nodevice vga + +device vt +device vt_vga Modified: projects/elftoolchain/sys/amd64/vmm/intel/vmcs.h ============================================================================== --- projects/elftoolchain/sys/amd64/vmm/intel/vmcs.h Mon Jan 20 19:38:16 2014 (r260919) +++ projects/elftoolchain/sys/amd64/vmm/intel/vmcs.h Mon Jan 20 19:38:44 2014 (r260920) @@ -331,12 +331,18 @@ vmcs_write(uint32_t encoding, uint64_t v #define EXIT_REASON_APIC_WRITE 56 /* + * NMI unblocking due to IRET. + * + * Applies to VM-exits due to hardware exception or EPT fault. + */ +#define EXIT_QUAL_NMIUDTI (1 << 12) +/* * VMCS interrupt information fields */ -#define VMCS_INTR_INFO_VALID (1U << 31) -#define VMCS_INTR_INFO_TYPE(info) (((info) >> 8) & 0x7) -#define VMCS_INTR_INFO_HW_INTR (0 << 8) -#define VMCS_INTR_INFO_NMI (2 << 8) +#define VMCS_INTR_VALID (1U << 31) +#define VMCS_INTR_T_MASK 0x700 /* Interruption-info type */ +#define VMCS_INTR_T_HWINTR (0 << 8) +#define VMCS_INTR_T_NMI (2 << 8) /* * VMCS IDT-Vectoring information fields Modified: projects/elftoolchain/sys/amd64/vmm/intel/vmx.c ============================================================================== --- projects/elftoolchain/sys/amd64/vmm/intel/vmx.c Mon Jan 20 19:38:16 2014 (r260919) +++ projects/elftoolchain/sys/amd64/vmm/intel/vmx.c Mon Jan 20 19:38:44 2014 (r260920) @@ -147,21 +147,6 @@ SYSCTL_INT(_hw_vmm_vmx, OID_AUTO, initia &vmx_initialized, 0, "Intel VMX initialized"); /* - * Virtual NMI blocking conditions. - * - * Some processor implementations also require NMI to be blocked if - * the STI_BLOCKING bit is set. It is possible to detect this at runtime - * based on the (exit_reason,exit_qual) tuple being set to - * (EXIT_REASON_INVAL_VMCS, EXIT_QUAL_NMI_WHILE_STI_BLOCKING). - * - * We take the easy way out and also include STI_BLOCKING as one of the - * gating items for vNMI injection. - */ -static uint64_t nmi_blocking_bits = VMCS_INTERRUPTIBILITY_MOVSS_BLOCKING | - VMCS_INTERRUPTIBILITY_NMI_BLOCKING | - VMCS_INTERRUPTIBILITY_STI_BLOCKING; - -/* * Optional capabilities */ static int cap_halt_exit; @@ -1020,121 +1005,149 @@ static void __inline vmx_set_int_window_exiting(struct vmx *vmx, int vcpu) { - vmx->cap[vcpu].proc_ctls |= PROCBASED_INT_WINDOW_EXITING; - vmcs_write(VMCS_PRI_PROC_BASED_CTLS, vmx->cap[vcpu].proc_ctls); + if ((vmx->cap[vcpu].proc_ctls & PROCBASED_INT_WINDOW_EXITING) == 0) { + vmx->cap[vcpu].proc_ctls |= PROCBASED_INT_WINDOW_EXITING; + vmcs_write(VMCS_PRI_PROC_BASED_CTLS, vmx->cap[vcpu].proc_ctls); + VCPU_CTR0(vmx->vm, vcpu, "Enabling interrupt window exiting"); + } } static void __inline vmx_clear_int_window_exiting(struct vmx *vmx, int vcpu) { + KASSERT((vmx->cap[vcpu].proc_ctls & PROCBASED_INT_WINDOW_EXITING) != 0, + ("intr_window_exiting not set: %#x", vmx->cap[vcpu].proc_ctls)); vmx->cap[vcpu].proc_ctls &= ~PROCBASED_INT_WINDOW_EXITING; vmcs_write(VMCS_PRI_PROC_BASED_CTLS, vmx->cap[vcpu].proc_ctls); + VCPU_CTR0(vmx->vm, vcpu, "Disabling interrupt window exiting"); } static void __inline vmx_set_nmi_window_exiting(struct vmx *vmx, int vcpu) { - vmx->cap[vcpu].proc_ctls |= PROCBASED_NMI_WINDOW_EXITING; - vmcs_write(VMCS_PRI_PROC_BASED_CTLS, vmx->cap[vcpu].proc_ctls); + if ((vmx->cap[vcpu].proc_ctls & PROCBASED_NMI_WINDOW_EXITING) == 0) { + vmx->cap[vcpu].proc_ctls |= PROCBASED_NMI_WINDOW_EXITING; + vmcs_write(VMCS_PRI_PROC_BASED_CTLS, vmx->cap[vcpu].proc_ctls); + VCPU_CTR0(vmx->vm, vcpu, "Enabling NMI window exiting"); + } } static void __inline vmx_clear_nmi_window_exiting(struct vmx *vmx, int vcpu) { + KASSERT((vmx->cap[vcpu].proc_ctls & PROCBASED_NMI_WINDOW_EXITING) != 0, + ("nmi_window_exiting not set %#x", vmx->cap[vcpu].proc_ctls)); vmx->cap[vcpu].proc_ctls &= ~PROCBASED_NMI_WINDOW_EXITING; vmcs_write(VMCS_PRI_PROC_BASED_CTLS, vmx->cap[vcpu].proc_ctls); + VCPU_CTR0(vmx->vm, vcpu, "Disabling NMI window exiting"); } -static int +#define NMI_BLOCKING (VMCS_INTERRUPTIBILITY_NMI_BLOCKING | \ + VMCS_INTERRUPTIBILITY_MOVSS_BLOCKING) +#define HWINTR_BLOCKING (VMCS_INTERRUPTIBILITY_STI_BLOCKING | \ + VMCS_INTERRUPTIBILITY_MOVSS_BLOCKING) + +static void vmx_inject_nmi(struct vmx *vmx, int vcpu) { - uint64_t info, interruptibility; + uint32_t gi, info; - /* Bail out if no NMI requested */ - if (!vm_nmi_pending(vmx->vm, vcpu)) - return (0); + gi = vmcs_read(VMCS_GUEST_INTERRUPTIBILITY); + KASSERT((gi & NMI_BLOCKING) == 0, ("vmx_inject_nmi: invalid guest " + "interruptibility-state %#x", gi)); - interruptibility = vmcs_read(VMCS_GUEST_INTERRUPTIBILITY); - if (interruptibility & nmi_blocking_bits) - goto nmiblocked; + info = vmcs_read(VMCS_ENTRY_INTR_INFO); + KASSERT((info & VMCS_INTR_VALID) == 0, ("vmx_inject_nmi: invalid " + "VM-entry interruption information %#x", info)); /* * Inject the virtual NMI. The vector must be the NMI IDT entry * or the VMCS entry check will fail. */ - info = VMCS_INTR_INFO_NMI | VMCS_INTR_INFO_VALID; - info |= IDT_NMI; + info = IDT_NMI | VMCS_INTR_T_NMI | VMCS_INTR_VALID; vmcs_write(VMCS_ENTRY_INTR_INFO, info); VCPU_CTR0(vmx->vm, vcpu, "Injecting vNMI"); /* Clear the request */ vm_nmi_clear(vmx->vm, vcpu); - return (1); - -nmiblocked: - /* - * Set the NMI Window Exiting execution control so we can inject - * the virtual NMI as soon as blocking condition goes away. - */ - vmx_set_nmi_window_exiting(vmx, vcpu); - - VCPU_CTR0(vmx->vm, vcpu, "Enabling NMI window exiting"); - return (1); } static void vmx_inject_interrupts(struct vmx *vmx, int vcpu, struct vlapic *vlapic) { - int vector; - uint64_t info, rflags, interruptibility; - - const int HWINTR_BLOCKED = VMCS_INTERRUPTIBILITY_STI_BLOCKING | - VMCS_INTERRUPTIBILITY_MOVSS_BLOCKING; + int vector, need_nmi_exiting; + uint64_t rflags; + uint32_t gi, info; - /* - * If there is already an interrupt pending then just return. - * - * This could happen if an interrupt was injected on a prior - * VM entry but the actual entry into guest mode was aborted - * because of a pending AST. - */ - info = vmcs_read(VMCS_ENTRY_INTR_INFO); - if (info & VMCS_INTR_INFO_VALID) - return; + if (vm_nmi_pending(vmx->vm, vcpu)) { + /* + * If there are no conditions blocking NMI injection then + * inject it directly here otherwise enable "NMI window + * exiting" to inject it as soon as we can. + * + * We also check for STI_BLOCKING because some implementations + * don't allow NMI injection in this case. If we are running + * on a processor that doesn't have this restriction it will + * immediately exit and the NMI will be injected in the + * "NMI window exiting" handler. + */ + need_nmi_exiting = 1; + gi = vmcs_read(VMCS_GUEST_INTERRUPTIBILITY); + if ((gi & (HWINTR_BLOCKING | NMI_BLOCKING)) == 0) { + info = vmcs_read(VMCS_ENTRY_INTR_INFO); + if ((info & VMCS_INTR_VALID) == 0) { + vmx_inject_nmi(vmx, vcpu); + need_nmi_exiting = 0; + } else { + VCPU_CTR1(vmx->vm, vcpu, "Cannot inject NMI " + "due to VM-entry intr info %#x", info); + } + } else { + VCPU_CTR1(vmx->vm, vcpu, "Cannot inject NMI due to " + "Guest Interruptibility-state %#x", gi); + } - /* - * NMI injection has priority so deal with those first - */ - if (vmx_inject_nmi(vmx, vcpu)) - return; + if (need_nmi_exiting) + vmx_set_nmi_window_exiting(vmx, vcpu); + } if (virtual_interrupt_delivery) { vmx_inject_pir(vlapic); return; } + /* + * If there is already an interrupt pending then just return. This + * could happen for multiple reasons: + * - A vectoring VM-entry was aborted due to astpending or rendezvous. + * - A VM-exit happened during event injection. + * - A NMI was injected above or after "NMI window exiting" VM-exit. + */ + info = vmcs_read(VMCS_ENTRY_INTR_INFO); + if (info & VMCS_INTR_VALID) + return; + /* Ask the local apic for a vector to inject */ if (!vlapic_pending_intr(vlapic, &vector)) return; - if (vector < 32 || vector > 255) - panic("vmx_inject_interrupts: invalid vector %d\n", vector); + KASSERT(vector >= 32 && vector <= 255, ("invalid vector %d", vector)); /* Check RFLAGS.IF and the interruptibility state of the guest */ rflags = vmcs_read(VMCS_GUEST_RFLAGS); if ((rflags & PSL_I) == 0) goto cantinject; - interruptibility = vmcs_read(VMCS_GUEST_INTERRUPTIBILITY); - if (interruptibility & HWINTR_BLOCKED) + gi = vmcs_read(VMCS_GUEST_INTERRUPTIBILITY); + if (gi & HWINTR_BLOCKING) goto cantinject; /* Inject the interrupt */ - info = VMCS_INTR_INFO_HW_INTR | VMCS_INTR_INFO_VALID; + info = VMCS_INTR_T_HWINTR | VMCS_INTR_VALID; info |= vector; vmcs_write(VMCS_ENTRY_INTR_INFO, info); @@ -1151,8 +1164,37 @@ cantinject: * the interrupt as soon as blocking condition goes away. */ vmx_set_int_window_exiting(vmx, vcpu); +} *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201401201938.s0KJcjoO037115>