From owner-svn-src-stable@FreeBSD.ORG Sun Oct 13 00:13:58 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 396D37C; Sun, 13 Oct 2013 00:13:58 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2602227E3; Sun, 13 Oct 2013 00:13:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9D0DwDQ060771; Sun, 13 Oct 2013 00:13:58 GMT (envelope-from markm@svn.freebsd.org) Received: (from markm@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9D0DvpN060763; Sun, 13 Oct 2013 00:13:57 GMT (envelope-from markm@svn.freebsd.org) Message-Id: <201310130013.r9D0DvpN060763@svn.freebsd.org> From: Mark Murray Date: Sun, 13 Oct 2013 00:13:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256414 - stable/10/sys/dev/random X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Oct 2013 00:13:58 -0000 Author: markm Date: Sun Oct 13 00:13:57 2013 New Revision: 256414 URL: http://svnweb.freebsd.org/changeset/base/256414 Log: MFC: There is an issue (not seen in our testing) where "yarrow" and "dummy" switch priorities, and the users are left with no usable /dev/random. The fix assigns priories to these and gives the users what they want. The override tuneable has a stupid name (blame me!) and this fixes it to be something that 'sysctl kern.random' emits and is the right thing to set. Approved by: re (gjb) Approved by: secteam (cperciva) Modified: stable/10/sys/dev/random/dummy_rng.c stable/10/sys/dev/random/random_adaptors.c stable/10/sys/dev/random/randomdev.h stable/10/sys/dev/random/randomdev_soft.c Modified: stable/10/sys/dev/random/dummy_rng.c ============================================================================== --- stable/10/sys/dev/random/dummy_rng.c Sun Oct 13 00:13:29 2013 (r256413) +++ stable/10/sys/dev/random/dummy_rng.c Sun Oct 13 00:13:57 2013 (r256414) @@ -102,6 +102,7 @@ struct random_adaptor dummy_random = { .read = (random_read_func_t *)random_null_func, .reseed = (random_reseed_func_t *)random_null_func, .seeded = 0, /* This device can never be seeded */ + .priority = 1, /* Bottom priority, so goes to last position */ }; static int Modified: stable/10/sys/dev/random/random_adaptors.c ============================================================================== --- stable/10/sys/dev/random/random_adaptors.c Sun Oct 13 00:13:29 2013 (r256413) +++ stable/10/sys/dev/random/random_adaptors.c Sun Oct 13 00:13:57 2013 (r256414) @@ -104,12 +104,13 @@ void random_adaptor_choose(struct random_adaptor **adaptor) { char rngs[128], *token, *cp; - struct random_adaptors *rpp; + struct random_adaptors *rppi, *ramax; + unsigned primax; KASSERT(adaptor != NULL, ("pre-conditions failed")); *adaptor = NULL; - if (TUNABLE_STR_FETCH("rngs_want", rngs, sizeof(rngs))) { + if (TUNABLE_STR_FETCH("kern.random.active_adaptor", rngs, sizeof(rngs))) { cp = rngs; while ((token = strsep(&cp, ",")) != NULL) @@ -120,16 +121,23 @@ random_adaptor_choose(struct random_adap " skipping\n", token); } + primax = 0U; if (*adaptor == NULL) { /* - * Fallback to the first thing that's on the list of - * available RNGs. + * Fall back to the highest priority item on the available + * RNG list. */ sx_slock(&adaptors_lock); - rpp = LIST_FIRST(&adaptors); - if (rpp != NULL) - *adaptor = rpp->rsp; + ramax = NULL; + LIST_FOREACH(rppi, &adaptors, entries) { + if (rppi->rsp->priority >= primax) { + ramax = rppi; + primax = rppi->rsp->priority; + } + } + if (ramax != NULL) + *adaptor = ramax->rsp; sx_sunlock(&adaptors_lock); Modified: stable/10/sys/dev/random/randomdev.h ============================================================================== --- stable/10/sys/dev/random/randomdev.h Sun Oct 13 00:13:29 2013 (r256413) +++ stable/10/sys/dev/random/randomdev.h Sun Oct 13 00:13:57 2013 (r256414) @@ -44,6 +44,7 @@ struct random_adaptor { struct selinfo rsel; const char *ident; int seeded; + unsigned priority; random_init_func_t *init; random_deinit_func_t *deinit; random_block_func_t *block; Modified: stable/10/sys/dev/random/randomdev_soft.c ============================================================================== --- stable/10/sys/dev/random/randomdev_soft.c Sun Oct 13 00:13:29 2013 (r256413) +++ stable/10/sys/dev/random/randomdev_soft.c Sun Oct 13 00:13:57 2013 (r256414) @@ -84,6 +84,7 @@ static struct random_adaptor random_cont .poll = randomdev_poll, .reseed = randomdev_flush_reseed, .seeded = 0, /* This will be seeded during entropy processing */ + .priority = 90, /* High priority, so top of the list. Fortuna may still win. */ }; #define RANDOM_MODULE_NAME yarrow #define RANDOM_CSPRNG_NAME "yarrow" @@ -99,6 +100,7 @@ static struct random_adaptor random_cont .poll = randomdev_poll, .reseed = randomdev_flush_reseed, .seeded = 0, /* This will be excplicitly seeded at startup when secured */ + .priority = 100, /* High priority, so top of the list. Beat Yarrow. */ }; #define RANDOM_MODULE_NAME fortuna #define RANDOM_CSPRNG_NAME "fortuna" From owner-svn-src-stable@FreeBSD.ORG Sun Oct 13 00:24:45 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8555A787; Sun, 13 Oct 2013 00:24:45 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 58AE6283F; Sun, 13 Oct 2013 00:24:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9D0OjZw066894; Sun, 13 Oct 2013 00:24:45 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9D0OjS9066892; Sun, 13 Oct 2013 00:24:45 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201310130024.r9D0OjS9066892@svn.freebsd.org> From: Glen Barber Date: Sun, 13 Oct 2013 00:24:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256420 - stable/10/sys/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Oct 2013 00:24:45 -0000 Author: gjb Date: Sun Oct 13 00:24:44 2013 New Revision: 256420 URL: http://svnweb.freebsd.org/changeset/base/256420 Log: Forced commit to mark the real -BETA1 point. Approved by: re (implicit) Modified: stable/10/sys/conf/newvers.sh Modified: stable/10/sys/conf/newvers.sh ============================================================================== From owner-svn-src-stable@FreeBSD.ORG Mon Oct 14 05:44:16 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D66E1463; Mon, 14 Oct 2013 05:44:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C29C22BAA; Mon, 14 Oct 2013 05:44:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9E5iG3o075778; Mon, 14 Oct 2013 05:44:16 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9E5iGM5075777; Mon, 14 Oct 2013 05:44:16 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310140544.r9E5iGM5075777@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 14 Oct 2013 05:44:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256435 - stable/9/sys/sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Oct 2013 05:44:16 -0000 Author: kib Date: Mon Oct 14 05:44:16 2013 New Revision: 256435 URL: http://svnweb.freebsd.org/changeset/base/256435 Log: MFC r256100: Add the definition of DF_1_INTERPOSE flag. Modified: stable/9/sys/sys/elf_common.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/sys/elf_common.h ============================================================================== --- stable/9/sys/sys/elf_common.h Mon Oct 14 00:56:38 2013 (r256434) +++ stable/9/sys/sys/elf_common.h Mon Oct 14 05:44:16 2013 (r256435) @@ -478,6 +478,7 @@ typedef struct { #define DF_1_LOADFLTR 0x00000010 /* Immediate loading of filtees */ #define DF_1_NOOPEN 0x00000040 /* Do not allow loading on dlopen() */ #define DF_1_ORIGIN 0x00000080 /* Process $ORIGIN */ +#define DF_1_INTERPOSE 0x00000400 /* Interpose all objects but main */ #define DF_1_NODEFLIB 0x00000800 /* Do not search default paths */ /* Values for n_type. Used in core files. */ From owner-svn-src-stable@FreeBSD.ORG Mon Oct 14 05:49:21 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B919F5D4; Mon, 14 Oct 2013 05:49:21 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A63A52BD0; Mon, 14 Oct 2013 05:49:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9E5nLeA076969; Mon, 14 Oct 2013 05:49:21 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9E5nLgO076967; Mon, 14 Oct 2013 05:49:21 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310140549.r9E5nLgO076967@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 14 Oct 2013 05:49:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256436 - stable/9/libexec/rtld-elf X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Oct 2013 05:49:21 -0000 Author: kib Date: Mon Oct 14 05:49:20 2013 New Revision: 256436 URL: http://svnweb.freebsd.org/changeset/base/256436 Log: MFC r256101: Implement support for the interpose dso flag. Modified: stable/9/libexec/rtld-elf/rtld.c stable/9/libexec/rtld-elf/rtld.h Directory Properties: stable/9/libexec/rtld-elf/ (props changed) Modified: stable/9/libexec/rtld-elf/rtld.c ============================================================================== --- stable/9/libexec/rtld-elf/rtld.c Mon Oct 14 05:44:16 2013 (r256435) +++ stable/9/libexec/rtld-elf/rtld.c Mon Oct 14 05:49:20 2013 (r256436) @@ -116,6 +116,7 @@ static Objlist_Entry *objlist_find(Objli static void objlist_init(Objlist *); static void objlist_push_head(Objlist *, Obj_Entry *); static void objlist_push_tail(Objlist *, Obj_Entry *); +static void objlist_put_after(Objlist *, Obj_Entry *, Obj_Entry *); static void objlist_remove(Objlist *, Obj_Entry *); static void *path_enumerate(const char *, path_enum_proc, void *); static int relocate_object_dag(Obj_Entry *root, bool bind_now, @@ -323,6 +324,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ Objlist_Entry *entry; Obj_Entry *obj; Obj_Entry **preload_tail; + Obj_Entry *last_interposer; Objlist initlist; RtldLockState lockstate; char *library_path_rpath; @@ -537,8 +539,14 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ die(); /* Make a list of all objects loaded at startup. */ + last_interposer = obj_main; for (obj = obj_list; obj != NULL; obj = obj->next) { - objlist_push_tail(&list_main, obj); + if (obj->z_interpose && obj != obj_main) { + objlist_put_after(&list_main, last_interposer, obj); + last_interposer = obj; + } else { + objlist_push_tail(&list_main, obj); + } obj->refcount++; } @@ -1132,6 +1140,8 @@ digest_dynamic1(Obj_Entry *obj, int earl obj->z_nodelete = true; if (dynp->d_un.d_val & DF_1_LOADFLTR) obj->z_loadfltr = true; + if (dynp->d_un.d_val & DF_1_INTERPOSE) + obj->z_interpose = true; if (dynp->d_un.d_val & DF_1_NODEFLIB) obj->z_nodeflib = true; break; @@ -1980,6 +1990,7 @@ static int load_preload_objects(void) { char *p = ld_preload; + Obj_Entry *obj; static const char delim[] = " \t:;"; if (p == NULL) @@ -1992,8 +2003,10 @@ load_preload_objects(void) savech = p[len]; p[len] = '\0'; - if (load_object(p, -1, NULL, 0) == NULL) + obj = load_object(p, -1, NULL, 0); + if (obj == NULL) return -1; /* XXX - cleanup */ + obj->z_interpose = true; p[len] = savech; p += len; p += strspn(p, delim); @@ -2382,6 +2395,23 @@ objlist_push_tail(Objlist *list, Obj_Ent } static void +objlist_put_after(Objlist *list, Obj_Entry *listobj, Obj_Entry *obj) +{ + Objlist_Entry *elm, *listelm; + + STAILQ_FOREACH(listelm, list, link) { + if (listelm->obj == listobj) + break; + } + elm = NEW(Objlist_Entry); + elm->obj = obj; + if (listelm != NULL) + STAILQ_INSERT_AFTER(list, listelm, elm, link); + else + STAILQ_INSERT_TAIL(list, elm, link); +} + +static void objlist_remove(Objlist *list, Obj_Entry *obj) { Objlist_Entry *elm; Modified: stable/9/libexec/rtld-elf/rtld.h ============================================================================== --- stable/9/libexec/rtld-elf/rtld.h Mon Oct 14 05:44:16 2013 (r256435) +++ stable/9/libexec/rtld-elf/rtld.h Mon Oct 14 05:49:20 2013 (r256436) @@ -259,6 +259,7 @@ typedef struct Struct_Obj_Entry { bool z_nodelete : 1; /* Do not unload the object and dependencies */ bool z_noopen : 1; /* Do not load on dlopen */ bool z_loadfltr : 1; /* Immediately load filtees */ + bool z_interpose : 1; /* Interpose all objects but main */ bool z_nodeflib : 1; /* Don't search default library path */ bool ref_nodel : 1; /* Refcount increased to prevent dlclose */ bool init_scanned: 1; /* Object is already on init list. */ From owner-svn-src-stable@FreeBSD.ORG Mon Oct 14 05:56:16 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6EFD4931; Mon, 14 Oct 2013 05:56:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 59EEC2C1B; Mon, 14 Oct 2013 05:56:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9E5uGVA080920; Mon, 14 Oct 2013 05:56:16 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9E5uGJa080919; Mon, 14 Oct 2013 05:56:16 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310140556.r9E5uGJa080919@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 14 Oct 2013 05:56:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256437 - stable/9/sys/dev/isci X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Oct 2013 05:56:16 -0000 Author: kib Date: Mon Oct 14 05:56:15 2013 New Revision: 256437 URL: http://svnweb.freebsd.org/changeset/base/256437 Log: MFC r256125: Make isci(4) loadable. Modified: stable/9/sys/dev/isci/isci.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/isci/isci.c ============================================================================== --- stable/9/sys/dev/isci/isci.c Mon Oct 14 05:49:20 2013 (r256436) +++ stable/9/sys/dev/isci/isci.c Mon Oct 14 05:56:15 2013 (r256437) @@ -81,6 +81,7 @@ static driver_t isci_pci_driver = { }; DRIVER_MODULE(isci, pci, isci_pci_driver, isci_devclass, 0, 0); +MODULE_DEPEND(isci, cam, 1, 1, 1); static struct _pcsid { From owner-svn-src-stable@FreeBSD.ORG Mon Oct 14 15:06:49 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 715CFD8; Mon, 14 Oct 2013 15:06:49 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4F1FE2EAE; Mon, 14 Oct 2013 15:06:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9EF6nFE066499; Mon, 14 Oct 2013 15:06:49 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9EF6mnv066489; Mon, 14 Oct 2013 15:06:48 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201310141506.r9EF6mnv066489@svn.freebsd.org> From: Dimitry Andric Date: Mon, 14 Oct 2013 15:06:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256443 - in stable/9: contrib/binutils/gas/config contrib/binutils/opcodes sys/amd64/amd64 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Oct 2013 15:06:49 -0000 Author: dim Date: Mon Oct 14 15:06:47 2013 New Revision: 256443 URL: http://svnweb.freebsd.org/changeset/base/256443 Log: MFC r247012 (by jmg): add support for AES and PCLMULQDQ instructions to binutils... Thanks to Mike Belopuhov for the pointer to the OpenBSD patch, though OpenBSD's gcc is very different that it only helped w/ where to modify, not how... Thanks to jhb for some early reviews... Reviewed by: imp, kib MFC r247117 (by jmg): reorder so all the flags are together and make the PCLMUL flag unique.. This fixes the problem on amd64 miscompiling mpboot.s causing boot issues... We are still using gas for a few files in the kernel... Submitted by: kib MFC r255192 (by jhb): Add support for the 'invpcid' instruction to binutils and DDB's disassembler on amd64. MFC r256112: Add support for assembling and disassembling Intel Random Number Generator extensions (e.g. the 'rdrand' mnemonic) to our copy of binutils. Obtained from: OpenBSD, via pfg Modified: stable/9/contrib/binutils/gas/config/tc-i386.c stable/9/contrib/binutils/opcodes/i386-dis.c stable/9/contrib/binutils/opcodes/i386-opc.h stable/9/contrib/binutils/opcodes/i386-opc.tbl stable/9/contrib/binutils/opcodes/i386-tbl.h stable/9/sys/amd64/amd64/db_disasm.c Directory Properties: stable/9/contrib/binutils/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/contrib/binutils/gas/config/tc-i386.c ============================================================================== --- stable/9/contrib/binutils/gas/config/tc-i386.c Mon Oct 14 12:11:19 2013 (r256442) +++ stable/9/contrib/binutils/gas/config/tc-i386.c Mon Oct 14 15:06:47 2013 (r256443) @@ -3981,7 +3981,7 @@ output_insn (void) SSE4 instructions have 3 bytes. We may use one more higher byte to specify a prefix the instruction requires. Exclude instructions which are in both SSE4 and ABM. */ - if ((i.tm.cpu_flags & (CpuSSSE3 | CpuSSE4)) != 0 + if ((i.tm.cpu_flags & (CpuSSSE3 | CpuSSE4 | CpuAES | CpuPCLMUL)) != 0 && (i.tm.cpu_flags & CpuABM) == 0) { if (i.tm.base_opcode & 0xff000000) @@ -3990,7 +3990,8 @@ output_insn (void) goto check_prefix; } } - else if (i.tm.base_opcode == 0x660f3880 || i.tm.base_opcode == 0x660f3881) + else if (i.tm.base_opcode == 0x660f3880 || i.tm.base_opcode == 0x660f3881 + || i.tm.base_opcode == 0x660f3882) { /* invept and invvpid are 3 byte instructions with a mandatory prefix. */ @@ -4033,14 +4034,15 @@ output_insn (void) } else { - if ((i.tm.cpu_flags & (CpuSSSE3 | CpuSSE4)) != 0 + if ((i.tm.cpu_flags & (CpuSSSE3 | CpuSSE4 | CpuAES | CpuPCLMUL)) != 0 && (i.tm.cpu_flags & CpuABM) == 0) { p = frag_more (3); *p++ = (i.tm.base_opcode >> 16) & 0xff; } else if (i.tm.base_opcode == 0x660f3880 || - i.tm.base_opcode == 0x660f3881) + i.tm.base_opcode == 0x660f3881 || + i.tm.base_opcode == 0x660f3882) { p = frag_more (3); *p++ = (i.tm.base_opcode >> 16) & 0xff; Modified: stable/9/contrib/binutils/opcodes/i386-dis.c ============================================================================== --- stable/9/contrib/binutils/opcodes/i386-dis.c Mon Oct 14 12:11:19 2013 (r256442) +++ stable/9/contrib/binutils/opcodes/i386-dis.c Mon Oct 14 15:06:47 2013 (r256443) @@ -543,6 +543,14 @@ fetch_data (struct disassemble_info *inf #define PREGRP97 NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 97 } } #define PREGRP98 NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 98 } } #define PREGRP99 NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 99 } } +#define PREGRP100 NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 100 } } +#define PREGRP101 NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 101 } } +#define PREGRP102 NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 102 } } +#define PREGRP103 NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 103 } } +#define PREGRP104 NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 104 } } +#define PREGRP105 NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 105 } } +#define PREGRP106 NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 106 } } +#define PREGRP107 NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 107 } } #define X86_64_0 NULL, { { NULL, X86_64_SPECIAL }, { NULL, 0 } } @@ -1319,7 +1327,7 @@ static const unsigned char threebyte_0x3 /* a0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* af */ /* b0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* bf */ /* c0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* cf */ - /* d0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* df */ + /* d0 */ 0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1, /* df */ /* e0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* ef */ /* f0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* ff */ /* ------------------------------- */ @@ -1382,7 +1390,7 @@ static const unsigned char threebyte_0x3 /* 10 */ 0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0, /* 1f */ /* 20 */ 1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 2f */ /* 30 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 3f */ - /* 40 */ 1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 4f */ + /* 40 */ 1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0, /* 4f */ /* 50 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 5f */ /* 60 */ 1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0, /* 6f */ /* 70 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 7f */ @@ -1391,7 +1399,7 @@ static const unsigned char threebyte_0x3 /* a0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* af */ /* b0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* bf */ /* c0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* cf */ - /* d0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* df */ + /* d0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1, /* df */ /* e0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* ef */ /* f0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* ff */ /* ------------------------------- */ @@ -2605,6 +2613,70 @@ static const struct dis386 prefix_user_t { "invvpid",{ Gm, Mo } }, { "(bad)", { XX } }, }, + + /* PREGRP100 */ + { + { "(bad)", { XX } }, + { "(bad)", { XX } }, + { "aesimc", { XM, EXx } }, + { "(bad)", { XX } }, + }, + + /* PREGRP101 */ + { + { "(bad)", { XX } }, + { "(bad)", { XX } }, + { "aesenc",{ XM, EXx } }, + { "(bad)", { XX } }, + }, + + /* PREGRP102 */ + { + { "(bad)", { XX } }, + { "(bad)", { XX } }, + { "aesenclast", { XM, EXx } }, + { "(bad)", { XX } }, + }, + + /* PREGRP103 */ + { + { "(bad)", { XX } }, + { "(bad)", { XX } }, + { "aesdec", { XM, EXx } }, + { "(bad)", { XX } }, + }, + + /* PREGRP104 */ + { + { "(bad)", { XX } }, + { "(bad)", { XX } }, + { "aesdeclast", { XM, EXx } }, + { "(bad)", { XX } }, + }, + + /* PREGRP105 */ + { + { "(bad)", { XX } }, + { "(bad)", { XX } }, + { "aeskeygenassist", { XM, EXx, Ib } }, + { "(bad)", { XX } }, + }, + + /* PREGRP106 */ + { + { "(bad)", { XX } }, + { "(bad)", { XX } }, + { "pclmulqdq", { XM, EXx, Ib } }, + { "(bad)", { XX } }, + }, + + /* PREGRP107 */ + { + { "(bad)", { XX } }, + { "(bad)", { XX } }, + { "invpcid",{ Gm, Mo } }, + { "(bad)", { XX } }, + }, }; static const struct dis386 x86_64_table[][2] = { @@ -2776,7 +2848,7 @@ static const struct dis386 three_byte_ta /* 80 */ { PREGRP98 }, { PREGRP99 }, - { "(bad)", { XX } }, + { PREGRP107 }, { "(bad)", { XX } }, { "(bad)", { XX } }, { "(bad)", { XX } }, @@ -2876,11 +2948,11 @@ static const struct dis386 three_byte_ta { "(bad)", { XX } }, { "(bad)", { XX } }, { "(bad)", { XX } }, - { "(bad)", { XX } }, - { "(bad)", { XX } }, - { "(bad)", { XX } }, - { "(bad)", { XX } }, - { "(bad)", { XX } }, + { PREGRP100 }, + { PREGRP101 }, + { PREGRP102 }, + { PREGRP103 }, + { PREGRP104 }, /* e0 */ { "(bad)", { XX } }, { "(bad)", { XX } }, @@ -2997,7 +3069,7 @@ static const struct dis386 three_byte_ta { PREGRP84 }, { PREGRP85 }, { "(bad)", { XX } }, - { "(bad)", { XX } }, + { PREGRP106 }, { "(bad)", { XX } }, { "(bad)", { XX } }, { "(bad)", { XX } }, @@ -3171,7 +3243,7 @@ static const struct dis386 three_byte_ta { "(bad)", { XX } }, { "(bad)", { XX } }, { "(bad)", { XX } }, - { "(bad)", { XX } }, + { PREGRP105 }, /* e0 */ { "(bad)", { XX } }, { "(bad)", { XX } }, @@ -6366,14 +6438,22 @@ VMX_Fixup (int extrachar ATTRIBUTE_UNUSE static void OP_VMX (int bytemode, int sizeflag) { - used_prefixes |= (prefixes & (PREFIX_DATA | PREFIX_REPZ)); - if (prefixes & PREFIX_DATA) - strcpy (obuf, "vmclear"); - else if (prefixes & PREFIX_REPZ) - strcpy (obuf, "vmxon"); + if (modrm.mod == 3) + { + strcpy (obuf, "rdrand"); + OP_E (v_mode, sizeflag); + } else - strcpy (obuf, "vmptrld"); - OP_E (bytemode, sizeflag); + { + used_prefixes |= (prefixes & (PREFIX_DATA | PREFIX_REPZ)); + if (prefixes & PREFIX_DATA) + strcpy (obuf, "vmclear"); + else if (prefixes & PREFIX_REPZ) + strcpy (obuf, "vmxon"); + else + strcpy (obuf, "vmptrld"); + OP_E (bytemode, sizeflag); + } } static void Modified: stable/9/contrib/binutils/opcodes/i386-opc.h ============================================================================== --- stable/9/contrib/binutils/opcodes/i386-opc.h Mon Oct 14 12:11:19 2013 (r256442) +++ stable/9/contrib/binutils/opcodes/i386-opc.h Mon Oct 14 15:06:47 2013 (r256443) @@ -72,19 +72,23 @@ typedef struct template #define CpuSSE4_1 0x400000 /* SSE4.1 Instructions required */ #define CpuSSE4_2 0x800000 /* SSE4.2 Instructions required */ #define CpuXSAVE 0x1000000 /* XSAVE Instructions required */ - -/* SSE4.1/4.2 Instructions required */ -#define CpuSSE4 (CpuSSE4_1|CpuSSE4_2) +#define CpuAES 0x2000000 /* AES Instructions required */ /* These flags are set by gas depending on the flag_code. */ #define Cpu64 0x4000000 /* 64bit support required */ #define CpuNo64 0x8000000 /* Not supported in the 64bit mode */ +#define CpuPCLMUL 0x10000000 /* Carry-less Multiplication extensions */ +#define CpuRdRnd 0x20000000 /* Intel Random Number Generator extensions */ + +/* SSE4.1/4.2 Instructions required */ +#define CpuSSE4 (CpuSSE4_1|CpuSSE4_2) + /* The default value for unknown CPUs - enable all features to avoid problems. */ #define CpuUnknownFlags (Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686 \ |CpuP4|CpuSledgehammer|CpuMMX|CpuMMX2|CpuSSE|CpuSSE2|CpuSSE3|CpuVMX \ |Cpu3dnow|Cpu3dnowA|CpuK6|CpuPadLock|CpuSVME|CpuSSSE3|CpuSSE4_1 \ - |CpuSSE4_2|CpuABM|CpuSSE4a|CpuXSAVE) + |CpuSSE4_2|CpuABM|CpuSSE4a|CpuXSAVE|CpuAES|CpuPCLMUL|CpuRdRnd) /* the bits in opcode_modifier are used to generate the final opcode from the base_opcode. These bits also are used to detect alternate forms of @@ -126,6 +130,8 @@ typedef struct template #define Rex64 0x10000000 /* instruction require Rex64 prefix. */ #define Ugh 0x20000000 /* deprecated fp insn, gets a warning */ +#define NoSuf (No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf) + /* operand_types[i] describes the type of operand i. This is made by OR'ing together all of the possible type masks. (e.g. 'operand_types[i] = Reg|Imm' specifies that operand i can be Modified: stable/9/contrib/binutils/opcodes/i386-opc.tbl ============================================================================== --- stable/9/contrib/binutils/opcodes/i386-opc.tbl Mon Oct 14 12:11:19 2013 (r256442) +++ stable/9/contrib/binutils/opcodes/i386-opc.tbl Mon Oct 14 15:06:47 2013 (r256443) @@ -1498,3 +1498,25 @@ xsetbv, 0, 0xf01, 0xd1, CpuXSAVE, No_bSu xsave, 1, 0xfae, 0x4, CpuXSAVE, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_xSuf, { BaseIndex|Disp8|Disp16|Disp32|Disp32S } xsaveopt, 1, 0xfae, 0x6, CpuXSAVE, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_xSuf, { BaseIndex|Disp8|Disp16|Disp32|Disp32S } xrstor, 1, 0xfae, 0x5, CpuXSAVE, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_xSuf, { BaseIndex|Disp8|Disp16|Disp32|Disp32S } + +// INVPCID +invpcid, 2, 0x660f3882, None, CpuNo64, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf|No_xSuf|NoRex64, { BaseIndex|Disp8|Disp16|Disp32|Disp32S, Reg32 } +invpcid, 2, 0x660f3882, None, Cpu64, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf|No_xSuf|NoRex64, { BaseIndex|Disp8|Disp16|Disp32|Disp32S, Reg64 } + +// Intel AES extensions +aesdec, 2, 0x660f38de, None, CpuAES, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { RegXMM|LLongMem, RegXMM } +aesdeclast, 2, 0x660f38df, None, CpuAES, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { RegXMM|LLongMem, RegXMM } +aesenc, 2, 0x660f38dc, None, CpuAES, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { RegXMM|LLongMem, RegXMM } +aesenclast, 2, 0x660f38dd, None, CpuAES, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { RegXMM|LLongMem, RegXMM } +aesimc, 2, 0x660f38db, None, CpuAES, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { RegXMM|LLongMem, RegXMM } +aeskeygenassist, 3, 0x660f3adf, None, CpuAES, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { Imm8, RegXMM|LLongMem, RegXMM } + +// Intel Carry-less Multiplication extensions +pclmulqdq, 3, 0x660f3a44, None, CpuPCLMUL, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { Imm8, RegXMM|LLongMem, RegXMM } +pclmullqlqdq, 2, 0x660f3a44, 0x0, CpuPCLMUL, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf|ImmExt, { RegXMM|LLongMem, RegXMM } +pclmulhqlqdq, 2, 0x660f3a44, 0x1, CpuPCLMUL, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf|ImmExt, { RegXMM|LLongMem, RegXMM } +pclmullqhqdq, 2, 0x660f3a44, 0x10, CpuPCLMUL, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf|ImmExt, { RegXMM|LLongMem, RegXMM } +pclmulhqhqdq, 2, 0x660f3a44, 0x11, CpuPCLMUL, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf|ImmExt, { RegXMM|LLongMem, RegXMM } + +// Intel Random Number Generator extensions +rdrand, 1, 0x0fc7, 0x6, CpuRdRnd, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { Reg16|Reg32|Reg64 } Modified: stable/9/contrib/binutils/opcodes/i386-tbl.h ============================================================================== --- stable/9/contrib/binutils/opcodes/i386-tbl.h Mon Oct 14 12:11:19 2013 (r256442) +++ stable/9/contrib/binutils/opcodes/i386-tbl.h Mon Oct 14 15:06:47 2013 (r256443) @@ -3641,6 +3641,14 @@ const template i386_optab[] = Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf|No_xSuf|NoRex64, { BaseIndex|Disp8|Disp16|Disp32|Disp32S, Reg64 } }, + { "invpcid", 2, 0x660f3882, None, CpuNo64, + Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf|No_xSuf|NoRex64, + { BaseIndex|Disp8|Disp16|Disp32|Disp32S, + Reg32 } }, + { "invpcid", 2, 0x660f3882, None, Cpu64, + Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf|No_xSuf|NoRex64, + { BaseIndex|Disp8|Disp16|Disp32|Disp32S, + Reg64 } }, { "vmcall", 0, 0xf01, 0xc1, CpuVMX, No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf|ImmExt, { 0 } }, @@ -4319,6 +4327,59 @@ const template i386_optab[] = { "xrstor", 1, 0xfae, 0x5, CpuXSAVE, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_xSuf, { BaseIndex|Disp8|Disp16|Disp32|Disp32S } }, + /* Intel AES extensions */ + {"aesdec", 2, 0x660f38de, None, CpuAES, + Modrm|IgnoreSize|NoSuf, + { RegXMM|LLongMem, + RegXMM } }, + {"aesdeclast", 2, 0x660f38df, None, CpuAES, + Modrm|IgnoreSize|NoSuf, + { RegXMM|LLongMem, + RegXMM } }, + {"aesenc", 2, 0x660f38dc, None, CpuAES, + Modrm|IgnoreSize|NoSuf, + { RegXMM|LLongMem, + RegXMM } }, + {"aesenclast", 2, 0x660f38dd, None, CpuAES, + Modrm|IgnoreSize|NoSuf, + { RegXMM|LLongMem, + RegXMM } }, + {"aesimc", 2, 0x660f38db, None, CpuAES, + Modrm|IgnoreSize|NoSuf, + { RegXMM|LLongMem, + RegXMM } }, + {"aeskeygenassist", 3, 0x660f3adf, None, CpuAES, + Modrm|IgnoreSize|NoSuf, + { Imm8, RegXMM|LLongMem, + RegXMM } }, + + /* Intel Carry-less Multiplication extensions */ + {"pclmulqdq", 3, 0x660f3a44, None, CpuPCLMUL, + Modrm|IgnoreSize|NoSuf, + { Imm8, RegXMM|LLongMem, + RegXMM } }, + {"pclmullqlqdq", 2, 0x660f3a44, 0x0, CpuPCLMUL, + Modrm|IgnoreSize|NoSuf|ImmExt, + { RegXMM|LLongMem, + RegXMM } }, + {"pclmulhqlqdq", 2, 0x660f3a44, 0x1, CpuPCLMUL, + Modrm|IgnoreSize|NoSuf|ImmExt, + { RegXMM|LLongMem, + RegXMM } }, + {"pclmullqhqdq", 2, 0x660f3a44, 0x10, CpuPCLMUL, + Modrm|IgnoreSize|NoSuf|ImmExt, + { RegXMM|LLongMem, + RegXMM } }, + {"pclmulhqhqdq", 2, 0x660f3a44, 0x11, CpuPCLMUL, + Modrm|IgnoreSize|NoSuf|ImmExt, + { RegXMM|LLongMem, + RegXMM } }, + + /* Intel Random Number Generator extensions */ + {"rdrand", 1, 0x0fc7, 0x6, CpuRdRnd, + Modrm|NoSuf, + { Reg16|Reg32|Reg64 } }, + { NULL, 0, 0, 0, 0, 0, { 0 } } }; Modified: stable/9/sys/amd64/amd64/db_disasm.c ============================================================================== --- stable/9/sys/amd64/amd64/db_disasm.c Mon Oct 14 12:11:19 2013 (r256442) +++ stable/9/sys/amd64/amd64/db_disasm.c Mon Oct 14 15:06:47 2013 (r256443) @@ -127,7 +127,7 @@ struct finst { static const struct inst db_inst_0f388x[] = { /*80*/ { "", TRUE, SDEP, op2(E, Rq), "invept" }, /*81*/ { "", TRUE, SDEP, op2(E, Rq), "invvpid" }, -/*82*/ { "", FALSE, NONE, 0, 0 }, +/*82*/ { "", TRUE, SDEP, op2(E, Rq), "invpcid" }, /*83*/ { "", FALSE, NONE, 0, 0 }, /*84*/ { "", FALSE, NONE, 0, 0 }, /*85*/ { "", FALSE, NONE, 0, 0 }, From owner-svn-src-stable@FreeBSD.ORG Mon Oct 14 18:24:31 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6FD4E251; Mon, 14 Oct 2013 18:24:31 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5D1782CB9; Mon, 14 Oct 2013 18:24:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9EIOVft073183; Mon, 14 Oct 2013 18:24:31 GMT (envelope-from markm@svn.freebsd.org) Received: (from markm@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9EIOVWF073182; Mon, 14 Oct 2013 18:24:31 GMT (envelope-from markm@svn.freebsd.org) Message-Id: <201310141824.r9EIOVWF073182@svn.freebsd.org> From: Mark Murray Date: Mon, 14 Oct 2013 18:24:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256449 - stable/10/sys/modules/random X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Oct 2013 18:24:31 -0000 Author: markm Date: Mon Oct 14 18:24:30 2013 New Revision: 256449 URL: http://svnweb.freebsd.org/changeset/base/256449 Log: MFC: Add extra files to the KLD random.ko module to allow it to load. Approved by: re (kib) Modified: stable/10/sys/modules/random/Makefile Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/modules/random/Makefile ============================================================================== --- stable/10/sys/modules/random/Makefile Mon Oct 14 18:17:09 2013 (r256448) +++ stable/10/sys/modules/random/Makefile Mon Oct 14 18:24:30 2013 (r256449) @@ -11,6 +11,7 @@ SRCS+= nehemiah.c SRCS+= ivy.c .endif SRCS+= randomdev_soft.c yarrow.c hash.c +SRCS+= random_harvestq.c live_entropy_sources.c rwfile.c SRCS+= rijndael-alg-fst.c rijndael-api-fst.c sha2.c SRCS+= bus_if.h device_if.h vnode_if.h opt_cpu.h opt_random.h From owner-svn-src-stable@FreeBSD.ORG Tue Oct 15 21:08:37 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9A5ACAAF; Tue, 15 Oct 2013 21:08:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 86CC628C7; Tue, 15 Oct 2013 21:08:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9FL8bVY001205; Tue, 15 Oct 2013 21:08:37 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9FL8bsY001204; Tue, 15 Oct 2013 21:08:37 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201310152108.r9FL8bsY001204@svn.freebsd.org> From: John Baldwin Date: Tue, 15 Oct 2013 21:08:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256562 - stable/10/sys/boot/i386/btx/btx X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Oct 2013 21:08:37 -0000 Author: jhb Date: Tue Oct 15 21:08:37 2013 New Revision: 256562 URL: http://svnweb.freebsd.org/changeset/base/256562 Log: MFC 256293: Sanitize the %eflags returned by BIOS routines. Some BIOS routines enter protected mode and may leave protected-mode-specific flags like PSL_NT set when they return to real mode. This can cause a fault when BTX re-enters protected mode after the BIOS mode returns. Approved by: re (gjb) Modified: stable/10/sys/boot/i386/btx/btx/btx.S Directory Properties: stable/10/sys/ (props changed) stable/10/sys/boot/ (props changed) Modified: stable/10/sys/boot/i386/btx/btx/btx.S ============================================================================== --- stable/10/sys/boot/i386/btx/btx/btx.S Tue Oct 15 21:04:46 2013 (r256561) +++ stable/10/sys/boot/i386/btx/btx/btx.S Tue Oct 15 21:08:37 2013 (r256562) @@ -41,6 +41,8 @@ .set PSL_RESERVED_DEFAULT,0x00000002 .set PSL_T,0x00000100 # Trap flag .set PSL_I,0x00000200 # Interrupt enable flag + .set PSL_D,0x00000400 # String instruction direction + .set PSL_NT,0x00004000 # Nested task flag .set PSL_VM,0x00020000 # Virtual 8086 mode flag .set PSL_AC,0x00040000 # Alignment check flag /* @@ -611,8 +613,8 @@ rret_tramp: movw $MEM_ESPR-0x08,%sp # R pushl %ds # regs pushl %es pushfl # Save %eflags - cli # Disable interrupts - std # String ops dec + pushl $PSL_RESERVED_DEFAULT|PSL_D # Use clean %eflags with + popfl # string ops dec xorw %ax,%ax # Reset seg movw %ax,%ds # regs movw %ax,%es # (%ss is already 0) @@ -675,6 +677,7 @@ rret_tramp.1: xorl %ecx,%ecx # Zero testl $V86F_FLAGS,%edx # User wants flags? jz rret_tramp.3 # No movl MEM_ESPR-0x3c,%eax # Read real mode flags + andl $~(PSL_T|PSL_NT),%eax # Clear unsafe flags movw %ax,-0x08(%esi) # Update user flags (low 16) /* * Return to the user task From owner-svn-src-stable@FreeBSD.ORG Wed Oct 16 03:37:03 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8D21DD75; Wed, 16 Oct 2013 03:37:03 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 793582C6B; Wed, 16 Oct 2013 03:37:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9G3b3YW019897; Wed, 16 Oct 2013 03:37:03 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9G3b3R1019896; Wed, 16 Oct 2013 03:37:03 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201310160337.r9G3b3R1019896@svn.freebsd.org> From: Mark Johnston Date: Wed, 16 Oct 2013 03:37:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256578 - stable/9/sbin/camcontrol X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Oct 2013 03:37:03 -0000 Author: markj Date: Wed Oct 16 03:37:02 2013 New Revision: 256578 URL: http://svnweb.freebsd.org/changeset/base/256578 Log: Fix an inverted check for the master user in "camcontrol security -U". Modified: stable/9/sbin/camcontrol/camcontrol.c Directory Properties: stable/9/sbin/camcontrol/ (props changed) Modified: stable/9/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/9/sbin/camcontrol/camcontrol.c Wed Oct 16 03:19:05 2013 (r256577) +++ stable/9/sbin/camcontrol/camcontrol.c Wed Oct 16 03:37:02 2013 (r256578) @@ -2743,7 +2743,7 @@ atasecurity(struct cam_device *device, i if (strcasecmp(optarg, "user") == 0) { pwd.ctrl |= ATA_SECURITY_PASSWORD_USER; pwd.ctrl &= ~ATA_SECURITY_PASSWORD_MASTER; - } else if (strcasecmp(optarg, "master") != 0) { + } else if (strcasecmp(optarg, "master") == 0) { pwd.ctrl |= ATA_SECURITY_PASSWORD_MASTER; pwd.ctrl &= ~ATA_SECURITY_PASSWORD_USER; } else { From owner-svn-src-stable@FreeBSD.ORG Wed Oct 16 03:37:23 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8D6B9EAD; Wed, 16 Oct 2013 03:37:23 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 79A8A2C74; Wed, 16 Oct 2013 03:37:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9G3bNS2019973; Wed, 16 Oct 2013 03:37:23 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9G3bNpv019972; Wed, 16 Oct 2013 03:37:23 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201310160337.r9G3bNpv019972@svn.freebsd.org> From: Mark Johnston Date: Wed, 16 Oct 2013 03:37:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r256579 - stable/8/sbin/camcontrol X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Oct 2013 03:37:23 -0000 Author: markj Date: Wed Oct 16 03:37:22 2013 New Revision: 256579 URL: http://svnweb.freebsd.org/changeset/base/256579 Log: Fix an inverted check for the master user in "camcontrol security -U". Modified: stable/8/sbin/camcontrol/camcontrol.c Directory Properties: stable/8/sbin/camcontrol/ (props changed) Modified: stable/8/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/8/sbin/camcontrol/camcontrol.c Wed Oct 16 03:37:02 2013 (r256578) +++ stable/8/sbin/camcontrol/camcontrol.c Wed Oct 16 03:37:22 2013 (r256579) @@ -2675,7 +2675,7 @@ atasecurity(struct cam_device *device, i if (strcasecmp(optarg, "user") == 0) { pwd.ctrl |= ATA_SECURITY_PASSWORD_USER; pwd.ctrl &= ~ATA_SECURITY_PASSWORD_MASTER; - } else if (strcasecmp(optarg, "master") != 0) { + } else if (strcasecmp(optarg, "master") == 0) { pwd.ctrl |= ATA_SECURITY_PASSWORD_MASTER; pwd.ctrl &= ~ATA_SECURITY_PASSWORD_USER; } else { From owner-svn-src-stable@FreeBSD.ORG Wed Oct 16 06:07:04 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 618B1F94; Wed, 16 Oct 2013 06:07:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 34C332328; Wed, 16 Oct 2013 06:07:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9G674O0099250; Wed, 16 Oct 2013 06:07:04 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9G673Lm099248; Wed, 16 Oct 2013 06:07:03 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310160607.r9G673Lm099248@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 16 Oct 2013 06:07:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256589 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Oct 2013 06:07:04 -0000 Author: kib Date: Wed Oct 16 06:07:03 2013 New Revision: 256589 URL: http://svnweb.freebsd.org/changeset/base/256589 Log: MFC r256209: Reduce code duplication, introduce the getmaxfd() helper to calculate the max filedescriptor index. Modified: stable/9/sys/kern/kern_descrip.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_descrip.c ============================================================================== --- stable/9/sys/kern/kern_descrip.c Wed Oct 16 05:43:03 2013 (r256588) +++ stable/9/sys/kern/kern_descrip.c Wed Oct 16 06:07:03 2013 (r256589) @@ -133,6 +133,7 @@ static int fill_procdesc_info(struct pro struct kinfo_file *kif); static int fill_sem_info(struct file *fp, struct kinfo_file *kif); static int fill_shm_info(struct file *fp, struct kinfo_file *kif); +static int getmaxfd(struct proc *p); /* * A process is initially started out with NDFILE descriptors stored within @@ -808,6 +809,18 @@ readahead_vnlock_fail: return (error); } +static int +getmaxfd(struct proc *p) +{ + int maxfd; + + PROC_LOCK(p); + maxfd = min((int)lim_cur(p, RLIMIT_NOFILE), maxfilesperproc); + PROC_UNLOCK(p); + + return (maxfd); +} + /* * Common code for dup, dup2, fcntl(F_DUPFD) and fcntl(F_DUP2FD). */ @@ -833,9 +846,7 @@ do_dup(struct thread *td, int flags, int return (EBADF); if (new < 0) return (flags & DUP_FCNTL ? EINVAL : EBADF); - PROC_LOCK(p); - maxfd = min((int)lim_cur(p, RLIMIT_NOFILE), maxfilesperproc); - PROC_UNLOCK(p); + maxfd = getmaxfd(p); if (new >= maxfd) return (flags & DUP_FCNTL ? EINVAL : EBADF); @@ -1547,9 +1558,7 @@ fdalloc(struct thread *td, int minfd, in if (fdp->fd_freefile > minfd) minfd = fdp->fd_freefile; - PROC_LOCK(p); - maxfd = min((int)lim_cur(p, RLIMIT_NOFILE), maxfilesperproc); - PROC_UNLOCK(p); + maxfd = getmaxfd(p); /* * Search the bitmap for a free descriptor. If none is found, try @@ -1634,9 +1643,7 @@ fdavail(struct thread *td, int n) * call racct_add() from there instead of dealing with containers * here. */ - PROC_LOCK(p); - lim = min((int)lim_cur(p, RLIMIT_NOFILE), maxfilesperproc); - PROC_UNLOCK(p); + lim = getmaxfd(p); if ((i = lim - fdp->fd_nfiles) > 0 && (n -= i) <= 0) return (1); last = min(fdp->fd_nfiles, lim); From owner-svn-src-stable@FreeBSD.ORG Wed Oct 16 06:13:09 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 368CA20E; Wed, 16 Oct 2013 06:13:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 229562384; Wed, 16 Oct 2013 06:13:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9G6D9Av003134; Wed, 16 Oct 2013 06:13:09 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9G6D8BS003133; Wed, 16 Oct 2013 06:13:08 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310160613.r9G6D8BS003133@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 16 Oct 2013 06:13:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256590 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Oct 2013 06:13:09 -0000 Author: kib Date: Wed Oct 16 06:13:08 2013 New Revision: 256590 URL: http://svnweb.freebsd.org/changeset/base/256590 Log: MFC r256211: Do not flush buffers when the v_object of the passed vnode does not really belong to it. Modified: stable/9/sys/kern/vfs_subr.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_subr.c ============================================================================== --- stable/9/sys/kern/vfs_subr.c Wed Oct 16 06:07:03 2013 (r256589) +++ stable/9/sys/kern/vfs_subr.c Wed Oct 16 06:13:08 2013 (r256590) @@ -1304,6 +1304,8 @@ vinvalbuf(struct vnode *vp, int flags, i CTR3(KTR_VFS, "%s: vp %p with flags %d", __func__, vp, flags); ASSERT_VOP_LOCKED(vp, "vinvalbuf"); + if (vp->v_object != NULL && vp->v_object->handle != vp) + return (0); return (bufobj_invalbuf(&vp->v_bufobj, flags, slpflag, slptimeo)); } From owner-svn-src-stable@FreeBSD.ORG Wed Oct 16 06:15:41 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 17623469; Wed, 16 Oct 2013 06:15:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0203923A4; Wed, 16 Oct 2013 06:15:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9G6Fekv004435; Wed, 16 Oct 2013 06:15:40 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9G6Fe2X004434; Wed, 16 Oct 2013 06:15:40 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310160615.r9G6Fe2X004434@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 16 Oct 2013 06:15:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256591 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Oct 2013 06:15:41 -0000 Author: kib Date: Wed Oct 16 06:15:40 2013 New Revision: 256591 URL: http://svnweb.freebsd.org/changeset/base/256591 Log: MFC r256213: Do not try to flush device vnodes from the buffer allocation context. Modified: stable/9/sys/kern/vfs_bio.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_bio.c ============================================================================== --- stable/9/sys/kern/vfs_bio.c Wed Oct 16 06:13:08 2013 (r256590) +++ stable/9/sys/kern/vfs_bio.c Wed Oct 16 06:15:40 2013 (r256591) @@ -2108,7 +2108,8 @@ getnewbuf_bufd_help(struct vnode *vp, in td = curthread; mtx_lock(&nblock); while (needsbuffer & flags) { - if (vp != NULL && (td->td_pflags & TDP_BUFNEED) == 0) { + if (vp != NULL && vp->v_type != VCHR && + (td->td_pflags & TDP_BUFNEED) == 0) { mtx_unlock(&nblock); /* * getblk() is called with a vnode locked, and From owner-svn-src-stable@FreeBSD.ORG Wed Oct 16 21:52:55 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7F0CCB51; Wed, 16 Oct 2013 21:52:55 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6BB782D6F; Wed, 16 Oct 2013 21:52:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9GLqtGm000835; Wed, 16 Oct 2013 21:52:55 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9GLqtIG000834; Wed, 16 Oct 2013 21:52:55 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201310162152.r9GLqtIG000834@svn.freebsd.org> From: Neel Natu Date: Wed, 16 Oct 2013 21:52:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256651 - stable/10/sys/amd64/vmm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Oct 2013 21:52:55 -0000 Author: neel Date: Wed Oct 16 21:52:54 2013 New Revision: 256651 URL: http://svnweb.freebsd.org/changeset/base/256651 Log: MFC r256570: Fix the witness warning that warned against calling uiomove() while holding the 'vmmdev_mtx' in vmmdev_rw(). Rely on the 'si_threadcount' accounting to ensure that we never destroy the VM device node while it has operations in progress (e.g. ioctl, mmap etc). Approved by: re (rodrigc) Modified: stable/10/sys/amd64/vmm/vmm_dev.c Directory Properties: stable/10/sys/ (props changed) stable/10/sys/amd64/vmm/ (props changed) Modified: stable/10/sys/amd64/vmm/vmm_dev.c ============================================================================== --- stable/10/sys/amd64/vmm/vmm_dev.c Wed Oct 16 20:04:06 2013 (r256650) +++ stable/10/sys/amd64/vmm/vmm_dev.c Wed Oct 16 21:52:54 2013 (r256651) @@ -60,7 +60,10 @@ struct vmmdev_softc { struct vm *vm; /* vm instance cookie */ struct cdev *cdev; SLIST_ENTRY(vmmdev_softc) link; + int flags; }; +#define VSC_LINKED 0x01 + static SLIST_HEAD(, vmmdev_softc) head; static struct mtx vmmdev_mtx; @@ -104,7 +107,6 @@ vmmdev_rw(struct cdev *cdev, struct uio static char zerobuf[PAGE_SIZE]; error = 0; - mtx_lock(&vmmdev_mtx); sc = vmmdev_lookup2(cdev); if (sc == NULL) error = ENXIO; @@ -134,8 +136,6 @@ vmmdev_rw(struct cdev *cdev, struct uio vm_gpa_release(cookie); } } - - mtx_unlock(&vmmdev_mtx); return (error); } @@ -379,34 +379,28 @@ vmmdev_mmap_single(struct cdev *cdev, vm int error; struct vmmdev_softc *sc; - mtx_lock(&vmmdev_mtx); - sc = vmmdev_lookup2(cdev); if (sc != NULL && (nprot & PROT_EXEC) == 0) error = vm_get_memobj(sc->vm, *offset, size, offset, object); else error = EINVAL; - mtx_unlock(&vmmdev_mtx); - return (error); } static void -vmmdev_destroy(struct vmmdev_softc *sc, boolean_t unlink) +vmmdev_destroy(void *arg) { - /* - * XXX must stop virtual machine instances that may be still - * running and cleanup their state. - */ - if (sc->cdev) + struct vmmdev_softc *sc = arg; + + if (sc->cdev != NULL) destroy_dev(sc->cdev); - if (sc->vm) + if (sc->vm != NULL) vm_destroy(sc->vm); - if (unlink) { + if ((sc->flags & VSC_LINKED) != 0) { mtx_lock(&vmmdev_mtx); SLIST_REMOVE(&head, sc, vmmdev_softc, link); mtx_unlock(&vmmdev_mtx); @@ -421,27 +415,38 @@ sysctl_vmm_destroy(SYSCTL_HANDLER_ARGS) int error; char buf[VM_MAX_NAMELEN]; struct vmmdev_softc *sc; + struct cdev *cdev; strlcpy(buf, "beavis", sizeof(buf)); error = sysctl_handle_string(oidp, buf, sizeof(buf), req); if (error != 0 || req->newptr == NULL) return (error); - /* - * XXX TODO if any process has this device open then fail - */ - mtx_lock(&vmmdev_mtx); sc = vmmdev_lookup(buf); - if (sc == NULL) { + if (sc == NULL || sc->cdev == NULL) { mtx_unlock(&vmmdev_mtx); return (EINVAL); } - sc->cdev->si_drv1 = NULL; + /* + * The 'cdev' will be destroyed asynchronously when 'si_threadcount' + * goes down to 0 so we should not do it again in the callback. + */ + cdev = sc->cdev; + sc->cdev = NULL; mtx_unlock(&vmmdev_mtx); - vmmdev_destroy(sc, TRUE); + /* + * Schedule the 'cdev' to be destroyed: + * + * - any new operations on this 'cdev' will return an error (ENXIO). + * + * - when the 'si_threadcount' dwindles down to zero the 'cdev' will + * be destroyed and the callback will be invoked in a taskqueue + * context. + */ + destroy_dev_sched_cb(cdev, vmmdev_destroy, sc); return (0); } @@ -462,6 +467,7 @@ sysctl_vmm_create(SYSCTL_HANDLER_ARGS) { int error; struct vm *vm; + struct cdev *cdev; struct vmmdev_softc *sc, *sc2; char buf[VM_MAX_NAMELEN]; @@ -489,22 +495,28 @@ sysctl_vmm_create(SYSCTL_HANDLER_ARGS) */ mtx_lock(&vmmdev_mtx); sc2 = vmmdev_lookup(buf); - if (sc2 == NULL) + if (sc2 == NULL) { SLIST_INSERT_HEAD(&head, sc, link); + sc->flags |= VSC_LINKED; + } mtx_unlock(&vmmdev_mtx); if (sc2 != NULL) { - vmmdev_destroy(sc, FALSE); + vmmdev_destroy(sc); return (EEXIST); } - error = make_dev_p(MAKEDEV_CHECKNAME, &sc->cdev, &vmmdevsw, NULL, + error = make_dev_p(MAKEDEV_CHECKNAME, &cdev, &vmmdevsw, NULL, UID_ROOT, GID_WHEEL, 0600, "vmm/%s", buf); if (error != 0) { - vmmdev_destroy(sc, TRUE); + vmmdev_destroy(sc); return (error); } + + mtx_lock(&vmmdev_mtx); + sc->cdev = cdev; sc->cdev->si_drv1 = sc; + mtx_unlock(&vmmdev_mtx); return (0); } From owner-svn-src-stable@FreeBSD.ORG Thu Oct 17 05:44:16 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id F26E19D9; Thu, 17 Oct 2013 05:44:15 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DD3D02349; Thu, 17 Oct 2013 05:44:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9H5iF5t052816; Thu, 17 Oct 2013 05:44:15 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9H5iFv6052815; Thu, 17 Oct 2013 05:44:15 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201310170544.r9H5iFv6052815@svn.freebsd.org> From: Justin Hibbits Date: Thu, 17 Oct 2013 05:44:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256665 - stable/9/sys/powerpc/ofw X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Oct 2013 05:44:16 -0000 Author: jhibbits Date: Thu Oct 17 05:44:15 2013 New Revision: 256665 URL: http://svnweb.freebsd.org/changeset/base/256665 Log: MFC r253588 Increase the size of the OFW bounce buffer to 4 pages. With this I can now run 'ofwdump -ap' on my quad G5. Modified: stable/9/sys/powerpc/ofw/ofw_real.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/powerpc/ofw/ofw_real.c ============================================================================== --- stable/9/sys/powerpc/ofw/ofw_real.c Thu Oct 17 05:43:28 2013 (r256664) +++ stable/9/sys/powerpc/ofw/ofw_real.c Thu Oct 17 05:44:15 2013 (r256665) @@ -211,12 +211,12 @@ ofw_real_bounce_alloc(void *junk) mtx_lock(&of_bounce_mtx); - of_bounce_virt = contigmalloc(PAGE_SIZE, M_OFWREAL, 0, 0, + of_bounce_virt = contigmalloc(4 * PAGE_SIZE, M_OFWREAL, 0, 0, ulmin(platform_real_maxaddr(), BUS_SPACE_MAXADDR_32BIT), PAGE_SIZE, - PAGE_SIZE); + 4 * PAGE_SIZE); of_bounce_phys = vtophys(of_bounce_virt); - of_bounce_size = PAGE_SIZE; + of_bounce_size = 4 * PAGE_SIZE; /* * For virtual-mode OF, direct map this physical address so that From owner-svn-src-stable@FreeBSD.ORG Thu Oct 17 06:14:33 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4FD2C72F; Thu, 17 Oct 2013 06:14:33 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3CEC42532; Thu, 17 Oct 2013 06:14:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9H6EX3I068962; Thu, 17 Oct 2013 06:14:33 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9H6EXLU068961; Thu, 17 Oct 2013 06:14:33 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201310170614.r9H6EXLU068961@svn.freebsd.org> From: Justin Hibbits Date: Thu, 17 Oct 2013 06:14:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256667 - stable/9/sys/powerpc/ofw X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Oct 2013 06:14:33 -0000 Author: jhibbits Date: Thu Oct 17 06:14:32 2013 New Revision: 256667 URL: http://svnweb.freebsd.org/changeset/base/256667 Log: MFC r253979 Micro-optimize OFW syscons 8-bit blank. Modified: stable/9/sys/powerpc/ofw/ofw_syscons.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/powerpc/ofw/ofw_syscons.c ============================================================================== --- stable/9/sys/powerpc/ofw/ofw_syscons.c Thu Oct 17 05:51:54 2013 (r256666) +++ stable/9/sys/powerpc/ofw/ofw_syscons.c Thu Oct 17 06:14:32 2013 (r256667) @@ -586,14 +586,22 @@ ofwfb_blank_display8(video_adapter_t *ad { struct ofwfb_softc *sc; int i; - uint8_t *addr; + uint32_t *addr; + uint32_t color; + uint32_t end; sc = (struct ofwfb_softc *)adp; - addr = (uint8_t *) sc->sc_addr; + addr = (uint32_t *) sc->sc_addr; + end = (sc->sc_stride/4) * sc->sc_height; + + /* Splat 4 pixels at once. */ + color = (ofwfb_background(SC_NORM_ATTR) << 24) | + (ofwfb_background(SC_NORM_ATTR) << 16) | + (ofwfb_background(SC_NORM_ATTR) << 8) | + (ofwfb_background(SC_NORM_ATTR)); - /* Could be done a lot faster e.g. 32-bits, or Altivec'd */ - for (i = 0; i < sc->sc_stride*sc->sc_height; i++) - *(addr + i) = ofwfb_background(SC_NORM_ATTR); + for (i = 0; i < end; i++) + *(addr + i) = color; return (0); } From owner-svn-src-stable@FreeBSD.ORG Thu Oct 17 06:48:44 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4F62C4D7; Thu, 17 Oct 2013 06:48:44 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3BCB426E5; Thu, 17 Oct 2013 06:48:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9H6milX086772; Thu, 17 Oct 2013 06:48:44 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9H6mipU086771; Thu, 17 Oct 2013 06:48:44 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201310170648.r9H6mipU086771@svn.freebsd.org> From: Hiroki Sato Date: Thu, 17 Oct 2013 06:48:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256668 - stable/10/etc/rc.d X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Oct 2013 06:48:44 -0000 Author: hrs Date: Thu Oct 17 06:48:43 2013 New Revision: 256668 URL: http://svnweb.freebsd.org/changeset/base/256668 Log: MFC 256440, 256498: - Normalize jailname. "example.com" is converted to "example_com". - Fix a bug that some $jail_{jname}_foo variables did not work. - Fix a bug which prevented $jail_devfs_ruleset from working[1]. - Move $jail_parameters to the last of the configuraiton lines[1]. - Fix "ifname|addr" syntax support in jail_{jname}_ip. - Create /var/run/jail_{jname}.id because ezjail-admin depends on it. Reported by: jase [1] Approved by: re (gjb) Modified: stable/10/etc/rc.d/jail Directory Properties: stable/10/etc/rc.d/ (props changed) Modified: stable/10/etc/rc.d/jail ============================================================================== --- stable/10/etc/rc.d/jail Thu Oct 17 06:14:32 2013 (r256667) +++ stable/10/etc/rc.d/jail Thu Oct 17 06:48:43 2013 (r256668) @@ -22,7 +22,7 @@ status_cmd="jail_status" extra_commands="config console status" : ${jail_conf:=/etc/jail.conf} : ${jail_program:=/usr/sbin/jail} -: ${jail_consolecmd:=/bin/sh} +: ${jail_consolecmd:=/usr/bin/login -f root} : ${jail_jexec:=/usr/sbin/jexec} : ${jail_jls:=/usr/sbin/jls} @@ -94,7 +94,7 @@ extract_var() # parse_options() { - local _j + local _j _p _j=$1 _confwarn=0 @@ -166,7 +166,7 @@ parse_options() jail_handle_ips_option $_ip $_interface alias=0 while : ; do - eval _x=\"\$jail_${_jail}_ip_multi${alias}\" + eval _x=\"\$jail_${_j}_ip_multi${alias}\" [ -z "$_x" ] && break jail_handle_ips_option $_x $_interface @@ -208,6 +208,7 @@ parse_options() eval : \${jail_${_j}_devfs_enable:=${jail_devfs_enable:-NO}} if checkyesno jail_${_j}_devfs_enable; then echo " mount.devfs;" + eval _ruleset=\${jail_${_j}_devfs_ruleset:-${jail_devfs_ruleset}} case $_ruleset in "") ;; [0-9]*) echo " devfs_ruleset = \"$_ruleset\";" ;; @@ -217,7 +218,7 @@ parse_options() # mount(8) only accepts an integer. # This should accept a ruleset name. ;; - *) warn "devfs_ruleset must be integer." ;; + *) warn "devfs_ruleset must be an integer." ;; esac if [ -r $_fstab ]; then echo " mount.fstab = \"$_fstab\";" @@ -234,8 +235,6 @@ parse_options() "\"procfs ${_rootdir%/}/proc procfs rw 0 0\";" fi - echo " ${_parameters};" - eval : \${jail_${_j}_mount_enable:=${jail_mount_enable:-NO}} if checkyesno jail_${_j}_mount_enable; then echo " allow.mount;" >> $_conf @@ -243,6 +242,9 @@ parse_options() extract_var $_j set_hostname_allow allow.set_hostname YN NO extract_var $_j sysvipc_allow allow.sysvipc YN NO + for _p in $_parameters; do + echo " ${_p%\;};" + done echo "}" ) >> $_conf @@ -327,9 +329,9 @@ jail_extract_address() # jail_handle_ips_option() { - local _x _type _i _iface + local _x _type _i _defif _x=$1 - _iface=$2 + _defif=$2 if [ -z "${_x}" ]; then # No IP given. This can happen for the primary address @@ -353,7 +355,8 @@ jail_handle_ips_option() _type="" _addr="" _mask="" - jail_extract_address $_i $_iface + _iface="" + jail_extract_address $_i $_defif # make sure we got an address. case $_addr in @@ -364,10 +367,10 @@ jail_handle_ips_option() # Append address to list of addresses for the jail command. case $_type in inet) - echo " ip4.addr += \"${_addr}${_mask}\";" + echo " ip4.addr += \"${_iface}|${_addr}${_mask}\";" ;; inet6) - echo " ip6.addr += \"${_addr}${_mask}\";" + echo " ip6.addr += \"${_iface}|${_addr}${_mask}\";" need_dad_wait=1 ;; esac @@ -376,26 +379,35 @@ jail_handle_ips_option() jail_config() { + local _j + case $1 in _ALL) return ;; esac - for _jail in $@; do - if parse_options $_jail; then - echo "$_jail: parameters are in $_conf." + for _j in $@; do + _j=$(echo $_j | tr /. _) + if parse_options $_j; then + echo "$_j: parameters are in $_conf." fi done } jail_console() { + local _j _cmd + # One argument that is not _ALL. case $#:$1 in - 1:_ALL) err 3 "Specify a jail name." ;; - 1:*) ;; - *) err 3 "Specify a jail name." ;; + 0:*|1:_ALL) err 3 "Specify a jail name." ;; + 1:*) ;; + esac + _j=$(echo $1 | tr /. _) + shift + case $# in + 0) eval _cmd=\${jail_${_j}_consolecmd:-$jail_consolecmd} ;; + *) _cmd=$@ ;; esac - eval _cmd=\${jail_$1_consolecmd:-$jail_consolecmd} - $jail_jexec $1 $_cmd + $jail_jexec $_j $_cmd } jail_status() @@ -406,6 +418,8 @@ jail_status() jail_start() { + local _j _jid _jn + if [ $# = 0 ]; then return fi @@ -416,27 +430,39 @@ jail_start() command=$jail_program rc_flags=$jail_flags command_args="-f $jail_conf -c" - $command $rc_flags $command_args "*" + $jail_jls -nq | while read IN; do + _jn=$(echo $IN | tr " " "\n" | grep name=) + _jid=$(echo $IN | tr " " "\n" | grep jid=) + if $command $rc_flags $command_args ${_jn#name=}; then + echo -n " ${_jn#name=}" + echo "${_jid#jid=}" \ + > /var/run/jail_${_jn#name=}.id + fi + done echo '.' return ;; esac _tmp=`mktemp -t jail` || exit 3 - for _jail in $@; do - parse_options $_jail || continue + for _j in $@; do + _j=$(echo $_j | tr /. _) + parse_options $_j || continue eval rc_flags=\${jail_${_j}_flags:-$jail_flags} eval command=\${jail_${_j}_program:-$jail_program} if checkyesno jail_parallel_start; then - command_args="-i -f $_conf -c $_jail &" + command_args="-i -f $_conf -c $_j &" else - command_args="-i -f $_conf -c $_jail" + command_args="-i -f $_conf -c $_j" fi if $command $rc_flags $command_args \ >> $_tmp 2>&1 /var/run/jail_${_j}.id else - echo " cannot start jail \"${_hostname:-${jail}}\": " + rm -f /var/run/jail_${_j}.id + echo " cannot start jail \"${_hostname:-${_j}}\": " cat $_tmp fi rm -f $_tmp @@ -446,6 +472,8 @@ jail_start() jail_stop() { + local _j _jn + if [ $# = 0 ]; then return fi @@ -456,16 +484,29 @@ jail_stop() command=$jail_program rc_flags=$jail_flags command_args="-f $jail_conf -r" - $command $rc_flags $command_args "*" + $jail_jls -nq | while read IN; do + _jn=$(echo $IN | tr " " "\n" | grep name=) + echo -n " ${_jn#name=}" + $command $rc_flags $command_args ${_jn#name=} + if ! $jail_jls -j ${_jn#name=} > /dev/null 2>&1; then + rm -f /var/run/jail_${_jn#name=}.id + fi + done echo '.' return ;; esac - for _jail in $@; do - parse_options $_jail || continue + for _j in $@; do + _j=$(echo $_j | tr /. _) + parse_options $_j || continue + if ! $jail_jls -j $_j > /dev/null 2>&1; then + continue + fi eval command=\${jail_${_j}_program:-$jail_program} - if $command -q -f $_conf -r $_jail; then - echo -n " ${_hostname:-${_jail}}" + echo -n " ${_hostname:-${_j}}" + $command -q -f $_conf -r $_j + if ! $jail_jls -j $_j > /dev/null 2>&1; then + rm -f /var/run/jail_${_j}.id fi done echo '.' From owner-svn-src-stable@FreeBSD.ORG Thu Oct 17 14:08:47 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6BB30718; Thu, 17 Oct 2013 14:08:47 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 582CC2331; Thu, 17 Oct 2013 14:08:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9HE8lEq020160; Thu, 17 Oct 2013 14:08:47 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9HE8lu4020159; Thu, 17 Oct 2013 14:08:47 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201310171408.r9HE8lu4020159@svn.freebsd.org> From: Alfred Perlstein Date: Thu, 17 Oct 2013 14:08:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256686 - stable/10/sys/ofed/include/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Oct 2013 14:08:47 -0000 Author: alfred Date: Thu Oct 17 14:08:46 2013 New Revision: 256686 URL: http://svnweb.freebsd.org/changeset/base/256686 Log: Fix __free_pages() in the linux shim. __free_pages() is actaully supposed to take a "struct page *" not an address. MFC: 256546 Approved by: re Modified: stable/10/sys/ofed/include/linux/gfp.h Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/ofed/include/linux/gfp.h ============================================================================== --- stable/10/sys/ofed/include/linux/gfp.h Thu Oct 17 13:28:57 2013 (r256685) +++ stable/10/sys/ofed/include/linux/gfp.h Thu Oct 17 14:08:46 2013 (r256686) @@ -92,14 +92,14 @@ __free_page(struct page *m) } static inline void -__free_pages(void *p, unsigned int order) +__free_pages(struct page *m, unsigned int order) { size_t size; - if (p == 0) + if (m == NULL) return; size = PAGE_SIZE << order; - kmem_free(kmem_arena, (vm_offset_t)p, size); + kmem_free(kmem_arena, (vm_offset_t)page_address(m), size); } /* From owner-svn-src-stable@FreeBSD.ORG Fri Oct 18 07:42:51 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2DE88ACA; Fri, 18 Oct 2013 07:42:51 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1B2182742; Fri, 18 Oct 2013 07:42:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9I7go9C083982; Fri, 18 Oct 2013 07:42:50 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9I7goZv083981; Fri, 18 Oct 2013 07:42:50 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201310180742.r9I7goZv083981@svn.freebsd.org> From: Devin Teske Date: Fri, 18 Oct 2013 07:42:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256719 - in stable/10/usr.sbin/bsdinstall: . scripts X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Oct 2013 07:42:51 -0000 Author: dteske Date: Fri Oct 18 07:42:50 2013 New Revision: 256719 URL: http://svnweb.freebsd.org/changeset/base/256719 Log: MFC r256489: Add executable bit to docsinstall [old] and entropy [new] scripts. MFC r256541: Document BSDINSTALL_TMPBOOT environment variable introduced by SVN r256343. Approved by: re (gjb) Modified: stable/10/usr.sbin/bsdinstall/bsdinstall.8 Directory Properties: stable/10/usr.sbin/bsdinstall/ (props changed) stable/10/usr.sbin/bsdinstall/scripts/docsinstall (props changed) stable/10/usr.sbin/bsdinstall/scripts/entropy (props changed) Modified: stable/10/usr.sbin/bsdinstall/bsdinstall.8 ============================================================================== --- stable/10/usr.sbin/bsdinstall/bsdinstall.8 Fri Oct 18 07:42:16 2013 (r256718) +++ stable/10/usr.sbin/bsdinstall/bsdinstall.8 Fri Oct 18 07:42:50 2013 (r256719) @@ -254,6 +254,14 @@ will be stored until the target is executed. If this directory does not already exist, it will be created. Default: .Pa /tmp/bsdinstall_etc +.It Ev BSDINSTALL_TMPBOOT +Directory where files destined for the new system's +.Pa /boot +will be stored until the +.Cm config +target is executed. If this directory does not already exist, it will be +created. Default: +.Pa /tmp/bsdinstall_boot .El .Sh SCRIPTING .Nm From owner-svn-src-stable@FreeBSD.ORG Fri Oct 18 09:50:23 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id EDD7C4CE; Fri, 18 Oct 2013 09:50:23 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DAF3C20D8; Fri, 18 Oct 2013 09:50:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9I9oN4S050059; Fri, 18 Oct 2013 09:50:23 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9I9oNxj050058; Fri, 18 Oct 2013 09:50:23 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201310180950.r9I9oNxj050058@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 18 Oct 2013 09:50:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256728 - stable/9/bin/pkill X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Oct 2013 09:50:24 -0000 Author: trasz Date: Fri Oct 18 09:50:23 2013 New Revision: 256728 URL: http://svnweb.freebsd.org/changeset/base/256728 Log: MFC r256050: Remove useless check - ki_loginclass is an array; can't be NULL. Modified: stable/9/bin/pkill/pkill.c Directory Properties: stable/9/bin/pkill/ (props changed) Modified: stable/9/bin/pkill/pkill.c ============================================================================== --- stable/9/bin/pkill/pkill.c Fri Oct 18 09:32:16 2013 (r256727) +++ stable/9/bin/pkill/pkill.c Fri Oct 18 09:50:23 2013 (r256728) @@ -481,7 +481,6 @@ main(int argc, char **argv) * We skip P_SYSTEM processes to match ps(1) output. */ if ((kp->ki_flag & P_SYSTEM) == 0 && - kp->ki_loginclass != NULL && strcmp(kp->ki_loginclass, li->li_name) == 0) break; } From owner-svn-src-stable@FreeBSD.ORG Fri Oct 18 17:08:23 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C2094B7; Fri, 18 Oct 2013 17:08:23 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AE3A821A2; Fri, 18 Oct 2013 17:08:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9IH8NDR084862; Fri, 18 Oct 2013 17:08:23 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9IH8Nt1084861; Fri, 18 Oct 2013 17:08:23 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201310181708.r9IH8Nt1084861@svn.freebsd.org> From: Dimitry Andric Date: Fri, 18 Oct 2013 17:08:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256747 - stable/10/sys/xen X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Oct 2013 17:08:23 -0000 Author: dim Date: Fri Oct 18 17:08:23 2013 New Revision: 256747 URL: http://svnweb.freebsd.org/changeset/base/256747 Log: MFC r256746: Remove redundant redeclaration of gdtset in sys/xen/xen-os.h, to silence a gcc warning. Approved by: re (glebius) Modified: stable/10/sys/xen/xen-os.h Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/xen/xen-os.h ============================================================================== --- stable/10/sys/xen/xen-os.h Fri Oct 18 17:06:13 2013 (r256746) +++ stable/10/sys/xen/xen-os.h Fri Oct 18 17:08:23 2013 (r256747) @@ -50,8 +50,6 @@ /* Force a proper event-channel callback from Xen. */ void force_evtchn_callback(void); -extern int gdtset; - extern shared_info_t *HYPERVISOR_shared_info; enum xen_domain_type { From owner-svn-src-stable@FreeBSD.ORG Fri Oct 18 21:42:48 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 633FB416; Fri, 18 Oct 2013 21:42:48 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 50D10202A; Fri, 18 Oct 2013 21:42:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9ILgm4X032688; Fri, 18 Oct 2013 21:42:48 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9ILgmTP032687; Fri, 18 Oct 2013 21:42:48 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201310182142.r9ILgmTP032687@svn.freebsd.org> From: Peter Grehan Date: Fri, 18 Oct 2013 21:42:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256754 - stable/10/usr.sbin/bhyve X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Oct 2013 21:42:48 -0000 Author: grehan Date: Fri Oct 18 21:42:47 2013 New Revision: 256754 URL: http://svnweb.freebsd.org/changeset/base/256754 Log: MFC r256709: Eliminate unconditional debug printfs. Linux writes to these nominally read-only registers, so avoid having bhyve write warning messages to stdout when the reg writes can be safely ignored. Change the WPRINTF to DPRINTF which is conditional. Approved by: re (gjb) Modified: stable/10/usr.sbin/bhyve/pci_ahci.c Directory Properties: stable/10/usr.sbin/bhyve/ (props changed) Modified: stable/10/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_ahci.c Fri Oct 18 20:52:42 2013 (r256753) +++ stable/10/usr.sbin/bhyve/pci_ahci.c Fri Oct 18 21:42:47 2013 (r256754) @@ -1543,7 +1543,7 @@ pci_ahci_host_write(struct pci_ahci_soft case AHCI_PI: case AHCI_VS: case AHCI_CAP2: - WPRINTF("pci_ahci_host: read only registers 0x%"PRIx64"\n", offset); + DPRINTF("pci_ahci_host: read only registers 0x%"PRIx64"\n", offset); break; case AHCI_GHC: if (value & AHCI_GHC_HR) From owner-svn-src-stable@FreeBSD.ORG Fri Oct 18 22:05:19 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0E2169A9; Fri, 18 Oct 2013 22:05:19 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ED6F5218A; Fri, 18 Oct 2013 22:05:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9IM5I4R044759; Fri, 18 Oct 2013 22:05:18 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9IM5H1x044748; Fri, 18 Oct 2013 22:05:17 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201310182205.r9IM5H1x044748@svn.freebsd.org> From: Peter Grehan Date: Fri, 18 Oct 2013 22:05:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256755 - stable/10/usr.sbin/bhyve X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Oct 2013 22:05:19 -0000 Author: grehan Date: Fri Oct 18 22:05:17 2013 New Revision: 256755 URL: http://svnweb.freebsd.org/changeset/base/256755 Log: MFC r256709: Eliminate unconditional debug printfs. Linux writes to these nominally read-only registers, so avoid having bhyve write warning messages to stdout when the reg writes can be safely ignored. Change the WPRINTF to DPRINTF which is conditional. Approved by: re (delphij) Modified: stable/10/usr.sbin/bhyve/bhyverun.c stable/10/usr.sbin/bhyve/bhyverun.h stable/10/usr.sbin/bhyve/mptbl.c stable/10/usr.sbin/bhyve/pci_hostbridge.c stable/10/usr.sbin/bhyve/pci_virtio_block.c stable/10/usr.sbin/bhyve/pci_virtio_net.c stable/10/usr.sbin/bhyve/rtc.c Directory Properties: stable/10/usr.sbin/bhyve/ (props changed) Modified: stable/10/usr.sbin/bhyve/bhyverun.c ============================================================================== --- stable/10/usr.sbin/bhyve/bhyverun.c Fri Oct 18 21:42:47 2013 (r256754) +++ stable/10/usr.sbin/bhyve/bhyverun.c Fri Oct 18 22:05:17 2013 (r256755) @@ -81,6 +81,7 @@ int guest_ncpus; static int pincpu = -1; static int guest_vmexit_on_hlt, guest_vmexit_on_pause, disable_x2apic; +static int virtio_msix = 1; static int foundcpus; @@ -120,7 +121,7 @@ usage(int code) { fprintf(stderr, - "Usage: %s [-aehAHIP][-g ][-s ][-S ]" + "Usage: %s [-aehAHIPW][-g ][-s ][-S ]" "[-c vcpus][-p pincpu][-m mem]" " \n" " -a: local apic is in XAPIC mode (default is X2APIC)\n" @@ -131,6 +132,7 @@ usage(int code) " -H: vmexit from the guest on hlt\n" " -I: present an ioapic to the guest\n" " -P: vmexit from the guest on pause\n" + " -W: force virtio to use single-vector MSI\n" " -e: exit on unhandled i/o access\n" " -h: help\n" " -s: PCI slot config\n" @@ -169,6 +171,13 @@ fbsdrun_vmexit_on_hlt(void) return (guest_vmexit_on_hlt); } +int +fbsdrun_virtio_msix(void) +{ + + return (virtio_msix); +} + static void * fbsdrun_start_thread(void *param) { @@ -500,7 +509,7 @@ main(int argc, char *argv[]) ioapic = 0; memsize = 256 * MB; - while ((c = getopt(argc, argv, "abehAHIPp:g:c:s:S:m:")) != -1) { + while ((c = getopt(argc, argv, "abehAHIPWp:g:c:s:S:m:")) != -1) { switch (c) { case 'a': disable_x2apic = 1; @@ -547,6 +556,9 @@ main(int argc, char *argv[]) case 'e': strictio = 1; break; + case 'W': + virtio_msix = 0; + break; case 'h': usage(0); default: Modified: stable/10/usr.sbin/bhyve/bhyverun.h ============================================================================== --- stable/10/usr.sbin/bhyve/bhyverun.h Fri Oct 18 21:42:47 2013 (r256754) +++ stable/10/usr.sbin/bhyve/bhyverun.h Fri Oct 18 22:05:17 2013 (r256755) @@ -46,4 +46,5 @@ int fbsdrun_muxed(void); int fbsdrun_vmexit_on_hlt(void); int fbsdrun_vmexit_on_pause(void); int fbsdrun_disable_x2apic(void); +int fbsdrun_virtio_msix(void); #endif Modified: stable/10/usr.sbin/bhyve/mptbl.c ============================================================================== --- stable/10/usr.sbin/bhyve/mptbl.c Fri Oct 18 21:42:47 2013 (r256754) +++ stable/10/usr.sbin/bhyve/mptbl.c Fri Oct 18 22:05:17 2013 (r256755) @@ -71,6 +71,9 @@ __FBSDID("$FreeBSD$"); #define MPEP_FEATURES (0xBFEBFBFF) /* XXX Intel i7 */ +/* Number of i/o intr entries */ +#define MPEII_MAX_IRQ 16 + /* Define processor entry struct since gets it wrong */ typedef struct BPROCENTRY { u_char type; @@ -155,14 +158,14 @@ mpt_build_bus_entries(bus_entry_ptr mpeb memset(mpeb, 0, sizeof(*mpeb)); mpeb->type = MPCT_ENTRY_BUS; - mpeb->bus_id = ISA; - memcpy(mpeb->bus_type, MPE_BUSNAME_ISA, MPE_BUSNAME_LEN); + mpeb->bus_id = 0; + memcpy(mpeb->bus_type, MPE_BUSNAME_PCI, MPE_BUSNAME_LEN); mpeb++; memset(mpeb, 0, sizeof(*mpeb)); mpeb->type = MPCT_ENTRY_BUS; - mpeb->bus_id = PCI; - memcpy(mpeb->bus_type, MPE_BUSNAME_PCI, MPE_BUSNAME_LEN); + mpeb->bus_id = 1; + memcpy(mpeb->bus_type, MPE_BUSNAME_ISA, MPE_BUSNAME_LEN); } static void @@ -177,9 +180,8 @@ mpt_build_ioapic_entries(io_apic_entry_p mpei->apic_address = IOAPIC_PADDR; } -#ifdef notyet static void -mpt_build_ioint_entries(struct mpe_ioint *mpeii, int num_pins, int id) +mpt_build_ioint_entries(int_entry_ptr mpie, int num_pins, int id) { int pin; @@ -189,28 +191,27 @@ mpt_build_ioint_entries(struct mpe_ioint * just use the default config, tweek later if needed. */ - /* Run through all 16 pins. */ for (pin = 0; pin < num_pins; pin++) { - memset(mpeii, 0, sizeof(*mpeii)); - mpeii->entry_type = MP_ENTRY_IOINT; - mpeii->src_bus_id = MPE_BUSID_ISA; - mpeii->dst_apic_id = id; + memset(mpie, 0, sizeof(*mpie)); + mpie->type = MPCT_ENTRY_INT; + mpie->src_bus_id = 1; + mpie->dst_apic_id = id; /* * All default configs route IRQs from bus 0 to the first 16 * pins of the first I/O APIC with an APIC ID of 2. */ - mpeii->dst_apic_intin = pin; + mpie->dst_apic_int = pin; switch (pin) { case 0: /* Pin 0 is an ExtINT pin. */ - mpeii->intr_type = MPEII_INTR_EXTINT; + mpie->int_type = INTENTRY_TYPE_EXTINT; break; case 2: /* IRQ 0 is routed to pin 2. */ - mpeii->intr_type = MPEII_INTR_INT; - mpeii->src_bus_irq = 0; + mpie->int_type = INTENTRY_TYPE_INT; + mpie->src_bus_irq = 0; break; case 5: case 10: @@ -218,118 +219,20 @@ mpt_build_ioint_entries(struct mpe_ioint /* * PCI Irqs set to level triggered. */ - mpeii->intr_flags = MPEII_FLAGS_TRIGMODE_LEVEL; - mpeii->src_bus_id = MPE_BUSID_PCI; + mpie->int_flags = INTENTRY_FLAGS_TRIGGER_LEVEL; + mpie->src_bus_id = 0; + /* fall through.. */ default: /* All other pins are identity mapped. */ - mpeii->intr_type = MPEII_INTR_INT; - mpeii->src_bus_irq = pin; + mpie->int_type = INTENTRY_TYPE_INT; + mpie->src_bus_irq = pin; break; } - mpeii++; + mpie++; } } -#define COPYSTR(dest, src, bytes) \ - memcpy(dest, src, bytes); \ - str[bytes] = 0; - -static void -mptable_dump(struct mp_floating_pointer *mpfp, struct mp_config_hdr *mpch) -{ - static char str[16]; - int i; - char *cur; - - union mpe { - struct mpe_proc *proc; - struct mpe_bus *bus; - struct mpe_ioapic *ioapic; - struct mpe_ioint *ioint; - struct mpe_lint *lnit; - char *p; - }; - - union mpe mpe; - - printf(" MP Floating Pointer :\n"); - COPYSTR(str, mpfp->signature, 4); - printf("\tsignature:\t%s\n", str); - printf("\tmpch paddr:\t%x\n", mpfp->mptable_paddr); - printf("\tlength:\t%x\n", mpfp->length); - printf("\tspecrec:\t%x\n", mpfp->specrev); - printf("\tchecksum:\t%x\n", mpfp->checksum); - printf("\tfeature1:\t%x\n", mpfp->feature1); - printf("\tfeature2:\t%x\n", mpfp->feature2); - printf("\tfeature3:\t%x\n", mpfp->feature3); - printf("\tfeature4:\t%x\n", mpfp->feature4); - - printf(" MP Configuration Header :\n"); - COPYSTR(str, mpch->signature, 4); - printf(" signature: %s\n", str); - printf(" length: %x\n", mpch->length); - printf(" specrec: %x\n", mpch->specrev); - printf(" checksum: %x\n", mpch->checksum); - COPYSTR(str, mpch->oemid, MPCH_OEMID_LEN); - printf(" oemid: %s\n", str); - COPYSTR(str, mpch->prodid, MPCH_PRODID_LEN); - printf(" prodid: %s\n", str); - printf(" oem_ptr: %x\n", mpch->oem_ptr); - printf(" oem_sz: %x\n", mpch->oem_sz); - printf(" nr_entries: %x\n", mpch->nr_entries); - printf(" apic paddr: %x\n", mpch->lapic_paddr); - printf(" ext_length: %x\n", mpch->ext_length); - printf(" ext_checksum: %x\n", mpch->ext_checksum); - - cur = (char *)mpch + sizeof(*mpch); - for (i = 0; i < mpch->nr_entries; i++) { - mpe.p = cur; - switch(*mpe.p) { - case MP_ENTRY_PROC: - printf(" MP Processor Entry :\n"); - printf(" lapic_id: %x\n", mpe.proc->lapic_id); - printf(" lapic_version: %x\n", mpe.proc->lapic_version); - printf(" proc_flags: %x\n", mpe.proc->proc_flags); - printf(" proc_signature: %x\n", mpe.proc->proc_signature); - printf(" feature_flags: %x\n", mpe.proc->feature_flags); - cur += sizeof(struct mpe_proc); - break; - case MP_ENTRY_BUS: - printf(" MP Bus Entry :\n"); - printf(" busid: %x\n", mpe.bus->busid); - COPYSTR(str, mpe.bus->busname, MPE_BUSNAME_LEN); - printf(" busname: %s\n", str); - cur += sizeof(struct mpe_bus); - break; - case MP_ENTRY_IOAPIC: - printf(" MP IOAPIC Entry :\n"); - printf(" ioapi_id: %x\n", mpe.ioapic->ioapic_id); - printf(" ioapi_version: %x\n", mpe.ioapic->ioapic_version); - printf(" ioapi_flags: %x\n", mpe.ioapic->ioapic_flags); - printf(" ioapi_paddr: %x\n", mpe.ioapic->ioapic_paddr); - cur += sizeof(struct mpe_ioapic); - break; - case MP_ENTRY_IOINT: - printf(" MP IO Interrupt Entry :\n"); - printf(" intr_type: %x\n", mpe.ioint->intr_type); - printf(" intr_flags: %x\n", mpe.ioint->intr_flags); - printf(" src_bus_id: %x\n", mpe.ioint->src_bus_id); - printf(" src_bus_irq: %x\n", mpe.ioint->src_bus_irq); - printf(" dst_apic_id: %x\n", mpe.ioint->dst_apic_id); - printf(" dst_apic_intin: %x\n", mpe.ioint->dst_apic_intin); - cur += sizeof(struct mpe_ioint); - break; - case MP_ENTRY_LINT: - printf(" MP Local Interrupt Entry :\n"); - cur += sizeof(struct mpe_lint); - break; - } - - } -} -#endif - void mptable_add_oemtbl(void *tbl, int tblsz) { @@ -346,6 +249,7 @@ mptable_build(struct vmctx *ctx, int ncp io_apic_entry_ptr mpei; bproc_entry_ptr mpep; mpfps_t mpfp; + int_entry_ptr mpie; char *curraddr; char *startaddr; @@ -381,12 +285,10 @@ mptable_build(struct vmctx *ctx, int ncp mpch->entry_count++; } -#ifdef notyet - mpt_build_ioint_entries((struct mpe_ioint*)curraddr, MPEII_MAX_IRQ, - ncpu + 1); - curraddr += sizeof(struct mpe_ioint) * MPEII_MAX_IRQ; + mpie = (int_entry_ptr) curraddr; + mpt_build_ioint_entries(mpie, MPEII_MAX_IRQ, ncpu + 1); + curraddr += sizeof(*mpie) * MPEII_MAX_IRQ; mpch->entry_count += MPEII_MAX_IRQ; -#endif if (oem_tbl_start) { mpch->oem_table_pointer = curraddr - startaddr + MPTABLE_BASE; Modified: stable/10/usr.sbin/bhyve/pci_hostbridge.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_hostbridge.c Fri Oct 18 21:42:47 2013 (r256754) +++ stable/10/usr.sbin/bhyve/pci_hostbridge.c Fri Oct 18 22:05:17 2013 (r256755) @@ -47,6 +47,22 @@ pci_hostbridge_init(struct vmctx *ctx, s return (0); } +static int +pci_amd_hostbridge_init(struct vmctx *ctx, struct pci_devinst *pi, char *opts) +{ + (void) pci_hostbridge_init(ctx, pi, opts); + pci_set_cfgdata16(pi, PCIR_VENDOR, 0x1022); /* AMD */ + pci_set_cfgdata16(pi, PCIR_DEVICE, 0x7432); /* made up */ + + return (0); +} + +struct pci_devemu pci_de_amd_hostbridge = { + .pe_emu = "amd_hostbridge", + .pe_init = pci_amd_hostbridge_init, +}; +PCI_EMUL_SET(pci_de_amd_hostbridge); + struct pci_devemu pci_de_hostbridge = { .pe_emu = "hostbridge", .pe_init = pci_hostbridge_init, Modified: stable/10/usr.sbin/bhyve/pci_virtio_block.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_virtio_block.c Fri Oct 18 21:42:47 2013 (r256754) +++ stable/10/usr.sbin/bhyve/pci_virtio_block.c Fri Oct 18 22:05:17 2013 (r256755) @@ -256,8 +256,6 @@ pci_vtblk_init(struct vmctx *ctx, struct off_t size; int fd; int sectsz; - int use_msix; - const char *env_msi; if (opts == NULL) { printf("virtio-block: backing device required\n"); @@ -336,12 +334,7 @@ pci_vtblk_init(struct vmctx *ctx, struct pci_set_cfgdata8(pi, PCIR_CLASS, PCIC_STORAGE); pci_set_cfgdata16(pi, PCIR_SUBDEV_0, VIRTIO_TYPE_BLOCK); - use_msix = 1; - if ((env_msi = getenv("BHYVE_USE_MSI"))) { - if (strcasecmp(env_msi, "yes") == 0) - use_msix = 0; - } - if (vi_intr_init(&sc->vbsc_vs, 1, use_msix)) + if (vi_intr_init(&sc->vbsc_vs, 1, fbsdrun_virtio_msix())) return (1); vi_set_io_bar(&sc->vbsc_vs, 0); return (0); Modified: stable/10/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_virtio_net.c Fri Oct 18 21:42:47 2013 (r256754) +++ stable/10/usr.sbin/bhyve/pci_virtio_net.c Fri Oct 18 22:05:17 2013 (r256755) @@ -509,11 +509,9 @@ pci_vtnet_init(struct vmctx *ctx, struct char nstr[80]; char tname[MAXCOMLEN + 1]; struct pci_vtnet_softc *sc; - const char *env_msi; char *devname; char *vtopts; int mac_provided; - int use_msix; sc = malloc(sizeof(struct pci_vtnet_softc)); memset(sc, 0, sizeof(struct pci_vtnet_softc)); @@ -531,15 +529,6 @@ pci_vtnet_init(struct vmctx *ctx, struct #endif /* - * Use MSI if set by user - */ - use_msix = 1; - if ((env_msi = getenv("BHYVE_USE_MSI")) != NULL) { - if (strcasecmp(env_msi, "yes") == 0) - use_msix = 0; - } - - /* * Attempt to open the tap device and read the MAC address * if specified */ @@ -623,7 +612,7 @@ pci_vtnet_init(struct vmctx *ctx, struct sc->vsc_config.status = 1; /* use BAR 1 to map MSI-X table and PBA, if we're using MSI-X */ - if (vi_intr_init(&sc->vsc_vs, 1, use_msix)) + if (vi_intr_init(&sc->vsc_vs, 1, fbsdrun_virtio_msix())) return (1); /* use BAR 0 to map config regs in IO space */ Modified: stable/10/usr.sbin/bhyve/rtc.c ============================================================================== --- stable/10/usr.sbin/bhyve/rtc.c Fri Oct 18 21:42:47 2013 (r256754) +++ stable/10/usr.sbin/bhyve/rtc.c Fri Oct 18 22:05:17 2013 (r256755) @@ -331,7 +331,7 @@ rtc_init(struct vmctx *ctx) memset(rtc_nvram, 0, sizeof(rtc_nvram)); - rtc_nvram[nvoff(RTC_CENTURY)] = rtcout(tm.tm_year / 100); + rtc_nvram[nvoff(RTC_CENTURY)] = bin2bcd((tm.tm_year + 1900) / 100); /* XXX init diag/reset code/equipment/checksum ? */ From owner-svn-src-stable@FreeBSD.ORG Fri Oct 18 22:48:38 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D3592797; Fri, 18 Oct 2013 22:48:38 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A488523F8; Fri, 18 Oct 2013 22:48:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9IMmcC4068195; Fri, 18 Oct 2013 22:48:38 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9IMmceh068194; Fri, 18 Oct 2013 22:48:38 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201310182248.r9IMmceh068194@svn.freebsd.org> From: "Justin T. Gibbs" Date: Fri, 18 Oct 2013 22:48:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256757 - stable/10/sys/dev/xen/blkfront X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Oct 2013 22:48:38 -0000 Author: gibbs Date: Fri Oct 18 22:48:38 2013 New Revision: 256757 URL: http://svnweb.freebsd.org/changeset/base/256757 Log: MFC: r256425 Centralize the detection logic for the Hyper-V hypervisor. Submitted by: Roger Pau MonnĂ© Sponsored by: Citrix Systems R&D Reviewed by: gibbs, grehan Approved by: re (gjb) sys/sys/systm.h: * Add a new VM_GUEST type, VM_GUEST_HV (HyperV guest). sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c: sys/dev/hyperv/vmbus/hv_hv.c: sys/dev/hyperv/stordisengage/hv_ata_pci_disengage.c: * Set vm_guest to VM_GUEST_HV and use that on other HyperV related devices instead of cloning the cpuid hypervisor check. * Cleanup the vmbus_identify function. Modified: stable/10/sys/dev/xen/blkfront/blkfront.c Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- stable/10/sys/dev/xen/blkfront/blkfront.c Fri Oct 18 22:47:10 2013 (r256756) +++ stable/10/sys/dev/xen/blkfront/blkfront.c Fri Oct 18 22:48:38 2013 (r256757) @@ -1381,14 +1381,42 @@ xbd_closing(device_t dev) static int xbd_probe(device_t dev) { + if (strcmp(xenbus_get_type(dev), "vbd") != 0) + return (ENXIO); - if (!strcmp(xenbus_get_type(dev), "vbd")) { - device_set_desc(dev, "Virtual Block Device"); - device_quiet(dev); - return (0); + if (xen_hvm_domain()) { + int error; + char *type; + + /* + * When running in an HVM domain, IDE disk emulation is + * disabled early in boot so that native drivers will + * not see emulated hardware. However, CDROM device + * emulation cannot be disabled. + * + * Through use of FreeBSD's vm_guest and xen_hvm_domain() + * APIs, we could modify the native CDROM driver to fail its + * probe when running under Xen. Unfortunatlely, the PV + * CDROM support in XenServer (up through at least version + * 6.2) isn't functional, so we instead rely on the emulated + * CDROM instance, and fail to attach the PV one here in + * the blkfront driver. + */ + error = xs_read(XST_NIL, xenbus_get_node(dev), + "device-type", NULL, (void **) &type); + if (error) + return (ENXIO); + + if (strncmp(type, "cdrom", 5) == 0) { + free(type, M_XENSTORE); + return (ENXIO); + } + free(type, M_XENSTORE); } - return (ENXIO); + device_set_desc(dev, "Virtual Block Device"); + device_quiet(dev); + return (0); } /* From owner-svn-src-stable@FreeBSD.ORG Fri Oct 18 23:19:29 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2F2B9349; Fri, 18 Oct 2013 23:19:29 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0C8222590; Fri, 18 Oct 2013 23:19:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9INJSUL085736; Fri, 18 Oct 2013 23:19:28 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9INJSdH085731; Fri, 18 Oct 2013 23:19:28 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201310182319.r9INJSdH085731@svn.freebsd.org> From: "Justin T. Gibbs" Date: Fri, 18 Oct 2013 23:19:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256758 - in stable/10/sys: dev/hyperv/stordisengage dev/hyperv/vmbus sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Oct 2013 23:19:29 -0000 Author: gibbs Date: Fri Oct 18 23:19:27 2013 New Revision: 256758 URL: http://svnweb.freebsd.org/changeset/base/256758 Log: MFC r256425: Centralize the detection logic for the Hyper-V hypervisor. Submitted by: Roger Pau MonnĂ© Sponsored by: Citrix Systems R&D Reviewed by: gibbs, grehan Approved by: re (gjb) sys/sys/systm.h: * Add a new VM_GUEST type, VM_GUEST_HV (HyperV guest). sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c: sys/dev/hyperv/vmbus/hv_hv.c: sys/dev/hyperv/stordisengage/hv_ata_pci_disengage.c: * Set vm_guest to VM_GUEST_HV and use that on other HyperV related devices instead of cloning the cpuid hypervisor check. * Cleanup the vmbus_identify function. ------------------------------------------------------------------------ Modified: stable/10/sys/dev/hyperv/stordisengage/hv_ata_pci_disengage.c stable/10/sys/dev/hyperv/vmbus/hv_hv.c stable/10/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c stable/10/sys/sys/systm.h Directory Properties: stable/10/sys/ (props changed) stable/10/sys/dev/hyperv/ (props changed) Modified: stable/10/sys/dev/hyperv/stordisengage/hv_ata_pci_disengage.c ============================================================================== --- stable/10/sys/dev/hyperv/stordisengage/hv_ata_pci_disengage.c Fri Oct 18 22:48:38 2013 (r256757) +++ stable/10/sys/dev/hyperv/stordisengage/hv_ata_pci_disengage.c Fri Oct 18 23:19:27 2013 (r256758) @@ -75,17 +75,11 @@ __FBSDID("$FreeBSD$"); #include #include -#define HV_X64_MSR_GUEST_OS_ID 0x40000000 -#define HV_X64_CPUID_MIN 0x40000005 -#define HV_X64_CPUID_MAX 0x4000ffff - /* prototypes */ static int hv_ata_pci_probe(device_t dev); static int hv_ata_pci_attach(device_t dev); static int hv_ata_pci_detach(device_t dev); -static int hv_check_for_hyper_v(void); - /* * generic PCI ATA device probe */ @@ -100,7 +94,7 @@ hv_ata_pci_probe(device_t dev) /* * Don't probe if not running in a Hyper-V environment */ - if (!hv_check_for_hyper_v()) + if (vm_guest != VM_GUEST_HV) return (ENXIO); if (device_get_unit(parent) != 0 || device_get_ivars(dev) != 0) @@ -139,33 +133,6 @@ hv_ata_pci_detach(device_t dev) return (0); } -/** -* Detect Hyper-V and enable fast IDE -* via enlighted storage driver -*/ -static int -hv_check_for_hyper_v(void) -{ - u_int regs[4]; - int hyper_v_detected; - - hyper_v_detected = 0; - do_cpuid(1, regs); - if (regs[2] & 0x80000000) { - /* - * if(a hypervisor is detected) - * make sure this really is Hyper-V - */ - do_cpuid(HV_X64_MSR_GUEST_OS_ID, regs); - hyper_v_detected = - regs[0] >= HV_X64_CPUID_MIN && - regs[0] <= HV_X64_CPUID_MAX && - !memcmp("Microsoft Hv", ®s[1], 12); - } - - return (hyper_v_detected); -} - static device_method_t hv_ata_pci_methods[] = { /* device interface */ DEVMETHOD(device_probe, hv_ata_pci_probe), Modified: stable/10/sys/dev/hyperv/vmbus/hv_hv.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/hv_hv.c Fri Oct 18 22:48:38 2013 (r256757) +++ stable/10/sys/dev/hyperv/vmbus/hv_hv.c Fri Oct 18 23:19:27 2013 (r256758) @@ -218,7 +218,7 @@ hv_vmbus_init(void) 0, sizeof(hv_vmbus_handle) * MAXCPU); - if (!hv_vmbus_query_hypervisor_presence()) + if (vm_guest != VM_GUEST_HV) goto cleanup; max_leaf = hv_vmbus_get_hypervisor_version(); Modified: stable/10/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Fri Oct 18 22:48:38 2013 (r256757) +++ stable/10/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Fri Oct 18 23:19:27 2013 (r256758) @@ -295,11 +295,15 @@ hv_vmbus_child_device_unregister(struct return(ret); } -static void vmbus_identify(driver_t *driver, device_t parent) { +static void +vmbus_identify(driver_t *driver, device_t parent) +{ + if (!hv_vmbus_query_hypervisor_presence()) + return; + + vm_guest = VM_GUEST_HV; + BUS_ADD_CHILD(parent, 0, "vmbus", 0); - if (device_find_child(parent, "vmbus", 0) == NULL) { - BUS_ADD_CHILD(parent, 0, "vmbus", 0); - } } static int @@ -307,9 +311,6 @@ vmbus_probe(device_t dev) { if(bootverbose) device_printf(dev, "VMBUS: probe\n"); - if (!hv_vmbus_query_hypervisor_presence()) - return (ENXIO); - device_set_desc(dev, "Vmbus Devices"); return (0); @@ -491,10 +492,13 @@ vmbus_attach(device_t dev) static void vmbus_init(void) { + if (vm_guest != VM_GUEST_HV) + return; + /* * If the system has already booted and thread - * scheduling is possible indicated by the global - * cold set to zero, we just call the driver + * scheduling is possible, as indicated by the + * global cold set to zero, we just call the driver * initialization directly. */ if (!cold) Modified: stable/10/sys/sys/systm.h ============================================================================== --- stable/10/sys/sys/systm.h Fri Oct 18 22:48:38 2013 (r256757) +++ stable/10/sys/sys/systm.h Fri Oct 18 23:19:27 2013 (r256758) @@ -71,7 +71,7 @@ extern int vm_guest; /* Running as virt * and/or add to the VM_GUEST_VM type if specific VM functionality is * ever implemented (e.g. vendor-specific paravirtualization features). */ -enum VM_GUEST { VM_GUEST_NO = 0, VM_GUEST_VM, VM_GUEST_XEN }; +enum VM_GUEST { VM_GUEST_NO = 0, VM_GUEST_VM, VM_GUEST_XEN, VM_GUEST_HV }; #if defined(WITNESS) || defined(INVARIANTS) void kassert_panic(const char *fmt, ...) __printflike(1, 2); From owner-svn-src-stable@FreeBSD.ORG Sat Oct 19 06:30:21 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E32A941E; Sat, 19 Oct 2013 06:30:21 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9A35E28E1; Sat, 19 Oct 2013 06:30:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9J6ULER026194; Sat, 19 Oct 2013 06:30:21 GMT (envelope-from hiren@svn.freebsd.org) Received: (from hiren@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9J6ULTR026192; Sat, 19 Oct 2013 06:30:21 GMT (envelope-from hiren@svn.freebsd.org) Message-Id: <201310190630.r9J6ULTR026192@svn.freebsd.org> From: Hiren Panchasara Date: Sat, 19 Oct 2013 06:30:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256759 - in stable/9/sys/dev: e1000 ixgbe X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Oct 2013 06:30:22 -0000 Author: hiren Date: Sat Oct 19 06:30:20 2013 New Revision: 256759 URL: http://svnweb.freebsd.org/changeset/base/256759 Log: MFC: r256069 Expose system level ixgbe sysctls. Device level sysctls are already exposed as dev.ix. Fixing the case where number of queues for igb is auto-tuned and hw.igb.num_queues does not return current/updated value. Modified: stable/9/sys/dev/e1000/if_igb.c stable/9/sys/dev/ixgbe/ixgbe.c Modified: stable/9/sys/dev/e1000/if_igb.c ============================================================================== --- stable/9/sys/dev/e1000/if_igb.c Fri Oct 18 23:19:27 2013 (r256758) +++ stable/9/sys/dev/e1000/if_igb.c Sat Oct 19 06:30:20 2013 (r256759) @@ -2883,6 +2883,9 @@ igb_setup_msix(struct adapter *adapter) if (queues > maxqueues) queues = maxqueues; + /* reflect correct sysctl value */ + igb_num_queues = queues; + /* ** One vector (RX/TX pair) per queue ** plus an additional for Link interrupt Modified: stable/9/sys/dev/ixgbe/ixgbe.c ============================================================================== --- stable/9/sys/dev/ixgbe/ixgbe.c Fri Oct 18 23:19:27 2013 (r256758) +++ stable/9/sys/dev/ixgbe/ixgbe.c Sat Oct 19 06:30:20 2013 (r256759) @@ -234,6 +234,9 @@ MODULE_DEPEND(ixgbe, ether, 1, 1, 1); ** TUNEABLE PARAMETERS: */ +static SYSCTL_NODE(_hw, OID_AUTO, ix, CTLFLAG_RD, 0, + "IXGBE driver parameters"); + /* ** AIM: Adaptive Interrupt Moderation ** which means that the interrupt rate @@ -242,17 +245,29 @@ MODULE_DEPEND(ixgbe, ether, 1, 1, 1); */ static int ixgbe_enable_aim = TRUE; TUNABLE_INT("hw.ixgbe.enable_aim", &ixgbe_enable_aim); +SYSCTL_INT(_hw_ix, OID_AUTO, enable_aim, CTLFLAG_RW, &ixgbe_enable_aim, 0, + "Enable adaptive interrupt moderation"); static int ixgbe_max_interrupt_rate = (4000000 / IXGBE_LOW_LATENCY); TUNABLE_INT("hw.ixgbe.max_interrupt_rate", &ixgbe_max_interrupt_rate); +SYSCTL_INT(_hw_ix, OID_AUTO, max_interrupt_rate, CTLFLAG_RDTUN, + &ixgbe_max_interrupt_rate, 0, "Maximum interrupts per second"); /* How many packets rxeof tries to clean at a time */ static int ixgbe_rx_process_limit = 256; TUNABLE_INT("hw.ixgbe.rx_process_limit", &ixgbe_rx_process_limit); +SYSCTL_INT(_hw_ix, OID_AUTO, rx_process_limit, CTLFLAG_RDTUN, + &ixgbe_rx_process_limit, 0, + "Maximum number of received packets to process at a time," + "-1 means unlimited"); /* How many packets txeof tries to clean at a time */ static int ixgbe_tx_process_limit = 256; TUNABLE_INT("hw.ixgbe.tx_process_limit", &ixgbe_tx_process_limit); +SYSCTL_INT(_hw_ix, OID_AUTO, tx_process_limit, CTLFLAG_RDTUN, + &ixgbe_tx_process_limit, 0, + "Maximum number of sent packets to process at a time," + "-1 means unlimited"); /* ** Smart speed setting, default to on @@ -269,6 +284,8 @@ static int ixgbe_smart_speed = ixgbe_sma */ static int ixgbe_enable_msix = 1; TUNABLE_INT("hw.ixgbe.enable_msix", &ixgbe_enable_msix); +SYSCTL_INT(_hw_ix, OID_AUTO, enable_msix, CTLFLAG_RDTUN, &ixgbe_enable_msix, 0, + "Enable MSI-X interrupts"); /* * Number of Queues, can be set to 0, @@ -278,6 +295,8 @@ TUNABLE_INT("hw.ixgbe.enable_msix", &ixg */ static int ixgbe_num_queues = 0; TUNABLE_INT("hw.ixgbe.num_queues", &ixgbe_num_queues); +SYSCTL_INT(_hw_ix, OID_AUTO, num_queues, CTLFLAG_RDTUN, &ixgbe_num_queues, 0, + "Number of queues to configure, 0 indicates autoconfigure"); /* ** Number of TX descriptors per ring, @@ -286,10 +305,14 @@ TUNABLE_INT("hw.ixgbe.num_queues", &ixgb */ static int ixgbe_txd = PERFORM_TXD; TUNABLE_INT("hw.ixgbe.txd", &ixgbe_txd); +SYSCTL_INT(_hw_ix, OID_AUTO, txd, CTLFLAG_RDTUN, &ixgbe_txd, 0, + "Number of receive descriptors per queue"); /* Number of RX descriptors per ring */ static int ixgbe_rxd = PERFORM_RXD; TUNABLE_INT("hw.ixgbe.rxd", &ixgbe_rxd); +SYSCTL_INT(_hw_ix, OID_AUTO, rxd, CTLFLAG_RDTUN, &ixgbe_rxd, 0, + "Number of receive descriptors per queue"); /* ** Defining this on will allow the use @@ -2442,6 +2465,9 @@ ixgbe_setup_msix(struct adapter *adapter else if ((ixgbe_num_queues == 0) && (queues > 8)) queues = 8; + /* reflect correct sysctl value */ + ixgbe_num_queues = queues; + /* ** Want one vector (RX/TX pair) per queue ** plus an additional for Link.