svn commit: r295035 - stable/10/sys/dev/ixgbe
Author: smh Date: Fri Jan 29 09:16:08 2016 New Revision: 295035 URL: https://svnweb.freebsd.org/changeset/base/295035 Log: MFC r294578: Fix ix advertise value after media change Approved by: re (gjb) Sponsored by: Multiplay Modified: stable/10/sys/dev/ixgbe/if_ix.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ixgbe/if_ix.c == --- stable/10/sys/dev/ixgbe/if_ix.c Fri Jan 29 03:10:22 2016 (r295034) +++ stable/10/sys/dev/ixgbe/if_ix.c Fri Jan 29 09:16:08 2016 (r295035) @@ -1855,10 +1855,16 @@ ixgbe_media_change(struct ifnet * ifp) hw->mac.autotry_restart = TRUE; hw->mac.ops.setup_link(hw, speed, TRUE); - adapter->advertise = - ((speed & IXGBE_LINK_SPEED_10GB_FULL) << 2) | - ((speed & IXGBE_LINK_SPEED_1GB_FULL) << 1) | - ((speed & IXGBE_LINK_SPEED_100_FULL) << 0); + if (IFM_SUBTYPE(ifm->ifm_media) == IFM_AUTO) { + adapter->advertise = 0; + } else { + if ((speed & IXGBE_LINK_SPEED_10GB_FULL) != 0) + adapter->advertise |= 1 << 2; + if ((speed & IXGBE_LINK_SPEED_1GB_FULL) != 0) + adapter->advertise |= 1 << 1; + if ((speed & IXGBE_LINK_SPEED_100_FULL) != 0) + adapter->advertise |= 1 << 0; + } return (0); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r295036 - in head/sys: arm/arm arm/conf arm/include conf
Author: mmel Date: Fri Jan 29 10:31:54 2016 New Revision: 295036 URL: https://svnweb.freebsd.org/changeset/base/295036 Log: ARM: remove old pmap-v6 code. The new pmap-v6 is mature enough, and dual implementation is showstopper for major cleanup. This patch only removes old code from tree. Cleanups will follow asap. Deleted: head/sys/arm/arm/pmap-v6.c Modified: head/sys/arm/arm/genassym.c head/sys/arm/arm/locore-v6.S head/sys/arm/arm/machdep.c head/sys/arm/arm/mem.c head/sys/arm/arm/mp_machdep.c head/sys/arm/arm/swtch.S head/sys/arm/arm/trap-v6.c head/sys/arm/conf/std.armv6 head/sys/arm/include/machdep.h head/sys/arm/include/pmap.h head/sys/arm/include/pte.h head/sys/arm/include/sf_buf.h head/sys/arm/include/vm.h head/sys/conf/files.arm head/sys/conf/options.arm Modified: head/sys/arm/arm/genassym.c == --- head/sys/arm/arm/genassym.c Fri Jan 29 09:16:08 2016(r295035) +++ head/sys/arm/arm/genassym.c Fri Jan 29 10:31:54 2016(r295036) @@ -61,16 +61,16 @@ __FBSDID("$FreeBSD$"); ASSYM(KERNBASE, KERNBASE); ASSYM(PCB_NOALIGNFLT, PCB_NOALIGNFLT); -#ifdef ARM_NEW_PMAP +#if __ARM_ARCH >= 6 ASSYM(CPU_ASID_KERNEL,CPU_ASID_KERNEL); #endif ASSYM(PCB_ONFAULT, offsetof(struct pcb, pcb_onfault)); -#ifndef ARM_NEW_PMAP +#if __ARM_ARCH < 6 ASSYM(PCB_DACR, offsetof(struct pcb, pcb_dacr)); #endif ASSYM(PCB_FLAGS, offsetof(struct pcb, pcb_flags)); ASSYM(PCB_PAGEDIR, offsetof(struct pcb, pcb_pagedir)); -#ifndef ARM_NEW_PMAP +#if __ARM_ARCH < 6 ASSYM(PCB_L1VEC, offsetof(struct pcb, pcb_l1vec)); ASSYM(PCB_PL1VEC, offsetof(struct pcb, pcb_pl1vec)); #endif Modified: head/sys/arm/arm/locore-v6.S == --- head/sys/arm/arm/locore-v6.SFri Jan 29 09:16:08 2016 (r295035) +++ head/sys/arm/arm/locore-v6.SFri Jan 29 10:31:54 2016 (r295036) @@ -30,6 +30,7 @@ #include "assym.s" #include +#include #include #include #include @@ -39,11 +40,6 @@ __FBSDID("$FreeBSD$"); -#ifndef ARM_NEW_PMAP -#definePTE1_OFFSET L1_S_OFFSET -#definePTE1_SHIFT L1_S_SHIFT -#definePTE1_SIZE L1_S_SIZE -#endif #if __ARM_ARCH >= 7 #if defined(__ARM_ARCH_7VE__) || defined(__clang__) @@ -287,7 +283,6 @@ ASENTRY_NP(init_mmu) mov r0, #((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2)) | DOMAIN_CLIENT) mcr CP15_DACR(r0) -#ifdef ARM_NEW_PMAP /* * Set TEX remap registers * - All is set to uncacheable memory @@ -296,7 +291,6 @@ ASENTRY_NP(init_mmu) mcr CP15_PRRR(r0) mov r0, #0 mcr CP15_NMRR(r0) -#endif mcr CP15_TLBIALL/* Flush TLB */ DSB ISB @@ -305,9 +299,7 @@ ASENTRY_NP(init_mmu) mrc CP15_SCTLR(r0) orr r0, r0, #CPU_CONTROL_MMU_ENABLE orr r0, r0, #CPU_CONTROL_V6_EXTPAGE -#ifdef ARM_NEW_PMAP orr r0, r0, #CPU_CONTROL_TR_ENABLE -#endif orr r0, r0, #CPU_CONTROL_AF_ENABLE mcr CP15_SCTLR(r0) DSB @@ -398,23 +390,11 @@ END(reinit_mmu) * Addresses must be 1MiB aligned */ build_device_pagetables: -#if defined(ARM_NEW_PMAP) ldr r4, =PTE1_V|PTE1_A|PTE1_AP_KRW|TEX1_CLASS_0 -#elif defined(SMP) - ldr r4, =(L1_TYPE_S|L1_S_AP(AP_KRW)|L1_SHARED) -#else - ldr r4, =(L1_TYPE_S|L1_S_AP(AP_KRW)) -#endif b 1f build_pagetables: /* Set the required page attributed */ -#if defined(ARM_NEW_PMAP) ldr r4, =PTE1_V|PTE1_A|PTE1_AP_KRW|TEX1_CLASS_0 -#elif defined(SMP) - ldr r4, =(L1_TYPE_S|L1_S_C|L1_S_AP(AP_KRW)|L1_SHARED) -#else - ldr r4, =(L1_TYPE_S|L1_S_C|L1_S_AP(AP_KRW)) -#endif 1: orr r1, r4 Modified: head/sys/arm/arm/machdep.c == --- head/sys/arm/arm/machdep.c Fri Jan 29 09:16:08 2016(r295035) +++ head/sys/arm/arm/machdep.c Fri Jan 29 10:31:54 2016(r295036) @@ -199,7 +199,7 @@ static char *loader_envp; vm_paddr_t pmap_pa; -#ifdef ARM_NEW_PMAP +#if __ARM_ARCH >= 6 vm_offset_t systempage; vm_offset_t irqstack; vm_offset_t undstack; @@ -456,7 +456,7 @@ cpu_startup(void *dummy) pcb->pcb_regs.sf_sp = (u_int)thread0.td_kstack + USPACE_SVC_STACK_TOP; pmap_set_pcb_pagedir(pmap_kernel(), pcb); -#ifndef ARM_NEW_PMAP +#if __ARM_ARCH < 6 vector_page_setprot(VM_PROT_READ); pmap_postinit(); #endif @@ -1283,7 +1283,7 @@ arm_predict_branch(void *cookie, u_int i } } -#ifdef ARM_NEW_PMAP +#if __ARM_ARCH >= 6 void set_stackptrs(int cpu) { @@ -1447,7 +1447,7 @@ print_kenv(void) debugf(" %x %s\n", (uint32_t)cp, cp); } -#ifndef ARM_NEW_PMAP +#if __ARM_ARCH < 6 void * initarm(struct arm_boot_params *abp) { @@ -1717,7 +1717,7 @@ initarm(
svn commit: r295037 - in head/sys: arm/arm conf
Author: mmel Date: Fri Jan 29 11:00:33 2016 New Revision: 295037 URL: https://svnweb.freebsd.org/changeset/base/295037 Log: ARM: After removal of old pmap-v6 code, rename pmap-v6-new.c to pmap-v6.c. Added: head/sys/arm/arm/pmap-v6.c - copied unchanged from r295036, head/sys/arm/arm/pmap-v6-new.c Deleted: head/sys/arm/arm/pmap-v6-new.c Modified: head/sys/conf/files.arm Copied: head/sys/arm/arm/pmap-v6.c (from r295036, head/sys/arm/arm/pmap-v6-new.c) == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/arm/pmap-v6.c Fri Jan 29 11:00:33 2016(r295037, copy of r295036, head/sys/arm/arm/pmap-v6-new.c) @@ -0,0 +1,6634 @@ +/*- + * Copyright (c) 1991 Regents of the University of California. + * Copyright (c) 1994 John S. Dyson + * Copyright (c) 1994 David Greenman + * Copyright (c) 2005-2010 Alan L. Cox + * Copyright (c) 2014 Svatopluk Kraus + * Copyright (c) 2014 Michal Meloun + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * the Systems Programming Group of the University of Utah Computer + * Science Department and William Jolitz of UUNET Technologies Inc. + * + * 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. + * 3. Neither the name of the University nor the names of its contributors + *may be used to endorse or promote products derived from this software + *without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. + * + * from: @(#)pmap.c 7.7 (Berkeley) 5/12/91 + */ +/*- + * Copyright (c) 2003 Networks Associates Technology, Inc. + * All rights reserved. + * + * This software was developed for the FreeBSD Project by Jake Burkholder, + * Safeport Network Services, and Network Associates Laboratories, the + * Security Research Division of Network Associates, Inc. under + * DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the DARPA + * CHATS research program. + * + * 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$"); + +/* + * Manages physical address maps. + * + * Since the information managed by this module is + * also stored by the logical address mapping module, + * this module may throw away valid virtual-to-physical + * mappings at almost any time. However, invalidations + * of virtual-to-physical mappings must be done as + * requested. + * + * In order to cope with hardware
svn commit: r295038 - in head/sys: arm64/arm64 arm64/include conf
Author: wma Date: Fri Jan 29 13:06:30 2016 New Revision: 295038 URL: https://svnweb.freebsd.org/changeset/base/295038 Log: Framework for ARM64 instruction disassembler Provide an easy to use framework for ARM64 DDB disassembler. This commit does not contain full list of instruction opcodes. Obtained from: Semihalf Sponsored by: Cavium Approved by: cognet (mentor) Reviewed by: zbb, andrew, cognet Differential revision: https://reviews.freebsd.org/D5114 Added: head/sys/arm64/arm64/disassem.c (contents, props changed) head/sys/arm64/include/disassem.h (contents, props changed) Modified: head/sys/arm64/arm64/db_disasm.c head/sys/arm64/include/armreg.h head/sys/conf/files.arm64 Modified: head/sys/arm64/arm64/db_disasm.c == --- head/sys/arm64/arm64/db_disasm.cFri Jan 29 11:00:33 2016 (r295037) +++ head/sys/arm64/arm64/db_disasm.cFri Jan 29 13:06:30 2016 (r295038) @@ -31,11 +31,40 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + +#include + +static u_int db_disasm_read_word(vm_offset_t); +static void db_disasm_printaddr(vm_offset_t); + +/* Glue code to interface db_disasm to the generic ARM disassembler */ +static const struct disasm_interface db_disasm_interface = { + db_disasm_read_word, + db_disasm_printaddr, + db_printf +}; + +static u_int +db_disasm_read_word(vm_offset_t address) +{ + + return (db_get_value(address, INSN_SIZE, 0)); +} + +static void +db_disasm_printaddr(vm_offset_t address) +{ + + db_printsym((db_addr_t)address, DB_STGY_ANY); +} vm_offset_t db_disasm(vm_offset_t loc, bool altfmt) { - return 0; + + return (disasm(&db_disasm_interface, loc, altfmt)); } /* End of db_disasm.c */ Added: head/sys/arm64/arm64/disassem.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/arm64/disassem.c Fri Jan 29 13:06:30 2016 (r295038) @@ -0,0 +1,330 @@ +/*- + * Copyright (c) 2016 Cavium + * All rights reserved. + * + * This software was developed by Semihalf. + * + * 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$"); +#include + +#include +#include +#include +#include + +#defineARM64_MAX_TOKEN_LEN 8 +#defineARM64_MAX_TOKEN_CNT 10 + +static const char *w_reg[] = { + "w0", "w1", "w2", "w3", "w4", "w5", "w6", "w7", + "w8", "w9", "w10", "w11", "w12", "w13", "w14", "w15", + "w16", "w17", "w18", "w19", "w20", "w21", "w22", "w23", + "w24", "w25", "w26", "w27", "w28", "w29", "w30", "wSP", +}; + +static const char *x_reg[] = { + "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7", + "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15", + "x16", "x17", "x18", "x19", "x20", "x21", "x22", "x23", + "x24", "x25", "x26", "x27", "x28", "x29", "LR", "SP", +}; + +static const char *shift_2[] = { + "LSL", "LSR", "ASR", "RSV" +}; + +/* + * Structure representing single token (operand) inside instruction. + * name - name of operand + * pos- position within the instruction (in bits) + * len- operand length (in bits) + */ +struct arm64_insn_token { + char name[ARM64_MAX_TOKEN_LEN]; + int pos; + int len; +}; + +/* + * Define generic types for instruction printing. + */ +enum arm64_format_type { + TYPE_01,/* OP , , {, #} SF32/64 + OP , , #{, } SF32/64 */ +}; + +/* + * Structure representing single parsed instruction format. + * name - opcode na
svn commit: r295039 - in head: lib/libc/gen lib/libc/include lib/libc/sys sys/sys
Author: kib Date: Fri Jan 29 14:12:12 2016 New Revision: 295039 URL: https://svnweb.freebsd.org/changeset/base/295039 Log: Add implementations of sendmmsg(3) and recvmmsg(3) functions which wraps sendmsg(2) and recvmsg(2) into batch send and receive operation. The goal of this implementation is only to provide API compatibility with Linux. The cancellation behaviour of the functions is not quite right, but due to relative rare use of cancellation it is considered acceptable comparing with the complexity of the correct implementation. If functions are reimplemented as syscalls, the fix would come almost trivial. The direct use of the syscall trampolines instead of libc wrappers for sendmsg(2) and recvmsg(2) is to avoid data loss on cancellation. Submitted by: Boris Astardzhiev Discussed with: jilles (cancellation behaviour) MFC after:1 month Added: head/lib/libc/gen/recvmmsg.c (contents, props changed) head/lib/libc/gen/sendmmsg.c (contents, props changed) Modified: head/lib/libc/gen/Makefile.inc head/lib/libc/include/namespace.h head/lib/libc/include/un-namespace.h head/lib/libc/sys/Symbol.map head/lib/libc/sys/recv.2 head/lib/libc/sys/send.2 head/sys/sys/socket.h Modified: head/lib/libc/gen/Makefile.inc == --- head/lib/libc/gen/Makefile.inc Fri Jan 29 13:06:30 2016 (r295038) +++ head/lib/libc/gen/Makefile.inc Fri Jan 29 14:12:12 2016 (r295039) @@ -99,11 +99,13 @@ SRCS+= __getosreldate.c \ raise.c \ readdir.c \ readpassphrase.c \ + recvmmsg.c \ rewinddir.c \ scandir.c \ seed48.c \ seekdir.c \ semctl.c \ + sendmmsg.c \ setdomainname.c \ sethostname.c \ setjmperr.c \ @@ -451,10 +453,12 @@ MLINKS+=rand48.3 _rand48.3 \ rand48.3 nrand48.3 \ rand48.3 seed48.3 \ rand48.3 srand48.3 +MLINKS+=recv.2 recvmmsg.2 MLINKS+=scandir.3 alphasort.3 MLINKS+=sem_open.3 sem_close.3 \ sem_open.3 sem_unlink.3 MLINKS+=sem_wait.3 sem_trywait.3 +MLINKS+=send.2 sendmmsg.2 MLINKS+=setjmp.3 _longjmp.3 \ setjmp.3 _setjmp.3 \ setjmp.3 longjmp.3 \ Added: head/lib/libc/gen/recvmmsg.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/gen/recvmmsg.cFri Jan 29 14:12:12 2016 (r295039) @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2016 Boris Astardzhiev, Smartcom-Bulgaria AD + * 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(s), this list of conditions and the following disclaimer as + *the first lines of this file unmodified other than the possible + *addition of one or more copyright notices. + * 2. Redistributions in binary form must reproduce the above copyright + *notice(s), 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 COPYRIGHT HOLDER(S) ``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 COPYRIGHT HOLDER(S) 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$"); + +#include +#include +#include +#include +#include +#include "libc_private.h" + +ssize_t +recvmmsg(int s, struct mmsghdr *__restrict msgvec, size_t vlen, int flags, +const struct timespec *__restrict timeout) +{ + struct pollfd pfd[1]; + size_t i, rcvd; + ssize_t ret; + int res; + short ev; + + if (timeout != NULL) { + pfd[0].fd = s; + pfd[0].revents = 0; + pfd[0].events = ev = POLLIN | POLLRDNORM | POLLRDBAND | + POLLPRI; + res = ppoll(&pfd[0], 1, timeout, NULL); + if (res == -1 || res == 0) + return (res); + if (pfd[0].revents & POLLNVAL) { + errno = EBADF; + return (-1); + } + if ((pfd[0].revents & ev) == 0) {
svn commit: r295041 - in head/sys: boot/fdt/dts/riscv boot/ficl/riscv cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/sys conf dev/hwpmc riscv/conf riscv/htif riscv/riscv sys
Author: br Date: Fri Jan 29 15:12:31 2016 New Revision: 295041 URL: https://svnweb.freebsd.org/changeset/base/295041 Log: Welcome the RISC-V 64-bit kernel. This is the final step required allowing to compile and to run RISC-V kernel and userland from HEAD. RISC-V is a completely open ISA that is freely available to academia and industry. Thanks to all the people involved! Special thanks to Andrew Turner, David Chisnall, Ed Maste, Konstantin Belousov, John Baldwin and Arun Thomas for their help. Thanks to Robert Watson for organizing this project. This project sponsored by UK Higher Education Innovation Fund (HEIF5) and DARPA CTSRD project at the University of Cambridge Computer Laboratory. FreeBSD/RISC-V project home: https://wiki.freebsd.org/riscv Reviewed by: andrew, emaste, kib Relnotes: Yes Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Differential Revision:https://reviews.freebsd.org/D4982 Added: head/sys/boot/fdt/dts/riscv/ head/sys/boot/fdt/dts/riscv/spike.dts (contents, props changed) head/sys/boot/ficl/riscv/ head/sys/boot/ficl/riscv/sysdep.c (contents, props changed) head/sys/boot/ficl/riscv/sysdep.h (contents, props changed) head/sys/conf/Makefile.riscv (contents, props changed) head/sys/conf/files.riscv (contents, props changed) head/sys/conf/ldscript.riscv (contents, props changed) head/sys/conf/options.riscv (contents, props changed) head/sys/dev/hwpmc/hwpmc_riscv.h (contents, props changed) head/sys/riscv/conf/ head/sys/riscv/conf/DEFAULTS (contents, props changed) head/sys/riscv/conf/GENERIC (contents, props changed) head/sys/riscv/htif/ head/sys/riscv/htif/htif.c (contents, props changed) head/sys/riscv/htif/htif.h (contents, props changed) head/sys/riscv/htif/htif_block.c (contents, props changed) head/sys/riscv/htif/htif_console.c (contents, props changed) head/sys/riscv/riscv/ head/sys/riscv/riscv/autoconf.c (contents, props changed) head/sys/riscv/riscv/bcopy.c (contents, props changed) head/sys/riscv/riscv/bus_machdep.c (contents, props changed) head/sys/riscv/riscv/busdma_machdep.c (contents, props changed) head/sys/riscv/riscv/clock.c (contents, props changed) head/sys/riscv/riscv/copyinout.S (contents, props changed) head/sys/riscv/riscv/copystr.c (contents, props changed) head/sys/riscv/riscv/cpufunc_asm.S (contents, props changed) head/sys/riscv/riscv/devmap.c (contents, props changed) head/sys/riscv/riscv/dump_machdep.c (contents, props changed) head/sys/riscv/riscv/elf_machdep.c (contents, props changed) head/sys/riscv/riscv/exception.S (contents, props changed) head/sys/riscv/riscv/genassym.c (contents, props changed) head/sys/riscv/riscv/identcpu.c (contents, props changed) head/sys/riscv/riscv/in_cksum.c (contents, props changed) head/sys/riscv/riscv/intr_machdep.c (contents, props changed) head/sys/riscv/riscv/locore.S (contents, props changed) head/sys/riscv/riscv/machdep.c (contents, props changed) head/sys/riscv/riscv/mem.c (contents, props changed) head/sys/riscv/riscv/minidump_machdep.c (contents, props changed) head/sys/riscv/riscv/nexus.c (contents, props changed) head/sys/riscv/riscv/pmap.c (contents, props changed) head/sys/riscv/riscv/support.S (contents, props changed) head/sys/riscv/riscv/swtch.S (contents, props changed) head/sys/riscv/riscv/sys_machdep.c (contents, props changed) head/sys/riscv/riscv/timer.c (contents, props changed) head/sys/riscv/riscv/trap.c (contents, props changed) head/sys/riscv/riscv/uio_machdep.c (contents, props changed) head/sys/riscv/riscv/uma_machdep.c (contents, props changed) head/sys/riscv/riscv/vm_machdep.c (contents, props changed) Modified: head/sys/cddl/compat/opensolaris/sys/atomic.h head/sys/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h head/sys/conf/kern.mk head/sys/conf/kern.pre.mk head/sys/sys/cdefs.h head/sys/sys/kerneldump.h Added: head/sys/boot/fdt/dts/riscv/spike.dts == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/riscv/spike.dts Fri Jan 29 15:12:31 2016 (r295041) @@ -0,0 +1,92 @@ +/*- + * Copyright (c) 2015 Ruslan Bukin + * All rights reserved. + * + * Portions of this software were developed by SRI International and the + * University of Cambridge Computer Laboratory under DARPA/AFRL contract + * FA8750-10-C-0237 ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Portions of this software were developed by the University of Cambridge + * Computer Laboratory as part of the CTSRD Project, with support from the + * UK Higher Education Innovation Fund (HEIF). + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditi
svn commit: r295042 - in head/sys/arm: arm include
Author: skra Date: Fri Jan 29 16:01:37 2016 New Revision: 295042 URL: https://svnweb.freebsd.org/changeset/base/295042 Log: Use kernel_pmap directly instead of pmap_kernel(). The kernel_pmap is already used for __ARM_ARCH >= 6 and so even for __ARM_ARCH < 6 on some common places. Modified: head/sys/arm/arm/db_interface.c head/sys/arm/arm/machdep.c head/sys/arm/arm/pmap.c head/sys/arm/include/pmap-v6.h head/sys/arm/include/pmap.h Modified: head/sys/arm/arm/db_interface.c == --- head/sys/arm/arm/db_interface.c Fri Jan 29 15:12:31 2016 (r295041) +++ head/sys/arm/arm/db_interface.c Fri Jan 29 16:01:37 2016 (r295042) @@ -170,7 +170,7 @@ db_validate_address(vm_offset_t addr) addr >= VM_MIN_KERNEL_ADDRESS #endif ) - pmap = pmap_kernel(); + pmap = kernel_pmap; else pmap = p->p_vmspace->vm_map.pmap; Modified: head/sys/arm/arm/machdep.c == --- head/sys/arm/arm/machdep.c Fri Jan 29 15:12:31 2016(r295041) +++ head/sys/arm/arm/machdep.c Fri Jan 29 16:01:37 2016(r295042) @@ -455,7 +455,7 @@ cpu_startup(void *dummy) vm_pager_bufferinit(); pcb->pcb_regs.sf_sp = (u_int)thread0.td_kstack + USPACE_SVC_STACK_TOP; - pmap_set_pcb_pagedir(pmap_kernel(), pcb); + pmap_set_pcb_pagedir(kernel_pmap, pcb); #if __ARM_ARCH < 6 vector_page_setprot(VM_PROT_READ); pmap_postinit(); Modified: head/sys/arm/arm/pmap.c == --- head/sys/arm/arm/pmap.c Fri Jan 29 15:12:31 2016(r295041) +++ head/sys/arm/arm/pmap.c Fri Jan 29 16:01:37 2016(r295042) @@ -394,7 +394,7 @@ int pmap_needs_pte_sync; #define PMAP_SHPGPERPROC 200 #endif -#define pmap_is_current(pm)((pm) == pmap_kernel() || \ +#define pmap_is_current(pm)((pm) == kernel_pmap || \ curproc->p_vmspace->vm_map.pmap == (pm)) static uma_zone_t pvzone = NULL; uma_zone_t l2zone; @@ -437,10 +437,10 @@ pmap_init_l1(struct l1_ttable *l1, pd_en /* * Copy the kernel's L1 entries to each new L1. */ - if (l1pt != pmap_kernel()->pm_l1->l1_kva) - memcpy(l1pt, pmap_kernel()->pm_l1->l1_kva, L1_TABLE_SIZE); + if (l1pt != kernel_pmap->pm_l1->l1_kva) + memcpy(l1pt, kernel_pmap->pm_l1->l1_kva, L1_TABLE_SIZE); - if ((l1->l1_physaddr = pmap_extract(pmap_kernel(), (vm_offset_t)l1pt)) == 0) + if ((l1->l1_physaddr = pmap_extract(kernel_pmap, (vm_offset_t)l1pt)) == 0) panic("pmap_init_l1: can't get PA of L1 at %p", l1pt); SLIST_INSERT_HEAD(&l1_list, l1, l1_link); TAILQ_INSERT_TAIL(&l1_lru_list, l1, l1_lru); @@ -932,7 +932,7 @@ pmap_free_l2_bucket(pmap_t pm, struct l2 * to a performance win over time as we don't need to continually * alloc/free. */ - if (l2b->l2b_occupancy > 0 || pm == pmap_kernel()) + if (l2b->l2b_occupancy > 0 || pm == kernel_pmap) return; /* @@ -1002,7 +1002,7 @@ pmap_l2ptp_ctor(void *mem, int size, voi * page tables, we simply fix up the cache-mode here if it's not * correct. */ - l2b = pmap_get_l2_bucket(pmap_kernel(), va); + l2b = pmap_get_l2_bucket(kernel_pmap, va); ptep = &l2b->l2b_kva[l2pte_index(va)]; pte = *ptep; @@ -1077,9 +1077,9 @@ pmap_idcache_wbinv_range(pmap_t pm, vm_o vm_size_t rest; CTR4(KTR_PMAP, "pmap_dcache_wbinv_range: pmap %p is_kernel %d va 0x%08x" - " len 0x%x ", pm, pm == pmap_kernel(), va, len); + " len 0x%x ", pm, pm == kernel_pmap, va, len); - if (pmap_is_current(pm) || pm == pmap_kernel()) { + if (pmap_is_current(pm) || pm == kernel_pmap) { rest = MIN(PAGE_SIZE - (va & PAGE_MASK), len); while (len > 0) { if (pmap_has_valid_mapping(pm, va)) { @@ -1100,7 +1100,7 @@ pmap_dcache_wb_range(pmap_t pm, vm_offse vm_size_t rest; CTR4(KTR_PMAP, "pmap_dcache_wb_range: pmap %p is_kernel %d va 0x%08x " - "len 0x%x ", pm, pm == pmap_kernel(), va, len); + "len 0x%x ", pm, pm == kernel_pmap, va, len); CTR2(KTR_PMAP, " do_inv %d rd_only %d", do_inv, rd_only); if (pmap_is_current(pm)) { @@ -1230,13 +1230,13 @@ pmap_fix_cache(struct vm_page *pg, pmap_ TAILQ_FOREACH(pv, &pg->md.pv_list, pv_list) { /* generate a count of the pv_entry uses */ if (pv->pv_flags & PVF_WRITE) { - if (pv->pv_pmap == pmap_kernel()) + if (pv->pv_pmap == kernel_pmap) kwritable++; else
svn commit: r295043 - head/sys/arm/include
Author: skra Date: Fri Jan 29 16:42:03 2016 New Revision: 295043 URL: https://svnweb.freebsd.org/changeset/base/295043 Log: Remove NPTEPG definition which is not used anywhere now after introduction of new pmap dump interface (r294722). And do not expose pt_entry_t type. Modified: head/sys/arm/include/param.h Modified: head/sys/arm/include/param.h == --- head/sys/arm/include/param.hFri Jan 29 16:01:37 2016 (r295042) +++ head/sys/arm/include/param.hFri Jan 29 16:42:03 2016 (r295043) @@ -110,7 +110,6 @@ #definePAGE_SHIFT 12 #definePAGE_SIZE (1 << PAGE_SHIFT) /* Page size */ #definePAGE_MASK (PAGE_SIZE - 1) -#defineNPTEPG (PAGE_SIZE/(sizeof (pt_entry_t))) #define PDR_SHIFT 20 /* log2(NBPDR) */ #define NBPDR (1 << PDR_SHIFT) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r295045 - in head: . sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: asomers Date: Fri Jan 29 17:08:26 2016 New Revision: 295045 URL: https://svnweb.freebsd.org/changeset/base/295045 Log: Add a sysctl to allow ZFS pools backed by zvols Change 294329 removed the ability to build ZFS pools that are backed by zvols, because having that ability (even if it's not used) leads to deadlocks. By popular demand, I'm adding an off-by-default sysctl to reenable that ability. Reviewed by: lidl, delphij MFC after:Never Sponsored by: Spectra Logic Corp Differential Revision:https://reviews.freebsd.org/D4998 Modified: head/UPDATING head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Modified: head/UPDATING == --- head/UPDATING Fri Jan 29 17:05:30 2016(r295044) +++ head/UPDATING Fri Jan 29 17:08:26 2016(r295045) @@ -31,6 +31,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20160129: + Building ZFS pools on top of zvols is prohibited by default. That + feature has never worked safely; it's always been prone to deadlocks. + Using a zvol as the backing store for a VM guest's virtual disk will + still work, even if the guest is using ZFS. Legacy behavior can be + restored by setting vfs.zfs.vol.recursive=1. + 20160119: The NONE and HPN patches has been removed from OpenSSH. They are still available in the security/openssh-portable port. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Fri Jan 29 17:05:30 2016(r295044) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Fri Jan 29 17:08:26 2016(r295045) @@ -134,6 +134,9 @@ SYSCTL_NODE(_vfs_zfs, OID_AUTO, vol, CTL static int volmode = ZFS_VOLMODE_GEOM; SYSCTL_INT(_vfs_zfs_vol, OID_AUTO, mode, CTLFLAG_RWTUN, &volmode, 0, "Expose as GEOM providers (1), device files (2) or neither"); +static boolean_t zpool_on_zvol = B_FALSE; +SYSCTL_INT(_vfs_zfs_vol, OID_AUTO, recursive, CTLFLAG_RWTUN, &zpool_on_zvol, 0, +"Allow zpools to use zvols as vdevs (DANGEROUS)"); #endif typedef struct zvol_extent { @@ -1114,7 +1117,9 @@ zvol_open(struct g_provider *pp, int fla return (err); } #else /* !illumos */ - if (tsd_get(zfs_geom_probe_vdev_key) != NULL) { + boolean_t locked = B_FALSE; + + if (!zpool_on_zvol && tsd_get(zfs_geom_probe_vdev_key) != NULL) { /* * if zfs_geom_probe_vdev_key is set, that means that zfs is * attempting to probe geom providers while looking for a @@ -1125,19 +1130,34 @@ zvol_open(struct g_provider *pp, int fla */ return (EOPNOTSUPP); } - - mutex_enter(&zfsdev_state_lock); + /* +* Protect against recursively entering spa_namespace_lock +* when spa_open() is used for a pool on a (local) ZVOL(s). +* This is needed since we replaced upstream zfsdev_state_lock +* with spa_namespace_lock in the ZVOL code. +* We are using the same trick as spa_open(). +* Note that calls in zvol_first_open which need to resolve +* pool name to a spa object will enter spa_open() +* recursively, but that function already has all the +* necessary protection. +*/ + if (!MUTEX_HELD(&zfsdev_state_lock)) { + mutex_enter(&zfsdev_state_lock); + locked = B_TRUE; + } zv = pp->private; if (zv == NULL) { - mutex_exit(&zfsdev_state_lock); + if (locked) + mutex_exit(&zfsdev_state_lock); return (SET_ERROR(ENXIO)); } if (zv->zv_total_opens == 0) { err = zvol_first_open(zv); if (err) { - mutex_exit(&zfsdev_state_lock); + if (locked) + mutex_exit(&zfsdev_state_lock); return (err); } pp->mediasize = zv->zv_volsize; @@ -1171,7 +1191,8 @@ zvol_open(struct g_provider *pp, int fla mutex_exit(&zfsdev_state_lock); #else zv->zv_total_opens += count; - mutex_exit(&zfsdev_state_lock); + if (locked) + mutex_exit(&zfsdev_state_lock); #endif return (err); @@ -1181,7 +1202,8 @@ out: #ifdef illumos mutex_exit(&zfsdev_state_lock); #else - mutex_exit(&zfsdev_state_lock); + if (locked) + mutex_exit(&
svn commit: r295046 - vendor/illumos/dist/lib/libzfs/common
Author: mav Date: Fri Jan 29 17:18:50 2016 New Revision: 295046 URL: https://svnweb.freebsd.org/changeset/base/295046 Log: 6358 A faulted pool with only unavailable vdevs triggers assertion failure in libzfs Reviewed by: Matthew Ahrens Reviewed by: Andrew Stormont Reviewed by: Serban Maduta Approved by: Dan McDonald Author: Dan Vatca illumos/illumos-gate@b289d045e084af53efcc025255af8242e41f28fa Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_config.c Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_config.c == --- vendor/illumos/dist/lib/libzfs/common/libzfs_config.c Fri Jan 29 17:08:26 2016(r295045) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_config.c Fri Jan 29 17:18:50 2016(r295046) @@ -26,6 +26,7 @@ /* * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2015 by Syneto S.R.L. All rights reserved. */ /* @@ -246,8 +247,9 @@ zpool_get_features(zpool_handle_t *zhp) config = zpool_get_config(zhp, NULL); } - verify(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_FEATURE_STATS, - &features) == 0); + if (nvlist_lookup_nvlist(config, ZPOOL_CONFIG_FEATURE_STATS, + &features) != 0) + return (NULL); return (features); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r295047 - head/cddl/contrib/opensolaris/lib/libzfs/common
Author: mav Date: Fri Jan 29 17:20:59 2016 New Revision: 295047 URL: https://svnweb.freebsd.org/changeset/base/295047 Log: MFV 295046: 6358 A faulted pool with only unavailable vdevs triggers assertion failure in libzfs Reviewed by: Matthew Ahrens Reviewed by: Andrew Stormont Reviewed by: Serban Maduta Approved by: Dan McDonald Author: Dan Vatca illumos/illumos-gate@b289d045e084af53efcc025255af8242e41f28fa Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_config.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/lib/libzfs/ (props changed) Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_config.c == --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_config.c Fri Jan 29 17:18:50 2016(r295046) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_config.c Fri Jan 29 17:20:59 2016(r295047) @@ -26,6 +26,7 @@ /* * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2015 by Syneto S.R.L. All rights reserved. */ /* @@ -246,8 +247,9 @@ zpool_get_features(zpool_handle_t *zhp) config = zpool_get_config(zhp, NULL); } - verify(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_FEATURE_STATS, - &features) == 0); + if (nvlist_lookup_nvlist(config, ZPOOL_CONFIG_FEATURE_STATS, + &features) != 0) + return (NULL); return (features); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
RE: svn commit: r295045 - in head: .sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Thank you. :) Sent from my cellphone, ~Cy -Original Message- From: Alan Somers Sent: 29/01/2016 09:08 To: src-committ...@freebsd.org; svn-src-all@freebsd.org; svn-src-h...@freebsd.org Subject: svn commit: r295045 - in head: .sys/cddl/contrib/opensolaris/uts/common/fs/zfs Author: asomers Date: Fri Jan 29 17:08:26 2016 New Revision: 295045 URL: https://svnweb.freebsd.org/changeset/base/295045 Log: Add a sysctl to allow ZFS pools backed by zvols Change 294329 removed the ability to build ZFS pools that are backed by zvols, because having that ability (even if it's not used) leads to deadlocks. By popular demand, I'm adding an off-by-default sysctl to reenable that ability. Reviewed by: lidl, delphij MFC after:Never Sponsored by: Spectra Logic Corp Differential Revision:https://reviews.freebsd.org/D4998 Modified: head/UPDATING head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Modified: head/UPDATING == --- head/UPDATING Fri Jan 29 17:05:30 2016(r295044) +++ head/UPDATING Fri Jan 29 17:08:26 2016(r295045) @@ -31,6 +31,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20160129: + Building ZFS pools on top of zvols is prohibited by default. That + feature has never worked safely; it's always been prone to deadlocks. + Using a zvol as the backing store for a VM guest's virtual disk will + still work, even if the guest is using ZFS. Legacy behavior can be + restored by setting vfs.zfs.vol.recursive=1. + 20160119: The NONE and HPN patches has been removed from OpenSSH. They are still available in the security/openssh-portable port. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Fri Jan 29 17:05:30 2016(r295044) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Fri Jan 29 17:08:26 2016(r295045) @@ -134,6 +134,9 @@ SYSCTL_NODE(_vfs_zfs, OID_AUTO, vol, CTL static int volmode = ZFS_VOLMODE_GEOM; SYSCTL_INT(_vfs_zfs_vol, OID_AUTO, mode, CTLFLAG_RWTUN, &volmode, 0, "Expose as GEOM providers (1), device files (2) or neither"); +static boolean_t zpool_on_zvol = B_FALSE; +SYSCTL_INT(_vfs_zfs_vol, OID_AUTO, recursive, CTLFLAG_RWTUN, &zpool_on_zvol, 0, +"Allow zpools to use zvols as vdevs (DANGEROUS)"); #endif typedef struct zvol_extent { @@ -1114,7 +1117,9 @@ zvol_open(struct g_provider *pp, int fla return (err); } #else /* !illumos */ - if (tsd_get(zfs_geom_probe_vdev_key) != NULL) { + boolean_t locked = B_FALSE; + + if (!zpool_on_zvol && tsd_get(zfs_geom_probe_vdev_key) != NULL) { /* * if zfs_geom_probe_vdev_key is set, that means that zfs is * attempting to probe geom providers while looking for a @@ -1125,19 +1130,34 @@ zvol_open(struct g_provider *pp, int fla */ return (EOPNOTSUPP); } - - mutex_enter(&zfsdev_state_lock); + /* +* Protect against recursively entering spa_namespace_lock +* when spa_open() is used for a pool on a (local) ZVOL(s). +* This is needed since we replaced upstream zfsdev_state_lock +* with spa_namespace_lock in the ZVOL code. +* We are using the same trick as spa_open(). +* Note that calls in zvol_first_open which need to resolve +* pool name to a spa object will enter spa_open() +* recursively, but that function already has all the +* necessary protection. +*/ + if (!MUTEX_HELD(&zfsdev_state_lock)) { + mutex_enter(&zfsdev_state_lock); + locked = B_TRUE; + } zv = pp->private; if (zv == NULL) { - mutex_exit(&zfsdev_state_lock); + if (locked) + mutex_exit(&zfsdev_state_lock); return (SET_ERROR(ENXIO)); } if (zv->zv_total_opens == 0) { err = zvol_first_open(zv); if (err) { - mutex_exit(&zfsdev_state_lock); + if (locked) + mutex_exit(&zfsdev_state_lock); return (err); } pp->mediasize = zv->zv_volsize; @@ -1171,7 +1191,8 @@ zvol_open(struct g_provider *pp, int fla mutex_exit(&zfsdev_state_lock); #else zv->zv_total_opens += count; - mutex_exit(&zfsdev_state_lock); + if (loc
svn commit: r295048 - stable/10/share/mk
Author: bdrewery Date: Fri Jan 29 17:33:37 2016 New Revision: 295048 URL: https://svnweb.freebsd.org/changeset/base/295048 Log: MFC r295006: Fix -include .depend hack from r294370 for headers not in .PATH. Approved by: re (gjb) Modified: stable/10/share/mk/bsd.dep.mk Directory Properties: stable/10/ (props changed) Modified: stable/10/share/mk/bsd.dep.mk == --- stable/10/share/mk/bsd.dep.mk Fri Jan 29 17:20:59 2016 (r295047) +++ stable/10/share/mk/bsd.dep.mk Fri Jan 29 17:33:37 2016 (r295048) @@ -165,12 +165,13 @@ depend: beforedepend ${DEPENDFILE} after _CFLAGS_INCLUDES= ${CFLAGS:Q:S/\\ /,/g:C/-include,/-include%/g:C/,/ /g:M-include*:C/%/ /g} _CXXFLAGS_INCLUDES= ${CXXFLAGS:Q:S/\\ /,/g:C/-include,/-include%/g:C/,/ /g:M-include*:C/%/ /g} # XXX: Temporary hack to workaround .depend files not tracking -include -.if !empty(_CFLAGS_INCLUDES) -${OBJS} ${POBJS} ${SOBJS}: ${_CFLAGS_INCLUDES:M*.h} -.endif -.if !empty(_CXXFLAGS_INCLUDES) -${OBJS} ${POBJS} ${SOBJS}: ${_CXXFLAGS_INCLUDES:M*.h} +_hdrincludes=${_CFLAGS_INCLUDES:M*.h} ${_CXXFLAGS_INCLUDES:M*.h} +.for _hdr in ${_hdrincludes:O:u} +.if exists(${_hdr}) +${OBJS} ${POBJS} ${SOBJS}: ${_hdr} .endif +.endfor +.undef _hdrincludes # Different types of sources are compiled with slightly different flags. # Split up the sources, and filter out headers and non-applicable flags. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r295049 - in head/sys/arm: arm include
Author: skra Date: Fri Jan 29 17:43:03 2016 New Revision: 295049 URL: https://svnweb.freebsd.org/changeset/base/295049 Log: Retire pmap_pte_init_mmu_v6() which was used by old pmap-v6. Modified: head/sys/arm/arm/cpufunc.c head/sys/arm/arm/pmap-v6.c head/sys/arm/include/pmap-v6.h head/sys/arm/include/pmap.h Modified: head/sys/arm/arm/cpufunc.c == --- head/sys/arm/arm/cpufunc.c Fri Jan 29 17:33:37 2016(r295048) +++ head/sys/arm/arm/cpufunc.c Fri Jan 29 17:43:03 2016(r295049) @@ -889,9 +889,6 @@ set_cpufuncs() cpufuncs = arm1176_cpufuncs; cpu_reset_needs_v4_MMU_disable = 1; /* V4 or higher */ get_cachetype_cp15(); - - pmap_pte_init_mmu_v6(); - goto out; } #endif /* CPU_ARM1176 */ @@ -915,8 +912,6 @@ set_cpufuncs() cpufuncs = cortexa_cpufuncs; cpu_reset_needs_v4_MMU_disable = 1; /* V4 or higher */ get_cachetype_cp15(); - - pmap_pte_init_mmu_v6(); goto out; } #endif /* CPU_CORTEXA */ @@ -927,7 +922,6 @@ set_cpufuncs() cputype == CPU_ID_ARM_88SV581X_V7) { cpufuncs = pj4bv7_cpufuncs; get_cachetype_cp15(); - pmap_pte_init_mmu_v6(); goto out; } #endif /* CPU_MV_PJ4B */ Modified: head/sys/arm/arm/pmap-v6.c == --- head/sys/arm/arm/pmap-v6.c Fri Jan 29 17:33:37 2016(r295048) +++ head/sys/arm/arm/pmap-v6.c Fri Jan 29 17:43:03 2016(r295049) @@ -6278,11 +6278,6 @@ pte1_setrw: } /* REMOVE */ -void -pmap_pte_init_mmu_v6(void) -{ -} - void vector_page_setprot(int p) { } Modified: head/sys/arm/include/pmap-v6.h == --- head/sys/arm/include/pmap-v6.h Fri Jan 29 17:33:37 2016 (r295048) +++ head/sys/arm/include/pmap-v6.h Fri Jan 29 17:43:03 2016 (r295049) @@ -268,7 +268,6 @@ void pmap_devmap_bootstrap(const struct /* * sys/arm/arm/cpufunc.c */ -void pmap_pte_init_mmu_v6(void); void vector_page_setprot(int); /* Modified: head/sys/arm/include/pmap.h == --- head/sys/arm/include/pmap.h Fri Jan 29 17:33:37 2016(r295048) +++ head/sys/arm/include/pmap.h Fri Jan 29 17:43:03 2016(r295049) @@ -624,9 +624,6 @@ voidpmap_copy_page_generic(vm_paddr_t, void pmap_zero_page_generic(vm_paddr_t, int, int); void pmap_pte_init_generic(void); -#if (ARM_MMU_V6 + ARM_MMU_V7) != 0 -void pmap_pte_init_mmu_v6(void); -#endif /* (ARM_MMU_V6 + ARM_MMU_V7) != 0 */ #endif /* (ARM_MMU_GENERIC + ARM_MMU_V6 + ARM_MMU_V7) != 0 */ #if ARM_MMU_XSCALE == 1 ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r295050 - head/sys/arm64/arm64
Author: zbb Date: Fri Jan 29 18:43:51 2016 New Revision: 295050 URL: https://svnweb.freebsd.org/changeset/base/295050 Log: Fix sending IPI to all CPUs on ARM64 There is no explanation why IPI ID is incremented here by "16". This should have been removed in r285533 but somehow survived. Reviewed by: wma Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D5120 Modified: head/sys/arm64/arm64/intr_machdep.c Modified: head/sys/arm64/arm64/intr_machdep.c == --- head/sys/arm64/arm64/intr_machdep.c Fri Jan 29 17:43:03 2016 (r295049) +++ head/sys/arm64/arm64/intr_machdep.c Fri Jan 29 18:43:51 2016 (r295050) @@ -472,9 +472,6 @@ ipi_all_but_self(u_int ipi) other_cpus = all_cpus; CPU_CLR(PCPU_GET(cpuid), &other_cpus); - /* ARM64TODO: This will be fixed with arm_intrng */ - ipi += 16; - CTR2(KTR_SMP, "%s: ipi: %x", __func__, ipi); PIC_IPI_SEND(root_pic, other_cpus, ipi); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r295051 - head/sys/dev/ixl
Author: smh Date: Fri Jan 29 21:06:59 2016 New Revision: 295051 URL: https://svnweb.freebsd.org/changeset/base/295051 Log: Fix phy interrupts setup for ixl Fix the inverted set of interrupts being used as the mask for ixl. Without this ixl devices fail to detect link state changes. Reviewed by: erj, sbruno MFC after:2 days Sponsored by: Multiplay Modified: head/sys/dev/ixl/if_ixl.c Modified: head/sys/dev/ixl/if_ixl.c == --- head/sys/dev/ixl/if_ixl.c Fri Jan 29 18:43:51 2016(r295050) +++ head/sys/dev/ixl/if_ixl.c Fri Jan 29 21:06:59 2016(r295051) @@ -674,9 +674,9 @@ ixl_attach(device_t dev) } /* Limit phy interrupts to link and modules failure */ - error = i40e_aq_set_phy_int_mask(hw, - I40E_AQ_EVENT_LINK_UPDOWN | I40E_AQ_EVENT_MODULE_QUAL_FAIL, NULL); -if (error) + error = i40e_aq_set_phy_int_mask(hw, ~(I40E_AQ_EVENT_LINK_UPDOWN | + I40E_AQ_EVENT_MODULE_QUAL_FAIL), NULL); + if (error) device_printf(dev, "set phy mask failed: %d\n", error); /* Get the bus configuration and set the shared code */ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r294981 - in stable/10/sys/boot: common efi efi/boot1 efi/include efi/libefi efi/loader efi/loader/arch/amd64 fdt i386/libi386
On 30.01.2016 2:36, Andrey Chernov wrote: > I am not sure this is exact commit which cause this, but any operation > in /sys/boot/efi ends like this (by hand, not from buildworld): > (i386-stable machine, clang compiler) > > ===> efi (obj) > make[1]: "/usr/src/sys/boot/efi/Makefile" line 4: Malformed conditional > (${COMPILER_TYPE} != "gcc") > make[1]: Fatal errors encountered -- cannot continue > make[1]: stopped in /usr/src/sys/boot/efi > *** Error code 1 > > Stop. > make: stopped in /usr/src/sys/boot > As Makefile shows, there is no include to pick COMPILER_TYPE and it is undefined. You need at least to move bsd.subdir.mk up. # $FreeBSD: stable/10/sys/boot/efi/Makefile 294981 2016-01-28 12:11:42Z smh $ # In-tree GCC does not support __attribute__((ms_abi)). .if ${COMPILER_TYPE} != "gcc" .if ${MACHINE_CPUARCH} == "amd64" SUBDIR+=libefi loader boot1 .endif .endif # ${COMPILER_TYPE} != "gcc" .include -- http://ache.vniz.net/ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r294981 - in stable/10/sys/boot: common efi efi/boot1 efi/include efi/libefi efi/loader efi/loader/arch/amd64 fdt i386/libi386
I am not sure this is exact commit which cause this, but any operation in /sys/boot/efi ends like this (by hand, not from buildworld): (i386-stable machine, clang compiler) ===> efi (obj) make[1]: "/usr/src/sys/boot/efi/Makefile" line 4: Malformed conditional (${COMPILER_TYPE} != "gcc") make[1]: Fatal errors encountered -- cannot continue make[1]: stopped in /usr/src/sys/boot/efi *** Error code 1 Stop. make: stopped in /usr/src/sys/boot -- http://ache.vniz.net/ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r295055 - stable/10/lib/libc/gen
Author: sobomax Date: Sat Jan 30 00:09:30 2016 New Revision: 295055 URL: https://svnweb.freebsd.org/changeset/base/295055 Log: MFC r294691: Fix readpassphrase(3) when it's called with stdin being closed. Approved by: re (delphij) Modified: stable/10/lib/libc/gen/readpassphrase.c Modified: stable/10/lib/libc/gen/readpassphrase.c == --- stable/10/lib/libc/gen/readpassphrase.c Fri Jan 29 21:42:27 2016 (r295054) +++ stable/10/lib/libc/gen/readpassphrase.c Sat Jan 30 00:09:30 2016 (r295055) @@ -46,7 +46,7 @@ char * readpassphrase(const char *prompt, char *buf, size_t bufsiz, int flags) { ssize_t nr; - int input, output, save_errno, i, need_restart; + int input, output, save_errno, i, need_restart, input_is_tty; char ch, *p, *end; struct termios term, oterm; struct sigaction sa, savealrm, saveint, savehup, savequit, saveterm; @@ -68,12 +68,20 @@ restart: * Read and write to /dev/tty if available. If not, read from * stdin and write to stderr unless a tty is required. */ - if ((flags & RPP_STDIN) || - (input = output = _open(_PATH_TTY, O_RDWR | O_CLOEXEC)) == -1) { - if (flags & RPP_REQUIRE_TTY) { - errno = ENOTTY; - return(NULL); + input_is_tty = 0; + if (!(flags & RPP_STDIN)) { + input = output = _open(_PATH_TTY, O_RDWR | O_CLOEXEC); + if (input == -1) { + if (flags & RPP_REQUIRE_TTY) { + errno = ENOTTY; + return(NULL); + } + input = STDIN_FILENO; + output = STDERR_FILENO; + } else { + input_is_tty = 1; } + } else { input = STDIN_FILENO; output = STDERR_FILENO; } @@ -83,7 +91,7 @@ restart: * If we are using a tty but are not the foreground pgrp this will * generate SIGTTOU, so do it *before* installing the signal handlers. */ - if (input != STDIN_FILENO && tcgetattr(input, &oterm) == 0) { + if (input_is_tty && tcgetattr(input, &oterm) == 0) { memcpy(&term, &oterm, sizeof(term)); if (!(flags & RPP_ECHO_ON)) term.c_lflag &= ~(ECHO | ECHONL); @@ -152,7 +160,7 @@ restart: (void)__libc_sigaction(SIGTSTP, &savetstp, NULL); (void)__libc_sigaction(SIGTTIN, &savettin, NULL); (void)__libc_sigaction(SIGTTOU, &savettou, NULL); - if (input != STDIN_FILENO) + if (input_is_tty) (void)_close(input); /* ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r295056 - in head: lib/libsysdecode usr.bin/kdump usr.bin/truss
Author: jhb Date: Sat Jan 30 01:00:54 2016 New Revision: 295056 URL: https://svnweb.freebsd.org/changeset/base/295056 Log: Add a SYSDECODE_ABI_ prefix to the ABI enums to avoid potential collisions. Suggested by: jmallett Reviewed by: bdrewery, jmallett Differential Revision:https://reviews.freebsd.org/D5123 Modified: head/lib/libsysdecode/syscallnames.c head/lib/libsysdecode/sysdecode.3 head/lib/libsysdecode/sysdecode.h head/usr.bin/kdump/kdump.c head/usr.bin/truss/aarch64-cloudabi64.c head/usr.bin/truss/aarch64-freebsd.c head/usr.bin/truss/amd64-cloudabi64.c head/usr.bin/truss/amd64-freebsd.c head/usr.bin/truss/amd64-freebsd32.c head/usr.bin/truss/amd64-linux32.c head/usr.bin/truss/arm-freebsd.c head/usr.bin/truss/i386-freebsd.c head/usr.bin/truss/i386-linux.c head/usr.bin/truss/mips-freebsd.c head/usr.bin/truss/powerpc-freebsd.c head/usr.bin/truss/powerpc64-freebsd.c head/usr.bin/truss/powerpc64-freebsd32.c head/usr.bin/truss/sparc64-freebsd.c Modified: head/lib/libsysdecode/syscallnames.c == --- head/lib/libsysdecode/syscallnames.cSat Jan 30 00:09:30 2016 (r295055) +++ head/lib/libsysdecode/syscallnames.cSat Jan 30 01:00:54 2016 (r295056) @@ -70,30 +70,30 @@ sysdecode_syscallname(enum sysdecode_abi { switch (abi) { - case FREEBSD: + case SYSDECODE_ABI_FREEBSD: if (code < nitems(syscallnames)) return (syscallnames[code]); break; #if defined(__amd64__) || defined(__powerpc64__) - case FREEBSD32: + case SYSDECODE_ABI_FREEBSD32: if (code < nitems(freebsd32_syscallnames)) return (freebsd32_syscallnames[code]); break; #endif #if defined(__amd64__) || defined(__i386__) - case LINUX: + case SYSDECODE_ABI_LINUX: if (code < nitems(linux_syscallnames)) return (linux_syscallnames[code]); break; #endif #ifdef __amd64__ - case LINUX32: + case SYSDECODE_ABI_LINUX32: if (code < nitems(linux32_syscallnames)) return (linux32_syscallnames[code]); break; #endif #if defined(__amd64__) || defined(__aarch64__) - case CLOUDABI64: + case SYSDECODE_ABI_CLOUDABI64: if (code < nitems(cloudabi64_syscallnames)) return (cloudabi64_syscallnames[code]); break; Modified: head/lib/libsysdecode/sysdecode.3 == --- head/lib/libsysdecode/sysdecode.3 Sat Jan 30 00:09:30 2016 (r295055) +++ head/lib/libsysdecode/sysdecode.3 Sat Jan 30 01:00:54 2016 (r295056) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 24, 2016 +.Dd January 29, 2016 .Dt SYSDECODE 3 .Os .Sh NAME @@ -44,23 +44,23 @@ The supported ABIs are named by the .Vt enum sysdecode_abi enumeration. .Pp -.Bl -tag -width "Li UNKNOWN_ABI" -compact -.It Li FREEBSD +.Bl -tag -width "Li SYSDECODE_ABI_CLOUDABI64" -compact +.It Li SYSDECODE_ABI_FREEBSD Native FreeBSD binaries. Supported on all platforms. -.It Li FREEBSD32 +.It Li SYSDECODE_ABI_FREEBSD32 32-bit FreeBSD binaries. Supported on amd64 and powerpc64. -.It Li LINUX +.It Li SYSDECODE_ABI_LINUX Linux binaries of the same platform. Supported on amd64 and i386. -.It Li LINUX32 +.It Li SYSDECODE_ABI_LINUX32 32-bit Linux binaries. Supported on amd64. -.It Li CLOUDABI64 +.It Li SYSDECODE_ABI_CLOUDABI64 64-bit CloudABI binaries. Supported on aarch64 and amd64. -.It Li UNKNOWN_ABI +.It Li SYSDECODE_ABI_UNKNOWN A placeholder for use when the ABI is not known. .El .Sh SEE ALSO Modified: head/lib/libsysdecode/sysdecode.h == --- head/lib/libsysdecode/sysdecode.h Sat Jan 30 00:09:30 2016 (r295055) +++ head/lib/libsysdecode/sysdecode.h Sat Jan 30 01:00:54 2016 (r295056) @@ -30,12 +30,12 @@ #define__SYSDECODE_H__ enum sysdecode_abi { - UNKNOWN_ABI = 0, - FREEBSD, - FREEBSD32, - LINUX, - LINUX32, - CLOUDABI64 + SYSDECODE_ABI_UNKNOWN = 0, + SYSDECODE_ABI_FREEBSD, + SYSDECODE_ABI_FREEBSD32, + SYSDECODE_ABI_LINUX, + SYSDECODE_ABI_LINUX32, + SYSDECODE_ABI_CLOUDABI64 }; const char *sysdecode_ioctlname(unsigned long _val); Modified: head/usr.bin/kdump/kdump.c == --- head/usr.bin/kdump/kdump.c Sat Jan 30 00:09:30 2016(r295055) +++ head/usr.bin/kdump/kdump.c Sat Jan 30 01:00:54 2016(r295056) @@ -690,20 +690,20 @@ syscallabi(u_int sv_flags) { if (sv_flags == 0) - return (FREEBSD); + return (SYSDECODE_ABI_FREEBSD
Re: svn commit: r295051 - head/sys/dev/ixl
This should have referenced https://reviews.freebsd.org/D5106 On 29/01/2016 21:06, Steven Hartland wrote: Author: smh Date: Fri Jan 29 21:06:59 2016 New Revision: 295051 URL: https://svnweb.freebsd.org/changeset/base/295051 Log: Fix phy interrupts setup for ixl Fix the inverted set of interrupts being used as the mask for ixl. Without this ixl devices fail to detect link state changes. Reviewed by: erj, sbruno MFC after: 2 days Sponsored by:Multiplay Modified: head/sys/dev/ixl/if_ixl.c Modified: head/sys/dev/ixl/if_ixl.c == --- head/sys/dev/ixl/if_ixl.c Fri Jan 29 18:43:51 2016(r295050) +++ head/sys/dev/ixl/if_ixl.c Fri Jan 29 21:06:59 2016(r295051) @@ -674,9 +674,9 @@ ixl_attach(device_t dev) } /* Limit phy interrupts to link and modules failure */ - error = i40e_aq_set_phy_int_mask(hw, - I40E_AQ_EVENT_LINK_UPDOWN | I40E_AQ_EVENT_MODULE_QUAL_FAIL, NULL); -if (error) + error = i40e_aq_set_phy_int_mask(hw, ~(I40E_AQ_EVENT_LINK_UPDOWN | + I40E_AQ_EVENT_MODULE_QUAL_FAIL), NULL); + if (error) device_printf(dev, "set phy mask failed: %d\n", error); /* Get the bus configuration and set the shared code */ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r294981 - in stable/10/sys/boot: common efi efi/boot1 efi/include efi/libefi efi/loader efi/loader/arch/amd64 fdt i386/libi386
Yep I have a request in with re@ for the direct commit required to fix this. On 29/01/2016 23:36, Andrey Chernov wrote: I am not sure this is exact commit which cause this, but any operation in /sys/boot/efi ends like this (by hand, not from buildworld): (i386-stable machine, clang compiler) ===> efi (obj) make[1]: "/usr/src/sys/boot/efi/Makefile" line 4: Malformed conditional (${COMPILER_TYPE} != "gcc") make[1]: Fatal errors encountered -- cannot continue make[1]: stopped in /usr/src/sys/boot/efi *** Error code 1 Stop. make: stopped in /usr/src/sys/boot ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r295057 - stable/10/sys/boot/efi
Author: smh Date: Sat Jan 30 01:27:29 2016 New Revision: 295057 URL: https://svnweb.freebsd.org/changeset/base/295057 Log: Fix clean target for sys/boot/efi Fix clean target breakage of sys/boot/efi introduced by r294981 specifically the MFC of r294029 without the related change introduced by r281114. This is direct commit to stable/10 as head uses src.opts.mk. Approved by: re (glebius) Sponsored by: Multiplay Modified: stable/10/sys/boot/efi/Makefile Modified: stable/10/sys/boot/efi/Makefile == --- stable/10/sys/boot/efi/Makefile Sat Jan 30 01:00:54 2016 (r295056) +++ stable/10/sys/boot/efi/Makefile Sat Jan 30 01:27:29 2016 (r295057) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + # In-tree GCC does not support __attribute__((ms_abi)). .if ${COMPILER_TYPE} != "gcc" ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r294981 - in stable/10/sys/boot: common efi efi/boot1 efi/include efi/libefi efi/loader efi/loader/arch/amd64 fdt i386/libi386
Just spotted the reply from re@ which came in a hour or so ago (thanks glebius) so this is fixed as of r295057 On 29/01/2016 23:47, Andrey Chernov wrote: On 30.01.2016 2:36, Andrey Chernov wrote: I am not sure this is exact commit which cause this, but any operation in /sys/boot/efi ends like this (by hand, not from buildworld): (i386-stable machine, clang compiler) ===> efi (obj) make[1]: "/usr/src/sys/boot/efi/Makefile" line 4: Malformed conditional (${COMPILER_TYPE} != "gcc") make[1]: Fatal errors encountered -- cannot continue make[1]: stopped in /usr/src/sys/boot/efi *** Error code 1 Stop. make: stopped in /usr/src/sys/boot As Makefile shows, there is no include to pick COMPILER_TYPE and it is undefined. You need at least to move bsd.subdir.mk up. # $FreeBSD: stable/10/sys/boot/efi/Makefile 294981 2016-01-28 12:11:42Z smh $ # In-tree GCC does not support __attribute__((ms_abi)). .if ${COMPILER_TYPE} != "gcc" .if ${MACHINE_CPUARCH} == "amd64" SUBDIR+=libefi loader boot1 .endif .endif # ${COMPILER_TYPE} != "gcc" .include ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r294315 - in vendor-crypto/openssh/dist: . contrib/redhat contrib/suse
On Tue, Jan 19, 2016 at 2:10 AM, Dag-Erling Smørgrav wrote: > Author: des > Date: Tue Jan 19 10:10:58 2016 > New Revision: 294315 > URL: https://svnweb.freebsd.org/changeset/base/294315 > > Log: > Vendor import of OpenSSH 7.1p2. > Hi, I'm not sure if this is the exact commit, but sometime around this commit, I have started seeing some failures in some scripts that I have running. These scripts build and boot a VM, and try to SSH into the VM to run some tests. It turns out that sshd is not starting properly, so the tests fail to SSH into the VM: https://jenkins.freebsd.org/job/FreeBSD_HEAD/54/execution/node/43/log/ From last night's build, I was able to boot the VM, and log into the VM console. If I tried to manually start sshd, I got this: # service sshd restart Performing sanity check on sshd configuration. Fssh_key_load_public: invalid format Could not load host key: /etc/ssh/ssh_host_rsa_key Could not load host key: /etc/ssh/ssh_host_dsa_key Fssh_key_load_public: invalid format Could not load host key: /etc/ssh/ssh_host_ecdsa_key Fssh_key_load_public: invalid format Could not load host key: /etc/ssh/ssh_host_ed25519_key Disabling protocol version 2. Could not load host key sshd: no hostkeys available -- exiting. Some observations: - these do not exist: /etc/ssh/ssh_host_dsa_key /etc/ssh/ssh_host_ecdsa_key - these files exist: -rw--- 1 root wheel 227 Jan 25 21:34 /etc/ssh/ssh_host_ecdsa_key -rw--- 1 root wheel 387 Jan 25 21:34 /etc/ssh/ssh_host_ed25519_key -rw--- 1 root wheel 1679 Jan 25 21:34 /etc/ssh/ssh_host_rsa_key but they seem to be all zeroes The VM that I configured is nothing fancy. It just has this in /etc/rc.conf: sshd_enable="YES" ifconfig_vtnet0="inet 192.168.10.2/24" Any ideas as to what the problem might be? -- Craig ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r295059 - in head: lib/libc/tests/gen libexec/rtld-elf
Author: sobomax Date: Sat Jan 30 04:16:05 2016 New Revision: 295059 URL: https://svnweb.freebsd.org/changeset/base/295059 Log: This seems like a very trivial bug that should have been squashed a long time ago, but for some reason it was not. Basically, without this change dlopen(3)'ing an empty .so file would just cause application to dump core with SIGSEGV. Make sure the file has enough data for at least the ELF header before mmap'ing it. Add a test case to check that dlopen an empty file return an error. There were a separate discussion as to whether it should be SIGBUS instead when you try to access region mapped from an empty file, but it's definitely SIGSEGV now, so if anyone want to check that please be my guest. Reviewed by: mjg, cem MFC after:1 week Differential Revision:https://reviews.freebsd.org/D5112 Added: head/lib/libc/tests/gen/dlopen_empty_test.c (contents, props changed) Modified: head/lib/libc/tests/gen/Makefile head/libexec/rtld-elf/map_object.c Modified: head/lib/libc/tests/gen/Makefile == --- head/lib/libc/tests/gen/MakefileSat Jan 30 01:52:18 2016 (r295058) +++ head/lib/libc/tests/gen/MakefileSat Jan 30 04:16:05 2016 (r295059) @@ -11,6 +11,7 @@ ATF_TESTS_C+= ftw_test ATF_TESTS_C+= popen_test ATF_TESTS_C+= posix_spawn_test ATF_TESTS_C+= wordexp_test +ATF_TESTS_C+= dlopen_empty_test # TODO: t_closefrom, t_cpuset, t_fmtcheck, t_randomid, t_sleep # TODO: t_siginfo (fixes require further inspection) Added: head/lib/libc/tests/gen/dlopen_empty_test.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/gen/dlopen_empty_test.c Sat Jan 30 04:16:05 2016 (r295059) @@ -0,0 +1,97 @@ +/*- + * Copyright (c) 2016 Maksym Sobolyev + * 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +static const char *funname; +static char *soname; + +static void +sigsegv_handler(int sig __unused) +{ +unlink(soname); +free(soname); +atf_tc_fail("got SIGSEGV in the %s(3)", funname); +} + +ATF_TC(dlopen_empty_test); +ATF_TC_HEAD(dlopen_empty_test, tc) +{ +atf_tc_set_md_var(tc, "descr", "Tests the dlopen() of an empty file " + "returns an error"); +} +ATF_TC_BODY(dlopen_empty_test, tc) +{ +char tempname[] = "/tmp/temp.XX"; +char *fname; +int fd; +void *dlh; +struct sigaction act, oact; + +fname = mktemp(tempname); +ATF_REQUIRE_MSG(fname != NULL, "mktemp failed; errno=%d", errno); +asprintf(&soname, "%s.so", fname); +ATF_REQUIRE_MSG(soname != NULL, "asprintf failed; errno=%d", ENOMEM); +fd = open(soname, O_WRONLY | O_CREAT | O_TRUNC, DEFFILEMODE); +ATF_REQUIRE_MSG(fd != -1, "open(\"%s\") failed; errno=%d", soname, errno); +close(fd); + +act.sa_handler = sigsegv_handler; +act.sa_flags = 0; +sigemptyset(&act.sa_mask); +ATF_CHECK_MSG(sigaction(SIGSEGV, &act, &oact) != -1, +"sigaction() failed"); + +funname = "dlopen"; +dlh = dlopen(soname, RTLD_LAZY); +if (dlh != NULL) { +funname = "dlclose"; +dlclose(dlh); +} +ATF_REQUIRE_MSG(dlh == NULL, "dlopen(\"%s\") did not fail", soname); +unlink(soname); +free(soname);
svn commit: r295060 - stable/9/crypto/openssl/ssl
Author: delphij Date: Sat Jan 30 06:09:38 2016 New Revision: 295060 URL: https://svnweb.freebsd.org/changeset/base/295060 Log: Fix OpenSSL SSLv2 ciphersuite downgrade vulnerability. Security: CVE-2015-3197 Security: FreeBSD-SA-16:11.openssl Modified: stable/9/crypto/openssl/ssl/s2_srvr.c Modified: stable/9/crypto/openssl/ssl/s2_srvr.c == --- stable/9/crypto/openssl/ssl/s2_srvr.c Sat Jan 30 04:16:05 2016 (r295059) +++ stable/9/crypto/openssl/ssl/s2_srvr.c Sat Jan 30 06:09:38 2016 (r295060) @@ -396,7 +396,7 @@ static int get_client_master_key(SSL *s) } cp = ssl2_get_cipher_by_char(p); -if (cp == NULL) { +if (cp == NULL || sk_SSL_CIPHER_find(s->session->ciphers, cp) < 0) { ssl2_return_error(s, SSL2_PE_NO_CIPHER); SSLerr(SSL_F_GET_CLIENT_MASTER_KEY, SSL_R_NO_CIPHER_MATCH); return (-1); @@ -687,8 +687,12 @@ static int get_client_hello(SSL *s) prio = cs; allow = cl; } + +/* Generate list of SSLv2 ciphers shared between client and server */ for (z = 0; z < sk_SSL_CIPHER_num(prio); z++) { -if (sk_SSL_CIPHER_find(allow, sk_SSL_CIPHER_value(prio, z)) < 0) { +const SSL_CIPHER *cp = sk_SSL_CIPHER_value(prio, z); +if ((cp->algorithms & SSL_SSLV2) == 0 || +sk_SSL_CIPHER_find(allow, cp) < 0) { (void)sk_SSL_CIPHER_delete(prio, z); z--; } @@ -697,6 +701,13 @@ static int get_client_hello(SSL *s) sk_SSL_CIPHER_free(s->session->ciphers); s->session->ciphers = prio; } + +/* Make sure we have at least one cipher in common */ +if (sk_SSL_CIPHER_num(s->session->ciphers) == 0) { +ssl2_return_error(s, SSL2_PE_NO_CIPHER); +SSLerr(SSL_F_GET_CLIENT_HELLO, SSL_R_NO_CIPHER_MATCH); +return -1; +} /* * s->session->ciphers should now have a list of ciphers that are on * both the client and server. This list is ordered by the order the ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r295061 - in releng: 10.1 10.1/crypto/openssl/ssl 10.1/sys/conf 10.2 10.2/crypto/openssl/ssl 10.2/sys/conf 9.3 9.3/crypto/openssl/ssl 9.3/sys/conf
Author: delphij Date: Sat Jan 30 06:12:03 2016 New Revision: 295061 URL: https://svnweb.freebsd.org/changeset/base/295061 Log: Fix OpenSSL SSLv2 ciphersuite downgrade vulnerability. Security: CVE-2015-3197 Security: FreeBSD-SA-16:11.openssl Approved by: so Modified: releng/10.1/UPDATING releng/10.1/crypto/openssl/ssl/s2_srvr.c releng/10.1/sys/conf/newvers.sh releng/10.2/UPDATING releng/10.2/crypto/openssl/ssl/s2_srvr.c releng/10.2/sys/conf/newvers.sh releng/9.3/UPDATING releng/9.3/crypto/openssl/ssl/s2_srvr.c releng/9.3/sys/conf/newvers.sh Modified: releng/10.1/UPDATING == --- releng/10.1/UPDATINGSat Jan 30 06:09:38 2016(r295060) +++ releng/10.1/UPDATINGSat Jan 30 06:12:03 2016(r295061) @@ -16,6 +16,10 @@ from older versions of FreeBSD, try WITH stable/10, and then rebuild without this option. The bootstrap process from older version of current is a bit fragile. +20160130 p29 FreeBSD-SA-16:11.openssl + + Fix OpenSSL SSLv2 ciphersuite downgrade vulnerability. [SA-16:11] + 20160127 p28 FreeBSD-SA-16:09.ntp FreeBSD-SA-16:10.linux Modified: releng/10.1/crypto/openssl/ssl/s2_srvr.c == --- releng/10.1/crypto/openssl/ssl/s2_srvr.cSat Jan 30 06:09:38 2016 (r295060) +++ releng/10.1/crypto/openssl/ssl/s2_srvr.cSat Jan 30 06:12:03 2016 (r295061) @@ -400,7 +400,7 @@ static int get_client_master_key(SSL *s) } cp=ssl2_get_cipher_by_char(p); - if (cp == NULL) + if (cp == NULL || sk_SSL_CIPHER_find(s->session->ciphers, cp) < 0) { ssl2_return_error(s,SSL2_PE_NO_CIPHER); SSLerr(SSL_F_GET_CLIENT_MASTER_KEY, SSL_R_NO_CIPHER_MATCH); @@ -698,9 +698,12 @@ static int get_client_hello(SSL *s) prio = cs; allow = cl; } - for (z=0; zalgorithm_ssl & SSL_SSLV2) == 0 || + sk_SSL_CIPHER_find(allow, cp) < 0) { (void)sk_SSL_CIPHER_delete(prio,z); z--; @@ -711,6 +714,14 @@ static int get_client_hello(SSL *s) sk_SSL_CIPHER_free(s->session->ciphers); s->session->ciphers = prio; } + + /* Make sure we have at least one cipher in common */ + if (sk_SSL_CIPHER_num(s->session->ciphers) == 0) + { + ssl2_return_error(s, SSL2_PE_NO_CIPHER); + SSLerr(SSL_F_GET_CLIENT_HELLO, SSL_R_NO_CIPHER_MATCH); + return -1; + } /* s->session->ciphers should now have a list of * ciphers that are on both the client and server. * This list is ordered by the order the client sent Modified: releng/10.1/sys/conf/newvers.sh == --- releng/10.1/sys/conf/newvers.sh Sat Jan 30 06:09:38 2016 (r295060) +++ releng/10.1/sys/conf/newvers.sh Sat Jan 30 06:12:03 2016 (r295061) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="10.1" -BRANCH="RELEASE-p28" +BRANCH="RELEASE-p29" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/10.2/UPDATING == --- releng/10.2/UPDATINGSat Jan 30 06:09:38 2016(r295060) +++ releng/10.2/UPDATINGSat Jan 30 06:12:03 2016(r295061) @@ -16,6 +16,10 @@ from older versions of FreeBSD, try WITH stable/10, and then rebuild without this option. The bootstrap process from older version of current is a bit fragile. +20160130 p12 FreeBSD-SA-16:11.openssl + + Fix OpenSSL SSLv2 ciphersuite downgrade vulnerability. [SA-16:11] + 20160127 p11 FreeBSD-SA-16:09.ntp FreeBSD-SA-16:10.linux Modified: releng/10.2/crypto/openssl/ssl/s2_srvr.c == --- releng/10.2/crypto/openssl/ssl/s2_srvr.cSat Jan 30 06:09:38 2016 (r295060) +++ releng/10.2/crypto/openssl/ssl/s2_srvr.cSat Jan 30 06:12:03 2016 (r295061) @@ -402,7 +402,7 @@ static int get_client_master_key(SSL *s) } cp = ssl2_get_cipher_by_char(p); -if (cp == NULL) { +if (cp == NULL || sk_SSL_CIPHER_find(s->session->ciphers, cp) < 0) { ssl2_return_error(s, SSL2_PE_NO_CIPHER); SSLerr(SSL_F_GET_CLIENT_MASTER_KEY, SSL_R_NO_CIPHER_MATCH); return (-1); @@ -687,8 +687,12 @@ static int
svn commit: r295062 - head/sbin/nvmecontrol
Author: imp Date: Sat Jan 30 06:18:37 2016 New Revision: 295062 URL: https://svnweb.freebsd.org/changeset/base/295062 Log: Implement power command to list all power modes, find out the power mode we're in and to set the power mode. Added: head/sbin/nvmecontrol/power.c (contents, props changed) Modified: head/sbin/nvmecontrol/Makefile head/sbin/nvmecontrol/nvmecontrol.8 head/sbin/nvmecontrol/nvmecontrol.c head/sbin/nvmecontrol/nvmecontrol.h Modified: head/sbin/nvmecontrol/Makefile == --- head/sbin/nvmecontrol/Makefile Sat Jan 30 06:12:03 2016 (r295061) +++ head/sbin/nvmecontrol/Makefile Sat Jan 30 06:18:37 2016 (r295062) @@ -2,7 +2,7 @@ PROG= nvmecontrol SRCS= nvmecontrol.c devlist.c firmware.c identify.c logpage.c \ - perftest.c reset.c nvme_util.c + perftest.c reset.c nvme_util.c power.c MAN= nvmecontrol.8 .PATH: ${.CURDIR}/../../sys/dev/nvme Modified: head/sbin/nvmecontrol/nvmecontrol.8 == --- head/sbin/nvmecontrol/nvmecontrol.8 Sat Jan 30 06:12:03 2016 (r295061) +++ head/sbin/nvmecontrol/nvmecontrol.8 Sat Jan 30 06:18:37 2016 (r295062) @@ -70,6 +70,11 @@ .Op Fl f Ar path_to_firmware .Op Fl a .Aq device id +.Nm +.Ic power +.Op Fl l +.Op Fl p power_state +.Op fl w workload_hint .Sh DESCRIPTION NVM Express (NVMe) is a storage protocol standard, for SSDs and other high-speed storage devices over PCI Express. @@ -120,6 +125,18 @@ Activate the firmware in slot 4 of the n .Pp Download the firmware image contained in "/tmp/nvme_firmware" to slot 7 of the nvme0 controller and activate it on the next reset. +.Pp +.Dl nvmecontrol power -l nvme0 +.Pp +List all the current power modes. +.Pp +.Dl nvmecontrol power -p 3 nvme0 +.Pp +Set the current power mode. +.Pp +.Dl nvmecontrol power nvme0 +.Pp +Get the current power mode. .Sh AUTHORS .An -nosplit .Nm Modified: head/sbin/nvmecontrol/nvmecontrol.c == --- head/sbin/nvmecontrol/nvmecontrol.c Sat Jan 30 06:12:03 2016 (r295061) +++ head/sbin/nvmecontrol/nvmecontrol.c Sat Jan 30 06:18:37 2016 (r295062) @@ -58,6 +58,7 @@ static struct nvme_function { {"reset", reset, RESET_USAGE}, {"logpage", logpage,LOGPAGE_USAGE}, {"firmware",firmware, FIRMWARE_USAGE}, + {"power", power, POWER_USAGE}, {NULL, NULL, NULL}, }; Modified: head/sbin/nvmecontrol/nvmecontrol.h == --- head/sbin/nvmecontrol/nvmecontrol.h Sat Jan 30 06:12:03 2016 (r295061) +++ head/sbin/nvmecontrol/nvmecontrol.h Sat Jan 30 06:18:37 2016 (r295062) @@ -55,12 +55,16 @@ #define FIRMWARE_USAGE\ " nvmecontrol firmware [-s slot] [-f path_to_firmware] [-a] \n" +#define POWER_USAGE \ +" nvmecontrol power [-l] [-p new-state [-w workload-hint]] \n" + void devlist(int argc, char *argv[]); void identify(int argc, char *argv[]); void perftest(int argc, char *argv[]); void reset(int argc, char *argv[]); void logpage(int argc, char *argv[]); void firmware(int argc, char *argv[]); +void power(int argc, char *argv[]); int open_dev(const char *str, int *fd, int show_error, int exit_on_error); void parse_ns_str(const char *ns_str, char *ctrlr_str, int *nsid); Added: head/sbin/nvmecontrol/power.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/nvmecontrol/power.c Sat Jan 30 06:18:37 2016 (r295062) @@ -0,0 +1,185 @@ +/*- + * Copyright (c) 2016 Netflix, Inc + * 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 SUBS
svn commit: r295063 - head/tools/tools/nanobsd/embedded
Author: imp Date: Sat Jan 30 07:00:28 2016 New Revision: 295063 URL: https://svnweb.freebsd.org/changeset/base/295063 Log: Two new config files. One that has UEFI booting, and the other that can do both UEFI and BIOS/GPT booting. Support for nanobsd coming soon. Based in part in a patch from: andrew@ Added: head/tools/tools/nanobsd/embedded/qemu-amd64-uefi-bios.cfg (contents, props changed) head/tools/tools/nanobsd/embedded/qemu-amd64-uefi.cfg (contents, props changed) Added: head/tools/tools/nanobsd/embedded/qemu-amd64-uefi-bios.cfg == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/nanobsd/embedded/qemu-amd64-uefi-bios.cfg Sat Jan 30 07:00:28 2016(r295063) @@ -0,0 +1,43 @@ +# $FreeBSD$ + +#- +# Copyright (c) 2015 Warner Losh. All Rights Reserved. +# Copyright (c) 2010-2011 iXsystems, Inc., 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 iXsystems, Inc. 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. +# + +NANO_ARCH=amd64 +NANO_NAME=qemu-amd64-uefi-bios +NANO_LAYOUT=std-uefi-bios + +. common # Pull in common definitions + +qemu_env + +# +# Run with +# qemu-system-x86_64 -serial stdio -bios OVMF.fd \ +# -hda _.disk.image.qemu-amd64-uefi.qcow2 +# OVMF.fd is from +# http://sourceforge.net/projects/edk2/files/OVMF/OVMF-X64-r15214.zip +# Added: head/tools/tools/nanobsd/embedded/qemu-amd64-uefi.cfg == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/nanobsd/embedded/qemu-amd64-uefi.cfg Sat Jan 30 07:00:28 2016(r295063) @@ -0,0 +1,43 @@ +# $FreeBSD$ + +#- +# Copyright (c) 2015 Warner Losh. All Rights Reserved. +# Copyright (c) 2010-2011 iXsystems, Inc., 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 iXsystems, Inc. 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. +# + +NANO_ARCH=amd64 +NANO_NAME=qemu-amd64-uefi +NANO_LAYOUT=std-uefi + +. common # Pull in common definitions + +qemu_env + +# +# Run with +# qemu-system-x86_64 -serial stdio -bios OVMF.fd \ +# -hda _.disk.image.qemu-amd64-uefi.qcow2 +# OVMF.fd is from +# http://sourceforge.net/projects/edk2/files/OVMF/OVMF-X64-r15214.zip +# ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r295065 - head/tools/tools/nanobsd/embedded
Author: imp Date: Sat Jan 30 07:00:36 2016 New Revision: 295065 URL: https://svnweb.freebsd.org/changeset/base/295065 Log: Preliminary EFI support. Based, in part, on patches from Andy Turner. Add support for being able to boot off both UEFI and BIOS firmware, ala the memstick trick. Add support for writing to GPT volumes. Move away from using bsd labels at all for these embedded stuff. Minor tweaks to README. Modified: head/tools/tools/nanobsd/embedded/README head/tools/tools/nanobsd/embedded/common Modified: head/tools/tools/nanobsd/embedded/README == --- head/tools/tools/nanobsd/embedded/READMESat Jan 30 07:00:29 2016 (r295064) +++ head/tools/tools/nanobsd/embedded/READMESat Jan 30 07:00:36 2016 (r295065) @@ -10,8 +10,6 @@ and DHCPd. This is a work in progress. Generally, to build this you should cd tools/tools/nanobsd/embedded sudo sh ../nanobsd.sh -c foo.cfg -but do be careful if things are interrupted. There may still be -bugs lurking that cause your entire FreeBSD tree to disappear. Some features: Modified: head/tools/tools/nanobsd/embedded/common == --- head/tools/tools/nanobsd/embedded/commonSat Jan 30 07:00:29 2016 (r295064) +++ head/tools/tools/nanobsd/embedded/commonSat Jan 30 07:00:36 2016 (r295065) @@ -76,6 +76,8 @@ fi NANO_SLICE_FAT_SIZE=32m NANO_SLICE_CFG_SIZE=32m +NANO_BOOT2CFG="-D -h -S115200 comconsole_port=0x3e8" + NANO_RAM_ETCSIZE=8192 NANO_RAM_TMPVARSIZE=8192 NANO_IMAGES=2 @@ -292,7 +294,7 @@ create_diskimage_mbr ( ) ( bootbsd=${NANO_BOOT_BSD:+-b ${NANO_BOOT_BSD}} skiparg=${NANO_MBR_FIRST_SKIP:+-S ${NANO_MBR_FIRST_SKIP}} - for i in s1 s2 s3 s4 empty; do + for i in s1 s2 s3 s4 p1 p2 p3 p4 p5 empty; do rm -fr ${NANO_OBJ}/_.${i}* done @@ -317,10 +319,10 @@ create_diskimage_mbr ( ) ( # bsd label [ -z ${NANO_NOPRIV_BUILD} ] || extra="-F ${NANO_METALOG}" sz=${NANO_SLICE_ROOT_SIZE:+-s ${NANO_SLICE_ROOT_SIZE}} - eval "${NANO_MAKEFS_UFS}" ${extra} $sz "${NANO_OBJ}/_.${NANO_SLICE_ROOT}a" \ + eval "${NANO_MAKEFS_UFS}" ${extra} $sz "${NANO_OBJ}/_.${NANO_SLICE_ROOT}" \ "${NANO_WORLDDIR}" - mkimg -s bsd ${bootbsd} -p freebsd-ufs:=${NANO_OBJ}/_.${NANO_SLICE_ROOT}a \ - -o ${NANO_OBJ}/_.${NANO_SLICE_ROOT} +# mkimg -s bsd ${bootbsd} -p freebsd-ufs:=${NANO_OBJ}/_.${NANO_SLICE_ROOT} \ +# -o ${NANO_OBJ}/_.${NANO_SLICE_ROOT} # Populate the /cfg partition, empty if none given if [ -z "${NANO_CFGDIR}" ]; then @@ -339,8 +341,18 @@ create_diskimage_mbr ( ) ( if [ -n "$NANO_SLICE_FAT" ]; then eval $NANO_SLICE_FAT=fat16b fi - eval $NANO_SLICE_CFG=freebsd - eval $NANO_SLICE_ROOT=freebsd + case ${NANO_SLICE_CFG} in + s*) + echo slice + eval $NANO_SLICE_CFG=freebsd + eval $NANO_SLICE_ROOT=freebsd + ;; + p*) + echo part + eval $NANO_SLICE_CFG=freebsd-ufs + eval $NANO_SLICE_ROOT=freebsd-ufs + ;; + esac # below depends on https://reviews.freebsd.org/D4403 not yet in the tree # but there's problems: it marks all partitions as active, so you have to # boot off parittion 3 or 2 by hand if you're playing around with this WIP @@ -358,6 +370,25 @@ create_diskimage_mbr ( ) ( -p ${s2}:=${NANO_OBJ}/_.s2 \ -o ${NANO_OBJ}/_.disk.image.${NANO_NAME}${fmt} ;; + std-uefi) + # s1 is boot, s2 is cfg, s3 is /, not sure how to make that + # boot (marked as active) with mkimg yet + mkimg -a 2 ${fmtarg} ${bootmbr} -s mbr \ + -p efi:=${NANO_WORLDDIR}/boot/boot1.efifat \ + -p ${s2}:=${NANO_OBJ}/_.s2 \ + -p ${s3}:=${NANO_OBJ}/_.s3 \ + -o ${NANO_OBJ}/_.disk.image.${NANO_NAME}${fmt} + ;; + std-uefi-bios) + # p1 is boot for uefi, p2 is boot for gpt, p3 is cfg, p4 is / + # and p5 is alt-root (after resize) + mkimg -a 2 ${fmtarg} ${bootmbr} -s gpt \ + -p efi:=${NANO_WORLDDIR}/boot/boot1.efifat \ + -p freebsd-boot:=${NAANO_WORLDDIR}/boot/gptboot \ + -p ${p3}:=${NANO_OBJ}/_.p3 \ + -p ${p4}:=${NANO_OBJ}/_.p4 \ + -o ${NANO_OBJ}/_.disk.image.${NANO_NAME}${fmt} + ;; powerpc64-ibm) # A lie to make the boot loader work, it boots the first BSD partition # it finds, regardless of the active flag. @@ -658,6 +689,19 @@ powerpc64-apple)
svn commit: r295064 - in head/tools/tools/nanobsd: . embedded
Author: imp Date: Sat Jan 30 07:00:29 2016 New Revision: 295064 URL: https://svnweb.freebsd.org/changeset/base/295064 Log: Two new variables: NANO_ROOT and NANO_ALTROOT. These used to be spelled ${NANO_SLICE_ROOT}a and ${NANO_SLICE_ALTROOT}a respectively, and that's the default value. This will allow nanobsd on systems without a bsd label. That's rarely needed these days, even in an MBR world. The default will shift to this in the future, but remain an option. Modified: head/tools/tools/nanobsd/defaults.sh (contents, props changed) head/tools/tools/nanobsd/embedded/common Modified: head/tools/tools/nanobsd/defaults.sh == --- head/tools/tools/nanobsd/defaults.shSat Jan 30 07:00:28 2016 (r295063) +++ head/tools/tools/nanobsd/defaults.shSat Jan 30 07:00:29 2016 (r295064) @@ -156,6 +156,8 @@ NANO_SLICE_ROOT=s1 NANO_SLICE_ALTROOT=s2 NANO_SLICE_CFG=s3 NANO_SLICE_DATA=s4 +NANO_ROOT=s1a +NANO_ALTROOT=s2a # Default ownwership for nopriv build NANO_DEF_UNAME=root @@ -569,7 +571,7 @@ setup_nanobsd_etc ( ) ( # save config file for scripts echo "NANO_DRIVE=${NANO_DRIVE}" > etc/nanobsd.conf - echo "/dev/${NANO_DRIVE}${NANO_SLICE_ROOT}a / ufs ro 1 1" > etc/fstab + echo "/dev/${NANO_DRIVE}${NANO_ROOT} / ufs ro 1 1" > etc/fstab echo "/dev/${NANO_DRIVE}${NANO_SLICE_CFG} /cfg ufs rw,noauto 2 2" >> etc/fstab mkdir -p cfg ) @@ -731,8 +733,8 @@ create_diskimage ( ) ( bsdlabel ${MD}${NANO_SLICE_ROOT} # Create first image - populate_slice /dev/${MD}${NANO_SLICE_ROOT}a ${NANO_WORLDDIR} ${MNT} "${NANO_SLICE_ROOT}a" - mount /dev/${MD}${NANO_SLICE_ROOT}a ${MNT} + populate_slice /dev/${MD}${NANO_ROOT} ${NANO_WORLDDIR} ${MNT} "${NANO_ROOT}" + mount /dev/${MD}${NANO_ROOT} ${MNT} echo "Generating mtree..." ( cd "${MNT}" && mtree -c ) > ${NANO_OBJ}/_.mtree ( cd "${MNT}" && du -k ) > ${NANO_OBJ}/_.du @@ -742,7 +744,7 @@ create_diskimage ( ) ( # Duplicate to second image (if present) echo "Duplicating to second image..." dd conv=sparse if=/dev/${MD}${NANO_SLICE_ROOT} of=/dev/${MD}${NANO_SLICE_ALTROOT} bs=64k - mount /dev/${MD}${NANO_SLICE_ALTROOT}a ${MNT} + mount /dev/${MD}${NANO_ALTROOT} ${MNT} for f in ${MNT}/etc/fstab ${MNT}/conf/base/etc/fstab do sed -i "" "s=${NANO_DRIVE}${NANO_SLICE_ROOT}=${NANO_DRIVE}${NANO_SLICE_ALTROOT}=g" $f @@ -751,7 +753,7 @@ create_diskimage ( ) ( # Override the label from the first partition so we # don't confuse glabel with duplicates. if [ -n "${NANO_LABEL}" ]; then - tunefs -L ${NANO_LABEL}"${NANO_SLICE_ALTROOT}a" /dev/${MD}${NANO_SLICE_ALTROOT}a + tunefs -L ${NANO_LABEL}"${NANO_ALTROOT}" /dev/${MD}${NANO_ALTROOT} fi fi Modified: head/tools/tools/nanobsd/embedded/common == --- head/tools/tools/nanobsd/embedded/commonSat Jan 30 07:00:28 2016 (r295063) +++ head/tools/tools/nanobsd/embedded/commonSat Jan 30 07:00:29 2016 (r295064) @@ -664,6 +664,11 @@ powerpc64-apple) ;; esac +# For this config, no BSD labels so NANO_ROOT and NANO_ALTROOT need to be +# adjusted +NANO_ROOT=${NANO_SLICE_ROOT} +NANO_ALTROOT=${NANO_SLICE_ALTROOT} + NANO_SLICE_DATA= # Not included # Each major disk scheme has its own routine. Generally ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"