From owner-svn-src-projects@FreeBSD.ORG Sun Sep 21 00:20:42 2014 Return-Path: Delivered-To: svn-src-projects@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 ESMTPS id 7B357870; Sun, 21 Sep 2014 00:20:42 +0000 (UTC) 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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 657F2CC8; Sun, 21 Sep 2014 00:20:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8L0KgmA013933; Sun, 21 Sep 2014 00:20:42 GMT (envelope-from jceel@FreeBSD.org) Received: (from jceel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8L0Kf8l013926; Sun, 21 Sep 2014 00:20:41 GMT (envelope-from jceel@FreeBSD.org) Message-Id: <201409210020.s8L0Kf8l013926@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jceel set sender to jceel@FreeBSD.org using -f From: Jakub Wojciech Klama Date: Sun, 21 Sep 2014 00:20:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r271914 - in projects/arm_intrng/sys/arm: arm include X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Sep 2014 00:20:42 -0000 Author: jceel Date: Sun Sep 21 00:20:41 2014 New Revision: 271914 URL: http://svnweb.freebsd.org/changeset/base/271914 Log: Add method for binding interrupt to CPU in PIC interface (currently unused) and mechanism for unified caching and translating FDT cells describing interrupt to actual IRQ number through PIC kobj interface. Modified: projects/arm_intrng/sys/arm/arm/intrng.c projects/arm_intrng/sys/arm/arm/nexus.c projects/arm_intrng/sys/arm/arm/pic_if.m projects/arm_intrng/sys/arm/include/intr.h Modified: projects/arm_intrng/sys/arm/arm/intrng.c ============================================================================== --- projects/arm_intrng/sys/arm/arm/intrng.c Sun Sep 21 00:05:44 2014 (r271913) +++ projects/arm_intrng/sys/arm/arm/intrng.c Sun Sep 21 00:20:41 2014 (r271914) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -47,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -58,6 +60,7 @@ __FBSDID("$FreeBSD$"); #define IRQ_VECTOR_IDX(_irq) ((_irq) & 0xff) #define IRQ_GEN(_pic, _irq) (((_pic) << 8) | ((_irq) & 0xff)) +//#define DEBUG #ifdef DEBUG #define debugf(fmt, args...) do { printf("%s(): ", __func__); \ printf(fmt,##args); } while (0) @@ -70,6 +73,8 @@ typedef void (*mask_fn)(void *); struct arm_intr_controller { device_t ic_dev; phandle_t ic_node; + int ic_maxintrs; + struct arm_intr_handler *ic_intrs; }; struct arm_intr_handler { @@ -77,6 +82,10 @@ struct arm_intr_handler { const char * ih_ipi_name; int ih_intrcnt_idx; int ih_irq; + pcell_t ih_cells[8]; + int ih_ncells; + enum intr_trigger ih_trig; + enum intr_polarity ih_pol; struct intr_event * ih_event; struct arm_intr_controller *ih_pic; }; @@ -85,13 +94,15 @@ static void arm_mask_irq(void *); static void arm_unmask_irq(void *); static void arm_eoi(void *); -static struct arm_intr_handler arm_intrs[NIRQ]; static struct arm_intr_controller arm_pics[NPIC]; static struct arm_intr_controller *arm_ipi_pic; static int intrcnt_index = 0; static int last_printed = 0; +MALLOC_DECLARE(M_INTRNG); +MALLOC_DEFINE(M_INTRNG, "intrng", "ARM interrupt handling"); + /* Data for statistics reporting. */ u_long intrcnt[NIRQ]; char intrnames[NIRQ * INTRNAME_LEN]; @@ -109,6 +120,7 @@ arm_intrnames_init(void) void arm_dispatch_irq(device_t dev, struct trapframe *tf, int irq) { + struct arm_intr_controller *ic; struct arm_intr_handler *ih = NULL; int i; @@ -122,11 +134,13 @@ arm_dispatch_irq(device_t dev, struct tr if (tf == NULL) tf = PCPU_GET(curthread)->td_intr_frame; - for (i = 0; arm_intrs[i].ih_dev != NULL; i++) { - if (arm_intrs[i].ih_pic->ic_dev == dev && - arm_intrs[i].ih_irq == irq) { - ih = &arm_intrs[i]; - break; + for (ic = &arm_pics[0]; ic->ic_dev != NULL; ic++) { + if (ic->ic_dev == dev) { + for (i = 0; i < ic->ic_maxintrs; i++) { + ih = &ic->ic_intrs[i]; + if (irq == ih->ih_irq) + break; + } } } @@ -147,38 +161,64 @@ arm_dispatch_irq(device_t dev, struct tr } static struct arm_intr_handler * -arm_lookup_intr_handler(device_t pic, int irq) +arm_lookup_intr_handler(device_t pic, int idx) { - int i; + struct arm_intr_controller *ic; - for (i = 0; i < NIRQ; i++) { - if (arm_intrs[i].ih_pic != NULL && - arm_intrs[i].ih_pic->ic_dev == pic && - arm_intrs[i].ih_irq == irq) - return (&arm_intrs[i]); - - if (arm_intrs[i].ih_dev == NULL) - return (&arm_intrs[i]); + for (ic = &arm_pics[0]; ic->ic_dev != NULL; ic++) { + if (ic->ic_dev != NULL && ic->ic_dev == pic) + return (&ic->ic_intrs[idx]); } - return NULL; + return (NULL); } + int -arm_fdt_map_irq(phandle_t ic, int irq) +arm_fdt_map_irq(phandle_t ic, pcell_t *cells, int ncells) { - int i; + struct arm_intr_controller *pic; + struct arm_intr_handler *ih; + int i, j; ic = OF_xref_phandle(ic); - debugf("ic %08x irq %d\n", ic, irq); - - if (ic == CORE_PIC_NODE) - return (IRQ_GEN(CORE_PIC_IDX, irq)); + debugf("ic %08x cells <%*D>\n", ic, ncells * sizeof(pcell_t), + (char *)cells, ","); for (i = 0; arm_pics[i].ic_node != 0; i++) { - if (arm_pics[i].ic_node == ic) - return (IRQ_GEN(i, irq)); + pic = &arm_pics[i]; + if (pic->ic_node == ic) { + for (j = 0; j < pic->ic_maxintrs; j++) { + ih = &pic->ic_intrs[j]; + + /* Compare pcell contents */ + if (!memcmp(cells, ih->ih_cells, ncells)) + return (IRQ_GEN(i, j)); + } + + /* Not found - new entry required */ + pic->ic_maxintrs++; + pic->ic_intrs = realloc(pic->ic_intrs, + pic->ic_maxintrs * sizeof(struct arm_intr_handler), + M_INTRNG, M_WAITOK | M_ZERO); + + ih = &pic->ic_intrs[pic->ic_maxintrs - 1]; + ih->ih_pic = pic; + ih->ih_ncells = ncells; + memcpy(ih->ih_cells, cells, ncells); + + if (pic->ic_dev != NULL) { + /* Map IRQ number */ + PIC_TRANSLATE(pic->ic_dev, cells, &ih->ih_irq, + &ih->ih_trig, &ih->ih_pol); + + debugf(pic->ic_dev, "translated to irq %d\n", + ih->ih_irq); + } + + return (IRQ_GEN(i, pic->ic_maxintrs - 1)); + }; } /* @@ -186,32 +226,53 @@ arm_fdt_map_irq(phandle_t ic, int irq) * we map a stub for it. 'i' is pointing to free * first slot in arm_pics table. */ - arm_pics[i].ic_node = ic; - return (IRQ_GEN(i, irq)); + debugf("allocating new ic at index %d\n", i); + + pic = &arm_pics[i]; + pic->ic_node = ic; + pic->ic_maxintrs = 1; + pic->ic_intrs = malloc(sizeof(struct arm_intr_handler), M_INTRNG, + M_WAITOK | M_ZERO); + + ih = &pic->ic_intrs[0]; + ih->ih_pic = pic; + ih->ih_ncells = ncells; + memcpy(ih->ih_cells, cells, ncells); + + return (IRQ_GEN(i, 0)); } const char * arm_describe_irq(int irq) { struct arm_intr_controller *pic; + struct arm_intr_handler *ih; static char buffer[INTRNAME_LEN]; static char name[INTRNAME_LEN]; pic = &arm_pics[IRQ_PIC_IDX(irq)]; + if (pic == NULL) + return (""); + + if (IRQ_VECTOR_IDX(irq) > pic->ic_maxintrs) + return (""); + + ih = &pic->ic_intrs[IRQ_VECTOR_IDX(irq)]; + if (pic->ic_dev == NULL) { /* - * Interrupt controller not attached yet, so we'll use it's - * FDT "name" property instead + * Interrupt controller not attached yet. We don't know the + * IC device name nor interrupt number. All we can do is to + * use FDT 'name' property. */ - OF_getprop(pic->ic_node, "name", name, sizeof(name)); - snprintf(buffer, sizeof(buffer), "%s.%d", name, - IRQ_VECTOR_IDX(irq)); + OF_getprop(ih->ih_pic->ic_node, "name", name, sizeof(name)); + snprintf(buffer, sizeof(buffer), "%s.?", name); return (buffer); } snprintf(buffer, sizeof(buffer), "%s.%d", - device_get_nameunit(pic->ic_dev), IRQ_VECTOR_IDX(irq)); + device_get_nameunit(ih->ih_pic->ic_dev), ih->ih_irq); return (buffer); } @@ -220,6 +281,7 @@ void arm_register_pic(device_t dev, int flags) { struct arm_intr_controller *ic = NULL; + struct arm_intr_handler *ih; phandle_t node; int i; @@ -247,15 +309,28 @@ arm_register_pic(device_t dev, int flags ic->ic_dev = dev; ic->ic_node = node; - debugf("device %s node %08x slot %d\n", device_get_nameunit(dev), ic->ic_node, i); + debugf("device %s node %08x slot %d\n", device_get_nameunit(dev), + ic->ic_node, i); if (flags & PIC_FEATURE_IPI) { if (arm_ipi_pic != NULL) - panic("there's already registered interrupt controller for serving IPIs"); + panic("there's already registered interrupt " + "controller for serving IPIs"); arm_ipi_pic = ic; } + /* Resolve IRQ numbers for interrupt handlers added earlier */ + for (i = 0; i < ic->ic_maxintrs; i++) { + ih = &ic->ic_intrs[i]; + + /* Map IRQ number */ + PIC_TRANSLATE(ic->ic_dev, ih->ih_cells, &ih->ih_irq, + &ih->ih_trig, &ih->ih_pol); + + debugf(ic->ic_dev, "translated to irq %d\n", ih->ih_irq); + } + device_printf(dev, "registered as interrupt controller\n"); } @@ -290,14 +365,14 @@ arm_setup_irqhandler(device_t dev, drive if (ih->ih_event == NULL) { error = intr_event_create(&ih->ih_event, (void *)ih, 0, irq, (mask_fn)arm_mask_irq, (mask_fn)arm_unmask_irq, - arm_eoi, NULL, "intr%d:", irq); + arm_eoi, NULL, "intr%d.%d:", IRQ_PIC_IDX(irq), + IRQ_VECTOR_IDX(irq)); if (error) return; ih->ih_dev = dev; ih->ih_ipi_name = ipi ? name : NULL; - ih->ih_irq = IRQ_VECTOR_IDX(irq); ih->ih_pic = pic; arm_unmask_irq(ih); Modified: projects/arm_intrng/sys/arm/arm/nexus.c ============================================================================== --- projects/arm_intrng/sys/arm/arm/nexus.c Sun Sep 21 00:05:44 2014 (r271913) +++ projects/arm_intrng/sys/arm/arm/nexus.c Sun Sep 21 00:20:41 2014 (r271914) @@ -426,30 +426,8 @@ static int nexus_ofw_map_intr(device_t dev, device_t child, phandle_t iparent, int icells, pcell_t *intr) { - fdt_pic_decode_t intr_decode; - phandle_t intr_offset; - int i, rv, interrupt, trig, pol; - intr_offset = OF_xref_phandle(iparent); - - for (i = 0; i < icells; i++) - intr[i] = cpu_to_fdt32(intr[i]); - - for (i = 0; fdt_pic_table[i] != NULL; i++) { - intr_decode = fdt_pic_table[i]; - rv = intr_decode(intr_offset, intr, &interrupt, &trig, &pol); - - if (rv == 0) { - /* This was recognized as our PIC and decoded. */ - interrupt = FDT_MAP_IRQ(iparent, interrupt); - return (interrupt); - } - } - - /* Not in table, so guess */ - interrupt = FDT_MAP_IRQ(iparent, fdt32_to_cpu(intr[0])); - - return (interrupt); + return (arm_fdt_map_irq(iparent, intr, icells)); } #endif Modified: projects/arm_intrng/sys/arm/arm/pic_if.m ============================================================================== --- projects/arm_intrng/sys/arm/arm/pic_if.m Sun Sep 21 00:05:44 2014 (r271913) +++ projects/arm_intrng/sys/arm/arm/pic_if.m Sun Sep 21 00:20:41 2014 (r271914) @@ -28,10 +28,25 @@ #include #include +#include INTERFACE pic; CODE { + static int null_pic_translate(device_t dev, pcell_t *cells, int *irq, + enum intr_trigger *trig, enum intr_polarity *pol) + { + *irq = cells[0]; + *trig = INTR_TRIGGER_CONFORM; + *pol = INTR_POLARITY_CONFORM; + return (0); + } + + static void null_pic_bind(device_t dev, int irq, cpuset_t cpumask) + { + return; + } + static void null_pic_ipi_send(device_t dev, cpuset_t cpus, int ipi) { return; @@ -60,6 +75,20 @@ METHOD int config { enum intr_polarity pol; }; +METHOD int translate { + device_t dev; + pcell_t *cells; + int *irq; + enum intr_trigger *trig; + enum intr_polarity *pol; +} DEFAULT null_pic_translate; + +METHOD void bind { + device_t dev; + int irq; + cpuset_t cpumask; +} DEFAULT null_pic_bind; + METHOD void eoi { device_t dev; int irq; Modified: projects/arm_intrng/sys/arm/include/intr.h ============================================================================== --- projects/arm_intrng/sys/arm/include/intr.h Sun Sep 21 00:05:44 2014 (r271913) +++ projects/arm_intrng/sys/arm/include/intr.h Sun Sep 21 00:20:41 2014 (r271914) @@ -57,7 +57,7 @@ /* Interrupt controller features used in arm_register_pic(): */ #define PIC_FEATURE_IPI 0x1 -int arm_fdt_map_irq(phandle_t ic, int irq); +int arm_fdt_map_irq(phandle_t ic, pcell_t *cells, int ncells); void arm_register_pic(device_t dev, int features); void arm_unregister_pic(device_t dev); void arm_dispatch_irq(device_t dev, struct trapframe *tf, int irq); @@ -113,13 +113,12 @@ extern void (*arm_post_filter)(void *); extern int (*arm_config_irq)(int irq, enum intr_trigger trig, enum intr_polarity pol); -void arm_irq_memory_barrier(uintptr_t); - void gic_init_secondary(void); #endif /* !ARM_INTRNG */ const char *arm_describe_irq(int irq); void arm_intrnames_init(void); +void arm_irq_memory_barrier(uintptr_t); #endif /* _MACHINE_INTR_H */ From owner-svn-src-projects@FreeBSD.ORG Sun Sep 21 03:00:30 2014 Return-Path: Delivered-To: svn-src-projects@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 ESMTPS id D4AE9DAB; Sun, 21 Sep 2014 03:00:30 +0000 (UTC) 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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF4F9C32; Sun, 21 Sep 2014 03:00:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8L30Ufc088724; Sun, 21 Sep 2014 03:00:30 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8L30UYp088723; Sun, 21 Sep 2014 03:00:30 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201409210300.s8L30UYp088723@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 21 Sep 2014 03:00:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r271915 - projects/arm_intrng/sys/arm/arm X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Sep 2014 03:00:30 -0000 Author: ian Date: Sun Sep 21 03:00:30 2014 New Revision: 271915 URL: http://svnweb.freebsd.org/changeset/base/271915 Log: Don't register as an interrupt controller until after resource allocation and all the other up-front things that could fail. Modified: projects/arm_intrng/sys/arm/arm/gic.c Modified: projects/arm_intrng/sys/arm/arm/gic.c ============================================================================== --- projects/arm_intrng/sys/arm/arm/gic.c Sun Sep 21 00:20:41 2014 (r271914) +++ projects/arm_intrng/sys/arm/arm/gic.c Sun Sep 21 03:00:30 2014 (r271915) @@ -210,8 +210,6 @@ arm_gic_attach(device_t dev) sc->gic_c_bst = rman_get_bustag(sc->gic_res[1]); sc->gic_c_bsh = rman_get_bushandle(sc->gic_res[1]); - arm_register_pic(dev, PIC_FEATURE_IPI); - if (bus_setup_intr(dev, sc->gic_res[2], INTR_TYPE_MISC | INTR_CONTROLLER, arm_gic_intr, NULL, sc, &sc->gic_intrhand)) { device_printf(dev, "could not setup interrupt handler\n"); @@ -219,6 +217,8 @@ arm_gic_attach(device_t dev) return (ENXIO); } + arm_register_pic(dev, PIC_FEATURE_IPI); + /* Disable interrupt forwarding to the CPU interface */ gic_d_write_4(sc, GICD_CTLR, 0x00); From owner-svn-src-projects@FreeBSD.ORG Sun Sep 21 06:36:17 2014 Return-Path: Delivered-To: svn-src-projects@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 ESMTPS id B8F2F9B; Sun, 21 Sep 2014 06:36:17 +0000 (UTC) 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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8AB4FF6; Sun, 21 Sep 2014 06:36:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8L6aHhb091868; Sun, 21 Sep 2014 06:36:17 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8L6aHOQ091867; Sun, 21 Sep 2014 06:36:17 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201409210636.s8L6aHOQ091867@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Sun, 21 Sep 2014 06:36:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r271922 - projects/bhyve_svm/sys/amd64/amd64 X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Sep 2014 06:36:17 -0000 Author: neel Date: Sun Sep 21 06:36:17 2014 New Revision: 271922 URL: http://svnweb.freebsd.org/changeset/base/271922 Log: The memory type bits (PAT, PCD, PWT) associated with a nested PTE or PDE are identical to the traditional x86 page tables. Modified: projects/bhyve_svm/sys/amd64/amd64/pmap.c Modified: projects/bhyve_svm/sys/amd64/amd64/pmap.c ============================================================================== --- projects/bhyve_svm/sys/amd64/amd64/pmap.c Sun Sep 21 05:03:04 2014 (r271921) +++ projects/bhyve_svm/sys/amd64/amd64/pmap.c Sun Sep 21 06:36:17 2014 (r271922) @@ -1115,6 +1115,7 @@ pmap_swap_pat(pmap_t pmap, pt_entry_t en switch (pmap->pm_type) { case PT_X86: + case PT_RVI: /* Verify that both PAT bits are not set at the same time */ KASSERT((entry & x86_pat_bits) != x86_pat_bits, ("Invalid PAT bits in entry %#lx", entry)); @@ -1123,9 +1124,6 @@ pmap_swap_pat(pmap_t pmap, pt_entry_t en if ((entry & x86_pat_bits) != 0) entry ^= x86_pat_bits; break; - case PT_RVI: - /* XXX: PAT support. */ - break; case PT_EPT: /* * Nothing to do - the memory attributes are represented @@ -1153,6 +1151,7 @@ pmap_cache_bits(pmap_t pmap, int mode, b switch (pmap->pm_type) { case PT_X86: + case PT_RVI: /* The PAT bit is different for PTE's and PDE's. */ pat_flag = is_pde ? X86_PG_PDE_PAT : X86_PG_PTE_PAT; @@ -1169,11 +1168,6 @@ pmap_cache_bits(pmap_t pmap, int mode, b cache_bits |= PG_NC_PWT; break; - case PT_RVI: - /* XXX: PAT support. */ - cache_bits = 0; - break; - case PT_EPT: cache_bits = EPT_PG_IGNORE_PAT | EPT_PG_MEMORY_TYPE(mode); break; @@ -1192,11 +1186,8 @@ pmap_cache_mask(pmap_t pmap, boolean_t i switch (pmap->pm_type) { case PT_X86: - mask = is_pde ? X86_PG_PDE_CACHE : X86_PG_PTE_CACHE; - break; case PT_RVI: - /* XXX: PAT support. */ - mask = 0; + mask = is_pde ? X86_PG_PDE_CACHE : X86_PG_PTE_CACHE; break; case PT_EPT: mask = EPT_PG_IGNORE_PAT | EPT_PG_MEMORY_TYPE(0x7); @@ -1260,7 +1251,7 @@ pmap_update_pde_invalidate(pmap_t pmap, if (pmap_type_guest(pmap)) return; - + KASSERT(pmap->pm_type == PT_X86, ("pmap_update_pde_invalidate: invalid type %d", pmap->pm_type)); @@ -1376,7 +1367,7 @@ pmap_invalidate_page(pmap_t pmap, vm_off pmap_invalidate_ept(pmap); return; } - + KASSERT(pmap->pm_type == PT_X86, ("pmap_invalidate_page: invalid type %d", pmap->pm_type)); From owner-svn-src-projects@FreeBSD.ORG Sun Sep 21 18:15:10 2014 Return-Path: Delivered-To: svn-src-projects@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 ESMTPS id A3B1190E; Sun, 21 Sep 2014 18:15:10 +0000 (UTC) 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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D1DF79E; Sun, 21 Sep 2014 18:15:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8LIFATX026509; Sun, 21 Sep 2014 18:15:10 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8LIFAqJ026505; Sun, 21 Sep 2014 18:15:10 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201409211815.s8LIFAqJ026505@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sun, 21 Sep 2014 18:15:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r271932 - in projects/ipfw/sys: modules/ipfw netpfil/ipfw X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Sep 2014 18:15:10 -0000 Author: melifaro Date: Sun Sep 21 18:15:09 2014 New Revision: 271932 URL: http://svnweb.freebsd.org/changeset/base/271932 Log: Add pre-alfa version of DXR lookup module. It does build but (currently) does not work. This change is not intended to be merged along with other ipfw changes. Added: projects/ipfw/sys/netpfil/ipfw/dxr_algo.c projects/ipfw/sys/netpfil/ipfw/dxr_fwd.c projects/ipfw/sys/netpfil/ipfw/dxr_fwd.h Modified: projects/ipfw/sys/modules/ipfw/Makefile projects/ipfw/sys/netpfil/ipfw/ip_fw_table.h projects/ipfw/sys/netpfil/ipfw/ip_fw_table_algo.c Modified: projects/ipfw/sys/modules/ipfw/Makefile ============================================================================== --- projects/ipfw/sys/modules/ipfw/Makefile Sun Sep 21 15:37:39 2014 (r271931) +++ projects/ipfw/sys/modules/ipfw/Makefile Sun Sep 21 18:15:09 2014 (r271932) @@ -9,6 +9,7 @@ SRCS= ip_fw2.c ip_fw_pfil.c SRCS+= ip_fw_dynamic.c ip_fw_log.c SRCS+= ip_fw_sockopt.c ip_fw_table.c ip_fw_table_algo.c ip_fw_iface.c SRCS+= ip_fw_table_value.c +SRCS+= dxr_fwd.c dxr_algo.c SRCS+= opt_inet.h opt_inet6.h opt_ipdivert.h opt_ipfw.h opt_ipsec.h CFLAGS+= -DIPFIREWALL Added: projects/ipfw/sys/netpfil/ipfw/dxr_algo.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/ipfw/sys/netpfil/ipfw/dxr_algo.c Sun Sep 21 18:15:09 2014 (r271932) @@ -0,0 +1,847 @@ +/*- + * Copyright (c) 2014 Yandex LLC + * Copyright (c) 2014 Alexander V. Chernikov + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: projects/ipfw/sys/netpfil/ipfw/ip_fw_table.c 267384 2014-06-12 09:59:11Z melifaro $"); + +/* + * DXR algorithm bindings. + * + */ + +#include "opt_ipfw.h" +#include "opt_inet.h" +#ifndef INET +#error IPFIREWALL requires INET. +#endif /* INET */ +#include "opt_inet6.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include /* ip_fw.h requires IFNAMSIZ */ +#include +#include + +#include +#include /* struct ipfw_rule_ref */ +#include + +#include + +#include +#include +#include + +#define DXR_BUILD_DEBUG + +static uma_zone_t chunk_zone; + +/* + * ADDR implementation using dxr + * + */ + +/* + * The radix code expects addr and mask to be array of bytes, + * with the first byte being the length of the array. rn_inithead + * is called with the offset in bits of the lookup key within the + * array. If we use a sockaddr_in as the underlying type, + * sin_len is conveniently located at offset 0, sin_addr is at + * offset 4 and normally aligned. + * But for portability, let's avoid assumption and make the code explicit + */ +#define KEY_LEN(v) *((uint8_t *)&(v)) +/* + * Do not require radix to compare more than actual IPv4/IPv6 address + */ +#define KEY_LEN_INET (offsetof(struct sockaddr_in, sin_addr) + sizeof(in_addr_t)) +#define KEY_LEN_INET6 (offsetof(struct sa_in6, sin6_addr) + sizeof(struct in6_addr)) + +#define OFF_LEN_INET (8 * offsetof(struct sockaddr_in, sin_addr)) +#define OFF_LEN_INET6 (8 * offsetof(struct sa_in6, sin6_addr)) + +struct radix_addr_entry { + struct radix_node rn[2]; + struct sockaddr_in addr; + uint32_t value; + uint8_t masklen; +}; + +struct sa_in6 { + uint8_t sin6_len; + uint8_t sin6_family; + uint8_t pad[2]; + struct in6_addr sin6_addr; +}; + +struct radix_addr_xentry { + struct radix_node rn[2]; + struct sa_in6 addr6; + uint32_t value; + uint8_t masklen; +}; + +struct radix_cfg { + struct radix_node_head *head4; + struct radix_node_head *head6; + size_t count4; + size_t count6; + struct dxr_instance *di; +}; + +struct ta_buf_radix +{ + void *ent_ptr; + struct sockaddr *addr_ptr; + struct sockaddr *mask_ptr; + union { + struct { + struct sockaddr_in sa; + struct sockaddr_in ma; + } a4; + struct { + struct sa_in6 sa; + struct sa_in6 ma; + } a6; + } addr; +}; + +static int +radix_lookup(void *tree_ptr, in_addr_t *pdst, in_addr_t *pmask, int *pnh) +{ + struct radix_node_head *rnh; + struct radix_addr_entry *ent; + struct sockaddr_in sin, *s_dst; + struct sockaddr *psa; + in_addr_t dst, mask; + + memset(&sin, 0, sizeof(sin)); + sin.sin_family = AF_INET; + sin.sin_len = sizeof(sin); + sin.sin_addr.s_addr = htonl(*pdst); + psa = (struct sockaddr *)&sin; + + //TREE_LOCK_ASSERT(di); + rnh = (struct radix_node_head *)tree_ptr; + ent = (struct radix_addr_entry *)rnh->rnh_matchaddr(psa, rnh); + if (ent == NULL) + return (ENOENT); + + s_dst = (struct sockaddr_in *)&ent->addr; + + dst = s_dst->sin_addr.s_addr; + mask = htonl(ent->masklen ? ~((1 << (32 - ent->masklen)) - 1) : 0); + +#ifdef DXR_BUILD_DEBUG + char kbuf[16], kbuf2[16]; + inet_ntop(AF_INET, pdst, kbuf, sizeof(kbuf)); + inet_ntop(AF_INET, &dst, kbuf2, sizeof(kbuf2)); + printf("RLookup for %s returned %s/%d value %d\n", kbuf, kbuf2, + ent->masklen, ent->value); +#endif + + *pnh = ent->value; + *pdst = dst; + *pmask = mask; + + return (0); +} + +struct radix_wa { + tree_walkf_cb_t *f; + void *arg; + struct dxr_instance *di; +}; + +static int +radix_walkf_f(struct radix_node *rn, void *arg) +{ + struct radix_wa *wa; + struct radix_addr_entry *ent; + struct sockaddr_in *s_dst; + in_addr_t dst, mask; + int nh; + + wa = (struct radix_wa *)arg; + ent = (struct radix_addr_entry *)rn; + + s_dst = (struct sockaddr_in *)&ent->addr; + + nh = ent->value; + dst = s_dst->sin_addr.s_addr; + mask = htonl(ent->masklen ? ~((1 << (32 - ent->masklen)) - 1) : 0); + +#ifdef DXR_BUILD_DEBUG + char kbuf[16]; + inet_ntop(AF_INET, &dst, kbuf, sizeof(kbuf)); + printf(" WALK returned %s/%d value %d\n", kbuf, + ent->masklen, ent->value); +#endif + + return (wa->f(wa->di, dst, mask, nh, wa->arg)); +} + + +static int +radix_walkf(void *tree_ptr, struct dxr_instance *di, in_addr_t dst, + in_addr_t mask, tree_walkf_cb_t *f, void *arg) +{ + struct radix_node_head *rnh; + struct sockaddr_in s_dst, s_mask; + struct radix_wa wa; + int error; + + rnh = (struct radix_node_head *)tree_ptr; + + memset(&s_dst, 0, sizeof(s_dst)); + memset(&s_mask, 0, sizeof(s_mask)); + s_dst.sin_family = AF_INET; + s_dst.sin_len = sizeof(s_dst); + s_dst.sin_addr.s_addr = dst; + s_mask.sin_family = AF_INET; + s_mask.sin_len = sizeof(s_mask); + s_mask.sin_addr.s_addr = mask; + + memset(&wa, 0, sizeof(wa)); + wa.f = f; + wa.arg = arg; + wa.di = di; + +#ifdef DXR_BUILD_DEBUG + char kbuf[16], kbuf2[16]; + inet_ntop(AF_INET, &dst, kbuf, sizeof(kbuf)); + inet_ntop(AF_INET, &mask, kbuf2, sizeof(kbuf2)); + printf("START walk for %s/%s\n", kbuf, kbuf2); +#endif + + error = rnh->rnh_walktree_from(rnh, &s_dst, &s_mask, radix_walkf_f, &wa); +#ifdef DXR_BUILD_DEBUG + printf("END walk\n"); +#endif + + return (error); +} + + +static void *slab_alloc(void *slab_ptr) +{ + uma_zone_t zone; + + zone = (uma_zone_t)slab_ptr; + + return (uma_zalloc(zone, M_NOWAIT)); +} + +static void slab_free(void *slab_ptr, void *obj_ptr) +{ + uma_zone_t zone; + + zone = (uma_zone_t)slab_ptr; + + uma_zfree(zone, obj_ptr); +} + +static int +ta_lookup_dxr(struct table_info *ti, void *key, uint32_t keylen, + uint32_t *val) +{ + struct radix_node_head *rnh; + struct dxr_instance *di; + + if (keylen == sizeof(in_addr_t)) { + di = (struct dxr_instance *)ti->state; + int idx = dxr_lookup(di, *((uint32_t *)key)); +#ifdef DXR_BUILD_DEBUG + char kbuf[16]; + inet_ntop(AF_INET, key, kbuf, sizeof(kbuf)); + printf("Lookup for %s returned %d\n", kbuf, idx); +#endif + if (idx == 0) { + /* No match, check for default route idx */ + if ((idx = ti->data & 0xFFFF) == 0) + return (0); + } + + *val = idx; + return (1); + } else { + struct radix_addr_xentry *xent; + struct sa_in6 sa6; + KEY_LEN(sa6) = KEY_LEN_INET6; + memcpy(&sa6.sin6_addr, key, sizeof(struct in6_addr)); + rnh = (struct radix_node_head *)ti->xstate; + xent = (struct radix_addr_xentry *)(rnh->rnh_matchaddr(&sa6, rnh)); + if (xent != NULL) { + *val = xent->value; + return (1); + } + } + + return (0); +} + +/* + * New table + */ +static int +ta_init_dxr(struct ip_fw_chain *ch, void **ta_state, struct table_info *ti, + char *data, uint8_t tflags) +{ + struct radix_cfg *cfg; + struct dxr_funcs f; + + cfg = malloc(sizeof(struct radix_cfg), M_IPFW, M_WAITOK | M_ZERO); + + if (!rn_inithead((void **)&cfg->head4, OFF_LEN_INET)) + return (ENOMEM); + if (!rn_inithead((void **)&cfg->head6, OFF_LEN_INET6)) { + rn_detachhead((void **)&cfg->head4); + return (ENOMEM); + } + + ti->xstate = cfg->head6; + *ta_state = cfg; + ti->lookup = ta_lookup_dxr; + + /* XXX: do this from per-algo hook */ + if (chunk_zone == NULL) { + /* Allocate the zone for chunk descriptors (XXX - get size) */ + chunk_zone = uma_zcreate("dxr_chunk", sizeof(struct chunk_desc), + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); +#if 0 + /* Create updater thread */ + if (kproc_kthread_add(dxr_updater, NULL, &p, &td, RFHIGHPID, + 0, "dxr_update", "dxr_update")) + panic("Can't create the DXR updater thread"); +#endif + } + + memset(&f, 0, sizeof(f)); + f.slab_alloc = slab_alloc; + f.slab_free = slab_free; + f.slab_ptr = chunk_zone; + f.tree_walk = radix_walkf; + f.tree_lookup = radix_lookup; + f.tree_ptr = cfg->head4; + + + cfg->di = dxr_init(M_IPFW, M_WAITOK); + if (cfg == NULL) + return (ENOMEM); + + dxr_setfuncs(cfg->di, &f); + + ti->state = cfg->di; + + return (0); +} + +static int +flush_radix_entry(struct radix_node *rn, void *arg) +{ + struct radix_node_head * const rnh = arg; + struct radix_addr_entry *ent; + + ent = (struct radix_addr_entry *) + rnh->rnh_deladdr(rn->rn_key, rn->rn_mask, rnh); + if (ent != NULL) + free(ent, M_IPFW_TBL); + return (0); +} + +static void +ta_destroy_dxr(void *ta_state, struct table_info *ti) +{ + struct radix_cfg *cfg; + struct radix_node_head *rnh; + + cfg = (struct radix_cfg *)ta_state; + + dxr_destroy(cfg->di, M_IPFW); + + rnh = cfg->head4; + rnh->rnh_walktree(rnh, flush_radix_entry, rnh); + rn_detachhead((void **)&cfg->head4); + + rnh = cfg->head6; + rnh->rnh_walktree(rnh, flush_radix_entry, rnh); + rn_detachhead((void **)&cfg->head6); + + free(cfg, M_IPFW); +} + +/* + * Provide algo-specific table info + */ +static void +ta_dump_radix_tinfo(void *ta_state, struct table_info *ti, ipfw_ta_tinfo *tinfo) +{ + struct radix_cfg *cfg; + + cfg = (struct radix_cfg *)ta_state; + + tinfo->flags = IPFW_TATFLAGS_AFDATA | IPFW_TATFLAGS_AFITEM; + tinfo->taclass4 = IPFW_TACLASS_RADIX; + tinfo->count4 = cfg->count4; + tinfo->itemsize4 = sizeof(struct radix_addr_entry); + tinfo->taclass6 = IPFW_TACLASS_RADIX; + tinfo->count6 = cfg->count6; + tinfo->itemsize6 = sizeof(struct radix_addr_xentry); +} + +static int +ta_dump_radix_tentry(void *ta_state, struct table_info *ti, void *e, + ipfw_obj_tentry *tent) +{ + struct radix_addr_entry *n; + struct radix_addr_xentry *xn; + + n = (struct radix_addr_entry *)e; + + /* Guess IPv4/IPv6 radix by sockaddr family */ + if (n->addr.sin_family == AF_INET) { + tent->k.addr.s_addr = n->addr.sin_addr.s_addr; + tent->masklen = n->masklen; + tent->subtype = AF_INET; + tent->v.kidx = n->value; +#ifdef INET6 + } else { + xn = (struct radix_addr_xentry *)e; + memcpy(&tent->k, &xn->addr6.sin6_addr, sizeof(struct in6_addr)); + tent->masklen = xn->masklen; + tent->subtype = AF_INET6; + tent->v.kidx = xn->value; +#endif + } + + return (0); +} + +static int +ta_find_radix_tentry(void *ta_state, struct table_info *ti, + ipfw_obj_tentry *tent) +{ + struct radix_cfg *cfg; + struct radix_node_head *rnh; + void *e; + + cfg = (struct radix_cfg *)ta_state; + + e = NULL; + if (tent->subtype == AF_INET) { + struct sockaddr_in sa; + KEY_LEN(sa) = KEY_LEN_INET; + sa.sin_addr.s_addr = tent->k.addr.s_addr; + rnh = cfg->head4; + e = rnh->rnh_matchaddr(&sa, rnh); + } else { + struct sa_in6 sa6; + KEY_LEN(sa6) = KEY_LEN_INET6; + memcpy(&sa6.sin6_addr, &tent->k.addr6, sizeof(struct in6_addr)); + rnh = cfg->head6; + e = rnh->rnh_matchaddr(&sa6, rnh); + } + + if (e != NULL) { + ta_dump_radix_tentry(ta_state, ti, e, tent); + return (0); + } + + return (ENOENT); +} + +static void +ta_foreach_radix(void *ta_state, struct table_info *ti, ta_foreach_f *f, + void *arg) +{ + struct radix_cfg *cfg; + struct radix_node_head *rnh; + + cfg = (struct radix_cfg *)ta_state; + + rnh = cfg->head4; + rnh->rnh_walktree(rnh, (walktree_f_t *)f, arg); + + rnh = cfg->head6; + rnh->rnh_walktree(rnh, (walktree_f_t *)f, arg); +} + + +#ifdef INET6 +static inline void +ipv6_writemask(struct in6_addr *addr6, uint8_t mask) +{ + uint32_t *cp; + + for (cp = (uint32_t *)addr6; mask >= 32; mask -= 32) + *cp++ = 0xFFFFFFFF; + *cp = htonl(mask ? ~((1 << (32 - mask)) - 1) : 0); +} +#endif + +static void +tei_to_sockaddr_ent(struct tentry_info *tei, struct sockaddr *sa, + struct sockaddr *ma, int *set_mask) +{ + int mlen; + struct sockaddr_in *addr, *mask; + struct sa_in6 *addr6, *mask6; + in_addr_t a4; + + mlen = tei->masklen; + + if (tei->subtype == AF_INET) { +#ifdef INET + addr = (struct sockaddr_in *)sa; + mask = (struct sockaddr_in *)ma; + /* Set 'total' structure length */ + KEY_LEN(*addr) = KEY_LEN_INET; + KEY_LEN(*mask) = KEY_LEN_INET; + addr->sin_family = AF_INET; + mask->sin_addr.s_addr = + htonl(mlen ? ~((1 << (32 - mlen)) - 1) : 0); + a4 = *((in_addr_t *)tei->paddr); + addr->sin_addr.s_addr = a4 & mask->sin_addr.s_addr; + if (mlen != 32) + *set_mask = 1; + else + *set_mask = 0; +#endif +#ifdef INET6 + } else if (tei->subtype == AF_INET6) { + /* IPv6 case */ + addr6 = (struct sa_in6 *)sa; + mask6 = (struct sa_in6 *)ma; + /* Set 'total' structure length */ + KEY_LEN(*addr6) = KEY_LEN_INET6; + KEY_LEN(*mask6) = KEY_LEN_INET6; + addr6->sin6_family = AF_INET6; + ipv6_writemask(&mask6->sin6_addr, mlen); + memcpy(&addr6->sin6_addr, tei->paddr, sizeof(struct in6_addr)); + APPLY_MASK(&addr6->sin6_addr, &mask6->sin6_addr); + if (mlen != 128) + *set_mask = 1; + else + *set_mask = 0; + } +#endif +} + +static int +ta_prepare_add_radix(struct ip_fw_chain *ch, struct tentry_info *tei, + void *ta_buf) +{ + struct ta_buf_radix *tb; + struct radix_addr_entry *ent; + struct radix_addr_xentry *xent; + struct sockaddr *addr, *mask; + int mlen, set_mask; + + tb = (struct ta_buf_radix *)ta_buf; + + mlen = tei->masklen; + set_mask = 0; + + if (tei->subtype == AF_INET) { +#ifdef INET + if (mlen > 32) + return (EINVAL); + ent = malloc(sizeof(*ent), M_IPFW_TBL, M_WAITOK | M_ZERO); + ent->masklen = mlen; + + addr = (struct sockaddr *)&ent->addr; + mask = (struct sockaddr *)&tb->addr.a4.ma; + tb->ent_ptr = ent; +#endif +#ifdef INET6 + } else if (tei->subtype == AF_INET6) { + /* IPv6 case */ + if (mlen > 128) + return (EINVAL); + xent = malloc(sizeof(*xent), M_IPFW_TBL, M_WAITOK | M_ZERO); + xent->masklen = mlen; + + addr = (struct sockaddr *)&xent->addr6; + mask = (struct sockaddr *)&tb->addr.a6.ma; + tb->ent_ptr = xent; +#endif + } else { + /* Unknown CIDR type */ + return (EINVAL); + } + + tei_to_sockaddr_ent(tei, addr, mask, &set_mask); + /* Set pointers */ + tb->addr_ptr = addr; + if (set_mask != 0) + tb->mask_ptr = mask; + + return (0); +} + +static int +dxr_req(struct table_info *ti, int req, struct tentry_info *tei) +{ + struct dxr_instance *di; + struct in_addr *a; + int error; + + if (tei->masklen == 0) { + + /* + * Handle 'default route' case - store + * value index in lowe 2 bits of ti->data + */ + ti->data &= ~((u_long)0xFFFF); + if (req != 0) + ti->data |= tei->value & 0xFFFF; + return (0); + } + + di = (struct dxr_instance *)ti->state; + a = (struct in_addr *)tei->paddr; + error = 0; + +#ifdef DXR_BUILD_DEBUG + char kbuf[16]; + inet_ntop(AF_INET, tei->paddr, kbuf, sizeof(kbuf)); + printf("%s for %s/%d value [%d]\n", (req == 0) ? "DEL":"ADD", kbuf, + tei->masklen, tei->value); +#endif + + /* Delete old record */ + if (req == 0 || (tei->flags & TEI_FLAGS_UPDATED) != 0) { + error = dxr_request(di, RTM_DELETE, *a, tei->masklen, 1); + if (error != 0) + printf("error doing del dxr_req\n"); + } + if (req != 0) { + error = dxr_request(di, RTM_ADD, *a, tei->masklen, 1); + if (error != 0) + printf("error doing del dxr_req\n"); + } + + return (error); +} + +static int +ta_add_dxr(void *ta_state, struct table_info *ti, struct tentry_info *tei, + void *ta_buf, uint32_t *pnum) +{ + struct radix_cfg *cfg; + struct radix_node_head *rnh; + struct radix_node *rn; + struct ta_buf_radix *tb; + uint32_t *old_value, value; + + cfg = (struct radix_cfg *)ta_state; + tb = (struct ta_buf_radix *)ta_buf; + + /* Save current entry value from @tei */ + if (tei->subtype == AF_INET) { + rnh = cfg->head4; + ((struct radix_addr_entry *)tb->ent_ptr)->value = tei->value; + } else { + rnh = ti->xstate; + ((struct radix_addr_xentry *)tb->ent_ptr)->value = tei->value; + } + + /* Search for an entry first */ + rn = rnh->rnh_lookup(tb->addr_ptr, tb->mask_ptr, rnh); + if (rn != NULL) { + if ((tei->flags & TEI_FLAGS_UPDATE) == 0) + return (EEXIST); + /* Record already exists. Update value if we're asked to */ + if (tei->subtype == AF_INET) + old_value = &((struct radix_addr_entry *)rn)->value; + else + old_value = &((struct radix_addr_xentry *)rn)->value; + + /* Indicate that update has happened instead of addition */ + tei->flags |= TEI_FLAGS_UPDATED; + + /* Update DXR data */ + if (tei->subtype == AF_INET) + dxr_req(ti, 1, tei); + + value = *old_value; + *old_value = tei->value; + tei->value = value; + + *pnum = 0; + + return (0); + } + + if ((tei->flags & TEI_FLAGS_DONTADD) != 0) + return (EFBIG); + + rn = rnh->rnh_addaddr(tb->addr_ptr, tb->mask_ptr, rnh, tb->ent_ptr); + if (rn == NULL) { + /* Unknown error */ + return (EINVAL); + } + + if (tei->subtype == AF_INET) { + dxr_req(ti, 1, tei); + cfg->count4++; + } else + cfg->count6++; + tb->ent_ptr = NULL; + *pnum = 1; + + return (0); +} + +static int +ta_prepare_del_radix(struct ip_fw_chain *ch, struct tentry_info *tei, + void *ta_buf) +{ + struct ta_buf_radix *tb; + struct sockaddr *addr, *mask; + int mlen, set_mask; + + tb = (struct ta_buf_radix *)ta_buf; + + mlen = tei->masklen; + set_mask = 0; + + if (tei->subtype == AF_INET) { + if (mlen > 32) + return (EINVAL); + + addr = (struct sockaddr *)&tb->addr.a4.sa; + mask = (struct sockaddr *)&tb->addr.a4.ma; +#ifdef INET6 + } else if (tei->subtype == AF_INET6) { + if (mlen > 128) + return (EINVAL); + + addr = (struct sockaddr *)&tb->addr.a6.sa; + mask = (struct sockaddr *)&tb->addr.a6.ma; +#endif + } else + return (EINVAL); + + tei_to_sockaddr_ent(tei, addr, mask, &set_mask); + tb->addr_ptr = addr; + if (set_mask != 0) + tb->mask_ptr = mask; + + return (0); +} + +static int +ta_del_dxr(void *ta_state, struct table_info *ti, struct tentry_info *tei, + void *ta_buf, uint32_t *pnum) +{ + struct radix_cfg *cfg; + struct radix_node_head *rnh; + struct radix_node *rn; + struct ta_buf_radix *tb; + + cfg = (struct radix_cfg *)ta_state; + tb = (struct ta_buf_radix *)ta_buf; + + if (tei->subtype == AF_INET) + rnh = cfg->head4; + else + rnh = cfg->head6; + + rn = rnh->rnh_deladdr(tb->addr_ptr, tb->mask_ptr, rnh); + + if (rn == NULL) + return (ENOENT); + + /* Save entry value to @tei */ + if (tei->subtype == AF_INET) + tei->value = ((struct radix_addr_entry *)rn)->value; + else + tei->value = ((struct radix_addr_xentry *)rn)->value; + + tb->ent_ptr = rn; + + if (tei->subtype == AF_INET) { + dxr_req(ti, 0, tei); + cfg->count4--; + } else + cfg->count6--; + *pnum = 1; + + return (0); +} + +static void +ta_flush_radix_entry(struct ip_fw_chain *ch, struct tentry_info *tei, + void *ta_buf) +{ + struct ta_buf_radix *tb; + + tb = (struct ta_buf_radix *)ta_buf; + + if (tb->ent_ptr != NULL) + free(tb->ent_ptr, M_IPFW_TBL); +} + +static int +ta_need_modify_radix(void *ta_state, struct table_info *ti, uint32_t count, + uint64_t *pflags) +{ + + /* + * radix does not require additional memory allocations + * other than nodes itself. Adding new masks to the tree do + * but we don't have any API to call (and we don't known which + * sizes do we need). + */ + return (0); +} + +struct table_algo addr_dxr = { + .name = "addr:dxr", + .type = IPFW_TABLE_ADDR, + .flags = TA_FLAG_DEFAULT, + .ta_buf_size = sizeof(struct ta_buf_radix), + .init = ta_init_dxr, + .destroy = ta_destroy_dxr, + .prepare_add = ta_prepare_add_radix, + .prepare_del = ta_prepare_del_radix, + .add = ta_add_dxr, + .del = ta_del_dxr, + .flush_entry = ta_flush_radix_entry, + .foreach = ta_foreach_radix, + .dump_tentry = ta_dump_radix_tentry, + .find_tentry = ta_find_radix_tentry, + .dump_tinfo = ta_dump_radix_tinfo, + .need_modify = ta_need_modify_radix, +}; + Added: projects/ipfw/sys/netpfil/ipfw/dxr_fwd.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/ipfw/sys/netpfil/ipfw/dxr_fwd.c Sun Sep 21 18:15:09 2014 (r271932) @@ -0,0 +1,2424 @@ +#define DXR_DIRECT_BITS 18 +#define ALLOW_OOO_EXEC +#define DXR_LOOKUP_TIMING +//#define DIR_24_8 +//#define RADIX_TIMING +//#define DXR_ITER_TIMING +//#define REPEAT_SAME_KEY +#define DXR_LOOKUP_CONSISTENCY_CHECK + +/* + * Copyright (c) 2005-2012 University of Zagreb + * Copyright (c) 2005 International Computer Science Institute + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +/* Compile-time tunables, overriding defaults from ip_fib.h */ +#define DXR_VPORTS_MAX 1024 + +/* Debugging options */ +#define DXR_BUILD_TIMING +#define DXR_BUILD_PARANOIC +//#define DXR_BUILD_DEBUG + +#if defined(DXR_ITER_TIMING) && defined(DXR_LOOKUP_TIMING) +#error DXR_ITER_TIMING and DXR_LOOKUP_TIMING are mutualy exclusive +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include +#include +#include + +#include "dxr_fwd.h" + +#if 0 +static uint16_t nexthop_ref(struct in_addr, struct ifnet *); +static int nexthop_unref(uint16_t); +#endif +static void schedule_update(struct dxr_instance *di, struct in_addr dst, + int mlen); +static void update_chunk(struct dxr_instance *, int); +static void update_chunk_long(struct dxr_instance *, int); +static int dxr_walk(struct dxr_instance *di, in_addr_t dst, in_addr_t mask, + int nh, void *arg); +static int dxr_walk_long(struct dxr_instance *di, in_addr_t dst, in_addr_t mask, + int nh, void *arg); +static void dxr_initheap(struct dxr_instance *, uint32_t, uint32_t); +static void dxr_heap_inject(struct dxr_instance*, uint32_t, uint32_t, int, int); +static int dxr_parse(struct dxr_instance *, int, uint32_t, uint32_t, int, int); +static int dxr_parse_long(struct dxr_instance *, int, uint32_t, uint32_t, + int, int); +static void prune_empty_chunks(struct dxr_instance *); +static void chunk_ref(struct dxr_instance *, int); +static void chunk_unref(struct dxr_instance *, int); +static void apply_pending(struct dxr_instance *); +static void dxr_check_tables(struct dxr_instance *di); + +static int radix_lookup(struct dxr_instance *di, uint32_t dst); + +#ifdef DIR_24_8 +#if (DXR_DIRECT_BITS != 24) +#error DXR_DIRECT_BITS must be set to 24 when DIR_24_8 is configured +#endif +static void dir_24_8_rebuild(void); +static int dir_24_8_lookup(uint32_t); +#endif + +#if defined(DXR_LOOKUP_TIMING) || defined(DXR_ITER_TIMING) || defined(RADIX_TIMING) +static void dxr_lookup_exercise(void *arg); +#endif + +#ifdef DXR_BUILD_DEBUG +static void dxr_heap_dump(void); +static void dxr_chunk_dump(int); +static void print_in_route(struct rtentry *, const char *); +#endif + +#if defined(DXR_LOOKUP_TIMING) || defined(DXR_ITER_TIMING) || defined(RADIX_TIMING) +static DPCPU_DEFINE(int, valid_timing); +static int ex_preload; +static int ex_threads; +static int ex_iters = 100000; + +struct iter_stat { + uint64_t cnt; + uint64_t cycles; +} static iter_stats[MAXCPU][32]; + +static int reduce; +static int rdtsc_latency; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Sun Sep 21 18:52:57 2014 Return-Path: Delivered-To: svn-src-projects@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 ESMTPS id 348D3A9; Sun, 21 Sep 2014 18:52:57 +0000 (UTC) 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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1FEFDACF; Sun, 21 Sep 2014 18:52:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8LIquam045180; Sun, 21 Sep 2014 18:52:56 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8LIqu90045178; Sun, 21 Sep 2014 18:52:56 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201409211852.s8LIqu90045178@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Sun, 21 Sep 2014 18:52:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r271933 - projects/bhyve_svm/sys/amd64/vmm X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Sep 2014 18:52:57 -0000 Author: neel Date: Sun Sep 21 18:52:56 2014 New Revision: 271933 URL: http://svnweb.freebsd.org/changeset/base/271933 Log: Get rid of unused stat VMM_HLT_IGNORED. Modified: projects/bhyve_svm/sys/amd64/vmm/vmm_stat.c projects/bhyve_svm/sys/amd64/vmm/vmm_stat.h Modified: projects/bhyve_svm/sys/amd64/vmm/vmm_stat.c ============================================================================== --- projects/bhyve_svm/sys/amd64/vmm/vmm_stat.c Sun Sep 21 18:15:09 2014 (r271932) +++ projects/bhyve_svm/sys/amd64/vmm/vmm_stat.c Sun Sep 21 18:52:56 2014 (r271933) @@ -152,7 +152,6 @@ VMM_STAT(VCPU_MIGRATIONS, "vcpu migratio VMM_STAT(VMEXIT_COUNT, "total number of vm exits"); VMM_STAT(VMEXIT_EXTINT, "vm exits due to external interrupt"); VMM_STAT(VMEXIT_HLT, "number of times hlt was intercepted"); -VMM_STAT(VMEXIT_HLT_IGNORED, "number of times hlt was ignored"); VMM_STAT(VMEXIT_CR_ACCESS, "number of times %cr access was intercepted"); VMM_STAT(VMEXIT_RDMSR, "number of times rdmsr was intercepted"); VMM_STAT(VMEXIT_WRMSR, "number of times wrmsr was intercepted"); Modified: projects/bhyve_svm/sys/amd64/vmm/vmm_stat.h ============================================================================== --- projects/bhyve_svm/sys/amd64/vmm/vmm_stat.h Sun Sep 21 18:15:09 2014 (r271932) +++ projects/bhyve_svm/sys/amd64/vmm/vmm_stat.h Sun Sep 21 18:52:56 2014 (r271933) @@ -141,7 +141,6 @@ VMM_STAT_DECLARE(VCPU_MIGRATIONS); VMM_STAT_DECLARE(VMEXIT_COUNT); VMM_STAT_DECLARE(VMEXIT_EXTINT); VMM_STAT_DECLARE(VMEXIT_HLT); -VMM_STAT_DECLARE(VMEXIT_HLT_IGNORED); VMM_STAT_DECLARE(VMEXIT_CR_ACCESS); VMM_STAT_DECLARE(VMEXIT_RDMSR); VMM_STAT_DECLARE(VMEXIT_WRMSR); From owner-svn-src-projects@FreeBSD.ORG Sun Sep 21 19:34:29 2014 Return-Path: Delivered-To: svn-src-projects@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 ESMTPS id 2580B7D4; Sun, 21 Sep 2014 19:34:29 +0000 (UTC) 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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 10EE2EC4; Sun, 21 Sep 2014 19:34:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8LJYSWN063794; Sun, 21 Sep 2014 19:34:28 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8LJYSUH063793; Sun, 21 Sep 2014 19:34:28 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201409211934.s8LJYSUH063793@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 21 Sep 2014 19:34:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r271935 - projects/arm_intrng/sys/arm/arm X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Sep 2014 19:34:29 -0000 Author: ian Date: Sun Sep 21 19:34:28 2014 New Revision: 271935 URL: http://svnweb.freebsd.org/changeset/base/271935 Log: Automatically allocate an ic_intrs array for nexus when it registers; nexus isn't described in the fdt data which usually triggers allocation. Modified: projects/arm_intrng/sys/arm/arm/intrng.c Modified: projects/arm_intrng/sys/arm/arm/intrng.c ============================================================================== --- projects/arm_intrng/sys/arm/arm/intrng.c Sun Sep 21 19:31:19 2014 (r271934) +++ projects/arm_intrng/sys/arm/arm/intrng.c Sun Sep 21 19:34:28 2014 (r271935) @@ -309,6 +309,21 @@ arm_register_pic(device_t dev, int flags ic->ic_dev = dev; ic->ic_node = node; + /* + * Normally ic_intrs is allocated by arm_fdt_map_irq(), but the nexus + * root isn't described by fdt data. If the node is -1 and the ic_intrs + * array hasn't yet been allocated, we're dealing with nexus, allocate a + * single entry for irq 0. + */ + if (node == -1 && ic->ic_intrs == NULL) { + ic->ic_intrs = malloc(sizeof(struct arm_intr_handler), M_INTRNG, + M_WAITOK | M_ZERO); + ic->ic_maxintrs = 1; + ih = &ic->ic_intrs[0]; + ih->ih_pic = ic; + ih->ih_ncells = 0; + } + debugf("device %s node %08x slot %d\n", device_get_nameunit(dev), ic->ic_node, i); From owner-svn-src-projects@FreeBSD.ORG Sun Sep 21 23:42:56 2014 Return-Path: Delivered-To: svn-src-projects@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 ESMTPS id 9831FCB1; Sun, 21 Sep 2014 23:42:56 +0000 (UTC) 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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8269A9E9; Sun, 21 Sep 2014 23:42:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8LNguQ2082282; Sun, 21 Sep 2014 23:42:56 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8LNgtoa082275; Sun, 21 Sep 2014 23:42:55 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201409212342.s8LNgtoa082275@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Sun, 21 Sep 2014 23:42:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r271939 - projects/bhyve_svm/sys/amd64/vmm/amd X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Sep 2014 23:42:56 -0000 Author: neel Date: Sun Sep 21 23:42:54 2014 New Revision: 271939 URL: http://svnweb.freebsd.org/changeset/base/271939 Log: Allow more VMCB fields to be cached: - CR2 - CR0, CR3, CR4 and EFER - GDT/IDT base/limit fields - CS/DS/ES/SS selector/base/limit/attrib fields The caching can be further restricted via the tunable 'hw.vmm.svm.vmcb_clean'. Restructure the code such that the fields above are only modified in a single place. This makes it easy to invalidate the VMCB cache when any of these fields is modified. Modified: projects/bhyve_svm/sys/amd64/vmm/amd/svm.c projects/bhyve_svm/sys/amd64/vmm/amd/svm.h projects/bhyve_svm/sys/amd64/vmm/amd/svm_softc.h projects/bhyve_svm/sys/amd64/vmm/amd/vmcb.c projects/bhyve_svm/sys/amd64/vmm/amd/vmcb.h Modified: projects/bhyve_svm/sys/amd64/vmm/amd/svm.c ============================================================================== --- projects/bhyve_svm/sys/amd64/vmm/amd/svm.c Sun Sep 21 21:31:16 2014 (r271938) +++ projects/bhyve_svm/sys/amd64/vmm/amd/svm.c Sun Sep 21 23:42:54 2014 (r271939) @@ -89,16 +89,22 @@ SYSCTL_NODE(_hw_vmm, OID_AUTO, svm, CTLF VMCB_CACHE_IOPM | \ VMCB_CACHE_I | \ VMCB_CACHE_TPR | \ + VMCB_CACHE_CR2 | \ + VMCB_CACHE_CR | \ + VMCB_CACHE_DT | \ + VMCB_CACHE_SEG | \ VMCB_CACHE_NP) +static uint32_t vmcb_clean = VMCB_CACHE_DEFAULT; +SYSCTL_INT(_hw_vmm_svm, OID_AUTO, vmcb_clean, CTLFLAG_RDTUN, &vmcb_clean, + 0, NULL); + MALLOC_DEFINE(M_SVM, "svm", "svm"); MALLOC_DEFINE(M_SVM_VLAPIC, "svm-vlapic", "svm-vlapic"); /* Per-CPU context area. */ extern struct pcpu __pcpu[]; -static int svm_getdesc(void *arg, int vcpu, int type, struct seg_desc *desc); - static uint32_t svm_feature; /* AMD SVM features. */ SYSCTL_UINT(_hw_vmm_svm, OID_AUTO, features, CTLFLAG_RD, &svm_feature, 0, "SVM features advertised by CPUID.8000000AH:EDX"); @@ -129,6 +135,8 @@ static VMM_STAT_AMD(VCPU_EXITINTINFO, "V static VMM_STAT_AMD(VCPU_INTINFO_INJECTED, "Events pending at VM entry"); static VMM_STAT_AMD(VMEXIT_VINTR, "VM exits due to interrupt window"); +static int svm_setreg(void *arg, int vcpu, int ident, uint64_t val); + /* * Common function to enable or disabled SVM for a CPU. */ @@ -292,6 +300,8 @@ svm_init(int ipinum) if (err) return (err); + vmcb_clean &= VMCB_CACHE_DEFAULT; + for (cpu = 0; cpu < MAXCPU; cpu++) { /* * Initialize the host ASIDs to their "highest" valid values. @@ -410,16 +420,6 @@ svm_msr_rd_ok(uint8_t *perm_bitmap, uint return svm_msr_perm(perm_bitmap, msr, true, false); } -static __inline void -vcpu_set_dirty(struct svm_softc *sc, int vcpu, uint32_t dirtybits) -{ - struct svm_vcpu *vcpustate; - - vcpustate = svm_get_vcpu(sc, vcpu); - - vcpustate->dirty |= dirtybits; -} - static __inline int svm_get_intercept(struct svm_softc *sc, int vcpu, int idx, uint32_t bitmask) { @@ -449,7 +449,7 @@ svm_set_intercept(struct svm_softc *sc, ctrl->intercept[idx] &= ~bitmask; if (ctrl->intercept[idx] != oldval) { - vcpu_set_dirty(sc, vcpu, VMCB_CACHE_I); + svm_set_dirty(sc, vcpu, VMCB_CACHE_I); VCPU_CTR3(sc->vm, vcpu, "intercept[%d] modified " "from %#x to %#x", idx, oldval, ctrl->intercept[idx]); } @@ -592,6 +592,10 @@ svm_vminit(struct vm *vm, pmap_t pmap) svm_msr_rw_ok(svm_sc->msr_bitmap, MSR_PAT); svm_msr_rd_ok(svm_sc->msr_bitmap, MSR_TSC); + + /* + * Intercept writes to make sure that the EFER_SVM bit is not cleared. + */ svm_msr_rd_ok(svm_sc->msr_bitmap, MSR_EFER); /* Intercept access to all I/O ports. */ @@ -627,18 +631,22 @@ svm_cpl(struct vmcb_state *state) static enum vm_cpu_mode svm_vcpu_mode(struct vmcb *vmcb) { - struct vmcb_segment *seg; + struct vmcb_segment seg; struct vmcb_state *state; + int error; state = &vmcb->state; if (state->efer & EFER_LMA) { - seg = vmcb_seg(vmcb, VM_REG_GUEST_CS); + error = vmcb_seg(vmcb, VM_REG_GUEST_CS, &seg); + KASSERT(error == 0, ("%s: vmcb_seg(cs) error %d", __func__, + error)); + /* * Section 4.8.1 for APM2, check if Code Segment has * Long attribute set in descriptor. */ - if (seg->attrib & VMCB_CS_ATTRIB_L) + if (seg.attrib & VMCB_CS_ATTRIB_L) return (CPU_MODE_64BIT); else return (CPU_MODE_COMPATIBILITY); @@ -700,7 +708,7 @@ svm_inout_str_seginfo(struct svm_softc * vis->seg_name = vm_segment_name(s); } - error = svm_getdesc(svm_sc, vcpu, vis->seg_name, &vis->seg_desc); + error = vmcb_getdesc(svm_sc, vcpu, vis->seg_name, &vis->seg_desc); KASSERT(error == 0, ("%s: svm_getdesc error %d", __func__, error)); } @@ -824,10 +832,10 @@ static void svm_handle_inst_emul(struct vmcb *vmcb, uint64_t gpa, struct vm_exit *vmexit) { struct vm_guest_paging *paging; - struct vmcb_segment *seg; + struct vmcb_segment seg; struct vmcb_ctrl *ctrl; char *inst_bytes; - int inst_len; + int error, inst_len; ctrl = &vmcb->ctrl; paging = &vmexit->u.inst_emul.paging; @@ -837,14 +845,16 @@ svm_handle_inst_emul(struct vmcb *vmcb, vmexit->u.inst_emul.gla = VIE_INVALID_GLA; svm_paging_info(vmcb, paging); - seg = vmcb_seg(vmcb, VM_REG_GUEST_CS); + error = vmcb_seg(vmcb, VM_REG_GUEST_CS, &seg); + KASSERT(error == 0, ("%s: vmcb_seg(CS) error %d", __func__, error)); + switch(paging->cpu_mode) { case CPU_MODE_PROTECTED: case CPU_MODE_COMPATIBILITY: /* * Section 4.8.1 of APM2, Default Operand Size or D bit. */ - vmexit->u.inst_emul.cs_d = (seg->attrib & VMCB_CS_ATTRIB_D) ? + vmexit->u.inst_emul.cs_d = (seg.attrib & VMCB_CS_ATTRIB_D) ? 1 : 0; break; default: @@ -865,28 +875,6 @@ svm_handle_inst_emul(struct vmcb *vmcb, vie_init(&vmexit->u.inst_emul.vie, inst_bytes, inst_len); } -/* - * Intercept access to MSR_EFER to prevent the guest from clearing the - * SVM enable bit. - */ -static int -svm_write_efer(struct svm_softc *sc, int vcpu, uint64_t val) -{ - struct vmcb_state *state; - uint64_t oldval; - - state = svm_get_vmcb_state(sc, vcpu); - - oldval = state->efer; - state->efer = val | EFER_SVM; - if (state->efer != oldval) { - VCPU_CTR2(sc->vm, vcpu, "Guest EFER changed from %#lx to %#lx", - oldval, state->efer); - vcpu_set_dirty(sc, vcpu, VMCB_CACHE_CR); - } - return (0); -} - #ifdef KTR static const char * intrtype_to_str(int intr_type) @@ -1028,7 +1016,7 @@ enable_intr_window_exiting(struct svm_so ctrl->v_irq = 1; ctrl->v_ign_tpr = 1; ctrl->v_intr_vector = 0; - vcpu_set_dirty(sc, vcpu, VMCB_CACHE_TPR); + svm_set_dirty(sc, vcpu, VMCB_CACHE_TPR); svm_enable_intercept(sc, vcpu, VMCB_CTRL1_INTCPT, VMCB_INTCPT_VINTR); } @@ -1053,7 +1041,7 @@ disable_intr_window_exiting(struct svm_s #endif ctrl->v_irq = 0; ctrl->v_intr_vector = 0; - vcpu_set_dirty(sc, vcpu, VMCB_CACHE_TPR); + svm_set_dirty(sc, vcpu, VMCB_CACHE_TPR); svm_disable_intercept(sc, vcpu, VMCB_CTRL1_INTCPT, VMCB_INTCPT_VINTR); } @@ -1144,7 +1132,7 @@ emulate_wrmsr(struct svm_softc *sc, int if (lapic_msr(num)) error = lapic_wrmsr(sc->vm, vcpu, num, val, retu); else if (num == MSR_EFER) - error = svm_write_efer(sc, vcpu, val); + error = svm_setreg(sc, vcpu, VM_REG_GUEST_EFER, val); else error = svm_wrmsr(sc, vcpu, num, val, retu); @@ -1622,7 +1610,7 @@ done: VCPU_CTR2(sc->vm, vcpu, "VMCB V_TPR changed from %#x to %#x", ctrl->v_tpr, v_tpr); ctrl->v_tpr = v_tpr; - vcpu_set_dirty(sc, vcpu, VMCB_CACHE_TPR); + svm_set_dirty(sc, vcpu, VMCB_CACHE_TPR); } if (pending_apic_vector) { @@ -1638,7 +1626,7 @@ done: ctrl->v_ign_tpr = 0; ctrl->v_intr_vector = pending_apic_vector; ctrl->v_intr_prio = pending_apic_vector >> 4; - vcpu_set_dirty(sc, vcpu, VMCB_CACHE_TPR); + svm_set_dirty(sc, vcpu, VMCB_CACHE_TPR); } else if (need_intr_window) { /* * We use V_IRQ in conjunction with the VINTR intercept to @@ -1764,7 +1752,7 @@ check_asid(struct svm_softc *sc, int vcp vcpustate->asid.num = asid[thiscpu].num; ctrl->asid = vcpustate->asid.num; - vcpu_set_dirty(sc, vcpuid, VMCB_CACHE_ASID); + svm_set_dirty(sc, vcpuid, VMCB_CACHE_ASID); /* * If this cpu supports "flush-by-asid" then the TLB * was not flushed after the generation bump. The TLB @@ -1830,7 +1818,7 @@ svm_vmrun(void *arg, int vcpu, register_ /* * Invalidate the VMCB state cache by marking all fields dirty. */ - vcpu_set_dirty(svm_sc, vcpu, 0xffffffff); + svm_set_dirty(svm_sc, vcpu, 0xffffffff); /* * XXX @@ -1891,7 +1879,7 @@ svm_vmrun(void *arg, int vcpu, register_ */ check_asid(svm_sc, vcpu, pmap, thiscpu); - ctrl->vmcb_clean = VMCB_CACHE_DEFAULT & ~vcpustate->dirty; + ctrl->vmcb_clean = vmcb_clean & ~vcpustate->dirty; vcpustate->dirty = 0; VCPU_CTR1(vm, vcpu, "vmcb clean %#x", ctrl->vmcb_clean); @@ -2001,17 +1989,15 @@ static int svm_getreg(void *arg, int vcpu, int ident, uint64_t *val) { struct svm_softc *svm_sc; - struct vmcb *vmcb; register_t *reg; svm_sc = arg; - vmcb = svm_get_vmcb(svm_sc, vcpu); if (ident == VM_REG_GUEST_INTR_SHADOW) { return (svm_get_intr_shadow(svm_sc, vcpu, val)); } - if (vmcb_read(vmcb, ident, val) == 0) { + if (vmcb_read(svm_sc, vcpu, ident, val) == 0) { return (0); } @@ -2034,17 +2020,15 @@ static int svm_setreg(void *arg, int vcpu, int ident, uint64_t val) { struct svm_softc *svm_sc; - struct vmcb *vmcb; register_t *reg; svm_sc = arg; - vmcb = svm_get_vmcb(svm_sc, vcpu); if (ident == VM_REG_GUEST_INTR_SHADOW) { return (svm_modify_intr_shadow(svm_sc, vcpu, val)); } - if (vmcb_write(vmcb, ident, val) == 0) { + if (vmcb_write(svm_sc, vcpu, ident, val) == 0) { return (0); } @@ -2065,81 +2049,6 @@ svm_setreg(void *arg, int vcpu, int iden return (EINVAL); } - -/* - * Inteface to set various descriptors. - */ -static int -svm_setdesc(void *arg, int vcpu, int type, struct seg_desc *desc) -{ - struct svm_softc *svm_sc; - struct vmcb *vmcb; - struct vmcb_segment *seg; - uint16_t attrib; - - svm_sc = arg; - vmcb = svm_get_vmcb(svm_sc, vcpu); - - VCPU_CTR1(svm_sc->vm, vcpu, "SVM:set_desc: Type%d\n", type); - - seg = vmcb_seg(vmcb, type); - if (seg == NULL) { - ERR("SVM_ERR:Unsupported segment type%d\n", type); - return (EINVAL); - } - - /* Map seg_desc access to VMCB attribute format.*/ - attrib = ((desc->access & 0xF000) >> 4) | (desc->access & 0xFF); - VCPU_CTR3(svm_sc->vm, vcpu, "SVM:[sel %d attribute 0x%x limit:0x%x]\n", - type, desc->access, desc->limit); - seg->attrib = attrib; - seg->base = desc->base; - seg->limit = desc->limit; - - return (0); -} - -/* - * Interface to get guest descriptor. - */ -static int -svm_getdesc(void *arg, int vcpu, int type, struct seg_desc *desc) -{ - struct svm_softc *svm_sc; - struct vmcb_segment *seg; - - svm_sc = arg; - VCPU_CTR1(svm_sc->vm, vcpu, "SVM:get_desc: Type%d\n", type); - - seg = vmcb_seg(svm_get_vmcb(svm_sc, vcpu), type); - if (!seg) { - ERR("SVM_ERR:Unsupported segment type%d\n", type); - return (EINVAL); - } - - /* Map seg_desc access to VMCB attribute format.*/ - desc->access = ((seg->attrib & 0xF00) << 4) | (seg->attrib & 0xFF); - desc->base = seg->base; - desc->limit = seg->limit; - - /* - * VT-x uses bit 16 (Unusable) to indicate a segment that has been - * loaded with a NULL segment selector. The 'desc->access' field is - * interpreted in the VT-x format by the processor-independent code. - * - * SVM uses the 'P' bit to convey the same information so convert it - * into the VT-x format. For more details refer to section - * "Segment State in the VMCB" in APMv2. - */ - if (type == VM_REG_GUEST_CS && type == VM_REG_GUEST_TR) - desc->access |= 0x80; /* CS and TS always present */ - - if (!(desc->access & 0x80)) - desc->access |= 0x10000; /* Unusable segment */ - - return (0); -} - static int svm_setcap(void *arg, int vcpu, int type, int val) { @@ -2231,8 +2140,8 @@ struct vmm_ops vmm_ops_amd = { svm_vmcleanup, svm_getreg, svm_setreg, - svm_getdesc, - svm_setdesc, + vmcb_getdesc, + vmcb_setdesc, svm_getcap, svm_setcap, svm_npt_alloc, Modified: projects/bhyve_svm/sys/amd64/vmm/amd/svm.h ============================================================================== --- projects/bhyve_svm/sys/amd64/vmm/amd/svm.h Sun Sep 21 21:31:16 2014 (r271938) +++ projects/bhyve_svm/sys/amd64/vmm/amd/svm.h Sun Sep 21 23:42:54 2014 (r271939) @@ -92,25 +92,4 @@ enable_gintr(void) __asm __volatile("stgi" : : :); } -static __inline void -save_cr2(uint64_t *cr2) -{ - - __asm __volatile( - "mov %%cr2, %%rax; movq %%rax, %0" - :"=m"(*cr2) - : - :"rax", "memory"); -} - -static __inline void -load_cr2(uint64_t *cr2) -{ - __asm __volatile( - "movq %0, %%rax; movq %%rax, %%cr2" - : - :"m"(*cr2) - :"rax"); -} - #endif /* _SVM_H_ */ Modified: projects/bhyve_svm/sys/amd64/vmm/amd/svm_softc.h ============================================================================== --- projects/bhyve_svm/sys/amd64/vmm/amd/svm_softc.h Sun Sep 21 21:31:16 2014 (r271938) +++ projects/bhyve_svm/sys/amd64/vmm/amd/svm_softc.h Sun Sep 21 23:42:54 2014 (r271939) @@ -116,5 +116,14 @@ svm_get_guest_regctx(struct svm_softc *s return (&(sc->vcpu[vcpu].swctx)); } -void svm_dump_vmcb(struct svm_softc *svm_sc, int vcpu); +static __inline void +svm_set_dirty(struct svm_softc *sc, int vcpu, uint32_t dirtybits) +{ + struct svm_vcpu *vcpustate; + + vcpustate = svm_get_vcpu(sc, vcpu); + + vcpustate->dirty |= dirtybits; +} + #endif /* _SVM_SOFTC_H_ */ Modified: projects/bhyve_svm/sys/amd64/vmm/amd/vmcb.c ============================================================================== --- projects/bhyve_svm/sys/amd64/vmm/amd/vmcb.c Sun Sep 21 21:31:16 2014 (r271938) +++ projects/bhyve_svm/sys/amd64/vmm/amd/vmcb.c Sun Sep 21 23:42:54 2014 (r271939) @@ -35,8 +35,11 @@ __FBSDID("$FreeBSD$"); #include #include +#include "vmm_ktr.h" + #include "vmcb.h" #include "svm.h" +#include "svm_softc.h" /* * The VMCB aka Virtual Machine Control Block is a 4KB aligned page @@ -49,15 +52,77 @@ __FBSDID("$FreeBSD$"); */ /* + * Return VMCB segment area. + */ +static struct vmcb_segment * +vmcb_segptr(struct vmcb *vmcb, int type) +{ + struct vmcb_state *state; + struct vmcb_segment *seg; + + state = &vmcb->state; + + switch (type) { + case VM_REG_GUEST_CS: + seg = &state->cs; + break; + + case VM_REG_GUEST_DS: + seg = &state->ds; + break; + + case VM_REG_GUEST_ES: + seg = &state->es; + break; + + case VM_REG_GUEST_FS: + seg = &state->fs; + break; + + case VM_REG_GUEST_GS: + seg = &state->gs; + break; + + case VM_REG_GUEST_SS: + seg = &state->ss; + break; + + case VM_REG_GUEST_GDTR: + seg = &state->gdt; + break; + + case VM_REG_GUEST_IDTR: + seg = &state->idt; + break; + + case VM_REG_GUEST_LDTR: + seg = &state->ldt; + break; + + case VM_REG_GUEST_TR: + seg = &state->tr; + break; + + default: + seg = NULL; + break; + } + + return (seg); +} + +/* * Read from segment selector, control and general purpose register of VMCB. */ int -vmcb_read(struct vmcb *vmcb, int ident, uint64_t *retval) +vmcb_read(struct svm_softc *sc, int vcpu, int ident, uint64_t *retval) { + struct vmcb *vmcb; struct vmcb_state *state; struct vmcb_segment *seg; int err; + vmcb = svm_get_vmcb(sc, vcpu); state = &vmcb->state; err = 0; @@ -108,20 +173,19 @@ vmcb_read(struct vmcb *vmcb, int ident, case VM_REG_GUEST_FS: case VM_REG_GUEST_GS: case VM_REG_GUEST_SS: - case VM_REG_GUEST_GDTR: - case VM_REG_GUEST_IDTR: case VM_REG_GUEST_LDTR: case VM_REG_GUEST_TR: - seg = vmcb_seg(vmcb, ident); - if (seg == NULL) { - ERR("Invalid seg type %d\n", ident); - err = EINVAL; - break; - } - + seg = vmcb_segptr(vmcb, ident); + KASSERT(seg != NULL, ("%s: unable to get segment %d from VMCB", + __func__, ident)); *retval = seg->selector; break; + case VM_REG_GUEST_GDTR: + case VM_REG_GUEST_IDTR: + /* GDTR and IDTR don't have segment selectors */ + err = EINVAL; + break; default: err = EINVAL; break; @@ -134,30 +198,37 @@ vmcb_read(struct vmcb *vmcb, int ident, * Write to segment selector, control and general purpose register of VMCB. */ int -vmcb_write(struct vmcb *vmcb, int ident, uint64_t val) +vmcb_write(struct svm_softc *sc, int vcpu, int ident, uint64_t val) { + struct vmcb *vmcb; struct vmcb_state *state; struct vmcb_segment *seg; - int err; + int err, dirtyseg; + vmcb = svm_get_vmcb(sc, vcpu); state = &vmcb->state; + dirtyseg = 0; err = 0; switch (ident) { case VM_REG_GUEST_CR0: state->cr0 = val; + svm_set_dirty(sc, vcpu, VMCB_CACHE_CR); break; case VM_REG_GUEST_CR2: state->cr2 = val; + svm_set_dirty(sc, vcpu, VMCB_CACHE_CR2); break; case VM_REG_GUEST_CR3: state->cr3 = val; + svm_set_dirty(sc, vcpu, VMCB_CACHE_CR); break; case VM_REG_GUEST_CR4: state->cr4 = val; + svm_set_dirty(sc, vcpu, VMCB_CACHE_CR); break; case VM_REG_GUEST_DR7: @@ -167,6 +238,7 @@ vmcb_write(struct vmcb *vmcb, int ident, case VM_REG_GUEST_EFER: /* EFER_SVM must always be set when the guest is executing */ state->efer = val | EFER_SVM; + svm_set_dirty(sc, vcpu, VMCB_CACHE_CR); break; case VM_REG_GUEST_RAX: @@ -188,86 +260,135 @@ vmcb_write(struct vmcb *vmcb, int ident, case VM_REG_GUEST_CS: case VM_REG_GUEST_DS: case VM_REG_GUEST_ES: + case VM_REG_GUEST_SS: + dirtyseg = 1; /* FALLTHROUGH */ case VM_REG_GUEST_FS: case VM_REG_GUEST_GS: - case VM_REG_GUEST_SS: - case VM_REG_GUEST_GDTR: - case VM_REG_GUEST_IDTR: case VM_REG_GUEST_LDTR: case VM_REG_GUEST_TR: - seg = vmcb_seg(vmcb, ident); - if (seg == NULL) { - ERR("Invalid segment type %d\n", ident); - err = EINVAL; - break; - } - + seg = vmcb_segptr(vmcb, ident); + KASSERT(seg != NULL, ("%s: unable to get segment %d from VMCB", + __func__, ident)); seg->selector = val; + if (dirtyseg) + svm_set_dirty(sc, vcpu, VMCB_CACHE_SEG); break; + case VM_REG_GUEST_GDTR: + case VM_REG_GUEST_IDTR: + /* GDTR and IDTR don't have segment selectors */ + err = EINVAL; + break; default: err = EINVAL; + break; } return (err); } -/* - * Return VMCB segment area. - */ -struct vmcb_segment * -vmcb_seg(struct vmcb *vmcb, int type) +int +vmcb_seg(struct vmcb *vmcb, int ident, struct vmcb_segment *seg2) { - struct vmcb_state *state; struct vmcb_segment *seg; - state = &vmcb->state; - - switch (type) { - case VM_REG_GUEST_CS: - seg = &state->cs; - break; + seg = vmcb_segptr(vmcb, ident); + if (seg != NULL) { + bcopy(seg, seg2, sizeof(struct vmcb_segment)); + return (0); + } else { + return (EINVAL); + } +} - case VM_REG_GUEST_DS: - seg = &state->ds; - break; +int +vmcb_setdesc(void *arg, int vcpu, int reg, struct seg_desc *desc) +{ + struct vmcb *vmcb; + struct svm_softc *sc; + struct vmcb_segment *seg; + uint16_t attrib; - case VM_REG_GUEST_ES: - seg = &state->es; - break; + sc = arg; + vmcb = svm_get_vmcb(sc, vcpu); - case VM_REG_GUEST_FS: - seg = &state->fs; - break; + seg = vmcb_segptr(vmcb, reg); + KASSERT(seg != NULL, ("%s: invalid segment descriptor %d", + __func__, reg)); + + seg->base = desc->base; + seg->limit = desc->limit; + if (reg != VM_REG_GUEST_GDTR && reg != VM_REG_GUEST_IDTR) { + /* + * Map seg_desc access to VMCB attribute format. + * + * SVM uses the 'P' bit in the segment attributes to indicate a + * NULL segment so clear it if the segment is marked unusable. + */ + attrib = ((desc->access & 0xF000) >> 4) | (desc->access & 0xFF); + if (SEG_DESC_UNUSABLE(desc->access)) { + attrib &= ~0x80; + } + seg->attrib = attrib; + } - case VM_REG_GUEST_GS: - seg = &state->gs; - break; + VCPU_CTR4(sc->vm, vcpu, "Setting desc %d: base (%#lx), limit (%#x), " + "attrib (%#x)", reg, seg->base, seg->limit, seg->attrib); + switch (reg) { + case VM_REG_GUEST_CS: + case VM_REG_GUEST_DS: + case VM_REG_GUEST_ES: case VM_REG_GUEST_SS: - seg = &state->ss; - break; - + svm_set_dirty(sc, vcpu, VMCB_CACHE_SEG); case VM_REG_GUEST_GDTR: - seg = &state->gdt; - break; - case VM_REG_GUEST_IDTR: - seg = &state->idt; + svm_set_dirty(sc, vcpu, VMCB_CACHE_DT); break; - - case VM_REG_GUEST_LDTR: - seg = &state->ldt; + default: break; + } - case VM_REG_GUEST_TR: - seg = &state->tr; - break; + return (0); +} - default: - seg = NULL; - break; +int +vmcb_getdesc(void *arg, int vcpu, int reg, struct seg_desc *desc) +{ + struct vmcb *vmcb; + struct svm_softc *sc; + struct vmcb_segment *seg; + + sc = arg; + vmcb = svm_get_vmcb(sc, vcpu); + seg = vmcb_segptr(vmcb, reg); + KASSERT(seg != NULL, ("%s: invalid segment descriptor %d", + __func__, reg)); + + desc->base = seg->base; + desc->limit = seg->limit; + desc->access = 0; + + if (reg != VM_REG_GUEST_GDTR && reg != VM_REG_GUEST_IDTR) { + /* Map seg_desc access to VMCB attribute format */ + desc->access = ((seg->attrib & 0xF00) << 4) | + (seg->attrib & 0xFF); + + /* + * VT-x uses bit 16 to indicate a segment that has been loaded + * with a NULL selector (aka unusable). The 'desc->access' + * field is interpreted in the VT-x format by the + * processor-independent code. + * + * SVM uses the 'P' bit to convey the same information so + * convert it into the VT-x format. For more details refer to + * section "Segment State in the VMCB" in APMv2. + */ + if (reg != VM_REG_GUEST_CS && reg != VM_REG_GUEST_TR) { + if ((desc->access & 0x80) == 0) + desc->access |= 0x10000; /* Unusable segment */ + } } - return (seg); + return (0); } Modified: projects/bhyve_svm/sys/amd64/vmm/amd/vmcb.h ============================================================================== --- projects/bhyve_svm/sys/amd64/vmm/amd/vmcb.h Sun Sep 21 21:31:16 2014 (r271938) +++ projects/bhyve_svm/sys/amd64/vmm/amd/vmcb.h Sun Sep 21 23:42:54 2014 (r271939) @@ -29,6 +29,8 @@ #ifndef _VMCB_H_ #define _VMCB_H_ +struct svm_softc; + /* * Secure Virtual Machine: AMD64 Programmer's Manual Vol2, Chapter 15 * Layout of VMCB: AMD64 Programmer's Manual Vol2, Appendix B @@ -279,8 +281,10 @@ struct vmcb { CTASSERT(sizeof(struct vmcb) == PAGE_SIZE); CTASSERT(offsetof(struct vmcb, state) == 0x400); -int vmcb_read(struct vmcb *vmcb, int ident, uint64_t *retval); -int vmcb_write(struct vmcb *vmcb, int ident, uint64_t val); -struct vmcb_segment *vmcb_seg(struct vmcb *vmcb, int type); +int vmcb_read(struct svm_softc *sc, int vcpu, int ident, uint64_t *retval); +int vmcb_write(struct svm_softc *sc, int vcpu, int ident, uint64_t val); +int vmcb_setdesc(void *arg, int vcpu, int ident, struct seg_desc *desc); +int vmcb_getdesc(void *arg, int vcpu, int ident, struct seg_desc *desc); +int vmcb_seg(struct vmcb *vmcb, int ident, struct vmcb_segment *seg); #endif /* _VMCB_H_ */ From owner-svn-src-projects@FreeBSD.ORG Mon Sep 22 22:38:55 2014 Return-Path: Delivered-To: svn-src-projects@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 ESMTPS id B57C9294; Mon, 22 Sep 2014 22:38:55 +0000 (UTC) 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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A1746206; Mon, 22 Sep 2014 22:38:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MMctG0064448; Mon, 22 Sep 2014 22:38:55 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MMcti1064447; Mon, 22 Sep 2014 22:38:55 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201409222238.s8MMcti1064447@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 22 Sep 2014 22:38:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r272005 - projects/arm_intrng/sys/arm/arm X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 22:38:55 -0000 Author: ian Date: Mon Sep 22 22:38:54 2014 New Revision: 272005 URL: http://svnweb.freebsd.org/changeset/base/272005 Log: Use the right variable for determining that we exited the loop without finding an interrupt handler. Modified: projects/arm_intrng/sys/arm/arm/intrng.c Modified: projects/arm_intrng/sys/arm/arm/intrng.c ============================================================================== --- projects/arm_intrng/sys/arm/arm/intrng.c Mon Sep 22 21:12:30 2014 (r272004) +++ projects/arm_intrng/sys/arm/arm/intrng.c Mon Sep 22 22:38:54 2014 (r272005) @@ -144,7 +144,7 @@ arm_dispatch_irq(device_t dev, struct tr } } - if (ih == NULL) + if (ic->ic_dev == NULL) panic("arm_dispatch_irq: unknown irq"); debugf("requested by %s\n", ih->ih_ipi_name != NULL From owner-svn-src-projects@FreeBSD.ORG Sat Sep 27 02:04:59 2014 Return-Path: Delivered-To: svn-src-projects@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 ESMTPS id CB1AAE06; Sat, 27 Sep 2014 02:04:59 +0000 (UTC) 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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B50818C4; Sat, 27 Sep 2014 02:04:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8R24x1I029496; Sat, 27 Sep 2014 02:04:59 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8R24wvf029488; Sat, 27 Sep 2014 02:04:58 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201409270204.s8R24wvf029488@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Sat, 27 Sep 2014 02:04:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r272195 - projects/bhyve_svm/sys/amd64/vmm/amd X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2014 02:04:59 -0000 Author: neel Date: Sat Sep 27 02:04:58 2014 New Revision: 272195 URL: http://svnweb.freebsd.org/changeset/base/272195 Log: Simplify register state save and restore across a VMRUN: - Host registers are now stored on the stack instead of a per-cpu host context. - Host %FS and %GS selectors are not saved and restored across VMRUN. - Restoring the %FS/%GS selectors was futile anyways since that only updates the low 32 bits of base address in the hidden descriptor state. - GS.base is properly updated via the MSR_GSBASE on return from svm_launch(). - FS.base is not used while inside the kernel so it can be safely ignored. - Add function prologue/epilogue so svm_launch() can be traced with Dtrace's FBT entry/exit probes. They also serve to save/restore the host %rbp across VMRUN. Reviewed by: grehan Discussed with: Anish Gupta (akgupt3@gmail.com) Modified: projects/bhyve_svm/sys/amd64/vmm/amd/svm.c projects/bhyve_svm/sys/amd64/vmm/amd/svm.h projects/bhyve_svm/sys/amd64/vmm/amd/svm_genassym.c projects/bhyve_svm/sys/amd64/vmm/amd/svm_support.S Modified: projects/bhyve_svm/sys/amd64/vmm/amd/svm.c ============================================================================== --- projects/bhyve_svm/sys/amd64/vmm/amd/svm.c Sat Sep 27 01:50:03 2014 (r272194) +++ projects/bhyve_svm/sys/amd64/vmm/amd/svm.c Sat Sep 27 02:04:58 2014 (r272195) @@ -126,11 +126,6 @@ static struct asid asid[MAXCPU]; */ static uint8_t hsave[MAXCPU][PAGE_SIZE] __aligned(PAGE_SIZE); -/* - * S/w saved host context. - */ -static struct svm_regctx host_ctx[MAXCPU]; - static VMM_STAT_AMD(VCPU_EXITINTINFO, "VM exits during event delivery"); static VMM_STAT_AMD(VCPU_INTINFO_INJECTED, "Events pending at VM entry"); static VMM_STAT_AMD(VMEXIT_VINTR, "VM exits due to interrupt window"); @@ -679,7 +674,7 @@ svm_inout_str_index(struct svm_regctx *r { uint64_t val; - val = in ? regs->e.g.sctx_rdi : regs->e.g.sctx_rsi; + val = in ? regs->sctx_rdi : regs->sctx_rsi; return (val); } @@ -1156,7 +1151,7 @@ emulate_rdmsr(struct svm_softc *sc, int state = svm_get_vmcb_state(sc, vcpu); ctx = svm_get_guest_regctx(sc, vcpu); state->rax = result & 0xffffffff; - ctx->e.g.sctx_rdx = result >> 32; + ctx->sctx_rdx = result >> 32; } return (error); @@ -1315,7 +1310,7 @@ svm_vmexit(struct svm_softc *svm_sc, int case VMCB_EXIT_MSR: /* MSR access. */ eax = state->rax; ecx = ctx->sctx_rcx; - edx = ctx->e.g.sctx_rdx; + edx = ctx->sctx_rdx; retu = false; if (info1) { @@ -1357,7 +1352,7 @@ svm_vmexit(struct svm_softc *svm_sc, int (uint32_t *)&state->rax, (uint32_t *)&ctx->sctx_rbx, (uint32_t *)&ctx->sctx_rcx, - (uint32_t *)&ctx->e.g.sctx_rdx); + (uint32_t *)&ctx->sctx_rdx); break; case VMCB_EXIT_HLT: vmm_stat_incr(svm_sc->vm, vcpu, VMEXIT_HLT, 1); @@ -1775,7 +1770,7 @@ static int svm_vmrun(void *arg, int vcpu, register_t rip, pmap_t pmap, void *rend_cookie, void *suspended_cookie) { - struct svm_regctx *hctx, *gctx; + struct svm_regctx *gctx; struct svm_softc *svm_sc; struct svm_vcpu *vcpustate; struct vmcb_state *state; @@ -1806,7 +1801,6 @@ svm_vmrun(void *arg, int vcpu, register_ thiscpu = curcpu; gctx = svm_get_guest_regctx(svm_sc, vcpu); - hctx = &host_ctx[thiscpu]; vmcb_pa = svm_sc->vcpu[vcpu].vmcb_pa; if (vcpustate->lastcpu != thiscpu) { @@ -1885,7 +1879,7 @@ svm_vmrun(void *arg, int vcpu, register_ /* Launch Virtual Machine. */ VCPU_CTR1(vm, vcpu, "Resume execution at %#lx", state->rip); - svm_launch(vmcb_pa, gctx, hctx); + svm_launch(vmcb_pa, gctx); CPU_CLR_ATOMIC(thiscpu, &pmap->pm_active); @@ -1950,11 +1944,11 @@ swctx_regptr(struct svm_regctx *regctx, case VM_REG_GUEST_RCX: return (®ctx->sctx_rcx); case VM_REG_GUEST_RDX: - return (®ctx->e.g.sctx_rdx); + return (®ctx->sctx_rdx); case VM_REG_GUEST_RDI: - return (®ctx->e.g.sctx_rdi); + return (®ctx->sctx_rdi); case VM_REG_GUEST_RSI: - return (®ctx->e.g.sctx_rsi); + return (®ctx->sctx_rsi); case VM_REG_GUEST_RBP: return (®ctx->sctx_rbp); case VM_REG_GUEST_R8: Modified: projects/bhyve_svm/sys/amd64/vmm/amd/svm.h ============================================================================== --- projects/bhyve_svm/sys/amd64/vmm/amd/svm.h Sat Sep 27 01:50:03 2014 (r272194) +++ projects/bhyve_svm/sys/amd64/vmm/amd/svm.h Sat Sep 27 02:04:58 2014 (r272195) @@ -34,33 +34,15 @@ printf("SVM ERROR:%s " fmt "\n", __func__, ##args); /* - * Software saved machine state for guest and host. + * Guest register state that is saved outside the VMCB. */ - -/* Additional guest register state */ -struct svm_gctx { - register_t sctx_rdx; - register_t sctx_rdi; - register_t sctx_rsi; - /* Points to host context area. */ - register_t sctx_hostctx_base; -}; - -/* Additional host register state */ -struct svm_hctx { - uint16_t sctx_fs; - uint16_t sctx_gs; - - register_t sctx_rsp; -}; - -/* Common register context area for guest and host. */ struct svm_regctx { register_t sctx_rbp; - - register_t sctx_rbx; + register_t sctx_rbx; register_t sctx_rcx; - + register_t sctx_rdx; + register_t sctx_rdi; + register_t sctx_rsi; register_t sctx_r8; register_t sctx_r9; register_t sctx_r10; @@ -69,14 +51,9 @@ struct svm_regctx { register_t sctx_r13; register_t sctx_r14; register_t sctx_r15; - - union { - struct svm_hctx h; /* host-specific register state */ - struct svm_gctx g; /* guest-specific register state */ - } e; }; -void svm_launch(uint64_t pa, struct svm_regctx *, struct svm_regctx *); +void svm_launch(uint64_t pa, struct svm_regctx *); static __inline void disable_gintr(void) Modified: projects/bhyve_svm/sys/amd64/vmm/amd/svm_genassym.c ============================================================================== --- projects/bhyve_svm/sys/amd64/vmm/amd/svm_genassym.c Sat Sep 27 01:50:03 2014 (r272194) +++ projects/bhyve_svm/sys/amd64/vmm/amd/svm_genassym.c Sat Sep 27 02:04:58 2014 (r272195) @@ -35,7 +35,9 @@ __FBSDID("$FreeBSD$"); ASSYM(SCTX_RBX, offsetof(struct svm_regctx, sctx_rbx)); ASSYM(SCTX_RCX, offsetof(struct svm_regctx, sctx_rcx)); ASSYM(SCTX_RBP, offsetof(struct svm_regctx, sctx_rbp)); - +ASSYM(SCTX_RDX, offsetof(struct svm_regctx, sctx_rdx)); +ASSYM(SCTX_RDI, offsetof(struct svm_regctx, sctx_rdi)); +ASSYM(SCTX_RSI, offsetof(struct svm_regctx, sctx_rsi)); ASSYM(SCTX_R8, offsetof(struct svm_regctx, sctx_r8)); ASSYM(SCTX_R9, offsetof(struct svm_regctx, sctx_r9)); ASSYM(SCTX_R10, offsetof(struct svm_regctx, sctx_r10)); @@ -44,14 +46,3 @@ ASSYM(SCTX_R12, offsetof(struct svm_regc ASSYM(SCTX_R13, offsetof(struct svm_regctx, sctx_r13)); ASSYM(SCTX_R14, offsetof(struct svm_regctx, sctx_r14)); ASSYM(SCTX_R15, offsetof(struct svm_regctx, sctx_r15)); - -/* Guest only registers. */ -ASSYM(SCTX_GUEST_RDX, offsetof(struct svm_regctx, e.g.sctx_rdx)); -ASSYM(SCTX_GUEST_RDI, offsetof(struct svm_regctx, e.g.sctx_rdi)); -ASSYM(SCTX_GUEST_RSI, offsetof(struct svm_regctx, e.g.sctx_rsi)); -ASSYM(SCTX_GUEST_HCTX_BASE, offsetof(struct svm_regctx, e.g.sctx_hostctx_base)); - -/* Host only registers. */ -ASSYM(SCTX_HOST_GS, offsetof(struct svm_regctx, e.h.sctx_gs)); -ASSYM(SCTX_HOST_FS, offsetof(struct svm_regctx, e.h.sctx_fs)); -ASSYM(SCTX_HOST_RSP, offsetof(struct svm_regctx, e.h.sctx_rsp)); Modified: projects/bhyve_svm/sys/amd64/vmm/amd/svm_support.S ============================================================================== --- projects/bhyve_svm/sys/amd64/vmm/amd/svm_support.S Sat Sep 27 01:50:03 2014 (r272194) +++ projects/bhyve_svm/sys/amd64/vmm/amd/svm_support.S Sat Sep 27 02:04:58 2014 (r272195) @@ -28,110 +28,88 @@ #include "svm_assym.s" /* - * Macros to save and restore GPRs. - */ -#define SAVE_GPR_STATE(reg); \ - movq %rbp, SCTX_RBP(reg); \ - movq %rbx, SCTX_RBX(reg); \ - movq %rcx, SCTX_RCX(reg); \ - movq %r8, SCTX_R8(reg); \ - movq %r9, SCTX_R9(reg); \ - movq %r10, SCTX_R10(reg); \ - movq %r11, SCTX_R11(reg); \ - movq %r12, SCTX_R12(reg); \ - movq %r13, SCTX_R13(reg); \ - movq %r14, SCTX_R14(reg); \ - movq %r15, SCTX_R15(reg); \ - -#define LOAD_GPR_STATE(reg) \ - movq SCTX_RBP(reg), %rbp; \ - movq SCTX_RBX(reg), %rbx; \ - movq SCTX_RCX(reg), %rcx; \ - movq SCTX_R8(reg), %r8; \ - movq SCTX_R9(reg), %r9; \ - movq SCTX_R10(reg), %r10; \ - movq SCTX_R11(reg), %r11; \ - movq SCTX_R12(reg), %r12; \ - movq SCTX_R13(reg), %r13; \ - movq SCTX_R14(reg), %r14; \ - movq SCTX_R15(reg), %r15; \ - -/* - * Macros to save and restore vcpu registers which are not - * done by SVM. - */ -#define SAVE_GUEST_STATE(reg) \ - movq %rdi, SCTX_GUEST_RDI(reg); \ - movq %rsi, SCTX_GUEST_RSI(reg); \ - movq %rdx, SCTX_GUEST_RDX(reg); \ - SAVE_GPR_STATE(reg) - -#define LOAD_GUEST_STATE(reg) \ - movq SCTX_GUEST_RDI(reg), %rdi; \ - movq SCTX_GUEST_RSI(reg), %rsi; \ - movq SCTX_GUEST_RDX(reg), %rdx; \ - LOAD_GPR_STATE(reg) - -/* - * Macros to save and restore host registers which are not - * saved by SVM. + * Be friendly to DTrace FBT's prologue/epilogue pattern matching. + * + * They are also responsible for saving/restoring the host %rbp across VMRUN. */ -#define SAVE_HOST_STATE(reg) \ - mov %fs, SCTX_HOST_FS(reg); \ - mov %gs, SCTX_HOST_GS(reg); \ - movq %rsp, SCTX_HOST_RSP(reg); \ - SAVE_GPR_STATE(reg) - -#define LOAD_HOST_STATE(reg) \ - mov SCTX_HOST_FS(reg), %fs; \ - mov SCTX_HOST_GS(reg), %gs; \ - movq SCTX_HOST_RSP(reg), %rsp; \ - LOAD_GPR_STATE(reg) +#define VENTER push %rbp ; mov %rsp,%rbp +#define VLEAVE pop %rbp /* - * This is where virtual machine vcpu start execution. - * int svm_launch(vmcb_pa, gswctx, hswctx) - * vmcb_pa - VMCB physical address is in %rdi. - * gswctx - Guest context is in %rsi. - * hswctx - Host context is in %rdx. - * - * Note: SVM guarantees host RSP and RAX will be restored - * back after guest exit. RAX is where VMCB Phy addr is so - * we are left with only RSP. RSP will hold base for guest - * software context which will have base for host software - * context. + * svm_launch(uint64_t vmcb, struct svm_regctx *gctx) + * %rdi: physical address of VMCB + * %rsi: pointer to guest context */ ENTRY(svm_launch) - - /* Save host GPRs. */ - SAVE_HOST_STATE(%rdx) + VENTER /* - * Move the parameters to final destinations. - * RAX - VMCB phy addr. - * RSP - Guest software context. - * SCTX_GUEST_HOST(guest) - Host software context. + * Host register state saved across a VMRUN. + * + * All "callee saved registers" except: + * %rsp: because it is preserved by the processor across VMRUN. + * %rbp: because it is saved/restored by the function prologue/epilogue. */ + push %rbx + push %r12 + push %r13 + push %r14 + push %r15 + + /* Save the physical address of the VMCB in %rax */ movq %rdi, %rax - movq %rsi, %rsp - movq %rdx, SCTX_GUEST_HCTX_BASE(%rsp) - /* Load guest context. */ - LOAD_GUEST_STATE(%rsp) + push %rsi /* push guest context pointer on the stack */ - vmload %rax + /* + * Restore guest state. + */ + movq SCTX_R8(%rsi), %r8 + movq SCTX_R9(%rsi), %r9 + movq SCTX_R10(%rsi), %r10 + movq SCTX_R11(%rsi), %r11 + movq SCTX_R12(%rsi), %r12 + movq SCTX_R13(%rsi), %r13 + movq SCTX_R14(%rsi), %r14 + movq SCTX_R15(%rsi), %r15 + movq SCTX_RBP(%rsi), %rbp + movq SCTX_RBX(%rsi), %rbx + movq SCTX_RCX(%rsi), %rcx + movq SCTX_RDX(%rsi), %rdx + movq SCTX_RDI(%rsi), %rdi + movq SCTX_RSI(%rsi), %rsi /* %rsi must be restored last */ + vmload %rax vmrun %rax - vmsave %rax - /* Save guest state. */ - SAVE_GUEST_STATE(%rsp) + pop %rax /* pop guest context pointer from the stack */ - /* Restore host context base in RDX. */ - movq SCTX_GUEST_HCTX_BASE(%rsp), %rdx - /* Restore host GPRs. */ - LOAD_HOST_STATE(%rdx) + /* + * Save guest state. + */ + movq %r8, SCTX_R8(%rax) + movq %r9, SCTX_R9(%rax) + movq %r10, SCTX_R10(%rax) + movq %r11, SCTX_R11(%rax) + movq %r12, SCTX_R12(%rax) + movq %r13, SCTX_R13(%rax) + movq %r14, SCTX_R14(%rax) + movq %r15, SCTX_R15(%rax) + movq %rbp, SCTX_RBP(%rax) + movq %rbx, SCTX_RBX(%rax) + movq %rcx, SCTX_RCX(%rax) + movq %rdx, SCTX_RDX(%rax) + movq %rdi, SCTX_RDI(%rax) + movq %rsi, SCTX_RSI(%rax) + + /* Restore host state */ + pop %r15 + pop %r14 + pop %r13 + pop %r12 + pop %rbx + VLEAVE ret END(svm_launch) From owner-svn-src-projects@FreeBSD.ORG Sat Sep 27 21:13:22 2014 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9ACB9CCE; Sat, 27 Sep 2014 21:13:22 +0000 (UTC) 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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E54C2C3; Sat, 27 Sep 2014 21:13:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8RLDMpO083181; Sat, 27 Sep 2014 21:13:22 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8RLDMnR083180; Sat, 27 Sep 2014 21:13:22 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201409272113.s8RLDMnR083180@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Sat, 27 Sep 2014 21:13:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r272228 - projects/release-vmimage X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2014 21:13:22 -0000 Author: gjb Date: Sat Sep 27 21:13:21 2014 New Revision: 272228 URL: http://svnweb.freebsd.org/changeset/base/272228 Log: Copy head@r272227 to projects/release-vmimage. This project branch will be used to add support for building virtual machine disk images as part of the release process. Sponsored by: The FreeBSD Foundation Added: projects/release-vmimage/ - copied from r272227, head/ From owner-svn-src-projects@FreeBSD.ORG Sat Sep 27 22:15:59 2014 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B153853B; Sat, 27 Sep 2014 22:15:59 +0000 (UTC) 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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A66D9B7; Sat, 27 Sep 2014 22:15:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8RMFxxG011635; Sat, 27 Sep 2014 22:15:59 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8RMFqPG011604; Sat, 27 Sep 2014 22:15:52 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201409272215.s8RMFqPG011604@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Sat, 27 Sep 2014 22:15:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r272229 - in projects/bhyve_svm: . bin/sh cddl/contrib/opensolaris/cmd/dtrace cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libdtrace/common cddl/usr.sbin contrib/apr-... X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2014 22:15:59 -0000 Author: neel Date: Sat Sep 27 22:15:50 2014 New Revision: 272229 URL: http://svnweb.freebsd.org/changeset/base/272229 Log: IFC @r272185 Added: projects/bhyve_svm/contrib/llvm/patches/patch-r269387-clang-arm-target-cpu.diff - copied unchanged from r272185, head/contrib/llvm/patches/patch-r269387-clang-arm-target-cpu.diff projects/bhyve_svm/contrib/llvm/patches/patch-r271024-llvm-r216989-r216990-fix-movw-armv6.diff - copied unchanged from r272185, head/contrib/llvm/patches/patch-r271024-llvm-r216989-r216990-fix-movw-armv6.diff projects/bhyve_svm/contrib/llvm/patches/patch-r271597-clang-r217410-i386-garbage-float.diff - copied unchanged from r272185, head/contrib/llvm/patches/patch-r271597-clang-r217410-i386-garbage-float.diff projects/bhyve_svm/contrib/pjdfstest/ - copied from r272185, head/contrib/pjdfstest/ projects/bhyve_svm/games/primes/spsp.c - copied unchanged from r272185, head/games/primes/spsp.c projects/bhyve_svm/lib/libproc/tests/ - copied from r272185, head/lib/libproc/tests/ projects/bhyve_svm/share/man/man4/ipheth.4 - copied unchanged from r272185, head/share/man/man4/ipheth.4 projects/bhyve_svm/share/man/man4/man4.arm/cgem.4 - copied unchanged from r272185, head/share/man/man4/man4.arm/cgem.4 projects/bhyve_svm/share/man/man4/smsc.4 - copied unchanged from r272185, head/share/man/man4/smsc.4 projects/bhyve_svm/sys/arm/samsung/s3c2xx0/ - copied from r272185, head/sys/arm/samsung/s3c2xx0/ projects/bhyve_svm/sys/dev/alpm/ - copied from r272185, head/sys/dev/alpm/ projects/bhyve_svm/sys/dev/amdpm/ - copied from r272185, head/sys/dev/amdpm/ projects/bhyve_svm/sys/dev/amdsmb/ - copied from r272185, head/sys/dev/amdsmb/ projects/bhyve_svm/sys/dev/dwc/ - copied from r272185, head/sys/dev/dwc/ projects/bhyve_svm/sys/dev/fdc/fdc_cbus.c - copied unchanged from r272185, head/sys/dev/fdc/fdc_cbus.c projects/bhyve_svm/sys/dev/intpm/ - copied from r272185, head/sys/dev/intpm/ projects/bhyve_svm/sys/dev/ncr/ - copied from r272185, head/sys/dev/ncr/ projects/bhyve_svm/sys/dev/nfsmb/ - copied from r272185, head/sys/dev/nfsmb/ projects/bhyve_svm/sys/dev/viapm/ - copied from r272185, head/sys/dev/viapm/ projects/bhyve_svm/sys/modules/ncr/ - copied from r272185, head/sys/modules/ncr/ projects/bhyve_svm/sys/ofed/drivers/net/mlx4/mlx4_stats.h - copied unchanged from r272185, head/sys/ofed/drivers/net/mlx4/mlx4_stats.h projects/bhyve_svm/sys/ofed/drivers/net/mlx4/utils.c - copied unchanged from r272185, head/sys/ofed/drivers/net/mlx4/utils.c projects/bhyve_svm/sys/ofed/drivers/net/mlx4/utils.h - copied unchanged from r272185, head/sys/ofed/drivers/net/mlx4/utils.h projects/bhyve_svm/usr.bin/mkimg/qcow.c - copied unchanged from r272185, head/usr.bin/mkimg/qcow.c projects/bhyve_svm/usr.bin/mkimg/tests/ - copied from r272185, head/usr.bin/mkimg/tests/ Deleted: projects/bhyve_svm/contrib/llvm/patches/patch-r271024-llvm-r216989-fix-movm-armv6.diff projects/bhyve_svm/lib/libproc/test/ projects/bhyve_svm/sys/arm/s3c2xx0/ projects/bhyve_svm/sys/pc98/cbus/fdc.c projects/bhyve_svm/sys/pc98/cbus/fdc_cbus.c projects/bhyve_svm/sys/pc98/cbus/fdcreg.h projects/bhyve_svm/sys/pc98/cbus/fdcvar.h projects/bhyve_svm/sys/pci/ projects/bhyve_svm/tools/regression/pjdfstest/ Modified: projects/bhyve_svm/Makefile.inc1 projects/bhyve_svm/ObsoleteFiles.inc projects/bhyve_svm/UPDATING projects/bhyve_svm/bin/sh/sh.1 projects/bhyve_svm/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 projects/bhyve_svm/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c projects/bhyve_svm/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c projects/bhyve_svm/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c projects/bhyve_svm/cddl/usr.sbin/Makefile projects/bhyve_svm/contrib/apr-util/CHANGES projects/bhyve_svm/contrib/apr-util/NOTICE projects/bhyve_svm/contrib/apr-util/apr-util.spec projects/bhyve_svm/contrib/apr-util/configure projects/bhyve_svm/contrib/apr-util/crypto/apr_crypto.c projects/bhyve_svm/contrib/apr-util/crypto/apr_passwd.c projects/bhyve_svm/contrib/apr-util/dbd/apr_dbd_mysql.c projects/bhyve_svm/contrib/apr-util/dbd/apr_dbd_odbc.c projects/bhyve_svm/contrib/apr-util/dbm/NWGNUmakefile projects/bhyve_svm/contrib/apr-util/include/apu_version.h projects/bhyve_svm/contrib/apr-util/test/Makefile.win projects/bhyve_svm/contrib/atf/FREEBSD-upgrade projects/bhyve_svm/contrib/atf/atf-c++/atf-c++-api.3 projects/bhyve_svm/contrib/atf/atf-c/atf-c-api.3 projects/bhyve_svm/contrib/atf/atf-sh/atf-check.1 projects/bhyve_svm/contrib/atf/atf-sh/atf-sh-api.3 projects/bhyve_svm/contrib/atf/atf-sh/atf-sh.1 projects/bhyve_svm/contrib/atf/doc/atf-test-case.4 projects/bhyve_svm/contrib/atf/doc/atf-test-program.1 projects/bhyve_svm/contrib/hyperv/tools/hv_kvp_daemon.c projects/bhyve_svm/contrib/ipfilter/lib/gethost.c projects/bhyve_svm/contrib/ipfilter/lib/printnat.c projects/bhyve_svm/contrib/ipfilter/tools/ipf_y.y projects/bhyve_svm/contrib/ipfilter/tools/ipnat_y.y projects/bhyve_svm/contrib/llvm/patches/patch-r270147-llvm-r197824-r213427-r213960.diff projects/bhyve_svm/contrib/llvm/patches/patch-r271282-clang-r200797-r200798-r200805-debug-info-crash.diff projects/bhyve_svm/contrib/llvm/patches/patch-r271432-clang-r205331-debug-info-crash.diff projects/bhyve_svm/contrib/ofed/libibverbs/examples/asyncwatch.c projects/bhyve_svm/contrib/ofed/libibverbs/examples/device_list.c projects/bhyve_svm/contrib/ofed/libibverbs/examples/devinfo.c projects/bhyve_svm/contrib/ofed/libmlx4/src/mlx4-abi.h projects/bhyve_svm/etc/defaults/periodic.conf projects/bhyve_svm/etc/motd projects/bhyve_svm/etc/mtree/BSD.tests.dist projects/bhyve_svm/etc/rc.d/Makefile projects/bhyve_svm/etc/rc.d/syscons projects/bhyve_svm/games/factor/factor.6 projects/bhyve_svm/games/primes/Makefile projects/bhyve_svm/games/primes/primes.c projects/bhyve_svm/games/primes/primes.h projects/bhyve_svm/lib/libnv/nv.3 projects/bhyve_svm/lib/libproc/Makefile projects/bhyve_svm/lib/libproc/proc_sym.c projects/bhyve_svm/lib/libthr/libthr.3 projects/bhyve_svm/lib/libthr/thread/thr_init.c projects/bhyve_svm/lib/msun/src/e_lgamma_r.c projects/bhyve_svm/release/doc/en_US.ISO8859-1/hardware/article.xml projects/bhyve_svm/sbin/ping6/Makefile projects/bhyve_svm/sbin/ping6/ping6.c projects/bhyve_svm/sbin/routed/defs.h projects/bhyve_svm/sbin/routed/input.c projects/bhyve_svm/sbin/routed/main.c projects/bhyve_svm/sbin/routed/output.c projects/bhyve_svm/sbin/routed/routed.8 projects/bhyve_svm/sbin/sysctl/sysctl.c projects/bhyve_svm/share/man/man4/Makefile projects/bhyve_svm/share/man/man4/ada.4 projects/bhyve_svm/share/man/man4/cdce.4 projects/bhyve_svm/share/man/man4/man4.arm/Makefile projects/bhyve_svm/share/man/man4/miibus.4 projects/bhyve_svm/share/man/man4/urndis.4 projects/bhyve_svm/share/man/man9/Makefile projects/bhyve_svm/share/man/man9/sleepqueue.9 projects/bhyve_svm/share/misc/committers-src.dot projects/bhyve_svm/share/mk/bsd.progs.mk projects/bhyve_svm/sys/Makefile projects/bhyve_svm/sys/amd64/amd64/fpu.c projects/bhyve_svm/sys/amd64/amd64/machdep.c projects/bhyve_svm/sys/amd64/amd64/trap.c projects/bhyve_svm/sys/amd64/conf/GENERIC projects/bhyve_svm/sys/amd64/conf/NOTES projects/bhyve_svm/sys/amd64/vmm/intel/vmx.c projects/bhyve_svm/sys/amd64/vmm/io/vlapic.c projects/bhyve_svm/sys/amd64/vmm/vmm.c projects/bhyve_svm/sys/arm/allwinner/a10_clk.c projects/bhyve_svm/sys/arm/altera/socfpga/files.socfpga projects/bhyve_svm/sys/arm/arm/machdep.c projects/bhyve_svm/sys/arm/arm/mpcore_timer.c projects/bhyve_svm/sys/arm/at91/at91rm92reg.h projects/bhyve_svm/sys/arm/at91/at91sam9260reg.h projects/bhyve_svm/sys/arm/at91/at91sam9g20reg.h projects/bhyve_svm/sys/arm/at91/at91sam9g45reg.h projects/bhyve_svm/sys/arm/at91/at91sam9x5reg.h projects/bhyve_svm/sys/arm/conf/LN2410SBC projects/bhyve_svm/sys/arm/conf/NOTES projects/bhyve_svm/sys/arm/conf/SOCKIT projects/bhyve_svm/sys/boot/efi/include/eficonsctl.h projects/bhyve_svm/sys/boot/fdt/dts/arm/socfpga-sockit.dts projects/bhyve_svm/sys/boot/fdt/dts/arm/socfpga.dtsi projects/bhyve_svm/sys/cam/ctl/ctl.c projects/bhyve_svm/sys/cam/ctl/ctl.h projects/bhyve_svm/sys/cam/ctl/ctl_cmd_table.c projects/bhyve_svm/sys/cam/ctl/ctl_error.c projects/bhyve_svm/sys/cam/ctl/ctl_error.h projects/bhyve_svm/sys/cam/ctl/ctl_frontend_iscsi.c projects/bhyve_svm/sys/cam/ctl/ctl_private.h projects/bhyve_svm/sys/compat/freebsd32/freebsd32_misc.c projects/bhyve_svm/sys/compat/linux/linux_ioctl.c projects/bhyve_svm/sys/compat/linux/linux_mib.c projects/bhyve_svm/sys/conf/NOTES projects/bhyve_svm/sys/conf/files projects/bhyve_svm/sys/conf/files.amd64 projects/bhyve_svm/sys/conf/files.pc98 projects/bhyve_svm/sys/conf/options projects/bhyve_svm/sys/contrib/ipfilter/netinet/ip_dstlist.c projects/bhyve_svm/sys/contrib/ipfilter/netinet/ip_frag.c projects/bhyve_svm/sys/ddb/db_main.c projects/bhyve_svm/sys/ddb/ddb.h projects/bhyve_svm/sys/dev/acpica/acpi.c projects/bhyve_svm/sys/dev/acpica/acpi_pci.c projects/bhyve_svm/sys/dev/asmc/asmc.c projects/bhyve_svm/sys/dev/asmc/asmcvar.h projects/bhyve_svm/sys/dev/atkbdc/atkbd.c projects/bhyve_svm/sys/dev/bce/if_bce.c projects/bhyve_svm/sys/dev/bce/if_bcereg.h projects/bhyve_svm/sys/dev/cxgbe/t4_main.c projects/bhyve_svm/sys/dev/cxgbe/tom/t4_listen.c projects/bhyve_svm/sys/dev/et/if_et.c projects/bhyve_svm/sys/dev/fdc/fdc.c projects/bhyve_svm/sys/dev/fdc/fdcvar.h projects/bhyve_svm/sys/dev/fdt/fdt_common.c projects/bhyve_svm/sys/dev/fdt/fdt_common.h projects/bhyve_svm/sys/dev/fdt/simplebus.c projects/bhyve_svm/sys/dev/ixl/i40e_common.c projects/bhyve_svm/sys/dev/ixl/if_ixl.c projects/bhyve_svm/sys/dev/ixl/if_ixlv.c projects/bhyve_svm/sys/dev/ixl/ixl_txrx.c projects/bhyve_svm/sys/dev/jme/if_jme.c projects/bhyve_svm/sys/dev/lmc/if_lmc.c projects/bhyve_svm/sys/dev/lmc/if_lmc.h projects/bhyve_svm/sys/dev/mxge/if_mxge.c projects/bhyve_svm/sys/dev/netmap/netmap.c projects/bhyve_svm/sys/dev/netmap/netmap_kern.h projects/bhyve_svm/sys/dev/oce/oce_if.c projects/bhyve_svm/sys/dev/oce/oce_if.h projects/bhyve_svm/sys/dev/ofw/ofw_bus_subr.c projects/bhyve_svm/sys/dev/ofw/ofw_bus_subr.h projects/bhyve_svm/sys/dev/ofw/ofwbus.c projects/bhyve_svm/sys/dev/pci/pci.c projects/bhyve_svm/sys/dev/pci/pci_private.h projects/bhyve_svm/sys/dev/ti/if_ti.c projects/bhyve_svm/sys/dev/tws/tws.c projects/bhyve_svm/sys/dev/tws/tws.h projects/bhyve_svm/sys/dev/tws/tws_cam.c projects/bhyve_svm/sys/dev/tws/tws_hdm.c projects/bhyve_svm/sys/dev/tws/tws_hdm.h projects/bhyve_svm/sys/dev/tws/tws_services.c projects/bhyve_svm/sys/dev/txp/if_txp.c projects/bhyve_svm/sys/dev/usb/controller/ohci_s3c24x0.c projects/bhyve_svm/sys/dev/usb/controller/xhci.c projects/bhyve_svm/sys/dev/usb/net/if_smsc.c projects/bhyve_svm/sys/dev/usb/usbdevs projects/bhyve_svm/sys/dev/vmware/vmxnet3/if_vmx.c projects/bhyve_svm/sys/dev/vmware/vmxnet3/if_vmxvar.h projects/bhyve_svm/sys/dev/vt/vt_buf.c projects/bhyve_svm/sys/dev/vte/if_vte.c projects/bhyve_svm/sys/dev/wi/if_wi.c projects/bhyve_svm/sys/dev/xen/netfront/netfront.c projects/bhyve_svm/sys/fs/autofs/autofs.c projects/bhyve_svm/sys/fs/autofs/autofs_vnops.c projects/bhyve_svm/sys/fs/devfs/devfs_vnops.c projects/bhyve_svm/sys/gnu/fs/reiserfs/reiserfs_fs_i.h projects/bhyve_svm/sys/i386/i386/machdep.c projects/bhyve_svm/sys/kern/bus_if.m projects/bhyve_svm/sys/kern/kern_cons.c projects/bhyve_svm/sys/kern/kern_descrip.c projects/bhyve_svm/sys/kern/kern_event.c projects/bhyve_svm/sys/kern/kern_malloc.c projects/bhyve_svm/sys/kern/subr_bus.c projects/bhyve_svm/sys/kern/sys_pipe.c projects/bhyve_svm/sys/kern/sys_procdesc.c projects/bhyve_svm/sys/kern/sys_socket.c projects/bhyve_svm/sys/kern/tty_pts.c projects/bhyve_svm/sys/kern/uipc_mqueue.c projects/bhyve_svm/sys/kern/uipc_sem.c projects/bhyve_svm/sys/kern/uipc_shm.c projects/bhyve_svm/sys/kern/uipc_sockbuf.c projects/bhyve_svm/sys/kern/vfs_syscalls.c projects/bhyve_svm/sys/kern/vfs_vnops.c projects/bhyve_svm/sys/mips/beri/beri_simplebus.c projects/bhyve_svm/sys/mips/mips/machdep.c projects/bhyve_svm/sys/modules/Makefile projects/bhyve_svm/sys/modules/fdc/Makefile projects/bhyve_svm/sys/modules/i2c/controllers/alpm/Makefile projects/bhyve_svm/sys/modules/i2c/controllers/amdpm/Makefile projects/bhyve_svm/sys/modules/i2c/controllers/amdsmb/Makefile projects/bhyve_svm/sys/modules/i2c/controllers/intpm/Makefile projects/bhyve_svm/sys/modules/i2c/controllers/nfsmb/Makefile projects/bhyve_svm/sys/modules/i2c/controllers/viapm/Makefile projects/bhyve_svm/sys/modules/mlx4/Makefile projects/bhyve_svm/sys/modules/mlxen/Makefile projects/bhyve_svm/sys/modules/netmap/Makefile projects/bhyve_svm/sys/net/ieee8023ad_lacp.c projects/bhyve_svm/sys/net/ieee8023ad_lacp.h projects/bhyve_svm/sys/net/if.c projects/bhyve_svm/sys/net/if_gif.c projects/bhyve_svm/sys/net/if_gre.c projects/bhyve_svm/sys/net/if_gre.h projects/bhyve_svm/sys/net/if_lagg.c projects/bhyve_svm/sys/net/if_lagg.h projects/bhyve_svm/sys/net/if_var.h projects/bhyve_svm/sys/net/if_vlan.c projects/bhyve_svm/sys/net/route.c projects/bhyve_svm/sys/net/route.h projects/bhyve_svm/sys/netgraph/bluetooth/include/ng_btsocket_l2cap.h projects/bhyve_svm/sys/netgraph/bluetooth/include/ng_btsocket_rfcomm.h projects/bhyve_svm/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c projects/bhyve_svm/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c projects/bhyve_svm/sys/netinet/in.c projects/bhyve_svm/sys/netinet/ip_gre.c projects/bhyve_svm/sys/netinet/ip_ipsec.c projects/bhyve_svm/sys/netinet/tcp_input.c projects/bhyve_svm/sys/netinet/tcp_output.c projects/bhyve_svm/sys/netinet/tcp_subr.c projects/bhyve_svm/sys/netinet/tcp_var.h projects/bhyve_svm/sys/netinet/toecore.c projects/bhyve_svm/sys/netpfil/ipfw/ip_dn_io.c projects/bhyve_svm/sys/ofed/drivers/infiniband/hw/mlx4/mad.c projects/bhyve_svm/sys/ofed/drivers/infiniband/hw/mlx4/main.c projects/bhyve_svm/sys/ofed/drivers/infiniband/hw/mlx4/qp.c projects/bhyve_svm/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c projects/bhyve_svm/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c projects/bhyve_svm/sys/ofed/drivers/net/mlx4/alloc.c projects/bhyve_svm/sys/ofed/drivers/net/mlx4/catas.c projects/bhyve_svm/sys/ofed/drivers/net/mlx4/cmd.c projects/bhyve_svm/sys/ofed/drivers/net/mlx4/cq.c projects/bhyve_svm/sys/ofed/drivers/net/mlx4/en_cq.c projects/bhyve_svm/sys/ofed/drivers/net/mlx4/en_ethtool.c projects/bhyve_svm/sys/ofed/drivers/net/mlx4/en_main.c projects/bhyve_svm/sys/ofed/drivers/net/mlx4/en_netdev.c projects/bhyve_svm/sys/ofed/drivers/net/mlx4/en_port.c projects/bhyve_svm/sys/ofed/drivers/net/mlx4/en_port.h projects/bhyve_svm/sys/ofed/drivers/net/mlx4/en_resources.c projects/bhyve_svm/sys/ofed/drivers/net/mlx4/en_rx.c projects/bhyve_svm/sys/ofed/drivers/net/mlx4/en_selftest.c projects/bhyve_svm/sys/ofed/drivers/net/mlx4/en_tx.c projects/bhyve_svm/sys/ofed/drivers/net/mlx4/eq.c projects/bhyve_svm/sys/ofed/drivers/net/mlx4/fw.c projects/bhyve_svm/sys/ofed/drivers/net/mlx4/fw.h projects/bhyve_svm/sys/ofed/drivers/net/mlx4/icm.c projects/bhyve_svm/sys/ofed/drivers/net/mlx4/icm.h projects/bhyve_svm/sys/ofed/drivers/net/mlx4/intf.c projects/bhyve_svm/sys/ofed/drivers/net/mlx4/main.c projects/bhyve_svm/sys/ofed/drivers/net/mlx4/mcg.c projects/bhyve_svm/sys/ofed/drivers/net/mlx4/mlx4.h projects/bhyve_svm/sys/ofed/drivers/net/mlx4/mlx4_en.h projects/bhyve_svm/sys/ofed/drivers/net/mlx4/mr.c projects/bhyve_svm/sys/ofed/drivers/net/mlx4/pd.c projects/bhyve_svm/sys/ofed/drivers/net/mlx4/port.c projects/bhyve_svm/sys/ofed/drivers/net/mlx4/profile.c projects/bhyve_svm/sys/ofed/drivers/net/mlx4/qp.c projects/bhyve_svm/sys/ofed/drivers/net/mlx4/reset.c projects/bhyve_svm/sys/ofed/drivers/net/mlx4/resource_tracker.c projects/bhyve_svm/sys/ofed/drivers/net/mlx4/sense.c projects/bhyve_svm/sys/ofed/drivers/net/mlx4/srq.c projects/bhyve_svm/sys/ofed/drivers/net/mlx4/sys_tune.c projects/bhyve_svm/sys/ofed/include/linux/linux_compat.c projects/bhyve_svm/sys/ofed/include/linux/mlx4/cmd.h projects/bhyve_svm/sys/ofed/include/linux/mlx4/cq.h projects/bhyve_svm/sys/ofed/include/linux/mlx4/device.h projects/bhyve_svm/sys/ofed/include/linux/mlx4/driver.h projects/bhyve_svm/sys/ofed/include/linux/mlx4/qp.h projects/bhyve_svm/sys/ofed/include/linux/mlx4/srq.h projects/bhyve_svm/sys/opencrypto/cryptodev.c projects/bhyve_svm/sys/pc98/cbus/olpt.c projects/bhyve_svm/sys/pc98/cbus/pckbd.c projects/bhyve_svm/sys/pc98/pc98/machdep.c projects/bhyve_svm/sys/powerpc/aim/locore64.S projects/bhyve_svm/sys/powerpc/aim/machdep.c projects/bhyve_svm/sys/powerpc/booke/machdep.c projects/bhyve_svm/sys/powerpc/ofw/ofw_pcibus.c projects/bhyve_svm/sys/powerpc/pseries/vdevice.c projects/bhyve_svm/sys/sparc64/sparc64/machdep.c projects/bhyve_svm/sys/sys/bus.h projects/bhyve_svm/sys/sys/file.h projects/bhyve_svm/sys/sys/filedesc.h projects/bhyve_svm/sys/sys/ksem.h projects/bhyve_svm/sys/sys/mman.h projects/bhyve_svm/sys/sys/sleepqueue.h projects/bhyve_svm/sys/sys/sockbuf.h projects/bhyve_svm/sys/sys/syscallsubr.h projects/bhyve_svm/sys/vm/vm_map.c projects/bhyve_svm/sys/vm/vm_pageout.c projects/bhyve_svm/sys/x86/xen/pv.c projects/bhyve_svm/tools/build/mk/OptionalObsoleteFiles.inc projects/bhyve_svm/tools/test/dtrace/Makefile projects/bhyve_svm/usr.bin/calendar/calendars/calendar.freebsd projects/bhyve_svm/usr.bin/grep/regex/tre-fastmatch.c projects/bhyve_svm/usr.bin/man/man.1 projects/bhyve_svm/usr.bin/mkimg/Makefile projects/bhyve_svm/usr.bin/xinstall/xinstall.c projects/bhyve_svm/usr.sbin/autofs/common.c projects/bhyve_svm/usr.sbin/bhyve/smbiostbl.c projects/bhyve_svm/usr.sbin/bsdinstall/scripts/services projects/bhyve_svm/usr.sbin/newsyslog/newsyslog.8 Directory Properties: projects/bhyve_svm/ (props changed) projects/bhyve_svm/cddl/ (props changed) projects/bhyve_svm/cddl/contrib/opensolaris/ (props changed) projects/bhyve_svm/contrib/apr-util/ (props changed) projects/bhyve_svm/contrib/atf/ (props changed) projects/bhyve_svm/contrib/ipfilter/ (props changed) projects/bhyve_svm/contrib/llvm/ (props changed) projects/bhyve_svm/etc/ (props changed) projects/bhyve_svm/sbin/ (props changed) projects/bhyve_svm/share/ (props changed) projects/bhyve_svm/share/man/man4/ (props changed) projects/bhyve_svm/sys/ (props changed) projects/bhyve_svm/sys/amd64/vmm/ (props changed) projects/bhyve_svm/sys/boot/ (props changed) projects/bhyve_svm/sys/conf/ (props changed) projects/bhyve_svm/sys/contrib/ipfilter/ (props changed) projects/bhyve_svm/usr.bin/calendar/ (props changed) projects/bhyve_svm/usr.bin/mkimg/ (props changed) projects/bhyve_svm/usr.sbin/bhyve/ (props changed) Modified: projects/bhyve_svm/Makefile.inc1 ============================================================================== --- projects/bhyve_svm/Makefile.inc1 Sat Sep 27 21:13:21 2014 (r272228) +++ projects/bhyve_svm/Makefile.inc1 Sat Sep 27 22:15:50 2014 (r272229) @@ -911,7 +911,7 @@ packageworld: # and do a 'make reinstall' on the *client* to install new binaries from the # most recent server build. # -reinstall: +reinstall: .MAKE @echo "--------------------------------------------------------------" @echo ">>> Making hierarchy" @echo "--------------------------------------------------------------" @@ -926,7 +926,7 @@ reinstall: ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install32 .endif -redistribute: +redistribute: .MAKE @echo "--------------------------------------------------------------" @echo ">>> Distributing everything" @echo "--------------------------------------------------------------" @@ -936,7 +936,7 @@ redistribute: DISTRIBUTION=lib32 .endif -distrib-dirs distribution: +distrib-dirs distribution: .MAKE cd ${.CURDIR}/etc; ${CROSSENV} PATH=${TMPPATH} ${MAKE} \ ${IMAKE_INSTALL} ${IMAKE_MTREE} METALOG=${METALOG} ${.TARGET} @@ -1464,7 +1464,7 @@ native-xtools: .MAKE # # hierarchy - ensure that all the needed directories are present # -hierarchy hier: +hierarchy hier: .MAKE cd ${.CURDIR}/etc && ${HMAKE} distrib-dirs # Modified: projects/bhyve_svm/ObsoleteFiles.inc ============================================================================== --- projects/bhyve_svm/ObsoleteFiles.inc Sat Sep 27 21:13:21 2014 (r272228) +++ projects/bhyve_svm/ObsoleteFiles.inc Sat Sep 27 22:15:50 2014 (r272229) @@ -38,6 +38,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20140922: sleepq_calc_signal_retval.9 and sleepq_catch_signals.9 removed +OLD_FILES+=usr/share/man/man9/sleepq_calc_signal_retval.9.gz +OLD_FILES+=usr/share/man/man9/sleepq_catch_signals.9.gz # 20140917: hv_kvpd rc.d script removed in favor of devd configuration OLD_FILES+=etc/rc.d/hv_kvpd # 20140814: libopie version bump Modified: projects/bhyve_svm/UPDATING ============================================================================== --- projects/bhyve_svm/UPDATING Sat Sep 27 21:13:21 2014 (r272228) +++ projects/bhyve_svm/UPDATING Sat Sep 27 22:15:50 2014 (r272229) @@ -31,6 +31,18 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20140923: + pjdfstest has been moved from tools/regression/pjdfstest to + contrib/pjdfstest . + +20140922: + At svn r271982, The default linux compat kernel ABI has been adjusted + to 2.6.18 in support of the linux-c6 compat ports infrastructure + update. If you wish to continue using the linux-f10 compat ports, + add compat.linux.osrelease=2.6.16 to your local sysctl.conf. Users are + encouraged to update their linux-compat packages to linux-c6 during + their next update cycle. + 20140729: The ofwfb driver, used to provide a graphics console on PowerPC when using vt(4), no longer allows mmap() of all of physical memory. This Modified: projects/bhyve_svm/bin/sh/sh.1 ============================================================================== --- projects/bhyve_svm/bin/sh/sh.1 Sat Sep 27 21:13:21 2014 (r272228) +++ projects/bhyve_svm/bin/sh/sh.1 Sat Sep 27 22:15:50 2014 (r272229) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd September 4, 2014 +.Dd September 21, 2014 .Dt SH 1 .Os .Sh NAME @@ -590,7 +590,8 @@ the following actions: Leading words of the form .Dq Li name=value are stripped off and assigned to the environment of -the simple command. +the simple command +(they do not affect expansions). Redirection operators and their arguments (as described below) are stripped off and saved for processing. Modified: projects/bhyve_svm/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 ============================================================================== --- projects/bhyve_svm/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 Sat Sep 27 21:13:21 2014 (r272228) +++ projects/bhyve_svm/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 Sat Sep 27 22:15:50 2014 (r272229) @@ -277,6 +277,19 @@ Generate a header file containing macros specified provider definitions. This option should be used to generate a header file that is included by other source files for later use with the +.Fl G +option. +If the +.Fl o +option is present, the header file is saved using the pathname specified as the +argument for that option. +If the +.Fl o +option is not present and the DTrace program is contained within a file whose +name is +.Ar filename.d , +then the header file is saved using the name +.Ar filename.h . .It Fl H Print the pathnames of included files when invoking .Xr cpp 1 @@ -289,20 +302,6 @@ option to each .Xr cpp 1 invocation, causing it to display the list of pathnames, one for each line, to standard error. -.Fl G -option. -If the -.Fl o -option -is present, the header file is saved using the pathname specified as the -argument for that option. -If the -.Fl o -option is not present and the DTrace program is contained with a file whose -name is -.Ar filename.d , -then the header file is saved using the name -.Ar filename.h . .It Fl i Ar probe-id Op Oo Ar predicate Oc Ar action Specify probe identifier .Ar ( probe-id ) Modified: projects/bhyve_svm/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- projects/bhyve_svm/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Sat Sep 27 21:13:21 2014 (r272228) +++ projects/bhyve_svm/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Sat Sep 27 22:15:50 2014 (r272229) @@ -4524,7 +4524,8 @@ is_root_pool(zpool_handle_t *zhp) } static void -root_pool_upgrade_check(zpool_handle_t *zhp, char *poolname, int size) { +root_pool_upgrade_check(zpool_handle_t *zhp, char *poolname, int size) +{ if (poolname[0] == '\0' && is_root_pool(zhp)) (void) strlcpy(poolname, zpool_get_name(zhp), size); @@ -4623,7 +4624,7 @@ upgrade_cb(zpool_handle_t *zhp, void *ar #ifdef __FreeBSD__ root_pool_upgrade_check(zhp, cbp->cb_poolname, sizeof(cbp->cb_poolname)); -#endif /* ___FreeBSD__ */ +#endif /* __FreeBSD__ */ printnl = B_TRUE; #ifdef illumos @@ -4647,6 +4648,10 @@ upgrade_cb(zpool_handle_t *zhp, void *ar if (count > 0) { cbp->cb_first = B_FALSE; printnl = B_TRUE; +#ifdef __FreeBSD__ + root_pool_upgrade_check(zhp, cbp->cb_poolname, + sizeof(cbp->cb_poolname)); +#endif /* __FreeBSD__ */ /* * If they did "zpool upgrade -a", then we could * be doing ioctls to different pools. We need @@ -4788,7 +4793,7 @@ upgrade_one(zpool_handle_t *zhp, void *d #ifdef __FreeBSD__ root_pool_upgrade_check(zhp, cbp->cb_poolname, sizeof(cbp->cb_poolname)); -#endif /* ___FreeBSD__ */ +#endif /* __FreeBSD__ */ } if (cbp->cb_version >= SPA_VERSION_FEATURES) { Modified: projects/bhyve_svm/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c ============================================================================== --- projects/bhyve_svm/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c Sat Sep 27 21:13:21 2014 (r272228) +++ projects/bhyve_svm/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c Sat Sep 27 22:15:50 2014 (r272229) @@ -121,12 +121,12 @@ dtrace_dof_init(void) #if !defined(sun) Elf *e; Elf_Scn *scn = NULL; - Elf_Data *symtabdata = NULL, *dynsymdata = NULL, *dofdata = NULL; + Elf_Data *dofdata = NULL; dof_hdr_t *dof_next = NULL; GElf_Shdr shdr; int efd; char *s; - size_t shstridx, symtabidx = 0, dynsymidx = 0; + size_t shstridx; #endif if (getenv("DTRACE_DOF_INIT_DISABLE") != NULL) @@ -166,15 +166,9 @@ dtrace_dof_init(void) dof = NULL; while ((scn = elf_nextscn(e, scn)) != NULL) { gelf_getshdr(scn, &shdr); - if (shdr.sh_type == SHT_SYMTAB) { - symtabidx = shdr.sh_link; - symtabdata = elf_getdata(scn, NULL); - } else if (shdr.sh_type == SHT_DYNSYM) { - dynsymidx = shdr.sh_link; - dynsymdata = elf_getdata(scn, NULL); - } else if (shdr.sh_type == SHT_SUNW_dof) { + if (shdr.sh_type == SHT_SUNW_dof) { s = elf_strptr(e, shstridx, shdr.sh_name); - if (s != NULL && strcmp(s, ".SUNW_dof") == 0) { + if (s != NULL && strcmp(s, ".SUNW_dof") == 0) { dofdata = elf_getdata(scn, NULL); dof = dofdata->d_buf; } Modified: projects/bhyve_svm/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c ============================================================================== --- projects/bhyve_svm/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Sat Sep 27 21:13:21 2014 (r272228) +++ projects/bhyve_svm/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Sat Sep 27 22:15:50 2014 (r272229) @@ -1819,7 +1819,6 @@ dtrace_program_link(dtrace_hdl_t *dtp, d "failed to write %s: %s", file, strerror(errno))); } #else - (void)close(fd); if (status != 0) return (dt_link_error(dtp, NULL, -1, NULL, "failed to write %s: %s", tfile, Modified: projects/bhyve_svm/cddl/usr.sbin/Makefile ============================================================================== --- projects/bhyve_svm/cddl/usr.sbin/Makefile Sat Sep 27 21:13:21 2014 (r272228) +++ projects/bhyve_svm/cddl/usr.sbin/Makefile Sat Sep 27 22:15:50 2014 (r272229) @@ -5,6 +5,7 @@ SUBDIR= ${_dtrace} \ ${_dtruss} \ ${_lockstat} \ + ${_plockstat} \ ${_tests} \ ${_zdb} \ ${_zhack} @@ -24,6 +25,9 @@ _zhack= zhack _dtrace= dtrace _dtruss= dtruss _lockstat= lockstat +.if defined(WITH_PLOCKSTAT) +_plockstat= plockstat +.endif .endif .if ${MACHINE_CPUARCH} == "mips" Modified: projects/bhyve_svm/contrib/apr-util/CHANGES ============================================================================== --- projects/bhyve_svm/contrib/apr-util/CHANGES Sat Sep 27 21:13:21 2014 (r272228) +++ projects/bhyve_svm/contrib/apr-util/CHANGES Sat Sep 27 22:15:50 2014 (r272229) @@ -1,4 +1,30 @@ -*- coding: utf-8 -*- +Changes with APR-util 1.5.4 + + *) MySQL driver: Fix incorrect handling of bad parameter in the + driver support for apr_dbd_transaction_end(). PR 56330. + [Weiqiang Li ] + + *) apr_crypto_get_driver(): Fix invalid storage reference on error path. + [Philip Martin ] + + *) Fix compile failure for Android. PR 56627. [Fredrik Fornwall + , Jeff Trawick] + + *) Fix to let ODBC driver build with MSVC6, which does not have intptr_t + [Tom Donovan] + + *) Windows cmake build: Fix incompatiblities with Visual Studio + generators with all cmake versions, and the NMake Makefile generator + with cmake 2.8.12 and later. PR 56616 and other bugs. [Jeff Trawick, + Bert Huijben] + + *) Fix detection of Berkeley DB 6.0. PR 55277. + [Lars Wendler ] + + *) Improve platform detection for bundled expat by updating + config.guess and config.sub. [Rainer Jung] + Changes with APR-util 1.5.3 *) Cygwin: Use correct file extension when loading APR DSOs. PR 55587. Modified: projects/bhyve_svm/contrib/apr-util/NOTICE ============================================================================== --- projects/bhyve_svm/contrib/apr-util/NOTICE Sat Sep 27 21:13:21 2014 (r272228) +++ projects/bhyve_svm/contrib/apr-util/NOTICE Sat Sep 27 22:15:50 2014 (r272229) @@ -1,7 +1,7 @@ Apache Portable Runtime Utility Library -Copyright (c) 2011 The Apache Software Foundation. +Copyright (c) 2000-2014 The Apache Software Foundation. -This product includes software developed by +This product includes software developed at The Apache Software Foundation (http://www.apache.org/). Portions of this software were developed at the National Center Modified: projects/bhyve_svm/contrib/apr-util/apr-util.spec ============================================================================== --- projects/bhyve_svm/contrib/apr-util/apr-util.spec Sat Sep 27 21:13:21 2014 (r272228) +++ projects/bhyve_svm/contrib/apr-util/apr-util.spec Sat Sep 27 22:15:50 2014 (r272229) @@ -3,7 +3,7 @@ Summary: Apache Portable Runtime Utility library Name: apr-util -Version: 1.5.3 +Version: 1.5.4 Release: 1 License: Apache Software License Group: System Environment/Libraries Modified: projects/bhyve_svm/contrib/apr-util/configure ============================================================================== --- projects/bhyve_svm/contrib/apr-util/configure Sat Sep 27 21:13:21 2014 (r272228) +++ projects/bhyve_svm/contrib/apr-util/configure Sat Sep 27 22:15:50 2014 (r272229) @@ -11608,19 +11608,34 @@ fi apu_db_version=0 # Maximum supported version announced in help string. - # Although we search for all versions up to 5.9, + # Although we search for all versions up to 6.9, # we should only include existing versions in our # help string. - db_max_version=53 - db_min_version=41 dbm_list="sdbm, gdbm, ndbm, db, db1, db185, db2, db3, db4" + db_max_version=48 + db_min_version=41 + db_version="$db_min_version" + while [ $db_version -le $db_max_version ] + do + dbm_list="$dbm_list, db$db_version" + db_version=`expr $db_version + 1` + done + db_max_version=53 + db_min_version=50 + db_version="$db_min_version" + while [ $db_version -le $db_max_version ] + do + dbm_list="$dbm_list, db$db_version" + db_version=`expr $db_version + 1` + done + db_max_version=60 + db_min_version=60 db_version="$db_min_version" while [ $db_version -le $db_max_version ] do dbm_list="$dbm_list, db$db_version" db_version=`expr $db_version + 1` done - dbm_list="$dbm_list, db60" # Check whether --with-dbm was given. @@ -12093,8 +12108,8 @@ if test "${with_berkeley_db+set}" = set; all_places="$check_places" - # Start version search at version 5.9 - db_version=59 + # Start version search at version 6.9 + db_version=69 while [ $db_version -ge 40 ] do db_major=`echo $db_version | sed -e 's/.$//'` @@ -12178,7 +12193,7 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test ""${db_major}"" = "3" -o ""${db_major}"" = "4" -o ""${db_major}"" = "5"; then + if test ""${db_major}"" = "3" -o ""${db_major}"" = "4" -o ""${db_major}"" = "5" -o ""${db_major}"" = "6"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of @@ -12580,7 +12595,7 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test "3" = "3" -o "3" = "4" -o "3" = "5"; then + if test "3" = "3" -o "3" = "4" -o "3" = "5" -o "3" = "6"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of @@ -12978,7 +12993,7 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test "2" = "3" -o "2" = "4" -o "2" = "5"; then + if test "2" = "3" -o "2" = "4" -o "2" = "5" -o "2" = "6"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of @@ -13376,7 +13391,7 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test "1" = "3" -o "1" = "4" -o "1" = "5"; then + if test "1" = "3" -o "1" = "4" -o "1" = "5" -o "1" = "6"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of @@ -13774,7 +13789,7 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test "1" = "3" -o "1" = "4" -o "1" = "5"; then + if test "1" = "3" -o "1" = "4" -o "1" = "5" -o "1" = "6"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of @@ -14186,7 +14201,7 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test "1" = "3" -o "1" = "4" -o "1" = "5"; then + if test "1" = "3" -o "1" = "4" -o "1" = "5" -o "1" = "6"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of @@ -14587,7 +14602,7 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test "1" = "3" -o "1" = "4" -o "1" = "5"; then + if test "1" = "3" -o "1" = "4" -o "1" = "5" -o "1" = "6"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of @@ -14988,7 +15003,7 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test "2" = "3" -o "2" = "4" -o "2" = "5"; then + if test "2" = "3" -o "2" = "4" -o "2" = "5" -o "2" = "6"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of @@ -15389,7 +15404,7 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test "3" = "3" -o "3" = "4" -o "3" = "5"; then + if test "3" = "3" -o "3" = "4" -o "3" = "5" -o "3" = "6"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of @@ -15794,7 +15809,7 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test ""${db_major}"" = "3" -o ""${db_major}"" = "4" -o ""${db_major}"" = "5"; then + if test ""${db_major}"" = "3" -o ""${db_major}"" = "4" -o ""${db_major}"" = "5" -o ""${db_major}"" = "6"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of @@ -16202,7 +16217,7 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test ""${db_major}"" = "3" -o ""${db_major}"" = "4" -o ""${db_major}"" = "5"; then + if test ""${db_major}"" = "3" -o ""${db_major}"" = "4" -o ""${db_major}"" = "5" -o ""${db_major}"" = "6"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of @@ -16534,8 +16549,8 @@ fi all_places="$check_places" - # Start version search at version 5.9 - db_version=59 + # Start version search at version 6.9 + db_version=69 while [ $db_version -ge 40 ] do db_major=`echo $db_version | sed -e 's/.$//'` @@ -16619,7 +16634,7 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test ""${db_major}"" = "3" -o ""${db_major}"" = "4" -o ""${db_major}"" = "5"; then + if test ""${db_major}"" = "3" -o ""${db_major}"" = "4" -o ""${db_major}"" = "5" -o ""${db_major}"" = "6"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of @@ -17021,7 +17036,7 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test "3" = "3" -o "3" = "4" -o "3" = "5"; then + if test "3" = "3" -o "3" = "4" -o "3" = "5" -o "3" = "6"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of @@ -17419,7 +17434,7 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test "2" = "3" -o "2" = "4" -o "2" = "5"; then + if test "2" = "3" -o "2" = "4" -o "2" = "5" -o "2" = "6"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of @@ -17817,7 +17832,7 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test "1" = "3" -o "1" = "4" -o "1" = "5"; then + if test "1" = "3" -o "1" = "4" -o "1" = "5" -o "1" = "6"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of @@ -18215,7 +18230,7 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test "1" = "3" -o "1" = "4" -o "1" = "5"; then + if test "1" = "3" -o "1" = "4" -o "1" = "5" -o "1" = "6"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of Modified: projects/bhyve_svm/contrib/apr-util/crypto/apr_crypto.c ============================================================================== --- projects/bhyve_svm/contrib/apr-util/crypto/apr_crypto.c Sat Sep 27 21:13:21 2014 (r272228) +++ projects/bhyve_svm/contrib/apr-util/crypto/apr_crypto.c Sat Sep 27 22:15:50 2014 (r272229) @@ -204,7 +204,7 @@ APU_DECLARE(apr_status_t) apr_crypto_get if (err && buffer) { apr_dso_error(dso, buffer, ERROR_SIZE - 1); err->msg = buffer; - err->reason = modname; + err->reason = apr_pstrdup(pool, modname); *result = err; } } Modified: projects/bhyve_svm/contrib/apr-util/crypto/apr_passwd.c ============================================================================== --- projects/bhyve_svm/contrib/apr-util/crypto/apr_passwd.c Sat Sep 27 21:13:21 2014 (r272228) +++ projects/bhyve_svm/contrib/apr-util/crypto/apr_passwd.c Sat Sep 27 22:15:50 2014 (r272229) @@ -66,6 +66,12 @@ static void crypt_mutex_unlock(void) #endif #endif +#if defined(WIN32) || defined(BEOS) || defined(NETWARE) || defined(__ANDROID__) +#define CRYPT_MISSING 1 +#else +#define CRYPT_MISSING 0 +#endif + /* * Validate a plaintext password against a smashed one. Uses either * crypt() (if available) or apr_md5_encode() or apr_sha1_base64(), depending @@ -77,7 +83,7 @@ APU_DECLARE(apr_status_t) apr_password_v const char *hash) { char sample[200]; -#if !defined(WIN32) && !defined(BEOS) && !defined(NETWARE) +#if !CRYPT_MISSING char *crypt_pw; #endif if (hash[0] == '$' @@ -100,7 +106,7 @@ APU_DECLARE(apr_status_t) apr_password_v /* * It's not our algorithm, so feed it to crypt() if possible. */ -#if defined(WIN32) || defined(BEOS) || defined(NETWARE) +#if CRYPT_MISSING return (strcmp(passwd, hash) == 0) ? APR_SUCCESS : APR_EMISMATCH; #elif defined(CRYPT_R_CRYPTD) apr_status_t rv; Modified: projects/bhyve_svm/contrib/apr-util/dbd/apr_dbd_mysql.c ============================================================================== --- projects/bhyve_svm/contrib/apr-util/dbd/apr_dbd_mysql.c Sat Sep 27 21:13:21 2014 (r272228) +++ projects/bhyve_svm/contrib/apr-util/dbd/apr_dbd_mysql.c Sat Sep 27 22:15:50 2014 (r272229) @@ -1050,9 +1050,9 @@ static int dbd_mysql_end_transaction(apr else { ret = mysql_commit(trans->handle->conn); } + ret |= mysql_autocommit(trans->handle->conn, 1); + trans->handle->trans = NULL; } - ret |= mysql_autocommit(trans->handle->conn, 1); - trans->handle->trans = NULL; return ret; } /* Whether or not transactions work depends on whether the Modified: projects/bhyve_svm/contrib/apr-util/dbd/apr_dbd_odbc.c ============================================================================== --- projects/bhyve_svm/contrib/apr-util/dbd/apr_dbd_odbc.c Sat Sep 27 21:13:21 2014 (r272228) +++ projects/bhyve_svm/contrib/apr-util/dbd/apr_dbd_odbc.c Sat Sep 27 22:15:50 2014 (r272229) @@ -47,6 +47,21 @@ #include #endif +/* +* MSVC6 does not support intptr_t (C99) +* APR does not have a signed inptr type until 2.0 (r1557720) +*/ +#if defined(_MSC_VER) && _MSC_VER < 1400 +#if APR_SIZEOF_VOIDP == 8 +#define ODBC_INTPTR_T apr_int64_t +#else +#define ODBC_INTPTR_T apr_int32_t +#endif +#else +#define ODBC_INTPTR_T intptr_t +#endif + + /* Driver name is "odbc" and the entry point is 'apr_dbd_odbc_driver' * unless ODBC_DRIVER_NAME is defined and it is linked with another db library which * is ODBC source-compatible. e.g. DB2, Informix, TimesTen, mysql. @@ -114,9 +129,9 @@ struct apr_dbd_t char lastError[MAX_ERROR_STRING]; int defaultBufferSize; /* used for CLOBs in text mode, * and when fld size is indeterminate */ - intptr_t transaction_mode; - intptr_t dboptions; /* driver options re SQLGetData */ - intptr_t default_transaction_mode; + ODBC_INTPTR_T transaction_mode; + ODBC_INTPTR_T dboptions; /* driver options re SQLGetData */ + ODBC_INTPTR_T default_transaction_mode; int can_commit; /* controls end_trans behavior */ }; @@ -359,7 +374,7 @@ static SQLRETURN odbc_set_result_column( SQLHANDLE stmt) { SQLRETURN rc; - intptr_t maxsize, textsize, realsize, type, isunsigned = 1; + ODBC_INTPTR_T maxsize, textsize, realsize, type, isunsigned = 1; /* discover the sql type */ rc = SQLColAttribute(stmt, icol + 1, SQL_DESC_UNSIGNED, NULL, 0, NULL, @@ -747,7 +762,7 @@ static void *odbc_get(const apr_dbd_row_ SQLRETURN rc; SQLLEN indicator; int state = row->res->colstate[col]; - intptr_t options = row->res->apr_dbd->dboptions; + ODBC_INTPTR_T options = row->res->apr_dbd->dboptions; switch (state) { case (COL_UNAVAIL): @@ -817,13 +832,13 @@ static apr_status_t odbc_parse_params(ap int *connect, SQLCHAR **datasource, SQLCHAR **user, SQLCHAR **password, int *defaultBufferSize, int *nattrs, - int **attrs, intptr_t **attrvals) + int **attrs, ODBC_INTPTR_T **attrvals) { char *seps, *last, *next, *name[MAX_PARAMS], *val[MAX_PARAMS]; int nparams = 0, i, j; *attrs = apr_pcalloc(pool, MAX_PARAMS * sizeof(char *)); - *attrvals = apr_pcalloc(pool, MAX_PARAMS * sizeof(intptr_t)); + *attrvals = apr_pcalloc(pool, MAX_PARAMS * sizeof(ODBC_INTPTR_T)); *nattrs = 0; seps = DEFAULTSEPS; name[nparams] = apr_strtok(apr_pstrdup(pool, params), seps, &last); @@ -1063,7 +1078,7 @@ static apr_dbd_t *odbc_open(apr_pool_t * SQLCHAR *datasource = (SQLCHAR *)"", *user = (SQLCHAR *)"", *password = (SQLCHAR *)""; int nattrs = 0, *attrs = NULL, connect = 0; - intptr_t *attrvals = NULL; + ODBC_INTPTR_T *attrvals = NULL; err_step = "SQLAllocHandle (SQL_HANDLE_DBC)"; err_htype = SQL_HANDLE_ENV; @@ -1117,10 +1132,10 @@ static apr_dbd_t *odbc_open(apr_pool_t * handle->default_transaction_mode = 0; handle->can_commit = APR_DBD_TRANSACTION_IGNORE_ERRORS; SQLGetInfo(hdbc, SQL_DEFAULT_TXN_ISOLATION, - &(handle->default_transaction_mode), sizeof(intptr_t), NULL); + &(handle->default_transaction_mode), sizeof(ODBC_INTPTR_T), NULL); handle->transaction_mode = handle->default_transaction_mode; SQLGetInfo(hdbc, SQL_GETDATA_EXTENSIONS ,&(handle->dboptions), - sizeof(intptr_t), NULL); + sizeof(ODBC_INTPTR_T), NULL); apr_pool_cleanup_register(pool, handle, odbc_close_cleanup, apr_pool_cleanup_null); return handle; } Modified: projects/bhyve_svm/contrib/apr-util/dbm/NWGNUmakefile ============================================================================== --- projects/bhyve_svm/contrib/apr-util/dbm/NWGNUmakefile Sat Sep 27 21:13:21 2014 (r272228) +++ projects/bhyve_svm/contrib/apr-util/dbm/NWGNUmakefile Sat Sep 27 22:15:50 2014 (r272229) @@ -235,7 +235,7 @@ nlms :: libs $(TARGET_nlm) # correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) # install :: nlms $(INSTDIRS) FORCE - copy $(OBJDIR)\*.nlm $(INSTALLBASE) + $(call COPY,$(OBJDIR)/*.nlm,$(INSTALLBASE)) # # Any specialized rules here Modified: projects/bhyve_svm/contrib/apr-util/include/apu_version.h ============================================================================== --- projects/bhyve_svm/contrib/apr-util/include/apu_version.h Sat Sep 27 21:13:21 2014 (r272228) +++ projects/bhyve_svm/contrib/apr-util/include/apu_version.h Sat Sep 27 22:15:50 2014 (r272229) @@ -38,7 +38,7 @@ */ -#define APU_COPYRIGHT "Copyright (c) 2013 The Apache Software " \ +#define APU_COPYRIGHT "Copyright (c) 2000-2014 The Apache Software " \ "Foundation or its licensors, as applicable." /* The numeric compile-time version constants. These constants are the @@ -62,7 +62,7 @@ * The Patch Level never includes API changes, simply bug fixes. * Reset to 0 when upgrading APR_MINOR_VERSION */ -#define APU_PATCH_VERSION 3 +#define APU_PATCH_VERSION 4 /** * The symbol APU_IS_DEV_VERSION is only defined for internal, Modified: projects/bhyve_svm/contrib/apr-util/test/Makefile.win ============================================================================== --- projects/bhyve_svm/contrib/apr-util/test/Makefile.win Sat Sep 27 21:13:21 2014 (r272228) +++ projects/bhyve_svm/contrib/apr-util/test/Makefile.win Sat Sep 27 22:15:50 2014 (r272229) @@ -88,6 +88,8 @@ APROUTDIR=$(OUTDIR) !IF "$(MODEL)" == "static" PROGRAM_DEPENDENCIES = \ $(APR_PATH)\$(APROUTDIR)\apr-1.lib \ + $(API_PATH)\$(OUTDIR)\apriconv-1.lib \ + ..\xml\expat\lib\$(OUTDIR)\xml.lib \ ..\$(OUTDIR)\aprutil-1.lib STATIC_CFLAGS = /D APR_DECLARE_STATIC /D APU_DECLARE_STATIC STATIC_LIBS = odbc32.lib odbccp32.lib wldap32.lib Modified: projects/bhyve_svm/contrib/atf/FREEBSD-upgrade ============================================================================== --- projects/bhyve_svm/contrib/atf/FREEBSD-upgrade Sat Sep 27 21:13:21 2014 (r272228) +++ projects/bhyve_svm/contrib/atf/FREEBSD-upgrade Sat Sep 27 22:15:50 2014 (r272229) @@ -7,10 +7,9 @@ branches and you are supposed to follow http://www.freebsd.org/doc/en/articles/committers-guide/subversion-primer.html -The ATF source code is hosted on Google Code as a subcomponent of the -Kyua project: +The ATF source code is hosted on GitHub: - http://code.google.com/p/kyua/downloads/list + https://github.com/jmmv/atf and is imported into the atf vendor branch (see base/vendor/atf/). @@ -42,7 +41,7 @@ the vendor branch as you easily risk com tree. Lastly, with the list of old and new files in this import, make sure -to udpate the reachover Makefiles accordingly. +to update the reachover Makefiles accordingly. Test the build (keeping in mind the WITH_TESTS/WITHOUT_TESTS knobs) and, if all looks good, you are ready to commit all the changes in one go. Modified: projects/bhyve_svm/contrib/atf/atf-c++/atf-c++-api.3 ============================================================================== --- projects/bhyve_svm/contrib/atf/atf-c++/atf-c++-api.3 Sat Sep 27 21:13:21 2014 (r272228) +++ projects/bhyve_svm/contrib/atf/atf-c++/atf-c++-api.3 Sat Sep 27 22:15:50 2014 (r272229) @@ -26,7 +26,7 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd November 15, 2013 +.Dd March 2, 2014 .Dt ATF-C++-API 3 .Os .Sh NAME @@ -330,9 +330,8 @@ If .Va exitcode is not .Sq -1 , -.Xr atf-run 1 -will validate that the exit code of the test case matches the one provided -in this call. +the runtime engine will validate that the exit code of the test case +matches the one provided in this call. Otherwise, the exact value will be ignored. .It Fn expect_fail "reason" Any failure (be it fatal or non-fatal) raised in this mode is recorded. @@ -368,9 +367,8 @@ If .Va signo is not .Sq -1 , -.Xr atf-run 1 -will validate that the signal that terminated the test case matches the one -provided in this call. +the runtime engine will validate that the signal that terminated the test +case matches the one provided in this call. Otherwise, the exact value will be ignored. .It Fn expect_timeout "reason" Expects the test case to execute for longer than its timeout. @@ -631,5 +629,4 @@ ATF_INIT_TEST_CASES(tcs) .Ed .Sh SEE ALSO .Xr atf-test-program 1 , -.Xr atf-test-case 4 , -.Xr atf 7 +.Xr atf-test-case 4 Modified: projects/bhyve_svm/contrib/atf/atf-c/atf-c-api.3 ============================================================================== --- projects/bhyve_svm/contrib/atf/atf-c/atf-c-api.3 Sat Sep 27 21:13:21 2014 (r272228) +++ projects/bhyve_svm/contrib/atf/atf-c/atf-c-api.3 Sat Sep 27 22:15:50 2014 (r272229) @@ -26,7 +26,7 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd November 15, 2013 +.Dd March 2, 2014 .Dt ATF-C-API 3 .Os .Sh NAME @@ -409,9 +409,8 @@ If .Va exitcode is not .Sq -1 , -.Xr atf-run 1 -will validate that the exit code of the test case matches the one provided -in this call. +the runtime engine will validate that the exit code of the test case +matches the one provided in this call. Otherwise, the exact value will be ignored. .It Fn atf_tc_expect_fail "reason" "..." Any failure (be it fatal or non-fatal) raised in this mode is recorded. @@ -443,9 +442,8 @@ If .Va signo is not .Sq -1 , -.Xr atf-run 1 -will validate that the signal that terminated the test case matches the one -provided in this call. +the runtime engine will validate that the signal that terminated the test +case matches the one provided in this call. Otherwise, the exact value will be ignored. .It Fn atf_tc_expect_timeout "reason" "..." Expects the test case to execute for longer than its timeout. @@ -771,5 +769,4 @@ ATF_TP_ADD_TCS(tp) .Ed .Sh SEE ALSO .Xr atf-test-program 1 , -.Xr atf-test-case 4 , -.Xr atf 7 +.Xr atf-test-case 4 Modified: projects/bhyve_svm/contrib/atf/atf-sh/atf-check.1 ============================================================================== --- projects/bhyve_svm/contrib/atf/atf-sh/atf-check.1 Sat Sep 27 21:13:21 2014 (r272228) +++ projects/bhyve_svm/contrib/atf/atf-sh/atf-check.1 Sat Sep 27 22:15:50 2014 (r272229) @@ -26,7 +26,7 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd June 27, 2010 +.Dd March 2, 2014 .Dt ATF-CHECK 1 .Os .Sh NAME @@ -118,15 +118,20 @@ Analyzes standard error (syntax identica Executes .Ar command as a shell command line, executing it with the system shell defined by -.Va ATF_SHELL -in -.Xr atf-config 1 . +.Va ATF_SHELL . You should avoid using this flag if at all possible to prevent shell quoting issues. .El .Sh EXIT STATUS .Nm exits 0 on success, and other (unspecified) value on failure. +.Sh ENVIRONMENT +.Bl -tag -width ATFXSHELLXX -compact +.It Va ATF_SHELL +Path to the system shell to be used when the +.Fl x +is given to run commands. +.El .Sh EXAMPLES .Bd -literal -offset indent # Exit code 0, nothing on stdout/stderr @@ -146,6 +151,3 @@ atf-check -s signal:sigsegv my_program # Combined checks atf-check -o match:foo -o not-match:bar echo foo baz .Ed -.Sh SEE ALSO -.Xr atf-config 1 , -.Xr atf 7 Modified: projects/bhyve_svm/contrib/atf/atf-sh/atf-sh-api.3 ============================================================================== --- projects/bhyve_svm/contrib/atf/atf-sh/atf-sh-api.3 Sat Sep 27 21:13:21 2014 (r272228) +++ projects/bhyve_svm/contrib/atf/atf-sh/atf-sh-api.3 Sat Sep 27 22:15:50 2014 (r272229) @@ -26,7 +26,7 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd October 13, 2013 +.Dd March 2, 2014 .Dt ATF-SH-API 3 .Os .Sh NAME @@ -224,9 +224,8 @@ If .Va exitcode is not .Sq -1 , -.Xr atf-run 1 -will validate that the exit code of the test case matches the one provided -in this call. +the runtime engine will validate that the exit code of the test case +matches the one provided in this call. Otherwise, the exact value will be ignored. .It Fn atf_expect_fail "reason" Any failure raised in this mode is recorded, but such failures do not report @@ -258,9 +257,8 @@ If .Va signo is not .Sq -1 , -.Xr atf-run 1 -will validate that the signal that terminated the test case matches the one -provided in this call. +the runtime engine will validate that the signal that terminated the test +case matches the one provided in this call. Otherwise, the exact value will be ignored. .It Fn atf_expect_timeout "reason" "..." Expects the test case to execute for longer than its timeout. @@ -339,5 +337,4 @@ atf_check -s exit:0 -o match:"^foo$" -e .Sh SEE ALSO .Xr atf-sh 1 , .Xr atf-test-program 1 , -.Xr atf-test-case 4 , -.Xr atf 7 +.Xr atf-test-case 4 Modified: projects/bhyve_svm/contrib/atf/atf-sh/atf-sh.1 ============================================================================== --- projects/bhyve_svm/contrib/atf/atf-sh/atf-sh.1 Sat Sep 27 21:13:21 2014 (r272228) +++ projects/bhyve_svm/contrib/atf/atf-sh/atf-sh.1 Sat Sep 27 22:15:50 2014 (r272229) @@ -26,7 +26,7 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd October 15, 2013 +.Dd March 2, 2014 .Dt ATF-SH 1 .Os .Sh NAME @@ -47,10 +47,8 @@ library. .Pp .Nm is not a real interpreter though: it is just a wrapper around -the system-wide shell defined by the -.Sq atf_shell -configuration value in -.Xr atf-config 1 . +the system-wide shell defined by +.Va ATF_SHELL . .Nm executes the interpreter, loads the .Xr atf-sh-api 3 @@ -68,7 +66,10 @@ The following options are available: .It Fl h Shows a short summary of all available options and their purpose. .El +.Sh ENVIRONMENT +.Bl -tag -width ATFXSHELLXX -compact +.It Va ATF_SHELL +Path to the system shell to be used in the generated scripts. +.El .Sh SEE ALSO -.Xr atf-config 1 , -.Xr atf-sh-api 3 , -.Xr atf 7 +.Xr atf-sh-api 3 Modified: projects/bhyve_svm/contrib/atf/doc/atf-test-case.4 ============================================================================== --- projects/bhyve_svm/contrib/atf/doc/atf-test-case.4 Sat Sep 27 21:13:21 2014 (r272228) +++ projects/bhyve_svm/contrib/atf/doc/atf-test-case.4 Sat Sep 27 22:15:50 2014 (r272229) @@ -26,7 +26,7 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd January 13, 2011 +.Dd March 2, 2014 .Dt ATF-TEST-CASE 4 .Os .Sh NAME @@ -171,9 +171,7 @@ Type: boolean. Optional. .Pp If set to true, specifies that the test case has a cleanup routine that has -to be executed by -.Xr atf-run 1 -during the cleanup phase of the execution. +to be executed by the runtime engine during the cleanup phase of the execution. This property is automatically set by the framework when defining a test case with a cleanup routine, so it should never be set by hand. .It ident @@ -251,8 +249,7 @@ the test case is .Pp If the test case is running as root and this property is .Sq unprivileged , -.Xr atf-run 1 -will automatically drop the privileges if the +the runtime engine will automatically drop the privileges if the .Sq unprivileged-user configuration property is set; otherwise the test case is .Em skipped . @@ -314,7 +311,4 @@ Test cases are always executed with a fi .Sq 0022 . The test case's code is free to change this during execution. .Sh SEE ALSO -.Xr atf-run 1 , -.Xr atf-test-program 1 , -.Xr atf-formats 5 , -.Xr atf 7 +.Xr atf-test-program 1 Modified: projects/bhyve_svm/contrib/atf/doc/atf-test-program.1 ============================================================================== --- projects/bhyve_svm/contrib/atf/doc/atf-test-program.1 Sat Sep 27 21:13:21 2014 (r272228) +++ projects/bhyve_svm/contrib/atf/doc/atf-test-program.1 Sat Sep 27 22:15:50 2014 (r272229) @@ -26,7 +26,7 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd February 6, 2011 +.Dd March 2, 2014 .Dt ATF-TEST-PROGRAM 1 .Os .Sh NAME @@ -61,16 +61,17 @@ instead of the test case body; see Note that the test case is .Em executed without isolation , so it can and probably will create and modify files in the current directory. -To execute test cases in a controller manner, refer to -.Xr atf-run 1 , -which is the preferred way to run test cases. +To execute test cases in a controller manner, you need a runtime engine +that understands the ATF interface. +The recommended runtime engine is +.Xr kyua 1 . You should only execute test cases by hand for debugging purposes. .Pp In the second synopsis form, the test program will list all available test cases alongside their meta-data properties in a format that is machine parseable. This list is processed by -.Xr atf-run 1 +.Xr kyua 1 to know how to execute the test cases of a given test program. .Pp *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***