From owner-svn-src-head@FreeBSD.ORG Sun Feb 2 00:48:18 2014 Return-Path: Delivered-To: svn-src-head@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 B3E6623C; Sun, 2 Feb 2014 00:48:18 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9E5C91D63; Sun, 2 Feb 2014 00:48:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s120mImT057204; Sun, 2 Feb 2014 00:48:18 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s120mGww057186; Sun, 2 Feb 2014 00:48:16 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201402020048.s120mGww057186@svn.freebsd.org> From: Ian Lepore Date: Sun, 2 Feb 2014 00:48:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261393 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2014 00:48:18 -0000 Author: ian Date: Sun Feb 2 00:48:15 2014 New Revision: 261393 URL: http://svnweb.freebsd.org/changeset/base/261393 Log: Update all arm code that manipulates the PSR registers to use modern syntax. It turns out the version of gas we're using interprets the old '_all' mask as 'fc' instead of 'fsxc'. That is, "all" doesn't really mean "all". This was the cause of the "wrong-endian register restore" bug that's been causing problems with some cortex-a9 chips. The 'endian' bit in the spsr register would never get changed (it falls into the 'x' mask group) and the first return-from-exception would fail if the chip had powered on with garbage in the spsr register that included the big-endian bit. It's unknown why this affected only certain cortex-a9 chips. Modified: head/sys/arm/arm/cpufunc_asm_arm8.S head/sys/arm/arm/cpufunc_asm_sa1.S head/sys/arm/arm/cpufunc_asm_sa11x0.S head/sys/arm/arm/cpufunc_asm_xscale.S head/sys/arm/arm/cpufunc_asm_xscale_c3.S head/sys/arm/arm/exception.S head/sys/arm/arm/fiq_subr.S head/sys/arm/arm/locore.S head/sys/arm/arm/setcpsr.S head/sys/arm/arm/setstack.s head/sys/arm/include/asmacros.h head/sys/arm/include/atomic.h Modified: head/sys/arm/arm/cpufunc_asm_arm8.S ============================================================================== --- head/sys/arm/arm/cpufunc_asm_arm8.S Sun Feb 2 00:34:32 2014 (r261392) +++ head/sys/arm/arm/cpufunc_asm_arm8.S Sun Feb 2 00:48:15 2014 (r261393) @@ -67,9 +67,9 @@ END(arm8_clock_config) * addresses that are about to change. */ ENTRY(arm8_setttb) - mrs r3, cpsr_all + mrs r3, cpsr orr r1, r3, #(I32_bit | F32_bit) - msr cpsr_all, r1 + msr cpsr_fsxc, r1 stmfd sp!, {r0-r3, lr} bl _C_LABEL(arm8_cache_cleanID) @@ -88,7 +88,7 @@ ENTRY(arm8_setttb) /* Make sure that pipeline is emptied */ mov r0, r0 mov r0, r0 - msr cpsr_all, r3 + msr cpsr_fsxc, r3 RET END(arm8_setttb) @@ -182,9 +182,9 @@ ENTRY(arm8_cache_purgeID) mov r0, #0x00000000 - mrs r3, cpsr_all + mrs r3, cpsr orr r2, r3, #(I32_bit | F32_bit) - msr cpsr_all, r2 + msr cpsr_fsxc, r2 1: mov r2, r0 mcr p15, 0, r2, c7, c11, 1 @@ -238,7 +238,7 @@ ENTRY(arm8_cache_purgeID) adds r0, r0, #0x04000000 bne 1b - msr cpsr_all, r3 + msr cpsr_fsxc, r3 RET END(arm8_cache_purgeID) @@ -255,12 +255,12 @@ ENTRY(arm8_cache_purgeID_E) * mcr p15, 0, rd, c7, c11, 1 * mcr p15, 0, rd, c7, c7, 1 */ - mrs r3, cpsr_all + mrs r3, cpsr orr r2, r3, #(I32_bit | F32_bit) - msr cpsr_all, r2 + msr cpsr_fsxc, r2 mcr p15, 0, r0, c7, c11, 1 /* clean I+D single entry */ mcr p15, 0, r0, c7, c7, 1 /* flush I+D single entry */ - msr cpsr_all, r3 + msr cpsr_fsxc, r3 RET END(arm8_cache_purgeID_E) Modified: head/sys/arm/arm/cpufunc_asm_sa1.S ============================================================================== --- head/sys/arm/arm/cpufunc_asm_sa1.S Sun Feb 2 00:34:32 2014 (r261392) +++ head/sys/arm/arm/cpufunc_asm_sa1.S Sun Feb 2 00:48:15 2014 (r261393) @@ -52,9 +52,9 @@ ENTRY(getttb) mrc p15, 0, r0, c2, c0, 0 ENTRY(sa1_setttb) #ifdef CACHE_CLEAN_BLOCK_INTR - mrs r3, cpsr_all + mrs r3, cpsr orr r1, r3, #(I32_bit | F32_bit) - msr cpsr_all, r1 + msr cpsr_fsxc, r1 #else ldr r3, .Lblock_userspace_access ldr r2, [r3] @@ -80,7 +80,7 @@ ENTRY(sa1_setttb) mov r0, r0 mov r0, r0 #ifdef CACHE_CLEAN_BLOCK_INTR - msr cpsr_all, r3 + msr cpsr_fsxc, r3 #else str r2, [r3] #endif @@ -154,12 +154,12 @@ _C_LABEL(sa1_cache_clean_size): #ifdef CACHE_CLEAN_BLOCK_INTR #define SA1_CACHE_CLEAN_BLOCK \ - mrs r3, cpsr_all ; \ + mrs r3, cpsr ; \ orr r0, r3, #(I32_bit | F32_bit) ; \ - msr cpsr_all, r0 + msr cpsr_fsxc, r0 #define SA1_CACHE_CLEAN_UNBLOCK \ - msr cpsr_all, r3 + msr cpsr_fsxc, r3 #else #define SA1_CACHE_CLEAN_BLOCK \ ldr r3, .Lblock_userspace_access ; \ Modified: head/sys/arm/arm/cpufunc_asm_sa11x0.S ============================================================================== --- head/sys/arm/arm/cpufunc_asm_sa11x0.S Sun Feb 2 00:34:32 2014 (r261392) +++ head/sys/arm/arm/cpufunc_asm_sa11x0.S Sun Feb 2 00:48:15 2014 (r261393) @@ -80,9 +80,9 @@ ENTRY(sa11x0_cpu_sleep) * re-enable clock switching before servicing interrupts. */ - mrs r3, cpsr_all /* 6 */ + mrs r3, cpsr /* 6 */ orr r2, r3, #(I32_bit|F32_bit) /* 7 */ - msr cpsr_all, r2 /* 8 */ + msr cpsr_fsxc, r2 /* 8 */ /* We're now 32-byte aligned */ @@ -93,7 +93,7 @@ ENTRY(sa11x0_cpu_sleep) mcr p15, 0, r0, c15, c1, 2 /* re-enable clock switching */ /* Restore interrupts (which will cause them to be serviced). */ - msr cpsr_all, r3 + msr cpsr_fsxc, r3 RET END(sa11x0_cpu_sleep) Modified: head/sys/arm/arm/cpufunc_asm_xscale.S ============================================================================== --- head/sys/arm/arm/cpufunc_asm_xscale.S Sun Feb 2 00:34:32 2014 (r261392) +++ head/sys/arm/arm/cpufunc_asm_xscale.S Sun Feb 2 00:48:15 2014 (r261393) @@ -134,9 +134,9 @@ END(xscale_control) */ ENTRY(xscale_setttb) #ifdef CACHE_CLEAN_BLOCK_INTR - mrs r3, cpsr_all + mrs r3, cpsr orr r1, r3, #(I32_bit | F32_bit) - msr cpsr_all, r1 + msr cpsr_fsxc, r1 #else ldr r3, .Lblock_userspace_access ldr r2, [r3] @@ -164,7 +164,7 @@ ENTRY(xscale_setttb) CPWAIT(r0) #ifdef CACHE_CLEAN_BLOCK_INTR - msr cpsr_all, r3 + msr cpsr_fsxc, r3 #else str r2, [r3] #endif @@ -266,12 +266,12 @@ _C_LABEL(xscale_minidata_clean_size): #ifdef CACHE_CLEAN_BLOCK_INTR #define XSCALE_CACHE_CLEAN_BLOCK \ - mrs r3, cpsr_all ; \ + mrs r3, cpsr ; \ orr r0, r3, #(I32_bit | F32_bit) ; \ - msr cpsr_all, r0 + msr cpsr_fsxc, r0 #define XSCALE_CACHE_CLEAN_UNBLOCK \ - msr cpsr_all, r3 + msr cpsr_fsxc, r3 #else #define XSCALE_CACHE_CLEAN_BLOCK \ ldr r3, .Lblock_userspace_access ; \ Modified: head/sys/arm/arm/cpufunc_asm_xscale_c3.S ============================================================================== --- head/sys/arm/arm/cpufunc_asm_xscale_c3.S Sun Feb 2 00:34:32 2014 (r261392) +++ head/sys/arm/arm/cpufunc_asm_xscale_c3.S Sun Feb 2 00:48:15 2014 (r261393) @@ -121,12 +121,12 @@ __FBSDID("$FreeBSD$"); #ifdef CACHE_CLEAN_BLOCK_INTR #define XSCALE_CACHE_CLEAN_BLOCK \ stmfd sp!, {r4} ; \ - mrs r4, cpsr_all ; \ + mrs r4, cpsr ; \ orr r0, r4, #(I32_bit | F32_bit) ; \ - msr cpsr_all, r0 + msr cpsr_fsxc, r0 #define XSCALE_CACHE_CLEAN_UNBLOCK \ - msr cpsr_all, r4 ; \ + msr cpsr_fsxc, r4 ; \ ldmfd sp!, {r4} #else #define XSCALE_CACHE_CLEAN_BLOCK \ @@ -348,9 +348,9 @@ END(xscalec3_l2cache_flush_rng) */ ENTRY(xscalec3_setttb) #ifdef CACHE_CLEAN_BLOCK_INTR - mrs r3, cpsr_all + mrs r3, cpsr orr r1, r3, #(I32_bit | F32_bit) - msr cpsr_all, r1 + msr cpsr_fsxc, r1 #else ldr r3, .Lblock_userspace_access ldr r2, [r3] @@ -378,7 +378,7 @@ ENTRY(xscalec3_setttb) CPWAIT(r0) #ifdef CACHE_CLEAN_BLOCK_INTR - msr cpsr_all, r3 + msr cpsr_fsxc, r3 #else str r2, [r3] #endif Modified: head/sys/arm/arm/exception.S ============================================================================== --- head/sys/arm/arm/exception.S Sun Feb 2 00:34:32 2014 (r261392) +++ head/sys/arm/arm/exception.S Sun Feb 2 00:48:15 2014 (r261393) @@ -173,8 +173,8 @@ END(data_abort_entry) * it like a Data Abort. */ ASENTRY_NP(address_exception_entry) - mrs r1, cpsr_all - mrs r2, spsr_all + mrs r1, cpsr + mrs r2, spsr mov r3, lr adr r0, Laddress_exception_msg bl _C_LABEL(printf) /* XXX CLOBBERS LR!! */ Modified: head/sys/arm/arm/fiq_subr.S ============================================================================== --- head/sys/arm/arm/fiq_subr.S Sun Feb 2 00:34:32 2014 (r261392) +++ head/sys/arm/arm/fiq_subr.S Sun Feb 2 00:48:15 2014 (r261393) @@ -52,14 +52,14 @@ __FBSDID("$FreeBSD$"); #endif #define SWITCH_TO_FIQ_MODE \ - mrs r2, cpsr_all ; \ + mrs r2, cpsr ; \ mov r3, r2 ; \ bic r2, r2, #(PSR_MODE) ; \ orr r2, r2, #(PSR_FIQ32_MODE) ; \ - msr cpsr_all, r2 + msr cpsr_fsxc, r2 #define BACK_TO_SVC_MODE \ - msr cpsr_all, r3 + msr cpsr_fsxc, r3 /* * fiq_getregs: Modified: head/sys/arm/arm/locore.S ============================================================================== --- head/sys/arm/arm/locore.S Sun Feb 2 00:34:32 2014 (r261392) +++ head/sys/arm/arm/locore.S Sun Feb 2 00:48:15 2014 (r261393) @@ -333,10 +333,10 @@ ASENTRY_NP(mptramp) AP_DEBUG(#1) - mrs r3, cpsr_all + mrs r3, cpsr bic r3, r3, #(PSR_MODE) orr r3, r3, #(PSR_SVC32_MODE) - msr cpsr_all, r3 + msr cpsr_fsxc, r3 mrc p15, 0, r0, c0, c0, 5 and r0, #0x0f /* Get CPU ID */ @@ -446,7 +446,7 @@ ENTRY_NP(cpu_halt) bic r2, r2, #(PSR_MODE) orr r2, r2, #(PSR_SVC32_MODE) orr r2, r2, #(I32_bit | F32_bit) - msr cpsr_all, r2 + msr cpsr_fsxc, r2 ldr r4, .Lcpu_reset_address ldr r4, [r4] Modified: head/sys/arm/arm/setcpsr.S ============================================================================== --- head/sys/arm/arm/setcpsr.S Sun Feb 2 00:34:32 2014 (r261392) +++ head/sys/arm/arm/setcpsr.S Sun Feb 2 00:48:15 2014 (r261393) @@ -61,7 +61,7 @@ ENTRY_NP(SetCPSR) mrs r3, cpsr /* Set the CPSR */ bic r2, r3, r0 eor r2, r2, r1 - msr cpsr_all, r2 + msr cpsr_fsxc, r2 mov r0, r3 /* Return the old CPSR */ Modified: head/sys/arm/arm/setstack.s ============================================================================== --- head/sys/arm/arm/setstack.s Sun Feb 2 00:34:32 2014 (r261392) +++ head/sys/arm/arm/setstack.s Sun Feb 2 00:48:15 2014 (r261393) @@ -61,14 +61,14 @@ __FBSDID("$FreeBSD$"); */ ENTRY(set_stackptr) - mrs r3, cpsr_all /* Switch to the appropriate mode */ + mrs r3, cpsr /* Switch to the appropriate mode */ bic r2, r3, #(PSR_MODE) orr r2, r2, r0 - msr cpsr_all, r2 + msr cpsr_fsxc, r2 mov sp, r1 /* Set the stack pointer */ - msr cpsr_all, r3 /* Restore the old mode */ + msr cpsr_fsxc, r3 /* Restore the old mode */ mov pc, lr /* Exit */ @@ -80,14 +80,14 @@ ENTRY(set_stackptr) */ ENTRY(get_stackptr) - mrs r3, cpsr_all /* Switch to the appropriate mode */ + mrs r3, cpsr /* Switch to the appropriate mode */ bic r2, r3, #(PSR_MODE) orr r2, r2, r0 - msr cpsr_all, r2 + msr cpsr_fsxc, r2 mov r0, sp /* Set the stack pointer */ - msr cpsr_all, r3 /* Restore the old mode */ + msr cpsr_fsxc, r3 /* Restore the old mode */ mov pc, lr /* Exit */ Modified: head/sys/arm/include/asmacros.h ============================================================================== --- head/sys/arm/include/asmacros.h Sun Feb 2 00:34:32 2014 (r261392) +++ head/sys/arm/include/asmacros.h Sun Feb 2 00:48:15 2014 (r261393) @@ -70,7 +70,7 @@ add r0, sp, #(4*13); /* Adjust the stack pointer */ \ stmia r0, {r13-r14}^; /* Push the user mode registers */ \ mov r0, r0; /* NOP for previous instruction */ \ - mrs r0, spsr_all; /* Put the SPSR on the stack */ \ + mrs r0, spsr; /* Put the SPSR on the stack */ \ str r0, [sp, #-4]!; \ ldr r0, =ARM_RAS_START; \ mov r1, #0; \ @@ -86,7 +86,7 @@ add r0, sp, #(4*13); /* Adjust the stack pointer */ \ stmia r0, {r13-r14}^; /* Push the user mode registers */ \ mov r0, r0; /* NOP for previous instruction */ \ - mrs r0, spsr_all; /* Put the SPSR on the stack */ \ + mrs r0, spsr; /* Put the SPSR on the stack */ \ str r0, [sp, #-4]!; #endif @@ -98,7 +98,7 @@ #ifdef ARM_TP_ADDRESS #define PULLFRAME \ ldr r0, [sp], #0x0004; /* Get the SPSR from stack */ \ - msr spsr_all, r0; \ + msr spsr_fsxc, r0; \ ldmia sp, {r0-r14}^; /* Restore registers (usr mode) */ \ mov r0, r0; /* NOP for previous instruction */ \ add sp, sp, #(4*17); /* Adjust the stack pointer */ \ @@ -107,7 +107,7 @@ #else #define PULLFRAME \ ldr r0, [sp], #0x0004; /* Get the SPSR from stack */ \ - msr spsr_all, r0; \ + msr spsr_fsxc, r0; \ clrex; \ ldmia sp, {r0-r14}^; /* Restore registers (usr mode) */ \ mov r0, r0; /* NOP for previous instruction */ \ @@ -142,7 +142,7 @@ str r0, [sp, #-4]!; /* Push return address */ \ str lr, [sp, #-4]!; /* Push SVC lr */ \ str r2, [sp, #-4]!; /* Push SVC sp */ \ - msr spsr_all, r3; /* Restore correct spsr */ \ + msr spsr_fsxc, r3; /* Restore correct spsr */ \ ldmdb r1, {r0-r3}; /* Restore 4 regs from xxx mode */ \ sub sp, sp, #(4*15); /* Adjust the stack pointer */ \ stmia sp, {r0-r12}; /* Push the user mode registers */ \ @@ -161,7 +161,7 @@ ldrne r1, [r0, #16]; /* adjust the saved PC so that */ \ cmpne r4, r1; /* execution later resumes at */ \ strhi r3, [r0, #16]; /* the RAS_START location. */ \ - mrs r0, spsr_all; \ + mrs r0, spsr; \ str r0, [sp, #-4]! #else #define PUSHFRAMEINSVC \ @@ -179,14 +179,14 @@ str r0, [sp, #-4]!; /* Push return address */ \ str lr, [sp, #-4]!; /* Push SVC lr */ \ str r2, [sp, #-4]!; /* Push SVC sp */ \ - msr spsr_all, r3; /* Restore correct spsr */ \ + msr spsr_fsxc, r3; /* Restore correct spsr */ \ ldmdb r1, {r0-r3}; /* Restore 4 regs from xxx mode */ \ sub sp, sp, #(4*15); /* Adjust the stack pointer */ \ stmia sp, {r0-r12}; /* Push the user mode registers */ \ add r0, sp, #(4*13); /* Adjust the stack pointer */ \ stmia r0, {r13-r14}^; /* Push the user mode registers */ \ mov r0, r0; /* NOP for previous instruction */ \ - mrs r0, spsr_all; /* Put the SPSR on the stack */ \ + mrs r0, spsr; /* Put the SPSR on the stack */ \ str r0, [sp, #-4]! #endif @@ -200,7 +200,7 @@ #ifdef ARM_TP_ADDRESS #define PULLFRAMEFROMSVCANDEXIT \ ldr r0, [sp], #0x0004; /* Get the SPSR from stack */ \ - msr spsr_all, r0; /* restore SPSR */ \ + msr spsr_fsxc, r0; /* restore SPSR */ \ ldmia sp, {r0-r14}^; /* Restore registers (usr mode) */ \ mov r0, r0; /* NOP for previous instruction */ \ add sp, sp, #(4*15); /* Adjust the stack pointer */ \ @@ -208,7 +208,7 @@ #else #define PULLFRAMEFROMSVCANDEXIT \ ldr r0, [sp], #0x0004; /* Get the SPSR from stack */ \ - msr spsr_all, r0; /* restore SPSR */ \ + msr spsr_fsxc, r0; /* restore SPSR */ \ clrex; \ ldmia sp, {r0-r14}^; /* Restore registers (usr mode) */ \ mov r0, r0; /* NOP for previous instruction */ \ Modified: head/sys/arm/include/atomic.h ============================================================================== --- head/sys/arm/include/atomic.h Sun Feb 2 00:34:32 2014 (r261392) +++ head/sys/arm/include/atomic.h Sun Feb 2 00:48:15 2014 (r261393) @@ -450,13 +450,13 @@ atomic_store_rel_long(volatile u_long *p __asm __volatile( \ "mrs %0, cpsr;" \ "orr %1, %0, %2;" \ - "msr cpsr_all, %1;" \ + "msr cpsr_fsxc, %1;" \ : "=r" (cpsr_save), "=r" (tmp) \ : "I" (I32_bit | F32_bit) \ : "cc" ); \ (expr); \ __asm __volatile( \ - "msr cpsr_all, %0" \ + "msr cpsr_fsxc, %0" \ : /* no output */ \ : "r" (cpsr_save) \ : "cc" ); \ From owner-svn-src-head@FreeBSD.ORG Sun Feb 2 03:30:35 2014 Return-Path: Delivered-To: svn-src-head@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 0AE9AA14; Sun, 2 Feb 2014 03:30:35 +0000 (UTC) Received: from mail-qa0-x236.google.com (mail-qa0-x236.google.com [IPv6:2607:f8b0:400d:c00::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 80E271772; Sun, 2 Feb 2014 03:30:34 +0000 (UTC) Received: by mail-qa0-f54.google.com with SMTP id i13so8243072qae.41 for ; Sat, 01 Feb 2014 19:30:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=OCStenFlOWCiFE0Yk1oQ8K1/eaGN28BB1aIuGqB/Ws8=; b=oIenm/zmK3xcFnWKWeEnMwtPiEpSA1RUtu2SUKy6m8Wkg1fk7iB8LevMeRlz0BateO 6tdcuV5Dwp0x0AZO8QgRMai6N6To0VURY3a9YOtgr0rWJnEc35KrYVXa6Ygz8WeF9K1Z i4qmPwjy3lL70zAbY4Hqyz3oWifXtD2OFfUB7RjGXzFsOZqwMg/bPm3bui/mQcGD1YRv //v/HXTBxFLn9+lcB7ss5u41Tf7rI7mzveslGxUYkOmvY4hCHyRsQa7BJGn6RJRysJ+5 mmkKALWjIMJLlzqHCje3htvb3/u2R2lkoSjE8+UlxC1iM58o/9SgY6cPIlpOoZwM5ENK rjrQ== MIME-Version: 1.0 X-Received: by 10.224.121.137 with SMTP id h9mr34643468qar.55.1391311833756; Sat, 01 Feb 2014 19:30:33 -0800 (PST) Received: by 10.224.52.8 with HTTP; Sat, 1 Feb 2014 19:30:33 -0800 (PST) Received: by 10.224.52.8 with HTTP; Sat, 1 Feb 2014 19:30:33 -0800 (PST) In-Reply-To: <201402020048.s120mGww057186@svn.freebsd.org> References: <201402020048.s120mGww057186@svn.freebsd.org> Date: Sat, 1 Feb 2014 19:30:33 -0800 Message-ID: Subject: Re: svn commit: r261393 - in head/sys/arm: arm include From: Adrian Chadd To: Ian Lepore Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2014 03:30:35 -0000 Wow! Great find! Adrian On Feb 1, 2014 6:48 PM, "Ian Lepore" wrote: > Author: ian > Date: Sun Feb 2 00:48:15 2014 > New Revision: 261393 > URL: http://svnweb.freebsd.org/changeset/base/261393 > > Log: > Update all arm code that manipulates the PSR registers to use modern > syntax. > > It turns out the version of gas we're using interprets the old '_all' > mask > as 'fc' instead of 'fsxc'. That is, "all" doesn't really mean "all". > > This was the cause of the "wrong-endian register restore" bug that's > been causing problems with some cortex-a9 chips. The 'endian' bit in the > spsr register would never get changed (it falls into the 'x' mask group) > and the first return-from-exception would fail if the chip had powered on > with garbage in the spsr register that included the big-endian bit. It's > unknown why this affected only certain cortex-a9 chips. > > Modified: > head/sys/arm/arm/cpufunc_asm_arm8.S > head/sys/arm/arm/cpufunc_asm_sa1.S > head/sys/arm/arm/cpufunc_asm_sa11x0.S > head/sys/arm/arm/cpufunc_asm_xscale.S > head/sys/arm/arm/cpufunc_asm_xscale_c3.S > head/sys/arm/arm/exception.S > head/sys/arm/arm/fiq_subr.S > head/sys/arm/arm/locore.S > head/sys/arm/arm/setcpsr.S > head/sys/arm/arm/setstack.s > head/sys/arm/include/asmacros.h > head/sys/arm/include/atomic.h > > Modified: head/sys/arm/arm/cpufunc_asm_arm8.S > > ============================================================================== > --- head/sys/arm/arm/cpufunc_asm_arm8.S Sun Feb 2 00:34:32 2014 > (r261392) > +++ head/sys/arm/arm/cpufunc_asm_arm8.S Sun Feb 2 00:48:15 2014 > (r261393) > @@ -67,9 +67,9 @@ END(arm8_clock_config) > * addresses that are about to change. > */ > ENTRY(arm8_setttb) > - mrs r3, cpsr_all > + mrs r3, cpsr > orr r1, r3, #(I32_bit | F32_bit) > - msr cpsr_all, r1 > + msr cpsr_fsxc, r1 > > stmfd sp!, {r0-r3, lr} > bl _C_LABEL(arm8_cache_cleanID) > @@ -88,7 +88,7 @@ ENTRY(arm8_setttb) > /* Make sure that pipeline is emptied */ > mov r0, r0 > mov r0, r0 > - msr cpsr_all, r3 > + msr cpsr_fsxc, r3 > > RET > END(arm8_setttb) > @@ -182,9 +182,9 @@ ENTRY(arm8_cache_purgeID) > > mov r0, #0x00000000 > > - mrs r3, cpsr_all > + mrs r3, cpsr > orr r2, r3, #(I32_bit | F32_bit) > - msr cpsr_all, r2 > + msr cpsr_fsxc, r2 > > 1: mov r2, r0 > mcr p15, 0, r2, c7, c11, 1 > @@ -238,7 +238,7 @@ ENTRY(arm8_cache_purgeID) > adds r0, r0, #0x04000000 > bne 1b > > - msr cpsr_all, r3 > + msr cpsr_fsxc, r3 > RET > END(arm8_cache_purgeID) > > @@ -255,12 +255,12 @@ ENTRY(arm8_cache_purgeID_E) > * mcr p15, 0, rd, c7, c11, 1 > * mcr p15, 0, rd, c7, c7, 1 > */ > - mrs r3, cpsr_all > + mrs r3, cpsr > orr r2, r3, #(I32_bit | F32_bit) > - msr cpsr_all, r2 > + msr cpsr_fsxc, r2 > mcr p15, 0, r0, c7, c11, 1 /* clean I+D single entry */ > mcr p15, 0, r0, c7, c7, 1 /* flush I+D single entry */ > - msr cpsr_all, r3 > + msr cpsr_fsxc, r3 > RET > END(arm8_cache_purgeID_E) > > > Modified: head/sys/arm/arm/cpufunc_asm_sa1.S > > ============================================================================== > --- head/sys/arm/arm/cpufunc_asm_sa1.S Sun Feb 2 00:34:32 2014 > (r261392) > +++ head/sys/arm/arm/cpufunc_asm_sa1.S Sun Feb 2 00:48:15 2014 > (r261393) > @@ -52,9 +52,9 @@ ENTRY(getttb) > mrc p15, 0, r0, c2, c0, 0 > ENTRY(sa1_setttb) > #ifdef CACHE_CLEAN_BLOCK_INTR > - mrs r3, cpsr_all > + mrs r3, cpsr > orr r1, r3, #(I32_bit | F32_bit) > - msr cpsr_all, r1 > + msr cpsr_fsxc, r1 > #else > ldr r3, .Lblock_userspace_access > ldr r2, [r3] > @@ -80,7 +80,7 @@ ENTRY(sa1_setttb) > mov r0, r0 > mov r0, r0 > #ifdef CACHE_CLEAN_BLOCK_INTR > - msr cpsr_all, r3 > + msr cpsr_fsxc, r3 > #else > str r2, [r3] > #endif > @@ -154,12 +154,12 @@ _C_LABEL(sa1_cache_clean_size): > > #ifdef CACHE_CLEAN_BLOCK_INTR > #define SA1_CACHE_CLEAN_BLOCK > \ > - mrs r3, cpsr_all ; \ > + mrs r3, cpsr ; \ > orr r0, r3, #(I32_bit | F32_bit) ; \ > - msr cpsr_all, r0 > + msr cpsr_fsxc, r0 > > #define SA1_CACHE_CLEAN_UNBLOCK > \ > - msr cpsr_all, r3 > + msr cpsr_fsxc, r3 > #else > #define SA1_CACHE_CLEAN_BLOCK > \ > ldr r3, .Lblock_userspace_access ; \ > > Modified: head/sys/arm/arm/cpufunc_asm_sa11x0.S > > ============================================================================== > --- head/sys/arm/arm/cpufunc_asm_sa11x0.S Sun Feb 2 00:34:32 2014 > (r261392) > +++ head/sys/arm/arm/cpufunc_asm_sa11x0.S Sun Feb 2 00:48:15 2014 > (r261393) > @@ -80,9 +80,9 @@ ENTRY(sa11x0_cpu_sleep) > * re-enable clock switching before servicing interrupts. > */ > > - mrs r3, cpsr_all /* > 6 */ > + mrs r3, cpsr /* > 6 */ > orr r2, r3, #(I32_bit|F32_bit) /* > 7 */ > - msr cpsr_all, r2 /* > 8 */ > + msr cpsr_fsxc, r2 /* > 8 */ > > /* We're now 32-byte aligned */ > > @@ -93,7 +93,7 @@ ENTRY(sa11x0_cpu_sleep) > mcr p15, 0, r0, c15, c1, 2 /* re-enable clock switching */ > > /* Restore interrupts (which will cause them to be serviced). */ > - msr cpsr_all, r3 > + msr cpsr_fsxc, r3 > RET > END(sa11x0_cpu_sleep) > > > Modified: head/sys/arm/arm/cpufunc_asm_xscale.S > > ============================================================================== > --- head/sys/arm/arm/cpufunc_asm_xscale.S Sun Feb 2 00:34:32 2014 > (r261392) > +++ head/sys/arm/arm/cpufunc_asm_xscale.S Sun Feb 2 00:48:15 2014 > (r261393) > @@ -134,9 +134,9 @@ END(xscale_control) > */ > ENTRY(xscale_setttb) > #ifdef CACHE_CLEAN_BLOCK_INTR > - mrs r3, cpsr_all > + mrs r3, cpsr > orr r1, r3, #(I32_bit | F32_bit) > - msr cpsr_all, r1 > + msr cpsr_fsxc, r1 > #else > ldr r3, .Lblock_userspace_access > ldr r2, [r3] > @@ -164,7 +164,7 @@ ENTRY(xscale_setttb) > CPWAIT(r0) > > #ifdef CACHE_CLEAN_BLOCK_INTR > - msr cpsr_all, r3 > + msr cpsr_fsxc, r3 > #else > str r2, [r3] > #endif > @@ -266,12 +266,12 @@ _C_LABEL(xscale_minidata_clean_size): > > #ifdef CACHE_CLEAN_BLOCK_INTR > #define XSCALE_CACHE_CLEAN_BLOCK > \ > - mrs r3, cpsr_all ; \ > + mrs r3, cpsr ; \ > orr r0, r3, #(I32_bit | F32_bit) ; \ > - msr cpsr_all, r0 > + msr cpsr_fsxc, r0 > > #define XSCALE_CACHE_CLEAN_UNBLOCK > \ > - msr cpsr_all, r3 > + msr cpsr_fsxc, r3 > #else > #define XSCALE_CACHE_CLEAN_BLOCK > \ > ldr r3, .Lblock_userspace_access ; \ > > Modified: head/sys/arm/arm/cpufunc_asm_xscale_c3.S > > ============================================================================== > --- head/sys/arm/arm/cpufunc_asm_xscale_c3.S Sun Feb 2 00:34:32 2014 > (r261392) > +++ head/sys/arm/arm/cpufunc_asm_xscale_c3.S Sun Feb 2 00:48:15 2014 > (r261393) > @@ -121,12 +121,12 @@ __FBSDID("$FreeBSD$"); > #ifdef CACHE_CLEAN_BLOCK_INTR > #define XSCALE_CACHE_CLEAN_BLOCK > \ > stmfd sp!, {r4} ; \ > - mrs r4, cpsr_all ; \ > + mrs r4, cpsr ; \ > orr r0, r4, #(I32_bit | F32_bit) ; \ > - msr cpsr_all, r0 > + msr cpsr_fsxc, r0 > > #define XSCALE_CACHE_CLEAN_UNBLOCK > \ > - msr cpsr_all, r4 ; \ > + msr cpsr_fsxc, r4 ; \ > ldmfd sp!, {r4} > #else > #define XSCALE_CACHE_CLEAN_BLOCK > \ > @@ -348,9 +348,9 @@ END(xscalec3_l2cache_flush_rng) > */ > ENTRY(xscalec3_setttb) > #ifdef CACHE_CLEAN_BLOCK_INTR > - mrs r3, cpsr_all > + mrs r3, cpsr > orr r1, r3, #(I32_bit | F32_bit) > - msr cpsr_all, r1 > + msr cpsr_fsxc, r1 > #else > ldr r3, .Lblock_userspace_access > ldr r2, [r3] > @@ -378,7 +378,7 @@ ENTRY(xscalec3_setttb) > CPWAIT(r0) > > #ifdef CACHE_CLEAN_BLOCK_INTR > - msr cpsr_all, r3 > + msr cpsr_fsxc, r3 > #else > str r2, [r3] > #endif > > Modified: head/sys/arm/arm/exception.S > > ============================================================================== > --- head/sys/arm/arm/exception.S Sun Feb 2 00:34:32 2014 > (r261392) > +++ head/sys/arm/arm/exception.S Sun Feb 2 00:48:15 2014 > (r261393) > @@ -173,8 +173,8 @@ END(data_abort_entry) > * it like a Data Abort. > */ > ASENTRY_NP(address_exception_entry) > - mrs r1, cpsr_all > - mrs r2, spsr_all > + mrs r1, cpsr > + mrs r2, spsr > mov r3, lr > adr r0, Laddress_exception_msg > bl _C_LABEL(printf) /* XXX CLOBBERS LR!! */ > > Modified: head/sys/arm/arm/fiq_subr.S > > ============================================================================== > --- head/sys/arm/arm/fiq_subr.S Sun Feb 2 00:34:32 2014 (r261392) > +++ head/sys/arm/arm/fiq_subr.S Sun Feb 2 00:48:15 2014 (r261393) > @@ -52,14 +52,14 @@ __FBSDID("$FreeBSD$"); > #endif > > #define SWITCH_TO_FIQ_MODE > \ > - mrs r2, cpsr_all ; \ > + mrs r2, cpsr ; \ > mov r3, r2 ; \ > bic r2, r2, #(PSR_MODE) ; \ > orr r2, r2, #(PSR_FIQ32_MODE) ; \ > - msr cpsr_all, r2 > + msr cpsr_fsxc, r2 > > #define BACK_TO_SVC_MODE > \ > - msr cpsr_all, r3 > + msr cpsr_fsxc, r3 > > /* > * fiq_getregs: > > Modified: head/sys/arm/arm/locore.S > > ============================================================================== > --- head/sys/arm/arm/locore.S Sun Feb 2 00:34:32 2014 (r261392) > +++ head/sys/arm/arm/locore.S Sun Feb 2 00:48:15 2014 (r261393) > @@ -333,10 +333,10 @@ ASENTRY_NP(mptramp) > > AP_DEBUG(#1) > > - mrs r3, cpsr_all > + mrs r3, cpsr > bic r3, r3, #(PSR_MODE) > orr r3, r3, #(PSR_SVC32_MODE) > - msr cpsr_all, r3 > + msr cpsr_fsxc, r3 > > mrc p15, 0, r0, c0, c0, 5 > and r0, #0x0f /* Get CPU ID */ > @@ -446,7 +446,7 @@ ENTRY_NP(cpu_halt) > bic r2, r2, #(PSR_MODE) > orr r2, r2, #(PSR_SVC32_MODE) > orr r2, r2, #(I32_bit | F32_bit) > - msr cpsr_all, r2 > + msr cpsr_fsxc, r2 > > ldr r4, .Lcpu_reset_address > ldr r4, [r4] > > Modified: head/sys/arm/arm/setcpsr.S > > ============================================================================== > --- head/sys/arm/arm/setcpsr.S Sun Feb 2 00:34:32 2014 (r261392) > +++ head/sys/arm/arm/setcpsr.S Sun Feb 2 00:48:15 2014 (r261393) > @@ -61,7 +61,7 @@ ENTRY_NP(SetCPSR) > mrs r3, cpsr /* Set the CPSR */ > bic r2, r3, r0 > eor r2, r2, r1 > - msr cpsr_all, r2 > + msr cpsr_fsxc, r2 > > mov r0, r3 /* Return the old CPSR */ > > > Modified: head/sys/arm/arm/setstack.s > > ============================================================================== > --- head/sys/arm/arm/setstack.s Sun Feb 2 00:34:32 2014 (r261392) > +++ head/sys/arm/arm/setstack.s Sun Feb 2 00:48:15 2014 (r261393) > @@ -61,14 +61,14 @@ __FBSDID("$FreeBSD$"); > */ > > ENTRY(set_stackptr) > - mrs r3, cpsr_all /* Switch to the appropriate mode > */ > + mrs r3, cpsr /* Switch to the appropriate mode > */ > bic r2, r3, #(PSR_MODE) > orr r2, r2, r0 > - msr cpsr_all, r2 > + msr cpsr_fsxc, r2 > > mov sp, r1 /* Set the stack pointer */ > > - msr cpsr_all, r3 /* Restore the old mode */ > + msr cpsr_fsxc, r3 /* Restore the old mode */ > > mov pc, lr /* Exit */ > > @@ -80,14 +80,14 @@ ENTRY(set_stackptr) > */ > > ENTRY(get_stackptr) > - mrs r3, cpsr_all /* Switch to the appropriate mode > */ > + mrs r3, cpsr /* Switch to the appropriate mode > */ > bic r2, r3, #(PSR_MODE) > orr r2, r2, r0 > - msr cpsr_all, r2 > + msr cpsr_fsxc, r2 > > mov r0, sp /* Set the stack pointer */ > > - msr cpsr_all, r3 /* Restore the old mode */ > + msr cpsr_fsxc, r3 /* Restore the old mode */ > > mov pc, lr /* Exit */ > > > Modified: head/sys/arm/include/asmacros.h > > ============================================================================== > --- head/sys/arm/include/asmacros.h Sun Feb 2 00:34:32 2014 > (r261392) > +++ head/sys/arm/include/asmacros.h Sun Feb 2 00:48:15 2014 > (r261393) > @@ -70,7 +70,7 @@ > add r0, sp, #(4*13); /* Adjust the stack pointer */ > \ > stmia r0, {r13-r14}^; /* Push the user mode registers */ > \ > mov r0, r0; /* NOP for previous instruction > */ \ > - mrs r0, spsr_all; /* Put the SPSR on the stack */ > \ > + mrs r0, spsr; /* Put the SPSR on the stack */ > \ > str r0, [sp, #-4]!; > \ > ldr r0, =ARM_RAS_START; > \ > mov r1, #0; > \ > @@ -86,7 +86,7 @@ > add r0, sp, #(4*13); /* Adjust the stack pointer */ > \ > stmia r0, {r13-r14}^; /* Push the user mode registers */ > \ > mov r0, r0; /* NOP for previous instruction > */ \ > - mrs r0, spsr_all; /* Put the SPSR on the stack */ > \ > + mrs r0, spsr; /* Put the SPSR on the stack */ > \ > str r0, [sp, #-4]!; > #endif > > @@ -98,7 +98,7 @@ > #ifdef ARM_TP_ADDRESS > #define PULLFRAME > \ > ldr r0, [sp], #0x0004; /* Get the SPSR from stack */ > \ > - msr spsr_all, r0; > \ > + msr spsr_fsxc, r0; > \ > ldmia sp, {r0-r14}^; /* Restore registers (usr mode) */ > \ > mov r0, r0; /* NOP for previous instruction > */ \ > add sp, sp, #(4*17); /* Adjust the stack pointer */ > \ > @@ -107,7 +107,7 @@ > #else > #define PULLFRAME > \ > ldr r0, [sp], #0x0004; /* Get the SPSR from stack */ > \ > - msr spsr_all, r0; > \ > + msr spsr_fsxc, r0; > \ > clrex; > \ > ldmia sp, {r0-r14}^; /* Restore registers (usr mode) */ > \ > mov r0, r0; /* NOP for previous instruction > */ \ > @@ -142,7 +142,7 @@ > str r0, [sp, #-4]!; /* Push return address */ > \ > str lr, [sp, #-4]!; /* Push SVC lr */ > \ > str r2, [sp, #-4]!; /* Push SVC sp */ > \ > - msr spsr_all, r3; /* Restore correct spsr */ > \ > + msr spsr_fsxc, r3; /* Restore correct spsr */ > \ > ldmdb r1, {r0-r3}; /* Restore 4 regs from xxx mode */ > \ > sub sp, sp, #(4*15); /* Adjust the stack pointer */ > \ > stmia sp, {r0-r12}; /* Push the user mode registers */ > \ > @@ -161,7 +161,7 @@ > ldrne r1, [r0, #16]; /* adjust the saved PC so that */ > \ > cmpne r4, r1; /* execution later resumes at */ > \ > strhi r3, [r0, #16]; /* the RAS_START location. */ > \ > - mrs r0, spsr_all; > \ > + mrs r0, spsr; \ > str r0, [sp, #-4]! > #else > #define PUSHFRAMEINSVC > \ > @@ -179,14 +179,14 @@ > str r0, [sp, #-4]!; /* Push return address */ > \ > str lr, [sp, #-4]!; /* Push SVC lr */ > \ > str r2, [sp, #-4]!; /* Push SVC sp */ > \ > - msr spsr_all, r3; /* Restore correct spsr */ > \ > + msr spsr_fsxc, r3; /* Restore correct spsr */ > \ > ldmdb r1, {r0-r3}; /* Restore 4 regs from xxx mode */ > \ > sub sp, sp, #(4*15); /* Adjust the stack pointer */ > \ > stmia sp, {r0-r12}; /* Push the user mode registers */ > \ > add r0, sp, #(4*13); /* Adjust the stack pointer */ > \ > stmia r0, {r13-r14}^; /* Push the user mode registers */ > \ > mov r0, r0; /* NOP for previous instruction > */ \ > - mrs r0, spsr_all; /* Put the SPSR on the stack */ > \ > + mrs r0, spsr; /* Put the SPSR on the stack */ > \ > str r0, [sp, #-4]! > #endif > > @@ -200,7 +200,7 @@ > #ifdef ARM_TP_ADDRESS > #define PULLFRAMEFROMSVCANDEXIT > \ > ldr r0, [sp], #0x0004; /* Get the SPSR from stack */ > \ > - msr spsr_all, r0; /* restore SPSR */ > \ > + msr spsr_fsxc, r0; /* restore SPSR */ > \ > ldmia sp, {r0-r14}^; /* Restore registers (usr mode) */ > \ > mov r0, r0; /* NOP for previous > instruction */ \ > add sp, sp, #(4*15); /* Adjust the stack pointer */ > \ > @@ -208,7 +208,7 @@ > #else > #define PULLFRAMEFROMSVCANDEXIT > \ > ldr r0, [sp], #0x0004; /* Get the SPSR from stack */ > \ > - msr spsr_all, r0; /* restore SPSR */ > \ > + msr spsr_fsxc, r0; /* restore SPSR */ > \ > clrex; > \ > ldmia sp, {r0-r14}^; /* Restore registers (usr mode) */ > \ > mov r0, r0; /* NOP for previous > instruction */ \ > > Modified: head/sys/arm/include/atomic.h > > ============================================================================== > --- head/sys/arm/include/atomic.h Sun Feb 2 00:34:32 2014 > (r261392) > +++ head/sys/arm/include/atomic.h Sun Feb 2 00:48:15 2014 > (r261393) > @@ -450,13 +450,13 @@ atomic_store_rel_long(volatile u_long *p > __asm __volatile( \ > "mrs %0, cpsr;" \ > "orr %1, %0, %2;" \ > - "msr cpsr_all, %1;" \ > + "msr cpsr_fsxc, %1;" \ > : "=r" (cpsr_save), "=r" (tmp) \ > : "I" (I32_bit | F32_bit) \ > : "cc" ); \ > (expr); \ > __asm __volatile( \ > - "msr cpsr_all, %0" \ > + "msr cpsr_fsxc, %0" \ > : /* no output */ \ > : "r" (cpsr_save) \ > : "cc" ); \ > From owner-svn-src-head@FreeBSD.ORG Sun Feb 2 05:15:37 2014 Return-Path: Delivered-To: svn-src-head@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 7901832F; Sun, 2 Feb 2014 05:15:37 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5DAB81D7B; Sun, 2 Feb 2014 05:15:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s125FbGL061753; Sun, 2 Feb 2014 05:15:37 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s125Fbxn061750; Sun, 2 Feb 2014 05:15:37 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201402020515.s125Fbxn061750@svn.freebsd.org> From: Bryan Venteicher Date: Sun, 2 Feb 2014 05:15:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261394 - head/sys/dev/virtio/network X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2014 05:15:37 -0000 Author: bryanv Date: Sun Feb 2 05:15:36 2014 New Revision: 261394 URL: http://svnweb.freebsd.org/changeset/base/261394 Log: Do not place the sglist used for Rx/Tx on the stack The sglist segment array has grown to a bit over 512 bytes (on 64-bit system) which is more than ideally should be put on the stack. Instead allocate an appropriately sized sglist and hang it off each Rx/Tx queue structure. Bump the maximum number of Tx segments to 64 to make it unlikely we'll have defragment an mbuf chain. Our previous count was rounded up to this value since it is the next power of two, so effective memory usage should not change. Also only allocate the maximum number of Tx segments if TSO was negotiated. Modified: head/sys/dev/virtio/network/if_vtnet.c head/sys/dev/virtio/network/if_vtnetvar.h Modified: head/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- head/sys/dev/virtio/network/if_vtnet.c Sun Feb 2 00:48:15 2014 (r261393) +++ head/sys/dev/virtio/network/if_vtnet.c Sun Feb 2 05:15:36 2014 (r261394) @@ -609,6 +609,20 @@ vtnet_setup_features(struct vtnet_softc } else sc->vtnet_hdr_size = sizeof(struct virtio_net_hdr); + if (sc->vtnet_flags & VTNET_FLAG_MRG_RXBUFS) + sc->vtnet_rx_nsegs = VTNET_MRG_RX_SEGS; + else if (sc->vtnet_flags & VTNET_FLAG_LRO_NOMRG) + sc->vtnet_rx_nsegs = VTNET_MAX_RX_SEGS; + else + sc->vtnet_rx_nsegs = VTNET_MIN_RX_SEGS; + + if (virtio_with_feature(dev, VIRTIO_NET_F_GSO) || + virtio_with_feature(dev, VIRTIO_NET_F_HOST_TSO4) || + virtio_with_feature(dev, VIRTIO_NET_F_HOST_TSO6)) + sc->vtnet_tx_nsegs = VTNET_MAX_TX_SEGS; + else + sc->vtnet_tx_nsegs = VTNET_MIN_TX_SEGS; + if (virtio_with_feature(dev, VIRTIO_NET_F_CTRL_VQ)) { sc->vtnet_flags |= VTNET_FLAG_CTRL_VQ; @@ -664,6 +678,10 @@ vtnet_init_rxq(struct vtnet_softc *sc, i rxq->vtnrx_sc = sc; rxq->vtnrx_id = id; + rxq->vtnrx_sg = sglist_alloc(sc->vtnet_rx_nsegs, M_NOWAIT); + if (rxq->vtnrx_sg == NULL) + return (ENOMEM); + TASK_INIT(&rxq->vtnrx_intrtask, 0, vtnet_rxq_tq_intr, rxq); rxq->vtnrx_tq = taskqueue_create(rxq->vtnrx_name, M_NOWAIT, taskqueue_thread_enqueue, &rxq->vtnrx_tq); @@ -685,6 +703,10 @@ vtnet_init_txq(struct vtnet_softc *sc, i txq->vtntx_sc = sc; txq->vtntx_id = id; + txq->vtntx_sg = sglist_alloc(sc->vtnet_tx_nsegs, M_NOWAIT); + if (txq->vtntx_sg == NULL) + return (ENOMEM); + #ifndef VTNET_LEGACY_TX txq->vtntx_br = buf_ring_alloc(VTNET_DEFAULT_BUFRING_SIZE, M_DEVBUF, M_NOWAIT, &txq->vtntx_mtx); @@ -737,6 +759,11 @@ vtnet_destroy_rxq(struct vtnet_rxq *rxq) rxq->vtnrx_sc = NULL; rxq->vtnrx_id = -1; + if (rxq->vtnrx_sg != NULL) { + sglist_free(rxq->vtnrx_sg); + rxq->vtnrx_sg = NULL; + } + if (mtx_initialized(&rxq->vtnrx_mtx) != 0) mtx_destroy(&rxq->vtnrx_mtx); } @@ -748,6 +775,11 @@ vtnet_destroy_txq(struct vtnet_txq *txq) txq->vtntx_sc = NULL; txq->vtntx_id = -1; + if (txq->vtntx_sg != NULL) { + sglist_free(txq->vtntx_sg); + txq->vtntx_sg = NULL; + } + #ifndef VTNET_LEGACY_TX if (txq->vtntx_br != NULL) { buf_ring_free(txq->vtntx_br, M_DEVBUF); @@ -822,24 +854,11 @@ vtnet_alloc_virtqueues(struct vtnet_soft struct vq_alloc_info *info; struct vtnet_rxq *rxq; struct vtnet_txq *txq; - int i, idx, flags, nvqs, rxsegs, error; + int i, idx, flags, nvqs, error; dev = sc->vtnet_dev; flags = 0; - /* - * Indirect descriptors are not needed for the Rx virtqueue when - * mergeable buffers are negotiated. The header is placed inline - * with the data, not in a separate descriptor, and mbuf clusters - * are always physically contiguous. - */ - if (sc->vtnet_flags & VTNET_FLAG_MRG_RXBUFS) - rxsegs = 0; - else if (sc->vtnet_flags & VTNET_FLAG_LRO_NOMRG) - rxsegs = VTNET_MAX_RX_SEGS; - else - rxsegs = VTNET_MIN_RX_SEGS; - nvqs = sc->vtnet_max_vq_pairs * 2; if (sc->vtnet_flags & VTNET_FLAG_CTRL_VQ) nvqs++; @@ -850,12 +869,12 @@ vtnet_alloc_virtqueues(struct vtnet_soft for (i = 0, idx = 0; i < sc->vtnet_max_vq_pairs; i++, idx+=2) { rxq = &sc->vtnet_rxqs[i]; - VQ_ALLOC_INFO_INIT(&info[idx], rxsegs, + VQ_ALLOC_INFO_INIT(&info[idx], sc->vtnet_rx_nsegs, vtnet_rx_vq_intr, rxq, &rxq->vtnrx_vq, "%s-%d rx", device_get_nameunit(dev), rxq->vtnrx_id); txq = &sc->vtnet_txqs[i]; - VQ_ALLOC_INFO_INIT(&info[idx+1], VTNET_MAX_TX_SEGS, + VQ_ALLOC_INFO_INIT(&info[idx+1], sc->vtnet_tx_nsegs, vtnet_tx_vq_intr, txq, &txq->vtntx_vq, "%s-%d tx", device_get_nameunit(dev), txq->vtntx_id); } @@ -1362,14 +1381,14 @@ vtnet_rxq_replace_buf(struct vtnet_rxq * static int vtnet_rxq_enqueue_buf(struct vtnet_rxq *rxq, struct mbuf *m) { - struct sglist sg; - struct sglist_seg segs[VTNET_MAX_RX_SEGS]; struct vtnet_softc *sc; + struct sglist *sg; struct vtnet_rx_header *rxhdr; uint8_t *mdata; int offset, error; sc = rxq->vtnrx_sc; + sg = rxq->vtnrx_sg; mdata = mtod(m, uint8_t *); VTNET_RXQ_LOCK_ASSERT(rxq); @@ -1379,22 +1398,22 @@ vtnet_rxq_enqueue_buf(struct vtnet_rxq * ("%s: unexpected cluster size %d/%d", __func__, m->m_len, sc->vtnet_rx_clsize)); - sglist_init(&sg, VTNET_MAX_RX_SEGS, segs); + sglist_reset(sg); if ((sc->vtnet_flags & VTNET_FLAG_MRG_RXBUFS) == 0) { MPASS(sc->vtnet_hdr_size == sizeof(struct virtio_net_hdr)); rxhdr = (struct vtnet_rx_header *) mdata; - sglist_append(&sg, &rxhdr->vrh_hdr, sc->vtnet_hdr_size); + sglist_append(sg, &rxhdr->vrh_hdr, sc->vtnet_hdr_size); offset = sizeof(struct vtnet_rx_header); } else offset = 0; - sglist_append(&sg, mdata + offset, m->m_len - offset); + sglist_append(sg, mdata + offset, m->m_len - offset); if (m->m_next != NULL) { - error = sglist_append_mbuf(&sg, m->m_next); + error = sglist_append_mbuf(sg, m->m_next); MPASS(error == 0); } - error = virtqueue_enqueue(rxq->vtnrx_vq, m, &sg, 0, sg.sg_nseg); + error = virtqueue_enqueue(rxq->vtnrx_vq, m, sg, 0, sg->sg_nseg); return (error); } @@ -2048,30 +2067,30 @@ static int vtnet_txq_enqueue_buf(struct vtnet_txq *txq, struct mbuf **m_head, struct vtnet_tx_header *txhdr) { - struct sglist sg; - struct sglist_seg segs[VTNET_MAX_TX_SEGS]; struct vtnet_softc *sc; struct virtqueue *vq; + struct sglist *sg; struct mbuf *m; int collapsed, error; - vq = txq->vtntx_vq; sc = txq->vtntx_sc; + vq = txq->vtntx_vq; + sg = txq->vtntx_sg; m = *m_head; collapsed = 0; - sglist_init(&sg, VTNET_MAX_TX_SEGS, segs); - error = sglist_append(&sg, &txhdr->vth_uhdr, sc->vtnet_hdr_size); - KASSERT(error == 0 && sg.sg_nseg == 1, + sglist_reset(sg); + error = sglist_append(sg, &txhdr->vth_uhdr, sc->vtnet_hdr_size); + KASSERT(error == 0 && sg->sg_nseg == 1, ("%s: error %d adding header to sglist", __func__, error)); again: - error = sglist_append_mbuf(&sg, m); + error = sglist_append_mbuf(sg, m); if (error) { if (collapsed) goto fail; - m = m_collapse(m, M_NOWAIT, VTNET_MAX_TX_SEGS - 1); + m = m_collapse(m, M_NOWAIT, sc->vtnet_tx_nsegs - 1); if (m == NULL) goto fail; @@ -2082,7 +2101,7 @@ again: } txhdr->vth_mbuf = m; - error = virtqueue_enqueue(vq, txhdr, &sg, sg.sg_nseg, 0); + error = virtqueue_enqueue(vq, txhdr, sg, sg->sg_nseg, 0); return (error); @@ -2849,9 +2868,10 @@ vtnet_init_rx_queues(struct vtnet_softc sc->vtnet_rx_clsize = clsize; sc->vtnet_rx_nmbufs = VTNET_NEEDED_RX_MBUFS(sc, clsize); - /* The first segment is reserved for the header. */ - KASSERT(sc->vtnet_rx_nmbufs < VTNET_MAX_RX_SEGS, - ("%s: too many rx mbufs %d", __func__, sc->vtnet_rx_nmbufs)); + KASSERT(sc->vtnet_flags & VTNET_FLAG_MRG_RXBUFS || + sc->vtnet_rx_nmbufs < sc->vtnet_rx_nsegs, + ("%s: too many rx mbufs %d for %d segments", __func__, + sc->vtnet_rx_nmbufs, sc->vtnet_rx_nsegs)); for (i = 0; i < sc->vtnet_act_vq_pairs; i++) { rxq = &sc->vtnet_rxqs[i]; Modified: head/sys/dev/virtio/network/if_vtnetvar.h ============================================================================== --- head/sys/dev/virtio/network/if_vtnetvar.h Sun Feb 2 00:48:15 2014 (r261393) +++ head/sys/dev/virtio/network/if_vtnetvar.h Sun Feb 2 05:15:36 2014 (r261394) @@ -70,6 +70,7 @@ struct vtnet_rxq { struct mtx vtnrx_mtx; struct vtnet_softc *vtnrx_sc; struct virtqueue *vtnrx_vq; + struct sglist *vtnrx_sg; int vtnrx_id; int vtnrx_process_limit; struct vtnet_rxq_stats vtnrx_stats; @@ -99,6 +100,7 @@ struct vtnet_txq { struct mtx vtntx_mtx; struct vtnet_softc *vtntx_sc; struct virtqueue *vtntx_vq; + struct sglist *vtntx_sg; #ifndef VTNET_LEGACY_TX struct buf_ring *vtntx_br; #endif @@ -143,9 +145,11 @@ struct vtnet_softc { int vtnet_link_active; int vtnet_hdr_size; int vtnet_rx_process_limit; + int vtnet_rx_nsegs; int vtnet_rx_nmbufs; int vtnet_rx_clsize; int vtnet_rx_new_clsize; + int vtnet_tx_nsegs; int vtnet_if_flags; int vtnet_act_vq_pairs; int vtnet_max_vq_pairs; @@ -293,11 +297,14 @@ CTASSERT(sizeof(struct vtnet_mac_filter) /* * Used to preallocate the Vq indirect descriptors. The first segment - * is reserved for the header. + * is reserved for the header, except for mergeable buffers since the + * header is placed inline with the data. */ +#define VTNET_MRG_RX_SEGS 1 #define VTNET_MIN_RX_SEGS 2 #define VTNET_MAX_RX_SEGS 34 -#define VTNET_MAX_TX_SEGS 34 +#define VTNET_MIN_TX_SEGS 4 +#define VTNET_MAX_TX_SEGS 64 /* * Assert we can receive and transmit the maximum with regular @@ -314,7 +321,7 @@ CTASSERT(((VTNET_MAX_TX_SEGS - 1) * MCLB /* * Determine how many mbufs are in each receive buffer. For LRO without - * mergeable descriptors, we must allocate an mbuf chain large enough to + * mergeable buffers, we must allocate an mbuf chain large enough to * hold both the vtnet_rx_header and the maximum receivable data. */ #define VTNET_NEEDED_RX_MBUFS(_sc, _clsize) \ From owner-svn-src-head@FreeBSD.ORG Sun Feb 2 05:20:47 2014 Return-Path: Delivered-To: svn-src-head@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 3D729475; Sun, 2 Feb 2014 05:20:47 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 289361D84; Sun, 2 Feb 2014 05:20:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s125KlkV064679; Sun, 2 Feb 2014 05:20:47 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s125Kklc064677; Sun, 2 Feb 2014 05:20:46 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201402020520.s125Kklc064677@svn.freebsd.org> From: Bryan Venteicher Date: Sun, 2 Feb 2014 05:20:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261395 - head/sys/dev/virtio/network X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2014 05:20:47 -0000 Author: bryanv Date: Sun Feb 2 05:20:46 2014 New Revision: 261395 URL: http://svnweb.freebsd.org/changeset/base/261395 Log: Use m_defrag() instead of m_collapse() to compact a long mbuf chain This should be an infrequent occurrence, so remove the per-queue counters in favor of just global counters in the softc. Modified: head/sys/dev/virtio/network/if_vtnet.c head/sys/dev/virtio/network/if_vtnetvar.h Modified: head/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- head/sys/dev/virtio/network/if_vtnet.c Sun Feb 2 05:15:36 2014 (r261394) +++ head/sys/dev/virtio/network/if_vtnet.c Sun Feb 2 05:20:46 2014 (r261395) @@ -2071,33 +2071,30 @@ vtnet_txq_enqueue_buf(struct vtnet_txq * struct virtqueue *vq; struct sglist *sg; struct mbuf *m; - int collapsed, error; + int error; sc = txq->vtntx_sc; vq = txq->vtntx_vq; sg = txq->vtntx_sg; m = *m_head; - collapsed = 0; sglist_reset(sg); error = sglist_append(sg, &txhdr->vth_uhdr, sc->vtnet_hdr_size); KASSERT(error == 0 && sg->sg_nseg == 1, ("%s: error %d adding header to sglist", __func__, error)); -again: error = sglist_append_mbuf(sg, m); if (error) { - if (collapsed) - goto fail; - - m = m_collapse(m, M_NOWAIT, sc->vtnet_tx_nsegs - 1); + m = m_defrag(m, M_NOWAIT); if (m == NULL) goto fail; *m_head = m; - collapsed = 1; - txq->vtntx_stats.vtxs_collapsed++; - goto again; + sc->vtnet_stats.tx_defragged++; + + error = sglist_append_mbuf(sg, m); + if (error) + goto fail; } txhdr->vth_mbuf = m; @@ -2106,6 +2103,7 @@ again: return (error); fail: + sc->vtnet_stats.tx_defrag_failed++; m_freem(*m_head); *m_head = NULL; @@ -2550,7 +2548,6 @@ vtnet_txq_accum_stats(struct vtnet_txq * accum->vtxs_obytes += st->vtxs_obytes; accum->vtxs_csum += st->vtxs_csum; accum->vtxs_tso += st->vtxs_tso; - accum->vtxs_collapsed += st->vtxs_collapsed; accum->vtxs_rescheduled += st->vtxs_rescheduled; } @@ -3631,8 +3628,6 @@ vtnet_setup_txq_sysctl(struct sysctl_ctx &stats->vtxs_csum, "Transmit checksum offloaded"); SYSCTL_ADD_UQUAD(ctx, list, OID_AUTO, "tso", CTLFLAG_RD, &stats->vtxs_tso, "Transmit segmentation offloaded"); - SYSCTL_ADD_UQUAD(ctx, list, OID_AUTO, "collapsed", CTLFLAG_RD, - &stats->vtxs_collapsed, "Transmit mbufs collapsed"); SYSCTL_ADD_UQUAD(ctx, list, OID_AUTO, "rescheduled", CTLFLAG_RD, &stats->vtxs_rescheduled, "Transmit interrupt handler rescheduled"); @@ -3712,6 +3707,12 @@ vtnet_setup_stat_sysctl(struct sysctl_ct SYSCTL_ADD_UQUAD(ctx, child, OID_AUTO, "tx_tso_not_tcp", CTLFLAG_RD, &stats->tx_tso_not_tcp, "Aborted transmit of TSO buffer with non TCP protocol"); + SYSCTL_ADD_UQUAD(ctx, child, OID_AUTO, "tx_defragged", + CTLFLAG_RD, &stats->tx_defragged, + "Transmit mbufs defragged"); + SYSCTL_ADD_UQUAD(ctx, child, OID_AUTO, "tx_defrag_failed", + CTLFLAG_RD, &stats->tx_defrag_failed, + "Aborted transmit of buffer because defrag failed"); SYSCTL_ADD_UQUAD(ctx, child, OID_AUTO, "tx_csum_offloaded", CTLFLAG_RD, &stats->tx_csum_offloaded, "Offloaded checksum of transmitted buffer"); Modified: head/sys/dev/virtio/network/if_vtnetvar.h ============================================================================== --- head/sys/dev/virtio/network/if_vtnetvar.h Sun Feb 2 05:15:36 2014 (r261394) +++ head/sys/dev/virtio/network/if_vtnetvar.h Sun Feb 2 05:20:46 2014 (r261395) @@ -44,6 +44,8 @@ struct vtnet_statistics { uint64_t tx_csum_bad_ethtype; uint64_t tx_tso_bad_ethtype; uint64_t tx_tso_not_tcp; + uint64_t tx_defragged; + uint64_t tx_defrag_failed; /* * These are accumulated from each Rx/Tx queue. @@ -92,7 +94,6 @@ struct vtnet_txq_stats { uint64_t vtxs_omcasts; /* if_omcasts */ uint64_t vtxs_csum; uint64_t vtxs_tso; - uint64_t vtxs_collapsed; uint64_t vtxs_rescheduled; }; From owner-svn-src-head@FreeBSD.ORG Sun Feb 2 05:21:13 2014 Return-Path: Delivered-To: svn-src-head@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 5E99E5AD; Sun, 2 Feb 2014 05:21:13 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4B2B01DDA; Sun, 2 Feb 2014 05:21:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s125LCOd065035; Sun, 2 Feb 2014 05:21:13 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s125LCr5065034; Sun, 2 Feb 2014 05:21:12 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201402020521.s125LCr5065034@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 2 Feb 2014 05:21:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261396 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2014 05:21:13 -0000 Author: nwhitehorn Date: Sun Feb 2 05:21:12 2014 New Revision: 261396 URL: http://svnweb.freebsd.org/changeset/base/261396 Log: Fix typo. Sorry for breakage! Modified: head/sys/arm/arm/nexus.c Modified: head/sys/arm/arm/nexus.c ============================================================================== --- head/sys/arm/arm/nexus.c Sun Feb 2 05:20:46 2014 (r261395) +++ head/sys/arm/arm/nexus.c Sun Feb 2 05:21:12 2014 (r261396) @@ -356,7 +356,7 @@ nexus_ofw_map_intr(device_t dev, device_ if (rv == 0) { /* This was recognized as our PIC and decoded. */ - interrupt = FDT_MAP_IRQ(intr_parent, intr[0]); + interrupt = FDT_MAP_IRQ(intr_parent, interrupt); return (interrupt); } } From owner-svn-src-head@FreeBSD.ORG Sun Feb 2 05:41:13 2014 Return-Path: Delivered-To: svn-src-head@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 38A3780A; Sun, 2 Feb 2014 05:41:13 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 24F731ED7; Sun, 2 Feb 2014 05:41:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s125fDYd070686; Sun, 2 Feb 2014 05:41:13 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s125fDZh070685; Sun, 2 Feb 2014 05:41:13 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201402020541.s125fDZh070685@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 2 Feb 2014 05:41:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261397 - head/sys/dev/fdt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2014 05:41:13 -0000 Author: nwhitehorn Date: Sun Feb 2 05:41:12 2014 New Revision: 261397 URL: http://svnweb.freebsd.org/changeset/base/261397 Log: Allow nesting of simplebuses. Modified: head/sys/dev/fdt/simplebus.c Modified: head/sys/dev/fdt/simplebus.c ============================================================================== --- head/sys/dev/fdt/simplebus.c Sun Feb 2 05:21:12 2014 (r261396) +++ head/sys/dev/fdt/simplebus.c Sun Feb 2 05:41:12 2014 (r261397) @@ -122,6 +122,7 @@ static driver_t simplebus_driver = { }; static devclass_t simplebus_devclass; DRIVER_MODULE(simplebus, nexus, simplebus_driver, simplebus_devclass, 0, 0); +DRIVER_MODULE(simplebus, simplebus, simplebus_driver, simplebus_devclass, 0, 0); static int simplebus_probe(device_t dev) From owner-svn-src-head@FreeBSD.ORG Sun Feb 2 05:52:35 2014 Return-Path: Delivered-To: svn-src-head@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 69083B07; Sun, 2 Feb 2014 05:52:35 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 542201F69; Sun, 2 Feb 2014 05:52:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s125qZQY075351; Sun, 2 Feb 2014 05:52:35 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s125qZ4t075350; Sun, 2 Feb 2014 05:52:35 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201402020552.s125qZ4t075350@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 2 Feb 2014 05:52:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261398 - head/sys/dev/fdt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2014 05:52:35 -0000 Author: nwhitehorn Date: Sun Feb 2 05:52:34 2014 New Revision: 261398 URL: http://svnweb.freebsd.org/changeset/base/261398 Log: Fix missing offset. Modified: head/sys/dev/fdt/fdt_common.c Modified: head/sys/dev/fdt/fdt_common.c ============================================================================== --- head/sys/dev/fdt/fdt_common.c Sun Feb 2 05:41:12 2014 (r261397) +++ head/sys/dev/fdt/fdt_common.c Sun Feb 2 05:52:34 2014 (r261398) @@ -501,7 +501,8 @@ fdt_intr_to_rl(device_t dev, phandle_t n icells = 1; } for (i = 0, k = 0; i < nintr; i += icells, k++) { - intr[i] = ofw_bus_map_intr(dev, iparent, icells, intr); + intr[i] = ofw_bus_map_intr(dev, iparent, icells, + &intr[i]); resource_list_add(rl, SYS_RES_IRQ, k, intr[i], intr[i], 1); } From owner-svn-src-head@FreeBSD.ORG Sun Feb 2 07:28:05 2014 Return-Path: Delivered-To: svn-src-head@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 80EC25F2; Sun, 2 Feb 2014 07:28:05 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6CBF81498; Sun, 2 Feb 2014 07:28:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s127S55u010211; Sun, 2 Feb 2014 07:28:05 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s127S575010210; Sun, 2 Feb 2014 07:28:05 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201402020728.s127S575010210@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sun, 2 Feb 2014 07:28:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261400 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2014 07:28:05 -0000 Author: ae Date: Sun Feb 2 07:28:04 2014 New Revision: 261400 URL: http://svnweb.freebsd.org/changeset/base/261400 Log: Take exclusive lock only when lle isn't NULL. We don't need write access to lle in most cases. MFC after: 1 week Sponsored by: Yandex LLC Modified: head/sys/netinet6/nd6.c Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Sun Feb 2 06:34:38 2014 (r261399) +++ head/sys/netinet6/nd6.c Sun Feb 2 07:28:04 2014 (r261400) @@ -1889,7 +1889,7 @@ nd6_output_lle(struct ifnet *ifp, struct * or an anycast address(i.e. not a multicast). */ - flags = ((m != NULL) || (lle != NULL)) ? LLE_EXCLUSIVE : 0; + flags = (lle != NULL) ? LLE_EXCLUSIVE : 0; if (ln == NULL) { retry: IF_AFDATA_RLOCK(ifp); From owner-svn-src-head@FreeBSD.ORG Sun Feb 2 13:24:45 2014 Return-Path: Delivered-To: svn-src-head@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 053A0DB3; Sun, 2 Feb 2014 13:24:45 +0000 (UTC) Received: from mailrelay009.isp.belgacom.be (mailrelay009.isp.belgacom.be [195.238.6.176]) by mx1.freebsd.org (Postfix) with ESMTP id B5F401CDB; Sun, 2 Feb 2014 13:24:43 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnQGAL1G7lJR8apO/2dsb2JhbABYgww4S71tgQAXdIIlAQEFOhwjEAsOBgQJGgsPKh4GiBwBCMwDF48JB4Q4BJgpgTOQb4FvgT87 Received: from 78.170-241-81.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([81.241.170.78]) by relay.skynet.be with ESMTP; 02 Feb 2014 14:24:24 +0100 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.7/8.14.7) with ESMTP id s12DONZt002008; Sun, 2 Feb 2014 14:24:23 +0100 (CET) (envelope-from tijl@FreeBSD.org) Date: Sun, 2 Feb 2014 14:24:23 +0100 From: Tijl Coosemans To: Baptiste Daroussin Subject: Re: svn commit: r261246 - in head: . cddl/contrib/opensolaris/tools/ctf/cvt contrib/elftoolchain lib/libdwarf lib/libelf sys/sys Message-ID: <20140202142423.1c9ba5a7@kalimero.tijl.coosemans.org> In-Reply-To: <20140201234405.GO54904@ithaqua.etoilebsd.net> References: <201401282138.s0SLcsVV085769@svn.freebsd.org> <20140201234405.GO54904@ithaqua.etoilebsd.net> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Kai Wang , garga@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2014 13:24:45 -0000 On Sun, 2 Feb 2014 00:44:05 +0100 Baptiste Daroussin wrote: > On Tue, Jan 28, 2014 at 09:38:54PM +0000, Kai Wang wrote: >> Author: kaiw >> Date: Tue Jan 28 21:38:54 2014 >> New Revision: 261246 >> URL: http://svnweb.freebsd.org/changeset/base/261246 >> >> Log: >> Merge from projects/elftoolchain: Upgrade libelf and libdwarf to newer >> versions from elftoolchain upstream (r2974). Convert ctfconvert to >> use the APIs from the new libdwarf and make ctfconvert work with Clang >> 3.4. >> >> __FreeBSD_version is bumped to 1100006. > > Thanks for this update, I just want to remind something to everyone, because it > happened a lot recently. > > Before breaking any ABI (SHLIB num bumped here in this case) all committers > should first talk to portmgr sync with them and then commit (and send a heasup > to portmgr saying the commit has been done) There also needs to be a compat10x port now and the other compat ports have to be updated. From owner-svn-src-head@FreeBSD.ORG Sun Feb 2 14:11:35 2014 Return-Path: Delivered-To: svn-src-head@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 5580BEBF; Sun, 2 Feb 2014 14:11:35 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 420BF1FBE; Sun, 2 Feb 2014 14:11:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s12EBZkJ071648; Sun, 2 Feb 2014 14:11:35 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s12EBZXW071647; Sun, 2 Feb 2014 14:11:35 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201402021411.s12EBZXW071647@svn.freebsd.org> From: Bryan Drewery Date: Sun, 2 Feb 2014 14:11:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261401 - head/usr.sbin/newsyslog X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2014 14:11:35 -0000 Author: bdrewery Date: Sun Feb 2 14:11:34 2014 New Revision: 261401 URL: http://svnweb.freebsd.org/changeset/base/261401 Log: Fix newsyslog(8) to use the size of the file instead of the blocks it takes on disk, as advertised in newsyslog.conf(5). This fixes newsyslog(8) on ZFS with compression enabled to not have large files compared to the expected rotation size. # grep remotes/messages /etc/newsyslog.conf /var/log/remote/messages root:info 640 5 500 * JC # ls -alh /var/log/remote/messages -rw-r----- 1 root info 3.2M Jan 31 20:02 /var/log/remote/messages # newsyslog -vN|grep remote/messages /var/log/remote/messages <5J>: size (Kb): 464 [500] --> skipping # stat -f "st_size: %z st_blocks: %b" /var/log/remote/messages st_size: 3372627 st_blocks: 928 # zfs get -H compressratio zroot/syslogs zroot/syslogs compressratio 3.77x - With fix: # newsyslog -v | grep remote/messages /var/log/remote/messages <5J>: size (Kb): 3338 [500] --> trimming log.... Approved by: bapt (mentor) PR: docs/150877 Reported by: Joshua Isom MFC after: 2 weeks Modified: head/usr.sbin/newsyslog/newsyslog.c Modified: head/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- head/usr.sbin/newsyslog/newsyslog.c Sun Feb 2 07:28:04 2014 (r261400) +++ head/usr.sbin/newsyslog/newsyslog.c Sun Feb 2 14:11:34 2014 (r261401) @@ -2284,7 +2284,7 @@ sizefile(const char *file) if (stat(file, &sb) < 0) return (-1); - return (kbytes(dbtob(sb.st_blocks))); + return (kbytes(sb.st_size)); } /* From owner-svn-src-head@FreeBSD.ORG Sun Feb 2 14:13:52 2014 Return-Path: Delivered-To: svn-src-head@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 8EB5FCF; Sun, 2 Feb 2014 14:13:52 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7B4731FCD; Sun, 2 Feb 2014 14:13:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s12EDqYd072006; Sun, 2 Feb 2014 14:13:52 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s12EDqFZ072005; Sun, 2 Feb 2014 14:13:52 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201402021413.s12EDqFZ072005@svn.freebsd.org> From: Bryan Drewery Date: Sun, 2 Feb 2014 14:13:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261402 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2014 14:13:52 -0000 Author: bdrewery Date: Sun Feb 2 14:13:51 2014 New Revision: 261402 URL: http://svnweb.freebsd.org/changeset/base/261402 Log: Add back reference to buf(9) removed in r32223 as buf(9) was added in r42016. Approved by: bapt (mentor) Modified: head/share/man/man9/VOP_STRATEGY.9 Modified: head/share/man/man9/VOP_STRATEGY.9 ============================================================================== --- head/share/man/man9/VOP_STRATEGY.9 Sun Feb 2 14:11:34 2014 (r261401) +++ head/share/man/man9/VOP_STRATEGY.9 Sun Feb 2 14:13:51 2014 (r261402) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 24, 1996 +.Dd February 2, 2014 .Dt VOP_STRATEGY 9 .Os .Sh NAME @@ -57,7 +57,7 @@ Always zero. Errors should be signalled by setting BIO_ERROR on b_ioflags field in struct buf, and setting b_error to the appropriate errno value. .Sh SEE ALSO -.\" .Xr buf 9 , +.Xr buf 9 , .Xr vnode 9 .Sh AUTHORS This manual page was written by From owner-svn-src-head@FreeBSD.ORG Sun Feb 2 16:41:55 2014 Return-Path: Delivered-To: svn-src-head@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 D180A184; Sun, 2 Feb 2014 16:41: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AD28E1A15; Sun, 2 Feb 2014 16:41:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s12Gft6d032800; Sun, 2 Feb 2014 16:41:55 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s12GftrY032796; Sun, 2 Feb 2014 16:41:55 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201402021641.s12GftrY032796@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 2 Feb 2014 16:41:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261403 - head/sys/dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2014 16:41:56 -0000 Author: nwhitehorn Date: Sun Feb 2 16:41:54 2014 New Revision: 261403 URL: http://svnweb.freebsd.org/changeset/base/261403 Log: Add a set of helpers (ofw_bus_get_status() and ofw_bus_status_okay()) to process "status" properties of OF nodes. I've avoided adding new KOBJ methods here so that we don't have to modify every ofw_bus in the tree. Since 100% of implementations of ofw_bus use only ofw_bus_gen_*(), it might be worth garbage-collecting the other methods as well. Modified: head/sys/dev/ofw/ofw_bus_if.m head/sys/dev/ofw/ofw_bus_subr.c head/sys/dev/ofw/ofw_bus_subr.h Modified: head/sys/dev/ofw/ofw_bus_if.m ============================================================================== --- head/sys/dev/ofw/ofw_bus_if.m Sun Feb 2 14:13:51 2014 (r261402) +++ head/sys/dev/ofw/ofw_bus_if.m Sun Feb 2 16:41:54 2014 (r261403) @@ -46,6 +46,7 @@ HEADER { char *obd_model; char *obd_name; char *obd_type; + char *obd_status; }; }; Modified: head/sys/dev/ofw/ofw_bus_subr.c ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.c Sun Feb 2 14:13:51 2014 (r261402) +++ head/sys/dev/ofw/ofw_bus_subr.c Sun Feb 2 16:41:54 2014 (r261403) @@ -55,6 +55,7 @@ ofw_bus_gen_setup_devinfo(struct ofw_bus OF_getprop_alloc(node, "compatible", 1, (void **)&obd->obd_compat); OF_getprop_alloc(node, "device_type", 1, (void **)&obd->obd_type); OF_getprop_alloc(node, "model", 1, (void **)&obd->obd_model); + OF_getprop_alloc(node, "status", 1, (void **)&obd->obd_status); obd->obd_node = node; return (0); } @@ -73,6 +74,8 @@ ofw_bus_gen_destroy_devinfo(struct ofw_b free(obd->obd_name, M_OFWPROP); if (obd->obd_type != NULL) free(obd->obd_type, M_OFWPROP); + if (obd->obd_status != NULL) + free(obd->obd_status, M_OFWPROP); } int @@ -147,6 +150,30 @@ ofw_bus_gen_get_type(device_t bus, devic return (obd->obd_type); } +const char * +ofw_bus_get_status(device_t dev) +{ + const struct ofw_bus_devinfo *obd; + + obd = OFW_BUS_GET_DEVINFO(device_get_parent(dev), dev); + if (obd == NULL) + return (NULL); + + return (obd->obd_status); +} + +int +ofw_bus_status_okay(device_t dev) +{ + const char *status; + + status = ofw_bus_get_status(dev); + if (status == NULL || strcmp(status, "okay") == 0) + return (1); + + return (0); +} + int ofw_bus_is_compatible(device_t dev, const char *onecompat) { Modified: head/sys/dev/ofw/ofw_bus_subr.h ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.h Sun Feb 2 14:13:51 2014 (r261402) +++ head/sys/dev/ofw/ofw_bus_subr.h Sun Feb 2 16:41:54 2014 (r261403) @@ -72,6 +72,10 @@ int ofw_bus_lookup_imap(phandle_t, struc int ofw_bus_search_intrmap(void *, int, void *, int, void *, int, void *, void *, void *, int, phandle_t *); +/* Helper to get device status property */ +const char *ofw_bus_get_status(device_t dev); +int ofw_bus_status_okay(device_t dev); + /* Helper to get node's interrupt parent */ void ofw_bus_find_iparent(phandle_t); From owner-svn-src-head@FreeBSD.ORG Sun Feb 2 16:42:27 2014 Return-Path: Delivered-To: svn-src-head@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 054EC2C2; Sun, 2 Feb 2014 16:42:27 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E54781A17; Sun, 2 Feb 2014 16:42:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s12GgQhA032924; Sun, 2 Feb 2014 16:42:26 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s12GgQHr032923; Sun, 2 Feb 2014 16:42:26 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201402021642.s12GgQHr032923@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 2 Feb 2014 16:42:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261404 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2014 16:42:27 -0000 Author: nwhitehorn Date: Sun Feb 2 16:42:26 2014 New Revision: 261404 URL: http://svnweb.freebsd.org/changeset/base/261404 Log: Fix one remnant endian flaw here. The back-and-forth endian conversions are confusing. Modified: head/sys/arm/arm/nexus.c Modified: head/sys/arm/arm/nexus.c ============================================================================== --- head/sys/arm/arm/nexus.c Sun Feb 2 16:41:54 2014 (r261403) +++ head/sys/arm/arm/nexus.c Sun Feb 2 16:42:26 2014 (r261404) @@ -362,7 +362,7 @@ nexus_ofw_map_intr(device_t dev, device_ } /* Not in table, so guess */ - interrupt = FDT_MAP_IRQ(intr_parent, intr[0]); + interrupt = FDT_MAP_IRQ(intr_parent, fdt32_to_cpu(intr[0])); return (interrupt); } From owner-svn-src-head@FreeBSD.ORG Sun Feb 2 16:56:41 2014 Return-Path: Delivered-To: svn-src-head@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 72718927; Sun, 2 Feb 2014 16:56:41 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5ABE51AEB; Sun, 2 Feb 2014 16:56:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s12GufLO037508; Sun, 2 Feb 2014 16:56:41 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s12GufkW037507; Sun, 2 Feb 2014 16:56:41 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201402021656.s12GufkW037507@svn.freebsd.org> From: Ian Lepore Date: Sun, 2 Feb 2014 16:56:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261405 - head/sys/dev/fdt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2014 16:56:41 -0000 Author: ian Date: Sun Feb 2 16:56:40 2014 New Revision: 261405 URL: http://svnweb.freebsd.org/changeset/base/261405 Log: Be more robust with malformed interrupt config data. Instead of crashing or going into a near-infinite loop, warn and make potentially-reasonable assumptions. Modified: head/sys/dev/fdt/simplebus.c Modified: head/sys/dev/fdt/simplebus.c ============================================================================== --- head/sys/dev/fdt/simplebus.c Sun Feb 2 16:42:26 2014 (r261404) +++ head/sys/dev/fdt/simplebus.c Sun Feb 2 16:56:40 2014 (r261405) @@ -287,11 +287,23 @@ simplebus_setup_dinfo(device_t dev, phan nintr = OF_getencprop_alloc(node, "interrupts", sizeof(*intr), (void **)&intr); if (nintr > 0) { - iparent = 0; - OF_searchencprop(node, "interrupt-parent", &iparent, - sizeof(iparent)); - OF_searchencprop(OF_xref_phandle(iparent), "#interrupt-cells", - &icells, sizeof(icells)); + if (OF_searchencprop(node, "interrupt-parent", &iparent, + sizeof(iparent)) == -1) { + device_printf(dev, "No interrupt-parent found, " + "assuming direct parent\n"); + iparent = OF_parent(node); + } + if (OF_searchencprop(OF_xref_phandle(iparent), + "#interrupt-cells", &icells, sizeof(icells)) == -1) { + device_printf(dev, "Missing #interrupt-cells property, " + "assuming <1>\n"); + icells = 1; + } + if (icells < 1 || icells > nintr) { + device_printf(dev, "Invalid #interrupt-cells property " + "value <%d>, assuming <1>\n", icells); + icells = 1; + } for (i = 0, k = 0; i < nintr; i += icells, k++) { intr[i] = ofw_bus_map_intr(dev, iparent, icells, &intr[i]); From owner-svn-src-head@FreeBSD.ORG Sun Feb 2 17:48:08 2014 Return-Path: Delivered-To: svn-src-head@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 17575B88; Sun, 2 Feb 2014 17:48:08 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EB4461F48; Sun, 2 Feb 2014 17:48:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s12Hm77n057838; Sun, 2 Feb 2014 17:48:07 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s12Hm7xs057834; Sun, 2 Feb 2014 17:48:07 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201402021748.s12Hm7xs057834@svn.freebsd.org> From: Ruslan Bukin Date: Sun, 2 Feb 2014 17:48:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261406 - in head/sys: arm/freescale/vybrid boot/fdt/dts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2014 17:48:08 -0000 Author: br Date: Sun Feb 2 17:48:06 2014 New Revision: 261406 URL: http://svnweb.freebsd.org/changeset/base/261406 Log: o Expand device tree information o Export iomuxc (pins) configuration to DTS o Allow devices to assign clocks in DTS Modified: head/sys/arm/freescale/vybrid/vf_ccm.c head/sys/arm/freescale/vybrid/vf_iomuxc.c head/sys/boot/fdt/dts/vybrid-cosmic.dts head/sys/boot/fdt/dts/vybrid.dtsi Modified: head/sys/arm/freescale/vybrid/vf_ccm.c ============================================================================== --- head/sys/arm/freescale/vybrid/vf_ccm.c Sun Feb 2 16:56:40 2014 (r261405) +++ head/sys/arm/freescale/vybrid/vf_ccm.c Sun Feb 2 17:48:06 2014 (r261406) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ruslan Bukin + * Copyright (c) 2013-2014 Ruslan Bukin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -73,8 +73,8 @@ __FBSDID("$FreeBSD$"); #define CCM_CCGRN 12 #define CCM_CCGR(n) (0x40 + (n * 0x04)) /* Clock Gating Register */ -#define CCM_CMEOR(n) (0x70 + (n * 0x70)) /* Module Enable Override Reg */ -#define CCM_CCPGR(n) (0x90 + (n * 0x04)) /* Platform Clock Gating Reg */ +#define CCM_CMEOR(n) (0x70 + (n * 0x70)) /* Module Enable Override */ +#define CCM_CCPGR(n) (0x90 + (n * 0x04)) /* Platform Clock Gating */ #define CCM_CPPDSR 0x88 /* PLL PFD Disable Status Register */ #define CCM_CCOWR 0x8C /* CORE Wakeup Register */ @@ -100,6 +100,228 @@ __FBSDID("$FreeBSD$"); /* CCM_CSCDR1 */ #define ENET_TS_EN (1 << 23) #define RMII_CLK_EN (1 << 24) +#define SAI3_EN (1 << 19) + +/* CCM_CSCDR2 */ +#define ESAI_EN (1 << 30) +#define ESDHC1_EN (1 << 29) +#define ESDHC0_EN (1 << 28) +#define NFC_EN (1 << 9) +#define ESDHC1_DIV_S 20 +#define ESDHC1_DIV_M 0xf +#define ESDHC0_DIV_S 16 +#define ESDHC0_DIV_M 0xf + +/* CCM_CSCDR3 */ +#define DCU0_EN (1 << 19) + +#define QSPI1_EN (1 << 12) +#define QSPI1_DIV (1 << 11) +#define QSPI1_X2_DIV (1 << 10) +#define QSPI1_X4_DIV_M 0x3 +#define QSPI1_X4_DIV_S 8 + +#define QSPI0_EN (1 << 4) +#define QSPI0_DIV (1 << 3) +#define QSPI0_X2_DIV (1 << 2) +#define QSPI0_X4_DIV_M 0x3 +#define QSPI0_X4_DIV_S 0 + +#define SAI3_DIV_SHIFT 12 +#define SAI3_DIV_MASK 0xf +#define ESAI_DIV_SHIFT 24 +#define ESAI_DIV_MASK 0xf + +#define PLL4_CLK_DIV_SHIFT 6 +#define PLL4_CLK_DIV_MASK 0x7 + +#define IPG_CLK_DIV_SHIFT 11 +#define IPG_CLK_DIV_MASK 0x3 + +#define ESAI_CLK_SEL_SHIFT 20 +#define ESAI_CLK_SEL_MASK 0x3 + +#define SAI3_CLK_SEL_SHIFT 6 +#define SAI3_CLK_SEL_MASK 0x3 + +#define CKO1_EN (1 << 10) +#define CKO1_DIV_MASK 0xf +#define CKO1_DIV_SHIFT 6 +#define CKO1_SEL_MASK 0x3f +#define CKO1_SEL_SHIFT 0 +#define CKO1_PLL4_MAIN 0x6 +#define CKO1_PLL4_DIVD 0x7 + +struct clk { + uint32_t reg; + uint32_t enable_reg; + uint32_t div_mask; + uint32_t div_shift; + uint32_t div_val; + uint32_t sel_reg; + uint32_t sel_mask; + uint32_t sel_shift; + uint32_t sel_val; +}; + +/* + PLL4 clock divider (before switching the clocks should be gated) + 000 Divide by 1 (only if PLL frequency less than or equal to 650 MHz) + 001 Divide by 4 + 010 Divide by 6 + 011 Divide by 8 + 100 Divide by 10 + 101 Divide by 12 + 110 Divide by 14 + 111 Divide by 16 +*/ + +static struct clk pll4_clk = { + .reg = CCM_CACRR, + .enable_reg = 0, + .div_mask = PLL4_CLK_DIV_MASK, + .div_shift = PLL4_CLK_DIV_SHIFT, + .div_val = 5, /* Divide by 12 */ + .sel_reg = 0, + .sel_mask = 0, + .sel_shift = 0, + .sel_val = 0, +}; + +static struct clk sai3_clk = { + .reg = CCM_CSCDR1, + .enable_reg = SAI3_EN, + .div_mask = SAI3_DIV_MASK, + .div_shift = SAI3_DIV_SHIFT, + .div_val = 1, + .sel_reg = CCM_CSCMR1, + .sel_mask = SAI3_CLK_SEL_MASK, + .sel_shift = SAI3_CLK_SEL_SHIFT, + .sel_val = 0x3, /* Divided PLL4 main clock */ +}; + +static struct clk cko1_clk = { + .reg = CCM_CCOSR, + .enable_reg = CKO1_EN, + .div_mask = CKO1_DIV_MASK, + .div_shift = CKO1_DIV_SHIFT, + .div_val = 1, + .sel_reg = CCM_CCOSR, + .sel_mask = CKO1_SEL_MASK, + .sel_shift = CKO1_SEL_SHIFT, + .sel_val = CKO1_PLL4_DIVD, +}; + +static struct clk esdhc0_clk = { + .reg = CCM_CSCDR2, + .enable_reg = ESDHC0_EN, + .div_mask = ESDHC0_DIV_M, + .div_shift = ESDHC0_DIV_S, + .div_val = 0x9, + .sel_reg = 0, + .sel_mask = 0, + .sel_shift = 0, + .sel_val = 0, +}; + +static struct clk esdhc1_clk = { + .reg = CCM_CSCDR2, + .enable_reg = ESDHC1_EN, + .div_mask = ESDHC1_DIV_M, + .div_shift = ESDHC1_DIV_S, + .div_val = 0x9, + .sel_reg = 0, + .sel_mask = 0, + .sel_shift = 0, + .sel_val = 0, +}; + +static struct clk qspi0_clk = { + .reg = CCM_CSCDR3, + .enable_reg = QSPI0_EN, + .div_mask = 0, + .div_shift = 0, + .div_val = 0, + .sel_reg = 0, + .sel_mask = 0, + .sel_shift = 0, + .sel_val = 0, +}; + +static struct clk dcu0_clk = { + .reg = CCM_CSCDR3, + .enable_reg = DCU0_EN, + .div_mask = 0x7, + .div_shift = 16, /* DCU0_DIV */ + .div_val = 0, /* divide by 1 */ + .sel_reg = 0, + .sel_mask = 0, + .sel_shift = 0, + .sel_val = 0, +}; + +static struct clk enet_clk = { + .reg = CCM_CSCDR1, + .enable_reg = (ENET_TS_EN | RMII_CLK_EN), + .div_mask = 0, + .div_shift = 0, + .div_val = 0, + .sel_reg = 0, + .sel_mask = 0, + .sel_shift = 0, + .sel_val = 0, +}; + +static struct clk nand_clk = { + .reg = CCM_CSCDR2, + .enable_reg = NFC_EN, + .div_mask = 0, + .div_shift = 0, + .div_val = 0, + .sel_reg = 0, + .sel_mask = 0, + .sel_shift = 0, + .sel_val = 0, +}; + +/* + Divider to generate ESAI clock + 0000 Divide by 1 + 0001 Divide by 2 + ... ... + 1111 Divide by 16 +*/ + +static struct clk esai_clk = { + .reg = CCM_CSCDR2, + .enable_reg = ESAI_EN, + .div_mask = ESAI_DIV_MASK, + .div_shift = ESAI_DIV_SHIFT, + .div_val = 3, /* Divide by 4 */ + .sel_reg = CCM_CSCMR1, + .sel_mask = ESAI_CLK_SEL_MASK, + .sel_shift = ESAI_CLK_SEL_SHIFT, + .sel_val = 0x3, /* Divided PLL4 main clock */ +}; + +struct clock_entry { + char *name; + struct clk *clk; +}; + +static struct clock_entry clock_map[] = { + {"pll4", &pll4_clk}, + {"sai3", &sai3_clk}, + {"cko1", &cko1_clk}, + {"esdhc0", &esdhc0_clk}, + {"esdhc1", &esdhc1_clk}, + {"qspi0", &qspi0_clk}, + {"dcu0", &dcu0_clk}, + {"enet", &enet_clk}, + {"nand", &nand_clk}, + {"esai", &esai_clk}, + {NULL, NULL} +}; struct ccm_softc { struct resource *res[1]; @@ -125,6 +347,83 @@ ccm_probe(device_t dev) } static int +set_clock(struct ccm_softc *sc, char *name) +{ + struct clk *clk; + int reg; + int i; + + for (i = 0; clock_map[i].name != NULL; i++) { + if (strcmp(clock_map[i].name, name) == 0) { +#if 0 + device_printf(sc->dev, "Configuring %s clk\n", name); +#endif + clk = clock_map[i].clk; + if (clk->sel_reg != 0) { + reg = READ4(sc, clk->sel_reg); + reg &= ~(clk->sel_mask << clk->sel_shift); + reg |= (clk->sel_val << clk->sel_shift); + WRITE4(sc, clk->sel_reg, reg); + }; + + reg = READ4(sc, clk->reg); + reg |= clk->enable_reg; + reg &= ~(clk->div_mask << clk->div_shift); + reg |= (clk->div_val << clk->div_shift); + WRITE4(sc, clk->reg, reg); + }; + }; + + return (0); +} + +static int +ccm_fdt_set(struct ccm_softc *sc) +{ + phandle_t child, parent, root; + int len; + char *fdt_config, *name; + + root = OF_finddevice("/"); + len = 0; + parent = root; + + /* Find 'clock_names' prop in the tree */ + for (child = OF_child(parent); child != 0; child = OF_peer(child)) { + + /* Find a 'leaf'. Start the search from this node. */ + while (OF_child(child)) { + parent = child; + child = OF_child(child); + } + + if (!fdt_is_enabled(child)) + continue; + + if ((len = OF_getproplen(child, "clock_names")) > 0) { + len = OF_getproplen(child, "clock_names"); + OF_getprop_alloc(child, "clock_names", 1, + (void **)&fdt_config); + + while (len > 0) { + name = fdt_config; + fdt_config += strlen(name) + 1; + len -= strlen(name) + 1; + set_clock(sc, name); + }; + }; + + if (OF_peer(child) == 0) { + /* No more siblings. */ + child = parent; + parent = OF_parent(child); + } + } + + return (0); +} + +static int ccm_attach(device_t dev) { struct ccm_softc *sc; @@ -163,10 +462,8 @@ ccm_attach(device_t dev) WRITE4(sc, CCM_CCGR(i), 0xffffffff); } - /* Enable ENET clocks */ - reg = READ4(sc, CCM_CSCDR1); - reg |= (ENET_TS_EN | RMII_CLK_EN); - WRITE4(sc, CCM_CSCDR1, reg); + /* Take and apply FDT clocks */ + ccm_fdt_set(sc); return (0); } Modified: head/sys/arm/freescale/vybrid/vf_iomuxc.c ============================================================================== --- head/sys/arm/freescale/vybrid/vf_iomuxc.c Sun Feb 2 16:56:40 2014 (r261405) +++ head/sys/arm/freescale/vybrid/vf_iomuxc.c Sun Feb 2 17:48:06 2014 (r261406) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ruslan Bukin + * Copyright (c) 2013-2014 Ruslan Bukin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -67,16 +67,12 @@ __FBSDID("$FreeBSD$"); #define MUX_MODE_MASK 7 #define MUX_MODE_SHIFT 20 #define MUX_MODE_GPIO 0 -#define MUX_MODE_RMII 1 -#define MUX_MODE_RMII_CLKIN 2 #define MUX_MODE_VBUS_EN_OTG 2 #define PUS_22_KOHM_PULL_UP (3 << 4) #define DSE_25_OHM (6 << 6) -#define NET0_PAD_START 45 -#define NET1_PAD_START 54 -#define NET_PAD_N 9 +#define MAX_MUX_LEN 1024 struct iomuxc_softc { struct resource *tmr_res[1]; @@ -115,11 +111,62 @@ configure_pad(struct iomuxc_softc *sc, i } static int +pinmux_set(struct iomuxc_softc *sc) +{ + phandle_t child, parent, root; + pcell_t iomux_config[MAX_MUX_LEN]; + int len; + int values; + int pin; + int mux_mode; + int i; + + root = OF_finddevice("/"); + len = 0; + parent = root; + + /* Find 'iomux_config' prop in the nodes */ + for (child = OF_child(parent); child != 0; child = OF_peer(child)) { + + /* Find a 'leaf'. Start the search from this node. */ + while (OF_child(child)) { + parent = child; + child = OF_child(child); + } + + if (!fdt_is_enabled(child)) + continue; + + if ((len = OF_getproplen(child, "iomux_config")) > 0) { + OF_getprop(child, "iomux_config", &iomux_config, len); + + values = len / (sizeof(uint32_t)); + for (i = 0; i < values; i += 2) { + pin = fdt32_to_cpu(iomux_config[i]); + mux_mode = fdt32_to_cpu(iomux_config[i+1]); +#if 0 + device_printf(sc->dev, "Set pin %d to ALT%d\n", + pin, mux_mode); +#endif + configure_pad(sc, IOMUXC(pin), mux_mode); + } + } + + if (OF_peer(child) == 0) { + /* No more siblings. */ + child = parent; + parent = OF_parent(child); + } + } + + return (0); +} + +static int iomuxc_attach(device_t dev) { struct iomuxc_softc *sc; int reg; - int i; sc = device_get_softc(dev); sc->dev = dev; @@ -138,18 +185,7 @@ iomuxc_attach(device_t dev) reg = (PKE | PUE | PUS_22_KOHM_PULL_UP | DSE_25_OHM | OBE); WRITE4(sc, IOMUXC_PTA7, reg); - /* NET */ - configure_pad(sc, IOMUXC_PTA6, MUX_MODE_RMII_CLKIN); - - /* NET0 */ - for (i = NET0_PAD_START; i <= (NET0_PAD_START + NET_PAD_N); i++) { - configure_pad(sc, IOMUXC(i), MUX_MODE_RMII); - } - - /* NET1 */ - for (i = NET1_PAD_START; i <= (NET1_PAD_START + NET_PAD_N); i++) { - configure_pad(sc, IOMUXC(i), MUX_MODE_RMII); - } + pinmux_set(sc); return (0); } Modified: head/sys/boot/fdt/dts/vybrid-cosmic.dts ============================================================================== --- head/sys/boot/fdt/dts/vybrid-cosmic.dts Sun Feb 2 16:56:40 2014 (r261405) +++ head/sys/boot/fdt/dts/vybrid-cosmic.dts Sun Feb 2 17:48:06 2014 (r261406) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ruslan Bukin + * Copyright (c) 2013-2014 Ruslan Bukin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -39,12 +39,37 @@ }; SOC: vybrid { - serial0: serial@40027000 { - status = "disabled"; + serial1: serial@40028000 { + status = "okay"; }; - fec0: ethernet@400D0000 { - status = "disabled"; + fec1: ethernet@400D1000 { + status = "okay"; + iomux_config = < 54 0x1 55 0x1 + 56 0x1 57 0x1 + 58 0x1 59 0x1 + 60 0x1 61 0x1 + 62 0x1 0 0x2 >; + }; + + esai: esai@40062000 { + status = "okay"; + }; + + edma1: edma@40098000 { + status = "okay"; + }; + + tcon0: tcon@4003D000 { + status = "okay"; + }; + + dcu0: dcu4@40058000 { + status = "okay"; + }; + + adc0: adc@4003B000 { + status = "okay"; }; }; Modified: head/sys/boot/fdt/dts/vybrid.dtsi ============================================================================== --- head/sys/boot/fdt/dts/vybrid.dtsi Sun Feb 2 16:56:40 2014 (r261405) +++ head/sys/boot/fdt/dts/vybrid.dtsi Sun Feb 2 17:48:06 2014 (r261406) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ruslan Bukin + * Copyright (c) 2013-2014 Ruslan Bukin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -28,7 +28,7 @@ / { model = "Freescale Vybrid Family"; - compatible = "freescale,vybrid", "fsl,vf"; + compatible = "freescale,vybrid", "fsl,mvf"; #address-cells = <1>; #size-cells = <1>; @@ -38,6 +38,15 @@ soc = &SOC; serial0 = &serial0; serial1 = &serial1; + sai0 = &sai0; + sai1 = &sai1; + sai2 = &sai2; + sai3 = &sai3; + esai = &esai; + adc0 = &adc0; + adc1 = &adc1; + edma0 = &edma0; + edma1 = &edma1; src = &SRC; }; @@ -74,6 +83,7 @@ ccm@4006b000 { compatible = "fsl,mvf600-ccm"; reg = <0x4006b000 0x1000>; + clock_names = "pll4"; }; mp_tmr@40002100 { @@ -87,6 +97,32 @@ interrupt-parent = < &GIC >; }; + dmamux@40024000 { + compatible = "fsl,mvf600-dmamux"; + reg = <0x40024000 0x100>, + <0x40025000 0x100>, + <0x400A1000 0x100>, + <0x400A2000 0x100>; + }; + + edma0: edma@40018000 { + compatible = "fsl,mvf600-edma"; + reg = <0x40018000 0x1000>, + <0x40019000 0x1000>; /* TCD */ + interrupts = < 40 41 >; + interrupt-parent = <&GIC>; + status = "disabled"; + }; + + edma1: edma@40098000 { + compatible = "fsl,mvf600-edma"; + reg = <0x40098000 0x1000>, + <0x40099000 0x1000>; /* TCD */ + interrupts = < 42 43 >; + interrupt-parent = <&GIC>; + status = "disabled"; + }; + pit@40037000 { compatible = "fsl,mvf600-pit"; reg = <0x40037000 0x1000>; @@ -115,7 +151,6 @@ gpio-controller; interrupts = < 139 140 141 142 143 >; interrupt-parent = <&GIC>; - }; nand@400E0000 { @@ -125,6 +160,8 @@ reg = <0x400E0000 0x10000>; interrupts = < 115 >; interrupt-parent = <&GIC>; + clock_names = "nand"; + status = "disabled"; partition@40000 { reg = <0x40000 0x200000>; /* 2MB */ @@ -146,7 +183,6 @@ reg = <0xe40000 0x1e000000>; /* 480MB */ label = "root"; }; - }; sdhci0: sdhci@400B1000 { @@ -155,6 +191,8 @@ interrupts = < 59 >; interrupt-parent = <&GIC>; clock-frequency = <50000000>; + status = "disabled"; + clock_names = "esdhc0"; }; sdhci1: sdhci@400B2000 { @@ -163,6 +201,11 @@ interrupts = < 60 >; interrupt-parent = <&GIC>; clock-frequency = <50000000>; + status = "disabled"; + clock_names = "esdhc1"; + iomux_config = < 14 0x5 15 0x5 + 16 0x5 17 0x5 + 18 0x5 19 0x5 >; }; serial0: serial@40027000 { @@ -172,6 +215,7 @@ interrupt-parent = <&GIC>; current-speed = <115200>; clock-frequency = < 24000000 >; + status = "disabled"; }; serial1: serial@40028000 { @@ -181,6 +225,7 @@ interrupt-parent = <&GIC>; current-speed = <115200>; clock-frequency = < 24000000 >; + status = "disabled"; }; usb@40034000 { @@ -208,6 +253,13 @@ interrupt-parent = <&GIC>; phy-mode = "rmii"; phy-disable-preamble; + status = "disabled"; + clock_names = "enet"; + iomux_config = < 45 0x1 46 0x1 + 47 0x1 48 0x1 + 49 0x1 50 0x1 + 51 0x1 52 0x1 + 53 0x1 >; }; fec1: ethernet@400D1000 { @@ -217,7 +269,145 @@ interrupt-parent = <&GIC>; phy-mode = "rmii"; phy-disable-preamble; + status = "disabled"; + clock_names = "enet"; + iomux_config = < 54 0x1 55 0x1 + 56 0x1 57 0x1 + 58 0x1 59 0x1 + 60 0x1 61 0x1 + 62 0x1 >; + }; + + sai0: sai@4002F000 { + compatible = "fsl,mvf600-sai"; + reg = <0x4002F000 0x1000>; + interrupts = < 116 >; + interrupt-parent = <&GIC>; + status = "disabled"; + }; + + sai1: sai@40030000 { + compatible = "fsl,mvf600-sai"; + reg = <0x40030000 0x1000>; + interrupts = < 117 >; + interrupt-parent = <&GIC>; + status = "disabled"; + }; + + sai2: sai@40031000 { + compatible = "fsl,mvf600-sai"; + reg = <0x40031000 0x1000>; + interrupts = < 118 >; + interrupt-parent = <&GIC>; + status = "disabled"; + }; + + sai3: sai@40032000 { + compatible = "fsl,mvf600-sai"; + reg = <0x40032000 0x1000>; + interrupts = < 119 >; + interrupt-parent = <&GIC>; + status = "disabled"; + clock_names = "sai3", "cko1"; + iomux_config = < 16 0x2 + 19 0x2 + 21 0x2 + 40 0x4 >; /* CKO1 */ + }; + + esai: esai@40062000 { + compatible = "fsl,mvf600-esai"; + reg = <0x40062000 0x1000>; + interrupts = < 120 >; + interrupt-parent = <&GIC>; + status = "disabled"; + clock_names = "esai"; + iomux_config = < 45 0x4 46 0x4 + 47 0x4 48 0x4 + 49 0x4 50 0x4 + 51 0x4 52 0x4 + 78 0x3 40 0x4>; + }; + + spi0: spi@4002C000 { + compatible = "fsl,mvf600-spi"; + reg = <0x4002C000 0x1000>; + interrupts = < 99 >; + interrupt-parent = <&GIC>; + status = "disabled"; + iomux_config = < 40 0x1 41 0x1 + 42 0x1 43 0x1 + 44 0x1 >; + }; + + spi1: spi@4002D000 { + compatible = "fsl,mvf600-spi"; + reg = <0x4002D000 0x1000>; + interrupts = < 100 >; + interrupt-parent = <&GIC>; + status = "disabled"; + }; + + spi2: spi@400AC000 { + compatible = "fsl,mvf600-spi"; + reg = <0x400AC000 0x1000>; + interrupts = < 101 >; + interrupt-parent = <&GIC>; + status = "disabled"; + }; + + spi3: spi@400AD000 { + compatible = "fsl,mvf600-spi"; + reg = <0x400AD000 0x1000>; + interrupts = < 102 >; + interrupt-parent = <&GIC>; + status = "disabled"; }; + adc0: adc@4003B000 { + compatible = "fsl,mvf600-adc"; + reg = <0x4003B000 0x1000>; + interrupts = < 85 >; + interrupt-parent = <&GIC>; + status = "disabled"; + }; + + adc1: adc@400BB000 { + compatible = "fsl,mvf600-adc"; + reg = <0x400BB000 0x1000>; + interrupts = < 86 >; + interrupt-parent = <&GIC>; + status = "disabled"; + }; + + tcon0: tcon@4003D000 { + compatible = "fsl,mvf600-tcon"; + reg = <0x4003D000 0x1000>; + status = "disabled"; + }; + + dcu0: dcu4@40058000 { + compatible = "fsl,mvf600-dcu4"; + reg = <0x40058000 0x7000>; + interrupts = < 62 >; + interrupt-parent = <&GIC>; + status = "disabled"; + clock_names = "dcu0"; + iomux_config = < 105 0x1 106 0x1 + 107 0x1 108 0x1 + 109 0x1 110 0x1 + 111 0x1 112 0x1 + 113 0x1 114 0x1 + 115 0x1 116 0x1 + 117 0x1 118 0x1 + 119 0x1 120 0x1 + 121 0x1 122 0x1 + 123 0x1 124 0x1 + 125 0x1 126 0x1 + 127 0x1 128 0x1 + 129 0x1 130 0x1 + 131 0x1 132 0x1 + 133 0x1 >; + }; }; }; From owner-svn-src-head@FreeBSD.ORG Sun Feb 2 19:03:53 2014 Return-Path: Delivered-To: svn-src-head@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 1DD03CB9; Sun, 2 Feb 2014 19:03:53 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0A17C14BE; Sun, 2 Feb 2014 19:03:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s12J3qDC088692; Sun, 2 Feb 2014 19:03:52 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s12J3qQi088691; Sun, 2 Feb 2014 19:03:52 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201402021903.s12J3qQi088691@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 2 Feb 2014 19:03:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261407 - head/lib/libnv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2014 19:03:53 -0000 Author: pjd Date: Sun Feb 2 19:03:52 2014 New Revision: 261407 URL: http://svnweb.freebsd.org/changeset/base/261407 Log: Fix sending empty nvlist. Submitted by: Mariusz Zaborski Modified: head/lib/libnv/msgio.c Modified: head/lib/libnv/msgio.c ============================================================================== --- head/lib/libnv/msgio.c Sun Feb 2 17:48:06 2014 (r261406) +++ head/lib/libnv/msgio.c Sun Feb 2 19:03:52 2014 (r261407) @@ -364,7 +364,7 @@ buf_recv(int sock, void *buf, size_t siz unsigned char *ptr; ptr = buf; - do { + while (size > 0) { fd_wait(sock, true); done = recv(sock, ptr, size, 0); if (done == -1) { @@ -377,7 +377,7 @@ buf_recv(int sock, void *buf, size_t siz } size -= done; ptr += done; - } while (size > 0); + } return (0); } From owner-svn-src-head@FreeBSD.ORG Sun Feb 2 19:06:01 2014 Return-Path: Delivered-To: svn-src-head@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 776CC22C; Sun, 2 Feb 2014 19:06:01 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 641FB150D; Sun, 2 Feb 2014 19:06:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s12J61DU089150; Sun, 2 Feb 2014 19:06:01 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s12J61GQ089149; Sun, 2 Feb 2014 19:06:01 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201402021906.s12J61GQ089149@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 2 Feb 2014 19:06:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261408 - head/lib/libnv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2014 19:06:01 -0000 Author: pjd Date: Sun Feb 2 19:06:00 2014 New Revision: 261408 URL: http://svnweb.freebsd.org/changeset/base/261408 Log: Assert input arguments to buf_send() and buf_recv(). Submitted by: Mariusz Zaborski Modified: head/lib/libnv/msgio.c Modified: head/lib/libnv/msgio.c ============================================================================== --- head/lib/libnv/msgio.c Sun Feb 2 19:03:52 2014 (r261407) +++ head/lib/libnv/msgio.c Sun Feb 2 19:06:00 2014 (r261408) @@ -338,6 +338,10 @@ buf_send(int sock, void *buf, size_t siz ssize_t done; unsigned char *ptr; + PJDLOG_ASSERT(sock >= 0); + PJDLOG_ASSERT(size > 0); + PJDLOG_ASSERT(buf != NULL); + ptr = buf; do { fd_wait(sock, false); @@ -363,6 +367,9 @@ buf_recv(int sock, void *buf, size_t siz ssize_t done; unsigned char *ptr; + PJDLOG_ASSERT(sock >= 0); + PJDLOG_ASSERT(buf != NULL); + ptr = buf; while (size > 0) { fd_wait(sock, true); From owner-svn-src-head@FreeBSD.ORG Sun Feb 2 19:13:03 2014 Return-Path: Delivered-To: svn-src-head@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 A233A4AC; Sun, 2 Feb 2014 19:13:03 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 82DB915BD; Sun, 2 Feb 2014 19:13:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s12JD3QU092950; Sun, 2 Feb 2014 19:13:03 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s12JD3aZ092947; Sun, 2 Feb 2014 19:13:03 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201402021913.s12JD3aZ092947@svn.freebsd.org> From: Ruslan Bukin Date: Sun, 2 Feb 2014 19:13:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261409 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2014 19:13:03 -0000 Author: br Date: Sun Feb 2 19:13:02 2014 New Revision: 261409 URL: http://svnweb.freebsd.org/changeset/base/261409 Log: Split kernel configuration to chip common and board specific parts. Added: head/sys/arm/conf/VYBRID.common (contents, props changed) Modified: head/sys/arm/conf/COSMIC Modified: head/sys/arm/conf/COSMIC ============================================================================== --- head/sys/arm/conf/COSMIC Sun Feb 2 19:06:00 2014 (r261408) +++ head/sys/arm/conf/COSMIC Sun Feb 2 19:13:02 2014 (r261409) @@ -17,123 +17,9 @@ # # $FreeBSD$ +include "VYBRID.common" ident COSMIC -include "../freescale/vybrid/std.vybrid" - -makeoptions MODULES_OVERRIDE="" -makeoptions WITHOUT_MODULES="ahc" - -makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols -makeoptions WERROR="-Werror" - -options HZ=100 ## -options SCHED_4BSD #4BSD scheduler -options INET #InterNETworking -options INET6 #IPv6 communications protocols -options FFS #Berkeley Fast Filesystem -options SOFTUPDATES -options UFS_ACL #Support for access control lists -options UFS_DIRHASH #Improve performance on big directories -options MSDOSFS #MSDOS Filesystem -options CD9660 #ISO 9660 Filesystem -options PROCFS #Process filesystem (requires PSEUDOFS) -options PSEUDOFS #Pseudo-filesystem framework -#options NANDFS #NAND Filesystem -options TMPFS -options COMPAT_43 #Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 #Delay (in ms) before probing SCSI -options KTRACE -options SYSVSHM #SYSV-style shared memory -options SYSVMSG #SYSV-style message queues -options SYSVSEM #SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions -options KBD_INSTALL_CDEV -options PREEMPTION -options FREEBSD_BOOT_LOADER -options VFP # vfp/neon - -# Debugging -makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols -options BREAK_TO_DEBUGGER -#options VERBOSE_SYSINIT #Enable verbose sysinit messages -options KDB -options DDB #Enable the kernel debugger -options INVARIANTS #Enable calls of extra sanity checking -options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS #Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed -options DIAGNOSTIC - -# NFS support -options NFSCL #Network Filesystem Client -options NFSLOCKD #Network Lock Manager -options NFS_ROOT #NFS usable as /, requires NFSCLIENT - -# Uncomment this for NFS root -#options NFS_ROOT #NFS usable as /, requires NFSCL -#options BOOTP_NFSROOT -#options BOOTP_COMPAT -#options BOOTP -#options BOOTP_NFSV3 -#options BOOTP_WIRED_TO=ffec0 - -device mmc # mmc/sd bus -device mmcsd # mmc/sd flash cards -device sdhci # generic sdhci - -#options ROOTDEVNAME=\"nfs:10.5.0.1:/tftpboot/cosmic\" -#options ROOTDEVNAME=\"nandfs:/dev/gnand0s.root\" -options ROOTDEVNAME=\"ufs:/dev/da0\" - -#options SMP - -# Pseudo devices - -device loop -device random -device pty -device md -device gpio - -# USB support -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. -device usb -options USB_DEBUG -#options USB_REQ_DEBUG -#options USB_VERBOSE -#device musb -device ehci -#device ohci - -device umass -device scbus # SCSI bus (required for SCSI) -device da # Direct Access (disks) -device pass - -# SATA -#device ata -#device atadisk -#device mvs - -device nand - -# Serial ports -device uart - -# I2C (TWSI) -#device iic -#device iicbus - -# Ethernet -device ether -device ffec - -# USB ethernet support, requires miibus -device miibus -device axe # ASIX Electronics USB Ethernet -device bpf # Berkeley packet filter - #FDT options FDT options FDT_DTB_STATIC Added: head/sys/arm/conf/VYBRID.common ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/VYBRID.common Sun Feb 2 19:13:02 2014 (r261409) @@ -0,0 +1,139 @@ +# Kernel configuration for Vybrid Family boards. +# +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +include "../freescale/vybrid/std.vybrid" + +makeoptions MODULES_OVERRIDE="" +makeoptions WITHOUT_MODULES="ahc" + +makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +makeoptions WERROR="-Werror" + +options HZ=100 ## +options SCHED_4BSD #4BSD scheduler +options INET #InterNETworking +options INET6 #IPv6 communications protocols +options FFS #Berkeley Fast Filesystem +options SOFTUPDATES +options UFS_ACL #Support for access control lists +options UFS_DIRHASH #Improve performance on big directories +options MSDOSFS #MSDOS Filesystem +options CD9660 #ISO 9660 Filesystem +options PROCFS #Process filesystem (requires PSEUDOFS) +options PSEUDOFS #Pseudo-filesystem framework +#options NANDFS #NAND Filesystem +options TMPFS +options COMPAT_43 #Compatible with BSD 4.3 [KEEP THIS!] +options SCSI_DELAY=5000 #Delay (in ms) before probing SCSI +options KTRACE +options SYSVSHM #SYSV-style shared memory +options SYSVMSG #SYSV-style message queues +options SYSVSEM #SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions +options KBD_INSTALL_CDEV +options PREEMPTION +options FREEBSD_BOOT_LOADER +options MUTEX_NOINLINE +options RWLOCK_NOINLINE +options NO_FFS_SNAPSHOT +options NO_SWAPPING +options VFP # vfp/neon + +# Debugging +makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +options BREAK_TO_DEBUGGER +#options VERBOSE_SYSINIT #Enable verbose sysinit messages +options KDB +options DDB #Enable the kernel debugger +options INVARIANTS #Enable calls of extra sanity checking +options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS #Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed +options DIAGNOSTIC + +# NFS support +options NFSCL #Network Filesystem Client +options NFSLOCKD #Network Lock Manager +options NFS_ROOT #NFS usable as /, requires NFSCLIENT + +# Uncomment this for NFS root +#options NFS_ROOT #NFS usable as /, requires NFSCL +#options BOOTP_NFSROOT +#options BOOTP_COMPAT +#options BOOTP +#options BOOTP_NFSV3 +#options BOOTP_WIRED_TO=ffec0 + +device mmc # mmc/sd bus +device mmcsd # mmc/sd flash cards +device sdhci # generic sdhci + +#options ROOTDEVNAME=\"nfs:10.5.0.1:/tftpboot/cosmic\" +#options ROOTDEVNAME=\"nandfs:/dev/gnand0s.root\" +options ROOTDEVNAME=\"ufs:/dev/da0\" + +#options SMP + +# Pseudo devices + +device loop +device random +device pty +device md +device gpio + +# USB support +options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. +device usb +options USB_DEBUG +#options USB_REQ_DEBUG +#options USB_VERBOSE +#device musb +device ehci +#device ohci + +device umass +device scbus # SCSI bus (required for SCSI) +device da # Direct Access (disks) +device pass + +# SATA +#device ata +#device atadisk +#device mvs + +device nand + +# Serial ports +device uart + +# I2C (TWSI) +#device iic +#device iicbus + +# Ethernet +device ether +device ffec + +# USB ethernet support, requires miibus +device miibus +device axe # ASIX Electronics USB Ethernet +device bpf # Berkeley packet filter + +device sound From owner-svn-src-head@FreeBSD.ORG Sun Feb 2 19:17:46 2014 Return-Path: Delivered-To: svn-src-head@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 6D46B6A4; Sun, 2 Feb 2014 19:17:46 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 556C815DF; Sun, 2 Feb 2014 19:17:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s12JHkht093650; Sun, 2 Feb 2014 19:17:46 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s12JHSB0093546; Sun, 2 Feb 2014 19:17:28 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201402021917.s12JHSB0093546@svn.freebsd.org> From: Ian Lepore Date: Sun, 2 Feb 2014 19:17:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261410 - in head/sys: arm/allwinner arm/allwinner/a20 arm/arm arm/broadcom/bcm2835 arm/freescale/imx arm/freescale/vybrid arm/lpc arm/mv arm/rockchip arm/samsung/exynos arm/ti arm/ti/a... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2014 19:17:46 -0000 Author: ian Date: Sun Feb 2 19:17:28 2014 New Revision: 261410 URL: http://svnweb.freebsd.org/changeset/base/261410 Log: Follow r261352 by updating all drivers which are children of simplebus to check the status property in their probe routines. Simplebus used to only instantiate its children whose status="okay" but that was improper behavior, fixed in r261352. Now that it doesn't check anymore and probes all its children; the children all have to do the check because really only the children know how to properly interpret their status property strings. Right now all existing drivers only understand "okay" versus something- that's-not-okay, so they all use the new ofw_bus_status_okay() helper. Modified: head/sys/arm/allwinner/a10_clk.c head/sys/arm/allwinner/a10_ehci.c head/sys/arm/allwinner/a10_gpio.c head/sys/arm/allwinner/a10_wdog.c head/sys/arm/allwinner/a20/a20_cpu_cfg.c head/sys/arm/allwinner/aintc.c head/sys/arm/arm/generic_timer.c head/sys/arm/arm/gic.c head/sys/arm/arm/mpcore_timer.c head/sys/arm/arm/pl190.c head/sys/arm/arm/pl310.c head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c head/sys/arm/broadcom/bcm2835/bcm2835_dma.c head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c head/sys/arm/broadcom/bcm2835/bcm2835_intr.c head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c head/sys/arm/broadcom/bcm2835/bcm2835_spi.c head/sys/arm/broadcom/bcm2835/bcm2835_systimer.c head/sys/arm/broadcom/bcm2835/bcm2835_wdog.c head/sys/arm/freescale/imx/i2c.c head/sys/arm/freescale/imx/imx51_ccm.c head/sys/arm/freescale/imx/imx51_gpio.c head/sys/arm/freescale/imx/imx51_iomux.c head/sys/arm/freescale/imx/imx51_ipuv3.c head/sys/arm/freescale/imx/imx51_ipuv3_fbd.c head/sys/arm/freescale/imx/imx6_anatop.c head/sys/arm/freescale/imx/imx6_ccm.c head/sys/arm/freescale/imx/imx6_usbphy.c head/sys/arm/freescale/imx/imx_gpt.c head/sys/arm/freescale/imx/imx_nop_usbphy.c head/sys/arm/freescale/imx/imx_sdhci.c head/sys/arm/freescale/imx/imx_wdog.c head/sys/arm/freescale/imx/tzic.c head/sys/arm/freescale/vybrid/vf_anadig.c head/sys/arm/freescale/vybrid/vf_ccm.c head/sys/arm/freescale/vybrid/vf_ehci.c head/sys/arm/freescale/vybrid/vf_gpio.c head/sys/arm/freescale/vybrid/vf_iomuxc.c head/sys/arm/freescale/vybrid/vf_mscm.c head/sys/arm/freescale/vybrid/vf_nfc.c head/sys/arm/freescale/vybrid/vf_src.c head/sys/arm/lpc/if_lpe.c head/sys/arm/lpc/lpc_dmac.c head/sys/arm/lpc/lpc_fb.c head/sys/arm/lpc/lpc_gpio.c head/sys/arm/lpc/lpc_intc.c head/sys/arm/lpc/lpc_mmc.c head/sys/arm/lpc/lpc_ohci.c head/sys/arm/lpc/lpc_pwr.c head/sys/arm/lpc/lpc_rtc.c head/sys/arm/lpc/lpc_spi.c head/sys/arm/lpc/lpc_timer.c head/sys/arm/mv/gpio.c head/sys/arm/mv/ic.c head/sys/arm/mv/mpic.c head/sys/arm/mv/mv_sata.c head/sys/arm/mv/mv_ts.c head/sys/arm/mv/rtc.c head/sys/arm/mv/timer.c head/sys/arm/mv/twsi.c head/sys/arm/rockchip/rk30xx_gpio.c head/sys/arm/rockchip/rk30xx_grf.c head/sys/arm/rockchip/rk30xx_pmu.c head/sys/arm/rockchip/rk30xx_wdog.c head/sys/arm/samsung/exynos/arch_timer.c head/sys/arm/samsung/exynos/ehci_exynos5.c head/sys/arm/ti/aintc.c head/sys/arm/ti/am335x/am335x_dmtimer.c head/sys/arm/ti/am335x/am335x_lcd.c head/sys/arm/ti/am335x/am335x_prcm.c head/sys/arm/ti/am335x/am335x_pwm.c head/sys/arm/ti/am335x/am335x_usbss.c head/sys/arm/ti/cpsw/if_cpsw.c head/sys/arm/ti/omap4/omap4_prcm_clks.c head/sys/arm/ti/ti_edma3.c head/sys/arm/ti/ti_gpio.c head/sys/arm/ti/ti_i2c.c head/sys/arm/ti/ti_mbox.c head/sys/arm/ti/ti_mmchs.c head/sys/arm/ti/ti_pruss.c head/sys/arm/ti/ti_scm.c head/sys/arm/ti/ti_sdhci.c head/sys/arm/ti/ti_sdma.c head/sys/arm/ti/usb/omap_ehci.c head/sys/arm/versatile/if_smc_fdt.c head/sys/arm/versatile/pl050.c head/sys/arm/versatile/sp804.c head/sys/arm/versatile/versatile_clcd.c head/sys/arm/versatile/versatile_pci.c head/sys/arm/versatile/versatile_sic.c head/sys/arm/xilinx/zy7_devcfg.c head/sys/arm/xilinx/zy7_ehci.c head/sys/arm/xilinx/zy7_gpio.c head/sys/arm/xilinx/zy7_slcr.c head/sys/dev/altera/atse/if_atse_fdt.c head/sys/dev/altera/avgen/altera_avgen_fdt.c head/sys/dev/altera/jtag_uart/altera_jtag_uart_fdt.c head/sys/dev/altera/sdcard/altera_sdcard_fdt.c head/sys/dev/ata/chipsets/ata-fsl.c head/sys/dev/cesa/cesa.c head/sys/dev/cfi/cfi_bus_fdt.c head/sys/dev/fdt/simplebus.c head/sys/dev/ffec/if_ffec.c head/sys/dev/mge/if_mge.c head/sys/dev/mvs/mvs_soc.c head/sys/dev/quicc/quicc_bfe_fdt.c head/sys/dev/sdhci/sdhci_fdt.c head/sys/dev/sec/sec.c head/sys/dev/terasic/de4led/terasic_de4led_fdt.c head/sys/dev/terasic/mtl/terasic_mtl_fdt.c head/sys/dev/tsec/if_tsec_fdt.c head/sys/dev/uart/uart_bus_fdt.c head/sys/dev/usb/controller/dwc_otg_fdt.c head/sys/dev/usb/controller/ehci_fsl.c head/sys/dev/usb/controller/ehci_imx.c head/sys/dev/usb/controller/ehci_mv.c head/sys/mips/beri/beri_pic.c head/sys/mips/beri/beri_simplebus.c Modified: head/sys/arm/allwinner/a10_clk.c ============================================================================== --- head/sys/arm/allwinner/a10_clk.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/allwinner/a10_clk.c Sun Feb 2 19:17:28 2014 (r261410) @@ -69,6 +69,10 @@ static struct a10_ccm_softc *a10_ccm_sc static int a10_ccm_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_is_compatible(dev, "allwinner,sun4i-ccm")) { device_set_desc(dev, "Allwinner Clock Control Module"); return(BUS_PROBE_DEFAULT); Modified: head/sys/arm/allwinner/a10_ehci.c ============================================================================== --- head/sys/arm/allwinner/a10_ehci.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/allwinner/a10_ehci.c Sun Feb 2 19:17:28 2014 (r261410) @@ -93,6 +93,10 @@ bs_w_1_proto(reversed); static int a10_ehci_probe(device_t self) { + + if (!ofw_bus_status_okay(self)) + return (ENXIO); + if (!ofw_bus_is_compatible(self, "allwinner,usb-ehci")) return (ENXIO); Modified: head/sys/arm/allwinner/a10_gpio.c ============================================================================== --- head/sys/arm/allwinner/a10_gpio.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/allwinner/a10_gpio.c Sun Feb 2 19:17:28 2014 (r261410) @@ -410,6 +410,10 @@ a10_gpio_pin_toggle(device_t dev, uint32 static int a10_gpio_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "allwinner,sun4i-gpio")) return (ENXIO); Modified: head/sys/arm/allwinner/a10_wdog.c ============================================================================== --- head/sys/arm/allwinner/a10_wdog.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/allwinner/a10_wdog.c Sun Feb 2 19:17:28 2014 (r261410) @@ -93,6 +93,9 @@ static int a10wd_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_is_compatible(dev, "allwinner,sun4i-wdt")) { device_set_desc(dev, "Allwinner A10 Watchdog"); return (BUS_PROBE_DEFAULT); Modified: head/sys/arm/allwinner/a20/a20_cpu_cfg.c ============================================================================== --- head/sys/arm/allwinner/a20/a20_cpu_cfg.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/allwinner/a20/a20_cpu_cfg.c Sun Feb 2 19:17:28 2014 (r261410) @@ -70,6 +70,9 @@ static int a20_cpu_cfg_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_is_compatible(dev, "allwinner,sun7i-cpu-cfg")) { device_set_desc(dev, "A20 CPU Configuration Module"); return(BUS_PROBE_DEFAULT); Modified: head/sys/arm/allwinner/aintc.c ============================================================================== --- head/sys/arm/allwinner/aintc.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/allwinner/aintc.c Sun Feb 2 19:17:28 2014 (r261410) @@ -97,6 +97,10 @@ static struct a10_aintc_softc *a10_aintc static int a10_aintc_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "allwinner,sun4i-ic")) return (ENXIO); device_set_desc(dev, "A10 AINTC Interrupt Controller"); Modified: head/sys/arm/arm/generic_timer.c ============================================================================== --- head/sys/arm/arm/generic_timer.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/arm/generic_timer.c Sun Feb 2 19:17:28 2014 (r261410) @@ -244,6 +244,9 @@ static int arm_tmr_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "arm,armv7-timer")) return (ENXIO); Modified: head/sys/arm/arm/gic.c ============================================================================== --- head/sys/arm/arm/gic.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/arm/gic.c Sun Feb 2 19:17:28 2014 (r261410) @@ -129,6 +129,9 @@ static int arm_gic_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "arm,gic")) return (ENXIO); device_set_desc(dev, "ARM Generic Interrupt Controller"); Modified: head/sys/arm/arm/mpcore_timer.c ============================================================================== --- head/sys/arm/arm/mpcore_timer.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/arm/mpcore_timer.c Sun Feb 2 19:17:28 2014 (r261410) @@ -247,6 +247,10 @@ arm_tmr_intr(void *arg) static int arm_tmr_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "arm,mpcore-timers")) return (ENXIO); Modified: head/sys/arm/arm/pl190.c ============================================================================== --- head/sys/arm/arm/pl190.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/arm/pl190.c Sun Feb 2 19:17:28 2014 (r261410) @@ -78,6 +78,10 @@ static struct pl190_intc_softc *pl190_in static int pl190_intc_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "arm,versatile-vic")) return (ENXIO); device_set_desc(dev, "ARM PL190 VIC"); Modified: head/sys/arm/arm/pl310.c ============================================================================== --- head/sys/arm/arm/pl310.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/arm/pl310.c Sun Feb 2 19:17:28 2014 (r261410) @@ -281,6 +281,9 @@ static int pl310_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "arm,pl310")) return (ENXIO); device_set_desc(dev, "PL310 L2 cache controller"); Modified: head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c Sun Feb 2 19:17:28 2014 (r261410) @@ -222,6 +222,9 @@ static int bcm_bsc_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-bsc")) return (ENXIO); Modified: head/sys/arm/broadcom/bcm2835/bcm2835_dma.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_dma.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/broadcom/bcm2835/bcm2835_dma.c Sun Feb 2 19:17:28 2014 (r261410) @@ -637,6 +637,9 @@ static int bcm_dma_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-dma")) return (ENXIO); Modified: head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Sun Feb 2 19:17:28 2014 (r261410) @@ -674,6 +674,10 @@ bcm_gpio_get_reserved_pins(struct bcm_gp static int bcm_gpio_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-gpio")) return (ENXIO); Modified: head/sys/arm/broadcom/bcm2835/bcm2835_intr.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_intr.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/broadcom/bcm2835/bcm2835_intr.c Sun Feb 2 19:17:28 2014 (r261410) @@ -90,6 +90,10 @@ static struct bcm_intc_softc *bcm_intc_s static int bcm_intc_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-armctrl-ic")) return (ENXIO); device_set_desc(dev, "BCM2835 Interrupt Controller"); Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Sun Feb 2 19:17:28 2014 (r261410) @@ -128,6 +128,9 @@ static int bcm_mbox_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_is_compatible(dev, "broadcom,bcm2835-mbox")) { device_set_desc(dev, "BCM2835 VideoCore Mailbox"); return(BUS_PROBE_DEFAULT); Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Sun Feb 2 19:17:28 2014 (r261410) @@ -151,6 +151,10 @@ bcm_dmamap_cb(void *arg, bus_dma_segment static int bcm_sdhci_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-sdhci")) return (ENXIO); Modified: head/sys/arm/broadcom/bcm2835/bcm2835_spi.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_spi.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/broadcom/bcm2835/bcm2835_spi.c Sun Feb 2 19:17:28 2014 (r261410) @@ -231,6 +231,9 @@ static int bcm_spi_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-spi")) return (ENXIO); Modified: head/sys/arm/broadcom/bcm2835/bcm2835_systimer.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_systimer.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/broadcom/bcm2835/bcm2835_systimer.c Sun Feb 2 19:17:28 2014 (r261410) @@ -186,6 +186,9 @@ static int bcm_systimer_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_is_compatible(dev, "broadcom,bcm2835-system-timer")) { device_set_desc(dev, "BCM2835 System Timer"); return (BUS_PROBE_DEFAULT); Modified: head/sys/arm/broadcom/bcm2835/bcm2835_wdog.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_wdog.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/broadcom/bcm2835/bcm2835_wdog.c Sun Feb 2 19:17:28 2014 (r261410) @@ -85,6 +85,9 @@ static int bcmwd_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_is_compatible(dev, "broadcom,bcm2835-wdt")) { device_set_desc(dev, "BCM2708/2835 Watchdog"); return (BUS_PROBE_DEFAULT); Modified: head/sys/arm/freescale/imx/i2c.c ============================================================================== --- head/sys/arm/freescale/imx/i2c.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/freescale/imx/i2c.c Sun Feb 2 19:17:28 2014 (r261410) @@ -224,6 +224,9 @@ i2c_probe(device_t dev) { struct i2c_softc *sc; + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "fsl,imx-i2c")) return (ENXIO); Modified: head/sys/arm/freescale/imx/imx51_ccm.c ============================================================================== --- head/sys/arm/freescale/imx/imx51_ccm.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/freescale/imx/imx51_ccm.c Sun Feb 2 19:17:28 2014 (r261410) @@ -141,6 +141,9 @@ static int imxccm_match(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "fsl,imx51-ccm") && !ofw_bus_is_compatible(dev, "fsl,imx53-ccm")) return (ENXIO); Modified: head/sys/arm/freescale/imx/imx51_gpio.c ============================================================================== --- head/sys/arm/freescale/imx/imx51_gpio.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/freescale/imx/imx51_gpio.c Sun Feb 2 19:17:28 2014 (r261410) @@ -370,6 +370,9 @@ static int imx51_gpio_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_is_compatible(dev, "fsl,imx51-gpio") || ofw_bus_is_compatible(dev, "fsl,imx53-gpio")) { device_set_desc(dev, "i.MX515 GPIO Controller"); Modified: head/sys/arm/freescale/imx/imx51_iomux.c ============================================================================== --- head/sys/arm/freescale/imx/imx51_iomux.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/freescale/imx/imx51_iomux.c Sun Feb 2 19:17:28 2014 (r261410) @@ -106,6 +106,9 @@ static int iomux_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "fsl,imx51-iomux") && !ofw_bus_is_compatible(dev, "fsl,imx53-iomux")) return (ENXIO); Modified: head/sys/arm/freescale/imx/imx51_ipuv3.c ============================================================================== --- head/sys/arm/freescale/imx/imx51_ipuv3.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/freescale/imx/imx51_ipuv3.c Sun Feb 2 19:17:28 2014 (r261410) @@ -254,6 +254,9 @@ ipu3_fb_probe(device_t dev) { int error; + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "fsl,ipu3")) return (ENXIO); Modified: head/sys/arm/freescale/imx/imx51_ipuv3_fbd.c ============================================================================== --- head/sys/arm/freescale/imx/imx51_ipuv3_fbd.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/freescale/imx/imx51_ipuv3_fbd.c Sun Feb 2 19:17:28 2014 (r261410) @@ -184,6 +184,9 @@ static int ipu3_fb_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "fsl,ipu3")) return (ENXIO); Modified: head/sys/arm/freescale/imx/imx6_anatop.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_anatop.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/freescale/imx/imx6_anatop.c Sun Feb 2 19:17:28 2014 (r261410) @@ -126,6 +126,9 @@ static int imx6_anatop_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_is_compatible(dev, "fsl,imx6q-anatop") == 0) return (ENXIO); Modified: head/sys/arm/freescale/imx/imx6_ccm.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_ccm.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/freescale/imx/imx6_ccm.c Sun Feb 2 19:17:28 2014 (r261410) @@ -121,6 +121,9 @@ static int ccm_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_is_compatible(dev, "fsl,imx6q-ccm") == 0) return (ENXIO); Modified: head/sys/arm/freescale/imx/imx6_usbphy.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_usbphy.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/freescale/imx/imx6_usbphy.c Sun Feb 2 19:17:28 2014 (r261410) @@ -160,6 +160,9 @@ static int usbphy_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_is_compatible(dev, "fsl,imx6q-usbphy") == 0) return (ENXIO); Modified: head/sys/arm/freescale/imx/imx_gpt.c ============================================================================== --- head/sys/arm/freescale/imx/imx_gpt.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/freescale/imx/imx_gpt.c Sun Feb 2 19:17:28 2014 (r261410) @@ -121,6 +121,9 @@ static int imx_gpt_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data != 0) { device_set_desc(dev, "Freescale i.MX GPT timer"); return (BUS_PROBE_DEFAULT); Modified: head/sys/arm/freescale/imx/imx_nop_usbphy.c ============================================================================== --- head/sys/arm/freescale/imx/imx_nop_usbphy.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/freescale/imx/imx_nop_usbphy.c Sun Feb 2 19:17:28 2014 (r261410) @@ -89,6 +89,9 @@ static int usbphy_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data != 0) { device_set_desc(dev, "Freescale USB PHY"); return (BUS_PROBE_DEFAULT); Modified: head/sys/arm/freescale/imx/imx_sdhci.c ============================================================================== --- head/sys/arm/freescale/imx/imx_sdhci.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/freescale/imx/imx_sdhci.c Sun Feb 2 19:17:28 2014 (r261410) @@ -643,6 +643,9 @@ static int imx_sdhci_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + switch (ofw_bus_search_compatible(dev, compat_data)->ocd_data) { case HWTYPE_ESDHC: device_set_desc(dev, "Freescale eSDHC controller"); Modified: head/sys/arm/freescale/imx/imx_wdog.c ============================================================================== --- head/sys/arm/freescale/imx/imx_wdog.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/freescale/imx/imx_wdog.c Sun Feb 2 19:17:28 2014 (r261410) @@ -130,6 +130,9 @@ static int imx_wdog_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "fsl,imx51-wdt") && !ofw_bus_is_compatible(dev, "fsl,imx53-wdt")) return (ENXIO); Modified: head/sys/arm/freescale/imx/tzic.c ============================================================================== --- head/sys/arm/freescale/imx/tzic.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/freescale/imx/tzic.c Sun Feb 2 19:17:28 2014 (r261410) @@ -76,6 +76,10 @@ static void tzic_post_filter(void *); static int tzic_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_is_compatible(dev, "fsl,tzic")) { device_set_desc(dev, "TrustZone Interrupt Controller"); return (BUS_PROBE_DEFAULT); Modified: head/sys/arm/freescale/vybrid/vf_anadig.c ============================================================================== --- head/sys/arm/freescale/vybrid/vf_anadig.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/freescale/vybrid/vf_anadig.c Sun Feb 2 19:17:28 2014 (r261410) @@ -114,6 +114,9 @@ static int anadig_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "fsl,mvf600-anadig")) return (ENXIO); Modified: head/sys/arm/freescale/vybrid/vf_ccm.c ============================================================================== --- head/sys/arm/freescale/vybrid/vf_ccm.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/freescale/vybrid/vf_ccm.c Sun Feb 2 19:17:28 2014 (r261410) @@ -339,6 +339,9 @@ static int ccm_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "fsl,mvf600-ccm")) return (ENXIO); Modified: head/sys/arm/freescale/vybrid/vf_ehci.c ============================================================================== --- head/sys/arm/freescale/vybrid/vf_ehci.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/freescale/vybrid/vf_ehci.c Sun Feb 2 19:17:28 2014 (r261410) @@ -176,6 +176,9 @@ static int vybrid_ehci_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_is_compatible(dev, "fsl,mvf600-usb-ehci") == 0) return (ENXIO); Modified: head/sys/arm/freescale/vybrid/vf_gpio.c ============================================================================== --- head/sys/arm/freescale/vybrid/vf_gpio.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/freescale/vybrid/vf_gpio.c Sun Feb 2 19:17:28 2014 (r261410) @@ -123,6 +123,9 @@ static int vf_gpio_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "fsl,mvf600-gpio")) return (ENXIO); Modified: head/sys/arm/freescale/vybrid/vf_iomuxc.c ============================================================================== --- head/sys/arm/freescale/vybrid/vf_iomuxc.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/freescale/vybrid/vf_iomuxc.c Sun Feb 2 19:17:28 2014 (r261410) @@ -90,6 +90,9 @@ static int iomuxc_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "fsl,mvf600-iomuxc")) return (ENXIO); Modified: head/sys/arm/freescale/vybrid/vf_mscm.c ============================================================================== --- head/sys/arm/freescale/vybrid/vf_mscm.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/freescale/vybrid/vf_mscm.c Sun Feb 2 19:17:28 2014 (r261410) @@ -75,6 +75,9 @@ static int mscm_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "fsl,mvf600-mscm")) return (ENXIO); Modified: head/sys/arm/freescale/vybrid/vf_nfc.c ============================================================================== --- head/sys/arm/freescale/vybrid/vf_nfc.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/freescale/vybrid/vf_nfc.c Sun Feb 2 19:17:28 2014 (r261410) @@ -171,6 +171,9 @@ static int vf_nand_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "fsl,mvf600-nand")) return (ENXIO); Modified: head/sys/arm/freescale/vybrid/vf_src.c ============================================================================== --- head/sys/arm/freescale/vybrid/vf_src.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/freescale/vybrid/vf_src.c Sun Feb 2 19:17:28 2014 (r261410) @@ -102,6 +102,9 @@ static int src_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "fsl,mvf600-src")) return (ENXIO); Modified: head/sys/arm/lpc/if_lpe.c ============================================================================== --- head/sys/arm/lpc/if_lpe.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/lpc/if_lpe.c Sun Feb 2 19:17:28 2014 (r261410) @@ -190,6 +190,9 @@ static int lpe_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "lpc,ethernet")) return (ENXIO); Modified: head/sys/arm/lpc/lpc_dmac.c ============================================================================== --- head/sys/arm/lpc/lpc_dmac.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/lpc/lpc_dmac.c Sun Feb 2 19:17:28 2014 (r261410) @@ -90,6 +90,10 @@ static void lpc_dmac_intr(void *); static int lpc_dmac_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "lpc,dmac")) return (ENXIO); Modified: head/sys/arm/lpc/lpc_fb.c ============================================================================== --- head/sys/arm/lpc/lpc_fb.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/lpc/lpc_fb.c Sun Feb 2 19:17:28 2014 (r261410) @@ -138,6 +138,10 @@ static struct cdevsw lpc_fb_cdevsw = { static int lpc_fb_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "lpc,fb")) return (ENXIO); Modified: head/sys/arm/lpc/lpc_gpio.c ============================================================================== --- head/sys/arm/lpc/lpc_gpio.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/lpc/lpc_gpio.c Sun Feb 2 19:17:28 2014 (r261410) @@ -160,6 +160,10 @@ static struct lpc_gpio_softc *lpc_gpio_s static int lpc_gpio_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "lpc,gpio")) return (ENXIO); Modified: head/sys/arm/lpc/lpc_intc.c ============================================================================== --- head/sys/arm/lpc/lpc_intc.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/lpc/lpc_intc.c Sun Feb 2 19:17:28 2014 (r261410) @@ -68,6 +68,9 @@ static int lpc_intc_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "lpc,pic")) return (ENXIO); Modified: head/sys/arm/lpc/lpc_mmc.c ============================================================================== --- head/sys/arm/lpc/lpc_mmc.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/lpc/lpc_mmc.c Sun Feb 2 19:17:28 2014 (r261410) @@ -166,6 +166,10 @@ static struct lpc_dmac_channel_config lp static int lpc_mmc_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "lpc,mmc")) return (ENXIO); Modified: head/sys/arm/lpc/lpc_ohci.c ============================================================================== --- head/sys/arm/lpc/lpc_ohci.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/lpc/lpc_ohci.c Sun Feb 2 19:17:28 2014 (r261410) @@ -98,6 +98,10 @@ static void lpc_isp3101_configure(device static int lpc_ohci_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "lpc,usb-ohci")) return (ENXIO); Modified: head/sys/arm/lpc/lpc_pwr.c ============================================================================== --- head/sys/arm/lpc/lpc_pwr.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/lpc/lpc_pwr.c Sun Feb 2 19:17:28 2014 (r261410) @@ -65,6 +65,9 @@ static int lpc_pwr_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "lpc,pwr")) return (ENXIO); Modified: head/sys/arm/lpc/lpc_rtc.c ============================================================================== --- head/sys/arm/lpc/lpc_rtc.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/lpc/lpc_rtc.c Sun Feb 2 19:17:28 2014 (r261410) @@ -63,6 +63,9 @@ static int lpc_rtc_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "lpc,rtc")) return (ENXIO); Modified: head/sys/arm/lpc/lpc_spi.c ============================================================================== --- head/sys/arm/lpc/lpc_spi.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/lpc/lpc_spi.c Sun Feb 2 19:17:28 2014 (r261410) @@ -85,6 +85,10 @@ static int lpc_spi_transfer(device_t, de static int lpc_spi_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "lpc,spi")) return (ENXIO); Modified: head/sys/arm/lpc/lpc_timer.c ============================================================================== --- head/sys/arm/lpc/lpc_timer.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/lpc/lpc_timer.c Sun Feb 2 19:17:28 2014 (r261410) @@ -111,6 +111,9 @@ static int lpc_timer_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "lpc,timer")) return (ENXIO); Modified: head/sys/arm/mv/gpio.c ============================================================================== --- head/sys/arm/mv/gpio.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/mv/gpio.c Sun Feb 2 19:17:28 2014 (r261410) @@ -125,6 +125,9 @@ static int mv_gpio_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "mrvl,gpio")) return (ENXIO); Modified: head/sys/arm/mv/ic.c ============================================================================== --- head/sys/arm/mv/ic.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/mv/ic.c Sun Feb 2 19:17:28 2014 (r261410) @@ -80,6 +80,9 @@ static int mv_ic_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "mrvl,pic")) return (ENXIO); Modified: head/sys/arm/mv/mpic.c ============================================================================== --- head/sys/arm/mv/mpic.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/mv/mpic.c Sun Feb 2 19:17:28 2014 (r261410) @@ -127,6 +127,9 @@ static int mv_mpic_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "mrvl,mpic")) return (ENXIO); Modified: head/sys/arm/mv/mv_sata.c ============================================================================== --- head/sys/arm/mv/mv_sata.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/mv/mv_sata.c Sun Feb 2 19:17:28 2014 (r261410) @@ -185,6 +185,9 @@ sata_probe(device_t dev) struct sata_softc *sc; uint32_t d, r; + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "mrvl,sata")) return (ENXIO); Modified: head/sys/arm/mv/mv_ts.c ============================================================================== --- head/sys/arm/mv/mv_ts.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/mv/mv_ts.c Sun Feb 2 19:17:28 2014 (r261410) @@ -59,6 +59,9 @@ ts_probe(device_t dev) { uint32_t d, r; + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "mrvl,ts")) return (ENXIO); soc_id(&d, &r); Modified: head/sys/arm/mv/rtc.c ============================================================================== --- head/sys/arm/mv/rtc.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/mv/rtc.c Sun Feb 2 19:17:28 2014 (r261410) @@ -97,6 +97,9 @@ static int mv_rtc_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "mrvl,rtc")) return (ENXIO); Modified: head/sys/arm/mv/timer.c ============================================================================== --- head/sys/arm/mv/timer.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/mv/timer.c Sun Feb 2 19:17:28 2014 (r261410) @@ -108,6 +108,9 @@ static int mv_timer_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "mrvl,timer")) return (ENXIO); Modified: head/sys/arm/mv/twsi.c ============================================================================== --- head/sys/arm/mv/twsi.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/mv/twsi.c Sun Feb 2 19:17:28 2014 (r261410) @@ -305,6 +305,9 @@ static int mv_twsi_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "mrvl,twsi")) return (ENXIO); Modified: head/sys/arm/rockchip/rk30xx_gpio.c ============================================================================== --- head/sys/arm/rockchip/rk30xx_gpio.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/rockchip/rk30xx_gpio.c Sun Feb 2 19:17:28 2014 (r261410) @@ -441,6 +441,9 @@ static int rk30_gpio_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "rockchip,rk30xx-gpio")) return (ENXIO); Modified: head/sys/arm/rockchip/rk30xx_grf.c ============================================================================== --- head/sys/arm/rockchip/rk30xx_grf.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/rockchip/rk30xx_grf.c Sun Feb 2 19:17:28 2014 (r261410) @@ -70,6 +70,9 @@ static int rk30_grf_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_is_compatible(dev, "rockchip,rk30xx-grf")) { device_set_desc(dev, "RK30XX General Register File"); return(BUS_PROBE_DEFAULT); Modified: head/sys/arm/rockchip/rk30xx_pmu.c ============================================================================== --- head/sys/arm/rockchip/rk30xx_pmu.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/rockchip/rk30xx_pmu.c Sun Feb 2 19:17:28 2014 (r261410) @@ -70,6 +70,9 @@ static int rk30_pmu_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_is_compatible(dev, "rockchip,rk30xx-pmu")) { device_set_desc(dev, "RK30XX PMU"); return(BUS_PROBE_DEFAULT); Modified: head/sys/arm/rockchip/rk30xx_wdog.c ============================================================================== --- head/sys/arm/rockchip/rk30xx_wdog.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/rockchip/rk30xx_wdog.c Sun Feb 2 19:17:28 2014 (r261410) @@ -84,6 +84,9 @@ static int rk30_wd_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_is_compatible(dev, "rockchip,rk30xx-wdt")) { device_set_desc(dev, "Rockchip RK30XX Watchdog"); return (BUS_PROBE_DEFAULT); Modified: head/sys/arm/samsung/exynos/arch_timer.c ============================================================================== --- head/sys/arm/samsung/exynos/arch_timer.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/samsung/exynos/arch_timer.c Sun Feb 2 19:17:28 2014 (r261410) @@ -71,6 +71,10 @@ static struct resource_spec arm_tmr_spec static int arm_tmr_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "exynos,mct")) return (ENXIO); Modified: head/sys/arm/samsung/exynos/ehci_exynos5.c ============================================================================== --- head/sys/arm/samsung/exynos/ehci_exynos5.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/samsung/exynos/ehci_exynos5.c Sun Feb 2 19:17:28 2014 (r261410) @@ -147,6 +147,9 @@ static int exynos_ehci_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_is_compatible(dev, "exynos,usb-ehci") == 0) return (ENXIO); Modified: head/sys/arm/ti/aintc.c ============================================================================== --- head/sys/arm/ti/aintc.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/ti/aintc.c Sun Feb 2 19:17:28 2014 (r261410) @@ -81,6 +81,10 @@ static struct ti_aintc_softc *ti_aintc_s static int ti_aintc_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "ti,aintc")) return (ENXIO); device_set_desc(dev, "TI AINTC Interrupt Controller"); Modified: head/sys/arm/ti/am335x/am335x_dmtimer.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_dmtimer.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/ti/am335x/am335x_dmtimer.c Sun Feb 2 19:17:28 2014 (r261410) @@ -528,6 +528,9 @@ static int am335x_dmtimer_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_is_compatible(dev, "ti,am335x-dmtimer")) { device_set_desc(dev, "AM335x DMTimer"); return(BUS_PROBE_DEFAULT); Modified: head/sys/arm/ti/am335x/am335x_lcd.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_lcd.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/ti/am335x/am335x_lcd.c Sun Feb 2 19:17:28 2014 (r261410) @@ -404,6 +404,9 @@ am335x_lcd_probe(device_t dev) { int err; + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "ti,am335x-lcd")) return (ENXIO); Modified: head/sys/arm/ti/am335x/am335x_prcm.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_prcm.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/ti/am335x/am335x_prcm.c Sun Feb 2 19:17:28 2014 (r261410) @@ -370,6 +370,10 @@ void am335x_prcm_setup_dmtimer(int); static int am335x_prcm_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_is_compatible(dev, "am335x,prcm")) { device_set_desc(dev, "AM335x Power and Clock Management"); return(BUS_PROBE_DEFAULT); Modified: head/sys/arm/ti/am335x/am335x_pwm.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_pwm.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/ti/am335x/am335x_pwm.c Sun Feb 2 19:17:28 2014 (r261410) @@ -309,6 +309,10 @@ am335x_pwm_sysctl_period(SYSCTL_HANDLER_ static int am335x_pwm_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "ti,am335x-pwm")) return (ENXIO); Modified: head/sys/arm/ti/am335x/am335x_usbss.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_usbss.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/ti/am335x/am335x_usbss.c Sun Feb 2 19:17:28 2014 (r261410) @@ -250,6 +250,10 @@ musbotg_wrapper_interrupt(void *arg) static int musbotg_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "ti,musb-am33xx")) return (ENXIO); Modified: head/sys/arm/ti/cpsw/if_cpsw.c ============================================================================== --- head/sys/arm/ti/cpsw/if_cpsw.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/ti/cpsw/if_cpsw.c Sun Feb 2 19:17:28 2014 (r261410) @@ -445,6 +445,9 @@ static int cpsw_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "ti,cpsw")) return (ENXIO); Modified: head/sys/arm/ti/omap4/omap4_prcm_clks.c ============================================================================== --- head/sys/arm/ti/omap4/omap4_prcm_clks.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/ti/omap4/omap4_prcm_clks.c Sun Feb 2 19:17:28 2014 (r261410) @@ -1363,6 +1363,10 @@ omap4_prcm_reset(void) static int omap4_prcm_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "ti,omap4_prcm")) return (ENXIO); Modified: head/sys/arm/ti/ti_edma3.c ============================================================================== --- head/sys/arm/ti/ti_edma3.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/ti/ti_edma3.c Sun Feb 2 19:17:28 2014 (r261410) @@ -142,6 +142,10 @@ static struct { static int ti_edma3_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "ti,edma3")) return (ENXIO); Modified: head/sys/arm/ti/ti_gpio.c ============================================================================== --- head/sys/arm/ti/ti_gpio.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/ti/ti_gpio.c Sun Feb 2 19:17:28 2014 (r261410) @@ -627,6 +627,10 @@ ti_gpio_intr(void *arg) static int ti_gpio_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "ti,gpio")) return (ENXIO); Modified: head/sys/arm/ti/ti_i2c.c ============================================================================== --- head/sys/arm/ti/ti_i2c.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/ti/ti_i2c.c Sun Feb 2 19:17:28 2014 (r261410) @@ -1020,6 +1020,10 @@ ti_i2c_deactivate(device_t dev) static int ti_i2c_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "ti,i2c")) return (ENXIO); Modified: head/sys/arm/ti/ti_mbox.c ============================================================================== --- head/sys/arm/ti/ti_mbox.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/ti/ti_mbox.c Sun Feb 2 19:17:28 2014 (r261410) @@ -119,6 +119,10 @@ ti_mbox_reg_write(struct ti_mbox_softc * static int ti_mbox_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_is_compatible(dev, "ti,system-mbox")) { device_set_desc(dev, "TI System Mailbox"); return (BUS_PROBE_DEFAULT); Modified: head/sys/arm/ti/ti_mmchs.c ============================================================================== --- head/sys/arm/ti/ti_mmchs.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/ti/ti_mmchs.c Sun Feb 2 19:17:28 2014 (r261410) @@ -1656,6 +1656,10 @@ errout: static int ti_mmchs_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "ti,mmchs")) return (ENXIO); Modified: head/sys/arm/ti/ti_pruss.c ============================================================================== --- head/sys/arm/ti/ti_pruss.c Sun Feb 2 19:13:02 2014 (r261409) +++ head/sys/arm/ti/ti_pruss.c Sun Feb 2 19:17:28 2014 (r261410) @@ -145,6 +145,10 @@ ti_pruss_reg_write(struct ti_pruss_softc static int ti_pruss_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_is_compatible(dev, "ti,pruss-v1") || ofw_bus_is_compatible(dev, "ti,pruss-v2")) { device_set_desc(dev, "TI Programmable Realtime Unit Subsystem"); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Feb 2 19:35:11 2014 Return-Path: Delivered-To: svn-src-head@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 8E7D7A63; Sun, 2 Feb 2014 19:35:11 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7A91D1717; Sun, 2 Feb 2014 19:35:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s12JZBWO000970; Sun, 2 Feb 2014 19:35:11 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s12JZB5C000968; Sun, 2 Feb 2014 19:35:11 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201402021935.s12JZB5C000968@svn.freebsd.org> From: Ruslan Bukin Date: Sun, 2 Feb 2014 19:35:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261411 - in head/sys: arm/conf boot/fdt/dts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2014 19:35:11 -0000 Author: br Date: Sun Feb 2 19:35:10 2014 New Revision: 261411 URL: http://svnweb.freebsd.org/changeset/base/261411 Log: Add support for Colibri VF50 Evaluation Board. Colibri VF50 is a SODIMM200 Vybrid Family core module and development board produced by Toradex AG. Sponsored by: Machdep, Inc. Added: head/sys/arm/conf/COLIBRI-VF50 (contents, props changed) head/sys/boot/fdt/dts/vybrid-colibri-vf50.dts (contents, props changed) Added: head/sys/arm/conf/COLIBRI-VF50 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/COLIBRI-VF50 Sun Feb 2 19:35:10 2014 (r261411) @@ -0,0 +1,26 @@ +# Kernel configuration for Toradex Colibri VF50 Evaluation Board. +# +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +include "VYBRID.common" +ident COLIBRI-VF50 + +#FDT +options FDT +options FDT_DTB_STATIC +makeoptions FDT_DTS_FILE=vybrid-colibri-vf50.dts Added: head/sys/boot/fdt/dts/vybrid-colibri-vf50.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/vybrid-colibri-vf50.dts Sun Feb 2 19:35:10 2014 (r261411) @@ -0,0 +1,73 @@ +/*- + * Copyright (c) 2014 Ruslan Bukin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/dts-v1/; + +/include/ "vybrid.dtsi" + +/ { + model = "Toradex Colibri VF50"; + + memory { + device_type = "memory"; + reg = < 0x80000000 0x08000000 >; /* 128MB RAM */ + }; + + SOC: vybrid { + serial0: serial@40027000 { + status = "okay"; + }; + + fec1: ethernet@400D1000 { + status = "okay"; + iomux_config = < 54 0x1 55 0x1 + 56 0x1 57 0x1 + 58 0x1 59 0x1 + 60 0x1 61 0x1 + 62 0x1 0 0x1 >; + }; + + sai3: sai@40032000 { + status = "okay"; + }; + + adc0: adc@4003B000 { + status = "okay"; + }; + + edma1: edma@40098000 { + status = "okay"; + }; + }; + + chosen { + bootargs = "-v"; + stdin = "serial0"; + stdout = "serial0"; + }; +}; From owner-svn-src-head@FreeBSD.ORG Sun Feb 2 20:21:54 2014 Return-Path: Delivered-To: svn-src-head@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 00A3B502; Sun, 2 Feb 2014 20:21:53 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CBE851A9F; Sun, 2 Feb 2014 20:21:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s12KLrwV051526; Sun, 2 Feb 2014 20:21:53 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s12KLrYe051514; Sun, 2 Feb 2014 20:21:53 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201402022021.s12KLrYe051514@svn.freebsd.org> From: Alan Cox Date: Sun, 2 Feb 2014 20:21:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261412 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2014 20:21:54 -0000 Author: alc Date: Sun Feb 2 20:21:53 2014 New Revision: 261412 URL: http://svnweb.freebsd.org/changeset/base/261412 Log: Make prefaulting more aggressive on hard faults. Previously, we would only map a fraction of the pages that were fetched by vm_pager_get_pages() from secondary storage. Now, we map them all in order to avoid future soft faults. This effect is most evident when a memory-mapped file is accessed sequentially. Previously, there were 6 soft faults for every hard fault. Now, these soft faults are eliminated. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Sun Feb 2 19:35:10 2014 (r261411) +++ head/sys/vm/vm_fault.c Sun Feb 2 20:21:53 2014 (r261412) @@ -104,17 +104,8 @@ __FBSDID("$FreeBSD$"); #define PFBAK 4 #define PFFOR 4 -#define PAGEORDER_SIZE (PFBAK+PFFOR) - -static int prefault_pageorder[] = { - -1 * PAGE_SIZE, 1 * PAGE_SIZE, - -2 * PAGE_SIZE, 2 * PAGE_SIZE, - -3 * PAGE_SIZE, 3 * PAGE_SIZE, - -4 * PAGE_SIZE, 4 * PAGE_SIZE -}; static int vm_fault_additional_pages(vm_page_t, int, int, vm_page_t *, int *); -static void vm_fault_prefault(pmap_t, vm_offset_t, vm_map_entry_t); #define VM_FAULT_READ_BEHIND 8 #define VM_FAULT_READ_MAX (1 + VM_FAULT_READ_AHEAD_MAX) @@ -136,6 +127,8 @@ struct faultstate { }; static void vm_fault_cache_behind(const struct faultstate *fs, int distance); +static void vm_fault_prefault(const struct faultstate *fs, vm_offset_t addra, + int faultcount, int reqpage); static inline void release_page(struct faultstate *fs) @@ -905,7 +898,7 @@ vnode_locked: */ pmap_enter(fs.map->pmap, vaddr, fault_type, fs.m, prot, wired); if ((fault_flags & VM_FAULT_CHANGE_WIRING) == 0 && wired == 0) - vm_fault_prefault(fs.map->pmap, vaddr, fs.entry); + vm_fault_prefault(&fs, vaddr, faultcount, reqpage); VM_OBJECT_WLOCK(fs.object); vm_page_lock(fs.m); @@ -1000,31 +993,49 @@ vm_fault_cache_behind(const struct fault * of mmap time. */ static void -vm_fault_prefault(pmap_t pmap, vm_offset_t addra, vm_map_entry_t entry) +vm_fault_prefault(const struct faultstate *fs, vm_offset_t addra, + int faultcount, int reqpage) { - int i; + pmap_t pmap; + vm_map_entry_t entry; + vm_object_t backing_object, lobject; vm_offset_t addr, starta; vm_pindex_t pindex; vm_page_t m; - vm_object_t object; + int backward, forward, i; + pmap = fs->map->pmap; if (pmap != vmspace_pmap(curthread->td_proc->p_vmspace)) return; - object = entry->object.vm_object; + if (faultcount > 0) { + backward = reqpage; + forward = faultcount - reqpage - 1; + } else { + backward = PFBAK; + forward = PFFOR; + } + entry = fs->entry; - starta = addra - PFBAK * PAGE_SIZE; + starta = addra - backward * PAGE_SIZE; if (starta < entry->start) { starta = entry->start; } else if (starta > addra) { starta = 0; } - for (i = 0; i < PAGEORDER_SIZE; i++) { - vm_object_t backing_object, lobject; - - addr = addra + prefault_pageorder[i]; - if (addr > addra + (PFFOR * PAGE_SIZE)) + /* + * Generate the sequence of virtual addresses that are candidates for + * prefaulting in an outward spiral from the faulting virtual address, + * "addra". Specifically, the sequence is "addra - PAGE_SIZE", "addra + * + PAGE_SIZE", "addra - 2 * PAGE_SIZE", "addra + 2 * PAGE_SIZE", ... + * If the candidate address doesn't have a backing physical page, then + * the loop immediately terminates. + */ + for (i = 0; i < 2 * imax(backward, forward); i++) { + addr = addra + ((i >> 1) + 1) * ((i & 1) == 0 ? -PAGE_SIZE : + PAGE_SIZE); + if (addr > addra + forward * PAGE_SIZE) addr = 0; if (addr < starta || addr >= entry->end) @@ -1034,7 +1045,7 @@ vm_fault_prefault(pmap_t pmap, vm_offset continue; pindex = ((addr - entry->start) + entry->offset) >> PAGE_SHIFT; - lobject = object; + lobject = entry->object.vm_object; VM_OBJECT_RLOCK(lobject); while ((m = vm_page_lookup(lobject, pindex)) == NULL && lobject->type == OBJT_DEFAULT && @@ -1046,9 +1057,6 @@ vm_fault_prefault(pmap_t pmap, vm_offset VM_OBJECT_RUNLOCK(lobject); lobject = backing_object; } - /* - * give-up when a page is not in memory - */ if (m == NULL) { VM_OBJECT_RUNLOCK(lobject); break; From owner-svn-src-head@FreeBSD.ORG Sun Feb 2 20:25:28 2014 Return-Path: Delivered-To: svn-src-head@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 9EF8F742; Sun, 2 Feb 2014 20:25:28 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8A7341AB8; Sun, 2 Feb 2014 20:25:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s12KPSTU053632; Sun, 2 Feb 2014 20:25:28 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s12KPRFw053627; Sun, 2 Feb 2014 20:25:27 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201402022025.s12KPRFw053627@svn.freebsd.org> From: Ruslan Bukin Date: Sun, 2 Feb 2014 20:25:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261413 - in head/sys/arm: conf freescale/vybrid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2014 20:25:28 -0000 Author: br Date: Sun Feb 2 20:25:27 2014 New Revision: 261413 URL: http://svnweb.freebsd.org/changeset/base/261413 Log: Add driver for Display Control Unit (DCU4). Added: head/sys/arm/freescale/vybrid/vf_dcu4.c (contents, props changed) head/sys/arm/freescale/vybrid/vf_tcon.c (contents, props changed) Modified: head/sys/arm/conf/VYBRID.common head/sys/arm/freescale/vybrid/files.vybrid Modified: head/sys/arm/conf/VYBRID.common ============================================================================== --- head/sys/arm/conf/VYBRID.common Sun Feb 2 20:21:53 2014 (r261412) +++ head/sys/arm/conf/VYBRID.common Sun Feb 2 20:25:27 2014 (r261413) @@ -137,3 +137,10 @@ device axe # ASIX Electronics USB Eth device bpf # Berkeley packet filter device sound + +# Framebuffer +device vt +device kbdmux +options SC_DFLT_FONT # compile font in +makeoptions SC_DFLT_FONT=cp437 +device ukbd Modified: head/sys/arm/freescale/vybrid/files.vybrid ============================================================================== --- head/sys/arm/freescale/vybrid/files.vybrid Sun Feb 2 20:21:53 2014 (r261412) +++ head/sys/arm/freescale/vybrid/files.vybrid Sun Feb 2 20:25:27 2014 (r261413) @@ -21,6 +21,8 @@ arm/freescale/vybrid/vf_anadig.c standa arm/freescale/vybrid/vf_iomuxc.c standard arm/freescale/vybrid/vf_mscm.c standard arm/freescale/vybrid/vf_src.c standard +arm/freescale/vybrid/vf_tcon.c optional vt +arm/freescale/vybrid/vf_dcu4.c optional vt arm/freescale/vybrid/vf_nfc.c optional nand arm/freescale/vybrid/vf_ehci.c optional ehci arm/freescale/vybrid/vf_gpio.c optional gpio Added: head/sys/arm/freescale/vybrid/vf_dcu4.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/freescale/vybrid/vf_dcu4.c Sun Feb 2 20:25:27 2014 (r261413) @@ -0,0 +1,359 @@ +/*- + * Copyright (c) 2014 Ruslan Bukin + * 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. + */ + +/* + * Vybrid Family Display Control Unit (DCU4) + * Chapter 55, Vybrid Reference Manual, Rev. 5, 07/2013 + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include "fb_if.h" + +#include + +#define DCU_CTRLDESCCURSOR1 0x000 /* Control Descriptor Cursor 1 */ +#define DCU_CTRLDESCCURSOR2 0x004 /* Control Descriptor Cursor 2 */ +#define DCU_CTRLDESCCURSOR3 0x008 /* Control Descriptor Cursor 3 */ +#define DCU_CTRLDESCCURSOR4 0x00C /* Control Descriptor Cursor 4 */ +#define DCU_DCU_MODE 0x010 /* DCU4 Mode */ +#define DCU_MODE_M 0x3 +#define DCU_MODE_S 0 +#define DCU_MODE_NORMAL 0x1 +#define DCU_MODE_TEST 0x2 +#define DCU_MODE_COLBAR 0x3 +#define RASTER_EN (1 << 14) /* Raster scan of pixel data */ +#define DCU_BGND 0x014 /* Background */ +#define DCU_DISP_SIZE 0x018 /* Display Size */ +#define DELTA_M 0x7ff +#define DELTA_Y_S 16 +#define DELTA_X_S 0 +#define DCU_HSYN_PARA 0x01C /* Horizontal Sync Parameter */ +#define BP_H_SHIFT 22 +#define PW_H_SHIFT 11 +#define FP_H_SHIFT 0 +#define DCU_VSYN_PARA 0x020 /* Vertical Sync Parameter */ +#define BP_V_SHIFT 22 +#define PW_V_SHIFT 11 +#define FP_V_SHIFT 0 +#define DCU_SYNPOL 0x024 /* Synchronize Polarity */ +#define INV_HS (1 << 0) +#define INV_VS (1 << 1) +#define DCU_THRESHOLD 0x028 /* Threshold */ +#define LS_BF_VS_SHIFT 16 +#define OUT_BUF_HIGH_SHIFT 8 +#define OUT_BUF_LOW_SHIFT 0 +#define DCU_INT_STATUS 0x02C /* Interrupt Status */ +#define DCU_INT_MASK 0x030 /* Interrupt Mask */ +#define DCU_COLBAR_1 0x034 /* COLBAR_1 */ +#define DCU_COLBAR_2 0x038 /* COLBAR_2 */ +#define DCU_COLBAR_3 0x03C /* COLBAR_3 */ +#define DCU_COLBAR_4 0x040 /* COLBAR_4 */ +#define DCU_COLBAR_5 0x044 /* COLBAR_5 */ +#define DCU_COLBAR_6 0x048 /* COLBAR_6 */ +#define DCU_COLBAR_7 0x04C /* COLBAR_7 */ +#define DCU_COLBAR_8 0x050 /* COLBAR_8 */ +#define DCU_DIV_RATIO 0x054 /* Divide Ratio */ +#define DCU_SIGN_CALC_1 0x058 /* Sign Calculation 1 */ +#define DCU_SIGN_CALC_2 0x05C /* Sign Calculation 2 */ +#define DCU_CRC_VAL 0x060 /* CRC Value */ +#define DCU_PDI_STATUS 0x064 /* PDI Status */ +#define DCU_PDI_STA_MSK 0x068 /* PDI Status Mask */ +#define DCU_PARR_ERR_STATUS1 0x06C /* Parameter Error Status 1 */ +#define DCU_PARR_ERR_STATUS2 0x070 /* Parameter Error Status 2 */ +#define DCU_PARR_ERR_STATUS3 0x07C /* Parameter Error Status 3 */ +#define DCU_MASK_PARR_ERR_ST1 0x080 /* Mask Parameter Error Status 1 */ +#define DCU_MASK_PARR_ERR_ST2 0x084 /* Mask Parameter Error Status 2 */ +#define DCU_MASK_PARR_ERR_ST3 0x090 /* Mask Parameter Error Status 3 */ +#define DCU_THRESHOLD_INP_BUF_1 0x094 /* Threshold Input 1 */ +#define DCU_THRESHOLD_INP_BUF_2 0x098 /* Threshold Input 2 */ +#define DCU_THRESHOLD_INP_BUF_3 0x09C /* Threshold Input 3 */ +#define DCU_LUMA_COMP 0x0A0 /* LUMA Component */ +#define DCU_CHROMA_RED 0x0A4 /* Red Chroma Components */ +#define DCU_CHROMA_GREEN 0x0A8 /* Green Chroma Components */ +#define DCU_CHROMA_BLUE 0x0AC /* Blue Chroma Components */ +#define DCU_CRC_POS 0x0B0 /* CRC Position */ +#define DCU_LYR_INTPOL_EN 0x0B4 /* Layer Interpolation Enable */ +#define DCU_LYR_LUMA_COMP 0x0B8 /* Layer Luminance Component */ +#define DCU_LYR_CHRM_RED 0x0BC /* Layer Chroma Red */ +#define DCU_LYR_CHRM_GRN 0x0C0 /* Layer Chroma Green */ +#define DCU_LYR_CHRM_BLUE 0x0C4 /* Layer Chroma Blue */ +#define DCU_COMP_IMSIZE 0x0C8 /* Compression Image Size */ +#define DCU_UPDATE_MODE 0x0CC /* Update Mode */ +#define READREG (1 << 30) +#define MODE (1 << 31) +#define DCU_UNDERRUN 0x0D0 /* Underrun */ +#define DCU_GLBL_PROTECT 0x100 /* Global Protection */ +#define DCU_SFT_LCK_BIT_L0 0x104 /* Soft Lock Bit Layer 0 */ +#define DCU_SFT_LCK_BIT_L1 0x108 /* Soft Lock Bit Layer 1 */ +#define DCU_SFT_LCK_DISP_SIZE 0x10C /* Soft Lock Display Size */ +#define DCU_SFT_LCK_HS_VS_PARA 0x110 /* Soft Lock Hsync/Vsync Parameter */ +#define DCU_SFT_LCK_POL 0x114 /* Soft Lock POL */ +#define DCU_SFT_LCK_L0_TRANSP 0x118 /* Soft Lock L0 Transparency */ +#define DCU_SFT_LCK_L1_TRANSP 0x11C /* Soft Lock L1 Transparency */ + +/* Control Descriptor */ +#define DCU_CTRLDESCL(n, m) 0x200 + (0x40 * n) + 0x4 * (m - 1) +#define DCU_CTRLDESCLn_1(n) DCU_CTRLDESCL(n, 1) +#define DCU_CTRLDESCLn_2(n) DCU_CTRLDESCL(n, 2) +#define DCU_CTRLDESCLn_3(n) DCU_CTRLDESCL(n, 3) +#define TRANS_SHIFT 20 +#define DCU_CTRLDESCLn_4(n) DCU_CTRLDESCL(n, 4) +#define BPP_MASK 0xf /* Bit per pixel Mask */ +#define BPP_SHIFT 16 /* Bit per pixel Shift */ +#define BPP24 0x5 +#define EN_LAYER (1 << 31) /* Enable the layer */ +#define DCU_CTRLDESCLn_5(n) DCU_CTRLDESCL(n, 5) +#define DCU_CTRLDESCLn_6(n) DCU_CTRLDESCL(n, 6) +#define DCU_CTRLDESCLn_7(n) DCU_CTRLDESCL(n, 7) +#define DCU_CTRLDESCLn_8(n) DCU_CTRLDESCL(n, 8) +#define DCU_CTRLDESCLn_9(n) DCU_CTRLDESCL(n, 9) + +#define DISPLAY_WIDTH 480 +#define DISPLAY_HEIGHT 272 + +struct dcu_softc { + struct resource *res[2]; + bus_space_tag_t bst; + bus_space_handle_t bsh; + void *ih; + device_t dev; + device_t sc_fbd; /* fbd child */ + struct fb_info sc_info; +}; + +static struct resource_spec dcu_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 0, RF_ACTIVE }, + { -1, 0 } +}; + +static int +dcu_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "fsl,mvf600-dcu4")) + return (ENXIO); + + device_set_desc(dev, "Vybrid Family Display Control Unit (DCU4)"); + return (BUS_PROBE_DEFAULT); +} + +static void +dcu_intr(void *arg) +{ + struct dcu_softc *sc; + int reg; + + sc = arg; + + /* Ack interrupts */ + reg = READ4(sc, DCU_INT_STATUS); + WRITE4(sc, DCU_INT_STATUS, reg); + + /* TODO interrupt handler */ +} + +static int +dcu_init(struct dcu_softc *sc) +{ + int reg; + + /* Configure DCU */ + reg = ((sc->sc_info.fb_height) << DELTA_Y_S); + reg |= (sc->sc_info.fb_width / 16); + WRITE4(sc, DCU_DISP_SIZE, reg); + + /* TODO: export panel info to FDT */ + + reg = (2 << BP_H_SHIFT); + reg |= (41 << PW_H_SHIFT); + reg |= (2 << FP_H_SHIFT); + WRITE4(sc, DCU_HSYN_PARA, reg); + + reg = (2 << BP_V_SHIFT); + reg |= (10 << PW_V_SHIFT); + reg |= (2 << FP_V_SHIFT); + WRITE4(sc, DCU_VSYN_PARA, reg); + + WRITE4(sc, DCU_BGND, 0); + WRITE4(sc, DCU_DIV_RATIO, 30); + + reg = (INV_VS | INV_HS); + WRITE4(sc, DCU_SYNPOL, reg); + + reg = (0x3 << LS_BF_VS_SHIFT); + reg |= (0x78 << OUT_BUF_HIGH_SHIFT); + reg |= (0 << OUT_BUF_LOW_SHIFT); + WRITE4(sc, DCU_THRESHOLD, reg); + + /* Mask all the interrupts */ + WRITE4(sc, DCU_INT_MASK, 0xffffffff); + + /* Setup first layer */ + reg = (sc->sc_info.fb_width | (sc->sc_info.fb_height << 16)); + WRITE4(sc, DCU_CTRLDESCLn_1(0), reg); + WRITE4(sc, DCU_CTRLDESCLn_2(0), 0x0); + WRITE4(sc, DCU_CTRLDESCLn_3(0), sc->sc_info.fb_pbase); + reg = (BPP24 << BPP_SHIFT); + reg |= EN_LAYER; + reg |= (0xFF << TRANS_SHIFT); /* completely opaque */ + WRITE4(sc, DCU_CTRLDESCLn_4(0), reg); + WRITE4(sc, DCU_CTRLDESCLn_5(0), 0xffffff); + WRITE4(sc, DCU_CTRLDESCLn_6(0), 0x0); + WRITE4(sc, DCU_CTRLDESCLn_7(0), 0x0); + WRITE4(sc, DCU_CTRLDESCLn_8(0), 0x0); + WRITE4(sc, DCU_CTRLDESCLn_9(0), 0x0); + + /* Enable DCU in normal mode */ + reg = READ4(sc, DCU_DCU_MODE); + reg &= ~(DCU_MODE_M << DCU_MODE_S); + reg |= (DCU_MODE_NORMAL << DCU_MODE_S); + reg |= (RASTER_EN); + WRITE4(sc, DCU_DCU_MODE, reg); + WRITE4(sc, DCU_UPDATE_MODE, READREG); + + return (0); +} + +static int +dcu_attach(device_t dev) +{ + struct dcu_softc *sc; + int err; + + sc = device_get_softc(dev); + + if (bus_alloc_resources(dev, dcu_spec, sc->res)) { + device_printf(dev, "could not allocate resources\n"); + return (ENXIO); + } + + /* Memory interface */ + sc->bst = rman_get_bustag(sc->res[0]); + sc->bsh = rman_get_bushandle(sc->res[0]); + + /* Setup interrupt handler */ + err = bus_setup_intr(dev, sc->res[1], INTR_TYPE_BIO | INTR_MPSAFE, + NULL, dcu_intr, sc, &sc->ih); + if (err) { + device_printf(dev, "Unable to alloc interrupt resource.\n"); + return (ENXIO); + } + + /* Bypass timing control (used for raw lcd panels) */ + tcon_bypass(); + + sc->sc_info.fb_width = DISPLAY_WIDTH; + sc->sc_info.fb_height = DISPLAY_HEIGHT; + sc->sc_info.fb_stride = sc->sc_info.fb_width * 3; + sc->sc_info.fb_bpp = sc->sc_info.fb_depth = 24; + sc->sc_info.fb_size = sc->sc_info.fb_height * sc->sc_info.fb_stride; + sc->sc_info.fb_vbase = (intptr_t)contigmalloc(sc->sc_info.fb_size, + M_DEVBUF, M_ZERO, 0, ~0, PAGE_SIZE, 0); + sc->sc_info.fb_pbase = (intptr_t)vtophys(sc->sc_info.fb_vbase); + +#if 0 + printf("%dx%d [%d]\n", sc->sc_info.fb_width, sc->sc_info.fb_height, + sc->sc_info.fb_stride); + printf("pbase == 0x%08x\n", sc->sc_info.fb_pbase); +#endif + + memset((int8_t *)sc->sc_info.fb_vbase, 0x0, sc->sc_info.fb_size); + + dcu_init(sc); + + sc->sc_info.fb_name = device_get_nameunit(dev); + + /* Ask newbus to attach framebuffer device to me. */ + sc->sc_fbd = device_add_child(dev, "fbd", device_get_unit(dev)); + if (sc->sc_fbd == NULL) + device_printf(dev, "Can't attach fbd device\n"); + + if (device_probe_and_attach(sc->sc_fbd) != 0) { + device_printf(sc->dev, "Failed to attach fbd device\n"); + } + + return (0); +} + +static struct fb_info * +dcu4_fb_getinfo(device_t dev) +{ + struct dcu_softc *sc = device_get_softc(dev); + + return (&sc->sc_info); +} + +static device_method_t dcu_methods[] = { + DEVMETHOD(device_probe, dcu_probe), + DEVMETHOD(device_attach, dcu_attach), + + /* Framebuffer service methods */ + DEVMETHOD(fb_getinfo, dcu4_fb_getinfo), + { 0, 0 } +}; + +static driver_t dcu_driver = { + "fb", + dcu_methods, + sizeof(struct dcu_softc), +}; + +static devclass_t dcu_devclass; + +DRIVER_MODULE(fb, simplebus, dcu_driver, dcu_devclass, 0, 0); Added: head/sys/arm/freescale/vybrid/vf_tcon.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/freescale/vybrid/vf_tcon.c Sun Feb 2 20:25:27 2014 (r261413) @@ -0,0 +1,137 @@ +/*- + * Copyright (c) 2014 Ruslan Bukin + * 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. + */ + +/* + * Vybrid Family Timing Controller (TCON) + * Chapter 58, Vybrid Reference Manual, Rev. 5, 07/2013 + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#define TCON0_CTRL1 0x00 + +struct tcon_softc { + struct resource *res[1]; + bus_space_tag_t bst; + bus_space_handle_t bsh; +}; + +struct tcon_softc *tcon_sc; + +static struct resource_spec tcon_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { -1, 0 } +}; + +uint32_t +tcon_bypass(void) +{ + struct tcon_softc *sc; + + if (tcon_sc == NULL) + return (1); + + sc = tcon_sc; + + WRITE4(tcon_sc, TCON0_CTRL1, (1 << 29)); + + return (0); +} + +static int +tcon_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "fsl,mvf600-tcon")) + return (ENXIO); + + device_set_desc(dev, "Vybrid Family Timing Controller (TCON)"); + return (BUS_PROBE_DEFAULT); +} + +static int +tcon_attach(device_t dev) +{ + struct tcon_softc *sc; + + sc = device_get_softc(dev); + + if (bus_alloc_resources(dev, tcon_spec, sc->res)) { + device_printf(dev, "could not allocate resources\n"); + return (ENXIO); + } + + /* Memory interface */ + sc->bst = rman_get_bustag(sc->res[0]); + sc->bsh = rman_get_bushandle(sc->res[0]); + + tcon_sc = sc; + + return (0); +} + +static device_method_t tcon_methods[] = { + DEVMETHOD(device_probe, tcon_probe), + DEVMETHOD(device_attach, tcon_attach), + { 0, 0 } +}; + +static driver_t tcon_driver = { + "tcon", + tcon_methods, + sizeof(struct tcon_softc), +}; + +static devclass_t tcon_devclass; + +DRIVER_MODULE(tcon, simplebus, tcon_driver, tcon_devclass, 0, 0); From owner-svn-src-head@FreeBSD.ORG Sun Feb 2 20:45:42 2014 Return-Path: Delivered-To: svn-src-head@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 5918FA37; Sun, 2 Feb 2014 20:45: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 461F81CEF; Sun, 2 Feb 2014 20:45:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s12Kjg04061581; Sun, 2 Feb 2014 20:45:42 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s12Kjgrd061580; Sun, 2 Feb 2014 20:45:42 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201402022045.s12Kjgrd061580@svn.freebsd.org> From: Olivier Houchard Date: Sun, 2 Feb 2014 20:45:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261414 - head/sys/arm/ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2014 20:45:42 -0000 Author: cognet Date: Sun Feb 2 20:45:41 2014 New Revision: 261414 URL: http://svnweb.freebsd.org/changeset/base/261414 Log: Don't call device_set_ivars() for the mmchs, it doesn't seem to be used, and it overrides the ivars set by the simplebus. Modified: head/sys/arm/ti/ti_mmchs.c Modified: head/sys/arm/ti/ti_mmchs.c ============================================================================== --- head/sys/arm/ti/ti_mmchs.c Sun Feb 2 20:25:27 2014 (r261413) +++ head/sys/arm/ti/ti_mmchs.c Sun Feb 2 20:45:41 2014 (r261414) @@ -1755,7 +1755,6 @@ ti_mmchs_attach(device_t dev) device_add_child(dev, "mmc", 0); - device_set_ivars(dev, &sc->host); err = bus_generic_attach(dev); out: From owner-svn-src-head@FreeBSD.ORG Sun Feb 2 20:58:26 2014 Return-Path: Delivered-To: svn-src-head@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 EE4527C; Sun, 2 Feb 2014 20:58:25 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D90E31DB7; Sun, 2 Feb 2014 20:58:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s12KwPVL065904; Sun, 2 Feb 2014 20:58:25 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s12KwNHZ065890; Sun, 2 Feb 2014 20:58:23 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201402022058.s12KwNHZ065890@svn.freebsd.org> From: Olivier Houchard Date: Sun, 2 Feb 2014 20:58:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261415 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2014 20:58:26 -0000 Author: cognet Date: Sun Feb 2 20:58:23 2014 New Revision: 261415 URL: http://svnweb.freebsd.org/changeset/base/261415 Log: Change the way pcpu and curthread are stored per-core: the old way was to store pcpu in a register, and get curthread from pcpu, which is not very atomic, and led to issues if the thread was migrated to another core between the time we got the pcpu address and the time we got curthread. Instead, we now store curthread where pcpu used to be store, and we calculate the pcpu address based on the cpu id. Modified: head/sys/arm/arm/bcopyinout.S head/sys/arm/arm/bcopyinout_xscale.S head/sys/arm/arm/copystr.S head/sys/arm/arm/fusu.S head/sys/arm/arm/genassym.c head/sys/arm/arm/machdep.c head/sys/arm/arm/mp_machdep.c head/sys/arm/arm/swtch.S head/sys/arm/arm/vfp.c head/sys/arm/include/asmacros.h head/sys/arm/include/pcpu.h Modified: head/sys/arm/arm/bcopyinout.S ============================================================================== --- head/sys/arm/arm/bcopyinout.S Sun Feb 2 20:45:41 2014 (r261414) +++ head/sys/arm/arm/bcopyinout.S Sun Feb 2 20:58:23 2014 (r261415) @@ -57,7 +57,7 @@ __FBSDID("$FreeBSD$"); #ifdef _ARM_ARCH_6 #define GET_PCB(tmp) \ mrc p15, 0, tmp, c13, c0, 4; \ - add tmp, tmp, #(PC_CURPCB) + add tmp, tmp, #(TD_PCB) #else .Lcurpcb: .word _C_LABEL(__pcpu) + PC_CURPCB Modified: head/sys/arm/arm/bcopyinout_xscale.S ============================================================================== --- head/sys/arm/arm/bcopyinout_xscale.S Sun Feb 2 20:45:41 2014 (r261414) +++ head/sys/arm/arm/bcopyinout_xscale.S Sun Feb 2 20:58:23 2014 (r261415) @@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$"); #ifdef _ARM_ARCH_6 #define GET_PCB(tmp) \ mrc p15, 0, tmp, c13, c0, 4; \ - add tmp, tmp, #(PC_CURPCB) + add tmp, tmp, #(TD_PCB) #else .Lcurpcb: .word _C_LABEL(__pcpu) + PC_CURPCB Modified: head/sys/arm/arm/copystr.S ============================================================================== --- head/sys/arm/arm/copystr.S Sun Feb 2 20:45:41 2014 (r261414) +++ head/sys/arm/arm/copystr.S Sun Feb 2 20:58:23 2014 (r261415) @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); #ifdef _ARM_ARCH_6 #define GET_PCB(tmp) \ mrc p15, 0, tmp, c13, c0, 4; \ - add tmp, tmp, #(PC_CURPCB) + add tmp, tmp, #(TD_PCB) #else .Lpcb: .word _C_LABEL(__pcpu) + PC_CURPCB Modified: head/sys/arm/arm/fusu.S ============================================================================== --- head/sys/arm/arm/fusu.S Sun Feb 2 20:45:41 2014 (r261414) +++ head/sys/arm/arm/fusu.S Sun Feb 2 20:58:23 2014 (r261415) @@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$"); #ifdef _ARM_ARCH_6 #define GET_PCB(tmp) \ mrc p15, 0, tmp, c13, c0, 4; \ - add tmp, tmp, #(PC_CURPCB) + add tmp, tmp, #(TD_PCB) #else .Lcurpcb: .word _C_LABEL(__pcpu) + PC_CURPCB Modified: head/sys/arm/arm/genassym.c ============================================================================== --- head/sys/arm/arm/genassym.c Sun Feb 2 20:45:41 2014 (r261414) +++ head/sys/arm/arm/genassym.c Sun Feb 2 20:58:23 2014 (r261415) @@ -140,3 +140,4 @@ ASSYM(TRAPFRAMESIZE, sizeof(struct trapf ASSYM(MAXCOMLEN, MAXCOMLEN); ASSYM(NIRQ, NIRQ); +ASSYM(PCPU_SIZE, sizeof(struct pcpu)); Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Sun Feb 2 20:45:41 2014 (r261414) +++ head/sys/arm/arm/machdep.c Sun Feb 2 20:58:23 2014 (r261415) @@ -874,7 +874,7 @@ void pcpu0_init(void) { #if ARM_ARCH_6 || ARM_ARCH_7A || defined(CPU_MV_PJ4B) - set_pcpu(pcpup); + set_curthread(&thread0); #endif pcpu_init(pcpup, 0, sizeof(struct pcpu)); PCPU_SET(curthread, &thread0); Modified: head/sys/arm/arm/mp_machdep.c ============================================================================== --- head/sys/arm/arm/mp_machdep.c Sun Feb 2 20:45:41 2014 (r261414) +++ head/sys/arm/arm/mp_machdep.c Sun Feb 2 20:58:23 2014 (r261415) @@ -177,7 +177,6 @@ init_secondary(int cpu) cpu_tlb_flushID(); pc = &__pcpu[cpu]; - set_pcpu(pc); /* * pcpu_init() updates queue, so it should not be executed in parallel @@ -203,6 +202,7 @@ init_secondary(int cpu) KASSERT(PCPU_GET(idlethread) != NULL, ("no idle thread")); pc->pc_curthread = pc->pc_idlethread; pc->pc_curpcb = pc->pc_idlethread->td_pcb; + set_curthread(pc->pc_idlethread); #ifdef VFP pc->pc_cpu = cpu; Modified: head/sys/arm/arm/swtch.S ============================================================================== --- head/sys/arm/arm/swtch.S Sun Feb 2 20:45:41 2014 (r261414) +++ head/sys/arm/arm/swtch.S Sun Feb 2 20:58:23 2014 (r261415) @@ -89,16 +89,22 @@ __FBSDID("$FreeBSD$"); #define DOMAIN_CLIENT 0x01 #ifdef _ARM_ARCH_6 -#define GET_PCPU(tmp) \ - mrc p15, 0, tmp, c13, c0, 4; +#define GET_PCPU(tmp, tmp2) \ + mrc p15, 0, tmp, c0, c0, 5; \ + and tmp, tmp, #0xf; \ + ldr tmp2, .Lcurpcpu+4; \ + mul tmp, tmp, tmp2; \ + ldr tmp2, .Lcurpcpu; \ + add tmp, tmp, tmp2; #else -.Lcurpcpu: - .word _C_LABEL(__pcpu) -#define GET_PCPU(tmp) \ +#define GET_PCPU(tmp, tmp2) \ ldr tmp, .Lcurpcpu #endif +.Lcurpcpu: + .word _C_LABEL(__pcpu) + .word PCPU_SIZE .Lcpufuncs: .word _C_LABEL(cpufuncs) .Lblocked_lock: @@ -112,7 +118,7 @@ ENTRY(cpu_throw) * r5 = newtd */ - GET_PCPU(r7) + GET_PCPU(r7, r9) #ifdef VFP /* @@ -191,10 +197,15 @@ ENTRY(cpu_throw) ldr r13, [r7, #(PCB_SP)] #endif + GET_PCPU(r6, r4) + /* Hook in a new pcb */ + str r7, [r6, #PC_CURPCB] /* We have a new curthread now so make a note it */ - GET_CURTHREAD_PTR(r6) + add r6, r6, #PC_CURTHREAD str r5, [r6] - +#ifndef ARM_TP_ADDRESS + mcr p15, 0, r5, c13, c0, 4 +#endif /* Set the new tp */ ldr r6, [r5, #(TD_MD + MD_TP)] #ifdef ARM_TP_ADDRESS @@ -207,9 +218,6 @@ ENTRY(cpu_throw) #else mcr p15, 0, r6, c13, c0, 3 #endif - /* Hook in a new pcb */ - GET_PCPU(r6) - str r7, [r6, #PC_CURPCB] add sp, sp, #4; ldmfd sp!, {r4-r7, pc} @@ -231,11 +239,14 @@ ENTRY(cpu_switch) /* Process is now on a processor. */ /* We have a new curthread now so make a note it */ - GET_CURTHREAD_PTR(r7) + GET_PCPU(r7, r2) + add r7, r7, #PC_CURTHREAD str r1, [r7] +#ifndef ARM_TP_ADDRESS + mcr p15, 0, r1, c13, c0, 4 +#endif /* Hook in a new pcb */ - GET_PCPU(r7) ldr r2, [r1, #TD_PCB] str r2, [r7, #PC_CURPCB] @@ -315,7 +326,7 @@ ENTRY(cpu_switch) * a future exception will bounce the backup settings in the fp unit. * XXX vfp_store can't change r4 */ - GET_PCPU(r7) + GET_PCPU(r7, r8) ldr r8, [r7, #(PC_VFPCTHREAD)] cmp r4, r8 /* old thread used vfp? */ bne 1f /* no, don't save */ @@ -440,7 +451,6 @@ ENTRY(cpu_switch) #if defined(SCHED_ULE) && defined(SMP) ldr r6, .Lblocked_lock GET_CURTHREAD_PTR(r3) - 1: ldr r4, [r3, #TD_LOCK] cmp r4, r6 @@ -516,7 +526,7 @@ ENTRY(savectx) * registers and state, and modify the control as needed. * a future exception will bounce the backup settings in the fp unit. */ - GET_PCPU(r7) + GET_PCPU(r7, r4) ldr r4, [r7, #(PC_VFPCTHREAD)] /* vfp thread */ ldr r2, [r7, #(PC_CURTHREAD)] /* current thread */ cmp r4, r2 Modified: head/sys/arm/arm/vfp.c ============================================================================== --- head/sys/arm/arm/vfp.c Sun Feb 2 20:45:41 2014 (r261414) +++ head/sys/arm/arm/vfp.c Sun Feb 2 20:58:23 2014 (r261415) @@ -140,9 +140,11 @@ vfp_bounce(u_int addr, u_int insn, struc u_int fpexc; struct pcb *curpcb; struct thread *vfptd; + int i; if (!vfp_exists) return 1; /* vfp does not exist */ + i = disable_interrupts(I32_bit|F32_bit); fpexc = fmrx(VFPEXC); /* read the vfp exception reg */ if (fpexc & VFPEXC_EN) { vfptd = PCPU_GET(vfpcthread); @@ -164,6 +166,7 @@ vfp_bounce(u_int addr, u_int insn, struc fmxr(VFPEXC, fpexc); /* turn vfp hardware off */ if (vfptd == curthread) { /* kill the process - we do not handle emulation */ + restore_interrupts(i); killproc(curthread->td_proc, "vfp emulation"); return 1; } @@ -173,7 +176,7 @@ vfp_bounce(u_int addr, u_int insn, struc } fpexc |= VFPEXC_EN; fmxr(VFPEXC, fpexc); /* enable the vfp and repeat command */ - curpcb = PCPU_GET(curpcb); + curpcb = curthread->td_pcb; /* If we were the last process to use the VFP, the process did not * use a VFP on another processor, then the registers in the VFP * will still be ours and are current. Eventually, we will make the @@ -183,7 +186,8 @@ vfp_bounce(u_int addr, u_int insn, struc #ifdef SMP curpcb->pcb_vfpcpu = PCPU_GET(cpu); #endif - PCPU_SET(vfpcthread, PCPU_GET(curthread)); + PCPU_SET(vfpcthread, curthread); + restore_interrupts(i); return 0; } @@ -218,7 +222,6 @@ vfp_restore(struct vfp_state *vfpsave) "ldr %0, [%1]\n" /* set old vfpscr */ "mcr p10, 7, %0, cr1, c0, 0\n" : "=&r" (vfpscr) : "r" (vfpsave), "r" (is_d32) : "cc"); - PCPU_SET(vfpcthread, PCPU_GET(curthread)); } } @@ -237,7 +240,7 @@ vfp_store(struct vfp_state *vfpsave) u_int tmp, vfpscr = 0; tmp = fmrx(VFPEXC); /* Is the vfp enabled? */ - if (vfpsave && tmp & VFPEXC_EN) { + if (vfpsave && (tmp & VFPEXC_EN)) { __asm __volatile("stc p11, c0, [%1], #128\n" /* d0-d15 */ "cmp %2, #0\n" /* -D16 or -D32? */ stclne" p11, c0, [%1], #128\n" /* d16-d31 */ @@ -265,6 +268,12 @@ vfp_discard() { u_int tmp = 0; + /* + * No need to protect the access to vfpcthread by disabling + * interrupts, since it's called from cpu_throw(), who is called + * with interrupts disabled. + */ + PCPU_SET(vfpcthread, 0); /* permanent forget about reg */ tmp = fmrx(VFPEXC); tmp &= ~VFPEXC_EN; /* turn off VFP hardware */ Modified: head/sys/arm/include/asmacros.h ============================================================================== --- head/sys/arm/include/asmacros.h Sun Feb 2 20:45:41 2014 (r261414) +++ head/sys/arm/include/asmacros.h Sun Feb 2 20:58:23 2014 (r261415) @@ -241,15 +241,15 @@ name: #ifdef _ARM_ARCH_6 #define AST_LOCALS #define GET_CURTHREAD_PTR(tmp) \ - mrc p15, 0, tmp, c13, c0, 4; \ - add tmp, tmp, #(PC_CURTHREAD) + mrc p15, 0, tmp, c13, c0, 4 #else #define AST_LOCALS ;\ .Lcurthread: ;\ .word _C_LABEL(__pcpu) + PC_CURTHREAD #define GET_CURTHREAD_PTR(tmp) \ - ldr tmp, .Lcurthread + ldr tmp, .Lcurthread \ + ldr tmp, [tmp] #endif #define DO_AST \ @@ -262,7 +262,6 @@ name: bne 2f /* Nope, get out now */ ;\ bic r4, r4, #(I32_bit|F32_bit) ;\ 1: GET_CURTHREAD_PTR(r5) ;\ - ldr r5, [r5] ;\ ldr r1, [r5, #(TD_FLAGS)] ;\ and r1, r1, #(TDF_ASTPENDING|TDF_NEEDRESCHED) ;\ teq r1, #0x00000000 ;\ Modified: head/sys/arm/include/pcpu.h ============================================================================== --- head/sys/arm/include/pcpu.h Sun Feb 2 20:45:41 2014 (r261414) +++ head/sys/arm/include/pcpu.h Sun Feb 2 20:58:23 2014 (r261415) @@ -62,22 +62,32 @@ struct pcpu; extern struct pcpu *pcpup; #if ARM_ARCH_6 || ARM_ARCH_7A /* or ARM_TP_ADDRESS mark REMOVE ME NOTE */ -static inline struct pcpu * -get_pcpu(void) + +#define CPU_MASK (0xf) + +#define get_pcpu() __extension__ ({ \ + int id; \ + __asm __volatile("mrc p15, 0, %0, c0, c0, 5" : "=r" (id)); \ + (pcpup + (id & CPU_MASK)); \ + }) + +static inline struct thread * +get_curthread(void) { - void *pcpu; + void *ret; - __asm __volatile("mrc p15, 0, %0, c13, c0, 4" : "=r" (pcpu)); - return (pcpu); + __asm __volatile("mrc p15, 0, %0, c13, c0, 4" : "=r" (ret)); + return (ret); } static inline void -set_pcpu(void *pcpu) +set_curthread(struct thread *td) { - __asm __volatile("mcr p15, 0, %0, c13, c0, 4" : : "r" (pcpu)); + __asm __volatile("mcr p15, 0, %0, c13, c0, 4" : : "r" (td)); } + static inline void * get_tls(void) { @@ -93,6 +103,9 @@ set_tls(void *tls) __asm __volatile("mcr p15, 0, %0, c13, c0, 3" : : "r" (tls)); } + +#define curthread get_curthread() + #else #define get_pcpu() pcpup #endif From owner-svn-src-head@FreeBSD.ORG Sun Feb 2 21:10:41 2014 Return-Path: Delivered-To: svn-src-head@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 4C8BE2D9; Sun, 2 Feb 2014 21:10:41 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 396D61E7A; Sun, 2 Feb 2014 21:10:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s12LAfUd070929; Sun, 2 Feb 2014 21:10:41 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s12LAetH070925; Sun, 2 Feb 2014 21:10:40 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201402022110.s12LAetH070925@svn.freebsd.org> From: Ruslan Bukin Date: Sun, 2 Feb 2014 21:10:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261416 - head/sys/arm/freescale/vybrid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2014 21:10:41 -0000 Author: br Date: Sun Feb 2 21:10:40 2014 New Revision: 261416 URL: http://svnweb.freebsd.org/changeset/base/261416 Log: o Add prototype for tcon_bypass() used by dcu4 o Add register definition Modified: head/sys/arm/freescale/vybrid/vf_common.h head/sys/arm/freescale/vybrid/vf_tcon.c Modified: head/sys/arm/freescale/vybrid/vf_common.h ============================================================================== --- head/sys/arm/freescale/vybrid/vf_common.h Sun Feb 2 20:58:23 2014 (r261415) +++ head/sys/arm/freescale/vybrid/vf_common.h Sun Feb 2 21:10:40 2014 (r261416) @@ -38,3 +38,5 @@ bus_space_read_1(_sc->bst, _sc->bsh, _reg) #define WRITE1(_sc, _reg, _val) \ bus_space_write_1(_sc->bst, _sc->bsh, _reg, _val) + +uint32_t tcon_bypass(void); Modified: head/sys/arm/freescale/vybrid/vf_tcon.c ============================================================================== --- head/sys/arm/freescale/vybrid/vf_tcon.c Sun Feb 2 20:58:23 2014 (r261415) +++ head/sys/arm/freescale/vybrid/vf_tcon.c Sun Feb 2 21:10:40 2014 (r261416) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #define TCON0_CTRL1 0x00 +#define TCON_BYPASS (1 << 29) struct tcon_softc { struct resource *res[1]; @@ -80,7 +81,7 @@ tcon_bypass(void) sc = tcon_sc; - WRITE4(tcon_sc, TCON0_CTRL1, (1 << 29)); + WRITE4(tcon_sc, TCON0_CTRL1, TCON_BYPASS); return (0); } From owner-svn-src-head@FreeBSD.ORG Sun Feb 2 21:29:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 7E6C0591; Sun, 2 Feb 2014 21:29:58 +0000 (UTC) Date: Sun, 2 Feb 2014 21:29:58 +0000 From: Alexey Dokuchaev To: Nathan Whitehorn Subject: Re: svn commit: r261358 - head/sys/powerpc/conf Message-ID: <20140202212958.GA23660@FreeBSD.org> References: <201402012056.s11Kuod4063897@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201402012056.s11Kuod4063897@svn.freebsd.org> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2014 21:29:58 -0000 On Sat, Feb 01, 2014 at 08:56:50PM +0000, Nathan Whitehorn wrote: > New Revision: 261358 > URL: http://svnweb.freebsd.org/changeset/base/261358 > > Log: > Switch default Book-E scheduler to ULE, which works now, and enable > CAPABILITIES stuff required to make ssh work. Hmm; I've been using ssh(d) on a kernel w/out CAPABILITIES support just fine. Am I missing something? ./danfe From owner-svn-src-head@FreeBSD.ORG Sun Feb 2 21:40:48 2014 Return-Path: Delivered-To: svn-src-head@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 E8E588E2; Sun, 2 Feb 2014 21:40:48 +0000 (UTC) Received: from smtpauth2.wiscmail.wisc.edu (wmauth2.doit.wisc.edu [144.92.197.222]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B39491255; Sun, 2 Feb 2014 21:40:48 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth2.wiscmail.wisc.edu by smtpauth2.wiscmail.wisc.edu (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) id <0N0E00F0013RUV00@smtpauth2.wiscmail.wisc.edu>; Sun, 02 Feb 2014 15:40:46 -0600 (CST) X-Spam-PmxInfo: Server=avs-2, Version=6.0.3.2322014, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2014.2.2.213614, SenderIP=0.0.0.0 X-Spam-Report: AuthenticatedSender=yes, SenderIP=0.0.0.0 Received: from comporellon.tachypleus.net (adsl-76-208-68-77.dsl.mdsnwi.sbcglobal.net [76.208.68.77]) by smtpauth2.wiscmail.wisc.edu (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) with ESMTPSA id <0N0E007211JXFL10@smtpauth2.wiscmail.wisc.edu>; Sun, 02 Feb 2014 15:40:46 -0600 (CST) Message-id: <52EEBB5D.5000409@freebsd.org> Date: Sun, 02 Feb 2014 15:40:45 -0600 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 To: Alexey Dokuchaev Subject: Re: svn commit: r261358 - head/sys/powerpc/conf References: <201402012056.s11Kuod4063897@svn.freebsd.org> <20140202212958.GA23660@FreeBSD.org> In-reply-to: <20140202212958.GA23660@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2014 21:40:49 -0000 On 02/02/14 15:29, Alexey Dokuchaev wrote: > On Sat, Feb 01, 2014 at 08:56:50PM +0000, Nathan Whitehorn wrote: >> New Revision: 261358 >> URL: http://svnweb.freebsd.org/changeset/base/261358 >> >> Log: >> Switch default Book-E scheduler to ULE, which works now, and enable >> CAPABILITIES stuff required to make ssh work. > Hmm; I've been using ssh(d) on a kernel w/out CAPABILITIES support just > fine. Am I missing something? > > ./danfe With a fresh install of head yesterday, it was non-functional. Gave an error during preauth about how it couldn't initialize a sandbox. -Nathan From owner-svn-src-head@FreeBSD.ORG Sun Feb 2 21:44:05 2014 Return-Path: Delivered-To: svn-src-head@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 F1E85A73; Sun, 2 Feb 2014 21:44:04 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DE8181283; Sun, 2 Feb 2014 21:44:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s12Li4Zp084897; Sun, 2 Feb 2014 21:44:04 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s12Li4uu084895; Sun, 2 Feb 2014 21:44:04 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201402022144.s12Li4uu084895@svn.freebsd.org> From: Ian Lepore Date: Sun, 2 Feb 2014 21:44:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261417 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2014 21:44:05 -0000 Author: ian Date: Sun Feb 2 21:44:04 2014 New Revision: 261417 URL: http://svnweb.freebsd.org/changeset/base/261417 Log: Add missing semicolon. Modified: head/sys/arm/include/asmacros.h Modified: head/sys/arm/include/asmacros.h ============================================================================== --- head/sys/arm/include/asmacros.h Sun Feb 2 21:10:40 2014 (r261416) +++ head/sys/arm/include/asmacros.h Sun Feb 2 21:44:04 2014 (r261417) @@ -248,7 +248,7 @@ name: .word _C_LABEL(__pcpu) + PC_CURTHREAD #define GET_CURTHREAD_PTR(tmp) \ - ldr tmp, .Lcurthread \ + ldr tmp, .Lcurthread; \ ldr tmp, [tmp] #endif From owner-svn-src-head@FreeBSD.ORG Sun Feb 2 22:26:31 2014 Return-Path: Delivered-To: svn-src-head@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 8A5FD32D; Sun, 2 Feb 2014 22:26:31 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7673215BB; Sun, 2 Feb 2014 22:26:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s12MQVgd001093; Sun, 2 Feb 2014 22:26:31 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s12MQVCc001092; Sun, 2 Feb 2014 22:26:31 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201402022226.s12MQVCc001092@svn.freebsd.org> From: Olivier Houchard Date: Sun, 2 Feb 2014 22:26:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261418 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2014 22:26:31 -0000 Author: cognet Date: Sun Feb 2 22:26:30 2014 New Revision: 261418 URL: http://svnweb.freebsd.org/changeset/base/261418 Log: Invalidate cachelines for bounce pages on PREREAD too, there may still be stale entries from a previous transfer. Modified: head/sys/arm/arm/busdma_machdep-v6.c Modified: head/sys/arm/arm/busdma_machdep-v6.c ============================================================================== --- head/sys/arm/arm/busdma_machdep-v6.c Sun Feb 2 21:44:04 2014 (r261417) +++ head/sys/arm/arm/busdma_machdep-v6.c Sun Feb 2 22:26:30 2014 (r261418) @@ -1220,6 +1220,17 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus dmat->bounce_zone->total_bounced++; } + if (op & BUS_DMASYNC_PREREAD) { + bpage = STAILQ_FIRST(&map->bpages); + while (bpage != NULL) { + cpu_dcache_inv_range((vm_offset_t)bpage->vaddr, + bpage->datacount); + l2cache_inv_range((vm_offset_t)bpage->vaddr, + (vm_offset_t)bpage->busaddr, + bpage->datacount); + bpage = STAILQ_NEXT(bpage, links); + } + } if (op & BUS_DMASYNC_POSTREAD) { while (bpage != NULL) { vm_offset_t startv; From owner-svn-src-head@FreeBSD.ORG Sun Feb 2 22:40:44 2014 Return-Path: Delivered-To: svn-src-head@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 4754A79C; Sun, 2 Feb 2014 22:40:44 +0000 (UTC) Received: from mail-gw12.york.ac.uk (mail-gw12.york.ac.uk [144.32.129.162]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 078F616C4; Sun, 2 Feb 2014 22:40:43 +0000 (UTC) Received: from ury.york.ac.uk ([144.32.64.162]:44454) by mail-gw12.york.ac.uk with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1WA5cw-00008D-JG; Sun, 02 Feb 2014 22:34:58 +0000 Date: Sun, 2 Feb 2014 22:34:58 +0000 (GMT) From: Gavin Atkinson X-X-Sender: gavin@ury.york.ac.uk To: John Baldwin Subject: Re: svn commit: r261216 - head/sys/dev/pccbb In-Reply-To: <201401271949.s0RJnr7t067977@svn.freebsd.org> Message-ID: References: <201401271949.s0RJnr7t067977@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="830102327-1676614541-1391380498=:33534" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, imp@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2014 22:40:44 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --830102327-1676614541-1391380498=:33534 Content-Type: TEXT/PLAIN; charset=US-ASCII On Mon, 27 Jan 2014, John Baldwin wrote: > Author: jhb > Date: Mon Jan 27 19:49:52 2014 > New Revision: 261216 > URL: http://svnweb.freebsd.org/changeset/base/261216 > > Log: > Explicitly enable I/O and memory decoding in the bridge's command register > when activating an I/O or memory window on the CardBus bridge. This fixes some, but not all of my machines. One in particular, a Toshiba M5 laptop, remains broken by r254263 even with this change. Specificaly, the laptop does not notice when a card is inserted. The attached minimal patch gets things working again, though I don't know if is the correct fix or if a more involved fix is required. dmesg before and after that patch: http://people.freebsd.org/~gavin/m5-dmesg-before.txt http://people.freebsd.org/~gavin/m5-dmesg-after.txt The only difference is the cbb register dump, the one bit that I am setting in the patch. Thanks, Gavin --830102327-1676614541-1391380498=:33534 Content-Type: TEXT/PLAIN; charset=US-ASCII; name=m5-diff-minimal Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename=m5-diff-minimal SW5kZXg6IC91c3Ivc3JjL3N5cy9kZXYvcGNjYmIvcGNjYmJfcGNpLmMNCj09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT0NCi0tLSAvdXNyL3NyYy9zeXMvZGV2L3Bj Y2JiL3BjY2JiX3BjaS5jCShyZXZpc2lvbiAyNjEzNTIpDQorKysgL3Vzci9z cmMvc3lzL2Rldi9wY2NiYi9wY2NiYl9wY2kuYwkod29ya2luZyBjb3B5KQ0K QEAgLTQ3Miw2ICs0NzIsNyBAQA0KIA0KIAkvKiBFbmFibGUgbWVtb3J5IGFj Y2VzcyAqLw0KIAlwY2lfZW5hYmxlX2J1c21hc3RlcihzYy0+ZGV2KTsNCisJ UENJX01BU0tfQ09ORklHKHNjLT5kZXYsIFBDSVJfQ09NTUFORCwgfCBQQ0lN X0NNRF9QT1JURU4sIDIpOw0KIA0KIAkvKiBkaXNhYmxlIExlZ2FjeSBJTyAq Lw0KIAlzd2l0Y2ggKHNjLT5jaGlwc2V0KSB7DQo= --830102327-1676614541-1391380498=:33534-- From owner-svn-src-head@FreeBSD.ORG Sun Feb 2 23:29:52 2014 Return-Path: Delivered-To: svn-src-head@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 754FBEFB; Sun, 2 Feb 2014 23:29:52 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 611D810F7; Sun, 2 Feb 2014 23:29:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s12NTqF9004705; Sun, 2 Feb 2014 23:29:52 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s12NTqbQ004703; Sun, 2 Feb 2014 23:29:52 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201402022329.s12NTqbQ004703@svn.freebsd.org> From: Olivier Houchard Date: Sun, 2 Feb 2014 23:29:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261419 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2014 23:29:52 -0000 Author: cognet Date: Sun Feb 2 23:29:51 2014 New Revision: 261419 URL: http://svnweb.freebsd.org/changeset/base/261419 Log: Only use the CPU ID register if SMP is defined. Some non-MPCore armv6 cpu, such as the one found in the RPi, don't have it, and just hang when we try to access it. Modified: head/sys/arm/arm/swtch.S head/sys/arm/include/pcpu.h Modified: head/sys/arm/arm/swtch.S ============================================================================== --- head/sys/arm/arm/swtch.S Sun Feb 2 22:26:30 2014 (r261418) +++ head/sys/arm/arm/swtch.S Sun Feb 2 23:29:51 2014 (r261419) @@ -88,7 +88,7 @@ __FBSDID("$FreeBSD$"); #define DOMAIN_CLIENT 0x01 -#ifdef _ARM_ARCH_6 +#if defined(_ARM_ARCH_6) && defined(SMP) #define GET_PCPU(tmp, tmp2) \ mrc p15, 0, tmp, c0, c0, 5; \ and tmp, tmp, #0xf; \ @@ -240,8 +240,7 @@ ENTRY(cpu_switch) /* Process is now on a processor. */ /* We have a new curthread now so make a note it */ GET_PCPU(r7, r2) - add r7, r7, #PC_CURTHREAD - str r1, [r7] + str r1, [r7, #PC_CURTHREAD] #ifndef ARM_TP_ADDRESS mcr p15, 0, r1, c13, c0, 4 #endif Modified: head/sys/arm/include/pcpu.h ============================================================================== --- head/sys/arm/include/pcpu.h Sun Feb 2 22:26:30 2014 (r261418) +++ head/sys/arm/include/pcpu.h Sun Feb 2 23:29:51 2014 (r261419) @@ -65,11 +65,15 @@ extern struct pcpu *pcpup; #define CPU_MASK (0xf) +#ifndef SMP +#define get_pcpu() (pcpup) +#else #define get_pcpu() __extension__ ({ \ int id; \ __asm __volatile("mrc p15, 0, %0, c0, c0, 5" : "=r" (id)); \ (pcpup + (id & CPU_MASK)); \ }) +#endif static inline struct thread * get_curthread(void) From owner-svn-src-head@FreeBSD.ORG Mon Feb 3 01:16:33 2014 Return-Path: Delivered-To: svn-src-head@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 65E41327; Mon, 3 Feb 2014 01:16:33 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 51FD71916; Mon, 3 Feb 2014 01:16:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s131GXIq047300; Mon, 3 Feb 2014 01:16:33 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s131GXue047299; Mon, 3 Feb 2014 01:16:33 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201402030116.s131GXue047299@svn.freebsd.org> From: Justin Hibbits Date: Mon, 3 Feb 2014 01:16:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261420 - head/sys/modules/hwpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2014 01:16:33 -0000 Author: jhibbits Date: Mon Feb 3 01:16:32 2014 New Revision: 261420 URL: http://svnweb.freebsd.org/changeset/base/261420 Log: Add missing file to Makefile. MFC after: 1 month X-MFC-with: 261342 Modified: head/sys/modules/hwpmc/Makefile Modified: head/sys/modules/hwpmc/Makefile ============================================================================== --- head/sys/modules/hwpmc/Makefile Sun Feb 2 23:29:51 2014 (r261419) +++ head/sys/modules/hwpmc/Makefile Mon Feb 3 01:16:32 2014 (r261420) @@ -29,7 +29,7 @@ SRCS+= hwpmc_ia64.c .endif .if ${MACHINE_CPUARCH} == "powerpc" -SRCS+= hwpmc_powerpc.c hwpmc_mpc7xxx.c +SRCS+= hwpmc_powerpc.c hwpmc_mpc7xxx.c hwpmc_ppc970.c .endif .if ${MACHINE_CPUARCH} == "sparc64" From owner-svn-src-head@FreeBSD.ORG Mon Feb 3 01:22:51 2014 Return-Path: Delivered-To: svn-src-head@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 B50365F8; Mon, 3 Feb 2014 01:22:51 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 94EBA19AB; Mon, 3 Feb 2014 01:22:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s131Mp36050678; Mon, 3 Feb 2014 01:22:51 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s131MpI5050675; Mon, 3 Feb 2014 01:22:51 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201402030122.s131MpI5050675@svn.freebsd.org> From: Justin Hibbits Date: Mon, 3 Feb 2014 01:22:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261421 - in head/sys: conf dev/iicbus powerpc/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2014 01:22:51 -0000 Author: jhibbits Date: Mon Feb 3 01:22:50 2014 New Revision: 261421 URL: http://svnweb.freebsd.org/changeset/base/261421 Log: Add driver for the ADT7460/ADT7467 fan controller found in later PowerBooks and iBooks. Original work by andreast. MFC after: 1 month Added: head/sys/dev/iicbus/adt746x.c (contents, props changed) Modified: head/sys/conf/files.powerpc head/sys/powerpc/conf/GENERIC Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Mon Feb 3 01:16:32 2014 (r261420) +++ head/sys/conf/files.powerpc Mon Feb 3 01:22:50 2014 (r261421) @@ -33,6 +33,7 @@ dev/hwpmc/hwpmc_powerpc.c optional hwpmc dev/hwpmc/hwpmc_mpc7xxx.c optional hwpmc dev/hwpmc/hwpmc_ppc970.c optional hwpmc dev/iicbus/ad7417.c optional ad7417 powermac +dev/iicbus/adt746x.c optional adt746x powermac dev/iicbus/ds1631.c optional ds1631 powermac dev/iicbus/ds1775.c optional ds1775 powermac dev/iicbus/max6690.c optional max6690 powermac Added: head/sys/dev/iicbus/adt746x.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/iicbus/adt746x.c Mon Feb 3 01:22:50 2014 (r261421) @@ -0,0 +1,664 @@ +/*- + * Copyright (c) 2012 Andreas Tobler + * Copyright (c) 2014 Justin Hibbits + * 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 ``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 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 +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include +#include + +/* ADT746X registers. */ +#define ADT746X_TACH1LOW 0x28 +#define ADT746X_TACH1HIGH 0x29 +#define ADT746X_TACH2LOW 0x2a +#define ADT746X_TACH2HIGH 0x2b +#define ADT746X_PWM1 0x30 +#define ADT746X_PWM2 0x31 +#define ADT746X_DEVICE_ID 0x3d +#define ADT746X_COMPANY_ID 0x3e +#define ADT746X_REV_ID 0x3f +#define ADT746X_CONFIG 0x40 +#define ADT746X_PWM1_CONF 0x5c +#define ADT746X_PWM2_CONF 0x5d +#define ADT746X_MANUAL_MASK 0xe0 + +#define ADT7460_DEV_ID 0x27 +#define ADT7467_DEV_ID 0x68 + +struct adt746x_fan { + struct pmac_fan fan; + device_t dev; + int id; + int setpoint; + int pwm_reg; + int conf_reg; +}; + +struct adt746x_sensor { + struct pmac_therm therm; + device_t dev; + int id; + cell_t reg; + enum { + ADT746X_SENSOR_TEMP, + ADT746X_SENSOR_VOLT, + ADT746X_SENSOR_SPEED + } type; +}; + +struct adt746x_softc { + device_t sc_dev; + struct intr_config_hook enum_hook; + uint32_t sc_addr; + /* The 7467 supports up to 4 fans, 2 voltage and 3 temperature sensors. */ + struct adt746x_fan sc_fans[4]; + int sc_nfans; + struct adt746x_sensor sc_sensors[9]; + int sc_nsensors; + int device_id; + +}; + + +/* Regular bus attachment functions */ + +static int adt746x_probe(device_t); +static int adt746x_attach(device_t); + + +/* Utility functions */ +static void adt746x_attach_fans(device_t dev); +static void adt746x_attach_sensors(device_t dev); +static int adt746x_fill_fan_prop(device_t dev); +static int adt746x_fill_sensor_prop(device_t dev); + +static int adt746x_fan_set_pwm(struct adt746x_fan *fan, int pwm); +static int adt746x_fan_get_pwm(struct adt746x_fan *fan); +static int adt746x_sensor_read(struct adt746x_sensor *sens); +static void adt746x_start(void *xdev); + +/* i2c read/write functions. */ +static int adt746x_write(device_t dev, uint32_t addr, uint8_t reg, + uint8_t *buf); +static int adt746x_read(device_t dev, uint32_t addr, uint8_t reg, + uint8_t *data); + +static device_method_t adt746x_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, adt746x_probe), + DEVMETHOD(device_attach, adt746x_attach), + { 0, 0 }, +}; + +static driver_t adt746x_driver = { + "adt746x", + adt746x_methods, + sizeof(struct adt746x_softc) +}; + +static devclass_t adt746x_devclass; + +DRIVER_MODULE(adt746x, iicbus, adt746x_driver, adt746x_devclass, 0, 0); +static MALLOC_DEFINE(M_ADT746X, "adt746x", "ADT Sensor Information"); + + +/* i2c read/write functions. */ + +static int +adt746x_write(device_t dev, uint32_t addr, uint8_t reg, uint8_t *buff) +{ + uint8_t buf[4]; + int try = 0; + + struct iic_msg msg[] = { + {addr, IIC_M_WR, 2, buf } + }; + + /* Prepare the write msg. */ + buf[0] = reg; + memcpy(buf + 1, buff, 1); + + for (;;) + { + if (iicbus_transfer(dev, msg, 1) == 0) + return (0); + if (++try > 5) { + device_printf(dev, "iicbus write failed\n"); + return (-1); + } + pause("adt746x_write", hz); + } + return (0); +} + +static int +adt746x_read(device_t dev, uint32_t addr, uint8_t reg, uint8_t *data) +{ + uint8_t buf[4]; + int err, try = 0; + + struct iic_msg msg[2] = { + {addr, IIC_M_WR | IIC_M_NOSTOP, 1, ®}, + {addr, IIC_M_RD, 1, buf}, + }; + + for (;;) + { + err = iicbus_transfer(dev, msg, 2); + if (err != 0) + goto retry; + + *data = *((uint8_t*)buf); + return (0); + retry: + if (++try > 5) { + device_printf(dev, "iicbus read failed\n"); + return (-1); + } + pause("adt746x_read", hz); + } +} + +static int +adt746x_probe(device_t dev) +{ + const char *name, *compatible; + struct adt746x_softc *sc; + + name = ofw_bus_get_name(dev); + compatible = ofw_bus_get_compat(dev); + + if (!name) + return (ENXIO); + + if (strcmp(name, "fan") != 0 || + (strcmp(compatible, "adt7460") != 0 && + strcmp(compatible, "adt7467") != 0)) + return (ENXIO); + + sc = device_get_softc(dev); + sc->sc_dev = dev; + sc->sc_addr = iicbus_get_addr(dev); + + device_set_desc(dev, "Apple Thermostat Unit ADT746X"); + + return (0); +} + +static int +adt746x_attach(device_t dev) +{ + struct adt746x_softc *sc; + + sc = device_get_softc(dev); + + sc->enum_hook.ich_func = adt746x_start; + sc->enum_hook.ich_arg = dev; + + /* We have to wait until interrupts are enabled. I2C read and write + * only works if the interrupts are available. + * The unin/i2c is controlled by the htpic on unin. But this is not + * the master. The openpic on mac-io is controlling the htpic. + * This one gets attached after the mac-io probing and then the + * interrupts will be available. + */ + + if (config_intrhook_establish(&sc->enum_hook) != 0) + return (ENOMEM); + + return (0); +} + +static void +adt746x_start(void *xdev) +{ + uint8_t did, cid, rev, conf; + + struct adt746x_softc *sc; + + device_t dev = (device_t)xdev; + + sc = device_get_softc(dev); + + adt746x_read(sc->sc_dev, sc->sc_addr, ADT746X_DEVICE_ID, &did); + adt746x_read(sc->sc_dev, sc->sc_addr, ADT746X_COMPANY_ID, &cid); + adt746x_read(sc->sc_dev, sc->sc_addr, ADT746X_REV_ID, &rev); + adt746x_read(sc->sc_dev, sc->sc_addr, ADT746X_CONFIG, &conf); + + device_printf(dev, "Dev ID %#x, Company ID %#x, Rev ID %#x CNF: %#x\n", + did, cid, rev, conf); + + /* We can get the device id either from 'of' properties or from the chip + itself. This method makes sure we can read the chip, otherwise + we return. */ + + sc->device_id = did; + + conf = 1; + /* Start the ADT7460. */ + if (sc->device_id == ADT7460_DEV_ID) + adt746x_write(sc->sc_dev, sc->sc_addr, ADT746X_CONFIG, &conf); + + /* Detect and attach child devices. */ + adt746x_attach_fans(dev); + adt746x_attach_sensors(dev); + config_intrhook_disestablish(&sc->enum_hook); +} + +/* + * Sensor and fan management + */ +static int +adt746x_fan_set_pwm(struct adt746x_fan *fan, int pwm) +{ + uint8_t reg = 0, manual, mode = 0; + struct adt746x_softc *sc; + uint8_t buf; + + sc = device_get_softc(fan->dev); + + /* Clamp to allowed range */ + pwm = max(fan->fan.min_rpm, pwm); + pwm = min(fan->fan.max_rpm, pwm); + + reg = fan->pwm_reg; + mode = fan->conf_reg; + + /* From the 7460 datasheet: + PWM dutycycle can be programmed from 0% (0x00) to 100% (0xFF) + in steps of 0.39% (256 steps). + */ + buf = (pwm * 100 / 39) - (pwm ? 1 : 0); + fan->setpoint = buf; + + /* Manual mode. */ + adt746x_read(sc->sc_dev, sc->sc_addr, mode, &manual); + manual |= ADT746X_MANUAL_MASK; + adt746x_write(sc->sc_dev, sc->sc_addr, mode, &manual); + + /* Write speed. */ + adt746x_write(sc->sc_dev, sc->sc_addr, reg, &buf); + + return (0); +} + +static int +adt746x_fan_get_pwm(struct adt746x_fan *fan) +{ + uint8_t buf, reg; + uint16_t pwm; + struct adt746x_softc *sc; + + sc = device_get_softc(fan->dev); + + reg = fan->pwm_reg; + + adt746x_read(sc->sc_dev, sc->sc_addr, reg, &buf); + + pwm = (buf * 39 / 100) + (buf ? 1 : 0); + return (pwm); +} + +static int +adt746x_fill_fan_prop(device_t dev) +{ + phandle_t child; + struct adt746x_softc *sc; + u_int *id; + char *location; + int i, id_len, len = 0, location_len, prev_len = 0; + + sc = device_get_softc(dev); + + child = ofw_bus_get_node(dev); + + /* Fill the fan location property. */ + location_len = OF_getprop_alloc(child, "hwctrl-location", 1, (void **)&location); + id_len = OF_getprop_alloc(child, "hwctrl-id", sizeof(cell_t), (void **)&id); + if (location_len == -1 || id_len == -1) { + free(location, M_OFWPROP); + free(id, M_OFWPROP); + return 0; + } + + /* Fill in all the properties for each fan. */ + for (i = 0; i < id_len; i++) { + strlcpy(sc->sc_fans[i].fan.name, location + len, 32); + prev_len = strlen(location + len) + 1; + len += prev_len; + sc->sc_fans[i].id = id[i]; + if (id[i] == 6) { + sc->sc_fans[i].pwm_reg = ADT746X_PWM1; + sc->sc_fans[i].conf_reg = ADT746X_PWM1_CONF; + } else if (id[i] == 7) { + sc->sc_fans[i].pwm_reg = ADT746X_PWM2; + sc->sc_fans[i].conf_reg = ADT746X_PWM2_CONF; + } else { + sc->sc_fans[i].pwm_reg = ADT746X_PWM1 + i; + sc->sc_fans[i].conf_reg = ADT746X_PWM1_CONF + i; + } + sc->sc_fans[i].dev = sc->sc_dev; + sc->sc_fans[i].fan.min_rpm = 5; /* Percent */ + sc->sc_fans[i].fan.max_rpm = 100; + sc->sc_fans[i].fan.read = NULL; + sc->sc_fans[i].fan.set = + (int (*)(struct pmac_fan *, int))(adt746x_fan_set_pwm); + sc->sc_fans[i].fan.default_rpm = sc->sc_fans[i].fan.max_rpm; + } + free(location, M_OFWPROP); + free(id, M_OFWPROP); + + return (i); +} + +static int +adt746x_fill_sensor_prop(device_t dev) +{ + phandle_t child, node; + struct adt746x_softc *sc; + char sens_type[32]; + int i = 0, reg, sensid; + + sc = device_get_softc(dev); + + child = ofw_bus_get_node(dev); + + /* Fill in the sensor properties for each child. */ + for (node = OF_child(child); node != 0; node = OF_peer(node)) { + if (OF_getprop(node, "sensor-id", &sensid, sizeof(sensid)) == -1) + continue; + OF_getprop(node, "location", sc->sc_sensors[i].therm.name, 32); + OF_getprop(node, "device_type", sens_type, sizeof(sens_type)); + if (strcmp(sens_type, "temperature") == 0) + sc->sc_sensors[i].type = ADT746X_SENSOR_TEMP; + else if (strcmp(sens_type, "voltage") == 0) + sc->sc_sensors[i].type = ADT746X_SENSOR_VOLT; + else + sc->sc_sensors[i].type = ADT746X_SENSOR_SPEED; + OF_getprop(node, "reg", ®, sizeof(reg)); + OF_getprop(node, "sensor-id", &sensid, + sizeof(sensid)); + /* This is the i2c register of the sensor. */ + sc->sc_sensors[i].reg = reg; + sc->sc_sensors[i].id = sensid; + OF_getprop(node, "zone", &sc->sc_sensors[i].therm.zone, + sizeof(sc->sc_sensors[i].therm.zone)); + sc->sc_sensors[i].dev = dev; + sc->sc_sensors[i].therm.read = + (int (*)(struct pmac_therm *))adt746x_sensor_read; + if (sc->sc_sensors[i].type == ADT746X_SENSOR_TEMP) { + /* Make up some ranges */ + sc->sc_sensors[i].therm.target_temp = 500 + ZERO_C_TO_K; + sc->sc_sensors[i].therm.max_temp = 800 + ZERO_C_TO_K; + + pmac_thermal_sensor_register(&sc->sc_sensors[i].therm); + } + i++; + } + + return (i); +} + +static int +adt746x_fanrpm_sysctl(SYSCTL_HANDLER_ARGS) +{ + device_t adt; + struct adt746x_softc *sc; + struct adt746x_fan *fan; + int pwm = 0, error; + + adt = arg1; + sc = device_get_softc(adt); + fan = &sc->sc_fans[arg2]; + pwm = adt746x_fan_get_pwm(fan); + error = sysctl_handle_int(oidp, &pwm, 0, req); + + if (error || !req->newptr) + return (error); + + return (adt746x_fan_set_pwm(fan, pwm)); +} + +static void +adt746x_attach_fans(device_t dev) +{ + struct adt746x_softc *sc; + struct sysctl_oid *oid, *fanroot_oid; + struct sysctl_ctx_list *ctx; + phandle_t child; + char sysctl_name[32]; + int i, j; + + sc = device_get_softc(dev); + + sc->sc_nfans = 0; + + child = ofw_bus_get_node(dev); + + /* Count the actual number of fans. */ + sc->sc_nfans = adt746x_fill_fan_prop(dev); + + device_printf(dev, "%d fans detected!\n", sc->sc_nfans); + + if (sc->sc_nfans == 0) { + device_printf(dev, "WARNING: No fans detected!\n"); + return; + } + + ctx = device_get_sysctl_ctx(dev); + fanroot_oid = SYSCTL_ADD_NODE(ctx, + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "fans", + CTLFLAG_RD, 0, "ADT Fan Information"); + + /* Now we can fill the properties into the allocated struct. */ + sc->sc_nfans = adt746x_fill_fan_prop(dev); + + /* Register fans with pmac_thermal */ + for (i = 0; i < sc->sc_nfans; i++) + pmac_thermal_fan_register(&sc->sc_fans[i].fan); + + /* Add sysctls for the fans. */ + for (i = 0; i < sc->sc_nfans; i++) { + for (j = 0; j < strlen(sc->sc_fans[i].fan.name); j++) { + sysctl_name[j] = tolower(sc->sc_fans[i].fan.name[j]); + if (isspace(sysctl_name[j])) + sysctl_name[j] = '_'; + } + sysctl_name[j] = 0; + + sc->sc_fans[i].setpoint = + adt746x_fan_get_pwm(&sc->sc_fans[i]); + + oid = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(fanroot_oid), + OID_AUTO, sysctl_name, CTLFLAG_RD, 0, "Fan Information"); + + /* I use i to pass the fan id. */ + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, + "pwm", CTLTYPE_INT | CTLFLAG_RW, dev, i, + adt746x_fanrpm_sysctl, "I", "Fan PWM in %"); + } + + /* Dump fan location & type. */ + if (bootverbose) { + for (i = 0; i < sc->sc_nfans; i++) { + device_printf(dev, "Fan location: %s", + sc->sc_fans[i].fan.name); + device_printf(dev, " id: %d RPM: %d\n", + sc->sc_fans[i].id, + sc->sc_fans[i].setpoint); + } + } +} + +static int +adt746x_sensor_read(struct adt746x_sensor *sens) +{ + struct adt746x_softc *sc; + uint16_t tmp = 0; + uint16_t val; + uint8_t temp, data[1], data1[1]; + + sc = device_get_softc(sens->dev); + if (sens->type != ADT746X_SENSOR_SPEED) { + if (adt746x_read(sc->sc_dev, sc->sc_addr, sens->reg, + &temp) < 0) + return (-1); + if (sens->type == ADT746X_SENSOR_TEMP) + tmp = 10 * temp + ZERO_C_TO_K; + else + tmp = temp; + } else { + if (adt746x_read(sc->sc_dev, sc->sc_addr, sens->reg, + data) < 0) + return (-1); + if (adt746x_read(sc->sc_dev, sc->sc_addr, sens->reg + 1, + data1) < 0) + return (-1); + val = data[0] + (data1[0] << 8); + /* A value of 0xffff means the fan is stopped. */ + if (val == 0 || val == 0xffff) + tmp = 0; + else + tmp = (90000 * 60) / val; + } + return (tmp); +} + +static int +adt746x_sensor_sysctl(SYSCTL_HANDLER_ARGS) +{ + device_t dev; + struct adt746x_softc *sc; + struct adt746x_sensor *sens; + int value, error; + + dev = arg1; + sc = device_get_softc(dev); + sens = &sc->sc_sensors[arg2]; + + value = sens->therm.read(&sens->therm); + if (value < 0) + return (ENXIO); + + error = sysctl_handle_int(oidp, &value, 0, req); + + return (error); +} + +static void +adt746x_attach_sensors(device_t dev) +{ + struct adt746x_softc *sc; + struct sysctl_oid *oid, *sensroot_oid; + struct sysctl_ctx_list *ctx; + phandle_t child; + char sysctl_name[40]; + const char *unit; + const char *desc; + int i, j; + + + sc = device_get_softc(dev); + sc->sc_nsensors = 0; + child = ofw_bus_get_node(dev); + + /* Count the actual number of sensors. */ + sc->sc_nsensors = adt746x_fill_sensor_prop(dev); + device_printf(dev, "%d sensors detected!\n", sc->sc_nsensors); + if (sc->sc_nsensors == 0) { + device_printf(dev, "WARNING: No sensors detected!\n"); + return; + } + + ctx = device_get_sysctl_ctx(dev); + sensroot_oid = SYSCTL_ADD_NODE(ctx, + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "sensors", + CTLFLAG_RD, 0, "ADT Sensor Information"); + + /* Add the sysctl for the sensors. */ + for (i = 0; i < sc->sc_nsensors; i++) { + for (j = 0; j < strlen(sc->sc_sensors[i].therm.name); j++) { + sysctl_name[j] = tolower(sc->sc_sensors[i].therm.name[j]); + if (isspace(sysctl_name[j])) + sysctl_name[j] = '_'; + } + sysctl_name[j] = 0; + oid = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(sensroot_oid), + OID_AUTO, + sysctl_name, CTLFLAG_RD, 0, + "Sensor Information"); + if (sc->sc_sensors[i].type == ADT746X_SENSOR_TEMP) { + unit = "temp"; + desc = "sensor unit (C)"; + } else if (sc->sc_sensors[i].type == ADT746X_SENSOR_VOLT) { + unit = "volt"; + desc = "sensor unit (mV)"; + } else { + unit = "rpm"; + desc = "sensor unit (RPM)"; + } + /* I use i to pass the sensor id. */ + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, + unit, CTLTYPE_INT | CTLFLAG_RD, dev, i, + adt746x_sensor_sysctl, + sc->sc_sensors[i].type == ADT746X_SENSOR_TEMP ? + "IK" : "I", desc); + } + + /* Dump sensor location & type. */ + if (bootverbose) { + for (i = 0; i < sc->sc_nsensors; i++) { + device_printf(dev, "Sensor location: %s", + sc->sc_sensors[i].therm.name); + device_printf(dev, " type: %d id: %d reg: 0x%x\n", + sc->sc_sensors[i].type, + sc->sc_sensors[i].id, + sc->sc_sensors[i].reg); + } + } +} Modified: head/sys/powerpc/conf/GENERIC ============================================================================== --- head/sys/powerpc/conf/GENERIC Mon Feb 3 01:16:32 2014 (r261420) +++ head/sys/powerpc/conf/GENERIC Mon Feb 3 01:22:50 2014 (r261421) @@ -192,6 +192,7 @@ options AH_SUPPORT_AR5416 device iicbus # I2C bus code device kiic # Keywest I2C device ad7417 # PowerMac7,2 temperature sensor +device adt746x # PowerBook5,8 temperature sensor device ds1631 # PowerMac11,2 temperature sensor device ds1775 # PowerMac7,2 temperature sensor device fcu # Apple Fan Control Unit From owner-svn-src-head@FreeBSD.ORG Mon Feb 3 01:45:08 2014 Return-Path: Delivered-To: svn-src-head@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 2670CC25; Mon, 3 Feb 2014 01:45:08 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 128891B40; Mon, 3 Feb 2014 01:45:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s131j7JZ058603; Mon, 3 Feb 2014 01:45:07 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s131j7Cm058602; Mon, 3 Feb 2014 01:45:07 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201402030145.s131j7Cm058602@svn.freebsd.org> From: Justin Hibbits Date: Mon, 3 Feb 2014 01:45:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261422 - head/contrib/binutils/gas/config X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2014 01:45:08 -0000 Author: jhibbits Date: Mon Feb 3 01:45:07 2014 New Revision: 261422 URL: http://svnweb.freebsd.org/changeset/base/261422 Log: Make gas accept any PowerPC instruction by default. This is a local change, and will not be submitted upstream. Discussed with: nwhitehorn,rdivacky MFC after: 1 month Modified: head/contrib/binutils/gas/config/tc-ppc.c Modified: head/contrib/binutils/gas/config/tc-ppc.c ============================================================================== --- head/contrib/binutils/gas/config/tc-ppc.c Mon Feb 3 01:22:50 2014 (r261421) +++ head/contrib/binutils/gas/config/tc-ppc.c Mon Feb 3 01:45:07 2014 (r261422) @@ -681,7 +681,7 @@ ppc_parse_name (const char *name, expres /* The type of processor we are assembling for. This is one or more of the PPC_OPCODE flags defined in opcode/ppc.h. */ -static unsigned long ppc_cpu = 0; +static unsigned long ppc_cpu = PPC_OPCODE_ANY; /* Whether to target xcoff64/elf64. */ static unsigned int ppc_obj64 = BFD_DEFAULT_TARGET_SIZE == 64; From owner-svn-src-head@FreeBSD.ORG Mon Feb 3 02:52:08 2014 Return-Path: Delivered-To: svn-src-head@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 69CDD6E0; Mon, 3 Feb 2014 02:52:08 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5605010E7; Mon, 3 Feb 2014 02:52:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s132q8OI086004; Mon, 3 Feb 2014 02:52:08 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s132q8M0086003; Mon, 3 Feb 2014 02:52:08 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201402030252.s132q8M0086003@svn.freebsd.org> From: Ian Lepore Date: Mon, 3 Feb 2014 02:52:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261423 - head/sys/dev/mmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2014 02:52:08 -0000 Author: ian Date: Mon Feb 3 02:52:07 2014 New Revision: 261423 URL: http://svnweb.freebsd.org/changeset/base/261423 Log: Add the imx sdhci controller. Modified: head/sys/dev/mmc/mmc.c Modified: head/sys/dev/mmc/mmc.c ============================================================================== --- head/sys/dev/mmc/mmc.c Mon Feb 3 01:45:07 2014 (r261422) +++ head/sys/dev/mmc/mmc.c Mon Feb 3 02:52:07 2014 (r261423) @@ -1762,3 +1762,4 @@ DRIVER_MODULE(mmc, sdhci_pci, mmc_driver DRIVER_MODULE(mmc, sdhci_bcm, mmc_driver, mmc_devclass, NULL, NULL); DRIVER_MODULE(mmc, sdhci_fdt, mmc_driver, mmc_devclass, NULL, NULL); DRIVER_MODULE(mmc, sdhci_ti, mmc_driver, mmc_devclass, NULL, NULL); +DRIVER_MODULE(mmc, sdhci_imx, mmc_driver, mmc_devclass, NULL, NULL); From owner-svn-src-head@FreeBSD.ORG Mon Feb 3 02:56:24 2014 Return-Path: Delivered-To: svn-src-head@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 27F6F8A0; Mon, 3 Feb 2014 02:56:24 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 146941101; Mon, 3 Feb 2014 02:56:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s132uNLX086556; Mon, 3 Feb 2014 02:56:23 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s132uNjk086555; Mon, 3 Feb 2014 02:56:23 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201402030256.s132uNjk086555@svn.freebsd.org> From: Ian Lepore Date: Mon, 3 Feb 2014 02:56:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261424 - head/sys/dev/mmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2014 02:56:24 -0000 Author: ian Date: Mon Feb 3 02:56:23 2014 New Revision: 261424 URL: http://svnweb.freebsd.org/changeset/base/261424 Log: Sort the list. Modified: head/sys/dev/mmc/mmc.c Modified: head/sys/dev/mmc/mmc.c ============================================================================== --- head/sys/dev/mmc/mmc.c Mon Feb 3 02:52:07 2014 (r261423) +++ head/sys/dev/mmc/mmc.c Mon Feb 3 02:56:23 2014 (r261424) @@ -1756,10 +1756,11 @@ static driver_t mmc_driver = { }; static devclass_t mmc_devclass; -DRIVER_MODULE(mmc, ti_mmchs, mmc_driver, mmc_devclass, NULL, NULL); DRIVER_MODULE(mmc, at91_mci, mmc_driver, mmc_devclass, NULL, NULL); -DRIVER_MODULE(mmc, sdhci_pci, mmc_driver, mmc_devclass, NULL, NULL); DRIVER_MODULE(mmc, sdhci_bcm, mmc_driver, mmc_devclass, NULL, NULL); DRIVER_MODULE(mmc, sdhci_fdt, mmc_driver, mmc_devclass, NULL, NULL); -DRIVER_MODULE(mmc, sdhci_ti, mmc_driver, mmc_devclass, NULL, NULL); DRIVER_MODULE(mmc, sdhci_imx, mmc_driver, mmc_devclass, NULL, NULL); +DRIVER_MODULE(mmc, sdhci_pci, mmc_driver, mmc_devclass, NULL, NULL); +DRIVER_MODULE(mmc, sdhci_ti, mmc_driver, mmc_devclass, NULL, NULL); +DRIVER_MODULE(mmc, ti_mmchs, mmc_driver, mmc_devclass, NULL, NULL); + From owner-svn-src-head@FreeBSD.ORG Mon Feb 3 04:22:29 2014 Return-Path: Delivered-To: svn-src-head@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 F0FD52AE; Mon, 3 Feb 2014 04:22: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DCCA11934; Mon, 3 Feb 2014 04:22:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s134MTGp023151; Mon, 3 Feb 2014 04:22:29 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s134MTXA023150; Mon, 3 Feb 2014 04:22:29 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201402030422.s134MTXA023150@svn.freebsd.org> From: Eitan Adler Date: Mon, 3 Feb 2014 04:22:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261428 - head/sbin/dhclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2014 04:22:30 -0000 Author: eadler Date: Mon Feb 3 04:22:29 2014 New Revision: 261428 URL: http://svnweb.freebsd.org/changeset/base/261428 Log: dhclient: change the pidfile's permissions to 644 This change permits non-root users to determine if dhclient is running ('service dhclient status wlan0'). Discussed with: mjg, cperciva Modified: head/sbin/dhclient/dhclient.c Modified: head/sbin/dhclient/dhclient.c ============================================================================== --- head/sbin/dhclient/dhclient.c Mon Feb 3 03:35:43 2014 (r261427) +++ head/sbin/dhclient/dhclient.c Mon Feb 3 04:22:29 2014 (r261428) @@ -393,7 +393,7 @@ main(int argc, char *argv[]) if (path_dhclient_pidfile == NULL) error("asprintf"); } - pidfile = pidfile_open(path_dhclient_pidfile, 0600, &otherpid); + pidfile = pidfile_open(path_dhclient_pidfile, 0644, &otherpid); if (pidfile == NULL) { if (errno == EEXIST) error("dhclient already running, pid: %d.", otherpid); From owner-svn-src-head@FreeBSD.ORG Mon Feb 3 08:13:45 2014 Return-Path: Delivered-To: svn-src-head@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 6A395A0B; Mon, 3 Feb 2014 08:13:45 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4BFF01A2B; Mon, 3 Feb 2014 08:13:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s138DjTK076167; Mon, 3 Feb 2014 08:13:45 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s138DipK076165; Mon, 3 Feb 2014 08:13:44 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201402030813.s138DipK076165@svn.freebsd.org> From: Baptiste Daroussin Date: Mon, 3 Feb 2014 08:13:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261431 - head/contrib/libyaml/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2014 08:13:45 -0000 Author: bapt Date: Mon Feb 3 08:13:44 2014 New Revision: 261431 URL: http://svnweb.freebsd.org/changeset/base/261431 Log: Apply patch for CVE-2013-6393 [1] to fix heap-based buffer overflow when parsing YAML tags. Also apply a patch for hardenning the guards againt the issue The only user in base in yaml is pkg(7) which uses the library a way that it is not affected Submitted by: delphij Obtained from: https://bugzilla.redhat.com/show_bug.cgi?id=1033990 MFC after: 3 days Security: CVE-2013-6393 Modified: head/contrib/libyaml/src/api.c head/contrib/libyaml/src/scanner.c Directory Properties: head/contrib/libyaml/ (props changed) Modified: head/contrib/libyaml/src/api.c ============================================================================== --- head/contrib/libyaml/src/api.c Mon Feb 3 08:04:09 2014 (r261430) +++ head/contrib/libyaml/src/api.c Mon Feb 3 08:13:44 2014 (r261431) @@ -117,7 +117,12 @@ yaml_string_join( YAML_DECLARE(int) yaml_stack_extend(void **start, void **top, void **end) { - void *new_start = yaml_realloc(*start, ((char *)*end - (char *)*start)*2); + void *new_start; + + if ((char *)*end - (char *)*start >= INT_MAX / 2) + return 0; + + new_start = yaml_realloc(*start, ((char *)*end - (char *)*start)*2); if (!new_start) return 0; Modified: head/contrib/libyaml/src/scanner.c ============================================================================== --- head/contrib/libyaml/src/scanner.c Mon Feb 3 08:04:09 2014 (r261430) +++ head/contrib/libyaml/src/scanner.c Mon Feb 3 08:13:44 2014 (r261431) @@ -615,11 +615,14 @@ yaml_parser_decrease_flow_level(yaml_par */ static int -yaml_parser_roll_indent(yaml_parser_t *parser, int column, +yaml_parser_roll_indent(yaml_parser_t *parser, size_t column, int number, yaml_token_type_t type, yaml_mark_t mark); static int -yaml_parser_unroll_indent(yaml_parser_t *parser, int column); +yaml_parser_unroll_indent(yaml_parser_t *parser, size_t column); + +static int +yaml_parser_reset_indent(yaml_parser_t *parser); /* * Token fetchers. @@ -1206,7 +1209,7 @@ yaml_parser_decrease_flow_level(yaml_par */ static int -yaml_parser_roll_indent(yaml_parser_t *parser, int column, +yaml_parser_roll_indent(yaml_parser_t *parser, size_t column, int number, yaml_token_type_t type, yaml_mark_t mark) { yaml_token_t token; @@ -1216,7 +1219,7 @@ yaml_parser_roll_indent(yaml_parser_t *p if (parser->flow_level) return 1; - if (parser->indent < column) + if (parser->indent == -1 || parser->indent < column) { /* * Push the current indentation level to the stack and set the new @@ -1254,7 +1257,7 @@ yaml_parser_roll_indent(yaml_parser_t *p static int -yaml_parser_unroll_indent(yaml_parser_t *parser, int column) +yaml_parser_unroll_indent(yaml_parser_t *parser, size_t column) { yaml_token_t token; @@ -1263,6 +1266,15 @@ yaml_parser_unroll_indent(yaml_parser_t if (parser->flow_level) return 1; + /* + * column is unsigned and parser->indent is signed, so if + * parser->indent is less than zero the conditional in the while + * loop below is incorrect. Guard against that. + */ + + if (parser->indent < 0) + return 1; + /* Loop through the intendation levels in the stack. */ while (parser->indent > column) @@ -1283,6 +1295,41 @@ yaml_parser_unroll_indent(yaml_parser_t } /* + * Pop indentation levels from the indents stack until the current + * level resets to -1. For each intendation level, append the + * BLOCK-END token. + */ + +static int +yaml_parser_reset_indent(yaml_parser_t *parser) +{ + yaml_token_t token; + + /* In the flow context, do nothing. */ + + if (parser->flow_level) + return 1; + + /* Loop through the intendation levels in the stack. */ + + while (parser->indent > -1) + { + /* Create a token and append it to the queue. */ + + TOKEN_INIT(token, YAML_BLOCK_END_TOKEN, parser->mark, parser->mark); + + if (!ENQUEUE(parser, parser->tokens, token)) + return 0; + + /* Pop the indentation level. */ + + parser->indent = POP(parser, parser->indents); + } + + return 1; +} + +/* * Initialize the scanner and produce the STREAM-START token. */ @@ -1338,7 +1385,7 @@ yaml_parser_fetch_stream_end(yaml_parser /* Reset the indentation level. */ - if (!yaml_parser_unroll_indent(parser, -1)) + if (!yaml_parser_reset_indent(parser)) return 0; /* Reset simple keys. */ @@ -1369,7 +1416,7 @@ yaml_parser_fetch_directive(yaml_parser_ /* Reset the indentation level. */ - if (!yaml_parser_unroll_indent(parser, -1)) + if (!yaml_parser_reset_indent(parser)) return 0; /* Reset simple keys. */ @@ -1407,7 +1454,7 @@ yaml_parser_fetch_document_indicator(yam /* Reset the indentation level. */ - if (!yaml_parser_unroll_indent(parser, -1)) + if (!yaml_parser_reset_indent(parser)) return 0; /* Reset simple keys. */ From owner-svn-src-head@FreeBSD.ORG Mon Feb 3 08:15:10 2014 Return-Path: Delivered-To: svn-src-head@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 7F624B5F; Mon, 3 Feb 2014 08: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6C26F1A3A; Mon, 3 Feb 2014 08:15:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s138FA3m076410; Mon, 3 Feb 2014 08:15:10 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s138FAkl076409; Mon, 3 Feb 2014 08:15:10 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201402030815.s138FAkl076409@svn.freebsd.org> From: Rui Paulo Date: Mon, 3 Feb 2014 08:15:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261432 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2014 08:15:10 -0000 Author: rpaulo Date: Mon Feb 3 08:15:09 2014 New Revision: 261432 URL: http://svnweb.freebsd.org/changeset/base/261432 Log: Fix the definition of hg_cmd. MFC after: 3 days Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Mon Feb 3 08:13:44 2014 (r261431) +++ head/sys/conf/newvers.sh Mon Feb 3 08:15:09 2014 (r261432) @@ -133,7 +133,7 @@ fi if [ -d "${SYSDIR}/../.hg" ] ; then for dir in /usr/bin /usr/local/bin; do if [ -x "${dir}/hg" ] ; then - hg_cmd="${dir}/hg -R ${SYSDIR}/../.hg" + hg_cmd="${dir}/hg -R ${SYSDIR}/.." break fi done From owner-svn-src-head@FreeBSD.ORG Mon Feb 3 12:32:41 2014 Return-Path: Delivered-To: svn-src-head@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 A969E27E; Mon, 3 Feb 2014 12:32:41 +0000 (UTC) Received: from fep26.mx.upcmail.net (fep26.mx.upcmail.net [62.179.121.46]) by mx1.freebsd.org (Postfix) with ESMTP id 6506B139A; Mon, 3 Feb 2014 12:32:39 +0000 (UTC) Received: from edge01.upcmail.net ([192.168.13.236]) by viefep26-int.chello.at (InterMail vM.8.01.05.05 201-2260-151-110-20120111) with ESMTP id <20140203123237.DJUS11143.viefep26-int.chello.at@edge01.upcmail.net>; Mon, 3 Feb 2014 13:32:37 +0100 Received: from mole.fafoe.narf.at ([80.109.55.137]) by edge01.upcmail.net with edge id MoYd1n00B2xdvHc01oYdml; Mon, 03 Feb 2014 13:32:37 +0100 X-SourceIP: 80.109.55.137 Received: by mole.fafoe.narf.at (Postfix, from userid 1001) id C572C6D47B; Mon, 3 Feb 2014 13:32:36 +0100 (CET) Date: Mon, 3 Feb 2014 13:32:36 +0100 From: Stefan Farfeleder To: Dimitry Andric Subject: Re: svn commit: r261283 - in head: contrib/libc++ contrib/libc++/include contrib/libc++/include/experimental contrib/libc++/include/ext contrib/libc++/src etc/mtree lib/libc++ sys/sys tools/build/mk Message-ID: <20140203123235.GA1540@mole.fafoe.narf.at> References: <201401300744.s0U7iNLt016044@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201401300744.s0U7iNLt016044@svn.freebsd.org> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2014 12:32:41 -0000 On Thu, Jan 30, 2014 at 07:44:23AM +0000, Dimitry Andric wrote: > Author: dim > Date: Thu Jan 30 07:44:22 2014 > New Revision: 261283 > URL: http://svnweb.freebsd.org/changeset/base/261283 > > Log: > Import libc++ 3.4 release. This contains a lot of bugfixes, and some > preliminary support for C++1y. > > MFC after: 3 weeks Hi Dimitry, Is this expected to change the ABI? I had to recompile the boost libraries to stop my applications from crashing. Stefan From owner-svn-src-head@FreeBSD.ORG Mon Feb 3 15:10:44 2014 Return-Path: Delivered-To: svn-src-head@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 D427C19B; Mon, 3 Feb 2014 15:10:44 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B5E01124C; Mon, 3 Feb 2014 15:10:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s13FAiw0028381; Mon, 3 Feb 2014 15:10:44 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s13FAiUS028380; Mon, 3 Feb 2014 15:10:44 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201402031510.s13FAiUS028380@svn.freebsd.org> From: Warner Losh Date: Mon, 3 Feb 2014 15:10:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261435 - head/usr.sbin/config X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2014 15:10:44 -0000 Author: imp Date: Mon Feb 3 15:10:44 2014 New Revision: 261435 URL: http://svnweb.freebsd.org/changeset/base/261435 Log: Slightly deobfuscate read_file() and likely pessimize the runtime performance by epsilon. (Translation: elminate bogus macros that hid 'returns' making it hard to read and moved a block of code inline rather than at the end of the fuction where it was effectively a 'gosub' kind of goto). Modified: head/usr.sbin/config/mkmakefile.c Modified: head/usr.sbin/config/mkmakefile.c ============================================================================== --- head/usr.sbin/config/mkmakefile.c Mon Feb 3 11:20:32 2014 (r261434) +++ head/usr.sbin/config/mkmakefile.c Mon Feb 3 15:10:44 2014 (r261435) @@ -50,21 +50,6 @@ static const char rcsid[] = #include "config.h" #include "configvers.h" -#define next_word(fp, wd) \ - { char *word = get_word(fp); \ - if (word == (char *)EOF) \ - return; \ - else \ - wd = word; \ - } -#define next_quoted_word(fp, wd) \ - { char *word = get_quoted_word(fp); \ - if (word == (char *)EOF) \ - return; \ - else \ - wd = word; \ - } - static char *tail(char *); static void do_clean(FILE *); static void do_rules(FILE *); @@ -343,7 +328,9 @@ next: goto next; } if (eq(wd, "include")) { - next_quoted_word(fp, wd); + wd = get_quoted_word(fp); + if (wd == (char *)EOF) + return; if (wd == 0) { fprintf(stderr, "%s: missing include filename.\n", fname); @@ -356,7 +343,9 @@ next: goto next; } this = ns(wd); - next_word(fp, wd); + wd = get_word(fp); + if (wd == (char *)EOF) + return; if (wd == 0) { fprintf(stderr, "%s: No type for %s.\n", fname, this); exit(1); @@ -392,11 +381,36 @@ next: exit(1); } nextparam: - next_word(fp, wd); + wd = get_word(fp); + if (wd == (char *)EOF) + return; if (wd == 0) { compile += match; - if (compile && tp == NULL) - goto doneparam; + if (compile && tp == NULL) { + if (std == 0 && nreqs == 0) { + fprintf(stderr, "%s: what is %s optional on?\n", + fname, this); + exit(1); + } + if (filetype == PROFILING && profiling == 0) + goto next; + tp = new_fent(); + tp->f_fn = this; + tp->f_type = filetype; + if (imp_rule) + tp->f_flags |= NO_IMPLCT_RULE; + if (no_obj) + tp->f_flags |= NO_OBJ; + if (before_depend) + tp->f_flags |= BEFORE_DEPEND; + if (nowerror) + tp->f_flags |= NOWERROR; + tp->f_compilewith = compilewith; + tp->f_depends = depends; + tp->f_clean = clean; + tp->f_warn = warning; + tp->f_objprefix = objprefix; + } goto next; } if (eq(wd, "|")) { @@ -428,7 +442,9 @@ nextparam: goto nextparam; } if (eq(wd, "dependency")) { - next_quoted_word(fp, wd); + wd = get_quoted_word(fp); + if (wd == (char *)EOF) + return; if (wd == 0) { fprintf(stderr, "%s: %s missing dependency string.\n", @@ -439,7 +455,9 @@ nextparam: goto nextparam; } if (eq(wd, "clean")) { - next_quoted_word(fp, wd); + wd = get_quoted_word(fp); + if (wd == (char *)EOF) + return; if (wd == 0) { fprintf(stderr, "%s: %s missing clean file list.\n", fname, this); @@ -449,7 +467,9 @@ nextparam: goto nextparam; } if (eq(wd, "compile-with")) { - next_quoted_word(fp, wd); + wd = get_quoted_word(fp); + if (wd == (char *)EOF) + return; if (wd == 0) { fprintf(stderr, "%s: %s missing compile command string.\n", @@ -460,7 +480,9 @@ nextparam: goto nextparam; } if (eq(wd, "warning")) { - next_quoted_word(fp, wd); + wd = get_quoted_word(fp); + if (wd == (char *)EOF) + return; if (wd == 0) { fprintf(stderr, "%s: %s missing warning text string.\n", @@ -471,7 +493,9 @@ nextparam: goto nextparam; } if (eq(wd, "obj-prefix")) { - next_quoted_word(fp, wd); + wd = get_quoted_word(fp); + if (wd == (char *)EOF) + return; if (wd == 0) { printf("%s: %s missing object prefix string.\n", fname, this); @@ -518,38 +542,6 @@ nextparam: goto nextparam; match = 0; goto nextparam; - -doneparam: - if (std == 0 && nreqs == 0) { - fprintf(stderr, "%s: what is %s optional on?\n", - fname, this); - exit(1); - } - - if (wd) { - fprintf(stderr, "%s: syntax error describing %s\n", - fname, this); - exit(1); - } - if (filetype == PROFILING && profiling == 0) - goto next; - tp = new_fent(); - tp->f_fn = this; - tp->f_type = filetype; - if (imp_rule) - tp->f_flags |= NO_IMPLCT_RULE; - if (no_obj) - tp->f_flags |= NO_OBJ; - if (before_depend) - tp->f_flags |= BEFORE_DEPEND; - if (nowerror) - tp->f_flags |= NOWERROR; - tp->f_compilewith = compilewith; - tp->f_depends = depends; - tp->f_clean = clean; - tp->f_warn = warning; - tp->f_objprefix = objprefix; - goto next; } /* From owner-svn-src-head@FreeBSD.ORG Mon Feb 3 16:46:02 2014 Return-Path: Delivered-To: svn-src-head@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 125478EA; Mon, 3 Feb 2014 16:46:02 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D93821A8A; Mon, 3 Feb 2014 16:46:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s13Gk12g064163; Mon, 3 Feb 2014 16:46:01 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s13Gk1mp064162; Mon, 3 Feb 2014 16:46:01 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201402031646.s13Gk1mp064162@svn.freebsd.org> From: Warner Losh Date: Mon, 3 Feb 2014 16:46:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261436 - head/usr.sbin/config X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2014 16:46:02 -0000 Author: imp Date: Mon Feb 3 16:46:01 2014 New Revision: 261436 URL: http://svnweb.freebsd.org/changeset/base/261436 Log: In the 17 years since r30796, the mandatory keyword has never been used in any files as far as I can tell, and is currently unused. Retire it. Modified: head/usr.sbin/config/mkmakefile.c Modified: head/usr.sbin/config/mkmakefile.c ============================================================================== --- head/usr.sbin/config/mkmakefile.c Mon Feb 3 15:10:44 2014 (r261435) +++ head/usr.sbin/config/mkmakefile.c Mon Feb 3 16:46:01 2014 (r261436) @@ -299,7 +299,7 @@ read_file(char *fname) char *wd, *this, *compilewith, *depends, *clean, *warning; const char *objprefix; int compile, match, nreqs, std, filetype, - imp_rule, no_obj, before_depend, mandatory, nowerror; + imp_rule, no_obj, before_depend, nowerror; fp = fopen(fname, "r"); if (fp == 0) @@ -307,7 +307,7 @@ read_file(char *fname) next: /* * include "filename" - * filename [ standard | mandatory | optional ] + * filename [ standard | optional ] * [ dev* [ | dev* ... ] | profiling-routine ] [ no-obj ] * [ compile-with "compile rule" [no-implicit-rule] ] * [ dependency "dependency-list"] [ before-depend ] @@ -358,7 +358,7 @@ next: depends = 0; clean = 0; warning = 0; - std = mandatory = 0; + std = 0; imp_rule = 0; no_obj = 0; before_depend = 0; @@ -367,16 +367,9 @@ next: objprefix = ""; if (eq(wd, "standard")) { std = 1; - /* - * If an entry is marked "mandatory", config will abort if it's - * not called by a configuration line in the config file. Apart - * from this, the device is handled like one marked "optional". - */ - } else if (eq(wd, "mandatory")) { - mandatory = 1; } else if (!eq(wd, "optional")) { fprintf(stderr, - "%s: \"%s\" %s must be optional, mandatory or standard\n", + "%s: \"%s\" %s must be optional or standard\n", fname, wd, this); exit(1); } @@ -526,11 +519,6 @@ nextparam: dp->d_done |= DEVDONE; goto nextparam; } - if (mandatory) { - fprintf(stderr, "%s: mandatory device \"%s\" not found\n", - fname, wd); - exit(1); - } if (std) { fprintf(stderr, "standard entry %s has a device keyword - %s!\n", From owner-svn-src-head@FreeBSD.ORG Mon Feb 3 16:47:11 2014 Return-Path: Delivered-To: svn-src-head@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 61E9BA32; Mon, 3 Feb 2014 16:47:11 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4E4EC1A98; Mon, 3 Feb 2014 16:47:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s13GlBjt064283; Mon, 3 Feb 2014 16:47:11 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s13GlBVB064282; Mon, 3 Feb 2014 16:47:11 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201402031647.s13GlBVB064282@svn.freebsd.org> From: Warner Losh Date: Mon, 3 Feb 2014 16:47:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261437 - head/usr.sbin/config X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2014 16:47:11 -0000 Author: imp Date: Mon Feb 3 16:47:10 2014 New Revision: 261437 URL: http://svnweb.freebsd.org/changeset/base/261437 Log: Don't believe we have a requirement until after we've checked all the known key words. This will make error messages slightly better in weird corner cases, but should otherwise be a nop. Modified: head/usr.sbin/config/mkmakefile.c Modified: head/usr.sbin/config/mkmakefile.c ============================================================================== --- head/usr.sbin/config/mkmakefile.c Mon Feb 3 16:46:01 2014 (r261436) +++ head/usr.sbin/config/mkmakefile.c Mon Feb 3 16:47:10 2014 (r261437) @@ -497,7 +497,6 @@ nextparam: objprefix = ns(wd); goto nextparam; } - nreqs++; if (eq(wd, "local")) { filetype = LOCAL; goto nextparam; @@ -514,6 +513,7 @@ nextparam: nowerror = 1; goto nextparam; } + nreqs++; STAILQ_FOREACH(dp, &dtab, d_next) if (eq(dp->d_name, wd)) { dp->d_done |= DEVDONE; From owner-svn-src-head@FreeBSD.ORG Mon Feb 3 16:54:53 2014 Return-Path: Delivered-To: svn-src-head@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 EAC63E08; Mon, 3 Feb 2014 16:54:53 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D727E1B89; Mon, 3 Feb 2014 16:54:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s13GsrXe067459; Mon, 3 Feb 2014 16:54:53 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s13Gsr6w067457; Mon, 3 Feb 2014 16:54:53 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201402031654.s13Gsr6w067457@svn.freebsd.org> From: Warner Losh Date: Mon, 3 Feb 2014 16:54:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261438 - head/usr.sbin/config X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2014 16:54:54 -0000 Author: imp Date: Mon Feb 3 16:54:53 2014 New Revision: 261438 URL: http://svnweb.freebsd.org/changeset/base/261438 Log: Move the check for standard keyword + optional inclusion specifier to its proper location. Otherwise you could have 'file.c standard pci' without an error. This construct isn't in our tree, and has no well defined meaning. Modified: head/usr.sbin/config/mkmakefile.c Modified: head/usr.sbin/config/mkmakefile.c ============================================================================== --- head/usr.sbin/config/mkmakefile.c Mon Feb 3 16:47:10 2014 (r261437) +++ head/usr.sbin/config/mkmakefile.c Mon Feb 3 16:54:53 2014 (r261438) @@ -513,18 +513,18 @@ nextparam: nowerror = 1; goto nextparam; } + if (std) { + fprintf(stderr, + "standard entry %s has optional inclusion specifier %s!\n", + this, wd); + exit(1); + } nreqs++; STAILQ_FOREACH(dp, &dtab, d_next) if (eq(dp->d_name, wd)) { dp->d_done |= DEVDONE; goto nextparam; } - if (std) { - fprintf(stderr, - "standard entry %s has a device keyword - %s!\n", - this, wd); - exit(1); - } SLIST_FOREACH(op, &opt, op_next) if (op->op_value == 0 && opteq(op->op_name, wd)) goto nextparam; From owner-svn-src-head@FreeBSD.ORG Mon Feb 3 17:03:32 2014 Return-Path: Delivered-To: svn-src-head@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 1770A1EF; Mon, 3 Feb 2014 17:03:32 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CF7371C64; Mon, 3 Feb 2014 17:03:31 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s13H3UF9099157 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 3 Feb 2014 09:03:31 -0800 (PST) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s13H3UIo099156; Mon, 3 Feb 2014 09:03:30 -0800 (PST) (envelope-from jmg) Date: Mon, 3 Feb 2014 09:03:30 -0800 From: John-Mark Gurney To: Ian Lepore Subject: Re: svn commit: r261424 - head/sys/dev/mmc Message-ID: <20140203170330.GC89104@funkthat.com> References: <201402030256.s132uNjk086555@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201402030256.s132uNjk086555@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Mon, 03 Feb 2014 09:03:31 -0800 (PST) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2014 17:03:32 -0000 Ian Lepore wrote this message on Mon, Feb 03, 2014 at 02:56 +0000: > Author: ian > Date: Mon Feb 3 02:56:23 2014 > New Revision: 261424 > URL: http://svnweb.freebsd.org/changeset/base/261424 > > Log: > Sort the list. > > Modified: > head/sys/dev/mmc/mmc.c > > Modified: head/sys/dev/mmc/mmc.c > ============================================================================== > --- head/sys/dev/mmc/mmc.c Mon Feb 3 02:52:07 2014 (r261423) > +++ head/sys/dev/mmc/mmc.c Mon Feb 3 02:56:23 2014 (r261424) > @@ -1756,10 +1756,11 @@ static driver_t mmc_driver = { > }; > static devclass_t mmc_devclass; > > -DRIVER_MODULE(mmc, ti_mmchs, mmc_driver, mmc_devclass, NULL, NULL); > DRIVER_MODULE(mmc, at91_mci, mmc_driver, mmc_devclass, NULL, NULL); > -DRIVER_MODULE(mmc, sdhci_pci, mmc_driver, mmc_devclass, NULL, NULL); > DRIVER_MODULE(mmc, sdhci_bcm, mmc_driver, mmc_devclass, NULL, NULL); > DRIVER_MODULE(mmc, sdhci_fdt, mmc_driver, mmc_devclass, NULL, NULL); > -DRIVER_MODULE(mmc, sdhci_ti, mmc_driver, mmc_devclass, NULL, NULL); > DRIVER_MODULE(mmc, sdhci_imx, mmc_driver, mmc_devclass, NULL, NULL); > +DRIVER_MODULE(mmc, sdhci_pci, mmc_driver, mmc_devclass, NULL, NULL); > +DRIVER_MODULE(mmc, sdhci_ti, mmc_driver, mmc_devclass, NULL, NULL); > +DRIVER_MODULE(mmc, ti_mmchs, mmc_driver, mmc_devclass, NULL, NULL); > + Is there a reason we don't make mmc_driver/mmc_devclass global and put all of these defines in their respective file instead of poluting an MI file w/ MD info? -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Mon Feb 3 17:21:36 2014 Return-Path: Delivered-To: svn-src-head@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 B73F677E; Mon, 3 Feb 2014 17:21:36 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A3B551DBB; Mon, 3 Feb 2014 17:21:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s13HLaIT078401; Mon, 3 Feb 2014 17:21:36 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s13HLaSM078400; Mon, 3 Feb 2014 17:21:36 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201402031721.s13HLaSM078400@svn.freebsd.org> From: Luiz Otavio O Souza Date: Mon, 3 Feb 2014 17:21:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261439 - head/sys/geom/uncompress X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2014 17:21:36 -0000 Author: loos Date: Mon Feb 3 17:21:36 2014 New Revision: 261439 URL: http://svnweb.freebsd.org/changeset/base/261439 Log: Remove some unnecessary code. The offsets read from the first block are overwritten a few lines bellow. Reviewed by: ray Approved by: adrian (mentor) Modified: head/sys/geom/uncompress/g_uncompress.c Modified: head/sys/geom/uncompress/g_uncompress.c ============================================================================== --- head/sys/geom/uncompress/g_uncompress.c Mon Feb 3 16:54:53 2014 (r261438) +++ head/sys/geom/uncompress/g_uncompress.c Mon Feb 3 17:21:36 2014 (r261439) @@ -451,7 +451,7 @@ g_uncompress_taste(struct g_class *mp, s struct g_provider *pp2; struct g_consumer *cp; struct g_geom *gp; - uint32_t i, total_offsets, offsets_read, type; + uint32_t i, total_offsets, type; uint8_t *buf; int error; @@ -546,21 +546,15 @@ g_uncompress_taste(struct g_class *mp, s gp->name, sc->nblocks); goto err; } - sc->offsets = malloc( - total_offsets * sizeof(uint64_t), M_GEOM_UNCOMPRESS, M_WAITOK); - offsets_read = MIN(total_offsets, - (pp->sectorsize - sizeof(*header)) / sizeof(uint64_t)); - for (i = 0; i < offsets_read; i++) - sc->offsets[i] = be64toh(((uint64_t *) (header + 1))[i]); - DPRINTF(("%s: %u offsets in the first sector\n", - gp->name, offsets_read)); - free(buf, M_GEOM); + i = roundup((sizeof(struct cloop_header) + total_offsets * sizeof(uint64_t)),pp->sectorsize); buf = g_read_data(cp, 0, i, NULL); if (buf == NULL) goto err; + sc->offsets = malloc(total_offsets * sizeof(uint64_t), + M_GEOM_UNCOMPRESS, M_WAITOK); for (i = 0; i <= total_offsets; i++) { sc->offsets[i] = be64toh(((uint64_t *) (buf+sizeof(struct cloop_header)))[i]); From owner-svn-src-head@FreeBSD.ORG Mon Feb 3 17:25:37 2014 Return-Path: Delivered-To: svn-src-head@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 5E4C4906; Mon, 3 Feb 2014 17:25:37 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4AC281DE0; Mon, 3 Feb 2014 17:25:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s13HPb3M078759; Mon, 3 Feb 2014 17:25:37 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s13HPb4Z078758; Mon, 3 Feb 2014 17:25:37 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201402031725.s13HPb4Z078758@svn.freebsd.org> From: Luiz Otavio O Souza Date: Mon, 3 Feb 2014 17:25:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261440 - head/sys/geom/uncompress X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2014 17:25:37 -0000 Author: loos Date: Mon Feb 3 17:25:36 2014 New Revision: 261440 URL: http://svnweb.freebsd.org/changeset/base/261440 Log: Fix a logic error. Because of this inflateReset() wasn't being called and the output buffer wasn't being cleared between the inflate() calls, producing zeroed output after the first inflate() call. This fixes the read of mkuzip(8) images with geom_uncompress(4). Reviewed by: ray Approved by: adrian (mentor) Modified: head/sys/geom/uncompress/g_uncompress.c Modified: head/sys/geom/uncompress/g_uncompress.c ============================================================================== --- head/sys/geom/uncompress/g_uncompress.c Mon Feb 3 17:21:36 2014 (r261439) +++ head/sys/geom/uncompress/g_uncompress.c Mon Feb 3 17:25:36 2014 (r261440) @@ -264,7 +264,7 @@ g_uncompress_done(struct bio *bp) err = (inflate(sc->zs, Z_FINISH) != Z_STREAM_END) ? 1 : 0; - if ((err) && (inflateReset(sc->zs) != Z_OK)) + if ((err) || (inflateReset(sc->zs) != Z_OK)) printf("%s: UZIP decoder reset failed\n", gp->name); break; From owner-svn-src-head@FreeBSD.ORG Mon Feb 3 17:37:25 2014 Return-Path: Delivered-To: svn-src-head@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 DE5BCE2E for ; Mon, 3 Feb 2014 17:37:25 +0000 (UTC) Received: from p3plsmtpa08-09.prod.phx3.secureserver.net (p3plsmtpa08-09.prod.phx3.secureserver.net [173.201.193.110]) by mx1.freebsd.org (Postfix) with ESMTP id BE73B1FC4 for ; Mon, 3 Feb 2014 17:37:25 +0000 (UTC) Received: from [192.168.0.11] ([72.219.152.189]) by p3plsmtpa08-09.prod.phx3.secureserver.net with id MtdJ1n00U45SSWY01tdKVB; Mon, 03 Feb 2014 10:37:19 -0700 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: LOCAL MAP OPTIMIZATION FOR : mail-archive.com (Less Than $99/Month) From: Bart Cleveland | PV Brokers Message-Id: Date: Mon, 3 Feb 2014 09:37:20 -0800 To: "svn-src-head@freebsd.org" Mime-Version: 1.0 (1.0) X-Mailer: iPad Mail (11B554a) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2014 17:37:25 -0000 Pvbrokers@me.com 310 872-0778 Sent from my iPad From owner-svn-src-head@FreeBSD.ORG Mon Feb 3 18:31:51 2014 Return-Path: Delivered-To: svn-src-head@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 BD588E07; Mon, 3 Feb 2014 18:31:51 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8FDF6158F; Mon, 3 Feb 2014 18:31:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s13IVpaC003948; Mon, 3 Feb 2014 18:31:51 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s13IVpaw003947; Mon, 3 Feb 2014 18:31:51 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201402031831.s13IVpaw003947@svn.freebsd.org> From: Warner Losh Date: Mon, 3 Feb 2014 18:31:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261442 - head/usr.sbin/config X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2014 18:31:51 -0000 Author: imp Date: Mon Feb 3 18:31:51 2014 New Revision: 261442 URL: http://svnweb.freebsd.org/changeset/base/261442 Log: Better error messages when EOF is hit in the middle of a phrase. Modified: head/usr.sbin/config/mkmakefile.c Modified: head/usr.sbin/config/mkmakefile.c ============================================================================== --- head/usr.sbin/config/mkmakefile.c Mon Feb 3 17:33:06 2014 (r261441) +++ head/usr.sbin/config/mkmakefile.c Mon Feb 3 18:31:51 2014 (r261442) @@ -329,9 +329,7 @@ next: } if (eq(wd, "include")) { wd = get_quoted_word(fp); - if (wd == (char *)EOF) - return; - if (wd == 0) { + if (wd == (char *)EOF || wd == 0) { fprintf(stderr, "%s: missing include filename.\n", fname); exit(1); @@ -436,9 +434,7 @@ nextparam: } if (eq(wd, "dependency")) { wd = get_quoted_word(fp); - if (wd == (char *)EOF) - return; - if (wd == 0) { + if (wd == (char *)EOF || wd == 0) { fprintf(stderr, "%s: %s missing dependency string.\n", fname, this); @@ -449,9 +445,7 @@ nextparam: } if (eq(wd, "clean")) { wd = get_quoted_word(fp); - if (wd == (char *)EOF) - return; - if (wd == 0) { + if (wd == (char *)EOF || wd == 0) { fprintf(stderr, "%s: %s missing clean file list.\n", fname, this); exit(1); @@ -461,9 +455,7 @@ nextparam: } if (eq(wd, "compile-with")) { wd = get_quoted_word(fp); - if (wd == (char *)EOF) - return; - if (wd == 0) { + if (wd == (char *)EOF || wd == 0) { fprintf(stderr, "%s: %s missing compile command string.\n", fname, this); @@ -474,9 +466,7 @@ nextparam: } if (eq(wd, "warning")) { wd = get_quoted_word(fp); - if (wd == (char *)EOF) - return; - if (wd == 0) { + if (wd == (char *)EOF || wd == 0) { fprintf(stderr, "%s: %s missing warning text string.\n", fname, this); @@ -487,9 +477,7 @@ nextparam: } if (eq(wd, "obj-prefix")) { wd = get_quoted_word(fp); - if (wd == (char *)EOF) - return; - if (wd == 0) { + if (wd == (char *)EOF || wd == 0) { printf("%s: %s missing object prefix string.\n", fname, this); exit(1); From owner-svn-src-head@FreeBSD.ORG Mon Feb 3 18:40:25 2014 Return-Path: Delivered-To: svn-src-head@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 AF5131C6; Mon, 3 Feb 2014 18:40:25 +0000 (UTC) Received: from mail-qa0-x230.google.com (mail-qa0-x230.google.com [IPv6:2607:f8b0:400d:c00::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2050D1628; Mon, 3 Feb 2014 18:40:25 +0000 (UTC) Received: by mail-qa0-f48.google.com with SMTP id f11so10496610qae.21 for ; Mon, 03 Feb 2014 10:40:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type; bh=6MFF0qk+M0yosRw8f/Sc0ivzhgfY8h7PR4jBjcOBoK0=; b=GOOJhrYH+uTQn2IgLaWUkmugE6GPLaf0RKQ42UmwimF/8VWHTBGd2L28aAd2UAwCT8 GymlnF49rC77CuEuCG/yyMjOv7Pwdx/pXzN8yAnS3MqM0dBtrIkmx21ZoQPeIIdmtAik ZyJpckBIuVDJKgjc42CaNqfO5CxcMt+MmwQKld82JtAMIriBft3IWhCSuLepMQFjyuwc +l5FyRWYl/1tBEBzx6RS5N5vLJsOiJtOohwY4nbKQ+2/TgJ8vMgZDTRe7ZuWerqmxgBy nUWhx4lTlVle25MHOh5Nrv3tCHYJLdvTra3PfWO3ACiuIRcCoH8W5mYCgrhEn+CGF9PM 8o1Q== X-Received: by 10.140.109.72 with SMTP id k66mr55507352qgf.20.1391452384278; Mon, 03 Feb 2014 10:33:04 -0800 (PST) Received: from kan.dyndns.org (c-24-63-226-98.hsd1.ma.comcast.net. [24.63.226.98]) by mx.google.com with ESMTPSA id o75sm28289174qgd.11.2014.02.03.10.33.02 for (version=SSLv3 cipher=RC4-SHA bits=128/128); Mon, 03 Feb 2014 10:33:03 -0800 (PST) Date: Mon, 3 Feb 2014 13:32:54 -0500 From: Alexander Kabaev To: Stefan Farfeleder Subject: Re: svn commit: r261283 - in head: contrib/libc++ contrib/libc++/include contrib/libc++/include/experimental contrib/libc++/include/ext contrib/libc++/src etc/mtree lib/libc++ sys/sys tools/build/mk Message-ID: <20140203133254.243db1cd@kan.dyndns.org> In-Reply-To: <20140203123235.GA1540@mole.fafoe.narf.at> References: <201401300744.s0U7iNLt016044@svn.freebsd.org> <20140203123235.GA1540@mole.fafoe.narf.at> X-Mailer: Claws Mail 3.9.3 (GTK+ 2.24.22; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; boundary="Sig_/cdX.g7rR/SW.PG+mntnhpzp"; protocol="application/pgp-signature" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dimitry Andric X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2014 18:40:25 -0000 --Sig_/cdX.g7rR/SW.PG+mntnhpzp Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Mon, 3 Feb 2014 13:32:36 +0100 Stefan Farfeleder wrote: > On Thu, Jan 30, 2014 at 07:44:23AM +0000, Dimitry Andric wrote: > > Author: dim > > Date: Thu Jan 30 07:44:22 2014 > > New Revision: 261283 > > URL: http://svnweb.freebsd.org/changeset/base/261283 > >=20 > > Log: > > Import libc++ 3.4 release. This contains a lot of bugfixes, and > > some preliminary support for C++1y. > > =20 > > MFC after: 3 weeks >=20 > Hi Dimitry, >=20 > Is this expected to change the ABI? I had to recompile the boost > libraries to stop my applications from crashing. >=20 > Stefan More than likely. It does appear libc++ does not go through same pains to maintain ABI stable as libstdc++ does. The lack of all and any symbol versions in shared library binary strongly suggests that not only they do not bother with ABI stability, they simply can't enforce it at the moment even if they wanted to. --=20 Alexander Kabaev --Sig_/cdX.g7rR/SW.PG+mntnhpzp Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iD8DBQFS7+DdQ6z1jMm+XZYRAjO/AJ9blS9Ga4L/m+9bPfoKD1jMjEW6ZgCdEA31 bZPIiXNxCQf3to+wY1SgKjQ= =H3FG -----END PGP SIGNATURE----- --Sig_/cdX.g7rR/SW.PG+mntnhpzp-- From owner-svn-src-head@FreeBSD.ORG Mon Feb 3 18:44:37 2014 Return-Path: Delivered-To: svn-src-head@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 20AF64DC; Mon, 3 Feb 2014 18:44:37 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0CA4716DE; Mon, 3 Feb 2014 18:44:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s13IiaYd008114; Mon, 3 Feb 2014 18:44:36 GMT (envelope-from skreuzer@svn.freebsd.org) Received: (from skreuzer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s13Iia2j008113; Mon, 3 Feb 2014 18:44:36 GMT (envelope-from skreuzer@svn.freebsd.org) Message-Id: <201402031844.s13Iia2j008113@svn.freebsd.org> From: Steven Kreuzer Date: Mon, 3 Feb 2014 18:44:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261443 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2014 18:44:37 -0000 Author: skreuzer (doc,ports committer) Date: Mon Feb 3 18:44:36 2014 New Revision: 261443 URL: http://svnweb.freebsd.org/changeset/base/261443 Log: OpenSSH been updated to 6.5p1. bmake has been updated to version 20140101. Approved by: hrs (mentor) Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon Feb 3 18:31:51 2014 (r261442) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon Feb 3 18:44:36 2014 (r261443) @@ -259,6 +259,15 @@ sendmail has been updated from 8.14.7 to 8.14.8. + + OpenSSH has + been updated to 6.5p1. + + bmake has been + updated to version 20140101. + + libc++ has been + updated to version 3.4. From owner-svn-src-head@FreeBSD.ORG Mon Feb 3 18:54:49 2014 Return-Path: Delivered-To: svn-src-head@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 67526756; Mon, 3 Feb 2014 18:54:49 +0000 (UTC) Received: from tensor.andric.com (unknown [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2007517C1; Mon, 3 Feb 2014 18:54:49 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::4566:b3a4:1c1e:ef35] (unknown [IPv6:2001:7b8:3a7:0:4566:b3a4:1c1e:ef35]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 7E7725C44; Mon, 3 Feb 2014 19:54:23 +0100 (CET) Subject: Re: svn commit: r261283 - in head: contrib/libc++ contrib/libc++/include contrib/libc++/include/experimental contrib/libc++/include/ext contrib/libc++/src etc/mtree lib/libc++ sys/sys tools/build/mk Mime-Version: 1.0 (Mac OS X Mail 7.1 \(1827\)) Content-Type: multipart/signed; boundary="Apple-Mail=_AF2D8332-98CF-49FE-BBE4-0C0DEB311EFC"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.1 (6062eb4) From: Dimitry Andric In-Reply-To: <20140203123235.GA1540@mole.fafoe.narf.at> Date: Mon, 3 Feb 2014 19:54:01 +0100 Message-Id: <13B51A3E-B9C8-4B0C-9834-859ACEBC3375@FreeBSD.org> References: <201401300744.s0U7iNLt016044@svn.freebsd.org> <20140203123235.GA1540@mole.fafoe.narf.at> To: Stefan Farfeleder X-Mailer: Apple Mail (2.1827) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2014 18:54:49 -0000 --Apple-Mail=_AF2D8332-98CF-49FE-BBE4-0C0DEB311EFC Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On 03 Feb 2014, at 13:32, Stefan Farfeleder wrote: > On Thu, Jan 30, 2014 at 07:44:23AM +0000, Dimitry Andric wrote: >> Author: dim >> Date: Thu Jan 30 07:44:22 2014 >> New Revision: 261283 >> URL: http://svnweb.freebsd.org/changeset/base/261283 >> >> Log: >> Import libc++ 3.4 release. This contains a lot of bugfixes, and some >> preliminary support for C++1y. >> >> MFC after: 3 weeks > > Hi Dimitry, > > Is this expected to change the ABI? I had to recompile the boost > libraries to stop my applications from crashing. As far as I know, this should not change the ABI. But maybe boost does something strange, it would not amaze me. Do you have any coredumps or actual crash reports you could share? -Dimitry --Apple-Mail=_AF2D8332-98CF-49FE-BBE4-0C0DEB311EFC Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iEYEARECAAYFAlLv5dwACgkQsF6jCi4glqPcWwCfYdqsNeT3tvoRerUmdzjM+P4e uUsAn2gWKlxm+Jp+y1+JZxIMhTPbk3+e =3eJj -----END PGP SIGNATURE----- --Apple-Mail=_AF2D8332-98CF-49FE-BBE4-0C0DEB311EFC-- From owner-svn-src-head@FreeBSD.ORG Mon Feb 3 18:54:57 2014 Return-Path: Delivered-To: svn-src-head@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 83781889; Mon, 3 Feb 2014 18:54:57 +0000 (UTC) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4C40517C3; Mon, 3 Feb 2014 18:54:57 +0000 (UTC) Received: from [192.168.0.7] (cpc28-cmbg15-2-0-cust64.5-4.cable.virginm.net [86.27.189.65]) (authenticated bits=0) by theravensnest.org (8.14.5/8.14.5) with ESMTP id s13IspRH027607 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Mon, 3 Feb 2014 18:54:53 GMT (envelope-from theraven@FreeBSD.org) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.0 \(1822\)) Subject: Re: svn commit: r261283 - in head: contrib/libc++ contrib/libc++/include contrib/libc++/include/experimental contrib/libc++/include/ext contrib/libc++/src etc/mtree lib/libc++ sys/sys tools/build/mk From: David Chisnall In-Reply-To: <20140203133254.243db1cd@kan.dyndns.org> Date: Mon, 3 Feb 2014 18:54:46 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <73ED697C-09CC-49D6-8EBD-0F0E20232729@FreeBSD.org> References: <201401300744.s0U7iNLt016044@svn.freebsd.org> <20140203123235.GA1540@mole.fafoe.narf.at> <20140203133254.243db1cd@kan.dyndns.org> To: Alexander Kabaev X-Mailer: Apple Mail (2.1822) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Stefan Farfeleder , Dimitry Andric , src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2014 18:54:57 -0000 On 3 Feb 2014, at 18:32, Alexander Kabaev wrote: > More than likely. It does appear libc++ does not go through same pains > to maintain ABI stable as libstdc++ does. The lack of all and any > symbol versions in shared library binary strongly suggests that not > only they do not bother with ABI stability, they simply can't enforce > it at the moment even if they wanted to. libc++ aims to provide a stable ABI, however it does so in a manner that = is intended to integrate with the source language, rather than by = applying linker hacks post facto (which is very hard to do write with = C++). Every std:: class in libc++ is implemented inside a version = namespace inside std, and then imported into std:: in the header. = ABI-breaking classes should be inside a new version namespace. If you have examples where the ABI was not accidentally changed, then = please report them as bugs and we will try to fix them. If you just = have unfounded supposition, then it is not helpful to the discussion. David From owner-svn-src-head@FreeBSD.ORG Mon Feb 3 18:56:42 2014 Return-Path: Delivered-To: svn-src-head@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 153EFB7D; Mon, 3 Feb 2014 18:56: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E95511813; Mon, 3 Feb 2014 18:56:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s13Iufd5012167; Mon, 3 Feb 2014 18:56:41 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s13IufOO012166; Mon, 3 Feb 2014 18:56:41 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201402031856.s13IufOO012166@svn.freebsd.org> From: Warner Losh Date: Mon, 3 Feb 2014 18:56:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261444 - head/usr.sbin/config X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2014 18:56:42 -0000 Author: imp Date: Mon Feb 3 18:56:41 2014 New Revision: 261444 URL: http://svnweb.freebsd.org/changeset/base/261444 Log: Slight cleanup to the error messaging to compress code vertically... Modified: head/usr.sbin/config/mkmakefile.c Modified: head/usr.sbin/config/mkmakefile.c ============================================================================== --- head/usr.sbin/config/mkmakefile.c Mon Feb 3 18:44:36 2014 (r261443) +++ head/usr.sbin/config/mkmakefile.c Mon Feb 3 18:56:41 2014 (r261444) @@ -43,6 +43,7 @@ static const char rcsid[] = #include #include +#include #include #include #include @@ -59,6 +60,15 @@ static void do_before_depend(FILE *); static int opteq(const char *, const char *); static void read_files(void); +static void errout(const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + vfprintf(stderr, fmt, ap); + va_end(ap); + exit(1); +} + /* * Lookup a file, by name. */ @@ -329,11 +339,8 @@ next: } if (eq(wd, "include")) { wd = get_quoted_word(fp); - if (wd == (char *)EOF || wd == 0) { - fprintf(stderr, "%s: missing include filename.\n", - fname); - exit(1); - } + if (wd == (char *)EOF || wd == 0) + errout("%s: missing include filename.\n", fname); (void) snprintf(ifname, sizeof(ifname), "../../%s", wd); read_file(ifname); while (((wd = get_word(fp)) != (char *)EOF) && wd) @@ -344,10 +351,8 @@ next: wd = get_word(fp); if (wd == (char *)EOF) return; - if (wd == 0) { - fprintf(stderr, "%s: No type for %s.\n", fname, this); - exit(1); - } + if (wd == 0) + errout("%s: No type for %s.\n", fname, this); tp = fl_lookup(this); compile = 0; match = 1; @@ -363,14 +368,11 @@ next: nowerror = 0; filetype = NORMAL; objprefix = ""; - if (eq(wd, "standard")) { + if (eq(wd, "standard")) std = 1; - } else if (!eq(wd, "optional")) { - fprintf(stderr, - "%s: \"%s\" %s must be optional or standard\n", + else if (!eq(wd, "optional")) + errout("%s: \"%s\" %s must be optional or standard\n", fname, wd, this); - exit(1); - } nextparam: wd = get_word(fp); if (wd == (char *)EOF) @@ -378,11 +380,9 @@ nextparam: if (wd == 0) { compile += match; if (compile && tp == NULL) { - if (std == 0 && nreqs == 0) { - fprintf(stderr, "%s: what is %s optional on?\n", - fname, this); - exit(1); - } + if (std == 0 && nreqs == 0) + errout("%s: what is %s optional on?\n", + fname, this); if (filetype == PROFILING && profiling == 0) goto next; tp = new_fent(); @@ -405,11 +405,9 @@ nextparam: goto next; } if (eq(wd, "|")) { - if (nreqs == 0) { - fprintf(stderr, "%s: syntax error describing %s\n", + if (nreqs == 0) + errout("%s: syntax error describing %s\n", fname, this); - exit(1); - } compile += match; match = 1; nreqs = 0; @@ -420,11 +418,10 @@ nextparam: goto nextparam; } if (eq(wd, "no-implicit-rule")) { - if (compilewith == 0) { - fprintf(stderr, "%s: alternate rule required when " - "\"no-implicit-rule\" is specified.\n", - fname); - } + if (compilewith == 0) + errout("%s: alternate rule required when " + "\"no-implicit-rule\" is specified for %s.\n", + fname, this); imp_rule++; goto nextparam; } @@ -434,54 +431,41 @@ nextparam: } if (eq(wd, "dependency")) { wd = get_quoted_word(fp); - if (wd == (char *)EOF || wd == 0) { - fprintf(stderr, - "%s: %s missing dependency string.\n", + if (wd == (char *)EOF || wd == 0) + errout("%s: %s missing dependency string.\n", fname, this); - exit(1); - } depends = ns(wd); goto nextparam; } if (eq(wd, "clean")) { wd = get_quoted_word(fp); - if (wd == (char *)EOF || wd == 0) { - fprintf(stderr, "%s: %s missing clean file list.\n", + if (wd == (char *)EOF || wd == 0) + errout("%s: %s missing clean file list.\n", fname, this); - exit(1); - } clean = ns(wd); goto nextparam; } if (eq(wd, "compile-with")) { wd = get_quoted_word(fp); - if (wd == (char *)EOF || wd == 0) { - fprintf(stderr, - "%s: %s missing compile command string.\n", + if (wd == (char *)EOF || wd == 0) + errout("%s: %s missing compile command string.\n", fname, this); - exit(1); - } compilewith = ns(wd); goto nextparam; } if (eq(wd, "warning")) { wd = get_quoted_word(fp); - if (wd == (char *)EOF || wd == 0) { - fprintf(stderr, - "%s: %s missing warning text string.\n", + if (wd == (char *)EOF || wd == 0) + errout("%s: %s missing warning text string.\n", fname, this); - exit(1); - } warning = ns(wd); goto nextparam; } if (eq(wd, "obj-prefix")) { wd = get_quoted_word(fp); - if (wd == (char *)EOF || wd == 0) { - printf("%s: %s missing object prefix string.\n", + if (wd == (char *)EOF || wd == 0) + errout("%s: %s missing object prefix string.\n", fname, this); - exit(1); - } objprefix = ns(wd); goto nextparam; } @@ -501,12 +485,9 @@ nextparam: nowerror = 1; goto nextparam; } - if (std) { - fprintf(stderr, - "standard entry %s has optional inclusion specifier %s!\n", + if (std) + errout("standard entry %s has optional inclusion specifier %s!\n", this, wd); - exit(1); - } nreqs++; STAILQ_FOREACH(dp, &dtab, d_next) if (eq(dp->d_name, wd)) { From owner-svn-src-head@FreeBSD.ORG Mon Feb 3 19:10:33 2014 Return-Path: Delivered-To: svn-src-head@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 9CA631A4; Mon, 3 Feb 2014 19:10:33 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 897FD1984; Mon, 3 Feb 2014 19:10:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s13JAXii017007; Mon, 3 Feb 2014 19:10:33 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s13JAXLG017006; Mon, 3 Feb 2014 19:10:33 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201402031910.s13JAXLG017006@svn.freebsd.org> From: Warner Losh Date: Mon, 3 Feb 2014 19:10:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261445 - head/usr.sbin/config X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2014 19:10:33 -0000 Author: imp Date: Mon Feb 3 19:10:33 2014 New Revision: 261445 URL: http://svnweb.freebsd.org/changeset/base/261445 Log: Fix a bug introduced in r261437 that failed to honor "optional profiling-routine" to work, since profiling-routine is not really an option or a device, but a special case elsewhere in the code. Modified: head/usr.sbin/config/mkmakefile.c Modified: head/usr.sbin/config/mkmakefile.c ============================================================================== --- head/usr.sbin/config/mkmakefile.c Mon Feb 3 18:56:41 2014 (r261444) +++ head/usr.sbin/config/mkmakefile.c Mon Feb 3 19:10:33 2014 (r261445) @@ -477,18 +477,19 @@ nextparam: filetype = NODEPEND; goto nextparam; } - if (eq(wd, "profiling-routine")) { - filetype = PROFILING; - goto nextparam; - } if (eq(wd, "nowerror")) { nowerror = 1; goto nextparam; } + nreqs++; + /* Hack to allow "optional profiling-routine" to work */ + if (eq(wd, "profiling-routine")) { + filetype = PROFILING; + goto nextparam; + } if (std) errout("standard entry %s has optional inclusion specifier %s!\n", this, wd); - nreqs++; STAILQ_FOREACH(dp, &dtab, d_next) if (eq(dp->d_name, wd)) { dp->d_done |= DEVDONE; From owner-svn-src-head@FreeBSD.ORG Mon Feb 3 19:14:36 2014 Return-Path: Delivered-To: svn-src-head@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 E37DD3D5; Mon, 3 Feb 2014 19:14:36 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CF1081A1A; Mon, 3 Feb 2014 19:14:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s13JEaBV019738; Mon, 3 Feb 2014 19:14:36 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s13JEavV019737; Mon, 3 Feb 2014 19:14:36 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201402031914.s13JEavV019737@svn.freebsd.org> From: Warner Losh Date: Mon, 3 Feb 2014 19:14:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261446 - head/usr.sbin/config X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2014 19:14:37 -0000 Author: imp Date: Mon Feb 3 19:14:36 2014 New Revision: 261446 URL: http://svnweb.freebsd.org/changeset/base/261446 Log: Convert the loop by gotos into a for loop to improve readability. I did this only with the inner loop for the token parsing, and not the outer loop which was understandable enough when the extra layers of looping went away... Modified: head/usr.sbin/config/mkmakefile.c Modified: head/usr.sbin/config/mkmakefile.c ============================================================================== --- head/usr.sbin/config/mkmakefile.c Mon Feb 3 19:10:33 2014 (r261445) +++ head/usr.sbin/config/mkmakefile.c Mon Feb 3 19:14:36 2014 (r261446) @@ -373,133 +373,131 @@ next: else if (!eq(wd, "optional")) errout("%s: \"%s\" %s must be optional or standard\n", fname, wd, this); -nextparam: - wd = get_word(fp); - if (wd == (char *)EOF) - return; - if (wd == 0) { - compile += match; - if (compile && tp == NULL) { - if (std == 0 && nreqs == 0) - errout("%s: what is %s optional on?\n", - fname, this); - if (filetype == PROFILING && profiling == 0) - goto next; - tp = new_fent(); - tp->f_fn = this; - tp->f_type = filetype; - if (imp_rule) - tp->f_flags |= NO_IMPLCT_RULE; - if (no_obj) - tp->f_flags |= NO_OBJ; - if (before_depend) - tp->f_flags |= BEFORE_DEPEND; - if (nowerror) - tp->f_flags |= NOWERROR; - tp->f_compilewith = compilewith; - tp->f_depends = depends; - tp->f_clean = clean; - tp->f_warn = warning; - tp->f_objprefix = objprefix; + for (wd = get_word(fp); wd; wd = get_word(fp)) { + if (wd == (char *)EOF) + return; + if (eq(wd, "|")) { + if (nreqs == 0) + errout("%s: syntax error describing %s\n", + fname, this); + compile += match; + match = 1; + nreqs = 0; + continue; } - goto next; - } - if (eq(wd, "|")) { - if (nreqs == 0) - errout("%s: syntax error describing %s\n", - fname, this); - compile += match; - match = 1; - nreqs = 0; - goto nextparam; - } - if (eq(wd, "no-obj")) { - no_obj++; - goto nextparam; - } - if (eq(wd, "no-implicit-rule")) { - if (compilewith == 0) - errout("%s: alternate rule required when " - "\"no-implicit-rule\" is specified for %s.\n", - fname, this); - imp_rule++; - goto nextparam; - } - if (eq(wd, "before-depend")) { - before_depend++; - goto nextparam; - } - if (eq(wd, "dependency")) { - wd = get_quoted_word(fp); - if (wd == (char *)EOF || wd == 0) - errout("%s: %s missing dependency string.\n", - fname, this); - depends = ns(wd); - goto nextparam; - } - if (eq(wd, "clean")) { - wd = get_quoted_word(fp); - if (wd == (char *)EOF || wd == 0) - errout("%s: %s missing clean file list.\n", - fname, this); - clean = ns(wd); - goto nextparam; - } - if (eq(wd, "compile-with")) { - wd = get_quoted_word(fp); - if (wd == (char *)EOF || wd == 0) - errout("%s: %s missing compile command string.\n", - fname, this); - compilewith = ns(wd); - goto nextparam; - } - if (eq(wd, "warning")) { - wd = get_quoted_word(fp); - if (wd == (char *)EOF || wd == 0) - errout("%s: %s missing warning text string.\n", - fname, this); - warning = ns(wd); - goto nextparam; - } - if (eq(wd, "obj-prefix")) { - wd = get_quoted_word(fp); - if (wd == (char *)EOF || wd == 0) - errout("%s: %s missing object prefix string.\n", - fname, this); - objprefix = ns(wd); - goto nextparam; - } - if (eq(wd, "local")) { - filetype = LOCAL; - goto nextparam; - } - if (eq(wd, "no-depend")) { - filetype = NODEPEND; - goto nextparam; - } - if (eq(wd, "nowerror")) { - nowerror = 1; - goto nextparam; - } - nreqs++; - /* Hack to allow "optional profiling-routine" to work */ - if (eq(wd, "profiling-routine")) { - filetype = PROFILING; - goto nextparam; + if (eq(wd, "no-obj")) { + no_obj++; + continue; + } + if (eq(wd, "no-implicit-rule")) { + if (compilewith == 0) + errout("%s: alternate rule required when " + "\"no-implicit-rule\" is specified for" + " %s.\n", + fname, this); + imp_rule++; + continue; + } + if (eq(wd, "before-depend")) { + before_depend++; + continue; + } + if (eq(wd, "dependency")) { + wd = get_quoted_word(fp); + if (wd == (char *)EOF || wd == 0) + errout("%s: %s missing dependency string.\n", + fname, this); + depends = ns(wd); + continue; + } + if (eq(wd, "clean")) { + wd = get_quoted_word(fp); + if (wd == (char *)EOF || wd == 0) + errout("%s: %s missing clean file list.\n", + fname, this); + clean = ns(wd); + continue; + } + if (eq(wd, "compile-with")) { + wd = get_quoted_word(fp); + if (wd == (char *)EOF || wd == 0) + errout("%s: %s missing compile command string.\n", + fname, this); + compilewith = ns(wd); + continue; + } + if (eq(wd, "warning")) { + wd = get_quoted_word(fp); + if (wd == (char *)EOF || wd == 0) + errout("%s: %s missing warning text string.\n", + fname, this); + warning = ns(wd); + continue; + } + if (eq(wd, "obj-prefix")) { + wd = get_quoted_word(fp); + if (wd == (char *)EOF || wd == 0) + errout("%s: %s missing object prefix string.\n", + fname, this); + objprefix = ns(wd); + continue; + } + if (eq(wd, "nowerror")) { + nowerror = 1; + continue; + } + if (eq(wd, "local")) { + filetype = LOCAL; + continue; + } + if (eq(wd, "no-depend")) { + filetype = NODEPEND; + continue; + } + nreqs++; + if (eq(wd, "profiling-routine")) { + filetype = PROFILING; + continue; + } + if (std) + errout("standard entry %s has optional inclusion specifier %s!\n", + this, wd); + STAILQ_FOREACH(dp, &dtab, d_next) + if (eq(dp->d_name, wd)) { + dp->d_done |= DEVDONE; + goto nextparam; + } + SLIST_FOREACH(op, &opt, op_next) + if (op->op_value == 0 && opteq(op->op_name, wd)) + goto nextparam; + match = 0; +nextparam:; + } + compile += match; + if (compile && tp == NULL) { + if (std == 0 && nreqs == 0) + errout("%s: what is %s optional on?\n", + fname, this); + if (filetype == PROFILING && profiling == 0) + goto next; + tp = new_fent(); + tp->f_fn = this; + tp->f_type = filetype; + if (imp_rule) + tp->f_flags |= NO_IMPLCT_RULE; + if (no_obj) + tp->f_flags |= NO_OBJ; + if (before_depend) + tp->f_flags |= BEFORE_DEPEND; + if (nowerror) + tp->f_flags |= NOWERROR; + tp->f_compilewith = compilewith; + tp->f_depends = depends; + tp->f_clean = clean; + tp->f_warn = warning; + tp->f_objprefix = objprefix; } - if (std) - errout("standard entry %s has optional inclusion specifier %s!\n", - this, wd); - STAILQ_FOREACH(dp, &dtab, d_next) - if (eq(dp->d_name, wd)) { - dp->d_done |= DEVDONE; - goto nextparam; - } - SLIST_FOREACH(op, &opt, op_next) - if (op->op_value == 0 && opteq(op->op_name, wd)) - goto nextparam; - match = 0; - goto nextparam; + goto next; } /* From owner-svn-src-head@FreeBSD.ORG Mon Feb 3 20:07:44 2014 Return-Path: Delivered-To: svn-src-head@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 D6FF8526; Mon, 3 Feb 2014 20:07:44 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A80FE1E41; Mon, 3 Feb 2014 20:07:44 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WAPnz-000Hgw-3X; Mon, 03 Feb 2014 20:07:43 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s13K7eDe063456; Mon, 3 Feb 2014 13:07:40 -0700 (MST) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1+M3UDiJTkOuchD49Li+y+A Subject: Re: svn commit: r261424 - head/sys/dev/mmc From: Ian Lepore To: John-Mark Gurney In-Reply-To: <20140203170330.GC89104@funkthat.com> References: <201402030256.s132uNjk086555@svn.freebsd.org> <20140203170330.GC89104@funkthat.com> Content-Type: text/plain; charset="us-ascii" Date: Mon, 03 Feb 2014 13:07:39 -0700 Message-ID: <1391458059.13026.96.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2014 20:07:44 -0000 On Mon, 2014-02-03 at 09:03 -0800, John-Mark Gurney wrote: > Ian Lepore wrote this message on Mon, Feb 03, 2014 at 02:56 +0000: > > Author: ian > > Date: Mon Feb 3 02:56:23 2014 > > New Revision: 261424 > > URL: http://svnweb.freebsd.org/changeset/base/261424 > > > > Log: > > Sort the list. > > > > Modified: > > head/sys/dev/mmc/mmc.c > > > > Modified: head/sys/dev/mmc/mmc.c > > ============================================================================== > > --- head/sys/dev/mmc/mmc.c Mon Feb 3 02:52:07 2014 (r261423) > > +++ head/sys/dev/mmc/mmc.c Mon Feb 3 02:56:23 2014 (r261424) > > @@ -1756,10 +1756,11 @@ static driver_t mmc_driver = { > > }; > > static devclass_t mmc_devclass; > > > > -DRIVER_MODULE(mmc, ti_mmchs, mmc_driver, mmc_devclass, NULL, NULL); > > DRIVER_MODULE(mmc, at91_mci, mmc_driver, mmc_devclass, NULL, NULL); > > -DRIVER_MODULE(mmc, sdhci_pci, mmc_driver, mmc_devclass, NULL, NULL); > > DRIVER_MODULE(mmc, sdhci_bcm, mmc_driver, mmc_devclass, NULL, NULL); > > DRIVER_MODULE(mmc, sdhci_fdt, mmc_driver, mmc_devclass, NULL, NULL); > > -DRIVER_MODULE(mmc, sdhci_ti, mmc_driver, mmc_devclass, NULL, NULL); > > DRIVER_MODULE(mmc, sdhci_imx, mmc_driver, mmc_devclass, NULL, NULL); > > +DRIVER_MODULE(mmc, sdhci_pci, mmc_driver, mmc_devclass, NULL, NULL); > > +DRIVER_MODULE(mmc, sdhci_ti, mmc_driver, mmc_devclass, NULL, NULL); > > +DRIVER_MODULE(mmc, ti_mmchs, mmc_driver, mmc_devclass, NULL, NULL); > > + > > Is there a reason we don't make mmc_driver/mmc_devclass global and put > all of these defines in their respective file instead of poluting an MI > file w/ MD info? > I don't think that's an option. Part of what that macro does is create metadata that says "this module contains a driver that is a child of bus " and I think for that to work right, it has to be in the module itself, not elsewhere (at least in the .ko case; maybe it doesn't matter when it's compiled into the kernel). -- Ian From owner-svn-src-head@FreeBSD.ORG Mon Feb 3 21:51:29 2014 Return-Path: Delivered-To: svn-src-head@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 20F1E2CC; Mon, 3 Feb 2014 21:51:29 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E8A371881; Mon, 3 Feb 2014 21:51:28 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id DD6B6B964; Mon, 3 Feb 2014 16:51:27 -0500 (EST) From: John Baldwin To: Ian Lepore Subject: Re: svn commit: r261424 - head/sys/dev/mmc Date: Mon, 03 Feb 2014 16:33:05 -0500 Message-ID: <3325243.MZLnPn2Brt@ralph.baldwin.cx> User-Agent: KMail/4.10.5 (FreeBSD/10.0-STABLE; KDE/4.10.5; amd64; ; ) In-Reply-To: <1391458059.13026.96.camel@revolution.hippie.lan> References: <201402030256.s132uNjk086555@svn.freebsd.org> <20140203170330.GC89104@funkthat.com> <1391458059.13026.96.camel@revolution.hippie.lan> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 03 Feb 2014 16:51:28 -0500 (EST) Cc: svn-src-head@freebsd.org, John-Mark Gurney , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2014 21:51:29 -0000 On Monday, February 03, 2014 01:07:39 PM Ian Lepore wrote: > On Mon, 2014-02-03 at 09:03 -0800, John-Mark Gurney wrote: > > Ian Lepore wrote this message on Mon, Feb 03, 2014 at 02:56 +0000: > > > Author: ian > > > Date: Mon Feb 3 02:56:23 2014 > > > New Revision: 261424 > > > URL: http://svnweb.freebsd.org/changeset/base/261424 > > > > > > Log: > > > Sort the list. > > > > > > Modified: > > > head/sys/dev/mmc/mmc.c > > > > > > Modified: head/sys/dev/mmc/mmc.c > > > ======================================================================== > > > ====== --- head/sys/dev/mmc/mmc.c Mon Feb 3 02:52:07 2014 (r261423) > > > +++ head/sys/dev/mmc/mmc.c Mon Feb 3 02:56:23 2014 (r261424) > > > @@ -1756,10 +1756,11 @@ static driver_t mmc_driver = { > > > > > > }; > > > static devclass_t mmc_devclass; > > > > > > -DRIVER_MODULE(mmc, ti_mmchs, mmc_driver, mmc_devclass, NULL, NULL); > > > > > > DRIVER_MODULE(mmc, at91_mci, mmc_driver, mmc_devclass, NULL, NULL); > > > > > > -DRIVER_MODULE(mmc, sdhci_pci, mmc_driver, mmc_devclass, NULL, NULL); > > > > > > DRIVER_MODULE(mmc, sdhci_bcm, mmc_driver, mmc_devclass, NULL, NULL); > > > DRIVER_MODULE(mmc, sdhci_fdt, mmc_driver, mmc_devclass, NULL, NULL); > > > > > > -DRIVER_MODULE(mmc, sdhci_ti, mmc_driver, mmc_devclass, NULL, NULL); > > > > > > DRIVER_MODULE(mmc, sdhci_imx, mmc_driver, mmc_devclass, NULL, NULL); > > > > > > +DRIVER_MODULE(mmc, sdhci_pci, mmc_driver, mmc_devclass, NULL, NULL); > > > +DRIVER_MODULE(mmc, sdhci_ti, mmc_driver, mmc_devclass, NULL, NULL); > > > +DRIVER_MODULE(mmc, ti_mmchs, mmc_driver, mmc_devclass, NULL, NULL); > > > + > > > > Is there a reason we don't make mmc_driver/mmc_devclass global and put > > all of these defines in their respective file instead of poluting an MI > > file w/ MD info? > > I don't think that's an option. Part of what that macro does is create > metadata that says "this module contains a driver that is a child of bus > " and I think for that to work right, it has to be in the > module itself, not elsewhere (at least in the .ko case; maybe it doesn't > matter when it's compiled into the kernel). No, it can be anywhere. It's not voodoo magic, it's just a struct and a SYSINIT. John-Mark's suggestion is correct (and I thought the same thing when I saw this commit). You just have to make mmc_driver global. You should make mmc_devclass as well for now. (Side note: the devclass argument to DRIVER_MODULE() is useless in 99.9% of the cases and should be axed entirely. The very few drivers that want to find their devclass can use devclass_find() at runtime instead.) Too bad cpp doesn't support macro overloading, then we could make that change seamlessly. :) -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Feb 3 21:57:58 2014 Return-Path: Delivered-To: svn-src-head@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 5F60E5B8; Mon, 3 Feb 2014 21:57:58 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2DA7C18CD; Mon, 3 Feb 2014 21:57:57 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WARWe-000DmY-GM; Mon, 03 Feb 2014 21:57:56 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s13Lvqge063533; Mon, 3 Feb 2014 14:57:52 -0700 (MST) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1/Ue6Qm8GA/4slyBpsOdInI Subject: Re: svn commit: r261424 - head/sys/dev/mmc From: Ian Lepore To: John Baldwin In-Reply-To: <3325243.MZLnPn2Brt@ralph.baldwin.cx> References: <201402030256.s132uNjk086555@svn.freebsd.org> <20140203170330.GC89104@funkthat.com> <1391458059.13026.96.camel@revolution.hippie.lan> <3325243.MZLnPn2Brt@ralph.baldwin.cx> Content-Type: text/plain; charset="us-ascii" Date: Mon, 03 Feb 2014 14:57:52 -0700 Message-ID: <1391464672.13026.105.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, John-Mark Gurney , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2014 21:57:58 -0000 On Mon, 2014-02-03 at 16:33 -0500, John Baldwin wrote: > On Monday, February 03, 2014 01:07:39 PM Ian Lepore wrote: > > On Mon, 2014-02-03 at 09:03 -0800, John-Mark Gurney wrote: > > > Ian Lepore wrote this message on Mon, Feb 03, 2014 at 02:56 +0000: > > > > Author: ian > > > > Date: Mon Feb 3 02:56:23 2014 > > > > New Revision: 261424 > > > > URL: http://svnweb.freebsd.org/changeset/base/261424 > > > > > > > > Log: > > > > Sort the list. > > > > > > > > Modified: > > > > head/sys/dev/mmc/mmc.c > > > > > > > > Modified: head/sys/dev/mmc/mmc.c > > > > ======================================================================== > > > > ====== --- head/sys/dev/mmc/mmc.c Mon Feb 3 02:52:07 2014 (r261423) > > > > +++ head/sys/dev/mmc/mmc.c Mon Feb 3 02:56:23 2014 (r261424) > > > > @@ -1756,10 +1756,11 @@ static driver_t mmc_driver = { > > > > > > > > }; > > > > static devclass_t mmc_devclass; > > > > > > > > -DRIVER_MODULE(mmc, ti_mmchs, mmc_driver, mmc_devclass, NULL, NULL); > > > > > > > > DRIVER_MODULE(mmc, at91_mci, mmc_driver, mmc_devclass, NULL, NULL); > > > > > > > > -DRIVER_MODULE(mmc, sdhci_pci, mmc_driver, mmc_devclass, NULL, NULL); > > > > > > > > DRIVER_MODULE(mmc, sdhci_bcm, mmc_driver, mmc_devclass, NULL, NULL); > > > > DRIVER_MODULE(mmc, sdhci_fdt, mmc_driver, mmc_devclass, NULL, NULL); > > > > > > > > -DRIVER_MODULE(mmc, sdhci_ti, mmc_driver, mmc_devclass, NULL, NULL); > > > > > > > > DRIVER_MODULE(mmc, sdhci_imx, mmc_driver, mmc_devclass, NULL, NULL); > > > > > > > > +DRIVER_MODULE(mmc, sdhci_pci, mmc_driver, mmc_devclass, NULL, NULL); > > > > +DRIVER_MODULE(mmc, sdhci_ti, mmc_driver, mmc_devclass, NULL, NULL); > > > > +DRIVER_MODULE(mmc, ti_mmchs, mmc_driver, mmc_devclass, NULL, NULL); > > > > + > > > > > > Is there a reason we don't make mmc_driver/mmc_devclass global and put > > > all of these defines in their respective file instead of poluting an MI > > > file w/ MD info? > > > > I don't think that's an option. Part of what that macro does is create > > metadata that says "this module contains a driver that is a child of bus > > " and I think for that to work right, it has to be in the > > module itself, not elsewhere (at least in the .ko case; maybe it doesn't > > matter when it's compiled into the kernel). > > No, it can be anywhere. It's not voodoo magic, it's just a struct and a > SYSINIT. John-Mark's suggestion is correct (and I thought the same thing > when I saw this commit). You just have to make mmc_driver global. You > should make mmc_devclass as well for now. > > (Side note: the devclass argument to DRIVER_MODULE() is useless in 99.9% > of the cases and should be axed entirely. The very few drivers that want > to find their devclass can use devclass_find() at runtime instead.) > > Too bad cpp doesn't support macro overloading, then we could make that > change seamlessly. :) > Interesting, I had no idea. Do we have examples of doing it this other way in the tree now? -- Ian From owner-svn-src-head@FreeBSD.ORG Mon Feb 3 22:00:41 2014 Return-Path: Delivered-To: svn-src-head@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 E2C35759; Mon, 3 Feb 2014 22:00:40 +0000 (UTC) Received: from mail-qc0-x234.google.com (mail-qc0-x234.google.com [IPv6:2607:f8b0:400d:c01::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3D1B918E2; Mon, 3 Feb 2014 22:00:40 +0000 (UTC) Received: by mail-qc0-f180.google.com with SMTP id i17so12054855qcy.25 for ; Mon, 03 Feb 2014 14:00:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type; bh=BrVSpbe7+hpw9Eph1bkQHaIRcnM/R/ZDDoUIR0eXZF8=; b=mGV1WmJ1uGiSVCpYJmD5sPjLPK5xahGsP5fPvCD92MBcFSy4bdH3HXPbwtHrPMEoIB psdkT/pZ8fh/8yHEDL9E+n48RrtN/tvIhjxYLcFf5FeWvxdD7aHA53EGRe1uWpTHCjQa z/l+2Q5eMsM3nsxVSmohVjpDYm07+i5fd5Kea0KpULGx2X1K2Wwp6vftm4wsHuNywa1A 5Zvr46gA468shHmTl8Vd2tGvYBSfcTdYHWD2d8+zTl9WnDeTN9ea4L1eTcWmJ1/bEyI2 Q0CSTrG04uEjCPNosaiRHDOH79MULpx7PUzuQBTxIXGUY6JWoI7iBRaC88pPGsAtLqr2 cpeA== X-Received: by 10.140.47.212 with SMTP id m78mr56791366qga.21.1391464839390; Mon, 03 Feb 2014 14:00:39 -0800 (PST) Received: from kan.dyndns.org (c-24-63-226-98.hsd1.ma.comcast.net. [24.63.226.98]) by mx.google.com with ESMTPSA id o75sm29152853qgd.11.2014.02.03.14.00.37 for (version=SSLv3 cipher=RC4-SHA bits=128/128); Mon, 03 Feb 2014 14:00:38 -0800 (PST) Date: Mon, 3 Feb 2014 17:00:31 -0500 From: Alexander Kabaev To: David Chisnall Subject: Re: svn commit: r261283 - in head: contrib/libc++ contrib/libc++/include contrib/libc++/include/experimental contrib/libc++/include/ext contrib/libc++/src etc/mtree lib/libc++ sys/sys tools/build/mk Message-ID: <20140203170031.2166661c@kan.dyndns.org> In-Reply-To: <73ED697C-09CC-49D6-8EBD-0F0E20232729@FreeBSD.org> References: <201401300744.s0U7iNLt016044@svn.freebsd.org> <20140203123235.GA1540@mole.fafoe.narf.at> <20140203133254.243db1cd@kan.dyndns.org> <73ED697C-09CC-49D6-8EBD-0F0E20232729@FreeBSD.org> X-Mailer: Claws Mail 3.9.3 (GTK+ 2.24.22; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; boundary="Sig_//uik=TAN.5so1N1aJbGJY/t"; protocol="application/pgp-signature" Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Stefan Farfeleder , Dimitry Andric , src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2014 22:00:41 -0000 --Sig_//uik=TAN.5so1N1aJbGJY/t Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Mon, 3 Feb 2014 18:54:46 +0000 David Chisnall wrote: > On 3 Feb 2014, at 18:32, Alexander Kabaev wrote: >=20 > > More than likely. It does appear libc++ does not go through same > > pains to maintain ABI stable as libstdc++ does. The lack of all and > > any symbol versions in shared library binary strongly suggests that > > not only they do not bother with ABI stability, they simply can't > > enforce it at the moment even if they wanted to. >=20 > libc++ aims to provide a stable ABI, however it does so in a manner > that is intended to integrate with the source language, rather than > by applying linker hacks post facto (which is very hard to do write > with C++). Every std:: class in libc++ is implemented inside a > version namespace inside std, and then imported into std:: in the > header. ABI-breaking classes should be inside a new version > namespace. >=20 > If you have examples where the ABI was not accidentally changed, then > please report them as bugs and we will try to fix them. If you just > have unfounded supposition, then it is not helpful to the discussion. >=20 > David At the very least, new library did remove _ZNKSt3__111__libcpp_db12__comparableEPKvS2_ which was public before. Your definition of ABI stability might be different from mine, but in my book that counts as a backward compatibility breakage. And even if that symbol was not supposed to be lined to by anyone, it should not have been exported in the first place. --=20 Alexander Kabaev --Sig_//uik=TAN.5so1N1aJbGJY/t Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iD8DBQFS8BGEQ6z1jMm+XZYRAqlFAKDj7m3vtdD8UCc9e0qYd6zSD0NUjQCdG12v nV42l8t+CTpMXaUCw3ObUIc= =gZfQ -----END PGP SIGNATURE----- --Sig_//uik=TAN.5so1N1aJbGJY/t-- From owner-svn-src-head@FreeBSD.ORG Mon Feb 3 22:16:47 2014 Return-Path: Delivered-To: svn-src-head@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 6B7B6F50; Mon, 3 Feb 2014 22:16:47 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5778D1ACC; Mon, 3 Feb 2014 22:16:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s13MGlxd090430; Mon, 3 Feb 2014 22:16:47 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s13MGlsa090429; Mon, 3 Feb 2014 22:16:47 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402032216.s13MGlsa090429@svn.freebsd.org> From: Christian Brueffer Date: Mon, 3 Feb 2014 22:16:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261447 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2014 22:16:47 -0000 Author: brueffer Date: Mon Feb 3 22:16:46 2014 New Revision: 261447 URL: http://svnweb.freebsd.org/changeset/base/261447 Log: Fix a typo. MFC after: 1 week Modified: head/lib/libc/sys/cap_enter.2 Modified: head/lib/libc/sys/cap_enter.2 ============================================================================== --- head/lib/libc/sys/cap_enter.2 Mon Feb 3 19:14:36 2014 (r261446) +++ head/lib/libc/sys/cap_enter.2 Mon Feb 3 22:16:46 2014 (r261447) @@ -52,7 +52,7 @@ Access to global name spaces, such as fi prevented. If the process is already in a capability mode sandbox, the system call is a no-op. -Future process descendants create with +Future process descendants created with .Xr fork 2 or .Xr pdfork 2 From owner-svn-src-head@FreeBSD.ORG Mon Feb 3 23:53:43 2014 Return-Path: Delivered-To: svn-src-head@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 C84CFCA9; Mon, 3 Feb 2014 23:53:43 +0000 (UTC) Received: from mail.ambrisko.com (mail.ambrisko.com [70.91.206.90]) by mx1.freebsd.org (Postfix) with ESMTP id 7D3F515FB; Mon, 3 Feb 2014 23:53:43 +0000 (UTC) X-Ambrisko-Me: Yes Received: from server2.ambrisko.com (HELO internal.ambrisko.com) ([192.168.1.2]) by ironport.ambrisko.com with ESMTP; 03 Feb 2014 15:58:07 -0800 Received: from ambrisko.com (localhost [127.0.0.1]) by internal.ambrisko.com (8.14.4/8.14.4) with ESMTP id s13NrbqP079135; Mon, 3 Feb 2014 15:53:37 -0800 (PST) (envelope-from ambrisko@ambrisko.com) Received: (from ambrisko@localhost) by ambrisko.com (8.14.4/8.14.4/Submit) id s13NraJf079133; Mon, 3 Feb 2014 15:53:36 -0800 (PST) (envelope-from ambrisko) Date: Mon, 3 Feb 2014 15:53:36 -0800 From: Doug Ambrisko To: James Gritton Subject: Re: svn commit: r261266 - in head: sys/dev/drm sys/kern sys/sys usr.sbin/jail Message-ID: <20140203235336.GA46006@ambrisko.com> References: <201401291341.s0TDfDcB068211@svn.freebsd.org> <20140129134344.GW66160@FreeBSD.org> <52E906CD.9050202@freebsd.org> <20140129222210.0000711f@unknown> <20140131223011.0000163b@unknown> <52EC4DBB.50804@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52EC4DBB.50804@freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, Gleb Smirnoff , Robert Watson , svn-src-head@FreeBSD.org, Alexander Leidinger X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2014 23:53:44 -0000 On Fri, Jan 31, 2014 at 06:28:27PM -0700, James Gritton wrote: | On 1/31/2014 2:30 PM, Alexander Leidinger wrote: | > On Fri, 31 Jan 2014 12:34:48 +0000 (GMT) | > Robert Watson wrote: | >> On Wed, 29 Jan 2014, Alexander Leidinger wrote: | >>>> It does. I included a warning in jail.8 that this will pretty | >>>> much undo jail security. There are still reasons some may want to | >>>> do this, but it's definitely not for everyone or even most people. | >>> | >>> It only "unjails" (= basically the same security level as the | >>> jail-host with the added benefit of the flexibility of a jail like | >>> easy moving from one system to another) the jail which has this | >>> flag set. All other jails without the flag can not "escape" to the | >>> host. | >>> | >>> I also have to add that just setting this flag does not give access | >>> to the host, you also have to configure a non-default devfs rule | >>> for this jail (to have the devices appear in the jail). | >> | >> This is not correct: devices do not need to be delegated in devfs for | >> PRIV_IO to allow bypass of the Jail security model, due to sysarch() | >> and the Linux-emulated equivalent, which turn out direct I/O access | >> from a user process without use of a device node. | > | > Ok, then it is just the non-default flag, not the additional devfs part. | > | > I agree with your other post that we are better of to document better | > what it means if an admin allows kmem access for a specific jail. | | I second the documentation route. Yes, it's true that this option | makes a totally insecure jail - at least one lacking the expected jail | security additions. But I think that while security is one of the | primary purposes of jails, it's not the only purpose. It should be | possible to have a trusted "master jail" that still takes advantage of | the encapsulation while allowing otherwise unsupported features such | as a desktop. | | The distinction of whether certain devices are required to break out | of a jail with allow.kmem is something of a red herring - the fact is | that anyone who wants this level of access is going to have the | devices in place anyway. | | I suppose "obviate" wasn't the best word for the situation. Maybe | something that starts with "WARNING: ..." is in order. It's unfortunate that vimage requires jail. I want to use vimage but not have the security restrictions of a jail. To do this I patched jail to basically let everything through. It would be nice to be able to run jail in an insecure mode which I understand is a contradition. I do use the jail infrastructure to set the uname*/getosreldate so that a specific jail thinks it is FreeBSD version blah. Then I can ssh into that jail and pkg_add things, make ports etc. I use this on my laptop running current on the base. My other jails run various versions of FreeBSD. I don't care about security in this case. Thanks, Doug A. From owner-svn-src-head@FreeBSD.ORG Tue Feb 4 00:00:02 2014 Return-Path: Delivered-To: svn-src-head@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 28FD3E64; Tue, 4 Feb 2014 00:00:02 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1666D1631; Tue, 4 Feb 2014 00:00:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s14001X8053496; Tue, 4 Feb 2014 00:00:01 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s140016T053495; Tue, 4 Feb 2014 00:00:01 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201402040000.s140016T053495@svn.freebsd.org> From: Alexander Motin Date: Tue, 4 Feb 2014 00:00:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261449 - head/sys/rpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2014 00:00:02 -0000 Author: mav Date: Tue Feb 4 00:00:01 2014 New Revision: 261449 URL: http://svnweb.freebsd.org/changeset/base/261449 Log: Fix lock acquisition in case no request space available, missed in r260097. MFC after: 3 days Modified: head/sys/rpc/svc.c Modified: head/sys/rpc/svc.c ============================================================================== --- head/sys/rpc/svc.c Mon Feb 3 22:51:30 2014 (r261448) +++ head/sys/rpc/svc.c Tue Feb 4 00:00:01 2014 (r261449) @@ -1178,9 +1178,9 @@ svc_run_internal(SVCPOOL *pool, bool_t i */ xprt->xp_lastactive = time_uptime; do { - mtx_unlock(&pool->sp_lock); if (!svc_request_space_available(pool)) break; + mtx_unlock(&pool->sp_lock); rqstp = NULL; stat = svc_getreq(xprt, &rqstp); if (rqstp) { From owner-svn-src-head@FreeBSD.ORG Tue Feb 4 00:09:40 2014 Return-Path: Delivered-To: svn-src-head@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 DC7C828C; Tue, 4 Feb 2014 00:09:39 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AE12116F3; Tue, 4 Feb 2014 00:09:39 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id A844FB94B; Mon, 3 Feb 2014 19:09:38 -0500 (EST) From: John Baldwin To: Ian Lepore Subject: Re: svn commit: r261424 - head/sys/dev/mmc Date: Mon, 03 Feb 2014 18:54:24 -0500 Message-ID: <10243645.AuEuZPO9GG@ralph.baldwin.cx> User-Agent: KMail/4.10.5 (FreeBSD/10.0-STABLE; KDE/4.10.5; amd64; ; ) In-Reply-To: <1391464672.13026.105.camel@revolution.hippie.lan> References: <201402030256.s132uNjk086555@svn.freebsd.org> <3325243.MZLnPn2Brt@ralph.baldwin.cx> <1391464672.13026.105.camel@revolution.hippie.lan> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 03 Feb 2014 19:09:38 -0500 (EST) Cc: svn-src-head@freebsd.org, John-Mark Gurney , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2014 00:09:40 -0000 On Monday, February 03, 2014 02:57:52 PM Ian Lepore wrote: > On Mon, 2014-02-03 at 16:33 -0500, John Baldwin wrote: > > On Monday, February 03, 2014 01:07:39 PM Ian Lepore wrote: > > > On Mon, 2014-02-03 at 09:03 -0800, John-Mark Gurney wrote: > > > > Ian Lepore wrote this message on Mon, Feb 03, 2014 at 02:56 +0000: > > > > > Author: ian > > > > > Date: Mon Feb 3 02:56:23 2014 > > > > > New Revision: 261424 > > > > > URL: http://svnweb.freebsd.org/changeset/base/261424 > > > > > > > > > > Log: > > > > > Sort the list. > > > > > > > > > > Modified: > > > > > head/sys/dev/mmc/mmc.c > > > > > > > > > > Modified: head/sys/dev/mmc/mmc.c > > > > > ==================================================================== > > > > > ==== > > > > > ====== --- head/sys/dev/mmc/mmc.c Mon Feb 3 02:52:07 2014 (r261423) > > > > > +++ head/sys/dev/mmc/mmc.c Mon Feb 3 02:56:23 2014 (r261424) > > > > > @@ -1756,10 +1756,11 @@ static driver_t mmc_driver = { > > > > > > > > > > }; > > > > > static devclass_t mmc_devclass; > > > > > > > > > > -DRIVER_MODULE(mmc, ti_mmchs, mmc_driver, mmc_devclass, NULL, NULL); > > > > > > > > > > DRIVER_MODULE(mmc, at91_mci, mmc_driver, mmc_devclass, NULL, NULL); > > > > > > > > > > -DRIVER_MODULE(mmc, sdhci_pci, mmc_driver, mmc_devclass, NULL, > > > > > NULL); > > > > > > > > > > DRIVER_MODULE(mmc, sdhci_bcm, mmc_driver, mmc_devclass, NULL, > > > > > NULL); > > > > > DRIVER_MODULE(mmc, sdhci_fdt, mmc_driver, mmc_devclass, NULL, > > > > > NULL); > > > > > > > > > > -DRIVER_MODULE(mmc, sdhci_ti, mmc_driver, mmc_devclass, NULL, NULL); > > > > > > > > > > DRIVER_MODULE(mmc, sdhci_imx, mmc_driver, mmc_devclass, NULL, > > > > > NULL); > > > > > > > > > > +DRIVER_MODULE(mmc, sdhci_pci, mmc_driver, mmc_devclass, NULL, > > > > > NULL); > > > > > +DRIVER_MODULE(mmc, sdhci_ti, mmc_driver, mmc_devclass, NULL, NULL); > > > > > +DRIVER_MODULE(mmc, ti_mmchs, mmc_driver, mmc_devclass, NULL, NULL); > > > > > + > > > > > > > > Is there a reason we don't make mmc_driver/mmc_devclass global and put > > > > all of these defines in their respective file instead of poluting an > > > > MI > > > > file w/ MD info? > > > > > > I don't think that's an option. Part of what that macro does is create > > > metadata that says "this module contains a driver that is a child of bus > > > " and I think for that to work right, it has to be in the > > > module itself, not elsewhere (at least in the .ko case; maybe it doesn't > > > matter when it's compiled into the kernel). > > > > No, it can be anywhere. It's not voodoo magic, it's just a struct and a > > SYSINIT. John-Mark's suggestion is correct (and I thought the same thing > > when I saw this commit). You just have to make mmc_driver global. You > > should make mmc_devclass as well for now. > > > > (Side note: the devclass argument to DRIVER_MODULE() is useless in 99.9% > > of the cases and should be axed entirely. The very few drivers that want > > to find their devclass can use devclass_find() at runtime instead.) > > > > Too bad cpp doesn't support macro overloading, then we could make that > > change seamlessly. :) > > Interesting, I had no idea. Do we have examples of doing it this other > way in the tree now? Search for smbus_driver. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Feb 4 02:45:09 2014 Return-Path: Delivered-To: svn-src-head@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 C1E5587D; Tue, 4 Feb 2014 02:45:09 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AE03B138B; Tue, 4 Feb 2014 02:45:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s142j99v018958; Tue, 4 Feb 2014 02:45:09 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s142j865018954; Tue, 4 Feb 2014 02:45:08 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201402040245.s142j865018954@svn.freebsd.org> From: Neel Natu Date: Tue, 4 Feb 2014 02:45:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261453 - head/sys/amd64/vmm/intel X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2014 02:45:09 -0000 Author: neel Date: Tue Feb 4 02:45:08 2014 New Revision: 261453 URL: http://svnweb.freebsd.org/changeset/base/261453 Log: Avoid doing unnecessary nested TLB invalidations. Prior to this change the cached value of 'pm_eptgen' was tracked per-vcpu and per-hostcpu. In the degenerate case where 'N' vcpus were sharing a single hostcpu this could result in 'N - 1' unnecessary TLB invalidations. Since an 'invept' invalidates mappings for all VPIDs the first 'invept' is sufficient. Fix this by moving the 'eptgen[MAXCPU]' array from 'vmxctx' to 'struct vmx'. If it is known that an 'invept' is going to be done before entering the guest then it is safe to skip the 'invvpid'. The stat VPU_INVVPID_SAVED counts the number of 'invvpid' invalidations that were avoided because they were subsumed by an 'invept'. Discussed with: grehan Modified: head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/intel/vmx.h head/sys/amd64/vmm/intel/vmx_genassym.c head/sys/amd64/vmm/intel/vmx_support.S Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Tue Feb 4 02:41:54 2014 (r261452) +++ head/sys/amd64/vmm/intel/vmx.c Tue Feb 4 02:45:08 2014 (r261453) @@ -907,7 +907,6 @@ vmx_vminit(struct vm *vm, pmap_t pmap) panic("vmx_setup_cr4_shadow %d", error); vmx->ctx[i].pmap = pmap; - vmx->ctx[i].eptp = vmx->eptp; } return (vmx); @@ -955,20 +954,20 @@ vmx_astpending_trace(struct vmx *vmx, in #endif } +static VMM_STAT_INTEL(VCPU_INVVPID_SAVED, "Number of vpid invalidations saved"); + static void -vmx_set_pcpu_defaults(struct vmx *vmx, int vcpu) +vmx_set_pcpu_defaults(struct vmx *vmx, int vcpu, pmap_t pmap) { - int lastcpu; struct vmxstate *vmxstate; - struct invvpid_desc invvpid_desc = { 0 }; + struct invvpid_desc invvpid_desc; vmxstate = &vmx->state[vcpu]; - lastcpu = vmxstate->lastcpu; - vmxstate->lastcpu = curcpu; - - if (lastcpu == curcpu) + if (vmxstate->lastcpu == curcpu) return; + vmxstate->lastcpu = curcpu; + vmm_stat_incr(vmx->vm, vcpu, VCPU_MIGRATIONS, 1); vmcs_write(VMCS_HOST_TR_BASE, vmm_get_host_trbase()); @@ -991,8 +990,20 @@ vmx_set_pcpu_defaults(struct vmx *vmx, i * for "all" EP4TAs. */ if (vmxstate->vpid != 0) { - invvpid_desc.vpid = vmxstate->vpid; - invvpid(INVVPID_TYPE_SINGLE_CONTEXT, invvpid_desc); + if (pmap->pm_eptgen == vmx->eptgen[curcpu]) { + invvpid_desc._res1 = 0; + invvpid_desc._res2 = 0; + invvpid_desc.vpid = vmxstate->vpid; + invvpid(INVVPID_TYPE_SINGLE_CONTEXT, invvpid_desc); + } else { + /* + * The invvpid can be skipped if an invept is going to + * be performed before entering the guest. The invept + * will invalidate combined mappings tagged with + * 'vmx->eptp' for all vpids. + */ + vmm_stat_incr(vmx->vm, vcpu, VCPU_INVVPID_SAVED, 1); + } } } @@ -1859,8 +1870,6 @@ vmx_run(void *arg, int vcpu, register_t KASSERT(vmxctx->pmap == pmap, ("pmap %p different than ctx pmap %p", pmap, vmxctx->pmap)); - KASSERT(vmxctx->eptp == vmx->eptp, - ("eptp %p different than ctx eptp %#lx", eptp, vmxctx->eptp)); VMPTRLD(vmcs); @@ -1875,7 +1884,7 @@ vmx_run(void *arg, int vcpu, register_t vmcs_write(VMCS_HOST_CR3, rcr3()); vmcs_write(VMCS_GUEST_RIP, startrip); - vmx_set_pcpu_defaults(vmx, vcpu); + vmx_set_pcpu_defaults(vmx, vcpu, pmap); do { /* * Interrupts are disabled from this point on until the @@ -1910,7 +1919,7 @@ vmx_run(void *arg, int vcpu, register_t vmx_inject_interrupts(vmx, vcpu, vlapic); vmx_run_trace(vmx, vcpu); - rc = vmx_enter_guest(vmxctx, launched); + rc = vmx_enter_guest(vmxctx, vmx, launched); enable_intr(); Modified: head/sys/amd64/vmm/intel/vmx.h ============================================================================== --- head/sys/amd64/vmm/intel/vmx.h Tue Feb 4 02:41:54 2014 (r261452) +++ head/sys/amd64/vmm/intel/vmx.h Tue Feb 4 02:45:08 2014 (r261453) @@ -64,16 +64,13 @@ struct vmxctx { /* * XXX todo debug registers and fpu state */ - - int inst_fail_status; - long eptgen[MAXCPU]; /* cached pmap->pm_eptgen */ + int inst_fail_status; /* - * The 'eptp' and the 'pmap' do not change during the lifetime of - * the VM so it is safe to keep a copy in each vcpu's vmxctx. + * The pmap needs to be deactivated in vmx_exit_guest() + * so keep a copy of the 'pmap' in each vmxctx. */ - vm_paddr_t eptp; struct pmap *pmap; }; @@ -113,6 +110,7 @@ struct vmx { struct vmxstate state[VM_MAXCPU]; uint64_t eptp; struct vm *vm; + long eptgen[MAXCPU]; /* cached pmap->pm_eptgen */ }; CTASSERT((offsetof(struct vmx, vmcs) & PAGE_MASK) == 0); CTASSERT((offsetof(struct vmx, msr_bitmap) & PAGE_MASK) == 0); @@ -123,7 +121,7 @@ CTASSERT((offsetof(struct vmx, pir_desc[ #define VMX_VMRESUME_ERROR 1 #define VMX_VMLAUNCH_ERROR 2 #define VMX_INVEPT_ERROR 3 -int vmx_enter_guest(struct vmxctx *ctx, int launched); +int vmx_enter_guest(struct vmxctx *ctx, struct vmx *vmx, int launched); void vmx_exit_guest(void); void vmx_call_isr(uintptr_t entry); Modified: head/sys/amd64/vmm/intel/vmx_genassym.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx_genassym.c Tue Feb 4 02:41:54 2014 (r261452) +++ head/sys/amd64/vmm/intel/vmx_genassym.c Tue Feb 4 02:45:08 2014 (r261453) @@ -68,10 +68,10 @@ ASSYM(VMXCTX_HOST_RBX, offsetof(struct v ASSYM(VMXCTX_HOST_RIP, offsetof(struct vmxctx, host_rip)); ASSYM(VMXCTX_INST_FAIL_STATUS, offsetof(struct vmxctx, inst_fail_status)); -ASSYM(VMXCTX_EPTGEN, offsetof(struct vmxctx, eptgen)); - ASSYM(VMXCTX_PMAP, offsetof(struct vmxctx, pmap)); -ASSYM(VMXCTX_EPTP, offsetof(struct vmxctx, eptp)); + +ASSYM(VMX_EPTGEN, offsetof(struct vmx, eptgen)); +ASSYM(VMX_EPTP, offsetof(struct vmx, eptp)); ASSYM(VM_FAIL_INVALID, VM_FAIL_INVALID); ASSYM(VM_FAIL_VALID, VM_FAIL_VALID); Modified: head/sys/amd64/vmm/intel/vmx_support.S ============================================================================== --- head/sys/amd64/vmm/intel/vmx_support.S Tue Feb 4 02:41:54 2014 (r261452) +++ head/sys/amd64/vmm/intel/vmx_support.S Tue Feb 4 02:45:08 2014 (r261453) @@ -97,7 +97,8 @@ /* * vmx_enter_guest(struct vmxctx *vmxctx, int launched) * %rdi: pointer to the 'vmxctx' - * %esi: launch state of the VMCS + * %rsi: pointer to the 'vmx' + * %edx: launch state of the VMCS * Interrupts must be disabled on entry. */ ENTRY(vmx_enter_guest) @@ -114,19 +115,19 @@ ENTRY(vmx_enter_guest) LK btsl %eax, PM_ACTIVE(%r11) /* - * If 'vmxctx->eptgen[curcpu]' is not identical to 'pmap->pm_eptgen' + * If 'vmx->eptgen[curcpu]' is not identical to 'pmap->pm_eptgen' * then we must invalidate all mappings associated with this EPTP. */ movq PM_EPTGEN(%r11), %r10 - cmpq %r10, VMXCTX_EPTGEN(%rdi, %rax, 8) + cmpq %r10, VMX_EPTGEN(%rsi, %rax, 8) je guest_restore - /* Refresh 'vmxctx->eptgen[curcpu]' */ - movq %r10, VMXCTX_EPTGEN(%rdi, %rax, 8) + /* Refresh 'vmx->eptgen[curcpu]' */ + movq %r10, VMX_EPTGEN(%rsi, %rax, 8) /* Setup the invept descriptor on the host stack */ mov %rsp, %r11 - movq VMXCTX_EPTP(%rdi), %rax + movq VMX_EPTP(%rsi), %rax movq %rax, -16(%r11) movq $0x0, -8(%r11) mov $0x1, %eax /* Single context invalidate */ @@ -134,7 +135,7 @@ ENTRY(vmx_enter_guest) jbe invept_error /* Check invept instruction error */ guest_restore: - cmpl $0, %esi + cmpl $0, %edx je do_launch VMX_GUEST_RESTORE From owner-svn-src-head@FreeBSD.ORG Tue Feb 4 03:01:34 2014 Return-Path: Delivered-To: svn-src-head@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 417DDDEE; Tue, 4 Feb 2014 03:01:34 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 266961727; Tue, 4 Feb 2014 03:01:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1431Xsv027157; Tue, 4 Feb 2014 03:01:33 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1431XgK027156; Tue, 4 Feb 2014 03:01:33 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201402040301.s1431XgK027156@svn.freebsd.org> From: Eitan Adler Date: Tue, 4 Feb 2014 03:01:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261454 - head/lib/libc/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2014 03:01:34 -0000 Author: eadler Date: Tue Feb 4 03:01:33 2014 New Revision: 261454 URL: http://svnweb.freebsd.org/changeset/base/261454 Log: libc/net: Fix some issues in inet6_opt_init() (from RFC 3542): * The RFC says (in section 10.1) that only when extbuf is not NULL, extlen shall be checked, so don't perform this check when NULL is passed. * socklen_t is unsigned, so checking extlen for less than zero is not needed. Submitted by: swildner@dragonflybsd.org Reviewed by: Mark Martinec Reviewed by: hrs Obtained by: DragonFlyBSD Modified: head/lib/libc/net/ip6opt.c Modified: head/lib/libc/net/ip6opt.c ============================================================================== --- head/lib/libc/net/ip6opt.c Tue Feb 4 02:45:08 2014 (r261453) +++ head/lib/libc/net/ip6opt.c Tue Feb 4 03:01:33 2014 (r261454) @@ -381,11 +381,8 @@ inet6_opt_init(void *extbuf, socklen_t e { struct ip6_ext *ext = (struct ip6_ext *)extbuf; - if (extlen < 0 || (extlen % 8)) - return(-1); - if (ext) { - if (extlen == 0) + if (extlen == 0 || (extlen % 8)) return(-1); ext->ip6e_len = (extlen >> 3) - 1; } From owner-svn-src-head@FreeBSD.ORG Tue Feb 4 03:59:36 2014 Return-Path: Delivered-To: svn-src-head@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 B310D157; Tue, 4 Feb 2014 03:59:36 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 848221CC3; Tue, 4 Feb 2014 03:59:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s143xaJk047490; Tue, 4 Feb 2014 03:59:36 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s143xaEX047489; Tue, 4 Feb 2014 03:59:36 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201402040359.s143xaEX047489@svn.freebsd.org> From: Warner Losh Date: Tue, 4 Feb 2014 03:59:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261456 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2014 03:59:36 -0000 Author: imp Date: Tue Feb 4 03:59:35 2014 New Revision: 261456 URL: http://svnweb.freebsd.org/changeset/base/261456 Log: Add a prior version compat define. Modified: head/sys/conf/kern.mk Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Tue Feb 4 03:36:42 2014 (r261455) +++ head/sys/conf/kern.mk Tue Feb 4 03:59:35 2014 (r261456) @@ -1,5 +1,8 @@ # $FreeBSD$ +# Compat +MK_FORMAT_EXTENSIONS?=no + # # Warning flags for compiling the kernel and components of the kernel: # From owner-svn-src-head@FreeBSD.ORG Tue Feb 4 05:21:57 2014 Return-Path: Delivered-To: svn-src-head@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 C63F8BA5; Tue, 4 Feb 2014 05:21: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B188A1346; Tue, 4 Feb 2014 05:21:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s145Lv86081689; Tue, 4 Feb 2014 05:21:57 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s145Lv87081688; Tue, 4 Feb 2014 05:21:57 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201402040521.s145Lv87081688@svn.freebsd.org> From: Warner Losh Date: Tue, 4 Feb 2014 05:21:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261458 - head/sys/arm/econa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2014 05:21:57 -0000 Author: imp Date: Tue Feb 4 05:21:57 2014 New Revision: 261458 URL: http://svnweb.freebsd.org/changeset/base/261458 Log: s/standard/optional/ for ohci and echi, since these files are optional and not standard. Modified: head/sys/arm/econa/files.econa Modified: head/sys/arm/econa/files.econa ============================================================================== --- head/sys/arm/econa/files.econa Tue Feb 4 05:03:14 2014 (r261457) +++ head/sys/arm/econa/files.econa Tue Feb 4 05:21:57 2014 (r261458) @@ -8,7 +8,7 @@ arm/econa/uart_cpu_ec.c optional uart dev/uart/uart_dev_ns8250.c optional uart arm/arm/irq_dispatch.S standard arm/arm/bus_space_generic.c standard -arm/econa/ehci_ebus.c standard ehci -arm/econa/ohci_ec.c standard ohci +arm/econa/ehci_ebus.c optional ehci +arm/econa/ohci_ec.c optional ohci arm/econa/if_ece.c standard arm/econa/cfi_bus_econa.c optional cfi From owner-svn-src-head@FreeBSD.ORG Tue Feb 4 05:26:13 2014 Return-Path: Delivered-To: svn-src-head@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 543EDD3F; Tue, 4 Feb 2014 05:26:13 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3FCEA135B; Tue, 4 Feb 2014 05:26:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s145QDEN082244; Tue, 4 Feb 2014 05:26:13 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s145QDni082243; Tue, 4 Feb 2014 05:26:13 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201402040526.s145QDni082243@svn.freebsd.org> From: Warner Losh Date: Tue, 4 Feb 2014 05:26:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261459 - head/sys/arm/ti/am335x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2014 05:26:13 -0000 Author: imp Date: Tue Feb 4 05:26:12 2014 New Revision: 261459 URL: http://svnweb.freebsd.org/changeset/base/261459 Log: Remove trailing tabs causing false grep positives Modified: head/sys/arm/ti/am335x/files.am335x Modified: head/sys/arm/ti/am335x/files.am335x ============================================================================== --- head/sys/arm/ti/am335x/files.am335x Tue Feb 4 05:21:57 2014 (r261458) +++ head/sys/arm/ti/am335x/files.am335x Tue Feb 4 05:26:12 2014 (r261459) @@ -4,9 +4,9 @@ arm/ti/aintc.c standard arm/ti/am335x/am335x_prcm.c standard arm/ti/am335x/am335x_dmtimer.c standard arm/ti/am335x/am335x_scm_padconf.c standard -arm/ti/am335x/am335x_lcd.c optional sc +arm/ti/am335x/am335x_lcd.c optional sc arm/ti/am335x/am335x_lcd_syscons.c optional sc -arm/ti/am335x/am335x_pwm.c standard +arm/ti/am335x/am335x_pwm.c standard arm/ti/am335x/am335x_usbss.c optional musb fdt arm/ti/ti_edma3.c standard arm/ti/ti_sdhci.c optional sdhci From owner-svn-src-head@FreeBSD.ORG Tue Feb 4 05:35:04 2014 Return-Path: Delivered-To: svn-src-head@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 A770426D; Tue, 4 Feb 2014 05:35:04 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 935491449; Tue, 4 Feb 2014 05:35:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s145Z4te086084; Tue, 4 Feb 2014 05:35:04 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s145Z4W6086083; Tue, 4 Feb 2014 05:35:04 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201402040535.s145Z4W6086083@svn.freebsd.org> From: Warner Losh Date: Tue, 4 Feb 2014 05:35:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261460 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2014 05:35:04 -0000 Author: imp Date: Tue Feb 4 05:35:04 2014 New Revision: 261460 URL: http://svnweb.freebsd.org/changeset/base/261460 Log: Pass MACHINE and MACHINE_ARCH down into the modules Modified: head/sys/conf/kern.pre.mk Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Tue Feb 4 05:26:12 2014 (r261459) +++ head/sys/conf/kern.pre.mk Tue Feb 4 05:35:04 2014 (r261460) @@ -183,6 +183,7 @@ SYSTEM_DEP+= ${LDSCRIPT} MKMODULESENV+= MAKEOBJDIRPREFIX=${.OBJDIR}/modules KMODDIR=${KODIR} MKMODULESENV+= MACHINE_CPUARCH=${MACHINE_CPUARCH} +MKMODULESENV+= MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE_ARCH} .if (${KERN_IDENT} == LINT) MKMODULESENV+= ALL_MODULES=LINT .endif From owner-svn-src-head@FreeBSD.ORG Tue Feb 4 07:02:27 2014 Return-Path: Delivered-To: svn-src-head@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 09F9E3B9; Tue, 4 Feb 2014 07:02:27 +0000 (UTC) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id 56D0A1A13; Tue, 4 Feb 2014 07:02:26 +0000 (UTC) Received: from c122-106-144-87.carlnfd1.nsw.optusnet.com.au (c122-106-144-87.carlnfd1.nsw.optusnet.com.au [122.106.144.87]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id C5ABFD40986; Tue, 4 Feb 2014 17:29:28 +1100 (EST) Date: Tue, 4 Feb 2014 17:29:27 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Eitan Adler Subject: Re: svn commit: r261454 - head/lib/libc/net In-Reply-To: <201402040301.s1431XgK027156@svn.freebsd.org> Message-ID: <20140204164703.S1229@besplex.bde.org> References: <201402040301.s1431XgK027156@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=HZAtEE08 c=1 sm=1 tr=0 a=p/w0leo876FR0WNmYI1KeA==:117 a=PO7r1zJSAAAA:8 a=Gbr0sxjGmr4A:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=4jIg5_e19IMA:10 a=thoglojNH_oWOjbN14wA:9 a=vSSvafM5ynuK-452:21 a=D64CJz4_VERPXX-9:21 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2014 07:02:27 -0000 On Tue, 4 Feb 2014, Eitan Adler wrote: > Log: > libc/net: Fix some issues in inet6_opt_init() (from RFC 3542): > > * The RFC says (in section 10.1) that only when extbuf is not NULL, > extlen shall be checked, so don't perform this check when NULL is > passed. > > * socklen_t is unsigned, so checking extlen for less than zero is > not needed. Why be so unportable? socklen_t is not necessarily unsigned. It should be signed, and was signed int in BSD, but was broken during development of POSIX.1-2001. FreeBSD apparently tracked the buggy development version and changed from int to u_int32_t in 1999. >From POSIX.1-2001-draft7: 12409 The header shall define the type socklen_t, which is an integer type of width of 12410 at least 32 bits; see APPLICATION USAGE. [APPLICATION USAGE "recommends" that values stored in socklen_t not be larger than 2**31-1. It doesn't spell out that this is because socklen_t might be a signed type. Note that "width" is a technical tyem for integer types, and is satisfied by signed 32-bit ints although these have only 31 useful bits.] 7456 B.2.10.6 Socket Types 7457 The type socklen_t was invented to cover the range of implementations seen in the field. The 7458 intent of socklen_t is to be the type for all lengths that are naturally bounded in size; that is, that 7459 they are the length of a buffer which cannot sensibly become of massive size: network addresses, 7460 host names, string representations of these, ancillary data, control messages, and socket options [2**31-1 is massive. 2**16-1 would just be a bit too small.] 7461 are examples. Truly boundless sizes are represented by size_t as in read( ), write( ), and so on. [Nonsense. 2**31-1 is massive for read/write buffer sizes too, and size_t is far from being able to represent truly boundless sizes.] 7462 All socklen_t types were originally (in BSD UNIX) of type int. During the development of 7463 IEEE Std 1003.1-200x, it was decided to change all buffer lengths to size_t, which appears at face 7464 value to make sense. When dual mode 32/64-bit systems came along, this choice unnecessarily 7465 complicated system interfaces because size_t (with long) was a different size under ILP32 and 7466 LP64 models. Reverting to int would have happened except that some implementations had 7467 already shipped 64-bit-only interfaces. The compromise was a type which could be defined to be 7468 any size by the implementation: socklen_t. It was too late to fix the breakage for read/write. It was not too late to require plain int again for socklen_t. POSIX.1 requires 32-bit ints, so int for socklen_t was large enough. Strangely, POSIX only requires 16 bits for size_t and ssize_t. This makes some sense since it allows API's burdened by using typedefed types to use the best machine-dependent type (portable applications have the burden of using the typedefed types no matter what the implementation chooses). OTOH, if the API uses a basic type like int, then it has to be large enough to work for all implementations, so int can't be 16 bits. Bruce From owner-svn-src-head@FreeBSD.ORG Tue Feb 4 07:40:34 2014 Return-Path: Delivered-To: svn-src-head@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 10410B70; Tue, 4 Feb 2014 07:40:34 +0000 (UTC) Received: from cyrus.watson.org (cyrus.watson.org [198.74.231.69]) by mx1.freebsd.org (Postfix) with ESMTP id BDD6E1C37; Tue, 4 Feb 2014 07:40:33 +0000 (UTC) Received: from [10.0.1.9] (host31-51-142-185.range31-51.btcentralplus.com [31.51.142.185]) by cyrus.watson.org (Postfix) with ESMTPSA id 7C21C46B09; Tue, 4 Feb 2014 02:40:21 -0500 (EST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.1 \(1827\)) Subject: Re: svn commit: r261266 - in head: sys/dev/drm sys/kern sys/sys usr.sbin/jail From: "Robert N. M. Watson" In-Reply-To: <20140203235336.GA46006@ambrisko.com> Date: Tue, 4 Feb 2014 07:40:17 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <6AF2ADA6-8BAD-4875-8B15-A859B41DDCC0@FreeBSD.org> References: <201401291341.s0TDfDcB068211@svn.freebsd.org> <20140129134344.GW66160@FreeBSD.org> <52E906CD.9050202@freebsd.org> <20140129222210.0000711f@unknown> <20140131223011.0000163b@unknown> <52EC4DBB.50804@freebsd.org> <20140203235336.GA46006@ambrisko.com> To: Doug Ambrisko X-Mailer: Apple Mail (2.1827) Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, Gleb Smirnoff , James Gritton , svn-src-head@FreeBSD.org, Alexander Leidinger X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2014 07:40:34 -0000 On 3 Feb 2014, at 23:53, Doug Ambrisko wrote: > It's unfortunate that vimage requires jail. I want to use vimage but > not have the security restrictions of a jail. To do this I patched > jail to basically let everything through. It would be nice to be > able to run jail in an insecure mode which I understand is a = contradition. > I do use the jail infrastructure to set the uname*/getosreldate so > that a specific jail thinks it is FreeBSD version blah. Then I can = ssh > into that jail and pkg_add things, make ports etc. I use this on > my laptop running current on the base. My other jails run various > versions of FreeBSD. I don't care about security in this case. Something I've wanted to do for a while (>15 years) is move from a = simple privilege model to a privilege-mask model in which masks of = available system privileges can be delegated to jails rather than = hard-coding the list of privileges in jails. I got about 1/3 of the way = there with priv(9): enumerating system privileges, and shifting = knowledge of "is it available in jail" out of calling subsystems into = the privilege model itself. The next phase is to introduce a structured notion of a privilege mask = (efficiently), and expose masks in limited circumstances -- e.g., Jail = configuration. This requires introducing an /etc/security/privileges, = and a default /etc/security/jail.privileges (or similar) that provide a = mapping from user-readable privilege names to numbers, and a reasonable = default subset mask that jail(8) can use when creating a jail. This = would allow configuration of arbitrary privileges for jails in a = generalisable way, rather than lots of custom sysctls and extensions. We = could even provide different 'profiles' such as 'jail.default' for the = current model, and perhaps 'jail.allrights' to capture the idea of a = child jail that retains all privileges the parent jail held. We might = ask users to say --I-am-really-sure (or something less obnoxious but = equally prominent) to create jails to which stronger rights than the = default are granted. The final phase is to introduce a process-exposed privilege model = allowing individual processes to manage privilege masks. In about 2000, = Brian Feldman and I implemented POSIX.1e privileges [twice] for FreeBSD = (not too different from what Linux implemented, and derived form the = model in IRIX) but were deeply unimpressed. The current Solaris model is = probably closest to what we want, but we'd have to think through it = pretty carefully. One of the reasons we never merged our POSIX.1e = implementation was that although the model itself worked OK, various = compatibility modes (such as the one adopted in Linux) led to serious = but quite subtle security vulnerabilities. This is not a phase to embark = on without a *lot* of thought. There's a moderate amount of work in doing this, which I've never quite = found time to chase up. It would be worth doing as it would solve a = number of other problems. The risks involved are significant -- it's = very, very easy to get wrong (as we convinced ourselves on multiple = occasions, and from having looked at problems in other UNIX systems that = went this route) -- so it really does require time and a lot of review = of both the model and implementation. The Jail portion of it is likely = the easy bit, but does require us to come up with a sensible = user<->kernel ABI for masks (an extensible one, ideally, since you = always find you want more privileges), as well as a sensible = kernel<->kernel ABI (one that's relatively stable but perhaps less = extensible -- with performance benefits over the extensible interface). Robert= From owner-svn-src-head@FreeBSD.ORG Tue Feb 4 07:53:34 2014 Return-Path: Delivered-To: svn-src-head@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 81D2BFFC; Tue, 4 Feb 2014 07:53:34 +0000 (UTC) Received: from mail-qc0-x229.google.com (mail-qc0-x229.google.com [IPv6:2607:f8b0:400d:c01::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D3E6E1D6D; Tue, 4 Feb 2014 07:53:33 +0000 (UTC) Received: by mail-qc0-f169.google.com with SMTP id w7so13059520qcr.28 for ; Mon, 03 Feb 2014 23:53:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=FaB5DQyEJZnlmS3b7W/nULkYA7yIHYG5zi7Xm1GPvdE=; b=Acug1un3P8H5kZSOAZiJjuCKpWRotCf4U0iSGHM0QxyfoYNwWum5xOG06OY8g5uCCl CgnC9O6szWavJRQLLminyLXmoK3BkYBfHGj31o9T/ffQxGKOLzu850NGj9rhq256Tqdq zgB46cDbUAuWt3QJorRVOnFUJw+y6tILJkV06nXcJNrbCzXzW016/lUmmuIg/X2Fowx7 Qh2I4hTwwwp5im/Fpnv9jrgcQF+oM6HS2/C5KYvuoUkSusUYI3WSFaRQ4MQf1gre7cff Mh+u2yAk+W14qJLsCT4FOQ1/P+wDdO6ZMyXM/6JX3tLV9DEICX1wXcPyB1422QpJYkVL vINQ== MIME-Version: 1.0 X-Received: by 10.224.160.195 with SMTP id o3mr13411398qax.98.1391500413062; Mon, 03 Feb 2014 23:53:33 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.224.52.8 with HTTP; Mon, 3 Feb 2014 23:53:32 -0800 (PST) In-Reply-To: <52EC4DBB.50804@freebsd.org> References: <201401291341.s0TDfDcB068211@svn.freebsd.org> <20140129134344.GW66160@FreeBSD.org> <52E906CD.9050202@freebsd.org> <20140129222210.0000711f@unknown> <20140131223011.0000163b@unknown> <52EC4DBB.50804@freebsd.org> Date: Mon, 3 Feb 2014 23:53:32 -0800 X-Google-Sender-Auth: xIDx5GfiUr5GanLrpv8FR5XJpQY Message-ID: Subject: Re: svn commit: r261266 - in head: sys/dev/drm sys/kern sys/sys usr.sbin/jail From: Adrian Chadd To: James Gritton Content-Type: text/plain; charset=ISO-8859-1 Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Gleb Smirnoff , Robert Watson , "svn-src-head@freebsd.org" , Alexander Leidinger X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2014 07:53:34 -0000 On 31 January 2014 17:28, James Gritton wrote: > I second the documentation route. Yes, it's true that this option > makes a totally insecure jail - at least one lacking the expected jail > security additions. But I think that while security is one of the > primary purposes of jails, it's not the only purpose. It should be > possible to have a trusted "master jail" that still takes advantage of > the encapsulation while allowing otherwise unsupported features such > as a desktop. No; the xorg probe and device hackery API should somehow be modified to support this kind of hackery. And/or a very specific API that doesn't simply require /dev/io and /dev/kmem to be exposed. > The distinction of whether certain devices are required to break out > of a jail with allow.kmem is something of a red herring - the fact is > that anyone who wants this level of access is going to have the > devices in place anyway. > > I suppose "obviate" wasn't the best word for the situation. Maybe > something that starts with "WARNING: ..." is in order. > > I'd like to re-submit the patch with only the documentation changed > (unless someone knows of something that would accomplish the same > goals with different code). But I'll run it by secteam@ first, and > abide by the consensus there. I really would rather see Xorg gain whatever abstraction is necessary to probe/attach/interface with a DRI API supported graphics card. So, this then becomes a question of whether this is needed for DRI API supported graphics cards, or whether you're trying to solve the general case (eg for nvidia stuff.) It would be nice to enumerate what's required for different ways of interfacing to the graphics subsystem(s). -a From owner-svn-src-head@FreeBSD.ORG Tue Feb 4 08:26:07 2014 Return-Path: Delivered-To: svn-src-head@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 2D9F854C; Tue, 4 Feb 2014 08:26:07 +0000 (UTC) Received: from cyrus.watson.org (cyrus.watson.org [198.74.231.69]) by mx1.freebsd.org (Postfix) with ESMTP id F3596109C; Tue, 4 Feb 2014 08:26:06 +0000 (UTC) Received: from [10.0.1.9] (host31-51-142-185.range31-51.btcentralplus.com [31.51.142.185]) by cyrus.watson.org (Postfix) with ESMTPSA id 32CEB46B1A; Tue, 4 Feb 2014 03:26:03 -0500 (EST) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 7.1 \(1827\)) Subject: Re: svn commit: r261266 - in head: sys/dev/drm sys/kern sys/sys usr.sbin/jail From: "Robert N. M. Watson" In-Reply-To: Date: Tue, 4 Feb 2014 08:25:57 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <728A4D1D-32E9-400C-8045-58048B07A4B1@FreeBSD.org> References: <201401291341.s0TDfDcB068211@svn.freebsd.org> <20140129134344.GW66160@FreeBSD.org> <52E906CD.9050202@freebsd.org> <20140129222210.0000711f@unknown> <20140131223011.0000163b@unknown> <52EC4DBB.50804@freebsd.org> To: Adrian Chadd X-Mailer: Apple Mail (2.1827) Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Gleb Smirnoff , James Gritton , "svn-src-head@freebsd.org" , Alexander Leidinger X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2014 08:26:07 -0000 On 4 Feb 2014, at 07:53, Adrian Chadd wrote: > I really would rather see Xorg gain whatever abstraction is necessary > to probe/attach/interface with a DRI API supported graphics card. >=20 > So, this then becomes a question of whether this is needed for DRI API > supported graphics cards, or whether you're trying to solve the > general case (eg for nvidia stuff.) It would be nice to enumerate > what's required for different ways of interfacing to the graphics > subsystem(s). A safely delegable interface to DRI and friends would be excellent -- = not just for jails, but just for the purposes of safely providing access = to unprivileged components. However, looking at the recent history of = GPU driver bugs (e.g., Samsung) I have worries. As IOMMUs become more = widely available, that should help. Robert= From owner-svn-src-head@FreeBSD.ORG Tue Feb 4 08:44:45 2014 Return-Path: Delivered-To: svn-src-head@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 B8846EC2; Tue, 4 Feb 2014 08:44:45 +0000 (UTC) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7DDD01213; Tue, 4 Feb 2014 08:44:45 +0000 (UTC) Received: from [192.168.0.7] (cpc28-cmbg15-2-0-cust64.5-4.cable.virginm.net [86.27.189.65]) (authenticated bits=0) by theravensnest.org (8.14.5/8.14.5) with ESMTP id s148fhvp062834 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Tue, 4 Feb 2014 08:42:40 GMT (envelope-from theraven@FreeBSD.org) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.0 \(1822\)) Subject: Re: svn commit: r261283 - in head: contrib/libc++ contrib/libc++/include contrib/libc++/include/experimental contrib/libc++/include/ext contrib/libc++/src etc/mtree lib/libc++ sys/sys tools/build/mk From: David Chisnall In-Reply-To: <20140203170031.2166661c@kan.dyndns.org> Date: Tue, 4 Feb 2014 08:41:32 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <8A874F96-67A8-41B9-AC99-22D2ED3A5A1C@FreeBSD.org> References: <201401300744.s0U7iNLt016044@svn.freebsd.org> <20140203123235.GA1540@mole.fafoe.narf.at> <20140203133254.243db1cd@kan.dyndns.org> <73ED697C-09CC-49D6-8EBD-0F0E20232729@FreeBSD.org> <20140203170031.2166661c@kan.dyndns.org> To: Alexander Kabaev X-Mailer: Apple Mail (2.1822) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Stefan Farfeleder , Dimitry Andric , src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2014 08:44:45 -0000 On 3 Feb 2014, at 22:00, Alexander Kabaev wrote: > At the very least, new library did remove > _ZNKSt3__111__libcpp_db12__comparableEPKvS2_ which was public before. This symbol is part of the debugging infrastructure and is used when you = build your code with aggressive debug checks by defining _LIBCPP_DEBUG2 = when you build your code. It is not intended for deployment builds and = so is not part of the stable API. You can only access it by explicitly = enabling debug builds. > Your definition of ABI stability might be different from mine, but in > my book that counts as a backward compatibility breakage. And even if > that symbol was not supposed to be lined to by anyone, it should not > have been exported in the first place. It sounds like you're just looking at the output from nm, without = bothering to check how the symbols are used. =20 David From owner-svn-src-head@FreeBSD.ORG Tue Feb 4 09:11:51 2014 Return-Path: Delivered-To: svn-src-head@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 3891294B; Tue, 4 Feb 2014 09:11:51 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 064BE14EE; Tue, 4 Feb 2014 09:11:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s149BoWK070764; Tue, 4 Feb 2014 09:11:50 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s149Bo1c070763; Tue, 4 Feb 2014 09:11:50 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201402040911.s149Bo1c070763@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 4 Feb 2014 09:11:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261479 - head/etc/devd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2014 09:11:51 -0000 Author: hselasky Date: Tue Feb 4 09:11:50 2014 New Revision: 261479 URL: http://svnweb.freebsd.org/changeset/base/261479 Log: Regenerate usb.conf MFC after: 2 days Modified: head/etc/devd/usb.conf Modified: head/etc/devd/usb.conf ============================================================================== --- head/etc/devd/usb.conf Tue Feb 4 09:06:28 2014 (r261478) +++ head/etc/devd/usb.conf Tue Feb 4 09:11:50 2014 (r261479) @@ -1097,7 +1097,39 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x05ac"; - match "product" "(0x020d|0x020e|0x020f|0x0215|0x0217|0x0218|0x0219|0x021a|0x021b|0x021c|0x0229|0x022a|0x022b|0x030a|0x030b)"; + match "product" "(0x020d|0x020e|0x020f|0x0215|0x0217|0x0218|0x0219|0x021a|0x021b|0x021c)"; + action "kldload -n atp"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x05ac"; + match "product" "(0x0223|0x0224|0x0225)"; + action "kldload -n wsp"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x05ac"; + match "product" "(0x0229|0x022a|0x022b)"; + action "kldload -n atp"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x05ac"; + match "product" "(0x0230|0x0231|0x0232|0x0236|0x0237|0x0238|0x023f|0x0240|0x0241|0x0242|0x0243|0x0244|0x0245|0x0246|0x0247|0x0249|0x024a|0x024b|0x024c|0x024d|0x024e|0x0252|0x0253|0x0254|0x0259|0x025a|0x025b|0x0262|0x0263|0x0264|0x0290|0x0291|0x0292)"; + action "kldload -n wsp"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x05ac"; + match "product" "(0x030a|0x030b)"; action "kldload -n atp"; }; @@ -2209,23 +2241,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0af0"; - match "product" "0x7601"; - action "kldload -n uhso"; -}; - -nomatch 32 { - match "bus" "uhub[0-9]+"; - match "mode" "host"; - match "vendor" "0x0af0"; - match "product" "0x9000"; - action "kldload -n u3g"; -}; - -nomatch 32 { - match "bus" "uhub[0-9]+"; - match "mode" "host"; - match "vendor" "0x0af0"; - match "product" "(0xc031|0xd013|0xd031)"; + match "product" "(0x7601|0x9000|0xc031|0xd013|0xd031)"; action "kldload -n uhso"; }; @@ -5365,5 +5381,5 @@ nomatch 32 { action "kldload -n umass"; }; -# 2583 USB entries processed +# 2619 USB entries processed From owner-svn-src-head@FreeBSD.ORG Tue Feb 4 10:06:00 2014 Return-Path: Delivered-To: svn-src-head@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 E574ABD2; Tue, 4 Feb 2014 10:06:00 +0000 (UTC) Received: from mail-vc0-x22f.google.com (mail-vc0-x22f.google.com [IPv6:2607:f8b0:400c:c03::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 407571965; Tue, 4 Feb 2014 10:06:00 +0000 (UTC) Received: by mail-vc0-f175.google.com with SMTP id ij19so5533517vcb.6 for ; Tue, 04 Feb 2014 02:05:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=V/ejYjOA+OhXpNw9xDOP47iHDP2QtBNqUCSn3NoeuSg=; b=lN2e4FC6lKGteVFP3dvHgrjpLrzCFLs4n/4SnEhTiE+ok+lrsPyv7SPK0noXrr0wYM 4V4OXmI8HDNituQzFRcB3zOLdt6SqIY/kphTD9pikf0k72YR6Uz9SAPaTmkSjhpXVBEi x1yRSgWPsTWEkwZ/ixG+MiY/UIFebR4hLmZdI3DshTLPjct49jc/FgmRgzggo5+hD2kW zCoLc7ZI7cYRQjIDuOUahh/jtPem2K8CoUAGCr8Ymv4ddtcJobqq9GYQ3UIzaKgyc+GO t1w8UBgiU1cjgukJewTd2xm/UCsC3ZYawxG9fubWYK1OLqZ/3zVKRz0Twd2NKEMwBd52 1Z6A== X-Received: by 10.220.98.143 with SMTP id q15mr64251vcn.38.1391508359274; Tue, 04 Feb 2014 02:05:59 -0800 (PST) MIME-Version: 1.0 Sender: ivoras@gmail.com Received: by 10.58.171.42 with HTTP; Tue, 4 Feb 2014 02:05:19 -0800 (PST) In-Reply-To: <52EBDD42.4020702@freebsd.org> References: <201401291341.s0TDfDcB068211@svn.freebsd.org> <20140129134344.GW66160@FreeBSD.org> <52E906CD.9050202@freebsd.org> <20140129222210.0000711f@unknown> <52EBDD42.4020702@freebsd.org> From: Ivan Voras Date: Tue, 4 Feb 2014 11:05:19 +0100 X-Google-Sender-Auth: K0B6B-EOhEtgK0uP90Dkk8RnEUo Message-ID: Subject: Re: svn commit: r261266 - in head: sys/dev/drm sys/kern sys/sys usr.sbin/jail To: James Gritton Content-Type: text/plain; charset=UTF-8 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, Gleb Smirnoff , Robert Watson , svn-src-head@freebsd.org, Alexander Leidinger X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2014 10:06:01 -0000 On 31 January 2014 18:28, James Gritton wrote: > On 1/31/2014 5:34 AM, Robert Watson wrote: >> Frankly, I'd like to see this backed out and not reintroduced. If it must >> be retained, then it needs a much more clear warning that enabling this >> feature disables Jail's security model. Don't use the word 'obviate', >> instead explicitly state that root within the jail can escape the jail. >> >> Robert > > I'll do at least the next-best thing: back it out and hope to re-introduce > it. Clearly it could use some further discussion. How about outputting both a kernel (i.e. logged) and userland messages when the jail is created (or the parameter is changed, if it can?) which say something like "DANGER! The root within this jail (jid=%d) can escape the jail" or something like it? That seems reasonably loud. From owner-svn-src-head@FreeBSD.ORG Tue Feb 4 10:42:02 2014 Return-Path: Delivered-To: svn-src-head@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 45DC0B17; Tue, 4 Feb 2014 10:42:02 +0000 (UTC) Received: from cyrus.watson.org (cyrus.watson.org [198.74.231.69]) by mx1.freebsd.org (Postfix) with ESMTP id 1838C1C8B; Tue, 4 Feb 2014 10:42:02 +0000 (UTC) Received: from c0216.aw.cl.cam.ac.uk (c0216.aw.cl.cam.ac.uk [128.232.100.216]) by cyrus.watson.org (Postfix) with ESMTPSA id 1AD9146B0C; Tue, 4 Feb 2014 05:41:58 -0500 (EST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.1 \(1827\)) Subject: Re: svn commit: r261266 - in head: sys/dev/drm sys/kern sys/sys usr.sbin/jail From: "Robert N. M. Watson" In-Reply-To: Date: Tue, 4 Feb 2014 10:41:57 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201401291341.s0TDfDcB068211@svn.freebsd.org> <20140129134344.GW66160@FreeBSD.org> <52E906CD.9050202@freebsd.org> <20140129222210.0000711f@unknown> <52EBDD42.4020702@freebsd.org> To: Ivan Voras X-Mailer: Apple Mail (2.1827) Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, Gleb Smirnoff , James Gritton , svn-src-head@freebsd.org, Alexander Leidinger X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2014 10:42:02 -0000 On 4 Feb 2014, at 10:05, Ivan Voras wrote: > On 31 January 2014 18:28, James Gritton wrote: >> On 1/31/2014 5:34 AM, Robert Watson wrote: >=20 >>> Frankly, I'd like to see this backed out and not reintroduced. If = it must >>> be retained, then it needs a much more clear warning that enabling = this >>> feature disables Jail's security model. Don't use the word = 'obviate', >>> instead explicitly state that root within the jail can escape the = jail. >>=20 >> I'll do at least the next-best thing: back it out and hope to = re-introduce >> it. Clearly it could use some further discussion. >=20 > How about outputting both a kernel (i.e. logged) and userland messages > when the jail is created (or the parameter is changed, if it can?) > which say something like "DANGER! The root within this jail (jid=3D%d) > can escape the jail" or something like it? That seems reasonably loud. At the very least, we need a more clear structuring and presentation of = "insecure" options in the jail man page. E.g., a dedicated section for = options that may have serious security consequences and a nice = introduction to the section contextualising those concerns. Robert= From owner-svn-src-head@FreeBSD.ORG Tue Feb 4 10:42:20 2014 Return-Path: Delivered-To: svn-src-head@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 7BE83C51; Tue, 4 Feb 2014 10:42:20 +0000 (UTC) Received: from fep12.mx.upcmail.net (fep12.mx.upcmail.net [62.179.121.32]) by mx1.freebsd.org (Postfix) with ESMTP id 642B11C8D; Tue, 4 Feb 2014 10:42:18 +0000 (UTC) Received: from edge02.upcmail.net ([192.168.13.237]) by viefep12-int.chello.at (InterMail vM.8.01.05.13 201-2260-151-135-20130320) with ESMTP id <20140204104211.THBT42045.viefep12-int.chello.at@edge02.upcmail.net>; Tue, 4 Feb 2014 11:42:11 +0100 Received: from mole.fafoe.narf.at ([80.109.55.137]) by edge02.upcmail.net with edge id NAiA1n02w2xdvHc02AiA61; Tue, 04 Feb 2014 11:42:11 +0100 X-SourceIP: 80.109.55.137 Received: by mole.fafoe.narf.at (Postfix, from userid 1001) id 4ECE86D44C; Tue, 4 Feb 2014 11:42:10 +0100 (CET) Date: Tue, 4 Feb 2014 11:42:10 +0100 From: Stefan Farfeleder To: Dimitry Andric Subject: Re: svn commit: r261283 - in head: contrib/libc++ contrib/libc++/include contrib/libc++/include/experimental contrib/libc++/include/ext contrib/libc++/src etc/mtree lib/libc++ sys/sys tools/build/mk Message-ID: <20140204104209.GA1537@mole.fafoe.narf.at> References: <201401300744.s0U7iNLt016044@svn.freebsd.org> <20140203123235.GA1540@mole.fafoe.narf.at> <13B51A3E-B9C8-4B0C-9834-859ACEBC3375@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <13B51A3E-B9C8-4B0C-9834-859ACEBC3375@FreeBSD.org> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2014 10:42:20 -0000 On Mon, Feb 03, 2014 at 07:54:01PM +0100, Dimitry Andric wrote: > On 03 Feb 2014, at 13:32, Stefan Farfeleder wrote: > > On Thu, Jan 30, 2014 at 07:44:23AM +0000, Dimitry Andric wrote: > >> Author: dim > >> Date: Thu Jan 30 07:44:22 2014 > >> New Revision: 261283 > >> URL: http://svnweb.freebsd.org/changeset/base/261283 > >> > >> Log: > >> Import libc++ 3.4 release. This contains a lot of bugfixes, and some > >> preliminary support for C++1y. > >> > >> MFC after: 3 weeks > > > > Hi Dimitry, > > > > Is this expected to change the ABI? I had to recompile the boost > > libraries to stop my applications from crashing. > > As far as I know, this should not change the ABI. But maybe boost does > something strange, it would not amaze me. Do you have any coredumps or > actual crash reports you could share? At the moment I can only provide a backtrace, a very simple test program doesn't crash (of course). I'll try to come up with something later or tomorrow. What might be interesting is that boost::program_options::variables_map derives from std::map. Here's the backtrace: Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 806806400 (LWP 100777)] compare (this=, __str=...) at /usr/include/c++/v1/string:3585 3585 size_t __rhs_sz = __str.size(); (gdb) bt #0 compare (this=, __str=...) at /usr/include/c++/v1/string:3585 #1 operator<, std::__1::allocator > (__lhs=..., __rhs=...) at /usr/include/c++/v1/string:3769 #2 operator() (this=, __x=..., __y=...) at /usr/include/c++/v1/__functional_base:63 #3 std::__1::__tree, std::__1::allocator >, std::__1::less, std::__1::allocator > >, std::__1::allocator, std::__1::allocator > > >::__find_equal, std::__1::allocator > > (this=, __parent=@0x7fffffffb758: 0x7fffffffb8b0, __v=...) at /usr/include/c++/v1/__tree:1613 #4 0x00000008009b5f41 in std::__1::__tree, std::__1::allocator >, std::__1::less, std::__1::allocator > >, std::__1::allocator, std::__1::allocator > > >::__insert_unique (this=0x7fffffffb8e0, __v=...) at /usr/include/c++/v1/__tree:1867 #5 0x00000008034ca383 in boost::program_options::store(boost::program_options::basic_parsed_options const&, boost::program_options::variables_map&, bool) () from /usr/local/lib/libboost_program_options.so.5 Stefan From owner-svn-src-head@FreeBSD.ORG Tue Feb 4 12:34:09 2014 Return-Path: Delivered-To: svn-src-head@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 4A3E1768; Tue, 4 Feb 2014 12:34:09 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 33AB2177F; Tue, 4 Feb 2014 12:34:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s14CY9kN051061; Tue, 4 Feb 2014 12:34:09 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s14CY8vI051059; Tue, 4 Feb 2014 12:34:08 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402041234.s14CY8vI051059@svn.freebsd.org> From: Christian Brueffer Date: Tue, 4 Feb 2014 12:34:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261487 - in head/release/doc: en_US.ISO8859-1/hardware share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2014 12:34:09 -0000 Author: brueffer Date: Tue Feb 4 12:34:08 2014 New Revision: 261487 URL: http://svnweb.freebsd.org/changeset/base/261487 Log: Add qlxgbe(4) and qlxge(4) to the hardware notes. MFC after: 1 week Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml head/release/doc/share/misc/dev.archlist.txt Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/hardware/article.xml Tue Feb 4 10:29:23 2014 (r261486) +++ head/release/doc/en_US.ISO8859-1/hardware/article.xml Tue Feb 4 12:34:08 2014 (r261487) @@ -893,6 +893,10 @@ &hwlist.qlxgb; + &hwlist.qlxgbe; + + &hwlist.qlxge; + &hwlist.re; &hwlist.rl; Modified: head/release/doc/share/misc/dev.archlist.txt ============================================================================== --- head/release/doc/share/misc/dev.archlist.txt Tue Feb 4 10:29:23 2014 (r261486) +++ head/release/doc/share/misc/dev.archlist.txt Tue Feb 4 12:34:08 2014 (r261487) @@ -105,6 +105,8 @@ oltr i386 pcn i386,pc98,ia64,amd64 pst i386 qlxgb amd64 +qlxgbe amd64 +qlxge amd64 rc i386 ral i386,amd64 rue i386,pc98,amd64 From owner-svn-src-head@FreeBSD.ORG Tue Feb 4 13:24:16 2014 Return-Path: Delivered-To: svn-src-head@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 54D8FDA8; Tue, 4 Feb 2014 13:24:16 +0000 (UTC) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1A3081BFA; Tue, 4 Feb 2014 13:24:15 +0000 (UTC) Received: from Julian-MBP3.local (50-196-156-133-static.hfc.comcastbusiness.net [50.196.156.133]) (authenticated bits=0) by vps1.elischer.org (8.14.7/8.14.7) with ESMTP id s14DNw5D043486 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Tue, 4 Feb 2014 05:24:01 -0800 (PST) (envelope-from julian@freebsd.org) Message-ID: <52F0E9E9.2080402@freebsd.org> Date: Tue, 04 Feb 2014 21:23:53 +0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: "Robert N. M. Watson" , Doug Ambrisko Subject: Re: svn commit: r261266 - in head: sys/dev/drm sys/kern sys/sys usr.sbin/jail References: <201401291341.s0TDfDcB068211@svn.freebsd.org> <20140129134344.GW66160@FreeBSD.org> <52E906CD.9050202@freebsd.org> <20140129222210.0000711f@unknown> <20140131223011.0000163b@unknown> <52EC4DBB.50804@freebsd.org> <20140203235336.GA46006@ambrisko.com> <6AF2ADA6-8BAD-4875-8B15-A859B41DDCC0@FreeBSD.org> In-Reply-To: <6AF2ADA6-8BAD-4875-8B15-A859B41DDCC0@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, Gleb Smirnoff , James Gritton , svn-src-head@FreeBSD.org, Alexander Leidinger X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2014 13:24:16 -0000 On 2/4/14, 3:40 PM, Robert N. M. Watson wrote: > On 3 Feb 2014, at 23:53, Doug Ambrisko wrote: > >> It's unfortunate that vimage requires jail. I want to use vimage but >> not have the security restrictions of a jail. To do this I patched >> jail to basically let everything through. It would be nice to be >> able to run jail in an insecure mode which I understand is a contradit= ion. >> I do use the jail infrastructure to set the uname*/getosreldate so >> that a specific jail thinks it is FreeBSD version blah. Then I can ss= h >> into that jail and pkg_add things, make ports etc. I use this on >> my laptop running current on the base. My other jails run various >> versions of FreeBSD. I don't care about security in this case. vimage was not originally tied to jails. I can't remember why we=20 decided to do that :-) > Something I've wanted to do for a while (>15 years) {takes deep breath) > is move from a simple privilege model to a privilege-mask model in whic= h masks of available system privileges can be delegated to jails rather t= han hard-coding the list of privileges in jails. oh is that all... had been imagining "climb Mount Everest",=20 "Photograph a giant Squid" or similar.. > I got about 1/3 of the way there with priv(9): enumerating system pri= vileges, and shifting knowledge of "is it available in jail" out of calli= ng subsystems into the privilege model itself. > > The next phase is to introduce a structured notion of a privilege mask = (efficiently), and expose masks in limited circumstances -- e.g., Jail co= nfiguration. This requires introducing an /etc/security/privileges, and a= default /etc/security/jail.privileges (or similar) that provide a mappin= g from user-readable privilege names to numbers, and a reasonable default= subset mask that jail(8) can use when creating a jail. This would allow = configuration of arbitrary privileges for jails in a generalisable way, r= ather than lots of custom sysctls and extensions. We could even provide d= ifferent 'profiles' such as 'jail.default' for the current model, and per= haps 'jail.allrights' to capture the idea of a child jail that retains al= l privileges the parent jail held. We might ask users to say --I-am-reall= y-sure (or something less obnoxious but equally prominent) to create jail= s to which stronger rights than the default are granted. The one thing that always worries me is with priv models is that I=20 have a nagging suspicion that to do them right you end up having to enumerate 7,567,342 different separate privs..=20 "Is allowed to take puppies for a walk", etc. (and "is allowed to take puppies for a walk in Scotland"). > > The final phase is to introduce a process-exposed privilege model allow= ing individual processes to manage privilege masks. In about 2000, Brian = Feldman and I implemented POSIX.1e privileges [twice] for FreeBSD (not to= o different from what Linux implemented, and derived form the model in IR= IX) but were deeply unimpressed. The current Solaris model is probably cl= osest to what we want, but we'd have to think through it pretty carefully= =2E One of the reasons we never merged our POSIX.1e implementation was th= at although the model itself worked OK, various compatibility modes (such= as the one adopted in Linux) led to serious but quite subtle security vu= lnerabilities. This is not a phase to embark on without a *lot* of though= t. > > There's a moderate amount of work in doing this, which I've never quite= found time to chase up. It would be worth doing as it would solve a numb= er of other problems. The risks involved are significant -- it's very, ve= ry easy to get wrong (as we convinced ourselves on multiple occasions, an= d from having looked at problems in other UNIX systems that went this rou= te) -- so it really does require time and a lot of review of both the mod= el and implementation. The Jail portion of it is likely the easy bit, but= does require us to come up with a sensible user<->kernel ABI for masks (= an extensible one, ideally, since you always find you want more privilege= s), as well as a sensible kernel<->kernel ABI (one that's relatively stab= le but perhaps less extensible -- with performance benefits over the exte= nsible interface). > > Robert > From owner-svn-src-head@FreeBSD.ORG Tue Feb 4 13:49:51 2014 Return-Path: Delivered-To: svn-src-head@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 7418967C; Tue, 4 Feb 2014 13:49:51 +0000 (UTC) Received: from m2.gritton.org (gritton.org [199.192.164.235]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2C5D71DC3; Tue, 4 Feb 2014 13:49:50 +0000 (UTC) Received: from [192.168.0.34] (c-50-168-192-61.hsd1.ut.comcast.net [50.168.192.61]) (authenticated bits=0) by m2.gritton.org (8.14.7/8.14.7) with ESMTP id s14DnbQK005491; Tue, 4 Feb 2014 06:49:37 -0700 (MST) (envelope-from jamie@freebsd.org) Message-ID: <52F0EFE8.7030105@freebsd.org> Date: Tue, 04 Feb 2014 06:49:28 -0700 From: James Gritton User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Julian Elischer , "Robert N. M. Watson" , Doug Ambrisko Subject: Re: svn commit: r261266 - in head: sys/dev/drm sys/kern sys/sys usr.sbin/jail References: <201401291341.s0TDfDcB068211@svn.freebsd.org> <20140129134344.GW66160@FreeBSD.org> <52E906CD.9050202@freebsd.org> <20140129222210.0000711f@unknown> <20140131223011.0000163b@unknown> <52EC4DBB.50804@freebsd.org> <20140203235336.GA46006@ambrisko.com> <6AF2ADA6-8BAD-4875-8B15-A859B41DDCC0@FreeBSD.org> <52F0E9E9.2080402@freebsd.org> In-Reply-To: <52F0E9E9.2080402@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, Alexander Leidinger , svn-src-all@FreeBSD.org, Gleb Smirnoff , src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2014 13:49:51 -0000 On 2/4/2014 6:23 AM, Julian Elischer wrote: > On 2/4/14, 3:40 PM, Robert N. M. Watson wrote: >> On 3 Feb 2014, at 23:53, Doug Ambrisko wrote: >> >>> It's unfortunate that vimage requires jail. I want to use vimage but >>> not have the security restrictions of a jail. To do this I patched >>> jail to basically let everything through. It would be nice to be >>> able to run jail in an insecure mode which I understand is a >>> contradition. >>> I do use the jail infrastructure to set the uname*/getosreldate so >>> that a specific jail thinks it is FreeBSD version blah. Then I can ssh >>> into that jail and pkg_add things, make ports etc. I use this on >>> my laptop running current on the base. My other jails run various >>> versions of FreeBSD. I don't care about security in this case. > > vimage was not originally tied to jails. I can't remember why we > decided to do that :-) Leaving the smiley aside for the present, I remember that one - and it's closely tied to this discussion. It was part of this more flexible vision of jails that had added features, of which security was just one (optional) part. I thought of them as a more general encapsulation framework as needs would arise. Vimage was one of those needs. Marko Zec had originally implemented it with its own set of containers that ran parallel with jails, partially implementing some parts of jail but only well enough for the proof-of-concept of his networking idea. One thing vimage had going for it was hierarchies, which allowed one virtual network to exist encapsulated inside another, and that's how jails themselves became hierarchical. It was a requirement for Marko to agree to allow his own vimage-only encapsulation to be subsumed inside jails. Perhaps all that is what the smiley meant, but it's good to have a little history every now and then. - Jamie From owner-svn-src-head@FreeBSD.ORG Tue Feb 4 14:10:34 2014 Return-Path: Delivered-To: svn-src-head@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 C6B0E3B2; Tue, 4 Feb 2014 14:10:34 +0000 (UTC) Received: from cyrus.watson.org (cyrus.watson.org [198.74.231.69]) by mx1.freebsd.org (Postfix) with ESMTP id 7E8401183; Tue, 4 Feb 2014 14:10:34 +0000 (UTC) Received: from c0216.aw.cl.cam.ac.uk (c0216.aw.cl.cam.ac.uk [128.232.100.216]) by cyrus.watson.org (Postfix) with ESMTPSA id B5EC446B2A; Tue, 4 Feb 2014 09:10:30 -0500 (EST) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 7.1 \(1827\)) Subject: Re: svn commit: r261266 - in head: sys/dev/drm sys/kern sys/sys usr.sbin/jail From: "Robert N. M. Watson" In-Reply-To: <52F0E9E9.2080402@freebsd.org> Date: Tue, 4 Feb 2014 14:10:28 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <888199BA-9D75-4144-A8E2-BE2B1E06E110@FreeBSD.org> References: <201401291341.s0TDfDcB068211@svn.freebsd.org> <20140129134344.GW66160@FreeBSD.org> <52E906CD.9050202@freebsd.org> <20140129222210.0000711f@unknown> <20140131223011.0000163b@unknown> <52EC4DBB.50804@freebsd.org> <20140203235336.GA46006@ambrisko.com> <6AF2ADA6-8BAD-4875-8B15-A859B41DDCC0@FreeBSD.org> <52F0E9E9.2080402@freebsd.org> To: Julian Elischer X-Mailer: Apple Mail (2.1827) Cc: src-committers@FreeBSD.org, Doug Ambrisko , svn-src-all@FreeBSD.org, Gleb Smirnoff , James Gritton , svn-src-head@FreeBSD.org, Alexander Leidinger X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2014 14:10:35 -0000 On 4 Feb 2014, at 13:23, Julian Elischer wrote: > On 2/4/14, 3:40 PM, Robert N. M. Watson wrote: >> On 3 Feb 2014, at 23:53, Doug Ambrisko wrote: >>=20 >>> It's unfortunate that vimage requires jail. I want to use vimage = but >>> not have the security restrictions of a jail. To do this I patched >>> jail to basically let everything through. It would be nice to be >>> able to run jail in an insecure mode which I understand is a = contradition. >>> I do use the jail infrastructure to set the uname*/getosreldate so >>> that a specific jail thinks it is FreeBSD version blah. Then I can = ssh >>> into that jail and pkg_add things, make ports etc. I use this on >>> my laptop running current on the base. My other jails run various >>> versions of FreeBSD. I don't care about security in this case. >=20 >> The next phase is to introduce a structured notion of a privilege = mask (efficiently), and expose masks in limited circumstances -- e.g., = Jail configuration. This requires introducing an = /etc/security/privileges, and a default /etc/security/jail.privileges = (or similar) that provide a mapping from user-readable privilege names = to numbers, and a reasonable default subset mask that jail(8) can use = when creating a jail. This would allow configuration of arbitrary = privileges for jails in a generalisable way, rather than lots of custom = sysctls and extensions. We could even provide different 'profiles' such = as 'jail.default' for the current model, and perhaps 'jail.allrights' to = capture the idea of a child jail that retains all privileges the parent = jail held. We might ask users to say --I-am-really-sure (or something = less obnoxious but equally prominent) to create jails to which stronger = rights than the default are granted. > The one thing that always worries me is with priv models is that I = have a nagging suspicion that to do them right > you end up having to enumerate 7,567,342 different separate privs.. = "Is allowed to take puppies for a walk", etc. > (and "is allowed to take puppies for a walk in Scotland"). Well, we've done the privilege decomposition phase already, and the = number is more around 240-250 than 7,567,342. Solaris lives in the = 90-100 range. Linux has a smaller number as they limit the bits to a = 32-bit word. In FreeBSD we selected to use the same privilege for = 'near-identical semantics' where priv_check() (previously suser()) was = called -- with the exceptions of catchalls such as PRIV_DRIVER. In = Linux, CAP_SYS_ADMIN tends to be a much broader catchall for 'things = that used to require root and have something to do with administration'. = Solaris lives between. None of these systems specialise device-driver = privileges -- instead they focus on core OS functions. Likewise, the = definition of privilege in this case is 'global' across all objects of = some type: when we bind policy to specific objects, we call it = 'permissions', 'ACLs', 'labels', etc which narrows the scope quite a = bit. Robert= From owner-svn-src-head@FreeBSD.ORG Tue Feb 4 15:32:50 2014 Return-Path: Delivered-To: svn-src-head@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 03DD36AA; Tue, 4 Feb 2014 15:32:50 +0000 (UTC) Received: from mail-qc0-x22f.google.com (mail-qc0-x22f.google.com [IPv6:2607:f8b0:400d:c01::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7E36D194C; Tue, 4 Feb 2014 15:32:49 +0000 (UTC) Received: by mail-qc0-f175.google.com with SMTP id x13so13921974qcv.34 for ; Tue, 04 Feb 2014 07:32:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=LxJ+YEw6E60HD32ZrGdNiElCfujMHdSRezSq39q3pls=; b=yZ5NM6IR/JS/L2/5RPFq4Xx1jbZLfU/bjgxif61VEDUdmMS6MKeiXNT8Euq6IuPm0c cHf/XpWT9IG7g4edKrlM53XFT16ObLKvBi3rk2aUUCzj/jCiKx04nOOeQC+rFxBA4lNh tJbDX/FnHET3MOcVNmZhF1SluwzzL85Ih0ZoEyz6g2O6+OJRZHL+curSK7k4zRa0Aww6 fMmasuibJ9+uhjG+HtNhCsOOCdGNmcAj5nslK35N1WjbTBEQwdQAiPF6JDeU8osVSOUl 0epVJfCRzG4A2aUzANoRfBHbBskCB6nW8xLspUZdZW5wdYspAgzEQM0KgNd6EGRx6mTN Szhg== MIME-Version: 1.0 X-Received: by 10.224.36.195 with SMTP id u3mr67136540qad.59.1391527968559; Tue, 04 Feb 2014 07:32:48 -0800 (PST) Sender: carpeddiem@gmail.com Received: by 10.140.31.68 with HTTP; Tue, 4 Feb 2014 07:32:48 -0800 (PST) In-Reply-To: <20140131220727.GN1740@glenbarber.us> References: <201401191846.s0JIkdvw046339@svn.freebsd.org> <65D0418F-A3F2-490E-8A7E-E2212BB7F2F8@felyko.com> <20140131220727.GN1740@glenbarber.us> Date: Tue, 4 Feb 2014 10:32:48 -0500 X-Google-Sender-Auth: k2ZkVHgVJ0aNafyGLL0DHQwF8og Message-ID: Subject: Re: svn commit: r260888 - in head/sys: amd64/conf i386/conf From: Ed Maste To: Glen Barber Content-Type: text/plain; charset=ISO-8859-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Rui Paulo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2014 15:32:50 -0000 On 31 January 2014 17:07, Glen Barber wrote: > On Fri, Jan 31, 2014 at 02:01:52PM -0800, Rui Paulo wrote: >> On 19 Jan 2014, at 10:46, Ed Maste wrote: >> >> > Author: emaste >> > Date: Sun Jan 19 18:46:38 2014 >> > New Revision: 260888 >> > URL: http://svnweb.freebsd.org/changeset/base/260888 >> > >> > Log: >> > Add VT kernel configuration to ease testing of vt(9), aka Newcons >> >> I thought there was consensus that adding these amd64/i386 configuration files to the repository was not good idea. >> >> Is this something that helps a lot of people? Are you thinking of removing it later? Can't they co-exist based on a tunable? >> > > It is easier to build images with non-GENERIC default kernels this way. > The installer does not currently allow selecting a kernel to install, > even if multiple exist on the medium. Further to Glen's comment, they will indeed be removed later, once the remaining vt(9) nits are fixed and it is enabled in GENERIC. From owner-svn-src-head@FreeBSD.ORG Tue Feb 4 17:35:42 2014 Return-Path: Delivered-To: svn-src-head@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 C43193B8; Tue, 4 Feb 2014 17:35: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A8C8215ED; Tue, 4 Feb 2014 17:35:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s14HZguC073412; Tue, 4 Feb 2014 17:35:42 GMT (envelope-from ambrisko@svn.freebsd.org) Received: (from ambrisko@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s14HZgb8073409; Tue, 4 Feb 2014 17:35:42 GMT (envelope-from ambrisko@svn.freebsd.org) Message-Id: <201402041735.s14HZgb8073409@svn.freebsd.org> From: Doug Ambrisko Date: Tue, 4 Feb 2014 17:35:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261491 - in head: share/man/man4 sys/dev/mfi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2014 17:35:42 -0000 Author: ambrisko Date: Tue Feb 4 17:35:41 2014 New Revision: 261491 URL: http://svnweb.freebsd.org/changeset/base/261491 Log: Add a tunable "hw.mfi.mrsas_enable" to allow mfi(4) to drop priority and allow mrsas(4) from LSI to attach to newer LSI cards that are support by mrsas(4). If mrsas(4) is not loaded into the system at boot then mfi(4) will always attach. If a modified mrsas(4) is loaded in the system. That modification is return "-30" in it's probe since that is between BUS_PROBE_DEFAULT and BUS_PROBE_LOW_PRIORITY. This option is controller by a new probe flag "MFI_FLAGS_MRSAS" in mfi_ident that denotes cards that should work with mrsas(4). New entries that should have this option. This is the first step to get mrsas(4) checked into FreeBSD and to avoid collision with people that use mrsas(4) from LSI. Since mfi(4) takes priority, then mrsas(4) users need to rebuild GENERIC. Using the .disabled="1" method doesn't work since that blocks attaching and the probe gave it to mfi(4). Discussed with: LSI (Kashyap Desai) Modified: head/share/man/man4/mfi.4 head/sys/dev/mfi/mfi_pci.c head/sys/dev/mfi/mfivar.h Modified: head/share/man/man4/mfi.4 ============================================================================== --- head/share/man/man4/mfi.4 Tue Feb 4 16:29:30 2014 (r261490) +++ head/share/man/man4/mfi.4 Tue Feb 4 17:35:41 2014 (r261491) @@ -72,6 +72,17 @@ If the sysctl .Va dev.mfi.%d.delete_busy_volumes is set to 1, then the driver will allow mounted volumes to be removed. +.Pp +A tunable is provided to adjust the +.Nm +driver's behaviour when attaching to a card. By default the driver will +attach to all known cards with high probe priority. If the tunable +.Va hw.mfi.mrsas_enable +is set to 1, +then the driver will reduce its probe priority to allow +.Cd mrsas +to attach to the card instead of +.Nm . .Sh HARDWARE The .Nm Modified: head/sys/dev/mfi/mfi_pci.c ============================================================================== --- head/sys/dev/mfi/mfi_pci.c Tue Feb 4 16:29:30 2014 (r261490) +++ head/sys/dev/mfi/mfi_pci.c Tue Feb 4 17:35:41 2014 (r261491) @@ -112,6 +112,11 @@ TUNABLE_INT("hw.mfi.msi", &mfi_msi); SYSCTL_INT(_hw_mfi, OID_AUTO, msi, CTLFLAG_RDTUN, &mfi_msi, 0, "Enable use of MSI interrupts"); +static int mfi_mrsas_enable = 0; +TUNABLE_INT("hw.mfi.mrsas_enable", &mfi_msi); +SYSCTL_INT(_hw_mfi, OID_AUTO, mrsas_enable, CTLFLAG_RDTUN, &mfi_mrsas_enable, + 0, "Allow mrasas to take newer cards"); + struct mfi_ident { uint16_t vendor; uint16_t device; @@ -120,18 +125,18 @@ struct mfi_ident { int flags; const char *desc; } mfi_identifiers[] = { - {0x1000, 0x005b, 0x1028, 0x1f2d, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT, "Dell PERC H810 Adapter"}, - {0x1000, 0x005b, 0x1028, 0x1f30, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT, "Dell PERC H710 Embedded"}, - {0x1000, 0x005b, 0x1028, 0x1f31, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT, "Dell PERC H710P Adapter"}, - {0x1000, 0x005b, 0x1028, 0x1f33, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT, "Dell PERC H710P Mini (blades)"}, - {0x1000, 0x005b, 0x1028, 0x1f34, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT, "Dell PERC H710P Mini (monolithics)"}, - {0x1000, 0x005b, 0x1028, 0x1f35, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT, "Dell PERC H710 Adapter"}, - {0x1000, 0x005b, 0x1028, 0x1f37, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT, "Dell PERC H710 Mini (blades)"}, - {0x1000, 0x005b, 0x1028, 0x1f38, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT, "Dell PERC H710 Mini (monolithics)"}, - {0x1000, 0x005b, 0x8086, 0x9265, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT, "Intel (R) RAID Controller RS25DB080"}, - {0x1000, 0x005b, 0x8086, 0x9285, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT, "Intel (R) RAID Controller RS25NB008"}, - {0x1000, 0x005b, 0xffff, 0xffff, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT, "ThunderBolt"}, - {0x1000, 0x005d, 0xffff, 0xffff, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT, "Invader"}, + {0x1000, 0x005b, 0x1028, 0x1f2d, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT| MFI_FLAGS_MRSAS, "Dell PERC H810 Adapter"}, + {0x1000, 0x005b, 0x1028, 0x1f30, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT| MFI_FLAGS_MRSAS, "Dell PERC H710 Embedded"}, + {0x1000, 0x005b, 0x1028, 0x1f31, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT| MFI_FLAGS_MRSAS, "Dell PERC H710P Adapter"}, + {0x1000, 0x005b, 0x1028, 0x1f33, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT| MFI_FLAGS_MRSAS, "Dell PERC H710P Mini (blades)"}, + {0x1000, 0x005b, 0x1028, 0x1f34, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT| MFI_FLAGS_MRSAS, "Dell PERC H710P Mini (monolithics)"}, + {0x1000, 0x005b, 0x1028, 0x1f35, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT| MFI_FLAGS_MRSAS, "Dell PERC H710 Adapter"}, + {0x1000, 0x005b, 0x1028, 0x1f37, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT| MFI_FLAGS_MRSAS, "Dell PERC H710 Mini (blades)"}, + {0x1000, 0x005b, 0x1028, 0x1f38, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT| MFI_FLAGS_MRSAS, "Dell PERC H710 Mini (monolithics)"}, + {0x1000, 0x005b, 0x8086, 0x9265, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT| MFI_FLAGS_MRSAS, "Intel (R) RAID Controller RS25DB080"}, + {0x1000, 0x005b, 0x8086, 0x9285, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT| MFI_FLAGS_MRSAS, "Intel (R) RAID Controller RS25NB008"}, + {0x1000, 0x005b, 0xffff, 0xffff, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT| MFI_FLAGS_MRSAS, "ThunderBolt"}, + {0x1000, 0x005d, 0xffff, 0xffff, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT| MFI_FLAGS_MRSAS, "Invader"}, {0x1000, 0x0060, 0x1028, 0xffff, MFI_FLAGS_1078, "Dell PERC 6"}, {0x1000, 0x0060, 0xffff, 0xffff, MFI_FLAGS_1078, "LSI MegaSAS 1078"}, {0x1000, 0x0071, 0xffff, 0xffff, MFI_FLAGS_SKINNY, "Drake Skinny"}, @@ -178,7 +183,13 @@ mfi_pci_probe(device_t dev) if ((id = mfi_find_ident(dev)) != NULL) { device_set_desc(dev, id->desc); - return (BUS_PROBE_DEFAULT); + + /* give priority to mrsas if tunable set */ + TUNABLE_INT_FETCH("hw.mfi.mrsas_enable", &mfi_mrsas_enable); + if ((id->flags & MFI_FLAGS_MRSAS) && mfi_mrsas_enable) + return (BUS_PROBE_LOW_PRIORITY); + else + return (BUS_PROBE_DEFAULT); } return (ENXIO); } Modified: head/sys/dev/mfi/mfivar.h ============================================================================== --- head/sys/dev/mfi/mfivar.h Tue Feb 4 16:29:30 2014 (r261490) +++ head/sys/dev/mfi/mfivar.h Tue Feb 4 17:35:41 2014 (r261491) @@ -199,6 +199,7 @@ struct mfi_softc { #define MFI_FLAGS_GEN2 (1<<6) #define MFI_FLAGS_SKINNY (1<<7) #define MFI_FLAGS_TBOLT (1<<8) +#define MFI_FLAGS_MRSAS (1<<9) // Start: LSIP200113393 bus_dma_tag_t verbuf_h_dmat; bus_dmamap_t verbuf_h_dmamap; From owner-svn-src-head@FreeBSD.ORG Tue Feb 4 18:24:27 2014 Return-Path: Delivered-To: svn-src-head@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 C76741C8; Tue, 4 Feb 2014 18:24:27 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A492D1A31; Tue, 4 Feb 2014 18:24:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s14IORxY093094; Tue, 4 Feb 2014 18:24:27 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s14IOQpU093086; Tue, 4 Feb 2014 18:24:26 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201402041824.s14IOQpU093086@svn.freebsd.org> From: Warner Losh Date: Tue, 4 Feb 2014 18:24:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261492 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2014 18:24:27 -0000 Author: imp Date: Tue Feb 4 18:24:25 2014 New Revision: 261492 URL: http://svnweb.freebsd.org/changeset/base/261492 Log: Bump the version of config to the latest (3 year old, so upgrade worries are long past). Also remove redundant MACHINE= declarations and passing MACHINE/MACHINE_ARCH to module builds. That's now done in common code. Modified: head/sys/conf/Makefile.amd64 head/sys/conf/Makefile.arm head/sys/conf/Makefile.i386 head/sys/conf/Makefile.ia64 head/sys/conf/Makefile.mips head/sys/conf/Makefile.pc98 head/sys/conf/Makefile.powerpc head/sys/conf/Makefile.sparc64 Modified: head/sys/conf/Makefile.amd64 ============================================================================== --- head/sys/conf/Makefile.amd64 Tue Feb 4 17:35:41 2014 (r261491) +++ head/sys/conf/Makefile.amd64 Tue Feb 4 18:24:25 2014 (r261492) @@ -18,7 +18,7 @@ # # Which version of config(8) is required. -%VERSREQ= 600004 +%VERSREQ= 600012 STD8X16FONT?= iso @@ -37,8 +37,6 @@ INCLUDES+= -I$S/contrib/libfdt CFLAGS+= -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer .endif -MKMODULESENV+= MACHINE=amd64 - # XXX: clang integrated-as doesn't grok .codeNN directives yet ASM_CFLAGS.acpi_wakecode.S= ${CLANG_NO_IAS} ASM_CFLAGS.mpboot.S= ${CLANG_NO_IAS} Modified: head/sys/conf/Makefile.arm ============================================================================== --- head/sys/conf/Makefile.arm Tue Feb 4 17:35:41 2014 (r261491) +++ head/sys/conf/Makefile.arm Tue Feb 4 18:24:25 2014 (r261492) @@ -17,7 +17,7 @@ # # Which version of config(8) is required. -%VERSREQ= 600004 +%VERSREQ= 600012 STD8X16FONT?= iso @@ -126,8 +126,6 @@ ${KERNEL_KO}.tramp: ${KERNEL_KO} $S/$M/$ rm ${KERNEL_KO}.tmp.gz ${KERNEL_KO}.tramp.noheader opt_kernname.h \ inflate-tramp.o tmphack.S -MKMODULESENV+= MACHINE=${MACHINE} - %BEFORE_DEPEND %OBJS Modified: head/sys/conf/Makefile.i386 ============================================================================== --- head/sys/conf/Makefile.i386 Tue Feb 4 17:35:41 2014 (r261491) +++ head/sys/conf/Makefile.i386 Tue Feb 4 18:24:25 2014 (r261492) @@ -17,7 +17,7 @@ # # Which version of config(8) is required. -%VERSREQ= 600004 +%VERSREQ= 600012 STD8X16FONT?= iso @@ -32,10 +32,6 @@ S= ../../.. INCLUDES+= -I$S/contrib/libfdt -MACHINE=i386 - -MKMODULESENV+= MACHINE=${MACHINE} - # XXX: clang integrated-as doesn't grok .codeNN directives yet ASM_CFLAGS.acpi_wakecode.S= ${CLANG_NO_IAS} ASM_CFLAGS.mpboot.s= ${CLANG_NO_IAS} Modified: head/sys/conf/Makefile.ia64 ============================================================================== --- head/sys/conf/Makefile.ia64 Tue Feb 4 17:35:41 2014 (r261491) +++ head/sys/conf/Makefile.ia64 Tue Feb 4 18:24:25 2014 (r261492) @@ -17,7 +17,7 @@ # # Which version of config(8) is required. -%VERSREQ= 600004 +%VERSREQ= 600012 STD8X16FONT?= iso Modified: head/sys/conf/Makefile.mips ============================================================================== --- head/sys/conf/Makefile.mips Tue Feb 4 17:35:41 2014 (r261491) +++ head/sys/conf/Makefile.mips Tue Feb 4 18:24:25 2014 (r261492) @@ -15,7 +15,7 @@ # # Which version of config(8) is required. -%VERSREQ= 600004 +%VERSREQ= 600012 STD8X16FONT?= iso @@ -39,8 +39,6 @@ KERNLOADADDR?=0x80001000 # To be changed later TRAMPLOADADDR?=0x807963c0 -MKMODULESENV+= MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE_ARCH} - # We default to the MIPS32 ISA, if none specified in the # kernel configuration file. ARCH_FLAGS?=-march=mips32 @@ -60,7 +58,6 @@ TRAMP_ELFSIZE=64 TRAMP_ELFSIZE=32 .endif -# XXX hardcoded kernel entry point ASM_CFLAGS+=${CFLAGS} -D_LOCORE -DLOCORE .if !defined(WITHOUT_KERNEL_TRAMPOLINE) Modified: head/sys/conf/Makefile.pc98 ============================================================================== --- head/sys/conf/Makefile.pc98 Tue Feb 4 17:35:41 2014 (r261491) +++ head/sys/conf/Makefile.pc98 Tue Feb 4 18:24:25 2014 (r261492) @@ -19,7 +19,7 @@ # # Which version of config(8) is required. -%VERSREQ= 600004 +%VERSREQ= 600012 .if !defined(S) .if exists(./@/.) @@ -30,10 +30,6 @@ S= ../../.. .endif .include "$S/conf/kern.pre.mk" -MACHINE=pc98 - -MKMODULESENV+= MACHINE=${MACHINE} - # XXX: clang integrated-as doesn't grok .codeNN directives yet ASM_CFLAGS.mpboot.s= ${CLANG_NO_IAS} ASM_CFLAGS+= ${ASM_CFLAGS.${.IMPSRC:T}} Modified: head/sys/conf/Makefile.powerpc ============================================================================== --- head/sys/conf/Makefile.powerpc Tue Feb 4 17:35:41 2014 (r261491) +++ head/sys/conf/Makefile.powerpc Tue Feb 4 18:24:25 2014 (r261492) @@ -17,7 +17,7 @@ # # Which version of config(8) is required. -%VERSREQ= 600010 +%VERSREQ= 600012 STD8X16FONT?= iso Modified: head/sys/conf/Makefile.sparc64 ============================================================================== --- head/sys/conf/Makefile.sparc64 Tue Feb 4 17:35:41 2014 (r261491) +++ head/sys/conf/Makefile.sparc64 Tue Feb 4 18:24:25 2014 (r261492) @@ -17,7 +17,7 @@ # # Which version of config(8) is required. -%VERSREQ= 600004 +%VERSREQ= 600012 STD8X16FONT?= iso From owner-svn-src-head@FreeBSD.ORG Tue Feb 4 18:28:59 2014 Return-Path: Delivered-To: svn-src-head@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 2500B4F3; Tue, 4 Feb 2014 18:28: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E9DAD1A63; Tue, 4 Feb 2014 18:28:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s14ISw0i093754; Tue, 4 Feb 2014 18:28:58 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s14ISwb0093752; Tue, 4 Feb 2014 18:28:58 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201402041828.s14ISwb0093752@svn.freebsd.org> From: Warner Losh Date: Tue, 4 Feb 2014 18:28:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261493 - head/usr.sbin/config X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2014 18:28:59 -0000 Author: imp Date: Tue Feb 4 18:28:58 2014 New Revision: 261493 URL: http://svnweb.freebsd.org/changeset/base/261493 Log: Implement the '!' operator for files* files. It means 'include this only if the specified option is NOT specified.' Bump version because old config won't be able to cope with files* files that have this construct in them. Modified: head/usr.sbin/config/configvers.h head/usr.sbin/config/mkmakefile.c Modified: head/usr.sbin/config/configvers.h ============================================================================== --- head/usr.sbin/config/configvers.h Tue Feb 4 18:24:25 2014 (r261492) +++ head/usr.sbin/config/configvers.h Tue Feb 4 18:28:58 2014 (r261493) @@ -49,5 +49,5 @@ * * $FreeBSD$ */ -#define CONFIGVERS 600012 +#define CONFIGVERS 600013 #define MAJOR_VERS(x) ((x) / 100000) Modified: head/usr.sbin/config/mkmakefile.c ============================================================================== --- head/usr.sbin/config/mkmakefile.c Tue Feb 4 18:24:25 2014 (r261492) +++ head/usr.sbin/config/mkmakefile.c Tue Feb 4 18:28:58 2014 (r261493) @@ -308,7 +308,7 @@ read_file(char *fname) struct opt *op; char *wd, *this, *compilewith, *depends, *clean, *warning; const char *objprefix; - int compile, match, nreqs, std, filetype, + int compile, match, nreqs, std, filetype, not, imp_rule, no_obj, before_depend, nowerror; fp = fopen(fname, "r"); @@ -366,6 +366,7 @@ next: no_obj = 0; before_depend = 0; nowerror = 0; + not = 0; filetype = NORMAL; objprefix = ""; if (eq(wd, "standard")) @@ -376,13 +377,21 @@ next: for (wd = get_word(fp); wd; wd = get_word(fp)) { if (wd == (char *)EOF) return; + if (eq(wd, "!")) { + not = 1; + continue; + } if (eq(wd, "|")) { if (nreqs == 0) errout("%s: syntax error describing %s\n", fname, this); - compile += match; + if (not) + compile += !match; + else + compile += match; match = 1; nreqs = 0; + not = 0; continue; } if (eq(wd, "no-obj")) { @@ -471,9 +480,13 @@ next: if (op->op_value == 0 && opteq(op->op_name, wd)) goto nextparam; match = 0; -nextparam:; +nextparam: + not = 0; } - compile += match; + if (not) + compile += !match; + else + compile += match; if (compile && tp == NULL) { if (std == 0 && nreqs == 0) errout("%s: what is %s optional on?\n", From owner-svn-src-head@FreeBSD.ORG Tue Feb 4 18:54:33 2014 Return-Path: Delivered-To: svn-src-head@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 B1C64F11; Tue, 4 Feb 2014 18:54:33 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9B4F01CE3; Tue, 4 Feb 2014 18:54:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s14IsXEv004905; Tue, 4 Feb 2014 18:54:33 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s14IsXDm004904; Tue, 4 Feb 2014 18:54:33 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402041854.s14IsXDm004904@svn.freebsd.org> From: Christian Brueffer Date: Tue, 4 Feb 2014 18:54:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261494 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2014 18:54:33 -0000 Author: brueffer Date: Tue Feb 4 18:54:33 2014 New Revision: 261494 URL: http://svnweb.freebsd.org/changeset/base/261494 Log: Actually install acpi_rapidstart.4. MFC after: 1 week Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Tue Feb 4 18:28:58 2014 (r261493) +++ head/share/man/man4/Makefile Tue Feb 4 18:54:33 2014 (r261494) @@ -13,6 +13,7 @@ MAN= aac.4 \ ${_acpi_hp.4} \ ${_acpi_ibm.4} \ ${_acpi_panasonic.4} \ + ${_acpi_rapidstart.4} \ ${_acpi_sony.4} \ acpi_thermal.4 \ ${_acpi_toshiba.4} \ @@ -740,6 +741,7 @@ _acpi_fujitsu.4=acpi_fujitsu.4 _acpi_hp.4= acpi_hp.4 _acpi_ibm.4= acpi_ibm.4 _acpi_panasonic.4=acpi_panasonic.4 +_acpi_rapidstart.4=acpi_rapidstart.4 _acpi_sony.4= acpi_sony.4 _acpi_toshiba.4=acpi_toshiba.4 _acpi_wmi.4= acpi_wmi.4 From owner-svn-src-head@FreeBSD.ORG Tue Feb 4 19:01:03 2014 Return-Path: Delivered-To: svn-src-head@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 0A92334A for ; Tue, 4 Feb 2014 19:01:03 +0000 (UTC) Received: from mail-ob0-f171.google.com (mail-ob0-f171.google.com [209.85.214.171]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BBE221DAA for ; Tue, 4 Feb 2014 19:01:02 +0000 (UTC) Received: by mail-ob0-f171.google.com with SMTP id wp4so9991119obc.2 for ; Tue, 04 Feb 2014 11:00:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=+T+RYtGHd4kU1mE0BAEbmHYi4HtWibe9LMAdvjFEh/Y=; b=GQ+8JuKw3QgyhvSl3uhw241/Ed/ip7WeAOaMyBYhROnSeg921XH1Rbe6rBp/rySN/b Sn6015FlxSUfaN9OuKp0FLehWyrnGOvVIDImuppKipq7DYckwIZ8iN4Djsz+uVwm2hJV arUYwDyVOPU3bDqRpJq281F3Tty47m5QZKFJ/rHgPUEfuu7unoEE/TEcgvF1zHBb81F3 ReI7hwhWc179fvupDDAMx+mJDtADWnioG/xS5QT0BKjbjP1/NMoUodZbVIEE3BAt05zD ze6JpcUyIYq6SJ+/vQfBW0JDmVjx4+mI2l9Q64Q4QmNVvB7YmTCFey4CbusLHPP5eWbb 9PPQ== X-Gm-Message-State: ALoCoQkg+ozYJuNvbSlCLAxY17brU8v3fEIR0TZpEPxXL6MNN8UCKakUis8hEm7Bh/wUmj/76Fzh X-Received: by 10.182.149.168 with SMTP id ub8mr2873254obb.74.1391540456227; Tue, 04 Feb 2014 11:00:56 -0800 (PST) Received: from monkey-bot.int.fusionio.com ([209.117.142.2]) by mx.google.com with ESMTPSA id g4sm43151503obe.5.2014.02.04.11.00.55 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 04 Feb 2014 11:00:55 -0800 (PST) Sender: Warner Losh Subject: Re: svn commit: r261424 - head/sys/dev/mmc Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <1391464672.13026.105.camel@revolution.hippie.lan> Date: Tue, 4 Feb 2014 12:00:54 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201402030256.s132uNjk086555@svn.freebsd.org> <20140203170330.GC89104@funkthat.com> <1391458059.13026.96.camel@revolution.hippie.lan> <3325243.MZLnPn2Brt@ralph.baldwin.cx> <1391464672.13026.105.camel@revolution.hippie.lan> To: Ian Lepore X-Mailer: Apple Mail (2.1085) Cc: svn-src-head@FreeBSD.org, John-Mark Gurney , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2014 19:01:03 -0000 On Feb 3, 2014, at 2:57 PM, Ian Lepore wrote: > On Mon, 2014-02-03 at 16:33 -0500, John Baldwin wrote: >> On Monday, February 03, 2014 01:07:39 PM Ian Lepore wrote: >>> On Mon, 2014-02-03 at 09:03 -0800, John-Mark Gurney wrote: >>>> Ian Lepore wrote this message on Mon, Feb 03, 2014 at 02:56 +0000: >>>>> Author: ian >>>>> Date: Mon Feb 3 02:56:23 2014 >>>>> New Revision: 261424 >>>>> URL: http://svnweb.freebsd.org/changeset/base/261424 >>>>>=20 >>>>> Log: >>>>> Sort the list. >>>>>=20 >>>>> Modified: >>>>> head/sys/dev/mmc/mmc.c >>>>>=20 >>>>> Modified: head/sys/dev/mmc/mmc.c >>>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>>>> =3D=3D=3D=3D=3D=3D --- head/sys/dev/mmc/mmc.c Mon Feb 3 = 02:52:07 2014 (r261423) >>>>> +++ head/sys/dev/mmc/mmc.c Mon Feb 3 02:56:23 2014 = (r261424) >>>>> @@ -1756,10 +1756,11 @@ static driver_t mmc_driver =3D { >>>>>=20 >>>>> }; >>>>> static devclass_t mmc_devclass; >>>>>=20 >>>>> -DRIVER_MODULE(mmc, ti_mmchs, mmc_driver, mmc_devclass, NULL, = NULL); >>>>>=20 >>>>> DRIVER_MODULE(mmc, at91_mci, mmc_driver, mmc_devclass, NULL, = NULL); >>>>>=20 >>>>> -DRIVER_MODULE(mmc, sdhci_pci, mmc_driver, mmc_devclass, NULL, = NULL); >>>>>=20 >>>>> DRIVER_MODULE(mmc, sdhci_bcm, mmc_driver, mmc_devclass, NULL, = NULL); >>>>> DRIVER_MODULE(mmc, sdhci_fdt, mmc_driver, mmc_devclass, NULL, = NULL); >>>>>=20 >>>>> -DRIVER_MODULE(mmc, sdhci_ti, mmc_driver, mmc_devclass, NULL, = NULL); >>>>>=20 >>>>> DRIVER_MODULE(mmc, sdhci_imx, mmc_driver, mmc_devclass, NULL, = NULL); >>>>>=20 >>>>> +DRIVER_MODULE(mmc, sdhci_pci, mmc_driver, mmc_devclass, NULL, = NULL); >>>>> +DRIVER_MODULE(mmc, sdhci_ti, mmc_driver, mmc_devclass, NULL, = NULL); >>>>> +DRIVER_MODULE(mmc, ti_mmchs, mmc_driver, mmc_devclass, NULL, = NULL); >>>>> + >>>>=20 >>>> Is there a reason we don't make mmc_driver/mmc_devclass global and = put >>>> all of these defines in their respective file instead of poluting = an MI >>>> file w/ MD info? >>>=20 >>> I don't think that's an option. Part of what that macro does is = create >>> metadata that says "this module contains a driver that is a child of = bus >>> " and I think for that to work right, it has to be in the >>> module itself, not elsewhere (at least in the .ko case; maybe it = doesn't >>> matter when it's compiled into the kernel). >>=20 >> No, it can be anywhere. It's not voodoo magic, it's just a struct = and a >> SYSINIT. John-Mark's suggestion is correct (and I thought the same = thing >> when I saw this commit). You just have to make mmc_driver global. = You >> should make mmc_devclass as well for now. >>=20 >> (Side note: the devclass argument to DRIVER_MODULE() is useless in = 99.9% >> of the cases and should be axed entirely. The very few drivers that = want >> to find their devclass can use devclass_find() at runtime instead.) >>=20 >> Too bad cpp doesn't support macro overloading, then we could make = that >> change seamlessly. :) >>=20 >=20 > Interesting, I had no idea. Do we have examples of doing it this = other > way in the tree now?=20 I was actually thinking we could have all the respective drivers derive = from a mmc_base class, so we'd need only one, which is even simpler... Otherwise, look at how PCI accomplishes this. You just declare it = globally, then have each of the MD files reference it. Not sure I like = that, but it is fast to implement and nicer than what we have today. And = I'm already recursed 5 levels away from my primary goal in 'Yak Shaving' = at the moment, or I'd do it... Warner= From owner-svn-src-head@FreeBSD.ORG Tue Feb 4 19:07:33 2014 Return-Path: Delivered-To: svn-src-head@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 5CF3D60D for ; Tue, 4 Feb 2014 19:07:33 +0000 (UTC) Received: from mail-oa0-f44.google.com (mail-oa0-f44.google.com [209.85.219.44]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 18F531E0A for ; Tue, 4 Feb 2014 19:07:32 +0000 (UTC) Received: by mail-oa0-f44.google.com with SMTP id g12so10340850oah.17 for ; Tue, 04 Feb 2014 11:07:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=+Iscl21p8X6XtvwClJQzwJAlVqajeW1vn0iMbDwvr5M=; b=mezYxmS4cP4QOmeaKoyvwpXyUgJSlZz7Bdn5e0IWhHgo43Hy09Zg9HP2dOfGVRDY0e nT+2glL+0//Djd5kmU+PDwuWsDlycj2GTauPJHF52j9MCOslnLDKK+5FdgajeH5LHtRG XK1t/5QUUT4zfwZU1AiCEQeqHafSZ6q5IEjgxkjXCsV+OoUwS73OuiCwjWEcr7fEHLj7 UI+EsYYD3h5iXYqgn41BwJyypCd+2iC9n2aw1I9s9eqonCAe2XSEd9RYWOYteSUc7h+0 3pnJ1c0aWfYpcMRUIGbimzjC6oo/bWW1u5pj5qO43X19eCAKyc43gdxxexDnwUJ+zXZt mphQ== X-Gm-Message-State: ALoCoQmEykRTqO9USdECpCGSSr3NAbo8KkkGruCsLKvE6HNC/JQj9weOqEyMPtFAcVL0EK7MKug+ X-Received: by 10.60.80.101 with SMTP id q5mr9130857oex.44.1391540851787; Tue, 04 Feb 2014 11:07:31 -0800 (PST) Received: from monkey-bot.int.fusionio.com ([209.117.142.2]) by mx.google.com with ESMTPSA id qe2sm43208991obc.1.2014.02.04.11.07.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 04 Feb 2014 11:07:31 -0800 (PST) Sender: Warner Losh Subject: Re: svn commit: r261283 - in head: contrib/libc++ contrib/libc++/include contrib/libc++/include/experimental contrib/libc++/include/ext contrib/libc++/src etc/mtree lib/libc++ sys/sys tools/build/mk Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <8A874F96-67A8-41B9-AC99-22D2ED3A5A1C@FreeBSD.org> Date: Tue, 4 Feb 2014 12:07:29 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201401300744.s0U7iNLt016044@svn.freebsd.org> <20140203123235.GA1540@mole.fafoe.narf.at> <20140203133254.243db1cd@kan.dyndns.org> <73ED697C-09CC-49D6-8EBD-0F0E20232729@FreeBSD.org> <20140203170031.2166661c@kan.dyndns.org> <8A874F96-67A8-41B9-AC99-22D2ED3A5A1C@FreeBSD.org> To: David Chisnall X-Mailer: Apple Mail (2.1085) Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, Dimitry Andric , Stefan Farfeleder , svn-src-head@FreeBSD.org, Alexander Kabaev X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2014 19:07:33 -0000 On Feb 4, 2014, at 1:41 AM, David Chisnall wrote: > It sounds like you're just looking at the output from nm, without = bothering to check how the symbols are used. =20 With all due respect, if it is in nm output, it is part of the ABI, = intended or not. Years ago, before symbol versioning, we had all kinds = of issues like this where something 'accidentally' referenced something = in the ABI and broke when that was tightened up (accidentally or on = purpose). Sometimes it didn't matter, other times it did. In the Bad Old = Days, we just mostly ignored this unless it mattered too much... I'd = rather not see a return to the Bad Old Days... which is unfortunate. = Doing ABI stable releases with C++ is much much harder than plain old = C... Warner From owner-svn-src-head@FreeBSD.ORG Tue Feb 4 20:52:34 2014 Return-Path: Delivered-To: svn-src-head@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 85B51755; Tue, 4 Feb 2014 20:52:34 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6FB6619A0; Tue, 4 Feb 2014 20:52:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s14KqY0A053348; Tue, 4 Feb 2014 20:52:34 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s14KqYXT053347; Tue, 4 Feb 2014 20:52:34 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201402042052.s14KqYXT053347@svn.freebsd.org> From: Ed Schouten Date: Tue, 4 Feb 2014 20:52:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261495 - head/sys/dev/watchdog X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2014 20:52:34 -0000 Author: ed Date: Tue Feb 4 20:52:33 2014 New Revision: 261495 URL: http://svnweb.freebsd.org/changeset/base/261495 Log: Use right buffer to print to. PR: kern/176597 Submitted by: Christoph Mallon MFC after: 2 weeks Modified: head/sys/dev/watchdog/watchdog.c Modified: head/sys/dev/watchdog/watchdog.c ============================================================================== --- head/sys/dev/watchdog/watchdog.c Tue Feb 4 18:54:33 2014 (r261494) +++ head/sys/dev/watchdog/watchdog.c Tue Feb 4 20:52:33 2014 (r261495) @@ -226,7 +226,7 @@ wd_timeout_cb(void *arg) #ifdef DDB if ((wd_pretimeout_act & WD_SOFT_DDB)) { char kdb_why[80]; - snprintf(kdb_why, sizeof(buf), "watchdog %s timeout", type); + snprintf(kdb_why, sizeof(kdb_why), "watchdog %s timeout", type); kdb_backtrace(); kdb_enter(KDB_WHY_WATCHDOG, kdb_why); } From owner-svn-src-head@FreeBSD.ORG Tue Feb 4 21:15:15 2014 Return-Path: Delivered-To: svn-src-head@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 BF806E9C; Tue, 4 Feb 2014 21:15:15 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A93561BD7; Tue, 4 Feb 2014 21:15:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s14LFFgV062029; Tue, 4 Feb 2014 21:15:15 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s14LFFrJ062028; Tue, 4 Feb 2014 21:15:15 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402042115.s14LFFrJ062028@svn.freebsd.org> From: Christian Brueffer Date: Tue, 4 Feb 2014 21:15:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261496 - head/sbin/mount_udf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2014 21:15:15 -0000 Author: brueffer Date: Tue Feb 4 21:15:15 2014 New Revision: 261496 URL: http://svnweb.freebsd.org/changeset/base/261496 Log: Unbreak mount_udf by passing the correct iovec length into nmount(). This has been broken since r247856. PR: bin/186193 Submitted by: Arnot Belohlavek MFC after: 1 week Modified: head/sbin/mount_udf/mount_udf.c Modified: head/sbin/mount_udf/mount_udf.c ============================================================================== --- head/sbin/mount_udf/mount_udf.c Tue Feb 4 20:52:33 2014 (r261495) +++ head/sbin/mount_udf/mount_udf.c Tue Feb 4 21:15:15 2014 (r261496) @@ -77,9 +77,9 @@ main(int argc, char **argv) char fstype[] = "udf"; struct iovec *iov; char *cs_disk, *cs_local, *dev, *dir; - int ch, i, iovlen, mntflags, udf_flags, verbose; + int ch, iovlen, mntflags, udf_flags, verbose; - i = iovlen = mntflags = udf_flags = verbose = 0; + iovlen = mntflags = udf_flags = verbose = 0; cs_disk = cs_local = NULL; iov = NULL; while ((ch = getopt(argc, argv, "o:vC:")) != -1) @@ -129,7 +129,7 @@ main(int argc, char **argv) build_iovec(&iov, &iovlen, "cs_disk", cs_disk, (size_t)-1); build_iovec(&iov, &iovlen, "cs_local", cs_local, (size_t)-1); } - if (nmount(iov, i, mntflags) < 0) + if (nmount(iov, iovlen, mntflags) < 0) err(1, "%s", dev); exit(0); } From owner-svn-src-head@FreeBSD.ORG Tue Feb 4 21:23:13 2014 Return-Path: Delivered-To: svn-src-head@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 2E3BA468; Tue, 4 Feb 2014 21:23:13 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 178A61CC9; Tue, 4 Feb 2014 21:23:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s14LNCOu065748; Tue, 4 Feb 2014 21:23:12 GMT (envelope-from rmh@svn.freebsd.org) Received: (from rmh@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s14LNCtP065746; Tue, 4 Feb 2014 21:23:12 GMT (envelope-from rmh@svn.freebsd.org) Message-Id: <201402042123.s14LNCtP065746@svn.freebsd.org> From: Robert Millan Date: Tue, 4 Feb 2014 21:23:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261497 - head/sys/dev/drm2/radeon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2014 21:23:13 -0000 Author: rmh Date: Tue Feb 4 21:23:12 2014 New Revision: 261497 URL: http://svnweb.freebsd.org/changeset/base/261497 Log: Abort when firmware isn't present in R600+ models. More details at: http://anonscm.debian.org/viewvc/kernel/dists/trunk/linux/debian/patches/bugfix/all/radeon-firmware-is-required-for-drm-and-kms-on-r600-onward.patch?revision=20909&view=co Reviewed by: dumbbell MFC after: 1 week Modified: head/sys/dev/drm2/radeon/r600.c head/sys/dev/drm2/radeon/rv770.c Modified: head/sys/dev/drm2/radeon/r600.c ============================================================================== --- head/sys/dev/drm2/radeon/r600.c Tue Feb 4 21:15:15 2014 (r261496) +++ head/sys/dev/drm2/radeon/r600.c Tue Feb 4 21:23:12 2014 (r261497) @@ -3012,6 +3012,12 @@ int r600_init(struct radeon_device *rdev rdev->accel_working = false; } + /* Don't start up if the ucode is missing. */ + if (!rdev->me_fw || !rdev->pfp_fw || !rdev->rlc_fw) { + DRM_ERROR("radeon: ucode required for R600+.\n"); + return -EINVAL; + } + return 0; } Modified: head/sys/dev/drm2/radeon/rv770.c ============================================================================== --- head/sys/dev/drm2/radeon/rv770.c Tue Feb 4 21:15:15 2014 (r261496) +++ head/sys/dev/drm2/radeon/rv770.c Tue Feb 4 21:23:12 2014 (r261497) @@ -1186,6 +1186,12 @@ int rv770_init(struct radeon_device *rde rdev->accel_working = false; } + /* Don't start up if the ucode is missing. */ + if (!rdev->me_fw || !rdev->pfp_fw || !rdev->rlc_fw) { + DRM_ERROR("radeon: ucode required for R600+.\n"); + return -EINVAL; + } + return 0; } From owner-svn-src-head@FreeBSD.ORG Tue Feb 4 21:43:54 2014 Return-Path: Delivered-To: svn-src-head@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 7B022C29; Tue, 4 Feb 2014 21:43:54 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4BAB31FD4; Tue, 4 Feb 2014 21:43:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s14LhsBm073368; Tue, 4 Feb 2014 21:43:54 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s14Lhr4x073366; Tue, 4 Feb 2014 21:43:53 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201402042143.s14Lhr4x073366@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 4 Feb 2014 21:43:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261498 - head/sbin/ping X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2014 21:43:54 -0000 Author: pjd Date: Tue Feb 4 21:43:53 2014 New Revision: 261498 URL: http://svnweb.freebsd.org/changeset/base/261498 Log: Protect ping(8) using Capsicum and Casper. This is protection against malicious network packets that we parse and not against local users trying to gain root access through ping's set-uid bit - this is handled by dropping privileges very early in ping. Submitted by: Mikhail Modified: head/sbin/ping/Makefile head/sbin/ping/ping.c Modified: head/sbin/ping/Makefile ============================================================================== --- head/sbin/ping/Makefile Tue Feb 4 21:23:12 2014 (r261497) +++ head/sbin/ping/Makefile Tue Feb 4 21:43:53 2014 (r261498) @@ -1,6 +1,8 @@ # @(#)Makefile 8.1 (Berkeley) 6/5/93 # $FreeBSD$ +.include + PROG= ping MAN= ping.8 BINOWN= root @@ -9,6 +11,12 @@ WARNS?= 2 DPADD= ${LIBM} LDADD= -lm +.if ${MK_CASPER} != "no" && !defined(RESCUE) +DPADD+= ${LIBCAPSICUM} +LDADD+= -lcapsicum +CFLAGS+=-DHAVE_LIBCAPSICUM +.endif + .if !defined(RELEASE_CRUNCH) CFLAGS+=-DIPSEC DPADD+= ${LIBIPSEC} Modified: head/sbin/ping/ping.c ============================================================================== --- head/sbin/ping/ping.c Tue Feb 4 21:23:12 2014 (r261497) +++ head/sbin/ping/ping.c Tue Feb 4 21:43:53 2014 (r261498) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); */ #include /* NB: we rely on this for */ +#include #include #include #include @@ -74,6 +75,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef HAVE_LIBCAPSICUM +#include +#include +#include +#endif #ifdef IPSEC #include @@ -157,7 +163,8 @@ char rcvd_tbl[MAX_DUP_CHK / 8]; struct sockaddr_in whereto; /* who to ping */ int datalen = DEFDATALEN; int maxpayload; -int s; /* socket file descriptor */ +int ssend; /* send socket file descriptor */ +int srecv; /* receive socket file descriptor */ u_char outpackhdr[IP_MAXPACKET], *outpack; char BBELL = '\a'; /* characters written for MISSED and AUDIBLE */ char BSPACE = '\b'; /* characters written for flood */ @@ -197,8 +204,15 @@ double tsumsq = 0.0; /* sum of all time volatile sig_atomic_t finish_up; /* nonzero if we've been told to finish up */ volatile sig_atomic_t siginfo_p; +#ifdef HAVE_LIBCAPSICUM +static cap_channel_t *capdns; +#endif + static void fill(char *, char *); static u_short in_cksum(u_short *, int); +#ifdef HAVE_LIBCAPSICUM +static cap_channel_t *capdns_setup(void); +#endif static void check_status(void); static void finish(void) __dead2; static void pinger(void); @@ -233,8 +247,8 @@ main(int argc, char *const *argv) struct sockaddr_in *to; double t; u_long alarmtimeout, ultmp; - int almost_done, ch, df, hold, i, icmp_len, mib[4], preload, sockerrno, - tos, ttl; + int almost_done, ch, df, hold, i, icmp_len, mib[4], preload; + int ssend_errno, srecv_errno, tos, ttl; char ctrl[CMSG_SPACE(sizeof(struct timeval))]; char hnamebuf[MAXHOSTNAMELEN], snamebuf[MAXHOSTNAMELEN]; #ifdef IP_OPTIONS @@ -246,14 +260,26 @@ main(int argc, char *const *argv) #ifdef IPSEC_POLICY_IPSEC policy_in = policy_out = NULL; #endif + cap_rights_t rights; + bool cansandbox; /* * Do the stuff that we need root priv's for *first*, and * then drop our setuid bit. Save error reporting for * after arg parsing. + * + * Historicaly ping was using one socket 's' for sending and for + * receiving. After capsicum(4) related changes we use two + * sockets. It was done for special ping use case - when user + * issue ping on multicast or broadcast address replies come + * from different addresses, not from the address we + * connect(2)'ed to, and send socket do not receive those + * packets. */ - s = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP); - sockerrno = errno; + ssend = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP); + ssend_errno = errno; + srecv = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP); + srecv_errno = errno; if (setuid(getuid()) != 0) err(EX_NOPERM, "setuid() failed"); @@ -527,13 +553,22 @@ main(int argc, char *const *argv) if (options & F_PINGFILLED) { fill((char *)datap, payload); } +#ifdef HAVE_LIBCAPSICUM + capdns = capdns_setup(); +#endif if (source) { bzero((char *)&sock_in, sizeof(sock_in)); sock_in.sin_family = AF_INET; if (inet_aton(source, &sock_in.sin_addr) != 0) { shostname = source; } else { - hp = gethostbyname2(source, AF_INET); +#ifdef HAVE_LIBCAPSICUM + if (capdns != NULL) + hp = cap_gethostbyname2(capdns, source, + AF_INET); + else +#endif + hp = gethostbyname2(source, AF_INET); if (!hp) errx(EX_NOHOST, "cannot resolve %s: %s", source, hstrerror(h_errno)); @@ -549,7 +584,8 @@ main(int argc, char *const *argv) snamebuf[sizeof(snamebuf) - 1] = '\0'; shostname = snamebuf; } - if (bind(s, (struct sockaddr *)&sock_in, sizeof sock_in) == -1) + if (bind(ssend, (struct sockaddr *)&sock_in, sizeof sock_in) == + -1) err(1, "bind"); } @@ -560,7 +596,12 @@ main(int argc, char *const *argv) if (inet_aton(target, &to->sin_addr) != 0) { hostname = target; } else { - hp = gethostbyname2(target, AF_INET); +#ifdef HAVE_LIBCAPSICUM + if (capdns != NULL) + hp = cap_gethostbyname2(capdns, target, AF_INET); + else +#endif + hp = gethostbyname2(target, AF_INET); if (!hp) errx(EX_NOHOST, "cannot resolve %s: %s", target, hstrerror(h_errno)); @@ -573,6 +614,30 @@ main(int argc, char *const *argv) hostname = hnamebuf; } +#ifdef HAVE_LIBCAPSICUM + /* From now on we will use only reverse DNS lookups. */ + if (capdns != NULL) { + const char *types[1]; + + types[0] = "ADDR"; + if (cap_dns_type_limit(capdns, types, 1) < 0) + err(1, "unable to limit access to system.dns service"); + } +#endif + + if (ssend < 0) { + errno = ssend_errno; + err(EX_OSERR, "ssend socket"); + } + + if (srecv < 0) { + errno = srecv_errno; + err(EX_OSERR, "srecv socket"); + } + + if (connect(ssend, (struct sockaddr *)&whereto, sizeof(whereto)) != 0) + err(1, "connect"); + if (options & F_FLOOD && options & F_INTERVAL) errx(EX_USAGE, "-f and -i: incompatible options"); @@ -593,16 +658,15 @@ main(int argc, char *const *argv) ident = getpid() & 0xFFFF; - if (s < 0) { - errno = sockerrno; - err(EX_OSERR, "socket"); - } hold = 1; - if (options & F_SO_DEBUG) - (void)setsockopt(s, SOL_SOCKET, SO_DEBUG, (char *)&hold, + if (options & F_SO_DEBUG) { + (void)setsockopt(ssend, SOL_SOCKET, SO_DEBUG, (char *)&hold, sizeof(hold)); + (void)setsockopt(srecv, SOL_SOCKET, SO_DEBUG, (char *)&hold, + sizeof(hold)); + } if (options & F_SO_DONTROUTE) - (void)setsockopt(s, SOL_SOCKET, SO_DONTROUTE, (char *)&hold, + (void)setsockopt(ssend, SOL_SOCKET, SO_DONTROUTE, (char *)&hold, sizeof(hold)); #ifdef IPSEC #ifdef IPSEC_POLICY_IPSEC @@ -612,7 +676,7 @@ main(int argc, char *const *argv) buf = ipsec_set_policy(policy_in, strlen(policy_in)); if (buf == NULL) errx(EX_CONFIG, "%s", ipsec_strerror()); - if (setsockopt(s, IPPROTO_IP, IP_IPSEC_POLICY, + if (setsockopt(srecv, IPPROTO_IP, IP_IPSEC_POLICY, buf, ipsec_get_policylen(buf)) < 0) err(EX_CONFIG, "ipsec policy cannot be configured"); @@ -623,7 +687,7 @@ main(int argc, char *const *argv) buf = ipsec_set_policy(policy_out, strlen(policy_out)); if (buf == NULL) errx(EX_CONFIG, "%s", ipsec_strerror()); - if (setsockopt(s, IPPROTO_IP, IP_IPSEC_POLICY, + if (setsockopt(ssend, IPPROTO_IP, IP_IPSEC_POLICY, buf, ipsec_get_policylen(buf)) < 0) err(EX_CONFIG, "ipsec policy cannot be configured"); @@ -644,7 +708,7 @@ main(int argc, char *const *argv) if (sysctl(mib, 4, &ttl, &sz, NULL, 0) == -1) err(1, "sysctl(net.inet.ip.ttl)"); } - setsockopt(s, IPPROTO_IP, IP_HDRINCL, &hold, sizeof(hold)); + setsockopt(ssend, IPPROTO_IP, IP_HDRINCL, &hold, sizeof(hold)); ip->ip_v = IPVERSION; ip->ip_hl = sizeof(struct ip) >> 2; ip->ip_tos = tos; @@ -655,6 +719,35 @@ main(int argc, char *const *argv) ip->ip_src.s_addr = source ? sock_in.sin_addr.s_addr : INADDR_ANY; ip->ip_dst = to->sin_addr; } + + if (options & F_NUMERIC) + cansandbox = true; +#ifdef HAVE_LIBCAPSICUM + else if (capdns != NULL) + cansandbox = true; +#endif + else + cansandbox = false; + + /* + * Here we enter capability mode. Further down access to global + * namespaces (e.g filesystem) is restricted (see capsicum(4)). + * We must connect(2) our socket before this point. + */ + if (cansandbox && cap_enter() < 0 && errno != ENOSYS) + err(1, "cap_enter"); + + if (cap_sandboxed()) + fprintf(stderr, "capability mode sandbox enabled\n"); + + cap_rights_init(&rights, CAP_RECV, CAP_EVENT, CAP_SETSOCKOPT); + if (cap_rights_limit(srecv, &rights) < 0 && errno != ENOSYS) + err(1, "cap_rights_limit srecv"); + + cap_rights_init(&rights, CAP_SEND, CAP_SETSOCKOPT); + if (cap_rights_limit(ssend, &rights) < 0 && errno != ENOSYS) + err(1, "cap_rights_limit ssend"); + /* record route option */ if (options & F_RROUTE) { #ifdef IP_OPTIONS @@ -663,7 +756,7 @@ main(int argc, char *const *argv) rspace[IPOPT_OLEN] = sizeof(rspace) - 1; rspace[IPOPT_OFFSET] = IPOPT_MINOFF; rspace[sizeof(rspace) - 1] = IPOPT_EOL; - if (setsockopt(s, IPPROTO_IP, IP_OPTIONS, rspace, + if (setsockopt(ssend, IPPROTO_IP, IP_OPTIONS, rspace, sizeof(rspace)) < 0) err(EX_OSERR, "setsockopt IP_OPTIONS"); #else @@ -673,32 +766,32 @@ main(int argc, char *const *argv) } if (options & F_TTL) { - if (setsockopt(s, IPPROTO_IP, IP_TTL, &ttl, + if (setsockopt(ssend, IPPROTO_IP, IP_TTL, &ttl, sizeof(ttl)) < 0) { err(EX_OSERR, "setsockopt IP_TTL"); } } if (options & F_NOLOOP) { - if (setsockopt(s, IPPROTO_IP, IP_MULTICAST_LOOP, &loop, + if (setsockopt(ssend, IPPROTO_IP, IP_MULTICAST_LOOP, &loop, sizeof(loop)) < 0) { err(EX_OSERR, "setsockopt IP_MULTICAST_LOOP"); } } if (options & F_MTTL) { - if (setsockopt(s, IPPROTO_IP, IP_MULTICAST_TTL, &mttl, + if (setsockopt(ssend, IPPROTO_IP, IP_MULTICAST_TTL, &mttl, sizeof(mttl)) < 0) { err(EX_OSERR, "setsockopt IP_MULTICAST_TTL"); } } if (options & F_MIF) { - if (setsockopt(s, IPPROTO_IP, IP_MULTICAST_IF, &ifaddr, + if (setsockopt(ssend, IPPROTO_IP, IP_MULTICAST_IF, &ifaddr, sizeof(ifaddr)) < 0) { err(EX_OSERR, "setsockopt IP_MULTICAST_IF"); } } #ifdef SO_TIMESTAMP { int on = 1; - if (setsockopt(s, SOL_SOCKET, SO_TIMESTAMP, &on, sizeof(on)) < 0) + if (setsockopt(srecv, SOL_SOCKET, SO_TIMESTAMP, &on, sizeof(on)) < 0) err(EX_OSERR, "setsockopt SO_TIMESTAMP"); } #endif @@ -733,11 +826,19 @@ main(int argc, char *const *argv) * as well. */ hold = IP_MAXPACKET + 128; - (void)setsockopt(s, SOL_SOCKET, SO_RCVBUF, (char *)&hold, + (void)setsockopt(srecv, SOL_SOCKET, SO_RCVBUF, (char *)&hold, sizeof(hold)); + /* CAP_SETSOCKOPT removed */ + cap_rights_init(&rights, CAP_RECV, CAP_EVENT); + if (cap_rights_limit(srecv, &rights) < 0 && errno != ENOSYS) + err(1, "cap_rights_limit srecv setsockopt"); if (uid == 0) - (void)setsockopt(s, SOL_SOCKET, SO_SNDBUF, (char *)&hold, + (void)setsockopt(ssend, SOL_SOCKET, SO_SNDBUF, (char *)&hold, sizeof(hold)); + /* CAP_SETSOCKOPT removed */ + cap_rights_init(&rights, CAP_SEND); + if (cap_rights_limit(ssend, &rights) < 0 && errno != ENOSYS) + err(1, "cap_rights_limit ssend setsockopt"); if (to->sin_family == AF_INET) { (void)printf("PING %s (%s)", hostname, @@ -817,10 +918,10 @@ main(int argc, char *const *argv) int cc, n; check_status(); - if ((unsigned)s >= FD_SETSIZE) + if ((unsigned)srecv >= FD_SETSIZE) errx(EX_OSERR, "descriptor too large"); FD_ZERO(&rfds); - FD_SET(s, &rfds); + FD_SET(srecv, &rfds); (void)gettimeofday(&now, NULL); timeout.tv_sec = last.tv_sec + intvl.tv_sec - now.tv_sec; timeout.tv_usec = last.tv_usec + intvl.tv_usec - now.tv_usec; @@ -834,7 +935,7 @@ main(int argc, char *const *argv) } if (timeout.tv_sec < 0) timerclear(&timeout); - n = select(s + 1, &rfds, NULL, NULL, &timeout); + n = select(srecv + 1, &rfds, NULL, NULL, &timeout); if (n < 0) continue; /* Must be EINTR. */ if (n == 1) { @@ -845,7 +946,7 @@ main(int argc, char *const *argv) msg.msg_controllen = sizeof(ctrl); #endif msg.msg_namelen = sizeof(from); - if ((cc = recvmsg(s, &msg, 0)) < 0) { + if ((cc = recvmsg(srecv, &msg, 0)) < 0) { if (errno == EINTR) continue; warn("recvmsg"); @@ -981,9 +1082,7 @@ pinger(void) ip->ip_sum = in_cksum((u_short *)outpackhdr, cc); packet = outpackhdr; } - i = sendto(s, (char *)packet, cc, 0, (struct sockaddr *)&whereto, - sizeof(whereto)); - + i = send(ssend, (char *)packet, cc, 0); if (i < 0 || i != cc) { if (i < 0) { if (options & F_FLOOD && errno == ENOBUFS) { @@ -1604,12 +1703,21 @@ pr_addr(struct in_addr ina) struct hostent *hp; static char buf[16 + 3 + MAXHOSTNAMELEN]; - if ((options & F_NUMERIC) || - !(hp = gethostbyaddr((char *)&ina, 4, AF_INET))) + if (options & F_NUMERIC) return inet_ntoa(ina); + +#ifdef HAVE_LIBCAPSICUM + if (capdns != NULL) + hp = cap_gethostbyaddr(capdns, (char *)&ina, 4, AF_INET); else - (void)snprintf(buf, sizeof(buf), "%s (%s)", hp->h_name, - inet_ntoa(ina)); +#endif + hp = gethostbyaddr((char *)&ina, 4, AF_INET); + + if (hp == NULL) + return inet_ntoa(ina); + + (void)snprintf(buf, sizeof(buf), "%s (%s)", hp->h_name, + inet_ntoa(ina)); return(buf); } @@ -1682,6 +1790,36 @@ fill(char *bp, char *patp) } } +#ifdef HAVE_LIBCAPSICUM +static cap_channel_t * +capdns_setup(void) +{ + cap_channel_t *capcas, *capdnsloc; + const char *types[2]; + int families[1]; + + capcas = cap_init(); + if (capcas == NULL) { + warn("unable to contact casperd"); + return (NULL); + } + capdnsloc = cap_service_open(capcas, "system.dns"); + /* Casper capability no longer needed. */ + cap_close(capcas); + if (capdnsloc == NULL) + err(1, "unable to open system.dns service"); + types[0] = "NAME"; + types[1] = "ADDR"; + if (cap_dns_type_limit(capdnsloc, types, 2) < 0) + err(1, "unable to limit access to system.dns service"); + families[0] = AF_INET; + if (cap_dns_family_limit(capdnsloc, families, 1) < 0) + err(1, "unable to limit access to system.dns service"); + + return (capdnsloc); +} +#endif /* HAVE_LIBCAPSICUM */ + #if defined(IPSEC) && defined(IPSEC_POLICY_IPSEC) #define SECOPT " [-P policy]" #else From owner-svn-src-head@FreeBSD.ORG Tue Feb 4 21:45:52 2014 Return-Path: Delivered-To: svn-src-head@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 81C75F30; Tue, 4 Feb 2014 21:45:52 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 556591FF2; Tue, 4 Feb 2014 21:45:52 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id C809CB95D; Tue, 4 Feb 2014 16:45:50 -0500 (EST) From: John Baldwin To: Gavin Atkinson Subject: Re: svn commit: r261216 - head/sys/dev/pccbb Date: Tue, 4 Feb 2014 14:24:53 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201401271949.s0RJnr7t067977@svn.freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201402041424.54122.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 04 Feb 2014 16:45:50 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, imp@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2014 21:45:52 -0000 On Sunday, February 02, 2014 5:34:58 pm Gavin Atkinson wrote: > On Mon, 27 Jan 2014, John Baldwin wrote: > > Author: jhb > > Date: Mon Jan 27 19:49:52 2014 > > New Revision: 261216 > > URL: http://svnweb.freebsd.org/changeset/base/261216 > > > > Log: > > Explicitly enable I/O and memory decoding in the bridge's command register > > when activating an I/O or memory window on the CardBus bridge. > > This fixes some, but not all of my machines. One in particular, a Toshiba > M5 laptop, remains broken by r254263 even with this change. Specificaly, > the laptop does not notice when a card is inserted. > > The attached minimal patch gets things working again, though I don't know > if is the correct fix or if a more involved fix is required. > > dmesg before and after that patch: > > http://people.freebsd.org/~gavin/m5-dmesg-before.txt > http://people.freebsd.org/~gavin/m5-dmesg-after.txt > > The only difference is the cbb register dump, the one bit that I am > setting in the patch. Your patch effectively reverts r254263. It may be the correct thing to do, but the question is why. :) Can you provide 'pciconf -lbc' output for this device? (You can just do 'pciconf -lbc pccbb0' in HEAD now) -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Feb 4 21:48:09 2014 Return-Path: Delivered-To: svn-src-head@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 BEFB0114; Tue, 4 Feb 2014 21:48:09 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A7CC71021; Tue, 4 Feb 2014 21:48:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s14Lm9pe073936; Tue, 4 Feb 2014 21:48:09 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s14Lm9XD073935; Tue, 4 Feb 2014 21:48:09 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201402042148.s14Lm9XD073935@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 4 Feb 2014 21:48:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261499 - head/crypto/openssh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2014 21:48:09 -0000 Author: pjd Date: Tue Feb 4 21:48:09 2014 New Revision: 261499 URL: http://svnweb.freebsd.org/changeset/base/261499 Log: Fix installations that use kernels without CAPABILITIES support. Approved by: des Modified: head/crypto/openssh/sandbox-capsicum.c Modified: head/crypto/openssh/sandbox-capsicum.c ============================================================================== --- head/crypto/openssh/sandbox-capsicum.c Tue Feb 4 21:43:53 2014 (r261498) +++ head/crypto/openssh/sandbox-capsicum.c Tue Feb 4 21:48:09 2014 (r261499) @@ -94,10 +94,12 @@ ssh_sandbox_child(struct ssh_sandbox *bo fatal("can't limit stderr: %m"); cap_rights_init(&rights, CAP_READ, CAP_WRITE); - if (cap_rights_limit(box->monitor->m_recvfd, &rights) == -1) + if (cap_rights_limit(box->monitor->m_recvfd, &rights) == -1 && + errno != ENOSYS) fatal("%s: failed to limit the network socket", __func__); cap_rights_init(&rights, CAP_WRITE); - if (cap_rights_limit(box->monitor->m_log_sendfd, &rights) == -1) + if (cap_rights_limit(box->monitor->m_log_sendfd, &rights) == -1 && + errno != ENOSYS) fatal("%s: failed to limit the logging socket", __func__); if (cap_enter() < 0 && errno != ENOSYS) fatal("%s: failed to enter capability mode", __func__); From owner-svn-src-head@FreeBSD.ORG Tue Feb 4 22:20:17 2014 Return-Path: Delivered-To: svn-src-head@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 B996629E; Tue, 4 Feb 2014 22:20: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A478B1336; Tue, 4 Feb 2014 22:20:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s14MKHKH086965; Tue, 4 Feb 2014 22:20:17 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s14MKH7l086964; Tue, 4 Feb 2014 22:20:17 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402042220.s14MKH7l086964@svn.freebsd.org> From: Christian Brueffer Date: Tue, 4 Feb 2014 22:20:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261500 - head/sbin/etherswitchcfg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2014 22:20:17 -0000 Author: brueffer Date: Tue Feb 4 22:20:17 2014 New Revision: 261500 URL: http://svnweb.freebsd.org/changeset/base/261500 Log: Add a license (1) and do some cleanup. Approved by: Stefan Bethke (original author, by private mail) (1) MFC after: 1 week Modified: head/sbin/etherswitchcfg/etherswitchcfg.8 Modified: head/sbin/etherswitchcfg/etherswitchcfg.8 ============================================================================== --- head/sbin/etherswitchcfg/etherswitchcfg.8 Tue Feb 4 21:48:09 2014 (r261499) +++ head/sbin/etherswitchcfg/etherswitchcfg.8 Tue Feb 4 22:20:17 2014 (r261500) @@ -1,4 +1,29 @@ +.\" Copyright (c) 2011-2012 Stefan Bethke. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" .\" $FreeBSD$ +.\" .Dd September 20, 2013 .Dt ETHERSWITCHCFG 8 .Os @@ -35,13 +60,14 @@ The utility is used to configure an Ethernet switch built into the system. .Nm accepts a number of options: +.Pp .Bl -tag -width ".Fl f" -compact .It Fl "f control file" Specifies the .Xr etherswitch 4 control file that represents the switch to be configured. It defaults to -.Li /dev/etherswitch0 . +.Pa /dev/etherswitch0 . .It Fl m When reporting port information, also list available media options for that port. @@ -54,6 +80,7 @@ options are omitted. The config command provides access to global switch configuration parameters. It support the following commands: +.Pp .Bl -tag -width ".Ar vlan_mode mode" -compact .It Ar vlan_mode mode Sets the switch VLAN mode (depends on the hardware). @@ -74,6 +101,7 @@ To set the register value, use the form .Ss port The port command selects one of the ports of the switch. It supports the following commands: +.Pp .Bl -tag -width ".Ar pvid number" -compact .It Ar pvid number Sets the default port VID that is used to process incoming frames that are not tagged. @@ -88,8 +116,10 @@ for details on and .Ar mediaopt . .El +.Pp And the following flags (please note that not all flags -are supporterd by all switch drivers): +are supported by all switch drivers): +.Pp .Bl -tag -width ".Ar addtag" -compact .It Ar addtag Add VLAN tag to each packet sent by the port. @@ -100,7 +130,7 @@ Strip the VLAN tags from the packets sen .It Ar -striptag Disable the strip VLAN tag option. .It Ar firstlock -This options makes the switch port lock on the first MAC address it seems. +This options makes the switch port lock on the first MAC address it sees. After that, usually you need to reset the switch to learn different MAC addresses. .It Ar -firstlock @@ -125,6 +155,7 @@ The reg command provides access to the r .Ss vlangroup The vlangroup command selects one of the VLAN groups for configuration. It supports the following commands: +.Pp .Bl -tag -width ".Ar vlangroup" -compact .It Ar vlan VID Sets the VLAN ID (802.1q VID) for this VLAN group. @@ -142,13 +173,14 @@ to indicate that frames on this port are .Sh FILES .Bl -tag -width /dev/etherswitch? -compact .It Pa /dev/etherswitch? -Control file for the ethernet switch driver. +Control file for the Ethernet switch driver. .El .Sh EXAMPLES Configure VLAN group 1 with a VID of 2 and make ports 0 and 5 its members while excluding all other ports. Port 5 will send and receive tagged frames while port 0 will be untagged. Incoming untagged frames on port 0 are assigned to vlangroup1. +.Pp .Dl # etherswitchcfg vlangroup1 vlan 2 members 0,5t port0 pvid 2 .Sh SEE ALSO .Xr etherswitch 4 From owner-svn-src-head@FreeBSD.ORG Wed Feb 5 00:26:12 2014 Return-Path: Delivered-To: svn-src-head@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 589337E; Wed, 5 Feb 2014 00:26:12 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3ABE81E08; Wed, 5 Feb 2014 00:26:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s150QC7Q037248; Wed, 5 Feb 2014 00:26:12 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s150QC8f037247; Wed, 5 Feb 2014 00:26:12 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201402050026.s150QC8f037247@svn.freebsd.org> From: Warner Losh Date: Wed, 5 Feb 2014 00:26:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261501 - head/usr.sbin/config X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2014 00:26:12 -0000 Author: imp Date: Wed Feb 5 00:26:11 2014 New Revision: 261501 URL: http://svnweb.freebsd.org/changeset/base/261501 Log: Fix ! by not clearing not at the bottom of the loop. Add a blank line Submitted by: bde (blank line) Modified: head/usr.sbin/config/mkmakefile.c Modified: head/usr.sbin/config/mkmakefile.c ============================================================================== --- head/usr.sbin/config/mkmakefile.c Tue Feb 4 22:20:17 2014 (r261500) +++ head/usr.sbin/config/mkmakefile.c Wed Feb 5 00:26:11 2014 (r261501) @@ -63,6 +63,7 @@ static void read_files(void); static void errout(const char *fmt, ...) { va_list ap; + va_start(ap, fmt); vfprintf(stderr, fmt, ap); va_end(ap); @@ -480,8 +481,7 @@ next: if (op->op_value == 0 && opteq(op->op_name, wd)) goto nextparam; match = 0; -nextparam: - not = 0; +nextparam:; } if (not) compile += !match; From owner-svn-src-head@FreeBSD.ORG Wed Feb 5 01:29:14 2014 Return-Path: Delivered-To: svn-src-head@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 C3743B7F for ; Wed, 5 Feb 2014 01:29:14 +0000 (UTC) Received: from mail-qc0-x234.google.com (mail-qc0-x234.google.com [IPv6:2607:f8b0:400d:c01::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7A2441375 for ; Wed, 5 Feb 2014 01:29:14 +0000 (UTC) Received: by mail-qc0-f180.google.com with SMTP id i17so15033229qcy.39 for ; Tue, 04 Feb 2014 17:29:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=NY+xQISBiInJmIXLrtAn1+/kwRc49T3N2hv80E1siUs=; b=kZ/aqkFDqA6uI+8ehgEh+Vt55+3J0w6V2fb9Alc+zIH5XBedjFIhz/wAoTg45GM2+p HbPg7IW+q9OlOuq6OLdzAKNqQnenD3Ia6ojCz306AfL6SQNucHv8V71PxE8e8lBmNj4K rGyGPPq3wseQjhsYClxv7MA+f6Fq/ZTUf69pM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=NY+xQISBiInJmIXLrtAn1+/kwRc49T3N2hv80E1siUs=; b=D2JdI/JvYlebHxX6wHMqa5e1+6xeeIsiz5kPwp/pXbT5FEgkzuQ0SVKXlkXaggDuSP ECWo1HHgqV6HaPfqHTuIum/Y0VUMVcSnq3GwPiC9PLcAzK7RS+CUa7mpXsUBpFSqkfYl XITlM0YjGoEJn9ngoHSSs/iXPF/pf+1KVR8iyHNxxZDs7VdAwCZ44uNc1NzY/QPGRUcK jf0ezCUNPOcjIvzMrJOP6sO2TNODyK/PJt2MM1TUQoB93i/lMbf9rBz3KzRm+rB4d88J MUn0vWP2XdYZtOWSEGnRNpZ4RVptOZ7JKGS7kJnM3C/1Gfys/To4gJ4GJHvDefCSyjj6 fZeg== X-Gm-Message-State: ALoCoQmdcBc9qgVb3cQth4SvPHUtrwYtqI7xA4qSG40ODMi8Vs6aPrtH92yv45IgIPpTqyK8wouZ X-Received: by 10.140.85.179 with SMTP id n48mr66436402qgd.91.1391563753594; Tue, 04 Feb 2014 17:29:13 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.96.30.229 with HTTP; Tue, 4 Feb 2014 17:28:43 -0800 (PST) In-Reply-To: <20140204164703.S1229@besplex.bde.org> References: <201402040301.s1431XgK027156@svn.freebsd.org> <20140204164703.S1229@besplex.bde.org> From: Eitan Adler Date: Tue, 4 Feb 2014 20:28:43 -0500 X-Google-Sender-Auth: kyXFJjX8KJYyked4A1Qq13oeo14 Message-ID: Subject: Re: svn commit: r261454 - head/lib/libc/net To: Bruce Evans Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2014 01:29:14 -0000 On Tue, Feb 4, 2014 at 1:29 AM, Bruce Evans wrote: > On Tue, 4 Feb 2014, Eitan Adler wrote: > >> Log: >> libc/net: Fix some issues in inet6_opt_init() (from RFC 3542): >> >> * The RFC says (in section 10.1) that only when extbuf is not NULL, >> extlen shall be checked, so don't perform this check when NULL is >> passed. >> >> * socklen_t is unsigned, so checking extlen for less than zero is >> not needed. > > > Why be so unportable? socklen_t is not necessarily unsigned. When I checked prior to commit I read ' makes available a type, socklen_t, which is an unsigned opaque integral type of length of at least 32 bits. ' After checking again it turns out that this quote is from SUSv2 which is just a bit old. In any case switching the line to <= 0 won't add any real value now. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@FreeBSD.ORG Wed Feb 5 02:00:31 2014 Return-Path: Delivered-To: svn-src-head@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 DAECD640; Wed, 5 Feb 2014 02:00:31 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C780B185F; Wed, 5 Feb 2014 02:00:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1520VOf074917; Wed, 5 Feb 2014 02:00:31 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1520VvQ074916; Wed, 5 Feb 2014 02:00:31 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201402050200.s1520VvQ074916@svn.freebsd.org> From: Eitan Adler Date: Wed, 5 Feb 2014 02:00:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261502 - head/lib/libc/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2014 02:00:31 -0000 Author: eadler Date: Wed Feb 5 02:00:31 2014 New Revision: 261502 URL: http://svnweb.freebsd.org/changeset/base/261502 Log: libc/net: fix a portability issue * POSIX does not require socklen_t to be unsigned Submitted by: bde MFC After: 1 week (with r261454) Modified: head/lib/libc/net/ip6opt.c Modified: head/lib/libc/net/ip6opt.c ============================================================================== --- head/lib/libc/net/ip6opt.c Wed Feb 5 00:26:11 2014 (r261501) +++ head/lib/libc/net/ip6opt.c Wed Feb 5 02:00:31 2014 (r261502) @@ -382,7 +382,7 @@ inet6_opt_init(void *extbuf, socklen_t e struct ip6_ext *ext = (struct ip6_ext *)extbuf; if (ext) { - if (extlen == 0 || (extlen % 8)) + if (extlen <= 0 || (extlen % 8)) return(-1); ext->ip6e_len = (extlen >> 3) - 1; } From owner-svn-src-head@FreeBSD.ORG Wed Feb 5 03:27:29 2014 Return-Path: Delivered-To: svn-src-head@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 32E2B523; Wed, 5 Feb 2014 03:27:29 +0000 (UTC) Received: from sakura.ccs.furiru.org (sakura.ccs.furiru.org [IPv6:2001:2f0:104:8060::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6560C16E1; Wed, 5 Feb 2014 03:27:28 +0000 (UTC) Received: from localhost (authenticated bits=0) by sakura.ccs.furiru.org (unknown) with ESMTP id s153RKkV057798; Wed, 5 Feb 2014 12:27:23 +0900 (JST) (envelope-from nyan@FreeBSD.org) Date: Wed, 05 Feb 2014 12:27:20 +0900 (JST) Message-Id: <20140205.122720.737004071193668248.nyan@FreeBSD.org> To: imp@freebsd.org Subject: Re: svn commit: r261492 - head/sys/conf From: TAKAHASHI Yoshihiro In-Reply-To: <201402041824.s14IOQpU093086@svn.freebsd.org> References: <201402041824.s14IOQpU093086@svn.freebsd.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2014 03:27:29 -0000 In article <201402041824.s14IOQpU093086@svn.freebsd.org> Warner Losh writes: > Author: imp > Date: Tue Feb 4 18:24:25 2014 > New Revision: 261492 > URL: http://svnweb.freebsd.org/changeset/base/261492 > > Log: > Bump the version of config to the latest (3 year old, so upgrade > worries are long past). Also remove redundant MACHINE= declarations > and passing MACHINE/MACHINE_ARCH to module builds. That's now done in > common code. This broke cross-building with legacy method. See: http://svnweb.freebsd.org/base?view=revision&revision=69817 --- TAKAHASHI Yoshihiro From owner-svn-src-head@FreeBSD.ORG Wed Feb 5 02:01:08 2014 Return-Path: Delivered-To: svn-src-head@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 A955F788; Wed, 5 Feb 2014 02:01:08 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 945FC18D3; Wed, 5 Feb 2014 02:01:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s15218sY075139; Wed, 5 Feb 2014 02:01:08 GMT (envelope-from tychon@svn.freebsd.org) Received: (from tychon@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s15218tN075138; Wed, 5 Feb 2014 02:01:08 GMT (envelope-from tychon@svn.freebsd.org) Message-Id: <201402050201.s15218tN075138@svn.freebsd.org> From: Tycho Nightingale Date: Wed, 5 Feb 2014 02:01:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261503 - head/sys/amd64/vmm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2014 02:01:08 -0000 Author: tychon Date: Wed Feb 5 02:01:08 2014 New Revision: 261503 URL: http://svnweb.freebsd.org/changeset/base/261503 Log: Add support for emulating the byte move and zero extend instructions: "mov r/m8, r32" and "mov r/m8, r64". Approved by: neel (co-mentor) Modified: head/sys/amd64/vmm/vmm_instruction_emul.c Modified: head/sys/amd64/vmm/vmm_instruction_emul.c ============================================================================== --- head/sys/amd64/vmm/vmm_instruction_emul.c Wed Feb 5 02:00:31 2014 (r261502) +++ head/sys/amd64/vmm/vmm_instruction_emul.c Wed Feb 5 02:01:08 2014 (r261503) @@ -58,8 +58,10 @@ enum cpu_mode { enum { VIE_OP_TYPE_NONE = 0, VIE_OP_TYPE_MOV, + VIE_OP_TYPE_MOVZX, VIE_OP_TYPE_AND, VIE_OP_TYPE_OR, + VIE_OP_TYPE_TWO_BYTE, VIE_OP_TYPE_LAST }; @@ -67,7 +69,18 @@ enum { #define VIE_OP_F_IMM (1 << 0) /* immediate operand present */ #define VIE_OP_F_IMM8 (1 << 1) /* 8-bit immediate operand */ +static const struct vie_op two_byte_opcodes[256] = { + [0xB6] = { + .op_byte = 0xB6, + .op_type = VIE_OP_TYPE_MOVZX, + }, +}; + static const struct vie_op one_byte_opcodes[256] = { + [0x0F] = { + .op_byte = 0x0F, + .op_type = VIE_OP_TYPE_TWO_BYTE + }, [0x88] = { .op_byte = 0x88, .op_type = VIE_OP_TYPE_MOV, @@ -313,6 +326,59 @@ emulate_mov(void *vm, int vcpuid, uint64 return (error); } +/* + * The following simplifying assumptions are made during emulation: + * + * - guest is in 64-bit mode + * - default address size is 64-bits + * - default operand size is 32-bits + * + * - operand size override is not supported + * + * - address size override is not supported + */ +static int +emulate_movzx(void *vm, int vcpuid, uint64_t gpa, struct vie *vie, + mem_region_read_t memread, mem_region_write_t memwrite, + void *arg) +{ + int error, size; + enum vm_reg_name reg; + uint64_t val; + + size = 4; + error = EINVAL; + + switch (vie->op.op_byte) { + case 0xB6: + /* + * MOV and zero extend byte from mem (ModRM:r/m) to + * reg (ModRM:reg). + * + * 0F B6/r movzx r/m8, r32 + * REX.W + 0F B6/r movzx r/m8, r64 + */ + + /* get the first operand */ + error = memread(vm, vcpuid, gpa, &val, 1, arg); + if (error) + break; + + /* get the second operand */ + reg = gpr_map[vie->reg]; + + if (vie->rex_w) + size = 8; + + /* write the result */ + error = vie_update_register(vm, vcpuid, reg, val, size); + break; + default: + break; + } + return (error); +} + static int emulate_and(void *vm, int vcpuid, uint64_t gpa, struct vie *vie, mem_region_read_t memread, mem_region_write_t memwrite, void *arg) @@ -447,6 +513,10 @@ vmm_emulate_instruction(void *vm, int vc error = emulate_mov(vm, vcpuid, gpa, vie, memread, memwrite, memarg); break; + case VIE_OP_TYPE_MOVZX: + error = emulate_movzx(vm, vcpuid, gpa, vie, + memread, memwrite, memarg); + break; case VIE_OP_TYPE_AND: error = emulate_and(vm, vcpuid, gpa, vie, memread, memwrite, memarg); @@ -609,6 +679,23 @@ decode_rex(struct vie *vie) } static int +decode_two_byte_opcode(struct vie *vie) +{ + uint8_t x; + + if (vie_peek(vie, &x)) + return (-1); + + vie->op = two_byte_opcodes[x]; + + if (vie->op.op_type == VIE_OP_TYPE_NONE) + return (-1); + + vie_advance(vie); + return (0); +} + +static int decode_opcode(struct vie *vie) { uint8_t x; @@ -622,6 +709,10 @@ decode_opcode(struct vie *vie) return (-1); vie_advance(vie); + + if (vie->op.op_type == VIE_OP_TYPE_TWO_BYTE) + return (decode_two_byte_opcode(vie)); + return (0); } From owner-svn-src-head@FreeBSD.ORG Wed Feb 5 03:22:36 2014 Return-Path: Delivered-To: svn-src-head@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 56EE915D; Wed, 5 Feb 2014 03:22:36 +0000 (UTC) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id B9F161697; Wed, 5 Feb 2014 03:22:35 +0000 (UTC) Received: from c122-106-144-87.carlnfd1.nsw.optusnet.com.au (c122-106-144-87.carlnfd1.nsw.optusnet.com.au [122.106.144.87]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id B0C63782950; Wed, 5 Feb 2014 14:22:26 +1100 (EST) Date: Wed, 5 Feb 2014 14:22:25 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Eitan Adler Subject: Re: svn commit: r261502 - head/lib/libc/net In-Reply-To: <201402050200.s1520VvQ074916@svn.freebsd.org> Message-ID: <20140205135024.G1162@besplex.bde.org> References: <201402050200.s1520VvQ074916@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=Wu4Sb7vv c=1 sm=1 tr=0 a=p/w0leo876FR0WNmYI1KeA==:117 a=PO7r1zJSAAAA:8 a=TLSZfMyrDvIA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=4jIg5_e19IMA:10 a=FCIpg6Y5KE6TmbiEcUQA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2014 03:22:36 -0000 On Wed, 5 Feb 2014, Eitan Adler wrote: > Log: > libc/net: fix a portability issue > > * POSIX does not require socklen_t to be unsigned > > Submitted by: bde Thanks. > Modified: head/lib/libc/net/ip6opt.c > ============================================================================== > --- head/lib/libc/net/ip6opt.c Wed Feb 5 00:26:11 2014 (r261501) > +++ head/lib/libc/net/ip6opt.c Wed Feb 5 02:00:31 2014 (r261502) > @@ -382,7 +382,7 @@ inet6_opt_init(void *extbuf, socklen_t e > struct ip6_ext *ext = (struct ip6_ext *)extbuf; > > if (ext) { > - if (extlen == 0 || (extlen % 8)) > + if (extlen <= 0 || (extlen % 8)) > return(-1); > ext->ip6e_len = (extlen >> 3) - 1; > } Hmm, this gives (restores) some other portability problems. Compilers may warn about "unsigned comparison with 0" on systems where socklen_t is unsigned. This is a general problem with typedefed types of unspecifed signedness. You don't want to ifdef the signed and unsigned cases to avoid this warning. While here it would be nice to fix some style bugs: - boolean comparison for the pointer 'ext' - this commit fixes the inconsistency not obfuscating the non-boolean comparison of 'extlen' similarly. ' == 0' looks strange when everywhere else omits both explicit comparisons with 0 and NULL. - excessive parentheses around 'extlen % 8' - boolean comparison for the non-boolean 'extlen % 8'. The excessive parentheses would have been non-excessive (needed) for a non-boolean comparison - no space before the return value. This file has many return statements and consistently misformats them all. Otherwise, its density of style bugs is only moderately high. Related to the original commit, the man page was confusing about the error checking for the extbuf != NULL case, and I don't remember the commit changing the man page. It says that "extlen is a positive multiple of 8". 0 is multiple of 8, and it is unclear if it is positive. 0 is in fact not allowed. Bruce From owner-svn-src-head@FreeBSD.ORG Wed Feb 5 04:39:07 2014 Return-Path: Delivered-To: svn-src-head@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 6ADDF7EB; Wed, 5 Feb 2014 04:39:07 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5371A1B99; Wed, 5 Feb 2014 04:39:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s154d7jR036814; Wed, 5 Feb 2014 04:39:07 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s154d4Uq036793; Wed, 5 Feb 2014 04:39:04 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402050439.s154d4Uq036793@svn.freebsd.org> From: John Baldwin Date: Wed, 5 Feb 2014 04:39:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261504 - in head: lib/libvmmapi sys/amd64/include sys/amd64/vmm sys/amd64/vmm/intel sys/boot/common sys/boot/userboot/userboot usr.sbin/bhyveload X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2014 04:39:07 -0000 Author: jhb Date: Wed Feb 5 04:39:03 2014 New Revision: 261504 URL: http://svnweb.freebsd.org/changeset/base/261504 Log: Add support for FreeBSD/i386 guests under bhyve. - Similar to the hack for bootinfo32.c in userboot, define _MACHINE_ELF_WANT_32BIT in the load_elf32 file handlers in userboot. This allows userboot to load 32-bit kernels and modules. - Copy the SMAP generation code out of bootinfo64.c and into its own file so it can be shared with bootinfo32.c to pass an SMAP to the i386 kernel. - Use uint32_t instead of u_long when aligning module metadata in bootinfo32.c in userboot, as otherwise the metadata used 64-bit alignment which corrupted the layout. - Populate the basemem and extmem members of the bootinfo struct passed to 32-bit kernels. - Fix the 32-bit stack in userboot to start at the top of the stack instead of the bottom so that there is room to grow before the kernel switches to its own stack. - Push a fake return address onto the 32-bit stack in addition to the arguments normally passed to exec() in the loader. This return address is needed to convince recover_bootinfo() in the 32-bit locore code that it is being invoked from a "new" boot block. - Add a routine to libvmmapi to setup a 32-bit flat mode register state including a GDT and TSS that is able to start the i386 kernel and update bhyveload to use it when booting an i386 kernel. - Use the guest register state to determine the CPU's current instruction mode (32-bit vs 64-bit) and paging mode (flat, 32-bit, PAE, or long mode) in the instruction emulation code. Update the gla2gpa() routine used when fetching instructions to handle flat mode, 32-bit paging, and PAE paging in addition to long mode paging. Don't look for a REX prefix when the CPU is in 32-bit mode, and use the detected mode to enable the existing 32-bit mode code when decoding the mod r/m byte. Reviewed by: grehan, neel MFC after: 1 month Added: head/sys/boot/userboot/userboot/biossmap.c - copied, changed from r261503, head/sys/boot/userboot/userboot/bootinfo64.c Modified: head/lib/libvmmapi/vmmapi.h head/lib/libvmmapi/vmmapi_freebsd.c head/sys/amd64/include/vmm.h head/sys/amd64/include/vmm_instruction_emul.h head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/vmm.c head/sys/amd64/vmm/vmm_instruction_emul.c head/sys/boot/common/load_elf32.c head/sys/boot/common/load_elf32_obj.c head/sys/boot/userboot/userboot/Makefile head/sys/boot/userboot/userboot/bootinfo32.c head/sys/boot/userboot/userboot/bootinfo64.c head/sys/boot/userboot/userboot/elf32_freebsd.c head/sys/boot/userboot/userboot/libuserboot.h head/usr.sbin/bhyveload/bhyveload.c Modified: head/lib/libvmmapi/vmmapi.h ============================================================================== --- head/lib/libvmmapi/vmmapi.h Wed Feb 5 02:01:08 2014 (r261503) +++ head/lib/libvmmapi/vmmapi.h Wed Feb 5 04:39:03 2014 (r261504) @@ -111,5 +111,8 @@ int vcpu_reset(struct vmctx *ctx, int vc int vm_setup_freebsd_registers(struct vmctx *ctx, int vcpu, uint64_t rip, uint64_t cr3, uint64_t gdtbase, uint64_t rsp); +int vm_setup_freebsd_registers_i386(struct vmctx *vmctx, int vcpu, + uint32_t eip, uint32_t gdtbase, + uint32_t esp); void vm_setup_freebsd_gdt(uint64_t *gdtr); #endif /* _VMMAPI_H_ */ Modified: head/lib/libvmmapi/vmmapi_freebsd.c ============================================================================== --- head/lib/libvmmapi/vmmapi_freebsd.c Wed Feb 5 02:01:08 2014 (r261503) +++ head/lib/libvmmapi/vmmapi_freebsd.c Wed Feb 5 04:39:03 2014 (r261504) @@ -35,14 +35,176 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + #include "vmmapi.h" +#define I386_TSS_SIZE 104 + +#define DESC_PRESENT 0x00000080 +#define DESC_LONGMODE 0x00002000 +#define DESC_DEF32 0x00004000 +#define DESC_GRAN 0x00008000 #define DESC_UNUSABLE 0x00010000 #define GUEST_NULL_SEL 0 #define GUEST_CODE_SEL 1 #define GUEST_DATA_SEL 2 -#define GUEST_GDTR_LIMIT (3 * 8 - 1) +#define GUEST_TSS_SEL 3 +#define GUEST_GDTR_LIMIT64 (3 * 8 - 1) + +static struct segment_descriptor i386_gdt[] = { + {}, /* NULL */ + { .sd_lolimit = 0xffff, .sd_type = SDT_MEMER, /* CODE */ + .sd_p = 1, .sd_hilimit = 0xf, .sd_def32 = 1, .sd_gran = 1 }, + { .sd_lolimit = 0xffff, .sd_type = SDT_MEMRW, /* DATA */ + .sd_p = 1, .sd_hilimit = 0xf, .sd_def32 = 1, .sd_gran = 1 }, + { .sd_lolimit = I386_TSS_SIZE - 1, /* TSS */ + .sd_type = SDT_SYS386TSS, .sd_p = 1 } +}; + +/* + * Setup the 'vcpu' register set such that it will begin execution at + * 'eip' in flat mode. + */ +int +vm_setup_freebsd_registers_i386(struct vmctx *vmctx, int vcpu, uint32_t eip, + uint32_t gdtbase, uint32_t esp) +{ + uint64_t cr0, rflags, desc_base; + uint32_t desc_access, desc_limit, tssbase; + uint16_t gsel; + struct segment_descriptor *gdt; + int error, tmp; + + /* A 32-bit guest requires unrestricted mode. */ + error = vm_get_capability(vmctx, vcpu, VM_CAP_UNRESTRICTED_GUEST, &tmp); + if (error) + goto done; + error = vm_set_capability(vmctx, vcpu, VM_CAP_UNRESTRICTED_GUEST, 1); + if (error) + goto done; + + cr0 = CR0_PE | CR0_NE; + if ((error = vm_set_register(vmctx, vcpu, VM_REG_GUEST_CR0, cr0)) != 0) + goto done; + + if ((error = vm_set_register(vmctx, vcpu, VM_REG_GUEST_CR4, 0)) != 0) + goto done; + + /* + * Forcing EFER to 0 causes bhyve to clear the "IA-32e guest + * mode" entry control. + */ + if ((error = vm_set_register(vmctx, vcpu, VM_REG_GUEST_EFER, 0))) + goto done; + + gdt = vm_map_gpa(vmctx, gdtbase, 0x1000); + if (gdt == NULL) + return (EFAULT); + memcpy(gdt, i386_gdt, sizeof(i386_gdt)); + desc_base = gdtbase; + desc_limit = sizeof(i386_gdt) - 1; + error = vm_set_desc(vmctx, vcpu, VM_REG_GUEST_GDTR, + desc_base, desc_limit, 0); + if (error != 0) + goto done; + + /* Place the TSS one page above the GDT. */ + tssbase = gdtbase + 0x1000; + gdt[3].sd_lobase = tssbase; + + rflags = 0x2; + error = vm_set_register(vmctx, vcpu, VM_REG_GUEST_RFLAGS, rflags); + if (error) + goto done; + + desc_base = 0; + desc_limit = 0xffffffff; + desc_access = DESC_GRAN | DESC_DEF32 | DESC_PRESENT | SDT_MEMERA; + error = vm_set_desc(vmctx, vcpu, VM_REG_GUEST_CS, + desc_base, desc_limit, desc_access); + + desc_access = DESC_GRAN | DESC_DEF32 | DESC_PRESENT | SDT_MEMRWA; + error = vm_set_desc(vmctx, vcpu, VM_REG_GUEST_DS, + desc_base, desc_limit, desc_access); + if (error) + goto done; + + error = vm_set_desc(vmctx, vcpu, VM_REG_GUEST_ES, + desc_base, desc_limit, desc_access); + if (error) + goto done; + + error = vm_set_desc(vmctx, vcpu, VM_REG_GUEST_FS, + desc_base, desc_limit, desc_access); + if (error) + goto done; + + error = vm_set_desc(vmctx, vcpu, VM_REG_GUEST_GS, + desc_base, desc_limit, desc_access); + if (error) + goto done; + + error = vm_set_desc(vmctx, vcpu, VM_REG_GUEST_SS, + desc_base, desc_limit, desc_access); + if (error) + goto done; + + desc_base = tssbase; + desc_limit = I386_TSS_SIZE - 1; + desc_access = DESC_PRESENT | SDT_SYS386BSY; + error = vm_set_desc(vmctx, vcpu, VM_REG_GUEST_TR, + desc_base, desc_limit, desc_access); + if (error) + goto done; + + + error = vm_set_desc(vmctx, vcpu, VM_REG_GUEST_LDTR, 0, 0, + DESC_UNUSABLE); + if (error) + goto done; + + gsel = GSEL(GUEST_CODE_SEL, SEL_KPL); + if ((error = vm_set_register(vmctx, vcpu, VM_REG_GUEST_CS, gsel)) != 0) + goto done; + + gsel = GSEL(GUEST_DATA_SEL, SEL_KPL); + if ((error = vm_set_register(vmctx, vcpu, VM_REG_GUEST_DS, gsel)) != 0) + goto done; + + if ((error = vm_set_register(vmctx, vcpu, VM_REG_GUEST_ES, gsel)) != 0) + goto done; + + if ((error = vm_set_register(vmctx, vcpu, VM_REG_GUEST_FS, gsel)) != 0) + goto done; + + if ((error = vm_set_register(vmctx, vcpu, VM_REG_GUEST_GS, gsel)) != 0) + goto done; + + if ((error = vm_set_register(vmctx, vcpu, VM_REG_GUEST_SS, gsel)) != 0) + goto done; + + gsel = GSEL(GUEST_TSS_SEL, SEL_KPL); + if ((error = vm_set_register(vmctx, vcpu, VM_REG_GUEST_TR, gsel)) != 0) + goto done; + + /* LDTR is pointing to the null selector */ + if ((error = vm_set_register(vmctx, vcpu, VM_REG_GUEST_LDTR, 0)) != 0) + goto done; + + /* entry point */ + if ((error = vm_set_register(vmctx, vcpu, VM_REG_GUEST_RIP, eip)) != 0) + goto done; + + if ((error = vm_set_register(vmctx, vcpu, VM_REG_GUEST_RSP, esp)) != 0) + goto done; + + error = 0; +done: + return (error); +} void vm_setup_freebsd_gdt(uint64_t *gdtr) @@ -168,7 +330,7 @@ vm_setup_freebsd_registers(struct vmctx goto done; desc_base = gdtbase; - desc_limit = GUEST_GDTR_LIMIT; + desc_limit = GUEST_GDTR_LIMIT64; error = vm_set_desc(vmctx, vcpu, VM_REG_GUEST_GDTR, desc_base, desc_limit, 0); if (error != 0) Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Wed Feb 5 02:01:08 2014 (r261503) +++ head/sys/amd64/include/vmm.h Wed Feb 5 04:39:03 2014 (r261504) @@ -323,6 +323,8 @@ struct vm_exit { uint64_t gpa; uint64_t gla; uint64_t cr3; + enum vie_cpu_mode cpu_mode; + enum vie_paging_mode paging_mode; struct vie vie; } inst_emul; /* Modified: head/sys/amd64/include/vmm_instruction_emul.h ============================================================================== --- head/sys/amd64/include/vmm_instruction_emul.h Wed Feb 5 02:01:08 2014 (r261503) +++ head/sys/amd64/include/vmm_instruction_emul.h Wed Feb 5 04:39:03 2014 (r261504) @@ -29,6 +29,18 @@ #ifndef _VMM_INSTRUCTION_EMUL_H_ #define _VMM_INSTRUCTION_EMUL_H_ +enum vie_cpu_mode { + CPU_MODE_COMPATIBILITY, /* IA-32E mode (CS.L = 0) */ + CPU_MODE_64BIT, /* IA-32E mode (CS.L = 1) */ +}; + +enum vie_paging_mode { + PAGING_MODE_FLAT, + PAGING_MODE_32, + PAGING_MODE_PAE, + PAGING_MODE_64, +}; + /* * The data structures 'vie' and 'vie_op' are meant to be opaque to the * consumers of instruction decoding. The only reason why their contents @@ -107,7 +119,7 @@ int vmm_emulate_instruction(void *vm, in */ int vmm_fetch_instruction(struct vm *vm, int cpuid, uint64_t rip, int inst_length, uint64_t cr3, - struct vie *vie); + enum vie_paging_mode paging_mode, struct vie *vie); void vie_init(struct vie *vie); @@ -123,8 +135,8 @@ void vie_init(struct vie *vie); * in VIE_INVALID_GLA instead. */ #define VIE_INVALID_GLA (1UL << 63) /* a non-canonical address */ -int vmm_decode_instruction(struct vm *vm, int cpuid, - uint64_t gla, struct vie *vie); +int vmm_decode_instruction(struct vm *vm, int cpuid, uint64_t gla, + enum vie_cpu_mode cpu_mode, struct vie *vie); #endif /* _KERNEL */ #endif /* _VMM_INSTRUCTION_EMUL_H_ */ Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Wed Feb 5 02:01:08 2014 (r261503) +++ head/sys/amd64/vmm/intel/vmx.c Wed Feb 5 04:39:03 2014 (r261504) @@ -1338,6 +1338,30 @@ vmx_emulate_cr_access(struct vmx *vmx, i return (HANDLED); } +static enum vie_cpu_mode +vmx_cpu_mode(void) +{ + + if (vmcs_read(VMCS_GUEST_IA32_EFER) & EFER_LMA) + return (CPU_MODE_64BIT); + else + return (CPU_MODE_COMPATIBILITY); +} + +static enum vie_paging_mode +vmx_paging_mode(void) +{ + + if (!(vmcs_read(VMCS_GUEST_CR0) & CR0_PG)) + return (PAGING_MODE_FLAT); + if (!(vmcs_read(VMCS_GUEST_CR4) & CR4_PAE)) + return (PAGING_MODE_32); + if (vmcs_read(VMCS_GUEST_IA32_EFER) & EFER_LME) + return (PAGING_MODE_64); + else + return (PAGING_MODE_PAE); +} + static int ept_fault_type(uint64_t ept_qual) { @@ -1497,6 +1521,8 @@ vmx_handle_apic_access(struct vmx *vmx, vmexit->u.inst_emul.gpa = DEFAULT_APIC_BASE + offset; vmexit->u.inst_emul.gla = VIE_INVALID_GLA; vmexit->u.inst_emul.cr3 = vmcs_guest_cr3(); + vmexit->u.inst_emul.cpu_mode = vmx_cpu_mode(); + vmexit->u.inst_emul.paging_mode = vmx_paging_mode(); } /* @@ -1724,6 +1750,8 @@ vmx_exit_process(struct vmx *vmx, int vc vmexit->u.inst_emul.gpa = gpa; vmexit->u.inst_emul.gla = vmcs_gla(); vmexit->u.inst_emul.cr3 = vmcs_guest_cr3(); + vmexit->u.inst_emul.cpu_mode = vmx_cpu_mode(); + vmexit->u.inst_emul.paging_mode = vmx_paging_mode(); } /* * If Virtual NMIs control is 1 and the VM-exit is due to an Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Wed Feb 5 02:01:08 2014 (r261503) +++ head/sys/amd64/vmm/vmm.c Wed Feb 5 04:39:03 2014 (r261504) @@ -1056,6 +1056,8 @@ vm_handle_inst_emul(struct vm *vm, int v struct vm_exit *vme; int error, inst_length; uint64_t rip, gla, gpa, cr3; + enum vie_cpu_mode cpu_mode; + enum vie_paging_mode paging_mode; mem_region_read_t mread; mem_region_write_t mwrite; @@ -1068,15 +1070,18 @@ vm_handle_inst_emul(struct vm *vm, int v gla = vme->u.inst_emul.gla; gpa = vme->u.inst_emul.gpa; cr3 = vme->u.inst_emul.cr3; + cpu_mode = vme->u.inst_emul.cpu_mode; + paging_mode = vme->u.inst_emul.paging_mode; vie = &vme->u.inst_emul.vie; vie_init(vie); /* Fetch, decode and emulate the faulting instruction */ - if (vmm_fetch_instruction(vm, vcpuid, rip, inst_length, cr3, vie) != 0) + if (vmm_fetch_instruction(vm, vcpuid, rip, inst_length, cr3, + paging_mode, vie) != 0) return (EFAULT); - if (vmm_decode_instruction(vm, vcpuid, gla, vie) != 0) + if (vmm_decode_instruction(vm, vcpuid, gla, cpu_mode, vie) != 0) return (EFAULT); /* return to userland unless this is an in-kernel emulated device */ Modified: head/sys/amd64/vmm/vmm_instruction_emul.c ============================================================================== --- head/sys/amd64/vmm/vmm_instruction_emul.c Wed Feb 5 02:01:08 2014 (r261503) +++ head/sys/amd64/vmm/vmm_instruction_emul.c Wed Feb 5 04:39:03 2014 (r261504) @@ -49,11 +49,6 @@ __FBSDID("$FreeBSD$"); #include #endif /* _KERNEL */ -enum cpu_mode { - CPU_MODE_COMPATIBILITY, /* IA-32E mode (CS.L = 0) */ - CPU_MODE_64BIT, /* IA-32E mode (CS.L = 1) */ -}; - /* struct vie_op.op_type */ enum { VIE_OP_TYPE_NONE = 0, @@ -546,16 +541,76 @@ vie_init(struct vie *vie) static int gla2gpa(struct vm *vm, uint64_t gla, uint64_t ptpphys, - uint64_t *gpa, uint64_t *gpaend) + uint64_t *gpa, enum vie_paging_mode paging_mode) { int nlevels, ptpshift, ptpindex; uint64_t *ptpbase, pte, pgsize; + uint32_t *ptpbase32, pte32; void *cookie; - /* - * XXX assumes 64-bit guest with 4 page walk levels - */ - nlevels = 4; + if (paging_mode == PAGING_MODE_FLAT) { + *gpa = gla; + return (0); + } + + if (paging_mode == PAGING_MODE_32) { + nlevels = 2; + while (--nlevels >= 0) { + /* Zero out the lower 12 bits. */ + ptpphys &= ~0xfff; + + ptpbase32 = vm_gpa_hold(vm, ptpphys, PAGE_SIZE, + VM_PROT_READ, &cookie); + + if (ptpbase32 == NULL) + goto error; + + ptpshift = PAGE_SHIFT + nlevels * 10; + ptpindex = (gla >> ptpshift) & 0x3FF; + pgsize = 1UL << ptpshift; + + pte32 = ptpbase32[ptpindex]; + + vm_gpa_release(cookie); + + if ((pte32 & PG_V) == 0) + goto error; + + if (pte32 & PG_PS) + break; + + ptpphys = pte32; + } + + /* Zero out the lower 'ptpshift' bits */ + pte32 >>= ptpshift; pte32 <<= ptpshift; + *gpa = pte32 | (gla & (pgsize - 1)); + return (0); + } + + if (paging_mode == PAGING_MODE_PAE) { + /* Zero out the lower 5 bits and the upper 12 bits */ + ptpphys >>= 5; ptpphys <<= 17; ptpphys >>= 12; + + ptpbase = vm_gpa_hold(vm, ptpphys, sizeof(*ptpbase) * 4, + VM_PROT_READ, &cookie); + if (ptpbase == NULL) + goto error; + + ptpindex = (gla >> 30) & 0x3; + + pte = ptpbase[ptpindex]; + + vm_gpa_release(cookie); + + if ((pte & PG_V) == 0) + goto error; + + ptpphys = pte; + + nlevels = 2; + } else + nlevels = 4; while (--nlevels >= 0) { /* Zero out the lower 12 bits and the upper 12 bits */ ptpphys >>= 12; ptpphys <<= 24; ptpphys >>= 12; @@ -589,7 +644,6 @@ gla2gpa(struct vm *vm, uint64_t gla, uin /* Zero out the lower 'ptpshift' bits and the upper 12 bits */ pte >>= ptpshift; pte <<= (ptpshift + 12); pte >>= 12; *gpa = pte | (gla & (pgsize - 1)); - *gpaend = pte + pgsize; return (0); error: @@ -598,10 +652,11 @@ error: int vmm_fetch_instruction(struct vm *vm, int cpuid, uint64_t rip, int inst_length, - uint64_t cr3, struct vie *vie) + uint64_t cr3, enum vie_paging_mode paging_mode, + struct vie *vie) { int n, err, prot; - uint64_t gpa, gpaend, off; + uint64_t gpa, off; void *hpa, *cookie; /* @@ -614,7 +669,7 @@ vmm_fetch_instruction(struct vm *vm, int /* Copy the instruction into 'vie' */ while (vie->num_valid < inst_length) { - err = gla2gpa(vm, rip, cr3, &gpa, &gpaend); + err = gla2gpa(vm, rip, cr3, &gpa, paging_mode); if (err) break; @@ -717,15 +772,9 @@ decode_opcode(struct vie *vie) } static int -decode_modrm(struct vie *vie) +decode_modrm(struct vie *vie, enum vie_cpu_mode cpu_mode) { uint8_t x; - enum cpu_mode cpu_mode; - - /* - * XXX assuming that guest is in IA-32E 64-bit mode - */ - cpu_mode = CPU_MODE_64BIT; if (vie_peek(vie, &x)) return (-1); @@ -1002,16 +1051,19 @@ verify_gla(struct vm *vm, int cpuid, uin } int -vmm_decode_instruction(struct vm *vm, int cpuid, uint64_t gla, struct vie *vie) +vmm_decode_instruction(struct vm *vm, int cpuid, uint64_t gla, + enum vie_cpu_mode cpu_mode, struct vie *vie) { - if (decode_rex(vie)) - return (-1); + if (cpu_mode == CPU_MODE_64BIT) { + if (decode_rex(vie)) + return (-1); + } if (decode_opcode(vie)) return (-1); - if (decode_modrm(vie)) + if (decode_modrm(vie, cpu_mode)) return (-1); if (decode_sib(vie)) Modified: head/sys/boot/common/load_elf32.c ============================================================================== --- head/sys/boot/common/load_elf32.c Wed Feb 5 02:01:08 2014 (r261503) +++ head/sys/boot/common/load_elf32.c Wed Feb 5 04:39:03 2014 (r261504) @@ -2,5 +2,6 @@ __FBSDID("$FreeBSD$"); #define __ELF_WORD_SIZE 32 +#define _MACHINE_ELF_WANT_32BIT #include "load_elf.c" Modified: head/sys/boot/common/load_elf32_obj.c ============================================================================== --- head/sys/boot/common/load_elf32_obj.c Wed Feb 5 02:01:08 2014 (r261503) +++ head/sys/boot/common/load_elf32_obj.c Wed Feb 5 04:39:03 2014 (r261504) @@ -2,5 +2,6 @@ __FBSDID("$FreeBSD$"); #define __ELF_WORD_SIZE 32 +#define _MACHINE_ELF_WANT_32BIT #include "load_elf_obj.c" Modified: head/sys/boot/userboot/userboot/Makefile ============================================================================== --- head/sys/boot/userboot/userboot/Makefile Wed Feb 5 02:01:08 2014 (r261503) +++ head/sys/boot/userboot/userboot/Makefile Wed Feb 5 04:39:03 2014 (r261504) @@ -11,6 +11,7 @@ STRIP= LIBDIR= /boot SRCS= autoload.c +SRCS+= biossmap.c SRCS+= bootinfo.c SRCS+= bootinfo32.c SRCS+= bootinfo64.c Copied and modified: head/sys/boot/userboot/userboot/biossmap.c (from r261503, head/sys/boot/userboot/userboot/bootinfo64.c) ============================================================================== --- head/sys/boot/userboot/userboot/bootinfo64.c Wed Feb 5 02:01:08 2014 (r261503, copy source) +++ head/sys/boot/userboot/userboot/biossmap.c Wed Feb 5 04:39:03 2014 (r261504) @@ -31,163 +31,20 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include -#include -#include +#include +#include #include "bootstrap.h" #include "libuserboot.h" -/* - * Copy module-related data into the load area, where it can be - * used as a directory for loaded modules. - * - * Module data is presented in a self-describing format. Each datum - * is preceded by a 32-bit identifier and a 32-bit size field. - * - * Currently, the following data are saved: - * - * MOD_NAME (variable) module name (string) - * MOD_TYPE (variable) module type (string) - * MOD_ARGS (variable) module parameters (string) - * MOD_ADDR sizeof(vm_offset_t) module load address - * MOD_SIZE sizeof(size_t) module size - * MOD_METADATA (variable) type-specific metadata - */ -#define COPY32(v, a, c) { \ - u_int32_t x = (v); \ - if (c) \ - CALLBACK(copyin, &x, a, sizeof(x)); \ - a += sizeof(x); \ -} - -#define MOD_STR(t, a, s, c) { \ - COPY32(t, a, c); \ - COPY32(strlen(s) + 1, a, c); \ - if (c) \ - CALLBACK(copyin, s, a, strlen(s) + 1); \ - a += roundup(strlen(s) + 1, sizeof(u_int64_t));\ -} - -#define MOD_NAME(a, s, c) MOD_STR(MODINFO_NAME, a, s, c) -#define MOD_TYPE(a, s, c) MOD_STR(MODINFO_TYPE, a, s, c) -#define MOD_ARGS(a, s, c) MOD_STR(MODINFO_ARGS, a, s, c) - -#define MOD_VAR(t, a, s, c) { \ - COPY32(t, a, c); \ - COPY32(sizeof(s), a, c); \ - if (c) \ - CALLBACK(copyin, &s, a, sizeof(s)); \ - a += roundup(sizeof(s), sizeof(u_int64_t)); \ -} - -#define MOD_ADDR(a, s, c) MOD_VAR(MODINFO_ADDR, a, s, c) -#define MOD_SIZE(a, s, c) MOD_VAR(MODINFO_SIZE, a, s, c) - -#define MOD_METADATA(a, mm, c) { \ - COPY32(MODINFO_METADATA | mm->md_type, a, c); \ - COPY32(mm->md_size, a, c); \ - if (c) \ - CALLBACK(copyin, mm->md_data, a, mm->md_size); \ - a += roundup(mm->md_size, sizeof(u_int64_t));\ -} - -#define MOD_END(a, c) { \ - COPY32(MODINFO_END, a, c); \ - COPY32(0, a, c); \ -} - -static vm_offset_t -bi_copymodules64(vm_offset_t addr) -{ - struct preloaded_file *fp; - struct file_metadata *md; - int c; - u_int64_t v; - - c = addr != 0; - /* start with the first module on the list, should be the kernel */ - for (fp = file_findfile(NULL, NULL); fp != NULL; fp = fp->f_next) { - - MOD_NAME(addr, fp->f_name, c); /* this field must come first */ - MOD_TYPE(addr, fp->f_type, c); - if (fp->f_args) - MOD_ARGS(addr, fp->f_args, c); - v = fp->f_addr; - MOD_ADDR(addr, v, c); - v = fp->f_size; - MOD_SIZE(addr, v, c); - for (md = fp->f_metadata; md != NULL; md = md->md_next) - if (!(md->md_type & MODINFOMD_NOCOPY)) - MOD_METADATA(addr, md, c); - } - MOD_END(addr, c); - return(addr); -} - -/* - * Check to see if this CPU supports long mode. - */ -static int -bi_checkcpu(void) -{ -#if 0 - char *cpu_vendor; - int vendor[3]; - int eflags, regs[4]; - - /* Check for presence of "cpuid". */ - eflags = read_eflags(); - write_eflags(eflags ^ PSL_ID); - if (!((eflags ^ read_eflags()) & PSL_ID)) - return (0); - - /* Fetch the vendor string. */ - do_cpuid(0, regs); - vendor[0] = regs[1]; - vendor[1] = regs[3]; - vendor[2] = regs[2]; - cpu_vendor = (char *)vendor; - - /* Check for vendors that support AMD features. */ - if (strncmp(cpu_vendor, INTEL_VENDOR_ID, 12) != 0 && - strncmp(cpu_vendor, AMD_VENDOR_ID, 12) != 0 && - strncmp(cpu_vendor, CENTAUR_VENDOR_ID, 12) != 0) - return (0); - - /* Has to support AMD features. */ - do_cpuid(0x80000000, regs); - if (!(regs[0] >= 0x80000001)) - return (0); - - /* Check for long mode. */ - do_cpuid(0x80000001, regs); - return (regs[3] & AMDID_LM); -#else - return (1); -#endif -} - -struct smap { - uint64_t base; - uint64_t length; - uint32_t type; -} __packed; - -/* From FreeBSD */ -#define SMAP_TYPE_MEMORY 1 - #define GB (1024UL * 1024 * 1024) -#define MODINFOMD_SMAP 0x1001 - -static void +void bios_addsmapdata(struct preloaded_file *kfp) { uint64_t lowmem, highmem; int smapnum, len; - struct smap smap[3], *sm; + struct bios_smap smap[3], *sm; CALLBACK(getmem, &lowmem, &highmem); @@ -212,93 +69,6 @@ bios_addsmapdata(struct preloaded_file * smapnum++; } - len = smapnum * sizeof (struct smap); + len = smapnum * sizeof(struct bios_smap); file_addmetadata(kfp, MODINFOMD_SMAP, len, &smap[0]); } - -/* - * Load the information expected by an amd64 kernel. - * - * - The 'boothowto' argument is constructed - * - The 'bootdev' argument is constructed - * - The 'bootinfo' struct is constructed, and copied into the kernel space. - * - The kernel environment is copied into kernel space. - * - Module metadata are formatted and placed in kernel space. - */ -int -bi_load64(char *args, vm_offset_t *modulep, vm_offset_t *kernendp) -{ - struct preloaded_file *xp, *kfp; - struct userboot_devdesc *rootdev; - struct file_metadata *md; - vm_offset_t addr; - u_int64_t kernend; - u_int64_t envp; - vm_offset_t size; - char *rootdevname; - int howto; - - if (!bi_checkcpu()) { - printf("CPU doesn't support long mode\n"); - return (EINVAL); - } - - howto = bi_getboothowto(args); - - /* - * Allow the environment variable 'rootdev' to override the supplied device - * This should perhaps go to MI code and/or have $rootdev tested/set by - * MI code before launching the kernel. - */ - rootdevname = getenv("rootdev"); - userboot_getdev((void **)(&rootdev), rootdevname, NULL); - if (rootdev == NULL) { /* bad $rootdev/$currdev */ - printf("can't determine root device\n"); - return(EINVAL); - } - - /* Try reading the /etc/fstab file to select the root device */ - getrootmount(userboot_fmtdev((void *)rootdev)); - - /* find the last module in the chain */ - addr = 0; - for (xp = file_findfile(NULL, NULL); xp != NULL; xp = xp->f_next) { - if (addr < (xp->f_addr + xp->f_size)) - addr = xp->f_addr + xp->f_size; - } - /* pad to a page boundary */ - addr = roundup(addr, PAGE_SIZE); - - /* copy our environment */ - envp = addr; - addr = bi_copyenv(addr); - - /* pad to a page boundary */ - addr = roundup(addr, PAGE_SIZE); - - kfp = file_findfile(NULL, "elf kernel"); - if (kfp == NULL) - kfp = file_findfile(NULL, "elf64 kernel"); - if (kfp == NULL) - panic("can't find kernel file"); - kernend = 0; /* fill it in later */ - file_addmetadata(kfp, MODINFOMD_HOWTO, sizeof howto, &howto); - file_addmetadata(kfp, MODINFOMD_ENVP, sizeof envp, &envp); - file_addmetadata(kfp, MODINFOMD_KERNEND, sizeof kernend, &kernend); - bios_addsmapdata(kfp); - - /* Figure out the size and location of the metadata */ - *modulep = addr; - size = bi_copymodules64(0); - kernend = roundup(addr + size, PAGE_SIZE); - *kernendp = kernend; - - /* patch MODINFOMD_KERNEND */ - md = file_findmetadata(kfp, MODINFOMD_KERNEND); - bcopy(&kernend, md->md_data, sizeof kernend); - - /* copy module list and metadata */ - (void)bi_copymodules64(addr); - - return(0); -} Modified: head/sys/boot/userboot/userboot/bootinfo32.c ============================================================================== --- head/sys/boot/userboot/userboot/bootinfo32.c Wed Feb 5 02:01:08 2014 (r261503) +++ head/sys/boot/userboot/userboot/bootinfo32.c Wed Feb 5 04:39:03 2014 (r261504) @@ -66,7 +66,7 @@ static struct bootinfo bi; COPY32(strlen(s) + 1, a, c); \ if (c) \ CALLBACK(copyin, s, a, strlen(s) + 1); \ - a += roundup(strlen(s) + 1, sizeof(u_long));\ + a += roundup(strlen(s) + 1, sizeof(uint32_t));\ } #define MOD_NAME(a, s, c) MOD_STR(MODINFO_NAME, a, s, c) @@ -78,7 +78,7 @@ static struct bootinfo bi; COPY32(sizeof(s), a, c); \ if (c) \ CALLBACK(copyin, &s, a, sizeof(s)); \ - a += roundup(sizeof(s), sizeof(u_long)); \ + a += roundup(sizeof(s), sizeof(uint32_t)); \ } #define MOD_ADDR(a, s, c) MOD_VAR(MODINFO_ADDR, a, s, c) @@ -89,7 +89,7 @@ static struct bootinfo bi; COPY32(mm->md_size, a, c); \ if (c) \ CALLBACK(copyin, mm->md_data, a, mm->md_size); \ - a += roundup(mm->md_size, sizeof(u_long));\ + a += roundup(mm->md_size, sizeof(uint32_t));\ } #define MOD_END(a, c) { \ @@ -146,6 +146,7 @@ bi_load32(char *args, int *howtop, int * int bootdevnr, howto; char *kernelname; const char *kernelpath; + uint64_t lowmem, highmem; howto = bi_getboothowto(args); @@ -198,9 +199,7 @@ bi_load32(char *args, int *howtop, int * file_addmetadata(kfp, MODINFOMD_HOWTO, sizeof howto, &howto); file_addmetadata(kfp, MODINFOMD_ENVP, sizeof envp, &envp); file_addmetadata(kfp, MODINFOMD_KERNEND, sizeof kernend, &kernend); -#if 0 bios_addsmapdata(kfp); -#endif /* Figure out the size and location of the metadata */ *modulep = addr; @@ -237,11 +236,10 @@ bi_load32(char *args, int *howtop, int * bi.bi_bios_geom[i] = bd_getbigeom(i); #endif bi.bi_size = sizeof(bi); + CALLBACK(getmem, &lowmem, &highmem); bi.bi_memsizes_valid = 1; -#if 0 - bi.bi_basemem = bios_basemem / 1024; - bi.bi_extmem = bios_extmem / 1024; -#endif + bi.bi_basemem = 640; + bi.bi_extmem = (lowmem - 0x100000) / 1024; bi.bi_envp = envp; bi.bi_modulep = *modulep; bi.bi_kernend = kernend; @@ -251,7 +249,7 @@ bi_load32(char *args, int *howtop, int * /* * Copy the legacy bootinfo and kernel name to the guest at 0x2000 */ - bi.bi_kernelname = (char *) (0x2000 + sizeof(bi)); + bi.bi_kernelname = 0x2000 + sizeof(bi); CALLBACK(copyin, &bi, 0x2000, sizeof(bi)); CALLBACK(copyin, kernelname, 0x2000 + sizeof(bi), strlen(kernelname) + 1); Modified: head/sys/boot/userboot/userboot/bootinfo64.c ============================================================================== --- head/sys/boot/userboot/userboot/bootinfo64.c Wed Feb 5 02:01:08 2014 (r261503) +++ head/sys/boot/userboot/userboot/bootinfo64.c Wed Feb 5 04:39:03 2014 (r261504) @@ -169,53 +169,6 @@ bi_checkcpu(void) #endif } -struct smap { - uint64_t base; - uint64_t length; - uint32_t type; -} __packed; - -/* From FreeBSD */ -#define SMAP_TYPE_MEMORY 1 - -#define GB (1024UL * 1024 * 1024) - -#define MODINFOMD_SMAP 0x1001 - -static void -bios_addsmapdata(struct preloaded_file *kfp) -{ - uint64_t lowmem, highmem; - int smapnum, len; - struct smap smap[3], *sm; - - CALLBACK(getmem, &lowmem, &highmem); - - sm = &smap[0]; - - sm->base = 0; /* base memory */ - sm->length = 640 * 1024; - sm->type = SMAP_TYPE_MEMORY; - sm++; - - sm->base = 0x100000; /* extended memory */ - sm->length = lowmem - 0x100000; - sm->type = SMAP_TYPE_MEMORY; - sm++; - - smapnum = 2; - - if (highmem != 0) { - sm->base = 4 * GB; - sm->length = highmem; - sm->type = SMAP_TYPE_MEMORY; - smapnum++; - } - - len = smapnum * sizeof (struct smap); - file_addmetadata(kfp, MODINFOMD_SMAP, len, &smap[0]); -} - /* * Load the information expected by an amd64 kernel. * Modified: head/sys/boot/userboot/userboot/elf32_freebsd.c ============================================================================== --- head/sys/boot/userboot/userboot/elf32_freebsd.c Wed Feb 5 02:01:08 2014 (r261503) +++ head/sys/boot/userboot/userboot/elf32_freebsd.c Wed Feb 5 04:39:03 2014 (r261504) @@ -45,6 +45,9 @@ static int elf32_obj_exec(struct preload struct file_format i386_elf = { elf32_loadfile, elf32_exec }; struct file_format i386_elf_obj = { elf32_obj_loadfile, elf32_obj_exec }; +#define GUEST_STACK 0x1000 /* Initial stack base */ +#define GUEST_GDT 0x3000 /* Address of initial GDT */ + /* * There is an ELF kernel and one or more ELF modules loaded. * We wish to start executing the kernel image, so make such @@ -57,7 +60,7 @@ elf32_exec(struct preloaded_file *fp) Elf_Ehdr *ehdr; vm_offset_t entry, bootinfop, modulep, kernend; int boothowto, err, bootdev; - uint32_t stack[1024]; + uint32_t stack[1024], *sp; if ((md = file_findmetadata(fp, MODINFOMD_ELFHDR)) == NULL) @@ -78,16 +81,27 @@ elf32_exec(struct preloaded_file *fp) /* * Build a scratch stack at physical 0x1000 */ - stack[0] = boothowto; - stack[1] = bootdev; - stack[2] = 0; - stack[3] = 0; - stack[4] = 0; - stack[5] = bootinfop; - stack[6] = modulep; - stack[7] = kernend; - CALLBACK(copyin, stack, 0x1000, sizeof(stack)); - CALLBACK(setreg, 4, 0x1000); + memset(stack, 0, sizeof(stack)); + sp = (uint32_t *)((char *)stack + sizeof(stack)); + *--sp = kernend; + *--sp = modulep; + *--sp = bootinfop; + *--sp = 0; + *--sp = 0; + *--sp = 0; + *--sp = bootdev; + *--sp = boothowto; + + /* + * Fake return address to mimic "new" boot blocks. For more + * details see recover_bootinfo in locore.S. + */ + *--sp = 0xbeefface; + CALLBACK(copyin, stack, GUEST_STACK, sizeof(stack)); + CALLBACK(setreg, 4, (char *)sp - (char *)stack + GUEST_STACK); + + CALLBACK(setgdt, GUEST_GDT, 8 * 4 - 1); + CALLBACK(exec, entry); panic("exec returned"); Modified: head/sys/boot/userboot/userboot/libuserboot.h ============================================================================== --- head/sys/boot/userboot/userboot/libuserboot.h Wed Feb 5 02:01:08 2014 (r261503) +++ head/sys/boot/userboot/userboot/libuserboot.h Wed Feb 5 04:39:03 2014 (r261504) @@ -65,3 +65,4 @@ vm_offset_t bi_copyenv(vm_offset_t addr) int bi_load32(char *args, int *howtop, int *bootdevp, vm_offset_t *bip, vm_offset_t *modulep, vm_offset_t *kernend); int bi_load64(char *args, vm_offset_t *modulep, vm_offset_t *kernend); +void bios_addsmapdata(struct preloaded_file *kfp); Modified: head/usr.sbin/bhyveload/bhyveload.c ============================================================================== --- head/usr.sbin/bhyveload/bhyveload.c Wed Feb 5 02:01:08 2014 (r261503) +++ head/usr.sbin/bhyveload/bhyveload.c Wed Feb 5 04:39:03 2014 (r261504) @@ -465,7 +465,12 @@ cb_exec(void *arg, uint64_t rip) { int error; - error = vm_setup_freebsd_registers(ctx, BSP, rip, cr3, gdtbase, rsp); + if (cr3 == 0) + error = vm_setup_freebsd_registers_i386(ctx, BSP, rip, gdtbase, + rsp); + else *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Feb 5 04:50:05 2014 Return-Path: Delivered-To: svn-src-head@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 7BC349C5; Wed, 5 Feb 2014 04:50:05 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4F7D91C28; Wed, 5 Feb 2014 04:50:05 +0000 (UTC) Received: from pippin.baldwin.cx (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 2F719B926; Tue, 4 Feb 2014 23:50:03 -0500 (EST) From: John Baldwin To: src-committers@freebsd.org Subject: Re: svn commit: r261504 - in head: lib/libvmmapi sys/amd64/include sys/amd64/vmm sys/amd64/vmm/intel sys/boot/common sys/boot/userboot/userboot usr.sbin/bhyveload Date: Tue, 04 Feb 2014 23:48:11 -0500 Message-ID: <38657921.L00qfz5YiW@pippin.baldwin.cx> User-Agent: KMail/4.10.5 (FreeBSD/11.0-CURRENT; KDE/4.10.5; amd64; ; ) In-Reply-To: <201402050439.s154d4Uq036793@svn.freebsd.org> References: <201402050439.s154d4Uq036793@svn.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 04 Feb 2014 23:50:03 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2014 04:50:05 -0000 On Wednesday 05 February 2014 04:39:04 John Baldwin wrote: > Author: jhb > Date: Wed Feb 5 04:39:03 2014 > New Revision: 261504 > URL: http://svnweb.freebsd.org/changeset/base/261504 > > Log: > Add support for FreeBSD/i386 guests under bhyve. I have tested both PAE and non-PAE kernels from 10.0-RELEASE, and I believe Peter Grehan has booted a 9.2 i386 kernel. Note that no BIOS support is provided, so i386 kernels running under bhyve are running without any BIOS calls at all. This means that getting EFI working for i386 (as opposed to amd64) should not be as worrisome as some have feared as the i386 kernel does not, in fact, require a BIOS to boot and run, even using the existing entry point. Also, the stack used for the 64-bit exec in userboot has the same misfeature as the old 32-bit exec of pointing the initial stack pointer at the bottom of the stack (instead of just below the top). This works in practice as there isn't anything meaningful in the first page of data that the stack can grow down into. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Feb 5 04:55:55 2014 Return-Path: Delivered-To: svn-src-head@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 466BEBEF; Wed, 5 Feb 2014 04:55:55 +0000 (UTC) Received: from alto.onthenet.com.au (alto.OntheNet.com.au [203.13.68.12]) by mx1.freebsd.org (Postfix) with ESMTP id 02E141C9E; Wed, 5 Feb 2014 04:55:54 +0000 (UTC) Received: from dommail.onthenet.com.au (dommail.OntheNet.com.au [203.13.70.57]) by alto.onthenet.com.au (Postfix) with ESMTPS id E57B911E1F; Wed, 5 Feb 2014 14:55:46 +1000 (EST) Received: from Peters-MacBook-Pro.local (c-67-161-27-37.hsd1.ca.comcast.net [67.161.27.37]) by dommail.onthenet.com.au (MOS 4.2.4-GA) with ESMTP id BRP96221 (AUTH peterg@ptree32.com.au); Wed, 5 Feb 2014 14:55:45 +1000 Message-ID: <52F1C44F.9030807@freebsd.org> Date: Tue, 04 Feb 2014 20:55:43 -0800 From: Peter Grehan User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 MIME-Version: 1.0 To: John Baldwin , src-committers@freebsd.org Subject: Re: svn commit: r261504 - in head: lib/libvmmapi sys/amd64/include sys/amd64/vmm sys/amd64/vmm/intel sys/boot/common sys/boot/userboot/userboot usr.sbin/bhyveload References: <201402050439.s154d4Uq036793@svn.freebsd.org> <38657921.L00qfz5YiW@pippin.baldwin.cx> In-Reply-To: <38657921.L00qfz5YiW@pippin.baldwin.cx> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2014 04:55:55 -0000 > booted a 9.2 i386 kernel. Also, CURRENT/i386 was built from a 10.0/i386 VM and booted. The 8.4/i386 ISO also booted, though the installer had some issues with the geometry reported by virtio block. Some bughunting needed there for those interested. later, Peter. From owner-svn-src-head@FreeBSD.ORG Wed Feb 5 08:02:53 2014 Return-Path: Delivered-To: svn-src-head@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 90C60492; Wed, 5 Feb 2014 08:02:53 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 778481ADB; Wed, 5 Feb 2014 08:02:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1582rQZ018548; Wed, 5 Feb 2014 08:02:53 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1582rib018547; Wed, 5 Feb 2014 08:02:53 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201402050802.s1582rib018547@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 5 Feb 2014 08:02:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261505 - head/sys/dev/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2014 08:02:53 -0000 Author: hselasky Date: Wed Feb 5 08:02:52 2014 New Revision: 261505 URL: http://svnweb.freebsd.org/changeset/base/261505 Log: Fix a regression issue. Contiguous single segment allocations above PAGE_SIZE bytes should only use one USB page structure. Fixes a problem with some external drivers. MFC after: 2 days Modified: head/sys/dev/usb/usb_busdma.c Modified: head/sys/dev/usb/usb_busdma.c ============================================================================== --- head/sys/dev/usb/usb_busdma.c Wed Feb 5 04:39:03 2014 (r261504) +++ head/sys/dev/usb/usb_busdma.c Wed Feb 5 08:02:52 2014 (r261505) @@ -452,7 +452,7 @@ usb_pc_common_mem_cb(void *arg, bus_dma_ goto done; } #endif - while (1) { + while (pc->ismultiseg) { off += USB_PAGE_SIZE; if (off >= (segs->ds_len + rem)) { /* page crossing */ From owner-svn-src-head@FreeBSD.ORG Wed Feb 5 08:09:03 2014 Return-Path: Delivered-To: svn-src-head@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 95DE9841; Wed, 5 Feb 2014 08:09:03 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8080D1B15; Wed, 5 Feb 2014 08:09:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s15893jV019653; Wed, 5 Feb 2014 08:09:03 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s15893Xr019652; Wed, 5 Feb 2014 08:09:03 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201402050809.s15893Xr019652@svn.freebsd.org> From: Kevin Lo Date: Wed, 5 Feb 2014 08:09:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261506 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2014 08:09:03 -0000 Author: kevlo Date: Wed Feb 5 08:09:02 2014 New Revision: 261506 URL: http://svnweb.freebsd.org/changeset/base/261506 Log: Correct setting R92C_TXAGC_MCS11_MCS08 register. Modified: head/sys/dev/usb/wlan/if_urtwn.c Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Wed Feb 5 08:02:52 2014 (r261505) +++ head/sys/dev/usb/wlan/if_urtwn.c Wed Feb 5 08:09:02 2014 (r261506) @@ -2489,7 +2489,7 @@ urtwn_write_txpower(struct urtwn_softc * SM(R92C_TXAGC_MCS07, power[19])); urtwn_bb_write(sc, R92C_TXAGC_MCS11_MCS08(chain), SM(R92C_TXAGC_MCS08, power[20]) | - SM(R92C_TXAGC_MCS08, power[21]) | + SM(R92C_TXAGC_MCS09, power[21]) | SM(R92C_TXAGC_MCS10, power[22]) | SM(R92C_TXAGC_MCS11, power[23])); urtwn_bb_write(sc, R92C_TXAGC_MCS15_MCS12(chain), From owner-svn-src-head@FreeBSD.ORG Wed Feb 5 08:27:04 2014 Return-Path: Delivered-To: svn-src-head@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 07BC2899; Wed, 5 Feb 2014 08:27:03 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A27C51CBE; Wed, 5 Feb 2014 08:27:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s158R3Iu028769; Wed, 5 Feb 2014 08:27:03 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s158R3n8028766; Wed, 5 Feb 2014 08:27:03 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201402050827.s158R3n8028766@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 5 Feb 2014 08:27:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261507 - head/sys/dev/sound/pci/hda X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2014 08:27:04 -0000 Author: hselasky Date: Wed Feb 5 08:27:02 2014 New Revision: 261507 URL: http://svnweb.freebsd.org/changeset/base/261507 Log: Add more quirks for making builtin audio speakers work with more MacBookPro's. Only tested with MacBookPro 9,2. Obtained from: Linux MFC after: 1 week Modified: head/sys/dev/sound/pci/hda/hdaa_patches.c head/sys/dev/sound/pci/hda/hdac.h Modified: head/sys/dev/sound/pci/hda/hdaa_patches.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa_patches.c Wed Feb 5 08:09:02 2014 (r261506) +++ head/sys/dev/sound/pci/hda/hdaa_patches.c Wed Feb 5 08:27:02 2014 (r261507) @@ -107,9 +107,18 @@ static const struct { { APPLE_INTEL_MAC, HDA_CODEC_STAC9221, HDA_MATCH_ALL, 0, 0, HDAA_GPIO_SET(0) | HDAA_GPIO_SET(1) }, + { APPLE_MACBOOKAIR31, HDA_CODEC_CS4206, HDA_MATCH_ALL, + 0, 0, + HDAA_GPIO_SET(1) | HDAA_GPIO_SET(3) }, { APPLE_MACBOOKPRO55, HDA_CODEC_CS4206, HDA_MATCH_ALL, 0, 0, HDAA_GPIO_SET(1) | HDAA_GPIO_SET(3) }, + { APPLE_MACBOOKPRO71, HDA_CODEC_CS4206, HDA_MATCH_ALL, + 0, 0, + HDAA_GPIO_SET(1) | HDAA_GPIO_SET(3) }, + { HDA_INTEL_MACBOOKPRO92, HDA_CODEC_CS4206, HDA_MATCH_ALL, + 0, 0, + HDAA_GPIO_SET(1) | HDAA_GPIO_SET(3) }, { DELL_D630_SUBVENDOR, HDA_CODEC_STAC9205X, HDA_MATCH_ALL, 0, 0, HDAA_GPIO_SET(0) }, Modified: head/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.h Wed Feb 5 08:09:02 2014 (r261506) +++ head/sys/dev/sound/pci/hda/hdac.h Wed Feb 5 08:27:02 2014 (r261507) @@ -58,6 +58,7 @@ #define HDA_INTEL_82801JD HDA_MODEL_CONSTRUCT(INTEL, 0x3a6e) #define HDA_INTEL_PCH HDA_MODEL_CONSTRUCT(INTEL, 0x3b56) #define HDA_INTEL_PCH2 HDA_MODEL_CONSTRUCT(INTEL, 0x3b57) +#define HDA_INTEL_MACBOOKPRO92 HDA_MODEL_CONSTRUCT(INTEL, 0x7270) #define HDA_INTEL_SCH HDA_MODEL_CONSTRUCT(INTEL, 0x811b) #define HDA_INTEL_LPT1 HDA_MODEL_CONSTRUCT(INTEL, 0x8c20) #define HDA_INTEL_LPT2 HDA_MODEL_CONSTRUCT(INTEL, 0x8c21) @@ -266,7 +267,9 @@ * (see HDA_CODEC_STAC9221 below). */ #define APPLE_INTEL_MAC 0x76808384 +#define APPLE_MACBOOKAIR31 0x0d9410de #define APPLE_MACBOOKPRO55 0xcb7910de +#define APPLE_MACBOOKPRO71 0xcb8910de /* LG Electronics */ #define LG_VENDORID 0x1854 From owner-svn-src-head@FreeBSD.ORG Wed Feb 5 08:29:24 2014 Return-Path: Delivered-To: svn-src-head@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 BC9A6DD8; Wed, 5 Feb 2014 08:29:24 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A67151CE1; Wed, 5 Feb 2014 08:29:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s158TOOR029496; Wed, 5 Feb 2014 08:29:24 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s158TOWL029495; Wed, 5 Feb 2014 08:29:24 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201402050829.s158TOWL029495@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 5 Feb 2014 08:29:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261508 - head/sys/dev/sound/pci/hda X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2014 08:29:24 -0000 Author: hselasky Date: Wed Feb 5 08:29:24 2014 New Revision: 261508 URL: http://svnweb.freebsd.org/changeset/base/261508 Log: Use system macro instead of own hand-rolled one. Modified: head/sys/dev/sound/pci/hda/hdaa_patches.c Modified: head/sys/dev/sound/pci/hda/hdaa_patches.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa_patches.c Wed Feb 5 08:27:02 2014 (r261507) +++ head/sys/dev/sound/pci/hda/hdaa_patches.c Wed Feb 5 08:29:24 2014 (r261508) @@ -142,7 +142,6 @@ static const struct { 0, HDAA_QUIRK_OVREF, 0 } }; -#define HDAC_QUIRKS_LEN (sizeof(hdac_quirks) / sizeof(hdac_quirks[0])) static void hdac_pin_patch(struct hdaa_widget *w) @@ -466,7 +465,7 @@ hdaa_patch(struct hdaa_devinfo *devinfo) /* * Quirks */ - for (i = 0; i < HDAC_QUIRKS_LEN; i++) { + for (i = 0; i < nitems(hdac_quirks); i++) { if (!(HDA_DEV_MATCH(hdac_quirks[i].model, subid) && HDA_DEV_MATCH(hdac_quirks[i].id, id) && HDA_DEV_MATCH(hdac_quirks[i].subsystemid, subsystemid))) From owner-svn-src-head@FreeBSD.ORG Wed Feb 5 09:28:02 2014 Return-Path: Delivered-To: svn-src-head@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 B1083BF7; Wed, 5 Feb 2014 09:28:02 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 99768134C; Wed, 5 Feb 2014 09:28:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s159S2Tq054317; Wed, 5 Feb 2014 09:28:02 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s159S2D5054316; Wed, 5 Feb 2014 09:28:02 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201402050928.s159S2D5054316@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Wed, 5 Feb 2014 09:28:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261511 - head/usr.sbin/pwd_mkdb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2014 09:28:02 -0000 Author: des Date: Wed Feb 5 09:28:02 2014 New Revision: 261511 URL: http://svnweb.freebsd.org/changeset/base/261511 Log: Add an example of the most common use case. MFC after: 1 week Modified: head/usr.sbin/pwd_mkdb/pwd_mkdb.8 Modified: head/usr.sbin/pwd_mkdb/pwd_mkdb.8 ============================================================================== --- head/usr.sbin/pwd_mkdb/pwd_mkdb.8 Wed Feb 5 08:42:59 2014 (r261510) +++ head/usr.sbin/pwd_mkdb/pwd_mkdb.8 Wed Feb 5 09:28:02 2014 (r261511) @@ -28,7 +28,7 @@ .\" @(#)pwd_mkdb.8 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd February 28, 2005 +.Dd February 5, 2014 .Dt PWD_MKDB 8 .Os .Sh NAME @@ -143,6 +143,12 @@ The current password file. .It Pa /etc/passwd A Version 7 format password file. .El +.Sh EXAMPLES +Regenerate the password database after manually editing or replacing +the password file: +.Bd -literal -offset -indent +/usr/sbin/pwd_mkdb /etc/master.passwd +.Ed .Sh COMPATIBILITY Previous versions of the system had a program similar to .Nm , From owner-svn-src-head@FreeBSD.ORG Wed Feb 5 14:33:23 2014 Return-Path: Delivered-To: svn-src-head@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 1BDCFB08; Wed, 5 Feb 2014 14:33:23 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DF4DF107E; Wed, 5 Feb 2014 14:33:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s15EXMj8077247; Wed, 5 Feb 2014 14:33:22 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s15EXMUl077246; Wed, 5 Feb 2014 14:33:22 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402051433.s15EXMUl077246@svn.freebsd.org> From: John Baldwin Date: Wed, 5 Feb 2014 14:33:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261512 - head/usr.bin/nfsstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2014 14:33:23 -0000 Author: jhb Date: Wed Feb 5 14:33:22 2014 New Revision: 261512 URL: http://svnweb.freebsd.org/changeset/base/261512 Log: Partially revert r52493 and change client side interval statistics to report the actual number of RPCs issued, not the theoretical number that would be issued if all caching was disabled. Reviewed by: rmacklem MFC after: 2 weeks Modified: head/usr.bin/nfsstat/nfsstat.c Modified: head/usr.bin/nfsstat/nfsstat.c ============================================================================== --- head/usr.bin/nfsstat/nfsstat.c Wed Feb 5 09:28:02 2014 (r261511) +++ head/usr.bin/nfsstat/nfsstat.c Wed Feb 5 14:33:22 2014 (r261512) @@ -604,14 +604,15 @@ sidewaysintpr(u_int interval, int client if (clientOnly) { printf("%s %6d %6d %6d %6d %6d %6d %6d %6d", ((clientOnly && serverOnly) ? "Client:" : ""), - DELTA(attrcache_hits) + DELTA(attrcache_misses), - DELTA(lookupcache_hits) + DELTA(lookupcache_misses), - DELTA(biocache_readlinks), - DELTA(biocache_reads), - DELTA(biocache_writes), - nfsstats.rpccnt[NFSPROC_RENAME]-lastst.rpccnt[NFSPROC_RENAME], - DELTA(accesscache_hits) + DELTA(accesscache_misses), - DELTA(biocache_readdirs) + DELTA(rpccnt[NFSPROC_GETATTR]), + DELTA(rpccnt[NFSPROC_LOOKUP]), + DELTA(rpccnt[NFSPROC_READLINK]), + DELTA(rpccnt[NFSPROC_READ]), + DELTA(rpccnt[NFSPROC_WRITE]), + DELTA(rpccnt[NFSPROC_RENAME]), + DELTA(rpccnt[NFSPROC_ACCESS]), + DELTA(rpccnt[NFSPROC_READDIR]) + + DELTA(rpccnt[NFSPROC_READDIRPLUS]) ); if (widemode) { printf(" %s %s %s %s %s %s", @@ -993,15 +994,15 @@ exp_sidewaysintpr(u_int interval, int cl if (clientOnly) { printf("%s %6d %6d %6d %6d %6d %6d %6d %6d", ((clientOnly && serverOnly) ? "Client:" : ""), - DELTA(attrcache_hits) + DELTA(attrcache_misses), - DELTA(lookupcache_hits) + DELTA(lookupcache_misses), - DELTA(biocache_readlinks), - DELTA(biocache_reads), - DELTA(biocache_writes), - nfsstats.rpccnt[NFSPROC_RENAME] - - lastst.rpccnt[NFSPROC_RENAME], - DELTA(accesscache_hits) + DELTA(accesscache_misses), - DELTA(biocache_readdirs) + DELTA(rpccnt[NFSPROC_GETATTR]), + DELTA(rpccnt[NFSPROC_LOOKUP]), + DELTA(rpccnt[NFSPROC_READLINK]), + DELTA(rpccnt[NFSPROC_READ]), + DELTA(rpccnt[NFSPROC_WRITE]), + DELTA(rpccnt[NFSPROC_RENAME]), + DELTA(rpccnt[NFSPROC_ACCESS]), + DELTA(rpccnt[NFSPROC_READDIR]) + + DELTA(rpccnt[NFSPROC_READDIRPLUS]) ); if (widemode) { printf(" %s %s %s %s %s %s", From owner-svn-src-head@FreeBSD.ORG Wed Feb 5 14:44:28 2014 Return-Path: Delivered-To: svn-src-head@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 96AAC33F; Wed, 5 Feb 2014 14:44:28 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7D92E1188; Wed, 5 Feb 2014 14:44:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s15EiS0q082052; Wed, 5 Feb 2014 14:44:28 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s15EiML0082016; Wed, 5 Feb 2014 14:44:22 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201402051444.s15EiML0082016@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 5 Feb 2014 14:44:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261513 - in head/sys: arm/arm arm/broadcom/bcm2835 arm/freescale/imx arm/mv conf dev/fdt dev/ofw dev/powermac_nvram mips/beri mips/mips powerpc/mambo powerpc/mpc85xx powerpc/ofw powerp... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2014 14:44:28 -0000 Author: nwhitehorn Date: Wed Feb 5 14:44:22 2014 New Revision: 261513 URL: http://svnweb.freebsd.org/changeset/base/261513 Log: Move Open Firmware device root on PowerPC, ARM, and MIPS systems to a sub-node of nexus (ofwbus) rather than direct attach under nexus. This fixes FDT on x86 and will make coexistence with ACPI on ARM systems easier. SPARC is unchanged. Reviewed by: imp, ian Added: head/sys/dev/ofw/ofwbus.c - copied, changed from r261490, head/sys/dev/ofw/ofw_nexus.c Deleted: head/sys/dev/fdt/fdtbus.c head/sys/dev/ofw/ofw_nexus.c head/sys/dev/ofw/ofw_nexus.h Modified: head/sys/arm/arm/nexus.c head/sys/arm/broadcom/bcm2835/bcm2835_fb.c head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c head/sys/arm/freescale/imx/tzic.c head/sys/arm/mv/mv_localbus.c head/sys/arm/mv/mv_pci.c head/sys/conf/files head/sys/conf/files.powerpc head/sys/dev/fdt/simplebus.c head/sys/dev/powermac_nvram/powermac_nvram.c head/sys/mips/beri/beri_simplebus.c head/sys/mips/mips/nexus.c head/sys/powerpc/mambo/mambo.c head/sys/powerpc/mpc85xx/lbc.c head/sys/powerpc/mpc85xx/pci_mpc85xx.c head/sys/powerpc/ofw/ofw_cpu.c head/sys/powerpc/ofw/openpic_ofw.c head/sys/powerpc/powermac/cpcht.c head/sys/powerpc/powermac/grackle.c head/sys/powerpc/powermac/smu.c head/sys/powerpc/powermac/uninorth.c head/sys/powerpc/powermac/uninorthpci.c head/sys/powerpc/powerpc/nexus.c head/sys/powerpc/pseries/rtas_dev.c head/sys/powerpc/pseries/rtas_pci.c head/sys/powerpc/pseries/vdevice.c head/sys/powerpc/pseries/xics.c head/sys/powerpc/psim/iobus.c Modified: head/sys/arm/arm/nexus.c ============================================================================== --- head/sys/arm/arm/nexus.c Wed Feb 5 14:33:22 2014 (r261512) +++ head/sys/arm/arm/nexus.c Wed Feb 5 14:44:22 2014 (r261513) @@ -63,11 +63,11 @@ __FBSDID("$FreeBSD$"); #include "opt_platform.h" #ifdef FDT -#include #include #include #include "ofw_bus_if.h" -#else +#endif + static MALLOC_DEFINE(M_NEXUSDEV, "nexusdev", "Nexus device"); struct nexus_device { @@ -84,7 +84,6 @@ static int nexus_print_child(device_t, d static device_t nexus_add_child(device_t, u_int, const char *, int); static struct resource *nexus_alloc_resource(device_t, device_t, int, int *, u_long, u_long, u_long, u_int); -#endif static int nexus_activate_resource(device_t, device_t, int, int, struct resource *); static int nexus_config_intr(device_t dev, int irq, enum intr_trigger trig, @@ -102,7 +101,6 @@ static int nexus_ofw_map_intr(device_t d #endif static device_method_t nexus_methods[] = { -#ifndef FDT /* Device interface */ DEVMETHOD(device_probe, nexus_probe), DEVMETHOD(device_attach, nexus_attach), @@ -110,7 +108,6 @@ static device_method_t nexus_methods[] = DEVMETHOD(bus_print_child, nexus_print_child), DEVMETHOD(bus_add_child, nexus_add_child), DEVMETHOD(bus_alloc_resource, nexus_alloc_resource), -#endif DEVMETHOD(bus_activate_resource, nexus_activate_resource), DEVMETHOD(bus_config_intr, nexus_config_intr), DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), @@ -123,19 +120,13 @@ static device_method_t nexus_methods[] = }; static devclass_t nexus_devclass; -#ifndef FDT static driver_t nexus_driver = { "nexus", nexus_methods, 1 /* no softc */ }; -#else -DEFINE_CLASS_1(nexus, nexus_driver, nexus_methods, - sizeof(struct ofw_nexus_softc), ofw_nexus_driver); -#endif DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0); -#ifndef FDT static int nexus_probe(device_t dev) { @@ -235,7 +226,6 @@ nexus_alloc_resource(device_t bus, devic return (rv); } -#endif static int nexus_config_intr(device_t dev, int irq, enum intr_trigger trig, Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fb.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_fb.c Wed Feb 5 14:33:22 2014 (r261512) +++ head/sys/arm/broadcom/bcm2835/bcm2835_fb.c Wed Feb 5 14:44:22 2014 (r261513) @@ -361,7 +361,7 @@ static driver_t bcm_fb_driver = { sizeof(struct bcmsc_softc), }; -DRIVER_MODULE(bcm2835fb, nexus, bcm_fb_driver, bcm_fb_devclass, 0, 0); +DRIVER_MODULE(bcm2835fb, ofwbus, bcm_fb_driver, bcm_fb_devclass, 0, 0); /* * Video driver routines and glue. Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Wed Feb 5 14:33:22 2014 (r261512) +++ head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Wed Feb 5 14:44:22 2014 (r261513) @@ -315,4 +315,4 @@ static driver_t bcm_fb_driver = { sizeof(struct bcmsc_softc), }; -DRIVER_MODULE(bcm2835fb, nexus, bcm_fb_driver, bcm_fb_devclass, 0, 0); +DRIVER_MODULE(bcm2835fb, ofwbus, bcm_fb_driver, bcm_fb_devclass, 0, 0); Modified: head/sys/arm/freescale/imx/tzic.c ============================================================================== --- head/sys/arm/freescale/imx/tzic.c Wed Feb 5 14:33:22 2014 (r261512) +++ head/sys/arm/freescale/imx/tzic.c Wed Feb 5 14:44:22 2014 (r261513) @@ -146,9 +146,9 @@ static devclass_t tzic_devclass; /* * Memory space of controller located outside of device range, so let him to - * attach not only to simplebus, but nexus also. + * attach not only to simplebus, but ofwbus also. */ -EARLY_DRIVER_MODULE(tzic, nexus, tzic_driver, tzic_devclass, 0, 0, +EARLY_DRIVER_MODULE(tzic, ofwbus, tzic_driver, tzic_devclass, 0, 0, BUS_PASS_INTERRUPT); EARLY_DRIVER_MODULE(tzic, simplebus, tzic_driver, tzic_devclass, 0, 0, BUS_PASS_INTERRUPT); Modified: head/sys/arm/mv/mv_localbus.c ============================================================================== --- head/sys/arm/mv/mv_localbus.c Wed Feb 5 14:33:22 2014 (r261512) +++ head/sys/arm/mv/mv_localbus.c Wed Feb 5 14:44:22 2014 (r261513) @@ -156,7 +156,7 @@ static struct localbus_bank localbus_ban devclass_t localbus_devclass; -DRIVER_MODULE(localbus, nexus, localbus_driver, localbus_devclass, 0, 0); +DRIVER_MODULE(localbus, ofwbus, localbus_driver, localbus_devclass, 0, 0); static int fdt_localbus_reg_decode(phandle_t node, struct localbus_softc *sc, Modified: head/sys/arm/mv/mv_pci.c ============================================================================== --- head/sys/arm/mv/mv_pci.c Wed Feb 5 14:33:22 2014 (r261512) +++ head/sys/arm/mv/mv_pci.c Wed Feb 5 14:44:22 2014 (r261513) @@ -398,7 +398,7 @@ static driver_t mv_pcib_driver = { devclass_t pcib_devclass; -DRIVER_MODULE(pcib, nexus, mv_pcib_driver, pcib_devclass, 0, 0); +DRIVER_MODULE(pcib, ofwbus, mv_pcib_driver, pcib_devclass, 0, 0); static struct mtx pcicfg_mtx; Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Feb 5 14:33:22 2014 (r261512) +++ head/sys/conf/files Wed Feb 5 14:44:22 2014 (r261513) @@ -1370,7 +1370,6 @@ dev/fdt/fdt_common.c optional fdt dev/fdt/fdt_slicer.c optional fdt cfi | fdt nand dev/fdt/fdt_static_dtb.S optional fdt fdt_dtb_static \ dependency "$S/boot/fdt/dts/${FDT_DTS_FILE}" -dev/fdt/fdtbus.c optional fdtbus dev/fdt/simplebus.c optional fdt dev/fe/if_fe.c optional fe dev/fe/if_fe_pccard.c optional fe pccard @@ -1886,7 +1885,7 @@ dev/ofw/ofw_bus_subr.c optional fdt dev/ofw/ofw_fdt.c optional fdt dev/ofw/ofw_if.m optional fdt dev/ofw/ofw_iicbus.c optional fdt iicbus -dev/ofw/ofw_nexus.c optional fdt +dev/ofw/ofwbus.c optional fdt dev/ofw/openfirm.c optional fdt dev/ofw/openfirmio.c optional fdt dev/patm/if_patm.c optional patm pci Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Wed Feb 5 14:33:22 2014 (r261512) +++ head/sys/conf/files.powerpc Wed Feb 5 14:44:22 2014 (r261513) @@ -48,7 +48,7 @@ dev/ofw/ofw_bus_subr.c optional aim dev/ofw/ofw_console.c optional aim dev/ofw/ofw_disk.c optional ofwd aim dev/ofw/ofw_iicbus.c optional iicbus aim -dev/ofw/ofw_nexus.c optional aim | fdt +dev/ofw/ofwbus.c optional aim | fdt dev/ofw/ofw_standard.c optional aim powerpc dev/powermac_nvram/powermac_nvram.c optional powermac_nvram powermac dev/quicc/quicc_bfe_fdt.c optional quicc mpc85xx Modified: head/sys/dev/fdt/simplebus.c ============================================================================== --- head/sys/dev/fdt/simplebus.c Wed Feb 5 14:33:22 2014 (r261512) +++ head/sys/dev/fdt/simplebus.c Wed Feb 5 14:44:22 2014 (r261513) @@ -121,7 +121,7 @@ static driver_t simplebus_driver = { sizeof(struct simplebus_softc) }; static devclass_t simplebus_devclass; -DRIVER_MODULE(simplebus, nexus, simplebus_driver, simplebus_devclass, 0, 0); +DRIVER_MODULE(simplebus, ofwbus, simplebus_driver, simplebus_devclass, 0, 0); DRIVER_MODULE(simplebus, simplebus, simplebus_driver, simplebus_devclass, 0, 0); static int Copied and modified: head/sys/dev/ofw/ofwbus.c (from r261490, head/sys/dev/ofw/ofw_nexus.c) ============================================================================== --- head/sys/dev/ofw/ofw_nexus.c Tue Feb 4 16:29:30 2014 (r261490, copy source) +++ head/sys/dev/ofw/ofwbus.c Wed Feb 5 14:44:22 2014 (r261513) @@ -49,69 +49,78 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include /* - * The nexus (which is a pseudo-bus actually) iterates over the nodes that + * The ofwbus (which is a pseudo-bus actually) iterates over the nodes that * hang from the Open Firmware root node and adds them as devices to this bus * (except some special nodes which are excluded) so that drivers can be * attached to them. * - * Additionally, interrupt setup/teardown and some resource management are - * done at this level. - * */ -struct nexus_devinfo { +struct ofwbus_devinfo { struct ofw_bus_devinfo ndi_obdinfo; struct resource_list ndi_rl; }; -static device_probe_t nexus_probe; -static device_attach_t nexus_attach; -static bus_print_child_t nexus_print_child; -static bus_add_child_t nexus_add_child; -static bus_probe_nomatch_t nexus_probe_nomatch; -static bus_alloc_resource_t nexus_alloc_resource; -static bus_adjust_resource_t nexus_adjust_resource; -static bus_release_resource_t nexus_release_resource; -static bus_get_resource_list_t nexus_get_resource_list; -static ofw_bus_get_devinfo_t nexus_get_devinfo; - -static int nexus_inlist(const char *, const char *const *); -static struct nexus_devinfo * nexus_setup_dinfo(device_t, phandle_t); -static void nexus_destroy_dinfo(struct nexus_devinfo *); -static int nexus_print_res(struct nexus_devinfo *); +struct ofwbus_softc { + uint32_t acells, scells; + struct rman sc_intr_rman; + struct rman sc_mem_rman; +}; + +static device_identify_t ofwbus_identify; +static device_probe_t ofwbus_probe; +static device_attach_t ofwbus_attach; +static bus_print_child_t ofwbus_print_child; +static bus_add_child_t ofwbus_add_child; +static bus_probe_nomatch_t ofwbus_probe_nomatch; +static bus_alloc_resource_t ofwbus_alloc_resource; +static bus_adjust_resource_t ofwbus_adjust_resource; +static bus_release_resource_t ofwbus_release_resource; +static bus_get_resource_list_t ofwbus_get_resource_list; +static ofw_bus_get_devinfo_t ofwbus_get_devinfo; + +static int ofwbus_inlist(const char *, const char *const *); +static struct ofwbus_devinfo * ofwbus_setup_dinfo(device_t, phandle_t); +static void ofwbus_destroy_dinfo(struct ofwbus_devinfo *); +static int ofwbus_print_res(struct ofwbus_devinfo *); -static device_method_t nexus_methods[] = { +static device_method_t ofwbus_methods[] = { /* Device interface */ - DEVMETHOD(device_probe, nexus_probe), - DEVMETHOD(device_attach, nexus_attach), + DEVMETHOD(device_identify, ofwbus_identify), + DEVMETHOD(device_probe, ofwbus_probe), + DEVMETHOD(device_attach, ofwbus_attach), DEVMETHOD(device_detach, bus_generic_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), DEVMETHOD(device_suspend, bus_generic_suspend), DEVMETHOD(device_resume, bus_generic_resume), /* Bus interface */ - DEVMETHOD(bus_print_child, nexus_print_child), - DEVMETHOD(bus_probe_nomatch, nexus_probe_nomatch), + DEVMETHOD(bus_print_child, ofwbus_print_child), + DEVMETHOD(bus_probe_nomatch, ofwbus_probe_nomatch), DEVMETHOD(bus_read_ivar, bus_generic_read_ivar), DEVMETHOD(bus_write_ivar, bus_generic_write_ivar), - DEVMETHOD(bus_add_child, nexus_add_child), + DEVMETHOD(bus_add_child, ofwbus_add_child), DEVMETHOD(bus_child_pnpinfo_str, ofw_bus_gen_child_pnpinfo_str), - DEVMETHOD(bus_alloc_resource, nexus_alloc_resource), - DEVMETHOD(bus_adjust_resource, nexus_adjust_resource), - DEVMETHOD(bus_release_resource, nexus_release_resource), + DEVMETHOD(bus_alloc_resource, ofwbus_alloc_resource), + DEVMETHOD(bus_adjust_resource, ofwbus_adjust_resource), + DEVMETHOD(bus_release_resource, ofwbus_release_resource), DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource), DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), - DEVMETHOD(bus_get_resource_list, nexus_get_resource_list), + DEVMETHOD(bus_get_resource_list, ofwbus_get_resource_list), + DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), + DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_config_intr, bus_generic_config_intr), + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), /* ofw_bus interface */ - DEVMETHOD(ofw_bus_get_devinfo, nexus_get_devinfo), + DEVMETHOD(ofw_bus_get_devinfo, ofwbus_get_devinfo), DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), DEVMETHOD(ofw_bus_get_model, ofw_bus_gen_get_model), DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), @@ -121,11 +130,16 @@ static device_method_t nexus_methods[] = DEVMETHOD_END }; -DEFINE_CLASS_0(ofw_nexus, ofw_nexus_driver, nexus_methods, - sizeof(struct ofw_nexus_softc)); -MODULE_VERSION(ofw_nexus, 1); +static driver_t ofwbus_driver = { + "ofwbus", + ofwbus_methods, + sizeof(struct ofwbus_softc) +}; +static devclass_t ofwbus_devclass; +DRIVER_MODULE(ofwbus, nexus, ofwbus_driver, ofwbus_devclass, 0, 0); +MODULE_VERSION(ofwbus, 1); -static const char *const nexus_excl_name[] = { +static const char *const ofwbus_excl_name[] = { "FJSV,system", "aliases", "associations", @@ -145,14 +159,14 @@ static const char *const nexus_excl_name NULL }; -static const char *const nexus_excl_type[] = { +static const char *const ofwbus_excl_type[] = { "core", "cpu", NULL }; static int -nexus_inlist(const char *name, const char *const *list) +ofwbus_inlist(const char *name, const char *const *list) { int i; @@ -164,24 +178,35 @@ nexus_inlist(const char *name, const cha return (0); } -#define NEXUS_EXCLUDED(name, type) \ - (nexus_inlist((name), nexus_excl_name) || \ - ((type) != NULL && nexus_inlist((type), nexus_excl_type))) +#define OFWBUS_EXCLUDED(name, type) \ + (ofwbus_inlist((name), ofwbus_excl_name) || \ + ((type) != NULL && ofwbus_inlist((type), ofwbus_excl_type))) + +static void +ofwbus_identify(driver_t *driver, device_t parent) +{ + + /* Check if Open Firmware has been instantiated */ + if (OF_peer(0) == -1) + return; + + if (device_find_child(parent, "ofwbus", -1) == NULL) + BUS_ADD_CHILD(parent, 0, "ofwbus", -1); +} static int -nexus_probe(device_t dev) +ofwbus_probe(device_t dev) { - /* Nexus does always match. */ - device_set_desc(dev, "Open Firmware Nexus device"); - return (0); + device_set_desc(dev, "Open Firmware Device Tree"); + return (BUS_PROBE_NOWILDCARD); } static int -nexus_attach(device_t dev) +ofwbus_attach(device_t dev) { - struct nexus_devinfo *ndi; - struct ofw_nexus_softc *sc; + struct ofwbus_devinfo *ndi; + struct ofwbus_softc *sc; device_t cdev; phandle_t node; @@ -189,6 +214,12 @@ nexus_attach(device_t dev) node = OF_peer(0); + /* + * If no Open Firmware, bail early + */ + if (node == -1) + return (ENXIO); + sc->sc_intr_rman.rm_type = RMAN_ARRAY; sc->sc_intr_rman.rm_descr = "Interrupts"; sc->sc_mem_rman.rm_type = RMAN_ARRAY; @@ -205,12 +236,6 @@ nexus_attach(device_t dev) bus_generic_probe(dev); /* - * If no Open Firmware, bail early - */ - if (node == -1) - return (bus_generic_attach(dev)); - - /* * Some important numbers */ sc->acells = 2; @@ -222,13 +247,13 @@ nexus_attach(device_t dev) * Now walk the OFW tree and attach top-level devices. */ for (node = OF_child(node); node > 0; node = OF_peer(node)) { - if ((ndi = nexus_setup_dinfo(dev, node)) == NULL) + if ((ndi = ofwbus_setup_dinfo(dev, node)) == NULL) continue; cdev = device_add_child(dev, NULL, -1); if (cdev == NULL) { device_printf(dev, "<%s>: device_add_child failed\n", ndi->ndi_obdinfo.obd_name); - nexus_destroy_dinfo(ndi); + ofwbus_destroy_dinfo(ndi); continue; } device_set_ivars(cdev, ndi); @@ -237,10 +262,10 @@ nexus_attach(device_t dev) } static device_t -nexus_add_child(device_t dev, u_int order, const char *name, int unit) +ofwbus_add_child(device_t dev, u_int order, const char *name, int unit) { device_t cdev; - struct nexus_devinfo *ndi; + struct ofwbus_devinfo *ndi; cdev = device_add_child_ordered(dev, order, name, unit); if (cdev == NULL) @@ -255,18 +280,18 @@ nexus_add_child(device_t dev, u_int orde } static int -nexus_print_child(device_t bus, device_t child) +ofwbus_print_child(device_t bus, device_t child) { int rv; rv = bus_print_child_header(bus, child); - rv += nexus_print_res(device_get_ivars(child)); + rv += ofwbus_print_res(device_get_ivars(child)); rv += bus_print_child_footer(bus, child); return (rv); } static void -nexus_probe_nomatch(device_t bus, device_t child) +ofwbus_probe_nomatch(device_t bus, device_t child) { const char *name, *type; @@ -278,16 +303,16 @@ nexus_probe_nomatch(device_t bus, device device_printf(bus, "<%s>", name != NULL ? name : "unknown"); - nexus_print_res(device_get_ivars(child)); + ofwbus_print_res(device_get_ivars(child)); printf(" type %s (no driver attached)\n", type != NULL ? type : "unknown"); } static struct resource * -nexus_alloc_resource(device_t bus, device_t child, int type, int *rid, +ofwbus_alloc_resource(device_t bus, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags) { - struct ofw_nexus_softc *sc; + struct ofwbus_softc *sc; struct rman *rm; struct resource *rv; struct resource_list_entry *rle; @@ -344,17 +369,17 @@ nexus_alloc_resource(device_t bus, devic } static int -nexus_adjust_resource(device_t bus, device_t child __unused, int type, +ofwbus_adjust_resource(device_t bus, device_t child __unused, int type, struct resource *r, u_long start, u_long end) { - struct ofw_nexus_softc *sc; + struct ofwbus_softc *sc; struct rman *rm; - device_t nexus; + device_t ofwbus; - nexus = bus; - while (strcmp(device_get_name(device_get_parent(nexus)), "root") != 0) - nexus = device_get_parent(nexus); - sc = device_get_softc(nexus); + ofwbus = bus; + while (strcmp(device_get_name(device_get_parent(ofwbus)), "root") != 0) + ofwbus = device_get_parent(ofwbus); + sc = device_get_softc(ofwbus); switch (type) { case SYS_RES_IRQ: rm = &sc->sc_intr_rman; @@ -373,7 +398,7 @@ nexus_adjust_resource(device_t bus, devi } static int -nexus_release_resource(device_t bus __unused, device_t child, int type, +ofwbus_release_resource(device_t bus __unused, device_t child, int type, int rid, struct resource *r) { int error; @@ -387,28 +412,28 @@ nexus_release_resource(device_t bus __un } static struct resource_list * -nexus_get_resource_list(device_t bus __unused, device_t child) +ofwbus_get_resource_list(device_t bus __unused, device_t child) { - struct nexus_devinfo *ndi; + struct ofwbus_devinfo *ndi; ndi = device_get_ivars(child); return (&ndi->ndi_rl); } static const struct ofw_bus_devinfo * -nexus_get_devinfo(device_t bus __unused, device_t child) +ofwbus_get_devinfo(device_t bus __unused, device_t child) { - struct nexus_devinfo *ndi; + struct ofwbus_devinfo *ndi; ndi = device_get_ivars(child); return (&ndi->ndi_obdinfo); } -static struct nexus_devinfo * -nexus_setup_dinfo(device_t dev, phandle_t node) +static struct ofwbus_devinfo * +ofwbus_setup_dinfo(device_t dev, phandle_t node) { - struct ofw_nexus_softc *sc; - struct nexus_devinfo *ndi; + struct ofwbus_softc *sc; + struct ofwbus_devinfo *ndi; uint32_t *reg, *intr, icells; uint64_t phys, size; phandle_t iparent; @@ -423,7 +448,7 @@ nexus_setup_dinfo(device_t dev, phandle_ free(ndi, M_DEVBUF); return (NULL); } - if (NEXUS_EXCLUDED(ndi->ndi_obdinfo.obd_name, + if (OFWBUS_EXCLUDED(ndi->ndi_obdinfo.obd_name, ndi->ndi_obdinfo.obd_type)) { ofw_bus_gen_destroy_devinfo(&ndi->ndi_obdinfo); free(ndi, M_DEVBUF); @@ -479,7 +504,7 @@ nexus_setup_dinfo(device_t dev, phandle_ } static void -nexus_destroy_dinfo(struct nexus_devinfo *ndi) +ofwbus_destroy_dinfo(struct ofwbus_devinfo *ndi) { resource_list_free(&ndi->ndi_rl); @@ -488,7 +513,7 @@ nexus_destroy_dinfo(struct nexus_devinfo } static int -nexus_print_res(struct nexus_devinfo *ndi) +ofwbus_print_res(struct ofwbus_devinfo *ndi) { int rv; Modified: head/sys/dev/powermac_nvram/powermac_nvram.c ============================================================================== --- head/sys/dev/powermac_nvram/powermac_nvram.c Wed Feb 5 14:33:22 2014 (r261512) +++ head/sys/dev/powermac_nvram/powermac_nvram.c Wed Feb 5 14:44:22 2014 (r261513) @@ -84,7 +84,7 @@ static driver_t powermac_nvram_driver = static devclass_t powermac_nvram_devclass; -DRIVER_MODULE(powermac_nvram, nexus, powermac_nvram_driver, powermac_nvram_devclass, 0, 0); +DRIVER_MODULE(powermac_nvram, ofwbus, powermac_nvram_driver, powermac_nvram_devclass, 0, 0); /* * Cdev methods. Modified: head/sys/mips/beri/beri_simplebus.c ============================================================================== --- head/sys/mips/beri/beri_simplebus.c Wed Feb 5 14:33:22 2014 (r261512) +++ head/sys/mips/beri/beri_simplebus.c Wed Feb 5 14:44:22 2014 (r261513) @@ -136,7 +136,7 @@ static driver_t simplebus_driver = { devclass_t simplebus_devclass; -DRIVER_MODULE(simplebus, nexus, simplebus_driver, simplebus_devclass, 0, 0); +DRIVER_MODULE(simplebus, ofwbus, simplebus_driver, simplebus_devclass, 0, 0); DRIVER_MODULE(simplebus, simplebus, simplebus_driver, simplebus_devclass, 0, 0); Modified: head/sys/mips/mips/nexus.c ============================================================================== --- head/sys/mips/mips/nexus.c Wed Feb 5 14:33:22 2014 (r261512) +++ head/sys/mips/mips/nexus.c Wed Feb 5 14:44:22 2014 (r261513) @@ -60,10 +60,6 @@ __FBSDID("$FreeBSD$"); #include "opt_platform.h" -#ifdef FDT -#include -#endif - #undef NEXUS_DEBUG #ifdef NEXUS_DEBUG #define dprintf printf @@ -73,7 +69,6 @@ __FBSDID("$FreeBSD$"); #define NUM_MIPS_IRQS 6 -#ifndef FDT static MALLOC_DEFINE(M_NEXUSDEV, "nexusdev", "Nexus device"); struct nexus_device { @@ -102,7 +97,6 @@ static int nexus_release_resource(device struct resource *); static int nexus_set_resource(device_t, device_t, int, int, u_long, u_long); -#endif static int nexus_activate_resource(device_t, device_t, int, int, struct resource *); static int nexus_deactivate_resource(device_t, device_t, int, int, @@ -115,7 +109,6 @@ static int nexus_teardown_intr(device_t, void *); static device_method_t nexus_methods[] = { -#ifndef FDT /* Device interface */ DEVMETHOD(device_probe, nexus_probe), DEVMETHOD(device_attach, nexus_attach), @@ -129,7 +122,6 @@ static device_method_t nexus_methods[] = DEVMETHOD(bus_print_child, nexus_print_child), DEVMETHOD(bus_release_resource, nexus_release_resource), DEVMETHOD(bus_set_resource, nexus_set_resource), -#endif DEVMETHOD(bus_setup_intr, nexus_setup_intr), DEVMETHOD(bus_teardown_intr, nexus_teardown_intr), DEVMETHOD(bus_activate_resource,nexus_activate_resource), @@ -139,19 +131,13 @@ static device_method_t nexus_methods[] = { 0, 0 } }; -#ifndef FDT static driver_t nexus_driver = { "nexus", nexus_methods, 1 /* no softc */ }; -#else -DEFINE_CLASS_1(nexus, nexus_driver, nexus_methods, - sizeof(struct ofw_nexus_softc), ofw_nexus_driver); -#endif static devclass_t nexus_devclass; -#ifndef FDT static int nexus_probe(device_t dev) { @@ -387,7 +373,6 @@ nexus_release_resource(device_t bus, dev return (rman_release_resource(r)); } -#endif static int nexus_activate_resource(device_t bus, device_t child, int type, int rid, Modified: head/sys/powerpc/mambo/mambo.c ============================================================================== --- head/sys/powerpc/mambo/mambo.c Wed Feb 5 14:33:22 2014 (r261512) +++ head/sys/powerpc/mambo/mambo.c Wed Feb 5 14:44:22 2014 (r261513) @@ -75,7 +75,7 @@ static driver_t mambobus_driver = { static devclass_t mambobus_devclass; -DRIVER_MODULE(mambo, nexus, mambobus_driver, mambobus_devclass, 0, 0); +DRIVER_MODULE(mambo, ofwbus, mambobus_driver, mambobus_devclass, 0, 0); static int mambobus_probe(device_t dev) Modified: head/sys/powerpc/mpc85xx/lbc.c ============================================================================== --- head/sys/powerpc/mpc85xx/lbc.c Wed Feb 5 14:33:22 2014 (r261512) +++ head/sys/powerpc/mpc85xx/lbc.c Wed Feb 5 14:44:22 2014 (r261513) @@ -113,7 +113,7 @@ static driver_t lbc_driver = { devclass_t lbc_devclass; -DRIVER_MODULE(lbc, nexus, lbc_driver, lbc_devclass, 0, 0); +DRIVER_MODULE(lbc, ofwbus, lbc_driver, lbc_devclass, 0, 0); /* * Calculate address mask used by OR(n) registers. Use memory region size to Modified: head/sys/powerpc/mpc85xx/pci_mpc85xx.c ============================================================================== --- head/sys/powerpc/mpc85xx/pci_mpc85xx.c Wed Feb 5 14:33:22 2014 (r261512) +++ head/sys/powerpc/mpc85xx/pci_mpc85xx.c Wed Feb 5 14:44:22 2014 (r261513) @@ -170,7 +170,7 @@ static devclass_t fsl_pcib_devclass; DEFINE_CLASS_1(pcib, fsl_pcib_driver, fsl_pcib_methods, sizeof(struct fsl_pcib_softc), ofw_pci_driver); -DRIVER_MODULE(pcib, nexus, fsl_pcib_driver, fsl_pcib_devclass, 0, 0); +DRIVER_MODULE(pcib, ofwbus, fsl_pcib_driver, fsl_pcib_devclass, 0, 0); static int fsl_pcib_probe(device_t dev) Modified: head/sys/powerpc/ofw/ofw_cpu.c ============================================================================== --- head/sys/powerpc/ofw/ofw_cpu.c Wed Feb 5 14:33:22 2014 (r261512) +++ head/sys/powerpc/ofw/ofw_cpu.c Wed Feb 5 14:44:22 2014 (r261513) @@ -74,7 +74,7 @@ static driver_t ofw_cpulist_driver = { static devclass_t ofw_cpulist_devclass; -DRIVER_MODULE(ofw_cpulist, nexus, ofw_cpulist_driver, ofw_cpulist_devclass, +DRIVER_MODULE(ofw_cpulist, ofwbus, ofw_cpulist_driver, ofw_cpulist_devclass, 0, 0); static int Modified: head/sys/powerpc/ofw/openpic_ofw.c ============================================================================== --- head/sys/powerpc/ofw/openpic_ofw.c Wed Feb 5 14:33:22 2014 (r261512) +++ head/sys/powerpc/ofw/openpic_ofw.c Wed Feb 5 14:44:22 2014 (r261513) @@ -93,7 +93,7 @@ static driver_t openpic_ofw_driver = { sizeof(struct openpic_softc), }; -DRIVER_MODULE(openpic, nexus, openpic_ofw_driver, openpic_devclass, 0, 0); +DRIVER_MODULE(openpic, ofwbus, openpic_ofw_driver, openpic_devclass, 0, 0); DRIVER_MODULE(openpic, simplebus, openpic_ofw_driver, openpic_devclass, 0, 0); DRIVER_MODULE(openpic, macio, openpic_ofw_driver, openpic_devclass, 0, 0); Modified: head/sys/powerpc/powermac/cpcht.c ============================================================================== --- head/sys/powerpc/powermac/cpcht.c Wed Feb 5 14:33:22 2014 (r261512) +++ head/sys/powerpc/powermac/cpcht.c Wed Feb 5 14:44:22 2014 (r261513) @@ -135,7 +135,7 @@ struct cpcht_softc { static devclass_t cpcht_devclass; DEFINE_CLASS_1(pcib, cpcht_driver, cpcht_methods, sizeof(struct cpcht_softc), ofw_pci_driver); -DRIVER_MODULE(cpcht, nexus, cpcht_driver, cpcht_devclass, 0, 0); +DRIVER_MODULE(cpcht, ofwbus, cpcht_driver, cpcht_devclass, 0, 0); #define CPCHT_IOPORT_BASE 0xf4000000UL /* Hardwired */ #define CPCHT_IOPORT_SIZE 0x00400000UL Modified: head/sys/powerpc/powermac/grackle.c ============================================================================== --- head/sys/powerpc/powermac/grackle.c Wed Feb 5 14:33:22 2014 (r261512) +++ head/sys/powerpc/powermac/grackle.c Wed Feb 5 14:44:22 2014 (r261513) @@ -102,7 +102,7 @@ static device_method_t grackle_methods[] static devclass_t grackle_devclass; DEFINE_CLASS_1(pcib, grackle_driver, grackle_methods, sizeof(struct grackle_softc), ofw_pci_driver); -DRIVER_MODULE(grackle, nexus, grackle_driver, grackle_devclass, 0, 0); +DRIVER_MODULE(grackle, ofwbus, grackle_driver, grackle_devclass, 0, 0); static int grackle_probe(device_t dev) Modified: head/sys/powerpc/powermac/smu.c ============================================================================== --- head/sys/powerpc/powermac/smu.c Wed Feb 5 14:33:22 2014 (r261512) +++ head/sys/powerpc/powermac/smu.c Wed Feb 5 14:44:22 2014 (r261513) @@ -210,7 +210,7 @@ static driver_t smu_driver = { static devclass_t smu_devclass; -DRIVER_MODULE(smu, nexus, smu_driver, smu_devclass, 0, 0); +DRIVER_MODULE(smu, ofwbus, smu_driver, smu_devclass, 0, 0); static MALLOC_DEFINE(M_SMU, "smu", "SMU Sensor Information"); #define SMU_MAILBOX 0x8000860c Modified: head/sys/powerpc/powermac/uninorth.c ============================================================================== --- head/sys/powerpc/powermac/uninorth.c Wed Feb 5 14:33:22 2014 (r261512) +++ head/sys/powerpc/powermac/uninorth.c Wed Feb 5 14:44:22 2014 (r261513) @@ -143,7 +143,7 @@ static devclass_t unin_chip_devclass; */ static device_t unin_chip; -DRIVER_MODULE(unin, nexus, unin_chip_driver, unin_chip_devclass, 0, 0); +DRIVER_MODULE(unin, ofwbus, unin_chip_driver, unin_chip_devclass, 0, 0); /* * Add an interrupt to the dev's resource list if present Modified: head/sys/powerpc/powermac/uninorthpci.c ============================================================================== --- head/sys/powerpc/powermac/uninorthpci.c Wed Feb 5 14:33:22 2014 (r261512) +++ head/sys/powerpc/powermac/uninorthpci.c Wed Feb 5 14:44:22 2014 (r261513) @@ -98,7 +98,7 @@ static devclass_t uninorth_devclass; DEFINE_CLASS_1(pcib, uninorth_driver, uninorth_methods, sizeof(struct uninorth_softc), ofw_pci_driver); -DRIVER_MODULE(uninorth, nexus, uninorth_driver, uninorth_devclass, 0, 0); +DRIVER_MODULE(uninorth, ofwbus, uninorth_driver, uninorth_devclass, 0, 0); static int uninorth_probe(device_t dev) Modified: head/sys/powerpc/powerpc/nexus.c ============================================================================== --- head/sys/powerpc/powerpc/nexus.c Wed Feb 5 14:33:22 2014 (r261512) +++ head/sys/powerpc/powerpc/nexus.c Wed Feb 5 14:44:22 2014 (r261513) @@ -49,7 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -57,15 +56,12 @@ __FBSDID("$FreeBSD$"); #include /* - * The nexus (which is a pseudo-bus actually) iterates over the nodes that - * hang from the Open Firmware root node and adds them as devices to this bus - * (except some special nodes which are excluded) so that drivers can be - * attached to them. - * - * Additionally, interrupt setup/teardown and some resource management are - * done at this level. + * The nexus handles root-level resource allocation requests and interrupt + * mapping. All direct subdevices of nexus are attached by DEVICE_IDENTIFY(). */ +static device_probe_t nexus_probe; +static device_attach_t nexus_attach; static bus_setup_intr_t nexus_setup_intr; static bus_teardown_intr_t nexus_teardown_intr; static bus_activate_resource_t nexus_activate_resource; @@ -77,7 +73,12 @@ static bus_config_intr_t nexus_config_in static ofw_bus_map_intr_t nexus_ofw_map_intr; static device_method_t nexus_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, nexus_probe), + DEVMETHOD(device_attach, nexus_attach), + /* Bus interface */ + DEVMETHOD(bus_add_child, bus_generic_add_child), DEVMETHOD(bus_activate_resource, nexus_activate_resource), DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), DEVMETHOD(bus_setup_intr, nexus_setup_intr), @@ -95,13 +96,31 @@ static device_method_t nexus_methods[] = static devclass_t nexus_devclass; -DEFINE_CLASS_1(nexus, nexus_driver, nexus_methods, - sizeof(struct ofw_nexus_softc), ofw_nexus_driver); +DEFINE_CLASS_0(nexus, nexus_driver, nexus_methods, 1); EARLY_DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0, BUS_PASS_BUS); MODULE_VERSION(nexus, 1); static int +nexus_probe(device_t dev) +{ + + device_quiet(dev); /* suppress attach message for neatness */ + + return (BUS_PROBE_DEFAULT); +} + +static int +nexus_attach(device_t dev) +{ + + bus_generic_probe(dev); + bus_generic_attach(dev); + + return (0); +} + +static int nexus_setup_intr(device_t bus __unused, device_t child, struct resource *r, int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep) Modified: head/sys/powerpc/pseries/rtas_dev.c ============================================================================== --- head/sys/powerpc/pseries/rtas_dev.c Wed Feb 5 14:33:22 2014 (r261512) +++ head/sys/powerpc/pseries/rtas_dev.c Wed Feb 5 14:44:22 2014 (r261513) @@ -73,7 +73,7 @@ static driver_t rtasdev_driver = { static devclass_t rtasdev_devclass; -DRIVER_MODULE(rtasdev, nexus, rtasdev_driver, rtasdev_devclass, 0, 0); +DRIVER_MODULE(rtasdev, ofwbus, rtasdev_driver, rtasdev_devclass, 0, 0); static int rtasdev_probe(device_t dev) Modified: head/sys/powerpc/pseries/rtas_pci.c ============================================================================== --- head/sys/powerpc/pseries/rtas_pci.c Wed Feb 5 14:33:22 2014 (r261512) +++ head/sys/powerpc/pseries/rtas_pci.c Wed Feb 5 14:44:22 2014 (r261513) @@ -99,7 +99,7 @@ struct rtaspci_softc { static devclass_t rtaspci_devclass; DEFINE_CLASS_1(pcib, rtaspci_driver, rtaspci_methods, sizeof(struct rtaspci_softc), ofw_pci_driver); -DRIVER_MODULE(rtaspci, nexus, rtaspci_driver, rtaspci_devclass, 0, 0); +DRIVER_MODULE(rtaspci, ofwbus, rtaspci_driver, rtaspci_devclass, 0, 0); static int rtaspci_probe(device_t dev) Modified: head/sys/powerpc/pseries/vdevice.c ============================================================================== --- head/sys/powerpc/pseries/vdevice.c Wed Feb 5 14:33:22 2014 (r261512) +++ head/sys/powerpc/pseries/vdevice.c Wed Feb 5 14:44:22 2014 (r261513) @@ -103,7 +103,7 @@ static driver_t vdevice_driver = { static devclass_t vdevice_devclass; -DRIVER_MODULE(vdevice, nexus, vdevice_driver, vdevice_devclass, 0, 0); +DRIVER_MODULE(vdevice, ofwbus, vdevice_driver, vdevice_devclass, 0, 0); static int vdevice_probe(device_t dev) Modified: head/sys/powerpc/pseries/xics.c ============================================================================== --- head/sys/powerpc/pseries/xics.c Wed Feb 5 14:33:22 2014 (r261512) +++ head/sys/powerpc/pseries/xics.c Wed Feb 5 14:44:22 2014 (r261513) @@ -122,9 +122,9 @@ static driver_t xics_driver = { static devclass_t xicp_devclass; static devclass_t xics_devclass; -EARLY_DRIVER_MODULE(xicp, nexus, xicp_driver, xicp_devclass, 0, 0, +EARLY_DRIVER_MODULE(xicp, ofwbus, xicp_driver, xicp_devclass, 0, 0, BUS_PASS_INTERRUPT-1); -EARLY_DRIVER_MODULE(xics, nexus, xics_driver, xics_devclass, 0, 0, +EARLY_DRIVER_MODULE(xics, ofwbus, xics_driver, xics_devclass, 0, 0, BUS_PASS_INTERRUPT); static int Modified: head/sys/powerpc/psim/iobus.c ============================================================================== --- head/sys/powerpc/psim/iobus.c Wed Feb 5 14:33:22 2014 (r261512) +++ head/sys/powerpc/psim/iobus.c Wed Feb 5 14:44:22 2014 (r261513) @@ -116,7 +116,7 @@ static driver_t iobus_driver = { devclass_t iobus_devclass; -DRIVER_MODULE(iobus, nexus, iobus_driver, iobus_devclass, 0, 0); +DRIVER_MODULE(iobus, ofwbus, iobus_driver, iobus_devclass, 0, 0); static int iobus_probe(device_t dev) From owner-svn-src-head@FreeBSD.ORG Wed Feb 5 14:45:00 2014 Return-Path: Delivered-To: svn-src-head@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 0D6024AA; Wed, 5 Feb 2014 14:45:00 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EA40F1196; Wed, 5 Feb 2014 14:44:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s15EixUN082137; Wed, 5 Feb 2014 14:44:59 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s15Eixxa082136; Wed, 5 Feb 2014 14:44:59 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402051444.s15Eixxa082136@svn.freebsd.org> From: John Baldwin Date: Wed, 5 Feb 2014 14:44:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261514 - head/usr.bin/nfsstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2014 14:45:00 -0000 Author: jhb Date: Wed Feb 5 14:44:59 2014 New Revision: 261514 URL: http://svnweb.freebsd.org/changeset/base/261514 Log: Use the DELTA() macro to tidy the server-side interval stats code a bit. MFC after: 2 weeks Modified: head/usr.bin/nfsstat/nfsstat.c Modified: head/usr.bin/nfsstat/nfsstat.c ============================================================================== --- head/usr.bin/nfsstat/nfsstat.c Wed Feb 5 14:44:22 2014 (r261513) +++ head/usr.bin/nfsstat/nfsstat.c Wed Feb 5 14:44:59 2014 (r261514) @@ -1025,24 +1025,15 @@ exp_sidewaysintpr(u_int interval, int cl if (serverOnly) { printf("%s %6d %6d %6d %6d %6d %6d %6d %6d", ((clientOnly && serverOnly) ? "Server:" : ""), - nfsstats.srvrpccnt[NFSV4OP_GETATTR] - - lastst.srvrpccnt[NFSV4OP_GETATTR], - nfsstats.srvrpccnt[NFSV4OP_LOOKUP] - - lastst.srvrpccnt[NFSV4OP_LOOKUP], - nfsstats.srvrpccnt[NFSV4OP_READLINK] - - lastst.srvrpccnt[NFSV4OP_READLINK], - nfsstats.srvrpccnt[NFSV4OP_READ] - - lastst.srvrpccnt[NFSV4OP_READ], - nfsstats.srvrpccnt[NFSV4OP_WRITE] - - lastst.srvrpccnt[NFSV4OP_WRITE], - nfsstats.srvrpccnt[NFSV4OP_RENAME] - - lastst.srvrpccnt[NFSV4OP_RENAME], - nfsstats.srvrpccnt[NFSV4OP_ACCESS] - - lastst.srvrpccnt[NFSV4OP_ACCESS], - (nfsstats.srvrpccnt[NFSV4OP_READDIR] - - lastst.srvrpccnt[NFSV4OP_READDIR]) + - (nfsstats.srvrpccnt[NFSV4OP_READDIRPLUS] - - lastst.srvrpccnt[NFSV4OP_READDIRPLUS])); + DELTA(srvrpccnt[NFSV4OP_GETATTR]), + DELTA(srvrpccnt[NFSV4OP_LOOKUP]), + DELTA(srvrpccnt[NFSV4OP_READLINK]), + DELTA(srvrpccnt[NFSV4OP_READ]), + DELTA(srvrpccnt[NFSV4OP_WRITE]), + DELTA(srvrpccnt[NFSV4OP_RENAME]), + DELTA(srvrpccnt[NFSV4OP_ACCESS]), + DELTA(srvrpccnt[NFSV4OP_READDIR]) + + DELTA(srvrpccnt[NFSV4OP_READDIRPLUS])); printf("\n"); } lastst = nfsstats; From owner-svn-src-head@FreeBSD.ORG Wed Feb 5 16:22:03 2014 Return-Path: Delivered-To: svn-src-head@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 0BD236B6; Wed, 5 Feb 2014 16:22:03 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EA2511B33; Wed, 5 Feb 2014 16:22:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s15GM2c7025201; Wed, 5 Feb 2014 16:22:02 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s15GM22f025200; Wed, 5 Feb 2014 16:22:02 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201402051622.s15GM22f025200@svn.freebsd.org> From: Alexander Motin Date: Wed, 5 Feb 2014 16:22:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261515 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2014 16:22:03 -0000 Author: mav Date: Wed Feb 5 16:22:02 2014 New Revision: 261515 URL: http://svnweb.freebsd.org/changeset/base/261515 Log: Fix I/O freezes in some cases, caused by r257916. Delaying isp_reqodx update, we should be ready to update it every time we read it. Otherwise requests using several indexes may be requeued ndefinitely without ever updating the variable. MFC after: 3 days Modified: head/sys/dev/isp/isp_library.c Modified: head/sys/dev/isp/isp_library.c ============================================================================== --- head/sys/dev/isp/isp_library.c Wed Feb 5 14:44:59 2014 (r261514) +++ head/sys/dev/isp/isp_library.c Wed Feb 5 16:22:02 2014 (r261515) @@ -144,7 +144,9 @@ isp_send_cmd(ispsoftc_t *isp, void *fqe, while (seg < nsegs) { nxtnxt = ISP_NXT_QENTRY(nxt, RQUEST_QUEUE_LEN(isp)); if (nxtnxt == isp->isp_reqodx) { - return (CMD_EAGAIN); + isp->isp_reqodx = ISP_READ(isp, isp->isp_rqstoutrp); + if (nxtnxt == isp->isp_reqodx) + return (CMD_EAGAIN); } ISP_MEMZERO(storage, QENTRY_LEN); qe1 = ISP_QUEUE_ENTRY(isp->isp_rquest, nxt); @@ -2210,7 +2212,9 @@ isp_send_tgt_cmd(ispsoftc_t *isp, void * while (seg < nsegs) { nxtnxt = ISP_NXT_QENTRY(nxt, RQUEST_QUEUE_LEN(isp)); if (nxtnxt == isp->isp_reqodx) { - return (CMD_EAGAIN); + isp->isp_reqodx = ISP_READ(isp, isp->isp_rqstoutrp); + if (nxtnxt == isp->isp_reqodx) + return (CMD_EAGAIN); } ISP_MEMZERO(storage, QENTRY_LEN); qe1 = ISP_QUEUE_ENTRY(isp->isp_rquest, nxt); From owner-svn-src-head@FreeBSD.ORG Wed Feb 5 17:08:55 2014 Return-Path: Delivered-To: svn-src-head@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 A23588E8; Wed, 5 Feb 2014 17:08: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8D30E10E0; Wed, 5 Feb 2014 17:08:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s15H8t6L043451; Wed, 5 Feb 2014 17:08:55 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s15H8tQL043450; Wed, 5 Feb 2014 17:08:55 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201402051708.s15H8tQL043450@svn.freebsd.org> From: Luiz Otavio O Souza Date: Wed, 5 Feb 2014 17:08:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261516 - head/sys/boot/fdt/dts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2014 17:08:55 -0000 Author: loos Date: Wed Feb 5 17:08:55 2014 New Revision: 261516 URL: http://svnweb.freebsd.org/changeset/base/261516 Log: Add the missing ')' at end of sentence. Reword it to use a more common idiom. Reviewed by: imp (on freebsd-embedded@) Approved by: adrian (mentor, implicit) Modified: head/sys/boot/fdt/dts/bindings-gpio.txt Modified: head/sys/boot/fdt/dts/bindings-gpio.txt ============================================================================== --- head/sys/boot/fdt/dts/bindings-gpio.txt Wed Feb 5 16:22:02 2014 (r261515) +++ head/sys/boot/fdt/dts/bindings-gpio.txt Wed Feb 5 17:08:55 2014 (r261516) @@ -82,7 +82,7 @@ dir: flags: 0x0000---- IN_NONE - 0x0001---- IN_POL_LOW Polarity low (inverted input value. + 0x0001---- IN_POL_LOW Polarity low (active-low). 0x0002---- IN_IRQ_EDGE Interrupt, edge triggered. 0x0004---- IN_IRQ_LEVEL Interrupt, level triggered. From owner-svn-src-head@FreeBSD.ORG Wed Feb 5 17:22:55 2014 Return-Path: Delivered-To: svn-src-head@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 4BEFE78D; Wed, 5 Feb 2014 17:22: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1A2D21283; Wed, 5 Feb 2014 17:22:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s15HMsn1051650; Wed, 5 Feb 2014 17:22:54 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s15HMsmn051649; Wed, 5 Feb 2014 17:22:54 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402051722.s15HMsmn051649@svn.freebsd.org> From: John Baldwin Date: Wed, 5 Feb 2014 17:22:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261517 - head/sys/boot/i386/pxeldr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2014 17:22:55 -0000 Author: jhb Date: Wed Feb 5 17:22:54 2014 New Revision: 261517 URL: http://svnweb.freebsd.org/changeset/base/261517 Log: Similar to r130943 for cdboot.S, update the license on this file to a stock 2-clause BSD license. MFC after: 1 week Modified: head/sys/boot/i386/pxeldr/pxeldr.S Modified: head/sys/boot/i386/pxeldr/pxeldr.S ============================================================================== --- head/sys/boot/i386/pxeldr/pxeldr.S Wed Feb 5 17:08:55 2014 (r261516) +++ head/sys/boot/i386/pxeldr/pxeldr.S Wed Feb 5 17:22:54 2014 (r261517) @@ -2,15 +2,26 @@ * Copyright (c) 2000 John Baldwin * All rights reserved. * - * Redistribution and use in source and binary forms are freely - * permitted provided that the above copyright notice and this - * paragraph and the following disclaimer are duplicated in all - * such forms. + * 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 "AS IS" and without any express or - * implied warranties, including, without limitation, the implied - * warranties of merchantability and fitness for a particular - * purpose. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * * $FreeBSD$ */ From owner-svn-src-head@FreeBSD.ORG Wed Feb 5 17:41:01 2014 Return-Path: Delivered-To: svn-src-head@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 2D93A1DB; Wed, 5 Feb 2014 17:41:01 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 002BB1497; Wed, 5 Feb 2014 17:41:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s15Hf0CE059647; Wed, 5 Feb 2014 17:41:00 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s15Hf0f4059646; Wed, 5 Feb 2014 17:41:00 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402051741.s15Hf0f4059646@svn.freebsd.org> From: John Baldwin Date: Wed, 5 Feb 2014 17:41:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261518 - head/share/man/man3 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2014 17:41:01 -0000 Author: jhb Date: Wed Feb 5 17:41:00 2014 New Revision: 261518 URL: http://svnweb.freebsd.org/changeset/base/261518 Log: - Update a few places to account for va_copy(). - Create a separate 'return values' section and move some statements about return values to that section. - Note that each invocation of va_start() and va_copy() must be paired with va_end() in the same function. MFC after: 1 week Modified: head/share/man/man3/stdarg.3 Modified: head/share/man/man3/stdarg.3 ============================================================================== --- head/share/man/man3/stdarg.3 Wed Feb 5 17:22:54 2014 (r261517) +++ head/share/man/man3/stdarg.3 Wed Feb 5 17:41:00 2014 (r261518) @@ -59,7 +59,7 @@ The include file .In stdarg.h declares a type .Pq Em va_list -and defines three macros for stepping +and defines four macros for stepping through a list of arguments whose number and types are not known to the called function. .Pp @@ -77,7 +77,8 @@ The macro initializes .Fa ap for subsequent use by -.Fn va_arg +.Fn va_arg , +.Fn va_copy , and .Fn va_end , and must be called first. @@ -93,10 +94,6 @@ macro, it should not be declared as a re function or an array type. .Pp The -.Fn va_start -macro returns no value. -.Pp -The .Fn va_arg macro expands to an expression that has the type and value of the next argument in the call. @@ -105,7 +102,9 @@ The parameter is the .Em va_list Fa ap initialized by -.Fn va_start . +.Fn va_start +or +.Fn va_copy . Each call to .Fn va_arg modifies @@ -152,18 +151,28 @@ the same number of times as called with .Fa src . .Pp The -.Fn va_copy -macro returns no value. +.Fn va_end +macro cleans up any state associated with the variable argument list +.Fa ap . .Pp -The +Each invocation of +.Fn va_start +or +.Fn va_copy +must be paired with a corresponding invocation of .Fn va_end -macro handles a normal return from the function whose variable argument -list was initialized by -.Fn va_start . +in the same function. +.Sh RETURN VALUES +The +.Fn va_arg +macro returns the value of the next argument. .Pp The +.Fn va_start , +.Fn va_copy , +and .Fn va_end -macro returns no value. +macros return no value. .Sh EXAMPLES The function .Em foo From owner-svn-src-head@FreeBSD.ORG Wed Feb 5 18:11:46 2014 Return-Path: Delivered-To: svn-src-head@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 BF567D4E; Wed, 5 Feb 2014 18:11:46 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AAE351774; Wed, 5 Feb 2014 18:11:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s15IBkRI072426; Wed, 5 Feb 2014 18:11:46 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s15IBkAF072425; Wed, 5 Feb 2014 18:11:46 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402051811.s15IBkAF072425@svn.freebsd.org> From: John Baldwin Date: Wed, 5 Feb 2014 18:11:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261519 - head/sys/x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2014 18:11:46 -0000 Author: jhb Date: Wed Feb 5 18:11:46 2014 New Revision: 261519 URL: http://svnweb.freebsd.org/changeset/base/261519 Log: Move a warning about LINT pins configured with a level trigger under bootverbose. Modified: head/sys/x86/x86/local_apic.c Modified: head/sys/x86/x86/local_apic.c ============================================================================== --- head/sys/x86/x86/local_apic.c Wed Feb 5 17:41:00 2014 (r261518) +++ head/sys/x86/x86/local_apic.c Wed Feb 5 18:11:46 2014 (r261519) @@ -199,7 +199,7 @@ lvt_mode(struct lapic *la, u_int pin, ui case APIC_LVT_DM_SMI: case APIC_LVT_DM_INIT: case APIC_LVT_DM_EXTINT: - if (!lvt->lvt_edgetrigger) { + if (!lvt->lvt_edgetrigger && bootverbose) { printf("lapic%u: Forcing LINT%u to edge trigger\n", la->la_id, pin); value |= APIC_LVT_TM; From owner-svn-src-head@FreeBSD.ORG Wed Feb 5 18:13:32 2014 Return-Path: Delivered-To: svn-src-head@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 DBCEBCE; Wed, 5 Feb 2014 18:13:31 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C22D6178C; Wed, 5 Feb 2014 18:13:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s15IDVXe072880; Wed, 5 Feb 2014 18:13:31 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s15IDRWa072856; Wed, 5 Feb 2014 18:13:27 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402051813.s15IDRWa072856@svn.freebsd.org> From: John Baldwin Date: Wed, 5 Feb 2014 18:13:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261520 - in head: sbin/hastd sys/boot/i386/cdboot sys/dev/pci sys/kern sys/sys sys/x86/acpica sys/x86/include sys/x86/isa sys/x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2014 18:13:32 -0000 Author: jhb Date: Wed Feb 5 18:13:27 2014 New Revision: 261520 URL: http://svnweb.freebsd.org/changeset/base/261520 Log: Drop the 3rd clause from all 3 clause BSD licenses where I am the sole holder to convert them to 2 clause BSD licenses. MFC after: 1 week Modified: head/sbin/hastd/refcnt.h head/sys/boot/i386/cdboot/cdboot.S head/sys/dev/pci/vga_pci.c head/sys/kern/kern_ktr.c head/sys/kern/kern_rwlock.c head/sys/kern/subr_lock.c head/sys/kern/subr_sleepqueue.c head/sys/kern/subr_smp.c head/sys/sys/_rwlock.h head/sys/sys/refcount.h head/sys/sys/rwlock.h head/sys/sys/sleepqueue.h head/sys/sys/turnstile.h head/sys/x86/acpica/madt.c head/sys/x86/include/apicvar.h head/sys/x86/isa/atpic.c head/sys/x86/isa/elcr.c head/sys/x86/x86/intr_machdep.c head/sys/x86/x86/io_apic.c head/sys/x86/x86/mptable_pci.c Modified: head/sbin/hastd/refcnt.h ============================================================================== --- head/sbin/hastd/refcnt.h Wed Feb 5 18:11:46 2014 (r261519) +++ head/sbin/hastd/refcnt.h Wed Feb 5 18:13:27 2014 (r261520) @@ -10,9 +10,6 @@ * 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 author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: head/sys/boot/i386/cdboot/cdboot.S ============================================================================== --- head/sys/boot/i386/cdboot/cdboot.S Wed Feb 5 18:11:46 2014 (r261519) +++ head/sys/boot/i386/cdboot/cdboot.S Wed Feb 5 18:13:27 2014 (r261520) @@ -10,9 +10,6 @@ # 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 author nor the names of any co-contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: head/sys/dev/pci/vga_pci.c ============================================================================== --- head/sys/dev/pci/vga_pci.c Wed Feb 5 18:11:46 2014 (r261519) +++ head/sys/dev/pci/vga_pci.c Wed Feb 5 18:13:27 2014 (r261520) @@ -10,9 +10,6 @@ * 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 author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: head/sys/kern/kern_ktr.c ============================================================================== --- head/sys/kern/kern_ktr.c Wed Feb 5 18:11:46 2014 (r261519) +++ head/sys/kern/kern_ktr.c Wed Feb 5 18:13:27 2014 (r261520) @@ -10,9 +10,6 @@ * 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 author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Wed Feb 5 18:11:46 2014 (r261519) +++ head/sys/kern/kern_rwlock.c Wed Feb 5 18:13:27 2014 (r261520) @@ -10,9 +10,6 @@ * 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 author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: head/sys/kern/subr_lock.c ============================================================================== --- head/sys/kern/subr_lock.c Wed Feb 5 18:11:46 2014 (r261519) +++ head/sys/kern/subr_lock.c Wed Feb 5 18:13:27 2014 (r261520) @@ -10,9 +10,6 @@ * 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 author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: head/sys/kern/subr_sleepqueue.c ============================================================================== --- head/sys/kern/subr_sleepqueue.c Wed Feb 5 18:11:46 2014 (r261519) +++ head/sys/kern/subr_sleepqueue.c Wed Feb 5 18:13:27 2014 (r261520) @@ -10,9 +10,6 @@ * 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 author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: head/sys/kern/subr_smp.c ============================================================================== --- head/sys/kern/subr_smp.c Wed Feb 5 18:11:46 2014 (r261519) +++ head/sys/kern/subr_smp.c Wed Feb 5 18:13:27 2014 (r261520) @@ -10,9 +10,6 @@ * 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 author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: head/sys/sys/_rwlock.h ============================================================================== --- head/sys/sys/_rwlock.h Wed Feb 5 18:11:46 2014 (r261519) +++ head/sys/sys/_rwlock.h Wed Feb 5 18:13:27 2014 (r261520) @@ -10,9 +10,6 @@ * 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 author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: head/sys/sys/refcount.h ============================================================================== --- head/sys/sys/refcount.h Wed Feb 5 18:11:46 2014 (r261519) +++ head/sys/sys/refcount.h Wed Feb 5 18:13:27 2014 (r261520) @@ -10,9 +10,6 @@ * 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 author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: head/sys/sys/rwlock.h ============================================================================== --- head/sys/sys/rwlock.h Wed Feb 5 18:11:46 2014 (r261519) +++ head/sys/sys/rwlock.h Wed Feb 5 18:13:27 2014 (r261520) @@ -10,9 +10,6 @@ * 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 author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: head/sys/sys/sleepqueue.h ============================================================================== --- head/sys/sys/sleepqueue.h Wed Feb 5 18:11:46 2014 (r261519) +++ head/sys/sys/sleepqueue.h Wed Feb 5 18:13:27 2014 (r261520) @@ -10,9 +10,6 @@ * 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 author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: head/sys/sys/turnstile.h ============================================================================== --- head/sys/sys/turnstile.h Wed Feb 5 18:11:46 2014 (r261519) +++ head/sys/sys/turnstile.h Wed Feb 5 18:13:27 2014 (r261520) @@ -10,9 +10,6 @@ * 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 author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: head/sys/x86/acpica/madt.c ============================================================================== --- head/sys/x86/acpica/madt.c Wed Feb 5 18:11:46 2014 (r261519) +++ head/sys/x86/acpica/madt.c Wed Feb 5 18:13:27 2014 (r261520) @@ -10,9 +10,6 @@ * 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 author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: head/sys/x86/include/apicvar.h ============================================================================== --- head/sys/x86/include/apicvar.h Wed Feb 5 18:11:46 2014 (r261519) +++ head/sys/x86/include/apicvar.h Wed Feb 5 18:13:27 2014 (r261520) @@ -10,9 +10,6 @@ * 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 author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: head/sys/x86/isa/atpic.c ============================================================================== --- head/sys/x86/isa/atpic.c Wed Feb 5 18:11:46 2014 (r261519) +++ head/sys/x86/isa/atpic.c Wed Feb 5 18:13:27 2014 (r261520) @@ -10,9 +10,6 @@ * 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 author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: head/sys/x86/isa/elcr.c ============================================================================== --- head/sys/x86/isa/elcr.c Wed Feb 5 18:11:46 2014 (r261519) +++ head/sys/x86/isa/elcr.c Wed Feb 5 18:13:27 2014 (r261520) @@ -10,9 +10,6 @@ * 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 author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: head/sys/x86/x86/intr_machdep.c ============================================================================== --- head/sys/x86/x86/intr_machdep.c Wed Feb 5 18:11:46 2014 (r261519) +++ head/sys/x86/x86/intr_machdep.c Wed Feb 5 18:13:27 2014 (r261520) @@ -10,9 +10,6 @@ * 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 author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: head/sys/x86/x86/io_apic.c ============================================================================== --- head/sys/x86/x86/io_apic.c Wed Feb 5 18:11:46 2014 (r261519) +++ head/sys/x86/x86/io_apic.c Wed Feb 5 18:13:27 2014 (r261520) @@ -10,9 +10,6 @@ * 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 author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: head/sys/x86/x86/mptable_pci.c ============================================================================== --- head/sys/x86/x86/mptable_pci.c Wed Feb 5 18:11:46 2014 (r261519) +++ head/sys/x86/x86/mptable_pci.c Wed Feb 5 18:13:27 2014 (r261520) @@ -10,9 +10,6 @@ * 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 author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE From owner-svn-src-head@FreeBSD.ORG Wed Feb 5 18:16:19 2014 Return-Path: Delivered-To: svn-src-head@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 56BFD24A; Wed, 5 Feb 2014 18:16:19 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 24F8C17AD; Wed, 5 Feb 2014 18:16:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s15IGIi2073397; Wed, 5 Feb 2014 18:16:18 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s15IGIwo073396; Wed, 5 Feb 2014 18:16:18 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201402051816.s15IGIwo073396@svn.freebsd.org> From: Antoine Brodin Date: Wed, 5 Feb 2014 18:16:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261521 - head/tools/build/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2014 18:16:19 -0000 Author: antoine Date: Wed Feb 5 18:16:18 2014 New Revision: 261521 URL: http://svnweb.freebsd.org/changeset/base/261521 Log: Add files to remove WITHOUT_NIS PR: 186412 Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Wed Feb 5 18:13:27 2014 (r261520) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Wed Feb 5 18:16:18 2014 (r261521) @@ -3321,9 +3321,60 @@ OLD_FILES+=usr/bin/nc OLD_FILES+=usr/share/man/man1/nc.1.gz .endif -#.if ${MK_NIS} == no -# to be filled in -#.endif +.if ${MK_NIS} == no +OLD_FILES+=usr/bin/ypcat +OLD_FILES+=usr/bin/ypchfn +OLD_FILES+=usr/bin/ypchpass +OLD_FILES+=usr/bin/ypchsh +OLD_FILES+=usr/bin/ypmatch +OLD_FILES+=usr/bin/yppasswd +OLD_FILES+=usr/bin/ypwhich +OLD_FILES+=usr/include/ypclnt.h +OLD_FILES+=usr/lib/libypclnt.a +OLD_FILES+=usr/lib/libypclnt.so +OLD_LIBS+=usr/lib/libypclnt.so.4 +OLD_FILES+=usr/lib/libypclnt_p.a +.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64" +OLD_FILES+=usr/lib32/libypclnt.a +OLD_FILES+=usr/lib32/libypclnt.so +OLD_LIBS+=usr/lib32/libypclnt.so.4 +OLD_FILES+=usr/lib32/libypclnt_p.a +.endif +OLD_FILES+=usr/libexec/mknetid +OLD_FILES+=usr/libexec/yppwupdate +OLD_FILES+=usr/libexec/ypxfr +OLD_FILES+=usr/sbin/rpc.yppasswdd +OLD_FILES+=usr/sbin/rpc.ypupdated +OLD_FILES+=usr/sbin/rpc.ypxfrd +OLD_FILES+=usr/sbin/yp_mkdb +OLD_FILES+=usr/sbin/ypbind +OLD_FILES+=usr/sbin/ypinit +OLD_FILES+=usr/sbin/yppoll +OLD_FILES+=usr/sbin/yppush +OLD_FILES+=usr/sbin/ypserv +OLD_FILES+=usr/sbin/ypset +OLD_FILES+=usr/share/man/man1/ypcat.1.gz +OLD_FILES+=usr/share/man/man1/ypchfn.1.gz +OLD_FILES+=usr/share/man/man1/ypchpass.1.gz +OLD_FILES+=usr/share/man/man1/ypchsh.1.gz +OLD_FILES+=usr/share/man/man1/ypmatch.1.gz +OLD_FILES+=usr/share/man/man1/yppasswd.1.gz +OLD_FILES+=usr/share/man/man1/ypwhich.1.gz +OLD_FILES+=usr/share/man/man5/netid.5.gz +OLD_FILES+=usr/share/man/man8/mknetid.8.gz +OLD_FILES+=usr/share/man/man8/rpc.yppasswdd.8.gz +OLD_FILES+=usr/share/man/man8/rpc.ypxfrd.8.gz +OLD_FILES+=usr/share/man/man8/yp_mkdb.8.gz +OLD_FILES+=usr/share/man/man8/ypbind.8.gz +OLD_FILES+=usr/share/man/man8/ypinit.8.gz +OLD_FILES+=usr/share/man/man8/yppoll.8.gz +OLD_FILES+=usr/share/man/man8/yppush.8.gz +OLD_FILES+=usr/share/man/man8/ypserv.8.gz +OLD_FILES+=usr/share/man/man8/ypset.8.gz +OLD_FILES+=usr/share/man/man8/ypxfr.8.gz +OLD_FILES+=var/yp/Makefile +OLD_FILES+=var/yp/Makefile.dist +.endif #.if ${MK_NLS} == no # to be filled in From owner-svn-src-head@FreeBSD.ORG Wed Feb 5 18:26:31 2014 Return-Path: Delivered-To: svn-src-head@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 140CC821; Wed, 5 Feb 2014 18:26:31 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F26F01899; Wed, 5 Feb 2014 18:26:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s15IQUIs077378; Wed, 5 Feb 2014 18:26:30 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s15IQUIL077377; Wed, 5 Feb 2014 18:26:30 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201402051826.s15IQUIL077377@svn.freebsd.org> From: Warren Block Date: Wed, 5 Feb 2014 18:26:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261522 - head/sys/boot/i386/gptboot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2014 18:26:31 -0000 Author: wblock (doc committer) Date: Wed Feb 5 18:26:30 2014 New Revision: 261522 URL: http://svnweb.freebsd.org/changeset/base/261522 Log: Describe the use of a freebsd-boot GPT partition, brought up by Scot Hetzel on the -doc mailing list. Also modify the Author section to be clear that I wrote the man page, not gptboot. MFC after: 3 days Modified: head/sys/boot/i386/gptboot/gptboot.8 Modified: head/sys/boot/i386/gptboot/gptboot.8 ============================================================================== --- head/sys/boot/i386/gptboot/gptboot.8 Wed Feb 5 18:16:18 2014 (r261521) +++ head/sys/boot/i386/gptboot/gptboot.8 Wed Feb 5 18:26:30 2014 (r261522) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 3, 2013 +.Dd February 5, 2014 .Dt GPTBOOT 8 .Os .Sh NAME @@ -190,12 +190,18 @@ parameters for the boot blocks .El .Sh EXAMPLES .Nm -is typically installed in combination with a +is installed in a +.Cm freebsd-boot +partition, usually the first partition on the disk. +A .Dq protective MBR .Po see .Xr gpart 8 -.Pc . +.Pc +is typically installed in combination with +.Nm . +.Pp Install .Nm on the @@ -235,4 +241,5 @@ gpart set -a bootonce -i 2 ada0 .Nm appeared in FreeBSD 7.1. .Sh AUTHORS -Warren Block +.An +This manual page written by Warren Block . From owner-svn-src-head@FreeBSD.ORG Wed Feb 5 19:23:05 2014 Return-Path: Delivered-To: svn-src-head@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 D1F8FCCD; Wed, 5 Feb 2014 19:23:05 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BB1111DC6; Wed, 5 Feb 2014 19:23:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s15JN5iB001613; Wed, 5 Feb 2014 19:23:05 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s15JN51o001610; Wed, 5 Feb 2014 19:23:05 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402051923.s15JN51o001610@svn.freebsd.org> From: John Baldwin Date: Wed, 5 Feb 2014 19:23:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261523 - head/sys/dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2014 19:23:05 -0000 Author: jhb Date: Wed Feb 5 19:23:05 2014 New Revision: 261523 URL: http://svnweb.freebsd.org/changeset/base/261523 Log: Fix a typo. Modified: head/sys/dev/pci/pci_subr.c Modified: head/sys/dev/pci/pci_subr.c ============================================================================== --- head/sys/dev/pci/pci_subr.c Wed Feb 5 18:26:30 2014 (r261522) +++ head/sys/dev/pci/pci_subr.c Wed Feb 5 19:23:05 2014 (r261523) @@ -151,7 +151,7 @@ pcib_child_name(device_t child) /* * Some Host-PCI bridge drivers know which resource ranges they can * decode and should only allocate subranges to child PCI devices. - * This API provides a way to manage this. The bridge drive should + * This API provides a way to manage this. The bridge driver should * initialize this structure during attach and call * pcib_host_res_decodes() on each resource range it decodes. It can * then use pcib_host_res_alloc() and pcib_host_res_adjust() as helper From owner-svn-src-head@FreeBSD.ORG Wed Feb 5 19:24:17 2014 Return-Path: Delivered-To: svn-src-head@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 F3A9EF56; Wed, 5 Feb 2014 19:24:16 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DBFFC1DE1; Wed, 5 Feb 2014 19:24:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s15JOGP7001843; Wed, 5 Feb 2014 19:24:16 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s15JOGT7001842; Wed, 5 Feb 2014 19:24:16 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402051924.s15JOGT7001842@svn.freebsd.org> From: John Baldwin Date: Wed, 5 Feb 2014 19:24:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261524 - head/sys/dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2014 19:24:17 -0000 Author: jhb Date: Wed Feb 5 19:24:16 2014 New Revision: 261524 URL: http://svnweb.freebsd.org/changeset/base/261524 Log: Properly set the alignment flags when allocating the initial range for a BAR. This only really matters when pci_do_realloc_bars is enabled and the initial allocation of a specific range fails. MFC after: 1 week Modified: head/sys/dev/pci/pci.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Wed Feb 5 19:23:05 2014 (r261523) +++ head/sys/dev/pci/pci.c Wed Feb 5 19:24:16 2014 (r261524) @@ -2742,7 +2742,7 @@ pci_add_map(device_t bus, device_t dev, struct pci_map *pm; pci_addr_t base, map, testval; pci_addr_t start, end, count; - int barlen, basezero, maprange, mapsize, type; + int barlen, basezero, flags, maprange, mapsize, type; uint16_t cmd; struct resource *res; @@ -2848,6 +2848,9 @@ pci_add_map(device_t bus, device_t dev, } count = (pci_addr_t)1 << mapsize; + flags = RF_ALIGNMENT_LOG2(mapsize); + if (prefetch) + flags |= RF_PREFETCHABLE; if (basezero || base == pci_mapbase(testval)) { start = 0; /* Let the parent decide. */ end = ~0ul; @@ -2864,7 +2867,7 @@ pci_add_map(device_t bus, device_t dev, * pci_alloc_resource(). */ res = resource_list_reserve(rl, bus, dev, type, ®, start, end, count, - prefetch ? RF_PREFETCHABLE : 0); + flags); if (pci_do_realloc_bars && res == NULL && (start != 0 || end != ~0ul)) { /* * If the allocation fails, try to allocate a resource for @@ -2875,7 +2878,7 @@ pci_add_map(device_t bus, device_t dev, resource_list_delete(rl, type, reg); resource_list_add(rl, type, reg, 0, ~0ul, count); res = resource_list_reserve(rl, bus, dev, type, ®, 0, ~0ul, - count, prefetch ? RF_PREFETCHABLE : 0); + count, flags); } if (res == NULL) { /* From owner-svn-src-head@FreeBSD.ORG Wed Feb 5 19:28:23 2014 Return-Path: Delivered-To: svn-src-head@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 33D1E2E7; Wed, 5 Feb 2014 19:28:23 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E18BA1E23; Wed, 5 Feb 2014 19:28:22 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id BCC99B924; Wed, 5 Feb 2014 14:28:20 -0500 (EST) From: John Baldwin To: Doug Ambrisko Subject: Re: svn commit: r261266 - in head: sys/dev/drm sys/kern sys/sys usr.sbin/jail Date: Wed, 05 Feb 2014 14:05:29 -0500 Message-ID: <2362081.WrjYmKeYu9@ralph.baldwin.cx> User-Agent: KMail/4.10.5 (FreeBSD/10.0-STABLE; KDE/4.10.5; amd64; ; ) In-Reply-To: <20140203235336.GA46006@ambrisko.com> References: <201401291341.s0TDfDcB068211@svn.freebsd.org> <52EC4DBB.50804@freebsd.org> <20140203235336.GA46006@ambrisko.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 05 Feb 2014 14:28:20 -0500 (EST) Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, Gleb Smirnoff , Robert Watson , James Gritton , svn-src-head@freebsd.org, Alexander Leidinger X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2014 19:28:23 -0000 On Monday, February 03, 2014 03:53:36 PM Doug Ambrisko wrote: > On Fri, Jan 31, 2014 at 06:28:27PM -0700, James Gritton wrote: > | On 1/31/2014 2:30 PM, Alexander Leidinger wrote: > | > On Fri, 31 Jan 2014 12:34:48 +0000 (GMT) > | > > | > Robert Watson wrote: > | >> On Wed, 29 Jan 2014, Alexander Leidinger wrote: > | >>>> It does. I included a warning in jail.8 that this will pretty > | >>>> much undo jail security. There are still reasons some may want to > | >>>> do this, but it's definitely not for everyone or even most people. > | >>> > | >>> It only "unjails" (= basically the same security level as the > | >>> jail-host with the added benefit of the flexibility of a jail like > | >>> easy moving from one system to another) the jail which has this > | >>> flag set. All other jails without the flag can not "escape" to the > | >>> host. > | >>> > | >>> I also have to add that just setting this flag does not give access > | >>> to the host, you also have to configure a non-default devfs rule > | >>> for this jail (to have the devices appear in the jail). > | >> > | >> This is not correct: devices do not need to be delegated in devfs for > | >> PRIV_IO to allow bypass of the Jail security model, due to sysarch() > | >> and the Linux-emulated equivalent, which turn out direct I/O access > | >> from a user process without use of a device node. > | > > | > Ok, then it is just the non-default flag, not the additional devfs part. > | > > | > I agree with your other post that we are better of to document better > | > what it means if an admin allows kmem access for a specific jail. > | > | I second the documentation route. Yes, it's true that this option > | makes a totally insecure jail - at least one lacking the expected jail > | security additions. But I think that while security is one of the > | primary purposes of jails, it's not the only purpose. It should be > | possible to have a trusted "master jail" that still takes advantage of > | the encapsulation while allowing otherwise unsupported features such > | as a desktop. > | > | The distinction of whether certain devices are required to break out > | of a jail with allow.kmem is something of a red herring - the fact is > | that anyone who wants this level of access is going to have the > | devices in place anyway. > | > | I suppose "obviate" wasn't the best word for the situation. Maybe > | something that starts with "WARNING: ..." is in order. > > It's unfortunate that vimage requires jail. I want to use vimage but > not have the security restrictions of a jail. To do this I patched > jail to basically let everything through. It would be nice to be > able to run jail in an insecure mode which I understand is a contradition. > I do use the jail infrastructure to set the uname*/getosreldate so > that a specific jail thinks it is FreeBSD version blah. Then I can ssh > into that jail and pkg_add things, make ports etc. I use this on > my laptop running current on the base. My other jails run various > versions of FreeBSD. I don't care about security in this case. There are certainly use cases for a "job" (imagine in a compute cluster). Jails have some nice properties in that you can wait6/waitid for a jail, you can forcefully kill an entire jail, and you can apply resource limits to a jail collectively. I think having a "kmem" flag for jails is a hack and not the right approach. It does make a jail useless security-wise, but by masquerading as a flag, it implies that it is only partially violating security which gives a false sense of security. A short term solution that would permit non-security jails without having to do the longer term work that Robert would like might be to add a new per-jail flag that in effect means "no security at all". You would then modify one place (prison_priv_check() in kern_jail.c) to treat a jail with this flag set as if it wasn't jailed at all. This would clearly communicate to a user what they were doing by enabling this flag (jail --root-me-please), and it would also avoid future proliferation of new flags to add more optional and obscure holes in jails. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Feb 5 19:28:30 2014 Return-Path: Delivered-To: svn-src-head@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 585D1449; Wed, 5 Feb 2014 19:28:30 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2F3551E29; Wed, 5 Feb 2014 19:28:30 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 31058B9C5; Wed, 5 Feb 2014 14:28:29 -0500 (EST) From: John Baldwin To: Dag-Erling SmXXrgrav Subject: Re: svn commit: r261511 - head/usr.sbin/pwd_mkdb Date: Wed, 05 Feb 2014 08:47:23 -0500 Message-ID: <2955156.ndxKXjx9F0@ralph.baldwin.cx> User-Agent: KMail/4.10.5 (FreeBSD/10.0-STABLE; KDE/4.10.5; amd64; ; ) In-Reply-To: <201402050928.s159S2D5054316@svn.freebsd.org> References: <201402050928.s159S2D5054316@svn.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 05 Feb 2014 14:28:29 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2014 19:28:30 -0000 On Wednesday, February 05, 2014 09:28:02 AM Dag-Erling SmXXrgrav wrote: > Author: des > Date: Wed Feb 5 09:28:02 2014 > New Revision: 261511 > URL: http://svnweb.freebsd.org/changeset/base/261511 > > Log: > Add an example of the most common use case. > > MFC after: 1 week I've always used -p to update /etc/passwd as well. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Feb 5 19:38:34 2014 Return-Path: Delivered-To: svn-src-head@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 EBA31C74; Wed, 5 Feb 2014 19:38:34 +0000 (UTC) Received: from mail.ambrisko.com (mail.ambrisko.com [70.91.206.90]) by mx1.freebsd.org (Postfix) with ESMTP id A2CCB105D; Wed, 5 Feb 2014 19:38:34 +0000 (UTC) X-Ambrisko-Me: Yes Received: from server2.ambrisko.com (HELO internal.ambrisko.com) ([192.168.1.2]) by ironport.ambrisko.com with ESMTP; 05 Feb 2014 11:43:05 -0800 Received: from ambrisko.com (localhost [127.0.0.1]) by internal.ambrisko.com (8.14.4/8.14.4) with ESMTP id s15JcYbk078275; Wed, 5 Feb 2014 11:38:34 -0800 (PST) (envelope-from ambrisko@ambrisko.com) Received: (from ambrisko@localhost) by ambrisko.com (8.14.4/8.14.4/Submit) id s15JcYEq078274; Wed, 5 Feb 2014 11:38:34 -0800 (PST) (envelope-from ambrisko) Date: Wed, 5 Feb 2014 11:38:34 -0800 From: Doug Ambrisko To: John Baldwin Subject: Re: svn commit: r261266 - in head: sys/dev/drm sys/kern sys/sys usr.sbin/jail Message-ID: <20140205193834.GA75187@ambrisko.com> References: <201401291341.s0TDfDcB068211@svn.freebsd.org> <52EC4DBB.50804@freebsd.org> <20140203235336.GA46006@ambrisko.com> <2362081.WrjYmKeYu9@ralph.baldwin.cx> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2362081.WrjYmKeYu9@ralph.baldwin.cx> User-Agent: Mutt/1.4.2.3i Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, Gleb Smirnoff , Robert Watson , James Gritton , svn-src-head@freebsd.org, Alexander Leidinger X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2014 19:38:35 -0000 On Wed, Feb 05, 2014 at 02:05:29PM -0500, John Baldwin wrote: | On Monday, February 03, 2014 03:53:36 PM Doug Ambrisko wrote: | > On Fri, Jan 31, 2014 at 06:28:27PM -0700, James Gritton wrote: | > | On 1/31/2014 2:30 PM, Alexander Leidinger wrote: | > | > On Fri, 31 Jan 2014 12:34:48 +0000 (GMT) | > | > | > | > Robert Watson wrote: | > | >> On Wed, 29 Jan 2014, Alexander Leidinger wrote: | > | >>>> It does. I included a warning in jail.8 that this will pretty | > | >>>> much undo jail security. There are still reasons some may want to | > | >>>> do this, but it's definitely not for everyone or even most people. | > | >>> | > | >>> It only "unjails" (= basically the same security level as the | > | >>> jail-host with the added benefit of the flexibility of a jail like | > | >>> easy moving from one system to another) the jail which has this | > | >>> flag set. All other jails without the flag can not "escape" to the | > | >>> host. | > | >>> | > | >>> I also have to add that just setting this flag does not give access | > | >>> to the host, you also have to configure a non-default devfs rule | > | >>> for this jail (to have the devices appear in the jail). | > | >> | > | >> This is not correct: devices do not need to be delegated in devfs for | > | >> PRIV_IO to allow bypass of the Jail security model, due to sysarch() | > | >> and the Linux-emulated equivalent, which turn out direct I/O access | > | >> from a user process without use of a device node. | > | > | > | > Ok, then it is just the non-default flag, not the additional devfs part. | > | > | > | > I agree with your other post that we are better of to document better | > | > what it means if an admin allows kmem access for a specific jail. | > | | > | I second the documentation route. Yes, it's true that this option | > | makes a totally insecure jail - at least one lacking the expected jail | > | security additions. But I think that while security is one of the | > | primary purposes of jails, it's not the only purpose. It should be | > | possible to have a trusted "master jail" that still takes advantage of | > | the encapsulation while allowing otherwise unsupported features such | > | as a desktop. | > | | > | The distinction of whether certain devices are required to break out | > | of a jail with allow.kmem is something of a red herring - the fact is | > | that anyone who wants this level of access is going to have the | > | devices in place anyway. | > | | > | I suppose "obviate" wasn't the best word for the situation. Maybe | > | something that starts with "WARNING: ..." is in order. | > | > It's unfortunate that vimage requires jail. I want to use vimage but | > not have the security restrictions of a jail. To do this I patched | > jail to basically let everything through. It would be nice to be | > able to run jail in an insecure mode which I understand is a contradition. | > I do use the jail infrastructure to set the uname*/getosreldate so | > that a specific jail thinks it is FreeBSD version blah. Then I can ssh | > into that jail and pkg_add things, make ports etc. I use this on | > my laptop running current on the base. My other jails run various | > versions of FreeBSD. I don't care about security in this case. | | There are certainly use cases for a "job" (imagine in a compute cluster). | Jails have some nice properties in that you can wait6/waitid for a jail, you | can forcefully kill an entire jail, and you can apply resource limits to a | jail collectively. | | I think having a "kmem" flag for jails is a hack and not the right approach. | It does make a jail useless security-wise, but by masquerading as a flag, it | implies that it is only partially violating security which gives a false sense | of security. | | A short term solution that would permit non-security jails without having to | do the longer term work that Robert would like might be to add a new per-jail | flag that in effect means "no security at all". You would then modify one | place (prison_priv_check() in kern_jail.c) to treat a jail with this flag set | as if it wasn't jailed at all. This would clearly communicate to a user what | they were doing by enabling this flag (jail --root-me-please), and it would | also avoid future proliferation of new flags to add more optional and obscure | holes in jails. That is what my local patch/hack does, first line of prison_priv_check is just to return 0. So no security which is fine for what I use it for. As mentioned the jail infrastructure does have some nice features even with security turned off. Thanks, Doug A. From owner-svn-src-head@FreeBSD.ORG Wed Feb 5 19:56:50 2014 Return-Path: Delivered-To: svn-src-head@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 E382F804; Wed, 5 Feb 2014 19:56:50 +0000 (UTC) Received: from cyrus.watson.org (cyrus.watson.org [198.74.231.69]) by mx1.freebsd.org (Postfix) with ESMTP id B69B5121A; Wed, 5 Feb 2014 19:56:50 +0000 (UTC) Received: from [10.0.1.9] (host31-51-142-185.range31-51.btcentralplus.com [31.51.142.185]) by cyrus.watson.org (Postfix) with ESMTPSA id CDF5746B09; Wed, 5 Feb 2014 14:56:41 -0500 (EST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.1 \(1827\)) Subject: Re: svn commit: r261266 - in head: sys/dev/drm sys/kern sys/sys usr.sbin/jail From: "Robert N. M. Watson" In-Reply-To: <2362081.WrjYmKeYu9@ralph.baldwin.cx> Date: Wed, 5 Feb 2014 19:56:36 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <998DA3CF-C5A2-4492-8DF5-F1BF2451B860@FreeBSD.org> References: <201401291341.s0TDfDcB068211@svn.freebsd.org> <52EC4DBB.50804@freebsd.org> <20140203235336.GA46006@ambrisko.com> <2362081.WrjYmKeYu9@ralph.baldwin.cx> To: John Baldwin X-Mailer: Apple Mail (2.1827) Cc: src-committers@freebsd.org, Doug Ambrisko , svn-src-all@freebsd.org, Gleb Smirnoff , James Gritton , svn-src-head@freebsd.org, Alexander Leidinger X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2014 19:56:51 -0000 On 5 Feb 2014, at 19:05, John Baldwin wrote: > A short term solution that would permit non-security jails without = having to=20 > do the longer term work that Robert would like might be to add a new = per-jail=20 > flag that in effect means "no security at all". You would then modify = one=20 > place (prison_priv_check() in kern_jail.c) to treat a jail with this = flag set=20 > as if it wasn't jailed at all. This would clearly communicate to a = user what=20 > they were doing by enabling this flag (jail --root-me-please), and it = would=20 > also avoid future proliferation of new flags to add more optional and = obscure=20 > holes in jails. One path to this goal would be to better differentiate the idea of a = 'jail' from a more generic notion of a 'container'. I'm a bit loath to = use the latter term due to conflicts with the Linux convention which = uses 'container' to refer to something more like our 'jail', but in many = ways it would be useful. You could imagine having two variations on the = jail(8) command: today's jail(8) with security properties, and a new = container(8) from the same man page, but with only virtualisation, not = security properties. In general, there are two objections being raised here, which I think = you capture well: (1) an architectural concern about appropriate = implementation and its implications, and (2) appropriate = presentation/documentation for the user to prevent the significant = surprise they will get when they turn on an option without understanding = its implications. Robert= From owner-svn-src-head@FreeBSD.ORG Wed Feb 5 20:43:04 2014 Return-Path: Delivered-To: svn-src-head@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 1B3C260A; Wed, 5 Feb 2014 20:43:04 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0451E1764; Wed, 5 Feb 2014 20:43:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s15Kh3Wl034507; Wed, 5 Feb 2014 20:43:03 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s15Kh3et034506; Wed, 5 Feb 2014 20:43:03 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201402052043.s15Kh3et034506@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 5 Feb 2014 20:43:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261525 - head/usr.bin/netstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2014 20:43:04 -0000 Author: bz Date: Wed Feb 5 20:43:03 2014 New Revision: 261525 URL: http://svnweb.freebsd.org/changeset/base/261525 Log: Print the MD5 signature information introduced in r221023 in the TCP statistics output. MFC after: 3 weeks Modified: head/usr.bin/netstat/inet.c Modified: head/usr.bin/netstat/inet.c ============================================================================== --- head/usr.bin/netstat/inet.c Wed Feb 5 19:24:16 2014 (r261524) +++ head/usr.bin/netstat/inet.c Wed Feb 5 20:43:03 2014 (r261525) @@ -723,6 +723,17 @@ tcp_stats(u_long off, const char *name, p(tcps_ecn_ect1, "\t%ju packet%s with ECN ECT(1) bit set\n"); p(tcps_ecn_shs, "\t%ju successful ECN handshake%s\n"); p(tcps_ecn_rcwnd, "\t%ju time%s ECN reduced the congestion window\n"); + + p(tcps_sig_rcvgoodsig, + "\t%ju packet%s with valid tcp-md5 signature received\n"); + p(tcps_sig_rcvbadsig, + "\t%ju packet%s with invalid tcp-md5 signature received\n"); + p(tcps_sig_err_buildsig, + "\t%ju packet%s with tcp-md5 signature mismatch\n"); + p(tcps_sig_err_sigopt, + "\t%ju packet%s with unexpected tcp-md5 signature received\n"); + p(tcps_sig_err_nosigopt, + "\t%ju packet%s without expected tcp-md5 signature received\n"); #undef p #undef p1a #undef p2 From owner-svn-src-head@FreeBSD.ORG Wed Feb 5 20:47:50 2014 Return-Path: Delivered-To: svn-src-head@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 2E9D38E5; Wed, 5 Feb 2014 20:47:50 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 19B4A17A0; Wed, 5 Feb 2014 20:47:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s15KlnEF035346; Wed, 5 Feb 2014 20:47:49 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s15KlnCH035345; Wed, 5 Feb 2014 20:47:49 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402052047.s15KlnCH035345@svn.freebsd.org> From: John Baldwin Date: Wed, 5 Feb 2014 20:47:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261526 - head/sys/dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2014 20:47:50 -0000 Author: jhb Date: Wed Feb 5 20:47:49 2014 New Revision: 261526 URL: http://svnweb.freebsd.org/changeset/base/261526 Log: Simplify pci_reserve_map() by calling resource_list_reserve() to allocate the resource after creating a resource list entry rather than reimplementing it by hand. MFC after: 1 week Modified: head/sys/dev/pci/pci.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Wed Feb 5 20:43:03 2014 (r261525) +++ head/sys/dev/pci/pci.c Wed Feb 5 20:47:49 2014 (r261526) @@ -4177,7 +4177,6 @@ pci_reserve_map(device_t dev, device_t c { struct pci_devinfo *dinfo = device_get_ivars(child); struct resource_list *rl = &dinfo->resources; - struct resource_list_entry *rle; struct resource *res; struct pci_map *pm; pci_addr_t map, testval; @@ -4250,23 +4249,16 @@ pci_reserve_map(device_t dev, device_t c * Allocate enough resource, and then write back the * appropriate BAR for that resource. */ - res = BUS_ALLOC_RESOURCE(device_get_parent(dev), child, type, rid, - start, end, count, flags & ~RF_ACTIVE); + resource_list_add(rl, type, *rid, start, end, count); + res = resource_list_reserve(rl, dev, child, type, rid, start, end, + count, flags & ~RF_ACTIVE); if (res == NULL) { + resource_list_delete(rl, type, *rid); device_printf(child, "%#lx bytes of rid %#x res %d failed (%#lx, %#lx).\n", count, *rid, type, start, end); goto out; } - resource_list_add(rl, type, *rid, start, end, count); - rle = resource_list_find(rl, type, *rid); - if (rle == NULL) - panic("pci_reserve_map: unexpectedly can't find resource."); - rle->res = res; - rle->start = rman_get_start(res); - rle->end = rman_get_end(res); - rle->count = count; - rle->flags = RLE_RESERVED; if (bootverbose) device_printf(child, "Lazy allocation of %#lx bytes rid %#x type %d at %#lx\n", From owner-svn-src-head@FreeBSD.ORG Wed Feb 5 20:52:13 2014 Return-Path: Delivered-To: svn-src-head@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 E7279A9F; Wed, 5 Feb 2014 20:52:12 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C2D7F1849; Wed, 5 Feb 2014 20:52:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s15KqC2p038489; Wed, 5 Feb 2014 20:52:12 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s15KqCgg038487; Wed, 5 Feb 2014 20:52:12 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402052052.s15KqCgg038487@svn.freebsd.org> From: John Baldwin Date: Wed, 5 Feb 2014 20:52:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261527 - head/sys/dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2014 20:52:13 -0000 Author: jhb Date: Wed Feb 5 20:52:12 2014 New Revision: 261527 URL: http://svnweb.freebsd.org/changeset/base/261527 Log: Add two tunables to ignore certain firmware-assigned resources. These are mostly useful for debugging. - hw.pci.clear_bars ignores all firmware-assigned ranges for BARs when set. - hw.pci.clear_pcib ignores all firmware-assigned ranges for PCI-PCI bridge I/O windows when set. MFC after: 1 week Modified: head/sys/dev/pci/pci.c head/sys/dev/pci/pci_pci.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Wed Feb 5 20:47:49 2014 (r261526) +++ head/sys/dev/pci/pci.c Wed Feb 5 20:52:12 2014 (r261527) @@ -332,6 +332,11 @@ SYSCTL_INT(_hw_pci, OID_AUTO, usb_early_ Disable this if you depend on BIOS emulation of USB devices, that is\n\ you use USB devices (like keyboard or mouse) but do not load USB drivers"); +static int pci_clear_bars; +TUNABLE_INT("hw.pci.clear_bars", &pci_clear_bars); +SYSCTL_INT(_hw_pci, OID_AUTO, clear_bars, CTLFLAG_RDTUN, &pci_clear_bars, 0, + "Ignore firmware-assigned resources for BARs."); + static int pci_has_quirk(uint32_t devid, int quirk) { @@ -2851,7 +2856,7 @@ pci_add_map(device_t bus, device_t dev, flags = RF_ALIGNMENT_LOG2(mapsize); if (prefetch) flags |= RF_PREFETCHABLE; - if (basezero || base == pci_mapbase(testval)) { + if (basezero || base == pci_mapbase(testval) || pci_clear_bars) { start = 0; /* Let the parent decide. */ end = ~0ul; } else { Modified: head/sys/dev/pci/pci_pci.c ============================================================================== --- head/sys/dev/pci/pci_pci.c Wed Feb 5 20:47:49 2014 (r261526) +++ head/sys/dev/pci/pci_pci.c Wed Feb 5 20:52:12 2014 (r261527) @@ -103,6 +103,12 @@ DEFINE_CLASS_0(pcib, pcib_driver, pcib_m DRIVER_MODULE(pcib, pci, pcib_driver, pcib_devclass, NULL, NULL); #ifdef NEW_PCIB +SYSCTL_DECL(_hw_pci); + +static int pci_clear_pcib; +TUNABLE_INT("hw.pci.clear_pcib", &pci_clear_pcib); +SYSCTL_INT(_hw_pci, OID_AUTO, clear_pcib, CTLFLAG_RDTUN, &pci_clear_pcib, 0, + "Clear firmware-assigned resources for PCI-PCI bridge I/O windows."); /* * Is a resource from a child device sub-allocated from one of our @@ -416,6 +422,19 @@ pcib_probe_windows(struct pcib_softc *sc dev = sc->dev; + if (pci_clear_pcib) { + pci_write_config(dev, PCIR_IOBASEL_1, 0xff, 1); + pci_write_config(dev, PCIR_IOBASEH_1, 0xffff, 2); + pci_write_config(dev, PCIR_IOLIMITL_1, 0, 1); + pci_write_config(dev, PCIR_IOLIMITH_1, 0, 2); + pci_write_config(dev, PCIR_MEMBASE_1, 0xffff, 2); + pci_write_config(dev, PCIR_MEMLIMIT_1, 0, 2); + pci_write_config(dev, PCIR_PMBASEL_1, 0xffff, 2); + pci_write_config(dev, PCIR_PMBASEH_1, 0xffffffff, 4); + pci_write_config(dev, PCIR_PMLIMITL_1, 0, 2); + pci_write_config(dev, PCIR_PMLIMITH_1, 0, 4); + } + /* Determine if the I/O port window is implemented. */ val = pci_read_config(dev, PCIR_IOBASEL_1, 1); if (val == 0) { From owner-svn-src-head@FreeBSD.ORG Wed Feb 5 22:21:09 2014 Return-Path: Delivered-To: svn-src-head@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 59F31CC0; Wed, 5 Feb 2014 22:21:09 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4529D1140; Wed, 5 Feb 2014 22:21:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s15ML9o4075519; Wed, 5 Feb 2014 22:21:09 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s15ML8aj075517; Wed, 5 Feb 2014 22:21:08 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201402052221.s15ML8aj075517@svn.freebsd.org> From: Marius Strobl Date: Wed, 5 Feb 2014 22:21:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261528 - head/sys/dev/ed X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2014 22:21:09 -0000 Author: marius Date: Wed Feb 5 22:21:08 2014 New Revision: 261528 URL: http://svnweb.freebsd.org/changeset/base/261528 Log: Add bus space barriers for page switches missed in r260050. Modified: head/sys/dev/ed/if_ed.c head/sys/dev/ed/if_ed_hpp.c Modified: head/sys/dev/ed/if_ed.c ============================================================================== --- head/sys/dev/ed/if_ed.c Wed Feb 5 20:52:12 2014 (r261527) +++ head/sys/dev/ed/if_ed.c Wed Feb 5 22:21:08 2014 (r261528) @@ -420,7 +420,11 @@ ed_stop_hw(struct ed_softc *sc) /* * Stop everything on the interface, and select page 0 registers. */ + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_STP); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); /* * Wait for interface to enter stopped state, but limit # of checks to @@ -528,7 +532,11 @@ ed_init_locked(struct ed_softc *sc) /* * Set interface for page 0, Remote DMA complete, Stopped */ + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_STP); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); if (sc->isa16bit) /* @@ -649,7 +657,11 @@ ed_xmit(struct ed_softc *sc) /* * Set NIC for page 0 register access */ + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_STA); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); /* * Set TX buffer start page @@ -666,7 +678,11 @@ ed_xmit(struct ed_softc *sc) /* * Set page 0, Remote DMA complete, Transmit Packet, and *Start* */ + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_TXP | ED_CR_STA); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); sc->xmit_busy = 1; /* @@ -913,7 +929,11 @@ ed_rint(struct ed_softc *sc) /* * Set NIC to page 0 registers to update boundry register */ + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_STA); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_BNRY, boundry); /* @@ -947,7 +967,11 @@ edintr(void *arg) /* * Set NIC to page 0 registers */ + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_STA); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); /* * loop until there are no more new interrupts. When the card goes @@ -1165,7 +1189,11 @@ edintr(void *arg) * set in the transmit routine, is *okay* - it is 'edge' * triggered from low to high) */ + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_STA); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); /* * If the Network Talley Counters overflow, read them to reset @@ -1367,7 +1395,11 @@ ed_pio_readmem(struct ed_softc *sc, bus_ { /* Regular Novell cards */ /* select page 0 registers */ + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, ED_CR_RD2 | ED_CR_STA); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); /* round up to a word */ if (amount & 1) @@ -1400,7 +1432,11 @@ ed_pio_writemem(struct ed_softc *sc, uin int maxwait = 200; /* about 240us */ /* select page 0 registers */ + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, ED_CR_RD2 | ED_CR_STA); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); /* reset remote DMA complete flag */ ed_nic_outb(sc, ED_P0_ISR, ED_ISR_RDC); @@ -1457,7 +1493,11 @@ ed_pio_write_mbufs(struct ed_softc *sc, dma_len++; /* select page 0 registers */ + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, ED_CR_RD2 | ED_CR_STA); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); /* reset remote DMA complete flag */ ed_nic_outb(sc, ED_P0_ISR, ED_ISR_RDC); @@ -1587,7 +1627,11 @@ ed_setrcr(struct ed_softc *sc) * runts and packets with CRC & alignment errors. */ /* Set page 0 registers */ + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_STP); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_RCR, ED_RCR_PRO | ED_RCR_AM | ED_RCR_AB | ED_RCR_AR | ED_RCR_SEP | reg1); @@ -1609,7 +1653,11 @@ ed_setrcr(struct ed_softc *sc) ed_nic_outb(sc, ED_P1_MAR(i), ((u_char *) mcaf)[i]); /* Set page 0 registers */ + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_STP); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_RCR, ED_RCR_AM | ED_RCR_AB | reg1); } else { @@ -1622,6 +1670,8 @@ ed_setrcr(struct ed_softc *sc) ed_nic_outb(sc, ED_P1_MAR(i), 0x00); /* Set page 0 registers */ + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_STP); ed_nic_outb(sc, ED_P0_RCR, ED_RCR_AB | reg1); Modified: head/sys/dev/ed/if_ed_hpp.c ============================================================================== --- head/sys/dev/ed/if_ed_hpp.c Wed Feb 5 20:52:12 2014 (r261527) +++ head/sys/dev/ed/if_ed_hpp.c Wed Feb 5 22:21:08 2014 (r261528) @@ -565,7 +565,11 @@ ed_hpp_write_mbufs(struct ed_softc *sc, int use_32bit_accesses = !(sc->hpp_id & ED_HPP_ID_16_BIT_ACCESS); /* select page 0 registers */ + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_STA); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); /* reset remote DMA complete flag */ ed_nic_outb(sc, ED_P0_ISR, ED_ISR_RDC); From owner-svn-src-head@FreeBSD.ORG Wed Feb 5 22:27:50 2014 Return-Path: Delivered-To: svn-src-head@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 11723D2; Wed, 5 Feb 2014 22:27:50 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E2C5F11E0; Wed, 5 Feb 2014 22:27:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s15MRnQS076836; Wed, 5 Feb 2014 22:27:49 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s15MRnKl076835; Wed, 5 Feb 2014 22:27:49 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201402052227.s15MRnKl076835@svn.freebsd.org> From: Marius Strobl Date: Wed, 5 Feb 2014 22:27:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261529 - head/sys/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2014 22:27:50 -0000 Author: marius Date: Wed Feb 5 22:27:49 2014 New Revision: 261529 URL: http://svnweb.freebsd.org/changeset/base/261529 Log: Try to make the style used here consistent. Modified: head/sys/pci/if_rlreg.h Modified: head/sys/pci/if_rlreg.h ============================================================================== --- head/sys/pci/if_rlreg.h Wed Feb 5 22:21:08 2014 (r261528) +++ head/sys/pci/if_rlreg.h Wed Feb 5 22:27:49 2014 (r261529) @@ -163,7 +163,6 @@ #define RL_LOOPTEST_ON_CPLUS 0x00060000 /* Known revision codes. */ - #define RL_HWREV_8169 0x00000000 #define RL_HWREV_8169S 0x00800000 #define RL_HWREV_8110S 0x04000000 @@ -329,8 +328,8 @@ #define RL_RXSTAT_INDIV 0x00004000 #define RL_RXSTAT_MULTI 0x00008000 #define RL_RXSTAT_LENMASK 0xFFFF0000 +#define RL_RXSTAT_UNFINISHED 0x0000FFF0 /* DMA still in progress */ -#define RL_RXSTAT_UNFINISHED 0xFFF0 /* DMA still in progress */ /* * Command register. */ @@ -361,6 +360,7 @@ #define RL_PARA7C 0x7C #define RL_PARA7C_DEF 0xcb38de43 #define RL_PARA7C_RETUNE 0xfb38de03 + /* * EEPROM control register */ @@ -473,11 +473,9 @@ */ /* RL_DUMPSTATS_LO register */ - #define RL_DUMPSTATS_START 0x00000008 /* Transmit start register */ - #define RL_TXSTART_SWI 0x01 /* generate TX interrupt */ #define RL_TXSTART_START 0x40 /* start normal queue transmit */ #define RL_TXSTART_HPRIO_START 0x80 /* start hi prio queue transmit */ @@ -496,7 +494,6 @@ #define RL_BUSWIDTH_64BITS 0x08 /* C+ mode command register */ - #define RL_CPLUSCMD_TXENB 0x0001 /* enable C+ transmit mode */ #define RL_CPLUSCMD_RXENB 0x0002 /* enable C+ receive mode */ #define RL_CPLUSCMD_PCI_MRW 0x0008 /* enable PCI multi-read/write */ @@ -514,7 +511,6 @@ #define RL_CPLUSCMD_BIST_ENB 0x8000 /* 8168C/CP */ /* C+ early transmit threshold */ - #define RL_EARLYTXTHRESH_CNT 0x003F /* byte count times 8 */ /* Timer interrupt register */ @@ -528,7 +524,6 @@ /* * Gigabit PHY access register (8169 only) */ - #define RL_PHYAR_PHYDATA 0x0000FFFF #define RL_PHYAR_PHYREG 0x001F0000 #define RL_PHYAR_BUSY 0x80000000 @@ -559,7 +554,6 @@ * For reception, there's just one large buffer where the chip stores * all received packets. */ - #define RL_RX_BUF_SZ RL_RXBUF_64 #define RL_RXBUFLEN (1 << ((RL_RX_BUF_SZ >> 11) + 13)) #define RL_TX_LIST_CNT 4 @@ -642,11 +636,10 @@ struct rl_hwrev { /* * RX/TX descriptor definition. When large send mode is enabled, the - * lower 11 bits of the TX rl_cmd word are used to hold the MSS, and + * lower 11 bits of the TX rl_cmdstat word are used to hold the MSS, and * the checksum offload bits are disabled. The structure layout is * the same for RX and TX descriptors */ - struct rl_desc { uint32_t rl_cmdstat; uint32_t rl_vlanctl; @@ -679,7 +672,6 @@ struct rl_desc { * Error bits are valid only on the last descriptor of a frame * (i.e. RL_TDESC_CMD_EOF == 1) */ - #define RL_TDESC_STAT_COLCNT 0x000F0000 /* collision count */ #define RL_TDESC_STAT_EXCESSCOL 0x00100000 /* excessive collisions */ #define RL_TDESC_STAT_LINKFAIL 0x00200000 /* link faulure */ @@ -691,7 +683,6 @@ struct rl_desc { /* * RX descriptor cmd/vlan definitions */ - #define RL_RDESC_CMD_EOR 0x40000000 #define RL_RDESC_CMD_OWN 0x80000000 #define RL_RDESC_CMD_BUFLEN 0x00001FFF From owner-svn-src-head@FreeBSD.ORG Wed Feb 5 22:54:00 2014 Return-Path: Delivered-To: svn-src-head@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 2F63FE31; Wed, 5 Feb 2014 22:54:00 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1AB711451; Wed, 5 Feb 2014 22:54:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s15MrxHm088248; Wed, 5 Feb 2014 22:53:59 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s15MrxeW088244; Wed, 5 Feb 2014 22:53:59 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201402052253.s15MrxeW088244@svn.freebsd.org> From: Ian Lepore Date: Wed, 5 Feb 2014 22:53:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261530 - head/lib/libstand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2014 22:54:00 -0000 Author: ian Date: Wed Feb 5 22:53:58 2014 New Revision: 261530 URL: http://svnweb.freebsd.org/changeset/base/261530 Log: Set the malloc alignment to 64 bytes on platforms that use the U-Boot API device drivers. Recent versions of u-boot run with the MMU enabled, and require DMA-based I/O to be aligned to cache line boundaries. These changes are based on a patch originally submitted by Juergen Weiss, but I reworked them and thus any problems are purely my fault. Submitted by: "Juergen Weiss" Reviewed by: imp, nwhitehorn, jhb Modified: head/lib/libstand/sbrk.c head/lib/libstand/zalloc.c head/lib/libstand/zalloc_defs.h head/lib/libstand/zalloc_mem.h Modified: head/lib/libstand/sbrk.c ============================================================================== --- head/lib/libstand/sbrk.c Wed Feb 5 22:27:49 2014 (r261529) +++ head/lib/libstand/sbrk.c Wed Feb 5 22:53:58 2014 (r261530) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include "stand.h" +#include "zalloc_defs.h" static size_t maxheap, heapsize = 0; static void *heapbase; @@ -40,8 +41,9 @@ static void *heapbase; void setheap(void *base, void *top) { - /* Align start address to 16 bytes for the malloc code. Sigh. */ - heapbase = (void *)(((uintptr_t)base + 15) & ~15); + /* Align start address for the malloc code. Sigh. */ + heapbase = (void *)(((uintptr_t)base + MALLOCALIGN_MASK) & + ~MALLOCALIGN_MASK); maxheap = (char *)top - (char *)heapbase; } Modified: head/lib/libstand/zalloc.c ============================================================================== --- head/lib/libstand/zalloc.c Wed Feb 5 22:27:49 2014 (r261529) +++ head/lib/libstand/zalloc.c Wed Feb 5 22:53:58 2014 (r261530) @@ -71,6 +71,15 @@ __FBSDID("$FreeBSD$"); #include "zalloc_defs.h" /* + * Objects in the pool must be aligned to at least the size of struct MemNode. + * They must also be aligned to MALLOCALIGN, which should normally be larger + * than the struct, so assert that to be so at compile time. + */ +typedef char assert_align[(sizeof(struct MemNode) <= MALLOCALIGN) ? 1 : -1]; + +#define MEMNODE_SIZE_MASK MALLOCALIGN_MASK + +/* * znalloc() - allocate memory (without zeroing) from pool. Call reclaim * and retry if appropriate, return NULL if unable to allocate * memory. Modified: head/lib/libstand/zalloc_defs.h ============================================================================== --- head/lib/libstand/zalloc_defs.h Wed Feb 5 22:27:49 2014 (r261529) +++ head/lib/libstand/zalloc_defs.h Wed Feb 5 22:53:58 2014 (r261530) @@ -52,18 +52,26 @@ #define BLKEXTENDMASK (BLKEXTEND - 1) /* - * required malloc alignment. Just hardwire to 16. + * Required malloc alignment. * - * Note: if we implement a more sophisticated realloc, we should ensure that - * MALLOCALIGN is at least as large as MemNode. + * Embedded platforms using the u-boot API drivers require that all I/O buffers + * be on a cache line sized boundary. The worst case size for that is 64 bytes. + * For other platforms, 16 bytes works fine. The alignment also must be at + * least sizeof(struct MemNode); this is asserted in zalloc.c. */ +#if defined(__arm__) || defined(__mips__) || defined(__powerpc__) +#define MALLOCALIGN 64 +#else +#define MALLOCALIGN 16 +#endif +#define MALLOCALIGN_MASK (MALLOCALIGN - 1) + typedef struct Guard { size_t ga_Bytes; size_t ga_Magic; /* must be at least 32 bits */ } Guard; -#define MALLOCALIGN 16 #define GAMAGIC 0x55FF44FD #define GAFREE 0x5F54F4DF Modified: head/lib/libstand/zalloc_mem.h ============================================================================== --- head/lib/libstand/zalloc_mem.h Wed Feb 5 22:27:49 2014 (r261529) +++ head/lib/libstand/zalloc_mem.h Wed Feb 5 22:53:58 2014 (r261530) @@ -48,8 +48,6 @@ typedef struct MemPool { uintptr_t mp_Used; } MemPool; -#define MEMNODE_SIZE_MASK ((sizeof(MemNode) <= 8) ? 7 : 15) - #define ZNOTE_FREE 0 #define ZNOTE_REUSE 1 From owner-svn-src-head@FreeBSD.ORG Wed Feb 5 23:13:41 2014 Return-Path: Delivered-To: svn-src-head@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 51FCC7D8; Wed, 5 Feb 2014 23:13:41 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2F7C21601; Wed, 5 Feb 2014 23:13:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s15NDfBJ096867; Wed, 5 Feb 2014 23:13:41 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s15NDe5M096864; Wed, 5 Feb 2014 23:13:40 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201402052313.s15NDe5M096864@svn.freebsd.org> From: Marius Strobl Date: Wed, 5 Feb 2014 23:13:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261531 - in head/sys: dev/re pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2014 23:13:41 -0000 Author: marius Date: Wed Feb 5 23:13:40 2014 New Revision: 261531 URL: http://svnweb.freebsd.org/changeset/base/261531 Log: - Implement the RX EARLYOFF and RXDV GATED bits as done by RealTek's Linux driver as version 8.037.00 for RTL8168{E-VL,EP,F,G,GU} and RTL8111B. This makes reception of packets work with the RTL8168G (HW rev. 0x4c000000) in my Shuttle DS47. - Consistently use RL_MSI_MESSAGES. In joint forces with: yongari MFC after: 5 days Modified: head/sys/dev/re/if_re.c head/sys/pci/if_rlreg.h Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Wed Feb 5 22:53:58 2014 (r261530) +++ head/sys/dev/re/if_re.c Wed Feb 5 23:13:40 2014 (r261531) @@ -656,6 +656,10 @@ re_set_rxmode(struct rl_softc *sc) ifp = sc->rl_ifp; rxfilt = RL_RXCFG_CONFIG | RL_RXCFG_RX_INDIV | RL_RXCFG_RX_BROAD; + if ((sc->rl_flags & RL_FLAG_EARLYOFF) != 0) + rxfilt |= RL_RXCFG_EARLYOFF; + else if ((sc->rl_flags & RL_FLAG_EARLYOFFV2) != 0) + rxfilt |= RL_RXCFG_EARLYOFFV2; if (ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) { if (ifp->if_flags & IFF_PROMISC) @@ -1265,7 +1269,7 @@ re_attach(device_t dev) msic = 0; /* Prefer MSI-X to MSI. */ if (msixc > 0) { - msixc = 1; + msixc = RL_MSI_MESSAGES; rid = PCIR_BAR(4); sc->rl_res_pba = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); @@ -1275,7 +1279,7 @@ re_attach(device_t dev) } if (sc->rl_res_pba != NULL && pci_alloc_msix(dev, &msixc) == 0) { - if (msixc == 1) { + if (msixc == RL_MSI_MESSAGES) { device_printf(dev, "Using %d MSI-X message\n", msixc); sc->rl_flags |= RL_FLAG_MSIX; @@ -1292,7 +1296,7 @@ re_attach(device_t dev) } /* Prefer MSI to INTx. */ if (msixc == 0 && msic > 0) { - msic = 1; + msic = RL_MSI_MESSAGES; if (pci_alloc_msi(dev, &msic) == 0) { if (msic == RL_MSI_MESSAGES) { device_printf(dev, "Using %d MSI message\n", @@ -1463,16 +1467,24 @@ re_attach(device_t dev) RL_FLAG_WOL_MANLINK; break; case RL_HWREV_8168E_VL: - case RL_HWREV_8168EP: case RL_HWREV_8168F: - case RL_HWREV_8168G: + sc->rl_flags |= RL_FLAG_EARLYOFF; + /* FALLTHROUGH */ case RL_HWREV_8411: - case RL_HWREV_8411B: sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | RL_FLAG_CMDSTOP | RL_FLAG_AUTOPAD | RL_FLAG_JUMBOV2 | RL_FLAG_CMDSTOP_WAIT_TXQ | RL_FLAG_WOL_MANLINK; break; + case RL_HWREV_8168EP: + case RL_HWREV_8168G: + case RL_HWREV_8411B: + sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PAR | + RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | RL_FLAG_CMDSTOP | + RL_FLAG_AUTOPAD | RL_FLAG_JUMBOV2 | + RL_FLAG_CMDSTOP_WAIT_TXQ | RL_FLAG_WOL_MANLINK | + RL_FLAG_EARLYOFFV2 | RL_FLAG_RXDV_GATED; + break; case RL_HWREV_8168GU: if (pci_get_device(dev) == RT_DEVICEID_8101E) { /* RTL8106EUS */ @@ -1482,7 +1494,8 @@ re_attach(device_t dev) sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | RL_FLAG_CMDSTOP | - RL_FLAG_AUTOPAD | RL_FLAG_CMDSTOP_WAIT_TXQ; + RL_FLAG_AUTOPAD | RL_FLAG_CMDSTOP_WAIT_TXQ | + RL_FLAG_EARLYOFFV2 | RL_FLAG_RXDV_GATED; break; case RL_HWREV_8169_8110SB: case RL_HWREV_8169_8110SBL: @@ -3170,6 +3183,10 @@ re_init_locked(struct rl_softc *sc) CSR_WRITE_4(sc, RL_TXLIST_ADDR_LO, RL_ADDR_LO(sc->rl_ldata.rl_tx_list_addr)); + if ((sc->rl_flags & RL_FLAG_RXDV_GATED) != 0) + CSR_WRITE_4(sc, RL_MISC, CSR_READ_4(sc, RL_MISC) & + ~0x00080000); + /* * Enable transmit and receive. */ Modified: head/sys/pci/if_rlreg.h ============================================================================== --- head/sys/pci/if_rlreg.h Wed Feb 5 22:53:58 2014 (r261530) +++ head/sys/pci/if_rlreg.h Wed Feb 5 23:13:40 2014 (r261531) @@ -145,6 +145,7 @@ #define RL_PMCH 0x006F /* 8 bits */ #define RL_MAXRXPKTLEN 0x00DA /* 16 bits, chip multiplies by 8 */ #define RL_INTRMOD 0x00E2 /* 16 bits */ +#define RL_MISC 0x00F0 /* * TX config register bits @@ -286,8 +287,10 @@ #define RL_RXCFG_RX_RUNT 0x00000010 #define RL_RXCFG_RX_ERRPKT 0x00000020 #define RL_RXCFG_WRAP 0x00000080 +#define RL_RXCFG_EARLYOFFV2 0x00000800 #define RL_RXCFG_MAXDMA 0x00000700 #define RL_RXCFG_BUFSZ 0x00001800 +#define RL_RXCFG_EARLYOFF 0x00003800 #define RL_RXCFG_FIFOTHRESH 0x0000E000 #define RL_RXCFG_EARLYTHRESH 0x07000000 @@ -926,6 +929,9 @@ struct rl_softc { #define RL_FLAG_WAIT_TXPOLL 0x00004000 #define RL_FLAG_CMDSTOP_WAIT_TXQ 0x00008000 #define RL_FLAG_WOL_MANLINK 0x00010000 +#define RL_FLAG_EARLYOFF 0x00020000 +#define RL_FLAG_EARLYOFFV2 0x00040000 +#define RL_FLAG_RXDV_GATED 0x00080000 #define RL_FLAG_PCIE 0x40000000 #define RL_FLAG_LINK 0x80000000 }; From owner-svn-src-head@FreeBSD.ORG Thu Feb 6 00:32:33 2014 Return-Path: Delivered-To: svn-src-head@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 72DA1ABB; Thu, 6 Feb 2014 00:32:33 +0000 (UTC) Received: from mail-gw11.york.ac.uk (mail-gw11.york.ac.uk [144.32.129.150]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2FF8E1C51; Thu, 6 Feb 2014 00:32:33 +0000 (UTC) Received: from ury.york.ac.uk ([144.32.64.162]:39014) by mail-gw11.york.ac.uk with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1WBCnZ-0001SM-OW; Thu, 06 Feb 2014 00:26:33 +0000 Date: Thu, 6 Feb 2014 00:26:33 +0000 (GMT) From: Gavin Atkinson X-X-Sender: gavin@ury.york.ac.uk To: John Baldwin Subject: Re: svn commit: r261216 - head/sys/dev/pccbb In-Reply-To: <201402041424.54122.jhb@freebsd.org> Message-ID: References: <201401271949.s0RJnr7t067977@svn.freebsd.org> <201402041424.54122.jhb@freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, imp@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2014 00:32:33 -0000 On Tue, 4 Feb 2014, John Baldwin wrote: > On Sunday, February 02, 2014 5:34:58 pm Gavin Atkinson wrote: > > On Mon, 27 Jan 2014, John Baldwin wrote: > > > Author: jhb > > > Date: Mon Jan 27 19:49:52 2014 > > > New Revision: 261216 > > > URL: http://svnweb.freebsd.org/changeset/base/261216 > > > > > > Log: > > > Explicitly enable I/O and memory decoding in the bridge's command register > > > when activating an I/O or memory window on the CardBus bridge. > > > > This fixes some, but not all of my machines. One in particular, a Toshiba > > M5 laptop, remains broken by r254263 even with this change. Specificaly, > > the laptop does not notice when a card is inserted. > > > > The attached minimal patch gets things working again, though I don't know > > if is the correct fix or if a more involved fix is required. > > > > dmesg before and after that patch: > > > > http://people.freebsd.org/~gavin/m5-dmesg-before.txt > > http://people.freebsd.org/~gavin/m5-dmesg-after.txt > > > > The only difference is the cbb register dump, the one bit that I am > > setting in the patch. > > Your patch effectively reverts r254263. It may be the correct thing to do, > but the question is why. :) Can you provide 'pciconf -lbc' output for this > device? (You can just do 'pciconf -lbc pccbb0' in HEAD now) Full "pciconf -lbc" output at http://people.freebsd.org/~gavin/m5-pciconf-lbc.txt It's the same both with and without my hack-patch. Thanks, Gavin From owner-svn-src-head@FreeBSD.ORG Thu Feb 6 02:34:30 2014 Return-Path: Delivered-To: svn-src-head@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 77E6A384; Thu, 6 Feb 2014 02:34: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 62A761615; Thu, 6 Feb 2014 02:34:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s162YUFT077122; Thu, 6 Feb 2014 02:34:30 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s162YUPC077121; Thu, 6 Feb 2014 02:34:30 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201402060234.s162YUPC077121@svn.freebsd.org> From: Navdeep Parhar Date: Thu, 6 Feb 2014 02:34:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261533 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2014 02:34:30 -0000 Author: np Date: Thu Feb 6 02:34:29 2014 New Revision: 261533 URL: http://svnweb.freebsd.org/changeset/base/261533 Log: cxgbe(4): Use the port's tx channel to identify it to t4_clr_port_stats. MFC after: 3 days Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu Feb 6 02:12:39 2014 (r261532) +++ head/sys/dev/cxgbe/t4_main.c Thu Feb 6 02:34:29 2014 (r261533) @@ -7778,11 +7778,11 @@ t4_ioctl(struct cdev *dev, unsigned long if (port_id >= sc->params.nports) return (EINVAL); + pi = sc->port[port_id]; /* MAC stats */ - t4_clr_port_stats(sc, port_id); + t4_clr_port_stats(sc, pi->tx_chan); - pi = sc->port[port_id]; if (pi->flags & PORT_INIT_DONE) { struct sge_rxq *rxq; struct sge_txq *txq; From owner-svn-src-head@FreeBSD.ORG Thu Feb 6 02:36:12 2014 Return-Path: Delivered-To: svn-src-head@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 DCDAC4E5; Thu, 6 Feb 2014 02:36:12 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C699A161D; Thu, 6 Feb 2014 02:36:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s162aCUQ077379; Thu, 6 Feb 2014 02:36:12 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s162aCqe077378; Thu, 6 Feb 2014 02:36:12 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201402060236.s162aCqe077378@svn.freebsd.org> From: Navdeep Parhar Date: Thu, 6 Feb 2014 02:36:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261534 - head/tools/tools/cxgbetool X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2014 02:36:12 -0000 Author: np Date: Thu Feb 6 02:36:12 2014 New Revision: 261534 URL: http://svnweb.freebsd.org/changeset/base/261534 Log: cxgbetool: Display the congestion channel map in hex. MFC after: 1 week Modified: head/tools/tools/cxgbetool/cxgbetool.c Modified: head/tools/tools/cxgbetool/cxgbetool.c ============================================================================== --- head/tools/tools/cxgbetool/cxgbetool.c Thu Feb 6 02:34:29 2014 (r261533) +++ head/tools/tools/cxgbetool/cxgbetool.c Thu Feb 6 02:36:12 2014 (r261534) @@ -1368,7 +1368,7 @@ show_sge_context(const struct t4_sge_con FIELD1("CngDBPHdr:", 6), FIELD1("CngDBPData:", 5), FIELD1("CngIMSG:", 4), - FIELD("CngChMap:", 0, 3), + { "CngChMap:", 0, 3, 0, 1, 0}, { NULL } }; static struct field_desc t5_conm[] = { @@ -1377,7 +1377,7 @@ show_sge_context(const struct t4_sge_con FIELD1("CngDBPHdr:", 18), FIELD1("CngDBPData:", 17), FIELD1("CngIMSG:", 16), - FIELD("CngChMap:", 0, 15), + { "CngChMap:", 0, 15, 0, 1, 0}, { NULL } }; From owner-svn-src-head@FreeBSD.ORG Thu Feb 6 02:54:05 2014 Return-Path: Delivered-To: svn-src-head@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 ABE9336E; Thu, 6 Feb 2014 02:54:05 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8751C175C; Thu, 6 Feb 2014 02:54:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s162s57g086003; Thu, 6 Feb 2014 02:54:05 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s162s4hY086000; Thu, 6 Feb 2014 02:54:04 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201402060254.s162s4hY086000@svn.freebsd.org> From: Mark Johnston Date: Thu, 6 Feb 2014 02:54:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261535 - head/sys/dev/mfi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2014 02:54:05 -0000 Author: markj Date: Thu Feb 6 02:54:04 2014 New Revision: 261535 URL: http://svnweb.freebsd.org/changeset/base/261535 Log: Add support for MegaRAID Fury cards. The main change needed to boot from a 9341-4i controller was to ensure that scatter/gather lists are ended with an end-of-list marker. Both the mrsas and Linux megaraid_sas drivers use this marker with Invader cards as well, so we do the same thing, though it is apparently not strictly necessary. Reviewed by: ambrisko Tested by: ambrisko (Invader card) MFC after: 3 weeks Sponsored by: Sandvine Inc. Modified: head/sys/dev/mfi/mfi_pci.c head/sys/dev/mfi/mfi_tbolt.c head/sys/dev/mfi/mfivar.h Modified: head/sys/dev/mfi/mfi_pci.c ============================================================================== --- head/sys/dev/mfi/mfi_pci.c Thu Feb 6 02:36:12 2014 (r261534) +++ head/sys/dev/mfi/mfi_pci.c Thu Feb 6 02:54:04 2014 (r261535) @@ -136,7 +136,8 @@ struct mfi_ident { {0x1000, 0x005b, 0x8086, 0x9265, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT| MFI_FLAGS_MRSAS, "Intel (R) RAID Controller RS25DB080"}, {0x1000, 0x005b, 0x8086, 0x9285, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT| MFI_FLAGS_MRSAS, "Intel (R) RAID Controller RS25NB008"}, {0x1000, 0x005b, 0xffff, 0xffff, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT| MFI_FLAGS_MRSAS, "ThunderBolt"}, - {0x1000, 0x005d, 0xffff, 0xffff, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT| MFI_FLAGS_MRSAS, "Invader"}, + {0x1000, 0x005d, 0xffff, 0xffff, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT| MFI_FLAGS_MRSAS| MFI_FLAGS_INVADER, "Invader"}, + {0x1000, 0x005f, 0xffff, 0xffff, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT| MFI_FLAGS_MRSAS| MFI_FLAGS_FURY, "Fury"}, {0x1000, 0x0060, 0x1028, 0xffff, MFI_FLAGS_1078, "Dell PERC 6"}, {0x1000, 0x0060, 0xffff, 0xffff, MFI_FLAGS_1078, "LSI MegaSAS 1078"}, {0x1000, 0x0071, 0xffff, 0xffff, MFI_FLAGS_SKINNY, "Drake Skinny"}, Modified: head/sys/dev/mfi/mfi_tbolt.c ============================================================================== --- head/sys/dev/mfi/mfi_tbolt.c Thu Feb 6 02:36:12 2014 (r261534) +++ head/sys/dev/mfi/mfi_tbolt.c Thu Feb 6 02:54:04 2014 (r261535) @@ -850,7 +850,8 @@ mfi_tbolt_build_ldio(struct mfi_softc *s io_request = cmd->io_request; io_request->RaidContext.TargetID = device_id; io_request->RaidContext.Status = 0; - io_request->RaidContext.exStatus =0; + io_request->RaidContext.exStatus = 0; + io_request->RaidContext.regLockFlags = 0; start_lba_lo = mfi_cmd->cm_frame->io.lba_lo; start_lba_hi = mfi_cmd->cm_frame->io.lba_hi; @@ -945,6 +946,7 @@ mfi_tbolt_make_sgl(struct mfi_softc *sc, uint8_t i, sg_processed, sg_to_process; uint8_t sge_count, sge_idx; union mfi_sgl *os_sgl; + pMpi25IeeeSgeChain64_t sgl_end; /* * Return 0 if there is no data transfer @@ -968,6 +970,11 @@ mfi_tbolt_make_sgl(struct mfi_softc *sc, else sge_idx = sge_count; + if (sc->mfi_flags & (MFI_FLAGS_INVADER | MFI_FLAGS_FURY)) { + sgl_end = sgl_ptr + (sc->max_SGEs_in_main_message - 1); + sgl_end->Flags = 0; + } + for (i = 0; i < sge_idx; i++) { /* * For 32bit BSD we are getting 32 bit SGL's from OS @@ -981,7 +988,11 @@ mfi_tbolt_make_sgl(struct mfi_softc *sc, sgl_ptr->Length = os_sgl->sg32[i].len; sgl_ptr->Address = os_sgl->sg32[i].addr; } - sgl_ptr->Flags = 0; + if (i == sge_count - 1 && + (sc->mfi_flags & (MFI_FLAGS_INVADER | MFI_FLAGS_FURY))) + sgl_ptr->Flags = MPI25_IEEE_SGE_FLAGS_END_OF_LIST; + else + sgl_ptr->Flags = 0; sgl_ptr++; cmd->io_request->ChainOffset = 0; } @@ -996,8 +1007,11 @@ mfi_tbolt_make_sgl(struct mfi_softc *sc, sg_chain = sgl_ptr; /* Prepare chain element */ sg_chain->NextChainOffset = 0; - sg_chain->Flags = (MPI2_IEEE_SGE_FLAGS_CHAIN_ELEMENT | - MPI2_IEEE_SGE_FLAGS_IOCPLBNTA_ADDR); + if (sc->mfi_flags & (MFI_FLAGS_INVADER | MFI_FLAGS_FURY)) + sg_chain->Flags = MPI2_IEEE_SGE_FLAGS_CHAIN_ELEMENT; + else + sg_chain->Flags = MPI2_IEEE_SGE_FLAGS_CHAIN_ELEMENT | + MPI2_IEEE_SGE_FLAGS_IOCPLBNTA_ADDR; sg_chain->Length = (sizeof(MPI2_SGE_IO_UNION) * (sge_count - sg_processed)); sg_chain->Address = cmd->sg_frame_phys_addr; @@ -1010,7 +1024,13 @@ mfi_tbolt_make_sgl(struct mfi_softc *sc, sgl_ptr->Length = os_sgl->sg32[i].len; sgl_ptr->Address = os_sgl->sg32[i].addr; } - sgl_ptr->Flags = 0; + if (i == sge_count - 1 && + (sc->mfi_flags & + (MFI_FLAGS_INVADER | MFI_FLAGS_FURY))) + sgl_ptr->Flags = + MPI25_IEEE_SGE_FLAGS_END_OF_LIST; + else + sgl_ptr->Flags = 0; sgl_ptr++; } } Modified: head/sys/dev/mfi/mfivar.h ============================================================================== --- head/sys/dev/mfi/mfivar.h Thu Feb 6 02:36:12 2014 (r261534) +++ head/sys/dev/mfi/mfivar.h Thu Feb 6 02:54:04 2014 (r261535) @@ -200,6 +200,8 @@ struct mfi_softc { #define MFI_FLAGS_SKINNY (1<<7) #define MFI_FLAGS_TBOLT (1<<8) #define MFI_FLAGS_MRSAS (1<<9) +#define MFI_FLAGS_INVADER (1<<10) +#define MFI_FLAGS_FURY (1<<11) // Start: LSIP200113393 bus_dma_tag_t verbuf_h_dmat; bus_dmamap_t verbuf_h_dmamap; From owner-svn-src-head@FreeBSD.ORG Thu Feb 6 03:21:43 2014 Return-Path: Delivered-To: svn-src-head@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 CEEEFD1E; Thu, 6 Feb 2014 03:21:43 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BB6241D02; Thu, 6 Feb 2014 03:21:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s163LhkK098833; Thu, 6 Feb 2014 03:21:43 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s163Lhgp098830; Thu, 6 Feb 2014 03:21:43 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201402060321.s163Lhgp098830@svn.freebsd.org> From: Navdeep Parhar Date: Thu, 6 Feb 2014 03:21:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261536 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2014 03:21:43 -0000 Author: np Date: Thu Feb 6 03:21:43 2014 New Revision: 261536 URL: http://svnweb.freebsd.org/changeset/base/261536 Log: cxgbe(4): The T5 allows for a different freelist starvation threshold for queues with buffer packing. Use the correct value to calculate a freelist's low water mark. MFC after: 1 week Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Thu Feb 6 02:54:04 2014 (r261535) +++ head/sys/dev/cxgbe/adapter.h Thu Feb 6 03:21:43 2014 (r261536) @@ -517,6 +517,7 @@ struct sge { int timer_val[SGE_NTIMERS]; int counter_val[SGE_NCOUNTERS]; int fl_starve_threshold; + int fl_starve_threshold2; int eq_s_qpp; int iq_s_qpp; Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Thu Feb 6 02:54:04 2014 (r261535) +++ head/sys/dev/cxgbe/t4_sge.c Thu Feb 6 03:21:43 2014 (r261536) @@ -569,6 +569,10 @@ t4_read_chip_settings(struct adapter *sc r = t4_read_reg(sc, A_SGE_CONM_CTRL); s->fl_starve_threshold = G_EGRTHRESHOLD(r) * 2 + 1; + if (is_t4(sc)) + s->fl_starve_threshold2 = s->fl_starve_threshold; + else + s->fl_starve_threshold2 = G_EGRTHRESHOLDPACKING(r) * 2 + 1; /* egress queues: log2 of # of doorbells per BAR2 page */ r = t4_read_reg(sc, A_SGE_EGRESS_QUEUES_PER_PAGE_PF); @@ -2233,7 +2237,9 @@ alloc_iq_fl(struct port_info *pi, struct return (rc); } fl->needed = fl->cap; - fl->lowat = roundup2(sc->sge.fl_starve_threshold, 8); + fl->lowat = fl->flags & FL_BUF_PACKING ? + roundup2(sc->sge.fl_starve_threshold2, 8) : + roundup2(sc->sge.fl_starve_threshold, 8); c.iqns_to_fl0congen |= htobe32(V_FW_IQ_CMD_FL0HOSTFCMODE(X_HOSTFCMODE_NONE) | From owner-svn-src-head@FreeBSD.ORG Thu Feb 6 03:30:13 2014 Return-Path: Delivered-To: svn-src-head@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 8F9FAF0F; Thu, 6 Feb 2014 03:30:13 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 630A41DB4; Thu, 6 Feb 2014 03:30:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s163UDnC099884; Thu, 6 Feb 2014 03:30:13 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s163UCEU099881; Thu, 6 Feb 2014 03:30:12 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201402060330.s163UCEU099881@svn.freebsd.org> From: Navdeep Parhar Date: Thu, 6 Feb 2014 03:30:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261537 - in head/sys/dev/cxgbe: . common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2014 03:30:13 -0000 Author: np Date: Thu Feb 6 03:30:12 2014 New Revision: 261537 URL: http://svnweb.freebsd.org/changeset/base/261537 Log: cxgbe(4): Use the rx channel map (instead of the tx channel map) as the congestion channel map. MFC after: 1 week Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Thu Feb 6 03:21:43 2014 (r261536) +++ head/sys/dev/cxgbe/adapter.h Thu Feb 6 03:30:12 2014 (r261537) @@ -210,6 +210,7 @@ struct port_info { uint8_t mod_type; uint8_t port_id; uint8_t tx_chan; + uint8_t rx_chan_map; /* rx MPS channel bitmap */ /* These need to be int as they are used in sysctl */ int ntxq; /* # of tx queues */ Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Thu Feb 6 03:21:43 2014 (r261536) +++ head/sys/dev/cxgbe/common/t4_hw.c Thu Feb 6 03:30:12 2014 (r261537) @@ -5650,6 +5650,7 @@ int __devinit t4_port_init(struct port_i p->viid = ret; p->tx_chan = j; + p->rx_chan_map = get_mps_bg_map(adap, j); p->lport = j; p->rss_size = rss_size; t4_os_set_hw_addr(adap, p->port_id, addr); Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Thu Feb 6 03:21:43 2014 (r261536) +++ head/sys/dev/cxgbe/t4_sge.c Thu Feb 6 03:30:12 2014 (r261537) @@ -2474,7 +2474,7 @@ tnl_cong(struct port_info *pi) else if (cong_drop == 1) return (0); else - return (1 << pi->tx_chan); + return (pi->rx_chan_map); } static int @@ -2581,7 +2581,7 @@ alloc_ofld_rxq(struct port_info *pi, str char name[16]; rc = alloc_iq_fl(pi, &ofld_rxq->iq, &ofld_rxq->fl, intr_idx, - 1 << pi->tx_chan); + pi->rx_chan_map); if (rc != 0) return (rc); From owner-svn-src-head@FreeBSD.ORG Thu Feb 6 03:54:59 2014 Return-Path: Delivered-To: svn-src-head@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 0626B30B; Thu, 6 Feb 2014 03:54: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E50E71068; Thu, 6 Feb 2014 03:54:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s163swvG010467; Thu, 6 Feb 2014 03:54:58 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s163swXk010466; Thu, 6 Feb 2014 03:54:58 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201402060354.s163swXk010466@svn.freebsd.org> From: Alexander Motin Date: Thu, 6 Feb 2014 03:54:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261538 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2014 03:54:59 -0000 Author: mav Date: Thu Feb 6 03:54:58 2014 New Revision: 261538 URL: http://svnweb.freebsd.org/changeset/base/261538 Log: Make CTL block backend return proper error code for operations unsupposed by the underlying device. MFC after: 2 weeks Modified: head/sys/cam/ctl/ctl_backend_block.c Modified: head/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_block.c Thu Feb 6 03:30:12 2014 (r261537) +++ head/sys/cam/ctl/ctl_backend_block.c Thu Feb 6 03:54:58 2014 (r261538) @@ -510,6 +510,7 @@ ctl_be_block_biodone(struct bio *bio) struct ctl_be_block_io *beio; struct ctl_be_block_lun *be_lun; union ctl_io *io; + int error; beio = bio->bio_caller1; be_lun = beio->lun; @@ -517,8 +518,9 @@ ctl_be_block_biodone(struct bio *bio) DPRINTF("entered\n"); + error = bio->bio_error; mtx_lock(&be_lun->lock); - if (bio->bio_error != 0) + if (error != 0) beio->num_errors++; beio->num_bios_done++; @@ -550,7 +552,9 @@ ctl_be_block_biodone(struct bio *bio) * entire I/O with a medium error. */ if (beio->num_errors > 0) { - if (beio->bio_cmd == BIO_FLUSH) { + if (error == EOPNOTSUPP) { + ctl_set_invalid_opcode(&io->scsiio); + } else if (beio->bio_cmd == BIO_FLUSH) { /* XXX KDM is there is a better error here? */ ctl_set_internal_failure(&io->scsiio, /*sks_valid*/ 1, From owner-svn-src-head@FreeBSD.ORG Thu Feb 6 08:47:15 2014 Return-Path: Delivered-To: svn-src-head@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 840122F0; Thu, 6 Feb 2014 08:47:15 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6A5641614; Thu, 6 Feb 2014 08:47:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s168lFMh025215; Thu, 6 Feb 2014 08:47:15 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s168lEo6025211; Thu, 6 Feb 2014 08:47:14 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201402060847.s168lEo6025211@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 6 Feb 2014 08:47:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261541 - in head/sys: conf dev/usb dev/usb/net modules/usb modules/usb/urndis X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2014 08:47:15 -0000 Author: hselasky Date: Thu Feb 6 08:47:14 2014 New Revision: 261541 URL: http://svnweb.freebsd.org/changeset/base/261541 Log: Import USB RNDIS driver to FreeBSD from OpenBSD. Useful for so-called USB tethering. - Imported code from OpenBSD - Adapted code to FreeBSD - Removed some unused functions - Fixed some buffer encoding and decoding issues - Optimised data transport path a bit, by sending multiple packets at a time - Increased receive buffer to 16K Obtained from: OpenBSD Requested by: eadler @ MFC after: 2 weeks Added: head/sys/dev/usb/net/if_urndis.c (contents, props changed) head/sys/dev/usb/net/if_urndisreg.h (contents, props changed) head/sys/modules/usb/urndis/ head/sys/modules/usb/urndis/Makefile (contents, props changed) Modified: head/sys/conf/NOTES head/sys/conf/files head/sys/dev/usb/usb.h head/sys/modules/usb/Makefile Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Thu Feb 6 07:59:05 2014 (r261540) +++ head/sys/conf/NOTES Thu Feb 6 08:47:14 2014 (r261541) @@ -2746,6 +2746,8 @@ device upgt # Ralink Technology RT2500USB wireless driver device ural # +# RNDIS USB ethernet driver +device urndis # Realtek RTL8187B/L wireless driver device urtw # Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Feb 6 07:59:05 2014 (r261540) +++ head/sys/conf/files Thu Feb 6 08:47:14 2014 (r261541) @@ -2293,9 +2293,11 @@ dev/usb/net/if_rue.c optional rue dev/usb/net/if_smsc.c optional smsc dev/usb/net/if_udav.c optional udav dev/usb/net/if_usie.c optional usie +dev/usb/net/if_urndis.c optional urndis dev/usb/net/ruephy.c optional rue dev/usb/net/usb_ethernet.c optional aue | axe | axge | cdce | cue | kue | \ - mos | rue | smsc | udav | ipheth + mos | rue | smsc | udav | ipheth | \ + urndis dev/usb/net/uhso.c optional uhso # # USB WLAN drivers Added: head/sys/dev/usb/net/if_urndis.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/net/if_urndis.c Thu Feb 6 08:47:14 2014 (r261541) @@ -0,0 +1,1013 @@ +/* $OpenBSD: if_urndis.c,v 1.46 2013/12/09 15:45:29 pirofti Exp $ */ + +/* + * Copyright (c) 2010 Jonathan Armani + * Copyright (c) 2010 Fabien Romano + * Copyright (c) 2010 Michael Knudsen + * Copyright (c) 2014 Hans Petter Selasky + * All rights reserved. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#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 "usbdevs.h" + +#define USB_DEBUG_VAR urndis_debug +#include +#include +#include "usb_if.h" + +#include +#include + +#include + +static device_probe_t urndis_probe; +static device_attach_t urndis_attach; +static device_detach_t urndis_detach; +static device_suspend_t urndis_suspend; +static device_resume_t urndis_resume; + +static usb_callback_t urndis_bulk_write_callback; +static usb_callback_t urndis_bulk_read_callback; +static usb_callback_t urndis_intr_read_callback; + +static uether_fn_t urndis_attach_post; +static uether_fn_t urndis_init; +static uether_fn_t urndis_stop; +static uether_fn_t urndis_start; +static uether_fn_t urndis_setmulti; +static uether_fn_t urndis_setpromisc; + +static uint32_t urndis_ctrl_query(struct urndis_softc *, uint32_t, const void **, uint16_t *); +static uint32_t urndis_ctrl_set(struct urndis_softc *, uint32_t, struct urndis_set_req *, uint16_t); +static uint32_t urndis_ctrl_handle_init(struct urndis_softc *, const struct urndis_comp_hdr *); +static uint32_t urndis_ctrl_handle_query(struct urndis_softc *, const struct urndis_comp_hdr *, const void **, uint16_t *); +static uint32_t urndis_ctrl_handle_reset(struct urndis_softc *, const struct urndis_comp_hdr *); +static uint32_t urndis_ctrl_init(struct urndis_softc *); + +#ifdef USB_DEBUG +static int urndis_debug = 0; +static SYSCTL_NODE(_hw_usb, OID_AUTO, urndis, CTLFLAG_RW, 0, "USB RNDIS-Ethernet"); +SYSCTL_INT(_hw_usb_urndis, OID_AUTO, debug, CTLFLAG_RW, &urndis_debug, 0, + "Debug level"); +#endif + +static const struct usb_config urndis_config[URNDIS_N_TRANSFER] = { + + [URNDIS_BULK_RX] = { + .type = UE_BULK, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_RX, + .if_index = 0, + .frames = 1, + .bufsize = RNDIS_RX_MAXLEN, + .flags = {.short_xfer_ok = 1,}, + .callback = urndis_bulk_read_callback, + .timeout = 0, /* no timeout */ + .usb_mode = USB_MODE_HOST, + }, + + [URNDIS_BULK_TX] = { + .type = UE_BULK, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_TX, + .if_index = 0, + .frames = RNDIS_TX_FRAMES_MAX, + .bufsize = (RNDIS_TX_FRAMES_MAX * RNDIS_TX_MAXLEN), + .flags = { + .force_short_xfer = 1, + }, + .callback = urndis_bulk_write_callback, + .timeout = 10000, /* 10 seconds */ + .usb_mode = USB_MODE_HOST, + }, + + [URNDIS_INTR_RX] = { + .type = UE_INTERRUPT, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_RX, + .if_index = 1, + .bufsize = 0, /* use wMaxPacketSize */ + .flags = {.short_xfer_ok = 1,.no_pipe_ok = 1,}, + .callback = urndis_intr_read_callback, + .timeout = 0, + .usb_mode = USB_MODE_HOST, + }, +}; + +static device_method_t urndis_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, urndis_probe), + DEVMETHOD(device_attach, urndis_attach), + DEVMETHOD(device_detach, urndis_detach), + DEVMETHOD(device_suspend, urndis_suspend), + DEVMETHOD(device_resume, urndis_resume), + + DEVMETHOD_END +}; + +static driver_t urndis_driver = { + .name = "urndis", + .methods = urndis_methods, + .size = sizeof(struct urndis_softc), +}; + +static devclass_t urndis_devclass; + +DRIVER_MODULE(urndis, uhub, urndis_driver, urndis_devclass, NULL, 0); +MODULE_VERSION(urndis, 1); +MODULE_DEPEND(urndis, uether, 1, 1, 1); +MODULE_DEPEND(urndis, usb, 1, 1, 1); +MODULE_DEPEND(urndis, ether, 1, 1, 1); + +static const struct usb_ether_methods urndis_ue_methods = { + .ue_attach_post = urndis_attach_post, + .ue_start = urndis_start, + .ue_init = urndis_init, + .ue_stop = urndis_stop, + .ue_setmulti = urndis_setmulti, + .ue_setpromisc = urndis_setpromisc, +}; + +static const STRUCT_USB_HOST_ID urndis_host_devs[] = { + {USB_IFACE_CLASS(UICLASS_CDC), USB_IFACE_SUBCLASS(UISUBCLASS_ABSTRACT_CONTROL_MODEL), + USB_IFACE_PROTOCOL(0xff)}, + {USB_IFACE_CLASS(UICLASS_WIRELESS), USB_IFACE_SUBCLASS(UISUBCLASS_RF), + USB_IFACE_PROTOCOL(UIPROTO_RNDIS)}, + {USB_IFACE_CLASS(UICLASS_IAD), USB_IFACE_SUBCLASS(UISUBCLASS_SYNC), + USB_IFACE_PROTOCOL(UIPROTO_ACTIVESYNC)}, +}; + +static int +urndis_probe(device_t dev) +{ + struct usb_attach_arg *uaa = device_get_ivars(dev); + + return (usbd_lookup_id_by_uaa(urndis_host_devs, sizeof(urndis_host_devs), uaa)); +} + +static void +urndis_attach_post(struct usb_ether *ue) +{ + /* no-op */ + return; +} + +static int +urndis_attach(device_t dev) +{ + struct urndis_softc *sc = device_get_softc(dev); + struct usb_ether *ue = &sc->sc_ue; + struct usb_attach_arg *uaa = device_get_ivars(dev); + struct usb_cdc_cm_descriptor *cmd; + struct { + struct urndis_set_req hdr; + uint32_t filter; + } msg_filter; + const void *buf; + uint16_t bufsz; + uint8_t iface_index[2] = { uaa->info.bIfaceIndex + 1, uaa->info.bIfaceIndex }; + int error; + uint8_t i; + + sc->sc_ue.ue_udev = uaa->device; + sc->sc_ifaceno_ctl = uaa->info.bIfaceNum; + + cmd = usbd_find_descriptor(uaa->device, NULL, uaa->info.bIfaceIndex, + UDESC_CS_INTERFACE, 0xFF, UDESCSUB_CDC_CM, 0xFF); + if (cmd != 0) { + DPRINTF("Call Mode Descriptor found, dataif=%d\n", cmd->bDataInterface); + iface_index[0] = cmd->bDataInterface; + } + + device_set_usb_desc(dev); + + mtx_init(&sc->sc_mtx, device_get_nameunit(dev), NULL, MTX_DEF); + + /* scan the alternate settings looking for a valid one */ + + for (i = 0; i != 32; i++) { + + error = usbd_set_alt_interface_index(uaa->device, + iface_index[0], i); + + if (error != 0) + break; + + error = usbd_transfer_setup(uaa->device, + iface_index, sc->sc_xfer, urndis_config, + URNDIS_N_TRANSFER, sc, &sc->sc_mtx); + + if (error == 0) + break; + } + + if ((error != 0) || (i == 32)) { + device_printf(dev, "No valid alternate " + "setting found\n"); + goto detach; + } + URNDIS_LOCK(sc); + error = urndis_ctrl_query(sc, OID_802_3_PERMANENT_ADDRESS, &buf, &bufsz); + URNDIS_UNLOCK(sc); + + if (error != (int)RNDIS_STATUS_SUCCESS) { + device_printf(dev, "Unable to get hardware address\n"); + goto detach; + } + if (bufsz != ETHER_ADDR_LEN) { + device_printf(dev, "Invalid address length: %d bytes\n", bufsz); + goto detach; + } + memcpy(&sc->sc_ue.ue_eaddr, buf, ETHER_ADDR_LEN); + + /* Initialize packet filter */ + sc->sc_filter = RNDIS_PACKET_TYPE_BROADCAST | + RNDIS_PACKET_TYPE_ALL_MULTICAST; + msg_filter.filter = htole32(sc->sc_filter); + + URNDIS_LOCK(sc); + error = urndis_ctrl_set(sc, OID_GEN_CURRENT_PACKET_FILTER, + &msg_filter.hdr, sizeof(msg_filter)); + URNDIS_UNLOCK(sc); + + if (error != (int)RNDIS_STATUS_SUCCESS) { + device_printf(dev, "Unable to set data filters\n"); + goto detach; + } + ue->ue_sc = sc; + ue->ue_dev = dev; + ue->ue_udev = uaa->device; + ue->ue_mtx = &sc->sc_mtx; + ue->ue_methods = &urndis_ue_methods; + + error = uether_ifattach(ue); + if (error) { + device_printf(dev, "Could not attach interface\n"); + goto detach; + } + + URNDIS_LOCK(sc); + /* start interrupt endpoint, if any */ + usbd_transfer_start(sc->sc_xfer[URNDIS_INTR_RX]); + URNDIS_UNLOCK(sc); + + return (0); /* success */ + +detach: + urndis_detach(dev); + return (ENXIO); /* failure */ +} + +static int +urndis_detach(device_t dev) +{ + struct urndis_softc *sc = device_get_softc(dev); + struct usb_ether *ue = &sc->sc_ue; + + /* stop all USB transfers first */ + usbd_transfer_unsetup(sc->sc_xfer, URNDIS_N_TRANSFER); + + uether_ifdetach(ue); + + mtx_destroy(&sc->sc_mtx); + + return (0); +} + +static void +urndis_start(struct usb_ether *ue) +{ + struct urndis_softc *sc = uether_getsc(ue); + + /* + * Start the USB transfers, if not already started: + */ + usbd_transfer_start(sc->sc_xfer[URNDIS_BULK_TX]); + usbd_transfer_start(sc->sc_xfer[URNDIS_BULK_RX]); +} + +static void +urndis_init(struct usb_ether *ue) +{ + struct urndis_softc *sc = uether_getsc(ue); + struct ifnet *ifp = uether_getifp(ue); + + URNDIS_LOCK_ASSERT(sc, MA_OWNED); + + ifp->if_drv_flags |= IFF_DRV_RUNNING; + + urndis_ctrl_init(sc); + + /* stall data write direction, which depends on USB mode */ + usbd_xfer_set_stall(sc->sc_xfer[URNDIS_BULK_TX]); + + /* start data transfers */ + urndis_start(ue); +} + +static void +urndis_stop(struct usb_ether *ue) +{ + struct urndis_softc *sc = uether_getsc(ue); + struct ifnet *ifp = uether_getifp(ue); + + URNDIS_LOCK_ASSERT(sc, MA_OWNED); + + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + + /* + * stop all the transfers, if not already stopped: + */ + usbd_transfer_stop(sc->sc_xfer[URNDIS_BULK_RX]); + usbd_transfer_stop(sc->sc_xfer[URNDIS_BULK_TX]); +} + +static void +urndis_setmulti(struct usb_ether *ue) +{ + /* no-op */ + return; +} + +static void +urndis_setpromisc(struct usb_ether *ue) +{ + /* no-op */ + return; +} + +static int +urndis_suspend(device_t dev) +{ + device_printf(dev, "Suspending\n"); + return (0); +} + +static int +urndis_resume(device_t dev) +{ + device_printf(dev, "Resuming\n"); + return (0); +} + +static usb_error_t +urndis_ctrl_msg(struct urndis_softc *sc, uint8_t rt, uint8_t r, + uint16_t index, uint16_t value, void *buf, uint16_t buflen) +{ + usb_device_request_t req; + + req.bmRequestType = rt; + req.bRequest = r; + USETW(req.wValue, value); + USETW(req.wIndex, index); + USETW(req.wLength, buflen); + + return (usbd_do_request_flags(sc->sc_ue.ue_udev, + &sc->sc_mtx, &req, buf, (rt & UT_READ) ? + USB_SHORT_XFER_OK : 0, NULL, 2000 /* ms */ )); +} + +static usb_error_t +urndis_ctrl_send(struct urndis_softc *sc, void *buf, uint16_t len) +{ + usb_error_t err; + + err = urndis_ctrl_msg(sc, UT_WRITE_CLASS_INTERFACE, UR_GET_STATUS, + sc->sc_ifaceno_ctl, 0, buf, len); + + DPRINTF("%s\n", usbd_errstr(err)); + + return (err); +} + +static struct urndis_comp_hdr * +urndis_ctrl_recv(struct urndis_softc *sc) +{ + struct urndis_comp_hdr *hdr; + usb_error_t err; + + err = urndis_ctrl_msg(sc, UT_READ_CLASS_INTERFACE, UR_CLEAR_FEATURE, + sc->sc_ifaceno_ctl, 0, sc->sc_response_buf, RNDIS_RESPONSE_LEN); + + if (err != USB_ERR_NORMAL_COMPLETION) + return (NULL); + + hdr = (struct urndis_comp_hdr *)sc->sc_response_buf; + + DPRINTF("type 0x%x len %u\n", le32toh(hdr->rm_type), + le32toh(hdr->rm_len)); + + if (le32toh(hdr->rm_len) > RNDIS_RESPONSE_LEN) { + DPRINTF("ctrl message error: wrong size %u > %u\n", + le32toh(hdr->rm_len), RNDIS_RESPONSE_LEN); + return (NULL); + } + return (hdr); +} + +static uint32_t +urndis_ctrl_handle(struct urndis_softc *sc, struct urndis_comp_hdr *hdr, + const void **buf, uint16_t *bufsz) +{ + uint32_t rval; + + DPRINTF("\n"); + + if (buf != NULL && bufsz != NULL) { + *buf = NULL; + *bufsz = 0; + } + switch (le32toh(hdr->rm_type)) { + case REMOTE_NDIS_INITIALIZE_CMPLT: + rval = urndis_ctrl_handle_init(sc, hdr); + break; + + case REMOTE_NDIS_QUERY_CMPLT: + rval = urndis_ctrl_handle_query(sc, hdr, buf, bufsz); + break; + + case REMOTE_NDIS_RESET_CMPLT: + rval = urndis_ctrl_handle_reset(sc, hdr); + break; + + case REMOTE_NDIS_KEEPALIVE_CMPLT: + case REMOTE_NDIS_SET_CMPLT: + rval = le32toh(hdr->rm_status); + break; + + default: + DPRINTF("ctrl message error: unknown event 0x%x\n", + le32toh(hdr->rm_type)); + rval = RNDIS_STATUS_FAILURE; + break; + } + return (rval); +} + +static uint32_t +urndis_ctrl_handle_init(struct urndis_softc *sc, + const struct urndis_comp_hdr *hdr) +{ + const struct urndis_init_comp *msg; + + msg = (const struct urndis_init_comp *)hdr; + + DPRINTF("len %u rid %u status 0x%x " + "ver_major %u ver_minor %u devflags 0x%x medium 0x%x pktmaxcnt %u " + "pktmaxsz %u align %u aflistoffset %u aflistsz %u\n", + le32toh(msg->rm_len), + le32toh(msg->rm_rid), + le32toh(msg->rm_status), + le32toh(msg->rm_ver_major), + le32toh(msg->rm_ver_minor), + le32toh(msg->rm_devflags), + le32toh(msg->rm_medium), + le32toh(msg->rm_pktmaxcnt), + le32toh(msg->rm_pktmaxsz), + le32toh(msg->rm_align), + le32toh(msg->rm_aflistoffset), + le32toh(msg->rm_aflistsz)); + + if (le32toh(msg->rm_status) != RNDIS_STATUS_SUCCESS) { + DPRINTF("init failed 0x%x\n", le32toh(msg->rm_status)); + return (le32toh(msg->rm_status)); + } + if (le32toh(msg->rm_devflags) != RNDIS_DF_CONNECTIONLESS) { + DPRINTF("wrong device type (current type: 0x%x)\n", + le32toh(msg->rm_devflags)); + return (RNDIS_STATUS_FAILURE); + } + if (le32toh(msg->rm_medium) != RNDIS_MEDIUM_802_3) { + DPRINTF("medium not 802.3 (current medium: 0x%x)\n", + le32toh(msg->rm_medium)); + return (RNDIS_STATUS_FAILURE); + } + sc->sc_lim_pktsz = le32toh(msg->rm_pktmaxsz); + + return (le32toh(msg->rm_status)); +} + +static uint32_t +urndis_ctrl_handle_query(struct urndis_softc *sc, + const struct urndis_comp_hdr *hdr, const void **buf, uint16_t *bufsz) +{ + const struct urndis_query_comp *msg; + uint64_t limit; + + msg = (const struct urndis_query_comp *)hdr; + + DPRINTF("len %u rid %u status 0x%x " + "buflen %u bufoff %u\n", + le32toh(msg->rm_len), + le32toh(msg->rm_rid), + le32toh(msg->rm_status), + le32toh(msg->rm_infobuflen), + le32toh(msg->rm_infobufoffset)); + + if (buf != NULL && bufsz != NULL) { + *buf = NULL; + *bufsz = 0; + } + if (le32toh(msg->rm_status) != RNDIS_STATUS_SUCCESS) { + DPRINTF("query failed 0x%x\n", le32toh(msg->rm_status)); + return (le32toh(msg->rm_status)); + } + limit = le32toh(msg->rm_infobuflen); + limit += le32toh(msg->rm_infobufoffset); + limit += RNDIS_HEADER_OFFSET; + + if (limit > (uint64_t)le32toh(msg->rm_len)) { + DPRINTF("ctrl message error: invalid query info " + "len/offset/end_position(%u/%u/%u) -> " + "go out of buffer limit %u\n", + le32toh(msg->rm_infobuflen), + le32toh(msg->rm_infobufoffset), + le32toh(msg->rm_infobuflen) + + le32toh(msg->rm_infobufoffset) + RNDIS_HEADER_OFFSET, + le32toh(msg->rm_len)); + return (RNDIS_STATUS_FAILURE); + } + if (buf != NULL && bufsz != NULL) { + *buf = ((const uint8_t *)msg) + RNDIS_HEADER_OFFSET + le32toh(msg->rm_infobufoffset); + *bufsz = le32toh(msg->rm_infobuflen); + } + return (le32toh(msg->rm_status)); +} + +static uint32_t +urndis_ctrl_handle_reset(struct urndis_softc *sc, + const struct urndis_comp_hdr *hdr) +{ + const struct urndis_reset_comp *msg; + uint32_t rval; + + msg = (const struct urndis_reset_comp *)hdr; + + rval = le32toh(msg->rm_status); + + DPRINTF("len %u status 0x%x " + "adrreset %u\n", + le32toh(msg->rm_len), + rval, + le32toh(msg->rm_adrreset)); + + if (rval != RNDIS_STATUS_SUCCESS) { + DPRINTF("reset failed 0x%x\n", rval); + return (rval); + } + if (msg->rm_adrreset != 0) { + struct { + struct urndis_set_req hdr; + uint32_t filter; + } msg_filter; + + msg_filter.filter = htole32(sc->sc_filter); + + rval = urndis_ctrl_set(sc, OID_GEN_CURRENT_PACKET_FILTER, + &msg_filter.hdr, sizeof(msg_filter)); + + if (rval != RNDIS_STATUS_SUCCESS) { + DPRINTF("unable to reset data filters\n"); + return (rval); + } + } + return (rval); +} + +static uint32_t +urndis_ctrl_init(struct urndis_softc *sc) +{ + struct urndis_init_req msg; + struct urndis_comp_hdr *hdr; + uint32_t rval; + + msg.rm_type = htole32(REMOTE_NDIS_INITIALIZE_MSG); + msg.rm_len = htole32(sizeof(msg)); + msg.rm_rid = htole32(0); + msg.rm_ver_major = htole32(1); + msg.rm_ver_minor = htole32(1); + msg.rm_max_xfersz = htole32(RNDIS_RX_MAXLEN); + + DPRINTF("type %u len %u rid %u ver_major %u " + "ver_minor %u max_xfersz %u\n", + le32toh(msg.rm_type), + le32toh(msg.rm_len), + le32toh(msg.rm_rid), + le32toh(msg.rm_ver_major), + le32toh(msg.rm_ver_minor), + le32toh(msg.rm_max_xfersz)); + + rval = urndis_ctrl_send(sc, &msg, sizeof(msg)); + + if (rval != RNDIS_STATUS_SUCCESS) { + DPRINTF("init failed\n"); + return (rval); + } + if ((hdr = urndis_ctrl_recv(sc)) == NULL) { + DPRINTF("unable to get init response\n"); + return (RNDIS_STATUS_FAILURE); + } + rval = urndis_ctrl_handle(sc, hdr, NULL, NULL); + + return (rval); +} + +#if 0 +static uint32_t +urndis_ctrl_halt(struct urndis_softc *sc) +{ + struct urndis_halt_req msg; + uint32_t rval; + + msg.rm_type = htole32(REMOTE_NDIS_HALT_MSG); + msg.rm_len = htole32(sizeof(msg)); + msg.rm_rid = 0; + + DPRINTF("type %u len %u rid %u\n", + le32toh(msg.rm_type), + le32toh(msg.rm_len), + le32toh(msg.rm_rid)); + + rval = urndis_ctrl_send(sc, &msg, sizeof(msg)); + + if (rval != RNDIS_STATUS_SUCCESS) + printf("halt failed\n"); + + return (rval); +} + +#endif + +static uint32_t +urndis_ctrl_query(struct urndis_softc *sc, uint32_t oid, const void **rbuf, uint16_t *rbufsz) +{ + struct urndis_query_req msg; + uint32_t rval; + struct urndis_comp_hdr *hdr; + + msg.rm_type = htole32(REMOTE_NDIS_QUERY_MSG); + msg.rm_len = htole32(sizeof(msg)); + msg.rm_rid = 0; /* XXX */ + msg.rm_oid = htole32(oid); + msg.rm_infobuflen = htole32(0); + msg.rm_infobufoffset = 0; + msg.rm_devicevchdl = 0; + + DPRINTF("type %u len %u rid %u oid 0x%x " + "infobuflen %u infobufoffset %u devicevchdl %u\n", + le32toh(msg.rm_type), + le32toh(msg.rm_len), + le32toh(msg.rm_rid), + le32toh(msg.rm_oid), + le32toh(msg.rm_infobuflen), + le32toh(msg.rm_infobufoffset), + le32toh(msg.rm_devicevchdl)); + + rval = urndis_ctrl_send(sc, &msg, sizeof(msg)); + + if (rval != RNDIS_STATUS_SUCCESS) { + DPRINTF("query failed\n"); + return (rval); + } + if ((hdr = urndis_ctrl_recv(sc)) == NULL) { + DPRINTF("unable to get query response\n"); + return (RNDIS_STATUS_FAILURE); + } + rval = urndis_ctrl_handle(sc, hdr, rbuf, rbufsz); + + return (rval); +} + +static uint32_t +urndis_ctrl_set(struct urndis_softc *sc, uint32_t oid, struct urndis_set_req *msg, uint16_t len) +{ + struct urndis_comp_hdr *hdr; + uint32_t rval; + uint32_t datalen = len - sizeof(*msg); + + msg->rm_type = htole32(REMOTE_NDIS_SET_MSG); + msg->rm_len = htole32(len); + msg->rm_rid = 0; /* XXX */ + msg->rm_oid = htole32(oid); + msg->rm_infobuflen = htole32(datalen); + if (datalen != 0) { + msg->rm_infobufoffset = htole32(sizeof(*msg) - RNDIS_HEADER_OFFSET); + } else { + msg->rm_infobufoffset = 0; + } + msg->rm_devicevchdl = 0; + + DPRINTF("type %u len %u rid %u oid 0x%x " + "infobuflen %u infobufoffset %u devicevchdl %u\n", + le32toh(msg->rm_type), + le32toh(msg->rm_len), + le32toh(msg->rm_rid), + le32toh(msg->rm_oid), + le32toh(msg->rm_infobuflen), + le32toh(msg->rm_infobufoffset), + le32toh(msg->rm_devicevchdl)); + + rval = urndis_ctrl_send(sc, msg, len); + + if (rval != RNDIS_STATUS_SUCCESS) { + DPRINTF("set failed\n"); + return (rval); + } + if ((hdr = urndis_ctrl_recv(sc)) == NULL) { + DPRINTF("unable to get set response\n"); + return (RNDIS_STATUS_FAILURE); + } + rval = urndis_ctrl_handle(sc, hdr, NULL, NULL); + if (rval != RNDIS_STATUS_SUCCESS) + DPRINTF("set failed 0x%x\n", rval); + + return (rval); +} + +static void +urndis_bulk_read_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct urndis_softc *sc = usbd_xfer_softc(xfer); + struct usb_page_cache *pc = usbd_xfer_get_frame(xfer, 0); + struct ifnet *ifp = uether_getifp(&sc->sc_ue); + struct urndis_packet_msg msg; + struct mbuf *m; + int actlen; + int aframes; + int offset; + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + + usbd_xfer_status(xfer, &actlen, NULL, &aframes, NULL); + + DPRINTFN(1, "received %u bytes in %u frames\n", actlen, aframes); + + for (offset = 0; actlen >= (uint32_t)sizeof(msg);) { + + /* copy out header */ + usbd_copy_out(pc, offset, &msg, sizeof(msg)); + + if (le32toh(0x1234567U) != 0x1234567U) { + /* swap endianness */ + msg.rm_type = le32toh(msg.rm_type); + msg.rm_len = le32toh(msg.rm_len); + msg.rm_dataoffset = le32toh(msg.rm_dataoffset); + msg.rm_datalen = le32toh(msg.rm_datalen); + msg.rm_oobdataoffset = le32toh(msg.rm_oobdataoffset); + msg.rm_oobdatalen = le32toh(msg.rm_oobdatalen); + msg.rm_oobdataelements = le32toh(msg.rm_oobdataelements); + msg.rm_pktinfooffset = le32toh(msg.rm_pktinfooffset); + msg.rm_pktinfolen = le32toh(msg.rm_pktinfolen); + msg.rm_vchandle = le32toh(msg.rm_vchandle); + msg.rm_reserved = le32toh(msg.rm_reserved); + } + + DPRINTF("len %u data(off:%u len:%u) " + "oobdata(off:%u len:%u nb:%u) perpacket(off:%u len:%u)\n", + msg.rm_len, msg.rm_dataoffset, msg.rm_datalen, + msg.rm_oobdataoffset, msg.rm_oobdatalen, + msg.rm_oobdataelements, msg.rm_pktinfooffset, + msg.rm_pktinfooffset); + + /* sanity check the RNDIS header */ + if (msg.rm_type != REMOTE_NDIS_PACKET_MSG) { + DPRINTF("invalid type 0x%x != 0x%x\n", + msg.rm_type, REMOTE_NDIS_PACKET_MSG); + goto tr_setup; + } else if (msg.rm_len < (uint32_t)sizeof(msg)) { + DPRINTF("invalid msg len %u < %u\n", + msg.rm_len, (unsigned)sizeof(msg)); + goto tr_setup; + } else if (msg.rm_len > (uint32_t)actlen) { + DPRINTF("invalid msg len %u > buffer " + "len %u\n", msg.rm_len, actlen); + goto tr_setup; + } else if (msg.rm_dataoffset >= (uint32_t)actlen) { + DPRINTF("invalid msg dataoffset %u > buffer " + "dataoffset %u\n", msg.rm_dataoffset, actlen); + goto tr_setup; + } else if (msg.rm_datalen > (uint32_t)actlen) { + DPRINTF("invalid msg datalen %u > buffer " + "datalen %u\n", msg.rm_datalen, actlen); + goto tr_setup; + } else if ((msg.rm_dataoffset + msg.rm_datalen + + (uint32_t)__offsetof(struct urndis_packet_msg, + rm_dataoffset)) > (uint32_t)actlen) { + DPRINTF("invalid dataoffset %u larger than %u\n", + msg.rm_dataoffset + msg.rm_datalen + + (uint32_t)__offsetof(struct urndis_packet_msg, + rm_dataoffset)); + goto tr_setup; + } else if (msg.rm_datalen < (uint32_t)sizeof(struct ether_header)) { + ifp->if_ierrors++; + DPRINTF("invalid ethernet size " + "%u < %u\n", msg.rm_datalen, (unsigned)sizeof(struct ether_header)); + goto tr_setup; + } else if (msg.rm_datalen > (uint32_t)MCLBYTES) { + ifp->if_ierrors++; + DPRINTF("invalid ethernet size " + "%u > %u\n", + msg.rm_datalen, (unsigned)MCLBYTES); + goto tr_setup; + } else if (msg.rm_datalen > (uint32_t)(MHLEN - ETHER_ALIGN)) { + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); + } else { + m = m_gethdr(M_NOWAIT, MT_DATA); + } + + /* check if we have a buffer */ + if (m != NULL) { + m_adj(m, ETHER_ALIGN); + + usbd_copy_out(pc, offset + msg.rm_dataoffset + + __offsetof(struct urndis_packet_msg, + rm_dataoffset), m->m_data, msg.rm_datalen); + + /* enqueue */ + uether_rxmbuf(&sc->sc_ue, m, msg.rm_datalen); + } else { + ifp->if_ierrors++; + } + offset += msg.rm_len; + actlen -= msg.rm_len; + } + + case USB_ST_SETUP: +tr_setup: + usbd_xfer_set_frame_len(xfer, 0, RNDIS_RX_MAXLEN); + usbd_xfer_set_frames(xfer, 1); + usbd_transfer_submit(xfer); + uether_rxflush(&sc->sc_ue); /* must be last */ + break; + + default: /* Error */ + DPRINTFN(1, "error = %s\n", usbd_errstr(error)); + + if (error != USB_ERR_CANCELLED) { + /* try to clear stall first */ + usbd_xfer_set_stall(xfer); + usbd_xfer_set_frames(xfer, 0); + usbd_transfer_submit(xfer); + } + break; + } +} + +static void +urndis_bulk_write_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct urndis_packet_msg msg; + struct urndis_softc *sc = usbd_xfer_softc(xfer); + struct ifnet *ifp = uether_getifp(&sc->sc_ue); + struct mbuf *m; + unsigned x; + int actlen; + int aframes; + + usbd_xfer_status(xfer, &actlen, NULL, &aframes, NULL); + + DPRINTFN(1, "\n"); + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + DPRINTFN(11, "%u bytes in %u frames\n", actlen, aframes); + + ifp->if_opackets++; + + /* FALLTHROUGH */ + case USB_ST_SETUP: +tr_setup: + memset(&msg, 0, sizeof(msg)); + + for (x = 0; x != RNDIS_TX_FRAMES_MAX; x++) { + struct usb_page_cache *pc = usbd_xfer_get_frame(xfer, x); + + usbd_xfer_set_frame_offset(xfer, x * RNDIS_TX_MAXLEN, x); + + next_pkt: + IFQ_DRV_DEQUEUE(&ifp->if_snd, m); + + if (m == NULL) + break; + + if ((m->m_pkthdr.len + sizeof(msg)) > RNDIS_TX_MAXLEN) { + DPRINTF("Too big packet\n"); + ifp->if_oerrors++; + + /* Free buffer */ + m_freem(m); + goto next_pkt; + } + msg.rm_type = htole32(REMOTE_NDIS_PACKET_MSG); + msg.rm_len = htole32(sizeof(msg) + m->m_pkthdr.len); + + msg.rm_dataoffset = htole32(RNDIS_DATA_OFFSET); + msg.rm_datalen = htole32(m->m_pkthdr.len); + + /* copy in all data */ + usbd_copy_in(pc, 0, &msg, sizeof(msg)); + usbd_m_copy_in(pc, sizeof(msg), m, 0, m->m_pkthdr.len); + usbd_xfer_set_frame_len(xfer, x, sizeof(msg) + m->m_pkthdr.len); + + /* + * If there's a BPF listener, bounce a copy of + * this frame to him: + */ + BPF_MTAP(ifp, m); + + /* Free buffer */ + m_freem(m); + } + if (x != 0) { + usbd_xfer_set_frames(xfer, x); + usbd_transfer_submit(xfer); + } + break; + + default: /* Error */ + DPRINTFN(11, "transfer error, %s\n", usbd_errstr(error)); + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu Feb 6 09:57:28 2014 Return-Path: Delivered-To: svn-src-head@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 535EE4CF; Thu, 6 Feb 2014 09:57:28 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3BDF21BB2; Thu, 6 Feb 2014 09:57:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s169vSni053781; Thu, 6 Feb 2014 09:57:28 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s169vSDR053780; Thu, 6 Feb 2014 09:57:28 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201402060957.s169vSDR053780@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Thu, 6 Feb 2014 09:57:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261542 - head/usr.sbin/pwd_mkdb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2014 09:57:28 -0000 Author: des Date: Thu Feb 6 09:57:27 2014 New Revision: 261542 URL: http://svnweb.freebsd.org/changeset/base/261542 Log: Add -p to the example (why isn't this the default?) MFC after: 1 week Modified: head/usr.sbin/pwd_mkdb/pwd_mkdb.8 Modified: head/usr.sbin/pwd_mkdb/pwd_mkdb.8 ============================================================================== --- head/usr.sbin/pwd_mkdb/pwd_mkdb.8 Thu Feb 6 08:47:14 2014 (r261541) +++ head/usr.sbin/pwd_mkdb/pwd_mkdb.8 Thu Feb 6 09:57:27 2014 (r261542) @@ -147,7 +147,7 @@ A Version 7 format password file. Regenerate the password database after manually editing or replacing the password file: .Bd -literal -offset -indent -/usr/sbin/pwd_mkdb /etc/master.passwd +/usr/sbin/pwd_mkdb -p /etc/master.passwd .Ed .Sh COMPATIBILITY Previous versions of the system had a program similar to From owner-svn-src-head@FreeBSD.ORG Thu Feb 6 10:38:41 2014 Return-Path: Delivered-To: svn-src-head@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 18283F7B; Thu, 6 Feb 2014 10:38:41 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 031371149; Thu, 6 Feb 2014 10:38:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s16Acefo071152; Thu, 6 Feb 2014 10:38:40 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s16Ace7L071150; Thu, 6 Feb 2014 10:38:40 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201402061038.s16Ace7L071150@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 6 Feb 2014 10:38:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261543 - head/sys/dev/usb/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2014 10:38:41 -0000 Author: hselasky Date: Thu Feb 6 10:38:40 2014 New Revision: 261543 URL: http://svnweb.freebsd.org/changeset/base/261543 Log: Fix kernelbuild when full debugging features are enabled. Pointyhat: hselasky @ MFC after: 2 weeks Modified: head/sys/dev/usb/net/if_urndis.c head/sys/dev/usb/net/if_urndisreg.h Modified: head/sys/dev/usb/net/if_urndis.c ============================================================================== --- head/sys/dev/usb/net/if_urndis.c Thu Feb 6 09:57:27 2014 (r261542) +++ head/sys/dev/usb/net/if_urndis.c Thu Feb 6 10:38:40 2014 (r261543) @@ -838,7 +838,7 @@ urndis_bulk_read_callback(struct usb_xfe DPRINTF("invalid dataoffset %u larger than %u\n", msg.rm_dataoffset + msg.rm_datalen + (uint32_t)__offsetof(struct urndis_packet_msg, - rm_dataoffset)); + rm_dataoffset), actlen); goto tr_setup; } else if (msg.rm_datalen < (uint32_t)sizeof(struct ether_header)) { ifp->if_ierrors++; Modified: head/sys/dev/usb/net/if_urndisreg.h ============================================================================== --- head/sys/dev/usb/net/if_urndisreg.h Thu Feb 6 09:57:27 2014 (r261542) +++ head/sys/dev/usb/net/if_urndisreg.h Thu Feb 6 10:38:40 2014 (r261543) @@ -53,7 +53,7 @@ struct urndis_softc { #define URNDIS_LOCK(sc) mtx_lock(&(sc)->sc_mtx) #define URNDIS_UNLOCK(sc) mtx_unlock(&(sc)->sc_mtx) -#define URNDIS_LOCK_ASSERT(sc, what) mtx_assert(&(sc)->sc_mtx, (x)) +#define URNDIS_LOCK_ASSERT(sc, what) mtx_assert(&(sc)->sc_mtx, (what)) #define RNDIS_STATUS_BUFFER_OVERFLOW 0x80000005L #define RNDIS_STATUS_FAILURE 0xC0000001L From owner-svn-src-head@FreeBSD.ORG Thu Feb 6 10:47:48 2014 Return-Path: Delivered-To: svn-src-head@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 3A352A40; Thu, 6 Feb 2014 10:47:48 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 261B01286; Thu, 6 Feb 2014 10:47:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s16AlmGa075553; Thu, 6 Feb 2014 10:47:48 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s16AlliA075548; Thu, 6 Feb 2014 10:47:48 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201402061047.s16AlliA075548@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 6 Feb 2014 10:47:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261544 - head/sys/dev/usb/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2014 10:47:48 -0000 Author: hselasky Date: Thu Feb 6 10:47:47 2014 New Revision: 261544 URL: http://svnweb.freebsd.org/changeset/base/261544 Log: Resolve probe conflict for now. MFC after: 2 weeks Modified: head/sys/dev/usb/net/if_urndis.c Modified: head/sys/dev/usb/net/if_urndis.c ============================================================================== --- head/sys/dev/usb/net/if_urndis.c Thu Feb 6 10:38:40 2014 (r261543) +++ head/sys/dev/usb/net/if_urndis.c Thu Feb 6 10:47:47 2014 (r261544) @@ -170,8 +170,11 @@ static const struct usb_ether_methods ur }; static const STRUCT_USB_HOST_ID urndis_host_devs[] = { +#if 0 + /* XXX this entry has a conflict an entry the umodem driver XXX */ {USB_IFACE_CLASS(UICLASS_CDC), USB_IFACE_SUBCLASS(UISUBCLASS_ABSTRACT_CONTROL_MODEL), USB_IFACE_PROTOCOL(0xff)}, +#endif {USB_IFACE_CLASS(UICLASS_WIRELESS), USB_IFACE_SUBCLASS(UISUBCLASS_RF), USB_IFACE_PROTOCOL(UIPROTO_RNDIS)}, {USB_IFACE_CLASS(UICLASS_IAD), USB_IFACE_SUBCLASS(UISUBCLASS_SYNC), From owner-svn-src-head@FreeBSD.ORG Thu Feb 6 10:52:52 2014 Return-Path: Delivered-To: svn-src-head@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 94C94632; Thu, 6 Feb 2014 10:52:52 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 67508139C; Thu, 6 Feb 2014 10:52:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s16AqqwH079141; Thu, 6 Feb 2014 10:52:52 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s16Aqq9l079140; Thu, 6 Feb 2014 10:52:52 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201402061052.s16Aqq9l079140@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 6 Feb 2014 10:52:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261546 - head/etc/devd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2014 10:52:52 -0000 Author: hselasky Date: Thu Feb 6 10:52:51 2014 New Revision: 261546 URL: http://svnweb.freebsd.org/changeset/base/261546 Log: Regenerate usb.conf MFC after: 2 weeks Modified: head/etc/devd/usb.conf Modified: head/etc/devd/usb.conf ============================================================================== --- head/etc/devd/usb.conf Thu Feb 6 10:48:55 2014 (r261545) +++ head/etc/devd/usb.conf Thu Feb 6 10:52:51 2014 (r261546) @@ -5313,6 +5313,24 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "intclass" "0xe0"; + match "intsubclass" "0x01"; + match "intprotocol" "0x03"; + action "kldload -n if_urndis"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "intclass" "0xef"; + match "intsubclass" "0x01"; + match "intprotocol" "0x01"; + action "kldload -n if_urndis"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "intclass" "0xff"; match "intsubclass" "0x5d"; match "intprotocol" "0x01"; @@ -5381,5 +5399,5 @@ nomatch 32 { action "kldload -n umass"; }; -# 2619 USB entries processed +# 2621 USB entries processed From owner-svn-src-head@FreeBSD.ORG Thu Feb 6 11:38:40 2014 Return-Path: Delivered-To: svn-src-head@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 ABEE912E; Thu, 6 Feb 2014 11:38:40 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 967531913; Thu, 6 Feb 2014 11:38:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s16BceQS096269; Thu, 6 Feb 2014 11:38:40 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s16BceLv096268; Thu, 6 Feb 2014 11:38:40 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201402061138.s16BceLv096268@svn.freebsd.org> From: Aleksandr Rybalko Date: Thu, 6 Feb 2014 11:38:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261547 - head/sys/teken X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2014 11:38:40 -0000 Author: ray Date: Thu Feb 6 11:38:39 2014 New Revision: 261547 URL: http://svnweb.freebsd.org/changeset/base/261547 Log: Fix crash on load of bigger font. It reduce width and height of terminal, but current cursor position stay bigger that terminal window size, so next input triggers assert. Reported by: emaste Sponsored by: The FreeBSD Foundation Modified: head/sys/teken/teken.c Modified: head/sys/teken/teken.c ============================================================================== --- head/sys/teken/teken.c Thu Feb 6 10:52:51 2014 (r261546) +++ head/sys/teken/teken.c Thu Feb 6 11:38:39 2014 (r261547) @@ -338,10 +338,26 @@ teken_get_winsize(teken_t *t) return (&t->t_winsize); } +static void +taken_trim_cursor_pos(teken_t *t, const teken_pos_t *new) +{ + const teken_pos_t *cur; + + cur = &t->t_winsize; + + if (cur->tp_row < new->tp_row || cur->tp_col < new->tp_col) + return; + if (t->t_cursor.tp_row >= new->tp_row) + t->t_cursor.tp_row = new->tp_row - 1; + if (t->t_cursor.tp_col >= new->tp_col) + t->t_cursor.tp_col = new->tp_col - 1; +} + void teken_set_winsize(teken_t *t, const teken_pos_t *p) { + taken_trim_cursor_pos(t, p); t->t_winsize = *p; teken_subr_do_reset(t); } @@ -350,6 +366,7 @@ void teken_set_winsize_noreset(teken_t *t, const teken_pos_t *p) { + taken_trim_cursor_pos(t, p); t->t_winsize = *p; teken_subr_do_resize(t); } From owner-svn-src-head@FreeBSD.ORG Thu Feb 6 12:24:59 2014 Return-Path: Delivered-To: svn-src-head@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 0167851D; Thu, 6 Feb 2014 12:24:59 +0000 (UTC) Received: from smarthost1.greenhost.nl (smarthost1.greenhost.nl [195.190.28.81]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AB8421D9F; Thu, 6 Feb 2014 12:24:57 +0000 (UTC) Received: from smtp.greenhost.nl ([213.108.104.138]) by smarthost1.greenhost.nl with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1WBO0l-0001xb-6P; Thu, 06 Feb 2014 13:24:55 +0100 Content-Type: text/plain; charset=iso-8859-15; format=flowed; delsp=yes To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "Aleksandr Rybalko" Subject: Re: svn commit: r261547 - head/sys/teken References: <201402061138.s16BceLv096268@svn.freebsd.org> Date: Thu, 06 Feb 2014 13:24:53 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: "Ronald Klop" Message-ID: In-Reply-To: <201402061138.s16BceLv096268@svn.freebsd.org> User-Agent: Opera Mail/12.16 (Win32) X-Authenticated-As-Hash: 398f5522cb258ce43cb679602f8cfe8b62a256d1 X-Virus-Scanned: by clamav at smarthost1.samage.net X-Spam-Level: / X-Spam-Score: 0.8 X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.1 X-Scan-Signature: 2c269fdec788119c0964d98755c55204 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2014 12:24:59 -0000 On Thu, 06 Feb 2014 12:38:40 +0100, Aleksandr Rybalko wrote: > Author: ray > Date: Thu Feb 6 11:38:39 2014 > New Revision: 261547 > URL: http://svnweb.freebsd.org/changeset/base/261547 > > Log: > Fix crash on load of bigger font. It reduce width and height of > terminal, but > current cursor position stay bigger that terminal window size, so next > input > triggers assert. > Reported by: emaste > Sponsored by: The FreeBSD Foundation > > Modified: > head/sys/teken/teken.c > > Modified: head/sys/teken/teken.c > ============================================================================== > --- head/sys/teken/teken.c Thu Feb 6 10:52:51 2014 (r261546) > +++ head/sys/teken/teken.c Thu Feb 6 11:38:39 2014 (r261547) > @@ -338,10 +338,26 @@ teken_get_winsize(teken_t *t) > return (&t->t_winsize); > } > +static void > +taken_trim_cursor_pos(teken_t *t, const teken_pos_t *new) Was teken... already taken? Ronald. > +{ > + const teken_pos_t *cur; > + > + cur = &t->t_winsize; > + > + if (cur->tp_row < new->tp_row || cur->tp_col < new->tp_col) > + return; > + if (t->t_cursor.tp_row >= new->tp_row) > + t->t_cursor.tp_row = new->tp_row - 1; > + if (t->t_cursor.tp_col >= new->tp_col) > + t->t_cursor.tp_col = new->tp_col - 1; > +} > + > void > teken_set_winsize(teken_t *t, const teken_pos_t *p) > { > + taken_trim_cursor_pos(t, p); > t->t_winsize = *p; > teken_subr_do_reset(t); > } > @@ -350,6 +366,7 @@ void > teken_set_winsize_noreset(teken_t *t, const teken_pos_t *p) > { > + taken_trim_cursor_pos(t, p); > t->t_winsize = *p; > teken_subr_do_resize(t); > } > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-svn-src-head@FreeBSD.ORG Thu Feb 6 12:43:06 2014 Return-Path: Delivered-To: svn-src-head@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 C780CD28; Thu, 6 Feb 2014 12:43:06 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B21861087; Thu, 6 Feb 2014 12:43:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s16Ch6Z7024984; Thu, 6 Feb 2014 12:43:06 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s16Ch6dW024982; Thu, 6 Feb 2014 12:43:06 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402061243.s16Ch6dW024982@svn.freebsd.org> From: Christian Brueffer Date: Thu, 6 Feb 2014 12:43:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261549 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2014 12:43:07 -0000 Author: brueffer Date: Thu Feb 6 12:43:06 2014 New Revision: 261549 URL: http://svnweb.freebsd.org/changeset/base/261549 Log: Add a manpage for the urndis driver. Obtained from: OpenBSD Added: head/share/man/man4/urndis.4 (contents, props changed) Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Thu Feb 6 11:40:01 2014 (r261548) +++ head/share/man/man4/Makefile Thu Feb 6 12:43:06 2014 (r261549) @@ -527,6 +527,7 @@ MAN= aac.4 \ uplcom.4 \ ural.4 \ urio.4 \ + urndis.4 \ ${_urtw.4} \ urtwn.4 \ urtwnfw.4 \ @@ -716,6 +717,7 @@ MLINKS+=uath.4 if_uath.4 MLINKS+=udav.4 if_udav.4 MLINKS+=upgt.4 if_upgt.4 MLINKS+=ural.4 if_ural.4 +MLINKS+=urndis.4 if_urndis.4 MLINKS+=${_urtw.4} ${_if_urtw.4} MLINKS+=vge.4 if_vge.4 MLINKS+=vlan.4 if_vlan.4 Added: head/share/man/man4/urndis.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/urndis.4 Thu Feb 6 12:43:06 2014 (r261549) @@ -0,0 +1,97 @@ +.\" Copyright (c) 2010 Michael Knudsen +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" +.\" - Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" - 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 COPYRIGHT HOLDERS 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 +.\" COPYRIGHT HOLDERS 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. +.\" +.\" $OpenBSD: urndis.4,v 1.15 2013/07/16 16:05:49 schwarze Exp $ +.\" +.\" $FreeBSD$ +.\" +.Dd February 6, 2014 +.Dt URNDIS 4 +.Os +.Sh NAME +.Nm urndis +.Nd USB Remote NDIS Ethernet device +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device ehci" +.Cd "device uhci" +.Cd "device ohci" +.Cd "device xhci" +.Cd "device usb" +.Cd "device urndis" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +if_urndis_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides Ethernet access over Remote NDIS (RNDIS), +allowing mobile devices such as phones and tablets to provide network access. +It is often referred to as USB tethering, +and in most cases must be explicitly enabled on the device. +.Pp +.Nm +should work with any USB RNDIS devices, +such as those commonly found on Android devices. +It does not support different media types or options. +For more information on configuring this device, see +.Xr ifconfig 8 . +.Sh SEE ALSO +.Xr arp 4 , +.Xr netintro 4 , +.Xr usb 4 , +.Xr ifconfig 8 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Ox 4.7 . +The first +.Fx +release to include it was +.Fx 10.1 . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An Jonathan Armani Aq Mt armani@openbsd.org , +.An Michael Knudsen Aq Mt mk@openbsd.org , +and +.An Fabien Romano Aq Mt fabien@openbsd.org . +It was ported to +.Fx +by +.An Hans Petter Selasky Aq Mt hps@FreeBSD.org . From owner-svn-src-head@FreeBSD.ORG Thu Feb 6 13:18:11 2014 Return-Path: Delivered-To: svn-src-head@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 2229B15C; Thu, 6 Feb 2014 13:18:11 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 001B01398; Thu, 6 Feb 2014 13:18:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s16DIAjl037978; Thu, 6 Feb 2014 13:18:10 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s16DIALR037977; Thu, 6 Feb 2014 13:18:10 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201402061318.s16DIALR037977@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 6 Feb 2014 13:18:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261550 - head/tools/regression/sockets/unix_passfd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2014 13:18:11 -0000 Author: glebius Date: Thu Feb 6 13:18:10 2014 New Revision: 261550 URL: http://svnweb.freebsd.org/changeset/base/261550 Log: Add test case for kern/181741. Right now test fails. PR: 181741 Sponsored by: Nginx, Inc. Modified: head/tools/regression/sockets/unix_passfd/unix_passfd.c Modified: head/tools/regression/sockets/unix_passfd/unix_passfd.c ============================================================================== --- head/tools/regression/sockets/unix_passfd/unix_passfd.c Thu Feb 6 12:43:06 2014 (r261549) +++ head/tools/regression/sockets/unix_passfd/unix_passfd.c Thu Feb 6 13:18:10 2014 (r261550) @@ -29,11 +29,14 @@ #include #include #include +#include +#include #include #include #include #include +#include #include #include @@ -106,11 +109,10 @@ samefile(const char *test, struct stat * } static void -sendfd(const char *test, int sockfd, int sendfd) +sendfd_payload(const char *test, int sockfd, int sendfd, + void *payload, size_t paylen) { struct iovec iovec; - char ch; - char message[CMSG_SPACE(sizeof(int))]; struct cmsghdr *cmsghdr; struct msghdr msghdr; @@ -118,13 +120,12 @@ sendfd(const char *test, int sockfd, int bzero(&msghdr, sizeof(msghdr)); bzero(&message, sizeof(message)); - ch = 0; msghdr.msg_control = message; msghdr.msg_controllen = sizeof(message); - iovec.iov_base = &ch; - iovec.iov_len = sizeof(ch); + iovec.iov_base = payload; + iovec.iov_len = paylen; msghdr.msg_iov = &iovec; msghdr.msg_iovlen = 1; @@ -138,33 +139,35 @@ sendfd(const char *test, int sockfd, int len = sendmsg(sockfd, &msghdr, 0); if (len < 0) err(-1, "%s: sendmsg", test); - if (len != sizeof(ch)) + if (len != paylen) errx(-1, "%s: sendmsg: %zd bytes sent", test, len); } static void -recvfd(const char *test, int sockfd, int *recvfd) +sendfd(const char *test, int sockfd, int sendfd) +{ + char ch; + + return (sendfd_payload(test, sockfd, sendfd, &ch, sizeof(ch))); +} + +static void +recvfd_payload(const char *test, int sockfd, int *recvfd, + void *buf, size_t buflen) { struct cmsghdr *cmsghdr; - char message[CMSG_SPACE(sizeof(int))]; + char message[CMSG_SPACE(SOCKCREDSIZE(CMGROUP_MAX)) + sizeof(int)]; struct msghdr msghdr; struct iovec iovec; ssize_t len; - char ch; bzero(&msghdr, sizeof(msghdr)); - ch = 0; msghdr.msg_control = message; msghdr.msg_controllen = sizeof(message); - iovec.iov_base = &ch; - iovec.iov_len = sizeof(ch); - - msghdr.msg_iov = &iovec; - msghdr.msg_iovlen = 1; - - iovec.iov_len = sizeof(ch); + iovec.iov_base = buf; + iovec.iov_len = buflen; msghdr.msg_iov = &iovec; msghdr.msg_iovlen = 1; @@ -172,19 +175,33 @@ recvfd(const char *test, int sockfd, int len = recvmsg(sockfd, &msghdr, 0); if (len < 0) err(-1, "%s: recvmsg", test); - if (len != sizeof(ch)) + if (len != buflen) errx(-1, "%s: recvmsg: %zd bytes received", test, len); + cmsghdr = CMSG_FIRSTHDR(&msghdr); if (cmsghdr == NULL) errx(-1, "%s: recvmsg: did not receive control message", test); - if (cmsghdr->cmsg_len != CMSG_LEN(sizeof(int)) || - cmsghdr->cmsg_level != SOL_SOCKET || - cmsghdr->cmsg_type != SCM_RIGHTS) + *recvfd = -1; + for (; cmsghdr != NULL; cmsghdr = CMSG_NXTHDR(&msghdr, cmsghdr)) { + if (cmsghdr->cmsg_level == SOL_SOCKET && + cmsghdr->cmsg_type == SCM_RIGHTS && + cmsghdr->cmsg_len == CMSG_LEN(sizeof(int))) { + *recvfd = *(int *)CMSG_DATA(cmsghdr); + if (*recvfd == -1) + errx(-1, "%s: recvmsg: received fd -1", test); + } + } + if (*recvfd == -1) errx(-1, "%s: recvmsg: did not receive single-fd message", test); - *recvfd = *(int *)CMSG_DATA(cmsghdr); - if (*recvfd == -1) - errx(-1, "%s: recvmsg: received fd -1", test); +} + +static void +recvfd(const char *test, int sockfd, int *recvfd) +{ + char ch; + + return (recvfd_payload(test, sockfd, recvfd, &ch, sizeof(ch))); } int @@ -330,6 +347,43 @@ main(int argc, char *argv[]) closesocketpair(fd); printf("%s passed\n", test); + + /* + * Test for PR 181741. Receiver sets LOCAL_CREDS, and kernel + * prepends a control message to the data. Sender sends large + * payload. Payload + SCM_RIGHTS + LOCAL_CREDS hit socket buffer + * limit, and receiver receives truncated data. + */ + test = "test8-rigths+creds+payload"; + printf("beginning %s\n", test); + + { + const int on = 1; + u_long sendspace; + size_t len; + void *buf; + + len = sizeof(sendspace); + if (sysctlbyname("net.local.stream.sendspace", &sendspace, + &len, NULL, 0) < 0) + err(-1, "%s: sysctlbyname(net.local.stream.sendspace)", + test); + + if ((buf = malloc(sendspace)) == NULL) + err(-1, "%s: malloc", test); + + domainsocketpair(test, fd); + if (setsockopt(fd[1], 0, LOCAL_CREDS, &on, sizeof(on)) < 0) + err(-1, "%s: setsockopt(LOCAL_CREDS)", test); + tempfile(test, &putfd_1); + sendfd_payload(test, fd[0], putfd_1, buf, sendspace); + recvfd_payload(test, fd[1], &getfd_1, buf, sendspace); + close(putfd_1); + close(getfd_1); + closesocketpair(fd); + } + + printf("%s passed\n", test); return (0); } From owner-svn-src-head@FreeBSD.ORG Thu Feb 6 13:28:07 2014 Return-Path: Delivered-To: svn-src-head@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 30847873; Thu, 6 Feb 2014 13:28:07 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1A44B14C2; Thu, 6 Feb 2014 13:28:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s16DS65o042078; Thu, 6 Feb 2014 13:28:06 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s16DS64h042077; Thu, 6 Feb 2014 13:28:06 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201402061328.s16DS64h042077@svn.freebsd.org> From: Aleksandr Rybalko Date: Thu, 6 Feb 2014 13:28:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261551 - head/sys/teken X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2014 13:28:07 -0000 Author: ray Date: Thu Feb 6 13:28:06 2014 New Revision: 261551 URL: http://svnweb.freebsd.org/changeset/base/261551 Log: Fix typo. Pointed by: Ronald Klop Pointy hat: ray Sponsored by: The FreeBSD Foundation Modified: head/sys/teken/teken.c Modified: head/sys/teken/teken.c ============================================================================== --- head/sys/teken/teken.c Thu Feb 6 13:18:10 2014 (r261550) +++ head/sys/teken/teken.c Thu Feb 6 13:28:06 2014 (r261551) @@ -339,7 +339,7 @@ teken_get_winsize(teken_t *t) } static void -taken_trim_cursor_pos(teken_t *t, const teken_pos_t *new) +teken_trim_cursor_pos(teken_t *t, const teken_pos_t *new) { const teken_pos_t *cur; @@ -357,7 +357,7 @@ void teken_set_winsize(teken_t *t, const teken_pos_t *p) { - taken_trim_cursor_pos(t, p); + teken_trim_cursor_pos(t, p); t->t_winsize = *p; teken_subr_do_reset(t); } @@ -366,7 +366,7 @@ void teken_set_winsize_noreset(teken_t *t, const teken_pos_t *p) { - taken_trim_cursor_pos(t, p); + teken_trim_cursor_pos(t, p); t->t_winsize = *p; teken_subr_do_resize(t); } From owner-svn-src-head@FreeBSD.ORG Thu Feb 6 13:35:09 2014 Return-Path: Delivered-To: svn-src-head@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 5FC11F71; Thu, 6 Feb 2014 13:35:09 +0000 (UTC) Received: from smtp.dlink.ua (smtp.dlink.ua [193.138.187.146]) by mx1.freebsd.org (Postfix) with ESMTP id 17B4D15CC; Thu, 6 Feb 2014 13:35:08 +0000 (UTC) Received: from terran (unknown [192.168.99.1]) (Authenticated sender: ray) by smtp.dlink.ua (Postfix) with ESMTPA id 23A92C497E; Thu, 6 Feb 2014 15:29:09 +0200 (EET) Date: Thu, 6 Feb 2014 15:32:29 +0200 From: Aleksandr Rybalko To: "Ronald Klop" Subject: Re: svn commit: r261547 - head/sys/teken Message-Id: <20140206153229.1afa30afc5c7ccec45adde86@freebsd.org> In-Reply-To: References: <201402061138.s16BceLv096268@svn.freebsd.org> X-Mailer: Sylpheed 3.2.0 (GTK+ 2.24.6; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2014 13:35:09 -0000 On Thu, 06 Feb 2014 13:24:53 +0100 "Ronald Klop" wrote: > On Thu, 06 Feb 2014 12:38:40 +0100, Aleksandr Rybalko > wrote: > > > Author: ray > > Date: Thu Feb 6 11:38:39 2014 > > New Revision: 261547 > > URL: http://svnweb.freebsd.org/changeset/base/261547 > > > > Log: > > Fix crash on load of bigger font. It reduce width and height of > > terminal, but > > current cursor position stay bigger that terminal window size, so next > > input > > triggers assert. > > Reported by: emaste > > Sponsored by: The FreeBSD Foundation > > > > Modified: > > head/sys/teken/teken.c > > > > Modified: head/sys/teken/teken.c > > ============================================================================== > > --- head/sys/teken/teken.c Thu Feb 6 10:52:51 2014 (r261546) > > +++ head/sys/teken/teken.c Thu Feb 6 11:38:39 2014 (r261547) > > @@ -338,10 +338,26 @@ teken_get_winsize(teken_t *t) > > return (&t->t_winsize); > > } > > +static void > > +taken_trim_cursor_pos(teken_t *t, const teken_pos_t *new) > > Was teken... already taken? Oops. it is almost taken :) Fixed in r261551. Thanks Ronald! > > > Ronald. > > > > +{ > > + const teken_pos_t *cur; > > + > > + cur = &t->t_winsize; > > + > > + if (cur->tp_row < new->tp_row || cur->tp_col < new->tp_col) > > + return; > > + if (t->t_cursor.tp_row >= new->tp_row) > > + t->t_cursor.tp_row = new->tp_row - 1; > > + if (t->t_cursor.tp_col >= new->tp_col) > > + t->t_cursor.tp_col = new->tp_col - 1; > > +} > > + > > void > > teken_set_winsize(teken_t *t, const teken_pos_t *p) > > { > > + taken_trim_cursor_pos(t, p); > > t->t_winsize = *p; > > teken_subr_do_reset(t); > > } > > @@ -350,6 +366,7 @@ void > > teken_set_winsize_noreset(teken_t *t, const teken_pos_t *p) > > { > > + taken_trim_cursor_pos(t, p); > > t->t_winsize = *p; > > teken_subr_do_resize(t); > > } > > _______________________________________________ > > svn-src-all@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/svn-src-all > > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" WBW -- Aleksandr Rybalko From owner-svn-src-head@FreeBSD.ORG Thu Feb 6 15:12:44 2014 Return-Path: Delivered-To: svn-src-head@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 D39D6D25; Thu, 6 Feb 2014 15:12:44 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BC59410FE; Thu, 6 Feb 2014 15:12:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s16FCixX086892; Thu, 6 Feb 2014 15:12:44 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s16FCihd086890; Thu, 6 Feb 2014 15:12:44 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201402061512.s16FCihd086890@svn.freebsd.org> From: Aleksandr Rybalko Date: Thu, 6 Feb 2014 15:12:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261552 - in head/sys/dev/vt: . hw/fb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2014 15:12:45 -0000 Author: ray Date: Thu Feb 6 15:12:44 2014 New Revision: 261552 URL: http://svnweb.freebsd.org/changeset/base/261552 Log: Add two new vt(9) driver methods: vd_drawrect and vd_setpixel. Implement vd_drawrect and vd_setpixel for vt_fb driver. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/hw/fb/vt_fb.c head/sys/dev/vt/vt.h Modified: head/sys/dev/vt/hw/fb/vt_fb.c ============================================================================== --- head/sys/dev/vt/hw/fb/vt_fb.c Thu Feb 6 13:28:06 2014 (r261551) +++ head/sys/dev/vt/hw/fb/vt_fb.c Thu Feb 6 15:12:44 2014 (r261552) @@ -45,11 +45,16 @@ static int vt_fb_ioctl(struct vt_device struct thread *td); static int vt_fb_mmap(struct vt_device *vd, vm_ooffset_t offset, vm_paddr_t *paddr, int prot, vm_memattr_t *memattr); +void vt_fb_drawrect(struct vt_device *vd, int x1, int y1, int x2, int y2, + int fill, term_color_t color); +void vt_fb_setpixel(struct vt_device *vd, int x, int y, term_color_t color); static struct vt_driver vt_fb_driver = { .vd_init = vt_fb_init, .vd_blank = vt_fb_blank, .vd_bitbltchr = vt_fb_bitbltchr, + .vd_drawrect = vt_fb_drawrect, + .vd_setpixel = vt_fb_setpixel, .vd_postswitch = vt_fb_postswitch, .vd_priority = VD_PRIORITY_GENERIC+10, .vd_fb_ioctl = vt_fb_ioctl, @@ -84,6 +89,56 @@ vt_fb_mmap(struct vt_device *vd, vm_ooff } void +vt_fb_setpixel(struct vt_device *vd, int x, int y, term_color_t color) +{ + struct fb_info *info; + uint32_t c; + u_int o; + + info = vd->vd_softc; + c = info->fb_cmap[color]; + o = info->fb_stride * y + x * FBTYPE_GET_BYTESPP(info); + + switch (FBTYPE_GET_BYTESPP(info)) { + case 1: + info->wr1(info, o, c); + break; + case 2: + info->wr2(info, o, c); + break; + case 3: + info->wr1(info, o, (c >> 16) & 0xff); + info->wr1(info, o + 1, (c >> 8) & 0xff); + info->wr1(info, o + 2, c & 0xff); + break; + case 4: + info->wr4(info, o, c); + break; + default: + /* panic? */ + return; + } + +} + +void +vt_fb_drawrect(struct vt_device *vd, int x1, int y1, int x2, int y2, int fill, + term_color_t color) +{ + int x, y; + + for (y = y1; y <= y2; y++) { + if (fill || (y == y1) || (y == y2)) { + for (x = x1; x <= x2; x++) + vt_fb_setpixel(vd, x, y, color); + } else { + vt_fb_setpixel(vd, x1, y, color); + vt_fb_setpixel(vd, x2, y, color); + } + } +} + +void vt_fb_blank(struct vt_device *vd, term_color_t color) { struct fb_info *info; Modified: head/sys/dev/vt/vt.h ============================================================================== --- head/sys/dev/vt/vt.h Thu Feb 6 13:28:06 2014 (r261551) +++ head/sys/dev/vt/vt.h Thu Feb 6 15:12:44 2014 (r261552) @@ -287,6 +287,9 @@ typedef void vd_putchar_t(struct vt_devi typedef int vd_fb_ioctl_t(struct vt_device *, u_long, caddr_t, struct thread *); typedef int vd_fb_mmap_t(struct vt_device *, vm_ooffset_t, vm_paddr_t *, int, vm_memattr_t *); +typedef void vd_drawrect_t(struct vt_device *, int, int, int, int, int, + term_color_t); +typedef void vd_setpixel_t(struct vt_device *, int, int, term_color_t); struct vt_driver { /* Console attachment. */ @@ -295,6 +298,8 @@ struct vt_driver { /* Drawing. */ vd_blank_t *vd_blank; vd_bitbltchr_t *vd_bitbltchr; + vd_drawrect_t *vd_drawrect; + vd_setpixel_t *vd_setpixel; /* Framebuffer ioctls, if present. */ vd_fb_ioctl_t *vd_fb_ioctl; From owner-svn-src-head@FreeBSD.ORG Thu Feb 6 15:16:39 2014 Return-Path: Delivered-To: svn-src-head@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 09B90F7C; Thu, 6 Feb 2014 15:16:39 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E82581137; Thu, 6 Feb 2014 15:16:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s16FGcjN087442; Thu, 6 Feb 2014 15:16:38 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s16FGcC5087441; Thu, 6 Feb 2014 15:16:38 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201402061516.s16FGcC5087441@svn.freebsd.org> From: Aleksandr Rybalko Date: Thu, 6 Feb 2014 15:16:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261553 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2014 15:16:39 -0000 Author: ray Date: Thu Feb 6 15:16:38 2014 New Revision: 261553 URL: http://svnweb.freebsd.org/changeset/base/261553 Log: Add vt_set_border function to help to change border color. Use vt_set_border to reset color after font changed (different font size may change border sizes) Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Thu Feb 6 15:12:44 2014 (r261552) +++ head/sys/dev/vt/vt_core.c Thu Feb 6 15:16:38 2014 (r261553) @@ -1045,6 +1045,30 @@ vt_change_font(struct vt_window *vw, str } static int +vt_set_border(struct vt_window *vw, struct vt_font *vf, term_color_t c) +{ + struct vt_device *vd = vw->vw_device; + int l, r, t, b, w, h; + + if (vd->vd_driver->vd_drawrect == NULL) + return (ENOTSUP); + + w = vd->vd_width - 1; + h = vd->vd_height - 1; + l = vd->vd_offset.tp_col - 1; + r = w - l; + t = vd->vd_offset.tp_row - 1; + b = h - t; + + vd->vd_driver->vd_drawrect(vd, 0, 0, w, t, 1, c); /* Top bar. */ + vd->vd_driver->vd_drawrect(vd, 0, t, l, b, 1, c); /* Left bar. */ + vd->vd_driver->vd_drawrect(vd, r, t, w, b, 1, c); /* Right bar. */ + vd->vd_driver->vd_drawrect(vd, 0, b, w, h, 1, c); /* Bottom bar. */ + + return (0); +} + +static int vt_proc_alive(struct vt_window *vw) { struct proc *p; @@ -1562,6 +1586,10 @@ skip_thunk: return (error); error = vt_change_font(vw, vf); + if (error == 0) { + /* XXX: replace 0 with current bg color. */ + vt_set_border(vw, vf, 0); + } vtfont_unref(vf); return (error); } From owner-svn-src-head@FreeBSD.ORG Thu Feb 6 15:55:30 2014 Return-Path: Delivered-To: svn-src-head@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 06B1A79A; Thu, 6 Feb 2014 15:55: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E3A9B1592; Thu, 6 Feb 2014 15:55:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s16FtTcw002729; Thu, 6 Feb 2014 15:55:29 GMT (envelope-from dwmalone@svn.freebsd.org) Received: (from dwmalone@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s16FtTQj002728; Thu, 6 Feb 2014 15:55:29 GMT (envelope-from dwmalone@svn.freebsd.org) Message-Id: <201402061555.s16FtTQj002728@svn.freebsd.org> From: David Malone Date: Thu, 6 Feb 2014 15:55:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261555 - head/usr.bin/units X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2014 15:55:30 -0000 Author: dwmalone Date: Thu Feb 6 15:55:29 2014 New Revision: 261555 URL: http://svnweb.freebsd.org/changeset/base/261555 Log: Let units deal with Gas Mark and Stufe. Modified: head/usr.bin/units/units.lib Modified: head/usr.bin/units/units.lib ============================================================================== --- head/usr.bin/units/units.lib Thu Feb 6 15:46:33 2014 (r261554) +++ head/usr.bin/units/units.lib Thu Feb 6 15:55:29 2014 (r261555) @@ -679,6 +679,8 @@ degreesrankine 5|9 K degrankine degreesrankine degreerankine degreesrankine degreaumur 10|8&+273.15 K +gasmark 25|1&250 degF +Stufe 25|1&125 degC drachm 60 grain poncelet 100 kg m g / sec denier .05|450 gram / m From owner-svn-src-head@FreeBSD.ORG Thu Feb 6 18:40:39 2014 Return-Path: Delivered-To: svn-src-head@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 AB3C3F95; Thu, 6 Feb 2014 18:40:39 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 970DE16EC; Thu, 6 Feb 2014 18:40:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s16Ied2U070099; Thu, 6 Feb 2014 18:40:39 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s16Iedd0070096; Thu, 6 Feb 2014 18:40:39 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201402061840.s16Iedd0070096@svn.freebsd.org> From: Scott Long Date: Thu, 6 Feb 2014 18:40:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261558 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2014 18:40:39 -0000 Author: scottl Date: Thu Feb 6 18:40:38 2014 New Revision: 261558 URL: http://svnweb.freebsd.org/changeset/base/261558 Log: Add a new sysctl, dev.cxgbe.N.rsrv_noflow, and a companion tunable, hw.cxgbe.rsrv_noflow. When set, queue 0 of the port is reserved for TX packets without a flowid. The hash value of packets with a flowid is bumped up by 1. The intent is to provide a private queue for link-level packets like LACP that is unlikely to overflow or suffer deep queue latency. Reviewed by: np Obtained from: Netflix MFC after: 3 days Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Thu Feb 6 17:57:23 2014 (r261557) +++ head/sys/dev/cxgbe/adapter.h Thu Feb 6 18:40:38 2014 (r261558) @@ -215,6 +215,7 @@ struct port_info { /* These need to be int as they are used in sysctl */ int ntxq; /* # of tx queues */ int first_txq; /* index of first tx queue */ + int rsrv_noflowq; /* Reserve queue 0 for non-flowid packets */ int nrxq; /* # of rx queues */ int first_rxq; /* index of first rx queue */ #ifdef TCP_OFFLOAD Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu Feb 6 17:57:23 2014 (r261557) +++ head/sys/dev/cxgbe/t4_main.c Thu Feb 6 18:40:38 2014 (r261558) @@ -197,6 +197,9 @@ TUNABLE_INT("hw.cxgbe.ntxq1g", &t4_ntxq1 static int t4_nrxq1g = -1; TUNABLE_INT("hw.cxgbe.nrxq1g", &t4_nrxq1g); +static int t4_rsrv_noflowq = 0; +TUNABLE_INT("hw.cxgbe.rsrv_noflowq", &t4_rsrv_noflowq); + #ifdef TCP_OFFLOAD #define NOFLDTXQ_10G 8 static int t4_nofldtxq10g = -1; @@ -299,6 +302,7 @@ struct intrs_and_queues { int nrxq10g; /* # of NIC rxq's for each 10G port */ int ntxq1g; /* # of NIC txq's for each 1G port */ int nrxq1g; /* # of NIC rxq's for each 1G port */ + int rsrv_noflowq; /* Flag whether to reserve queue 0 */ #ifdef TCP_OFFLOAD int nofldtxq10g; /* # of TOE txq's for each 10G port */ int nofldrxq10g; /* # of TOE rxq's for each 10G port */ @@ -375,6 +379,7 @@ static int cxgbe_sysctls(struct port_inf static int sysctl_int_array(SYSCTL_HANDLER_ARGS); static int sysctl_bitfield(SYSCTL_HANDLER_ARGS); static int sysctl_btphy(SYSCTL_HANDLER_ARGS); +static int sysctl_noflowq(SYSCTL_HANDLER_ARGS); static int sysctl_holdoff_tmr_idx(SYSCTL_HANDLER_ARGS); static int sysctl_holdoff_pktc_idx(SYSCTL_HANDLER_ARGS); static int sysctl_qsize_rxq(SYSCTL_HANDLER_ARGS); @@ -783,6 +788,11 @@ t4_attach(device_t dev) pi->ntxq = iaq.ntxq1g; } + if (pi->ntxq > 1) + pi->rsrv_noflowq = iaq.rsrv_noflowq ? 1 : 0; + else + pi->rsrv_noflowq = 0; + rqidx += pi->nrxq; tqidx += pi->ntxq; @@ -1283,7 +1293,8 @@ cxgbe_transmit(struct ifnet *ifp, struct } if (m->m_flags & M_FLOWID) - txq += (m->m_pkthdr.flowid % pi->ntxq); + txq += ((m->m_pkthdr.flowid % (pi->ntxq - pi->rsrv_noflowq)) + + pi->rsrv_noflowq); br = txq->br; if (TXQ_TRYLOCK(txq) == 0) { @@ -1735,6 +1746,7 @@ cfg_itype_and_nqueues(struct adapter *sc iaq->ntxq1g = t4_ntxq1g; iaq->nrxq10g = nrxq10g = t4_nrxq10g; iaq->nrxq1g = nrxq1g = t4_nrxq1g; + iaq->rsrv_noflowq = t4_rsrv_noflowq; #ifdef TCP_OFFLOAD if (is_offload(sc)) { iaq->nofldtxq10g = t4_nofldtxq10g; @@ -4548,6 +4560,9 @@ cxgbe_sysctls(struct port_info *pi) &pi->first_rxq, 0, "index of first rx queue"); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "first_txq", CTLFLAG_RD, &pi->first_txq, 0, "index of first tx queue"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "rsrv_noflowq", CTLTYPE_INT | + CTLFLAG_RW, pi, 0, sysctl_noflowq, "IU", + "Reserve queue 0 for non-flowid packets"); #ifdef TCP_OFFLOAD if (is_offload(sc)) { @@ -4802,6 +4817,25 @@ sysctl_btphy(SYSCTL_HANDLER_ARGS) } static int +sysctl_noflowq(SYSCTL_HANDLER_ARGS) +{ + struct port_info *pi = arg1; + int rc, val; + + val = pi->rsrv_noflowq; + rc = sysctl_handle_int(oidp, &val, 0, req); + if (rc != 0 || req->newptr == NULL) + return (rc); + + if ((val >= 1) && (pi->ntxq > 1)) + pi->rsrv_noflowq = 1; + else + pi->rsrv_noflowq = 0; + + return (rc); +} + +static int sysctl_holdoff_tmr_idx(SYSCTL_HANDLER_ARGS) { struct port_info *pi = arg1; From owner-svn-src-head@FreeBSD.ORG Thu Feb 6 19:22:19 2014 Return-Path: Delivered-To: svn-src-head@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 54F17818; Thu, 6 Feb 2014 19:22:19 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 281531B14; Thu, 6 Feb 2014 19:22:19 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 0056FB9E0; Thu, 6 Feb 2014 14:22:17 -0500 (EST) From: John Baldwin To: Gavin Atkinson Subject: Re: svn commit: r261216 - head/sys/dev/pccbb Date: Thu, 6 Feb 2014 14:08:55 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201401271949.s0RJnr7t067977@svn.freebsd.org> <201402041424.54122.jhb@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201402061408.55990.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 06 Feb 2014 14:22:18 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, imp@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2014 19:22:19 -0000 On Wednesday, February 05, 2014 7:26:33 pm Gavin Atkinson wrote: > On Tue, 4 Feb 2014, John Baldwin wrote: > > On Sunday, February 02, 2014 5:34:58 pm Gavin Atkinson wrote: > > > On Mon, 27 Jan 2014, John Baldwin wrote: > > > > Author: jhb > > > > Date: Mon Jan 27 19:49:52 2014 > > > > New Revision: 261216 > > > > URL: http://svnweb.freebsd.org/changeset/base/261216 > > > > > > > > Log: > > > > Explicitly enable I/O and memory decoding in the bridge's command register > > > > when activating an I/O or memory window on the CardBus bridge. > > > > > > This fixes some, but not all of my machines. One in particular, a Toshiba > > > M5 laptop, remains broken by r254263 even with this change. Specificaly, > > > the laptop does not notice when a card is inserted. > > > > > > The attached minimal patch gets things working again, though I don't know > > > if is the correct fix or if a more involved fix is required. > > > > > > dmesg before and after that patch: > > > > > > http://people.freebsd.org/~gavin/m5-dmesg-before.txt > > > http://people.freebsd.org/~gavin/m5-dmesg-after.txt > > > > > > The only difference is the cbb register dump, the one bit that I am > > > setting in the patch. > > > > Your patch effectively reverts r254263. It may be the correct thing to do, > > but the question is why. :) Can you provide 'pciconf -lbc' output for this > > device? (You can just do 'pciconf -lbc pccbb0' in HEAD now) > > Full "pciconf -lbc" output at > http://people.freebsd.org/~gavin/m5-pciconf-lbc.txt > > It's the same both with and without my hack-patch. Humm, no I/O port BAR. I found a copy of the cardbus spec online and there is nothing special that says it requires I/O decoding to be enabled. I guess add it with an XXX comment of some sort to note that at least one chipset requires this. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Thu Feb 6 20:17:59 2014 Return-Path: Delivered-To: svn-src-head@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 8F53B209; Thu, 6 Feb 2014 20:17: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 778BE1123; Thu, 6 Feb 2014 20:17:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s16KHxps008626; Thu, 6 Feb 2014 20:17:59 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s16KHxrl008624; Thu, 6 Feb 2014 20:17:59 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201402062017.s16KHxrl008624@svn.freebsd.org> From: Andrew Turner Date: Thu, 6 Feb 2014 20:17:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261562 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2014 20:17:59 -0000 Author: andrew Date: Thu Feb 6 20:17:58 2014 New Revision: 261562 URL: http://svnweb.freebsd.org/changeset/base/261562 Log: Pass the kernel physical address to initarm through the boot param struct. Modified: head/sys/arm/arm/locore.S head/sys/arm/include/cpu.h Modified: head/sys/arm/arm/locore.S ============================================================================== --- head/sys/arm/arm/locore.S Thu Feb 6 19:47:50 2014 (r261561) +++ head/sys/arm/arm/locore.S Thu Feb 6 20:17:58 2014 (r261562) @@ -216,7 +216,7 @@ mmu_done: ldr pc, .Lvirt_done virt_done: - mov r1, #20 /* loader info size is 20 bytes also second arg */ + mov r1, #24 /* loader info size is 24 bytes also second arg */ subs sp, sp, r1 /* allocate arm_boot_params struct on stack */ bic sp, sp, #7 /* align stack to 8 bytes */ mov r0, sp /* loader info pointer is first arg */ @@ -225,6 +225,8 @@ virt_done: str r8, [r0, #8] /* Store r1 from boot loader */ str ip, [r0, #12] /* store r2 from boot loader */ str fp, [r0, #16] /* store r3 from boot loader */ + ldr r5, =KERNPHYSADDR /* load KERNPHYSADDR as the physical address */ + str r5, [r0, #20] /* store the physical address */ mov fp, #0 /* trace back starts here */ bl _C_LABEL(initarm) /* Off we go */ Modified: head/sys/arm/include/cpu.h ============================================================================== --- head/sys/arm/include/cpu.h Thu Feb 6 19:47:50 2014 (r261561) +++ head/sys/arm/include/cpu.h Thu Feb 6 20:17:58 2014 (r261562) @@ -41,6 +41,7 @@ struct arm_boot_params { register_t abp_r1; /* r1 from the boot loader */ register_t abp_r2; /* r2 from the boot loader */ register_t abp_r3; /* r3 from the boot loader */ + vm_offset_t abp_physaddr; /* The kernel physical address */ }; void arm_vector_init(vm_offset_t, int); From owner-svn-src-head@FreeBSD.ORG Thu Feb 6 20:23:36 2014 Return-Path: Delivered-To: svn-src-head@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 17AE157A; Thu, 6 Feb 2014 20:23:36 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 039D511CA; Thu, 6 Feb 2014 20:23:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s16KNZRS012049; Thu, 6 Feb 2014 20:23:35 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s16KNZpC012048; Thu, 6 Feb 2014 20:23:35 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201402062023.s16KNZpC012048@svn.freebsd.org> From: Andrew Turner Date: Thu, 6 Feb 2014 20:23:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261563 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2014 20:23:36 -0000 Author: andrew Date: Thu Feb 6 20:23:35 2014 New Revision: 261563 URL: http://svnweb.freebsd.org/changeset/base/261563 Log: Make functions only used in this file static, and remove vfp_enable as it is unused. Modified: head/sys/arm/arm/vfp.c Modified: head/sys/arm/arm/vfp.c ============================================================================== --- head/sys/arm/arm/vfp.c Thu Feb 6 20:17:58 2014 (r261562) +++ head/sys/arm/arm/vfp.c Thu Feb 6 20:23:35 2014 (r261563) @@ -42,10 +42,9 @@ __FBSDID("$FreeBSD$"); /* function prototypes */ unsigned int get_coprocessorACR(void); -int vfp_bounce(u_int, u_int, struct trapframe *, int); +static int vfp_bounce(u_int, u_int, struct trapframe *, int); +static void vfp_restore(struct vfp_state *); void vfp_discard(void); -void vfp_enable(void); -void vfp_restore(struct vfp_state *); void vfp_store(struct vfp_state *); void set_coprocessorACR(u_int); @@ -134,7 +133,7 @@ SYSINIT(vfp, SI_SUB_CPU, SI_ORDER_ANY, v /* start VFP unit, restore the vfp registers from the PCB and retry * the instruction */ -int +static int vfp_bounce(u_int addr, u_int insn, struct trapframe *frame, int code) { u_int fpexc; @@ -196,7 +195,7 @@ vfp_bounce(u_int addr, u_int insn, struc * Eventually we will use the information that this process was the last * to use the VFP hardware and bypass the restore, just turn on the hardware. */ -void +static void vfp_restore(struct vfp_state *vfpsave) { u_int vfpscr = 0; @@ -280,17 +279,5 @@ vfp_discard() fmxr(VFPEXC, tmp); } -/* Enable the VFP hardware without restoring registers. - * Called when the registers are still in the VFP unit - */ -void -vfp_enable() -{ - u_int tmp = 0; - - tmp = fmrx(VFPEXC); - tmp |= VFPEXC_EN; - fmxr(VFPEXC, tmp); -} #endif From owner-svn-src-head@FreeBSD.ORG Thu Feb 6 20:26:36 2014 Return-Path: Delivered-To: svn-src-head@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 AF167702; Thu, 6 Feb 2014 20:26:36 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 977FC11E3; Thu, 6 Feb 2014 20:26:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s16KQaeP012427; Thu, 6 Feb 2014 20:26:36 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s16KQahK012426; Thu, 6 Feb 2014 20:26:36 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201402062026.s16KQahK012426@svn.freebsd.org> From: Andrew Turner Date: Thu, 6 Feb 2014 20:26:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261564 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2014 20:26:36 -0000 Author: andrew Date: Thu Feb 6 20:26:36 2014 New Revision: 261564 URL: http://svnweb.freebsd.org/changeset/base/261564 Log: Fix __syscall on armeb EABI. As it returns a 64-bit value it needs to place 32-bit data in r1, not r0. 64-bit data is already packed correctly. Modified: head/sys/arm/arm/vm_machdep.c Modified: head/sys/arm/arm/vm_machdep.c ============================================================================== --- head/sys/arm/arm/vm_machdep.c Thu Feb 6 20:23:35 2014 (r261563) +++ head/sys/arm/arm/vm_machdep.c Thu Feb 6 20:26:36 2014 (r261564) @@ -298,15 +298,25 @@ cpu_set_syscall_retval(struct thread *td struct trapframe *frame; int fixup; #ifdef __ARMEB__ - uint32_t insn; + u_int call; #endif frame = td->td_frame; fixup = 0; #ifdef __ARMEB__ - insn = *(u_int32_t *)(frame->tf_pc - INSN_SIZE); - if ((insn & 0x000fffff) == SYS___syscall) { + /* + * __syscall returns an off_t while most other syscalls return an + * int. As an off_t is 64-bits and an int is 32-bits we need to + * place the returned data into r1. As the lseek and frerebsd6_lseek + * syscalls also return an off_t they do not need this fixup. + */ +#ifdef __ARM_EABI__ + call = frame->tf_r7; +#else + call = *(u_int32_t *)(frame->tf_pc - INSN_SIZE) & 0x000fffff; +#endif + if (call == SYS___syscall) { register_t *ap = &frame->tf_r0; register_t code = ap[_QUAD_LOWWORD]; if (td->td_proc->p_sysent->sv_mask) From owner-svn-src-head@FreeBSD.ORG Thu Feb 6 20:35:35 2014 Return-Path: Delivered-To: svn-src-head@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 8A9BEBC2; Thu, 6 Feb 2014 20:35:35 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6899B12CF; Thu, 6 Feb 2014 20:35:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s16KZZbe016339; Thu, 6 Feb 2014 20:35:35 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s16KZYqn016332; Thu, 6 Feb 2014 20:35:34 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201402062035.s16KZYqn016332@svn.freebsd.org> From: Andrew Turner Date: Thu, 6 Feb 2014 20:35:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261565 - in head/sys/arm: arm at91 econa include s3c2xx0 xscale/ixp425 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2014 20:35:35 -0000 Author: andrew Date: Thu Feb 6 20:35:33 2014 New Revision: 261565 URL: http://svnweb.freebsd.org/changeset/base/261565 Log: Use abp_physaddr for the physical address over KERNPHYSADDR. This helps us remove the need to load the kernel at a fixed address. Modified: head/sys/arm/arm/machdep.c head/sys/arm/at91/at91_machdep.c head/sys/arm/econa/econa_machdep.c head/sys/arm/include/machdep.h head/sys/arm/s3c2xx0/s3c24x0_machdep.c head/sys/arm/xscale/ixp425/avila_machdep.c Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Thu Feb 6 20:26:36 2014 (r261564) +++ head/sys/arm/arm/machdep.c Thu Feb 6 20:35:33 2014 (r261565) @@ -788,7 +788,7 @@ makectx(struct trapframe *tf, struct pcb * calling pmap_bootstrap. */ void -arm_dump_avail_init(vm_offset_t ramsize, size_t max) +arm_dump_avail_init(vm_paddr_t physaddr, vm_offset_t ramsize, size_t max) { #ifdef LINUX_BOOT_ABI /* @@ -814,8 +814,8 @@ arm_dump_avail_init(vm_offset_t ramsize, if (max < 4) panic("dump_avail too small\n"); - dump_avail[0] = round_page(PHYSADDR); - dump_avail[1] = trunc_page(PHYSADDR + ramsize); + dump_avail[0] = round_page(physaddr); + dump_avail[1] = trunc_page(physaddr + ramsize); dump_avail[2] = 0; dump_avail[3] = 0; } @@ -901,7 +901,7 @@ linux_parse_boot_param(struct arm_boot_p board_id = abp->abp_r1; walker = (struct arm_lbabi_tag *) - (abp->abp_r2 + KERNVIRTADDR - KERNPHYSADDR); + (abp->abp_r2 + KERNVIRTADDR - abp->abp_physaddr); /* xxx - Need to also look for binary device tree */ if (ATAG_TAG(walker) != ATAG_CORE) @@ -979,7 +979,7 @@ freebsd_parse_boot_param(struct arm_boot ksym_start = MD_FETCH(kmdp, MODINFOMD_SSYM, uintptr_t); ksym_end = MD_FETCH(kmdp, MODINFOMD_ESYM, uintptr_t); #endif - preload_addr_relocate = KERNVIRTADDR - KERNPHYSADDR; + preload_addr_relocate = KERNVIRTADDR - abp->abp_physaddr; return lastaddr; } #endif @@ -1081,15 +1081,15 @@ print_kenv(void) } static void -physmap_init(struct mem_region *availmem_regions, int availmem_regions_sz) +physmap_init(struct mem_region *availmem_regions, int availmem_regions_sz, + vm_offset_t kernload) { int i, j, cnt; - vm_offset_t phys_kernelend, kernload; + vm_offset_t phys_kernelend; uint32_t s, e, sz; struct mem_region *mp, *mp1; - phys_kernelend = KERNPHYSADDR + (virtual_avail - KERNVIRTADDR); - kernload = KERNPHYSADDR; + phys_kernelend = kernload + (virtual_avail - KERNVIRTADDR); /* * Remove kernel physical address range from avail @@ -1331,7 +1331,7 @@ initarm(struct arm_boot_params *abp) /* Define a macro to simplify memory allocation */ #define valloc_pages(var, np) \ alloc_pages((var).pv_va, (np)); \ - (var).pv_pa = (var).pv_va + (KERNPHYSADDR - KERNVIRTADDR); + (var).pv_pa = (var).pv_va + (abp->abp_physaddr - KERNVIRTADDR); #define alloc_pages(var, np) \ (var) = freemempos; \ @@ -1352,7 +1352,7 @@ initarm(struct arm_boot_params *abp) L2_TABLE_SIZE_REAL * (i - j); kernel_pt_table[i].pv_pa = kernel_pt_table[i].pv_va - KERNVIRTADDR + - KERNPHYSADDR; + abp->abp_physaddr; } } @@ -1397,7 +1397,7 @@ initarm(struct arm_boot_params *abp) pmap_curmaxkvaddr = l2_start + (l2size - 1) * L1_S_SIZE; /* Map kernel code and data */ - pmap_map_chunk(l1pagetable, KERNVIRTADDR, KERNPHYSADDR, + pmap_map_chunk(l1pagetable, KERNVIRTADDR, abp->abp_physaddr, (((uint32_t)(lastaddr) - KERNVIRTADDR) + PAGE_MASK) & ~PAGE_MASK, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); @@ -1501,7 +1501,8 @@ initarm(struct arm_boot_params *abp) arm_intrnames_init(); arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); - arm_dump_avail_init(memsize, sizeof(dump_avail) / sizeof(dump_avail[0])); + arm_dump_avail_init(abp->abp_physaddr, memsize, + sizeof(dump_avail) / sizeof(dump_avail[0])); pmap_bootstrap(freemempos, &kernel_l1pt); msgbufp = (void *)msgbufpv.pv_va; msgbufinit(msgbufp, msgbufsize); @@ -1510,7 +1511,7 @@ initarm(struct arm_boot_params *abp) /* * Prepare map of physical memory regions available to vm subsystem. */ - physmap_init(availmem_regions, availmem_regions_sz); + physmap_init(availmem_regions, availmem_regions_sz, abp->abp_physaddr); init_param2(physmem); kdb_init(); Modified: head/sys/arm/at91/at91_machdep.c ============================================================================== --- head/sys/arm/at91/at91_machdep.c Thu Feb 6 20:26:36 2014 (r261564) +++ head/sys/arm/at91/at91_machdep.c Thu Feb 6 20:35:33 2014 (r261565) @@ -630,7 +630,8 @@ initarm(struct arm_boot_params *abp) arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); pmap_curmaxkvaddr = afterkern + L1_S_SIZE * (KERNEL_PT_KERN_NUM - 1); - arm_dump_avail_init(memsize, sizeof(dump_avail)/sizeof(dump_avail[0])); + arm_dump_avail_init(abp->abp_physaddr, memsize, + sizeof(dump_avail)/sizeof(dump_avail[0])); /* Always use the 256MB of KVA we have available between the kernel and devices */ vm_max_kernel_address = KERNVIRTADDR + (256 << 20); pmap_bootstrap(freemempos, &kernel_l1pt); Modified: head/sys/arm/econa/econa_machdep.c ============================================================================== --- head/sys/arm/econa/econa_machdep.c Thu Feb 6 20:26:36 2014 (r261564) +++ head/sys/arm/econa/econa_machdep.c Thu Feb 6 20:35:33 2014 (r261565) @@ -322,7 +322,8 @@ initarm(struct arm_boot_params *abp) arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); pmap_curmaxkvaddr = afterkern + L1_S_SIZE * (KERNEL_PT_KERN_NUM - 1); - arm_dump_avail_init(memsize, sizeof(dump_avail) / sizeof(dump_avail[0])); + arm_dump_avail_init(abp->abp_physaddr, memsize, + sizeof(dump_avail) / sizeof(dump_avail[0])); vm_max_kernel_address = KERNVIRTADDR + 3 * memsize; pmap_bootstrap(freemempos, &kernel_l1pt); Modified: head/sys/arm/include/machdep.h ============================================================================== --- head/sys/arm/include/machdep.h Thu Feb 6 20:26:36 2014 (r261564) +++ head/sys/arm/include/machdep.h Thu Feb 6 20:35:33 2014 (r261565) @@ -72,6 +72,6 @@ void board_set_serial(uint64_t); void board_set_revision(uint32_t); /* Setup standard arrays */ -void arm_dump_avail_init( vm_offset_t memsize, size_t max); +void arm_dump_avail_init(vm_paddr_t, vm_offset_t, size_t); #endif /* !_MACHINE_MACHDEP_H_ */ Modified: head/sys/arm/s3c2xx0/s3c24x0_machdep.c ============================================================================== --- head/sys/arm/s3c2xx0/s3c24x0_machdep.c Thu Feb 6 20:26:36 2014 (r261564) +++ head/sys/arm/s3c2xx0/s3c24x0_machdep.c Thu Feb 6 20:35:33 2014 (r261565) @@ -384,7 +384,8 @@ initarm(struct arm_boot_params *abp) arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); pmap_curmaxkvaddr = afterkern + 0x100000 * (KERNEL_PT_KERN_NUM - 1); - arm_dump_avail_init(memsize, sizeof(dump_avail) / sizeof(dump_avail[0])); + arm_dump_avail_init(abp->abp_physaddr, memsize, + sizeof(dump_avail) / sizeof(dump_avail[0])); vm_max_kernel_address = KERNVIRTADDR + 3 * memsize; pmap_bootstrap(freemempos, &kernel_l1pt); msgbufp = (void*)msgbufpv.pv_va; Modified: head/sys/arm/xscale/ixp425/avila_machdep.c ============================================================================== --- head/sys/arm/xscale/ixp425/avila_machdep.c Thu Feb 6 20:26:36 2014 (r261564) +++ head/sys/arm/xscale/ixp425/avila_machdep.c Thu Feb 6 20:35:33 2014 (r261565) @@ -431,7 +431,8 @@ initarm(struct arm_boot_params *abp) arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); pmap_curmaxkvaddr = afterkern + PAGE_SIZE; - arm_dump_avail_init(memsize, sizeof(dump_avail) / sizeof(dump_avail[0])); + arm_dump_avail_init(abp->abp_physaddr, memsize, + sizeof(dump_avail) / sizeof(dump_avail[0])); vm_max_kernel_address = 0xe0000000; pmap_bootstrap(pmap_curmaxkvaddr, &kernel_l1pt); msgbufp = (void*)msgbufpv.pv_va; From owner-svn-src-head@FreeBSD.ORG Thu Feb 6 20:53:04 2014 Return-Path: Delivered-To: svn-src-head@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 7A8D448F; Thu, 6 Feb 2014 20:53:04 +0000 (UTC) Received: from mail.ebusiness-leidinger.de (mail.ebusiness-leidinger.de [217.11.53.44]) by mx1.freebsd.org (Postfix) with ESMTP id F32C814BE; Thu, 6 Feb 2014 20:53:03 +0000 (UTC) Received: from outgoing.leidinger.net (p57A38362.dip0.t-ipconnect.de [87.163.131.98]) by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id E94CA844007; Thu, 6 Feb 2014 21:53:00 +0100 (CET) Received: from unknown (Titan.Leidinger.net [192.168.1.17]) by outgoing.leidinger.net (Postfix) with ESMTP id 576FA3469; Thu, 6 Feb 2014 21:52:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=leidinger.net; s=outgoing-alex; t=1391719978; bh=HV/67nblhbH2T8Xw6xG7IzvPAsCkqSukmNRmMUPDwS8=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=2jb+NucWqJuBx+4easN4VMQJ6aMLSD03k7P18uCnHLhv4wnPhmpnox+JvRUpLvupE 6YmrDaxHezOQ4R33O4L6Jt3yuShAk5NOHXT11Bf5h/IK3eJaoqZPRxhjyqGTJHS4hb s7mWqWGcUWHvtWRFX3CeQQlJitXmkoX9Pfr0YHfrUgKda40jZLmetCc90TutbECx+q la/eipZcXaHTFgemStdlfKxxzbBnklTztIhFJB5qw58uYy4VMze7FD5FrLymdwq85u CEYlSSLBwP3OToBVH+wF6Zw1zlnnEQtkrCLRO82oaioAPnH3tVOugTMz84ejtPkMy4 6F6Mq7vYm9gdg== Date: Thu, 6 Feb 2014 21:53:00 +0100 From: Alexander Leidinger To: John Baldwin Subject: Re: svn commit: r261266 - in head: sys/dev/drm sys/kern sys/sys usr.sbin/jail Message-ID: <20140206215300.000014a3@unknown> In-Reply-To: <2362081.WrjYmKeYu9@ralph.baldwin.cx> References: <201401291341.s0TDfDcB068211@svn.freebsd.org> <52EC4DBB.50804@freebsd.org> <20140203235336.GA46006@ambrisko.com> <2362081.WrjYmKeYu9@ralph.baldwin.cx> X-Mailer: Claws Mail 3.9.2-55-g74b05b (GTK+ 2.16.6; i586-pc-mingw32msvc) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-EBL-MailScanner-Information: Please contact the ISP for more information X-EBL-MailScanner-ID: E94CA844007.A5107 X-EBL-MailScanner: Found to be clean X-EBL-MailScanner-SpamCheck: not spam, spamhaus-ZEN, SpamAssassin (not cached, score=-1.096, required 6, autolearn=disabled, ALL_TRUSTED -1.00, AWL -0.07, DKIM_SIGNED 0.10, DKIM_VALID -0.10, DKIM_VALID_AU -0.10, RP_MATCHES_RCVD -0.00, TW_SV 0.08) X-EBL-MailScanner-From: alexander@leidinger.net X-EBL-MailScanner-Watermark: 1392324781.28799@Xs+Tx430iFvgJGcm2cOqYQ X-EBL-Spam-Status: No Cc: src-committers@freebsd.org, Doug Ambrisko , svn-src-all@freebsd.org, Gleb Smirnoff , Robert Watson , James Gritton , svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2014 20:53:04 -0000 On Wed, 05 Feb 2014 14:05:29 -0500 John Baldwin wrote: > I think having a "kmem" flag for jails is a hack and not the right > approach. It does make a jail useless security-wise, but by > masquerading as a flag, it implies that it is only partially > violating security which gives a false sense of security. I think we need to differentiate between security and safety here. The allow_kmem flag disables security (protections against a malicious program which was written specially to make use of kmem/io to do something nasty and requires much more knowledge to write) but does not allow all the other things for which we have flags (raw sockets, chflags, mount). The safety aspect comes into play when you have badly behaving programs (in the sense of bugs, stupid programmers or unwanted behavior in some parts of a program). In such a case you may want to allow kmem access, but not raw socket / ... access. Having it as a flag does not imply to me that is is only partly violating security, I think it is just a matter of wording. Either in the description of the flag, or additionally in the naming of the flag (maybe more in the sense of allow.open_backdoor?) > A short term solution that would permit non-security jails without > having to do the longer term work that Robert would like might be to > add a new per-jail flag that in effect means "no security at all". Personally I wouldn't object if we replace the kmem flag with a "no security at all" solution, I would keep the patch locally until the long term solution may or may not surface. Note: over the years I had several people which were interested in my patch. Not an overwhelming amount, but still, there are people interested in it. Bye, Alexander. -- http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137 From owner-svn-src-head@FreeBSD.ORG Thu Feb 6 21:36:15 2014 Return-Path: Delivered-To: svn-src-head@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 B5631D0; Thu, 6 Feb 2014 21:36:15 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8648117FE; Thu, 6 Feb 2014 21:36:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s16LaFCZ040249; Thu, 6 Feb 2014 21:36:15 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s16LaEv8040246; Thu, 6 Feb 2014 21:36:14 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402062136.s16LaEv8040246@svn.freebsd.org> From: Christian Brueffer Date: Thu, 6 Feb 2014 21:36:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261566 - in head: sbin/dhclient tools/regression/security/cap_test X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2014 21:36:15 -0000 Author: brueffer Date: Thu Feb 6 21:36:14 2014 New Revision: 261566 URL: http://svnweb.freebsd.org/changeset/base/261566 Log: Use CAP_EVENT instead of the deprecated CAP_POLL_EVENT. PR: 185382 (based on) Submitted by: Loganaden Velvindron Reviewed by: pjd MFC after: 1 week Modified: head/sbin/dhclient/bpf.c head/sbin/dhclient/dhclient.c head/tools/regression/security/cap_test/cap_test_capabilities.c Modified: head/sbin/dhclient/bpf.c ============================================================================== --- head/sbin/dhclient/bpf.c Thu Feb 6 20:35:33 2014 (r261565) +++ head/sbin/dhclient/bpf.c Thu Feb 6 21:36:14 2014 (r261566) @@ -269,7 +269,7 @@ if_register_receive(struct interface_inf if (ioctl(info->rfdesc, BIOCLOCK, NULL) < 0) error("Cannot lock bpf"); - cap_rights_init(&rights, CAP_IOCTL, CAP_POLL_EVENT, CAP_READ); + cap_rights_init(&rights, CAP_IOCTL, CAP_EVENT, CAP_READ); if (cap_rights_limit(info->rfdesc, &rights) < 0 && errno != ENOSYS) error("Can't limit bpf descriptor: %m"); if (cap_ioctls_limit(info->rfdesc, cmds, 2) < 0 && errno != ENOSYS) Modified: head/sbin/dhclient/dhclient.c ============================================================================== --- head/sbin/dhclient/dhclient.c Thu Feb 6 20:35:33 2014 (r261565) +++ head/sbin/dhclient/dhclient.c Thu Feb 6 21:36:14 2014 (r261566) @@ -494,7 +494,7 @@ main(int argc, char *argv[]) add_protocol("AF_ROUTE", routefd, routehandler, ifi); if (shutdown(routefd, SHUT_WR) < 0) error("can't shutdown route socket: %m"); - cap_rights_init(&rights, CAP_POLL_EVENT, CAP_READ); + cap_rights_init(&rights, CAP_EVENT, CAP_READ); if (cap_rights_limit(routefd, &rights) < 0 && errno != ENOSYS) error("can't limit route socket: %m"); Modified: head/tools/regression/security/cap_test/cap_test_capabilities.c ============================================================================== --- head/tools/regression/security/cap_test/cap_test_capabilities.c Thu Feb 6 20:35:33 2014 (r261565) +++ head/tools/regression/security/cap_test/cap_test_capabilities.c Thu Feb 6 21:36:14 2014 (r261566) @@ -396,7 +396,7 @@ try_file_ops(int filefd, int dirfd, cap_ pollfd.revents = 0; ret = poll(&pollfd, 1, 0); - if (rights & CAP_POLL_EVENT) + if (rights & CAP_EVENT) CHECK((pollfd.revents & POLLNVAL) == 0); else CHECK((pollfd.revents & POLLNVAL) != 0); @@ -546,7 +546,7 @@ test_capabilities(void) TRY(CAP_SEM_POST); TRY(CAP_SEM_WAIT); TRY(CAP_POST_EVENT); - TRY(CAP_POLL_EVENT); + TRY(CAP_EVENT); TRY(CAP_IOCTL); TRY(CAP_TTYHOOK); TRY(CAP_PDGETPID); From owner-svn-src-head@FreeBSD.ORG Thu Feb 6 21:54:23 2014 Return-Path: Delivered-To: svn-src-head@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 A4C9F570; Thu, 6 Feb 2014 21:54:23 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8E8501956; Thu, 6 Feb 2014 21:54:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s16LsN4c047828; Thu, 6 Feb 2014 21:54:23 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s16LsLTN047813; Thu, 6 Feb 2014 21:54:21 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201402062154.s16LsLTN047813@svn.freebsd.org> From: Ed Maste Date: Thu, 6 Feb 2014 21:54:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261567 - in head/sys/boot: . i386/efi i386/gptboot i386/gptzfsboot i386/loader i386/zfsboot libstand32 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2014 21:54:23 -0000 Author: emaste Date: Thu Feb 6 21:54:21 2014 New Revision: 261567 URL: http://svnweb.freebsd.org/changeset/base/261567 Log: Build a 32-bit libstand under sys/boot/ A 32-bit libstand is needed on 64-bit platforms for use by various bootloaders. Previously only the 32-bit version was built, installed as /usr/lib/libstand.a. A new 64-bit libstand consumer will arrive in the near future, so move the bootloader-specific 32-bit version to sys/boot/libstand32/. Explicitly link against this version in the 32-bit loaders. Sponsored by: The FreeBSD Foundation Added: head/sys/boot/libstand32/ head/sys/boot/libstand32/Makefile (contents, props changed) Modified: head/sys/boot/Makefile.amd64 head/sys/boot/Makefile.i386 head/sys/boot/i386/efi/Makefile head/sys/boot/i386/gptboot/Makefile head/sys/boot/i386/gptzfsboot/Makefile head/sys/boot/i386/loader/Makefile head/sys/boot/i386/zfsboot/Makefile Modified: head/sys/boot/Makefile.amd64 ============================================================================== --- head/sys/boot/Makefile.amd64 Thu Feb 6 21:36:14 2014 (r261566) +++ head/sys/boot/Makefile.amd64 Thu Feb 6 21:54:21 2014 (r261567) @@ -1,5 +1,6 @@ # $FreeBSD$ SUBDIR+= efi +SUBDIR+= libstand32 SUBDIR+= zfs SUBDIR+= userboot Modified: head/sys/boot/Makefile.i386 ============================================================================== --- head/sys/boot/Makefile.i386 Thu Feb 6 21:36:14 2014 (r261566) +++ head/sys/boot/Makefile.i386 Thu Feb 6 21:54:21 2014 (r261567) @@ -1,4 +1,5 @@ # $FreeBSD$ SUBDIR+= efi +SUBDIR+= libstand32 SUBDIR+= zfs Modified: head/sys/boot/i386/efi/Makefile ============================================================================== --- head/sys/boot/i386/efi/Makefile Thu Feb 6 21:36:14 2014 (r261566) +++ head/sys/boot/i386/efi/Makefile Thu Feb 6 21:54:21 2014 (r261567) @@ -60,6 +60,7 @@ loader.efi: loader.sym --target=efi-app-ia32 ${.ALLSRC} ${.TARGET} LIBEFI= ${.OBJDIR}/../../efi/libefi/libefi.a +LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a CFLAGS+= -I${.CURDIR}/../libi386 CFLAGS+= -I${.CURDIR}/../btx/lib Modified: head/sys/boot/i386/gptboot/Makefile ============================================================================== --- head/sys/boot/i386/gptboot/Makefile Thu Feb 6 21:36:14 2014 (r261566) +++ head/sys/boot/i386/gptboot/Makefile Thu Feb 6 21:54:21 2014 (r261567) @@ -41,6 +41,8 @@ CFLAGS.gcc+= --param max-inline-insns-si LD_FLAGS=-static -N --gc-sections +LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a + # Pick up ../Makefile.inc early. .include Modified: head/sys/boot/i386/gptzfsboot/Makefile ============================================================================== --- head/sys/boot/i386/gptzfsboot/Makefile Thu Feb 6 21:36:14 2014 (r261566) +++ head/sys/boot/i386/gptzfsboot/Makefile Thu Feb 6 21:54:21 2014 (r261567) @@ -38,6 +38,8 @@ CFLAGS.gcc+= --param max-inline-insns-si LD_FLAGS=-static -N --gc-sections +LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a + # Pick up ../Makefile.inc early. .include Modified: head/sys/boot/i386/loader/Makefile ============================================================================== --- head/sys/boot/i386/loader/Makefile Thu Feb 6 21:36:14 2014 (r261566) +++ head/sys/boot/i386/loader/Makefile Thu Feb 6 21:54:21 2014 (r261567) @@ -69,6 +69,8 @@ LDFLAGS= -static -Ttext 0x0 LIBI386= ${.OBJDIR}/../libi386/libi386.a CFLAGS+= -I${.CURDIR}/.. +LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a + # BTX components CFLAGS+= -I${.CURDIR}/../btx/lib Modified: head/sys/boot/i386/zfsboot/Makefile ============================================================================== --- head/sys/boot/i386/zfsboot/Makefile Thu Feb 6 21:36:14 2014 (r261566) +++ head/sys/boot/i386/zfsboot/Makefile Thu Feb 6 21:54:21 2014 (r261567) @@ -35,6 +35,8 @@ CFLAGS.gcc+= --param max-inline-insns-si LD_FLAGS=-static -N --gc-sections +LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a + # Pick up ../Makefile.inc early. .include Added: head/sys/boot/libstand32/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/libstand32/Makefile Thu Feb 6 21:54:21 2014 (r261567) @@ -0,0 +1,196 @@ +# $FreeBSD$ +# Originally from $NetBSD: Makefile,v 1.21 1997/10/26 22:08:38 lukem Exp $ +# +# Notes: +# - We don't use the libc strerror/sys_errlist because the string table is +# quite large. +# + +NO_MAN= + +.include +MK_SSP= no + +S= ${.CURDIR}/../../../lib/libstand + +.PATH: ${S} +LIB= stand +INTERNALLIB= +NO_PROFILE= +NO_PIC= + +WARNS?= 0 + +CFLAGS+= -ffreestanding -Wformat +CFLAGS+= -I${S} + +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +CFLAGS.gcc+= -mpreferred-stack-boundary=2 +CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float +.endif +.if ${MACHINE} == "pc98" +CFLAGS+= -Os +.endif +.if ${MACHINE_CPUARCH} == "powerpc" +CFLAGS+= -msoft-float -D_STANDALONE -DNETIF_DEBUG +.endif +.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64" +CFLAGS+= -m32 -I. +.endif +.if ${MACHINE_CPUARCH} == "arm" +CFLAGS+= -msoft-float -D_STANDALONE +.endif +.if ${MACHINE_CPUARCH} == "mips" +CFLAGS+= -G0 -fno-pic -mno-abicalls +.endif + +# standalone components and stuff we have modified locally +SRCS+= gzguts.h zutil.h __main.c assert.c bcd.c bswap.c environment.c getopt.c gets.c \ + globals.c pager.c printf.c strdup.c strerror.c strtol.c strtoul.c random.c \ + sbrk.c twiddle.c zalloc.c zalloc_malloc.c + +# private (pruned) versions of libc string functions +SRCS+= strcasecmp.c + +LIBC= ${S}/../libc + +.PATH: ${LIBC}/net + +SRCS+= ntoh.c + +# string functions from libc +.PATH: ${LIBC}/string +.if ${MACHINE_CPUARCH} != "ia64" +SRCS+= bcmp.c bcopy.c bzero.c ffs.c memccpy.c memchr.c memcmp.c memcpy.c \ + memmove.c memset.c qdivrem.c strcat.c strchr.c strcmp.c strcpy.c \ + strcspn.c strlen.c strncat.c strncmp.c strncpy.c strpbrk.c \ + strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c +.endif +.if ${MACHINE_CPUARCH} == "arm" +.PATH: ${LIBC}/arm/gen + +.if ${MK_ARM_EABI} == "no" +SRCS+= divsi3.S +.else +# Compiler support functions +.PATH: ${.CURDIR}/../../../contrib/compiler-rt/lib/ +# __clzsi2 and ctzsi2 for various builtin functions +SRCS+= clzsi2.c ctzsi2.c +# Divide and modulus functions called by the compiler +SRCS+= divmoddi4.c divmodsi4.c divdi3.c divsi3.c moddi3.c modsi3.c +SRCS+= udivmoddi4.c udivmodsi4.c udivdi3.c udivsi3.c umoddi3.c umodsi3.c + +.PATH: ${.CURDIR}/../../../contrib/compiler-rt/lib/arm/ +SRCS+= aeabi_idivmod.S aeabi_ldivmod.S aeabi_uidivmod.S aeabi_uldivmod.S +SRCS+= aeabi_memcmp.S aeabi_memcpy.S aeabi_memmove.S aeabi_memset.S +.endif + +.endif +.if ${MACHINE_CPUARCH} == "ia64" +.PATH: ${LIBC}/ia64/string +SRCS+= bcmp.c bcopy.S bzero.S ffs.S memccpy.c memchr.c memcmp.c memcpy.S \ + memmove.S memset.c strcat.c strchr.c strcmp.c strcpy.c strcspn.c \ + strlen.c strncat.c strncmp.c strncpy.c strpbrk.c strrchr.c strsep.c \ + strspn.c strstr.c strtok.c swab.c + +.PATH: ${LIBC}/ia64/gen +SRCS+= __divdi3.S __divsi3.S __moddi3.S __modsi3.S +SRCS+= __udivdi3.S __udivsi3.S __umoddi3.S __umodsi3.S +.endif +.if ${MACHINE_CPUARCH} == "powerpc" +.PATH: ${LIBC}/quad +SRCS+= ashldi3.c ashrdi3.c +.PATH: ${LIBC}/powerpc/gen +SRCS+= syncicache.c +.endif + +# uuid functions from libc +.PATH: ${LIBC}/uuid +SRCS+= uuid_equal.c uuid_is_nil.c + +# _setjmp/_longjmp +.if ${MACHINE_CPUARCH} == "amd64" +.PATH: ${S}/i386 +.elif ${MACHINE_ARCH} == "powerpc64" +.PATH: ${S}/powerpc +.else +.PATH: ${S}/${MACHINE_CPUARCH} +.endif +SRCS+= _setjmp.S + +# decompression functionality from libbz2 +# NOTE: to actually test this functionality after libbz2 upgrade compile +# loader(8) with LOADER_BZIP2_SUPPORT defined +.PATH: ${.CURDIR}/../../../contrib/bzip2 +CFLAGS+= -DBZ_NO_STDIO -DBZ_NO_COMPRESS +SRCS+= libstand_bzlib_private.h + +.for file in bzlib.c crctable.c decompress.c huffman.c randtable.c +SRCS+= _${file} +CLEANFILES+= _${file} + +_${file}: ${file} + sed "s|bzlib_private\.h|libstand_bzlib_private.h|" ${.ALLSRC} > ${.TARGET} +.endfor + +CLEANFILES+= libstand_bzlib_private.h +libstand_bzlib_private.h: bzlib_private.h + sed -e 's||"stand.h"|' \ + ${.ALLSRC} > ${.TARGET} + +# decompression functionality from libz +.PATH: ${S}/../libz +CFLAGS+=-DHAVE_MEMCPY -I${S}/../libz +SRCS+= adler32.c crc32.c libstand_zutil.h libstand_gzguts.h + +.for file in infback.c inffast.c inflate.c inftrees.c zutil.c +SRCS+= _${file} +CLEANFILES+= _${file} + +_${file}: ${file} + sed -e "s|zutil\.h|libstand_zutil.h|" \ + -e "s|gzguts\.h|libstand_gzguts.h|" \ + ${.ALLSRC} > ${.TARGET} +.endfor + +# depend on stand.h being able to be included multiple times +.for file in zutil.h gzguts.h +CLEANFILES+= libstand_${file} +libstand_${file}: ${file} + sed -e 's||"stand.h"|' \ + -e 's||"stand.h"|' \ + -e 's||"stand.h"|' \ + -e 's||"stand.h"|' \ + -e 's||"stand.h"|' \ + ${.ALLSRC} > ${.TARGET} +.endfor + +# io routines +SRCS+= closeall.c dev.c ioctl.c nullfs.c stat.c \ + fstat.c close.c lseek.c open.c read.c write.c readdir.c + +# network routines +SRCS+= arp.c ether.c inet_ntoa.c in_cksum.c net.c udp.c netif.c rpc.c + +# network info services: +SRCS+= bootp.c rarp.c bootparam.c + +# boot filesystems +SRCS+= ufs.c nfs.c cd9660.c tftp.c gzipfs.c bzipfs.c +SRCS+= dosfs.c ext2fs.c +SRCS+= splitfs.c +.if ${MK_NAND} != "no" +SRCS+= nandfs.c +.endif + +.include + +.if ${MACHINE_CPUARCH} == "amd64" +beforedepend ${OBJS}: machine +cleandepend: cleanmachine +cleanmachine: + rm -f machine + +machine: + ln -s ${.CURDIR}/../../i386/include machine +.endif From owner-svn-src-head@FreeBSD.ORG Thu Feb 6 21:57:28 2014 Return-Path: Delivered-To: svn-src-head@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 6AC5C7C4; Thu, 6 Feb 2014 21:57:28 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 387961978; Thu, 6 Feb 2014 21:57:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s16LvSNP048299; Thu, 6 Feb 2014 21:57:28 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s16LvRV6048296; Thu, 6 Feb 2014 21:57:27 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201402062157.s16LvRV6048296@svn.freebsd.org> From: Ed Maste Date: Thu, 6 Feb 2014 21:57:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261568 - head/lib/libstand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2014 21:57:28 -0000 Author: emaste Date: Thu Feb 6 21:57:27 2014 New Revision: 261568 URL: http://svnweb.freebsd.org/changeset/base/261568 Log: Build libstand as a 64-bit library on amd64 The 32-bit bootloaders now link against libstand.a in sys/boot/libstand32, so there is no need to force /usr/lib/libstand.a to be 32-bit. Sponsored by: The FreeBSD Foundation Modified: head/lib/libstand/Makefile head/lib/libstand/libstand.3 Modified: head/lib/libstand/Makefile ============================================================================== --- head/lib/libstand/Makefile Thu Feb 6 21:54:21 2014 (r261567) +++ head/lib/libstand/Makefile Thu Feb 6 21:57:27 2014 (r261568) @@ -21,16 +21,21 @@ CFLAGS+= -ffreestanding -Wformat CFLAGS+= -I${.CURDIR} .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" -CFLAGS.gcc+= -mpreferred-stack-boundary=2 CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float .endif +.if ${MACHINE_CPUARCH} == "i386" +CFLAGS.gcc+= -mpreferred-stack-boundary=2 +.endif +.if ${MACHINE_CPUARCH} == "amd64" +CFLAGS+= -fPIC +.endif .if ${MACHINE} == "pc98" CFLAGS+= -Os .endif .if ${MACHINE_CPUARCH} == "powerpc" CFLAGS+= -msoft-float -D_STANDALONE -DNETIF_DEBUG .endif -.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64" +.if ${MACHINE_ARCH} == "powerpc64" CFLAGS+= -m32 -I. .endif .if ${MACHINE_CPUARCH} == "arm" @@ -103,9 +108,7 @@ SRCS+= syncicache.c SRCS+= uuid_equal.c uuid_is_nil.c # _setjmp/_longjmp -.if ${MACHINE_CPUARCH} == "amd64" -.PATH: ${.CURDIR}/i386 -.elif ${MACHINE_ARCH} == "powerpc64" +.if ${MACHINE_ARCH} == "powerpc64" .PATH: ${.CURDIR}/powerpc .else .PATH: ${.CURDIR}/${MACHINE_CPUARCH} @@ -179,12 +182,3 @@ SRCS+= nandfs.c .include -.if ${MACHINE_CPUARCH} == "amd64" -beforedepend ${OBJS}: machine -cleandepend: cleanmachine -cleanmachine: - rm -f machine - -machine: - ln -s ${.CURDIR}/../../sys/i386/include machine -.endif Modified: head/lib/libstand/libstand.3 ============================================================================== --- head/lib/libstand/libstand.3 Thu Feb 6 21:54:21 2014 (r261567) +++ head/lib/libstand/libstand.3 Thu Feb 6 21:57:27 2014 (r261568) @@ -675,6 +675,6 @@ the environment functions and this manpa .Sh BUGS The lack of detailed memory usage data is unhelpful. .Pp -On the amd64 and powerpc64 architectures +On the powerpc64 architecture .Nm is a 32-bit library. From owner-svn-src-head@FreeBSD.ORG Thu Feb 6 22:39:14 2014 Return-Path: Delivered-To: svn-src-head@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 E1A9D3B0; Thu, 6 Feb 2014 22:39:13 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B36911CAD; Thu, 6 Feb 2014 22:39:13 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id A41C8B948; Thu, 6 Feb 2014 17:39:12 -0500 (EST) From: John Baldwin To: Alexander Leidinger Subject: Re: svn commit: r261266 - in head: sys/dev/drm sys/kern sys/sys usr.sbin/jail Date: Thu, 6 Feb 2014 16:56:32 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201401291341.s0TDfDcB068211@svn.freebsd.org> <2362081.WrjYmKeYu9@ralph.baldwin.cx> <20140206215300.000014a3@unknown> In-Reply-To: <20140206215300.000014a3@unknown> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201402061656.32364.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 06 Feb 2014 17:39:12 -0500 (EST) Cc: src-committers@freebsd.org, Doug Ambrisko , svn-src-all@freebsd.org, Gleb Smirnoff , Robert Watson , James Gritton , svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2014 22:39:14 -0000 On Thursday, February 06, 2014 3:53:00 pm Alexander Leidinger wrote: > On Wed, 05 Feb 2014 14:05:29 -0500 > John Baldwin wrote: > > > I think having a "kmem" flag for jails is a hack and not the right > > approach. It does make a jail useless security-wise, but by > > masquerading as a flag, it implies that it is only partially > > violating security which gives a false sense of security. > > I think we need to differentiate between security and safety here. The > allow_kmem flag disables security (protections against a malicious > program which was written specially to make use of kmem/io to do > something nasty and requires much more knowledge to write) but does not > allow all the other things for which we have flags (raw sockets, > chflags, mount). The safety aspect comes into play when you have badly > behaving programs (in the sense of bugs, stupid programmers or unwanted > behavior in some parts of a program). In such a case you may want to > allow kmem access, but not raw socket / ... access. If a programmer writing a program can't be trusted to use a raw socket, you really think they can be trusted with kmem access? If they are careful enough to be trusted with kmem access, they are careful enough to be trusted to only open a raw socket if they need it. The problem with kmem is that it subverts everything you could put into place including capsicum, etc. Put another way: if you think you can't trust the program to not open a raw socket, then you definitely shouldn't trust it with kmem access. Also, in terms of bugs, kmem access is actually far worse! Now if you get a simple buffer overflow you might end up trashing kmem. I'd much rather a buggy program open a raw socket than be able to open /dev/kmem. > Having it as a flag does not imply to me that is is only partly > violating security, I think it is just a matter of wording. Either in > the description of the flag, or additionally in the naming of the > flag (maybe more in the sense of allow.open_backdoor?) All the other flags poke small holes in the existing jail barrier. The kmem flag shreds the barrier, so it is not of the same class. Any new flag that removes all security needs to be very explicitly labelled as such so that it is clear to users what is actually occurring. > > A short term solution that would permit non-security jails without > > having to do the longer term work that Robert would like might be to > > add a new per-jail flag that in effect means "no security at all". > > Personally I wouldn't object if we replace the kmem flag with a "no > security at all" solution, I would keep the patch locally until the > long term solution may or may not surface. > > Note: over the years I had several people which were interested in my > patch. Not an overwhelming amount, but still, there are people > interested in it. Interest in a patch doesn't mean it is correct. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Thu Feb 6 22:55:31 2014 Return-Path: Delivered-To: svn-src-head@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 0FD50D99; Thu, 6 Feb 2014 22:55:31 +0000 (UTC) Received: from mail-wg0-x22f.google.com (mail-wg0-x22f.google.com [IPv6:2a00:1450:400c:c00::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2D2601E25; Thu, 6 Feb 2014 22:55:30 +0000 (UTC) Received: by mail-wg0-f47.google.com with SMTP id m15so1732345wgh.26 for ; Thu, 06 Feb 2014 14:55:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=OcgouOCpkuBh3iliqPLNL16DxORfyylsEXVISpLkyDE=; b=JnH97hZDE3cj71rMesyG4viDXi7YQBXOngmGigAz1XpqNaqoPLXmzBM5MnUJxU8e8T cbktngYBEXIiIfudyzv0hrddqeAp2gCYjg8UvpEnIonscCiSd1PQ9RMli2m46034+nQY C2cl0Djqa6L4w2vzIk/BAHqFxXkiiABSwhZVgEjbNg8VIBxW076SlIOgQcmBKYuNxyeC +f3JxGkypVw8Mr3VHmp6bVGqF+kVJ3eDWYiAy0ks34GONtT9iZTrRbsD54ZXc9oon4qr g0grWj/uoYTRPlfpqrHTUo2wHIEeT/2gBoaUoHsHS2wiBX+Y1XcRhqvMsNyuYOLqg9p6 iuWg== MIME-Version: 1.0 X-Received: by 10.180.97.37 with SMTP id dx5mr1241728wib.53.1391727328544; Thu, 06 Feb 2014 14:55:28 -0800 (PST) Sender: asomers@gmail.com Received: by 10.194.168.197 with HTTP; Thu, 6 Feb 2014 14:55:28 -0800 (PST) In-Reply-To: <201401300744.s0U7iNLt016044@svn.freebsd.org> References: <201401300744.s0U7iNLt016044@svn.freebsd.org> Date: Thu, 6 Feb 2014 15:55:28 -0700 X-Google-Sender-Auth: 3WAJ7-8s-qHR9mkQZpErFaNsaTc Message-ID: Subject: Re: svn commit: r261283 - in head: contrib/libc++ contrib/libc++/include contrib/libc++/include/experimental contrib/libc++/include/ext contrib/libc++/src etc/mtree lib/libc++ sys/sys tools/build/mk From: Alan Somers To: Dimitry Andric Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2014 22:55:31 -0000 On Thu, Jan 30, 2014 at 12:44 AM, Dimitry Andric wrote: > Author: dim > Date: Thu Jan 30 07:44:22 2014 > New Revision: 261283 > URL: http://svnweb.freebsd.org/changeset/base/261283 > > Log: > Import libc++ 3.4 release. This contains a lot of bugfixes, and some > preliminary support for C++1y. > > MFC after: 3 weeks > > Added: ... > head/contrib/libc++/include/locale This broke the build when WITH_TESTS=yes is set. contrib/atf/atf-c++/detail/application.cpp fails to compile as shown below. All that file does is #include several standard headers, so I think the problem is strictly within libc++. Tinderbox probably didn't catch it because the base system includes so little C++, and WITH_TESTS is off by default. By inspection, I can't tell why locale compiled before this change; the offending LOC are identical. Can you please take a look? c++ -fpic -DPIC -O2 -pipe -DHAVE_CONFIG_H -DATF_ARCH='"amd64"' -DATF_BUILD_CC='"cc "' -DATF_BUILD_CFLAGS='"-O2 -pipe "' -DATF_BUILD_CPP='"cpp "' -DATF_BUILD_CPPFLAGS='""' -DATF_BUILD_CXX='"c++ "' -DATF_BUILD_CXXFLAGS='"-O2 -pipe"' -DATF_CONFDIR='"/etc/atf"' -DATF_C_TESTS_BASE='"/usr/tests/lib/atf/libatf-c"' -DATF_INCLUDEDIR='"/usr/include"' -DATF_LIBDIR='"/usr/lib"' -DATF_LIBEXECDIR='"/usr/libexec"' -DATF_MACHINE='"amd64"' -DATF_M4='"/usr/bin/m4"' -DATF_PKGDATADIR='"/usr/share/atf"' -DATF_SHELL='"/bin/sh"' -DATF_WORKDIR='"/tmp"' -I/usr/home/alans/freebsd/head/contrib/atf -I/usr/home/alans/freebsd/head/lib/atf/libatf-c++/../libatf-c -I. -DHAVE_CONFIG_H -Qunused-arguments -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wpointer-arith -Wno-uninitialized -Wno-empty-body -Wno-string-plus-int -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -Wno-c++11-extensions -c /usr/home/alans/freebsd/head/contrib/atf/atf-c++/detail/application.cpp -o application.So In file included from /usr/home/alans/freebsd/head/contrib/atf/atf-c++/detail/application.cpp:42: In file included from /vmpool/obj/usr/home/alans/freebsd/head/tmp/usr/include/c++/v1/iostream:40: In file included from /vmpool/obj/usr/home/alans/freebsd/head/tmp/usr/include/c++/v1/istream:156: In file included from /vmpool/obj/usr/home/alans/freebsd/head/tmp/usr/include/c++/v1/ostream:133: /vmpool/obj/usr/home/alans/freebsd/head/tmp/usr/include/c++/v1/locale:1015:27: error: comparison of integers of different signs: 'long' and 'size_type' (aka 'unsigned long') [-Werror,-Wsign-compare] if (__a_end - __a == __buf.size()) ~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~ /vmpool/obj/usr/home/alans/freebsd/head/tmp/usr/include/c++/v1/locale:1065:27: error: comparison of integers of different signs: 'long' and 'size_type' (aka 'unsigned long') [-Werror,-Wsign-compare] if (__a_end - __a == __buf.size()) ~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~ /vmpool/obj/usr/home/alans/freebsd/head/tmp/usr/include/c++/v1/locale:1119:27: error: comparison of integers of different signs: 'long' and 'size_type' (aka 'unsigned long') [-Werror,-Wsign-compare] if (__a_end - __a == __buf.size()) ~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~ 3 errors generated. *** [application.So] Error code 1 bmake[4]: stopped in /usr/home/alans/freebsd/head/lib/atf/libatf-c++ 1 error -Alan From owner-svn-src-head@FreeBSD.ORG Fri Feb 7 03:00:15 2014 Return-Path: Delivered-To: svn-src-head@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 E28A8605; Fri, 7 Feb 2014 03:00:15 +0000 (UTC) Received: from smtpauth2.wiscmail.wisc.edu (wmauth2.doit.wisc.edu [144.92.197.222]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AEA5B12B8; Fri, 7 Feb 2014 03:00:14 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth2.wiscmail.wisc.edu by smtpauth2.wiscmail.wisc.edu (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) id <0N0L00000UZCS500@smtpauth2.wiscmail.wisc.edu>; Thu, 06 Feb 2014 21:00:07 -0600 (CST) X-Spam-PmxInfo: Server=avs-2, Version=6.0.3.2322014, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2014.2.7.25115, SenderIP=0.0.0.0 X-Spam-Report: AuthenticatedSender=yes, SenderIP=0.0.0.0 Received: from comporellon.tachypleus.net (adsl-76-208-68-77.dsl.mdsnwi.sbcglobal.net [76.208.68.77]) by smtpauth2.wiscmail.wisc.edu (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) with ESMTPSA id <0N0L000GOV06WP10@smtpauth2.wiscmail.wisc.edu>; Thu, 06 Feb 2014 21:00:07 -0600 (CST) Message-id: <52F44C35.90101@freebsd.org> Date: Thu, 06 Feb 2014 21:00:05 -0600 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 To: Ed Maste , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r261567 - in head/sys/boot: . i386/efi i386/gptboot i386/gptzfsboot i386/loader i386/zfsboot libstand32 References: <201402062154.s16LsLTN047813@svn.freebsd.org> In-reply-to: <201402062154.s16LsLTN047813@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 03:00:16 -0000 On 02/06/14 15:54, Ed Maste wrote: > Author: emaste > Date: Thu Feb 6 21:54:21 2014 > New Revision: 261567 > URL: http://svnweb.freebsd.org/changeset/base/261567 > > Log: > Build a 32-bit libstand under sys/boot/ > > A 32-bit libstand is needed on 64-bit platforms for use by various > bootloaders. Previously only the 32-bit version was built, installed as > /usr/lib/libstand.a. > > A new 64-bit libstand consumer will arrive in the near future, so move > the bootloader-specific 32-bit version to sys/boot/libstand32/. > > Explicitly link against this version in the 32-bit loaders. > > Sponsored by: The FreeBSD Foundation > Please also do this for the powerpc64 bootloader, which, like amd64, is 32-bit. -Nathan From owner-svn-src-head@FreeBSD.ORG Fri Feb 7 03:03:14 2014 Return-Path: Delivered-To: svn-src-head@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 35E8FBB5; Fri, 7 Feb 2014 03:03:14 +0000 (UTC) Received: from smtpauth4.wiscmail.wisc.edu (wmauth4.doit.wisc.edu [144.92.197.145]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F07401619; Fri, 7 Feb 2014 03:03:13 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth4.wiscmail.wisc.edu by smtpauth4.wiscmail.wisc.edu (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) id <0N0L00H00UYMAE00@smtpauth4.wiscmail.wisc.edu>; Thu, 06 Feb 2014 21:03:06 -0600 (CST) X-Spam-PmxInfo: Server=avs-4, Version=6.0.3.2322014, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2014.2.7.25115, SenderIP=0.0.0.0 X-Spam-Report: AuthenticatedSender=yes, SenderIP=0.0.0.0 Received: from comporellon.tachypleus.net (adsl-76-208-68-77.dsl.mdsnwi.sbcglobal.net [76.208.68.77]) by smtpauth4.wiscmail.wisc.edu (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) with ESMTPSA id <0N0L00MFJV55O510@smtpauth4.wiscmail.wisc.edu>; Thu, 06 Feb 2014 21:03:06 -0600 (CST) Message-id: <52F44CE9.8090708@freebsd.org> Date: Thu, 06 Feb 2014 21:03:05 -0600 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 To: Andrew Turner , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r261564 - head/sys/arm/arm References: <201402062026.s16KQahK012426@svn.freebsd.org> In-reply-to: <201402062026.s16KQahK012426@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 03:03:14 -0000 On 02/06/14 14:26, Andrew Turner wrote: > Author: andrew > Date: Thu Feb 6 20:26:36 2014 > New Revision: 261564 > URL: http://svnweb.freebsd.org/changeset/base/261564 > > Log: > Fix __syscall on armeb EABI. As it returns a 64-bit value it needs to place > 32-bit data in r1, not r0. 64-bit data is already packed correctly. > Does this mean armeb works again? -Nathan From owner-svn-src-head@FreeBSD.ORG Fri Feb 7 03:30:23 2014 Return-Path: Delivered-To: svn-src-head@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 CAF362EF; Fri, 7 Feb 2014 03:30:23 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B47561889; Fri, 7 Feb 2014 03:30:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s173UNVq087138; Fri, 7 Feb 2014 03:30:23 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s173UGtw087097; Fri, 7 Feb 2014 03:30:16 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201402070330.s173UGtw087097@svn.freebsd.org> From: Ian Lepore Date: Fri, 7 Feb 2014 03:30:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261570 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 03:30:23 -0000 Author: ian Date: Fri Feb 7 03:30:16 2014 New Revision: 261570 URL: http://svnweb.freebsd.org/changeset/base/261570 Log: Revert r260440. I didn't realize that most of this change was already in effect due to r250753. That is sufficient for all SoCs with a 32 byte cache line size. Systems with 64 byte cache lines will need the option; that will be done in a separate commit. Thanks to loos@ for pointing out r250753. Modified: head/sys/arm/conf/AC100 head/sys/arm/conf/ARMADAXP head/sys/arm/conf/ARNDALE head/sys/arm/conf/ATMEL head/sys/arm/conf/AVILA head/sys/arm/conf/BWCT head/sys/arm/conf/CAMBRIA head/sys/arm/conf/CNS11XXNAS head/sys/arm/conf/CUBIEBOARD head/sys/arm/conf/CUBIEBOARD2 head/sys/arm/conf/DB-78XXX head/sys/arm/conf/DB-88F5XXX head/sys/arm/conf/DB-88F6XXX head/sys/arm/conf/DIGI-CCWMX53 head/sys/arm/conf/EA3250 head/sys/arm/conf/EB9200 head/sys/arm/conf/EFIKA_MX head/sys/arm/conf/ETHERNUT5 head/sys/arm/conf/HL200 head/sys/arm/conf/HL201 head/sys/arm/conf/IMX53-QSB head/sys/arm/conf/KB920X head/sys/arm/conf/LN2410SBC head/sys/arm/conf/NSLU head/sys/arm/conf/PANDABOARD head/sys/arm/conf/QILA9G20 head/sys/arm/conf/RPI-B head/sys/arm/conf/SAM9260EK head/sys/arm/conf/SAM9G20EK head/sys/arm/conf/SAM9X25EK head/sys/arm/conf/SHEEVAPLUG head/sys/arm/conf/SN9G45 head/sys/arm/conf/TS7800 head/sys/arm/conf/ZEDBOARD Modified: head/sys/arm/conf/AC100 ============================================================================== --- head/sys/arm/conf/AC100 Thu Feb 6 22:10:26 2014 (r261569) +++ head/sys/arm/conf/AC100 Fri Feb 7 03:30:16 2014 (r261570) @@ -66,7 +66,6 @@ device loop device md # USB -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. #options USB_DEBUG # enable debug msgs #device usb #device ehci Modified: head/sys/arm/conf/ARMADAXP ============================================================================== --- head/sys/arm/conf/ARMADAXP Thu Feb 6 22:10:26 2014 (r261569) +++ head/sys/arm/conf/ARMADAXP Fri Feb 7 03:30:16 2014 (r261570) @@ -67,7 +67,6 @@ device loop device md # USB -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. options USB_DEBUG # enable debug msgs device usb device ehci Modified: head/sys/arm/conf/ARNDALE ============================================================================== --- head/sys/arm/conf/ARNDALE Thu Feb 6 22:10:26 2014 (r261569) +++ head/sys/arm/conf/ARNDALE Fri Feb 7 03:30:16 2014 (r261570) @@ -94,7 +94,6 @@ device md device gpio # USB support -options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. device usb options USB_DEBUG #options USB_REQ_DEBUG Modified: head/sys/arm/conf/ATMEL ============================================================================== --- head/sys/arm/conf/ATMEL Thu Feb 6 22:10:26 2014 (r261569) +++ head/sys/arm/conf/ATMEL Fri Feb 7 03:30:16 2014 (r261570) @@ -156,7 +156,6 @@ device uart # Multi-uart driver options ALT_BREAK_TO_DEBUGGER # USB support -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. options USB_DEBUG # enable debug msgs device ohci # OHCI USB interface device usb # USB Bus (required) Modified: head/sys/arm/conf/AVILA ============================================================================== --- head/sys/arm/conf/AVILA Thu Feb 6 22:10:26 2014 (r261569) +++ head/sys/arm/conf/AVILA Fri Feb 7 03:30:16 2014 (r261570) @@ -143,7 +143,6 @@ device ath_ar9160 device ath_ar9280 device usb -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. #options USB_DEBUG device ohci device ehci Modified: head/sys/arm/conf/BWCT ============================================================================== --- head/sys/arm/conf/BWCT Thu Feb 6 22:10:26 2014 (r261569) +++ head/sys/arm/conf/BWCT Fri Feb 7 03:30:16 2014 (r261570) @@ -104,7 +104,6 @@ device spibus device bpf # Berkeley packet filter #options USB_DEBUG -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. #device ohci #device usb #device umass # Disks/Mass storage - Requires scbus and da Modified: head/sys/arm/conf/CAMBRIA ============================================================================== --- head/sys/arm/conf/CAMBRIA Thu Feb 6 22:10:26 2014 (r261569) +++ head/sys/arm/conf/CAMBRIA Fri Feb 7 03:30:16 2014 (r261570) @@ -136,7 +136,6 @@ options AH_SUPPORT_AR5416 # NB: for 11n device ath_hal # NB: 2 USB 2.0 ports standard -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. device usb options USB_EHCI_BIG_ENDIAN_DESC # handle big-endian byte order #options USB_DEBUG Modified: head/sys/arm/conf/CNS11XXNAS ============================================================================== --- head/sys/arm/conf/CNS11XXNAS Thu Feb 6 22:10:26 2014 (r261569) +++ head/sys/arm/conf/CNS11XXNAS Fri Feb 7 03:30:16 2014 (r261570) @@ -105,7 +105,6 @@ device random # Entrop #options ARM_USE_SMALL_ALLOC device usb -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. #options USB_DEBUG device ohci device ehci Modified: head/sys/arm/conf/CUBIEBOARD ============================================================================== --- head/sys/arm/conf/CUBIEBOARD Thu Feb 6 22:10:26 2014 (r261569) +++ head/sys/arm/conf/CUBIEBOARD Fri Feb 7 03:30:16 2014 (r261570) @@ -106,7 +106,6 @@ device da # Direct Access (disks) device pass # USB support -options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. device usb options USB_DEBUG #options USB_REQ_DEBUG Modified: head/sys/arm/conf/CUBIEBOARD2 ============================================================================== --- head/sys/arm/conf/CUBIEBOARD2 Thu Feb 6 22:10:26 2014 (r261569) +++ head/sys/arm/conf/CUBIEBOARD2 Fri Feb 7 03:30:16 2014 (r261570) @@ -106,7 +106,6 @@ device da # Direct Access (disks) device pass # USB support -options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. device usb options USB_DEBUG #options USB_REQ_DEBUG Modified: head/sys/arm/conf/DB-78XXX ============================================================================== --- head/sys/arm/conf/DB-78XXX Thu Feb 6 22:10:26 2014 (r261569) +++ head/sys/arm/conf/DB-78XXX Fri Feb 7 03:30:16 2014 (r261570) @@ -67,7 +67,6 @@ device e1000phy device bpf # USB -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. options USB_DEBUG # enable debug msgs device usb device ehci Modified: head/sys/arm/conf/DB-88F5XXX ============================================================================== --- head/sys/arm/conf/DB-88F5XXX Thu Feb 6 22:10:26 2014 (r261569) +++ head/sys/arm/conf/DB-88F5XXX Fri Feb 7 03:30:16 2014 (r261570) @@ -73,7 +73,6 @@ device iicbus device ds133x # USB -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. options USB_DEBUG # enable debug msgs device usb device ehci Modified: head/sys/arm/conf/DB-88F6XXX ============================================================================== --- head/sys/arm/conf/DB-88F6XXX Thu Feb 6 22:10:26 2014 (r261569) +++ head/sys/arm/conf/DB-88F6XXX Fri Feb 7 03:30:16 2014 (r261570) @@ -71,7 +71,6 @@ device crypto device cryptodev # USB -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. options USB_DEBUG # enable debug msgs device usb device ehci Modified: head/sys/arm/conf/DIGI-CCWMX53 ============================================================================== --- head/sys/arm/conf/DIGI-CCWMX53 Thu Feb 6 22:10:26 2014 (r261569) +++ head/sys/arm/conf/DIGI-CCWMX53 Fri Feb 7 03:30:16 2014 (r261570) @@ -134,7 +134,6 @@ device cd # CD device pass # Passthrough device (direct SCSI access) # USB support -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. options USB_DEBUG # enable debug msgs device ehci # OHCI USB interface device usb # USB Bus (required) Modified: head/sys/arm/conf/EA3250 ============================================================================== --- head/sys/arm/conf/EA3250 Thu Feb 6 22:10:26 2014 (r261569) +++ head/sys/arm/conf/EA3250 Fri Feb 7 03:30:16 2014 (r261570) @@ -65,7 +65,6 @@ device bpf device lpe # USB -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. options USB_DEBUG device usb device ohci Modified: head/sys/arm/conf/EB9200 ============================================================================== --- head/sys/arm/conf/EB9200 Thu Feb 6 22:10:26 2014 (r261569) +++ head/sys/arm/conf/EB9200 Fri Feb 7 03:30:16 2014 (r261570) @@ -92,7 +92,6 @@ device icee device bpf # USB support -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. options USB_DEBUG # enable debug msgs device ohci # OHCI localbus->USB interface device usb # USB Bus (required) Modified: head/sys/arm/conf/EFIKA_MX ============================================================================== --- head/sys/arm/conf/EFIKA_MX Thu Feb 6 22:10:26 2014 (r261569) +++ head/sys/arm/conf/EFIKA_MX Fri Feb 7 03:30:16 2014 (r261570) @@ -130,7 +130,6 @@ device cd # CD device pass # Passthrough device (direct SCSI access) # USB support -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. #options USB_DEBUG # enable debug msgs device ehci # OHCI USB interface device usb # USB Bus (required) Modified: head/sys/arm/conf/ETHERNUT5 ============================================================================== --- head/sys/arm/conf/ETHERNUT5 Thu Feb 6 22:10:26 2014 (r261569) +++ head/sys/arm/conf/ETHERNUT5 Fri Feb 7 03:30:16 2014 (r261570) @@ -149,7 +149,6 @@ device uart # Multi-uart driver options ALT_BREAK_TO_DEBUGGER # USB support -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. #options USB_DEBUG # enable debug msgs device ohci # OHCI USB interface device usb # USB Bus (required) Modified: head/sys/arm/conf/HL200 ============================================================================== --- head/sys/arm/conf/HL200 Thu Feb 6 22:10:26 2014 (r261569) +++ head/sys/arm/conf/HL200 Fri Feb 7 03:30:16 2014 (r261570) @@ -94,7 +94,6 @@ device icee device bpf # USB support -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. options USB_DEBUG # enable debug msgs device ohci # OHCI localbus->USB interface device usb # USB Bus (required) Modified: head/sys/arm/conf/HL201 ============================================================================== --- head/sys/arm/conf/HL201 Thu Feb 6 22:10:26 2014 (r261569) +++ head/sys/arm/conf/HL201 Fri Feb 7 03:30:16 2014 (r261570) @@ -85,7 +85,6 @@ device md device bpf # USB support -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. device ohci # OHCI localbus->USB interface device usb # USB Bus (required) #device udbp # USB Double Bulk Pipe devices Modified: head/sys/arm/conf/IMX53-QSB ============================================================================== --- head/sys/arm/conf/IMX53-QSB Thu Feb 6 22:10:26 2014 (r261569) +++ head/sys/arm/conf/IMX53-QSB Fri Feb 7 03:30:16 2014 (r261570) @@ -133,7 +133,6 @@ device cd # CD device pass # Passthrough device (direct SCSI access) # USB support -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. #options USB_DEBUG # enable debug msgs device ehci # OHCI USB interface device usb # USB Bus (required) Modified: head/sys/arm/conf/KB920X ============================================================================== --- head/sys/arm/conf/KB920X Thu Feb 6 22:10:26 2014 (r261569) +++ head/sys/arm/conf/KB920X Fri Feb 7 03:30:16 2014 (r261570) @@ -95,7 +95,6 @@ device icee device bpf # USB support -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. options USB_DEBUG # enable debug msgs device ohci # OHCI localbus->USB interface device usb # USB Bus (required) Modified: head/sys/arm/conf/LN2410SBC ============================================================================== --- head/sys/arm/conf/LN2410SBC Thu Feb 6 22:10:26 2014 (r261569) +++ head/sys/arm/conf/LN2410SBC Fri Feb 7 03:30:16 2014 (r261570) @@ -77,7 +77,6 @@ options WITNESS_SKIPSPIN #Don't run wit device md -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. options USB_DEBUG # enable debug msgs device usb device ohci Modified: head/sys/arm/conf/NSLU ============================================================================== --- head/sys/arm/conf/NSLU Thu Feb 6 22:10:26 2014 (r261569) +++ head/sys/arm/conf/NSLU Fri Feb 7 03:30:16 2014 (r261570) @@ -108,7 +108,6 @@ device random # Entropy device #options ARM_USE_SMALL_ALLOC device usb -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. options USB_DEBUG device ohci device ehci Modified: head/sys/arm/conf/PANDABOARD ============================================================================== --- head/sys/arm/conf/PANDABOARD Thu Feb 6 22:10:26 2014 (r261569) +++ head/sys/arm/conf/PANDABOARD Fri Feb 7 03:30:16 2014 (r261570) @@ -112,7 +112,6 @@ device md device random # Entropy device # USB support -options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. device usb options USB_DEBUG #options USB_REQ_DEBUG Modified: head/sys/arm/conf/QILA9G20 ============================================================================== --- head/sys/arm/conf/QILA9G20 Thu Feb 6 22:10:26 2014 (r261569) +++ head/sys/arm/conf/QILA9G20 Fri Feb 7 03:30:16 2014 (r261570) @@ -118,7 +118,6 @@ device cd # CD device pass # Passthrough device (direct SCSI access) # USB support -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. device ohci # OHCI localbus->USB interface device usb # USB Bus (required) device umass # Disks/Mass storage - Requires scbus and da Modified: head/sys/arm/conf/RPI-B ============================================================================== --- head/sys/arm/conf/RPI-B Thu Feb 6 22:10:26 2014 (r261569) +++ head/sys/arm/conf/RPI-B Fri Feb 7 03:30:16 2014 (r261570) @@ -93,7 +93,6 @@ device md device random # Entropy device # USB support -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. device usb options USB_DEBUG device dwcotg #DWC OTG controller Modified: head/sys/arm/conf/SAM9260EK ============================================================================== --- head/sys/arm/conf/SAM9260EK Thu Feb 6 22:10:26 2014 (r261569) +++ head/sys/arm/conf/SAM9260EK Fri Feb 7 03:30:16 2014 (r261570) @@ -158,7 +158,6 @@ device uart # Multi-uart driver options ALT_BREAK_TO_DEBUGGER # USB support -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. #options USB_DEBUG # enable debug msgs device ohci # OHCI USB interface device usb # USB Bus (required) Modified: head/sys/arm/conf/SAM9G20EK ============================================================================== --- head/sys/arm/conf/SAM9G20EK Thu Feb 6 22:10:26 2014 (r261569) +++ head/sys/arm/conf/SAM9G20EK Fri Feb 7 03:30:16 2014 (r261570) @@ -122,7 +122,6 @@ device cd # CD device pass # Passthrough device (direct SCSI access) # USB support -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. device ohci # OHCI localbus->USB interface device usb # USB Bus (required) device umass # Disks/Mass storage - Requires scbus and da Modified: head/sys/arm/conf/SAM9X25EK ============================================================================== --- head/sys/arm/conf/SAM9X25EK Thu Feb 6 22:10:26 2014 (r261569) +++ head/sys/arm/conf/SAM9X25EK Fri Feb 7 03:30:16 2014 (r261570) @@ -120,7 +120,6 @@ device cd # CD device pass # Passthrough device (direct SCSI access) # USB support -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. #device ohci # OHCI localbus->USB interface #device usb # USB Bus (required) #device umass # Disks/Mass storage - Requires scbus and da Modified: head/sys/arm/conf/SHEEVAPLUG ============================================================================== --- head/sys/arm/conf/SHEEVAPLUG Thu Feb 6 22:10:26 2014 (r261569) +++ head/sys/arm/conf/SHEEVAPLUG Fri Feb 7 03:30:16 2014 (r261570) @@ -65,7 +65,6 @@ device crypto device cryptodev # USB -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. options USB_DEBUG # enable debug msgs device usb device ehci Modified: head/sys/arm/conf/SN9G45 ============================================================================== --- head/sys/arm/conf/SN9G45 Thu Feb 6 22:10:26 2014 (r261569) +++ head/sys/arm/conf/SN9G45 Fri Feb 7 03:30:16 2014 (r261570) @@ -96,7 +96,6 @@ device cd # CD device pass # Passthrough device (direct SCSI access) # USB support -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. device ohci # OHCI localbus->USB interface device usb # USB Bus (required) device umass # Disks/Mass storage - Requires scbus and da Modified: head/sys/arm/conf/TS7800 ============================================================================== --- head/sys/arm/conf/TS7800 Thu Feb 6 22:10:26 2014 (r261569) +++ head/sys/arm/conf/TS7800 Fri Feb 7 03:30:16 2014 (r261570) @@ -61,7 +61,6 @@ device bpf options HZ=1000 # USB -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. device usb device ehci device umass Modified: head/sys/arm/conf/ZEDBOARD ============================================================================== --- head/sys/arm/conf/ZEDBOARD Thu Feb 6 22:10:26 2014 (r261569) +++ head/sys/arm/conf/ZEDBOARD Fri Feb 7 03:30:16 2014 (r261570) @@ -81,7 +81,6 @@ device sdhci # generic sdhci device bpf # Berkeley packet filter # USB support -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. device usb options USB_DEBUG #options USB_REQ_DEBUG From owner-svn-src-head@FreeBSD.ORG Fri Feb 7 03:41:30 2014 Return-Path: Delivered-To: svn-src-head@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 AC9D552B; Fri, 7 Feb 2014 03:41:30 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7D32E19AE; Fri, 7 Feb 2014 03:41:30 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s173fSWC065132 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 6 Feb 2014 19:41:29 -0800 (PST) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s173fSq8065131; Thu, 6 Feb 2014 19:41:28 -0800 (PST) (envelope-from jmg) Date: Thu, 6 Feb 2014 19:41:28 -0800 From: John-Mark Gurney To: Nathan Whitehorn Subject: Re: svn commit: r261564 - head/sys/arm/arm Message-ID: <20140207034128.GB89104@funkthat.com> References: <201402062026.s16KQahK012426@svn.freebsd.org> <52F44CE9.8090708@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52F44CE9.8090708@freebsd.org> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Thu, 06 Feb 2014 19:41:29 -0800 (PST) Cc: Andrew Turner , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 03:41:30 -0000 Nathan Whitehorn wrote this message on Thu, Feb 06, 2014 at 21:03 -0600: > On 02/06/14 14:26, Andrew Turner wrote: > >Author: andrew > >Date: Thu Feb 6 20:26:36 2014 > >New Revision: 261564 > >URL: http://svnweb.freebsd.org/changeset/base/261564 > > > >Log: > > Fix __syscall on armeb EABI. As it returns a 64-bit value it needs to > > place > > 32-bit data in r1, not r0. 64-bit data is already packed correctly. > > Does this mean armeb works again? It's getting closer... I have a pending fix for off_t that I need to resolve w/ bde, and then there is the wired mapping panic issue that I've posted about to -arm... I've gotten a bit busy the last couple weeks, so I haven't had time to work on it recently... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Fri Feb 7 04:02:02 2014 Return-Path: Delivered-To: svn-src-head@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 4E88B852; Fri, 7 Feb 2014 04:02:02 +0000 (UTC) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id 0A71B1ADE; Fri, 7 Feb 2014 04:02:01 +0000 (UTC) Received: from lgwl-lstewart2.corp.netflix.com (lstewart-laptop.caia.swin.edu.au [136.186.229.148]) by lauren.room52.net (Postfix) with ESMTPSA id 5C7DC7E820; Fri, 7 Feb 2014 15:01:53 +1100 (EST) Message-ID: <52F45AA4.4000004@freebsd.org> Date: Fri, 07 Feb 2014 15:01:40 +1100 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Jason Evans , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r261071 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src include lib/libc/gen lib/libc/... References: <201401230247.s0N2lbkU098546@svn.freebsd.org> In-Reply-To: <201401230247.s0N2lbkU098546@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=unavailable version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on lauren.room52.net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 04:02:02 -0000 Hi Jason, On 01/23/14 13:47, Jason Evans wrote: > Author: jasone > Date: Thu Jan 23 02:47:36 2014 > New Revision: 261071 > URL: http://svnweb.freebsd.org/changeset/base/261071 > > Log: > Update jemalloc to version 3.5.0. I suspect that this commit is related to the assertion failures I've been seeing on recent head when I updated from r260427 to r261453. Here's two I noticed today: : /usr/local/poudriere/jails/head-amd64/usr/src/lib/libc/../../contrib/jemalloc/include/jemalloc/internal/arena.h:7 76: Failed assertion: "binind == actual_binind" *** Signal 6 and : /usr/src/lib/libc/../../contrib/jemalloc/include/jemalloc/internal/arena.h:776: Failed assertion: "binind == actual_binind" Abort trap I seem to be able to reproduce the first one readily when poudriere tries to build chromium so I can provide more info and help test ideas. Cheers, Lawrence From owner-svn-src-head@FreeBSD.ORG Fri Feb 7 04:05:10 2014 Return-Path: Delivered-To: svn-src-head@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 698E9AD9; Fri, 7 Feb 2014 04:05: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 55BAB1AF3; Fri, 7 Feb 2014 04:05:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1745A3g001710; Fri, 7 Feb 2014 04:05:10 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s17458pS001699; Fri, 7 Feb 2014 04:05:08 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201402070405.s17458pS001699@svn.freebsd.org> From: Ian Lepore Date: Fri, 7 Feb 2014 04:05:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261572 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 04:05:10 -0000 Author: ian Date: Fri Feb 7 04:05:08 2014 New Revision: 261572 URL: http://svnweb.freebsd.org/changeset/base/261572 Log: Add option USB_HOST_ALIGN=64 for all SoCs that have 64 byte cache lines. Modified: head/sys/arm/conf/ARNDALE head/sys/arm/conf/CUBIEBOARD head/sys/arm/conf/CUBIEBOARD2 head/sys/arm/conf/DIGI-CCWMX53 head/sys/arm/conf/EFIKA_MX head/sys/arm/conf/IMX53-QSB head/sys/arm/conf/PANDABOARD Modified: head/sys/arm/conf/ARNDALE ============================================================================== --- head/sys/arm/conf/ARNDALE Fri Feb 7 04:02:14 2014 (r261571) +++ head/sys/arm/conf/ARNDALE Fri Feb 7 04:05:08 2014 (r261572) @@ -94,6 +94,7 @@ device md device gpio # USB support +options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. device usb options USB_DEBUG #options USB_REQ_DEBUG Modified: head/sys/arm/conf/CUBIEBOARD ============================================================================== --- head/sys/arm/conf/CUBIEBOARD Fri Feb 7 04:02:14 2014 (r261571) +++ head/sys/arm/conf/CUBIEBOARD Fri Feb 7 04:05:08 2014 (r261572) @@ -106,6 +106,7 @@ device da # Direct Access (disks) device pass # USB support +options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. device usb options USB_DEBUG #options USB_REQ_DEBUG Modified: head/sys/arm/conf/CUBIEBOARD2 ============================================================================== --- head/sys/arm/conf/CUBIEBOARD2 Fri Feb 7 04:02:14 2014 (r261571) +++ head/sys/arm/conf/CUBIEBOARD2 Fri Feb 7 04:05:08 2014 (r261572) @@ -106,6 +106,7 @@ device da # Direct Access (disks) device pass # USB support +options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. device usb options USB_DEBUG #options USB_REQ_DEBUG Modified: head/sys/arm/conf/DIGI-CCWMX53 ============================================================================== --- head/sys/arm/conf/DIGI-CCWMX53 Fri Feb 7 04:02:14 2014 (r261571) +++ head/sys/arm/conf/DIGI-CCWMX53 Fri Feb 7 04:05:08 2014 (r261572) @@ -134,6 +134,7 @@ device cd # CD device pass # Passthrough device (direct SCSI access) # USB support +options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. options USB_DEBUG # enable debug msgs device ehci # OHCI USB interface device usb # USB Bus (required) Modified: head/sys/arm/conf/EFIKA_MX ============================================================================== --- head/sys/arm/conf/EFIKA_MX Fri Feb 7 04:02:14 2014 (r261571) +++ head/sys/arm/conf/EFIKA_MX Fri Feb 7 04:05:08 2014 (r261572) @@ -130,6 +130,7 @@ device cd # CD device pass # Passthrough device (direct SCSI access) # USB support +options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. #options USB_DEBUG # enable debug msgs device ehci # OHCI USB interface device usb # USB Bus (required) Modified: head/sys/arm/conf/IMX53-QSB ============================================================================== --- head/sys/arm/conf/IMX53-QSB Fri Feb 7 04:02:14 2014 (r261571) +++ head/sys/arm/conf/IMX53-QSB Fri Feb 7 04:05:08 2014 (r261572) @@ -133,6 +133,7 @@ device cd # CD device pass # Passthrough device (direct SCSI access) # USB support +options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. #options USB_DEBUG # enable debug msgs device ehci # OHCI USB interface device usb # USB Bus (required) Modified: head/sys/arm/conf/PANDABOARD ============================================================================== --- head/sys/arm/conf/PANDABOARD Fri Feb 7 04:02:14 2014 (r261571) +++ head/sys/arm/conf/PANDABOARD Fri Feb 7 04:05:08 2014 (r261572) @@ -112,6 +112,7 @@ device md device random # Entropy device # USB support +options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. device usb options USB_DEBUG #options USB_REQ_DEBUG From owner-svn-src-head@FreeBSD.ORG Fri Feb 7 05:07:14 2014 Return-Path: Delivered-To: svn-src-head@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 DF092909; Fri, 7 Feb 2014 05:07:14 +0000 (UTC) Received: from canonware.com (canonware.com [204.109.63.53]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B594A1FEA; Fri, 7 Feb 2014 05:07:14 +0000 (UTC) Received: from [192.168.168.18] (70-91-206-178-BusName-SFBA.hfc.comcastbusiness.net [70.91.206.178]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by canonware.com (Postfix) with ESMTPSA id 05BAF28418; Thu, 6 Feb 2014 21:07:05 -0800 (PST) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.1 \(1827\)) Subject: Re: svn commit: r261071 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src include lib/libc/gen lib/libc/... From: Jason Evans In-Reply-To: <52F45AA4.4000004@freebsd.org> Date: Thu, 6 Feb 2014 21:06:50 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <78E18422-AA85-41D4-9DE8-D33D00881ABA@freebsd.org> References: <201401230247.s0N2lbkU098546@svn.freebsd.org> <52F45AA4.4000004@freebsd.org> To: Lawrence Stewart X-Mailer: Apple Mail (2.1827) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 05:07:15 -0000 On Feb 6, 2014, at 8:01 PM, Lawrence Stewart = wrote: > On 01/23/14 13:47, Jason Evans wrote: >> Author: jasone >> Date: Thu Jan 23 02:47:36 2014 >> New Revision: 261071 >> URL: http://svnweb.freebsd.org/changeset/base/261071 >>=20 >> Log: >> Update jemalloc to version 3.5.0. >=20 > I suspect that this commit is related to the assertion failures I've > been seeing on recent head when I updated from r260427 to r261453. > Here's two I noticed today: >=20 > : > = /usr/local/poudriere/jails/head-amd64/usr/src/lib/libc/../../contrib/jemal= loc/include/jemalloc/internal/arena.h:7 > 76: Failed assertion: "binind =3D=3D actual_binind" > *** Signal 6 >=20 > and >=20 > : > = /usr/src/lib/libc/../../contrib/jemalloc/include/jemalloc/internal/arena.h= :776: > Failed assertion: "binind =3D=3D actual_binind" > Abort trap >=20 > I seem to be able to reproduce the first one readily when poudriere > tries to build chromium so I can provide more info and help test = ideas. >=20 > Cheers, > Lawrence Are the failures you saw happening only for the chromium build, or have = you seen that same failure for other things as well? If it=92s just the = chromium build, is there any chance that this same failure would have = occurred prior to the jemalloc 3.5.0 update? If this is an application bug, it=92s probably due do a buffer overrun = corrupting an adjacent page that contains page run metadata. If it=92s = a jemalloc bug, I=92m going to need to reproduce it and dig in; it=92s = unlikely to be easy to diagnose. Thanks, Jason= From owner-svn-src-head@FreeBSD.ORG Fri Feb 7 05:08:59 2014 Return-Path: Delivered-To: svn-src-head@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 A824AAA0; Fri, 7 Feb 2014 05:08: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 929631FFD; Fri, 7 Feb 2014 05:08:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1758x3Z024904; Fri, 7 Feb 2014 05:08:59 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1758xZx024903; Fri, 7 Feb 2014 05:08:59 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201402070508.s1758xZx024903@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 7 Feb 2014 05:08:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261577 - head/sys/dev/msk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 05:08:59 -0000 Author: yongari Date: Fri Feb 7 05:08:59 2014 New Revision: 261577 URL: http://svnweb.freebsd.org/changeset/base/261577 Log: Revert r234666. Clearing TWSI IRQ seems to cause watchdog timeout on old Yukon II controllers. Tested by: bsam MFC after: 2 weeks Modified: head/sys/dev/msk/if_msk.c Modified: head/sys/dev/msk/if_msk.c ============================================================================== --- head/sys/dev/msk/if_msk.c Fri Feb 7 04:35:20 2014 (r261576) +++ head/sys/dev/msk/if_msk.c Fri Feb 7 05:08:59 2014 (r261577) @@ -3750,9 +3750,6 @@ msk_intr(void *xsc) if ((status & Y2_IS_STAT_BMU) != 0 && domore == 0) CSR_WRITE_4(sc, STAT_CTRL, SC_STAT_CLR_IRQ); - /* Clear TWSI IRQ. */ - if ((status & Y2_IS_TWSI_RDY) != 0) - CSR_WRITE_4(sc, B2_I2C_IRQ, 1); /* Reenable interrupts. */ CSR_WRITE_4(sc, B0_Y2_SP_ICR, 2); From owner-svn-src-head@FreeBSD.ORG Fri Feb 7 07:57:51 2014 Return-Path: Delivered-To: svn-src-head@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 ACE026FF; Fri, 7 Feb 2014 07:57:51 +0000 (UTC) Received: from mail-qc0-x22a.google.com (mail-qc0-x22a.google.com [IPv6:2607:f8b0:400d:c01::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2138E1C73; Fri, 7 Feb 2014 07:57:51 +0000 (UTC) Received: by mail-qc0-f170.google.com with SMTP id e9so5276074qcy.15 for ; Thu, 06 Feb 2014 23:57:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=QCn6Y7iDzzZHmaNJF886UQkLeIbN20AVZ/UJINu3IVU=; b=QXoPK2Au69xokiFn4lSkUwmFIMUHU77gccqXi7iMyEQOpHIJNekf4G5PB0x0SiXohU /1+821FZUCOnJ6OcNXt9qoS5qGhvOFEKUlKMgf6lye7ZaC0sKiGMH60IpKWykBUZ7S7s WrxmdKP+MeNvMbhYlBhQSPv+DnLSmEunda7NMbLT0nEyKuTy5wFVBHgBdibpIYe2EdaS T5Y64SEjeqReZ6g3SYGybGF0bA4heERanRZgHYDzXWP/1YMS56wdkAqftzVIt4ctVeZ8 pHw4Z42ZD3hIZCFI5m94oeltN2qid3iRN2ic3fafK3eOxuiiDaDidJvVdXvLarGc6PPx Rj9Q== MIME-Version: 1.0 X-Received: by 10.224.16.72 with SMTP id n8mr19730041qaa.76.1391759870253; Thu, 06 Feb 2014 23:57:50 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.224.52.8 with HTTP; Thu, 6 Feb 2014 23:57:50 -0800 (PST) In-Reply-To: <20140207034128.GB89104@funkthat.com> References: <201402062026.s16KQahK012426@svn.freebsd.org> <52F44CE9.8090708@freebsd.org> <20140207034128.GB89104@funkthat.com> Date: Thu, 6 Feb 2014 23:57:50 -0800 X-Google-Sender-Auth: mLHbgY3Ck84KWRMQNlL7Enb9WG8 Message-ID: Subject: Re: svn commit: r261564 - head/sys/arm/arm From: Adrian Chadd To: John-Mark Gurney Content-Type: text/plain; charset=ISO-8859-1 Cc: Andrew Turner , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Nathan Whitehorn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 07:57:51 -0000 On 6 February 2014 19:41, John-Mark Gurney wrote: > Nathan Whitehorn wrote this message on Thu, Feb 06, 2014 at 21:03 -0600: >> On 02/06/14 14:26, Andrew Turner wrote: >> >Author: andrew >> >Date: Thu Feb 6 20:26:36 2014 >> >New Revision: 261564 >> >URL: http://svnweb.freebsd.org/changeset/base/261564 >> > >> >Log: >> > Fix __syscall on armeb EABI. As it returns a 64-bit value it needs to >> > place >> > 32-bit data in r1, not r0. 64-bit data is already packed correctly. >> >> Does this mean armeb works again? > > It's getting closer... I have a pending fix for off_t that I need to > resolve w/ bde, and then there is the wired mapping panic issue that > I've posted about to -arm... I've gotten a bit busy the last couple > weeks, so I haven't had time to work on it recently... Thanks so much for championing this! -a From owner-svn-src-head@FreeBSD.ORG Fri Feb 7 10:05:12 2014 Return-Path: Delivered-To: svn-src-head@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 AC9D1CA3; Fri, 7 Feb 2014 10:05:12 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 87135189F; Fri, 7 Feb 2014 10:05:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s17A5Cfm045540; Fri, 7 Feb 2014 10:05:12 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s17A5CHH045539; Fri, 7 Feb 2014 10:05:12 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201402071005.s17A5CHH045539@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 7 Feb 2014 10:05:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261582 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 10:05:12 -0000 Author: glebius Date: Fri Feb 7 10:05:12 2014 New Revision: 261582 URL: http://svnweb.freebsd.org/changeset/base/261582 Log: Spacing. Modified: head/sys/net/flowtable.c Modified: head/sys/net/flowtable.c ============================================================================== --- head/sys/net/flowtable.c Fri Feb 7 07:34:47 2014 (r261581) +++ head/sys/net/flowtable.c Fri Feb 7 10:05:12 2014 (r261582) @@ -36,13 +36,13 @@ POSSIBILITY OF SUCH DAMAGE. #include __FBSDID("$FreeBSD$"); -#include +#include #include #include #include #include #include -#include +#include #include #include #include @@ -58,7 +58,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include @@ -167,8 +167,8 @@ struct flowtable { fl_lock_t *ft_unlock; fl_rtalloc_t *ft_rtalloc; /* - * XXX need to pad out - */ + * XXX need to pad out + */ struct mtx *ft_locks; union flentryp ft_table; bitstr_t *ft_masks[MAXCPU]; @@ -219,7 +219,7 @@ do { \ * - Make flowtable stats per-cpu, aggregated at sysctl call time, * to avoid extra cache evictions caused by incrementing a shared * counter - * - add sysctls to resize && flush flow tables + * - add sysctls to resize && flush flow tables * - Add per flowtable sysctls for statistics and configuring timeouts * - add saturation counter to rtentry to support per-packet load-balancing * add flag to indicate round-robin flow, add list lookup from head @@ -286,7 +286,7 @@ sysctl_nmbflows(SYSCTL_HANDLER_ARGS) int error, newnmbflows; newnmbflows = V_flowtable_nmbflows; - error = sysctl_handle_int(oidp, &newnmbflows, 0, req); + error = sysctl_handle_int(oidp, &newnmbflows, 0, req); if (error == 0 && req->newptr) { if (newnmbflows > V_flowtable_nmbflows) { V_flowtable_nmbflows = newnmbflows; @@ -532,17 +532,17 @@ ipv4_mbuf_demarshal(struct flowtable *ft if ((*flags & FL_HASH_ALL) && (th->th_flags & (TH_RST|TH_FIN))) *flags |= FL_STALE; - break; + break; case IPPROTO_UDP: uh = (struct udphdr *)((caddr_t)ip + iphlen); sport = uh->uh_sport; dport = uh->uh_dport; - break; + break; case IPPROTO_SCTP: sh = (struct sctphdr *)((caddr_t)ip + iphlen); sport = sh->src_port; dport = sh->dest_port; - break; + break; default: FLDPRINTF(ft, FL_DEBUG_ALL, "proto=0x%x not supported\n", proto); return (ENOTSUP); @@ -560,7 +560,7 @@ skipports: static uint32_t ipv4_flow_lookup_hash_internal( - struct sockaddr_in *ssin, struct sockaddr_in *dsin, + struct sockaddr_in *ssin, struct sockaddr_in *dsin, uint32_t *key, uint16_t flags) { uint16_t sport, dport; @@ -581,7 +581,7 @@ ipv4_flow_lookup_hash_internal( } if (flags & FL_HASH_ALL) { ((uint16_t *)key)[0] = sport; - ((uint16_t *)key)[1] = dport; + ((uint16_t *)key)[1] = dport; } else offset = V_flow_hashjitter + proto; @@ -764,7 +764,7 @@ do { \ static uint32_t ipv6_flow_lookup_hash_internal( - struct sockaddr_in6 *ssin6, struct sockaddr_in6 *dsin6, + struct sockaddr_in6 *ssin6, struct sockaddr_in6 *dsin6, uint32_t *key, uint16_t flags) { uint16_t sport, dport; @@ -787,7 +787,7 @@ ipv6_flow_lookup_hash_internal( } if (flags & FL_HASH_ALL) { ((uint16_t *)key)[0] = sport; - ((uint16_t *)key)[1] = dport; + ((uint16_t *)key)[1] = dport; } else offset = V_flow_hashjitter + proto; @@ -885,7 +885,7 @@ flow_stale(struct flowtable *ft, struct && (idle_time > ft->ft_syn_idle)) || ((fle->f_flags & (TH_SYN|TH_ACK)) == (TH_SYN|TH_ACK) && (idle_time > ft->ft_tcp_idle)) || - ((fle->f_rt->rt_flags & RTF_UP) == 0 || + ((fle->f_rt->rt_flags & RTF_UP) == 0 || (fle->f_rt->rt_ifp == NULL))) return (1); @@ -906,7 +906,7 @@ flowtable_set_hashkey(struct flentry *fl hashkey = ((struct flentry_v6 *)fle)->fl_flow.ipf_key; } - for (i = 0; i < nwords; i++) + for (i = 0; i < nwords; i++) hashkey[i] = key[i]; } @@ -991,7 +991,7 @@ flowtable_insert(struct flowtable *ft, u bit_set(mask, FL_ENTRY_INDEX(ft, hash)); *flep = fle = newfle; goto skip; - } + } depth = 0; fs->ft_collisions++; @@ -1008,7 +1008,7 @@ flowtable_insert(struct flowtable *ft, u FL_ENTRY_UNLOCK(ft, hash); flow_free(newfle, ft); - if (flags & FL_OVERWRITE) + if (flags & FL_OVERWRITE) goto skip; return (EEXIST); } @@ -1020,7 +1020,7 @@ flowtable_insert(struct flowtable *ft, u depth++; fle = fle->f_next; - } + } if (depth > fs->ft_max_depth) fs->ft_max_depth = depth; @@ -1050,12 +1050,12 @@ kern_flowtable_insert(struct flowtable * hash = 0; #ifdef INET - if (ssa->ss_family == AF_INET) + if (ssa->ss_family == AF_INET) hash = ipv4_flow_lookup_hash_internal((struct sockaddr_in *)ssa, (struct sockaddr_in *)dsa, key, flags); #endif #ifdef INET6 - if (ssa->ss_family == AF_INET6) + if (ssa->ss_family == AF_INET6) hash = ipv6_flow_lookup_hash_internal((struct sockaddr_in6 *)ssa, (struct sockaddr_in6 *)dsa, key, flags); #endif @@ -1082,7 +1082,7 @@ flowtable_key_equal(struct flentry *fle, hashkey = ((struct flentry_v6 *)fle)->fl_flow.ipf_key; } - for (i = 0; i < nwords; i++) + for (i = 0; i < nwords; i++) if (hashkey[i] != key[i]) return (0); @@ -1137,9 +1137,9 @@ flowtable_lookup(struct flowtable *ft, s memcpy(&ro->ro_dst, dsa, sizeof(struct sockaddr_in)); /* * The harvested source and destination addresses - * may contain port information if the packet is - * from a transport protocol (e.g. TCP/UDP). The - * port field must be cleared before performing + * may contain port information if the packet is + * from a transport protocol (e.g. TCP/UDP). The + * port field must be cleared before performing * a route lookup. */ ((struct sockaddr_in *)&ro->ro_dst)->sin_port = 0; @@ -1170,7 +1170,7 @@ flowtable_lookup(struct flowtable *ft, s #endif /* * Ports are zero and this isn't a transmit cache - * - thus not a protocol for which we need to keep + * - thus not a protocol for which we need to keep * state * FL_HASH_ALL => key[0] != 0 for TCP || UDP || SCTP */ @@ -1229,7 +1229,7 @@ uncached: #endif ft->ft_rtalloc(ro, hash, fibnum); - if (ro->ro_rt == NULL) + if (ro->ro_rt == NULL) error = ENETUNREACH; else { struct llentry *lle = NULL; @@ -1286,7 +1286,7 @@ uncached: ro->ro_rt = NULL; ro->ro_lle = NULL; } - } + } return ((error) ? NULL : fle); } @@ -1347,7 +1347,7 @@ flowtable_alloc(char *name, int nentry, ft->ft_tmpmask = bit_alloc(nentry); /* - * In the local transmit case the table truly is + * In the local transmit case the table truly is * just a cache - so everything is eligible for * replacement after 5s of non-use */ @@ -1381,7 +1381,7 @@ flowtable_alloc(char *name, int nentry, * The rest of the code is devoted to garbage collection of expired entries. * It is a new additon made necessary by the switch to dynamically allocating * flow tables. - * + * */ static void fle_free(struct flentry *fle, struct flowtable *ft) @@ -1707,7 +1707,7 @@ flow_show(struct flowtable *ft, struct f idle_time = (int)(time_uptime - fle->f_uptime); rt = fle->f_rt; rt_valid = rt != NULL; - if (rt_valid) + if (rt_valid) ifp = rt->rt_ifp; ifp_valid = ifp != NULL; hashkey = flowtable_get_hashkey(fle); @@ -1722,9 +1722,9 @@ flow_show(struct flowtable *ft, struct f db_printf("%s:%d->%s:%d", saddr, sport, daddr, dport); - } else + } else db_printf("%s ", daddr); - + skipaddr: if (fle->f_flags & FL_STALE) db_printf(" FL_STALE "); From owner-svn-src-head@FreeBSD.ORG Fri Feb 7 10:58:46 2014 Return-Path: Delivered-To: svn-src-head@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 CC306962; Fri, 7 Feb 2014 10:58:46 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B77841C9D; Fri, 7 Feb 2014 10:58:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s17Awk7e065334; Fri, 7 Feb 2014 10:58:46 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s17AwkLg065333; Fri, 7 Feb 2014 10:58:46 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201402071058.s17AwkLg065333@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Fri, 7 Feb 2014 10:58:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261583 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 10:58:46 -0000 Author: ae Date: Fri Feb 7 10:58:46 2014 New Revision: 261583 URL: http://svnweb.freebsd.org/changeset/base/261583 Log: Unlock entry before retry. Submitted by: melifaro MFC after: 1 week Modified: head/sys/netinet6/nd6.c Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Fri Feb 7 10:05:12 2014 (r261582) +++ head/sys/netinet6/nd6.c Fri Feb 7 10:58:46 2014 (r261583) @@ -1925,6 +1925,7 @@ nd6_output_lle(struct ifnet *ifp, struct ln->ln_state < ND6_LLINFO_REACHABLE) { if ((flags & LLE_EXCLUSIVE) == 0) { flags |= LLE_EXCLUSIVE; + LLE_RUNLOCK(ln); goto retry; } ln->ln_state = ND6_LLINFO_STALE; From owner-svn-src-head@FreeBSD.ORG Fri Feb 7 11:40:51 2014 Return-Path: Delivered-To: svn-src-head@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 3DE4A307; Fri, 7 Feb 2014 11:40:51 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2883810F0; Fri, 7 Feb 2014 11:40:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s17Bep71082885; Fri, 7 Feb 2014 11:40:51 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s17Bep6i082884; Fri, 7 Feb 2014 11:40:51 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402071140.s17Bep6i082884@svn.freebsd.org> From: Christian Brueffer Date: Fri, 7 Feb 2014 11:40:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261584 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 11:40:51 -0000 Author: brueffer Date: Fri Feb 7 11:40:50 2014 New Revision: 261584 URL: http://svnweb.freebsd.org/changeset/base/261584 Log: In IPv6 code examples, use the correct v6 socket. MFC after: 1 week Modified: head/share/man/man4/multicast.4 Modified: head/share/man/man4/multicast.4 ============================================================================== --- head/share/man/man4/multicast.4 Fri Feb 7 10:58:46 2014 (r261583) +++ head/share/man/man4/multicast.4 Fri Feb 7 11:40:50 2014 (r261584) @@ -326,7 +326,7 @@ mc.mf6cc_parent = iif_index; for (i = 0; i < maxvifs; i++) if (oifs_ttl[i] > 0) IF_SET(i, &mc.mf6cc_ifset); -setsockopt(mrouter_s4, IPPROTO_IPV6, MRT6_ADD_MFC, +setsockopt(mrouter_s6, IPPROTO_IPV6, MRT6_ADD_MFC, (void *)&mc, sizeof(mc)); .Ed .Pp @@ -365,7 +365,7 @@ struct mf6cctl mc; memset(&mc, 0, sizeof(mc)); memcpy(&mc.mf6cc_origin, &source_addr, sizeof(mc.mf6cc_origin)); memcpy(&mc.mf6cc_mcastgrp, &group_addr, sizeof(mf6cc_mcastgrp)); -setsockopt(mrouter_s4, IPPROTO_IPV6, MRT6_DEL_MFC, +setsockopt(mrouter_s6, IPPROTO_IPV6, MRT6_DEL_MFC, (void *)&mc, sizeof(mc)); .Ed .Pp From owner-svn-src-head@FreeBSD.ORG Fri Feb 7 12:39:58 2014 Return-Path: Delivered-To: svn-src-head@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 E49D637D; Fri, 7 Feb 2014 12:39:58 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CF78E16E4; Fri, 7 Feb 2014 12:39:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s17Cdw0F007684; Fri, 7 Feb 2014 12:39:58 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s17CdwIH007683; Fri, 7 Feb 2014 12:39:58 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201402071239.s17CdwIH007683@svn.freebsd.org> From: Aleksandr Rybalko Date: Fri, 7 Feb 2014 12:39:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261585 - head/sys/dev/vt/hw/vga X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 12:39:59 -0000 Author: ray Date: Fri Feb 7 12:39:58 2014 New Revision: 261585 URL: http://svnweb.freebsd.org/changeset/base/261585 Log: Implement vd_drawrect and vd_setpixel for vt(9)'s VGA driver. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/hw/vga/vga.c Modified: head/sys/dev/vt/hw/vga/vga.c ============================================================================== --- head/sys/dev/vt/hw/vga/vga.c Fri Feb 7 11:40:50 2014 (r261584) +++ head/sys/dev/vt/hw/vga/vga.c Fri Feb 7 12:39:58 2014 (r261585) @@ -74,6 +74,8 @@ struct vga_softc { static vd_init_t vga_init; static vd_blank_t vga_blank; static vd_bitbltchr_t vga_bitbltchr; +static vd_drawrect_t vga_drawrect; +static vd_setpixel_t vga_setpixel; static vd_putchar_t vga_putchar; static vd_postswitch_t vga_postswitch; @@ -81,6 +83,8 @@ static const struct vt_driver vt_vga_dri .vd_init = vga_init, .vd_blank = vga_blank, .vd_bitbltchr = vga_bitbltchr, + .vd_drawrect = vga_drawrect, + .vd_setpixel = vga_setpixel, .vd_putchar = vga_putchar, .vd_postswitch = vga_postswitch, .vd_priority = VD_PRIORITY_GENERIC, @@ -139,6 +143,31 @@ vga_bitblt_put(struct vt_device *vd, u_l } } +static void +vga_setpixel(struct vt_device *vd, int x, int y, term_color_t color) +{ + + vga_bitblt_put(vd, (y * VT_VGA_WIDTH / 8) + (x / 8), color, + 0x80 >> (x % 8)); +} + +static void +vga_drawrect(struct vt_device *vd, int x1, int y1, int x2, int y2, int fill, + term_color_t color) +{ + int x, y; + + for (y = y1; y <= y2; y++) { + if (fill || (y == y1) || (y == y2)) { + for (x = x1; x <= x2; x++) + vga_setpixel(vd, x, y, color); + } else { + vga_setpixel(vd, x1, y, color); + vga_setpixel(vd, x2, y, color); + } + } +} + static inline void vga_bitblt_draw(struct vt_device *vd, const uint8_t *src, u_long ldst, uint8_t shift, unsigned int width, unsigned int height, From owner-svn-src-head@FreeBSD.ORG Fri Feb 7 13:06:49 2014 Return-Path: Delivered-To: svn-src-head@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 669D186A; Fri, 7 Feb 2014 13:06:49 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4978219E4; Fri, 7 Feb 2014 13:06:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s17D6nFP020242; Fri, 7 Feb 2014 13:06:49 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s17D6mKU020240; Fri, 7 Feb 2014 13:06:48 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201402071306.s17D6mKU020240@svn.freebsd.org> From: Luiz Otavio O Souza Date: Fri, 7 Feb 2014 13:06:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261586 - in head/sys/geom: uncompress uzip X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 13:06:49 -0000 Author: loos Date: Fri Feb 7 13:06:48 2014 New Revision: 261586 URL: http://svnweb.freebsd.org/changeset/base/261586 Log: Fix the build with DEBUG enabled. Where possible, fix style(9) issues. Reviewed by: bde Approved by: adrian (mentor) Modified: head/sys/geom/uncompress/g_uncompress.c head/sys/geom/uzip/g_uzip.c Modified: head/sys/geom/uncompress/g_uncompress.c ============================================================================== --- head/sys/geom/uncompress/g_uncompress.c Fri Feb 7 12:39:58 2014 (r261585) +++ head/sys/geom/uncompress/g_uncompress.c Fri Feb 7 13:06:48 2014 (r261586) @@ -213,10 +213,11 @@ g_uncompress_done(struct bio *bp) pos = sc->offsets[start_blk] % bsize; upos = 0; - DPRINTF(("%s: done: bio_length %lld bio_completed %lld start_blk %d, " - "pos %lld, upos %lld (%lld, %d, %d)\n", - gp->name, bp->bio_length, bp->bio_completed, start_blk, pos, upos, - bp2->bio_offset, sc->blksz, bsize)); + DPRINTF(("%s: done: bio_length %jd bio_completed %jd start_blk %d, " + "pos %jd, upos %jd (%jd, %d, %zu)\n", + gp->name, (intmax_t)bp->bio_length, (intmax_t)bp->bio_completed, + start_blk, (intmax_t)pos, (intmax_t)upos, + (intmax_t)bp2->bio_offset, sc->blksz, bsize)); for (i = start_blk; upos < bp2->bio_length; i++) { off_t len, dlen, ulen, uoff; @@ -225,9 +226,10 @@ g_uncompress_done(struct bio *bp) ulen = MIN(sc->blksz - uoff, bp2->bio_length - upos); dlen = len = sc->offsets[i + 1] - sc->offsets[i]; - DPRINTF(("%s: done: inflate block %d, start %lld, end %lld " - "len %lld\n", - gp->name, i, sc->offsets[i], sc->offsets[i + 1], len)); + DPRINTF(( + "%s: done: inflate block %d, start %ju, end %ju len %jd\n", + gp->name, i, (uintmax_t)sc->offsets[i], + (uintmax_t)sc->offsets[i + 1], (intmax_t)len)); if (len == 0) { /* All zero block: no cache update */ @@ -298,8 +300,9 @@ done: /* * Finish processing the request. */ - DPRINTF(("%s: done: (%d, %lld, %ld)\n", - gp->name, bp2->bio_error, bp2->bio_completed, bp2->bio_resid)); + DPRINTF(("%s: done: (%d, %jd, %ld)\n", + gp->name, bp2->bio_error, (intmax_t)bp2->bio_completed, + bp2->bio_resid)); free(bp->bio_data, M_GEOM_UNCOMPRESS); g_destroy_bio(bp); g_io_deliver(bp2, bp2->bio_error); @@ -319,9 +322,10 @@ g_uncompress_start(struct bio *bp) pp = bp->bio_to; gp = pp->geom; - DPRINTF(("%s: start (%s) to %s off=%lld len=%lld\n", gp->name, - (bp->bio_cmd==BIO_READ) ? "BIO_READ" : "BIO_WRITE*", - pp->name, bp->bio_offset, bp->bio_length)); + DPRINTF(("%s: start (%d:%s) to %s off=%jd len=%jd\n", + gp->name, bp->bio_cmd, + (bp->bio_cmd == BIO_READ) ? "BIO_READ" : "NOTSUPPORTED", + pp->name, (intmax_t)bp->bio_offset, (intmax_t)bp->bio_length)); if (bp->bio_cmd != BIO_READ) { g_io_deliver(bp, EOPNOTSUPP); @@ -353,9 +357,9 @@ g_uncompress_start(struct bio *bp) sc->req_cached++; mtx_unlock(&sc->last_mtx); - DPRINTF(("%s: start: cached 0 + %lld, " - "%lld + 0 + %lld\n", - gp->name, bp->bio_length, uoff, bp->bio_length)); + DPRINTF(("%s: start: cached 0 + %jd, %jd + 0 + %jd\n", + gp->name, (intmax_t)bp->bio_length, (intmax_t)uoff, + (intmax_t)bp->bio_length)); bp->bio_completed = bp->bio_length; g_io_deliver(bp, 0); return; @@ -368,10 +372,10 @@ g_uncompress_start(struct bio *bp) g_io_deliver(bp, ENOMEM); return; } - DPRINTF(("%s: start (%d..%d), %s: %d + %llu, %s: %d + %llu\n", + DPRINTF(("%s: start (%d..%d), %s: %d + %jd, %s: %d + %jd\n", gp->name, start_blk, end_blk, - pp->name, pp->sectorsize, pp->mediasize, - pp2->name, pp2->sectorsize, pp2->mediasize)); + pp->name, pp->sectorsize, (intmax_t)pp->mediasize, + pp2->name, pp2->sectorsize, (intmax_t)pp2->mediasize)); bsize = pp2->sectorsize; @@ -381,12 +385,12 @@ g_uncompress_start(struct bio *bp) bp2->bio_offset; bp2->bio_data = malloc(bp2->bio_length, M_GEOM_UNCOMPRESS, M_NOWAIT); - DPRINTF(("%s: start %lld + %lld -> %lld + %lld -> %lld + %lld\n", + DPRINTF(("%s: start %jd + %jd -> %ju + %ju -> %jd + %jd\n", gp->name, - bp->bio_offset, bp->bio_length, - sc->offsets[start_blk], - sc->offsets[end_blk] - sc->offsets[start_blk], - bp2->bio_offset, bp2->bio_length)); + (intmax_t)bp->bio_offset, (intmax_t)bp->bio_length, + (uintmax_t)sc->offsets[start_blk], + (uintmax_t)sc->offsets[end_blk] - sc->offsets[start_blk], + (intmax_t)bp2->bio_offset, (intmax_t)bp2->bio_length)); if (bp2->bio_data == NULL) { g_destroy_bio(bp2); @@ -484,8 +488,8 @@ g_uncompress_taste(struct g_class *mp, s * Read cloop header, look for CLOOP magic, perform * other validity checks. */ - DPRINTF(("%s: media sectorsize %u, mediasize %lld\n", - gp->name, pp->sectorsize, pp->mediasize)); + DPRINTF(("%s: media sectorsize %u, mediasize %jd\n", + gp->name, pp->sectorsize, (intmax_t)pp->mediasize)); i = roundup(sizeof(struct cloop_header), pp->sectorsize); buf = g_read_data(cp, 0, i, NULL); @@ -596,9 +600,9 @@ g_uncompress_taste(struct g_class *mp, s free(buf, M_GEOM); g_access(cp, -1, 0, 0); - DPRINTF(("%s: taste ok (%d, %lld), (%d, %d), %x\n", + DPRINTF(("%s: taste ok (%d, %jd), (%d, %d), %x\n", gp->name, - pp2->sectorsize, pp2->mediasize, + pp2->sectorsize, (intmax_t)pp2->mediasize, pp2->stripeoffset, pp2->stripesize, pp2->flags)); printf("%s: %u x %u blocks\n", gp->name, sc->nblocks, sc->blksz); Modified: head/sys/geom/uzip/g_uzip.c ============================================================================== --- head/sys/geom/uzip/g_uzip.c Fri Feb 7 12:39:58 2014 (r261585) +++ head/sys/geom/uzip/g_uzip.c Fri Feb 7 13:06:48 2014 (r261586) @@ -155,9 +155,9 @@ g_uzip_done(struct bio *bp) bsize = pp2->sectorsize; pos = sc->offsets[start_blk] % bsize; upos = 0; - DPRINTF(("%s: done: start_blk %d, pos %lld, upos %lld (%lld, %d, %d)\n", - gp->name, start_blk, pos, upos, - bp2->bio_offset, sc->blksz, bsize)); + DPRINTF(("%s: done: start_blk %d, pos %jd, upos %jd (%jd, %d, %zd)\n", + gp->name, start_blk, (intmax_t)pos, (intmax_t)upos, + (intmax_t)bp2->bio_offset, sc->blksz, bsize)); for (i = start_blk; upos < bp2->bio_length; i++) { off_t len, ulen, uoff; @@ -181,17 +181,17 @@ g_uzip_done(struct bio *bp) if (err != Z_STREAM_END) { sc->last_blk = -1; mtx_unlock(&sc->last_mtx); - DPRINTF(("%s: done: inflate failed (%lld + %lld -> %lld + %lld + %lld)\n", - gp->name, pos, len, uoff, upos, ulen)); + DPRINTF(("%s: done: inflate failed (%jd + %jd -> %jd + %jd + %jd)\n", + gp->name, (intmax_t)pos, (intmax_t)len, + (intmax_t)uoff, (intmax_t)upos, (intmax_t)ulen)); inflateEnd(&zs); bp2->bio_error = EIO; goto done; } sc->last_blk = i; - DPRINTF(("%s: done: inflated %lld + %lld -> %lld + %lld + %lld\n", - gp->name, - pos, len, - uoff, upos, ulen)); + DPRINTF(("%s: done: inflated %jd + %jd -> %jd + %jd + %jd\n", + gp->name, (intmax_t)pos, (intmax_t)len, (intmax_t)uoff, + (intmax_t)upos, (intmax_t)ulen)); memcpy(bp2->bio_data + upos, sc->last_buf + uoff, ulen); mtx_unlock(&sc->last_mtx); @@ -215,8 +215,9 @@ done: /* * Finish processing the request. */ - DPRINTF(("%s: done: (%d, %lld, %ld)\n", - gp->name, bp2->bio_error, bp2->bio_completed, bp2->bio_resid)); + DPRINTF(("%s: done: (%d, %jd, %ld)\n", + gp->name, bp2->bio_error, (intmax_t)bp2->bio_completed, + bp2->bio_resid)); free(bp->bio_data, M_GEOM_UZIP); g_destroy_bio(bp); g_io_deliver(bp2, bp2->bio_error); @@ -267,8 +268,9 @@ g_uzip_start(struct bio *bp) sc->req_cached++; mtx_unlock(&sc->last_mtx); - DPRINTF(("%s: start: cached 0 + %lld, %lld + 0 + %lld\n", - gp->name, bp->bio_length, uoff, bp->bio_length)); + DPRINTF(("%s: start: cached 0 + %jd, %jd + 0 + %jd\n", + gp->name, (intmax_t)bp->bio_length, (intmax_t)uoff, + (intmax_t)bp->bio_length)); bp->bio_completed = bp->bio_length; g_io_deliver(bp, 0); return; @@ -282,19 +284,20 @@ g_uzip_start(struct bio *bp) return; } bp2->bio_done = g_uzip_done; - DPRINTF(("%s: start (%d..%d), %s: %d + %lld, %s: %d + %lld\n", + DPRINTF(("%s: start (%d..%d), %s: %d + %jd, %s: %d + %jd\n", gp->name, start_blk, end_blk, - pp->name, pp->sectorsize, pp->mediasize, - pp2->name, pp2->sectorsize, pp2->mediasize)); + pp->name, pp->sectorsize, (intmax_t)pp->mediasize, + pp2->name, pp2->sectorsize, (intmax_t)pp2->mediasize)); bsize = pp2->sectorsize; bp2->bio_offset = sc->offsets[start_blk] - sc->offsets[start_blk] % bsize; bp2->bio_length = sc->offsets[end_blk] - bp2->bio_offset; bp2->bio_length = (bp2->bio_length + bsize - 1) / bsize * bsize; - DPRINTF(("%s: start %lld + %lld -> %lld + %lld -> %lld + %lld\n", + DPRINTF(("%s: start %jd + %jd -> %ju + %ju -> %jd + %jd\n", gp->name, - bp->bio_offset, bp->bio_length, - sc->offsets[start_blk], sc->offsets[end_blk] - sc->offsets[start_blk], - bp2->bio_offset, bp2->bio_length)); + (intmax_t)bp->bio_offset, (intmax_t)bp->bio_length, + (uintmax_t)sc->offsets[start_blk], + (uintmax_t)sc->offsets[end_blk] - sc->offsets[start_blk], + (intmax_t)bp2->bio_offset, (intmax_t)bp2->bio_length)); bp2->bio_data = malloc(bp2->bio_length, M_GEOM_UZIP, M_NOWAIT); if (bp2->bio_data == NULL) { g_destroy_bio(bp2); @@ -391,8 +394,8 @@ g_uzip_taste(struct g_class *mp, struct * Read cloop header, look for CLOOP magic, perform * other validity checks. */ - DPRINTF(("%s: media sectorsize %u, mediasize %lld\n", - gp->name, pp->sectorsize, pp->mediasize)); + DPRINTF(("%s: media sectorsize %u, mediasize %jd\n", + gp->name, pp->sectorsize, (intmax_t)pp->mediasize)); buf = g_read_data(cp, 0, pp->sectorsize, NULL); if (buf == NULL) goto err; @@ -472,9 +475,9 @@ g_uzip_taste(struct g_class *mp, struct g_error_provider(pp2, 0); g_access(cp, -1, 0, 0); - DPRINTF(("%s: taste ok (%d, %lld), (%d, %d), %x\n", + DPRINTF(("%s: taste ok (%d, %jd), (%d, %d), %x\n", gp->name, - pp2->sectorsize, pp2->mediasize, + pp2->sectorsize, (intmax_t)pp2->mediasize, pp2->stripeoffset, pp2->stripesize, pp2->flags)); printf("%s: %u x %u blocks\n", gp->name, sc->nblocks, sc->blksz); From owner-svn-src-head@FreeBSD.ORG Fri Feb 7 13:40:22 2014 Return-Path: Delivered-To: svn-src-head@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 B8810348; Fri, 7 Feb 2014 13:40: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 853261D40; Fri, 7 Feb 2014 13:40:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s17DeMqT033663; Fri, 7 Feb 2014 13:40:22 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s17DeMos033662; Fri, 7 Feb 2014 13:40:22 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201402071340.s17DeMos033662@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 7 Feb 2014 13:40:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261589 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 13:40:22 -0000 Author: jilles Date: Fri Feb 7 13:40:22 2014 New Revision: 261589 URL: http://svnweb.freebsd.org/changeset/base/261589 Log: fts: Fix double-free with conflicting concurrent modifications. If rare conditions such as concurrent conflicting manipulation of the filesystem occur, fts_read() frees the current FTSENT without adjusting the pointers in the FTS accordingly. A later fts_close() then frees the same FTSENT again. Reported by: pho Tested by: pho MFC after: 1 week Modified: head/lib/libc/gen/fts.c Modified: head/lib/libc/gen/fts.c ============================================================================== --- head/lib/libc/gen/fts.c Fri Feb 7 13:17:27 2014 (r261588) +++ head/lib/libc/gen/fts.c Fri Feb 7 13:40:22 2014 (r261589) @@ -406,8 +406,6 @@ fts_read(FTS *sp) /* Move to the next node on this level. */ next: tmp = p; if ((p = p->fts_link) != NULL) { - free(tmp); - /* * If reached the top, return to the original directory (or * the root of the tree), and load the paths for the next root. @@ -417,6 +415,7 @@ next: tmp = p; SET(FTS_STOP); return (NULL); } + free(tmp); fts_load(sp, p); return (sp->fts_cur = p); } @@ -426,8 +425,10 @@ next: tmp = p; * ignore. If followed, get a file descriptor so we can * get back if necessary. */ - if (p->fts_instr == FTS_SKIP) + if (p->fts_instr == FTS_SKIP) { + free(tmp); goto next; + } if (p->fts_instr == FTS_FOLLOW) { p->fts_info = fts_stat(sp, p, 1, -1); if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR)) { @@ -441,6 +442,8 @@ next: tmp = p; p->fts_instr = FTS_NOINSTR; } + free(tmp); + name: t = sp->fts_path + NAPPEND(p->fts_parent); *t++ = '/'; memmove(t, p->fts_name, p->fts_namelen + 1); @@ -449,13 +452,13 @@ name: t = sp->fts_path + NAPPEND(p->fts /* Move up to the parent node. */ p = tmp->fts_parent; - free(tmp); if (p->fts_level == FTS_ROOTPARENTLEVEL) { /* * Done; free everything up and set errno to 0 so the user * can distinguish between error and EOF. */ + free(tmp); free(p); errno = 0; return (sp->fts_cur = NULL); @@ -488,6 +491,7 @@ name: t = sp->fts_path + NAPPEND(p->fts SET(FTS_STOP); return (NULL); } + free(tmp); p->fts_info = p->fts_errno ? FTS_ERR : FTS_DP; return (sp->fts_cur = p); } From owner-svn-src-head@FreeBSD.ORG Fri Feb 7 13:47:34 2014 Return-Path: Delivered-To: svn-src-head@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 71115A5E; Fri, 7 Feb 2014 13:47:34 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5A9C81E06; Fri, 7 Feb 2014 13:47:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s17DlYmn037189; Fri, 7 Feb 2014 13:47:34 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s17DlXut037186; Fri, 7 Feb 2014 13:47:33 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201402071347.s17DlXut037186@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 7 Feb 2014 13:47:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261590 - in head/sys: kern net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 13:47:34 -0000 Author: glebius Date: Fri Feb 7 13:47:33 2014 New Revision: 261590 URL: http://svnweb.freebsd.org/changeset/base/261590 Log: Remove identical vnet sysctl handlers, and handle CTLFLAG_VNET in the sysctl_root(). Note: SYSCTL_VNET_* macros can be removed as well. All is needed to virtualize a sysctl oid is set CTLFLAG_VNET on it. But for now keep macros in place to avoid large code churn. Sponsored by: Nginx, Inc. Modified: head/sys/kern/kern_sysctl.c head/sys/net/vnet.c head/sys/net/vnet.h Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Fri Feb 7 13:40:22 2014 (r261589) +++ head/sys/kern/kern_sysctl.c Fri Feb 7 13:47:33 2014 (r261590) @@ -1491,7 +1491,10 @@ sysctl_root(SYSCTL_HANDLER_ARGS) #endif oid->oid_running++; SYSCTL_XUNLOCK(); - +#ifdef VIMAGE + if ((oid->oid_kind & CTLFLAG_VNET) && arg1 != NULL) + arg1 = (void *)(curvnet->vnet_data_base + (uintptr_t)arg1); +#endif if (!(oid->oid_kind & CTLFLAG_MPSAFE)) mtx_lock(&Giant); error = oid->oid_handler(oid, arg1, arg2, req); Modified: head/sys/net/vnet.c ============================================================================== --- head/sys/net/vnet.c Fri Feb 7 13:40:22 2014 (r261589) +++ head/sys/net/vnet.c Fri Feb 7 13:47:33 2014 (r261590) @@ -464,47 +464,6 @@ vnet_data_copy(void *start, int size) } /* - * Variants on sysctl_handle_foo that know how to handle virtualized global - * variables: if 'arg1' is a pointer, then we transform it to the local vnet - * offset. - */ -int -vnet_sysctl_handle_int(SYSCTL_HANDLER_ARGS) -{ - - if (arg1 != NULL) - arg1 = (void *)(curvnet->vnet_data_base + (uintptr_t)arg1); - return (sysctl_handle_int(oidp, arg1, arg2, req)); -} - -int -vnet_sysctl_handle_opaque(SYSCTL_HANDLER_ARGS) -{ - - if (arg1 != NULL) - arg1 = (void *)(curvnet->vnet_data_base + (uintptr_t)arg1); - return (sysctl_handle_opaque(oidp, arg1, arg2, req)); -} - -int -vnet_sysctl_handle_string(SYSCTL_HANDLER_ARGS) -{ - - if (arg1 != NULL) - arg1 = (void *)(curvnet->vnet_data_base + (uintptr_t)arg1); - return (sysctl_handle_string(oidp, arg1, arg2, req)); -} - -int -vnet_sysctl_handle_uint(SYSCTL_HANDLER_ARGS) -{ - - if (arg1 != NULL) - arg1 = (void *)(curvnet->vnet_data_base + (uintptr_t)arg1); - return (sysctl_handle_int(oidp, arg1, arg2, req)); -} - -/* * Support for special SYSINIT handlers registered via VNET_SYSINIT() * and VNET_SYSUNINIT(). */ Modified: head/sys/net/vnet.h ============================================================================== --- head/sys/net/vnet.h Fri Feb 7 13:40:22 2014 (r261589) +++ head/sys/net/vnet.h Fri Feb 7 13:47:33 2014 (r261590) @@ -290,15 +290,10 @@ void vnet_data_free(void *start_arg, in * arguments themselves, if required. */ #ifdef SYSCTL_OID -int vnet_sysctl_handle_int(SYSCTL_HANDLER_ARGS); -int vnet_sysctl_handle_opaque(SYSCTL_HANDLER_ARGS); -int vnet_sysctl_handle_string(SYSCTL_HANDLER_ARGS); -int vnet_sysctl_handle_uint(SYSCTL_HANDLER_ARGS); - #define SYSCTL_VNET_INT(parent, nbr, name, access, ptr, val, descr) \ SYSCTL_OID(parent, nbr, name, \ CTLTYPE_INT|CTLFLAG_MPSAFE|CTLFLAG_VNET|(access), \ - ptr, val, vnet_sysctl_handle_int, "I", descr) + ptr, val, sysctl_handle_int, "I", descr) #define SYSCTL_VNET_PROC(parent, nbr, name, access, ptr, arg, handler, \ fmt, descr) \ CTASSERT(((access) & CTLTYPE) != 0); \ @@ -312,16 +307,16 @@ int vnet_sysctl_handle_uint(SYSCTL_HANDL #define SYSCTL_VNET_STRING(parent, nbr, name, access, arg, len, descr) \ SYSCTL_OID(parent, nbr, name, \ CTLTYPE_STRING|CTLFLAG_VNET|(access), \ - arg, len, vnet_sysctl_handle_string, "A", descr) + arg, len, sysctl_handle_string, "A", descr) #define SYSCTL_VNET_STRUCT(parent, nbr, name, access, ptr, type, descr) \ SYSCTL_OID(parent, nbr, name, \ CTLTYPE_OPAQUE|CTLFLAG_VNET|(access), ptr, \ - sizeof(struct type), vnet_sysctl_handle_opaque, "S," #type, \ + sizeof(struct type), sysctl_handle_opaque, "S," #type, \ descr) #define SYSCTL_VNET_UINT(parent, nbr, name, access, ptr, val, descr) \ SYSCTL_OID(parent, nbr, name, \ CTLTYPE_UINT|CTLFLAG_MPSAFE|CTLFLAG_VNET|(access), \ - ptr, val, vnet_sysctl_handle_uint, "IU", descr) + ptr, val, sysctl_handle_int, "IU", descr) #define VNET_SYSCTL_ARG(req, arg1) do { \ if (arg1 != NULL) \ arg1 = (void *)(TD_TO_VNET((req)->td)->vnet_data_base + \ From owner-svn-src-head@FreeBSD.ORG Fri Feb 7 14:04:48 2014 Return-Path: Delivered-To: svn-src-head@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 E40353AF; Fri, 7 Feb 2014 14:04:48 +0000 (UTC) Received: from mail-vb0-x235.google.com (mail-vb0-x235.google.com [IPv6:2607:f8b0:400c:c02::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 66F0910DD; Fri, 7 Feb 2014 14:04:48 +0000 (UTC) Received: by mail-vb0-f53.google.com with SMTP id p17so2664104vbe.12 for ; Fri, 07 Feb 2014 06:04:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=QUDbpJKr7+F4098pzC+afqjG2+iDExr1HZLAiTmddQI=; b=s2PF30WfN23pAwQuowGyicwX1llhTEQ2Uqzsq821iYW7qnbavFE1WlWkcyhu99PLk4 6WbhE6Z/IJIm8RY+GMUX2ws4XKpoIDf+1xPE3/8B9SBKkIwpDImvmQqjjiAjUeoFA8QE PoDUF4ZQ2mXRE/+jLv0SClor6M/yGTnbVQEZ9MV16h1vbf8kO8FZ7Bmyz0zY6YETCYT7 IYEXPj6y2huhxSXp3Vnk3xyIhpxmTByawdozbI7HyLepeJR2G5U7hrO8olkkSMlQnPcf E7g6wW/nmnepDOkpB4O+FhEDvQ2/W0TaGuzAtGjZ+Kq/4biKkgTkb0e8zCHrlHRb33dt pm8g== MIME-Version: 1.0 X-Received: by 10.52.89.230 with SMTP id br6mr8979939vdb.20.1391781887581; Fri, 07 Feb 2014 06:04:47 -0800 (PST) Sender: edschouten@gmail.com Received: by 10.220.105.140 with HTTP; Fri, 7 Feb 2014 06:04:47 -0800 (PST) In-Reply-To: <201402071239.s17CdwIH007683@svn.freebsd.org> References: <201402071239.s17CdwIH007683@svn.freebsd.org> Date: Fri, 7 Feb 2014 15:04:47 +0100 X-Google-Sender-Auth: aBDZdHQTTLTB3Rqknc-j3WvhB-c Message-ID: Subject: Re: svn commit: r261585 - head/sys/dev/vt/hw/vga From: Ed Schouten To: Aleksandr Rybalko Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 14:04:49 -0000 Hi Aleksandr, On 7 February 2014 13:39, Aleksandr Rybalko wrote: > +static void > +vga_setpixel(struct vt_device *vd, int x, int y, term_color_t color) > +{ > +} > + > +static void > +vga_drawrect(struct vt_device *vd, int x1, int y1, int x2, int y2, int fill, > + term_color_t color) > +{ > +} > + > static inline void > vga_bitblt_draw(struct vt_device *vd, const uint8_t *src, > u_long ldst, uint8_t shift, unsigned int width, unsigned int height, My question is, why do the setpixel and drawrect functions take signed coordinates, whereas bitblt does not? Wouldn' it be better to use unsigned coordinates all over the place? Furthermore, I think it's a bit weird that vga_bitbltchr() contains explicit bounds checking. What happened there? I remember at one point in time, we had the nice invariant that vt(9) never attempted to draw outside of the display resolution. What caused us to give up on that? -- Ed Schouten From owner-svn-src-head@FreeBSD.ORG Fri Feb 7 14:24:36 2014 Return-Path: Delivered-To: svn-src-head@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 9B5BC971; Fri, 7 Feb 2014 14:24:36 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 85D5B125A; Fri, 7 Feb 2014 14:24:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s17EOaaO052700; Fri, 7 Feb 2014 14:24:36 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s17EOa4i052699; Fri, 7 Feb 2014 14:24:36 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201402071424.s17EOa4i052699@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 7 Feb 2014 14:24:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261591 - head/lib/libstand/powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 14:24:36 -0000 Author: nwhitehorn Date: Fri Feb 7 14:24:36 2014 New Revision: 261591 URL: http://svnweb.freebsd.org/changeset/base/261591 Log: Make libstand setjmp work for both 64- and 32-bit ABIs. Modified: head/lib/libstand/powerpc/_setjmp.S Modified: head/lib/libstand/powerpc/_setjmp.S ============================================================================== --- head/lib/libstand/powerpc/_setjmp.S Fri Feb 7 13:47:33 2014 (r261590) +++ head/lib/libstand/powerpc/_setjmp.S Fri Feb 7 14:24:36 2014 (r261591) @@ -1,36 +1,115 @@ -/* $NetBSD: _setjmp.S,v 1.1 1997/03/29 20:55:53 thorpej Exp $ */ +/* $FreeBSD$ */ +/* from: NetBSD: setjmp.S,v 1.1 1998/01/27 15:13:12 sakamoto Exp $ */ +/* from: OpenBSD: setjmp.S,v 1.2 1996/12/28 06:22:18 rahnds Exp */ +/* kernel version of this file, does not have signal goop */ +/* int setjmp(jmp_buf env) */ #include -#if (defined(LIBC_SCCS) || defined(LIBC_RCS)) && !defined(lint) - .text - .asciz "$FreeBSD$" +#ifdef __powerpc64__ +#define LD_REG ld +#define ST_REG std +#define REGWIDTH 8 +#else +#define LD_REG lwz +#define ST_REG stw +#define REGWIDTH 4 #endif -/* - * C library -- _setjmp, _longjmp - * - * _longjmp(a,v) - * will generate a "return(v?v:1)" from the last call to - * _setjmp(a) - * by restoring registers from the stack. - * The previous signal state is NOT restored. - */ - -ENTRY(_setjmp) - mflr 11 - mfcr 12 - mr 10,1 - mr 9,2 - stmw 9,8(3) - li 3,0 +#define JMP_r1 1*REGWIDTH +#define JMP_r2 2*REGWIDTH +#define JMP_r14 3*REGWIDTH +#define JMP_r15 4*REGWIDTH +#define JMP_r16 5*REGWIDTH +#define JMP_r17 6*REGWIDTH +#define JMP_r18 7*REGWIDTH +#define JMP_r19 8*REGWIDTH +#define JMP_r20 9*REGWIDTH +#define JMP_r21 10*REGWIDTH +#define JMP_r22 11*REGWIDTH +#define JMP_r23 12*REGWIDTH +#define JMP_r24 13*REGWIDTH +#define JMP_r25 14*REGWIDTH +#define JMP_r26 15*REGWIDTH +#define JMP_r27 16*REGWIDTH +#define JMP_r28 17*REGWIDTH +#define JMP_r29 18*REGWIDTH +#define JMP_r30 19*REGWIDTH +#define JMP_r31 20*REGWIDTH +#define JMP_lr 21*REGWIDTH +#define JMP_cr 22*REGWIDTH +#define JMP_ctr 23*REGWIDTH +#define JMP_xer 24*REGWIDTH +#define JMP_sig 25*REGWIDTH + +ASENTRY_NOPROF(setjmp) + ST_REG 31, JMP_r31(3) + /* r1, r2, r14-r30 */ + ST_REG 1, JMP_r1 (3) + ST_REG 2, JMP_r2 (3) + ST_REG 14, JMP_r14(3) + ST_REG 15, JMP_r15(3) + ST_REG 16, JMP_r16(3) + ST_REG 17, JMP_r17(3) + ST_REG 18, JMP_r18(3) + ST_REG 19, JMP_r19(3) + ST_REG 20, JMP_r20(3) + ST_REG 21, JMP_r21(3) + ST_REG 22, JMP_r22(3) + ST_REG 23, JMP_r23(3) + ST_REG 24, JMP_r24(3) + ST_REG 25, JMP_r25(3) + ST_REG 26, JMP_r26(3) + ST_REG 27, JMP_r27(3) + ST_REG 28, JMP_r28(3) + ST_REG 29, JMP_r29(3) + ST_REG 30, JMP_r30(3) + /* cr, lr, ctr, xer */ + mfcr 0 + ST_REG 0, JMP_cr(3) + mflr 0 + ST_REG 0, JMP_lr(3) + mfctr 0 + ST_REG 0, JMP_ctr(3) + mfxer 0 + ST_REG 0, JMP_xer(3) + /* f14-f31, fpscr */ + li 3, 0 blr -ENTRY(_longjmp) - lmw 9,8(3) - mtlr 11 - mtcr 12 - mr 2,9 - mr 1,10 - mr 3,4 + +.extern sigsetmask +ASENTRY_NOPROF(longjmp) + LD_REG 31, JMP_r31(3) + /* r1, r2, r14-r30 */ + LD_REG 1, JMP_r1 (3) + LD_REG 2, JMP_r2 (3) + LD_REG 14, JMP_r14(3) + LD_REG 15, JMP_r15(3) + LD_REG 16, JMP_r16(3) + LD_REG 17, JMP_r17(3) + LD_REG 18, JMP_r18(3) + LD_REG 19, JMP_r19(3) + LD_REG 20, JMP_r20(3) + LD_REG 21, JMP_r21(3) + LD_REG 22, JMP_r22(3) + LD_REG 23, JMP_r23(3) + LD_REG 24, JMP_r24(3) + LD_REG 25, JMP_r25(3) + LD_REG 26, JMP_r26(3) + LD_REG 27, JMP_r27(3) + LD_REG 28, JMP_r28(3) + LD_REG 29, JMP_r29(3) + LD_REG 30, JMP_r30(3) + /* cr, lr, ctr, xer */ + LD_REG 0, JMP_cr(3) + mtcr 0 + LD_REG 0, JMP_lr(3) + mtlr 0 + LD_REG 0, JMP_ctr(3) + mtctr 0 + LD_REG 0, JMP_xer(3) + mtxer 0 + /* f14-f31, fpscr */ + mr 3, 4 blr From owner-svn-src-head@FreeBSD.ORG Fri Feb 7 14:26:34 2014 Return-Path: Delivered-To: svn-src-head@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 26373ACB; Fri, 7 Feb 2014 14:26:34 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0F7CD126D; Fri, 7 Feb 2014 14:26:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s17EQXBp052974; Fri, 7 Feb 2014 14:26:33 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s17EQX69052973; Fri, 7 Feb 2014 14:26:33 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201402071426.s17EQX69052973@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 7 Feb 2014 14:26:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261592 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 14:26:34 -0000 Author: glebius Date: Fri Feb 7 14:26:33 2014 New Revision: 261592 URL: http://svnweb.freebsd.org/changeset/base/261592 Log: Catch up on r261590. Modified: head/sys/netinet/in_pcb.c Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Fri Feb 7 14:24:36 2014 (r261591) +++ head/sys/netinet/in_pcb.c Fri Feb 7 14:26:33 2014 (r261592) @@ -145,11 +145,7 @@ sysctl_net_ipport_check(SYSCTL_HANDLER_A { int error; -#ifdef VIMAGE - error = vnet_sysctl_handle_int(oidp, arg1, arg2, req); -#else error = sysctl_handle_int(oidp, arg1, arg2, req); -#endif if (error == 0) { RANGECHK(V_ipport_lowfirstauto, 1, IPPORT_RESERVED - 1); RANGECHK(V_ipport_lowlastauto, 1, IPPORT_RESERVED - 1); From owner-svn-src-head@FreeBSD.ORG Fri Feb 7 14:29:04 2014 Return-Path: Delivered-To: svn-src-head@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 99B82E32; Fri, 7 Feb 2014 14:29:04 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 76C1C129A; Fri, 7 Feb 2014 14:29:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s17ET4Ot053268; Fri, 7 Feb 2014 14:29:04 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s17ET3Rw053264; Fri, 7 Feb 2014 14:29:03 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201402071429.s17ET3Rw053264@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 7 Feb 2014 14:29:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261593 - in head: share/man/man9 sys/sys sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 14:29:04 -0000 Author: glebius Date: Fri Feb 7 14:29:03 2014 New Revision: 261593 URL: http://svnweb.freebsd.org/changeset/base/261593 Log: Provide macros that allow easily export uma(9) zone limits and current usage via sysctl(9): SYSCTL_UMA_MAX() SYSCTL_ADD_UMA_MAX() SYSCTL_UMA_CUR() SYSCTL_ADD_UMA_CUR() Sponsored by: Nginx, Inc. Modified: head/share/man/man9/zone.9 head/sys/sys/sysctl.h head/sys/vm/uma_core.c Modified: head/share/man/man9/zone.9 ============================================================================== --- head/share/man/man9/zone.9 Fri Feb 7 14:26:33 2014 (r261592) +++ head/share/man/man9/zone.9 Fri Feb 7 14:29:03 2014 (r261593) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 21, 2013 +.Dd February 7, 2014 .Dt ZONE 9 .Os .Sh NAME @@ -71,6 +71,11 @@ .Fn uma_zone_get_cur "uma_zone_t zone" .Ft void .Fn uma_zone_set_warning "uma_zone_t zone" "const char *warning" +.In sys/sysctl.h +.Fn SYSCTL_UMA_MAX parent nbr name access zone descr +.Fn SYSCTL_ADD_UMA_MAX ctx parent nbr name access zone descr +.Fn SYSCTL_UMA_CUR parent nbr name access zone descr +.Fn SYSCTL_ADD_UMA_CUR ctx parent nbr name access zone descr .Sh DESCRIPTION The zone allocator provides an efficient interface for managing dynamically-sized collections of items of similar size. @@ -307,6 +312,38 @@ Warnings can be turned off globally by s .Va vm.zone_warnings sysctl tunable to .Va 0 . +.Pp +The +.Fn SYSCTL_UMA_MAX parent nbr name access zone descr +macro declares a static +.Xr sysctl +oid that exports the effective upper limit number of items for a zone. +The +.Fa zone +argument should be a pointer to +.Vt uma_zone_t . +A read of the oid returns value obtained through +.Fn uma_zone_get_max . +A write to the oid sets new value via +.Fn uma_zone_set_max . +The +.Fn SYSCTL_ADD_UMA_MAX ctx parent nbr name access zone descr +macro is provided to create this type of oid dynamically. +.Pp +The +.Fn SYSCTL_UMA_CUR parent nbr name access zone descr +macro declares a static read only +.Xr sysctl +oid that exports the approximate current occupancy of the zone. +The +.Fa zone +argument should be a pointer to +.Vt uma_zone_t . +A read of the oid returns value obtained through +.Fn uma_zone_get_cur . +The +.Fn SYSCTL_ADD_UMA_CUR ctx parent nbr name zone descr +macro is provided to create this type of oid dynamically. .Sh RETURN VALUES The .Fn uma_zalloc Modified: head/sys/sys/sysctl.h ============================================================================== --- head/sys/sys/sysctl.h Fri Feb 7 14:26:33 2014 (r261592) +++ head/sys/sys/sysctl.h Fri Feb 7 14:29:03 2014 (r261593) @@ -186,6 +186,9 @@ int sysctl_handle_string(SYSCTL_HANDLER_ int sysctl_handle_opaque(SYSCTL_HANDLER_ARGS); int sysctl_handle_counter_u64(SYSCTL_HANDLER_ARGS); +int sysctl_handle_uma_zone_max(SYSCTL_HANDLER_ARGS); +int sysctl_handle_uma_zone_cur(SYSCTL_HANDLER_ARGS); + int sysctl_dpcpu_int(SYSCTL_HANDLER_ARGS); int sysctl_dpcpu_long(SYSCTL_HANDLER_ARGS); int sysctl_dpcpu_quad(SYSCTL_HANDLER_ARGS); @@ -431,6 +434,30 @@ SYSCTL_ALLOWED_TYPES(UINT64, uint64_t *a sysctl_add_oid(ctx, parent, nbr, name, (access), \ ptr, arg, handler, fmt, __DESCR(descr)) +/* Oid to handle limits on uma(9) zone specified by pointer. */ +#define SYSCTL_UMA_MAX(parent, nbr, name, access, ptr, descr) \ + SYSCTL_ASSERT_TYPE(INT, ptr, parent, name); \ + SYSCTL_OID(parent, nbr, name, \ + CTLTYPE_INT | CTLFLAG_MPSAFE | (access), \ + ptr, 0, sysctl_handle_uma_zone_max, "I", descr) +#define SYSCTL_ADD_UMA_MAX(ctx, parent, nbr, name, access, ptr, descr)\ + sysctl_add_oid(ctx, parent, nbr, name, \ + CTLTYPE_INT | CTLFLAG_MPSAFE | (access), \ + SYSCTL_ADD_ASSERT_TYPE(INT, ptr), 0, \ + sysctl_handle_uma_zone_max, "I", __DESCR(descr)) + +/* Oid to obtain current use of uma(9) zone specified by pointer. */ +#define SYSCTL_UMA_CUR(parent, nbr, name, access, ptr, descr) \ + SYSCTL_ASSERT_TYPE(INT, ptr, parent, name); \ + SYSCTL_OID(parent, nbr, name, \ + CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RD | (access), \ + ptr, 0, sysctl_handle_uma_zone_cur, "I", descr) +#define SYSCTL_ADD_UMA_CUR(ctx, parent, nbr, name, access, ptr, descr) \ + sysctl_add_oid(ctx, parent, nbr, name, \ + CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RD | (access), \ + SYSCTL_ADD_ASSERT_TYPE(INT, ptr), 0, \ + sysctl_handle_uma_zone_cur, "I", __DESCR(descr)) + /* * A macro to generate a read-only sysctl to indicate the presense of optional * kernel features. Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Fri Feb 7 14:26:33 2014 (r261592) +++ head/sys/vm/uma_core.c Fri Feb 7 14:29:03 2014 (r261593) @@ -3465,6 +3465,35 @@ skip: return (error); } +int +sysctl_handle_uma_zone_max(SYSCTL_HANDLER_ARGS) +{ + uma_zone_t zone = *(uma_zone_t *)arg1; + int error, max, old; + + old = max = uma_zone_get_max(zone); + error = sysctl_handle_int(oidp, &max, 0, req); + if (error || !req->newptr) + return (error); + + if (max < old) + return (EINVAL); + + uma_zone_set_max(zone, max); + + return (0); +} + +int +sysctl_handle_uma_zone_cur(SYSCTL_HANDLER_ARGS) +{ + uma_zone_t zone = *(uma_zone_t *)arg1; + int cur; + + cur = uma_zone_get_cur(zone); + return (sysctl_handle_int(oidp, &cur, 0, req)); +} + #ifdef DDB DB_SHOW_COMMAND(uma, db_show_uma) { From owner-svn-src-head@FreeBSD.ORG Fri Feb 7 14:31:52 2014 Return-Path: Delivered-To: svn-src-head@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 997A410A; Fri, 7 Feb 2014 14:31:52 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 82AE21319; Fri, 7 Feb 2014 14:31:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s17EVqqw056377; Fri, 7 Feb 2014 14:31:52 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s17EVqBv056375; Fri, 7 Feb 2014 14:31:52 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201402071431.s17EVqBv056375@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 7 Feb 2014 14:31:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261594 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 14:31:52 -0000 Author: glebius Date: Fri Feb 7 14:31:51 2014 New Revision: 261594 URL: http://svnweb.freebsd.org/changeset/base/261594 Log: Utilize SYSCTL_UMA_CUR() to export usage of syncache and tcp reassembly zones. Sponsored by: Nginx, Inc. Modified: head/sys/netinet/tcp_reass.c head/sys/netinet/tcp_syncache.c Modified: head/sys/netinet/tcp_reass.c ============================================================================== --- head/sys/netinet/tcp_reass.c Fri Feb 7 14:29:03 2014 (r261593) +++ head/sys/netinet/tcp_reass.c Fri Feb 7 14:31:51 2014 (r261594) @@ -75,8 +75,6 @@ __FBSDID("$FreeBSD$"); #include #endif /* TCPDEBUG */ -static int tcp_reass_sysctl_qsize(SYSCTL_HANDLER_ARGS); - static SYSCTL_NODE(_net_inet_tcp, OID_AUTO, reass, CTLFLAG_RW, 0, "TCP Segment Reassembly Queue"); @@ -86,10 +84,6 @@ SYSCTL_VNET_INT(_net_inet_tcp_reass, OID &VNET_NAME(tcp_reass_maxseg), 0, "Global maximum number of TCP Segments in Reassembly Queue"); -SYSCTL_VNET_PROC(_net_inet_tcp_reass, OID_AUTO, cursegments, - (CTLTYPE_INT | CTLFLAG_RD), NULL, 0, &tcp_reass_sysctl_qsize, "I", - "Global number of TCP Segments currently in Reassembly Queue"); - static VNET_DEFINE(int, tcp_reass_overflows) = 0; #define V_tcp_reass_overflows VNET(tcp_reass_overflows) SYSCTL_VNET_INT(_net_inet_tcp_reass, OID_AUTO, overflows, @@ -99,6 +93,9 @@ SYSCTL_VNET_INT(_net_inet_tcp_reass, OID static VNET_DEFINE(uma_zone_t, tcp_reass_zone); #define V_tcp_reass_zone VNET(tcp_reass_zone) +SYSCTL_UMA_CUR(_net_inet_tcp_reass, OID_AUTO, cursegments, CTLFLAG_VNET, + &VNET_NAME(tcp_reass_zone), + "Global number of TCP Segments currently in Reassembly Queue"); /* Initialize TCP reassembly queue */ static void @@ -155,15 +152,6 @@ tcp_reass_flush(struct tcpcb *tp) tp, tp->t_segqlen)); } -static int -tcp_reass_sysctl_qsize(SYSCTL_HANDLER_ARGS) -{ - int qsize; - - qsize = uma_zone_get_cur(V_tcp_reass_zone); - return (sysctl_handle_int(oidp, &qsize, 0, req)); -} - int tcp_reass(struct tcpcb *tp, struct tcphdr *th, int *tlenp, struct mbuf *m) { Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Fri Feb 7 14:29:03 2014 (r261593) +++ head/sys/netinet/tcp_syncache.c Fri Feb 7 14:31:51 2014 (r261594) @@ -126,7 +126,6 @@ struct syncache *syncache_lookup(struct static int syncache_respond(struct syncache *); static struct socket *syncache_socket(struct syncache *, struct socket *, struct mbuf *m); -static int syncache_sysctl_count(SYSCTL_HANDLER_ARGS); static void syncache_timeout(struct syncache *sc, struct syncache_head *sch, int docallout); static void syncache_timer(void *); @@ -170,9 +169,8 @@ SYSCTL_VNET_UINT(_net_inet_tcp_syncache, &VNET_NAME(tcp_syncache.cache_limit), 0, "Overall entry limit for syncache"); -SYSCTL_VNET_PROC(_net_inet_tcp_syncache, OID_AUTO, count, (CTLTYPE_UINT|CTLFLAG_RD), - NULL, 0, &syncache_sysctl_count, "IU", - "Current number of entries in syncache"); +SYSCTL_UMA_CUR(_net_inet_tcp_syncache, OID_AUTO, count, CTLFLAG_VNET, + &VNET_NAME(tcp_syncache.zone), "Current number of entries in syncache"); SYSCTL_VNET_UINT(_net_inet_tcp_syncache, OID_AUTO, hashsize, CTLFLAG_RDTUN, &VNET_NAME(tcp_syncache.hashsize), 0, @@ -328,15 +326,6 @@ syncache_destroy(void) } #endif -static int -syncache_sysctl_count(SYSCTL_HANDLER_ARGS) -{ - int count; - - count = uma_zone_get_cur(V_tcp_syncache.zone); - return (sysctl_handle_int(oidp, &count, 0, req)); -} - /* * Inserts a syncache entry into the specified bucket row. * Locks and unlocks the syncache_head autonomously. From owner-svn-src-head@FreeBSD.ORG Fri Feb 7 14:34:32 2014 Return-Path: Delivered-To: svn-src-head@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 14C94280; Fri, 7 Feb 2014 14:34:32 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DA13D132D; Fri, 7 Feb 2014 14:34:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s17EYVex056749; Fri, 7 Feb 2014 14:34:31 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s17EYVYb056747; Fri, 7 Feb 2014 14:34:31 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201402071434.s17EYVYb056747@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 7 Feb 2014 14:34:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261595 - in head: share/man/man9 sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 14:34:32 -0000 Author: glebius Date: Fri Feb 7 14:34:31 2014 New Revision: 261595 URL: http://svnweb.freebsd.org/changeset/base/261595 Log: sysctl_handle_counter_u64() doesn't use arg2 argument, thus simplify the SYSCTL_COUNTER_U64() macro. Sponsored by: Nginx, Inc. Modified: head/share/man/man9/counter.9 head/sys/sys/sysctl.h Modified: head/share/man/man9/counter.9 ============================================================================== --- head/share/man/man9/counter.9 Fri Feb 7 14:31:51 2014 (r261594) +++ head/share/man/man9/counter.9 Fri Feb 7 14:34:31 2014 (r261595) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 3, 2013 +.Dd February 7, 2014 .Dt COUNTER 9 .Os .Sh NAME @@ -52,7 +52,7 @@ .Ft void .Fn counter_u64_zero "counter_u64_t c" .In sys/sysctl.h -.Fn SYSCTL_COUNTER_U64 parent nbr name access ptr val descr +.Fn SYSCTL_COUNTER_U64 parent nbr name access ptr descr .Fn SYSCTL_ADD_COUNTER_U64 ctx parent nbr name access ptr descr .Sh DESCRIPTION .Nm @@ -126,7 +126,7 @@ value for any moment. Clear the counter .Fa c and set it to zero. -.It Fn SYSCTL_COUNTER_U64 parent nbr name access ptr val descr +.It Fn SYSCTL_COUNTER_U64 parent nbr name access ptr descr Declare a static .Xr sysctl oid that would represent a Modified: head/sys/sys/sysctl.h ============================================================================== --- head/sys/sys/sysctl.h Fri Feb 7 14:31:51 2014 (r261594) +++ head/sys/sys/sysctl.h Fri Feb 7 14:34:31 2014 (r261595) @@ -393,11 +393,11 @@ SYSCTL_ALLOWED_TYPES(UINT64, uint64_t *a sysctl_handle_64, "QU", __DESCR(descr)) /* Oid for a 64-bit unsigned counter(9). The pointer must be non NULL. */ -#define SYSCTL_COUNTER_U64(parent, nbr, name, access, ptr, val, descr) \ +#define SYSCTL_COUNTER_U64(parent, nbr, name, access, ptr, descr) \ SYSCTL_ASSERT_TYPE(UINT64, ptr, parent, name); \ SYSCTL_OID(parent, nbr, name, \ CTLTYPE_U64 | CTLFLAG_MPSAFE | (access), \ - ptr, val, sysctl_handle_counter_u64, "QU", descr) + ptr, 0, sysctl_handle_counter_u64, "QU", descr) #define SYSCTL_ADD_COUNTER_U64(ctx, parent, nbr, name, access, ptr, descr)\ sysctl_add_oid(ctx, parent, nbr, name, \ From owner-svn-src-head@FreeBSD.ORG Fri Feb 7 14:38:53 2014 Return-Path: Delivered-To: svn-src-head@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 6CD3768A; Fri, 7 Feb 2014 14:38:53 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0692E136D; Fri, 7 Feb 2014 14:38:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s17EcqHF057318; Fri, 7 Feb 2014 14:38:52 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s17EcqnD057313; Fri, 7 Feb 2014 14:38:52 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201402071438.s17EcqnD057313@svn.freebsd.org> From: Ian Lepore Date: Fri, 7 Feb 2014 14:38:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261596 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 14:38:53 -0000 Author: ian Date: Fri Feb 7 14:38:51 2014 New Revision: 261596 URL: http://svnweb.freebsd.org/changeset/base/261596 Log: Remove references to PHYSADDR where it's used only in debugging output, and where the code that references it can safely be elided if it's not defined (meaning the code is used for legacy arm platforms that still define the compile-time PHYSADDR but not on newer systems that calculate the value at runtime). Modified: head/sys/arm/arm/elf_trampoline.c head/sys/arm/arm/pmap-v6.c head/sys/arm/arm/pmap.c head/sys/arm/arm/support.S Modified: head/sys/arm/arm/elf_trampoline.c ============================================================================== --- head/sys/arm/arm/elf_trampoline.c Fri Feb 7 14:34:31 2014 (r261595) +++ head/sys/arm/arm/elf_trampoline.c Fri Feb 7 14:38:51 2014 (r261596) @@ -189,7 +189,7 @@ _startC(void) int physaddr = KERNPHYSADDR; int tmp1; unsigned int sp = ((unsigned int)&_end & ~3) + 4; -#if defined(FLASHADDR) && defined(LOADERRAMADDR) +#if defined(FLASHADDR) && defined(PHYSADDR) && defined(LOADERRAMADDR) unsigned int pc; __asm __volatile("mov %0, pc\n" Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Fri Feb 7 14:34:31 2014 (r261595) +++ head/sys/arm/arm/pmap-v6.c Fri Feb 7 14:38:51 2014 (r261596) @@ -1312,8 +1312,6 @@ pmap_init(void) vm_size_t s; int i, pv_npg; - PDEBUG(1, printf("pmap_init: phys_start = %08x\n", PHYSADDR)); - l2zone = uma_zcreate("L2 Table", L2_TABLE_SIZE_REAL, pmap_l2ptp_ctor, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE); l2table_zone = uma_zcreate("L2 Table", sizeof(struct l2_dtable), NULL, Modified: head/sys/arm/arm/pmap.c ============================================================================== --- head/sys/arm/arm/pmap.c Fri Feb 7 14:34:31 2014 (r261595) +++ head/sys/arm/arm/pmap.c Fri Feb 7 14:38:51 2014 (r261596) @@ -1826,8 +1826,6 @@ pmap_init(void) { int shpgperproc = PMAP_SHPGPERPROC; - PDEBUG(1, printf("pmap_init: phys_start = %08x\n", PHYSADDR)); - l2zone = uma_zcreate("L2 Table", L2_TABLE_SIZE_REAL, pmap_l2ptp_ctor, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE); l2table_zone = uma_zcreate("L2 Table", sizeof(struct l2_dtable), NULL, Modified: head/sys/arm/arm/support.S ============================================================================== --- head/sys/arm/arm/support.S Fri Feb 7 14:34:31 2014 (r261595) +++ head/sys/arm/arm/support.S Fri Feb 7 14:38:51 2014 (r261596) @@ -939,7 +939,7 @@ END(memmove) ENTRY(memcpy) /* save leaf functions having to store this away */ /* Do not check arm_memcpy if we're running from flash */ -#ifdef FLASHADDR +#if defined(FLASHADDR) && defined(PHYSADDR) #if FLASHADDR > PHYSADDR ldr r3, =FLASHADDR cmp r3, pc From owner-svn-src-head@FreeBSD.ORG Fri Feb 7 14:56:35 2014 Return-Path: Delivered-To: svn-src-head@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 08176221; Fri, 7 Feb 2014 14:56:35 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E67441621; Fri, 7 Feb 2014 14:56:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s17EuYI7065220; Fri, 7 Feb 2014 14:56:34 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s17EuYEv065219; Fri, 7 Feb 2014 14:56:34 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201402071456.s17EuYEv065219@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 7 Feb 2014 14:56:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261597 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 14:56:35 -0000 Author: hselasky Date: Fri Feb 7 14:56:34 2014 New Revision: 261597 URL: http://svnweb.freebsd.org/changeset/base/261597 Log: Add manual page for wsp driver. MFC after: 1 week Added: head/share/man/man4/wsp.4 (contents, props changed) Added: head/share/man/man4/wsp.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/wsp.4 Fri Feb 7 14:56:34 2014 (r261597) @@ -0,0 +1,96 @@ +.\" Copyright (c) 2014 Hans Petter Selasky . +.\" 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. +.\" 3. Neither the name of the author nor the names of any co-contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd February 7, 2014 +.Dt WSP 4 +.Os +.Sh NAME +.Nm wsp +.Nd Wellspring touchpad driver +.Sh SYNOPSIS +To compile this driver into the kernel, place the following lines into +your kernel configuration file: +.Bd -ragged -offset indent +.Cd "device wsp" +.Cd "device usb" +.Ed +.Pp +Alternativly, to load the driver as a module at boot time, +place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +wsp_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for the Apple Internal Trackpad +device found in many Apple laptops. +.Pp +The driver simulates a three\-button mouse using multi\-finger tap +detection. +. +A single\-finger press generates a left button click. +A two\-finger tap maps to the right button; whereas a three\-finger tap +gets treated as a middle button click. +. +.Pp +.Nm +supports dynamic reconfiguration using +.Xr sysctl 8 ; +through nodes under +.Nm hw.usb.wsp . +Pointer sensitivity can be controlled using the sysctl tunable +.Nm hw.usb.wsp.scale_factor . +. +.Sh FILES +.Nm +creates a blocking pseudo\-device file, +.Pa /dev/wsp0 , +which presents the mouse as a +.Ar sysmouse +or +.Ar mousesystems +type device\-\-see +.Xr moused 8 +for an explanation of these mouse +types. +.Sh SEE ALSO +.Xr sysmouse 4 , +.Xr usb 4 , +.Xr loader.conf 5 , +.Xr xorg.conf 5 Pq Pa ports/x11/xorg , +.Xr moused 8 , +.Xr sysctl 8 +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An Huang Wen Hui Aq huanghwh@gmail.com From owner-svn-src-head@FreeBSD.ORG Fri Feb 7 14:58:41 2014 Return-Path: Delivered-To: svn-src-head@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 5A36F564; Fri, 7 Feb 2014 14:58:41 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2BB44163A; Fri, 7 Feb 2014 14:58:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s17EwfvH065614; Fri, 7 Feb 2014 14:58:41 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s17EwfC2065613; Fri, 7 Feb 2014 14:58:41 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201402071458.s17EwfC2065613@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 7 Feb 2014 14:58:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261598 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 14:58:41 -0000 Author: hselasky Date: Fri Feb 7 14:58:40 2014 New Revision: 261598 URL: http://svnweb.freebsd.org/changeset/base/261598 Log: Update atp driver manual page. Moused is now started automatically by devd. MFC after: 1 week Modified: head/share/man/man4/atp.4 Modified: head/share/man/man4/atp.4 ============================================================================== --- head/share/man/man4/atp.4 Fri Feb 7 14:56:34 2014 (r261597) +++ head/share/man/man4/atp.4 Fri Feb 7 14:58:40 2014 (r261598) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 12, 2009 +.Dd February 7, 2014 .Dt ATP 4 .Os .Sh NAME @@ -114,57 +114,6 @@ type device\-\-see .Xr moused 8 for an explanation of these mouse types. -.Xr moused 8 -can be configured to read touchpad data from -.Pa /dev/atp0 -and pass it along to the -.Xr sysmouse 4 -driver so that any process wanting to utilize mouse operation (such as -an X server) may fetch it from -.Pa /dev/sysmouse ; -alternatively, -.Pa /dev/atp0 -may be manipulated via -.Xr read 2 -and -.Xr ioctl 2 -calls to get mouse data directly. -.Sh EXAMPLES -To use a compatible Apple Trackpad as your console mouse: -.Pp -.Dl moused -p /dev/atp0 -t auto -.Pp -To launch -.Xr moused 8 -automatically upon boot, add the following to -.Pa /etc/rc.conf : -.Pp -.Dl moused_enable="YES" -.Dl moused_type="auto" -.Dl moused_port="/dev/atp0" -.Pp -If you want -.Xr moused 8 -to also probe for external USB mice or other devices, then add the -following to -.Pa /etc/rc.conf : -.Pp -.Dl moused_nondefault_enable="YES" -.Dl moused_ums0_enable="YES" -.Dl moused_ums1_enable="YES" -.Pp -To be able to use the trackpad under X, change the "Pointer" section in -.Nm xorg.conf -to the following: -.Pp -.Dl Device "/dev/atp0" -.Dl Protocol "Auto" -.Pp -Better still, if you want to be able to use the mouse in both virtual -consoles as well as in X change it to: -.Pp -.Dl Device "/dev/sysmouse" -.Dl Protocol "Auto" .Sh SEE ALSO .Xr sysmouse 4 , .Xr usb 4 , From owner-svn-src-head@FreeBSD.ORG Fri Feb 7 15:00:09 2014 Return-Path: Delivered-To: svn-src-head@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 935C66C5; Fri, 7 Feb 2014 15:00:09 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7A2CF164C; Fri, 7 Feb 2014 15:00:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s17F09QB066008; Fri, 7 Feb 2014 15:00:09 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s17F09Me066007; Fri, 7 Feb 2014 15:00:09 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201402071500.s17F09Me066007@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 7 Feb 2014 15:00:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261599 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 15:00:09 -0000 Author: hselasky Date: Fri Feb 7 15:00:08 2014 New Revision: 261599 URL: http://svnweb.freebsd.org/changeset/base/261599 Log: The atp USB driver is generic and its manual page should be available for all platforms. Add wsp manual page to build. MFC after: 1 week Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Fri Feb 7 14:58:40 2014 (r261598) +++ head/share/man/man4/Makefile Fri Feb 7 15:00:08 2014 (r261599) @@ -60,7 +60,7 @@ MAN= aac.4 \ ath_pci.4 \ atkbd.4 \ atkbdc.4 \ - ${_atp.4} \ + atp.4 \ ${_atf_test_case.4} \ ${_atrtc.4} \ ${_attimer.4} \ @@ -568,6 +568,7 @@ MAN= aac.4 \ wlan_wep.4 \ wlan_xauth.4 \ ${_wpi.4} \ + wsp.4 \ xe.4 \ ${_xen.4} \ xhci.4 \ @@ -757,7 +758,6 @@ _amdsbwd.4= amdsbwd.4 _amdsmb.4= amdsmb.4 _amdtemp.4= amdtemp.4 _asmc.4= asmc.4 -_atp.4= atp.4 _bxe.4= bxe.4 _coretemp.4= coretemp.4 _cpuctl.4= cpuctl.4 @@ -830,9 +830,6 @@ MLINKS+=qlxgbe.4 if_qlxgbe.4 MLINKS+=sfxge.4 if_sfxge.4 .endif -.if ${MACHINE_CPUARCH} == "powerpc" -_atp.4= atp.4 -.endif .if ${MACHINE_CPUARCH} == "mips" _nvram2env.4= nvram2env.4 .endif From owner-svn-src-head@FreeBSD.ORG Fri Feb 7 15:07:10 2014 Return-Path: Delivered-To: svn-src-head@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 5F8B8A7D; Fri, 7 Feb 2014 15:07:10 +0000 (UTC) Received: from smtp.dlink.ua (smtp.dlink.ua [193.138.187.146]) by mx1.freebsd.org (Postfix) with ESMTP id 17FF716F6; Fri, 7 Feb 2014 15:07:09 +0000 (UTC) Received: from terran (unknown [192.168.99.1]) (Authenticated sender: ray) by smtp.dlink.ua (Postfix) with ESMTPA id 6ABBBC492D; Fri, 7 Feb 2014 17:07:02 +0200 (EET) Date: Fri, 7 Feb 2014 17:10:25 +0200 From: Aleksandr Rybalko To: Ed Schouten Subject: Re: svn commit: r261585 - head/sys/dev/vt/hw/vga Message-Id: <20140207171025.d33b95770f6b0d7d00b4aab3@freebsd.org> In-Reply-To: References: <201402071239.s17CdwIH007683@svn.freebsd.org> X-Mailer: Sylpheed 3.2.0 (GTK+ 2.24.6; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 15:07:10 -0000 On Fri, 7 Feb 2014 15:04:47 +0100 Ed Schouten wrote: > Hi Aleksandr, > > On 7 February 2014 13:39, Aleksandr Rybalko wrote: > > +static void > > +vga_setpixel(struct vt_device *vd, int x, int y, term_color_t color) > > +{ > > +} > > + > > +static void > > +vga_drawrect(struct vt_device *vd, int x1, int y1, int x2, int y2, int fill, > > + term_color_t color) > > +{ > > +} > > + > > static inline void > > vga_bitblt_draw(struct vt_device *vd, const uint8_t *src, > > u_long ldst, uint8_t shift, unsigned int width, unsigned int height, > > My question is, why do the setpixel and drawrect functions take signed > coordinates, whereas bitblt does not? Wouldn' it be better to use > unsigned coordinates all over the place? Theoretically unsigned a bit better, practically does not matter (+/-2G or 4G). Using signed int we also can ask to draw object which is partially out of screen. (and strlen("int") < strlen("unsigned int") :)) If you have objections, let discuss it. Also people asking me about advanced features of vt(9), like use multiple displays. I'm not sure, but signed coordinates may help with some things on that way (or makes more problems :) ). > > Furthermore, I think it's a bit weird that vga_bitbltchr() contains > explicit bounds checking. What happened there? I remember at one point > in time, we had the nice invariant that vt(9) never attempted to draw > outside of the display resolution. What caused us to give up on that? Mouse cursor allowed to partially go out of screen, so we have to check (or use special function for mouse cursor). > > -- > Ed Schouten -- Aleksandr Rybalko From owner-svn-src-head@FreeBSD.ORG Fri Feb 7 15:10:25 2014 Return-Path: Delivered-To: svn-src-head@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 73DD8CC3; Fri, 7 Feb 2014 15:10:25 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 456EA170F; Fri, 7 Feb 2014 15:10:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s17FAPSD070328; Fri, 7 Feb 2014 15:10:25 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s17FAPD5070327; Fri, 7 Feb 2014 15:10:25 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402071510.s17FAPD5070327@svn.freebsd.org> From: John Baldwin Date: Fri, 7 Feb 2014 15:10:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261600 - head/sys/dev/bvm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 15:10:25 -0000 Author: jhb Date: Fri Feb 7 15:10:24 2014 New Revision: 261600 URL: http://svnweb.freebsd.org/changeset/base/261600 Log: - Use a callout instead of the deprecated timeout_handle. - Set the console name always so that the bvm console device can be used via conscontrol even if it isn't chosen as the default console. Modified: head/sys/dev/bvm/bvm_console.c Modified: head/sys/dev/bvm/bvm_console.c ============================================================================== --- head/sys/dev/bvm/bvm_console.c Fri Feb 7 15:00:08 2014 (r261599) +++ head/sys/dev/bvm/bvm_console.c Fri Feb 7 15:10:24 2014 (r261600) @@ -58,8 +58,7 @@ static struct ttydevsw bvm_ttydevsw = { }; static int polltime; -static struct callout_handle bvm_timeouthandle - = CALLOUT_HANDLE_INITIALIZER(&bvm_timeouthandle); +static struct callout bvm_timer; #if defined(KDB) static int alt_break_state; @@ -107,9 +106,9 @@ cn_drvinit(void *unused) { struct tty *tp; - if (bvm_consdev.cn_pri != CN_DEAD && - bvm_consdev.cn_name[0] != '\0') { + if (bvm_consdev.cn_pri != CN_DEAD) { tp = tty_alloc(&bvm_ttydevsw, NULL); + callout_init_mtx(&bvm_timer, tty_getlock(tp), 0); tty_makedev(tp, NULL, "bvmcons"); } } @@ -120,7 +119,7 @@ bvm_tty_open(struct tty *tp) polltime = hz / BVMCONS_POLL_HZ; if (polltime < 1) polltime = 1; - bvm_timeouthandle = timeout(bvm_timeout, tp, polltime); + callout_reset(&bvm_timer, polltime, bvm_timeout, tp); return (0); } @@ -129,8 +128,9 @@ static void bvm_tty_close(struct tty *tp) { - /* XXX Should be replaced with callout_stop(9) */ - untimeout(bvm_timeout, tp, bvm_timeouthandle); + tty_lock(tp); + callout_stop(&bvm_timer); + tty_unlock(tp); } static void @@ -158,13 +158,12 @@ bvm_timeout(void *v) tp = (struct tty *)v; - tty_lock(tp); + tty_lock_assert(tp, MA_OWNED); while ((c = bvm_cngetc(NULL)) != -1) ttydisc_rint(tp, c, 0); ttydisc_rint_done(tp); - tty_unlock(tp); - bvm_timeouthandle = timeout(bvm_timeout, tp, polltime); + callout_reset(&bvm_timer, polltime, bvm_timeout, tp); } static void @@ -174,6 +173,7 @@ bvm_cnprobe(struct consdev *cp) disabled = 0; cp->cn_pri = CN_DEAD; + strcpy(cp->cn_name, "bvmcons"); resource_int_value("bvmconsole", 0, "disabled", &disabled); if (!disabled) { @@ -195,8 +195,6 @@ bvm_cninit(struct consdev *cp) for (i = 0; i < strlen(bootmsg); i++) bvm_cnputc(cp, bootmsg[i]); } - - strcpy(cp->cn_name, "bvmcons"); } static void From owner-svn-src-head@FreeBSD.ORG Fri Feb 7 15:18:23 2014 Return-Path: Delivered-To: svn-src-head@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 C8C4C173; Fri, 7 Feb 2014 15:18:23 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B028C17B4; Fri, 7 Feb 2014 15:18:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s17FINaT074188; Fri, 7 Feb 2014 15:18:23 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s17FINtP074186; Fri, 7 Feb 2014 15:18:23 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201402071518.s17FINtP074186@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 7 Feb 2014 15:18:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261601 - in head: sys/net sys/netinet sys/netinet6 usr.bin/netstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 15:18:23 -0000 Author: glebius Date: Fri Feb 7 15:18:23 2014 New Revision: 261601 URL: http://svnweb.freebsd.org/changeset/base/261601 Log: o Revamp API between flowtable and netinet, netinet6. - ip_output() and ip_output6() simply call flowtable_lookup(), passing mbuf and address family. That's the only code under #ifdef FLOWTABLE in the protocols code now. o Revamp statistics gathering and export. - Remove hand made pcpu stats, and utilize counter(9). - Snapshot of statistics is available via 'netstat -rs'. - All sysctls are moved into net.flowtable namespace, since spreading them over net.inet isn't correct. o Properly separate at compile time INET and INET6 parts. o General cleanup. - Remove chain of multiple flowtables. We simply have one for IPv4 and one for IPv6. - Flowtables are allocated in flowtable.c, symbols are static. - With proper argument to SYSINIT() we no longer need flowtable_ready. - Hash salt doesn't need to be per-VNET. - Removed rudimentary debugging, which use quite useless in dtrace era. The runtime behavior of flowtable shouldn't be changed by this commit. Sponsored by: Netflix Sponsored by: Nginx, Inc. Added: head/usr.bin/netstat/flowtable.c (contents, props changed) Modified: head/sys/net/flowtable.c head/sys/net/flowtable.h head/sys/net/route.c head/sys/netinet/ip_input.c head/sys/netinet/ip_output.c head/sys/netinet6/in6_proto.c head/sys/netinet6/ip6_input.c head/sys/netinet6/ip6_output.c head/usr.bin/netstat/Makefile head/usr.bin/netstat/main.c head/usr.bin/netstat/netstat.h Modified: head/sys/net/flowtable.c ============================================================================== --- head/sys/net/flowtable.c Fri Feb 7 15:10:24 2014 (r261600) +++ head/sys/net/flowtable.c Fri Feb 7 15:18:23 2014 (r261601) @@ -146,23 +146,13 @@ union flentryp { struct flentry **pcpu[MAXCPU]; }; -struct flowtable_stats { - uint64_t ft_collisions; - uint64_t ft_allocated; - uint64_t ft_misses; - uint64_t ft_max_depth; - uint64_t ft_free_checks; - uint64_t ft_frees; - uint64_t ft_hits; - uint64_t ft_lookups; -} __aligned(CACHE_LINE_SIZE); - struct flowtable { - struct flowtable_stats ft_stats[MAXCPU]; + counter_u64_t *ft_stat; + uma_zone_t ft_zone; int ft_size; int ft_lock_count; uint32_t ft_flags; - char *ft_name; + uint32_t ft_max_depth; fl_lock_t *ft_lock; fl_lock_t *ft_unlock; fl_rtalloc_t *ft_rtalloc; @@ -173,9 +163,7 @@ struct flowtable { union flentryp ft_table; bitstr_t *ft_masks[MAXCPU]; bitstr_t *ft_tmpmask; - struct flowtable *ft_next; - uint32_t ft_count __aligned(CACHE_LINE_SIZE); uint32_t ft_udp_idle __aligned(CACHE_LINE_SIZE); uint32_t ft_fin_wait_idle; uint32_t ft_syn_idle; @@ -183,17 +171,12 @@ struct flowtable { boolean_t ft_full; } __aligned(CACHE_LINE_SIZE); -static struct proc *flowcleanerproc; -static VNET_DEFINE(struct flowtable *, flow_list_head); -static VNET_DEFINE(uint32_t, flow_hashjitter); -static VNET_DEFINE(uma_zone_t, flow_ipv4_zone); -static VNET_DEFINE(uma_zone_t, flow_ipv6_zone); - -#define V_flow_list_head VNET(flow_list_head) -#define V_flow_hashjitter VNET(flow_hashjitter) -#define V_flow_ipv4_zone VNET(flow_ipv4_zone) -#define V_flow_ipv6_zone VNET(flow_ipv6_zone) +#define FLOWSTAT_ADD(ft, name, v) \ + counter_u64_add((ft)->ft_stat[offsetof(struct flowtable_stat, name) / sizeof(uint64_t)], (v)) +#define FLOWSTAT_INC(ft, name) FLOWSTAT_ADD(ft, name, 1) +static struct proc *flowcleanerproc; +static uint32_t flow_hashjitter; static struct cv flowclean_f_cv; static struct cv flowclean_c_cv; @@ -201,24 +184,8 @@ static struct mtx flowclean_lock; static uint32_t flowclean_cycles; static uint32_t flowclean_freq; -#ifdef FLOWTABLE_DEBUG -#define FLDPRINTF(ft, flags, fmt, ...) \ -do { \ - if ((ft)->ft_flags & (flags)) \ - printf((fmt), __VA_ARGS__); \ -} while (0); \ - -#else -#define FLDPRINTF(ft, flags, fmt, ...) - -#endif - - /* * TODO: - * - Make flowtable stats per-cpu, aggregated at sysctl call time, - * to avoid extra cache evictions caused by incrementing a shared - * counter * - add sysctls to resize && flush flow tables * - Add per flowtable sysctls for statistics and configuring timeouts * - add saturation counter to rtentry to support per-packet load-balancing @@ -230,148 +197,51 @@ do { \ * - support explicit connection state (currently only ad-hoc for DSR) * - idetach() cleanup for options VIMAGE builds. */ -VNET_DEFINE(int, flowtable_enable) = 1; -static VNET_DEFINE(int, flowtable_debug); +#ifdef INET +static VNET_DEFINE(struct flowtable, ip4_ft); +#define V_ip4_ft VNET(ip4_ft) +static uma_zone_t flow_ipv4_zone; +#endif +#ifdef INET6 +static VNET_DEFINE(struct flowtable, ip6_ft); +#define V_ip6_ft VNET(ip6_ft) +static uma_zone_t flow_ipv6_zone; +#endif + +static VNET_DEFINE(int, flowtable_enable) = 1; static VNET_DEFINE(int, flowtable_syn_expire) = SYN_IDLE; static VNET_DEFINE(int, flowtable_udp_expire) = UDP_IDLE; static VNET_DEFINE(int, flowtable_fin_wait_expire) = FIN_WAIT_IDLE; static VNET_DEFINE(int, flowtable_tcp_expire) = TCP_IDLE; -static VNET_DEFINE(int, flowtable_nmbflows); -static VNET_DEFINE(int, flowtable_ready) = 0; #define V_flowtable_enable VNET(flowtable_enable) -#define V_flowtable_debug VNET(flowtable_debug) #define V_flowtable_syn_expire VNET(flowtable_syn_expire) #define V_flowtable_udp_expire VNET(flowtable_udp_expire) #define V_flowtable_fin_wait_expire VNET(flowtable_fin_wait_expire) #define V_flowtable_tcp_expire VNET(flowtable_tcp_expire) -#define V_flowtable_nmbflows VNET(flowtable_nmbflows) -#define V_flowtable_ready VNET(flowtable_ready) -static SYSCTL_NODE(_net_inet, OID_AUTO, flowtable, CTLFLAG_RD, NULL, +static SYSCTL_NODE(_net, OID_AUTO, flowtable, CTLFLAG_RD, NULL, "flowtable"); -SYSCTL_VNET_INT(_net_inet_flowtable, OID_AUTO, debug, CTLFLAG_RW, - &VNET_NAME(flowtable_debug), 0, "print debug info."); -SYSCTL_VNET_INT(_net_inet_flowtable, OID_AUTO, enable, CTLFLAG_RW, +SYSCTL_VNET_INT(_net_flowtable, OID_AUTO, enable, CTLFLAG_RW, &VNET_NAME(flowtable_enable), 0, "enable flowtable caching."); /* * XXX This does not end up updating timeouts at runtime * and only reflects the value for the last table added :-/ */ -SYSCTL_VNET_INT(_net_inet_flowtable, OID_AUTO, syn_expire, CTLFLAG_RW, +SYSCTL_VNET_INT(_net_flowtable, OID_AUTO, syn_expire, CTLFLAG_RW, &VNET_NAME(flowtable_syn_expire), 0, "seconds after which to remove syn allocated flow."); -SYSCTL_VNET_INT(_net_inet_flowtable, OID_AUTO, udp_expire, CTLFLAG_RW, +SYSCTL_VNET_INT(_net_flowtable, OID_AUTO, udp_expire, CTLFLAG_RW, &VNET_NAME(flowtable_udp_expire), 0, "seconds after which to remove flow allocated to UDP."); -SYSCTL_VNET_INT(_net_inet_flowtable, OID_AUTO, fin_wait_expire, CTLFLAG_RW, +SYSCTL_VNET_INT(_net_flowtable, OID_AUTO, fin_wait_expire, CTLFLAG_RW, &VNET_NAME(flowtable_fin_wait_expire), 0, "seconds after which to remove a flow in FIN_WAIT."); -SYSCTL_VNET_INT(_net_inet_flowtable, OID_AUTO, tcp_expire, CTLFLAG_RW, +SYSCTL_VNET_INT(_net_flowtable, OID_AUTO, tcp_expire, CTLFLAG_RW, &VNET_NAME(flowtable_tcp_expire), 0, "seconds after which to remove flow allocated to a TCP connection."); - -/* - * Maximum number of flows that can be allocated of a given type. - * - * The table is allocated at boot time (for the pure caching case - * there is no reason why this could not be changed at runtime) - * and thus (currently) needs to be set with a tunable. - */ -static int -sysctl_nmbflows(SYSCTL_HANDLER_ARGS) -{ - int error, newnmbflows; - - newnmbflows = V_flowtable_nmbflows; - error = sysctl_handle_int(oidp, &newnmbflows, 0, req); - if (error == 0 && req->newptr) { - if (newnmbflows > V_flowtable_nmbflows) { - V_flowtable_nmbflows = newnmbflows; - uma_zone_set_max(V_flow_ipv4_zone, - V_flowtable_nmbflows); - uma_zone_set_max(V_flow_ipv6_zone, - V_flowtable_nmbflows); - } else - error = EINVAL; - } - return (error); -} -SYSCTL_VNET_PROC(_net_inet_flowtable, OID_AUTO, nmbflows, - CTLTYPE_INT|CTLFLAG_RW, 0, 0, sysctl_nmbflows, "IU", - "Maximum number of flows allowed"); - - - -#define FS_PRINT(sb, field) sbuf_printf((sb), "\t%s: %jd\n", #field, fs->ft_##field) - -static void -fs_print(struct sbuf *sb, struct flowtable_stats *fs) -{ - - FS_PRINT(sb, collisions); - FS_PRINT(sb, allocated); - FS_PRINT(sb, misses); - FS_PRINT(sb, max_depth); - FS_PRINT(sb, free_checks); - FS_PRINT(sb, frees); - FS_PRINT(sb, hits); - FS_PRINT(sb, lookups); -} - -static void -flowtable_show_stats(struct sbuf *sb, struct flowtable *ft) -{ - int i; - struct flowtable_stats fs, *pfs; - - if (ft->ft_flags & FL_PCPU) { - bzero(&fs, sizeof(fs)); - pfs = &fs; - CPU_FOREACH(i) { - pfs->ft_collisions += ft->ft_stats[i].ft_collisions; - pfs->ft_allocated += ft->ft_stats[i].ft_allocated; - pfs->ft_misses += ft->ft_stats[i].ft_misses; - pfs->ft_free_checks += ft->ft_stats[i].ft_free_checks; - pfs->ft_frees += ft->ft_stats[i].ft_frees; - pfs->ft_hits += ft->ft_stats[i].ft_hits; - pfs->ft_lookups += ft->ft_stats[i].ft_lookups; - if (ft->ft_stats[i].ft_max_depth > pfs->ft_max_depth) - pfs->ft_max_depth = ft->ft_stats[i].ft_max_depth; - } - } else { - pfs = &ft->ft_stats[0]; - } - fs_print(sb, pfs); -} - -static int -sysctl_flowtable_stats(SYSCTL_HANDLER_ARGS) -{ - struct flowtable *ft; - struct sbuf *sb; - int error; - - sb = sbuf_new(NULL, NULL, 64*1024, SBUF_FIXEDLEN); - - ft = V_flow_list_head; - while (ft != NULL) { - sbuf_printf(sb, "\ntable name: %s\n", ft->ft_name); - flowtable_show_stats(sb, ft); - ft = ft->ft_next; - } - sbuf_finish(sb); - error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1); - sbuf_delete(sb); - - return (error); -} -SYSCTL_VNET_PROC(_net_inet_flowtable, OID_AUTO, stats, CTLTYPE_STRING|CTLFLAG_RD, - NULL, 0, sysctl_flowtable_stats, "A", "flowtable statistics"); - - #ifndef RADIX_MPATH static void rtalloc_ign_wrapper(struct route *ro, uint32_t hash, u_int fibnum) @@ -419,12 +289,8 @@ flowtable_pcpu_unlock(struct flowtable * #define FL_STALE (1<<8) #define FL_OVERWRITE (1<<10) -void -flow_invalidate(struct flentry *fle) -{ - - fle->f_flags |= FL_STALE; -} +static struct flentry *flowtable_lookup_common(struct flowtable *, + struct sockaddr_storage *, struct sockaddr_storage *, struct mbuf *, int); static __inline int proto_to_flags(uint8_t proto) @@ -495,8 +361,8 @@ ipv4_flow_print_tuple(int flags, int pro #endif static int -ipv4_mbuf_demarshal(struct flowtable *ft, struct mbuf *m, - struct sockaddr_in *ssin, struct sockaddr_in *dsin, uint16_t *flags) +ipv4_mbuf_demarshal(struct mbuf *m, struct sockaddr_in *ssin, + struct sockaddr_in *dsin, uint16_t *flags) { struct ip *ip; uint8_t proto; @@ -516,11 +382,8 @@ ipv4_mbuf_demarshal(struct flowtable *ft ssin->sin_addr = ip->ip_src; proto = ip->ip_p; - if ((*flags & FL_HASH_ALL) == 0) { - FLDPRINTF(ft, FL_DEBUG_ALL, "skip port check flags=0x%x ", - *flags); + if ((*flags & FL_HASH_ALL) == 0) goto skipports; - } iphlen = ip->ip_hl << 2; /* XXX options? */ @@ -544,7 +407,6 @@ ipv4_mbuf_demarshal(struct flowtable *ft dport = sh->dest_port; break; default: - FLDPRINTF(ft, FL_DEBUG_ALL, "proto=0x%x not supported\n", proto); return (ENOTSUP); /* no port - hence not a protocol we care about */ break; @@ -559,7 +421,7 @@ skipports: } static uint32_t -ipv4_flow_lookup_hash_internal( +ipv4_flow_lookup_hash( struct sockaddr_in *ssin, struct sockaddr_in *dsin, uint32_t *key, uint16_t flags) { @@ -567,8 +429,6 @@ ipv4_flow_lookup_hash_internal( uint8_t proto; int offset = 0; - if ((V_flowtable_enable == 0) || (V_flowtable_ready == 0)) - return (0); proto = flags_to_proto(flags); sport = dport = key[2] = key[1] = key[0] = 0; if ((ssin != NULL) && (flags & FL_HASH_ALL)) { @@ -583,13 +443,13 @@ ipv4_flow_lookup_hash_internal( ((uint16_t *)key)[0] = sport; ((uint16_t *)key)[1] = dport; } else - offset = V_flow_hashjitter + proto; + offset = flow_hashjitter + proto; return (jenkins_hash32(key, 3, offset)); } static struct flentry * -flowtable_lookup_mbuf4(struct flowtable *ft, struct mbuf *m) +flowtable_lookup_ipv4(struct mbuf *m) { struct sockaddr_storage ssa, dsa; uint16_t flags; @@ -599,11 +459,11 @@ flowtable_lookup_mbuf4(struct flowtable ssin = (struct sockaddr_in *)&ssa; bzero(dsin, sizeof(*dsin)); bzero(ssin, sizeof(*ssin)); - flags = ft->ft_flags; - if (ipv4_mbuf_demarshal(ft, m, ssin, dsin, &flags) != 0) + flags = V_ip4_ft.ft_flags; + if (ipv4_mbuf_demarshal(m, ssin, dsin, &flags) != 0) return (NULL); - return (flowtable_lookup(ft, &ssa, &dsa, M_GETFIB(m), flags)); + return (flowtable_lookup_common(&V_ip4_ft, &ssa, &dsa, m, flags)); } void @@ -644,8 +504,8 @@ do { \ #define UDP(p) ((struct udphdr *)(p)) static int -ipv6_mbuf_demarshal(struct flowtable *ft, struct mbuf *m, - struct sockaddr_in6 *ssin6, struct sockaddr_in6 *dsin6, uint16_t *flags) +ipv6_mbuf_demarshal(struct mbuf *m, struct sockaddr_in6 *ssin6, + struct sockaddr_in6 *dsin6, uint16_t *flags) { struct ip6_hdr *ip6; uint8_t proto; @@ -763,7 +623,7 @@ do { \ } while (0) static uint32_t -ipv6_flow_lookup_hash_internal( +ipv6_flow_lookup_hash( struct sockaddr_in6 *ssin6, struct sockaddr_in6 *dsin6, uint32_t *key, uint16_t flags) { @@ -771,9 +631,6 @@ ipv6_flow_lookup_hash_internal( uint8_t proto; int offset = 0; - if ((V_flowtable_enable == 0) || (V_flowtable_ready == 0)) - return (0); - proto = flags_to_proto(flags); zero_key(key); sport = dport = 0; @@ -789,13 +646,13 @@ ipv6_flow_lookup_hash_internal( ((uint16_t *)key)[0] = sport; ((uint16_t *)key)[1] = dport; } else - offset = V_flow_hashjitter + proto; + offset = flow_hashjitter + proto; return (jenkins_hash32(key, 9, offset)); } static struct flentry * -flowtable_lookup_mbuf6(struct flowtable *ft, struct mbuf *m) +flowtable_lookup_ipv6(struct mbuf *m) { struct sockaddr_storage ssa, dsa; struct sockaddr_in6 *dsin6, *ssin6; @@ -805,12 +662,12 @@ flowtable_lookup_mbuf6(struct flowtable ssin6 = (struct sockaddr_in6 *)&ssa; bzero(dsin6, sizeof(*dsin6)); bzero(ssin6, sizeof(*ssin6)); - flags = ft->ft_flags; + flags = V_ip6_ft.ft_flags; - if (ipv6_mbuf_demarshal(ft, m, ssin6, dsin6, &flags) != 0) + if (ipv6_mbuf_demarshal(m, ssin6, dsin6, &flags) != 0) return (NULL); - return (flowtable_lookup(ft, &ssa, &dsa, M_GETFIB(m), flags)); + return (flowtable_lookup_common(&V_ip6_ft, &ssa, &dsa, m, flags)); } void @@ -910,43 +767,19 @@ flowtable_set_hashkey(struct flentry *fl hashkey[i] = key[i]; } -static struct flentry * -flow_alloc(struct flowtable *ft) -{ - struct flentry *newfle; - uma_zone_t zone; - - newfle = NULL; - zone = (ft->ft_flags & FL_IPV6) ? V_flow_ipv6_zone : V_flow_ipv4_zone; - - newfle = uma_zalloc(zone, M_NOWAIT | M_ZERO); - if (newfle != NULL) - atomic_add_int(&ft->ft_count, 1); - return (newfle); -} - -static void -flow_free(struct flentry *fle, struct flowtable *ft) -{ - uma_zone_t zone; - - zone = (ft->ft_flags & FL_IPV6) ? V_flow_ipv6_zone : V_flow_ipv4_zone; - atomic_add_int(&ft->ft_count, -1); - uma_zfree(zone, fle); -} - static int flow_full(struct flowtable *ft) { boolean_t full; - uint32_t count; + int count, max; full = ft->ft_full; - count = ft->ft_count; + count = uma_zone_get_cur(ft->ft_zone); + max = uma_zone_get_max(ft->ft_zone); - if (full && (count < (V_flowtable_nmbflows - (V_flowtable_nmbflows >> 3)))) + if (full && (count < (max - (max >> 3)))) ft->ft_full = FALSE; - else if (!full && (count > (V_flowtable_nmbflows - (V_flowtable_nmbflows >> 5)))) + else if (!full && (count > (max - (max >> 5)))) ft->ft_full = TRUE; if (full && !ft->ft_full) { @@ -970,12 +803,11 @@ flowtable_insert(struct flowtable *ft, u uint32_t fibnum, struct route *ro, uint16_t flags) { struct flentry *fle, *fletail, *newfle, **flep; - struct flowtable_stats *fs = &ft->ft_stats[curcpu]; int depth; bitstr_t *mask; uint8_t proto; - newfle = flow_alloc(ft); + newfle = uma_zalloc(ft->ft_zone, M_NOWAIT | M_ZERO); if (newfle == NULL) return (ENOMEM); @@ -994,7 +826,7 @@ flowtable_insert(struct flowtable *ft, u } depth = 0; - fs->ft_collisions++; + FLOWSTAT_INC(ft, ft_collisions); /* * find end of list and make sure that we were not * preempted by another thread handling this flow @@ -1006,7 +838,7 @@ flowtable_insert(struct flowtable *ft, u * or we lost a race to insert */ FL_ENTRY_UNLOCK(ft, hash); - flow_free(newfle, ft); + uma_zfree(ft->ft_zone, newfle); if (flags & FL_OVERWRITE) goto skip; @@ -1022,8 +854,8 @@ flowtable_insert(struct flowtable *ft, u fle = fle->f_next; } - if (depth > fs->ft_max_depth) - fs->ft_max_depth = depth; + if (depth > ft->ft_max_depth) + ft->ft_max_depth = depth; fletail->f_next = newfle; fle = newfle; skip: @@ -1039,35 +871,6 @@ skip: return (0); } -int -kern_flowtable_insert(struct flowtable *ft, - struct sockaddr_storage *ssa, struct sockaddr_storage *dsa, - struct route *ro, uint32_t fibnum, int flags) -{ - uint32_t key[9], hash; - - flags = (ft->ft_flags | flags | FL_OVERWRITE); - hash = 0; - -#ifdef INET - if (ssa->ss_family == AF_INET) - hash = ipv4_flow_lookup_hash_internal((struct sockaddr_in *)ssa, - (struct sockaddr_in *)dsa, key, flags); -#endif -#ifdef INET6 - if (ssa->ss_family == AF_INET6) - hash = ipv6_flow_lookup_hash_internal((struct sockaddr_in6 *)ssa, - (struct sockaddr_in6 *)dsa, key, flags); -#endif - if (ro->ro_rt == NULL || ro->ro_lle == NULL) - return (EINVAL); - - FLDPRINTF(ft, FL_DEBUG, - "kern_flowtable_insert: key=%x:%x:%x hash=%x fibnum=%d flags=%x\n", - key[0], key[1], key[2], hash, fibnum, flags); - return (flowtable_insert(ft, hash, key, fibnum, ro, flags)); -} - static int flowtable_key_equal(struct flentry *fle, uint32_t *key) { @@ -1090,49 +893,54 @@ flowtable_key_equal(struct flentry *fle, } struct flentry * -flowtable_lookup_mbuf(struct flowtable *ft, struct mbuf *m, int af) +flowtable_lookup(sa_family_t sa, struct mbuf *m) { - struct flentry *fle = NULL; + switch (sa) { #ifdef INET - if (af == AF_INET) - fle = flowtable_lookup_mbuf4(ft, m); + case AF_INET: + return (flowtable_lookup_ipv4(m)); #endif #ifdef INET6 - if (af == AF_INET6) - fle = flowtable_lookup_mbuf6(ft, m); -#endif - if (fle != NULL && m != NULL && (m->m_flags & M_FLOWID) == 0) { - m->m_flags |= M_FLOWID; - m->m_pkthdr.flowid = fle->f_fhash; + case AF_INET6: + return (flowtable_lookup_ipv6(m)); +#endif + default: + panic("%s: sa %d", __func__, sa); } - return (fle); } - -struct flentry * -flowtable_lookup(struct flowtable *ft, struct sockaddr_storage *ssa, - struct sockaddr_storage *dsa, uint32_t fibnum, int flags) + +static struct flentry * +flowtable_lookup_common(struct flowtable *ft, struct sockaddr_storage *ssa, + struct sockaddr_storage *dsa, struct mbuf *m, int flags) { - uint32_t key[9], hash; + struct route_in6 sro6; + struct route sro, *ro; struct flentry *fle; - struct flowtable_stats *fs = &ft->ft_stats[curcpu]; - uint8_t proto = 0; - int error = 0; struct rtentry *rt; struct llentry *lle; - struct route sro, *ro; - struct route_in6 sro6; + struct sockaddr_storage *l3addr; + struct ifnet *ifp; + uint32_t key[9], hash, fibnum; + uint8_t proto; + + if (V_flowtable_enable == 0) + return (NULL); sro.ro_rt = sro6.ro_rt = NULL; sro.ro_lle = sro6.ro_lle = NULL; - ro = NULL; - hash = 0; flags |= ft->ft_flags; proto = flags_to_proto(flags); + fibnum = M_GETFIB(m); + + switch (ssa->ss_family) { #ifdef INET - if (ssa->ss_family == AF_INET) { + case AF_INET: { struct sockaddr_in *ssin, *dsin; + KASSERT(dsa->ss_family == AF_INET, + ("%s: dsa family %d\n", __func__, dsa->ss_family)); + ro = &sro; memcpy(&ro->ro_dst, dsa, sizeof(struct sockaddr_in)); /* @@ -1150,13 +958,17 @@ flowtable_lookup(struct flowtable *ft, s (ntohl(ssin->sin_addr.s_addr) >> IN_CLASSA_NSHIFT) == IN_LOOPBACKNET) return (NULL); - hash = ipv4_flow_lookup_hash_internal(ssin, dsin, key, flags); + hash = ipv4_flow_lookup_hash(ssin, dsin, key, flags); + break; } #endif #ifdef INET6 - if (ssa->ss_family == AF_INET6) { + case AF_INET6: { struct sockaddr_in6 *ssin6, *dsin6; + KASSERT(dsa->ss_family == AF_INET6, + ("%s: dsa family %d\n", __func__, dsa->ss_family)); + ro = (struct route *)&sro6; memcpy(&sro6.ro_dst, dsa, sizeof(struct sockaddr_in6)); @@ -1165,19 +977,24 @@ flowtable_lookup(struct flowtable *ft, s ssin6 = (struct sockaddr_in6 *)ssa; flags |= FL_IPV6; - hash = ipv6_flow_lookup_hash_internal(ssin6, dsin6, key, flags); + hash = ipv6_flow_lookup_hash(ssin6, dsin6, key, flags); + break; } #endif + default: + panic("%s: ssa family %d", __func__, ssa->ss_family); + } + /* * Ports are zero and this isn't a transmit cache * - thus not a protocol for which we need to keep * state * FL_HASH_ALL => key[0] != 0 for TCP || UDP || SCTP */ - if (hash == 0 || (key[0] == 0 && (ft->ft_flags & FL_HASH_ALL))) + if (key[0] == 0 && (ft->ft_flags & FL_HASH_ALL)) return (NULL); - fs->ft_lookups++; + FLOWSTAT_INC(ft, ft_lookups); FL_ENTRY_LOCK(ft, hash); if ((fle = FL_ENTRY(ft, hash)) == NULL) { FL_ENTRY_UNLOCK(ft, hash); @@ -1195,11 +1012,11 @@ keycheck: && (rt->rt_flags & RTF_UP) && (rt->rt_ifp != NULL) && (lle->la_flags & LLE_VALID)) { - fs->ft_hits++; + FLOWSTAT_INC(ft, ft_hits); fle->f_uptime = time_uptime; fle->f_flags |= flags; FL_ENTRY_UNLOCK(ft, hash); - return (fle); + goto success; } else if (fle->f_next != NULL) { fle = fle->f_next; goto keycheck; @@ -1209,7 +1026,7 @@ uncached: if (flags & FL_NOAUTO || flow_full(ft)) return (NULL); - fs->ft_misses++; + FLOWSTAT_INC(ft, ft_misses); /* * This bit of code ends up locking the * same route 3 times (just like ip_output + ether_output) @@ -1222,73 +1039,66 @@ uncached: * receive the route locked */ -#ifdef INVARIANTS - if ((ro->ro_dst.sa_family != AF_INET) && - (ro->ro_dst.sa_family != AF_INET6)) - panic("sa_family == %d\n", ro->ro_dst.sa_family); -#endif - ft->ft_rtalloc(ro, hash, fibnum); if (ro->ro_rt == NULL) - error = ENETUNREACH; - else { - struct llentry *lle = NULL; - struct sockaddr_storage *l3addr; - struct rtentry *rt = ro->ro_rt; - struct ifnet *ifp = rt->rt_ifp; + return (NULL); - if (ifp->if_flags & (IFF_POINTOPOINT | IFF_LOOPBACK)) { - RTFREE(rt); - ro->ro_rt = NULL; - return (NULL); - } -#ifdef INET6 - if (ssa->ss_family == AF_INET6) { - struct sockaddr_in6 *dsin6; + rt = ro->ro_rt; + ifp = rt->rt_ifp; - dsin6 = (struct sockaddr_in6 *)dsa; - if (in6_localaddr(&dsin6->sin6_addr)) { - RTFREE(rt); - ro->ro_rt = NULL; - return (NULL); - } + if (ifp->if_flags & (IFF_POINTOPOINT | IFF_LOOPBACK)) { + RTFREE(rt); + return (NULL); + } - if (rt->rt_flags & RTF_GATEWAY) - l3addr = (struct sockaddr_storage *)rt->rt_gateway; - - else - l3addr = (struct sockaddr_storage *)&ro->ro_dst; - lle = llentry_alloc(ifp, LLTABLE6(ifp), l3addr); - } -#endif + switch (ssa->ss_family) { #ifdef INET - if (ssa->ss_family == AF_INET) { - if (rt->rt_flags & RTF_GATEWAY) - l3addr = (struct sockaddr_storage *)rt->rt_gateway; - else - l3addr = (struct sockaddr_storage *)&ro->ro_dst; - lle = llentry_alloc(ifp, LLTABLE(ifp), l3addr); - } - + case AF_INET: + if (rt->rt_flags & RTF_GATEWAY) + l3addr = (struct sockaddr_storage *)rt->rt_gateway; + else + l3addr = (struct sockaddr_storage *)&ro->ro_dst; + lle = llentry_alloc(ifp, LLTABLE(ifp), l3addr); + break; #endif - ro->ro_lle = lle; +#ifdef INET6 + case AF_INET6: { + struct sockaddr_in6 *dsin6; - if (lle == NULL) { + dsin6 = (struct sockaddr_in6 *)dsa; + if (in6_localaddr(&dsin6->sin6_addr)) { RTFREE(rt); - ro->ro_rt = NULL; - return (NULL); + return (NULL); } - error = flowtable_insert(ft, hash, key, fibnum, ro, flags); - if (error) { - RTFREE(rt); - LLE_FREE(lle); - ro->ro_rt = NULL; - ro->ro_lle = NULL; - } + if (rt->rt_flags & RTF_GATEWAY) + l3addr = (struct sockaddr_storage *)rt->rt_gateway; + else + l3addr = (struct sockaddr_storage *)&ro->ro_dst; + lle = llentry_alloc(ifp, LLTABLE6(ifp), l3addr); + break; + } +#endif + } + + if (lle == NULL) { + RTFREE(rt); + return (NULL); + } + ro->ro_lle = lle; + + if (flowtable_insert(ft, hash, key, fibnum, ro, flags) != 0) { + RTFREE(rt); + LLE_FREE(lle); + return (NULL); } - return ((error) ? NULL : fle); +success: + if (fle != NULL && (m->m_flags & M_FLOWID) == 0) { + m->m_flags |= M_FLOWID; + m->m_pkthdr.flowid = fle->f_fhash; + } + return (fle); } /* @@ -1296,37 +1106,24 @@ uncached: */ #define calloc(count, size) malloc((count)*(size), M_DEVBUF, M_WAITOK|M_ZERO) -struct flowtable * -flowtable_alloc(char *name, int nentry, int flags) +static void +flowtable_alloc(struct flowtable *ft) { - struct flowtable *ft, *fttail; - int i; - - if (V_flow_hashjitter == 0) - V_flow_hashjitter = arc4random(); - KASSERT(nentry > 0, ("nentry must be > 0, is %d\n", nentry)); - - ft = malloc(sizeof(struct flowtable), - M_RTABLE, M_WAITOK | M_ZERO); - - ft->ft_name = name; - ft->ft_flags = flags; - ft->ft_size = nentry; #ifdef RADIX_MPATH ft->ft_rtalloc = rtalloc_mpath_fib; #else ft->ft_rtalloc = rtalloc_ign_wrapper; #endif - if (flags & FL_PCPU) { + if (ft->ft_flags & FL_PCPU) { ft->ft_lock = flowtable_pcpu_lock; ft->ft_unlock = flowtable_pcpu_unlock; - for (i = 0; i <= mp_maxid; i++) { + for (int i = 0; i <= mp_maxid; i++) { ft->ft_table.pcpu[i] = - malloc(nentry*sizeof(struct flentry *), + malloc(ft->ft_size * sizeof(struct flentry *), M_RTABLE, M_WAITOK | M_ZERO); - ft->ft_masks[i] = bit_alloc(nentry); + ft->ft_masks[i] = bit_alloc(ft->ft_size); } } else { ft->ft_lock_count = 2*(powerof2(mp_maxid + 1) ? (mp_maxid + 1): @@ -1335,23 +1132,24 @@ flowtable_alloc(char *name, int nentry, ft->ft_lock = flowtable_global_lock; ft->ft_unlock = flowtable_global_unlock; ft->ft_table.global = - malloc(nentry*sizeof(struct flentry *), + malloc(ft->ft_size * sizeof(struct flentry *), M_RTABLE, M_WAITOK | M_ZERO); ft->ft_locks = malloc(ft->ft_lock_count*sizeof(struct mtx), M_RTABLE, M_WAITOK | M_ZERO); - for (i = 0; i < ft->ft_lock_count; i++) - mtx_init(&ft->ft_locks[i], "flow", NULL, MTX_DEF|MTX_DUPOK); + for (int i = 0; i < ft->ft_lock_count; i++) + mtx_init(&ft->ft_locks[i], "flow", NULL, + MTX_DEF | MTX_DUPOK); - ft->ft_masks[0] = bit_alloc(nentry); + ft->ft_masks[0] = bit_alloc(ft->ft_size); } - ft->ft_tmpmask = bit_alloc(nentry); + ft->ft_tmpmask = bit_alloc(ft->ft_size); /* * In the local transmit case the table truly is * just a cache - so everything is eligible for * replacement after 5s of non-use */ - if (flags & FL_HASH_ALL) { + if (ft->ft_flags & FL_HASH_ALL) { ft->ft_udp_idle = V_flowtable_udp_expire; ft->ft_syn_idle = V_flowtable_syn_expire; ft->ft_fin_wait_idle = V_flowtable_fin_wait_expire; @@ -1361,20 +1159,6 @@ flowtable_alloc(char *name, int nentry, ft->ft_syn_idle = ft->ft_tcp_idle = 30; } - - /* - * hook in to the cleaner list - */ - if (V_flow_list_head == NULL) - V_flow_list_head = ft; - else { - fttail = V_flow_list_head; - while (fttail->ft_next != NULL) - fttail = fttail->ft_next; - fttail->ft_next = ft; - } - - return (ft); } /* @@ -1395,17 +1179,16 @@ fle_free(struct flentry *fle, struct flo RTFREE(rt); if (lle != NULL) LLE_FREE(lle); - flow_free(fle, ft); + uma_zfree(ft->ft_zone, fle); } static void flowtable_free_stale(struct flowtable *ft, struct rtentry *rt) { - int curbit = 0, count, tmpsize; + int curbit = 0, tmpsize; struct flentry *fle, **flehead, *fleprev; struct flentry *flefreehead, *flefreetail, *fletmp; bitstr_t *mask, *tmpmask; - struct flowtable_stats *fs = &ft->ft_stats[curcpu]; flefreehead = flefreetail = NULL; mask = flowtable_mask(ft); @@ -1429,7 +1212,7 @@ flowtable_free_stale(struct flowtable *f flehead = flowtable_entry(ft, curbit); fle = fleprev = *flehead; - fs->ft_free_checks++; + FLOWSTAT_INC(ft, ft_free_checks); #ifdef DIAGNOSTIC if (fle == NULL && curbit > 0) { log(LOG_ALERT, @@ -1484,22 +1267,34 @@ flowtable_free_stale(struct flowtable *f tmpsize -= (curbit / 8) * 8; bit_ffs(tmpmask, tmpsize, &curbit); } - count = 0; while ((fle = flefreehead) != NULL) { flefreehead = fle->f_next; - count++; - fs->ft_frees++; + FLOWSTAT_INC(ft, ft_frees); fle_free(fle, ft); } - if (V_flowtable_debug && count) - log(LOG_DEBUG, "freed %d flow entries\n", count); } void -flowtable_route_flush(struct flowtable *ft, struct rtentry *rt) +flowtable_route_flush(sa_family_t sa, struct rtentry *rt) { + struct flowtable *ft; int i; + switch (sa) { +#ifdef INET + case AF_INET: + ft = &V_ip4_ft; + break; +#endif +#ifdef INET6 + case AF_INET6: + ft = &V_ip6_ft; + break; +#endif + default: + panic("%s: sa %d", __func__, sa); + } + if (ft->ft_flags & FL_PCPU) { CPU_FOREACH(i) { if (smp_started == 1) { @@ -1522,34 +1317,29 @@ flowtable_route_flush(struct flowtable * } static void -flowtable_clean_vnet(void) +flowtable_clean_vnet(struct flowtable *ft) { - struct flowtable *ft; - int i; - - ft = V_flow_list_head; - while (ft != NULL) { - if (ft->ft_flags & FL_PCPU) { - CPU_FOREACH(i) { - if (smp_started == 1) { - thread_lock(curthread); - sched_bind(curthread, i); - thread_unlock(curthread); - } - flowtable_free_stale(ft, NULL); + if (ft->ft_flags & FL_PCPU) { + int i; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Feb 7 15:26:20 2014 Return-Path: Delivered-To: svn-src-head@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 016CB509; Fri, 7 Feb 2014 15:26:20 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DF458187F; Fri, 7 Feb 2014 15:26:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s17FQJFo077807; Fri, 7 Feb 2014 15:26:19 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s17FQJb0077806; Fri, 7 Feb 2014 15:26:19 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201402071526.s17FQJb0077806@svn.freebsd.org> From: Kevin Lo Date: Fri, 7 Feb 2014 15:26:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261602 - head/lib/libc/inet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 15:26:20 -0000 Author: kevlo Date: Fri Feb 7 15:26:19 2014 New Revision: 261602 URL: http://svnweb.freebsd.org/changeset/base/261602 Log: Set errno on inet_ntop(3) failure. Reviewed by: glebius Modified: head/lib/libc/inet/inet_ntop.c Modified: head/lib/libc/inet/inet_ntop.c ============================================================================== --- head/lib/libc/inet/inet_ntop.c Fri Feb 7 15:18:23 2014 (r261601) +++ head/lib/libc/inet/inet_ntop.c Fri Feb 7 15:26:19 2014 (r261602) @@ -45,7 +45,7 @@ __FBSDID("$FreeBSD$"); static const char *inet_ntop4(const u_char *src, char *dst, socklen_t size); static const char *inet_ntop6(const u_char *src, char *dst, socklen_t size); -/* char * +/* const char * * inet_ntop(af, src, dst, size) * convert a network format address to presentation format. * return: @@ -169,8 +169,10 @@ inet_ntop6(const u_char *src, char *dst, if (i == 6 && best.base == 0 && (best.len == 6 || (best.len == 7 && words[7] != 0x0001) || (best.len == 5 && words[5] == 0xffff))) { - if (!inet_ntop4(src+12, tp, sizeof tmp - (tp - tmp))) + if (!inet_ntop4(src+12, tp, sizeof tmp - (tp - tmp))) { + errno = ENOSPC; return (NULL); + } tp += strlen(tp); break; } From owner-svn-src-head@FreeBSD.ORG Fri Feb 7 15:34:40 2014 Return-Path: Delivered-To: svn-src-head@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 BF78FB34; Fri, 7 Feb 2014 15:34:40 +0000 (UTC) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4852E1968; Fri, 7 Feb 2014 15:34:40 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id A062825D38A4; Fri, 7 Feb 2014 15:34:38 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id CA51BC22BD0; Fri, 7 Feb 2014 15:34:37 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id l_aSoVaitSxT; Fri, 7 Feb 2014 15:34:36 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:3535:2160:1e6b:964d] (unknown [IPv6:fde9:577b:c1a9:4410:3535:2160:1e6b:964d]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 2DD84C22BD3; Fri, 7 Feb 2014 15:34:34 +0000 (UTC) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.1 \(1827\)) Subject: Re: svn commit: r261601 - in head: sys/net sys/netinet sys/netinet6 usr.bin/netstat From: "Bjoern A. Zeeb" In-Reply-To: <201402071518.s17FINtP074186@svn.freebsd.org> Date: Fri, 7 Feb 2014 15:34:27 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201402071518.s17FINtP074186@svn.freebsd.org> To: Gleb Smirnoff X-Mailer: Apple Mail (2.1827) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 15:34:40 -0000 On 07 Feb 2014, at 15:18 , Gleb Smirnoff wrote: ... > /* > * XXX This does not end up updating timeouts at runtime > * and only reflects the value for the last table added :-/ > */ > -SYSCTL_VNET_INT(_net_inet_flowtable, OID_AUTO, syn_expire, = CTLFLAG_RW, > +SYSCTL_VNET_INT(_net_flowtable, OID_AUTO, syn_expire, CTLFLAG_RW, > &VNET_NAME(flowtable_syn_expire), 0, > "seconds after which to remove syn allocated flow."); > -SYSCTL_VNET_INT(_net_inet_flowtable, OID_AUTO, udp_expire, = CTLFLAG_RW, > +SYSCTL_VNET_INT(_net_flowtable, OID_AUTO, udp_expire, CTLFLAG_RW, > &VNET_NAME(flowtable_udp_expire), 0, > "seconds after which to remove flow allocated to UDP."); > -SYSCTL_VNET_INT(_net_inet_flowtable, OID_AUTO, fin_wait_expire, = CTLFLAG_RW, > +SYSCTL_VNET_INT(_net_flowtable, OID_AUTO, fin_wait_expire, = CTLFLAG_RW, > &VNET_NAME(flowtable_fin_wait_expire), 0, > "seconds after which to remove a flow in FIN_WAIT."); > -SYSCTL_VNET_INT(_net_inet_flowtable, OID_AUTO, tcp_expire, = CTLFLAG_RW, > +SYSCTL_VNET_INT(_net_flowtable, OID_AUTO, tcp_expire, CTLFLAG_RW, > &VNET_NAME(flowtable_tcp_expire), 0, > "seconds after which to remove flow allocated to a TCP = connection."); =85 This is not what we are doing for a lot of other things in the tree = which simply treat =93inet=94 as =93IP=94 without version number. Now I = know that the floatable sits even between L3 and L2 given it caches = pairs, I am still not sure I want to make net.* the =93dumping ground=94 = for these. Pending a better solution I don=92t care apart from that sysctl.confs = entries for the people using floatable after all break with this. =97=20 Bjoern A. Zeeb ????????? ??? ??????? ??????: '??? ??? ???? ?????? ??????? ?? ?? ??????? ??????? ??? ????? ????? ???? ?????? ?? ????? ????', ????????? ?????????, "??? ????? ?? ?????", ?.??? From owner-svn-src-head@FreeBSD.ORG Fri Feb 7 16:28:40 2014 Return-Path: Delivered-To: svn-src-head@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 F0ED1D7C; Fri, 7 Feb 2014 16:28:40 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DA27C1F90; Fri, 7 Feb 2014 16:28:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s17GSeVw002612; Fri, 7 Feb 2014 16:28:40 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s17GSe85002611; Fri, 7 Feb 2014 16:28:40 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201402071628.s17GSe85002611@svn.freebsd.org> From: Ed Maste Date: Fri, 7 Feb 2014 16:28:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261603 - head/sys/boot/efi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 16:28:41 -0000 Author: emaste Date: Fri Feb 7 16:28:40 2014 New Revision: 261603 URL: http://svnweb.freebsd.org/changeset/base/261603 Log: Don't force efi to a 32-bit build on amd64 Sponsored by: The FreeBSD Foundation Modified: head/sys/boot/efi/Makefile.inc Modified: head/sys/boot/efi/Makefile.inc ============================================================================== --- head/sys/boot/efi/Makefile.inc Fri Feb 7 15:26:19 2014 (r261602) +++ head/sys/boot/efi/Makefile.inc Fri Feb 7 16:28:40 2014 (r261603) @@ -2,17 +2,10 @@ BINDIR?= /boot -.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "i386" CFLAGS+= -march=i386 .endif -.if ${MACHINE_CPUARCH} == "amd64" -CFLAGS+= -m32 -ACFLAGS+= -m32 -LDFLAGS+= -m elf_i386_fbsd -AFLAGS+= --32 -.endif - # Options used when building app-specific efi components CFLAGS+= -ffreestanding -fshort-wchar -Wformat LDFLAGS+= -nostdlib From owner-svn-src-head@FreeBSD.ORG Fri Feb 7 17:14:42 2014 Return-Path: Delivered-To: svn-src-head@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 9C11CE1F; Fri, 7 Feb 2014 17:14:42 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EB30613DF; Fri, 7 Feb 2014 17:14:41 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.7/8.14.7) with ESMTP id s17HEdgO085922 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 7 Feb 2014 21:14:39 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.7/8.14.7/Submit) id s17HEdDs085921; Fri, 7 Feb 2014 21:14:39 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 7 Feb 2014 21:14:39 +0400 From: Gleb Smirnoff To: "Bjoern A. Zeeb" Subject: Re: svn commit: r261601 - in head: sys/net sys/netinet sys/netinet6 usr.bin/netstat Message-ID: <20140207171439.GD66160@FreeBSD.org> References: <201402071518.s17FINtP074186@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 17:14:42 -0000 On Fri, Feb 07, 2014 at 03:34:27PM +0000, Bjoern A. Zeeb wrote: B> > * XXX This does not end up updating timeouts at runtime B> > * and only reflects the value for the last table added :-/ B> > */ B> > -SYSCTL_VNET_INT(_net_inet_flowtable, OID_AUTO, syn_expire, CTLFLAG_RW, B> > +SYSCTL_VNET_INT(_net_flowtable, OID_AUTO, syn_expire, CTLFLAG_RW, B> > &VNET_NAME(flowtable_syn_expire), 0, B> > "seconds after which to remove syn allocated flow."); B> > -SYSCTL_VNET_INT(_net_inet_flowtable, OID_AUTO, udp_expire, CTLFLAG_RW, B> > +SYSCTL_VNET_INT(_net_flowtable, OID_AUTO, udp_expire, CTLFLAG_RW, B> > &VNET_NAME(flowtable_udp_expire), 0, B> > "seconds after which to remove flow allocated to UDP."); B> > -SYSCTL_VNET_INT(_net_inet_flowtable, OID_AUTO, fin_wait_expire, CTLFLAG_RW, B> > +SYSCTL_VNET_INT(_net_flowtable, OID_AUTO, fin_wait_expire, CTLFLAG_RW, B> > &VNET_NAME(flowtable_fin_wait_expire), 0, B> > "seconds after which to remove a flow in FIN_WAIT."); B> > -SYSCTL_VNET_INT(_net_inet_flowtable, OID_AUTO, tcp_expire, CTLFLAG_RW, B> > +SYSCTL_VNET_INT(_net_flowtable, OID_AUTO, tcp_expire, CTLFLAG_RW, B> > &VNET_NAME(flowtable_tcp_expire), 0, B> > "seconds after which to remove flow allocated to a TCP connection."); B> … B> B> B> This is not what we are doing for a lot of other things in the tree which simply treat “inet” as “IP” without version number. Now I know that the floatable sits even between L3 and L2 given it caches pairs, I am still not sure I want to make net.* the “dumping ground” for these. And that's not nice that we are using "inet" as dumping ground for all kind of IP. B> Pending a better solution I don’t care apart from that sysctl.confs entries for the people using floatable after all break with this. Taking into account absence of FLOWTABLE in GENERIC and all the problems that were (are?) there, I'm pretty sure these people are empty set :) -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Fri Feb 7 18:10:35 2014 Return-Path: Delivered-To: svn-src-head@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 85B505AA; Fri, 7 Feb 2014 18:10:35 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 720C019A2; Fri, 7 Feb 2014 18:10:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s17IAZWq043816; Fri, 7 Feb 2014 18:10:35 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s17IAZtx043815; Fri, 7 Feb 2014 18:10:35 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201402071810.s17IAZtx043815@svn.freebsd.org> From: Eitan Adler Date: Fri, 7 Feb 2014 18:10:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261604 - head/contrib/libc++/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 18:10:35 -0000 Author: eadler Date: Fri Feb 7 18:10:34 2014 New Revision: 261604 URL: http://svnweb.freebsd.org/changeset/base/261604 Log: HEAD is not buildable for the past day. Commit a 'quick fix' in order to permit buildworld to complete. Reviewed by: theraven Modified: head/contrib/libc++/include/locale Modified: head/contrib/libc++/include/locale ============================================================================== --- head/contrib/libc++/include/locale Fri Feb 7 16:28:40 2014 (r261603) +++ head/contrib/libc++/include/locale Fri Feb 7 18:10:34 2014 (r261604) @@ -1012,7 +1012,7 @@ num_get<_CharT, _InputIterator>::__do_ge unsigned __dc = 0; for (; __b != __e; ++__b) { - if (__a_end - __a == __buf.size()) + if (__a_end - __a == (long)__buf.size()) { size_t __tmp = __buf.size(); __buf.resize(2*__buf.size()); @@ -1062,7 +1062,7 @@ num_get<_CharT, _InputIterator>::__do_ge unsigned __dc = 0; for (; __b != __e; ++__b) { - if (__a_end - __a == __buf.size()) + if (__a_end - __a == (long)__buf.size()) { size_t __tmp = __buf.size(); __buf.resize(2*__buf.size()); @@ -1116,7 +1116,7 @@ num_get<_CharT, _InputIterator>::__do_ge char __exp = 'E'; for (; __b != __e; ++__b) { - if (__a_end - __a == __buf.size()) + if (__a_end - __a == (long)__buf.size()) { size_t __tmp = __buf.size(); __buf.resize(2*__buf.size()); @@ -1166,7 +1166,7 @@ num_get<_CharT, _InputIterator>::do_get( unsigned __dc = 0; for (; __b != __e; ++__b) { - if (__a_end - __a == __buf.size()) + if (__a_end - __a == (long)__buf.size()) { size_t __tmp = __buf.size(); __buf.resize(2*__buf.size()); From owner-svn-src-head@FreeBSD.ORG Fri Feb 7 18:14:20 2014 Return-Path: Delivered-To: svn-src-head@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 595E690A; Fri, 7 Feb 2014 18:14:20 +0000 (UTC) Received: from mail-we0-x232.google.com (mail-we0-x232.google.com [IPv6:2a00:1450:400c:c03::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 783941A0C; Fri, 7 Feb 2014 18:14:19 +0000 (UTC) Received: by mail-we0-f178.google.com with SMTP id q59so2510687wes.23 for ; Fri, 07 Feb 2014 10:14:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=7gtmIhlOBgOKVPMm6itdVDMsoguSn3jDp3VheKimRJs=; b=a78sIdXr9GtHEoShBUk7xUN3ZHLTGTu1yVaZG4iXJGVho6Zr9/DQB+pjzhwjMdZiyF 7Of9TWHJerDwM9lL/WPbCzgm+zTlLqWYPUAO09nEKQaRawDFVqRWCyInP4wnJcRswBno izlxfaPsrnsk3azsFRTaAdbY83df86TWW5QIGFVNs8fhNFb3Bzjygc3Yb4vbbPioGTtd jM5ASioVqjrJ/EQeUw0ghPY3xz/VhcQlcYbIdiFKJcR0oJm4vHFq3oq2/qRv9lfxU1ve GsajROnYe8IF31n1HzfPI8jMTJsC1goLLspkQzVyF7urJrEh3gCML0H+u4lX4W1m1/f5 NBHQ== MIME-Version: 1.0 X-Received: by 10.180.189.139 with SMTP id gi11mr803301wic.53.1391796857934; Fri, 07 Feb 2014 10:14:17 -0800 (PST) Sender: asomers@gmail.com Received: by 10.194.168.197 with HTTP; Fri, 7 Feb 2014 10:14:17 -0800 (PST) In-Reply-To: <201402071810.s17IAZtx043815@svn.freebsd.org> References: <201402071810.s17IAZtx043815@svn.freebsd.org> Date: Fri, 7 Feb 2014 11:14:17 -0700 X-Google-Sender-Auth: 0rGxZJUDjMkyiOgLTxBRqx3JgI0 Message-ID: Subject: Re: svn commit: r261604 - head/contrib/libc++/include From: Alan Somers To: Eitan Adler Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 18:14:20 -0000 On Fri, Feb 7, 2014 at 11:10 AM, Eitan Adler wrote: > Author: eadler > Date: Fri Feb 7 18:10:34 2014 > New Revision: 261604 > URL: http://svnweb.freebsd.org/changeset/base/261604 > > Log: > HEAD is not buildable for the past day. Commit a 'quick fix' in order to permit > buildworld to complete. > > Reviewed by: theraven > > Modified: > head/contrib/libc++/include/locale Are you sure that this will work on all architectures? It implicitly assumes that ptrdiff_t is the same as long. IMHO, it's better to cast the left side of the comparison to size_t, because it will always be nonnegative as long as __a_end is greater than or equal to __a. They certainly sound like it, based on the names. -Alan From owner-svn-src-head@FreeBSD.ORG Fri Feb 7 18:27:05 2014 Return-Path: Delivered-To: svn-src-head@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 1E99EFF0 for ; Fri, 7 Feb 2014 18:27:05 +0000 (UTC) Received: from mail-qc0-x236.google.com (mail-qc0-x236.google.com [IPv6:2607:f8b0:400d:c01::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C69FA1AF6 for ; Fri, 7 Feb 2014 18:27:04 +0000 (UTC) Received: by mail-qc0-f182.google.com with SMTP id c9so6642435qcz.13 for ; Fri, 07 Feb 2014 10:27:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=PmRqVeKIkOLIehdHYawpEqGqa0PIBj70TcglvXIyIvA=; b=KPC0XnA9yiS70gBWZPO9M7Bb5HtMLTVtuu7NCYV0tlio2kKVv6e4TjN96N/ucBGZFA gLjXnI4cMlIMRIIXolq5vdz0UrixMehrac9lhCXrCo7Kdk+uGcPrUHZb5DyxdiVWv2yC ItXGbnTfvmbQ4AJq5DUgDDLDXVSL8Od+x27RQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=PmRqVeKIkOLIehdHYawpEqGqa0PIBj70TcglvXIyIvA=; b=ZzkXvhMuZJAu6iCcG+ldIWQ2xpUb5ZoJ/SCxkEhgBGqtdLTCourmBEotY0LXcHebkS 8XNomwKaLNZ7ZU5bGgJNHS5F/2WyVeCV23AL/XHZF5xYZj0kzy3qvwsrq5pw6DlbDI4G 4dk3kK0ipMoIioty3w0RafQxO70cETkgNgYuk4zplDjboO6LEh4Xj0sn/rJ0zOmlDp7+ +ISrFKk29OkucpCwdigyF9EcHbt6fJoz0Opsb+bna1RwgGYUlATkKSsCn/aJzYgV5PUl fmhazHZ6oxtJws2ei1jpAEPjORf51V3PU/U4kHQK0KyCObaetKCmBS0hXIIQuoX7jd2Z hoBg== X-Gm-Message-State: ALoCoQlrVNkBZjl1RjL/nz0FqmTdrgGpoJxtgUuSRHEiXFqGviU1845wbm5ehU0NxD4F/NBH55mV X-Received: by 10.224.127.202 with SMTP id h10mr25019395qas.23.1391797623541; Fri, 07 Feb 2014 10:27:03 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.96.30.229 with HTTP; Fri, 7 Feb 2014 10:26:33 -0800 (PST) In-Reply-To: References: <201402071810.s17IAZtx043815@svn.freebsd.org> From: Eitan Adler Date: Fri, 7 Feb 2014 13:26:33 -0500 X-Google-Sender-Auth: giec9B4qyVLH93TgSwHLIL_xjj8 Message-ID: Subject: Re: svn commit: r261604 - head/contrib/libc++/include To: Alan Somers Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 18:27:05 -0000 On Fri, Feb 7, 2014 at 1:14 PM, Alan Somers wrote: > On Fri, Feb 7, 2014 at 11:10 AM, Eitan Adler wrote: >> Author: eadler >> Date: Fri Feb 7 18:10:34 2014 >> New Revision: 261604 >> URL: http://svnweb.freebsd.org/changeset/base/261604 >> >> Log: >> HEAD is not buildable for the past day. Commit a 'quick fix' in order to permit >> buildworld to complete. >> >> Reviewed by: theraven >> >> Modified: >> head/contrib/libc++/include/locale > > Are you sure that this will work on all architectures? I didn't run 'make universe' but I think it should work. This was committed this after waiting a day for a real fix to be done. I had / have other work which I needed to get done and did not analize this code in detail. > It implicitly > assumes that ptrdiff_t is the same as long. It assumes that ptrdiff_t is signed and sizeof (ptrdiff_t) <= sizeof(long). Please feel free to modify my hack or otherwise fix the code. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@FreeBSD.ORG Fri Feb 7 18:46:27 2014 Return-Path: Delivered-To: svn-src-head@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 B20C1438; Fri, 7 Feb 2014 18:46:27 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9C3D31CAA; Fri, 7 Feb 2014 18:46:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s17IkRwk056757; Fri, 7 Feb 2014 18:46:27 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s17IkR4Q056756; Fri, 7 Feb 2014 18:46:27 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402071846.s17IkR4Q056756@svn.freebsd.org> From: John Baldwin Date: Fri, 7 Feb 2014 18:46:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261605 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 18:46:27 -0000 Author: jhb Date: Fri Feb 7 18:46:27 2014 New Revision: 261605 URL: http://svnweb.freebsd.org/changeset/base/261605 Log: Now that FreeBSD/i386 works as a bhyve guest, allow i386 kernels to include bvmconsole and bvmdebug. Modified: head/sys/conf/files.i386 Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Fri Feb 7 18:10:34 2014 (r261604) +++ head/sys/conf/files.i386 Fri Feb 7 18:46:27 2014 (r261605) @@ -554,6 +554,11 @@ i386/xbox/pic16l.s optional xbox # compat/x86bios/x86bios.c optional x86bios | atkbd | dpms | vesa # +# bvm console +# +dev/bvm/bvm_console.c optional bvmconsole +dev/bvm/bvm_dbg.c optional bvmdebug +# # x86 shared code between IA32, AMD64 and PC98 architectures # x86/acpica/OsdEnvironment.c optional acpi From owner-svn-src-head@FreeBSD.ORG Fri Feb 7 19:15:26 2014 Return-Path: Delivered-To: svn-src-head@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 DBEA53E9; Fri, 7 Feb 2014 19:15:25 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B72E11FF9; Fri, 7 Feb 2014 19:15:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s17JFPZk069491; Fri, 7 Feb 2014 19:15:25 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s17JFP7R069490; Fri, 7 Feb 2014 19:15:25 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201402071915.s17JFP7R069490@svn.freebsd.org> From: Andrew Turner Date: Fri, 7 Feb 2014 19:15:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261606 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 19:15:26 -0000 Author: andrew Date: Fri Feb 7 19:15:25 2014 New Revision: 261606 URL: http://svnweb.freebsd.org/changeset/base/261606 Log: Dynamically generate the page table. This will allow us to detect the physical address we are loaded at to change the mapping. Modified: head/sys/arm/arm/locore.S Modified: head/sys/arm/arm/locore.S ============================================================================== --- head/sys/arm/arm/locore.S Fri Feb 7 18:46:27 2014 (r261605) +++ head/sys/arm/arm/locore.S Fri Feb 7 19:15:25 2014 (r261606) @@ -153,22 +153,27 @@ Lunmapped: ldr r2, =(KERNVIRTADDR - KERNPHYSADDR) sub r0, r1, r2 - adr r4, mmu_init_table - b 3f - -2: - str r3, [r0, r2] - add r2, r2, #4 - add r3, r3, #(L1_S_SIZE) - adds r1, r1, #-1 - bhi 2b -3: - ldmia r4!, {r1,r2,r3} /* # of sections, VA, PA|attr */ - cmp r1, #0 - adrne r5, 2b - bicne r5, r5, #0xf0000000 - orrne r5, r5, #PHYSADDR - movne pc, r5 + /* + * Map PA == VA + */ + ldr r5, =(PHYSADDR) + mov r1, r5 + mov r2, r5 + /* Map 64MiB, preserved over calls to build_pagetables */ + mov r3, #64 + bl build_pagetables + + /* Create the kernel map to jump to */ + mov r1, r5 + ldr r2, =(KERNBASE) + bl build_pagetables + +#if defined(SOCDEV_PA) && defined(SOCDEV_VA) + /* Create the custom map */ + ldr r1, =SOCDEV_VA + ldr r2, =SOCDEV_PA + bl build_pagetables +#endif #if defined(SMP) orr r0, r0, #2 /* Set TTB shared memory flag */ @@ -238,6 +243,40 @@ virt_done: adr r0, .Lmainreturned b _C_LABEL(panic) /* NOTREACHED */ +END(btext) +END(_start) + +/* + * Builds the page table + * r0 - The table base address + * r1 - The physical address (trashed) + * r2 - The virtual address (trashed) + * r3 - The number of 1MiB sections + * r4 - Trashed + * + * Addresses must be 1MiB aligned + */ +build_pagetables: + /* Set the required page attributed */ + ldr r4, =(L1_TYPE_S|L1_S_C|L1_S_AP(AP_KRW)) +#if defined(SMP) + orr r4, #(L1_SHARED) +#endif + orr r1, r4 + + /* Move the virtual address to the correct bit location */ + lsr r2, #(L1_S_SHIFT - 2) + + mov r4, r3 +1: + str r1, [r0, r2] + add r2, r2, #4 + add r1, r1, #(L1_S_SIZE) + adds r4, r4, #-1 + bhi 1b + + RET + #define MMU_INIT(va,pa,n_sec,attr) \ .word n_sec ; \ .word 4*((va)>>L1_S_SHIFT) ; \ @@ -257,27 +296,7 @@ Lstartup_pagetable: Lstartup_pagetable_secondary: .word temp_pagetable #endif -END(btext) -END(_start) -mmu_init_table: - /* fill all table VA==PA */ - /* map SDRAM VA==PA, WT cacheable */ -#if !defined(SMP) - MMU_INIT(PHYSADDR, PHYSADDR, 64, L1_TYPE_S|L1_S_C|L1_S_AP(AP_KRW)) - /* map VA 0xc0000000..0xc3ffffff to PA */ - MMU_INIT(KERNBASE, PHYSADDR, 64, L1_TYPE_S|L1_S_C|L1_S_AP(AP_KRW)) -#if defined(SOCDEV_PA) && defined(SOCDEV_VA) - /* Map in 0x04000000 worth of the SoC's devices for bootstrap debugging */ - MMU_INIT(SOCDEV_VA, SOCDEV_PA, 64, L1_TYPE_S|L1_S_C|L1_S_AP(AP_KRW)) -#endif -#else - MMU_INIT(PHYSADDR, PHYSADDR , 64, L1_TYPE_S|L1_SHARED|L1_S_C|L1_S_AP(AP_KRW)) - /* map VA 0xc0000000..0xc3ffffff to PA */ - MMU_INIT(KERNBASE, PHYSADDR, 64, L1_TYPE_S|L1_SHARED|L1_S_C|L1_S_AP(AP_KRW)) - MMU_INIT(0x48000000, 0x48000000, 1, L1_TYPE_S|L1_SHARED|L1_S_C|L1_S_AP(AP_KRW)) -#endif /* SMP */ - .word 0 /* end of table */ .Lstart: .word _edata .word _ebss From owner-svn-src-head@FreeBSD.ORG Fri Feb 7 20:53:42 2014 Return-Path: Delivered-To: svn-src-head@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 318E5E0C; Fri, 7 Feb 2014 20:53: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 19C3617EB; Fri, 7 Feb 2014 20:53:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s17Krfbn007971; Fri, 7 Feb 2014 20:53:41 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s17KrfBm007968; Fri, 7 Feb 2014 20:53:41 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402072053.s17KrfBm007968@svn.freebsd.org> From: John Baldwin Date: Fri, 7 Feb 2014 20:53:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261607 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 20:53:42 -0000 Author: jhb Date: Fri Feb 7 20:53:41 2014 New Revision: 261607 URL: http://svnweb.freebsd.org/changeset/base/261607 Log: Mark the I/O ports used by the bhyve console and debug devices as system resources. MFC after: 1 week Modified: head/usr.sbin/bhyve/consport.c head/usr.sbin/bhyve/dbgport.c Modified: head/usr.sbin/bhyve/consport.c ============================================================================== --- head/usr.sbin/bhyve/consport.c Fri Feb 7 19:15:25 2014 (r261606) +++ head/usr.sbin/bhyve/consport.c Fri Feb 7 20:53:41 2014 (r261607) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include "inout.h" +#include "pci_lpc.h" #define BVM_CONSOLE_PORT 0x220 #define BVM_CONS_SIG ('b' << 8 | 'v') @@ -125,6 +126,8 @@ console_handler(struct vmctx *ctx, int v return (0); } +SYSRES_IO(BVM_CONSOLE_PORT, 4); + static struct inout_port consport = { "bvmcons", BVM_CONSOLE_PORT, Modified: head/usr.sbin/bhyve/dbgport.c ============================================================================== --- head/usr.sbin/bhyve/dbgport.c Fri Feb 7 19:15:25 2014 (r261606) +++ head/usr.sbin/bhyve/dbgport.c Fri Feb 7 20:53:41 2014 (r261607) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include "inout.h" #include "dbgport.h" +#include "pci_lpc.h" #define BVM_DBG_PORT 0x224 #define BVM_DBG_SIG ('B' << 8 | 'V') @@ -110,6 +111,8 @@ static struct inout_port dbgport = { dbg_handler }; +SYSRES_IO(BVM_DBG_PORT, 4); + void init_dbgport(int sport) { From owner-svn-src-head@FreeBSD.ORG Fri Feb 7 21:17:21 2014 Return-Path: Delivered-To: svn-src-head@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 6FB86514; Fri, 7 Feb 2014 21:17:21 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5938E19CF; Fri, 7 Feb 2014 21:17:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s17LHLQ8016616; Fri, 7 Feb 2014 21:17:21 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s17LHLMi016615; Fri, 7 Feb 2014 21:17:21 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201402072117.s17LHLMi016615@svn.freebsd.org> From: Dimitry Andric Date: Fri, 7 Feb 2014 21:17:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261608 - head/contrib/libc++/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 21:17:21 -0000 Author: dim Date: Fri Feb 7 21:17:20 2014 New Revision: 261608 URL: http://svnweb.freebsd.org/changeset/base/261608 Log: Apply a cleaner solution for the sign warnings that can occur when compiling libc++'s header with -Wsystem-headers on. This has also been submitted upstream. Reported by: asomers Modified: head/contrib/libc++/include/locale Modified: head/contrib/libc++/include/locale ============================================================================== --- head/contrib/libc++/include/locale Fri Feb 7 20:53:41 2014 (r261607) +++ head/contrib/libc++/include/locale Fri Feb 7 21:17:20 2014 (r261608) @@ -1012,7 +1012,7 @@ num_get<_CharT, _InputIterator>::__do_ge unsigned __dc = 0; for (; __b != __e; ++__b) { - if (__a_end - __a == (long)__buf.size()) + if (__a_end == __a + __buf.size()) { size_t __tmp = __buf.size(); __buf.resize(2*__buf.size()); @@ -1062,7 +1062,7 @@ num_get<_CharT, _InputIterator>::__do_ge unsigned __dc = 0; for (; __b != __e; ++__b) { - if (__a_end - __a == (long)__buf.size()) + if (__a_end == __a + __buf.size()) { size_t __tmp = __buf.size(); __buf.resize(2*__buf.size()); @@ -1116,7 +1116,7 @@ num_get<_CharT, _InputIterator>::__do_ge char __exp = 'E'; for (; __b != __e; ++__b) { - if (__a_end - __a == (long)__buf.size()) + if (__a_end == __a + __buf.size()) { size_t __tmp = __buf.size(); __buf.resize(2*__buf.size()); @@ -1166,7 +1166,7 @@ num_get<_CharT, _InputIterator>::do_get( unsigned __dc = 0; for (; __b != __e; ++__b) { - if (__a_end - __a == (long)__buf.size()) + if (__a_end == __a + __buf.size()) { size_t __tmp = __buf.size(); __buf.resize(2*__buf.size()); From owner-svn-src-head@FreeBSD.ORG Fri Feb 7 21:28:01 2014 Return-Path: Delivered-To: svn-src-head@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 ED8A1C03; Fri, 7 Feb 2014 21:28:01 +0000 (UTC) Received: from mail-wg0-x22e.google.com (mail-wg0-x22e.google.com [IPv6:2a00:1450:400c:c00::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 147F21AC5; Fri, 7 Feb 2014 21:28:00 +0000 (UTC) Received: by mail-wg0-f46.google.com with SMTP id x12so2624267wgg.13 for ; Fri, 07 Feb 2014 13:27:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=R3iUhP7mS/n+21d8OF+3ZrmSsLlE1kkrdjZeHUneNPQ=; b=Xo5aNEpe2L7jRj7DZAiPbL1Y38v+byXbASrujvstcpygsjTdZxBQX3rKD1gNedGbMw XVSykt1Au0dgC+tjkGqtfbDav7k62JxhXu9Z4WjIu7FFDKbqjTw8km6JK2YRrShJ9doZ wkjdlgpnS/kRu9hSd19vEu1gHZus+2djowpa3zVgKuBu/vm51G8+IQJ2uytSINS6rcl9 Bp2BmsG8ikGoHj8q2wMZc5718zF8ugLQ2a/ICfnTJR5ynJFxyU+tqOyg2OoN8KMAx6zS /N1ksequruBJPKve6ec16zxa3Mloqqaa3IQezw/anfvtXyS6xBSSammI9puzsX4FWpZt UqXQ== MIME-Version: 1.0 X-Received: by 10.194.110.41 with SMTP id hx9mr12617981wjb.28.1391808478906; Fri, 07 Feb 2014 13:27:58 -0800 (PST) Sender: edschouten@gmail.com Received: by 10.194.177.169 with HTTP; Fri, 7 Feb 2014 13:27:58 -0800 (PST) In-Reply-To: <20140207171025.d33b95770f6b0d7d00b4aab3@freebsd.org> References: <201402071239.s17CdwIH007683@svn.freebsd.org> <20140207171025.d33b95770f6b0d7d00b4aab3@freebsd.org> Date: Fri, 7 Feb 2014 22:27:58 +0100 X-Google-Sender-Auth: PzNFTJ3H8taeKQ9cQmzyPXMWVG4 Message-ID: Subject: Re: svn commit: r261585 - head/sys/dev/vt/hw/vga From: Ed Schouten To: Aleksandr Rybalko Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 21:28:02 -0000 Hi Aleksandr, On 7 February 2014 16:10, Aleksandr Rybalko wrote: > On Fri, 7 Feb 2014 15:04:47 +0100 > Ed Schouten wrote: >> On 7 February 2014 13:39, Aleksandr Rybalko wrote: > Also people asking me about advanced features of vt(9), like use > multiple displays. I'm not sure, but signed coordinates may help with > some things on that way (or makes more problems :) ). But if you were to have multiple displays, you should have separate coordinate systems per display. It should not be seen as a single pane. >> Furthermore, I think it's a bit weird that vga_bitbltchr() contains >> explicit bounds checking. What happened there? I remember at one point >> in time, we had the nice invariant that vt(9) never attempted to draw >> outside of the display resolution. What caused us to give up on that? > > Mouse cursor allowed to partially go out of screen, so we have to check > (or use special function for mouse cursor). Well, that's a compelling argument. Still, it's a bit weird then that the bitblt function itself does not take signed coordinates. Would it make sense to bring that in sync then? -- Ed Schouten From owner-svn-src-head@FreeBSD.ORG Fri Feb 7 21:34:10 2014 Return-Path: Delivered-To: svn-src-head@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 6100DE1B; Fri, 7 Feb 2014 21:34: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4D24C1B88; Fri, 7 Feb 2014 21:34:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s17LYAJG023972; Fri, 7 Feb 2014 21:34:10 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s17LYA4C023971; Fri, 7 Feb 2014 21:34:10 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201402072134.s17LYA4C023971@svn.freebsd.org> From: Dimitry Andric Date: Fri, 7 Feb 2014 21:34:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261609 - head/contrib/libcxxrt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 21:34:10 -0000 Author: dim Date: Fri Feb 7 21:34:09 2014 New Revision: 261609 URL: http://svnweb.freebsd.org/changeset/base/261609 Log: Pull in upstream libcxxrt commit 8006101, which makes its cxxabi.h file compilable just by itself. PR: kern/184019 MFC after: 3 days Modified: head/contrib/libcxxrt/cxxabi.h Modified: head/contrib/libcxxrt/cxxabi.h ============================================================================== --- head/contrib/libcxxrt/cxxabi.h Fri Feb 7 21:17:20 2014 (r261608) +++ head/contrib/libcxxrt/cxxabi.h Fri Feb 7 21:34:09 2014 (r261609) @@ -22,6 +22,7 @@ #ifndef __CXXABI_H_ #define __CXXABI_H_ +#include #include #include "unwind.h" namespace std From owner-svn-src-head@FreeBSD.ORG Fri Feb 7 21:56:17 2014 Return-Path: Delivered-To: svn-src-head@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 34E9B696; Fri, 7 Feb 2014 21:56: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1CE631D2F; Fri, 7 Feb 2014 21:56:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s17LuGNX031806; Fri, 7 Feb 2014 21:56:16 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s17LuGe1031805; Fri, 7 Feb 2014 21:56:16 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201402072156.s17LuGe1031805@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 7 Feb 2014 21:56:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261610 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 21:56:17 -0000 Author: glebius Date: Fri Feb 7 21:56:16 2014 New Revision: 261610 URL: http://svnweb.freebsd.org/changeset/base/261610 Log: Remove unused defines. Modified: head/sys/net/flowtable.c Modified: head/sys/net/flowtable.c ============================================================================== --- head/sys/net/flowtable.c Fri Feb 7 21:34:09 2014 (r261609) +++ head/sys/net/flowtable.c Fri Feb 7 21:56:16 2014 (r261610) @@ -122,13 +122,6 @@ struct flentry_v6 { union ipv6_flow fl_flow; }; -#define fl_fhash fl_entry.fl_fhash -#define fl_flags fl_entry.fl_flags -#define fl_proto fl_entry.fl_proto -#define fl_uptime fl_entry.fl_uptime -#define fl_rt fl_entry.fl_rt -#define fl_lle fl_entry.fl_lle - #define SECS_PER_HOUR 3600 #define SECS_PER_DAY (24*SECS_PER_HOUR) From owner-svn-src-head@FreeBSD.ORG Fri Feb 7 22:04:57 2014 Return-Path: Delivered-To: svn-src-head@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 45D2C873; Fri, 7 Feb 2014 22:04: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2F7151DDC; Fri, 7 Feb 2014 22:04:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s17M4vob035657; Fri, 7 Feb 2014 22:04:57 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s17M4v8Y035656; Fri, 7 Feb 2014 22:04:57 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402072204.s17M4v8Y035656@svn.freebsd.org> From: Christian Brueffer Date: Fri, 7 Feb 2014 22:04:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261611 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 22:04:57 -0000 Author: brueffer Date: Fri Feb 7 22:04:56 2014 New Revision: 261611 URL: http://svnweb.freebsd.org/changeset/base/261611 Log: Add some context for the "kldload sem" command; minor other improvements. PR: 183650 Submitted by: Bjorn Heidotting MFC after: 1 week Modified: head/share/man/man4/sem.4 Modified: head/share/man/man4/sem.4 ============================================================================== --- head/share/man/man4/sem.4 Fri Feb 7 21:56:16 2014 (r261610) +++ head/share/man/man4/sem.4 Fri Feb 7 22:04:56 2014 (r261611) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 3, 2011 +.Dd February 7, 2014 .Dt SEM 4 .Os .Sh NAME @@ -32,7 +32,7 @@ .Nd POSIX semaphores .Sh SYNOPSIS To compile this driver into the kernel, -place the following lines in your +place the following line in your kernel configuration file: .Bd -ragged -offset indent .Cd "options P1003_1B_SEMAPHORES" @@ -45,7 +45,11 @@ module at boot time, place the following sem_load="YES" .Ed .Pp -.Dl "kldload sem" +To load the driver as a module at run-time, run the following +command as root: +.Bd -ragged -offset indent +kldload sem +.Ed .Sh DESCRIPTION The .Nm From owner-svn-src-head@FreeBSD.ORG Fri Feb 7 22:10:43 2014 Return-Path: Delivered-To: svn-src-head@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 992C6A2E for ; Fri, 7 Feb 2014 22:10:43 +0000 (UTC) Received: from mail-ee0-f41.google.com (mail-ee0-f41.google.com [74.125.83.41]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 277061DFF for ; Fri, 7 Feb 2014 22:10:42 +0000 (UTC) Received: by mail-ee0-f41.google.com with SMTP id e51so1532795eek.14 for ; Fri, 07 Feb 2014 14:10:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type:subject:from:date:to:cc :message-id; bh=V+21M2kYZtx4CvKOewsFCRT4LBdZvwDmHiHSpxmOBsM=; b=DhkwTjGrw9m008efPQ3aewCNc4tODMZWoO5coyUMSotIAVwA7TINCz/SfCqiYLTChn pEgaKbDEmcZekSRFSaijvWfSUQ4lDkuorSIjlWyHPuxshFylFixWOEbxLLL5FKbv5JN9 XniT0aj8OleCT7APJzHYnghMXgQXCIjvIsffuiPaJAYEXpubTUtV8357qMjDa8BI0eJA jBgU5dUiKHVRwONOstcdyi9StvlilALgW7j1UFkdULjcZHCjENKu54VGFzqLze7rQheO dd2M2LecWSVilDbN0ZK5dqGileUfSMi5SUymxwSYXJC6aR15UM16JjP03GCrh3duHdgi myEw== X-Gm-Message-State: ALoCoQkcEljdcSvOXHgwgZl1QZlUicR06zwG8x3ALS9GDeU8r1/JXQ3exiJ3wFXIup2xvU+rC7bw X-Received: by 10.15.26.8 with SMTP id m8mr19372879eeu.25.1391809515119; Fri, 07 Feb 2014 13:45:15 -0800 (PST) Received: from [192.168.1.81] (87-94-133-95.pool.ukrtel.net. [95.133.94.87]) by mx.google.com with ESMTPSA id k6sm21213010eep.17.2014.02.07.13.45.12 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 07 Feb 2014 13:45:13 -0800 (PST) User-Agent: K-9 Mail for Android In-Reply-To: References: <201402071239.s17CdwIH007683@svn.freebsd.org> <20140207171025.d33b95770f6b0d7d00b4aab3@freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Subject: Re: svn commit: r261585 - head/sys/dev/vt/hw/vga From: Aleksandr Rybalko Date: Fri, 07 Feb 2014 23:44:54 +0200 To: Ed Schouten ,Aleksandr Rybalko Message-ID: Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 22:10:43 -0000 On 7 лютого 2014 р. 23:27:58 GMT+02:00, Ed Schouten wrote: >Hi Aleksandr, > >On 7 February 2014 16:10, Aleksandr Rybalko wrote: >> On Fri, 7 Feb 2014 15:04:47 +0100 >> Ed Schouten wrote: >>> On 7 February 2014 13:39, Aleksandr Rybalko wrote: >> Also people asking me about advanced features of vt(9), like use >> multiple displays. I'm not sure, but signed coordinates may help with >> some things on that way (or makes more problems :) ). > >But if you were to have multiple displays, you should have separate >coordinate systems per display. It should not be seen as a single >pane. I don't really know yet how that will be implemented. :-) > >>> Furthermore, I think it's a bit weird that vga_bitbltchr() contains >>> explicit bounds checking. What happened there? I remember at one >point >>> in time, we had the nice invariant that vt(9) never attempted to >draw >>> outside of the display resolution. What caused us to give up on >that? >> >> Mouse cursor allowed to partially go out of screen, so we have to >check >> (or use special function for mouse cursor). > >Well, that's a compelling argument. Still, it's a bit weird then that >the bitblt function itself does not take signed coordinates. Would it >make sense to bring that in sync then? Yup, this is good idea to sync them. Will do that a bit later. Thanks a lot Ed! Let me know if you will have something more. WBW ------ Aleksandr Rybalko From owner-svn-src-head@FreeBSD.ORG Fri Feb 7 22:15:48 2014 Return-Path: Delivered-To: svn-src-head@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 C5BFCAA3; Fri, 7 Feb 2014 22:15:48 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B062A1F8E; Fri, 7 Feb 2014 22:15:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s17MFmd9039933; Fri, 7 Feb 2014 22:15:48 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s17MFmJI039932; Fri, 7 Feb 2014 22:15:48 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201402072215.s17MFmJI039932@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 7 Feb 2014 22:15:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261612 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 22:15:48 -0000 Author: pjd Date: Fri Feb 7 22:15:48 2014 New Revision: 261612 URL: http://svnweb.freebsd.org/changeset/base/261612 Log: Add cross-references to casperd(8) and libcapsicum(3). Suggested by: rwatson Modified: head/share/man/man4/capsicum.4 Modified: head/share/man/man4/capsicum.4 ============================================================================== --- head/share/man/man4/capsicum.4 Fri Feb 7 22:04:56 2014 (r261611) +++ head/share/man/man4/capsicum.4 Fri Feb 7 22:15:48 2014 (r261612) @@ -104,7 +104,9 @@ associated with file descriptors; descri .Xr shm_open 2 , .Xr write 2 , .Xr cap_rights_get 3 , -.Xr procdesc 4 +.Xr libcapsicum 3 , +.Xr procdesc 4 , +.Xr casperd 8 .Sh HISTORY .Nm first appeared in From owner-svn-src-head@FreeBSD.ORG Fri Feb 7 22:30:42 2014 Return-Path: Delivered-To: svn-src-head@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 ED154EDF; Fri, 7 Feb 2014 22:30: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BA226108B; Fri, 7 Feb 2014 22:30:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s17MUgZu044741; Fri, 7 Feb 2014 22:30:42 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s17MUgHQ044740; Fri, 7 Feb 2014 22:30:42 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201402072230.s17MUgHQ044740@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 7 Feb 2014 22:30:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261613 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 22:30:43 -0000 Author: glebius Date: Fri Feb 7 22:30:42 2014 New Revision: 261613 URL: http://svnweb.freebsd.org/changeset/base/261613 Log: Fix comment. Modified: head/sys/net/flowtable.h Modified: head/sys/net/flowtable.h ============================================================================== --- head/sys/net/flowtable.h Fri Feb 7 22:15:48 2014 (r261612) +++ head/sys/net/flowtable.h Fri Feb 7 22:30:42 2014 (r261613) @@ -75,4 +75,4 @@ void flow_to_route_in6(struct flentry *f #endif #endif /* _KERNEL */ -#endif /* _NET_FLOWTABLE_H_ */ +#endif /* !_NET_FLOWTABLE_H_ */ From owner-svn-src-head@FreeBSD.ORG Fri Feb 7 22:49:43 2014 Return-Path: Delivered-To: svn-src-head@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 B2703610; Fri, 7 Feb 2014 22:49:43 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8EB6E11F9; Fri, 7 Feb 2014 22:49:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s17Mnh8m051989; Fri, 7 Feb 2014 22:49:43 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s17MngXF051984; Fri, 7 Feb 2014 22:49:42 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201402072249.s17MngXF051984@svn.freebsd.org> From: Ed Maste Date: Fri, 7 Feb 2014 22:49:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261614 - in head/sys/boot: . powerpc/ofw powerpc/ps3 powerpc/uboot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 22:49:43 -0000 Author: emaste Date: Fri Feb 7 22:49:42 2014 New Revision: 261614 URL: http://svnweb.freebsd.org/changeset/base/261614 Log: Build a 32-bit libstand under sys/boot/ for ppc64 This change is equivalent to r261567 for i386/amd64. Sponsored by: The FreeBSD Foundation Modified: head/sys/boot/Makefile.powerpc head/sys/boot/powerpc/ofw/Makefile head/sys/boot/powerpc/ps3/Makefile head/sys/boot/powerpc/uboot/Makefile Modified: head/sys/boot/Makefile.powerpc ============================================================================== --- head/sys/boot/Makefile.powerpc Fri Feb 7 22:30:42 2014 (r261613) +++ head/sys/boot/Makefile.powerpc Fri Feb 7 22:49:42 2014 (r261614) @@ -4,5 +4,6 @@ SUBDIR+= fdt .endif +SUBDIR+= libstand32 SUBDIR+= ofw SUBDIR+= uboot Modified: head/sys/boot/powerpc/ofw/Makefile ============================================================================== --- head/sys/boot/powerpc/ofw/Makefile Fri Feb 7 22:30:42 2014 (r261613) +++ head/sys/boot/powerpc/ofw/Makefile Fri Feb 7 22:49:42 2014 (r261614) @@ -89,10 +89,11 @@ LIBOFW= ${.OBJDIR}/../../ofw/libofw/lib CFLAGS+= -I${.CURDIR}/../../ofw/libofw # where to get libstand from +LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ DPADD= ${LIBFICL} ${LIBOFW} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBOFW} -lstand +LDADD= ${LIBFICL} ${LIBOFW} ${LIBSTAND} vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} Modified: head/sys/boot/powerpc/ps3/Makefile ============================================================================== --- head/sys/boot/powerpc/ps3/Makefile Fri Feb 7 22:30:42 2014 (r261613) +++ head/sys/boot/powerpc/ps3/Makefile Fri Feb 7 22:49:42 2014 (r261614) @@ -95,10 +95,11 @@ CFLAGS+= -Wa,-mppc64bridge #.include "${.CURDIR}/../../ofw/common/Makefile.inc" # where to get libstand from +LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ DPADD= ${LIBFICL} ${LIBOFW} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBOFW} -lstand +LDADD= ${LIBFICL} ${LIBOFW} ${LIBSTAND} SC_DFLT_FONT=cp437 Modified: head/sys/boot/powerpc/uboot/Makefile ============================================================================== --- head/sys/boot/powerpc/uboot/Makefile Fri Feb 7 22:30:42 2014 (r261613) +++ head/sys/boot/powerpc/uboot/Makefile Fri Feb 7 22:49:42 2014 (r261614) @@ -95,10 +95,11 @@ CFLAGS+= -I${.CURDIR}/../../uboot/lib CFLAGS+= -I${.OBJDIR}/../../uboot/lib # where to get libstand from +LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} -lstand +LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBSTAND} vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} From owner-svn-src-head@FreeBSD.ORG Sat Feb 8 00:20:21 2014 Return-Path: Delivered-To: svn-src-head@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 A88F779A; Sat, 8 Feb 2014 00:20:21 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 94EA818FD; Sat, 8 Feb 2014 00:20:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s180KLvI088427; Sat, 8 Feb 2014 00:20:21 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s180KL7J088426; Sat, 8 Feb 2014 00:20:21 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201402080020.s180KL7J088426@svn.freebsd.org> From: Alan Somers Date: Sat, 8 Feb 2014 00:20:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261615 - head/tests/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Feb 2014 00:20:21 -0000 Author: asomers Date: Sat Feb 8 00:20:21 2014 New Revision: 261615 URL: http://svnweb.freebsd.org/changeset/base/261615 Log: tests/sys/Makefile use TESTS_SUBDIRS for kern instead of SUBDIRS. I don't think it makes a difference in this case, but TESTS_SUBDIRS is generally correct for subdirectories that contain tests. Sponsored by: Spectra Logic MFC after: 5 days X-MFC-With: r261133 Modified: head/tests/sys/Makefile Modified: head/tests/sys/Makefile ============================================================================== --- head/tests/sys/Makefile Fri Feb 7 22:49:42 2014 (r261614) +++ head/tests/sys/Makefile Sat Feb 8 00:20:21 2014 (r261615) @@ -2,13 +2,11 @@ .include -SUBDIR= kern +.PATH: ${.CURDIR}/.. + +TESTS_SUBDIRS+= kern TESTSDIR= ${TESTSBASE}/sys KYUAFILE= yes -CLEANFILES+= Kyuafile -Kyuafile: ${.CURDIR}/../Kyuafile - cp -f ${.CURDIR}/../Kyuafile . - .include From owner-svn-src-head@FreeBSD.ORG Sat Feb 8 04:29:37 2014 Return-Path: Delivered-To: svn-src-head@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 85B46B00; Sat, 8 Feb 2014 04:29:37 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6FF6A159B; Sat, 8 Feb 2014 04:29:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s184Tbgt085881; Sat, 8 Feb 2014 04:29:37 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s184TbNi085878; Sat, 8 Feb 2014 04:29:37 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201402080429.s184TbNi085878@svn.freebsd.org> From: Warner Losh Date: Sat, 8 Feb 2014 04:29:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261616 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Feb 2014 04:29:37 -0000 Author: imp Date: Sat Feb 8 04:29:36 2014 New Revision: 261616 URL: http://svnweb.freebsd.org/changeset/base/261616 Log: Remove FreeBSD 6 support Modified: head/sys/dev/usb/controller/at91dci_atmelarm.c head/sys/dev/usb/controller/ohci_atmelarm.c Modified: head/sys/dev/usb/controller/at91dci_atmelarm.c ============================================================================== --- head/sys/dev/usb/controller/at91dci_atmelarm.c Sat Feb 8 00:20:21 2014 (r261615) +++ head/sys/dev/usb/controller/at91dci_atmelarm.c Sat Feb 8 04:29:36 2014 (r261616) @@ -212,13 +212,8 @@ at91_udp_attach(device_t dev) } device_set_ivars(sc->sc_dci.sc_bus.bdev, &sc->sc_dci.sc_bus); -#if (__FreeBSD_version >= 700031) err = bus_setup_intr(dev, sc->sc_dci.sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, NULL, (driver_intr_t *)at91dci_interrupt, sc, &sc->sc_dci.sc_intr_hdl); -#else - err = bus_setup_intr(dev, sc->sc_dci.sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, - (driver_intr_t *)at91dci_interrupt, sc, &sc->sc_dci.sc_intr_hdl); -#endif if (err) { sc->sc_dci.sc_intr_hdl = NULL; goto error; Modified: head/sys/dev/usb/controller/ohci_atmelarm.c ============================================================================== --- head/sys/dev/usb/controller/ohci_atmelarm.c Sat Feb 8 00:20:21 2014 (r261615) +++ head/sys/dev/usb/controller/ohci_atmelarm.c Sat Feb 8 04:29:36 2014 (r261616) @@ -131,13 +131,8 @@ ohci_atmelarm_attach(device_t dev) strlcpy(sc->sc_ohci.sc_vendor, "Atmel", sizeof(sc->sc_ohci.sc_vendor)); -#if (__FreeBSD_version >= 700031) err = bus_setup_intr(dev, sc->sc_ohci.sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, NULL, (driver_intr_t *)ohci_interrupt, sc, &sc->sc_ohci.sc_intr_hdl); -#else - err = bus_setup_intr(dev, sc->sc_ohci.sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, - (driver_intr_t *)ohci_interrupt, sc, &sc->sc_ohci.sc_intr_hdl); -#endif if (err) { sc->sc_ohci.sc_intr_hdl = NULL; goto error; From owner-svn-src-head@FreeBSD.ORG Sat Feb 8 05:04:35 2014 Return-Path: Delivered-To: svn-src-head@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 0A0F3F0C; Sat, 8 Feb 2014 05:04:35 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E93F01841; Sat, 8 Feb 2014 05:04:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1854YG5000713; Sat, 8 Feb 2014 05:04:34 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1854YeY000712; Sat, 8 Feb 2014 05:04:34 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201402080504.s1854YeY000712@svn.freebsd.org> From: Neel Natu Date: Sat, 8 Feb 2014 05:04:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261617 - head/sys/amd64/vmm/intel X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Feb 2014 05:04:35 -0000 Author: neel Date: Sat Feb 8 05:04:34 2014 New Revision: 261617 URL: http://svnweb.freebsd.org/changeset/base/261617 Log: Fix a bug in the handling of VM-exits caused by non-maskable interrupts (NMI). If a VM-exit is caused by an NMI then "blocking by NMI" is in effect on the CPU when the VM-exit is completed. No more NMIs will be recognized until the execution of an "iret". Prior to this change the NMI handler was dispatched via a software interrupt with interrupts enabled. This meant that an interrupt could be recognized by the processor before the NMI handler completed its execution. The "iret" issued by the interrupt handler would then cause the "blocking by NMI" to be cleared prematurely. This is now fixed by handling the NMI with interrupts disabled in addition to "blocking by NMI" already established by the VM-exit. Modified: head/sys/amd64/vmm/intel/vmx.c Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Sat Feb 8 04:29:36 2014 (r261616) +++ head/sys/amd64/vmm/intel/vmx.c Sat Feb 8 05:04:34 2014 (r261617) @@ -1719,19 +1719,10 @@ vmx_exit_process(struct vmx *vmx, int vc vmx_restore_nmi_blocking(vmx, vcpu); /* - * If the NMI-exiting VM execution control is set to '1' - * then an NMI in non-root operation causes a VM-exit. - * NMI blocking is in effect for this logical processor so - * it is sufficient to simply vector to the NMI handler via - * a software interrupt. + * The NMI has already been handled in vmx_exit_handle_nmi(). */ - if ((intr_info & VMCS_INTR_T_MASK) == VMCS_INTR_T_NMI) { - KASSERT((intr_info & 0xff) == IDT_NMI, ("VM exit due " - "to NMI has invalid vector: %#x", intr_info)); - VCPU_CTR0(vmx->vm, vcpu, "Vectoring to NMI handler"); - __asm __volatile("int $2"); + if ((intr_info & VMCS_INTR_T_MASK) == VMCS_INTR_T_NMI) return (1); - } break; case EXIT_REASON_EPT_FAULT: vmm_stat_incr(vmx->vm, vcpu, VMEXIT_EPT_FAULT, 1); @@ -1874,6 +1865,36 @@ vmx_exit_inst_error(struct vmxctx *vmxct return (UNHANDLED); } +/* + * If the NMI-exiting VM execution control is set to '1' then an NMI in + * non-root operation causes a VM-exit. NMI blocking is in effect so it is + * sufficient to simply vector to the NMI handler via a software interrupt. + * However, this must be done before maskable interrupts are enabled + * otherwise the "iret" issued by an interrupt handler will incorrectly + * clear NMI blocking. + */ +static __inline void +vmx_exit_handle_nmi(struct vmx *vmx, int vcpuid, struct vm_exit *vmexit) +{ + uint32_t intr_info; + + KASSERT((read_rflags() & PSL_I) == 0, ("interrupts enabled")); + + if (vmexit->u.vmx.exit_reason != EXIT_REASON_EXCEPTION) + return; + + intr_info = vmcs_read(VMCS_EXIT_INTR_INFO); + KASSERT((intr_info & VMCS_INTR_VALID) != 0, + ("VM exit interruption info invalid: %#x", intr_info)); + + if ((intr_info & VMCS_INTR_T_MASK) == VMCS_INTR_T_NMI) { + KASSERT((intr_info & 0xff) == IDT_NMI, ("VM exit due " + "to NMI has invalid vector: %#x", intr_info)); + VCPU_CTR0(vmx->vm, vcpuid, "Vectoring to NMI handler"); + __asm __volatile("int $2"); + } +} + static int vmx_run(void *arg, int vcpu, register_t startrip, pmap_t pmap, void *rendezvous_cookie) @@ -1949,8 +1970,6 @@ vmx_run(void *arg, int vcpu, register_t vmx_run_trace(vmx, vcpu); rc = vmx_enter_guest(vmxctx, vmx, launched); - enable_intr(); - /* Collect some information for VM exit processing */ vmexit->rip = rip = vmcs_guest_rip(); vmexit->inst_length = vmexit_instruction_length(); @@ -1958,12 +1977,14 @@ vmx_run(void *arg, int vcpu, register_t vmexit->u.vmx.exit_qualification = vmcs_exit_qualification(); if (rc == VMX_GUEST_VMEXIT) { - launched = 1; + vmx_exit_handle_nmi(vmx, vcpu, vmexit); + enable_intr(); handled = vmx_exit_process(vmx, vcpu, vmexit); } else { + enable_intr(); handled = vmx_exit_inst_error(vmxctx, rc, vmexit); } - + launched = 1; vmx_exit_trace(vmx, vcpu, rip, exit_reason, handled); } while (handled); From owner-svn-src-head@FreeBSD.ORG Sat Feb 8 05:17:50 2014 Return-Path: Delivered-To: svn-src-head@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 1177D17C; Sat, 8 Feb 2014 05:17:50 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F198E18DB; Sat, 8 Feb 2014 05:17:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s185Hn9f005147; Sat, 8 Feb 2014 05:17:49 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s185HnTx005146; Sat, 8 Feb 2014 05:17:49 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201402080517.s185HnTx005146@svn.freebsd.org> From: Xin LI Date: Sat, 8 Feb 2014 05:17:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261618 - head/sys/geom/eli X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Feb 2014 05:17:50 -0000 Author: delphij Date: Sat Feb 8 05:17:49 2014 New Revision: 261618 URL: http://svnweb.freebsd.org/changeset/base/261618 Log: In g_eli_crypto_hmac_init(), zero out after using the ipad buffer, k_ipad. Note that the two consumers in geli(4) are not affected by this issue because the way the code is constructed and as such, we believe there is no security impact with or without this change with geli(4)'s usage. Reported by: Serge van den Boom Reviewed by: pjd MFC after: 2 weeks Modified: head/sys/geom/eli/g_eli_crypto.c Modified: head/sys/geom/eli/g_eli_crypto.c ============================================================================== --- head/sys/geom/eli/g_eli_crypto.c Sat Feb 8 05:04:34 2014 (r261617) +++ head/sys/geom/eli/g_eli_crypto.c Sat Feb 8 05:17:49 2014 (r261618) @@ -265,6 +265,7 @@ g_eli_crypto_hmac_init(struct hmac_ctx * /* Perform inner SHA512. */ SHA512_Init(&ctx->shactx); SHA512_Update(&ctx->shactx, k_ipad, sizeof(k_ipad)); + bzero(k_ipad, sizeof(k_ipad)); } void From owner-svn-src-head@FreeBSD.ORG Sat Feb 8 05:35:36 2014 Return-Path: Delivered-To: svn-src-head@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 A6B5B697; Sat, 8 Feb 2014 05:35:36 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 91FB31A4A; Sat, 8 Feb 2014 05:35:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s185Zamo012543; Sat, 8 Feb 2014 05:35:36 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s185ZaAl012542; Sat, 8 Feb 2014 05:35:36 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201402080535.s185ZaAl012542@svn.freebsd.org> From: Xin LI Date: Sat, 8 Feb 2014 05:35:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261620 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Feb 2014 05:35:36 -0000 Author: delphij Date: Sat Feb 8 05:35:36 2014 New Revision: 261620 URL: http://svnweb.freebsd.org/changeset/base/261620 Log: MFV r261619: 4574 get_clones_stat does not call zap_count in non-debug kernel zap_count(...) is never called in non-DEBUG kernel. As result "count" variable is always 0, and "goto fail" is always reached. This means get_clones_stat function never makes up list of clones for "clones" properties. MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Sat Feb 8 05:30:33 2014 (r261619) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Sat Feb 8 05:35:36 2014 (r261620) @@ -20,9 +20,10 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Portions Copyright (c) 2011 Martin Matuska * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. - * Portions Copyright (c) 2011 Martin Matuska + * Copyright (c) 2014 RackTop Systems. */ #include @@ -1424,7 +1425,7 @@ get_clones_stat(dsl_dataset_t *ds, nvlis * Only trust it if it has the right number of entries. */ if (ds->ds_phys->ds_next_clones_obj != 0) { - ASSERT0(zap_count(mos, ds->ds_phys->ds_next_clones_obj, + VERIFY0(zap_count(mos, ds->ds_phys->ds_next_clones_obj, &count)); } if (count != ds->ds_phys->ds_num_children - 1) From owner-svn-src-head@FreeBSD.ORG Sat Feb 8 06:22:10 2014 Return-Path: Delivered-To: svn-src-head@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 65AAC9B8; Sat, 8 Feb 2014 06:22: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 420F91D1C; Sat, 8 Feb 2014 06:22:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s186MAk2031444; Sat, 8 Feb 2014 06:22:10 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s186M9xQ031440; Sat, 8 Feb 2014 06:22:09 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201402080622.s186M9xQ031440@svn.freebsd.org> From: Neel Natu Date: Sat, 8 Feb 2014 06:22:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261621 - in head/sys/amd64/vmm: . intel X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Feb 2014 06:22:10 -0000 Author: neel Date: Sat Feb 8 06:22:09 2014 New Revision: 261621 URL: http://svnweb.freebsd.org/changeset/base/261621 Log: Add a counter to differentiate between VM-exits due to nested paging faults and instruction emulation faults. Modified: head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/vmm_stat.c head/sys/amd64/vmm/vmm_stat.h Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Sat Feb 8 05:35:36 2014 (r261620) +++ head/sys/amd64/vmm/intel/vmx.c Sat Feb 8 06:22:09 2014 (r261621) @@ -1725,7 +1725,6 @@ vmx_exit_process(struct vmx *vmx, int vc return (1); break; case EXIT_REASON_EPT_FAULT: - vmm_stat_incr(vmx->vm, vcpu, VMEXIT_EPT_FAULT, 1); /* * If 'gpa' lies within the address space allocated to * memory then this must be a nested page fault otherwise @@ -1736,6 +1735,7 @@ vmx_exit_process(struct vmx *vmx, int vc vmexit->exitcode = VM_EXITCODE_PAGING; vmexit->u.paging.gpa = gpa; vmexit->u.paging.fault_type = ept_fault_type(qual); + vmm_stat_incr(vmx->vm, vcpu, VMEXIT_NESTED_FAULT, 1); } else if (ept_emulation_fault(qual)) { vmexit->exitcode = VM_EXITCODE_INST_EMUL; vmexit->u.inst_emul.gpa = gpa; @@ -1743,6 +1743,7 @@ vmx_exit_process(struct vmx *vmx, int vc vmexit->u.inst_emul.cr3 = vmcs_guest_cr3(); vmexit->u.inst_emul.cpu_mode = vmx_cpu_mode(); vmexit->u.inst_emul.paging_mode = vmx_paging_mode(); + vmm_stat_incr(vmx->vm, vcpu, VMEXIT_INST_EMUL, 1); } /* * If Virtual NMIs control is 1 and the VM-exit is due to an Modified: head/sys/amd64/vmm/vmm_stat.c ============================================================================== --- head/sys/amd64/vmm/vmm_stat.c Sat Feb 8 05:35:36 2014 (r261620) +++ head/sys/amd64/vmm/vmm_stat.c Sat Feb 8 06:22:09 2014 (r261621) @@ -146,7 +146,8 @@ VMM_STAT(VMEXIT_INTR_WINDOW, "vm exits d VMM_STAT(VMEXIT_NMI_WINDOW, "vm exits due to nmi window opening"); VMM_STAT(VMEXIT_INOUT, "number of times in/out was intercepted"); VMM_STAT(VMEXIT_CPUID, "number of times cpuid was intercepted"); -VMM_STAT(VMEXIT_EPT_FAULT, "vm exits due to nested page fault"); +VMM_STAT(VMEXIT_NESTED_FAULT, "vm exits due to nested page fault"); +VMM_STAT(VMEXIT_INST_EMUL, "vm exits for instruction emulation"); VMM_STAT(VMEXIT_UNKNOWN, "number of vm exits for unknown reason"); VMM_STAT(VMEXIT_ASTPENDING, "number of times astpending at exit"); VMM_STAT(VMEXIT_USERSPACE, "number of vm exits handled in userspace"); Modified: head/sys/amd64/vmm/vmm_stat.h ============================================================================== --- head/sys/amd64/vmm/vmm_stat.h Sat Feb 8 05:35:36 2014 (r261620) +++ head/sys/amd64/vmm/vmm_stat.h Sat Feb 8 06:22:09 2014 (r261621) @@ -116,7 +116,8 @@ VMM_STAT_DECLARE(VMEXIT_INTR_WINDOW); VMM_STAT_DECLARE(VMEXIT_NMI_WINDOW); VMM_STAT_DECLARE(VMEXIT_INOUT); VMM_STAT_DECLARE(VMEXIT_CPUID); -VMM_STAT_DECLARE(VMEXIT_EPT_FAULT); +VMM_STAT_DECLARE(VMEXIT_NESTED_FAULT); +VMM_STAT_DECLARE(VMEXIT_INST_EMUL); VMM_STAT_DECLARE(VMEXIT_UNKNOWN); VMM_STAT_DECLARE(VMEXIT_ASTPENDING); VMM_STAT_DECLARE(VMEXIT_USERSPACE); From owner-svn-src-head@FreeBSD.ORG Sat Feb 8 09:56:27 2014 Return-Path: Delivered-To: svn-src-head@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 BC2F1E14; Sat, 8 Feb 2014 09:56:27 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8AC131C18; Sat, 8 Feb 2014 09:56:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s189uRa7013535; Sat, 8 Feb 2014 09:56:27 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s189uRYp013533; Sat, 8 Feb 2014 09:56:27 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201402080956.s189uRYp013533@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 8 Feb 2014 09:56:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261627 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Feb 2014 09:56:27 -0000 Author: glebius Date: Sat Feb 8 09:56:26 2014 New Revision: 261627 URL: http://svnweb.freebsd.org/changeset/base/261627 Log: Remove never set flag FL_OVERWRITE. The only place where it was checked led to lock/critnest leak. Modified: head/sys/net/flowtable.c head/sys/net/pfvar.h Modified: head/sys/net/flowtable.c ============================================================================== --- head/sys/net/flowtable.c Sat Feb 8 09:50:02 2014 (r261626) +++ head/sys/net/flowtable.c Sat Feb 8 09:56:26 2014 (r261627) @@ -280,7 +280,6 @@ flowtable_pcpu_unlock(struct flowtable * #define FL_ENTRY_UNLOCK(table, hash) (table)->ft_unlock((table), (hash)) #define FL_STALE (1<<8) -#define FL_OVERWRITE (1<<10) static struct flentry *flowtable_lookup_common(struct flowtable *, struct sockaddr_storage *, struct sockaddr_storage *, struct mbuf *, int); @@ -833,8 +832,6 @@ flowtable_insert(struct flowtable *ft, u FL_ENTRY_UNLOCK(ft, hash); uma_zfree(ft->ft_zone, newfle); - if (flags & FL_OVERWRITE) - goto skip; return (EEXIST); } /* Modified: head/sys/net/pfvar.h ============================================================================== --- head/sys/net/pfvar.h Sat Feb 8 09:50:02 2014 (r261626) +++ head/sys/net/pfvar.h Sat Feb 8 09:56:26 2014 (r261627) @@ -1580,8 +1580,6 @@ extern struct pf_src_node *pf_find_src_n extern void pf_unlink_src_node(struct pf_src_node *); extern void pf_unlink_src_node_locked(struct pf_src_node *); extern u_int pf_free_src_nodes(struct pf_src_node_list *); -extern void pf_print_state(struct pf_state *); -extern void pf_print_flags(u_int8_t); extern u_int16_t pf_cksum_fixup(u_int16_t, u_int16_t, u_int16_t, u_int8_t); @@ -1744,8 +1742,6 @@ int pf_osfp_get(struct pf_osfp_ioctl *); int pf_osfp_match(struct pf_osfp_enlist *, pf_osfp_t); #ifdef _KERNEL -void pf_print_host(struct pf_addr *, u_int16_t, u_int8_t); - void pf_step_into_anchor(struct pf_anchor_stackframe *, int *, struct pf_ruleset **, int, struct pf_rule **, struct pf_rule **, int *); From owner-svn-src-head@FreeBSD.ORG Sat Feb 8 09:57:52 2014 Return-Path: Delivered-To: svn-src-head@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 E8D54F52; Sat, 8 Feb 2014 09:57:52 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D2F271C1E; Sat, 8 Feb 2014 09:57:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s189vqrG013744; Sat, 8 Feb 2014 09:57:52 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s189vqqJ013742; Sat, 8 Feb 2014 09:57:52 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201402080957.s189vqqJ013742@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 8 Feb 2014 09:57:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261628 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Feb 2014 09:57:53 -0000 Author: glebius Date: Sat Feb 8 09:57:52 2014 New Revision: 261628 URL: http://svnweb.freebsd.org/changeset/base/261628 Log: Revert accidentially leaked changes in r261627. Modified: head/sys/net/pfvar.h Modified: head/sys/net/pfvar.h ============================================================================== --- head/sys/net/pfvar.h Sat Feb 8 09:56:26 2014 (r261627) +++ head/sys/net/pfvar.h Sat Feb 8 09:57:52 2014 (r261628) @@ -1580,6 +1580,8 @@ extern struct pf_src_node *pf_find_src_n extern void pf_unlink_src_node(struct pf_src_node *); extern void pf_unlink_src_node_locked(struct pf_src_node *); extern u_int pf_free_src_nodes(struct pf_src_node_list *); +extern void pf_print_state(struct pf_state *); +extern void pf_print_flags(u_int8_t); extern u_int16_t pf_cksum_fixup(u_int16_t, u_int16_t, u_int16_t, u_int8_t); @@ -1742,6 +1744,8 @@ int pf_osfp_get(struct pf_osfp_ioctl *); int pf_osfp_match(struct pf_osfp_enlist *, pf_osfp_t); #ifdef _KERNEL +void pf_print_host(struct pf_addr *, u_int16_t, u_int8_t); + void pf_step_into_anchor(struct pf_anchor_stackframe *, int *, struct pf_ruleset **, int, struct pf_rule **, struct pf_rule **, int *); From owner-svn-src-head@FreeBSD.ORG Sat Feb 8 13:29:36 2014 Return-Path: Delivered-To: svn-src-head@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 5AB56FC3; Sat, 8 Feb 2014 13:29:36 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 429B01B7D; Sat, 8 Feb 2014 13:29:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s18DTaSJ096323; Sat, 8 Feb 2014 13:29:36 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s18DTa7u096322; Sat, 8 Feb 2014 13:29:36 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201402081329.s18DTa7u096322@svn.freebsd.org> From: Joel Dahl Date: Sat, 8 Feb 2014 13:29:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261633 - head/usr.bin/csplit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Feb 2014 13:29:36 -0000 Author: joel (doc committer) Date: Sat Feb 8 13:29:35 2014 New Revision: 261633 URL: http://svnweb.freebsd.org/changeset/base/261633 Log: Correct example. Submitted by: Jason McIntyre Thomas Klausner Modified: head/usr.bin/csplit/csplit.1 Modified: head/usr.bin/csplit/csplit.1 ============================================================================== --- head/usr.bin/csplit/csplit.1 Sat Feb 8 11:05:48 2014 (r261632) +++ head/usr.bin/csplit/csplit.1 Sat Feb 8 13:29:35 2014 (r261633) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 24, 2008 +.Dd February 6, 2014 .Dt CSPLIT 1 .Os .Sh NAME @@ -143,7 +143,7 @@ Split the .Xr mdoc 7 file .Pa foo.1 -into one file for each section (up to 20): +into one file for each section (up to 21 plus one for the rest, if any): .Pp .Dl "csplit -k foo.1 '%^\e.Sh%' '/^\e.Sh/' '{20}'" .Pp From owner-svn-src-head@FreeBSD.ORG Sat Feb 8 13:37:05 2014 Return-Path: Delivered-To: svn-src-head@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 259892CC; Sat, 8 Feb 2014 13:37:05 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0C2441C26; Sat, 8 Feb 2014 13:37:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s18Db4Ov099993; Sat, 8 Feb 2014 13:37:04 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s18Db2RO099982; Sat, 8 Feb 2014 13:37:02 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201402081337.s18Db2RO099982@svn.freebsd.org> From: Joel Dahl Date: Sat, 8 Feb 2014 13:37:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261634 - in head: usr.bin/chpass usr.bin/grep usr.bin/indent usr.bin/rpcgen usr.bin/whois usr.bin/xargs usr.sbin/bluetooth/btpand usr.sbin/ifmcstat usr.sbin/ppp usr.sbin/watchdogd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Feb 2014 13:37:05 -0000 Author: joel (doc committer) Date: Sat Feb 8 13:37:02 2014 New Revision: 261634 URL: http://svnweb.freebsd.org/changeset/base/261634 Log: mdoc: minor paragraph fixes. Modified: head/usr.bin/chpass/chpass.1 head/usr.bin/grep/grep.1 head/usr.bin/indent/indent.1 head/usr.bin/rpcgen/rpcgen.1 head/usr.bin/whois/whois.1 head/usr.bin/xargs/xargs.1 head/usr.sbin/bluetooth/btpand/btpand.8 head/usr.sbin/ifmcstat/ifmcstat.8 head/usr.sbin/ppp/ppp.8 head/usr.sbin/watchdogd/watchdogd.8 Modified: head/usr.bin/chpass/chpass.1 ============================================================================== --- head/usr.bin/chpass/chpass.1 Sat Feb 8 13:29:35 2014 (r261633) +++ head/usr.bin/chpass/chpass.1 Sat Feb 8 13:37:02 2014 (r261634) @@ -317,7 +317,6 @@ password -- see below) will be silently .Pp Exception: the super-user on the NIS master server is permitted to change any field. -.Pp .It .Em "Password authentication is required" . The @@ -433,7 +432,6 @@ option can be used in conjunction with t .Fl d option, in which case the user-specified hostname will override the default. -.Pp .It Fl o Force the use of RPC-based updates when communicating with .Xr rpc.yppasswdd 8 Modified: head/usr.bin/grep/grep.1 ============================================================================== --- head/usr.bin/grep/grep.1 Sat Feb 8 13:29:35 2014 (r261633) +++ head/usr.bin/grep/grep.1 Sat Feb 8 13:37:02 2014 (r261634) @@ -398,8 +398,8 @@ The default is 2. Force output to be line buffered. By default, output is line buffered when standard output is a terminal and block buffered otherwise. -.Pp .El +.Pp If no file arguments are specified, the standard input is used. .Sh EXIT STATUS The Modified: head/usr.bin/indent/indent.1 ============================================================================== --- head/usr.bin/indent/indent.1 Sat Feb 8 13:29:35 2014 (r261633) +++ head/usr.bin/indent/indent.1 Sat Feb 8 13:37:02 2014 (r261634) @@ -184,7 +184,6 @@ if (...) { code } .Ed -.Pp .It Fl c Ns Ar n The column in which comments on code start. The default is 33. Modified: head/usr.bin/rpcgen/rpcgen.1 ============================================================================== --- head/usr.bin/rpcgen/rpcgen.1 Sat Feb 8 13:29:35 2014 (r261633) +++ head/usr.bin/rpcgen/rpcgen.1 Sat Feb 8 13:37:02 2014 (r261634) @@ -328,7 +328,6 @@ Contrary to some systems, in this option is needed to generate servers that can be invoked through portmonitors and .Xr inetd 8 . -.Pp .It Fl K Ar seconds By default, services created using .Nm Modified: head/usr.bin/whois/whois.1 ============================================================================== --- head/usr.bin/whois/whois.1 Sat Feb 8 13:29:35 2014 (r261633) +++ head/usr.bin/whois/whois.1 Sat Feb 8 13:37:02 2014 (r261634) @@ -62,7 +62,6 @@ nor by .Tn ARIN whois database end with .Qq Li -ARIN . ) -.Pp .It Fl A Use the Asia/Pacific Network Information Center .Pq Tn APNIC Modified: head/usr.bin/xargs/xargs.1 ============================================================================== --- head/usr.bin/xargs/xargs.1 Sat Feb 8 13:29:35 2014 (r261633) +++ head/usr.bin/xargs/xargs.1 Sat Feb 8 13:37:02 2014 (r261634) @@ -164,7 +164,6 @@ directory to .Pa destdir : .Pp .Dl /bin/ls -1d [A-Z]* | xargs -J % cp -Rp % destdir -.Pp .It Fl L Ar number Call .Ar utility Modified: head/usr.sbin/bluetooth/btpand/btpand.8 ============================================================================== --- head/usr.sbin/bluetooth/btpand/btpand.8 Sat Feb 8 13:29:35 2014 (r261633) +++ head/usr.sbin/bluetooth/btpand/btpand.8 Sat Feb 8 13:37:02 2014 (r261634) @@ -159,7 +159,6 @@ Network Access Point. .It PANU Personal Area Networking User. .El -.Pp .It Fl S Ar service As per .Fl s Modified: head/usr.sbin/ifmcstat/ifmcstat.8 ============================================================================== --- head/usr.sbin/ifmcstat/ifmcstat.8 Sat Feb 8 13:29:35 2014 (r261633) +++ head/usr.sbin/ifmcstat/ifmcstat.8 Sat Feb 8 13:37:02 2014 (r261634) @@ -54,7 +54,6 @@ The following options are supported: .Bl -tag -width Fl .It Fl i Ar interface specifies the interface to be displayed. -.Pp .It Fl f Ar address-family specifies the address family to be displayed; .Ar inet , Modified: head/usr.sbin/ppp/ppp.8 ============================================================================== --- head/usr.sbin/ppp/ppp.8 Sat Feb 8 13:29:35 2014 (r261633) +++ head/usr.sbin/ppp/ppp.8 Sat Feb 8 13:37:02 2014 (r261634) @@ -1188,7 +1188,6 @@ Use Hardware Handshake (CTS/RTS) for flo .It Modem should be set to NO echo back (ATE0) and NO results string (ATQ1). .El -.Pp .It Edit .Pa /etc/ttys @@ -1796,7 +1795,6 @@ If no timeout is given, the default time .Ic set timeout and defaulting to 180 seconds) is used. .El -.Pp .It Each filter can hold up to 40 rules, starting from rule 0. The entire rule set is not effective until rule 0 is defined, @@ -2207,7 +2205,6 @@ ISPs IP number would be: .Bd -literal -offset indent set ifaddr 10.0.0.1/0 10.0.0.2/0 0.0.0.0 0.0.0.0 .Ed -.Pp .It In most cases, your ISP will also be your default router. If this is the case, add the line @@ -3241,7 +3238,6 @@ not to make any utmp or wtmp entries. This is usually only necessary if you require the user to both login and authenticate themselves. .El -.Pp .It add Ns Xo .Op !\& .Ar dest Ns Op / Ns Ar nn @@ -3395,7 +3391,6 @@ When running in multi-link mode, a secti .Em any of the currently existing line modes. .El -.Pp .It nat Ar command Op Ar args This command allows the control of the network address translation (also known as masquerading or IP aliasing) facilities that are built into @@ -3584,7 +3579,6 @@ are 10.0.0.0/8, 172.16.0.0/12 and 192.16 These commands are also discussed in the file .Pa README.nat which comes with the source distribution. -.Pp .It Oo !\& Oc Ns Xo .No bg Ar command .Xc @@ -3890,7 +3884,6 @@ mode, all interface addresses are delete .Pp If the INET or INET6 arguments are used, only addresses for that address family are cleared. -.Pp .It iface delete Ns Xo .Op !\& Ns .No |rm Ns Op !\& @@ -4392,7 +4385,6 @@ the connection. This is required (in addition to one or more other callback options) if you wish callback to be optional. .El -.Pp .It set cbcp Oo .No *| Ns Ar number Ns Oo .No , Ns Ar number Ns ...\& Oc @@ -5441,7 +5433,6 @@ This also applies for RADIUS routes that or .Dv HISADDR keywords. -.Pp .It RAD_FRAMED_IPV6_PREFIX If this attribute is supplied, the value is substituted for IPV6PREFIX in a command. @@ -5493,7 +5484,6 @@ also applies for RADIUS IPv6 routes that or .Dv HISADDR6 keywords. -.Pp .It RAD_SESSION_TIMEOUT If supplied, the client connection is closed after the given number of seconds. @@ -5853,7 +5843,6 @@ and .Ar 16 inclusive. .El -.Pp .It shell|! Op Ar command If .Ar command @@ -5933,7 +5922,6 @@ Show the active alarm timers. Show the current version number of .Nm . .El -.Pp .It term Go into terminal mode. Characters typed at the keyboard are sent to the device. @@ -5966,7 +5954,6 @@ http://www.FreeBSD.org/doc/en_US.ISO8859 .It http://www.FreeBSD.org/doc/handbook/userppp.html .El -.Pp .El .Sh FILES .Nm Modified: head/usr.sbin/watchdogd/watchdogd.8 ============================================================================== --- head/usr.sbin/watchdogd/watchdogd.8 Sat Feb 8 13:29:35 2014 (r261633) +++ head/usr.sbin/watchdogd/watchdogd.8 Sat Feb 8 13:37:02 2014 (r261634) @@ -125,42 +125,35 @@ Do not fork. When this option is specified, .Nm will not fork into the background at startup. -.Pp .It Fl S Do not send a message to the system logger when the watchdog command takes longer than expected to execute. The default behaviour is to log a warning via the system logger with the LOG_DAEMON facility, and to output a warning to standard error. -.Pp .It Fl w Complain when the watchdog script takes too long. This flag will cause watchdogd to complain when the amount of time to execute the watchdog script exceeds the threshold of 'sleep' option. -.Pp .It Fl -pretimeout Ar timeout Set a "pretimeout" watchdog. At "timeout" seconds before the watchdog will fire attempt an action. The action is set by the --pretimeout-action flag. The default is just to log a message (WD_SOFT_LOG) via .Xr log 9 . -.Pp .It Fl -pretimeout-action Ar action Set the timeout action for the pretimeout. See the section .Sx Timeout Actions . -.Pp .It Fl -softtimeout Instead of arming the various hardware watchdogs, only use a basic software watchdog. The default action is just to .Xr log 9 a message (WD_SOFT_LOG). -.Pp .It Fl -softtimeout-action Ar action Set the timeout action for the softtimeout. See the section .Sx Timeout Actions . -.Pp .El .Sh Timeout Actions The following timeout actions are available via the @@ -173,25 +166,22 @@ flags: Call .Xr panic 9 when the timeout is reached. -.Pp .It Ar ddb Enter the kernel debugger via .Xr kdb_enter 9 when the timeout is reached. -.Pp .It Ar log Log a message using .Xr log 9 when the timeout is reached. -.Pp .It Ar printf call the kernel .Xr printf 9 to display a message to the console and .Xr dmesg 8 buffer. -.Pp .El +.Pp Actions can be combined in a comma separated list as so: .Ar log,printf which would both From owner-svn-src-head@FreeBSD.ORG Sat Feb 8 13:51:16 2014 Return-Path: Delivered-To: svn-src-head@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 617237C6; Sat, 8 Feb 2014 13:51:16 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 401A91D3E; Sat, 8 Feb 2014 13:51:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s18DpGXF006641; Sat, 8 Feb 2014 13:51:16 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s18DpGSS006640; Sat, 8 Feb 2014 13:51:16 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201402081351.s18DpGSS006640@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 8 Feb 2014 13:51:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261635 - head/sbin/init X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Feb 2014 13:51:16 -0000 Author: jilles Date: Sat Feb 8 13:51:15 2014 New Revision: 261635 URL: http://svnweb.freebsd.org/changeset/base/261635 Log: init: Remove code to track line numbers in /etc/ttys. The tracking generated warnings when the line number of an existing tty in /etc/ttys changed, which would corrupt utmp (as it was indexed by the line number). With utmpx, the line number no longer matters, so the tracking is no longer needed. Modified: head/sbin/init/init.c Modified: head/sbin/init/init.c ============================================================================== --- head/sbin/init/init.c Sat Feb 8 13:37:02 2014 (r261634) +++ head/sbin/init/init.c Sat Feb 8 13:51:15 2014 (r261635) @@ -143,7 +143,6 @@ static const char *get_shell(void); static void write_stderr(const char *message); typedef struct init_session { - int se_index; /* index of entry in ttys file */ pid_t se_process; /* controlling process */ time_t se_started; /* used to avoid thrashing */ int se_flags; /* status of session */ @@ -163,7 +162,7 @@ typedef struct init_session { } session_t; static void free_session(session_t *); -static session_t *new_session(session_t *, int, struct ttyent *); +static session_t *new_session(session_t *, struct ttyent *); static session_t *sessions; static char **construct_argv(char *); @@ -1005,7 +1004,7 @@ free_session(session_t *sp) * Mark it SE_PRESENT. */ static session_t * -new_session(session_t *sprev, int session_index, struct ttyent *typ) +new_session(session_t *sprev, struct ttyent *typ) { session_t *sp; int fd; @@ -1017,7 +1016,6 @@ new_session(session_t *sprev, int sessio sp = (session_t *) calloc(1, sizeof (session_t)); - sp->se_index = session_index; sp->se_flags |= SE_PRESENT; sp->se_device = malloc(sizeof(_PATH_DEV) + strlen(typ->ty_name)); @@ -1107,7 +1105,6 @@ setupargv(session_t *sp, struct ttyent * static state_func_t read_ttys(void) { - int session_index = 0; session_t *sp, *snext; struct ttyent *typ; @@ -1128,7 +1125,7 @@ read_ttys(void) * Note that sp starts at 0. */ while ((typ = getttyent()) != NULL) - if ((snext = new_session(sp, ++session_index, typ)) != NULL) + if ((snext = new_session(sp, typ)) != NULL) sp = snext; endttyent(); @@ -1380,7 +1377,6 @@ clean_ttys(void) { session_t *sp, *sprev; struct ttyent *typ; - int session_index = 0; int devlen; char *old_getty, *old_window, *old_type; @@ -1394,8 +1390,6 @@ clean_ttys(void) devlen = sizeof(_PATH_DEV) - 1; while ((typ = getttyent()) != NULL) { - ++session_index; - for (sprev = 0, sp = sessions; sp; sprev = sp, sp = sp->se_next) if (strcmp(typ->ty_name, sp->se_device + devlen) == 0) break; @@ -1403,12 +1397,6 @@ clean_ttys(void) if (sp) { /* we want this one to live */ sp->se_flags |= SE_PRESENT; - if (sp->se_index != session_index) { - warning("port %s changed utmp index from %d to %d", - sp->se_device, sp->se_index, - session_index); - sp->se_index = session_index; - } if ((typ->ty_status & TTY_ON) == 0 || typ->ty_getty == 0) { sp->se_flags |= SE_SHUTDOWN; @@ -1448,7 +1436,7 @@ clean_ttys(void) continue; } - new_session(sprev, session_index, typ); + new_session(sprev, typ); } endttyent(); From owner-svn-src-head@FreeBSD.ORG Sat Feb 8 16:37:55 2014 Return-Path: Delivered-To: svn-src-head@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 930C7B19; Sat, 8 Feb 2014 16:37: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6FF001A80; Sat, 8 Feb 2014 16:37:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s18GbtjI072353; Sat, 8 Feb 2014 16:37:55 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s18Gbspc072345; Sat, 8 Feb 2014 16:37:54 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402081637.s18Gbspc072345@svn.freebsd.org> From: John Baldwin Date: Sat, 8 Feb 2014 16:37:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261638 - in head/sys/amd64/vmm: . intel X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Feb 2014 16:37:55 -0000 Author: jhb Date: Sat Feb 8 16:37:54 2014 New Revision: 261638 URL: http://svnweb.freebsd.org/changeset/base/261638 Log: Add virtualized XSAVE support to bhyve which permits guests to use XSAVE and XSAVE-enabled features like AVX. - Store a per-cpu guest xcr0 register. When switching to the guest FPU state, switch to the guest xcr0 value. Note that the guest FPU state is saved and restored using the host's xcr0 value and xcr0 is saved/restored "inside" of saving/restoring the guest FPU state. - Handle VM exits for the xsetbv instruction by updating the guest xcr0. - Expose the XSAVE feature to the guest only if the host has enabled XSAVE, and only advertise XSAVE features enabled by the host to the guest. This ensures that the guest will only adjust FPU state that is a subset of the guest FPU state saved and restored by the host. Reviewed by: grehan Modified: head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/vmm.c head/sys/amd64/vmm/vmm_host.c head/sys/amd64/vmm/vmm_host.h head/sys/amd64/vmm/x86.c Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Sat Feb 8 15:51:42 2014 (r261637) +++ head/sys/amd64/vmm/intel/vmx.c Sat Feb 8 16:37:54 2014 (r261638) @@ -1228,6 +1228,40 @@ vmx_clear_nmi_blocking(struct vmx *vmx, } static int +vmx_emulate_xsetbv(struct vmx *vmx, int vcpu) +{ + struct vmxctx *vmxctx; + uint64_t xcrval; + const struct xsave_limits *limits; + + vmxctx = &vmx->ctx[vcpu]; + limits = vmm_get_xsave_limits(); + + /* We only handle xcr0 if the host has XSAVE enabled. */ + if (vmxctx->guest_rcx != 0 || !limits->xsave_enabled) + return (UNHANDLED); + + xcrval = vmxctx->guest_rdx << 32 | (vmxctx->guest_rax & 0xffffffff); + if ((xcrval & ~limits->xcr0_allowed) != 0) + return (UNHANDLED); + + if (!(xcrval & XFEATURE_ENABLED_X87)) + return (UNHANDLED); + + if ((xcrval & (XFEATURE_ENABLED_AVX | XFEATURE_ENABLED_SSE)) == + XFEATURE_ENABLED_AVX) + return (UNHANDLED); + + /* + * This runs "inside" vmrun() with the guest's FPU state, so + * modifying xcr0 directly modifies the guest's xcr0, not the + * host's. + */ + load_xcr(0, xcrval); + return (HANDLED); +} + +static int vmx_emulate_cr_access(struct vmx *vmx, int vcpu, uint64_t exitqual) { int cr, vmcs_guest_cr, vmcs_shadow_cr; @@ -1774,6 +1808,9 @@ vmx_exit_process(struct vmx *vmx, int vc vlapic = vm_lapic(vmx->vm, vcpu); handled = vmx_handle_apic_write(vlapic, qual); break; + case EXIT_REASON_XSETBV: + handled = vmx_emulate_xsetbv(vmx, vcpu); + break; default: vmm_stat_incr(vmx->vm, vcpu, VMEXIT_UNKNOWN, 1); break; Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Sat Feb 8 15:51:42 2014 (r261637) +++ head/sys/amd64/vmm/vmm.c Sat Feb 8 16:37:54 2014 (r261638) @@ -89,6 +89,7 @@ struct vcpu { struct vlapic *vlapic; int vcpuid; struct savefpu *guestfpu; /* guest fpu state */ + uint64_t guest_xcr0; void *stats; struct vm_exit exitinfo; enum x2apic_state x2apic_state; @@ -206,6 +207,7 @@ vcpu_init(struct vm *vm, uint32_t vcpu_i vcpu->vcpuid = vcpu_id; vcpu->vlapic = VLAPIC_INIT(vm->cookie, vcpu_id); vm_set_x2apic_state(vm, vcpu_id, X2APIC_ENABLED); + vcpu->guest_xcr0 = XFEATURE_ENABLED_X87; vcpu->guestfpu = fpu_save_area_alloc(); fpu_save_area_reset(vcpu->guestfpu); vcpu->stats = vmm_stat_alloc(); @@ -815,6 +817,10 @@ restore_guest_fpustate(struct vcpu *vcpu fpu_stop_emulating(); fpurestore(vcpu->guestfpu); + /* restore guest XCR0 if XSAVE is enabled in the host */ + if (rcr4() & CR4_XSAVE) + load_xcr(0, vcpu->guest_xcr0); + /* * The FPU is now "dirty" with the guest's state so turn on emulation * to trap any access to the FPU by the host. @@ -829,6 +835,12 @@ save_guest_fpustate(struct vcpu *vcpu) if ((rcr0() & CR0_TS) == 0) panic("fpu emulation not enabled in host!"); + /* save guest XCR0 and restore host XCR0 */ + if (rcr4() & CR4_XSAVE) { + vcpu->guest_xcr0 = rxcr(0); + load_xcr(0, vmm_get_host_xcr0()); + } + /* save guest FPU state */ fpu_stop_emulating(); fpusave(vcpu->guestfpu); Modified: head/sys/amd64/vmm/vmm_host.c ============================================================================== --- head/sys/amd64/vmm/vmm_host.c Sat Feb 8 15:51:42 2014 (r261637) +++ head/sys/amd64/vmm/vmm_host.c Sat Feb 8 16:37:54 2014 (r261638) @@ -38,11 +38,14 @@ __FBSDID("$FreeBSD$"); #include "vmm_host.h" -static uint64_t vmm_host_efer, vmm_host_pat, vmm_host_cr0, vmm_host_cr4; +static uint64_t vmm_host_efer, vmm_host_pat, vmm_host_cr0, vmm_host_cr4, + vmm_host_xcr0; +static struct xsave_limits vmm_xsave_limits; void vmm_host_state_init(void) { + int regs[4]; vmm_host_efer = rdmsr(MSR_EFER); vmm_host_pat = rdmsr(MSR_PAT); @@ -57,6 +60,21 @@ vmm_host_state_init(void) vmm_host_cr0 = rcr0() | CR0_TS; vmm_host_cr4 = rcr4(); + + /* + * Only permit a guest to use XSAVE if the host is using + * XSAVE. Only permit a guest to use XSAVE features supported + * by the host. This ensures that the FPU state used by the + * guest is always a subset of the saved guest FPU state. + */ + if (vmm_host_cr4 & CR4_XSAVE) { + vmm_xsave_limits.xsave_enabled = 1; + vmm_host_xcr0 = rxcr(0); + vmm_xsave_limits.xcr0_allowed = vmm_host_xcr0; + + cpuid_count(0xd, 0x0, regs); + vmm_xsave_limits.xsave_max_size = regs[1]; + } } uint64_t @@ -88,6 +106,13 @@ vmm_get_host_cr4(void) } uint64_t +vmm_get_host_xcr0(void) +{ + + return (vmm_host_xcr0); +} + +uint64_t vmm_get_host_datasel(void) { @@ -122,3 +147,10 @@ vmm_get_host_idtrbase(void) return (r_idt.rd_base); } + +const struct xsave_limits * +vmm_get_xsave_limits(void) +{ + + return (&vmm_xsave_limits); +} Modified: head/sys/amd64/vmm/vmm_host.h ============================================================================== --- head/sys/amd64/vmm/vmm_host.h Sat Feb 8 15:51:42 2014 (r261637) +++ head/sys/amd64/vmm/vmm_host.h Sat Feb 8 16:37:54 2014 (r261638) @@ -33,17 +33,25 @@ #error "no user-servicable parts inside" #endif +struct xsave_limits { + int xsave_enabled; + uint64_t xcr0_allowed; + uint32_t xsave_max_size; +}; + void vmm_host_state_init(void); uint64_t vmm_get_host_pat(void); uint64_t vmm_get_host_efer(void); uint64_t vmm_get_host_cr0(void); uint64_t vmm_get_host_cr4(void); +uint64_t vmm_get_host_xcr0(void); uint64_t vmm_get_host_datasel(void); uint64_t vmm_get_host_codesel(void); uint64_t vmm_get_host_tsssel(void); uint64_t vmm_get_host_fsbase(void); uint64_t vmm_get_host_idtrbase(void); +const struct xsave_limits *vmm_get_xsave_limits(void); /* * Inline access to host state that is used on every VM entry Modified: head/sys/amd64/vmm/x86.c ============================================================================== --- head/sys/amd64/vmm/x86.c Sat Feb 8 15:51:42 2014 (r261637) +++ head/sys/amd64/vmm/x86.c Sat Feb 8 16:37:54 2014 (r261638) @@ -30,17 +30,19 @@ __FBSDID("$FreeBSD$"); #include -#include +#include #include #include #include #include #include +#include #include #include +#include "vmm_host.h" #include "x86.h" #define CPUID_VM_HIGH 0x40000000 @@ -53,6 +55,8 @@ int x86_emulate_cpuid(struct vm *vm, int vcpu_id, uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx) { + const struct xsave_limits *limits; + uint64_t cr4; int error, enable_invpcid; unsigned int func, regs[4]; enum x2apic_state x2apic_state; @@ -147,11 +151,27 @@ x86_emulate_cpuid(struct vm *vm, int vcp regs[2] |= CPUID2_X2APIC; /* - * Hide xsave/osxsave/avx until the FPU save/restore - * issues are resolved + * Only advertise CPUID2_XSAVE in the guest if + * the host is using XSAVE. */ - regs[2] &= ~(CPUID2_XSAVE | CPUID2_OSXSAVE | - CPUID2_AVX); + if (!(regs[2] & CPUID2_OSXSAVE)) + regs[2] &= ~CPUID2_XSAVE; + + /* + * If CPUID2_XSAVE is being advertised and the + * guest has set CR4_XSAVE, set + * CPUID2_OSXSAVE. + */ + regs[2] &= ~CPUID2_OSXSAVE; + if (regs[2] & CPUID2_XSAVE) { + error = vm_get_register(vm, vcpu_id, + VM_REG_GUEST_CR4, &cr4); + if (error) + panic("x86_emulate_cpuid: error %d " + "fetching %%cr4", error); + if (cr4 & CR4_XSAVE) + regs[2] |= CPUID2_OSXSAVE; + } /* * Hide monitor/mwait until we know how to deal with @@ -219,7 +239,6 @@ x86_emulate_cpuid(struct vm *vm, int vcp case CPUID_0000_0006: case CPUID_0000_000A: - case CPUID_0000_000D: /* * Handle the access, but report 0 for * all options @@ -240,6 +259,57 @@ x86_emulate_cpuid(struct vm *vm, int vcp regs[3] = vcpu_id; break; + case CPUID_0000_000D: + limits = vmm_get_xsave_limits(); + if (!limits->xsave_enabled) { + regs[0] = 0; + regs[1] = 0; + regs[2] = 0; + regs[3] = 0; + break; + } + + cpuid_count(*eax, *ecx, regs); + switch (*ecx) { + case 0: + /* + * Only permit the guest to use bits + * that are active in the host in + * %xcr0. Also, claim that the + * maximum save area size is + * equivalent to the host's current + * save area size. Since this runs + * "inside" of vmrun(), it runs with + * the guest's xcr0, so the current + * save area size is correct as-is. + */ + regs[0] &= limits->xcr0_allowed; + regs[2] = limits->xsave_max_size; + regs[3] &= (limits->xcr0_allowed >> 32); + break; + case 1: + /* Only permit XSAVEOPT. */ + regs[0] &= CPUID_EXTSTATE_XSAVEOPT; + regs[1] = 0; + regs[2] = 0; + regs[3] = 0; + break; + default: + /* + * If the leaf is for a permitted feature, + * pass through as-is, otherwise return + * all zeroes. + */ + if (!(limits->xcr0_allowed & (1ul << *ecx))) { + regs[0] = 0; + regs[1] = 0; + regs[2] = 0; + regs[3] = 0; + } + break; + } + break; + case 0x40000000: regs[0] = CPUID_VM_HIGH; bcopy(bhyve_id, ®s[1], 4); From owner-svn-src-head@FreeBSD.ORG Sat Feb 8 17:54:54 2014 Return-Path: Delivered-To: svn-src-head@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 88B5CE1D; Sat, 8 Feb 2014 17:54:54 +0000 (UTC) Received: from mail-qa0-x229.google.com (mail-qa0-x229.google.com [IPv6:2607:f8b0:400d:c00::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0DC861135; Sat, 8 Feb 2014 17:54:53 +0000 (UTC) Received: by mail-qa0-f41.google.com with SMTP id w8so7301887qac.28 for ; Sat, 08 Feb 2014 09:54:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=yL9gn+NTgrxCx93mC4yKGVSwUzZdTHrN++ZgXjhICc8=; b=Nmk+CbSuPgj5fPtWnArJ6oxCq6/JHZzZyIUVOrzX1xIFuHr63snpcow3Y5IL/sEPYf pDH/6dB2ZusahwasKYNeXXKoERkYuKGXl6zx4WlMJxekDwZoHeRIcsW9KgeY6u0AcJ2j PzBjFwkBm4+VBI2LznIz1MdMC1R5i3CRzqdniw5OwSzbVXWVSHA35JsdHI5UMCiaV0eN TMYs8K3bycbmmpqUMFMLgk3kI+K/hpUQvYzyEh2qFg0PZJCgE4j8S611G5dAm5I4v4Yk nvoN/P/vfBPu8y8/xArOh4DW3Ji1NdrtN6nN76jHgpJnnIGjvkqAjkCF/eytKF+X6P9b mk1Q== MIME-Version: 1.0 X-Received: by 10.224.160.195 with SMTP id o3mr33096898qax.98.1391882092285; Sat, 08 Feb 2014 09:54:52 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.224.52.8 with HTTP; Sat, 8 Feb 2014 09:54:52 -0800 (PST) In-Reply-To: <201402080956.s189uRYp013533@svn.freebsd.org> References: <201402080956.s189uRYp013533@svn.freebsd.org> Date: Sat, 8 Feb 2014 09:54:52 -0800 X-Google-Sender-Auth: nC0QhCRrgA3nQbBy0mPQNmkgsUc Message-ID: Subject: Re: svn commit: r261627 - head/sys/net From: Adrian Chadd To: Gleb Smirnoff Content-Type: text/plain; charset=ISO-8859-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Feb 2014 17:54:54 -0000 Yup, it was part of the (never seemingly publicly used) kern_ API to directly add a flowtable entry. -a On 8 February 2014 01:56, Gleb Smirnoff wrote: > Author: glebius > Date: Sat Feb 8 09:56:26 2014 > New Revision: 261627 > URL: http://svnweb.freebsd.org/changeset/base/261627 > > Log: > Remove never set flag FL_OVERWRITE. The only place where > it was checked led to lock/critnest leak. > > Modified: > head/sys/net/flowtable.c > head/sys/net/pfvar.h > > Modified: head/sys/net/flowtable.c > ============================================================================== > --- head/sys/net/flowtable.c Sat Feb 8 09:50:02 2014 (r261626) > +++ head/sys/net/flowtable.c Sat Feb 8 09:56:26 2014 (r261627) > @@ -280,7 +280,6 @@ flowtable_pcpu_unlock(struct flowtable * > #define FL_ENTRY_UNLOCK(table, hash) (table)->ft_unlock((table), (hash)) > > #define FL_STALE (1<<8) > -#define FL_OVERWRITE (1<<10) > > static struct flentry *flowtable_lookup_common(struct flowtable *, > struct sockaddr_storage *, struct sockaddr_storage *, struct mbuf *, int); > @@ -833,8 +832,6 @@ flowtable_insert(struct flowtable *ft, u > FL_ENTRY_UNLOCK(ft, hash); > uma_zfree(ft->ft_zone, newfle); > > - if (flags & FL_OVERWRITE) > - goto skip; > return (EEXIST); > } > /* > > Modified: head/sys/net/pfvar.h > ============================================================================== > --- head/sys/net/pfvar.h Sat Feb 8 09:50:02 2014 (r261626) > +++ head/sys/net/pfvar.h Sat Feb 8 09:56:26 2014 (r261627) > @@ -1580,8 +1580,6 @@ extern struct pf_src_node *pf_find_src_n > extern void pf_unlink_src_node(struct pf_src_node *); > extern void pf_unlink_src_node_locked(struct pf_src_node *); > extern u_int pf_free_src_nodes(struct pf_src_node_list *); > -extern void pf_print_state(struct pf_state *); > -extern void pf_print_flags(u_int8_t); > extern u_int16_t pf_cksum_fixup(u_int16_t, u_int16_t, u_int16_t, > u_int8_t); > > @@ -1744,8 +1742,6 @@ int pf_osfp_get(struct pf_osfp_ioctl *); > int pf_osfp_match(struct pf_osfp_enlist *, pf_osfp_t); > > #ifdef _KERNEL > -void pf_print_host(struct pf_addr *, u_int16_t, u_int8_t); > - > void pf_step_into_anchor(struct pf_anchor_stackframe *, int *, > struct pf_ruleset **, int, struct pf_rule **, > struct pf_rule **, int *); From owner-svn-src-head@FreeBSD.ORG Sat Feb 8 19:48:00 2014 Return-Path: Delivered-To: svn-src-head@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 CE7CC216; Sat, 8 Feb 2014 19:48:00 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A97B318EC; Sat, 8 Feb 2014 19:48:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s18Jm0CJ046786; Sat, 8 Feb 2014 19:48:00 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s18JlxkO046768; Sat, 8 Feb 2014 19:47:59 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201402081947.s18JlxkO046768@svn.freebsd.org> From: Ruslan Bukin Date: Sat, 8 Feb 2014 19:47:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261639 - in head/sys: arm/freescale/vybrid boot/fdt/dts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Feb 2014 19:48:00 -0000 Author: br Date: Sat Feb 8 19:47:59 2014 New Revision: 261639 URL: http://svnweb.freebsd.org/changeset/base/261639 Log: Add drivers for: - Enhanced Direct Memory Access Controller (eDMA) - Direct Memory Access Multiplexer (DMAMUX) Added: head/sys/arm/freescale/vybrid/vf_dmamux.c (contents, props changed) head/sys/arm/freescale/vybrid/vf_dmamux.h (contents, props changed) head/sys/arm/freescale/vybrid/vf_edma.c (contents, props changed) head/sys/arm/freescale/vybrid/vf_edma.h (contents, props changed) Modified: head/sys/arm/freescale/vybrid/files.vybrid head/sys/boot/fdt/dts/vybrid.dtsi Modified: head/sys/arm/freescale/vybrid/files.vybrid ============================================================================== --- head/sys/arm/freescale/vybrid/files.vybrid Sat Feb 8 16:37:54 2014 (r261638) +++ head/sys/arm/freescale/vybrid/files.vybrid Sat Feb 8 19:47:59 2014 (r261639) @@ -21,6 +21,8 @@ arm/freescale/vybrid/vf_anadig.c standa arm/freescale/vybrid/vf_iomuxc.c standard arm/freescale/vybrid/vf_mscm.c standard arm/freescale/vybrid/vf_src.c standard +arm/freescale/vybrid/vf_edma.c standard +arm/freescale/vybrid/vf_dmamux.c standard arm/freescale/vybrid/vf_tcon.c optional vt arm/freescale/vybrid/vf_dcu4.c optional vt arm/freescale/vybrid/vf_nfc.c optional nand Added: head/sys/arm/freescale/vybrid/vf_dmamux.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/freescale/vybrid/vf_dmamux.c Sat Feb 8 19:47:59 2014 (r261639) @@ -0,0 +1,155 @@ +/*- + * Copyright (c) 2014 Ruslan Bukin + * 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. + */ + +/* + * Vybrid Family Direct Memory Access Multiplexer (DMAMUX) + * Chapter 22, Vybrid Reference Manual, Rev. 5, 07/2013 + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +#define DMAMUX_CHCFG(n) (0x1 * n) /* Channels 0-15 Cfg Reg */ +#define CHCFG_ENBL (1 << 7) /* Channel Enable */ +#define CHCFG_TRIG (1 << 6) /* Channel Trigger Enable */ +#define CHCFG_SOURCE_MASK 0x3f /* Channel Source (Slot) */ +#define CHCFG_SOURCE_SHIFT 0 + +struct dmamux_softc { + struct resource *res[4]; + bus_space_tag_t bst[4]; + bus_space_handle_t bsh[4]; +}; + +struct dmamux_softc *dmamux_sc; + +static struct resource_spec dmamux_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, /* DMAMUX0 */ + { SYS_RES_MEMORY, 1, RF_ACTIVE }, /* DMAMUX1 */ + { SYS_RES_MEMORY, 2, RF_ACTIVE }, /* DMAMUX2 */ + { SYS_RES_MEMORY, 3, RF_ACTIVE }, /* DMAMUX3 */ + { -1, 0 } +}; + +static int +dmamux_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "fsl,mvf600-dmamux")) + return (ENXIO); + + device_set_desc(dev, "Vybrid Family Direct Memory Access Multiplexer"); + return (BUS_PROBE_DEFAULT); +} + +int +dmamux_configure(int mux, int source, int channel, int enable) +{ + struct dmamux_softc *sc; + int reg; + + sc = dmamux_sc; + + MUX_WRITE1(sc, mux, DMAMUX_CHCFG(channel), 0x0); + + reg = 0; + if (enable) + reg |= (CHCFG_ENBL); + + reg &= ~(CHCFG_SOURCE_MASK << CHCFG_SOURCE_SHIFT); + reg |= (source << CHCFG_SOURCE_SHIFT); + + MUX_WRITE1(sc, mux, DMAMUX_CHCFG(channel), reg); + + return (0); +} + +static int +dmamux_attach(device_t dev) +{ + struct dmamux_softc *sc; + int i; + + sc = device_get_softc(dev); + + if (bus_alloc_resources(dev, dmamux_spec, sc->res)) { + device_printf(dev, "could not allocate resources\n"); + return (ENXIO); + } + + /* Memory interface */ + for (i = 0; i < 4; i++) { + sc->bst[i] = rman_get_bustag(sc->res[i]); + sc->bsh[i] = rman_get_bushandle(sc->res[i]); + } + + dmamux_sc = sc; + + return (0); +} + +static device_method_t dmamux_methods[] = { + DEVMETHOD(device_probe, dmamux_probe), + DEVMETHOD(device_attach, dmamux_attach), + { 0, 0 } +}; + +static driver_t dmamux_driver = { + "dmamux", + dmamux_methods, + sizeof(struct dmamux_softc), +}; + +static devclass_t dmamux_devclass; + +DRIVER_MODULE(dmamux, simplebus, dmamux_driver, dmamux_devclass, 0, 0); Added: head/sys/arm/freescale/vybrid/vf_dmamux.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/freescale/vybrid/vf_dmamux.h Sat Feb 8 19:47:59 2014 (r261639) @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 2014 Ruslan Bukin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +int dmamux_configure(int mux, int source, int channel, int enable); + +enum mux_num { + MUX0, + MUX1, + MUX2, + MUX3, +}; + +enum mux_grp { + MUXGRP0, /* MUX[0,3] */ + MUXGRP1, /* MUX[1,2] */ +}; + +/* DMAMUX */ +#define MUX_READ1(_sc, _mux, _reg) \ + bus_space_read_1(_sc->bst[_mux], _sc->bsh[_mux], _reg) + +#define MUX_WRITE1(_sc, _mux, _reg, _val) \ + bus_space_write_1(_sc->bst[_mux], _sc->bsh[_mux], _reg, _val) Added: head/sys/arm/freescale/vybrid/vf_edma.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/freescale/vybrid/vf_edma.c Sat Feb 8 19:47:59 2014 (r261639) @@ -0,0 +1,338 @@ +/*- + * Copyright (c) 2014 Ruslan Bukin + * 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. + */ + +/* + * Vybrid Family Enhanced Direct Memory Access Controller (eDMA) + * Chapter 21, Vybrid Reference Manual, Rev. 5, 07/2013 + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +struct edma_channel { + uint32_t enabled; + uint32_t mux_num; + uint32_t mux_src; + uint32_t mux_chn; + uint32_t (*ih) (void *, int); + void *ih_user; +}; + +static struct edma_channel edma_map[EDMA_NUM_CHANNELS]; + +static struct resource_spec edma_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_MEMORY, 1, RF_ACTIVE }, /* TCD */ + { SYS_RES_IRQ, 0, RF_ACTIVE }, /* Transfer complete */ + { SYS_RES_IRQ, 1, RF_ACTIVE }, /* Error Interrupt */ + { -1, 0 } +}; + +static int +edma_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "fsl,mvf600-edma")) + return (ENXIO); + + device_set_desc(dev, "Vybrid Family eDMA Controller"); + return (BUS_PROBE_DEFAULT); +} + +static void +edma_transfer_complete_intr(void *arg) +{ + struct edma_channel *ch; + struct edma_softc *sc; + int interrupts; + int i; + + sc = arg; + + interrupts = READ4(sc, DMA_INT); + WRITE1(sc, DMA_CINT, CINT_CAIR); + + for (i = 0; i < EDMA_NUM_CHANNELS; i++) { + if (interrupts & (0x1 << i)) { + ch = &edma_map[i]; + if (ch->enabled == 1) { + if (ch->ih != NULL) { + ch->ih(ch->ih_user, i); + } + } + } + } +} + +static void +edma_err_intr(void *arg) +{ + struct edma_softc *sc; + int reg; + + sc = arg; + + reg = READ4(sc, DMA_ERR); + +#if 0 + device_printf(sc->dev, "DMA_ERR 0x%08x, ES 0x%08x\n", + reg, READ4(sc, DMA_ES)); +#endif + + WRITE1(sc, DMA_CERR, CERR_CAEI); +} + +static int +channel_free(struct edma_softc *sc, int chnum) +{ + struct edma_channel *ch; + + ch = &edma_map[chnum]; + ch->enabled = 0; + + dmamux_configure(ch->mux_num, ch->mux_src, ch->mux_chn, 0); + + return (0); +} + +static int +channel_configure(struct edma_softc *sc, int mux_grp, int mux_src) +{ + struct edma_channel *ch; + int channel_first; + int mux_num; + int chnum; + int i; + + if ((sc->device_id == 0 && mux_grp == 1) || \ + (sc->device_id == 1 && mux_grp == 0)) { + channel_first = NCHAN_PER_MUX; + mux_num = (sc->device_id * 2) + 1; + } else { + channel_first = 0; + mux_num = sc->device_id * 2; + }; + + /* Take first unused eDMA channel */ + ch = NULL; + for (i = channel_first; i < (channel_first + NCHAN_PER_MUX); i++) { + ch = &edma_map[i]; + if (ch->enabled == 0) { + break; + } + ch = NULL; + }; + + if (ch == NULL) { + /* Can't find free channel */ + return (-1); + }; + + chnum = i; + + ch->enabled = 1; + ch->mux_num = mux_num; + ch->mux_src = mux_src; + ch->mux_chn = (chnum - channel_first); /* 0 to 15 */ + + dmamux_configure(ch->mux_num, ch->mux_src, ch->mux_chn, 1); + + return (chnum); +} + +static int +dma_stop(struct edma_softc *sc, int chnum) +{ + int reg; + + reg = READ4(sc, DMA_ERQ); + reg &= ~(0x1 << chnum); + WRITE4(sc, DMA_ERQ, reg); + + return (0); +} + +static int +dma_setup(struct edma_softc *sc, struct tcd_conf *tcd) +{ + struct edma_channel *ch; + int chnum; + int reg; + + chnum = tcd->channel; + + ch = &edma_map[chnum]; + ch->ih = tcd->ih; + ch->ih_user = tcd->ih_user; + + TCD_WRITE4(sc, DMA_TCDn_SADDR(chnum), tcd->saddr); + TCD_WRITE4(sc, DMA_TCDn_DADDR(chnum), tcd->daddr); + + reg = (tcd->smod << TCD_ATTR_SMOD_SHIFT); + reg |= (tcd->dmod << TCD_ATTR_DMOD_SHIFT); + reg |= (tcd->ssize << TCD_ATTR_SSIZE_SHIFT); + reg |= (tcd->dsize << TCD_ATTR_DSIZE_SHIFT); + TCD_WRITE2(sc, DMA_TCDn_ATTR(chnum), reg); + + TCD_WRITE2(sc, DMA_TCDn_SOFF(chnum), tcd->soff); + TCD_WRITE2(sc, DMA_TCDn_DOFF(chnum), tcd->doff); + TCD_WRITE4(sc, DMA_TCDn_SLAST(chnum), tcd->slast); + TCD_WRITE4(sc, DMA_TCDn_DLASTSGA(chnum), tcd->dlast_sga); + TCD_WRITE4(sc, DMA_TCDn_NBYTES_MLOFFYES(chnum), tcd->nbytes); + + reg = tcd->nmajor; /* Current Major Iteration Count */ + TCD_WRITE2(sc, DMA_TCDn_CITER_ELINKNO(chnum), reg); + TCD_WRITE2(sc, DMA_TCDn_BITER_ELINKNO(chnum), reg); + + reg = (TCD_CSR_INTMAJOR); + if(tcd->majorelink == 1) { + reg |= TCD_CSR_MAJORELINK; + reg |= (tcd->majorelinkch << TCD_CSR_MAJORELINKCH_SHIFT); + } + TCD_WRITE2(sc, DMA_TCDn_CSR(chnum), reg); + + /* Enable requests */ + reg = READ4(sc, DMA_ERQ); + reg |= (0x1 << chnum); + WRITE4(sc, DMA_ERQ, reg); + + /* Enable error interrupts */ + reg = READ4(sc, DMA_EEI); + reg |= (0x1 << chnum); + WRITE4(sc, DMA_EEI, reg); + + return (0); +} + +static int +dma_request(struct edma_softc *sc, int chnum) +{ + int reg; + + /* Start */ + reg = TCD_READ2(sc, DMA_TCDn_CSR(chnum)); + reg |= TCD_CSR_START; + TCD_WRITE2(sc, DMA_TCDn_CSR(chnum), reg); + + return (0); +} + +static int +edma_attach(device_t dev) +{ + struct edma_softc *sc; + phandle_t node; + int dts_value; + int len; + + sc = device_get_softc(dev); + sc->dev = dev; + + if ((node = ofw_bus_get_node(sc->dev)) == -1) + return (ENXIO); + + if ((len = OF_getproplen(node, "device-id")) <= 0) + return (ENXIO); + + OF_getprop(node, "device-id", &dts_value, len); + sc->device_id = fdt32_to_cpu(dts_value); + + sc->dma_stop = dma_stop; + sc->dma_setup = dma_setup; + sc->dma_request = dma_request; + sc->channel_configure = channel_configure; + sc->channel_free = channel_free; + + if (bus_alloc_resources(dev, edma_spec, sc->res)) { + device_printf(dev, "could not allocate resources\n"); + return (ENXIO); + } + + /* Memory interface */ + sc->bst = rman_get_bustag(sc->res[0]); + sc->bsh = rman_get_bushandle(sc->res[0]); + sc->bst_tcd = rman_get_bustag(sc->res[1]); + sc->bsh_tcd = rman_get_bushandle(sc->res[1]); + + /* Setup interrupt handlers */ + if (bus_setup_intr(dev, sc->res[2], INTR_TYPE_BIO | INTR_MPSAFE, + NULL, edma_transfer_complete_intr, sc, &sc->tc_ih)) { + device_printf(dev, "Unable to alloc DMA intr resource.\n"); + return (ENXIO); + } + + if (bus_setup_intr(dev, sc->res[3], INTR_TYPE_BIO | INTR_MPSAFE, + NULL, edma_err_intr, sc, &sc->err_ih)) { + device_printf(dev, "Unable to alloc DMA Err intr resource.\n"); + return (ENXIO); + } + + return (0); +} + +static device_method_t edma_methods[] = { + DEVMETHOD(device_probe, edma_probe), + DEVMETHOD(device_attach, edma_attach), + { 0, 0 } +}; + +static driver_t edma_driver = { + "edma", + edma_methods, + sizeof(struct edma_softc), +}; + +static devclass_t edma_devclass; + +DRIVER_MODULE(edma, simplebus, edma_driver, edma_devclass, 0, 0); Added: head/sys/arm/freescale/vybrid/vf_edma.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/freescale/vybrid/vf_edma.h Sat Feb 8 19:47:59 2014 (r261639) @@ -0,0 +1,186 @@ +/*- + * Copyright (c) 2014 Ruslan Bukin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#define DMA_CR 0x000 /* Control */ +#define DMA_ES 0x004 /* Error Status */ +#define DMA_ERQ 0x00C /* Enable Request */ +#define DMA_EEI 0x014 /* Enable Error Interrupt */ +#define DMA_CEEI 0x018 /* Clear Enable Error Interrupt */ +#define DMA_SEEI 0x019 /* Set Enable Error Interrupt */ +#define DMA_CERQ 0x01A /* Clear Enable Request */ +#define DMA_SERQ 0x01B /* Set Enable Request */ +#define DMA_CDNE 0x01C /* Clear DONE Status Bit */ +#define DMA_SSRT 0x01D /* Set START Bit */ +#define DMA_CERR 0x01E /* Clear Error */ +#define CERR_CAEI (1 << 6) /* Clear All Error Indicators */ +#define DMA_CINT 0x01F /* Clear Interrupt Request */ +#define CINT_CAIR (1 << 6) /* Clear All Interrupt Requests */ +#define DMA_INT 0x024 /* Interrupt Request */ +#define DMA_ERR 0x02C /* Error */ +#define DMA_HRS 0x034 /* Hardware Request Status */ +#define DMA_EARS 0x044 /* Enable Asynchronous Request in Stop */ +#define DMA_DCHPRI3 0x100 /* Channel n Priority */ +#define DMA_DCHPRI2 0x101 /* Channel n Priority */ +#define DMA_DCHPRI1 0x102 /* Channel n Priority */ +#define DMA_DCHPRI0 0x103 /* Channel n Priority */ +#define DMA_DCHPRI7 0x104 /* Channel n Priority */ +#define DMA_DCHPRI6 0x105 /* Channel n Priority */ +#define DMA_DCHPRI5 0x106 /* Channel n Priority */ +#define DMA_DCHPRI4 0x107 /* Channel n Priority */ +#define DMA_DCHPRI11 0x108 /* Channel n Priority */ +#define DMA_DCHPRI10 0x109 /* Channel n Priority */ +#define DMA_DCHPRI9 0x10A /* Channel n Priority */ +#define DMA_DCHPRI8 0x10B /* Channel n Priority */ +#define DMA_DCHPRI15 0x10C /* Channel n Priority */ +#define DMA_DCHPRI14 0x10D /* Channel n Priority */ +#define DMA_DCHPRI13 0x10E /* Channel n Priority */ +#define DMA_DCHPRI12 0x10F /* Channel n Priority */ +#define DMA_DCHPRI19 0x110 /* Channel n Priority */ +#define DMA_DCHPRI18 0x111 /* Channel n Priority */ +#define DMA_DCHPRI17 0x112 /* Channel n Priority */ +#define DMA_DCHPRI16 0x113 /* Channel n Priority */ +#define DMA_DCHPRI23 0x114 /* Channel n Priority */ +#define DMA_DCHPRI22 0x115 /* Channel n Priority */ +#define DMA_DCHPRI21 0x116 /* Channel n Priority */ +#define DMA_DCHPRI20 0x117 /* Channel n Priority */ +#define DMA_DCHPRI27 0x118 /* Channel n Priority */ +#define DMA_DCHPRI26 0x119 /* Channel n Priority */ +#define DMA_DCHPRI25 0x11A /* Channel n Priority */ +#define DMA_DCHPRI24 0x11B /* Channel n Priority */ +#define DMA_DCHPRI31 0x11C /* Channel n Priority */ +#define DMA_DCHPRI30 0x11D /* Channel n Priority */ +#define DMA_DCHPRI29 0x11E /* Channel n Priority */ +#define DMA_DCHPRI28 0x11F /* Channel n Priority */ + +#define DMA_TCDn_SADDR(n) (0x00 + 0x20 * n) /* Source Address */ +#define DMA_TCDn_SOFF(n) (0x04 + 0x20 * n) /* Signed Source Address Offset */ +#define DMA_TCDn_ATTR(n) (0x06 + 0x20 * n) /* Transfer Attributes */ +#define DMA_TCDn_NBYTES_MLNO(n) (0x08 + 0x20 * n) /* Minor Byte Count */ +#define DMA_TCDn_NBYTES_MLOFFNO(n) (0x08 + 0x20 * n) /* Signed Minor Loop Offset */ +#define DMA_TCDn_NBYTES_MLOFFYES(n) (0x08 + 0x20 * n) /* Signed Minor Loop Offset */ +#define DMA_TCDn_SLAST(n) (0x0C + 0x20 * n) /* Last Source Address Adjustment */ +#define DMA_TCDn_DADDR(n) (0x10 + 0x20 * n) /* Destination Address */ +#define DMA_TCDn_DOFF(n) (0x14 + 0x20 * n) /* Signed Destination Address Offset */ +#define DMA_TCDn_CITER_ELINKYES(n) (0x16 + 0x20 * n) /* Current Minor Loop Link, Major Loop Count */ +#define DMA_TCDn_CITER_ELINKNO(n) (0x16 + 0x20 * n) +#define DMA_TCDn_DLASTSGA(n) (0x18 + 0x20 * n) /* Last Dst Addr Adjustment/Scatter Gather Address */ +#define DMA_TCDn_CSR(n) (0x1C + 0x20 * n) /* Control and Status */ +#define DMA_TCDn_BITER_ELINKYES(n) (0x1E + 0x20 * n) /* Beginning Minor Loop Link, Major Loop Count */ +#define DMA_TCDn_BITER_ELINKNO(n) (0x1E + 0x20 * n) /* Beginning Minor Loop Link, Major Loop Count */ + +#define TCD_CSR_START (1 << 0) +#define TCD_CSR_INTMAJOR (1 << 1) +#define TCD_CSR_INTHALF (1 << 2) +#define TCD_CSR_DREQ (1 << 3) +#define TCD_CSR_ESG (1 << 4) +#define TCD_CSR_MAJORELINK (1 << 5) +#define TCD_CSR_ACTIVE (1 << 6) +#define TCD_CSR_DONE (1 << 7) +#define TCD_CSR_MAJORELINKCH_SHIFT 8 + +#define TCD_ATTR_SMOD_SHIFT 11 /* Source Address Modulo */ +#define TCD_ATTR_SSIZE_SHIFT 8 /* Source Data Transfer Size */ +#define TCD_ATTR_DMOD_SHIFT 3 /* Dst Address Modulo */ +#define TCD_ATTR_DSIZE_SHIFT 0 /* Dst Data Transfer Size */ + +#define TCD_READ4(_sc, _reg) \ + bus_space_read_4(_sc->bst_tcd, _sc->bsh_tcd, _reg) +#define TCD_WRITE4(_sc, _reg, _val) \ + bus_space_write_4(_sc->bst_tcd, _sc->bsh_tcd, _reg, _val) +#define TCD_READ2(_sc, _reg) \ + bus_space_read_2(_sc->bst_tcd, _sc->bsh_tcd, _reg) +#define TCD_WRITE2(_sc, _reg, _val) \ + bus_space_write_2(_sc->bst_tcd, _sc->bsh_tcd, _reg, _val) +#define TCD_READ1(_sc, _reg) \ + bus_space_read_1(_sc->bst_tcd, _sc->bsh_tcd, _reg) +#define TCD_WRITE1(_sc, _reg, _val) \ + bus_space_write_1(_sc->bst_tcd, _sc->bsh_tcd, _reg, _val) + +#define EDMA_NUM_DEVICES 2 +#define EDMA_NUM_CHANNELS 32 +#define NCHAN_PER_MUX 16 + +struct tcd_conf { + bus_addr_t saddr; + bus_addr_t daddr; + uint32_t nbytes; + uint32_t nmajor; + uint32_t majorelink; + uint32_t majorelinkch; + uint32_t esg; + uint32_t smod; + uint32_t dmod; + uint32_t soff; + uint32_t doff; + uint32_t ssize; + uint32_t dsize; + uint32_t slast; + uint32_t dlast_sga; + uint32_t channel; + uint32_t (*ih)(void *, int); + void *ih_user; +}; + +/* + * TCD struct is described at + * Vybrid Reference Manual, Rev. 5, 07/2013 + * + * Should be used for Scatter/Gathering feature. + */ + +struct TCD { + uint32_t saddr; + uint16_t attr; + uint16_t soff; + uint32_t nbytes; + uint32_t slast; + uint32_t daddr; + uint16_t citer; + uint16_t doff; + uint32_t dlast_sga; + uint16_t biter; + uint16_t csr; +} __packed; + +struct edma_softc { + device_t dev; + struct resource *res[4]; + bus_space_tag_t bst; + bus_space_handle_t bsh; + bus_space_tag_t bst_tcd; + bus_space_handle_t bsh_tcd; + void *tc_ih; + void *err_ih; + uint32_t device_id; + + int (*channel_configure) (struct edma_softc *, int, int); + int (*channel_free) (struct edma_softc *, int); + int (*dma_request) (struct edma_softc *, int); + int (*dma_setup) (struct edma_softc *, struct tcd_conf *); + int (*dma_stop) (struct edma_softc *, int); +}; Modified: head/sys/boot/fdt/dts/vybrid.dtsi ============================================================================== --- head/sys/boot/fdt/dts/vybrid.dtsi Sat Feb 8 16:37:54 2014 (r261638) +++ head/sys/boot/fdt/dts/vybrid.dtsi Sat Feb 8 19:47:59 2014 (r261639) @@ -111,6 +111,7 @@ <0x40019000 0x1000>; /* TCD */ interrupts = < 40 41 >; interrupt-parent = <&GIC>; + device-id = < 0 >; status = "disabled"; }; @@ -120,6 +121,7 @@ <0x40099000 0x1000>; /* TCD */ interrupts = < 42 43 >; interrupt-parent = <&GIC>; + device-id = < 1 >; status = "disabled"; }; @@ -308,6 +310,7 @@ interrupts = < 119 >; interrupt-parent = <&GIC>; status = "disabled"; + edma-controller = <&edma1>; clock_names = "sai3", "cko1"; iomux_config = < 16 0x2 19 0x2 From owner-svn-src-head@FreeBSD.ORG Sat Feb 8 22:10:53 2014 Return-Path: Delivered-To: svn-src-head@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 91470D7E; Sat, 8 Feb 2014 22:10:53 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7B77D13A8; Sat, 8 Feb 2014 22:10:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s18MArSf013196; Sat, 8 Feb 2014 22:10:53 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s18MArEJ013195; Sat, 8 Feb 2014 22:10:53 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201402082210.s18MArEJ013195@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 8 Feb 2014 22:10:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261640 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Feb 2014 22:10:53 -0000 Author: glebius Date: Sat Feb 8 22:10:53 2014 New Revision: 261640 URL: http://svnweb.freebsd.org/changeset/base/261640 Log: Spacing. Modified: head/sys/net/flowtable.c Modified: head/sys/net/flowtable.c ============================================================================== --- head/sys/net/flowtable.c Sat Feb 8 19:47:59 2014 (r261639) +++ head/sys/net/flowtable.c Sat Feb 8 22:10:53 2014 (r261640) @@ -103,7 +103,7 @@ union ipv6_flow { struct flentry { volatile uint32_t f_fhash; /* hash flowing forward */ uint16_t f_flags; /* flow flags */ - uint8_t f_pad; + uint8_t f_pad; uint8_t f_proto; /* protocol */ uint32_t f_fibnum; /* fib index */ uint32_t f_uptime; /* uptime at last access */ @@ -246,7 +246,7 @@ rtalloc_ign_wrapper(struct route *ro, ui static void flowtable_global_lock(struct flowtable *table, uint32_t hash) -{ +{ int lock_index = (hash)&(table->ft_lock_count - 1); mtx_lock(&table->ft_locks[lock_index]); @@ -254,7 +254,7 @@ flowtable_global_lock(struct flowtable * static void flowtable_global_unlock(struct flowtable *table, uint32_t hash) -{ +{ int lock_index = (hash)&(table->ft_lock_count - 1); mtx_unlock(&table->ft_locks[lock_index]); @@ -295,7 +295,7 @@ proto_to_flags(uint8_t proto) break; case IPPROTO_SCTP: flag = FL_SCTP; - break; + break; case IPPROTO_UDP: flag = FL_UDP; break; @@ -371,7 +371,7 @@ ipv4_mbuf_demarshal(struct mbuf *m, stru dsin->sin_addr = ip->ip_dst; ssin->sin_family = AF_INET; ssin->sin_len = sizeof(*ssin); - ssin->sin_addr = ip->ip_src; + ssin->sin_addr = ip->ip_src; proto = ip->ip_p; if ((*flags & FL_HASH_ALL) == 0) @@ -402,7 +402,7 @@ ipv4_mbuf_demarshal(struct mbuf *m, stru return (ENOTSUP); /* no port - hence not a protocol we care about */ break; - + } skipports: @@ -550,7 +550,7 @@ ipv6_mbuf_demarshal(struct mbuf *m, stru ulp = NULL; break; case IPPROTO_ROUTING: /* RFC 2460 */ - PULLUP_TO(hlen, ulp, struct ip6_rthdr); + PULLUP_TO(hlen, ulp, struct ip6_rthdr); hlen += (((struct ip6_rthdr *)ulp)->ip6r_len + 1) << 3; proto = ((struct ip6_rthdr *)ulp)->ip6r_nxt; ulp = NULL; @@ -613,7 +613,7 @@ do { \ key[7] = 0; \ key[8] = 0; \ } while (0) - + static uint32_t ipv6_flow_lookup_hash( struct sockaddr_in6 *ssin6, struct sockaddr_in6 *dsin6, @@ -647,7 +647,7 @@ static struct flentry * flowtable_lookup_ipv6(struct mbuf *m) { struct sockaddr_storage ssa, dsa; - struct sockaddr_in6 *dsin6, *ssin6; + struct sockaddr_in6 *dsin6, *ssin6; uint16_t flags; dsin6 = (struct sockaddr_in6 *)&dsa; @@ -655,7 +655,7 @@ flowtable_lookup_ipv6(struct mbuf *m) bzero(dsin6, sizeof(*dsin6)); bzero(ssin6, sizeof(*ssin6)); flags = V_ip6_ft.ft_flags; - + if (ipv6_mbuf_demarshal(m, ssin6, dsin6, &flags) != 0) return (NULL); @@ -706,7 +706,7 @@ flowtable_entry(struct flowtable *ft, ui KASSERT(&ft->ft_table.global[0] != NULL, ("global not set")); fle = &ft->ft_table.global[index]; } - + return (fle); } @@ -754,7 +754,7 @@ flowtable_set_hashkey(struct flentry *fl nwords = 3; hashkey = ((struct flentry_v6 *)fle)->fl_flow.ipf_key; } - + for (i = 0; i < nwords; i++) hashkey[i] = key[i]; } @@ -764,7 +764,7 @@ flow_full(struct flowtable *ft) { boolean_t full; int count, max; - + full = ft->ft_full; count = uma_zone_get_cur(ft->ft_zone); max = uma_zone_get_max(ft->ft_zone); @@ -773,7 +773,7 @@ flow_full(struct flowtable *ft) ft->ft_full = FALSE; else if (!full && (count > (max - (max >> 5)))) ft->ft_full = TRUE; - + if (full && !ft->ft_full) { flowclean_freq = 4*hz; if ((ft->ft_flags & FL_HASH_ALL) == 0) @@ -816,7 +816,7 @@ flowtable_insert(struct flowtable *ft, u *flep = fle = newfle; goto skip; } - + depth = 0; FLOWSTAT_INC(ft, ft_collisions); /* @@ -831,7 +831,7 @@ flowtable_insert(struct flowtable *ft, u */ FL_ENTRY_UNLOCK(ft, hash); uma_zfree(ft->ft_zone, newfle); - + return (EEXIST); } /* @@ -990,7 +990,7 @@ flowtable_lookup_common(struct flowtable FL_ENTRY_UNLOCK(ft, hash); goto uncached; } -keycheck: +keycheck: rt = __DEVOLATILE(struct rtentry *, fle->f_rt); lle = __DEVOLATILE(struct llentry *, fle->f_lle); if ((rt != NULL) @@ -1048,17 +1048,17 @@ uncached: l3addr = (struct sockaddr_storage *)rt->rt_gateway; else l3addr = (struct sockaddr_storage *)&ro->ro_dst; - lle = llentry_alloc(ifp, LLTABLE(ifp), l3addr); + lle = llentry_alloc(ifp, LLTABLE(ifp), l3addr); break; #endif #ifdef INET6 case AF_INET6: { struct sockaddr_in6 *dsin6; - dsin6 = (struct sockaddr_in6 *)dsa; + dsin6 = (struct sockaddr_in6 *)dsa; if (in6_localaddr(&dsin6->sin6_addr)) { RTFREE(rt); - return (NULL); + return (NULL); } if (rt->rt_flags & RTF_GATEWAY) @@ -1068,7 +1068,7 @@ uncached: lle = llentry_alloc(ifp, LLTABLE6(ifp), l3addr); break; } -#endif +#endif } if (lle == NULL) { @@ -1095,7 +1095,7 @@ success: * used by the bit_alloc macro */ #define calloc(count, size) malloc((count)*(size), M_DEVBUF, M_WAITOK|M_ZERO) - + static void flowtable_alloc(struct flowtable *ft) { @@ -1118,7 +1118,7 @@ flowtable_alloc(struct flowtable *ft) } else { ft->ft_lock_count = 2*(powerof2(mp_maxid + 1) ? (mp_maxid + 1): (fls(mp_maxid + 1) << 1)); - + ft->ft_lock = flowtable_global_lock; ft->ft_unlock = flowtable_global_unlock; ft->ft_table.global = @@ -1147,7 +1147,7 @@ flowtable_alloc(struct flowtable *ft) } else { ft->ft_udp_idle = ft->ft_fin_wait_idle = ft->ft_syn_idle = ft->ft_tcp_idle = 30; - + } } @@ -1209,7 +1209,7 @@ flowtable_free_stale(struct flowtable *f "warning bit=%d set, but no fle found\n", curbit); } -#endif +#endif while (fle != NULL) { if (rt != NULL) { if (__DEVOLATILE(struct rtentry *, fle->f_rt) != rt) { @@ -1532,7 +1532,7 @@ flowtable_entry_pcpu(struct flowtable *f } else { fle = &ft->ft_table.global[index]; } - + return (fle); } @@ -1559,7 +1559,7 @@ flow_show(struct flowtable *ft, struct f inet_ntoa_r(*(struct in_addr *) &hashkey[2], daddr); if (ft->ft_flags & FL_HASH_ALL) { - inet_ntoa_r(*(struct in_addr *) &hashkey[1], saddr); + inet_ntoa_r(*(struct in_addr *) &hashkey[1], saddr); sport = ntohs(((uint16_t *)hashkey)[0]); dport = ntohs(((uint16_t *)hashkey)[1]); db_printf("%s:%d->%s:%d", @@ -1583,9 +1583,9 @@ skipaddr: if (ifp->if_flags & IFF_LOOPBACK) db_printf(" IFF_LOOPBACK "); if (ifp->if_flags & IFF_UP) - db_printf(" IFF_UP "); + db_printf(" IFF_UP "); if (ifp->if_flags & IFF_POINTOPOINT) - db_printf(" IFF_POINTOPOINT "); + db_printf(" IFF_POINTOPOINT "); } if (fle->f_flags & FL_IPV6) db_printf("\n\tkey=%08x:%08x:%08x%08x:%08x:%08x%08x:%08x:%08x", @@ -1628,7 +1628,7 @@ flowtable_show(struct flowtable *ft, int flehead = flowtable_entry_pcpu(ft, curbit, cpuid); fle = *flehead; - while (fle != NULL) { + while (fle != NULL) { flow_show(ft, fle); fle = fle->f_next; continue; From owner-svn-src-head@FreeBSD.ORG Sat Feb 8 22:12:00 2014 Return-Path: Delivered-To: svn-src-head@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 AB43AF07; Sat, 8 Feb 2014 22:12:00 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 957B013B6; Sat, 8 Feb 2014 22:12:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s18MC0B1014134; Sat, 8 Feb 2014 22:12:00 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s18MC0H5014132; Sat, 8 Feb 2014 22:12:00 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201402082212.s18MC0H5014132@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 8 Feb 2014 22:12:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261641 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Feb 2014 22:12:00 -0000 Author: glebius Date: Sat Feb 8 22:12:00 2014 New Revision: 261641 URL: http://svnweb.freebsd.org/changeset/base/261641 Log: Remove ft_rtalloc and choose rtalloc function at compile time. Modified: head/sys/net/flowtable.c Modified: head/sys/net/flowtable.c ============================================================================== --- head/sys/net/flowtable.c Sat Feb 8 22:10:53 2014 (r261640) +++ head/sys/net/flowtable.c Sat Feb 8 22:12:00 2014 (r261641) @@ -132,7 +132,6 @@ struct flentry_v6 { typedef void fl_lock_t(struct flowtable *, uint32_t); -typedef void fl_rtalloc_t(struct route *, uint32_t, u_int); union flentryp { struct flentry **global; @@ -148,7 +147,6 @@ struct flowtable { uint32_t ft_max_depth; fl_lock_t *ft_lock; fl_lock_t *ft_unlock; - fl_rtalloc_t *ft_rtalloc; /* * XXX need to pad out */ @@ -235,15 +233,6 @@ SYSCTL_VNET_INT(_net_flowtable, OID_AUTO &VNET_NAME(flowtable_tcp_expire), 0, "seconds after which to remove flow allocated to a TCP connection."); -#ifndef RADIX_MPATH -static void -rtalloc_ign_wrapper(struct route *ro, uint32_t hash, u_int fibnum) -{ - - rtalloc_ign_fib(ro, 0, fibnum); -} -#endif - static void flowtable_global_lock(struct flowtable *table, uint32_t hash) { @@ -1029,7 +1018,12 @@ uncached: * receive the route locked */ - ft->ft_rtalloc(ro, hash, fibnum); +#ifdef RADIX_MPATH + rtalloc_mpath_fib(ro, hash, fibnum); +#else + rtalloc_ign_fib(ro, 0, fibnum); +#endif + if (ro->ro_rt == NULL) return (NULL); @@ -1100,11 +1094,6 @@ static void flowtable_alloc(struct flowtable *ft) { -#ifdef RADIX_MPATH - ft->ft_rtalloc = rtalloc_mpath_fib; -#else - ft->ft_rtalloc = rtalloc_ign_wrapper; -#endif if (ft->ft_flags & FL_PCPU) { ft->ft_lock = flowtable_pcpu_lock; ft->ft_unlock = flowtable_pcpu_unlock; From owner-svn-src-head@FreeBSD.ORG Sat Feb 8 22:21:42 2014 Return-Path: Delivered-To: svn-src-head@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 6D14E4DD; Sat, 8 Feb 2014 22:21: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5423014A6; Sat, 8 Feb 2014 22:21:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s18MLghl019219; Sat, 8 Feb 2014 22:21:42 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s18MLccf019190; Sat, 8 Feb 2014 22:21:38 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201402082221.s18MLccf019190@svn.freebsd.org> From: Ian Lepore Date: Sat, 8 Feb 2014 22:21:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261642 - in head/sys: arm/arm arm/conf arm/include arm/xscale/i80321 arm/xscale/i8134x arm/xscale/ixp425 arm/xscale/pxa conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Feb 2014 22:21:42 -0000 Author: ian Date: Sat Feb 8 22:21:38 2014 New Revision: 261642 URL: http://svnweb.freebsd.org/changeset/base/261642 Log: Remove the ARM_USE_SMALL_ALLOC option and code related to it. This was an optimization used only by a few xscale platforms. Part of the optimization was to create a direct map for all physical pages, and that resulted in making multiple mappings of pages in a way that bypassed the logic in pmap.c to handle VIVT cache aliasing. It also just generally made the code more complex and hard to maintain for all SoCs. Reviewed by: cognet Modified: head/sys/arm/arm/machdep.c head/sys/arm/arm/mem.c head/sys/arm/arm/pmap.c head/sys/arm/arm/vm_machdep.c head/sys/arm/conf/AVILA head/sys/arm/conf/CAMBRIA head/sys/arm/conf/CNS11XXNAS head/sys/arm/conf/CRB head/sys/arm/conf/EP80219 head/sys/arm/conf/IQ31244 head/sys/arm/conf/NSLU head/sys/arm/include/pmap.h head/sys/arm/include/sf_buf.h head/sys/arm/include/vmparam.h head/sys/arm/xscale/i80321/ep80219_machdep.c head/sys/arm/xscale/i80321/iq31244_machdep.c head/sys/arm/xscale/i8134x/crb_machdep.c head/sys/arm/xscale/ixp425/avila_machdep.c head/sys/arm/xscale/pxa/pxa_machdep.c head/sys/arm/xscale/pxa/std.pxa head/sys/conf/options.arm Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Sat Feb 8 22:12:00 2014 (r261641) +++ head/sys/arm/arm/machdep.c Sat Feb 8 22:21:38 2014 (r261642) @@ -783,9 +783,6 @@ makectx(struct trapframe *tf, struct pcb * Make a standard dump_avail array. Can't make the phys_avail * since we need to do that after we call pmap_bootstrap, but this * is needed before pmap_boostrap. - * - * ARM_USE_SMALL_ALLOC uses dump_avail, so it must be filled before - * calling pmap_bootstrap. */ void arm_dump_avail_init(vm_paddr_t physaddr, vm_offset_t ramsize, size_t max) Modified: head/sys/arm/arm/mem.c ============================================================================== --- head/sys/arm/arm/mem.c Sat Feb 8 22:12:00 2014 (r261641) +++ head/sys/arm/arm/mem.c Sat Feb 8 22:21:38 2014 (r261642) @@ -135,10 +135,6 @@ memrw(struct cdev *dev, struct uio *uio, if (!kernacc((caddr_t)(int)uio->uio_offset, c, uio->uio_rw == UIO_READ ? VM_PROT_READ : VM_PROT_WRITE)) -#ifdef ARM_USE_SMALL_ALLOC - if (addr <= VM_MAXUSER_ADDRESS || - addr >= KERNBASE) -#endif return (EFAULT); error = uiomove((caddr_t)(int)uio->uio_offset, (int)c, uio); continue; Modified: head/sys/arm/arm/pmap.c ============================================================================== --- head/sys/arm/arm/pmap.c Sat Feb 8 22:12:00 2014 (r261641) +++ head/sys/arm/arm/pmap.c Sat Feb 8 22:21:38 2014 (r261642) @@ -1069,9 +1069,7 @@ pmap_l2ptp_ctor(void *mem, int size, voi #ifndef PMAP_INCLUDE_PTE_SYNC struct l2_bucket *l2b; pt_entry_t *ptep, pte; -#ifdef ARM_USE_SMALL_ALLOC - pd_entry_t *pde; -#endif + vm_offset_t va = (vm_offset_t)mem & ~PAGE_MASK; /* @@ -1082,10 +1080,6 @@ pmap_l2ptp_ctor(void *mem, int size, voi * page tables, we simply fix up the cache-mode here if it's not * correct. */ -#ifdef ARM_USE_SMALL_ALLOC - pde = &kernel_pmap->pm_l1->l1_kva[L1_IDX(va)]; - if (!l1pte_section_p(*pde)) { -#endif l2b = pmap_get_l2_bucket(pmap_kernel(), va); ptep = &l2b->l2b_kva[l2pte_index(va)]; pte = *ptep; @@ -1100,9 +1094,6 @@ pmap_l2ptp_ctor(void *mem, int size, voi cpu_tlb_flushD_SE(va); cpu_cpwait(); } -#ifdef ARM_USE_SMALL_ALLOC - } -#endif #endif memset(mem, 0, L2_TABLE_SIZE_REAL); PTE_SYNC_RANGE(mem, L2_TABLE_SIZE_REAL / sizeof(pt_entry_t)); @@ -2259,10 +2250,6 @@ pmap_alloc_specials(vm_offset_t *availp, * (physical) address starting relative to 0] */ #define PMAP_STATIC_L2_SIZE 16 -#ifdef ARM_USE_SMALL_ALLOC -extern struct mtx smallalloc_mtx; -#endif - void pmap_bootstrap(vm_offset_t firstaddr, struct pv_addr *l1pt) { @@ -2422,10 +2409,6 @@ pmap_bootstrap(vm_offset_t firstaddr, st kernel_vm_end = pmap_curmaxkvaddr; mtx_init(&cmtx, "TMP mappings mtx", NULL, MTX_DEF); -#ifdef ARM_USE_SMALL_ALLOC - mtx_init(&smallalloc_mtx, "Small alloc page list", NULL, MTX_DEF); - arm_init_smallalloc(); -#endif pmap_set_pcb_pagedir(kernel_pmap, thread0.td_pcb); } @@ -2669,11 +2652,7 @@ pmap_remove_pages(pmap_t pmap) KASSERT(l2b != NULL, ("No L2 bucket in pmap_remove_pages")); pt = &l2b->l2b_kva[l2pte_index(pv->pv_va)]; m = PHYS_TO_VM_PAGE(*pt & L2_ADDR_MASK); -#ifdef ARM_USE_SMALL_ALLOC - KASSERT((vm_offset_t)m >= alloc_firstaddr, ("Trying to access non-existent page va %x pte %x", pv->pv_va, *pt)); -#else KASSERT((vm_offset_t)m >= KERNBASE, ("Trying to access non-existent page va %x pte %x", pv->pv_va, *pt)); -#endif *pt = 0; PTE_SYNC(pt); npv = TAILQ_NEXT(pv, pv_plist); @@ -2932,9 +2911,6 @@ pmap_kremove(vm_offset_t va) vm_offset_t pmap_map(vm_offset_t *virt, vm_offset_t start, vm_offset_t end, int prot) { -#ifdef ARM_USE_SMALL_ALLOC - return (arm_ptovirt(start)); -#else vm_offset_t sva = *virt; vm_offset_t va = sva; @@ -2949,7 +2925,6 @@ pmap_map(vm_offset_t *virt, vm_offset_t } *virt = va; return (sva); -#endif } static void @@ -4007,27 +3982,11 @@ pmap_remove(pmap_t pm, vm_offset_t sva, void pmap_zero_page_generic(vm_paddr_t phys, int off, int size) { -#ifdef ARM_USE_SMALL_ALLOC - char *dstpg; -#endif if (_arm_bzero && size >= _min_bzero_size && _arm_bzero((void *)(phys + off), size, IS_PHYSICAL) == 0) return; -#ifdef ARM_USE_SMALL_ALLOC - dstpg = (char *)arm_ptovirt(phys); - if (off || size != PAGE_SIZE) { - bzero(dstpg + off, size); - cpu_dcache_wbinv_range((vm_offset_t)(dstpg + off), size); - cpu_l2cache_wbinv_range((vm_offset_t)(dstpg + off), size); - } else { - bzero_page((vm_offset_t)dstpg); - cpu_dcache_wbinv_range((vm_offset_t)dstpg, PAGE_SIZE); - cpu_l2cache_wbinv_range((vm_offset_t)dstpg, PAGE_SIZE); - } -#else - mtx_lock(&cmtx); /* * Hook in the page, zero it, invalidate the TLB as needed. @@ -4045,7 +4004,6 @@ pmap_zero_page_generic(vm_paddr_t phys, bzero_page(cdstp); mtx_unlock(&cmtx); -#endif } #endif /* (ARM_MMU_GENERIC + ARM_MMU_SA1) != 0 */ @@ -4053,23 +4011,11 @@ pmap_zero_page_generic(vm_paddr_t phys, void pmap_zero_page_xscale(vm_paddr_t phys, int off, int size) { -#ifdef ARM_USE_SMALL_ALLOC - char *dstpg; -#endif if (_arm_bzero && size >= _min_bzero_size && _arm_bzero((void *)(phys + off), size, IS_PHYSICAL) == 0) return; -#ifdef ARM_USE_SMALL_ALLOC - dstpg = (char *)arm_ptovirt(phys); - if (off || size != PAGE_SIZE) { - bzero(dstpg + off, size); - cpu_dcache_wbinv_range((vm_offset_t)(dstpg + off), size); - } else { - bzero_page((vm_offset_t)dstpg); - cpu_dcache_wbinv_range((vm_offset_t)dstpg, PAGE_SIZE); - } -#else + mtx_lock(&cmtx); /* * Hook in the page, zero it, and purge the cache for that @@ -4087,7 +4033,6 @@ pmap_zero_page_xscale(vm_paddr_t phys, i bzero_page(cdstp); mtx_unlock(&cmtx); xscale_cache_clean_minidata(); -#endif } /* @@ -4412,9 +4357,6 @@ pmap_copy_page_offs_xscale(vm_paddr_t a_ void pmap_copy_page(vm_page_t src, vm_page_t dst) { -#ifdef ARM_USE_SMALL_ALLOC - vm_offset_t srcpg, dstpg; -#endif cpu_dcache_wbinv_all(); cpu_l2cache_wbinv_all(); @@ -4422,15 +4364,7 @@ pmap_copy_page(vm_page_t src, vm_page_t _arm_memcpy((void *)VM_PAGE_TO_PHYS(dst), (void *)VM_PAGE_TO_PHYS(src), PAGE_SIZE, IS_PHYSICAL) == 0) return; -#ifdef ARM_USE_SMALL_ALLOC - srcpg = arm_ptovirt(VM_PAGE_TO_PHYS(src)); - dstpg = arm_ptovirt(VM_PAGE_TO_PHYS(dst)); - bcopy_page(srcpg, dstpg); - cpu_dcache_wbinv_range(dstpg, PAGE_SIZE); - cpu_l2cache_wbinv_range(dstpg, PAGE_SIZE); -#else pmap_copy_page_func(VM_PAGE_TO_PHYS(src), VM_PAGE_TO_PHYS(dst)); -#endif } int unmapped_buf_allowed = 1; @@ -4442,9 +4376,6 @@ pmap_copy_pages(vm_page_t ma[], vm_offse vm_page_t a_pg, b_pg; vm_offset_t a_pg_offset, b_pg_offset; int cnt; -#ifdef ARM_USE_SMALL_ALLOC - vm_offset_t a_va, b_va; -#endif cpu_dcache_wbinv_all(); cpu_l2cache_wbinv_all(); @@ -4455,16 +4386,8 @@ pmap_copy_pages(vm_page_t ma[], vm_offse b_pg = mb[b_offset >> PAGE_SHIFT]; b_pg_offset = b_offset & PAGE_MASK; cnt = min(cnt, PAGE_SIZE - b_pg_offset); -#ifdef ARM_USE_SMALL_ALLOC - a_va = arm_ptovirt(VM_PAGE_TO_PHYS(a_pg)) + a_pg_offset; - b_va = arm_ptovirt(VM_PAGE_TO_PHYS(b_pg)) + b_pg_offset; - bcopy((char *)a_va, (char *)b_va, cnt); - cpu_dcache_wbinv_range(b_va, cnt); - cpu_l2cache_wbinv_range(b_va, cnt); -#else pmap_copy_page_offs_func(VM_PAGE_TO_PHYS(a_pg), a_pg_offset, VM_PAGE_TO_PHYS(b_pg), b_pg_offset, cnt); -#endif xfersize -= cnt; a_offset += cnt; b_offset += cnt; Modified: head/sys/arm/arm/vm_machdep.c ============================================================================== --- head/sys/arm/arm/vm_machdep.c Sat Feb 8 22:12:00 2014 (r261641) +++ head/sys/arm/arm/vm_machdep.c Sat Feb 8 22:21:38 2014 (r261642) @@ -82,8 +82,6 @@ __FBSDID("$FreeBSD$"); CTASSERT(sizeof(struct switchframe) == 24); CTASSERT(sizeof(struct trapframe) == 80); -#ifndef ARM_USE_SMALL_ALLOC - #ifndef NSFBUFS #define NSFBUFS (512 + maxusers * 16) #endif @@ -119,7 +117,6 @@ static u_int sf_buf_alloc_want; * A lock used to synchronize access to the hash table and free list */ static struct mtx sf_buf_lock; -#endif /* !ARM_USE_SMALL_ALLOC */ /* * Finish a fork operation, with process p2 nearly set up. @@ -191,7 +188,7 @@ cpu_thread_swapout(struct thread *td) void sf_buf_free(struct sf_buf *sf) { -#ifndef ARM_USE_SMALL_ALLOC + mtx_lock(&sf_buf_lock); sf->ref_count--; if (sf->ref_count == 0) { @@ -204,10 +201,8 @@ sf_buf_free(struct sf_buf *sf) wakeup(&sf_buf_freelist); } mtx_unlock(&sf_buf_lock); -#endif } -#ifndef ARM_USE_SMALL_ALLOC /* * Allocate a pool of sf_bufs (sendfile(2) or "super-fast" if you prefer. :-)) */ @@ -233,7 +228,6 @@ sf_buf_init(void *arg) sf_buf_alloc_want = 0; mtx_init(&sf_buf_lock, "sf_buf", NULL, MTX_DEF); } -#endif /* * Get an sf_buf from the freelist. Will block if none are available. @@ -241,9 +235,6 @@ sf_buf_init(void *arg) struct sf_buf * sf_buf_alloc(struct vm_page *m, int flags) { -#ifdef ARM_USE_SMALL_ALLOC - return ((struct sf_buf *)m); -#else struct sf_head *hash_list; struct sf_buf *sf; int error; @@ -289,7 +280,6 @@ sf_buf_alloc(struct vm_page *m, int flag done: mtx_unlock(&sf_buf_lock); return (sf); -#endif } void @@ -492,194 +482,3 @@ cpu_exit(struct thread *td) { } -#ifdef ARM_USE_SMALL_ALLOC - -static TAILQ_HEAD(,arm_small_page) pages_normal = - TAILQ_HEAD_INITIALIZER(pages_normal); -static TAILQ_HEAD(,arm_small_page) pages_wt = - TAILQ_HEAD_INITIALIZER(pages_wt); -static TAILQ_HEAD(,arm_small_page) free_pgdesc = - TAILQ_HEAD_INITIALIZER(free_pgdesc); - -extern uma_zone_t l2zone; - -struct mtx smallalloc_mtx; - -vm_offset_t alloc_firstaddr; - -#ifdef ARM_HAVE_SUPERSECTIONS -#define S_FRAME L1_SUP_FRAME -#define S_SIZE L1_SUP_SIZE -#else -#define S_FRAME L1_S_FRAME -#define S_SIZE L1_S_SIZE -#endif - -vm_offset_t -arm_ptovirt(vm_paddr_t pa) -{ - int i; - vm_offset_t addr = alloc_firstaddr; - - KASSERT(alloc_firstaddr != 0, ("arm_ptovirt called too early ?")); - for (i = 0; dump_avail[i + 1]; i += 2) { - if (pa >= dump_avail[i] && pa < dump_avail[i + 1]) - break; - addr += (dump_avail[i + 1] & S_FRAME) + S_SIZE - - (dump_avail[i] & S_FRAME); - } - KASSERT(dump_avail[i + 1] != 0, ("Trying to access invalid physical address")); - return (addr + (pa - (dump_avail[i] & S_FRAME))); -} - -void -arm_init_smallalloc(void) -{ - vm_offset_t to_map = 0, mapaddr; - int i; - - /* - * We need to use dump_avail and not phys_avail, since we want to - * map the whole memory and not just the memory available to the VM - * to be able to do a pa => va association for any address. - */ - - for (i = 0; dump_avail[i + 1]; i+= 2) { - to_map += (dump_avail[i + 1] & S_FRAME) + S_SIZE - - (dump_avail[i] & S_FRAME); - } - alloc_firstaddr = mapaddr = KERNBASE - to_map; - for (i = 0; dump_avail[i + 1]; i+= 2) { - vm_offset_t size = (dump_avail[i + 1] & S_FRAME) + - S_SIZE - (dump_avail[i] & S_FRAME); - vm_offset_t did = 0; - while (size > 0) { -#ifdef ARM_HAVE_SUPERSECTIONS - pmap_kenter_supersection(mapaddr, - (dump_avail[i] & L1_SUP_FRAME) + did, - SECTION_CACHE); -#else - pmap_kenter_section(mapaddr, - (dump_avail[i] & L1_S_FRAME) + did, SECTION_CACHE); -#endif - mapaddr += S_SIZE; - did += S_SIZE; - size -= S_SIZE; - } - } -} - -void -arm_add_smallalloc_pages(void *list, void *mem, int bytes, int pagetable) -{ - struct arm_small_page *pg; - - bytes &= ~PAGE_MASK; - while (bytes > 0) { - pg = (struct arm_small_page *)list; - pg->addr = mem; - if (pagetable) - TAILQ_INSERT_HEAD(&pages_wt, pg, pg_list); - else - TAILQ_INSERT_HEAD(&pages_normal, pg, pg_list); - list = (char *)list + sizeof(*pg); - mem = (char *)mem + PAGE_SIZE; - bytes -= PAGE_SIZE; - } -} - -void * -uma_small_alloc(uma_zone_t zone, int bytes, u_int8_t *flags, int wait) -{ - void *ret; - struct arm_small_page *sp; - TAILQ_HEAD(,arm_small_page) *head; - vm_page_t m; - - *flags = UMA_SLAB_PRIV; - /* - * For CPUs where we setup page tables as write back, there's no - * need to maintain two separate pools. - */ - if (zone == l2zone && pte_l1_s_cache_mode != pte_l1_s_cache_mode_pt) - head = (void *)&pages_wt; - else - head = (void *)&pages_normal; - - mtx_lock(&smallalloc_mtx); - sp = TAILQ_FIRST(head); - - if (!sp) { - int pflags; - - mtx_unlock(&smallalloc_mtx); - if (zone == l2zone && - pte_l1_s_cache_mode != pte_l1_s_cache_mode_pt) { - *flags = UMA_SLAB_KMEM; - ret = ((void *)kmem_malloc(kmem_arena, bytes, - M_NOWAIT)); - return (ret); - } - pflags = malloc2vm_flags(wait) | VM_ALLOC_WIRED; - for (;;) { - m = vm_page_alloc(NULL, 0, pflags | VM_ALLOC_NOOBJ); - if (m == NULL) { - if (wait & M_NOWAIT) - return (NULL); - VM_WAIT; - } else - break; - } - ret = (void *)arm_ptovirt(VM_PAGE_TO_PHYS(m)); - if ((wait & M_ZERO) && (m->flags & PG_ZERO) == 0) - bzero(ret, PAGE_SIZE); - return (ret); - } - TAILQ_REMOVE(head, sp, pg_list); - TAILQ_INSERT_HEAD(&free_pgdesc, sp, pg_list); - ret = sp->addr; - mtx_unlock(&smallalloc_mtx); - if ((wait & M_ZERO)) - bzero(ret, bytes); - return (ret); -} - -void -uma_small_free(void *mem, int size, u_int8_t flags) -{ - pd_entry_t *pd; - pt_entry_t *pt; - - if (flags & UMA_SLAB_KMEM) - kmem_free(kmem_arena, (vm_offset_t)mem, size); - else { - struct arm_small_page *sp; - - if ((vm_offset_t)mem >= KERNBASE) { - mtx_lock(&smallalloc_mtx); - sp = TAILQ_FIRST(&free_pgdesc); - KASSERT(sp != NULL, ("No more free page descriptor ?")); - TAILQ_REMOVE(&free_pgdesc, sp, pg_list); - sp->addr = mem; - pmap_get_pde_pte(kernel_pmap, (vm_offset_t)mem, &pd, - &pt); - if ((*pd & pte_l1_s_cache_mask) == - pte_l1_s_cache_mode_pt && - pte_l1_s_cache_mode_pt != pte_l1_s_cache_mode) - TAILQ_INSERT_HEAD(&pages_wt, sp, pg_list); - else - TAILQ_INSERT_HEAD(&pages_normal, sp, pg_list); - mtx_unlock(&smallalloc_mtx); - } else { - vm_page_t m; - vm_paddr_t pa = vtophys((vm_offset_t)mem); - - m = PHYS_TO_VM_PAGE(pa); - m->wire_count--; - vm_page_free(m); - atomic_subtract_int(&cnt.v_wire_count, 1); - } - } -} - -#endif Modified: head/sys/arm/conf/AVILA ============================================================================== --- head/sys/arm/conf/AVILA Sat Feb 8 22:12:00 2014 (r261641) +++ head/sys/arm/conf/AVILA Sat Feb 8 22:21:38 2014 (r261642) @@ -24,7 +24,6 @@ include "../xscale/ixp425/std.ixp425" # NB: memory mapping is defined in std.avila include "../xscale/ixp425/std.avila" options XSCALE_CACHE_READ_WRITE_ALLOCATE -#options ARM_USE_SMALL_ALLOC #To statically compile in device wiring instead of /boot/device.hints hints "AVILA.hints" #Default places to look for devices. makeoptions MODULES_OVERRIDE="" Modified: head/sys/arm/conf/CAMBRIA ============================================================================== --- head/sys/arm/conf/CAMBRIA Sat Feb 8 22:12:00 2014 (r261641) +++ head/sys/arm/conf/CAMBRIA Sat Feb 8 22:21:38 2014 (r261642) @@ -24,7 +24,6 @@ include "../xscale/ixp425/std.ixp435" # NB: memory mapping is defined in std.avila include "../xscale/ixp425/std.avila" options XSCALE_CACHE_READ_WRITE_ALLOCATE -#options ARM_USE_SMALL_ALLOC #To statically compile in device wiring instead of /boot/device.hints hints "CAMBRIA.hints" # Default places to look for devices. Modified: head/sys/arm/conf/CNS11XXNAS ============================================================================== --- head/sys/arm/conf/CNS11XXNAS Sat Feb 8 22:12:00 2014 (r261641) +++ head/sys/arm/conf/CNS11XXNAS Sat Feb 8 22:21:38 2014 (r261642) @@ -102,7 +102,6 @@ device loop device md device random # Entropy device -#options ARM_USE_SMALL_ALLOC device usb #options USB_DEBUG Modified: head/sys/arm/conf/CRB ============================================================================== --- head/sys/arm/conf/CRB Sat Feb 8 22:12:00 2014 (r261641) +++ head/sys/arm/conf/CRB Sat Feb 8 22:21:38 2014 (r261642) @@ -106,6 +106,5 @@ device md device random # Entropy device device iopwdog -options ARM_USE_SMALL_ALLOC # Floppy drives Modified: head/sys/arm/conf/EP80219 ============================================================================== --- head/sys/arm/conf/EP80219 Sat Feb 8 22:12:00 2014 (r261641) +++ head/sys/arm/conf/EP80219 Sat Feb 8 22:21:38 2014 (r261642) @@ -101,7 +101,6 @@ options XSCALE_CACHE_READ_WRITE_ALLOCAT device md device random # Entropy device -options ARM_USE_SMALL_ALLOC # Floppy drives options INCLUDE_CONFIG_FILE # Include this file in kernel Modified: head/sys/arm/conf/IQ31244 ============================================================================== --- head/sys/arm/conf/IQ31244 Sat Feb 8 22:12:00 2014 (r261641) +++ head/sys/arm/conf/IQ31244 Sat Feb 8 22:21:38 2014 (r261642) @@ -106,6 +106,5 @@ options XSCALE_CACHE_READ_WRITE_ALLOCAT device md device random # Entropy device -options ARM_USE_SMALL_ALLOC # Floppy drives Modified: head/sys/arm/conf/NSLU ============================================================================== --- head/sys/arm/conf/NSLU Sat Feb 8 22:12:00 2014 (r261641) +++ head/sys/arm/conf/NSLU Sat Feb 8 22:21:38 2014 (r261642) @@ -105,8 +105,6 @@ device loop device md device random # Entropy device -#options ARM_USE_SMALL_ALLOC - device usb options USB_DEBUG device ohci Modified: head/sys/arm/include/pmap.h ============================================================================== --- head/sys/arm/include/pmap.h Sat Feb 8 22:12:00 2014 (r261641) +++ head/sys/arm/include/pmap.h Sat Feb 8 22:21:38 2014 (r261642) @@ -708,17 +708,6 @@ extern char *_tmppt; void pmap_postinit(void); -#ifdef ARM_USE_SMALL_ALLOC -void arm_add_smallalloc_pages(void *, void *, int, int); -vm_offset_t arm_ptovirt(vm_paddr_t); -void arm_init_smallalloc(void); -struct arm_small_page { - void *addr; - TAILQ_ENTRY(arm_small_page) pg_list; -}; - -#endif - extern vm_paddr_t dump_avail[]; #endif /* _KERNEL */ Modified: head/sys/arm/include/sf_buf.h ============================================================================== --- head/sys/arm/include/sf_buf.h Sat Feb 8 22:12:00 2014 (r261641) +++ head/sys/arm/include/sf_buf.h Sat Feb 8 22:21:38 2014 (r261642) @@ -29,33 +29,10 @@ #ifndef _MACHINE_SF_BUF_H_ #define _MACHINE_SF_BUF_H_ +#include struct vm_page; -#ifdef ARM_USE_SMALL_ALLOC - -#include -#include -#include - -struct sf_buf; - -static __inline vm_offset_t -sf_buf_kva(struct sf_buf *sf) -{ - return arm_ptovirt(VM_PAGE_TO_PHYS((vm_page_t)sf)); -} - -static __inline vm_page_t -sf_buf_page(struct sf_buf *sf) -{ - return ((vm_page_t)sf); -} - -#else - -#include - struct sf_buf { LIST_ENTRY(sf_buf) list_entry; /* list of buffers */ TAILQ_ENTRY(sf_buf) free_entry; /* list of buffers */ @@ -78,8 +55,6 @@ sf_buf_page(struct sf_buf *sf) return (sf->m); } -#endif - struct sf_buf * sf_buf_alloc(struct vm_page *m, int flags); void sf_buf_free(struct sf_buf *sf); Modified: head/sys/arm/include/vmparam.h ============================================================================== --- head/sys/arm/include/vmparam.h Sat Feb 8 22:12:00 2014 (r261641) +++ head/sys/arm/include/vmparam.h Sat Feb 8 22:21:38 2014 (r261642) @@ -82,21 +82,15 @@ #define VM_PHYSSEG_DENSE /* - * Create two or three free page pools depending on the existence of a direct - * map: VM_FREEPOOL_DEFAULT is the default pool from which physical pages are - * allocated, and VM_FREEPOOL_DIRECT is the pool from which physical pages for - * small UMA objects are allocated. - */ -#ifdef ARM_USE_SMALL_ALLOC -#define VM_NFREEPOOL 3 -#define VM_FREEPOOL_CACHE 2 -#define VM_FREEPOOL_DIRECT 1 -#else + * Create two free page pools. Since the ARM kernel virtual address + * space does not include a mapping onto the machine's entire physical + * memory, VM_FREEPOOL_DIRECT is defined as an alias for the default + * pool, VM_FREEPOOL_DEFAULT. + */ #define VM_NFREEPOOL 2 #define VM_FREEPOOL_CACHE 1 -#define VM_FREEPOOL_DIRECT 0 -#endif #define VM_FREEPOOL_DEFAULT 0 +#define VM_FREEPOOL_DIRECT 0 /* * we support 2 free lists: @@ -132,23 +126,9 @@ #define UPT_MIN_ADDRESS VADDR(UPTPTDI, 0) #define VM_MIN_ADDRESS (0x00001000) -#ifdef ARM_USE_SMALL_ALLOC -/* - * ARM_KERN_DIRECTMAP is used to make sure there's enough space between - * VM_MAXUSER_ADDRESS and KERNBASE to map the whole memory. - * It has to be a compile-time constant, even if arm_init_smallalloc(), - * which will do the mapping, gets the real amount of memory at runtime, - * because VM_MAXUSER_ADDRESS is a constant. - */ -#ifndef ARM_KERN_DIRECTMAP -#define ARM_KERN_DIRECTMAP 512 * 1024 * 1024 /* 512 MB */ -#endif -#define VM_MAXUSER_ADDRESS KERNBASE - ARM_KERN_DIRECTMAP -#else /* ARM_USE_SMALL_ALLOC */ #ifndef VM_MAXUSER_ADDRESS #define VM_MAXUSER_ADDRESS KERNBASE #endif /* VM_MAXUSER_ADDRESS */ -#endif /* ARM_USE_SMALL_ALLOC */ #define VM_MAX_ADDRESS VM_MAXUSER_ADDRESS #define USRSTACK VM_MAXUSER_ADDRESS @@ -187,10 +167,6 @@ VM_MIN_KERNEL_ADDRESS + 1) * 2 / 5) #endif -#ifdef ARM_USE_SMALL_ALLOC -#define UMA_MD_SMALL_ALLOC -#endif /* ARM_USE_SMALL_ALLOC */ - extern vm_offset_t vm_max_kernel_address; #define ZERO_REGION_SIZE (64 * 1024) /* 64KB */ Modified: head/sys/arm/xscale/i80321/ep80219_machdep.c ============================================================================== --- head/sys/arm/xscale/i80321/ep80219_machdep.c Sat Feb 8 22:12:00 2014 (r261641) +++ head/sys/arm/xscale/i80321/ep80219_machdep.c Sat Feb 8 22:21:38 2014 (r261642) @@ -231,21 +231,6 @@ initarm(struct arm_boot_params *abp) valloc_pages(kernelstack, KSTACK_PAGES); alloc_pages(minidataclean.pv_pa, 1); valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); -#ifdef ARM_USE_SMALL_ALLOC - freemempos -= PAGE_SIZE; - freemem_pt = trunc_page(freemem_pt); - freemem_after = freemempos - ((freemem_pt - 0xa0100000) / - PAGE_SIZE) * sizeof(struct arm_small_page); - arm_add_smallalloc_pages((void *)(freemem_after + 0x20000000), - (void *)0xc0100000, freemem_pt - 0xa0100000, 1); - freemem_after -= ((freemem_after - 0xa0001000) / PAGE_SIZE) * - sizeof(struct arm_small_page); - arm_add_smallalloc_pages((void *)(freemem_after + 0x20000000), - (void *)0xc0001000, trunc_page(freemem_after) - 0xa0001000, 0); - - freemempos = trunc_page(freemem_after); - freemempos -= PAGE_SIZE; -#endif /* * Allocate memory for the l1 and l2 page tables. The scheme to avoid * wasting memory by allocating the l1pt on the first 16k memory was @@ -285,15 +270,6 @@ initarm(struct arm_boot_params *abp) VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); -#ifdef ARM_USE_SMALL_ALLOC - if ((freemem_after + 2 * PAGE_SIZE) <= afterkern) { - arm_add_smallalloc_pages((void *)(freemem_after), - (void*)(freemem_after + PAGE_SIZE), - afterkern - (freemem_after + PAGE_SIZE), 0); - - } -#endif - /* Map the Mini-Data cache clean area. */ xscale_setup_minidata(l1pagetable, afterkern, minidataclean.pv_pa); @@ -359,10 +335,6 @@ initarm(struct arm_boot_params *abp) arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); pmap_curmaxkvaddr = afterkern + PAGE_SIZE; - /* - * ARM_USE_SMALL_ALLOC uses dump_avail, so it must be filled before - * calling pmap_bootstrap. - */ dump_avail[0] = 0xa0000000; dump_avail[1] = 0xa0000000 + memsize; dump_avail[2] = 0; @@ -375,13 +347,6 @@ initarm(struct arm_boot_params *abp) mutex_init(); i = 0; -#ifdef ARM_USE_SMALL_ALLOC - phys_avail[i++] = 0xa0000000; - phys_avail[i++] = 0xa0001000; /* - *XXX: Gross hack to get our - * pages in the vm_page_array - . */ -#endif phys_avail[i++] = round_page(virtual_avail - KERNBASE + IQ80321_SDRAM_START); phys_avail[i++] = trunc_page(0xa0000000 + memsize - 1); phys_avail[i++] = 0; Modified: head/sys/arm/xscale/i80321/iq31244_machdep.c ============================================================================== --- head/sys/arm/xscale/i80321/iq31244_machdep.c Sat Feb 8 22:12:00 2014 (r261641) +++ head/sys/arm/xscale/i80321/iq31244_machdep.c Sat Feb 8 22:21:38 2014 (r261642) @@ -232,21 +232,6 @@ initarm(struct arm_boot_params *abp) valloc_pages(kernelstack, KSTACK_PAGES); alloc_pages(minidataclean.pv_pa, 1); valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); -#ifdef ARM_USE_SMALL_ALLOC - freemempos -= PAGE_SIZE; - freemem_pt = trunc_page(freemem_pt); - freemem_after = freemempos - ((freemem_pt - 0xa0100000) / - PAGE_SIZE) * sizeof(struct arm_small_page); - arm_add_smallalloc_pages((void *)(freemem_after + 0x20000000), - (void *)0xc0100000, freemem_pt - 0xa0100000, 1); - freemem_after -= ((freemem_after - 0xa0001000) / PAGE_SIZE) * - sizeof(struct arm_small_page); - arm_add_smallalloc_pages((void *)(freemem_after + 0x20000000), - (void *)0xc0001000, trunc_page(freemem_after) - 0xa0001000, 0); - - freemempos = trunc_page(freemem_after); - freemempos -= PAGE_SIZE; -#endif /* * Allocate memory for the l1 and l2 page tables. The scheme to avoid * wasting memory by allocating the l1pt on the first 16k memory was @@ -286,15 +271,6 @@ initarm(struct arm_boot_params *abp) VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); -#ifdef ARM_USE_SMALL_ALLOC - if ((freemem_after + 2 * PAGE_SIZE) <= afterkern) { - arm_add_smallalloc_pages((void *)(freemem_after), - (void*)(freemem_after + PAGE_SIZE), - afterkern - (freemem_after + PAGE_SIZE), 0); - - } -#endif - /* Map the Mini-Data cache clean area. */ xscale_setup_minidata(l1pagetable, afterkern, minidataclean.pv_pa); @@ -360,10 +336,6 @@ initarm(struct arm_boot_params *abp) arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); pmap_curmaxkvaddr = afterkern + PAGE_SIZE; - /* - * ARM_USE_SMALL_ALLOC uses dump_avail, so it must be filled before - * calling pmap_bootstrap. - */ dump_avail[0] = 0xa0000000; dump_avail[1] = 0xa0000000 + memsize; dump_avail[2] = 0; @@ -376,13 +348,6 @@ initarm(struct arm_boot_params *abp) mutex_init(); i = 0; -#ifdef ARM_USE_SMALL_ALLOC - phys_avail[i++] = 0xa0000000; - phys_avail[i++] = 0xa0001000; /* - *XXX: Gross hack to get our - * pages in the vm_page_array - . */ -#endif phys_avail[i++] = round_page(virtual_avail - KERNBASE + SDRAM_START); phys_avail[i++] = trunc_page(0xa0000000 + memsize - 1); phys_avail[i++] = 0; Modified: head/sys/arm/xscale/i8134x/crb_machdep.c ============================================================================== --- head/sys/arm/xscale/i8134x/crb_machdep.c Sat Feb 8 22:12:00 2014 (r261641) +++ head/sys/arm/xscale/i8134x/crb_machdep.c Sat Feb 8 22:21:38 2014 (r261642) @@ -230,22 +230,6 @@ initarm(struct arm_boot_params *abp) valloc_pages(undstack, UND_STACK_SIZE); valloc_pages(kernelstack, KSTACK_PAGES); valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); -#ifdef ARM_USE_SMALL_ALLOC - freemempos -= PAGE_SIZE; - freemem_pt = trunc_page(freemem_pt); - freemem_after = freemempos - ((freemem_pt - 0x00100000) / - PAGE_SIZE) * sizeof(struct arm_small_page); - arm_add_smallalloc_pages((void *)(freemem_after + 0xc0000000) - , (void *)0xc0100000, freemem_pt - 0x00100000, 1); - freemem_after -= ((freemem_after - 0x00001000) / PAGE_SIZE) * - sizeof(struct arm_small_page); -#if 0 - arm_add_smallalloc_pages((void *)(freemem_after + 0xc0000000) - , (void *)0xc0001000, trunc_page(freemem_after) - 0x00001000, 0); -#endif - freemempos = trunc_page(freemem_after); - freemempos -= PAGE_SIZE; -#endif /* * Now we start construction of the L1 page table * We start by mapping the L2 page tables into the L1. @@ -274,15 +258,6 @@ initarm(struct arm_boot_params *abp) } -#ifdef ARM_USE_SMALL_ALLOC - if ((freemem_after + 2 * PAGE_SIZE) <= afterkern) { - arm_add_smallalloc_pages((void *)(freemem_after), - (void*)(freemem_after + PAGE_SIZE), - afterkern - (freemem_after + PAGE_SIZE), 0); - - } -#endif - /* Map the vector page. */ pmap_map_entry(l1pagetable, ARM_VECTORS_HIGH, systempage.pv_pa, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); @@ -338,10 +313,7 @@ initarm(struct arm_boot_params *abp) arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); pmap_curmaxkvaddr = afterkern + PAGE_SIZE; - /* - * ARM_USE_SMALL_ALLOC uses dump_avail, so it must be filled before - * calling pmap_bootstrap. - */ + dump_avail[0] = 0x00000000; dump_avail[1] = 0x00000000 + memsize; dump_avail[2] = 0; @@ -354,13 +326,6 @@ initarm(struct arm_boot_params *abp) mutex_init(); i = 0; -#ifdef ARM_USE_SMALL_ALLOC - phys_avail[i++] = 0x00001000; - phys_avail[i++] = 0x00002000; /* - *XXX: Gross hack to get our - * pages in the vm_page_array - . */ -#endif phys_avail[i++] = round_page(virtual_avail - KERNBASE + SDRAM_START); phys_avail[i++] = trunc_page(0x00000000 + memsize - 1); phys_avail[i++] = 0; Modified: head/sys/arm/xscale/ixp425/avila_machdep.c ============================================================================== --- head/sys/arm/xscale/ixp425/avila_machdep.c Sat Feb 8 22:12:00 2014 (r261641) +++ head/sys/arm/xscale/ixp425/avila_machdep.c Sat Feb 8 22:21:38 2014 (r261642) @@ -299,24 +299,6 @@ initarm(struct arm_boot_params *abp) valloc_pages(kernelstack, KSTACK_PAGES); alloc_pages(minidataclean.pv_pa, 1); valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); -#ifdef ARM_USE_SMALL_ALLOC - freemempos -= PAGE_SIZE; - freemem_pt = trunc_page(freemem_pt); - freemem_after = freemempos - ((freemem_pt - (PHYSADDR + 0x100000)) / - PAGE_SIZE) * sizeof(struct arm_small_page); - arm_add_smallalloc_pages( - (void *)(freemem_after + (KERNVIRTADDR - KERNPHYSADDR)), - (void *)0xc0100000, - freemem_pt - (PHYSADDR + 0x100000), 1); - freemem_after -= ((freemem_after - (PHYSADDR + 0x1000)) / PAGE_SIZE) * - sizeof(struct arm_small_page); - arm_add_smallalloc_pages( - (void *)(freemem_after + (KERNVIRTADDR - KERNPHYSADDR)), - (void *)0xc0001000, - trunc_page(freemem_after) - (PHYSADDR + 0x1000), 0); - freemempos = trunc_page(freemem_after); - freemempos -= PAGE_SIZE; -#endif /* * Now construct the L1 page table. First map the L2 @@ -352,14 +334,6 @@ initarm(struct arm_boot_params *abp) pmap_map_entry(l1pagetable, afterkern, minidataclean.pv_pa, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); -#ifdef ARM_USE_SMALL_ALLOC - if ((freemem_after + 2 * PAGE_SIZE) <= afterkern) { - arm_add_smallalloc_pages((void *)(freemem_after), - (void*)(freemem_after + PAGE_SIZE), - afterkern - (freemem_after + PAGE_SIZE), 0); - - } -#endif /* Map the Mini-Data cache clean area. */ xscale_setup_minidata(l1pagetable, afterkern, @@ -440,13 +414,6 @@ initarm(struct arm_boot_params *abp) mutex_init(); i = 0; -#ifdef ARM_USE_SMALL_ALLOC - phys_avail[i++] = PHYSADDR; - phys_avail[i++] = PHYSADDR + PAGE_SIZE; /* - *XXX: Gross hack to get our - * pages in the vm_page_array. - */ -#endif phys_avail[i++] = round_page(virtual_avail - KERNBASE + PHYSADDR); phys_avail[i++] = trunc_page(PHYSADDR + memsize - 1); phys_avail[i++] = 0; Modified: head/sys/arm/xscale/pxa/pxa_machdep.c ============================================================================== --- head/sys/arm/xscale/pxa/pxa_machdep.c Sat Feb 8 22:12:00 2014 (r261641) +++ head/sys/arm/xscale/pxa/pxa_machdep.c Sat Feb 8 22:21:38 2014 (r261642) @@ -213,20 +213,6 @@ initarm(struct arm_boot_params *abp) valloc_pages(kernelstack, KSTACK_PAGES); alloc_pages(minidataclean.pv_pa, 1); valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); -#ifdef ARM_USE_SMALL_ALLOC - freemempos -= PAGE_SIZE; - freemem_pt = trunc_page(freemem_pt); - freemem_after = freemempos - ((freemem_pt - 0xa0100000) / - PAGE_SIZE) * sizeof(struct arm_small_page); - arm_add_smallalloc_pages((void *)(freemem_after + 0x20000000) - , (void *)0xc0100000, freemem_pt - 0xa0100000, 1); - freemem_after -= ((freemem_after - 0xa0001000) / PAGE_SIZE) * - sizeof(struct arm_small_page); - arm_add_smallalloc_pages((void *)(freemem_after + 0x20000000) - , (void *)0xc0001000, trunc_page(freemem_after) - 0xa0001000, 0); - freemempos = trunc_page(freemem_after); - freemempos -= PAGE_SIZE; -#endif /* * Allocate memory for the l1 and l2 page tables. The scheme to avoid * wasting memory by allocating the l1pt on the first 16k memory was @@ -267,13 +253,6 @@ initarm(struct arm_boot_params *abp) pmap_map_entry(l1pagetable, afterkern, minidataclean.pv_pa, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); -#ifdef ARM_USE_SMALL_ALLOC - if ((freemem_after + 2 * PAGE_SIZE) <= afterkern) { - arm_add_smallalloc_pages((void *)(freemem_after), - (void*)(freemem_after + PAGE_SIZE), - afterkern - (freemem_after + PAGE_SIZE), 0); - } -#endif /* Map the Mini-Data cache clean area. */ xscale_setup_minidata(l1pagetable, afterkern, @@ -350,10 +329,6 @@ initarm(struct arm_boot_params *abp) arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); pmap_curmaxkvaddr = afterkern + PAGE_SIZE; - /* - * ARM USE_SMALL_ALLOC uses dump_avail, so it must be filled before - * calling pmap_bootstrap. - */ i = 0; for (j = 0; j < PXA2X0_SDRAM_BANKS; j++) { if (memsize[j] > 0) { @@ -371,13 +346,6 @@ initarm(struct arm_boot_params *abp) mutex_init(); i = 0; -#ifdef ARM_USE_SMALL_ALLOC - phys_avail[i++] = 0xa0000000; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Feb 8 23:54:18 2014 Return-Path: Delivered-To: svn-src-head@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 DD8ED786; Sat, 8 Feb 2014 23:54:18 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C38031A7F; Sat, 8 Feb 2014 23:54:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s18NsIB5062158; Sat, 8 Feb 2014 23:54:18 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s18NsHVv062145; Sat, 8 Feb 2014 23:54:17 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201402082354.s18NsHVv062145@svn.freebsd.org> From: Ian Lepore Date: Sat, 8 Feb 2014 23:54:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261643 - in head/sys: arm/arm arm/at91 arm/econa arm/include arm/s3c2xx0 arm/sa11x0 arm/xscale/i80321 arm/xscale/i8134x arm/xscale/ixp425 arm/xscale/pxa conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Feb 2014 23:54:18 -0000 Author: ian Date: Sat Feb 8 23:54:16 2014 New Revision: 261643 URL: http://svnweb.freebsd.org/changeset/base/261643 Log: Consolidate code related to setting up physical memory configuration into a new physmem.c file. The new code provides helper routines that can be used by legacy SoCs and newer FDT-based systems. There are routines to add one or more regions of physically contiguous ram, and exclude one or more physically contiguous regions of ram. Ram can be excluded from crash dumps, from being given over to the vm system for allocation management, or both. After all the included and excluded regions have been added, arm_physmem_init_kernel_globals() processes the regions into the global dump_avail and phys_avail arrays and realmem and physmem variables that communicate memory configuration to the rest of the kernel. Convert all existing SoCs to use the new helper code. Added: head/sys/arm/arm/physmem.c (contents, props changed) head/sys/arm/include/physmem.h (contents, props changed) Modified: head/sys/arm/arm/machdep.c head/sys/arm/at91/at91_machdep.c head/sys/arm/econa/econa_machdep.c head/sys/arm/include/machdep.h head/sys/arm/s3c2xx0/s3c24x0_machdep.c head/sys/arm/sa11x0/assabet_machdep.c head/sys/arm/xscale/i80321/ep80219_machdep.c head/sys/arm/xscale/i80321/iq31244_machdep.c head/sys/arm/xscale/i8134x/crb_machdep.c head/sys/arm/xscale/ixp425/avila_machdep.c head/sys/arm/xscale/pxa/pxa_machdep.c head/sys/conf/files.arm Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Sat Feb 8 22:21:38 2014 (r261642) +++ head/sys/arm/arm/machdep.c Sat Feb 8 23:54:16 2014 (r261643) @@ -97,6 +97,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -122,8 +123,6 @@ uint32_t cpu_reset_address = 0; int cold = 1; vm_offset_t vector_page; -long realmem = 0; - int (*_arm_memcpy)(void *, void *, int, int) = NULL; int (*_arm_bzero)(void *, int, int) = NULL; int _min_memcpy_size = 0; @@ -144,9 +143,6 @@ extern vm_offset_t ksym_start, ksym_end; static struct pv_addr kernel_pt_table[KERNEL_PT_MAX]; -vm_paddr_t phys_avail[10]; -vm_paddr_t dump_avail[4]; - extern u_int data_abort_handler_address; extern u_int prefetch_abort_handler_address; extern u_int undefined_handler_address; @@ -356,6 +352,7 @@ static void cpu_startup(void *dummy) { struct pcb *pcb = thread0.td_pcb; + const unsigned int mbyte = 1024 * 1024; #ifdef ARM_TP_ADDRESS #ifndef ARM_CACHE_LOCK_ENABLE vm_page_t m; @@ -364,36 +361,21 @@ cpu_startup(void *dummy) identify_arm_cpu(); - printf("real memory = %ju (%ju MB)\n", (uintmax_t)ptoa(physmem), - (uintmax_t)ptoa(physmem) / 1048576); - realmem = physmem; + vm_ksubmap_init(&kmi); /* * Display the RAM layout. */ - if (bootverbose) { - int indx; - - printf("Physical memory chunk(s):\n"); - for (indx = 0; phys_avail[indx + 1] != 0; indx += 2) { - vm_paddr_t size; - - size = phys_avail[indx + 1] - phys_avail[indx]; - printf(" 0x%08jx - 0x%08jx, %ju KBytes (%ju pages)\n", - (uintmax_t)phys_avail[indx], - (uintmax_t)phys_avail[indx + 1] - 1, - (uintmax_t)size / 1024, (uintmax_t)size / PAGE_SIZE); - } - } - - vm_ksubmap_init(&kmi); - + printf("real memory = %ju (%ju MB)\n", + (uintmax_t)arm32_ptob(realmem), + (uintmax_t)arm32_ptob(realmem) / mbyte); printf("avail memory = %ju (%ju MB)\n", - (uintmax_t)ptoa(cnt.v_free_count), - (uintmax_t)ptoa(cnt.v_free_count) / 1048576); - - if (bootverbose) + (uintmax_t)arm32_ptob(cnt.v_free_count), + (uintmax_t)arm32_ptob(cnt.v_free_count) / mbyte); + if (bootverbose) { + arm_physmem_print_tables(); arm_devmap_print_table(); + } bufinit(); vm_pager_bufferinit(); @@ -780,44 +762,6 @@ makectx(struct trapframe *tf, struct pcb } /* - * Make a standard dump_avail array. Can't make the phys_avail - * since we need to do that after we call pmap_bootstrap, but this - * is needed before pmap_boostrap. - */ -void -arm_dump_avail_init(vm_paddr_t physaddr, vm_offset_t ramsize, size_t max) -{ -#ifdef LINUX_BOOT_ABI - /* - * Linux boot loader passes us the actual banks of memory, so use them - * to construct the dump_avail array. - */ - if (membanks > 0) - { - int i, j; - - if (max < (membanks + 1) * 2) - panic("dump_avail[%d] too small for %d banks\n", - max, membanks); - for (j = 0, i = 0; i < membanks; i++) { - dump_avail[j++] = round_page(memstart[i]); - dump_avail[j++] = trunc_page(memstart[i] + memsize[i]); - } - dump_avail[j++] = 0; - dump_avail[j++] = 0; - return; - } -#endif - if (max < 4) - panic("dump_avail too small\n"); - - dump_avail[0] = round_page(physaddr); - dump_avail[1] = trunc_page(physaddr + ramsize); - dump_avail[2] = 0; - dump_avail[3] = 0; -} - -/* * Fake up a boot descriptor table */ vm_offset_t @@ -910,11 +854,8 @@ linux_parse_boot_param(struct arm_boot_p case ATAG_CORE: break; case ATAG_MEM: - if (membanks < LBABI_MAX_BANKS) { - memstart[membanks] = walker->u.tag_mem.start; - memsize[membanks] = walker->u.tag_mem.size; - } - membanks++; + arm_physmem_hardware_region(walker->u.tag_mem.start, + walker->u.tag_mem.size); break; case ATAG_INITRD2: break; @@ -1077,120 +1018,10 @@ print_kenv(void) debugf(" %x %s\n", (uint32_t)cp, cp); } -static void -physmap_init(struct mem_region *availmem_regions, int availmem_regions_sz, - vm_offset_t kernload) -{ - int i, j, cnt; - vm_offset_t phys_kernelend; - uint32_t s, e, sz; - struct mem_region *mp, *mp1; - - phys_kernelend = kernload + (virtual_avail - KERNVIRTADDR); - - /* - * Remove kernel physical address range from avail - * regions list. Page align all regions. - * Non-page aligned memory isn't very interesting to us. - * Also, sort the entries for ascending addresses. - */ - sz = 0; - cnt = availmem_regions_sz; - debugf("processing avail regions:\n"); - for (mp = availmem_regions; mp->mr_size; mp++) { - s = mp->mr_start; - e = mp->mr_start + mp->mr_size; - debugf(" %08x-%08x -> ", s, e); - /* Check whether this region holds all of the kernel. */ - if (s < kernload && e > phys_kernelend) { - availmem_regions[cnt].mr_start = phys_kernelend; - availmem_regions[cnt++].mr_size = e - phys_kernelend; - e = kernload; - } - /* Look whether this regions starts within the kernel. */ - if (s >= kernload && s < phys_kernelend) { - if (e <= phys_kernelend) - goto empty; - s = phys_kernelend; - } - /* Now look whether this region ends within the kernel. */ - if (e > kernload && e <= phys_kernelend) { - if (s >= kernload) { - goto empty; - } - e = kernload; - } - /* Now page align the start and size of the region. */ - s = round_page(s); - e = trunc_page(e); - if (e < s) - e = s; - sz = e - s; - debugf("%08x-%08x = %x\n", s, e, sz); - - /* Check whether some memory is left here. */ - if (sz == 0) { - empty: - printf("skipping\n"); - bcopy(mp + 1, mp, - (cnt - (mp - availmem_regions)) * sizeof(*mp)); - cnt--; - mp--; - continue; - } - - /* Do an insertion sort. */ - for (mp1 = availmem_regions; mp1 < mp; mp1++) - if (s < mp1->mr_start) - break; - if (mp1 < mp) { - bcopy(mp1, mp1 + 1, (char *)mp - (char *)mp1); - mp1->mr_start = s; - mp1->mr_size = sz; - } else { - mp->mr_start = s; - mp->mr_size = sz; - } - } - availmem_regions_sz = cnt; - - /* Fill in phys_avail table, based on availmem_regions */ - debugf("fill in phys_avail:\n"); - for (i = 0, j = 0; i < availmem_regions_sz; i++, j += 2) { - - debugf(" region: 0x%08x - 0x%08x (0x%08x)\n", - availmem_regions[i].mr_start, - availmem_regions[i].mr_start + availmem_regions[i].mr_size, - availmem_regions[i].mr_size); - - /* - * We should not map the page at PA 0x0000000, the VM can't - * handle it, as pmap_extract() == 0 means failure. - */ - if (availmem_regions[i].mr_start > 0 || - availmem_regions[i].mr_size > PAGE_SIZE) { - vm_size_t size; - phys_avail[j] = availmem_regions[i].mr_start; - - size = availmem_regions[i].mr_size; - if (phys_avail[j] == 0) { - phys_avail[j] += PAGE_SIZE; - size -= PAGE_SIZE; - } - phys_avail[j + 1] = availmem_regions[i].mr_start + size; - } else - j -= 2; - } - phys_avail[j] = 0; - phys_avail[j + 1] = 0; -} - void * initarm(struct arm_boot_params *abp) { - struct mem_region memory_regions[FDT_MEM_REGIONS]; - struct mem_region availmem_regions[FDT_MEM_REGIONS]; - struct mem_region reserved_regions[FDT_MEM_REGIONS]; + struct mem_region mem_regions[FDT_MEM_REGIONS]; struct pv_addr kernel_l1pt; struct pv_addr dpcpu; vm_offset_t dtbp, freemempos, l2_start, lastaddr; @@ -1198,13 +1029,7 @@ initarm(struct arm_boot_params *abp) char *env; void *kmdp; u_int l1pagetable; - int i = 0, j = 0, err_devmap = 0; - int memory_regions_sz; - int availmem_regions_sz; - int reserved_regions_sz; - vm_offset_t start, end; - vm_offset_t rstart, rend; - int curr; + int i, j, err_devmap, mem_regions_sz; lastaddr = parse_boot_param(abp); memsize = 0; @@ -1235,72 +1060,14 @@ initarm(struct arm_boot_params *abp) while (1); /* Grab physical memory regions information from device tree. */ - if (fdt_get_mem_regions(memory_regions, &memory_regions_sz, - &memsize) != 0) - while(1); - - /* Grab physical memory regions information from device tree. */ - if (fdt_get_reserved_regions(reserved_regions, &reserved_regions_sz) != 0) - reserved_regions_sz = 0; - - /* - * Now exclude all the reserved regions - */ - curr = 0; - for (i = 0; i < memory_regions_sz; i++) { - start = memory_regions[i].mr_start; - end = start + memory_regions[i].mr_size; - for (j = 0; j < reserved_regions_sz; j++) { - rstart = reserved_regions[j].mr_start; - rend = rstart + reserved_regions[j].mr_size; - /* - * Restricted region is before available - * Skip restricted region - */ - if (rend <= start) - continue; - /* - * Restricted region is behind available - * No further processing required - */ - if (rstart >= end) - break; - /* - * Restricted region includes memory region - * skip available region - */ - if ((start >= rstart) && (rend >= end)) { - start = rend; - end = rend; - break; - } - /* - * Memory region includes restricted region - */ - if ((rstart > start) && (end > rend)) { - availmem_regions[curr].mr_start = start; - availmem_regions[curr++].mr_size = rstart - start; - start = rend; - break; - } - /* - * Memory region partially overlaps with restricted - */ - if ((rstart >= start) && (rstart <= end)) { - end = rstart; - } - else if ((rend >= start) && (rend <= end)) { - start = rend; - } - } - - if (end > start) { - availmem_regions[curr].mr_start = start; - availmem_regions[curr++].mr_size = end - start; - } - } - - availmem_regions_sz = curr; + if (fdt_get_mem_regions(mem_regions, &mem_regions_sz, &memsize) != 0) + panic("Cannot get physical memory regions"); + arm_physmem_hardware_regions(mem_regions, mem_regions_sz); + + /* Grab reserved memory regions information from device tree. */ + if (fdt_get_reserved_regions(mem_regions, &mem_regions_sz) == 0) + arm_physmem_exclude_regions(mem_regions, mem_regions_sz, + EXFLAG_NODUMP | EXFLAG_NOALLOC); /* Platform-specific initialisation */ initarm_early_init(); @@ -1339,7 +1106,7 @@ initarm(struct arm_boot_params *abp) freemempos += PAGE_SIZE; valloc_pages(kernel_l1pt, L1_TABLE_SIZE / PAGE_SIZE); - for (i = 0; i < l2size; ++i) { + for (i = 0, j = 0; i < l2size; ++i) { if (!(i % (PAGE_SIZE / L2_TABLE_SIZE_REAL))) { valloc_pages(kernel_pt_table[i], L2_TABLE_SIZE / PAGE_SIZE); @@ -1498,17 +1265,22 @@ initarm(struct arm_boot_params *abp) arm_intrnames_init(); arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); - arm_dump_avail_init(abp->abp_physaddr, memsize, - sizeof(dump_avail) / sizeof(dump_avail[0])); pmap_bootstrap(freemempos, &kernel_l1pt); msgbufp = (void *)msgbufpv.pv_va; msgbufinit(msgbufp, msgbufsize); mutex_init(); /* - * Prepare map of physical memory regions available to vm subsystem. + * Exclude the kernel (and all the things we allocated which immediately + * follow the kernel) from the VM allocation pool but not from crash + * dumps. virtual_avail is a global variable which tracks the kva we've + * "allocated" while setting up pmaps. + * + * Prepare the list of physical memory available to the vm subsystem. */ - physmap_init(availmem_regions, availmem_regions_sz, abp->abp_physaddr); + arm_physmem_exclude_region(abp->abp_physaddr, + (virtual_avail - KERNVIRTADDR), EXFLAG_NOALLOC); + arm_physmem_init_kernel_globals(); init_param2(physmem); kdb_init(); Added: head/sys/arm/arm/physmem.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/arm/physmem.c Sat Feb 8 23:54:16 2014 (r261643) @@ -0,0 +1,314 @@ +/*- + * Copyright (c) 2014 Ian Lepore + * All rights excluded. + * + * 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 "opt_ddb.h" + +/* + * Routines for describing and initializing anything related to physical memory. + */ + +#include +#include +#include +#include + +/* + * These structures are used internally to keep track of regions of physical + * ram, and regions within the physical ram that need to be excluded. An + * exclusion region can be excluded from crash dumps, from the vm pool of pages + * that can be allocated, or both, depending on the exclusion flags associated + * with the region. + */ +#define MAX_HWCNT 10 +#define MAX_EXCNT 10 + +struct region { + vm_offset_t addr; + vm_size_t size; + uint32_t flags; +}; + +static struct region hwregions[MAX_HWCNT]; +static struct region exregions[MAX_EXCNT]; + +static size_t hwcnt; +static size_t excnt; + +/* + * These "avail lists" are globals used to communicate physical memory layout to + * other parts of the kernel. Within the arrays, each value is the starting + * address of a contiguous area of physical address space. The values at even + * indexes are areas that contain usable memory and the values at odd indexes + * are areas that aren't usable. Each list is terminated by a pair of zero + * entries. + * + * dump_avail tells the dump code what regions to include in a crash dump, and + * phys_avail is the way we hand all the remaining physical ram we haven't used + * in early kernel init over to the vm system for allocation management. + * + * We size these arrays to hold twice as many available regions as we allow for + * hardware memory regions, to allow for the fact that exclusions can split a + * hardware region into two or more available regions. In the real world there + * will typically be one or two hardware regions and two or three exclusions. + * + * Each available region in this list occupies two array slots (the start of the + * available region and the start of the unavailable region that follows it). + */ +#define MAX_AVAIL_REGIONS (MAX_HWCNT * 2) +#define MAX_AVAIL_ENTRIES (MAX_AVAIL_REGIONS * 2) + +vm_paddr_t phys_avail[MAX_AVAIL_ENTRIES + 2]; /* +2 to allow for a pair */ +vm_paddr_t dump_avail[MAX_AVAIL_ENTRIES + 2]; /* of zeroes to terminate. */ + +/* This is the total number of hardware pages, excluded or not. */ +long realmem; + +/* + * Print the contents of the physical and excluded region tables using the + * provided printf-like output function (which will be either printf or + * db_printf). + */ +static void +physmem_dump_tables(int (*prfunc)(const char *, ...)) +{ + int flags, i; + uintmax_t addr, size; + const unsigned int mbyte = 1024 * 1024; + + prfunc("Physical memory chunk(s):\n"); + for (i = 0; i < hwcnt; ++i) { + addr = hwregions[i].addr; + size = hwregions[i].size; + prfunc(" 0x%08jx - 0x%08jx, %5ju MB (%7ju pages)\n", addr, + addr + size - 1, size / mbyte, size / PAGE_SIZE); + } + + prfunc("Excluded memory regions:\n"); + for (i = 0; i < excnt; ++i) { + addr = exregions[i].addr; + size = exregions[i].size; + flags = exregions[i].flags; + prfunc(" 0x%08jx - 0x%08jx, %5ju MB (%7ju pages) %s %s\n", + addr, addr + size - 1, size / mbyte, size / PAGE_SIZE, + (flags & EXFLAG_NOALLOC) ? "NoAlloc" : "", + (flags & EXFLAG_NODUMP) ? "NoDump" : ""); + } +} + +/* + * Print the contents of the static mapping table. Used for bootverbose. + */ +void +arm_physmem_print_tables() +{ + + physmem_dump_tables(printf); +} + +/* + * Walk the list of hardware regions, processing it against the list of + * exclusions that contain the given exflags, and generating an "avail list". + * + * Updates the kernel global 'realmem' with the sum of all pages in hw regions. + * + * Returns the number of pages of non-excluded memory added to the avail list. + */ +static long +regions_to_avail(vm_paddr_t *avail, uint32_t exflags) +{ + size_t acnt, exi, hwi; + vm_paddr_t end, start, xend, xstart; + long availmem; + const struct region *exp, *hwp; + + realmem = 0; + availmem = 0; + acnt = 0; + for (hwi = 0, hwp = hwregions; hwi < hwcnt; ++hwi, ++hwp) { + start = hwp->addr; + end = hwp->size + start; + realmem += arm32_btop(end - start); + for (exi = 0, exp = exregions; exi < excnt; ++exi, ++exp) { + xstart = exp->addr; + xend = exp->size + xstart; + /* + * If the excluded region ends before this hw region, + * continue checking with the next excluded region. + */ + if (xend <= start) + continue; + /* + * If the excluded region begins after this hw region + * we're done because both lists are sorted. + */ + if (xstart >= end) + break; + /* + * If the excluded region completely covers this hw + * region, shrink this hw region to zero size. + */ + if ((start >= xstart) && (end <= xend)) { + start = xend; + end = xend; + break; + } + /* + * If the excluded region falls wholly within this hw + * region without abutting or overlapping the beginning + * or end, create an available entry from the leading + * fragment, then adjust the start of this hw region to + * the end of the excluded region, and continue checking + * the next excluded region because another exclusion + * could affect the remainder of this hw region. + */ + if ((xstart > start) && (xend < end)) { + avail[acnt++] = start; + avail[acnt++] = xstart; + availmem += arm32_btop(xstart - start); + start = xend; + continue; + } + /* + * If excluded region partially overlaps this region, + * trim the excluded portion off the appropriate end. + */ + if ((xstart >= start) && (xstart <= end)) { + end = xstart; + } else if ((xend >= start) && (xend <= end)) { + start = xend; + } + } + /* + * If the trimming actions above left a non-zero size, create an + * available entry for it. + */ + if (end > start) { + avail[acnt++] = start; + avail[acnt++] = end; + availmem += arm32_btop(end - start); + } + if (acnt >= MAX_AVAIL_ENTRIES) + panic("Not enough space in the dump/phys_avail arrays"); + } + + return (availmem); +} + +/* + * Insertion-sort a new entry into a regions list; sorted by start address. + */ +static void +insert_region(struct region *regions, size_t rcnt, vm_offset_t addr, + vm_size_t size, uint32_t flags) +{ + size_t i; + struct region *ep, *rp; + + ep = regions + rcnt; + for (i = 0, rp = regions; i < rcnt; ++i, ++rp) { + if (addr < rp->addr) { + bcopy(rp, rp + 1, (ep - rp) * sizeof(*rp)); + break; + } + } + rp->addr = addr; + rp->size = size; + rp->flags = flags; +} + +/* + * Add a hardware memory region. + */ +void +arm_physmem_hardware_region(vm_offset_t pa, vm_size_t sz) +{ + vm_offset_t adj; + + /* + * Filter out the page at PA 0x00000000. The VM can't handle it, as + * pmap_extract() == 0 means failure. + */ + if (pa == 0) { + pa = PAGE_SIZE; + sz -= PAGE_SIZE; + } + + /* + * Round the starting address up to a page boundary, and truncate the + * ending page down to a page boundary. + */ + adj = round_page(pa) - pa; + pa = round_page(pa); + sz = trunc_page(sz - adj); + + if (hwcnt < nitems(hwregions)) + insert_region(hwregions, hwcnt++, pa, sz, 0); +} + +/* + * Add an exclusion region. + */ +void arm_physmem_exclude_region(vm_offset_t pa, vm_size_t sz, uint32_t exflags) +{ + vm_offset_t adj; + + /* + * Truncate the starting address down to a page boundary, and round the + * ending page up to a page boundary. + */ + adj = pa - trunc_page(pa); + pa = trunc_page(pa); + sz = round_page(sz + adj); + + if (excnt < nitems(exregions)) + insert_region(exregions, excnt++, pa, sz, exflags); +} + +/* + * Process all the regions added earlier into the global avail lists. + */ +void +arm_physmem_init_kernel_globals(void) +{ + + regions_to_avail(dump_avail, EXFLAG_NODUMP); + physmem = regions_to_avail(phys_avail, EXFLAG_NOALLOC); +} + +#ifdef DDB +#include + +DB_SHOW_COMMAND(physmem, db_show_physmem) +{ + + physmem_dump_tables(db_printf); +} + +#endif /* DDB */ + Modified: head/sys/arm/at91/at91_machdep.c ============================================================================== --- head/sys/arm/at91/at91_machdep.c Sat Feb 8 22:21:38 2014 (r261642) +++ head/sys/arm/at91/at91_machdep.c Sat Feb 8 23:54:16 2014 (r261643) @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -199,9 +200,6 @@ const struct arm_devmap_entry at91_devma /* Physical and virtual addresses for some global pages */ -vm_paddr_t phys_avail[10]; -vm_paddr_t dump_avail[4]; - struct pv_addr systempage; struct pv_addr msgbufpv; struct pv_addr irqstack; @@ -630,8 +628,6 @@ initarm(struct arm_boot_params *abp) arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); pmap_curmaxkvaddr = afterkern + L1_S_SIZE * (KERNEL_PT_KERN_NUM - 1); - arm_dump_avail_init(abp->abp_physaddr, memsize, - sizeof(dump_avail)/sizeof(dump_avail[0])); /* Always use the 256MB of KVA we have available between the kernel and devices */ vm_max_kernel_address = KERNVIRTADDR + (256 << 20); pmap_bootstrap(freemempos, &kernel_l1pt); @@ -639,15 +635,21 @@ initarm(struct arm_boot_params *abp) msgbufinit(msgbufp, msgbufsize); mutex_init(); - i = 0; -#if PHYSADDR != KERNPHYSADDR - phys_avail[i++] = PHYSADDR; - phys_avail[i++] = KERNPHYSADDR; -#endif - phys_avail[i++] = virtual_avail - KERNVIRTADDR + KERNPHYSADDR; - phys_avail[i++] = PHYSADDR + memsize; - phys_avail[i++] = 0; - phys_avail[i++] = 0; + /* + * Add the physical ram we have available. + * + * Exclude the kernel, and all the things we allocated which immediately + * follow the kernel, from the VM allocation pool but not from crash + * dumps. virtual_avail is a global variable which tracks the kva we've + * "allocated" while setting up pmaps. + * + * Prepare the list of physical memory available to the vm subsystem. + */ + arm_physmem_hardware_region(PHYSADDR, memsize); + arm_physmem_exclude_region(abp->abp_physaddr, + virtual_avail - KERNVIRTADDR, EXFLAG_NOALLOC); + arm_physmem_init_kernel_globals(); + init_param2(physmem); kdb_init(); return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP - Modified: head/sys/arm/econa/econa_machdep.c ============================================================================== --- head/sys/arm/econa/econa_machdep.c Sat Feb 8 22:21:38 2014 (r261642) +++ head/sys/arm/econa/econa_machdep.c Sat Feb 8 23:54:16 2014 (r261643) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -98,9 +99,6 @@ struct pv_addr kernel_pt_table[NUM_KERNE /* Physical and virtual addresses for some global pages */ -vm_paddr_t phys_avail[10]; -vm_paddr_t dump_avail[4]; - struct pv_addr systempage; struct pv_addr msgbufpv; struct pv_addr irqstack; @@ -284,7 +282,6 @@ initarm(struct arm_boot_params *abp) cninit(); mem_info = ((*ddr) >> 4) & 0x3; memsize = (8<abp_physaddr, memsize, - sizeof(dump_avail) / sizeof(dump_avail[0])); vm_max_kernel_address = KERNVIRTADDR + 3 * memsize; pmap_bootstrap(freemempos, &kernel_l1pt); @@ -332,16 +327,21 @@ initarm(struct arm_boot_params *abp) mutex_init(); - i = 0; -#if PHYSADDR != KERNPHYSADDR - phys_avail[i++] = PHYSADDR; - phys_avail[i++] = KERNPHYSADDR; -#endif - phys_avail[i++] = virtual_avail - KERNVIRTADDR + KERNPHYSADDR; - - phys_avail[i++] = PHYSADDR + memsize; - phys_avail[i++] = 0; - phys_avail[i++] = 0; + /* + * Add the physical ram we have available. + * + * Exclude the kernel, and all the things we allocated which immediately + * follow the kernel, from the VM allocation pool but not from crash + * dumps. virtual_avail is a global variable which tracks the kva we've + * "allocated" while setting up pmaps. + * + * Prepare the list of physical memory available to the vm subsystem. + */ + arm_physmem_hardware_region(PHYSADDR, memsize); + arm_physmem_exclude_region(abp->abp_physaddr, + virtual_avail - KERNVIRTADDR, EXFLAG_NOALLOC); + arm_physmem_init_kernel_globals(); + init_param2(physmem); kdb_init(); Modified: head/sys/arm/include/machdep.h ============================================================================== --- head/sys/arm/include/machdep.h Sat Feb 8 22:21:38 2014 (r261642) +++ head/sys/arm/include/machdep.h Sat Feb 8 23:54:16 2014 (r261643) @@ -71,7 +71,4 @@ void initarm_late_init(void); void board_set_serial(uint64_t); void board_set_revision(uint32_t); -/* Setup standard arrays */ -void arm_dump_avail_init(vm_paddr_t, vm_offset_t, size_t); - #endif /* !_MACHINE_MACHDEP_H_ */ Added: head/sys/arm/include/physmem.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/include/physmem.h Sat Feb 8 23:54:16 2014 (r261643) @@ -0,0 +1,86 @@ +/*- + * Copyright (c) 2014 Ian Lepore + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _MACHINE_PHYSMEM_H_ +#define _MACHINE_PHYSMEM_H_ + +/* + * Routines to help configure physical ram. + * + * Multiple regions of contiguous physical ram can be added (in any order). + * + * Multiple regions of physical ram that should be excluded from crash dumps, or + * memory allocation, or both, can be added (in any order). + * + * After all early kernel init is done and it's time to configure all + * remainining non-excluded physical ram for use by other parts of the kernel, + * arm_physmem_init_kernel_globals() processes the hardware regions and + * exclusion regions to generate the global dump_avail and phys_avail arrays + * that communicate physical ram configuration to other parts of the kernel. + */ + +#define EXFLAG_NODUMP 0x01 +#define EXFLAG_NOALLOC 0x02 + +void arm_physmem_hardware_region(vm_offset_t pa, vm_size_t sz); +void arm_physmem_exclude_region(vm_offset_t pa, vm_size_t sz, uint32_t flags); +void arm_physmem_init_kernel_globals(void); +void arm_physmem_print_tables(void); + +/* + * Convenience routines for FDT. + */ + +#ifdef FDT + +#include + +inline void +arm_physmem_hardware_regions(struct mem_region * mrptr, int mrcount) +{ + while (mrcount--) { + arm_physmem_hardware_region(mrptr->mr_start, mrptr->mr_size); + ++mrptr; + } +} + +inline void +arm_physmem_exclude_regions(struct mem_region * mrptr, int mrcount, + uint32_t exflags) +{ + while (mrcount--) { + arm_physmem_exclude_region(mrptr->mr_start, mrptr->mr_size, + exflags); + ++mrptr; + } +} + +#endif /* FDT */ + +#endif + Modified: head/sys/arm/s3c2xx0/s3c24x0_machdep.c ============================================================================== --- head/sys/arm/s3c2xx0/s3c24x0_machdep.c Sat Feb 8 22:21:38 2014 (r261642) +++ head/sys/arm/s3c2xx0/s3c24x0_machdep.c Sat Feb 8 23:54:16 2014 (r261643) @@ -70,6 +70,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -113,9 +114,6 @@ struct pv_addr kernel_pt_table[NUM_KERNE /* Physical and virtual addresses for some global pages */ -vm_paddr_t phys_avail[10]; -vm_paddr_t dump_avail[4]; - struct pv_addr systempage; struct pv_addr msgbufpv; struct pv_addr irqstack; @@ -384,20 +382,26 @@ initarm(struct arm_boot_params *abp) arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); pmap_curmaxkvaddr = afterkern + 0x100000 * (KERNEL_PT_KERN_NUM - 1); - arm_dump_avail_init(abp->abp_physaddr, memsize, - sizeof(dump_avail) / sizeof(dump_avail[0])); vm_max_kernel_address = KERNVIRTADDR + 3 * memsize; pmap_bootstrap(freemempos, &kernel_l1pt); msgbufp = (void*)msgbufpv.pv_va; msgbufinit(msgbufp, msgbufsize); mutex_init(); - physmem = memsize / PAGE_SIZE; - - phys_avail[0] = virtual_avail - KERNVIRTADDR + KERNPHYSADDR; - phys_avail[1] = PHYSADDR + memsize; - phys_avail[2] = 0; - phys_avail[3] = 0; + /* + * Add the physical ram we have available. + * + * Exclude the kernel, and all the things we allocated which immediately + * follow the kernel, from the VM allocation pool but not from crash + * dumps. virtual_avail is a global variable which tracks the kva we've + * "allocated" while setting up pmaps. + * + * Prepare the list of physical memory available to the vm subsystem. + */ + arm_physmem_hardware_region(PHYSADDR, memsize); + arm_physmem_exclude_region(abp->abp_physaddr, + virtual_avail - KERNVIRTADDR, EXFLAG_NOALLOC); + arm_physmem_init_kernel_globals(); init_param2(physmem); kdb_init(); Modified: head/sys/arm/sa11x0/assabet_machdep.c ============================================================================== --- head/sys/arm/sa11x0/assabet_machdep.c Sat Feb 8 22:21:38 2014 (r261642) +++ head/sys/arm/sa11x0/assabet_machdep.c Sat Feb 8 23:54:16 2014 (r261643) @@ -122,8 +122,6 @@ extern vm_offset_t sa1_cache_clean_addr; #endif *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***