Re: svn commit: r276142 - in head/sys: amd64/amd64 cddl/dev/dtrace/amd64 cddl/dev/dtrace/i386 cddl/dev/dtrace/mips cddl/dev/dtrace/powerpc i386/i386 mips/mips powerpc/aim sys
On 23 Dec 2014, at 6:05, Mark Johnston wrote: On Tue, Dec 23, 2014 at 08:45:57AM -0700, Ian Lepore wrote: On Tue, 2014-12-23 at 15:38 +, Mark Johnston wrote: Author: markj Date: Tue Dec 23 15:38:19 2014 New Revision: 276142 URL: https://svnweb.freebsd.org/changeset/base/276142 Log: Restore the trap type argument to the DTrace trap hook, removed in r268600. It's redundant at the moment since it can be obtained from the trapframe on the architectures where DTrace is supported, but this won't be the case with ARM. Modified: head/sys/amd64/amd64/trap.c head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c head/sys/cddl/dev/dtrace/i386/dtrace_subr.c head/sys/cddl/dev/dtrace/mips/dtrace_subr.c head/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c head/sys/i386/i386/trap.c head/sys/mips/mips/trap.c head/sys/powerpc/aim/trap.c head/sys/sys/dtrace_bsd.h Wouldn't it have been easier to just add the field to the trapframe for arm? iirc we have an unused padding field in the struct already just for ABI alignment, it could go there. In this case, the extra argument will be the fault address AND'ed with FAULT_TYPE_MASK, and the hook is only potentially called in the data abort handler, so this extra field would be unused for other exceptions (and unused for data aborts unless DTrace is active). Maybe that's ok, but restoring the extra hook argument seemed like a less intrusive way to go to me. Actually I have re-patched my tree with the code from Howard Su, put on top of the work by Mark et al. I took the comment in the review to heart and added the type to the trapframe for ARM. I'm happy to go either way, though. It's trivial to change it to work with this. Best, George ___ 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-unsubscr...@freebsd.org"
svn commit: r276354 - in head/sys/dev/beri/virtio: . network
Author: bryanv Date: Mon Dec 29 00:35:44 2014 New Revision: 276354 URL: https://svnweb.freebsd.org/changeset/base/276354 Log: Remove dev/virtio/virtio.h include from BERI VirtIO This header file contains prototypes and defines that only make sense to the guest VirtIO device drivers. Reviewed by: br Modified: head/sys/dev/beri/virtio/network/if_vtbe.c head/sys/dev/beri/virtio/virtio.c head/sys/dev/beri/virtio/virtio_block.c Modified: head/sys/dev/beri/virtio/network/if_vtbe.c == --- head/sys/dev/beri/virtio/network/if_vtbe.c Mon Dec 29 00:30:38 2014 (r276353) +++ head/sys/dev/beri/virtio/network/if_vtbe.c Mon Dec 29 00:35:44 2014 (r276354) @@ -82,7 +82,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include +#include #include #include "pio_if.h" Modified: head/sys/dev/beri/virtio/virtio.c == --- head/sys/dev/beri/virtio/virtio.c Mon Dec 29 00:30:38 2014 (r276353) +++ head/sys/dev/beri/virtio/virtio.c Mon Dec 29 00:35:44 2014 (r276354) @@ -65,7 +65,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: head/sys/dev/beri/virtio/virtio_block.c == --- head/sys/dev/beri/virtio/virtio_block.c Mon Dec 29 00:30:38 2014 (r276353) +++ head/sys/dev/beri/virtio/virtio_block.c Mon Dec 29 00:35:44 2014 (r276354) @@ -67,7 +67,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include +#include #include #include "pio_if.h" ___ 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-unsubscr...@freebsd.org"
svn commit: r276353 - stable/10/sys/kern
Author: kib Date: Mon Dec 29 00:30:38 2014 New Revision: 276353 URL: https://svnweb.freebsd.org/changeset/base/276353 Log: MFC r275260: Remove lock recursion for the pipe pair mutex, and disable the recursion on mutex initialization. Modified: stable/10/sys/kern/sys_pipe.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/sys_pipe.c == --- stable/10/sys/kern/sys_pipe.c Mon Dec 29 00:10:43 2014 (r276352) +++ stable/10/sys/kern/sys_pipe.c Mon Dec 29 00:30:38 2014 (r276353) @@ -315,7 +315,7 @@ pipe_zone_init(void *mem, int size, int pp = (struct pipepair *)mem; - mtx_init(&pp->pp_mtx, "pipe mutex", NULL, MTX_DEF | MTX_RECURSE); + mtx_init(&pp->pp_mtx, "pipe mutex", NULL, MTX_DEF); return (0); } @@ -1770,7 +1770,7 @@ filt_piperead(struct knote *kn, long hin struct pipe *wpipe = rpipe->pipe_peer; int ret; - PIPE_LOCK(rpipe); + PIPE_LOCK_ASSERT(rpipe, MA_OWNED); kn->kn_data = rpipe->pipe_buffer.cnt; if ((kn->kn_data == 0) && (rpipe->pipe_state & PIPE_DIRECTW)) kn->kn_data = rpipe->pipe_map.cnt; @@ -1779,11 +1779,9 @@ filt_piperead(struct knote *kn, long hin wpipe->pipe_present != PIPE_ACTIVE || (wpipe->pipe_state & PIPE_EOF)) { kn->kn_flags |= EV_EOF; - PIPE_UNLOCK(rpipe); return (1); } ret = kn->kn_data > 0; - PIPE_UNLOCK(rpipe); return ret; } @@ -1794,12 +1792,11 @@ filt_pipewrite(struct knote *kn, long hi struct pipe *wpipe; wpipe = kn->kn_hook; - PIPE_LOCK(wpipe); + PIPE_LOCK_ASSERT(wpipe, MA_OWNED); if (wpipe->pipe_present != PIPE_ACTIVE || (wpipe->pipe_state & PIPE_EOF)) { kn->kn_data = 0; kn->kn_flags |= EV_EOF; - PIPE_UNLOCK(wpipe); return (1); } kn->kn_data = (wpipe->pipe_buffer.size > 0) ? @@ -1807,7 +1804,6 @@ filt_pipewrite(struct knote *kn, long hi if (wpipe->pipe_state & PIPE_DIRECTW) kn->kn_data = 0; - PIPE_UNLOCK(wpipe); return (kn->kn_data >= PIPE_BUF); } ___ 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-unsubscr...@freebsd.org"
svn commit: r276352 - head/contrib/binutils/bfd
Author: dim Date: Mon Dec 29 00:10:43 2014 New Revision: 276352 URL: https://svnweb.freebsd.org/changeset/base/276352 Log: In contrib/binutils/bfd/elf32-ppc.c, avoid warnings about case values not being in the enumerated type 'enum elf_ppc_reloc_type', by casting the switch argument to int. MFC after:3 days Modified: head/contrib/binutils/bfd/elf32-ppc.c Modified: head/contrib/binutils/bfd/elf32-ppc.c == --- head/contrib/binutils/bfd/elf32-ppc.c Sun Dec 28 21:36:20 2014 (r276351) +++ head/contrib/binutils/bfd/elf32-ppc.c Mon Dec 29 00:10:43 2014 (r276352) @@ -6185,7 +6185,7 @@ ppc_elf_relocate_section (bfd *output_bf howto = NULL; if (r_type < R_PPC_max) howto = ppc_elf_howto_table[r_type]; - switch (r_type) + switch ((int) r_type) { default: (*_bfd_error_handler) ___ 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-unsubscr...@freebsd.org"
svn commit: r276351 - head/sys/dev/uart
Author: marius Date: Sun Dec 28 21:36:20 2014 New Revision: 276351 URL: https://svnweb.freebsd.org/changeset/base/276351 Log: Don't use a sub-device/-vendor wildcard for probing MCS9922 as other chips with the same device and vendor IDs actually may provide different functionality. While at it, canonicalize the description to match other MosChip UARTs. PR: 186891 MFC after:3 days Modified: head/sys/dev/uart/uart_bus_pci.c Modified: head/sys/dev/uart/uart_bus_pci.c == --- head/sys/dev/uart/uart_bus_pci.cSun Dec 28 21:33:41 2014 (r276350) +++ head/sys/dev/uart/uart_bus_pci.cSun Dec 28 21:36:20 2014 (r276351) @@ -137,8 +137,8 @@ static const struct pci_id pci_ns8250_id "MosChip MCS9901 PCIe to Peripheral Controller", 0x10 }, { 0x9710, 0x9904, 0xa000, 0x1000, "MosChip MCS9904 PCIe to Peripheral Controller", 0x10 }, -{ 0x9710, 0x9922, 0x, 0, - "MosChip MCS9922 Multi I/O Controller", 0x10 }, +{ 0x9710, 0x9922, 0xa000, 0x1000, + "MosChip MCS9922 PCIe to Peripheral Controller", 0x10 }, { 0xdeaf, 0x9051, 0x, 0, "Middle Digital PC Weasel Serial Port", 0x10 }, { 0x, 0, 0x, 0, NULL, 0, 0} }; ___ 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-unsubscr...@freebsd.org"
svn commit: r276350 - head/sys/arm/arm
Author: ian Date: Sun Dec 28 21:33:41 2014 New Revision: 276350 URL: https://svnweb.freebsd.org/changeset/base/276350 Log: Update comments (r4 is not used anywhere), use non-profiling entry macros. Modified: head/sys/arm/arm/cpu_asm-v6.S Modified: head/sys/arm/arm/cpu_asm-v6.S == --- head/sys/arm/arm/cpu_asm-v6.S Sun Dec 28 21:27:13 2014 (r276349) +++ head/sys/arm/arm/cpu_asm-v6.S Sun Dec 28 21:33:41 2014 (r276350) @@ -37,14 +37,16 @@ /* * Define cache functions used by startup code, which counts on the fact that - * only r0-r4,r12 (ip) are modified and no stack space is used. This set - * of function must be called with interrupts disabled and don't follow - * ARM ABI (cannot be called form C code. - * Moreover, it works only with caches integrated to CPU (accessible via CP15). + * only r0-r3,r12 (ip) are modified and no stack space is used. These functions + * must be called with interrupts disabled. Moreover, these work only with + * caches integrated to CPU (accessible via CP15); systems with an external L2 + * cache controller such as a PL310 need separate calls to that device driver + * to affect L2 caches. This is not a factor during early kernel startup, as + * any external L2 cache controller has not been enabled yet. */ /* Invalidate D cache to PoC. (aka all cache levels)*/ -ASENTRY(dcache_inv_poc_all) +ASENTRY_NP(dcache_inv_poc_all) mrc CP15_CLIDR(r0) andsr0, r0, #0x0700 mov r0, r0, lsr #23 /* Get LoC (naturally aligned) */ @@ -96,7 +98,7 @@ ASENTRY(dcache_inv_poc_all) END(dcache_inv_poc_all) /* Invalidate D cache to PoU. (aka L1 cache only)*/ -ASENTRY(dcache_inv_pou_all) +ASENTRY_NP(dcache_inv_pou_all) mrc CP15_CLIDR(r0) andsr0, r0, #0x0700 mov r0, r0, lsr #26 /* Get LoUU (naturally aligned) */ @@ -147,7 +149,7 @@ ASENTRY(dcache_inv_pou_all) END(dcache_inv_pou_all) /* Write back and Invalidate D cache to PoC. */ -ASENTRY(dcache_wbinv_poc_all) +ASENTRY_NP(dcache_wbinv_poc_all) mrc CP15_CLIDR(r0) andsr0, r0, #0x0700 mov r0, r0, lsr #23 /* Get LoC (naturally aligned) */ ___ 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-unsubscr...@freebsd.org"
svn commit: r276349 - in stable/10: sys/amd64/include sys/amd64/vmm sys/amd64/vmm/intel sys/amd64/vmm/io sys/modules/vmm sys/x86/include usr.sbin/bhyve usr.sbin/bhyvectl
Author: neel Date: Sun Dec 28 21:27:13 2014 New Revision: 276349 URL: https://svnweb.freebsd.org/changeset/base/276349 Log: MFC r270326 Fix a recursive lock acquisition in vi_reset_dev(). MFC r270434 Return the spurious interrupt vector (IRQ7 or IRQ15) if the atpic cannot find any unmasked pin with an interrupt asserted. MFC r270436 Fix a bug in the emulation of CPUID leaf 0x4. MFC r270437 Add "hw.vmm.topology.threads_per_core" and "hw.vmm.topology.cores_per_package" tunables to modify the default cpu topology advertised by bhyve. MFC r270855 Set the 'inst_length' to '0' early on before any error conditions are detected in the emulation of the task switch. If any exceptions are triggered then the guest %rip should point to instruction that caused the task switch as opposed to the one after it. MFC r270857 The "SUB" instruction used in getcc() actually does 'x -= y' so use the proper constraint for 'x'. The "+r" constraint indicates that 'x' is an input and output register operand. While here generate code for different variants of getcc() using a macro GETCC(sz) where 'sz' indicates the operand size. Update the status bits in %rflags when emulating AND and OR opcodes. MFC r271439 Initialize 'bc_rdonly' to the right value. MFC r271451 Optimize the common case of injecting an interrupt into a vcpu after a HLT by explicitly moving it out of the interrupt shadow. MFC r271888 Restructure the MSR handling so it is entirely handled by processor-specific code. MFC r271890 MSR_KGSBASE is no longer saved and restored from the guest MSR save area. This behavior was changed in r271888 so update the comment block to reflect this. MFC r271891 Add some more KTR events to help debugging. MFC r272197 mmap(2) requires either MAP_PRIVATE or MAP_SHARED for non-anonymous mappings. MFC r272395 Get rid of code that dealt with the hardware not being able to save/restore the PAT MSR on guest exit/entry. This workaround was done for a beta release of VMware Fusion 5 but is no longer needed in later versions. All Intel CPUs since Nehalem have supported saving and restoring MSR_PAT in the VM exit and entry controls. MFC r272670 Inject #UD into the guest when it executes either 'MONITOR' or 'MWAIT'. MFC r272710 Implement the FLUSH operation in the virtio-block emulation. MFC r272838 iasl(8) expects integer fields in data tables to be specified as hexadecimal values. Therefore the bit width of the "PM Timer Block" was actually being interpreted as 50-bits instead of the expected 32-bit. This eliminates an error message emitted by a Linux 3.17 guest during boot: "Invalid length for FADT/PmTimerBlock: 50, using default 32" MFC r272839 Support Intel-specific MSRs that are accessed when booting up a linux in bhyve: - MSR_PLATFORM_INFO - MSR_TURBO_RATIO_LIMITx - MSR_RAPL_POWER_UNIT MFC r273108 Emulate "POP r/m". This is needed to boot OpenBSD/i386 MP kernel in bhyve. MFC r273212 Support stopping and restarting the AHCI command list via toggling PxCMD.ST from '1' to '0' and back. This allows the driver a chance to recover if for instance a timeout occurred due to activity on the host. Deleted: stable/10/sys/amd64/vmm/vmm_msr.c stable/10/sys/amd64/vmm/vmm_msr.h Modified: stable/10/sys/amd64/include/vmm.h stable/10/sys/amd64/vmm/intel/ept.c stable/10/sys/amd64/vmm/intel/vmcs.h stable/10/sys/amd64/vmm/intel/vmx.c stable/10/sys/amd64/vmm/intel/vmx.h stable/10/sys/amd64/vmm/intel/vmx_msr.c stable/10/sys/amd64/vmm/intel/vmx_msr.h stable/10/sys/amd64/vmm/io/vatpic.c stable/10/sys/amd64/vmm/io/vlapic.c stable/10/sys/amd64/vmm/vmm.c stable/10/sys/amd64/vmm/vmm_instruction_emul.c stable/10/sys/amd64/vmm/x86.c stable/10/sys/modules/vmm/Makefile stable/10/sys/x86/include/specialreg.h stable/10/usr.sbin/bhyve/acpi.c stable/10/usr.sbin/bhyve/bhyverun.c stable/10/usr.sbin/bhyve/block_if.c stable/10/usr.sbin/bhyve/pci_ahci.c stable/10/usr.sbin/bhyve/pci_virtio_block.c stable/10/usr.sbin/bhyve/task_switch.c stable/10/usr.sbin/bhyve/virtio.c stable/10/usr.sbin/bhyve/xmsr.c stable/10/usr.sbin/bhyve/xmsr.h stable/10/usr.sbin/bhyvectl/bhyvectl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/include/vmm.h == --- stable/10/sys/amd64/include/vmm.h Sun Dec 28 21:13:55 2014 (r276348) +++ stable/10/sys/amd64/include/vmm.h Sun Dec 28 21:27:13 2014 (r276349) @@ -82,6 +82,7 @@ enum vm_reg_name { VM_REG_GUEST_PDPTE1, VM_REG_GUEST_PDPTE2, VM_REG_GUEST_PDPTE3, + VM_REG_GUEST_INTR_SHADOW, VM_REG_LAST }; @@ -194,7 +195,6 @@ void vm_nmi_clear(struct vm *vm, int vcp int vm_inject_extint(struct vm *vm, int vcpu); int vm_extint_pending(struct vm *vm, int vcp
svn commit: r276347 - head/sys/fs/nfsclient
Author: rmacklem Date: Sun Dec 28 21:13:52 2014 New Revision: 276347 URL: https://svnweb.freebsd.org/changeset/base/276347 Log: r245508 modified the NFS client's Setattr RPC to use VA_UTIMES_NULL to indicate whether it should set the time to the current tod on the server. This had the side effect of making the NFS client use the client's timestamp for exclusive create, starting with FreeBSD9.2. Unfortunately a bug in some Solaris NFS servers causes these servers to return NFS_OK to the Setattr RPC done during exclusive create, but not actually set the file's mode, leaving the file's mode == 0. This patch restores the NFS client's behaviour to use the server's tod for the exclusive open's Setattr RPC, to avoid the Solaris server bug and to restore the pre-FreeBSD9.2 NFS behaviour. Discussed on: freebsd-fs PR: 186293 MFC after:3 months Modified: head/sys/fs/nfsclient/nfs_clport.c Modified: head/sys/fs/nfsclient/nfs_clport.c == --- head/sys/fs/nfsclient/nfs_clport.c Sun Dec 28 21:06:03 2014 (r276346) +++ head/sys/fs/nfsclient/nfs_clport.c Sun Dec 28 21:13:52 2014 (r276347) @@ -1096,9 +1096,16 @@ nfscl_checksattr(struct vattr *vap, stru * us to do a SETATTR RPC. FreeBSD servers store the verifier * in atime, but we can't really assume that all servers will * so we ensure that our SETATTR sets both atime and mtime. +* Set the VA_UTIMES_NULL flag for this case, so that +* the server's time will be used. This is needed to +* work around a bug in some Solaris servers, where +* setting the time TOCLIENT causes the Setattr RPC +* to return NFS_OK, but not set va_mode. */ - if (vap->va_mtime.tv_sec == VNOVAL) + if (vap->va_mtime.tv_sec == VNOVAL) { vfs_timestamp(&vap->va_mtime); + vap->va_vaflags |= VA_UTIMES_NULL; + } if (vap->va_atime.tv_sec == VNOVAL) vap->va_atime = vap->va_mtime; return (1); ___ 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-unsubscr...@freebsd.org"
svn commit: r276346 - head/contrib/binutils/gas/config
Author: dim Date: Sun Dec 28 21:06:03 2014 New Revision: 276346 URL: https://svnweb.freebsd.org/changeset/base/276346 Log: In contrib/binutils/gas/config/tc-ppc.c, fix a few -Wformat-security warnings. MFC after:3 days 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 Sun Dec 28 20:56:03 2014 (r276345) +++ head/contrib/binutils/gas/config/tc-ppc.c Sun Dec 28 21:06:03 2014 (r276346) @@ -1548,7 +1548,7 @@ ppc_insert_operand (unsigned long insn, errmsg = NULL; insn = (*operand->insert) (insn, (long) val, ppc_cpu, &errmsg); if (errmsg != (const char *) NULL) - as_bad_where (file, line, errmsg); + as_bad_where (file, line, "%s", errmsg); } else insn |= ((long) val & operand->bitm) << operand->shift; @@ -2279,7 +2279,7 @@ md_assemble (char *str) { insn = (*operand->insert) (insn, 0L, ppc_cpu, &errmsg); if (errmsg != (const char *) NULL) - as_bad (errmsg); + as_bad ("%s", errmsg); continue; } @@ -2292,7 +2292,7 @@ md_assemble (char *str) { insn = (*operand->insert) (insn, 0L, ppc_cpu, &errmsg); if (errmsg != (const char *) NULL) - as_bad (errmsg); + as_bad ("%s", errmsg); } if ((operand->flags & PPC_OPERAND_NEXT) != 0) next_opindex = *opindex_ptr + 1; ___ 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-unsubscr...@freebsd.org"
svn commit: r276345 - head/share/man/man4
Author: sbruno Date: Sun Dec 28 20:56:03 2014 New Revision: 276345 URL: https://svnweb.freebsd.org/changeset/base/276345 Log: Correct naming of sysctl pmtud_blackhole_activated_min_mss. Clarify some statements around PMTUD blackhole detection to make the behavior more clear in the man page. Submitted by: Mikhail MFC after:2 weeks Modified: head/share/man/man4/tcp.4 Modified: head/share/man/man4/tcp.4 == --- head/share/man/man4/tcp.4 Sun Dec 28 20:42:28 2014(r276344) +++ head/share/man/man4/tcp.4 Sun Dec 28 20:56:03 2014(r276345) @@ -521,11 +521,11 @@ This is needed to help with connection e when a broken firewall is in the network path. .It Va pmtud_blackhole_detection Turn on automatic path MTU blackhole detection. -In case of retransmits we will +In case of retransmits OS will lower the MSS to check if it's MTU problem. If current MSS is greater than -configured value to try, it will be set to it, otherwise, MSS will be set to -default values +configured value to try, it will be set to configured value, otherwise, +MSS will be set to default values .Po Va net.inet.tcp.mssdflt and .Va net.inet.tcp.v6mssdflt @@ -535,11 +535,12 @@ MSS to try for IPv4 if PMTU blackhole de .It Va v6pmtud_blackhole_mss MSS to try for IPv6 if PMTU blackhole detection is turned on. .It Va pmtud_blackhole_activated -Number of times the code was activated to attempt a MSS downshift. -.It Va pmtud_blackhole_min_activated -Number of times the blackhole MSS was used in an attempt to downshift. +Number of times configured values were used in an attempt to downshift. +.It Va pmtud_blackhole_activated_min_mss +Number of times default MSS was used in an attempt to downshift. .It Va pmtud_blackhole_failed -Number of times that we failed to connect after we downshifted the MSS. +Number of connections for which retransmits continued even after MSS +downshift. .El .Sh ERRORS A socket operation may fail with one of the following errors returned: ___ 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-unsubscr...@freebsd.org"
svn commit: r276344 - head/sys/dev/ahci
Author: marius Date: Sun Dec 28 20:42:28 2014 New Revision: 276344 URL: https://svnweb.freebsd.org/changeset/base/276344 Log: - Const'ify the ahci_ids table. - Use DEVMETHOD_END. - Use NULL instead of 0 for pointers. MFC after:3 days Modified: head/sys/dev/ahci/ahci.c head/sys/dev/ahci/ahci_pci.c head/sys/dev/ahci/ahciem.c Modified: head/sys/dev/ahci/ahci.c == --- head/sys/dev/ahci/ahci.cSun Dec 28 20:02:06 2014(r276343) +++ head/sys/dev/ahci/ahci.cSun Dec 28 20:42:28 2014(r276344) @@ -868,14 +868,14 @@ static device_method_t ahcich_methods[] DEVMETHOD(device_detach,ahci_ch_detach), DEVMETHOD(device_suspend, ahci_ch_suspend), DEVMETHOD(device_resume,ahci_ch_resume), - { 0, 0 } + DEVMETHOD_END }; static driver_t ahcich_driver = { "ahcich", ahcich_methods, sizeof(struct ahci_channel) }; -DRIVER_MODULE(ahcich, ahci, ahcich_driver, ahcich_devclass, 0, 0); +DRIVER_MODULE(ahcich, ahci, ahcich_driver, ahcich_devclass, NULL, NULL); struct ahci_dc_cb_args { bus_addr_t maddr; Modified: head/sys/dev/ahci/ahci_pci.c == --- head/sys/dev/ahci/ahci_pci.cSun Dec 28 20:02:06 2014 (r276343) +++ head/sys/dev/ahci/ahci_pci.cSun Dec 28 20:42:28 2014 (r276344) @@ -48,7 +48,7 @@ __FBSDID("$FreeBSD$"); static int force_ahci = 1; TUNABLE_INT("hw.ahci.force", &force_ahci); -static struct { +static const struct { uint32_tid; uint8_t rev; const char *name; @@ -479,14 +479,14 @@ static device_method_t ahci_methods[] = DEVMETHOD(bus_teardown_intr,ahci_teardown_intr), DEVMETHOD(bus_child_location_str, ahci_child_location_str), DEVMETHOD(bus_get_dma_tag, ahci_get_dma_tag), - { 0, 0 } + DEVMETHOD_END }; static driver_t ahci_driver = { "ahci", ahci_methods, sizeof(struct ahci_controller) }; -DRIVER_MODULE(ahci, pci, ahci_driver, ahci_devclass, 0, 0); +DRIVER_MODULE(ahci, pci, ahci_driver, ahci_devclass, NULL, NULL); static device_method_t ahci_ata_methods[] = { DEVMETHOD(device_probe, ahci_ata_probe), DEVMETHOD(device_attach,ahci_pci_attach), @@ -499,11 +499,11 @@ static device_method_t ahci_ata_methods[ DEVMETHOD(bus_setup_intr, ahci_setup_intr), DEVMETHOD(bus_teardown_intr,ahci_teardown_intr), DEVMETHOD(bus_child_location_str, ahci_child_location_str), - { 0, 0 } + DEVMETHOD_END }; static driver_t ahci_ata_driver = { "ahci", ahci_ata_methods, sizeof(struct ahci_controller) }; -DRIVER_MODULE(ahci, atapci, ahci_ata_driver, ahci_devclass, 0, 0); +DRIVER_MODULE(ahci, atapci, ahci_ata_driver, ahci_devclass, NULL, NULL); Modified: head/sys/dev/ahci/ahciem.c == --- head/sys/dev/ahci/ahciem.c Sun Dec 28 20:02:06 2014(r276343) +++ head/sys/dev/ahci/ahciem.c Sun Dec 28 20:42:28 2014(r276344) @@ -273,14 +273,14 @@ static device_method_t ahciem_methods[] DEVMETHOD(device_detach,ahci_em_detach), DEVMETHOD(device_suspend, ahci_em_suspend), DEVMETHOD(device_resume,ahci_em_resume), - { 0, 0 } + DEVMETHOD_END }; static driver_t ahciem_driver = { "ahciem", ahciem_methods, sizeof(struct ahci_enclosure) }; -DRIVER_MODULE(ahciem, ahci, ahciem_driver, ahciem_devclass, 0, 0); +DRIVER_MODULE(ahciem, ahci, ahciem_driver, ahciem_devclass, NULL, NULL); static void ahci_em_setleds(device_t dev, int c) ___ 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-unsubscr...@freebsd.org"
svn commit: r276342 - head/libexec/rtld-elf/powerpc
Author: dim Date: Sun Dec 28 19:55:44 2014 New Revision: 276342 URL: https://svnweb.freebsd.org/changeset/base/276342 Log: Fix the following -Werror warning from clang 3.5.0, while building rtld-elf for powerpc 32 bit: libexec/rtld-elf/powerpc/reloc.c:486:6: error: taking the absolute value of unsigned type 'Elf_Addr' (aka 'unsigned int') has no effect [-Werror,-Wabsolute-value] if (abs(offset) < 32*1024*1024) { /* inside 32MB? */ ^ libexec/rtld-elf/powerpc/reloc.c:486:6: note: remove the call to 'abs' since unsigned values cannot be negative if (abs(offset) < 32*1024*1024) { /* inside 32MB? */ ^~~ 1 error generated. Cast 'offset' to int, since that was intended, and should be safe to do on architectures with 32-bit two's complement ints. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D1387 Modified: head/libexec/rtld-elf/powerpc/reloc.c Modified: head/libexec/rtld-elf/powerpc/reloc.c == --- head/libexec/rtld-elf/powerpc/reloc.c Sun Dec 28 19:24:01 2014 (r276341) +++ head/libexec/rtld-elf/powerpc/reloc.c Sun Dec 28 19:55:44 2014 (r276342) @@ -483,7 +483,7 @@ reloc_jmpslot(Elf_Addr *wherep, Elf_Addr */ offset = target - (Elf_Addr)wherep; - if (abs(offset) < 32*1024*1024) { /* inside 32MB? */ + if (abs((int)offset) < 32*1024*1024) { /* inside 32MB? */ /* bvalue # branch directly */ *wherep = 0x4800 | (offset & 0x03fc); __syncicache(wherep, 4); ___ 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-unsubscr...@freebsd.org"
svn commit: r276341 - head/sys/kern
Author: mjg Date: Sun Dec 28 19:24:01 2014 New Revision: 276341 URL: https://svnweb.freebsd.org/changeset/base/276341 Log: sysctl: don't modify oid_running for static nodes It is necessary to prevent nodes from being destroyed while used, but static ones cannot be destroyed. Modified: head/sys/kern/kern_sysctl.c Modified: head/sys/kern/kern_sysctl.c == --- head/sys/kern/kern_sysctl.c Sun Dec 28 19:05:32 2014(r276340) +++ head/sys/kern/kern_sysctl.c Sun Dec 28 19:24:01 2014(r276341) @@ -174,7 +174,8 @@ sysctl_root_handler_locked(struct sysctl int error; bool xlocked; - atomic_add_int(&oid->oid_running, 1); + if (oid->oid_kind & CTLFLAG_DYN) + atomic_add_int(&oid->oid_running, 1); xlocked = sysctl_unlock(); if (!(oid->oid_kind & CTLFLAG_MPSAFE)) @@ -184,9 +185,11 @@ sysctl_root_handler_locked(struct sysctl mtx_unlock(&Giant); sysctl_lock(xlocked); - if (atomic_fetchadd_int(&oid->oid_running, -1) == 1 && - (oid->oid_kind & CTLFLAG_DYING) != 0) - wakeup(&oid->oid_running); + if (oid->oid_kind & CTLFLAG_DYN) { + if (atomic_fetchadd_int(&oid->oid_running, -1) == 1 && + (oid->oid_kind & CTLFLAG_DYING) != 0) + wakeup(&oid->oid_running); + } return (error); } ___ 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-unsubscr...@freebsd.org"
svn commit: r276340 - head/sys/arm/include
Author: ian Date: Sun Dec 28 19:05:32 2014 New Revision: 276340 URL: https://svnweb.freebsd.org/changeset/base/276340 Log: Fix a "decl is not a prototype" error noticed by gcc (but not clang). Modified: head/sys/arm/include/cpu-v6.h Modified: head/sys/arm/include/cpu-v6.h == --- head/sys/arm/include/cpu-v6.h Sun Dec 28 19:03:29 2014 (r276339) +++ head/sys/arm/include/cpu-v6.h Sun Dec 28 19:05:32 2014 (r276340) @@ -224,7 +224,7 @@ tlb_flush_all(void) } static __inline void -tlb_flush_all_ng() +tlb_flush_all_ng(void) { dsb(); ___ 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-unsubscr...@freebsd.org"
svn commit: r276339 - stable/10/sys/kern
Author: marcel Date: Sun Dec 28 19:03:29 2014 New Revision: 276339 URL: https://svnweb.freebsd.org/changeset/base/276339 Log: MFC r272789: Fix draining in ttydev_leave(). Modified: stable/10/sys/kern/tty.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/tty.c == --- stable/10/sys/kern/tty.cSun Dec 28 18:53:16 2014(r276338) +++ stable/10/sys/kern/tty.cSun Dec 28 19:03:29 2014(r276339) @@ -123,9 +123,10 @@ tty_watermarks(struct tty *tp) } static int -tty_drain(struct tty *tp) +tty_drain(struct tty *tp, int leaving) { - int error; + size_t bytesused; + int error, revokecnt; if (ttyhook_hashook(tp, getc_inject)) /* buffer is inaccessible */ @@ -134,11 +135,27 @@ tty_drain(struct tty *tp) while (ttyoutq_bytesused(&tp->t_outq) > 0) { ttydevsw_outwakeup(tp); /* Could be handled synchronously. */ - if (ttyoutq_bytesused(&tp->t_outq) == 0) + bytesused = ttyoutq_bytesused(&tp->t_outq); + if (bytesused == 0) return (0); /* Wait for data to be drained. */ - error = tty_wait(tp, &tp->t_outwait); + if (leaving) { + revokecnt = tp->t_revokecnt; + error = tty_timedwait(tp, &tp->t_outwait, hz); + switch (error) { + case ERESTART: + if (revokecnt != tp->t_revokecnt) + error = 0; + break; + case EWOULDBLOCK: + if (ttyoutq_bytesused(&tp->t_outq) < bytesused) + error = 0; + break; + } + } else + error = tty_wait(tp, &tp->t_outwait); + if (error) return (error); } @@ -191,10 +208,8 @@ ttydev_leave(struct tty *tp) /* Drain any output. */ MPASS((tp->t_flags & TF_STOPPED) == 0); - if (!tty_gone(tp)) { - while (tty_drain(tp) == ERESTART) - ; - } + if (!tty_gone(tp)) + tty_drain(tp, 1); ttydisc_close(tp); @@ -1549,7 +1564,7 @@ tty_generic_ioctl(struct tty *tp, u_long /* Set terminal flags through tcsetattr(). */ if (cmd == TIOCSETAW || cmd == TIOCSETAF) { - error = tty_drain(tp); + error = tty_drain(tp, 0); if (error) return (error); if (cmd == TIOCSETAF) @@ -1728,7 +1743,7 @@ tty_generic_ioctl(struct tty *tp, u_long } case TIOCDRAIN: /* Drain TTY output. */ - return tty_drain(tp); + return tty_drain(tp, 0); case TIOCCONS: /* Set terminal as console TTY. */ if (*(int *)data) { ___ 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-unsubscr...@freebsd.org"
svn commit: r276338 - stable/10/sys/kern
Author: marcel Date: Sun Dec 28 18:53:16 2014 New Revision: 276338 URL: https://svnweb.freebsd.org/changeset/base/276338 Log: MFC r269126 & 272786: Don't return ERESTART when the device is gone. Modified: stable/10/sys/kern/tty.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/tty.c == --- stable/10/sys/kern/tty.cSun Dec 28 18:43:39 2014(r276337) +++ stable/10/sys/kern/tty.cSun Dec 28 18:53:16 2014(r276338) @@ -1391,14 +1391,14 @@ tty_wait(struct tty *tp, struct cv *cv) error = cv_wait_sig(cv, tp->t_mtx); - /* Restart the system call when we may have been revoked. */ - if (tp->t_revokecnt != revokecnt) - return (ERESTART); - /* Bail out when the device slipped away. */ if (tty_gone(tp)) return (ENXIO); + /* Restart the system call when we may have been revoked. */ + if (tp->t_revokecnt != revokecnt) + return (ERESTART); + return (error); } @@ -1413,14 +1413,14 @@ tty_timedwait(struct tty *tp, struct cv error = cv_timedwait_sig(cv, tp->t_mtx, hz); - /* Restart the system call when we may have been revoked. */ - if (tp->t_revokecnt != revokecnt) - return (ERESTART); - /* Bail out when the device slipped away. */ if (tty_gone(tp)) return (ENXIO); + /* Restart the system call when we may have been revoked. */ + if (tp->t_revokecnt != revokecnt) + return (ERESTART); + return (error); } ___ 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-unsubscr...@freebsd.org"
svn commit: r276337 - stable/10/usr.bin/mkimg
Author: marcel Date: Sun Dec 28 18:43:39 2014 New Revision: 276337 URL: https://svnweb.freebsd.org/changeset/base/276337 Log: MFC r275721: The size of the first level reference count table is given in terms of the number of clusters it occupies. Bump the version number of mkimg. Modified: stable/10/usr.bin/mkimg/Makefile stable/10/usr.bin/mkimg/qcow.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/mkimg/Makefile == --- stable/10/usr.bin/mkimg/MakefileSun Dec 28 18:38:25 2014 (r276336) +++ stable/10/usr.bin/mkimg/MakefileSun Dec 28 18:43:39 2014 (r276337) @@ -4,7 +4,7 @@ PROG= mkimg SRCS= format.c image.c mkimg.c scheme.c MAN= mkimg.1 -MKIMG_VERSION=20141003 +MKIMG_VERSION=20141211 mkimg.o: Makefile CFLAGS+=-DMKIMG_VERSION=${MKIMG_VERSION} Modified: stable/10/usr.bin/mkimg/qcow.c == --- stable/10/usr.bin/mkimg/qcow.c Sun Dec 28 18:38:25 2014 (r276336) +++ stable/10/usr.bin/mkimg/qcow.c Sun Dec 28 18:43:39 2014 (r276337) @@ -71,7 +71,7 @@ struct qcow_header { uint32_tl1_entries; uint64_tl1_offset; uint64_trefcnt_offset; - uint32_trefcnt_entries; + uint32_trefcnt_clstrs; uint32_tsnapshot_count; uint64_tsnapshot_offset; } v2; @@ -139,7 +139,7 @@ qcow_write(int fd, u_int version) uint64_t n, imagesz, nclstrs, ofs, ofsflags; lba_t blk, blkofs, blk_imgsz; u_int l1clno, l2clno, rcclno; - u_int blk_clstrsz; + u_int blk_clstrsz, refcnt_clstrs; u_int clstrsz, l1idx, l2idx; int error; @@ -199,14 +199,15 @@ qcow_write(int fd, u_int version) be32enc(&hdr->u.v2.l1_entries, clstr_l2tbls); be64enc(&hdr->u.v2.l1_offset, clstrsz * l1clno); be64enc(&hdr->u.v2.refcnt_offset, clstrsz * rcclno); - be32enc(&hdr->u.v2.refcnt_entries, clstr_rcblks); + refcnt_clstrs = round_clstr(clstr_rcblks * 8) >> clstr_log2sz; + be32enc(&hdr->u.v2.refcnt_clstrs, refcnt_clstrs); break; default: return (EDOOFUS); } if (sparse_write(fd, hdr, clstrsz) < 0) { -error = errno; + error = errno; goto out; } ___ 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-unsubscr...@freebsd.org"
svn commit: r276336 - in head/sys: arm/arm conf
Author: ian Date: Sun Dec 28 18:38:25 2014 New Revision: 276336 URL: https://svnweb.freebsd.org/changeset/base/276336 Log: Add cache maintenance functions which will be used by startup code to initially set up the MMU. Some day they may also be useful as part of suspend/resume handling, when we get better at power management. Submitted by: Svatopluk Kraus , Michal Meloun + * Copyright 2014 Michal Meloun + * 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$ + */ + +#include +#include +#include +#include +#include + +#if __ARM_ARCH >= 7 + +/* + * Define cache functions used by startup code, which counts on the fact that + * only r0-r4,r12 (ip) are modified and no stack space is used. This set + * of function must be called with interrupts disabled and don't follow + * ARM ABI (cannot be called form C code. + * Moreover, it works only with caches integrated to CPU (accessible via CP15). + */ + +/* Invalidate D cache to PoC. (aka all cache levels)*/ +ASENTRY(dcache_inv_poc_all) + mrc CP15_CLIDR(r0) + andsr0, r0, #0x0700 + mov r0, r0, lsr #23 /* Get LoC (naturally aligned) */ + beq 4f + +1: mcr CP15_CSSELR(r0) /* set cache level */ + isb + mrc CP15_CCSIDR(r0) /* read CCSIDR */ + + ubfxr2, r0, #13, #15/* get num sets - 1 from CCSIDR */ + ubfxr3, r0, #3, #10 /* get num ways - 1 from CCSIDR */ + clz r1, r3 /* number of bits to MSB of way */ + lsl r3, r3, r1 /* shift into position */ + mov ip, #1 + lsl ip, ip, r1 /* ip now contains the way decr */ + + ubfxr0, r0, #0, #3 /* get linesize from CCSIDR */ + add r0, r0, #4 /* apply bias */ + lsl r2, r2, r0 /* shift sets by log2(linesize) */ + add r3, r3, r2 /* merge numsets - 1 with numways - 1 */ + sub ip, ip, r2 /* subtract numsets - 1 from way decr */ + mov r1, #1 + lsl r1, r1, r0 /* r1 now contains the set decr */ + mov r2, ip /* r2 now contains set way decr */ + + /* r3 = ways/sets, r2 = way decr, r1 = set decr, r0 and ip are free */ +2: mcr CP15_DCISW(r3) /* invalidate line */ + movsr0, r3 /* get current way/set */ + beq 3f /* at 0 means we are done */ + movsr0, r0, lsl #10 /* clear way bits leaving only set bits*/ + subne r3, r3, r1 /* non-zero?, decrement set */ + subeq r3, r3, r2 /* zero?, decrement way and restore set count */ + b 2b + +3: + mrc CP15_CSSELR(r0) /* get cache level */ + add r0, r0, #2 /* next level */ + mrc CP15_CLIDR(r1) + andsr1, r1, #0x0700 + mov r1, r1, lsr #23 /* Get LoC (naturally aligned) */ + cmp r1, r0 + bgt 1b + +4: dsb /* wait for stores to finish */ + mov r0, #0 + mcr CP15_CSSELR(r0) + isb + bx lr +END(dcache_inv_poc_all) + +/* Invalidate D cache to PoU. (aka L1 cache only)*/ +ASENTRY(dcache_inv_pou_all) + mrc CP15_CLIDR(r0) + andsr0, r0, #0x0700 + mov r0, r0, lsr #26 /* Get LoUU (naturally aligned) */ + beq 4f + +1: mcr CP15_CSSELR(r0) /* set cache level */ + isb + mrc CP15_CCSIDR(r0) /* read CCSIDR */ + + ubfxr2, r0, #13, #
svn commit: r276335 - head/sys/arm/include
Author: ian Date: Sun Dec 28 18:26:15 2014 New Revision: 276335 URL: https://svnweb.freebsd.org/changeset/base/276335 Log: Eliminate an unused macro whose name clashes now with a function in the new cpu-v6.h. This should have been part of r276334. Modified: head/sys/arm/include/cpufunc.h Modified: head/sys/arm/include/cpufunc.h == --- head/sys/arm/include/cpufunc.h Sun Dec 28 18:19:05 2014 (r276334) +++ head/sys/arm/include/cpufunc.h Sun Dec 28 18:26:15 2014 (r276335) @@ -563,7 +563,6 @@ voidxscalec3_context_switch (void); #endif /* CPU_XSCALE_81342 */ -#define tlb_flush cpu_tlb_flushID #define setttb cpu_setttb #define drain_writebuf cpu_drain_writebuf ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r276334 - head/sys/arm/include
On Sun, 2014-12-28 at 18:19 +, Ian Lepore wrote: > Author: ian > Date: Sun Dec 28 18:19:05 2014 > New Revision: 276334 > URL: https://svnweb.freebsd.org/changeset/base/276334 > > Log: > Add new TLB and cache maintainence functions for armv6 and armv7. These > are inline functions that handle all the routine maintenance operations > except the flush-all and invalidate-all routines which are required only > during early kernel init. > > These inline functions should be very much faster than the old mechanism > that involved jumping through the big cpufuncs table, especially for > common operations such as invalidating a single TLB entry. Note that > nothing is calling these yet, this just is just required infrastructure > for upcoming changes to the pmap-v6 code. > > Modified: > head/sys/arm/include/cpu-v6.h Ooops, I forgot to add... Submitted by: Svatopluk Kraus , Michal Meloun http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r276334 - head/sys/arm/include
Author: ian Date: Sun Dec 28 18:19:05 2014 New Revision: 276334 URL: https://svnweb.freebsd.org/changeset/base/276334 Log: Add new TLB and cache maintainence functions for armv6 and armv7. These are inline functions that handle all the routine maintenance operations except the flush-all and invalidate-all routines which are required only during early kernel init. These inline functions should be very much faster than the old mechanism that involved jumping through the big cpufuncs table, especially for common operations such as invalidating a single TLB entry. Note that nothing is calling these yet, this just is just required infrastructure for upcoming changes to the pmap-v6 code. Modified: head/sys/arm/include/cpu-v6.h Modified: head/sys/arm/include/cpu-v6.h == --- head/sys/arm/include/cpu-v6.h Sun Dec 28 18:12:56 2014 (r276333) +++ head/sys/arm/include/cpu-v6.h Sun Dec 28 18:19:05 2014 (r276334) @@ -155,4 +155,242 @@ _RF0(cp15_cbar_get, CP15_CBAR(%0)) #undef _WF0 #undef _WF1 +/* + * TLB maintenance operations. + */ + +/* Local (i.e. not broadcasting ) operations. */ + +/* Flush all TLB entries (even global). */ +static __inline void +tlb_flush_all_local(void) +{ + + dsb(); + _CP15_TLBIALL(); + dsb(); +} + +/* Flush all not global TLB entries. */ +static __inline void +tlb_flush_all_ng_local(void) +{ + + dsb(); + _CP15_TLBIASID(CPU_ASID_KERNEL); + dsb(); +} + +/* Flush single TLB entry (even global). */ +static __inline void +tlb_flush_local(vm_offset_t sva) +{ + + dsb(); + _CP15_TLBIMVA((sva & ~PAGE_MASK ) | CPU_ASID_KERNEL); + dsb(); +} + +/* Flush range of TLB entries (even global). */ +static __inline void +tlb_flush_range_local(vm_offset_t sva, vm_size_t size) +{ + vm_offset_t va; + vm_offset_t eva = sva + size; + + dsb(); + for (va = sva; va < eva; va += PAGE_SIZE) + _CP15_TLBIMVA((va & ~PAGE_MASK ) | CPU_ASID_KERNEL); + dsb(); +} + +/* Broadcasting operations. */ +#ifndef SMP + +#define tlb_flush_all()tlb_flush_all_local() +#define tlb_flush_all_ng() tlb_flush_all_ng_local() +#define tlb_flush(sva) tlb_flush_local(sva) +#define tlb_flush_range(sva, size) tlb_flush_range_local(sva, size) + +#else /* SMP */ + +static __inline void +tlb_flush_all(void) +{ + + dsb(); + _CP15_TLBIALLIS(); + dsb(); +} + +static __inline void +tlb_flush_all_ng() +{ + + dsb(); + _CP15_TLBIASIDIS(CPU_ASID_KERNEL); + dsb(); +} + +static __inline void +tlb_flush(vm_offset_t sva) +{ + + dsb(); + _CP15_TLBIMVAAIS(sva); + dsb(); +} + +static __inline void +tlb_flush_range(vm_offset_t sva, vm_size_t size) +{ + vm_offset_t va; + vm_offset_t eva = sva + size; + + dsb(); + for (va = sva; va < eva; va += PAGE_SIZE) + _CP15_TLBIMVAAIS(va); + dsb(); +} +#endif /* SMP */ + +/* + * Cache maintenance operations. + */ + +/* Sync I and D caches to PoU */ +static __inline void +icache_sync(vm_offset_t sva, vm_size_t size) +{ + vm_offset_t va; + vm_offset_t eva = sva + size; + + dsb(); + for (va = sva; va < eva; va += arm_dcache_align) { +#ifdef SMP + _CP15_DCCMVAU(va); +#else + _CP15_DCCMVAC(va); +#endif + } + dsb(); +#ifdef SMP + _CP15_ICIALLUIS(); +#else + _CP15_ICIALLU(); +#endif + dsb(); + isb(); +} + +/* Invalidate I cache */ +static __inline void +icache_inv_all(void) +{ +#ifdef SMP + _CP15_ICIALLUIS(); +#else + _CP15_ICIALLU(); +#endif + dsb(); + isb(); +} + +/* Write back D-cache to PoU */ +static __inline void +dcache_wb_pou(vm_offset_t sva, vm_size_t size) +{ + vm_offset_t va; + vm_offset_t eva = sva + size; + + dsb(); + for (va = sva; va < eva; va += arm_dcache_align) { +#ifdef SMP + _CP15_DCCMVAU(va); +#else + _CP15_DCCMVAC(va); +#endif + } + dsb(); +} + +/* Invalidate D-cache to PoC */ +static __inline void +dcache_inv_poc(vm_offset_t sva, vm_paddr_t pa, vm_size_t size) +{ + vm_offset_t va; + vm_offset_t eva = sva + size; + + /* invalidate L1 first */ + for (va = sva; va < eva; va += arm_dcache_align) { + _CP15_DCIMVAC(va); + } + dsb(); + + /* then L2 */ + cpu_l2cache_inv_range(pa, size); + dsb(); + + /* then L1 again */ + for (va = sva; va < eva; va += arm_dcache_align) { + _CP15_DCIMVAC(va); + } + dsb(); +} + +/* Write back D-cache to PoC */ +static __inline void +dcache_wb_poc(vm_offset_t sva, vm_paddr_t pa, vm_size_t size) +{ + vm_offset_t va; + vm_offset_t eva = sva + size; + + dsb(); + + for (va = sva; va < eva; va += arm_dcache_align) {
svn commit: r276333 - in head/sys: arm/arm arm/include conf
Author: ian Date: Sun Dec 28 18:12:56 2014 New Revision: 276333 URL: https://svnweb.freebsd.org/changeset/base/276333 Log: Add new code to read and parse cpu identification data using the new CPUID mechanism defined for armv7 (and also present on some armv6 chips including the arm1176 used on rpi). The information is parsed into a global cpuinfo structure, which will be used by (upcoming) new cache and tlb maintenance code to handle cpu-specific variations of the maintence sequences. Submitted by: Svatopluk Kraus , Michal Meloun + * Copyright 2014 Michal Meloun + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include +#include + +struct cpuinfo cpuinfo; + +/* Read and parse CPU id scheme */ +void +cpuinfo_init(void) +{ + + cpuinfo.midr = cp15_midr_get(); + /* Test old version id schemes first */ + if ((cpuinfo.midr & CPU_ID_IMPLEMENTOR_MASK) == CPU_ID_ARM_LTD) { + if (CPU_ID_ISOLD(cpuinfo.midr)) { + /* obsolete ARMv2 or ARMv3 CPU */ + cpuinfo.midr = 0; + return; + } + if (CPU_ID_IS7(cpuinfo.midr)) { + if ((cpuinfo.midr & (1 << 23)) == 0) { + /* obsolete ARMv3 CPU */ + cpuinfo.midr = 0; + return; + } + /* ARMv4T CPU */ + cpuinfo.architecture = 1; + cpuinfo.revision = (cpuinfo.midr >> 16) & 0x7F; + } + } else { + /* must be new id scheme */ + cpuinfo.architecture = (cpuinfo.midr >> 16) & 0x0F; + cpuinfo.revision = (cpuinfo.midr >> 20) & 0x0F; + } + /* Parse rest of MIDR */ + cpuinfo.implementer = (cpuinfo.midr >> 24) & 0xFF; + cpuinfo.part_number = (cpuinfo.midr >> 4) & 0xFFF; + cpuinfo.patch = cpuinfo.midr & 0x0F; + + /* CP15 c0,c0 regs 0-7 exist on all CPUs (although aliased with MIDR) */ + cpuinfo.ctr = cp15_ctr_get(); + cpuinfo.tcmtr = cp15_tcmtr_get(); + cpuinfo.tlbtr = cp15_tlbtr_get(); + cpuinfo.mpidr = cp15_mpidr_get(); + cpuinfo.revidr = cp15_revidr_get(); + + /* if CPU is not v7 cpu id scheme */ + if (cpuinfo.architecture != 0xF) + return; + + cpuinfo.id_pfr0 = cp15_id_pfr0_get(); + cpuinfo.id_pfr1 = cp15_id_pfr1_get(); + cpuinfo.id_dfr0 = cp15_id_dfr0_get(); + cpuinfo.id_afr0 = cp15_id_afr0_get(); + cpuinfo.id_mmfr0 = cp15_id_mmfr0_get(); + cpuinfo.id_mmfr1 = cp15_id_mmfr1_get(); + cpuinfo.id_mmfr2 = cp15_id_mmfr2_get(); + cpuinfo.id_mmfr3 = cp15_id_mmfr3_get(); + cpuinfo.id_isar0 = cp15_id_isar0_get(); + cpuinfo.id_isar1 = cp15_id_isar1_get(); + cpuinfo.id_isar2 = cp15_id_isar2_get(); + cpuinfo.id_isar3 = cp15_id_isar3_get(); + cpuinfo.id_isar4 = cp15_id_isar4_get(); + cpuinfo.id_isar5 = cp15_id_isar5_get(); + +/* Not yet - CBAR only exist on ARM SMP Cortex A CPUs + cpuinfo.cbar = cp15_cbar_get(); +*/ + + /* Test if revidr is implemented */ + if (cpuinfo.revidr == cpuinfo.midr) + cpuinfo.revidr = 0; + + /* parsed bits of above registers */ + /* id_mmfr0 */ + cpuinfo.outermost_shareability = (cpuinfo.id_mmfr0 >> 8) & 0xF; + cpuinfo.shareability_levels = (cpuinfo.id_mmfr0 >> 12) & 0xF; + cpuinfo.auxiliary_registers = (cpuinfo.id_mmfr0 >> 20) & 0xF; + cpuinfo.innermost_sharea
svn commit: r276330 - head/share/mk
Author: antoine Date: Sun Dec 28 15:38:50 2014 New Revision: 276330 URL: https://svnweb.freebsd.org/changeset/base/276330 Log: Add ncurses to _LIBRARIES so that libmenu is correctly linked PR: ports/195782 Modified: head/share/mk/src.libnames.mk Modified: head/share/mk/src.libnames.mk == --- head/share/mk/src.libnames.mk Sun Dec 28 15:37:51 2014 (r276329) +++ head/share/mk/src.libnames.mk Sun Dec 28 15:38:50 2014 (r276330) @@ -110,6 +110,7 @@ _LIBRARIES= \ memstat \ mp \ nandfs \ + ncurses \ ncursesw \ netgraph \ ngatm \ ___ 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-unsubscr...@freebsd.org"