From owner-svn-src-all@freebsd.org Sun Dec 24 01:00:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 541CDE881D3; Sun, 24 Dec 2017 01:00:17 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D41D7E947; Sun, 24 Dec 2017 01:00:17 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBO10G4j073857; Sun, 24 Dec 2017 01:00:16 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBO10GB2073856; Sun, 24 Dec 2017 01:00:16 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201712240100.vBO10GB2073856@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 24 Dec 2017 01:00:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r327123 - vendor/llvm/llvm-trunk-r321414 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/llvm/llvm-trunk-r321414 X-SVN-Commit-Revision: 327123 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Dec 2017 01:00:17 -0000 Author: dim Date: Sun Dec 24 01:00:16 2017 New Revision: 327123 URL: https://svnweb.freebsd.org/changeset/base/327123 Log: Tag llvm trunk r321414. Added: vendor/llvm/llvm-trunk-r321414/ - copied from r327122, vendor/llvm/dist/ From owner-svn-src-all@freebsd.org Sun Dec 24 01:00:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68A0DE881AF; Sun, 24 Dec 2017 01:00:13 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB1E87E93D; Sun, 24 Dec 2017 01:00:12 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBO10Bu9073811; Sun, 24 Dec 2017 01:00:11 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBO109Ga073783; Sun, 24 Dec 2017 01:00:09 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201712240100.vBO109Ga073783@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 24 Dec 2017 01:00:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r327122 - in vendor/llvm/dist: docs docs/tutorial examples/Kaleidoscope examples/Kaleidoscope/Chapter9 include/llvm include/llvm-c include/llvm/Analysis include/llvm/BinaryFormat includ... X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/llvm/dist: docs docs/tutorial examples/Kaleidoscope examples/Kaleidoscope/Chapter9 include/llvm include/llvm-c include/llvm/Analysis include/llvm/BinaryFormat include/llvm/BinaryFormat/WasmR... X-SVN-Commit-Revision: 327122 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Dec 2017 01:00:13 -0000 Author: dim Date: Sun Dec 24 01:00:08 2017 New Revision: 327122 URL: https://svnweb.freebsd.org/changeset/base/327122 Log: Vendor import of llvm trunk r321414: https://llvm.org/svn/llvm-project/llvm/trunk@321414 Added: vendor/llvm/dist/include/llvm/BinaryFormat/WasmRelocs.def vendor/llvm/dist/include/llvm/CodeGen/LiveStacks.h (contents, props changed) vendor/llvm/dist/include/llvm/CodeGen/SDNodeProperties.td vendor/llvm/dist/lib/CodeGen/LiveStacks.cpp (contents, props changed) vendor/llvm/dist/test/CodeGen/AArch64/GlobalISel/fp128-legalize-crash-pr35690.mir vendor/llvm/dist/test/CodeGen/AArch64/chkstk.ll vendor/llvm/dist/test/CodeGen/AMDGPU/memory-legalizer-store-infinite-loop.ll vendor/llvm/dist/test/CodeGen/ARM/su-addsub-overflow.ll vendor/llvm/dist/test/CodeGen/ARM/usat.ll vendor/llvm/dist/test/CodeGen/BPF/objdump_imm_hex.ll vendor/llvm/dist/test/CodeGen/Hexagon/autohvx/build-vector-i32-type.ll vendor/llvm/dist/test/CodeGen/Hexagon/autohvx/isel-bool-vector.ll vendor/llvm/dist/test/CodeGen/Hexagon/autohvx/isel-select-const.ll vendor/llvm/dist/test/CodeGen/Hexagon/vect/vect-extract-i1-debug.ll vendor/llvm/dist/test/CodeGen/Mips/long-call-mcount.ll vendor/llvm/dist/test/CodeGen/Mips/sll-micromips-r6-encoding.mir vendor/llvm/dist/test/CodeGen/PowerPC/uint-to-ppcfp128-crash.ll vendor/llvm/dist/test/CodeGen/Thumb2/t2sizereduction.mir vendor/llvm/dist/test/DebugInfo/X86/dwarfdump-str-offsets-invalid-6.s (contents, props changed) vendor/llvm/dist/test/MC/AMDGPU/invalid-instructions-spellcheck.s (contents, props changed) vendor/llvm/dist/test/MC/ARM/dfb-neg.s (contents, props changed) vendor/llvm/dist/test/MC/ARM/dfb.s (contents, props changed) vendor/llvm/dist/test/MC/Disassembler/ARM/dfb-arm.txt (contents, props changed) vendor/llvm/dist/test/MC/Disassembler/ARM/dfb-thumb.txt (contents, props changed) vendor/llvm/dist/test/MC/X86/CLFLUSHOPT-32.s (contents, props changed) vendor/llvm/dist/test/MC/X86/CLFLUSHOPT-64.s (contents, props changed) vendor/llvm/dist/test/MC/X86/CLFSH-32.s (contents, props changed) vendor/llvm/dist/test/MC/X86/CLFSH-64.s (contents, props changed) vendor/llvm/dist/test/Transforms/CallSiteSplitting/callsite-no-or-structure.ll vendor/llvm/dist/test/Transforms/CallSiteSplitting/callsite-no-splitting.ll vendor/llvm/dist/test/Transforms/Inline/AArch64/binop.ll vendor/llvm/dist/test/Transforms/Inline/ARM/inline-fp.ll vendor/llvm/dist/test/Transforms/LoopVectorize/legal_preheader_check.ll vendor/llvm/dist/test/Transforms/MemCpyOpt/memcpy-invoke-memcpy.ll vendor/llvm/dist/test/Transforms/MemCpyOpt/merge-into-memset.ll vendor/llvm/dist/test/Transforms/MemCpyOpt/mixed-sizes.ll vendor/llvm/dist/test/Transforms/MemCpyOpt/nonlocal-memcpy-memcpy.ll vendor/llvm/dist/test/Transforms/SimplifyCFG/X86/if-conversion.ll vendor/llvm/dist/test/tools/llvm-objcopy/add-section-remove.test vendor/llvm/dist/test/tools/llvm-objcopy/add-section.test vendor/llvm/dist/utils/TableGen/SDNodeProperties.cpp (contents, props changed) vendor/llvm/dist/utils/TableGen/SDNodeProperties.h (contents, props changed) Deleted: vendor/llvm/dist/include/llvm/BinaryFormat/WasmRelocs/WebAssembly.def vendor/llvm/dist/include/llvm/CodeGen/LiveStackAnalysis.h vendor/llvm/dist/lib/CodeGen/LiveStackAnalysis.cpp vendor/llvm/dist/test/Transforms/Inline/inline-fp.ll vendor/llvm/dist/test/Transforms/SLPVectorizer/X86/jumbled-load-shuffle-placement.ll vendor/llvm/dist/test/Transforms/SLPVectorizer/X86/jumbled-load-used-in-phi.ll Modified: vendor/llvm/dist/docs/Extensions.rst vendor/llvm/dist/docs/MIRLangRef.rst vendor/llvm/dist/docs/tutorial/LangImpl09.rst vendor/llvm/dist/examples/Kaleidoscope/CMakeLists.txt vendor/llvm/dist/examples/Kaleidoscope/Chapter9/toy.cpp vendor/llvm/dist/include/llvm-c/lto.h vendor/llvm/dist/include/llvm/Analysis/AliasAnalysis.h vendor/llvm/dist/include/llvm/Analysis/AliasAnalysisEvaluator.h vendor/llvm/dist/include/llvm/Analysis/LoopAccessAnalysis.h vendor/llvm/dist/include/llvm/Analysis/MemoryDependenceAnalysis.h vendor/llvm/dist/include/llvm/Analysis/ProfileSummaryInfo.h vendor/llvm/dist/include/llvm/Analysis/ScalarEvolutionExpander.h vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfo.h vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfoImpl.h vendor/llvm/dist/include/llvm/BinaryFormat/Wasm.h vendor/llvm/dist/include/llvm/CodeGen/BasicTTIImpl.h vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/InstructionSelector.h vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/InstructionSelectorImpl.h vendor/llvm/dist/include/llvm/CodeGen/MachineOperand.h vendor/llvm/dist/include/llvm/CodeGen/RuntimeLibcalls.def vendor/llvm/dist/include/llvm/CodeGen/SelectionDAGNodes.h vendor/llvm/dist/include/llvm/CodeGen/TargetLowering.h vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFUnit.h vendor/llvm/dist/include/llvm/FuzzMutate/IRMutator.h vendor/llvm/dist/include/llvm/IR/Function.h vendor/llvm/dist/include/llvm/IR/Intrinsics.td vendor/llvm/dist/include/llvm/LTO/legacy/ThinLTOCodeGenerator.h vendor/llvm/dist/include/llvm/MC/MCAsmInfo.h vendor/llvm/dist/include/llvm/MC/MCStreamer.h vendor/llvm/dist/include/llvm/Object/Wasm.h vendor/llvm/dist/include/llvm/Support/CachePruning.h vendor/llvm/dist/include/llvm/Support/MemoryBuffer.h vendor/llvm/dist/include/llvm/Support/YAMLTraits.h vendor/llvm/dist/include/llvm/Target/TargetMachine.h vendor/llvm/dist/include/llvm/Target/TargetSelectionDAG.td vendor/llvm/dist/include/llvm/Transforms/Instrumentation.h vendor/llvm/dist/include/llvm/Transforms/Utils/CallPromotionUtils.h vendor/llvm/dist/include/llvm/module.modulemap vendor/llvm/dist/lib/Analysis/AliasAnalysis.cpp vendor/llvm/dist/lib/Analysis/AliasAnalysisEvaluator.cpp vendor/llvm/dist/lib/Analysis/BasicAliasAnalysis.cpp vendor/llvm/dist/lib/Analysis/CFGPrinter.cpp vendor/llvm/dist/lib/Analysis/GlobalsModRef.cpp vendor/llvm/dist/lib/Analysis/InlineCost.cpp vendor/llvm/dist/lib/Analysis/LoopAccessAnalysis.cpp vendor/llvm/dist/lib/Analysis/MemoryDependenceAnalysis.cpp vendor/llvm/dist/lib/Analysis/MemorySSA.cpp vendor/llvm/dist/lib/Analysis/ModuleSummaryAnalysis.cpp vendor/llvm/dist/lib/Analysis/ProfileSummaryInfo.cpp vendor/llvm/dist/lib/Analysis/ScalarEvolution.cpp vendor/llvm/dist/lib/Analysis/TargetTransformInfo.cpp vendor/llvm/dist/lib/Analysis/TypeBasedAliasAnalysis.cpp vendor/llvm/dist/lib/Bitcode/Writer/BitcodeWriter.cpp vendor/llvm/dist/lib/CodeGen/AsmPrinter/AsmPrinter.cpp vendor/llvm/dist/lib/CodeGen/CMakeLists.txt vendor/llvm/dist/lib/CodeGen/CodeGenPrepare.cpp vendor/llvm/dist/lib/CodeGen/GlobalISel/LegalizerHelper.cpp vendor/llvm/dist/lib/CodeGen/InlineSpiller.cpp vendor/llvm/dist/lib/CodeGen/LLVMTargetMachine.cpp vendor/llvm/dist/lib/CodeGen/MIRPrinter.cpp vendor/llvm/dist/lib/CodeGen/MachineBlockPlacement.cpp vendor/llvm/dist/lib/CodeGen/MachineOperand.cpp vendor/llvm/dist/lib/CodeGen/MachineVerifier.cpp vendor/llvm/dist/lib/CodeGen/README.txt vendor/llvm/dist/lib/CodeGen/RegAllocBasic.cpp vendor/llvm/dist/lib/CodeGen/RegAllocGreedy.cpp vendor/llvm/dist/lib/CodeGen/RegAllocPBQP.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/DAGCombiner.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/ResourcePriorityQueue.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAG.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/TargetLowering.cpp vendor/llvm/dist/lib/CodeGen/StackSlotColoring.cpp vendor/llvm/dist/lib/CodeGen/TargetLoweringBase.cpp vendor/llvm/dist/lib/CodeGen/VirtRegMap.cpp vendor/llvm/dist/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp vendor/llvm/dist/lib/DebugInfo/DWARF/DWARFContext.cpp vendor/llvm/dist/lib/DebugInfo/DWARF/DWARFUnit.cpp vendor/llvm/dist/lib/Demangle/ItaniumDemangle.cpp vendor/llvm/dist/lib/FuzzMutate/IRMutator.cpp vendor/llvm/dist/lib/IR/ConstantFold.cpp vendor/llvm/dist/lib/IR/Function.cpp vendor/llvm/dist/lib/IR/Value.cpp vendor/llvm/dist/lib/MC/MCAsmStreamer.cpp vendor/llvm/dist/lib/MC/MCStreamer.cpp vendor/llvm/dist/lib/MC/WasmObjectWriter.cpp vendor/llvm/dist/lib/Object/ELF.cpp vendor/llvm/dist/lib/Object/WasmObjectFile.cpp vendor/llvm/dist/lib/Object/WindowsResource.cpp vendor/llvm/dist/lib/ObjectYAML/WasmYAML.cpp vendor/llvm/dist/lib/Passes/LLVMBuild.txt vendor/llvm/dist/lib/Support/APFloat.cpp vendor/llvm/dist/lib/Support/CachePruning.cpp vendor/llvm/dist/lib/Support/MemoryBuffer.cpp vendor/llvm/dist/lib/Support/StringRef.cpp vendor/llvm/dist/lib/Support/TargetParser.cpp vendor/llvm/dist/lib/Support/YAMLTraits.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64AsmPrinter.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64FastISel.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64FrameLowering.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64ISelLowering.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64InstrInfo.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64SelectionDAGInfo.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64Subtarget.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64Subtarget.h vendor/llvm/dist/lib/Target/AArch64/AArch64SystemOperands.td vendor/llvm/dist/lib/Target/AArch64/AArch64TargetMachine.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64TargetMachine.h vendor/llvm/dist/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUISelLowering.h vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUTargetMachine.h vendor/llvm/dist/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp vendor/llvm/dist/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp vendor/llvm/dist/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.h vendor/llvm/dist/lib/Target/AMDGPU/InstPrinter/AMDGPUInstPrinter.cpp vendor/llvm/dist/lib/Target/AMDGPU/SIRegisterInfo.td vendor/llvm/dist/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp vendor/llvm/dist/lib/Target/ARC/ARCTargetMachine.cpp vendor/llvm/dist/lib/Target/ARC/ARCTargetMachine.h vendor/llvm/dist/lib/Target/ARM/ARM.h vendor/llvm/dist/lib/Target/ARM/ARM.td vendor/llvm/dist/lib/Target/ARM/ARMFastISel.cpp vendor/llvm/dist/lib/Target/ARM/ARMISelLowering.cpp vendor/llvm/dist/lib/Target/ARM/ARMISelLowering.h vendor/llvm/dist/lib/Target/ARM/ARMInstrInfo.td vendor/llvm/dist/lib/Target/ARM/ARMInstrThumb2.td vendor/llvm/dist/lib/Target/ARM/ARMInstructionSelector.cpp vendor/llvm/dist/lib/Target/ARM/ARMLegalizerInfo.cpp vendor/llvm/dist/lib/Target/ARM/ARMRegisterBankInfo.cpp vendor/llvm/dist/lib/Target/ARM/ARMSubtarget.cpp vendor/llvm/dist/lib/Target/ARM/ARMSubtarget.h vendor/llvm/dist/lib/Target/ARM/ARMTargetMachine.cpp vendor/llvm/dist/lib/Target/ARM/ARMTargetMachine.h vendor/llvm/dist/lib/Target/ARM/ARMTargetTransformInfo.cpp vendor/llvm/dist/lib/Target/ARM/ARMTargetTransformInfo.h vendor/llvm/dist/lib/Target/ARM/AsmParser/ARMAsmParser.cpp vendor/llvm/dist/lib/Target/ARM/Disassembler/ARMDisassembler.cpp vendor/llvm/dist/lib/Target/ARM/Thumb2SizeReduction.cpp vendor/llvm/dist/lib/Target/BPF/InstPrinter/BPFInstPrinter.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonISelDAGToDAGHVX.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonISelLowering.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonISelLowering.h vendor/llvm/dist/lib/Target/Hexagon/HexagonISelLoweringHVX.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonPatterns.td vendor/llvm/dist/lib/Target/Hexagon/HexagonRegisterInfo.td vendor/llvm/dist/lib/Target/Hexagon/HexagonSubtarget.h vendor/llvm/dist/lib/Target/Hexagon/HexagonTargetMachine.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonTargetMachine.h vendor/llvm/dist/lib/Target/Lanai/LanaiTargetMachine.cpp vendor/llvm/dist/lib/Target/Lanai/LanaiTargetMachine.h vendor/llvm/dist/lib/Target/Mips/MCTargetDesc/MipsMCCodeEmitter.cpp vendor/llvm/dist/lib/Target/Mips/MipsRegisterInfo.td vendor/llvm/dist/lib/Target/Mips/MipsTargetMachine.cpp vendor/llvm/dist/lib/Target/Mips/MipsTargetMachine.h vendor/llvm/dist/lib/Target/NVPTX/NVPTXTargetMachine.cpp vendor/llvm/dist/lib/Target/NVPTX/NVPTXTargetMachine.h vendor/llvm/dist/lib/Target/PowerPC/PPCFrameLowering.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCISelLowering.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCMIPeephole.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCTargetMachine.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCTargetMachine.h vendor/llvm/dist/lib/Target/SystemZ/SystemZTargetMachine.cpp vendor/llvm/dist/lib/Target/SystemZ/SystemZTargetMachine.h vendor/llvm/dist/lib/Target/TargetMachine.cpp vendor/llvm/dist/lib/Target/WebAssembly/WebAssemblyRegStackify.cpp vendor/llvm/dist/lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp vendor/llvm/dist/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp vendor/llvm/dist/lib/Target/WebAssembly/WebAssemblyTargetMachine.h vendor/llvm/dist/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp vendor/llvm/dist/lib/Target/X86/X86.td vendor/llvm/dist/lib/Target/X86/X86DomainReassignment.cpp vendor/llvm/dist/lib/Target/X86/X86ISelDAGToDAG.cpp vendor/llvm/dist/lib/Target/X86/X86ISelLowering.cpp vendor/llvm/dist/lib/Target/X86/X86Instr3DNow.td vendor/llvm/dist/lib/Target/X86/X86InstrFormats.td vendor/llvm/dist/lib/Target/X86/X86InstrInfo.td vendor/llvm/dist/lib/Target/X86/X86InstrSSE.td vendor/llvm/dist/lib/Target/X86/X86SelectionDAGInfo.cpp vendor/llvm/dist/lib/Target/X86/X86Subtarget.cpp vendor/llvm/dist/lib/Target/X86/X86Subtarget.h vendor/llvm/dist/lib/Target/X86/X86TargetMachine.cpp vendor/llvm/dist/lib/Target/X86/X86TargetMachine.h vendor/llvm/dist/lib/Target/XCore/XCoreTargetMachine.cpp vendor/llvm/dist/lib/Target/XCore/XCoreTargetMachine.h vendor/llvm/dist/lib/Transforms/IPO/PartialInlining.cpp vendor/llvm/dist/lib/Transforms/IPO/SampleProfile.cpp vendor/llvm/dist/lib/Transforms/IPO/WholeProgramDevirt.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineCalls.cpp vendor/llvm/dist/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp vendor/llvm/dist/lib/Transforms/Scalar/CallSiteSplitting.cpp vendor/llvm/dist/lib/Transforms/Scalar/JumpThreading.cpp vendor/llvm/dist/lib/Transforms/Scalar/LoopSink.cpp vendor/llvm/dist/lib/Transforms/Scalar/LoopUnrollPass.cpp vendor/llvm/dist/lib/Transforms/Scalar/MemCpyOptimizer.cpp vendor/llvm/dist/lib/Transforms/Scalar/SCCP.cpp vendor/llvm/dist/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp vendor/llvm/dist/lib/Transforms/Utils/CallPromotionUtils.cpp vendor/llvm/dist/lib/Transforms/Utils/LoopUnrollPeel.cpp vendor/llvm/dist/lib/Transforms/Utils/SimplifyCFG.cpp vendor/llvm/dist/lib/Transforms/Vectorize/LoopVectorize.cpp vendor/llvm/dist/lib/Transforms/Vectorize/SLPVectorizer.cpp vendor/llvm/dist/test/Analysis/BasicAA/args-rets-allocas-loads.ll vendor/llvm/dist/test/Analysis/BasicAA/call-attrs.ll vendor/llvm/dist/test/Analysis/BasicAA/cs-cs-arm.ll vendor/llvm/dist/test/Analysis/BasicAA/cs-cs.ll vendor/llvm/dist/test/Analysis/MemorySSA/volatile-clobber.ll vendor/llvm/dist/test/Analysis/ValueTracking/memory-dereferenceable.ll vendor/llvm/dist/test/CodeGen/AArch64/GlobalISel/arm64-fallback.ll vendor/llvm/dist/test/CodeGen/AArch64/GlobalISel/translate-gep.ll vendor/llvm/dist/test/CodeGen/AArch64/arm64-jumptable.ll vendor/llvm/dist/test/CodeGen/AArch64/arm64-memset-to-bzero.ll vendor/llvm/dist/test/CodeGen/AArch64/arm64-neon-2velem.ll vendor/llvm/dist/test/CodeGen/AArch64/arm64-zero-cycle-zeroing.ll vendor/llvm/dist/test/CodeGen/AArch64/ldst-paired-aliasing.ll vendor/llvm/dist/test/CodeGen/AMDGPU/amdgpu.private-memory.ll vendor/llvm/dist/test/CodeGen/ARM/GlobalISel/arm-instruction-select.mir vendor/llvm/dist/test/CodeGen/ARM/GlobalISel/arm-legalizer.mir vendor/llvm/dist/test/CodeGen/ARM/GlobalISel/arm-regbankselect.mir vendor/llvm/dist/test/CodeGen/ARM/avoid-cpsr-rmw.ll vendor/llvm/dist/test/CodeGen/Hexagon/expand-vstorerw-undef.ll vendor/llvm/dist/test/CodeGen/Hexagon/v60-cur.ll vendor/llvm/dist/test/CodeGen/Hexagon/vect/vect-infloop.ll vendor/llvm/dist/test/CodeGen/Mips/llvm-ir/extractelement.ll vendor/llvm/dist/test/CodeGen/PowerPC/cmp_elimination.ll vendor/llvm/dist/test/CodeGen/PowerPC/variable_elem_vec_extracts.ll vendor/llvm/dist/test/CodeGen/X86/avg-mask.ll vendor/llvm/dist/test/CodeGen/X86/avg.ll vendor/llvm/dist/test/CodeGen/X86/avx512-calling-conv.ll vendor/llvm/dist/test/CodeGen/X86/avx512-ext.ll vendor/llvm/dist/test/CodeGen/X86/avx512-extract-subvector-load-store.ll vendor/llvm/dist/test/CodeGen/X86/avx512-insert-extract.ll vendor/llvm/dist/test/CodeGen/X86/avx512-insert-extract_i1.ll vendor/llvm/dist/test/CodeGen/X86/avx512-mask-op.ll vendor/llvm/dist/test/CodeGen/X86/avx512-schedule.ll vendor/llvm/dist/test/CodeGen/X86/avx512-shuffles/partial_permute.ll vendor/llvm/dist/test/CodeGen/X86/avx512-skx-insert-subvec.ll vendor/llvm/dist/test/CodeGen/X86/avx512-vec-cmp.ll vendor/llvm/dist/test/CodeGen/X86/avx512vl-vec-masked-cmp.ll vendor/llvm/dist/test/CodeGen/X86/bitcast-and-setcc-128.ll vendor/llvm/dist/test/CodeGen/X86/bitcast-setcc-128.ll vendor/llvm/dist/test/CodeGen/X86/combine-and.ll vendor/llvm/dist/test/CodeGen/X86/combine-or.ll vendor/llvm/dist/test/CodeGen/X86/darwin-bzero.ll vendor/llvm/dist/test/CodeGen/X86/extractelement-index.ll vendor/llvm/dist/test/CodeGen/X86/fma-fneg-combine.ll vendor/llvm/dist/test/CodeGen/X86/fmsubadd-combine.ll vendor/llvm/dist/test/CodeGen/X86/fold-vector-sext-crash.ll vendor/llvm/dist/test/CodeGen/X86/horizontal-reduce-smax.ll vendor/llvm/dist/test/CodeGen/X86/horizontal-reduce-smin.ll vendor/llvm/dist/test/CodeGen/X86/horizontal-reduce-umax.ll vendor/llvm/dist/test/CodeGen/X86/horizontal-reduce-umin.ll vendor/llvm/dist/test/CodeGen/X86/known-bits-vector.ll vendor/llvm/dist/test/CodeGen/X86/machinesink-merge-debuginfo.ll vendor/llvm/dist/test/CodeGen/X86/machinesink-null-debuginfo.ll vendor/llvm/dist/test/CodeGen/X86/masked_gather_scatter.ll vendor/llvm/dist/test/CodeGen/X86/popcnt.ll vendor/llvm/dist/test/CodeGen/X86/prefetch.ll vendor/llvm/dist/test/CodeGen/X86/shuffle-strided-with-offset-128.ll vendor/llvm/dist/test/CodeGen/X86/shuffle-strided-with-offset-256.ll vendor/llvm/dist/test/CodeGen/X86/shuffle-strided-with-offset-512.ll vendor/llvm/dist/test/CodeGen/X86/shuffle-vs-trunc-128.ll vendor/llvm/dist/test/CodeGen/X86/shuffle-vs-trunc-256.ll vendor/llvm/dist/test/CodeGen/X86/shuffle-vs-trunc-512.ll vendor/llvm/dist/test/CodeGen/X86/var-permute-256.ll vendor/llvm/dist/test/CodeGen/X86/var-permute-512.ll vendor/llvm/dist/test/CodeGen/X86/vector-compare-results.ll vendor/llvm/dist/test/CodeGen/X86/vector-half-conversions.ll vendor/llvm/dist/test/CodeGen/X86/vector-rotate-128.ll vendor/llvm/dist/test/CodeGen/X86/vector-shift-ashr-128.ll vendor/llvm/dist/test/CodeGen/X86/vector-shift-lshr-128.ll vendor/llvm/dist/test/CodeGen/X86/vector-shift-shl-128.ll vendor/llvm/dist/test/CodeGen/X86/vector-shuffle-128-v16.ll vendor/llvm/dist/test/CodeGen/X86/vector-shuffle-128-v8.ll vendor/llvm/dist/test/CodeGen/X86/vector-shuffle-256-v16.ll vendor/llvm/dist/test/CodeGen/X86/vector-shuffle-256-v32.ll vendor/llvm/dist/test/CodeGen/X86/vector-shuffle-256-v4.ll vendor/llvm/dist/test/CodeGen/X86/vector-shuffle-256-v8.ll vendor/llvm/dist/test/CodeGen/X86/vector-shuffle-512-v32.ll vendor/llvm/dist/test/CodeGen/X86/vector-shuffle-v1.ll vendor/llvm/dist/test/CodeGen/X86/vector-shuffle-variable-128.ll vendor/llvm/dist/test/CodeGen/X86/vector-trunc.ll vendor/llvm/dist/test/CodeGen/X86/vector-zext.ll vendor/llvm/dist/test/CodeGen/X86/vselect.ll vendor/llvm/dist/test/DebugInfo/X86/dwarfdump-str-offsets-dwp.s vendor/llvm/dist/test/DebugInfo/X86/dwarfdump-str-offsets-invalid-3.s vendor/llvm/dist/test/DebugInfo/X86/dwarfdump-str-offsets-invalid-4.s vendor/llvm/dist/test/DebugInfo/X86/dwarfdump-str-offsets-macho.s vendor/llvm/dist/test/DebugInfo/X86/dwarfdump-str-offsets.s vendor/llvm/dist/test/Instrumentation/HWAddressSanitizer/basic.ll vendor/llvm/dist/test/Instrumentation/HWAddressSanitizer/with-calls.ll vendor/llvm/dist/test/MC/AArch64/arm64-system-encoding.s vendor/llvm/dist/test/MC/AArch64/basic-a64-diagnostics.s vendor/llvm/dist/test/MC/AArch64/dot-req.s vendor/llvm/dist/test/MC/AMDGPU/ds.s vendor/llvm/dist/test/MC/AMDGPU/expressions.s vendor/llvm/dist/test/MC/AMDGPU/trap.s vendor/llvm/dist/test/MC/AMDGPU/vop1-gfx9-err.s vendor/llvm/dist/test/MC/AMDGPU/vop3p-err.s vendor/llvm/dist/test/MC/COFF/align-nops.s vendor/llvm/dist/test/MC/Disassembler/AArch64/basic-a64-instructions.txt vendor/llvm/dist/test/MC/Disassembler/AMDGPU/ds_vi.txt vendor/llvm/dist/test/MC/Disassembler/AMDGPU/trap_gfx9.txt vendor/llvm/dist/test/MC/Disassembler/AMDGPU/trap_vi.txt vendor/llvm/dist/test/MC/Disassembler/X86/x86-32.txt vendor/llvm/dist/test/MC/ELF/align-nops.s vendor/llvm/dist/test/MC/MachO/x86_32-optimal_nop.s vendor/llvm/dist/test/MC/Mips/eva/invalid.s vendor/llvm/dist/test/MC/WebAssembly/weak-alias.ll vendor/llvm/dist/test/MC/X86/3DNow.s vendor/llvm/dist/test/MC/X86/AlignedBundling/different-sections.s vendor/llvm/dist/test/MC/X86/AlignedBundling/long-nop-pad.s vendor/llvm/dist/test/MC/X86/AlignedBundling/misaligned-bundle-group.s vendor/llvm/dist/test/MC/X86/AlignedBundling/misaligned-bundle.s vendor/llvm/dist/test/MC/X86/AlignedBundling/pad-align-to-bundle-end.s vendor/llvm/dist/test/MC/X86/AlignedBundling/pad-bundle-groups.s vendor/llvm/dist/test/MC/X86/AlignedBundling/relax-in-bundle-group.s vendor/llvm/dist/test/MC/X86/AlignedBundling/single-inst-bundling.s vendor/llvm/dist/test/MC/X86/x86_long_nop.s vendor/llvm/dist/test/TableGen/GlobalISelEmitter.td vendor/llvm/dist/test/TableGen/intrinsic-long-name.td vendor/llvm/dist/test/TableGen/intrinsic-struct.td vendor/llvm/dist/test/TableGen/intrinsic-varargs.td vendor/llvm/dist/test/ThinLTO/X86/cache.ll vendor/llvm/dist/test/Transforms/CodeGenPrepare/section.ll vendor/llvm/dist/test/Transforms/GVN/tbaa.ll vendor/llvm/dist/test/Transforms/Inline/redundant-loads.ll vendor/llvm/dist/test/Transforms/InstCombine/2011-09-03-Trampoline.ll vendor/llvm/dist/test/Transforms/JumpThreading/guards.ll vendor/llvm/dist/test/Transforms/NewGVN/tbaa.ll vendor/llvm/dist/test/Transforms/PGOProfile/icp_covariant_call_return.ll vendor/llvm/dist/test/Transforms/PGOProfile/icp_covariant_invoke_return.ll vendor/llvm/dist/test/Transforms/PGOProfile/icp_invoke.ll vendor/llvm/dist/test/Transforms/PGOProfile/icp_invoke_nouse.ll vendor/llvm/dist/test/Transforms/PGOProfile/icp_vararg.ll vendor/llvm/dist/test/Transforms/PGOProfile/indirect_call_promotion.ll vendor/llvm/dist/test/Transforms/SLPVectorizer/X86/jumbled-load-multiuse.ll vendor/llvm/dist/test/Transforms/SLPVectorizer/X86/jumbled-load.ll vendor/llvm/dist/test/Transforms/SLPVectorizer/X86/store-jumbled.ll vendor/llvm/dist/test/Transforms/SampleProfile/entry_counts.ll vendor/llvm/dist/test/tools/llvm-cvtres/machine.test vendor/llvm/dist/test/tools/llvm-cvtres/symbols.test vendor/llvm/dist/test/tools/llvm-dwarfdump/X86/lookup.s vendor/llvm/dist/test/tools/llvm-readobj/mips-got.test vendor/llvm/dist/test/tools/llvm-readobj/mips-plt.test vendor/llvm/dist/tools/llvm-dwarfdump/llvm-dwarfdump.cpp vendor/llvm/dist/tools/llvm-lto/llvm-lto.cpp vendor/llvm/dist/tools/llvm-objcopy/Object.cpp vendor/llvm/dist/tools/llvm-objcopy/Object.h vendor/llvm/dist/tools/llvm-objcopy/llvm-objcopy.cpp vendor/llvm/dist/tools/llvm-readobj/ELFDumper.cpp vendor/llvm/dist/tools/llvm-readobj/WasmDumper.cpp vendor/llvm/dist/tools/opt-viewer/optrecord.py vendor/llvm/dist/unittests/ADT/APFloatTest.cpp vendor/llvm/dist/unittests/ADT/StringRefTest.cpp vendor/llvm/dist/unittests/CodeGen/MachineOperandTest.cpp vendor/llvm/dist/unittests/ExecutionEngine/Orc/CMakeLists.txt vendor/llvm/dist/unittests/Support/CachePruningTest.cpp vendor/llvm/dist/unittests/Support/MemoryBufferTest.cpp vendor/llvm/dist/unittests/Support/TargetParserTest.cpp vendor/llvm/dist/unittests/Support/YAMLIOTest.cpp vendor/llvm/dist/utils/TableGen/CMakeLists.txt vendor/llvm/dist/utils/TableGen/CodeGenDAGPatterns.cpp vendor/llvm/dist/utils/TableGen/CodeGenDAGPatterns.h vendor/llvm/dist/utils/TableGen/CodeGenIntrinsics.h vendor/llvm/dist/utils/TableGen/CodeGenTarget.cpp vendor/llvm/dist/utils/TableGen/CodeGenTarget.h vendor/llvm/dist/utils/TableGen/GlobalISelEmitter.cpp vendor/llvm/dist/utils/TableGen/IntrinsicEmitter.cpp vendor/llvm/dist/utils/docker/build_docker_image.sh vendor/llvm/dist/utils/docker/scripts/build_install_llvm.sh vendor/llvm/dist/utils/git-svn/git-llvm vendor/llvm/dist/utils/update_mir_test_checks.py Modified: vendor/llvm/dist/docs/Extensions.rst ============================================================================== --- vendor/llvm/dist/docs/Extensions.rst Sat Dec 23 22:58:19 2017 (r327121) +++ vendor/llvm/dist/docs/Extensions.rst Sun Dec 24 01:00:08 2017 (r327122) @@ -288,3 +288,31 @@ standard stack probe emission. The MSVC environment does not emit code for VLAs currently. +Windows on ARM64 +---------------- + +Stack Probe Emission +^^^^^^^^^^^^^^^^^^^^ + +The reference implementation (Microsoft Visual Studio 2017) emits stack probes +in the following fashion: + +.. code-block:: gas + + mov x15, #constant + bl __chkstk + sub sp, sp, x15, lsl #4 + +However, this has the limitation of 256 MiB (±128MiB). In order to accommodate +larger binaries, LLVM supports the use of ``-mcode-model=large`` to allow a 8GiB +(±4GiB) range via a slight deviation. It will generate an indirect jump as +follows: + +.. code-block:: gas + + mov x15, #constant + adrp x16, __chkstk + add x16, x16, :lo12:__chkstk + blr x16 + sub sp, sp, x15, lsl #4 + Modified: vendor/llvm/dist/docs/MIRLangRef.rst ============================================================================== --- vendor/llvm/dist/docs/MIRLangRef.rst Sat Dec 23 22:58:19 2017 (r327121) +++ vendor/llvm/dist/docs/MIRLangRef.rst Sun Dec 24 01:00:08 2017 (r327122) @@ -692,6 +692,50 @@ The syntax is: EH_LABEL +CFIIndex Operands +^^^^^^^^^^^^^^^^^ + +A CFI Index operand is holding an index into a per-function side-table, +``MachineFunction::getFrameInstructions()``, which references all the frame +instructions in a ``MachineFunction``. A ``CFI_INSTRUCTION`` may look like it +contains multiple operands, but the only operand it contains is the CFI Index. +The other operands are tracked by the ``MCCFIInstruction`` object. + +The syntax is: + +.. code-block:: text + + CFI_INSTRUCTION offset %w30, -16 + +which may be emitted later in the MC layer as: + +.. code-block:: text + + .cfi_offset w30, -16 + +IntrinsicID Operands +^^^^^^^^^^^^^^^^^^^^ + +An Intrinsic ID operand contains a generic intrinsic ID or a target-specific ID. + +The syntax for the ``returnaddress`` intrinsic is: + +.. code-block:: text + + %x0 = COPY intrinsic(@llvm.returnaddress) + +Predicate Operands +^^^^^^^^^^^^^^^^^^ + +A Predicate operand contains an IR predicate from ``CmpInst::Predicate``, like +``ICMP_EQ``, etc. + +For an int eq predicate ``ICMP_EQ``, the syntax is: + +.. code-block:: text + + %2:gpr(s32) = G_ICMP intpred(eq), %0, %1 + .. TODO: Describe the parsers default behaviour when optional YAML attributes are missing. .. TODO: Describe the syntax for the bundled instructions. @@ -702,7 +746,6 @@ The syntax is: .. TODO: Describe the syntax of the stack object machine operands and their YAML definitions. .. TODO: Describe the syntax of the block address machine operands. -.. TODO: Describe the syntax of the CFI index machine operands. .. TODO: Describe the syntax of the metadata machine operands, and the instructions debug location attribute. .. TODO: Describe the syntax of the register live out machine operands. Modified: vendor/llvm/dist/docs/tutorial/LangImpl09.rst ============================================================================== --- vendor/llvm/dist/docs/tutorial/LangImpl09.rst Sat Dec 23 22:58:19 2017 (r327121) +++ vendor/llvm/dist/docs/tutorial/LangImpl09.rst Sun Dec 24 01:00:08 2017 (r327122) @@ -197,7 +197,7 @@ expressions: if (DblTy) return DblTy; - DblTy = DBuilder->createBasicType("double", 64, 64, dwarf::DW_ATE_float); + DblTy = DBuilder->createBasicType("double", 64, dwarf::DW_ATE_float); return DblTy; } @@ -208,7 +208,8 @@ And then later on in ``main`` when we're constructing DBuilder = new DIBuilder(*TheModule); KSDbgInfo.TheCU = DBuilder->createCompileUnit( - dwarf::DW_LANG_C, "fib.ks", ".", "Kaleidoscope Compiler", 0, "", 0); + dwarf::DW_LANG_C, DBuilder->createFile("fib.ks", "."), + "Kaleidoscope Compiler", 0, "", 0); There are a couple of things to note here. First, while we're producing a compile unit for a language called Kaleidoscope we used the language Modified: vendor/llvm/dist/examples/Kaleidoscope/CMakeLists.txt ============================================================================== --- vendor/llvm/dist/examples/Kaleidoscope/CMakeLists.txt Sat Dec 23 22:58:19 2017 (r327121) +++ vendor/llvm/dist/examples/Kaleidoscope/CMakeLists.txt Sun Dec 24 01:00:08 2017 (r327122) @@ -14,3 +14,4 @@ add_subdirectory(Chapter5) add_subdirectory(Chapter6) add_subdirectory(Chapter7) add_subdirectory(Chapter8) +add_subdirectory(Chapter9) Modified: vendor/llvm/dist/examples/Kaleidoscope/Chapter9/toy.cpp ============================================================================== --- vendor/llvm/dist/examples/Kaleidoscope/Chapter9/toy.cpp Sat Dec 23 22:58:19 2017 (r327121) +++ vendor/llvm/dist/examples/Kaleidoscope/Chapter9/toy.cpp Sun Dec 24 01:00:08 2017 (r327122) @@ -823,7 +823,7 @@ DIType *DebugInfo::getDoubleTy() { if (DblTy) return DblTy; - DblTy = DBuilder->createBasicType("double", 64, 64, dwarf::DW_ATE_float); + DblTy = DBuilder->createBasicType("double", 64, dwarf::DW_ATE_float); return DblTy; } @@ -1436,7 +1436,8 @@ int main() { // Currently down as "fib.ks" as a filename since we're redirecting stdin // but we'd like actual source locations. KSDbgInfo.TheCU = DBuilder->createCompileUnit( - dwarf::DW_LANG_C, "fib.ks", ".", "Kaleidoscope Compiler", 0, "", 0); + dwarf::DW_LANG_C, DBuilder->createFile("fib.ks", "."), + "Kaleidoscope Compiler", 0, "", 0); // Run the main "interpreter loop" now. MainLoop(); Modified: vendor/llvm/dist/include/llvm-c/lto.h ============================================================================== --- vendor/llvm/dist/include/llvm-c/lto.h Sat Dec 23 22:58:19 2017 (r327121) +++ vendor/llvm/dist/include/llvm-c/lto.h Sun Dec 24 01:00:08 2017 (r327122) @@ -757,17 +757,17 @@ extern void thinlto_codegen_add_cross_referenced_symbo * @ingroup LLVMCTLTO * * These entry points control the ThinLTO cache. The cache is intended to - * support incremental build, and thus needs to be persistent accross build. - * The client enabled the cache by supplying a path to an existing directory. + * support incremental builds, and thus needs to be persistent across builds. + * The client enables the cache by supplying a path to an existing directory. * The code generator will use this to store objects files that may be reused * during a subsequent build. * To avoid filling the disk space, a few knobs are provided: - * - The pruning interval limit the frequency at which the garbage collector - * will try to scan the cache directory to prune it from expired entries. - * Setting to -1 disable the pruning (default). + * - The pruning interval limits the frequency at which the garbage collector + * will try to scan the cache directory to prune expired entries. + * Setting to a negative number disables the pruning. * - The pruning expiration time indicates to the garbage collector how old an * entry needs to be to be removed. - * - Finally, the garbage collector can be instructed to prune the cache till + * - Finally, the garbage collector can be instructed to prune the cache until * the occupied space goes below a threshold. * @{ */ @@ -782,7 +782,7 @@ extern void thinlto_codegen_set_cache_dir(thinlto_code const char *cache_dir); /** - * Sets the cache pruning interval (in seconds). A negative value disable the + * Sets the cache pruning interval (in seconds). A negative value disables the * pruning. An unspecified default value will be applied, and a value of 0 will * be ignored. * Modified: vendor/llvm/dist/include/llvm/Analysis/AliasAnalysis.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/AliasAnalysis.h Sat Dec 23 22:58:19 2017 (r327121) +++ vendor/llvm/dist/include/llvm/Analysis/AliasAnalysis.h Sun Dec 24 01:00:08 2017 (r327122) @@ -95,46 +95,81 @@ enum AliasResult { /// /// This is no access at all, a modification, a reference, or both /// a modification and a reference. These are specifically structured such that -/// they form a two bit matrix and bit-tests for 'mod' or 'ref' +/// they form a three bit matrix and bit-tests for 'mod' or 'ref' or 'must' /// work with any of the possible values. - enum class ModRefInfo { + /// Must is provided for completeness, but no routines will return only + /// Must today. See definition of Must below. + Must = 0, + /// The access may reference the value stored in memory, + /// a mustAlias relation was found, and no mayAlias or partialAlias found. + MustRef = 1, + /// The access may modify the value stored in memory, + /// a mustAlias relation was found, and no mayAlias or partialAlias found. + MustMod = 2, + /// The access may reference, modify or both the value stored in memory, + /// a mustAlias relation was found, and no mayAlias or partialAlias found. + MustModRef = MustRef | MustMod, /// The access neither references nor modifies the value stored in memory. - NoModRef = 0, + NoModRef = 4, /// The access may reference the value stored in memory. - Ref = 1, + Ref = NoModRef | MustRef, /// The access may modify the value stored in memory. - Mod = 2, + Mod = NoModRef | MustMod, /// The access may reference and may modify the value stored in memory. ModRef = Ref | Mod, + + /// About Must: + /// Must is set in a best effort manner. + /// We usually do not try our best to infer Must, instead it is merely + /// another piece of "free" information that is presented when available. + /// Must set means there was certainly a MustAlias found. For calls, + /// where multiple arguments are checked (argmemonly), this translates to + /// only MustAlias or NoAlias was found. + /// Must is not set for RAR accesses, even if the two locations must + /// alias. The reason is that two read accesses translate to an early return + /// of NoModRef. An additional alias check to set Must may be + /// expensive. Other cases may also not set Must(e.g. callCapturesBefore). + /// We refer to Must being *set* when the most significant bit is *cleared*. + /// Conversely we *clear* Must information by *setting* the Must bit to 1. }; LLVM_NODISCARD inline bool isNoModRef(const ModRefInfo MRI) { - return MRI == ModRefInfo::NoModRef; + return (static_cast(MRI) & static_cast(ModRefInfo::MustModRef)) == + static_cast(ModRefInfo::Must); } LLVM_NODISCARD inline bool isModOrRefSet(const ModRefInfo MRI) { - return static_cast(MRI) & static_cast(ModRefInfo::ModRef); + return static_cast(MRI) & static_cast(ModRefInfo::MustModRef); } LLVM_NODISCARD inline bool isModAndRefSet(const ModRefInfo MRI) { - return (static_cast(MRI) & static_cast(ModRefInfo::ModRef)) == - static_cast(ModRefInfo::ModRef); + return (static_cast(MRI) & static_cast(ModRefInfo::MustModRef)) == + static_cast(ModRefInfo::MustModRef); } LLVM_NODISCARD inline bool isModSet(const ModRefInfo MRI) { - return static_cast(MRI) & static_cast(ModRefInfo::Mod); + return static_cast(MRI) & static_cast(ModRefInfo::MustMod); } LLVM_NODISCARD inline bool isRefSet(const ModRefInfo MRI) { - return static_cast(MRI) & static_cast(ModRefInfo::Ref); + return static_cast(MRI) & static_cast(ModRefInfo::MustRef); } +LLVM_NODISCARD inline bool isMustSet(const ModRefInfo MRI) { + return !(static_cast(MRI) & static_cast(ModRefInfo::NoModRef)); +} LLVM_NODISCARD inline ModRefInfo setMod(const ModRefInfo MRI) { - return ModRefInfo(static_cast(MRI) | static_cast(ModRefInfo::Mod)); + return ModRefInfo(static_cast(MRI) | + static_cast(ModRefInfo::MustMod)); } LLVM_NODISCARD inline ModRefInfo setRef(const ModRefInfo MRI) { - return ModRefInfo(static_cast(MRI) | static_cast(ModRefInfo::Ref)); + return ModRefInfo(static_cast(MRI) | + static_cast(ModRefInfo::MustRef)); } +LLVM_NODISCARD inline ModRefInfo setMust(const ModRefInfo MRI) { + return ModRefInfo(static_cast(MRI) & + static_cast(ModRefInfo::MustModRef)); +} LLVM_NODISCARD inline ModRefInfo setModAndRef(const ModRefInfo MRI) { return ModRefInfo(static_cast(MRI) | - static_cast(ModRefInfo::ModRef)); + static_cast(ModRefInfo::MustModRef)); } LLVM_NODISCARD inline ModRefInfo clearMod(const ModRefInfo MRI) { return ModRefInfo(static_cast(MRI) & static_cast(ModRefInfo::Ref)); @@ -142,6 +177,10 @@ LLVM_NODISCARD inline ModRefInfo clearMod(const ModRef LLVM_NODISCARD inline ModRefInfo clearRef(const ModRefInfo MRI) { return ModRefInfo(static_cast(MRI) & static_cast(ModRefInfo::Mod)); } +LLVM_NODISCARD inline ModRefInfo clearMust(const ModRefInfo MRI) { + return ModRefInfo(static_cast(MRI) | + static_cast(ModRefInfo::NoModRef)); +} LLVM_NODISCARD inline ModRefInfo unionModRef(const ModRefInfo MRI1, const ModRefInfo MRI2) { return ModRefInfo(static_cast(MRI1) | static_cast(MRI2)); @@ -160,11 +199,11 @@ enum FunctionModRefLocation { /// Base case is no access to memory. FMRL_Nowhere = 0, /// Access to memory via argument pointers. - FMRL_ArgumentPointees = 4, + FMRL_ArgumentPointees = 8, /// Memory that is inaccessible via LLVM IR. - FMRL_InaccessibleMem = 8, + FMRL_InaccessibleMem = 16, /// Access to any memory. - FMRL_Anywhere = 16 | FMRL_InaccessibleMem | FMRL_ArgumentPointees + FMRL_Anywhere = 32 | FMRL_InaccessibleMem | FMRL_ArgumentPointees }; /// Summary of how a function affects memory in the program. @@ -344,7 +383,7 @@ class AAResults { (public) /// result's bits are set to indicate the allowed aliasing ModRef kinds. Note /// that these bits do not necessarily account for the overall behavior of /// the function, but rather only provide additional per-argument - /// information. + /// information. This never sets ModRefInfo::Must. ModRefInfo getArgModRefInfo(ImmutableCallSite CS, unsigned ArgIdx); /// Return the behavior of the given call site. @@ -624,6 +663,8 @@ class AAResults { (public) /// or reads the specified memory location \p MemLoc before instruction \p I /// in a BasicBlock. An ordered basic block \p OBB can be used to speed up /// instruction ordering queries inside the BasicBlock containing \p I. + /// Early exits in callCapturesBefore may lead to ModRefInfo::Must not being + /// set. ModRefInfo callCapturesBefore(const Instruction *I, const MemoryLocation &MemLoc, DominatorTree *DT, OrderedBasicBlock *OBB = nullptr); Modified: vendor/llvm/dist/include/llvm/Analysis/AliasAnalysisEvaluator.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/AliasAnalysisEvaluator.h Sat Dec 23 22:58:19 2017 (r327121) +++ vendor/llvm/dist/include/llvm/Analysis/AliasAnalysisEvaluator.h Sun Dec 24 01:00:08 2017 (r327122) @@ -35,19 +35,23 @@ class AAEvaluator : public PassInfoMixin int64_t FunctionCount; int64_t NoAliasCount, MayAliasCount, PartialAliasCount, MustAliasCount; int64_t NoModRefCount, ModCount, RefCount, ModRefCount; + int64_t MustCount, MustRefCount, MustModCount, MustModRefCount; public: AAEvaluator() : FunctionCount(), NoAliasCount(), MayAliasCount(), PartialAliasCount(), MustAliasCount(), NoModRefCount(), ModCount(), RefCount(), - ModRefCount() {} + ModRefCount(), MustCount(), MustRefCount(), MustModCount(), + MustModRefCount() {} AAEvaluator(AAEvaluator &&Arg) : FunctionCount(Arg.FunctionCount), NoAliasCount(Arg.NoAliasCount), MayAliasCount(Arg.MayAliasCount), PartialAliasCount(Arg.PartialAliasCount), MustAliasCount(Arg.MustAliasCount), NoModRefCount(Arg.NoModRefCount), ModCount(Arg.ModCount), RefCount(Arg.RefCount), - ModRefCount(Arg.ModRefCount) { + ModRefCount(Arg.ModRefCount), MustCount(Arg.MustCount), + MustRefCount(Arg.MustRefCount), MustModCount(Arg.MustModCount), + MustModRefCount(Arg.MustModRefCount) { Arg.FunctionCount = 0; } ~AAEvaluator(); Modified: vendor/llvm/dist/include/llvm/Analysis/LoopAccessAnalysis.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/LoopAccessAnalysis.h Sat Dec 23 22:58:19 2017 (r327121) +++ vendor/llvm/dist/include/llvm/Analysis/LoopAccessAnalysis.h Sun Dec 24 01:00:08 2017 (r327122) @@ -667,21 +667,6 @@ int64_t getPtrStride(PredicatedScalarEvolution &PSE, V const ValueToValueMap &StridesMap = ValueToValueMap(), bool Assume = false, bool ShouldCheckWrap = true); -/// \brief Attempt to sort the 'loads' in \p VL and return the sorted values in -/// \p Sorted. -/// -/// Returns 'false' if sorting is not legal or feasible, otherwise returns -/// 'true'. If \p Mask is not null, it also returns the \p Mask which is the -/// shuffle mask for actual memory access order. -/// -/// For example, for a given VL of memory accesses in program order, a[i+2], -/// a[i+0], a[i+1] and a[i+3], this function will sort the VL and save the -/// sorted value in 'Sorted' as a[i+0], a[i+1], a[i+2], a[i+3] and saves the -/// mask for actual memory accesses in program order in 'Mask' as <2,0,1,3> -bool sortLoadAccesses(ArrayRef VL, const DataLayout &DL, - ScalarEvolution &SE, SmallVectorImpl &Sorted, - SmallVectorImpl *Mask = nullptr); - /// \brief Returns true if the memory operations \p A and \p B are consecutive. /// This is a simple API that does not depend on the analysis pass. bool isConsecutiveAccess(Value *A, Value *B, const DataLayout &DL, Modified: vendor/llvm/dist/include/llvm/Analysis/MemoryDependenceAnalysis.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/MemoryDependenceAnalysis.h Sat Dec 23 22:58:19 2017 (r327121) +++ vendor/llvm/dist/include/llvm/Analysis/MemoryDependenceAnalysis.h Sun Dec 24 01:00:08 2017 (r327122) @@ -407,6 +407,12 @@ class MemoryDependenceResults { (public) void getNonLocalPointerDependency(Instruction *QueryInst, SmallVectorImpl &Result); + /// Perform a dependency query specifically for QueryInst's access to Loc. + /// The other comments for getNonLocalPointerDependency apply here as well. + void getNonLocalPointerDependencyFrom(Instruction *QueryInst, + const MemoryLocation &Loc, bool isLoad, + SmallVectorImpl &Result); + /// Removes an instruction from the dependence analysis, updating the /// dependence of instructions that previously depended on it. void removeInstruction(Instruction *InstToRemove); Modified: vendor/llvm/dist/include/llvm/Analysis/ProfileSummaryInfo.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/ProfileSummaryInfo.h Sat Dec 23 22:58:19 2017 (r327121) +++ vendor/llvm/dist/include/llvm/Analysis/ProfileSummaryInfo.h Sun Dec 24 01:00:08 2017 (r327122) @@ -92,12 +92,12 @@ class ProfileSummaryInfo { (public) bool hasHugeWorkingSetSize(); /// \brief Returns true if \p F has hot function entry. bool isFunctionEntryHot(const Function *F); - /// Returns true if \p F has hot function entry or hot call edge. - bool isFunctionHotInCallGraph(const Function *F); + /// Returns true if \p F contains hot code. + bool isFunctionHotInCallGraph(const Function *F, BlockFrequencyInfo &BFI); /// \brief Returns true if \p F has cold function entry. bool isFunctionEntryCold(const Function *F); - /// Returns true if \p F has cold function entry or cold call edge. - bool isFunctionColdInCallGraph(const Function *F); + /// Returns true if \p F contains only cold code. + bool isFunctionColdInCallGraph(const Function *F, BlockFrequencyInfo &BFI); /// \brief Returns true if \p F is a hot function. bool isHotCount(uint64_t C); /// \brief Returns true if count \p C is considered cold. Modified: vendor/llvm/dist/include/llvm/Analysis/ScalarEvolutionExpander.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/ScalarEvolutionExpander.h Sat Dec 23 22:58:19 2017 (r327121) +++ vendor/llvm/dist/include/llvm/Analysis/ScalarEvolutionExpander.h Sun Dec 24 01:00:08 2017 (r327122) @@ -47,7 +47,7 @@ namespace llvm { ScalarEvolution &SE; const DataLayout &DL; - // New instructions receive a name to identifies them with the current pass. + // New instructions receive a name to identify them with the current pass. const char* IVName; // InsertedExpressions caches Values for reuse, so must track RAUW. Modified: vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfo.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfo.h Sat Dec 23 22:58:19 2017 (r327121) +++ vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfo.h Sun Dec 24 01:00:08 2017 (r327122) @@ -646,6 +646,9 @@ class TargetTransformInfo { (public) /// \brief Additional properties of an operand's values. enum OperandValueProperties { OP_None = 0, OP_PowerOf2 = 1 }; + /// \return True if target can execute instructions out of order. + bool isOutOfOrder() const; + /// \return The number of scalar or vector registers that the target has. /// If 'Vectors' is true, it returns the number of vector registers. If it is /// set to false, it returns the number of scalar registers. @@ -1018,6 +1021,7 @@ class TargetTransformInfo::Concept { (public) Type *Ty) = 0; virtual int getIntImmCost(Intrinsic::ID IID, unsigned Idx, const APInt &Imm, Type *Ty) = 0; + virtual bool isOutOfOrder() const = 0; virtual unsigned getNumberOfRegisters(bool Vector) = 0; virtual unsigned getRegisterBitWidth(bool Vector) const = 0; virtual unsigned getMinVectorRegisterBitWidth() = 0; @@ -1294,6 +1298,9 @@ class TargetTransformInfo::Model final : public Target int getIntImmCost(Intrinsic::ID IID, unsigned Idx, const APInt &Imm, Type *Ty) override { return Impl.getIntImmCost(IID, Idx, Imm, Ty); + } + bool isOutOfOrder() const override { + return Impl.isOutOfOrder(); } unsigned getNumberOfRegisters(bool Vector) override { return Impl.getNumberOfRegisters(Vector); Modified: vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfoImpl.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfoImpl.h Sat Dec 23 22:58:19 2017 (r327121) +++ vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfoImpl.h Sun Dec 24 01:00:08 2017 (r327122) @@ -337,6 +337,8 @@ class TargetTransformInfoImplBase { (public) return TTI::TCC_Free; } + bool isOutOfOrder() const { return false; } + unsigned getNumberOfRegisters(bool Vector) { return 8; } unsigned getRegisterBitWidth(bool Vector) const { return 32; } Modified: vendor/llvm/dist/include/llvm/BinaryFormat/Wasm.h ============================================================================== --- vendor/llvm/dist/include/llvm/BinaryFormat/Wasm.h Sat Dec 23 22:58:19 2017 (r327121) +++ vendor/llvm/dist/include/llvm/BinaryFormat/Wasm.h Sun Dec 24 01:00:08 2017 (r327122) @@ -208,7 +208,7 @@ const unsigned WASM_SYMBOL_VISIBILITY_HIDDEN = 0x4; #define WASM_RELOC(name, value) name = value, enum : unsigned { -#include "WasmRelocs/WebAssembly.def" +#include "WasmRelocs.def" }; #undef WASM_RELOC Added: vendor/llvm/dist/include/llvm/BinaryFormat/WasmRelocs.def ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/llvm/dist/include/llvm/BinaryFormat/WasmRelocs.def Sun Dec 24 01:00:08 2017 (r327122) @@ -0,0 +1,13 @@ + +#ifndef WASM_RELOC +#error "WASM_RELOC must be defined" +#endif + +WASM_RELOC(R_WEBASSEMBLY_FUNCTION_INDEX_LEB, 0) +WASM_RELOC(R_WEBASSEMBLY_TABLE_INDEX_SLEB, 1) +WASM_RELOC(R_WEBASSEMBLY_TABLE_INDEX_I32, 2) +WASM_RELOC(R_WEBASSEMBLY_MEMORY_ADDR_LEB, 3) +WASM_RELOC(R_WEBASSEMBLY_MEMORY_ADDR_SLEB, 4) +WASM_RELOC(R_WEBASSEMBLY_MEMORY_ADDR_I32, 5) +WASM_RELOC(R_WEBASSEMBLY_TYPE_INDEX_LEB, 6) +WASM_RELOC(R_WEBASSEMBLY_GLOBAL_INDEX_LEB, 7) Modified: vendor/llvm/dist/include/llvm/CodeGen/BasicTTIImpl.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/BasicTTIImpl.h Sat Dec 23 22:58:19 2017 (r327121) +++ vendor/llvm/dist/include/llvm/CodeGen/BasicTTIImpl.h Sun Dec 24 01:00:08 2017 (r327122) @@ -302,9 +302,13 @@ class BasicTTIImplBase : public TargetTransformInfoImp } unsigned getFPOpCost(Type *Ty) { - // By default, FP instructions are no more expensive since they are - // implemented in HW. Target specific TTI can override this. - return TargetTransformInfo::TCC_Basic; + // Check whether FADD is available, as a proxy for floating-point in + // general. + const TargetLoweringBase *TLI = getTLI(); + EVT VT = TLI->getValueType(DL, Ty); + if (TLI->isOperationLegalOrCustomOrPromote(ISD::FADD, VT)) + return TargetTransformInfo::TCC_Basic; + return TargetTransformInfo::TCC_Expensive; } unsigned getOperationCost(unsigned Opcode, Type *Ty, Type *OpTy) { @@ -396,6 +400,10 @@ class BasicTTIImplBase : public TargetTransformInfoImp return getST()->getSchedModel().DefaultLoadLatency; return BaseT::getInstructionLatency(I); + } + + bool isOutOfOrder() const { + return getST()->getSchedModel().isOutOfOrder(); } /// @} Modified: vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/InstructionSelector.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/InstructionSelector.h Sat Dec 23 22:58:19 2017 (r327121) +++ vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/InstructionSelector.h Sun Dec 24 01:00:08 2017 (r327122) @@ -282,10 +282,6 @@ enum { /// Provides the logic to select generic machine instructions. class InstructionSelector { public: - using I64ImmediatePredicateFn = bool (*)(int64_t); - using APIntImmediatePredicateFn = bool (*)(const APInt &); - using APFloatImmediatePredicateFn = bool (*)(const APFloat &); - virtual ~InstructionSelector() = default; /// Select the (possibly generic) instruction \p I to only use target-specific @@ -319,9 +315,6 @@ class InstructionSelector { (public) struct MatcherInfoTy { const LLT *TypeObjects; const PredicateBitset *FeatureBitsets; - const I64ImmediatePredicateFn *I64ImmPredicateFns; - const APIntImmediatePredicateFn *APIntImmPredicateFns; - const APFloatImmediatePredicateFn *APFloatImmPredicateFns; const ComplexMatcherMemFn *ComplexPredicates; }; @@ -339,6 +332,16 @@ class InstructionSelector { (public) MachineRegisterInfo &MRI, const TargetRegisterInfo &TRI, const RegisterBankInfo &RBI, const PredicateBitset &AvailableFeatures, CodeGenCoverage &CoverageInfo) const; + + virtual bool testImmPredicate_I64(unsigned, int64_t) const { + llvm_unreachable("Subclasses must override this to use tablegen"); + } + virtual bool testImmPredicate_APInt(unsigned, const APInt &) const { + llvm_unreachable("Subclasses must override this to use tablegen"); + } + virtual bool testImmPredicate_APFloat(unsigned, const APFloat &) const { + llvm_unreachable("Subclasses must override this to use tablegen"); + } /// Constrain a register operand of an instruction \p I to a specified /// register class. This could involve inserting COPYs before (for uses) or Modified: vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/InstructionSelectorImpl.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/InstructionSelectorImpl.h Sat Dec 23 22:58:19 2017 (r327121) +++ vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/InstructionSelectorImpl.h Sun Dec 24 01:00:08 2017 (r327122) @@ -181,7 +181,7 @@ bool InstructionSelector::executeMatchTable( else llvm_unreachable("Expected Imm or CImm operand"); - if (!MatcherInfo.I64ImmPredicateFns[Predicate](Value)) + if (!testImmPredicate_I64(Predicate, Value)) if (handleReject() == RejectAndGiveUp) return false; break; @@ -202,7 +202,7 @@ bool InstructionSelector::executeMatchTable( else llvm_unreachable("Expected Imm or CImm operand"); - if (!MatcherInfo.APIntImmPredicateFns[Predicate](Value)) + if (!testImmPredicate_APInt(Predicate, Value)) if (handleReject() == RejectAndGiveUp) return false; break; @@ -221,7 +221,7 @@ bool InstructionSelector::executeMatchTable( assert(Predicate > GIPFP_APFloat_Invalid && "Expected a valid predicate"); APFloat Value = State.MIs[InsnID]->getOperand(1).getFPImm()->getValueAPF(); - if (!MatcherInfo.APFloatImmPredicateFns[Predicate](Value)) + if (!testImmPredicate_APFloat(Predicate, Value)) if (handleReject() == RejectAndGiveUp) return false; break; Added: vendor/llvm/dist/include/llvm/CodeGen/LiveStacks.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/llvm/dist/include/llvm/CodeGen/LiveStacks.h Sun Dec 24 01:00:08 2017 (r327122) @@ -0,0 +1,103 @@ +//===- LiveStacks.h - Live Stack Slot Analysis ------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file implements the live stack slot analysis pass. It is analogous to +// live interval analysis except it's analyzing liveness of stack slots rather +// than registers. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CODEGEN_LIVESTACKS_H +#define LLVM_CODEGEN_LIVESTACKS_H + +#include "llvm/CodeGen/LiveInterval.h" +#include "llvm/CodeGen/MachineFunctionPass.h" +#include "llvm/Pass.h" +#include +#include +#include + +namespace llvm { + +class TargetRegisterClass; +class TargetRegisterInfo; + +class LiveStacks : public MachineFunctionPass { + const TargetRegisterInfo *TRI; + + /// Special pool allocator for VNInfo's (LiveInterval val#). + /// + VNInfo::Allocator VNInfoAllocator; + + /// S2IMap - Stack slot indices to live interval mapping. + using SS2IntervalMap = std::unordered_map; + SS2IntervalMap S2IMap; + + /// S2RCMap - Stack slot indices to register class mapping. + std::map S2RCMap; + +public: + static char ID; // Pass identification, replacement for typeid + + LiveStacks() : MachineFunctionPass(ID) { + initializeLiveStacksPass(*PassRegistry::getPassRegistry()); + } + + using iterator = SS2IntervalMap::iterator; + using const_iterator = SS2IntervalMap::const_iterator; + + const_iterator begin() const { return S2IMap.begin(); } + const_iterator end() const { return S2IMap.end(); } + iterator begin() { return S2IMap.begin(); } + iterator end() { return S2IMap.end(); } + + unsigned getNumIntervals() const { return (unsigned)S2IMap.size(); } + + LiveInterval &getOrCreateInterval(int Slot, const TargetRegisterClass *RC); + + LiveInterval &getInterval(int Slot) { + assert(Slot >= 0 && "Spill slot indice must be >= 0"); + SS2IntervalMap::iterator I = S2IMap.find(Slot); + assert(I != S2IMap.end() && "Interval does not exist for stack slot"); + return I->second; + } + + const LiveInterval &getInterval(int Slot) const { + assert(Slot >= 0 && "Spill slot indice must be >= 0"); + SS2IntervalMap::const_iterator I = S2IMap.find(Slot); + assert(I != S2IMap.end() && "Interval does not exist for stack slot"); + return I->second; + } + + bool hasInterval(int Slot) const { return S2IMap.count(Slot); } + + const TargetRegisterClass *getIntervalRegClass(int Slot) const { + assert(Slot >= 0 && "Spill slot indice must be >= 0"); + std::map::const_iterator I = + S2RCMap.find(Slot); + assert(I != S2RCMap.end() && + "Register class info does not exist for stack slot"); + return I->second; + } + + VNInfo::Allocator &getVNInfoAllocator() { return VNInfoAllocator; } + + void getAnalysisUsage(AnalysisUsage &AU) const override; + void releaseMemory() override; + + /// runOnMachineFunction - pass entry point + bool runOnMachineFunction(MachineFunction &) override; + + /// print - Implement the dump method. + void print(raw_ostream &O, const Module * = nullptr) const override; +}; + +} // end namespace llvm + +#endif Modified: vendor/llvm/dist/include/llvm/CodeGen/MachineOperand.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/MachineOperand.h Sat Dec 23 22:58:19 2017 (r327121) +++ vendor/llvm/dist/include/llvm/CodeGen/MachineOperand.h Sun Dec 24 01:00:08 2017 (r327122) @@ -29,6 +29,7 @@ class GlobalValue; class MachineBasicBlock; class MachineInstr; class MachineRegisterInfo; +class MCCFIInstruction; class MDNode; class ModuleSlotTracker; class TargetMachine; @@ -249,6 +250,12 @@ class MachineOperand { (public) /// Print a stack object reference. static void printStackObjectReference(raw_ostream &OS, unsigned FrameIndex, bool IsFixed, StringRef Name); + + /// Print the offset with explicit +/- signs. + static void printOperandOffset(raw_ostream &OS, int64_t Offset); + + /// Print an IRSlotNumber. + static void printIRSlotNumber(raw_ostream &OS, int Slot); /// Print the MachineOperand to \p os. /// Providing a valid \p TRI and \p IntrinsicInfo results in a more Modified: vendor/llvm/dist/include/llvm/CodeGen/RuntimeLibcalls.def ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/RuntimeLibcalls.def Sat Dec 23 22:58:19 2017 (r327121) +++ vendor/llvm/dist/include/llvm/CodeGen/RuntimeLibcalls.def Sun Dec 24 01:00:08 2017 (r327122) @@ -165,6 +165,8 @@ HANDLE_LIBCALL(SINCOS_F64, nullptr) HANDLE_LIBCALL(SINCOS_F80, nullptr) HANDLE_LIBCALL(SINCOS_F128, nullptr) HANDLE_LIBCALL(SINCOS_PPCF128, nullptr) +HANDLE_LIBCALL(SINCOS_STRET_F32, nullptr) +HANDLE_LIBCALL(SINCOS_STRET_F64, nullptr) HANDLE_LIBCALL(POW_F32, "powf") HANDLE_LIBCALL(POW_F64, "pow") HANDLE_LIBCALL(POW_F80, "powl") @@ -334,6 +336,7 @@ HANDLE_LIBCALL(O_PPCF128, "__gcc_qunord") HANDLE_LIBCALL(MEMCPY, "memcpy") HANDLE_LIBCALL(MEMMOVE, "memmove") HANDLE_LIBCALL(MEMSET, "memset") +HANDLE_LIBCALL(BZERO, nullptr) // Element-wise unordered-atomic memory of different sizes HANDLE_LIBCALL(MEMCPY_ELEMENT_UNORDERED_ATOMIC_1, "__llvm_memcpy_element_unordered_atomic_1") Added: vendor/llvm/dist/include/llvm/CodeGen/SDNodeProperties.td ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/llvm/dist/include/llvm/CodeGen/SDNodeProperties.td Sun Dec 24 01:00:08 2017 (r327122) @@ -0,0 +1,34 @@ +//===- SDNodeProperties.td - Common code for DAG isels ---*- tablegen -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +class SDNodeProperty; + +// Selection DAG Pattern Operations +class SDPatternOperator { + list Properties = []; +} + +//===----------------------------------------------------------------------===// +// Selection DAG Node Properties. +// +// Note: These are hard coded into tblgen. +// +def SDNPCommutative : SDNodeProperty; // X op Y == Y op X +def SDNPAssociative : SDNodeProperty; // (X op Y) op Z == X op (Y op Z) +def SDNPHasChain : SDNodeProperty; // R/W chain operand and result +def SDNPOutGlue : SDNodeProperty; // Write a flag result +def SDNPInGlue : SDNodeProperty; // Read a flag operand +def SDNPOptInGlue : SDNodeProperty; // Optionally read a flag operand +def SDNPMayStore : SDNodeProperty; // May write to memory, sets 'mayStore'. +def SDNPMayLoad : SDNodeProperty; // May read memory, sets 'mayLoad'. +def SDNPSideEffect : SDNodeProperty; // Sets 'HasUnmodelledSideEffects'. +def SDNPMemOperand : SDNodeProperty; // Touches memory, has assoc MemOperand +def SDNPVariadic : SDNodeProperty; // Node has variable arguments. +def SDNPWantRoot : SDNodeProperty; // ComplexPattern gets the root of match +def SDNPWantParent : SDNodeProperty; // ComplexPattern gets the parent Modified: vendor/llvm/dist/include/llvm/CodeGen/SelectionDAGNodes.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/SelectionDAGNodes.h Sat Dec 23 22:58:19 2017 (r327121) +++ vendor/llvm/dist/include/llvm/CodeGen/SelectionDAGNodes.h Sun Dec 24 01:00:08 2017 (r327122) @@ -189,8 +189,8 @@ class SDValue { (public) inline bool isUndef() const; inline unsigned getMachineOpcode() const; inline const DebugLoc &getDebugLoc() const; - inline void dump() const; - inline void dumpr() const; + inline void dump(const SelectionDAG *G = nullptr) const; + inline void dumpr(const SelectionDAG *G = nullptr) const; /// Return true if this operand (which must be a chain) reaches the /// specified operand without crossing any side-effecting instructions. @@ -1089,12 +1089,12 @@ inline const DebugLoc &SDValue::getDebugLoc() const { return Node->getDebugLoc(); } -inline void SDValue::dump() const { - return Node->dump(); +inline void SDValue::dump(const SelectionDAG *G) const { + return Node->dump(G); } -inline void SDValue::dumpr() const { - return Node->dumpr(); +inline void SDValue::dumpr(const SelectionDAG *G) const { + return Node->dumpr(G); } // Define inline functions from the SDUse class. Modified: vendor/llvm/dist/include/llvm/CodeGen/TargetLowering.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/TargetLowering.h Sat Dec 23 22:58:19 2017 (r327121) +++ vendor/llvm/dist/include/llvm/CodeGen/TargetLowering.h Sun Dec 24 01:00:08 2017 (r327122) @@ -824,8 +824,8 @@ class TargetLoweringBase { (public) /// also combined within this function. Currently, the minimum size check is /// performed in findJumpTable() in SelectionDAGBuiler and /// getEstimatedNumberOfCaseClusters() in BasicTTIImpl. - bool isSuitableForJumpTable(const SwitchInst *SI, uint64_t NumCases, - uint64_t Range) const { + virtual bool isSuitableForJumpTable(const SwitchInst *SI, uint64_t NumCases, + uint64_t Range) const { const bool OptForSize = SI->getParent()->getParent()->optForSize(); const unsigned MinDensity = getMinimumJumpTableDensity(OptForSize); const unsigned MaxJumpTableSize = @@ -1276,7 +1276,7 @@ class TargetLoweringBase { (public) } /// Return lower limit for number of blocks in a jump table. - unsigned getMinimumJumpTableEntries() const; + virtual unsigned getMinimumJumpTableEntries() const; /// Return lower limit of the density in a jump table. unsigned getMinimumJumpTableDensity(bool OptForSize) const; @@ -2429,7 +2429,7 @@ class TargetLoweringBase { (public) PromoteToType; /// Stores the name each libcall. - const char *LibcallRoutineNames[RTLIB::UNKNOWN_LIBCALL]; + const char *LibcallRoutineNames[RTLIB::UNKNOWN_LIBCALL + 1]; /// The ISD::CondCode that should be used to test the result of each of the /// comparison libcall against zero. @@ -2437,6 +2437,9 @@ class TargetLoweringBase { (public) /// Stores the CallingConv that should be used for each libcall. CallingConv::ID LibcallCallingConvs[RTLIB::UNKNOWN_LIBCALL]; + + /// Set default libcall names and calling conventions. + void InitLibcalls(const Triple &TT); protected: /// Return true if the extension represented by \p I is free. Modified: vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFUnit.h ============================================================================== --- vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFUnit.h Sat Dec 23 22:58:19 2017 (r327121) +++ vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFUnit.h Sun Dec 24 01:00:08 2017 (r327122) @@ -165,6 +165,29 @@ struct BaseAddress { uint64_t SectionIndex; }; +/// Represents a unit's contribution to the string offsets table. +struct StrOffsetsContributionDescriptor { + uint64_t Base = 0; + uint64_t Size = 0; + /// Format and version. + DWARFFormParams FormParams = {0, 0, dwarf::DwarfFormat::DWARF32}; + + StrOffsetsContributionDescriptor(uint64_t Base, uint64_t Size, + uint8_t Version, dwarf::DwarfFormat Format) + : Base(Base), Size(Size), FormParams({Version, 0, Format}) {} + + uint8_t getVersion() const { return FormParams.Version; } + dwarf::DwarfFormat getFormat() const { return FormParams.Format; } + uint8_t getDwarfOffsetByteSize() const { + return FormParams.getDwarfOffsetByteSize(); + } + /// Determine whether a contribution to the string offsets table is + /// consistent with the relevant section size and that its length is + /// a multiple of the size of one of its entries. + Optional + validateContributionSize(DWARFDataExtractor &DA); +}; + class DWARFUnit { DWARFContext &Context; /// Section containing this DWARFUnit. @@ -176,7 +199,6 @@ class DWARFUnit { const DWARFSection &LineSection; StringRef StringSection; const DWARFSection &StringOffsetSection; - uint64_t StringOffsetSectionBase = 0; const DWARFSection *AddrOffsetSection; uint32_t AddrOffsetSectionBase = 0; bool isLittleEndian; @@ -185,6 +207,9 @@ class DWARFUnit { // Version, address size, and DWARF format. DWARFFormParams FormParams; + /// Start, length, and DWARF format of the unit's contribution to the string + /// offsets table (DWARF v5). + Optional StringOffsetsTableContribution; uint32_t Offset; uint32_t Length; @@ -195,11 +220,41 @@ class DWARFUnit { /// The compile unit debug information entry items. std::vector DieArray; - /// Map from range's start address to end address and corresponding DIE. - /// IntervalMap does not support range removal, as a result, we use the - /// std::map::upper_bound for address range lookup. - std::map> AddrDieMap; + /// The vector of inlined subroutine DIEs that we can map directly to from + /// their subprogram below. + std::vector InlinedSubroutineDIEs; + /// A type representing a subprogram DIE and a map (built using a sorted + /// vector) into that subprogram's inlined subroutine DIEs. + struct SubprogramDIEAddrInfo { + DWARFDie SubprogramDIE; + + uint64_t SubprogramBasePC; + + /// A vector sorted to allow mapping from a relative PC to the inlined + /// subroutine DIE with the most specific address range covering that PC. + /// + /// The PCs are relative to the `SubprogramBasePC`. + /// + /// The vector is sorted in ascending order of the first int which + /// represents the relative PC for an interval in the map. The second int + /// represents the index into the `InlinedSubroutineDIEs` vector of the DIE + /// that interval maps to. An index of '-1` indicates an empty mapping. The + /// interval covered is from the `.first` relative PC to the next entry's + /// `.first` relative PC. + std::vector> InlinedSubroutineDIEAddrMap; + }; + + /// Vector of the subprogram DIEs and their subroutine address maps. + std::vector SubprogramDIEAddrInfos; + + /// A vector sorted to allow mapping from a PC to the subprogram DIE (and + /// associated addr map) index. Subprograms with overlapping PC ranges aren't + /// supported here. Nothing will crash, but the mapping may be inaccurate. + /// This vector may also contain "empty" ranges marked by an address with + /// a DIE index of '-1'. + std::vector> SubprogramDIEAddrMap; + using die_iterator_range = iterator_range::iterator>; @@ -219,6 +274,21 @@ class DWARFUnit { /// Size in bytes of the unit header. virtual uint32_t getHeaderSize() const { return getVersion() <= 4 ? 11 : 12; } + /// Find the unit's contribution to the string offsets table and determine its + /// length and form. The given offset is expected to be derived from the unit + /// DIE's DW_AT_str_offsets_base attribute. + Optional + determineStringOffsetsTableContribution(DWARFDataExtractor &DA, + uint64_t Offset); + + /// Find the unit's contribution to the string offsets table and determine its + /// length and form. The given offset is expected to be 0 in a dwo file or, + /// in a dwp file, the start of the unit's contribution to the string offsets + /// table section (as determined by the index table). + Optional + determineStringOffsetsTableContributionDWO(DWARFDataExtractor &DA, + uint64_t Offset); + public: DWARFUnit(DWARFContext &Context, const DWARFSection &Section, const DWARFDebugAbbrev *DA, const DWARFSection *RS, StringRef SS, @@ -242,9 +312,6 @@ class DWARFUnit { AddrOffsetSectionBase = Base; } - /// Recursively update address to Die map. - void updateAddressDieMap(DWARFDie Die); - void setRangesSection(const DWARFSection *RS, uint32_t Base) { RangeSection = RS; RangeSectionBase = Base; @@ -272,6 +339,10 @@ class DWARFUnit { uint32_t getNextUnitOffset() const { return Offset + Length + 4; } uint32_t getLength() const { return Length; } + const Optional & + getStringOffsetsTableContribution() const { + return StringOffsetsTableContribution; + } const DWARFFormParams &getFormParams() const { return FormParams; } uint16_t getVersion() const { return FormParams.Version; } dwarf::DwarfFormat getFormat() const { return FormParams.Format; } @@ -281,6 +352,16 @@ class DWARFUnit { return FormParams.getDwarfOffsetByteSize(); } + uint8_t getDwarfStringOffsetsByteSize() const { + assert(StringOffsetsTableContribution); + return StringOffsetsTableContribution->getDwarfOffsetByteSize(); + } + + uint64_t getStringOffsetsBase() const { + assert(StringOffsetsTableContribution); + return StringOffsetsTableContribution->Base; + } + const DWARFAbbreviationDeclarationSet *getAbbreviations() const; uint8_t getUnitType() const { return UnitType; } @@ -426,6 +507,9 @@ class DWARFUnit { /// parseDWO - Parses .dwo file for current compile unit. Returns true if /// it was actually constructed. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Dec 24 01:00:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B10AE88253; Sun, 24 Dec 2017 01:00:31 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2039F7EA66; Sun, 24 Dec 2017 01:00:27 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBO10Qj7073929; Sun, 24 Dec 2017 01:00:26 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBO10NvJ073904; Sun, 24 Dec 2017 01:00:23 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201712240100.vBO10NvJ073904@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 24 Dec 2017 01:00:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r327124 - in vendor/clang/dist: cmake/caches docs include/clang/AST include/clang/Basic include/clang/Frontend include/clang/Index include/clang/Parse include/clang/Sema include/clang/S... X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/clang/dist: cmake/caches docs include/clang/AST include/clang/Basic include/clang/Frontend include/clang/Index include/clang/Parse include/clang/Sema include/clang/Serialization include/clan... X-SVN-Commit-Revision: 327124 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Dec 2017 01:00:31 -0000 Author: dim Date: Sun Dec 24 01:00:23 2017 New Revision: 327124 URL: https://svnweb.freebsd.org/changeset/base/327124 Log: Vendor import of clang trunk r321414: https://llvm.org/svn/llvm-project/cfe/trunk@321414 Added: vendor/clang/dist/test/Analysis/arc-zero-init.m vendor/clang/dist/test/CodeGen/aarch64-v8.2a-neon-intrinsics.c (contents, props changed) vendor/clang/dist/test/CodeGen/ubsan-noreturn.c (contents, props changed) vendor/clang/dist/test/CodeGenCXX/ubsan-unreachable.cpp (contents, props changed) vendor/clang/dist/test/Driver/Inputs/basic_myriad_tree/lib/gcc/sparc-myriad-rtems/ vendor/clang/dist/test/Driver/Inputs/basic_myriad_tree/lib/gcc/sparc-myriad-rtems/6.3.0/ vendor/clang/dist/test/Driver/Inputs/basic_myriad_tree/lib/gcc/sparc-myriad-rtems/6.3.0/crtbegin.o (contents, props changed) vendor/clang/dist/test/Driver/Inputs/basic_myriad_tree/lib/gcc/sparc-myriad-rtems/6.3.0/crtend.o (contents, props changed) vendor/clang/dist/test/Driver/Inputs/basic_myriad_tree/lib/gcc/sparc-myriad-rtems/6.3.0/crti.o (contents, props changed) vendor/clang/dist/test/Driver/Inputs/basic_myriad_tree/lib/gcc/sparc-myriad-rtems/6.3.0/crtn.o (contents, props changed) vendor/clang/dist/test/Driver/Inputs/basic_myriad_tree/sparc-myriad-rtems/ vendor/clang/dist/test/Driver/Inputs/basic_myriad_tree/sparc-myriad-rtems/include/ vendor/clang/dist/test/Driver/Inputs/basic_myriad_tree/sparc-myriad-rtems/include/c++/ vendor/clang/dist/test/Driver/Inputs/basic_myriad_tree/sparc-myriad-rtems/include/c++/6.3.0/ vendor/clang/dist/test/Driver/Inputs/basic_myriad_tree/sparc-myriad-rtems/include/c++/6.3.0/.keep vendor/clang/dist/test/Driver/Inputs/basic_myriad_tree/sparc-myriad-rtems/lib/ vendor/clang/dist/test/Driver/Inputs/basic_myriad_tree/sparc-myriad-rtems/lib/crt0.o (contents, props changed) vendor/clang/dist/test/Index/skipped-bodies-templates.cpp (contents, props changed) vendor/clang/dist/test/Modules/Inputs/implicit-private-canonical/ vendor/clang/dist/test/Modules/Inputs/implicit-private-canonical/A.framework/ vendor/clang/dist/test/Modules/Inputs/implicit-private-canonical/A.framework/Headers/ vendor/clang/dist/test/Modules/Inputs/implicit-private-canonical/A.framework/Headers/a.h (contents, props changed) vendor/clang/dist/test/Modules/Inputs/implicit-private-canonical/A.framework/Headers/aprivate.h (contents, props changed) vendor/clang/dist/test/Modules/Inputs/implicit-private-canonical/A.framework/Modules/ vendor/clang/dist/test/Modules/Inputs/implicit-private-canonical/A.framework/Modules/module.modulemap vendor/clang/dist/test/Modules/Inputs/implicit-private-canonical/A.framework/Modules/module.private.modulemap vendor/clang/dist/test/Modules/Inputs/implicit-private-canonical/A.framework/PrivateHeaders/ vendor/clang/dist/test/Modules/Inputs/implicit-private-canonical/A.framework/PrivateHeaders/aprivate.h (contents, props changed) vendor/clang/dist/test/Modules/Inputs/implicit-private-with-different-name/A.framework/PrivateHeaders/ vendor/clang/dist/test/Modules/Inputs/implicit-private-with-different-name/A.framework/PrivateHeaders/aprivate.h (contents, props changed) vendor/clang/dist/test/Modules/Inputs/implicit-private-with-submodule/ vendor/clang/dist/test/Modules/Inputs/implicit-private-with-submodule/A.framework/ vendor/clang/dist/test/Modules/Inputs/implicit-private-with-submodule/A.framework/Headers/ vendor/clang/dist/test/Modules/Inputs/implicit-private-with-submodule/A.framework/Headers/a.h (contents, props changed) vendor/clang/dist/test/Modules/Inputs/implicit-private-with-submodule/A.framework/Headers/aprivate.h (contents, props changed) vendor/clang/dist/test/Modules/Inputs/implicit-private-with-submodule/A.framework/Modules/ vendor/clang/dist/test/Modules/Inputs/implicit-private-with-submodule/A.framework/Modules/module.modulemap vendor/clang/dist/test/Modules/Inputs/implicit-private-with-submodule/A.framework/Modules/module.private.modulemap vendor/clang/dist/test/Modules/Inputs/implicit-private-with-submodule/A.framework/PrivateHeaders/ vendor/clang/dist/test/Modules/Inputs/implicit-private-with-submodule/A.framework/PrivateHeaders/aprivate.h (contents, props changed) vendor/clang/dist/test/Modules/implicit-map-dot-private.m vendor/clang/dist/test/Modules/implicit-private-canonical.m vendor/clang/dist/test/Modules/implicit-private-with-submodule.m vendor/clang/dist/test/SemaTemplate/nested-deduction-guides.cpp (contents, props changed) vendor/clang/dist/test/SemaTemplate/temp_arg_enum_printing_more.cpp (contents, props changed) vendor/clang/dist/unittests/CodeGen/IRMatchers.h (contents, props changed) vendor/clang/dist/unittests/CodeGen/TBAAMetadataTest.cpp (contents, props changed) Deleted: vendor/clang/dist/test/Driver/Inputs/basic_myriad_tree/lib/gcc/sparc-myriad-elf/ vendor/clang/dist/test/Driver/Inputs/basic_myriad_tree/sparc-myriad-elf/ vendor/clang/dist/test/Modules/Inputs/implicit-private-with-different-name/A.framework/Headers/aprivate.h Modified: vendor/clang/dist/cmake/caches/Fuchsia-stage2.cmake vendor/clang/dist/cmake/caches/Fuchsia.cmake vendor/clang/dist/docs/HardwareAssistedAddressSanitizerDesign.rst vendor/clang/dist/docs/Modules.rst vendor/clang/dist/docs/UndefinedBehaviorSanitizer.rst vendor/clang/dist/include/clang/AST/Decl.h vendor/clang/dist/include/clang/AST/ODRHash.h vendor/clang/dist/include/clang/AST/Type.h vendor/clang/dist/include/clang/Basic/Attr.td vendor/clang/dist/include/clang/Basic/DiagnosticFrontendKinds.td vendor/clang/dist/include/clang/Basic/DiagnosticIDs.h vendor/clang/dist/include/clang/Basic/DiagnosticLexKinds.td vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td vendor/clang/dist/include/clang/Basic/DiagnosticSerializationKinds.td vendor/clang/dist/include/clang/Basic/arm_neon.td vendor/clang/dist/include/clang/Frontend/PrecompiledPreamble.h vendor/clang/dist/include/clang/Index/IndexSymbol.h vendor/clang/dist/include/clang/Parse/Parser.h vendor/clang/dist/include/clang/Sema/Sema.h vendor/clang/dist/include/clang/Serialization/ASTReader.h vendor/clang/dist/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h vendor/clang/dist/lib/AST/ASTDumper.cpp vendor/clang/dist/lib/AST/ASTImporter.cpp vendor/clang/dist/lib/AST/Decl.cpp vendor/clang/dist/lib/AST/Expr.cpp vendor/clang/dist/lib/AST/ExprCXX.cpp vendor/clang/dist/lib/AST/ExprConstant.cpp vendor/clang/dist/lib/AST/ItaniumMangle.cpp vendor/clang/dist/lib/AST/ODRHash.cpp vendor/clang/dist/lib/AST/TypeLoc.cpp vendor/clang/dist/lib/AST/TypePrinter.cpp vendor/clang/dist/lib/Basic/Diagnostic.cpp vendor/clang/dist/lib/Basic/DiagnosticIDs.cpp vendor/clang/dist/lib/Basic/SourceManager.cpp vendor/clang/dist/lib/Basic/Targets/AArch64.cpp vendor/clang/dist/lib/Basic/Targets/X86.cpp vendor/clang/dist/lib/CodeGen/BackendUtil.cpp vendor/clang/dist/lib/CodeGen/CGAtomic.cpp vendor/clang/dist/lib/CodeGen/CGBuiltin.cpp vendor/clang/dist/lib/CodeGen/CGCall.cpp vendor/clang/dist/lib/CodeGen/CGDebugInfo.cpp vendor/clang/dist/lib/CodeGen/CGException.cpp vendor/clang/dist/lib/CodeGen/CGExpr.cpp vendor/clang/dist/lib/CodeGen/CGExprAgg.cpp vendor/clang/dist/lib/CodeGen/CGExprCXX.cpp vendor/clang/dist/lib/CodeGen/CGExprComplex.cpp vendor/clang/dist/lib/CodeGen/CodeGenFunction.h vendor/clang/dist/lib/CodeGen/CodeGenModule.cpp vendor/clang/dist/lib/CodeGen/CodeGenTBAA.cpp vendor/clang/dist/lib/CodeGen/CodeGenTypeCache.h vendor/clang/dist/lib/Driver/SanitizerArgs.cpp vendor/clang/dist/lib/Driver/ToolChains/Clang.cpp vendor/clang/dist/lib/Driver/ToolChains/CommonArgs.cpp vendor/clang/dist/lib/Driver/ToolChains/Darwin.cpp vendor/clang/dist/lib/Driver/ToolChains/Fuchsia.cpp vendor/clang/dist/lib/Driver/ToolChains/Myriad.cpp vendor/clang/dist/lib/Frontend/CompilerInstance.cpp vendor/clang/dist/lib/Frontend/PrecompiledPreamble.cpp vendor/clang/dist/lib/Headers/__clang_cuda_intrinsics.h vendor/clang/dist/lib/Headers/cpuid.h vendor/clang/dist/lib/Headers/xmmintrin.h vendor/clang/dist/lib/Index/IndexSymbol.cpp vendor/clang/dist/lib/Lex/HeaderSearch.cpp vendor/clang/dist/lib/Lex/ModuleMap.cpp vendor/clang/dist/lib/Lex/Preprocessor.cpp vendor/clang/dist/lib/Parse/ParseTemplate.cpp vendor/clang/dist/lib/Rewrite/HTMLRewrite.cpp vendor/clang/dist/lib/Sema/CodeCompleteConsumer.cpp vendor/clang/dist/lib/Sema/JumpDiagnostics.cpp vendor/clang/dist/lib/Sema/SemaChecking.cpp vendor/clang/dist/lib/Sema/SemaCodeComplete.cpp vendor/clang/dist/lib/Sema/SemaDecl.cpp vendor/clang/dist/lib/Sema/SemaDeclAttr.cpp vendor/clang/dist/lib/Sema/SemaDeclCXX.cpp vendor/clang/dist/lib/Sema/SemaExpr.cpp vendor/clang/dist/lib/Sema/SemaExprMember.cpp vendor/clang/dist/lib/Sema/SemaExprObjC.cpp vendor/clang/dist/lib/Sema/SemaInit.cpp vendor/clang/dist/lib/Sema/SemaOpenMP.cpp vendor/clang/dist/lib/Sema/SemaOverload.cpp vendor/clang/dist/lib/Sema/SemaTemplate.cpp vendor/clang/dist/lib/Sema/SemaTemplateDeduction.cpp vendor/clang/dist/lib/Sema/SemaTemplateInstantiateDecl.cpp vendor/clang/dist/lib/Sema/SemaType.cpp vendor/clang/dist/lib/Serialization/ASTReader.cpp vendor/clang/dist/lib/Serialization/ASTReaderDecl.cpp vendor/clang/dist/lib/Serialization/ASTWriterDecl.cpp vendor/clang/dist/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp vendor/clang/dist/lib/StaticAnalyzer/Checkers/PaddingChecker.cpp vendor/clang/dist/lib/StaticAnalyzer/Core/BugReporter.cpp vendor/clang/dist/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp vendor/clang/dist/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp vendor/clang/dist/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp vendor/clang/dist/lib/StaticAnalyzer/Core/RegionStore.cpp vendor/clang/dist/test/Analysis/initializer.cpp vendor/clang/dist/test/Analysis/inlining/false-positive-suppression.m vendor/clang/dist/test/Analysis/inlining/inline-defensive-checks.c vendor/clang/dist/test/Analysis/inlining/path-notes.m vendor/clang/dist/test/Analysis/nullptr.cpp vendor/clang/dist/test/Analysis/uninit-const.cpp vendor/clang/dist/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-examples.cpp vendor/clang/dist/test/CXX/temp/temp.param/p2.cpp vendor/clang/dist/test/CodeGen/aarch64-neon-intrinsics.c vendor/clang/dist/test/CodeGen/aarch64-neon-ldst-one.c vendor/clang/dist/test/CodeGen/complex-math.c vendor/clang/dist/test/CodeGen/tbaa-array.cpp vendor/clang/dist/test/CodeGen/tbaa.cpp vendor/clang/dist/test/Driver/darwin-version.c vendor/clang/dist/test/Driver/fsanitize.c vendor/clang/dist/test/Driver/fuchsia.c vendor/clang/dist/test/Driver/myriad-toolchain.c vendor/clang/dist/test/Driver/objc-weak.m vendor/clang/dist/test/Driver/opt-record.c vendor/clang/dist/test/Driver/pic.c vendor/clang/dist/test/Driver/unavailable_aligned_allocation.cpp vendor/clang/dist/test/Frontend/float16.cpp vendor/clang/dist/test/Misc/ast-dump-attr.cpp vendor/clang/dist/test/Misc/ast-dump-color.cpp vendor/clang/dist/test/Misc/ast-dump-decl.cpp vendor/clang/dist/test/Misc/ast-dump-invalid.cpp vendor/clang/dist/test/Modules/add-remove-private.m vendor/clang/dist/test/Modules/auto-module-import.m vendor/clang/dist/test/Modules/global_index.m vendor/clang/dist/test/Modules/implicit-private-with-different-name.m vendor/clang/dist/test/Modules/modulemap-locations.m vendor/clang/dist/test/Modules/odr.cpp vendor/clang/dist/test/Modules/odr_hash.cpp vendor/clang/dist/test/Modules/prune.m vendor/clang/dist/test/Modules/redefinition-c-tagtypes.m vendor/clang/dist/test/Modules/requires-coroutines.mm vendor/clang/dist/test/Modules/requires.m vendor/clang/dist/test/Modules/requires.mm vendor/clang/dist/test/Modules/subframework-from-intermediate-path.m vendor/clang/dist/test/Modules/subframeworks.m vendor/clang/dist/test/OpenMP/dump.cpp vendor/clang/dist/test/OpenMP/parallel_for_codegen.cpp vendor/clang/dist/test/OpenMP/teams_distribute_parallel_for_num_threads_codegen.cpp vendor/clang/dist/test/OpenMP/teams_distribute_parallel_for_simd_num_threads_codegen.cpp vendor/clang/dist/test/Parser/cxx-decl.cpp vendor/clang/dist/test/Parser/objc-default-ctor-init.mm vendor/clang/dist/test/Preprocessor/predefined-arch-macros.c vendor/clang/dist/test/Sema/attr-ifunc.c vendor/clang/dist/test/Sema/builtin-object-size.c vendor/clang/dist/test/SemaCXX/compound-literal.cpp vendor/clang/dist/test/SemaCXX/decl-expr-ambiguity.cpp vendor/clang/dist/test/SemaCXX/return-noreturn.cpp vendor/clang/dist/test/SemaCXX/sourceranges.cpp vendor/clang/dist/test/SemaCXX/warn-redundant-move.cpp vendor/clang/dist/test/SemaObjCXX/block-cleanup.mm vendor/clang/dist/test/SemaTemplate/default-expr-arguments-2.cpp vendor/clang/dist/test/SemaTemplate/default-expr-arguments-3.cpp vendor/clang/dist/test/SemaTemplate/temp_arg_enum_printing.cpp vendor/clang/dist/tools/libclang/CXIndexDataConsumer.cpp vendor/clang/dist/unittests/AST/ASTImporterTest.cpp vendor/clang/dist/unittests/AST/NamedDeclPrinterTest.cpp vendor/clang/dist/unittests/CodeGen/CMakeLists.txt vendor/clang/dist/utils/TableGen/ClangAttrEmitter.cpp vendor/clang/dist/utils/TableGen/NeonEmitter.cpp Modified: vendor/clang/dist/cmake/caches/Fuchsia-stage2.cmake ============================================================================== --- vendor/clang/dist/cmake/caches/Fuchsia-stage2.cmake Sun Dec 24 01:00:16 2017 (r327123) +++ vendor/clang/dist/cmake/caches/Fuchsia-stage2.cmake Sun Dec 24 01:00:23 2017 (r327124) @@ -23,6 +23,7 @@ if(APPLE) set(LLDB_CODESIGN_IDENTITY "" CACHE STRING "") endif() +set(LLVM_ENABLE_ASSERTIONS ON CACHE BOOL "") set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "") set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 -gline-tables-only -DNDEBUG" CACHE STRING "") set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -gline-tables-only -DNDEBUG" CACHE STRING "") Modified: vendor/clang/dist/cmake/caches/Fuchsia.cmake ============================================================================== --- vendor/clang/dist/cmake/caches/Fuchsia.cmake Sun Dec 24 01:00:16 2017 (r327123) +++ vendor/clang/dist/cmake/caches/Fuchsia.cmake Sun Dec 24 01:00:23 2017 (r327124) @@ -13,6 +13,7 @@ set(LLVM_ENABLE_TERMINFO OFF CACHE BOOL "") set(LLVM_ENABLE_ZLIB OFF CACHE BOOL "") set(CLANG_PLUGIN_SUPPORT OFF CACHE BOOL "") +set(LLVM_ENABLE_ASSERTIONS ON CACHE BOOL "") set(CMAKE_BUILD_TYPE Release CACHE STRING "") set(BOOTSTRAP_LLVM_ENABLE_LTO ON CACHE BOOL "") Modified: vendor/clang/dist/docs/HardwareAssistedAddressSanitizerDesign.rst ============================================================================== --- vendor/clang/dist/docs/HardwareAssistedAddressSanitizerDesign.rst Sun Dec 24 01:00:16 2017 (r327123) +++ vendor/clang/dist/docs/HardwareAssistedAddressSanitizerDesign.rst Sun Dec 24 01:00:23 2017 (r327124) @@ -21,7 +21,7 @@ The redzones, the quarantine, and, to a less extent, t sources of AddressSanitizer's memory overhead. See the `AddressSanitizer paper`_ for details. -AArch64 has the `Address Tagging`_, a hardware feature that allows +AArch64 has the `Address Tagging`_ (or top-byte-ignore, TBI), a hardware feature that allows software to use 8 most significant bits of a 64-bit pointer as a tag. HWASAN uses `Address Tagging`_ to implement a memory safety tool, similar to :doc:`AddressSanitizer`, @@ -31,7 +31,7 @@ accuracy guarantees. Algorithm ========= * Every heap/stack/global memory object is forcibly aligned by `N` bytes - (`N` is e.g. 16 or 64) + (`N` is e.g. 16 or 64). We call `N` the **granularity** of tagging. * For every such object a random `K`-bit tag `T` is chosen (`K` is e.g. 4 or 8) * The pointer to the object is tagged with `T`. * The memory for the object is also tagged with `T` @@ -44,19 +44,35 @@ Instrumentation Memory Accesses --------------- -All memory accesses are prefixed with a call to a run-time function. -The function encodes the type and the size of access in its name; -it receives the address as a parameter, e.g. `__hwasan_load4(void *ptr)`; -it loads the memory tag, compares it with the -pointer tag, and executes `__builtin_trap` (or calls `__hwasan_error_load4(void *ptr)`) on mismatch. +All memory accesses are prefixed with an inline instruction sequence that +verifies the tags. Currently, the following sequence is used: -It's possible to inline this callback too. +.. code-block:: asm + + // int foo(int *a) { return *a; } + // clang -O2 --target=aarch64-linux -fsanitize=hwaddress -c load.c + foo: + 0: 08 dc 44 d3 ubfx x8, x0, #4, #52 // shadow address + 4: 08 01 40 39 ldrb w8, [x8] // load shadow + 8: 09 fc 78 d3 lsr x9, x0, #56 // address tag + c: 3f 01 08 6b cmp w9, w8 // compare tags + 10: 61 00 00 54 b.ne #12 // jump on mismatch + 14: 00 00 40 b9 ldr w0, [x0] // original load + 18: c0 03 5f d6 ret + 1c: 40 20 40 d4 hlt #0x102 // halt + 20: 00 00 40 b9 ldr w0, [x0] // original load + 24: c0 03 5f d6 ret + + +Alternatively, memory accesses are prefixed with a function call. + Heap ---- Tagging the heap memory/pointers is done by `malloc`. This can be based on any malloc that forces all objects to be N-aligned. +`free` tags the memory with a different tag. Stack ----- @@ -75,7 +91,7 @@ TODO: details. Error reporting --------------- -Errors are generated by `__builtin_trap` and are handled by a signal handler. +Errors are generated by the `HLT` instruction and are handled by a signal handler. Attribute --------- Modified: vendor/clang/dist/docs/Modules.rst ============================================================================== --- vendor/clang/dist/docs/Modules.rst Sun Dec 24 01:00:16 2017 (r327123) +++ vendor/clang/dist/docs/Modules.rst Sun Dec 24 01:00:23 2017 (r327124) @@ -859,13 +859,15 @@ express this with a single module map file in the libr module Foo { header "Foo.h" - - explicit module Private { - header "Foo_Private.h" - } + ... } + module Foo_Private { + header "Foo_Private.h" + ... + } + because the header ``Foo_Private.h`` won't always be available. The module map file could be customized based on whether ``Foo_Private.h`` is available or not, but doing so requires custom @@ -873,7 +875,7 @@ build machinery. Private module map files, which are named ``module.private.modulemap`` (or, for backward compatibility, ``module_private.map``), allow one to -augment the primary module map file with an additional submodule. For +augment the primary module map file with an additional modules. For example, we would split the module map file above into two module map files: @@ -883,9 +885,9 @@ files: module Foo { header "Foo.h" } - + /* module.private.modulemap */ - explicit module Foo.Private { + module Foo_Private { header "Foo_Private.h" } @@ -899,13 +901,12 @@ boundaries. When writing a private module as part of a *framework*, it's recommended that: -* Headers for this module are present in the ``PrivateHeaders`` - framework subdirectory. -* The private module is defined as a *submodule* of the public framework (if - there's one), similar to how ``Foo.Private`` is defined in the example above. -* The ``explicit`` keyword should be used to guarantee that its content will - only be available when the submodule itself is explicitly named (through a - ``@import`` for example). +* Headers for this module are present in the ``PrivateHeaders`` framework + subdirectory. +* The private module is defined as a *top level module* with the name of the + public framework prefixed, like ``Foo_Private`` above. Clang has extra logic + to work with this naming, using ``FooPrivate`` or ``Foo.Private`` (submodule) + trigger warnings and might not work as expected. Modularizing a Platform ======================= Modified: vendor/clang/dist/docs/UndefinedBehaviorSanitizer.rst ============================================================================== --- vendor/clang/dist/docs/UndefinedBehaviorSanitizer.rst Sun Dec 24 01:00:16 2017 (r327123) +++ vendor/clang/dist/docs/UndefinedBehaviorSanitizer.rst Sun Dec 24 01:00:23 2017 (r327124) @@ -124,8 +124,8 @@ Available checks are: - ``-fsanitize=signed-integer-overflow``: Signed integer overflow, including all the checks added by ``-ftrapv``, and checking for overflow in signed division (``INT_MIN / -1``). - - ``-fsanitize=unreachable``: If control flow reaches - ``__builtin_unreachable``. + - ``-fsanitize=unreachable``: If control flow reaches an unreachable + program point. - ``-fsanitize=unsigned-integer-overflow``: Unsigned integer overflows. Note that unlike signed integer overflow, unsigned integer is not undefined behavior. However, while it has well-defined semantics, Modified: vendor/clang/dist/include/clang/AST/Decl.h ============================================================================== --- vendor/clang/dist/include/clang/AST/Decl.h Sun Dec 24 01:00:16 2017 (r327123) +++ vendor/clang/dist/include/clang/AST/Decl.h Sun Dec 24 01:00:23 2017 (r327124) @@ -1759,6 +1759,11 @@ class FunctionDecl : public DeclaratorDecl, public Dec unsigned IsCopyDeductionCandidate : 1; private: + + /// Store the ODRHash after first calculation. + unsigned HasODRHash : 1; + unsigned ODRHash; + /// \brief End part of this FunctionDecl's source range. /// /// We could compute the full range in getSourceRange(). However, when we're @@ -1841,8 +1846,9 @@ class FunctionDecl : public DeclaratorDecl, public Dec IsExplicitlyDefaulted(false), HasImplicitReturnZero(false), IsLateTemplateParsed(false), IsConstexpr(isConstexprSpecified), InstantiationIsPending(false), UsesSEHTry(false), HasSkippedBody(false), - WillHaveBody(false), IsCopyDeductionCandidate(false), - EndRangeLoc(NameInfo.getEndLoc()), DNLoc(NameInfo.getInfo()) {} + WillHaveBody(false), IsCopyDeductionCandidate(false), HasODRHash(false), + ODRHash(0), EndRangeLoc(NameInfo.getEndLoc()), + DNLoc(NameInfo.getInfo()) {} using redeclarable_base = Redeclarable; @@ -2438,6 +2444,10 @@ class FunctionDecl : public DeclaratorDecl, public Dec /// the corresponding Builtin ID. If the function is not a memory function, /// returns 0. unsigned getMemoryFunctionKind() const; + + /// \brief Returns ODRHash of the function. This value is calculated and + /// stored on first call, then the stored value returned on the other calls. + unsigned getODRHash(); // Implement isa/cast/dyncast/etc. static bool classof(const Decl *D) { return classofKind(D->getKind()); } Modified: vendor/clang/dist/include/clang/AST/ODRHash.h ============================================================================== --- vendor/clang/dist/include/clang/AST/ODRHash.h Sun Dec 24 01:00:16 2017 (r327123) +++ vendor/clang/dist/include/clang/AST/ODRHash.h Sun Dec 24 01:00:23 2017 (r327124) @@ -53,6 +53,10 @@ class ODRHash { (public) // more information than the AddDecl class. void AddCXXRecordDecl(const CXXRecordDecl *Record); + // Use this for ODR checking functions between modules. This method compares + // more information than the AddDecl class. + void AddFunctionDecl(const FunctionDecl *Function); + // Process SubDecls of the main Decl. This method calls the DeclVisitor // while AddDecl does not. void AddSubDecl(const Decl *D); Modified: vendor/clang/dist/include/clang/AST/Type.h ============================================================================== --- vendor/clang/dist/include/clang/AST/Type.h Sun Dec 24 01:00:16 2017 (r327123) +++ vendor/clang/dist/include/clang/AST/Type.h Sun Dec 24 01:00:23 2017 (r327124) @@ -976,16 +976,14 @@ class QualType { (public) return LHS.Value != RHS.Value; } - std::string getAsString() const { - return getAsString(split()); + static std::string getAsString(SplitQualType split, + const PrintingPolicy &Policy) { + return getAsString(split.Ty, split.Quals, Policy); } + static std::string getAsString(const Type *ty, Qualifiers qs, + const PrintingPolicy &Policy); - static std::string getAsString(SplitQualType split) { - return getAsString(split.Ty, split.Quals); - } - - static std::string getAsString(const Type *ty, Qualifiers qs); - + std::string getAsString() const; std::string getAsString(const PrintingPolicy &Policy) const; void print(raw_ostream &OS, const PrintingPolicy &Policy, Modified: vendor/clang/dist/include/clang/Basic/Attr.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/Attr.td Sun Dec 24 01:00:16 2017 (r327123) +++ vendor/clang/dist/include/clang/Basic/Attr.td Sun Dec 24 01:00:23 2017 (r327124) @@ -267,14 +267,25 @@ def RenderScript : LangOpt<"RenderScript">; def ObjC : LangOpt<"ObjC1">; def BlocksSupported : LangOpt<"Blocks">; -// Defines targets for target-specific attributes. The list of strings should -// specify architectures for which the target applies, based off the ArchType -// enumeration in Triple.h. -class TargetArch arches> { - list Arches = arches; +// Defines targets for target-specific attributes. Empty lists are unchecked. +class TargetSpec { + // Specifies Architectures for which the target applies, based off the + // ArchType enumeration in Triple.h. + list Arches = []; + // Specifies Operating Systems for which the target applies, based off the + // OSType enumeration in Triple.h list OSes; + // Specifies the C++ ABIs for which the target applies, based off the + // TargetCXXABI::Kind in TargetCXXABI.h. list CXXABIs; + // Specifies Object Formats for which the target applies, based off the + // ObjectFormatType enumeration in Triple.h + list ObjectFormats; } + +class TargetArch arches> : TargetSpec { + let Arches = arches; +} def TargetARM : TargetArch<["arm", "thumb", "armeb", "thumbeb"]>; def TargetAVR : TargetArch<["avr"]>; def TargetMips32 : TargetArch<["mips", "mipsel"]>; @@ -288,6 +299,9 @@ def TargetWindows : TargetArch<["x86", "x86_64", "arm" def TargetMicrosoftCXXABI : TargetArch<["x86", "x86_64", "arm", "thumb", "aarch64"]> { let CXXABIs = ["Microsoft"]; } +def TargetELF : TargetSpec { + let ObjectFormats = ["ELF"]; +} // Attribute subject match rules that are used for #pragma clang attribute. // @@ -465,8 +479,8 @@ class InheritableAttr : Attr; /// A target-specific attribute. This class is meant to be used as a mixin /// with InheritableAttr or Attr depending on the attribute's needs. -class TargetSpecificAttr { - TargetArch Target = target; +class TargetSpecificAttr { + TargetSpec Target = target; // Attributes are generally required to have unique spellings for their names // so that the parser can determine what kind of attribute it has parsed. // However, target-specific attributes are special in that the attribute only @@ -1121,7 +1135,7 @@ def IBOutletCollection : InheritableAttr { let Documentation = [Undocumented]; } -def IFunc : Attr { +def IFunc : Attr, TargetSpecificAttr { let Spellings = [GCC<"ifunc">]; let Args = [StringArgument<"Resolver">]; let Subjects = SubjectList<[Function]>; Modified: vendor/clang/dist/include/clang/Basic/DiagnosticFrontendKinds.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/DiagnosticFrontendKinds.td Sun Dec 24 01:00:16 2017 (r327123) +++ vendor/clang/dist/include/clang/Basic/DiagnosticFrontendKinds.td Sun Dec 24 01:00:23 2017 (r327124) @@ -198,6 +198,11 @@ def err_missing_module : Error< def err_no_submodule : Error<"no submodule named %0 in module '%1'">; def err_no_submodule_suggest : Error< "no submodule named %0 in module '%1'; did you mean '%2'?">; +def warn_no_priv_submodule_use_toplevel : Warning< + "no submodule named %0 in module '%1'; using top level '%2'">, + InGroup; +def note_private_top_level_defined : Note< + "module defined here">; def warn_missing_submodule : Warning<"missing submodule '%0'">, InGroup; def note_module_import_here : Note<"module imported here">; Modified: vendor/clang/dist/include/clang/Basic/DiagnosticIDs.h ============================================================================== --- vendor/clang/dist/include/clang/Basic/DiagnosticIDs.h Sun Dec 24 01:00:16 2017 (r327123) +++ vendor/clang/dist/include/clang/Basic/DiagnosticIDs.h Sun Dec 24 01:00:23 2017 (r327124) @@ -297,7 +297,7 @@ class DiagnosticIDs : public RefCountedBase &Diags); + std::vector &Diags); /// \brief Get the diagnostic option with the closest edit distance to the /// given group name. Modified: vendor/clang/dist/include/clang/Basic/DiagnosticLexKinds.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/DiagnosticLexKinds.td Sun Dec 24 01:00:16 2017 (r327123) +++ vendor/clang/dist/include/clang/Basic/DiagnosticLexKinds.td Sun Dec 24 01:00:23 2017 (r327124) @@ -691,11 +691,15 @@ def err_mmap_expected_feature : Error<"expected a feat def err_mmap_expected_attribute : Error<"expected an attribute name">; def warn_mmap_unknown_attribute : Warning<"unknown attribute '%0'">, InGroup; -def warn_mmap_mismatched_top_level_private : Warning< - "top-level module '%0' in private module map, expected a submodule of '%1'">, +def warn_mmap_mismatched_private_submodule : Warning< + "private submodule '%0' in private module map, expected top-level module">, InGroup; -def note_mmap_rename_top_level_private_as_submodule : Note< - "make '%0' a submodule of '%1' to ensure it can be found by name">; +def warn_mmap_mismatched_private_module_name : Warning< + "expected canonical name for private module '%0'">, + InGroup; +def note_mmap_rename_top_level_private_module : Note< + "rename '%0' to ensure it can be found by name">; + def err_mmap_duplicate_header_attribute : Error< "header attribute '%0' specified multiple times">; def err_mmap_invalid_header_attribute_value : Error< Modified: vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td Sun Dec 24 01:00:16 2017 (r327123) +++ vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td Sun Dec 24 01:00:23 2017 (r327124) @@ -3911,6 +3911,9 @@ def err_template_param_different_kind : Error< "%select{|template parameter }0redeclaration">; def note_template_param_different_kind : Note< "template parameter has a different kind in template argument">; + +def err_invalid_decl_specifier_in_nontype_parm : Error< + "invalid declaration specifier in template non-type parameter">; def err_template_nontype_parm_different_type : Error< "template non-type parameter has a different type %0 in template " Modified: vendor/clang/dist/include/clang/Basic/DiagnosticSerializationKinds.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/DiagnosticSerializationKinds.td Sun Dec 24 01:00:16 2017 (r327123) +++ vendor/clang/dist/include/clang/Basic/DiagnosticSerializationKinds.td Sun Dec 24 01:00:23 2017 (r327124) @@ -270,6 +270,29 @@ def note_module_odr_violation_mismatch_decl_diff : Not "friend function %2|" "}1">; +def err_module_odr_violation_function : Error< + "%q0 has different definitions in different modules; " + "%select{definition in module '%2'|defined here}1 " + "first difference is " + "%select{" + "return type is %4|" + "%ordinal4 parameter with name %5|" + "%ordinal4 parameter with type %5%select{| decayed from %7}6|" + "%ordinal4 parameter with%select{out|}5 a default argument|" + "%ordinal4 parameter with a default argument|" + "function body" + "}3">; + +def note_module_odr_violation_function : Note<"but in '%0' found " + "%select{" + "different return type %2|" + "%ordinal2 parameter with name %3|" + "%ordinal2 parameter with type %3%select{| decayed from %5}4|" + "%ordinal2 parameter with%select{out|}3 a default argument|" + "%ordinal2 parameter with a different default argument|" + "a different body" + "}1">; + def err_module_odr_violation_mismatch_decl_unknown : Error< "%q0 %select{with definition in module '%2'|defined here}1 has different " "definitions in different modules; first difference is this " Modified: vendor/clang/dist/include/clang/Basic/arm_neon.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/arm_neon.td Sun Dec 24 01:00:16 2017 (r327123) +++ vendor/clang/dist/include/clang/Basic/arm_neon.td Sun Dec 24 01:00:23 2017 (r327124) @@ -227,6 +227,7 @@ def OP_UNAVAILABLE : Operation { // u: unsigned integer (int/float args) // f: float (int args) // F: double (int args) +// H: half (int args) // d: default // g: default, ignore 'Q' size modifier. // j: default, force 'Q' size modifier. @@ -345,6 +346,7 @@ def OP_MLSLHi : Op<(call "vmlsl", $p0, (call "vget_h (call "vget_high", $p2))>; def OP_MLSLHi_N : Op<(call "vmlsl_n", $p0, (call "vget_high", $p1), $p2)>; def OP_MUL_N : Op<(op "*", $p0, (dup $p1))>; +def OP_MULX_N : Op<(call "vmulx", $p0, (dup $p1))>; def OP_MLA_N : Op<(op "+", $p0, (op "*", $p1, (dup $p2)))>; def OP_MLS_N : Op<(op "-", $p0, (op "*", $p1, (dup $p2)))>; def OP_FMLA_N : Op<(call "vfma", $p0, $p1, (dup $p2))>; @@ -1660,4 +1662,187 @@ def SCALAR_SQRDMLSH_LANEQ : SOpInst<"vqrdmlsh_laneq", def SCALAR_VDUP_LANE : IInst<"vdup_lane", "sdi", "ScSsSiSlSfSdSUcSUsSUiSUlSPcSPs">; def SCALAR_VDUP_LANEQ : IInst<"vdup_laneq", "sji", "ScSsSiSlSfSdSUcSUsSUiSUlSPcSPs">; +} + +// ARMv8.2-A FP16 intrinsics. +let ArchGuard = "defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && defined(__aarch64__)" in { + + // ARMv8.2-A FP16 one-operand vector intrinsics. + + // Comparison + def CMEQH : SInst<"vceqz", "ud", "hQh">; + def CMGEH : SInst<"vcgez", "ud", "hQh">; + def CMGTH : SInst<"vcgtz", "ud", "hQh">; + def CMLEH : SInst<"vclez", "ud", "hQh">; + def CMLTH : SInst<"vcltz", "ud", "hQh">; + + // Vector conversion + def VCVT_F16 : SInst<"vcvt_f16", "Hd", "sUsQsQUs">; + def VCVT_S16 : SInst<"vcvt_s16", "xd", "hQh">; + def VCVT_U16 : SInst<"vcvt_u16", "ud", "hQh">; + def VCVTA_S16 : SInst<"vcvta_s16", "xd", "hQh">; + def VCVTA_U16 : SInst<"vcvta_u16", "ud", "hQh">; + def VCVTM_S16 : SInst<"vcvtm_s16", "xd", "hQh">; + def VCVTM_U16 : SInst<"vcvtm_u16", "ud", "hQh">; + def VCVTN_S16 : SInst<"vcvtn_s16", "xd", "hQh">; + def VCVTN_U16 : SInst<"vcvtn_u16", "ud", "hQh">; + def VCVTP_S16 : SInst<"vcvtp_s16", "xd", "hQh">; + def VCVTP_U16 : SInst<"vcvtp_u16", "ud", "hQh">; + + // Vector rounding + def FRINTZH : SInst<"vrnd", "dd", "hQh">; + def FRINTNH : SInst<"vrndn", "dd", "hQh">; + def FRINTAH : SInst<"vrnda", "dd", "hQh">; + def FRINTPH : SInst<"vrndp", "dd", "hQh">; + def FRINTMH : SInst<"vrndm", "dd", "hQh">; + def FRINTXH : SInst<"vrndx", "dd", "hQh">; + def FRINTIH : SInst<"vrndi", "dd", "hQh">; + + // Misc. + def VABSH : SInst<"vabs", "dd", "hQh">; + def VNEGH : SOpInst<"vneg", "dd", "hQh", OP_NEG>; + def VRECPEH : SInst<"vrecpe", "dd", "hQh">; + def FRSQRTEH : SInst<"vrsqrte", "dd", "hQh">; + def FSQRTH : SInst<"vsqrt", "dd", "hQh">; + + // ARMv8.2-A FP16 two-operands vector intrinsics. + + // Misc. + def VADDH : SOpInst<"vadd", "ddd", "hQh", OP_ADD>; + def VABDH : SInst<"vabd", "ddd", "hQh">; + def VSUBH : SOpInst<"vsub", "ddd", "hQh", OP_SUB>; + + // Comparison + let InstName = "vacge" in { + def VCAGEH : SInst<"vcage", "udd", "hQh">; + def VCALEH : SInst<"vcale", "udd", "hQh">; + } + let InstName = "vacgt" in { + def VCAGTH : SInst<"vcagt", "udd", "hQh">; + def VCALTH : SInst<"vcalt", "udd", "hQh">; + } + def VCEQH : SOpInst<"vceq", "udd", "hQh", OP_EQ>; + def VCGEH : SOpInst<"vcge", "udd", "hQh", OP_GE>; + def VCGTH : SOpInst<"vcgt", "udd", "hQh", OP_GT>; + let InstName = "vcge" in + def VCLEH : SOpInst<"vcle", "udd", "hQh", OP_LE>; + let InstName = "vcgt" in + def VCLTH : SOpInst<"vclt", "udd", "hQh", OP_LT>; + + // Vector conversion + let isVCVT_N = 1 in { + def VCVT_N_F16 : SInst<"vcvt_n_f16", "Hdi", "sUsQsQUs">; + def VCVT_N_S16 : SInst<"vcvt_n_s16", "xdi", "hQh">; + def VCVT_N_U16 : SInst<"vcvt_n_u16", "udi", "hQh">; + } + + // Max/Min + def VMAXH : SInst<"vmax", "ddd", "hQh">; + def VMINH : SInst<"vmin", "ddd", "hQh">; + def FMAXNMH : SInst<"vmaxnm", "ddd", "hQh">; + def FMINNMH : SInst<"vminnm", "ddd", "hQh">; + + // Multiplication/Division + def VMULH : SOpInst<"vmul", "ddd", "hQh", OP_MUL>; + def MULXH : SInst<"vmulx", "ddd", "hQh">; + def FDIVH : IOpInst<"vdiv", "ddd", "hQh", OP_DIV>; + + // Pairwise addition + def VPADDH : SInst<"vpadd", "ddd", "hQh">; + + // Pairwise Max/Min + def VPMAXH : SInst<"vpmax", "ddd", "hQh">; + def VPMINH : SInst<"vpmin", "ddd", "hQh">; + // Pairwise MaxNum/MinNum + def FMAXNMPH : SInst<"vpmaxnm", "ddd", "hQh">; + def FMINNMPH : SInst<"vpminnm", "ddd", "hQh">; + + // Reciprocal/Sqrt + def VRECPSH : SInst<"vrecps", "ddd", "hQh">; + def VRSQRTSH : SInst<"vrsqrts", "ddd", "hQh">; + + // ARMv8.2-A FP16 three-operands vector intrinsics. + + // Vector fused multiply-add operations + def VFMAH : SInst<"vfma", "dddd", "hQh">; + def VFMSH : SOpInst<"vfms", "dddd", "hQh", OP_FMLS>; + + // ARMv8.2-A FP16 lane vector intrinsics. + + // FMA lane + def VFMA_LANEH : IInst<"vfma_lane", "dddgi", "hQh">; + def VFMA_LANEQH : IInst<"vfma_laneq", "dddji", "hQh">; + + // FMA lane with scalar argument + def FMLA_NH : SOpInst<"vfma_n", "ddds", "hQh", OP_FMLA_N>; + // Scalar floating point fused multiply-add (scalar, by element) + def SCALAR_FMLA_LANEH : IInst<"vfma_lane", "sssdi", "Sh">; + def SCALAR_FMLA_LANEQH : IInst<"vfma_laneq", "sssji", "Sh">; + + // FMS lane + def VFMS_LANEH : IOpInst<"vfms_lane", "dddgi", "hQh", OP_FMS_LN>; + def VFMS_LANEQH : IOpInst<"vfms_laneq", "dddji", "hQh", OP_FMS_LNQ>; + // FMS lane with scalar argument + def FMLS_NH : SOpInst<"vfms_n", "ddds", "hQh", OP_FMLS_N>; + // Scalar floating foint fused multiply-subtract (scalar, by element) + def SCALAR_FMLS_LANEH : IOpInst<"vfms_lane", "sssdi", "Sh", OP_FMS_LN>; + def SCALAR_FMLS_LANEQH : IOpInst<"vfms_laneq", "sssji", "Sh", OP_FMS_LNQ>; + + // Mul lane + def VMUL_LANEH : IOpInst<"vmul_lane", "ddgi", "hQh", OP_MUL_LN>; + def VMUL_LANEQH : IOpInst<"vmul_laneq", "ddji", "hQh", OP_MUL_LN>; + def VMUL_NH : IOpInst<"vmul_n", "dds", "hQh", OP_MUL_N>; + // Scalar floating point multiply (scalar, by element) + def SCALAR_FMUL_LANEH : IOpInst<"vmul_lane", "ssdi", "Sh", OP_SCALAR_MUL_LN>; + def SCALAR_FMUL_LANEQH : IOpInst<"vmul_laneq", "ssji", "Sh", OP_SCALAR_MUL_LN>; + + // Mulx lane + def VMULX_LANEH : IOpInst<"vmulx_lane", "ddgi", "hQh", OP_MULX_LN>; + def VMULX_LANEQH : IOpInst<"vmulx_laneq", "ddji", "hQh", OP_MULX_LN>; + def VMULX_NH : IOpInst<"vmulx_n", "dds", "hQh", OP_MULX_N>; + // TODO: Scalar floating point multiply extended (scalar, by element) + // Below ones are commented out because they need vmulx_f16(float16_t, float16_t) + // which will be implemented later with fp16 scalar intrinsic (arm_fp16.h) + //def SCALAR_FMULX_LANEH : IOpInst<"vmulx_lane", "ssdi", "Sh", OP_SCALAR_MUL_LN>; + //def SCALAR_FMULX_LANEQH : IOpInst<"vmulx_laneq", "ssji", "Sh", OP_SCALAR_MUL_LN>; + + // ARMv8.2-A FP16 reduction vector intrinsics. + def VMAXVH : SInst<"vmaxv", "sd", "hQh">; + def VMINVH : SInst<"vminv", "sd", "hQh">; + def FMAXNMVH : SInst<"vmaxnmv", "sd", "hQh">; + def FMINNMVH : SInst<"vminnmv", "sd", "hQh">; + + // Data processing intrinsics - section 5 + + // Logical operations + let isHiddenLInst = 1 in + def VBSLH : SInst<"vbsl", "dudd", "hQh">; + + // Transposition operations + def VZIPH : WInst<"vzip", "2dd", "hQh">; + def VUZPH : WInst<"vuzp", "2dd", "hQh">; + def VTRNH : WInst<"vtrn", "2dd", "hQh">; + + // Set all lanes to same value. + /* Already implemented prior to ARMv8.2-A. + def VMOV_NH : WOpInst<"vmov_n", "ds", "hQh", OP_DUP>; + def VDUP_NH : WOpInst<"vdup_n", "ds", "hQh", OP_DUP>; + def VDUP_LANE1H : WOpInst<"vdup_lane", "dgi", "hQh", OP_DUP_LN>;*/ + + // Vector Extract + def VEXTH : WInst<"vext", "dddi", "hQh">; + + // Reverse vector elements + def VREV64H : WOpInst<"vrev64", "dd", "hQh", OP_REV64>; + + // Permutation + def VTRN1H : SOpInst<"vtrn1", "ddd", "hQh", OP_TRN1>; + def VZIP1H : SOpInst<"vzip1", "ddd", "hQh", OP_ZIP1>; + def VUZP1H : SOpInst<"vuzp1", "ddd", "hQh", OP_UZP1>; + def VTRN2H : SOpInst<"vtrn2", "ddd", "hQh", OP_TRN2>; + def VZIP2H : SOpInst<"vzip2", "ddd", "hQh", OP_ZIP2>; + def VUZP2H : SOpInst<"vuzp2", "ddd", "hQh", OP_UZP2>; + + def SCALAR_VDUP_LANEH : IInst<"vdup_lane", "sdi", "Sh">; + def SCALAR_VDUP_LANEQH : IInst<"vdup_laneq", "sji", "Sh">; } Modified: vendor/clang/dist/include/clang/Frontend/PrecompiledPreamble.h ============================================================================== --- vendor/clang/dist/include/clang/Frontend/PrecompiledPreamble.h Sun Dec 24 01:00:16 2017 (r327123) +++ vendor/clang/dist/include/clang/Frontend/PrecompiledPreamble.h Sun Dec 24 01:00:23 2017 (r327124) @@ -19,6 +19,7 @@ #include "llvm/ADT/IntrusiveRefCntPtr.h" #include "llvm/Support/AlignOf.h" #include "llvm/Support/MD5.h" +#include #include #include #include @@ -89,6 +90,11 @@ class PrecompiledPreamble { (public) /// PreambleBounds used to build the preamble. PreambleBounds getBounds() const; + /// Returns the size, in bytes, that preamble takes on disk or in memory. + /// For on-disk preambles returns 0 if filesystem operations fail. Intended to + /// be used for logging and debugging purposes only. + std::size_t getSize() const; + /// Check whether PrecompiledPreamble can be reused for the new contents(\p /// MainFileBuffer) of the main file. bool CanReuse(const CompilerInvocation &Invocation, @@ -244,6 +250,11 @@ class PreambleCallbacks { public: virtual ~PreambleCallbacks() = default; + /// Called before FrontendAction::BeginSourceFile. + /// Can be used to store references to various CompilerInstance fields + /// (e.g. SourceManager) that may be interesting to the consumers of other + /// callbacks. + virtual void BeforeExecute(CompilerInstance &CI); /// Called after FrontendAction::Execute(), but before /// FrontendAction::EndSourceFile(). Can be used to transfer ownership of /// various CompilerInstance fields before they are destroyed. Modified: vendor/clang/dist/include/clang/Index/IndexSymbol.h ============================================================================== --- vendor/clang/dist/include/clang/Index/IndexSymbol.h Sun Dec 24 01:00:16 2017 (r327123) +++ vendor/clang/dist/include/clang/Index/IndexSymbol.h Sun Dec 24 01:00:23 2017 (r327124) @@ -56,7 +56,7 @@ enum class SymbolKind : uint8_t { Using, }; -enum class SymbolLanguage { +enum class SymbolLanguage : uint8_t { C, ObjC, CXX, @@ -64,7 +64,7 @@ enum class SymbolLanguage { }; /// Language specific sub-kinds. -enum class SymbolSubKind { +enum class SymbolSubKind : uint8_t { None, CXXCopyConstructor, CXXMoveConstructor, @@ -74,8 +74,9 @@ enum class SymbolSubKind { UsingValue, }; +typedef uint8_t SymbolPropertySet; /// Set of properties that provide additional info about a symbol. -enum class SymbolProperty : uint8_t { +enum class SymbolProperty : SymbolPropertySet { Generic = 1 << 0, TemplatePartialSpecialization = 1 << 1, TemplateSpecialization = 1 << 2, @@ -86,7 +87,6 @@ enum class SymbolProperty : uint8_t { Local = 1 << 7, }; static const unsigned SymbolPropertyBitNum = 8; -typedef unsigned SymbolPropertySet; /// Set of roles that are attributed to symbol occurrences. enum class SymbolRole : uint32_t { @@ -127,8 +127,8 @@ struct SymbolRelation { struct SymbolInfo { SymbolKind Kind; SymbolSubKind SubKind; - SymbolPropertySet Properties; SymbolLanguage Lang; + SymbolPropertySet Properties; }; SymbolInfo getSymbolInfo(const Decl *D); Modified: vendor/clang/dist/include/clang/Parse/Parser.h ============================================================================== --- vendor/clang/dist/include/clang/Parse/Parser.h Sun Dec 24 01:00:16 2017 (r327123) +++ vendor/clang/dist/include/clang/Parse/Parser.h Sun Dec 24 01:00:23 2017 (r327124) @@ -2748,10 +2748,10 @@ class Parser : public CodeCompletionHandler { (private bool ParseTemplateParameterList(unsigned Depth, SmallVectorImpl &TemplateParams); bool isStartOfTemplateTypeParameter(); - Decl *ParseTemplateParameter(unsigned Depth, unsigned Position); - Decl *ParseTypeParameter(unsigned Depth, unsigned Position); - Decl *ParseTemplateTemplateParameter(unsigned Depth, unsigned Position); - Decl *ParseNonTypeTemplateParameter(unsigned Depth, unsigned Position); + NamedDecl *ParseTemplateParameter(unsigned Depth, unsigned Position); + NamedDecl *ParseTypeParameter(unsigned Depth, unsigned Position); + NamedDecl *ParseTemplateTemplateParameter(unsigned Depth, unsigned Position); + NamedDecl *ParseNonTypeTemplateParameter(unsigned Depth, unsigned Position); void DiagnoseMisplacedEllipsis(SourceLocation EllipsisLoc, SourceLocation CorrectLoc, bool AlreadyHasEllipsis, Modified: vendor/clang/dist/include/clang/Sema/Sema.h ============================================================================== --- vendor/clang/dist/include/clang/Sema/Sema.h Sun Dec 24 01:00:16 2017 (r327123) +++ vendor/clang/dist/include/clang/Sema/Sema.h Sun Dec 24 01:00:23 2017 (r327124) @@ -6064,7 +6064,7 @@ class Sema { (public) void DiagnoseTemplateParameterShadow(SourceLocation Loc, Decl *PrevDecl); TemplateDecl *AdjustDeclIfTemplate(Decl *&Decl); - Decl *ActOnTypeParameter(Scope *S, bool Typename, + NamedDecl *ActOnTypeParameter(Scope *S, bool Typename, SourceLocation EllipsisLoc, SourceLocation KeyLoc, IdentifierInfo *ParamName, @@ -6077,12 +6077,12 @@ class Sema { (public) SourceLocation Loc); QualType CheckNonTypeTemplateParameterType(QualType T, SourceLocation Loc); - Decl *ActOnNonTypeTemplateParameter(Scope *S, Declarator &D, + NamedDecl *ActOnNonTypeTemplateParameter(Scope *S, Declarator &D, unsigned Depth, unsigned Position, SourceLocation EqualLoc, Expr *DefaultArg); - Decl *ActOnTemplateTemplateParameter(Scope *S, + NamedDecl *ActOnTemplateTemplateParameter(Scope *S, SourceLocation TmpLoc, TemplateParameterList *Params, SourceLocation EllipsisLoc, Modified: vendor/clang/dist/include/clang/Serialization/ASTReader.h ============================================================================== --- vendor/clang/dist/include/clang/Serialization/ASTReader.h Sun Dec 24 01:00:16 2017 (r327123) +++ vendor/clang/dist/include/clang/Serialization/ASTReader.h Sun Dec 24 01:00:23 2017 (r327124) @@ -1092,6 +1092,10 @@ class ASTReader (private) llvm::SmallDenseMap, 2> PendingOdrMergeFailures; + /// \brief Function definitions in which we found an ODR violation. + llvm::SmallDenseMap, 2> + PendingFunctionOdrMergeFailures; + /// \brief DeclContexts in which we have diagnosed an ODR violation. llvm::SmallPtrSet DiagnosedOdrMergeFailures; Modified: vendor/clang/dist/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h ============================================================================== --- vendor/clang/dist/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h Sun Dec 24 01:00:16 2017 (r327123) +++ vendor/clang/dist/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h Sun Dec 24 01:00:23 2017 (r327124) @@ -334,7 +334,7 @@ class PathDiagnosticLocationPair { (public) // Path "pieces" for path-sensitive diagnostics. //===----------------------------------------------------------------------===// -class PathDiagnosticPiece { +class PathDiagnosticPiece: public llvm::FoldingSetNode { public: enum Kind { ControlFlow, Event, Macro, Call, Note }; enum DisplayHint { Above, Below }; Modified: vendor/clang/dist/lib/AST/ASTDumper.cpp ============================================================================== --- vendor/clang/dist/lib/AST/ASTDumper.cpp Sun Dec 24 01:00:16 2017 (r327123) +++ vendor/clang/dist/lib/AST/ASTDumper.cpp Sun Dec 24 01:00:23 2017 (r327124) @@ -99,6 +99,9 @@ namespace { const CommandTraits *Traits; const SourceManager *SM; + /// The policy to use for printing; can be defaulted. + PrintingPolicy PrintPolicy; + /// Pending[i] is an action to dump an entity at level i. llvm::SmallVector, 32> Pending; @@ -207,12 +210,17 @@ namespace { public: ASTDumper(raw_ostream &OS, const CommandTraits *Traits, const SourceManager *SM) - : OS(OS), Traits(Traits), SM(SM), - ShowColors(SM && SM->getDiagnostics().getShowColors()) { } + : ASTDumper(OS, Traits, SM, + SM && SM->getDiagnostics().getShowColors()) {} ASTDumper(raw_ostream &OS, const CommandTraits *Traits, const SourceManager *SM, bool ShowColors) - : OS(OS), Traits(Traits), SM(SM), ShowColors(ShowColors) {} + : ASTDumper(OS, Traits, SM, ShowColors, LangOptions()) {} + ASTDumper(raw_ostream &OS, const CommandTraits *Traits, + const SourceManager *SM, bool ShowColors, + const PrintingPolicy &PrintPolicy) + : OS(OS), Traits(Traits), SM(SM), PrintPolicy(PrintPolicy), + ShowColors(ShowColors) {} void setDeserialize(bool D) { Deserialize = D; } @@ -646,13 +654,13 @@ void ASTDumper::dumpBareType(QualType T, bool Desugar) ColorScope Color(*this, TypeColor); SplitQualType T_split = T.split(); - OS << "'" << QualType::getAsString(T_split) << "'"; + OS << "'" << QualType::getAsString(T_split, PrintPolicy) << "'"; if (Desugar && !T.isNull()) { // If the type is sugared, also dump a (shallow) desugared type. SplitQualType D_split = T.getSplitDesugaredType(); if (T_split != D_split) - OS << ":'" << QualType::getAsString(D_split) << "'"; + OS << ":'" << QualType::getAsString(D_split, PrintPolicy) << "'"; } } @@ -1187,12 +1195,12 @@ void ASTDumper::VisitFunctionDecl(const FunctionDecl * if (const CXXMethodDecl *MD = dyn_cast(D)) { if (MD->size_overridden_methods() != 0) { - auto dumpOverride = - [=](const CXXMethodDecl *D) { - SplitQualType T_split = D->getType().split(); - OS << D << " " << D->getParent()->getName() << "::" - << D->getNameAsString() << " '" << QualType::getAsString(T_split) << "'"; - }; + auto dumpOverride = [=](const CXXMethodDecl *D) { + SplitQualType T_split = D->getType().split(); + OS << D << " " << D->getParent()->getName() + << "::" << D->getNameAsString() << " '" + << QualType::getAsString(T_split, PrintPolicy) << "'"; + }; dumpChild([=] { auto Overrides = MD->overridden_methods(); @@ -1537,7 +1545,7 @@ void ASTDumper::VisitTemplateDeclSpecialization(const case TSK_ExplicitInstantiationDefinition: if (!DumpExplicitInst) break; - // Fall through. + LLVM_FALLTHROUGH; case TSK_Undeclared: case TSK_ImplicitInstantiation: if (DumpRefOnly) @@ -2682,15 +2690,19 @@ LLVM_DUMP_METHOD void Type::dump(llvm::raw_ostream &OS LLVM_DUMP_METHOD void Decl::dump() const { dump(llvm::errs()); } LLVM_DUMP_METHOD void Decl::dump(raw_ostream &OS, bool Deserialize) const { - ASTDumper P(OS, &getASTContext().getCommentCommandTraits(), - &getASTContext().getSourceManager()); + const ASTContext &Ctx = getASTContext(); + const SourceManager &SM = Ctx.getSourceManager(); + ASTDumper P(OS, &Ctx.getCommentCommandTraits(), &SM, + SM.getDiagnostics().getShowColors(), Ctx.getPrintingPolicy()); P.setDeserialize(Deserialize); P.dumpDecl(this); } LLVM_DUMP_METHOD void Decl::dumpColor() const { - ASTDumper P(llvm::errs(), &getASTContext().getCommentCommandTraits(), - &getASTContext().getSourceManager(), /*ShowColors*/true); + const ASTContext &Ctx = getASTContext(); + ASTDumper P(llvm::errs(), &Ctx.getCommentCommandTraits(), + &Ctx.getSourceManager(), /*ShowColors*/ true, + Ctx.getPrintingPolicy()); P.dumpDecl(this); } @@ -2705,7 +2717,9 @@ LLVM_DUMP_METHOD void DeclContext::dumpLookups(raw_ost while (!DC->isTranslationUnit()) DC = DC->getParent(); ASTContext &Ctx = cast(DC)->getASTContext(); - ASTDumper P(OS, &Ctx.getCommentCommandTraits(), &Ctx.getSourceManager()); + const SourceManager &SM = Ctx.getSourceManager(); + ASTDumper P(OS, &Ctx.getCommentCommandTraits(), &Ctx.getSourceManager(), + SM.getDiagnostics().getShowColors(), Ctx.getPrintingPolicy()); P.setDeserialize(Deserialize); P.dumpLookups(this, DumpDecls); } Modified: vendor/clang/dist/lib/AST/ASTImporter.cpp ============================================================================== --- vendor/clang/dist/lib/AST/ASTImporter.cpp Sun Dec 24 01:00:16 2017 (r327123) +++ vendor/clang/dist/lib/AST/ASTImporter.cpp Sun Dec 24 01:00:23 2017 (r327124) @@ -134,17 +134,12 @@ namespace clang { bool ImportTemplateArguments(const TemplateArgument *FromArgs, unsigned NumFromArgs, SmallVectorImpl &ToArgs); - template - bool ImportTemplateArgumentListInfo(const InContainerTy &Container, - TemplateArgumentListInfo &ToTAInfo); bool IsStructuralMatch(RecordDecl *FromRecord, RecordDecl *ToRecord, bool Complain = true); bool IsStructuralMatch(VarDecl *FromVar, VarDecl *ToVar, bool Complain = true); bool IsStructuralMatch(EnumDecl *FromEnum, EnumDecl *ToRecord); bool IsStructuralMatch(EnumConstantDecl *FromEC, EnumConstantDecl *ToEC); - bool IsStructuralMatch(FunctionTemplateDecl *From, - FunctionTemplateDecl *To); bool IsStructuralMatch(ClassTemplateDecl *From, ClassTemplateDecl *To); bool IsStructuralMatch(VarTemplateDecl *From, VarTemplateDecl *To); Decl *VisitDecl(Decl *D); @@ -200,7 +195,6 @@ namespace clang { ClassTemplateSpecializationDecl *D); Decl *VisitVarTemplateDecl(VarTemplateDecl *D); Decl *VisitVarTemplateSpecializationDecl(VarTemplateSpecializationDecl *D); - Decl *VisitFunctionTemplateDecl(FunctionTemplateDecl *D); // Importing statements DeclGroupRef ImportDeclGroup(DeclGroupRef DG); @@ -286,7 +280,6 @@ namespace clang { Expr *VisitCXXDeleteExpr(CXXDeleteExpr *E); Expr *VisitCXXConstructExpr(CXXConstructExpr *E); Expr *VisitCXXMemberCallExpr(CXXMemberCallExpr *E); - Expr *VisitCXXDependentScopeMemberExpr(CXXDependentScopeMemberExpr *E); Expr *VisitExprWithCleanups(ExprWithCleanups *EWC); Expr *VisitCXXThisExpr(CXXThisExpr *E); Expr *VisitCXXBoolLiteralExpr(CXXBoolLiteralExpr *E); @@ -1254,18 +1247,6 @@ bool ASTNodeImporter::ImportTemplateArguments(const Te return false; } -template -bool ASTNodeImporter::ImportTemplateArgumentListInfo( - const InContainerTy &Container, TemplateArgumentListInfo &ToTAInfo) { - for (const auto &FromLoc : Container) { - if (auto ToLoc = ImportTemplateArgumentLoc(FromLoc)) - ToTAInfo.addArgument(*ToLoc); - else - return true; - } - return false; -} - bool ASTNodeImporter::IsStructuralMatch(RecordDecl *FromRecord, RecordDecl *ToRecord, bool Complain) { // Eliminate a potential failure point where we attempt to re-import @@ -1299,14 +1280,6 @@ bool ASTNodeImporter::IsStructuralMatch(EnumDecl *From return Ctx.IsStructurallyEquivalent(FromEnum, ToEnum); } -bool ASTNodeImporter::IsStructuralMatch(FunctionTemplateDecl *From, - FunctionTemplateDecl *To) { - StructuralEquivalenceContext Ctx( - Importer.getFromContext(), Importer.getToContext(), - Importer.getNonEquivalentDecls(), false, false); - return Ctx.IsStructurallyEquivalent(From, To); -} - bool ASTNodeImporter::IsStructuralMatch(EnumConstantDecl *FromEC, EnumConstantDecl *ToEC) { @@ -4224,64 +4197,6 @@ Decl *ASTNodeImporter::VisitVarTemplateSpecializationD return D2; } -Decl *ASTNodeImporter::VisitFunctionTemplateDecl(FunctionTemplateDecl *D) { - DeclContext *DC, *LexicalDC; - DeclarationName Name; - SourceLocation Loc; - NamedDecl *ToD; - - if (ImportDeclParts(D, DC, LexicalDC, Name, ToD, Loc)) - return nullptr; - - if (ToD) - return ToD; - - // Try to find a function in our own ("to") context with the same name, same - // type, and in the same context as the function we're importing. - if (!LexicalDC->isFunctionOrMethod()) { - unsigned IDNS = Decl::IDNS_Ordinary; - SmallVector FoundDecls; - DC->getRedeclContext()->localUncachedLookup(Name, FoundDecls); - for (unsigned I = 0, N = FoundDecls.size(); I != N; ++I) { - if (!FoundDecls[I]->isInIdentifierNamespace(IDNS)) - continue; - - if (FunctionTemplateDecl *FoundFunction = - dyn_cast(FoundDecls[I])) { - if (FoundFunction->hasExternalFormalLinkage() && - D->hasExternalFormalLinkage()) { - if (IsStructuralMatch(D, FoundFunction)) { - Importer.Imported(D, FoundFunction); - // FIXME: Actually try to merge the body and other attributes. - return FoundFunction; - } - } - } - } - } - - TemplateParameterList *Params = - ImportTemplateParameterList(D->getTemplateParameters()); - if (!Params) - return nullptr; - - FunctionDecl *TemplatedFD = - cast_or_null(Importer.Import(D->getTemplatedDecl())); - if (!TemplatedFD) - return nullptr; - - FunctionTemplateDecl *ToFunc = FunctionTemplateDecl::Create( - Importer.getToContext(), DC, Loc, Name, Params, TemplatedFD); - - TemplatedFD->setDescribedFunctionTemplate(ToFunc); - ToFunc->setAccess(D->getAccess()); - ToFunc->setLexicalDeclContext(LexicalDC); - Importer.Imported(D, ToFunc); - - LexicalDC->addDeclInternal(ToFunc); - return ToFunc; -} - //---------------------------------------------------------------------------- // Import Statements //---------------------------------------------------------------------------- @@ -5842,47 +5757,6 @@ Expr *ASTNodeImporter::VisitCXXPseudoDestructorExpr( *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Dec 24 01:00:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D260E88263; Sun, 24 Dec 2017 01:00:34 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 417CD7EB15; Sun, 24 Dec 2017 01:00:31 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBO10Uq3073978; Sun, 24 Dec 2017 01:00:30 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBO10Ugi073977; Sun, 24 Dec 2017 01:00:30 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201712240100.vBO10Ugi073977@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 24 Dec 2017 01:00:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r327125 - vendor/clang/clang-trunk-r321414 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/clang/clang-trunk-r321414 X-SVN-Commit-Revision: 327125 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Dec 2017 01:00:34 -0000 Author: dim Date: Sun Dec 24 01:00:30 2017 New Revision: 327125 URL: https://svnweb.freebsd.org/changeset/base/327125 Log: Tag clang trunk r321414. Added: vendor/clang/clang-trunk-r321414/ - copied from r327124, vendor/clang/dist/ From owner-svn-src-all@freebsd.org Sun Dec 24 01:00:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5B98E882DF; Sun, 24 Dec 2017 01:00:41 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7CDCB7EBF3; Sun, 24 Dec 2017 01:00:41 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBO10eLt074866; Sun, 24 Dec 2017 01:00:40 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBO10ejk074865; Sun, 24 Dec 2017 01:00:40 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201712240100.vBO10ejk074865@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 24 Dec 2017 01:00:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r327127 - vendor/compiler-rt/compiler-rt-trunk-r321414 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/compiler-rt/compiler-rt-trunk-r321414 X-SVN-Commit-Revision: 327127 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Dec 2017 01:00:41 -0000 Author: dim Date: Sun Dec 24 01:00:40 2017 New Revision: 327127 URL: https://svnweb.freebsd.org/changeset/base/327127 Log: Tag compiler-rt trunk r321414. Added: vendor/compiler-rt/compiler-rt-trunk-r321414/ - copied from r327126, vendor/compiler-rt/dist/ From owner-svn-src-all@freebsd.org Sun Dec 24 01:00:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2963E88329; Sun, 24 Dec 2017 01:00:46 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5985E7ECB3; Sun, 24 Dec 2017 01:00:44 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBO10hKF074918; Sun, 24 Dec 2017 01:00:43 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBO10hL2074913; Sun, 24 Dec 2017 01:00:43 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201712240100.vBO10hL2074913@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 24 Dec 2017 01:00:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r327128 - in vendor/libc++/dist: include test/std/input.output/string.streams/stringbuf/stringbuf.virtuals test/std/strings/string.view X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/libc++/dist: include test/std/input.output/string.streams/stringbuf/stringbuf.virtuals test/std/strings/string.view X-SVN-Commit-Revision: 327128 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Dec 2017 01:00:47 -0000 Author: dim Date: Sun Dec 24 01:00:43 2017 New Revision: 327128 URL: https://svnweb.freebsd.org/changeset/base/327128 Log: Vendor import of libc++ trunk r321414: https://llvm.org/svn/llvm-project/libcxx/trunk@321414 Added: vendor/libc++/dist/test/std/strings/string.view/types.pass.cpp (contents, props changed) Modified: vendor/libc++/dist/include/sstream vendor/libc++/dist/include/string_view vendor/libc++/dist/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/seekoff.pass.cpp Modified: vendor/libc++/dist/include/sstream ============================================================================== --- vendor/libc++/dist/include/sstream Sun Dec 24 01:00:40 2017 (r327127) +++ vendor/libc++/dist/include/sstream Sun Dec 24 01:00:43 2017 (r327128) @@ -577,6 +577,7 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::seekoff( if ((__wch & (ios_base::in | ios_base::out)) == (ios_base::in | ios_base::out) && __way == ios_base::cur) return pos_type(-1); + const ptrdiff_t __hm = __hm_ == nullptr ? 0 : __hm_ - __str_.data(); off_type __noff; switch (__way) { @@ -590,13 +591,13 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::seekoff( __noff = this->pptr() - this->pbase(); break; case ios_base::end: - __noff = __hm_ - __str_.data(); + __noff = __hm; break; default: return pos_type(-1); } __noff += __off; - if (__noff < 0 || __hm_ - __str_.data() < __noff) + if (__noff < 0 || __hm < __noff) return pos_type(-1); if (__noff != 0) { Modified: vendor/libc++/dist/include/string_view ============================================================================== --- vendor/libc++/dist/include/string_view Sun Dec 24 01:00:40 2017 (r327127) +++ vendor/libc++/dist/include/string_view Sun Dec 24 01:00:43 2017 (r327128) @@ -196,9 +196,9 @@ class _LIBCPP_TEMPLATE_VIS basic_string_view { (public // types typedef _Traits traits_type; typedef _CharT value_type; - typedef const _CharT* pointer; + typedef _CharT* pointer; typedef const _CharT* const_pointer; - typedef const _CharT& reference; + typedef _CharT& reference; typedef const _CharT& const_reference; typedef const_pointer const_iterator; // See [string.view.iterators] typedef const_iterator iterator; Modified: vendor/libc++/dist/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/seekoff.pass.cpp ============================================================================== --- vendor/libc++/dist/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/seekoff.pass.cpp Sun Dec 24 01:00:40 2017 (r327127) +++ vendor/libc++/dist/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/seekoff.pass.cpp Sun Dec 24 01:00:43 2017 (r327128) @@ -21,6 +21,30 @@ int main() { { + std::stringbuf sb(std::ios_base::in); + assert(sb.pubseekoff(3, std::ios_base::beg, std::ios_base::out) == -1); + assert(sb.pubseekoff(3, std::ios_base::cur, std::ios_base::out) == -1); + assert(sb.pubseekoff(-3, std::ios_base::end, std::ios_base::out) == -1); + assert(sb.pubseekoff(3, std::ios_base::beg, std::ios_base::in | std::ios_base::out) == -1); + assert(sb.pubseekoff(3, std::ios_base::cur, std::ios_base::in | std::ios_base::out) == -1); + assert(sb.pubseekoff(-3, std::ios_base::end, std::ios_base::in | std::ios_base::out) == -1); + assert(sb.pubseekoff(0, std::ios_base::beg, std::ios_base::in) == 0); + assert(sb.pubseekoff(0, std::ios_base::cur, std::ios_base::in) == 0); + assert(sb.pubseekoff(0, std::ios_base::end, std::ios_base::in) == 0); + } + { + std::stringbuf sb(std::ios_base::out); + assert(sb.pubseekoff(3, std::ios_base::beg, std::ios_base::in) == -1); + assert(sb.pubseekoff(3, std::ios_base::cur, std::ios_base::in) == -1); + assert(sb.pubseekoff(-3, std::ios_base::end, std::ios_base::in) == -1); + assert(sb.pubseekoff(3, std::ios_base::beg, std::ios_base::in | std::ios_base::out) == -1); + assert(sb.pubseekoff(3, std::ios_base::cur, std::ios_base::in | std::ios_base::out) == -1); + assert(sb.pubseekoff(-3, std::ios_base::end, std::ios_base::in | std::ios_base::out) == -1); + assert(sb.pubseekoff(0, std::ios_base::beg, std::ios_base::out) == 0); + assert(sb.pubseekoff(0, std::ios_base::cur, std::ios_base::out) == 0); + assert(sb.pubseekoff(0, std::ios_base::end, std::ios_base::out) == 0); + } + { std::stringbuf sb("0123456789", std::ios_base::in); assert(sb.pubseekoff(3, std::ios_base::beg, std::ios_base::out) == -1); assert(sb.pubseekoff(3, std::ios_base::cur, std::ios_base::out) == -1); Added: vendor/libc++/dist/test/std/strings/string.view/types.pass.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libc++/dist/test/std/strings/string.view/types.pass.cpp Sun Dec 24 01:00:43 2017 (r327128) @@ -0,0 +1,77 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// Test nested types and default template args: + +// template> +// { +// public: +// // types: +// using traits_type = traits; +// using value_type = charT; +// using pointer = value_type*; +// using const_pointer = const value_type*; +// using reference = value_type&; +// using const_reference = const value_type&; +// using const_iterator = implementation-defined ; // see 24.4.2.2 +// using iterator = const_iterator; +// using const_reverse_iterator = reverse_iterator; +// using iterator = const_reverse_iterator; +// using size_type = size_t; +// using difference_type = ptrdiff_t; +// static constexpr size_type npos = size_type(-1); +// +// }; + +#include +#include +#include + +#include "test_macros.h" + +template +void +test() +{ + typedef std::basic_string_view S; + + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same< + typename std::iterator_traits::iterator_category, + std::random_access_iterator_tag>::value), ""); + static_assert((std::is_same< + typename std::iterator_traits::iterator_category, + std::random_access_iterator_tag>::value), ""); + static_assert((std::is_same< + typename S::reverse_iterator, + std::reverse_iterator >::value), ""); + static_assert((std::is_same< + typename S::const_reverse_iterator, + std::reverse_iterator >::value), ""); + static_assert(S::npos == -1, ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); +} + +int main() +{ + test >(); + test >(); + static_assert((std::is_same::traits_type, + std::char_traits >::value), ""); +} From owner-svn-src-all@freebsd.org Sun Dec 24 01:00:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0CF2E88376; Sun, 24 Dec 2017 01:00:53 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E2707EDF7; Sun, 24 Dec 2017 01:00:53 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBO10qp5075024; Sun, 24 Dec 2017 01:00:52 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBO10p67075012; Sun, 24 Dec 2017 01:00:51 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201712240100.vBO10p67075012@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 24 Dec 2017 01:00:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r327130 - in vendor/lld/dist: . COFF ELF ELF/Arch test/COFF test/ELF test/ELF/Inputs test/ELF/linkerscript test/wasm test/wasm/Inputs wasm X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/lld/dist: . COFF ELF ELF/Arch test/COFF test/ELF test/ELF/Inputs test/ELF/linkerscript test/wasm test/wasm/Inputs wasm X-SVN-Commit-Revision: 327130 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Dec 2017 01:00:54 -0000 Author: dim Date: Sun Dec 24 01:00:50 2017 New Revision: 327130 URL: https://svnweb.freebsd.org/changeset/base/327130 Log: Vendor import of lld trunk r321414: https://llvm.org/svn/llvm-project/lld/trunk@321414 Added: vendor/lld/dist/test/ELF/Inputs/znotext-plt-relocations.s (contents, props changed) vendor/lld/dist/test/ELF/arm-exidx-dedup-and-sentinel.s (contents, props changed) vendor/lld/dist/test/ELF/i386-tls-initial-exec-local.s (contents, props changed) vendor/lld/dist/test/ELF/znotext-plt-relocations.s (contents, props changed) vendor/lld/dist/test/wasm/Inputs/global-ctor-dtor.ll vendor/lld/dist/test/wasm/init-fini.ll Modified: vendor/lld/dist/COFF/DLL.cpp vendor/lld/dist/ELF/AArch64ErrataFix.cpp vendor/lld/dist/ELF/Arch/ARM.cpp vendor/lld/dist/ELF/Driver.cpp vendor/lld/dist/ELF/InputFiles.cpp vendor/lld/dist/ELF/InputFiles.h vendor/lld/dist/ELF/InputSection.cpp vendor/lld/dist/ELF/InputSection.h vendor/lld/dist/ELF/MarkLive.cpp vendor/lld/dist/ELF/Relocations.cpp vendor/lld/dist/ELF/ScriptParser.cpp vendor/lld/dist/ELF/SymbolTable.cpp vendor/lld/dist/ELF/SymbolTable.h vendor/lld/dist/ELF/Symbols.cpp vendor/lld/dist/ELF/Symbols.h vendor/lld/dist/ELF/SyntheticSections.cpp vendor/lld/dist/ELF/SyntheticSections.h vendor/lld/dist/ELF/Target.cpp vendor/lld/dist/ELF/Target.h vendor/lld/dist/ELF/Thunks.cpp vendor/lld/dist/ELF/Writer.cpp vendor/lld/dist/ELF/Writer.h vendor/lld/dist/README.md vendor/lld/dist/test/COFF/export-armnt.yaml vendor/lld/dist/test/COFF/lto.ll vendor/lld/dist/test/ELF/i386-got-value.s vendor/lld/dist/test/ELF/linkerscript/arm-exidx-sentinel-and-assignment.s vendor/lld/dist/test/ELF/linkerscript/operators.s vendor/lld/dist/test/wasm/Inputs/weak-alias.ll vendor/lld/dist/test/wasm/Inputs/weak-symbol1.ll vendor/lld/dist/test/wasm/Inputs/weak-symbol2.ll vendor/lld/dist/test/wasm/archive.ll vendor/lld/dist/test/wasm/call-indirect.ll vendor/lld/dist/test/wasm/conflict.test vendor/lld/dist/test/wasm/data-layout.ll vendor/lld/dist/test/wasm/entry.ll vendor/lld/dist/test/wasm/function-imports-first.ll vendor/lld/dist/test/wasm/function-imports.ll vendor/lld/dist/test/wasm/function-index.test vendor/lld/dist/test/wasm/import-memory.test vendor/lld/dist/test/wasm/invalid-stack-size.test vendor/lld/dist/test/wasm/local-symbols.ll vendor/lld/dist/test/wasm/many-functions.ll vendor/lld/dist/test/wasm/relocatable.ll vendor/lld/dist/test/wasm/signature-mismatch.ll vendor/lld/dist/test/wasm/stack-pointer.ll vendor/lld/dist/test/wasm/strip-debug.test vendor/lld/dist/test/wasm/symbol-type-mismatch.ll vendor/lld/dist/test/wasm/undefined-entry.test vendor/lld/dist/test/wasm/undefined.ll vendor/lld/dist/test/wasm/version.ll vendor/lld/dist/test/wasm/weak-alias-overide.ll vendor/lld/dist/test/wasm/weak-alias.ll vendor/lld/dist/test/wasm/weak-external.ll vendor/lld/dist/test/wasm/weak-symbols.ll vendor/lld/dist/wasm/InputFiles.cpp vendor/lld/dist/wasm/InputSegment.h vendor/lld/dist/wasm/OutputSections.cpp vendor/lld/dist/wasm/OutputSections.h vendor/lld/dist/wasm/OutputSegment.h vendor/lld/dist/wasm/SymbolTable.cpp vendor/lld/dist/wasm/SymbolTable.h vendor/lld/dist/wasm/Writer.cpp Modified: vendor/lld/dist/COFF/DLL.cpp ============================================================================== --- vendor/lld/dist/COFF/DLL.cpp Sun Dec 24 01:00:48 2017 (r327129) +++ vendor/lld/dist/COFF/DLL.cpp Sun Dec 24 01:00:50 2017 (r327130) @@ -362,12 +362,12 @@ class AddressTableChunk : public Chunk { (public) size_t getSize() const override { return Size * 4; } void writeTo(uint8_t *Buf) const override { - uint32_t Bit = 0; - // Pointer to thumb code must have the LSB set, so adjust it. - if (Config->Machine == ARMNT) - Bit = 1; - for (Export &E : Config->Exports) { + for (const Export &E : Config->Exports) { uint8_t *P = Buf + OutputSectionOff + E.Ordinal * 4; + uint32_t Bit = 0; + // Pointer to thumb code must have the LSB set, so adjust it. + if (Config->Machine == ARMNT && !E.Data) + Bit = 1; if (E.ForwardChunk) { write32le(P, E.ForwardChunk->getRVA() | Bit); } else { Modified: vendor/lld/dist/ELF/AArch64ErrataFix.cpp ============================================================================== --- vendor/lld/dist/ELF/AArch64ErrataFix.cpp Sun Dec 24 01:00:48 2017 (r327129) +++ vendor/lld/dist/ELF/AArch64ErrataFix.cpp Sun Dec 24 01:00:50 2017 (r327130) @@ -400,8 +400,8 @@ lld::elf::Patch843419Section::Patch843419Section(Input this->Parent = P->getParent(); PatchSym = addSyntheticLocal( Saver.save("__CortexA53843419_" + utohexstr(getLDSTAddr())), STT_FUNC, 0, - getSize(), this); - addSyntheticLocal(Saver.save("$x"), STT_NOTYPE, 0, 0, this); + getSize(), *this); + addSyntheticLocal(Saver.save("$x"), STT_NOTYPE, 0, 0, *this); } uint64_t lld::elf::Patch843419Section::getLDSTAddr() const { Modified: vendor/lld/dist/ELF/Arch/ARM.cpp ============================================================================== --- vendor/lld/dist/ELF/Arch/ARM.cpp Sun Dec 24 01:00:48 2017 (r327129) +++ vendor/lld/dist/ELF/Arch/ARM.cpp Sun Dec 24 01:00:50 2017 (r327130) @@ -37,8 +37,8 @@ class ARM final : public TargetInfo { (public) void writePltHeader(uint8_t *Buf) const override; void writePlt(uint8_t *Buf, uint64_t GotPltEntryAddr, uint64_t PltEntryAddr, int32_t Index, unsigned RelOff) const override; - void addPltSymbols(InputSectionBase *IS, uint64_t Off) const override; - void addPltHeaderSymbols(InputSectionBase *ISD) const override; + void addPltSymbols(InputSection &IS, uint64_t Off) const override; + void addPltHeaderSymbols(InputSection &ISD) const override; bool needsThunk(RelExpr Expr, RelType Type, const InputFile *File, uint64_t BranchAddr, const Symbol &S) const override; bool inBranchRange(RelType Type, uint64_t Src, uint64_t Dst) const override; @@ -184,7 +184,7 @@ void ARM::writeIgotPlt(uint8_t *Buf, const Symbol &S) write32le(Buf, S.getVA()); } -// Long form PLT Heade that does not have any restrictions on the displacement +// Long form PLT Header that does not have any restrictions on the displacement // of the .plt from the .plt.got. static void writePltHeaderLong(uint8_t *Buf) { const uint8_t PltData[] = { @@ -232,8 +232,7 @@ void ARM::writePltHeader(uint8_t *Buf) const { write32le(Buf + 28, TrapInstr); } -void ARM::addPltHeaderSymbols(InputSectionBase *ISD) const { - auto *IS = cast(ISD); +void ARM::addPltHeaderSymbols(InputSection &IS) const { addSyntheticLocal("$a", STT_NOTYPE, 0, 0, IS); addSyntheticLocal("$d", STT_NOTYPE, 16, 0, IS); } @@ -282,8 +281,7 @@ void ARM::writePlt(uint8_t *Buf, uint64_t GotPltEntryA write32le(Buf + 12, TrapInstr); // Pad to 16-byte boundary } -void ARM::addPltSymbols(InputSectionBase *ISD, uint64_t Off) const { - auto *IS = cast(ISD); +void ARM::addPltSymbols(InputSection &IS, uint64_t Off) const { addSyntheticLocal("$a", STT_NOTYPE, Off, 0, IS); addSyntheticLocal("$d", STT_NOTYPE, Off + 12, 0, IS); } Modified: vendor/lld/dist/ELF/Driver.cpp ============================================================================== --- vendor/lld/dist/ELF/Driver.cpp Sun Dec 24 01:00:48 2017 (r327129) +++ vendor/lld/dist/ELF/Driver.cpp Sun Dec 24 01:00:50 2017 (r327130) @@ -1056,7 +1056,7 @@ template void LinkerDriver::link(opt::Inp // We need to create some reserved symbols such as _end. Create them. if (!Config->Relocatable) - addReservedSymbols(); + addReservedSymbols(); // Apply version scripts. Symtab->scanVersionScript(); @@ -1111,7 +1111,7 @@ template void LinkerDriver::link(opt::Inp // before decompressAndMergeSections because the .comment section is a // mergeable section. if (!Config->Relocatable) - InputSections.push_back(createCommentSection()); + InputSections.push_back(createCommentSection()); // Do size optimizations: garbage collection, merging of SHF_MERGE sections // and identical code folding. Modified: vendor/lld/dist/ELF/InputFiles.cpp ============================================================================== --- vendor/lld/dist/ELF/InputFiles.cpp Sun Dec 24 01:00:48 2017 (r327129) +++ vendor/lld/dist/ELF/InputFiles.cpp Sun Dec 24 01:00:50 2017 (r327130) @@ -32,6 +32,7 @@ using namespace llvm; using namespace llvm::ELF; using namespace llvm::object; +using namespace llvm::sys; using namespace llvm::sys::fs; using namespace lld; @@ -69,6 +70,50 @@ Optional elf::readFile(StringRef Path return MBRef; } +// Concatenates arguments to construct a string representing an error location. +static std::string createFileLineMsg(StringRef Path, unsigned Line) { + std::string Filename = path::filename(Path); + std::string Lineno = ":" + std::to_string(Line); + if (Filename == Path) + return Filename + Lineno; + return Filename + Lineno + " (" + Path.str() + Lineno + ")"; +} + +template +static std::string getSrcMsgAux(ObjFile &File, const Symbol &Sym, + InputSectionBase &Sec, uint64_t Offset) { + // In DWARF, functions and variables are stored to different places. + // First, lookup a function for a given offset. + if (Optional Info = File.getDILineInfo(&Sec, Offset)) + return createFileLineMsg(Info->FileName, Info->Line); + + // If it failed, lookup again as a variable. + if (Optional> FileLine = + File.getVariableLoc(Sym.getName())) + return createFileLineMsg(FileLine->first, FileLine->second); + + // File.SourceFile contains STT_FILE symbol, and that is a last resort. + return File.SourceFile; +} + +std::string InputFile::getSrcMsg(const Symbol &Sym, InputSectionBase &Sec, + uint64_t Offset) { + if (kind() != ObjKind) + return ""; + switch (Config->EKind) { + default: + llvm_unreachable("Invalid kind"); + case ELF32LEKind: + return getSrcMsgAux(cast>(*this), Sym, Sec, Offset); + case ELF32BEKind: + return getSrcMsgAux(cast>(*this), Sym, Sec, Offset); + case ELF64LEKind: + return getSrcMsgAux(cast>(*this), Sym, Sec, Offset); + case ELF64BEKind: + return getSrcMsgAux(cast>(*this), Sym, Sec, Offset); + } +} + template void ObjFile::initializeDwarf() { DWARFContext Dwarf(make_unique>(this)); const DWARFObject &Obj = Dwarf.getDWARFObj(); @@ -384,8 +429,8 @@ void ObjFile::initializeSections( // have a SHF_LINK_ORDER dependency, this is identified by the sh_link. if (Sec.sh_flags & SHF_LINK_ORDER) { if (Sec.sh_link >= this->Sections.size()) - fatal(toString(this) + ": invalid sh_link index: " + - Twine(Sec.sh_link)); + fatal(toString(this) + + ": invalid sh_link index: " + Twine(Sec.sh_link)); this->Sections[Sec.sh_link]->DependentSections.push_back( cast(this->Sections[I])); } @@ -454,11 +499,9 @@ InputSectionBase *ObjFile::getRelocTarget(const // Create a regular InputSection class that has the same contents // as a given section. -InputSectionBase *toRegularSection(MergeInputSection *Sec) { - auto *Ret = make(Sec->Flags, Sec->Type, Sec->Alignment, - Sec->Data, Sec->Name); - Ret->File = Sec->File; - return Ret; +static InputSection *toRegularSection(MergeInputSection *Sec) { + return make(Sec->File, Sec->Flags, Sec->Type, Sec->Alignment, + Sec->Data, Sec->Name); } template @@ -471,13 +514,13 @@ InputSectionBase *ObjFile::createInputSection(co break; ARMAttributeParser Attributes; ArrayRef Contents = check(this->getObj().getSectionContents(&Sec)); - Attributes.Parse(Contents, /*isLittle*/Config->EKind == ELF32LEKind); + Attributes.Parse(Contents, /*isLittle*/ Config->EKind == ELF32LEKind); updateSupportedARMFeatures(Attributes); // FIXME: Retain the first attribute section we see. The eglibc ARM // dynamic loaders require the presence of an attribute section for dlopen // to work. In a full implementation we would merge all attribute sections. if (InX::ARMAttributes == nullptr) { - InX::ARMAttributes = make(this, &Sec, Name); + InX::ARMAttributes = make(*this, Sec, Name); return InX::ARMAttributes; } return &InputSection::Discarded; @@ -496,7 +539,7 @@ InputSectionBase *ObjFile::createInputSection(co // If -r is given, we do not interpret or apply relocation // but just copy relocation sections to output. if (Config->Relocatable) - return make(this, &Sec, Name); + return make(*this, Sec, Name); if (Target->FirstRelocation) fatal(toString(this) + @@ -534,7 +577,7 @@ InputSectionBase *ObjFile::createInputSection(co // However, if -emit-relocs is given, we need to leave them in the output. // (Some post link analysis tools need this information.) if (Config->EmitRelocs) { - InputSection *RelocSec = make(this, &Sec, Name); + InputSection *RelocSec = make(*this, Sec, Name); // We will not emit relocation section if target was discarded. Target->DependentSections.push_back(RelocSec); return RelocSec; @@ -581,11 +624,11 @@ InputSectionBase *ObjFile::createInputSection(co // .eh_frame_hdr section for runtime. So we handle them with a special // class. For relocatable outputs, they are just passed through. if (Name == ".eh_frame" && !Config->Relocatable) - return make(this, &Sec, Name); + return make(*this, Sec, Name); if (shouldMerge(Sec)) - return make(this, &Sec, Name); - return make(this, &Sec, Name); + return make(*this, Sec, Name); + return make(*this, Sec, Name); } template @@ -636,7 +679,7 @@ template Symbol *ObjFile::createSym if (Value == 0 || Value >= UINT32_MAX) fatal(toString(this) + ": common symbol '" + Name + "' has invalid alignment: " + Twine(Value)); - return Symtab->addCommon(Name, Size, Value, Binding, StOther, Type, this); + return Symtab->addCommon(Name, Size, Value, Binding, StOther, Type, *this); } switch (Binding) { @@ -648,8 +691,8 @@ template Symbol *ObjFile::createSym if (Sec == &InputSection::Discarded) return Symtab->addUndefined(Name, Binding, StOther, Type, /*CanOmitFromDynSym=*/false, this); - return Symtab->addRegular(Name, StOther, Type, Value, Size, Binding, - Sec, this); + return Symtab->addRegular(Name, StOther, Type, Value, Size, Binding, Sec, + this); } } @@ -660,7 +703,7 @@ ArchiveFile::ArchiveFile(std::unique_ptr &&Fi template void ArchiveFile::parse() { Symbols.reserve(File->getNumberOfSymbols()); for (const Archive::Symbol &Sym : File->symbols()) - Symbols.push_back(Symtab->addLazyArchive(Sym.getName(), this, Sym)); + Symbols.push_back(Symtab->addLazyArchive(Sym.getName(), *this, Sym)); } // Returns a buffer pointing to a member file containing a given symbol. @@ -841,14 +884,14 @@ template void SharedFile::parseRest error(toString(this) + ": alignment too large: " + Name); if (!Hidden) - Symtab->addShared(Name, this, Sym, Alignment, VersymIndex); + Symtab->addShared(Name, *this, Sym, Alignment, VersymIndex); // Also add the symbol with the versioned name to handle undefined symbols // with explicit versions. if (Ver) { StringRef VerName = this->StringTable.data() + Ver->getAux()->vda_name; Name = Saver.save(Name + "@" + VerName); - Symtab->addShared(Name, this, Sym, Alignment, VersymIndex); + Symtab->addShared(Name, *this, Sym, Alignment, VersymIndex); } } } @@ -925,7 +968,7 @@ static uint8_t mapVisibility(GlobalValue::VisibilityTy template static Symbol *createBitcodeSymbol(const std::vector &KeptComdats, const lto::InputFile::Symbol &ObjSym, - BitcodeFile *F) { + BitcodeFile &F) { StringRef NameRef = Saver.save(ObjSym.getName()); uint32_t Binding = ObjSym.isWeak() ? STB_WEAK : STB_GLOBAL; @@ -936,11 +979,11 @@ static Symbol *createBitcodeSymbol(const std::vectoraddUndefined(NameRef, Binding, Visibility, Type, - CanOmitFromDynSym, F); + CanOmitFromDynSym, &F); if (ObjSym.isUndefined()) return Symtab->addUndefined(NameRef, Binding, Visibility, Type, - CanOmitFromDynSym, F); + CanOmitFromDynSym, &F); if (ObjSym.isCommon()) return Symtab->addCommon(NameRef, ObjSym.getCommonSize(), @@ -958,7 +1001,7 @@ void BitcodeFile::parse(DenseSet KeptComdats.push_back(ComdatGroups.insert(CachedHashStringRef(S)).second); for (const lto::InputFile::Symbol &ObjSym : Obj->symbols()) - Symbols.push_back(createBitcodeSymbol(KeptComdats, ObjSym, this)); + Symbols.push_back(createBitcodeSymbol(KeptComdats, ObjSym, *this)); } static ELFKind getELFKind(MemoryBufferRef MB) { @@ -981,10 +1024,10 @@ static ELFKind getELFKind(MemoryBufferRef MB) { return (Endian == ELFDATA2LSB) ? ELF64LEKind : ELF64BEKind; } -template void BinaryFile::parse() { +void BinaryFile::parse() { ArrayRef Data = toArrayRef(MB.getBuffer()); - auto *Section = - make(SHF_ALLOC | SHF_WRITE, SHT_PROGBITS, 8, Data, ".data"); + auto *Section = make(nullptr, SHF_ALLOC | SHF_WRITE, + SHT_PROGBITS, 8, Data, ".data"); Sections.push_back(Section); // For each input file foo that is embedded to a result as a binary @@ -996,12 +1039,12 @@ template void BinaryFile::parse() { if (!isAlnum(S[I])) S[I] = '_'; - Symtab->addRegular(Saver.save(S + "_start"), STV_DEFAULT, STT_OBJECT, - 0, 0, STB_GLOBAL, Section, nullptr); - Symtab->addRegular(Saver.save(S + "_end"), STV_DEFAULT, STT_OBJECT, - Data.size(), 0, STB_GLOBAL, Section, nullptr); - Symtab->addRegular(Saver.save(S + "_size"), STV_DEFAULT, STT_OBJECT, - Data.size(), 0, STB_GLOBAL, nullptr, nullptr); + Symtab->addRegular(Saver.save(S + "_start"), STV_DEFAULT, STT_OBJECT, 0, 0, + STB_GLOBAL, Section, nullptr); + Symtab->addRegular(Saver.save(S + "_end"), STV_DEFAULT, STT_OBJECT, + Data.size(), 0, STB_GLOBAL, Section, nullptr); + Symtab->addRegular(Saver.save(S + "_size"), STV_DEFAULT, STT_OBJECT, + Data.size(), 0, STB_GLOBAL, nullptr, nullptr); } static bool isBitcode(MemoryBufferRef MB) { @@ -1145,8 +1188,3 @@ template class elf::SharedFile; template class elf::SharedFile; template class elf::SharedFile; template class elf::SharedFile; - -template void BinaryFile::parse(); -template void BinaryFile::parse(); -template void BinaryFile::parse(); -template void BinaryFile::parse(); Modified: vendor/lld/dist/ELF/InputFiles.h ============================================================================== --- vendor/lld/dist/ELF/InputFiles.h Sun Dec 24 01:00:48 2017 (r327129) +++ vendor/lld/dist/ELF/InputFiles.h Sun Dec 24 01:00:50 2017 (r327130) @@ -72,6 +72,11 @@ class InputFile { (public) Kind kind() const { return FileKind; } + bool isElf() const { + Kind K = kind(); + return K == ObjKind || K == SharedKind; + } + StringRef getName() const { return MB.getBufferIdentifier(); } MemoryBufferRef MB; @@ -104,6 +109,9 @@ class InputFile { (public) // Cache for toString(). Only toString() should use this member. mutable std::string ToStringCache; + std::string getSrcMsg(const Symbol &Sym, InputSectionBase &Sec, + uint64_t Offset); + protected: InputFile(Kind K, MemoryBufferRef M); std::vector Sections; @@ -121,10 +129,7 @@ template class ELFFileBase : public In typedef typename ELFT::SymRange Elf_Sym_Range; ELFFileBase(Kind K, MemoryBufferRef M); - static bool classof(const InputFile *F) { - Kind K = F->kind(); - return K == ObjKind || K == SharedKind; - } + static bool classof(const InputFile *F) { return F->isElf(); } llvm::object::ELFFile getObj() const { return check(llvm::object::ELFFile::create(MB.getBuffer())); @@ -325,7 +330,7 @@ class BinaryFile : public InputFile { public: explicit BinaryFile(MemoryBufferRef M) : InputFile(BinaryKind, M) {} static bool classof(const InputFile *F) { return F->kind() == BinaryKind; } - template void parse(); + void parse(); }; InputFile *createObjectFile(MemoryBufferRef MB, StringRef ArchiveName = "", Modified: vendor/lld/dist/ELF/InputSection.cpp ============================================================================== --- vendor/lld/dist/ELF/InputSection.cpp Sun Dec 24 01:00:48 2017 (r327129) +++ vendor/lld/dist/ELF/InputSection.cpp Sun Dec 24 01:00:50 2017 (r327130) @@ -24,7 +24,6 @@ #include "llvm/Support/Compiler.h" #include "llvm/Support/Compression.h" #include "llvm/Support/Endian.h" -#include "llvm/Support/Path.h" #include "llvm/Support/Threading.h" #include "llvm/Support/xxhash.h" #include @@ -73,11 +72,11 @@ DenseMap elf::buildSectionOrder() } template -static ArrayRef getSectionContents(ObjFile *File, - const typename ELFT::Shdr *Hdr) { - if (!File || Hdr->sh_type == SHT_NOBITS) - return makeArrayRef(nullptr, Hdr->sh_size); - return check(File->getObj().getSectionContents(Hdr)); +static ArrayRef getSectionContents(ObjFile &File, + const typename ELFT::Shdr &Hdr) { + if (Hdr.sh_type == SHT_NOBITS) + return makeArrayRef(nullptr, Hdr.sh_size); + return check(File.getObj().getSectionContents(&Hdr)); } InputSectionBase::InputSectionBase(InputFile *File, uint64_t Flags, @@ -88,6 +87,12 @@ InputSectionBase::InputSectionBase(InputFile *File, ui : SectionBase(SectionKind, Name, Flags, Entsize, Alignment, Type, Info, Link), File(File), Data(Data) { + // In order to reduce memory allocation, we assume that mergeable + // sections are smaller than 4 GiB, which is not an unreasonable + // assumption as of 2017. + if (SectionKind == SectionBase::Merge && Data.size() > UINT32_MAX) + error(toString(this) + ": section too large"); + NumRelocations = 0; AreRelocsRela = false; @@ -128,18 +133,18 @@ static uint64_t getType(uint64_t Type, StringRef Name) } template -InputSectionBase::InputSectionBase(ObjFile *File, - const typename ELFT::Shdr *Hdr, +InputSectionBase::InputSectionBase(ObjFile &File, + const typename ELFT::Shdr &Hdr, StringRef Name, Kind SectionKind) - : InputSectionBase(File, getFlags(Hdr->sh_flags), - getType(Hdr->sh_type, Name), Hdr->sh_entsize, - Hdr->sh_link, Hdr->sh_info, Hdr->sh_addralign, + : InputSectionBase(&File, getFlags(Hdr.sh_flags), + getType(Hdr.sh_type, Name), Hdr.sh_entsize, Hdr.sh_link, + Hdr.sh_info, Hdr.sh_addralign, getSectionContents(File, Hdr), Name, SectionKind) { // We reject object files having insanely large alignments even though // they are allowed by the spec. I think 4GB is a reasonable limitation. // We might want to relax this in the future. - if (Hdr->sh_addralign > UINT32_MAX) - fatal(toString(File) + ": section sh_addralign is too large"); + if (Hdr.sh_addralign > UINT32_MAX) + fatal(toString(&File) + ": section sh_addralign is too large"); } size_t InputSectionBase::getSize() const { @@ -211,8 +216,8 @@ void InputSectionBase::maybeUncompress() { fatal(toString(this) + ": decompress failed: " + llvm::toString(std::move(E))); - this->Data = makeArrayRef((uint8_t *)UncompressBuf.get(), Size); - this->Flags &= ~(uint64_t)SHF_COMPRESSED; + Data = makeArrayRef((uint8_t *)UncompressBuf.get(), Size); + Flags &= ~(uint64_t)SHF_COMPRESSED; } InputSection *InputSectionBase::getLinkOrderDep() const { @@ -257,40 +262,17 @@ std::string InputSectionBase::getLocation(uint64_t Off return (SrcFile + ":(" + Name + "+0x" + utohexstr(Offset) + ")").str(); } -// Concatenates arguments to construct a string representing an error location. -static std::string createFileLineMsg(StringRef Path, unsigned Line) { - std::string Filename = path::filename(Path); - std::string Lineno = ":" + std::to_string(Line); - if (Filename == Path) - return Filename + Lineno; - return Filename + Lineno + " (" + Path.str() + Lineno + ")"; -} - // This function is intended to be used for constructing an error message. // The returned message looks like this: // // foo.c:42 (/home/alice/possibly/very/long/path/foo.c:42) // // Returns an empty string if there's no way to get line info. -template std::string InputSectionBase::getSrcMsg(const Symbol &Sym, uint64_t Offset) { // Synthetic sections don't have input files. - ObjFile *File = getFile(); if (!File) return ""; - - // In DWARF, functions and variables are stored to different places. - // First, lookup a function for a given offset. - if (Optional Info = File->getDILineInfo(this, Offset)) - return createFileLineMsg(Info->FileName, Info->Line); - - // If it failed, lookup again as a variable. - if (Optional> FileLine = - File->getVariableLoc(Sym.getName())) - return createFileLineMsg(FileLine->first, FileLine->second); - - // File->SourceFile contains STT_FILE symbol, and that is a last resort. - return File->SourceFile; + return File->getSrcMsg(Sym, *this, Offset); } // Returns a filename string along with an optional section name. This @@ -323,16 +305,17 @@ std::string InputSectionBase::getObjMsg(uint64_t Off) .str(); } -InputSection InputSection::Discarded(0, 0, 0, ArrayRef(), ""); +InputSection InputSection::Discarded(nullptr, 0, 0, 0, ArrayRef(), ""); -InputSection::InputSection(uint64_t Flags, uint32_t Type, uint32_t Alignment, - ArrayRef Data, StringRef Name, Kind K) - : InputSectionBase(nullptr, Flags, Type, +InputSection::InputSection(InputFile *F, uint64_t Flags, uint32_t Type, + uint32_t Alignment, ArrayRef Data, + StringRef Name, Kind K) + : InputSectionBase(F, Flags, Type, /*Entsize*/ 0, /*Link*/ 0, /*Info*/ 0, Alignment, Data, Name, K) {} template -InputSection::InputSection(ObjFile *F, const typename ELFT::Shdr *Header, +InputSection::InputSection(ObjFile &F, const typename ELFT::Shdr &Header, StringRef Name) : InputSectionBase(F, Header, Name, InputSectionBase::Regular) {} @@ -357,15 +340,15 @@ template void InputSection::copyShtGroup( // Adjust section numbers because section numbers in an input object // files are different in the output. - ArrayRef Sections = this->File->getSections(); + ArrayRef Sections = File->getSections(); for (uint32_t Idx : From.slice(1)) *To++ = Sections[Idx]->getOutputSection()->SectionIndex; } InputSectionBase *InputSection::getRelocatedSection() { - assert(this->Type == SHT_RELA || this->Type == SHT_REL); - ArrayRef Sections = this->File->getSections(); - return Sections[this->Info]; + assert(Type == SHT_RELA || Type == SHT_REL); + ArrayRef Sections = File->getSections(); + return Sections[Info]; } // This is used for -r and --emit-relocs. We can't use memcpy to copy @@ -377,7 +360,7 @@ void InputSection::copyRelocations(uint8_t *Buf, Array for (const RelTy &Rel : Rels) { RelType Type = Rel.getType(Config->IsMips64EL); - Symbol &Sym = this->getFile()->getRelocTargetSym(Rel); + Symbol &Sym = getFile()->getRelocTargetSym(Rel); auto *P = reinterpret_cast(Buf); Buf += sizeof(RelTy); @@ -679,7 +662,7 @@ void InputSection::relocateNonAlloc(uint8_t *Buf, Arra if (!RelTy::IsRela) Addend += Target->getImplicitAddend(BufLoc, Type); - Symbol &Sym = this->getFile()->getRelocTargetSym(Rel); + Symbol &Sym = getFile()->getRelocTargetSym(Rel); RelExpr Expr = Target->getRelExpr(Type, Sym, BufLoc); if (Expr == R_NONE) continue; @@ -691,7 +674,7 @@ void InputSection::relocateNonAlloc(uint8_t *Buf, Arra if (Config->EMachine == EM_386 && Type == R_386_GOTPC) continue; - error(this->getLocation(Offset) + ": has non-ABS relocation " + + error(getLocation(Offset) + ": has non-ABS relocation " + toString(Type) + " against symbol '" + toString(Sym) + "'"); return; } @@ -765,7 +748,7 @@ void InputSectionBase::relocateAlloc(uint8_t *Buf, uin } template void InputSection::writeTo(uint8_t *Buf) { - if (this->Type == SHT_NOBITS) + if (Type == SHT_NOBITS) return; if (auto *S = dyn_cast(this)) { @@ -775,19 +758,17 @@ template void InputSection::writeTo(uint8 // If -r or --emit-relocs is given, then an InputSection // may be a relocation section. - if (this->Type == SHT_RELA) { - copyRelocations(Buf + OutSecOff, - this->template getDataAs()); + if (Type == SHT_RELA) { + copyRelocations(Buf + OutSecOff, getDataAs()); return; } - if (this->Type == SHT_REL) { - copyRelocations(Buf + OutSecOff, - this->template getDataAs()); + if (Type == SHT_REL) { + copyRelocations(Buf + OutSecOff, getDataAs()); return; } // If -r is given, we may have a SHT_GROUP section. - if (this->Type == SHT_GROUP) { + if (Type == SHT_GROUP) { copyShtGroup(Buf + OutSecOff); return; } @@ -796,18 +777,18 @@ template void InputSection::writeTo(uint8 // and then apply relocations. memcpy(Buf + OutSecOff, Data.data(), Data.size()); uint8_t *BufEnd = Buf + OutSecOff + Data.size(); - this->relocate(Buf, BufEnd); + relocate(Buf, BufEnd); } void InputSection::replace(InputSection *Other) { - this->Alignment = std::max(this->Alignment, Other->Alignment); - Other->Repl = this->Repl; + Alignment = std::max(Alignment, Other->Alignment); + Other->Repl = Repl; Other->Live = false; } template -EhInputSection::EhInputSection(ObjFile *F, - const typename ELFT::Shdr *Header, +EhInputSection::EhInputSection(ObjFile &F, + const typename ELFT::Shdr &Header, StringRef Name) : InputSectionBase(F, Header, Name, InputSectionBase::EHFrame) {} @@ -838,22 +819,21 @@ static unsigned getReloc(IntTy Begin, IntTy Size, cons // This function splits an input section into records and returns them. template void EhInputSection::split() { // Early exit if already split. - if (!this->Pieces.empty()) + if (!Pieces.empty()) return; - if (this->AreRelocsRela) - split(this->relas()); + if (AreRelocsRela) + split(relas()); else - split(this->rels()); + split(rels()); } template void EhInputSection::split(ArrayRef Rels) { - ArrayRef Data = this->Data; unsigned RelI = 0; for (size_t Off = 0, End = Data.size(); Off != End;) { size_t Size = readEhRecordSize(this, Off); - this->Pieces.emplace_back(Off, this, Size, getReloc(Off, Size, Rels, RelI)); + Pieces.emplace_back(Off, this, Size, getReloc(Off, Size, Rels, RelI)); // The empty record is the end marker. if (Size == 4) break; @@ -882,7 +862,7 @@ SyntheticSection *MergeInputSection::getParent() const // null-terminated strings. void MergeInputSection::splitStrings(ArrayRef Data, size_t EntSize) { size_t Off = 0; - bool IsAlloc = this->Flags & SHF_ALLOC; + bool IsAlloc = Flags & SHF_ALLOC; StringRef S = toStringRef(Data); while (!S.empty()) { @@ -903,7 +883,7 @@ void MergeInputSection::splitNonStrings(ArrayRefFlags & SHF_ALLOC; + bool IsAlloc = Flags & SHF_ALLOC; for (size_t I = 0; I != Size; I += EntSize) Pieces.emplace_back(I, xxHash64(toStringRef(Data.slice(I, EntSize))), @@ -911,17 +891,17 @@ void MergeInputSection::splitNonStrings(ArrayRef -MergeInputSection::MergeInputSection(ObjFile *F, - const typename ELFT::Shdr *Header, +MergeInputSection::MergeInputSection(ObjFile &F, + const typename ELFT::Shdr &Header, StringRef Name) - : InputSectionBase(F, Header, Name, InputSectionBase::Merge) { - // In order to reduce memory allocation, we assume that mergeable - // sections are smaller than 4 GiB, which is not an unreasonable - // assumption as of 2017. - if (Data.size() > UINT32_MAX) - error(toString(this) + ": section too large"); -} + : InputSectionBase(F, Header, Name, InputSectionBase::Merge) {} +MergeInputSection::MergeInputSection(uint64_t Flags, uint32_t Type, + uint64_t Entsize, ArrayRef Data, + StringRef Name) + : InputSectionBase(nullptr, Flags, Type, Entsize, /*Link*/ 0, /*Info*/ 0, + /*Alignment*/ Entsize, Data, Name, SectionBase::Merge) {} + // This function is called after we obtain a complete list of input sections // that need to be linked. This is responsible to split section contents // into small chunks for further processing. @@ -931,14 +911,14 @@ MergeInputSection::MergeInputSection(ObjFile *F, void MergeInputSection::splitIntoPieces() { assert(Pieces.empty()); - if (this->Flags & SHF_STRINGS) + if (Flags & SHF_STRINGS) splitStrings(Data, Entsize); else splitNonStrings(Data, Entsize); - if (Config->GcSections && (this->Flags & SHF_ALLOC)) + if (Config->GcSections && (Flags & SHF_ALLOC)) for (uint64_t Off : LiveOffsets) - this->getSectionPiece(Off)->Live = true; + getSectionPiece(Off)->Live = true; } // Do binary search to get a section piece at a given input offset. @@ -993,7 +973,7 @@ uint64_t MergeInputSection::getOffset(uint64_t Offset) // If Offset is not at beginning of a section piece, it is not in the map. // In that case we need to search from the original section piece vector. - const SectionPiece &Piece = *this->getSectionPiece(Offset); + const SectionPiece &Piece = *getSectionPiece(Offset); if (!Piece.Live) return 0; @@ -1001,13 +981,13 @@ uint64_t MergeInputSection::getOffset(uint64_t Offset) return Piece.OutputOff + Addend; } -template InputSection::InputSection(ObjFile *, const ELF32LE::Shdr *, +template InputSection::InputSection(ObjFile &, const ELF32LE::Shdr &, StringRef); -template InputSection::InputSection(ObjFile *, const ELF32BE::Shdr *, +template InputSection::InputSection(ObjFile &, const ELF32BE::Shdr &, StringRef); -template InputSection::InputSection(ObjFile *, const ELF64LE::Shdr *, +template InputSection::InputSection(ObjFile &, const ELF64LE::Shdr &, StringRef); -template InputSection::InputSection(ObjFile *, const ELF64BE::Shdr *, +template InputSection::InputSection(ObjFile &, const ELF64BE::Shdr &, StringRef); template std::string InputSectionBase::getLocation(uint64_t); @@ -1015,37 +995,28 @@ template std::string InputSectionBase::getLocation(uint64_t); template std::string InputSectionBase::getLocation(uint64_t); -template std::string InputSectionBase::getSrcMsg(const Symbol &, - uint64_t); -template std::string InputSectionBase::getSrcMsg(const Symbol &, - uint64_t); -template std::string InputSectionBase::getSrcMsg(const Symbol &, - uint64_t); -template std::string InputSectionBase::getSrcMsg(const Symbol &, - uint64_t); - template void InputSection::writeTo(uint8_t *); template void InputSection::writeTo(uint8_t *); template void InputSection::writeTo(uint8_t *); template void InputSection::writeTo(uint8_t *); -template MergeInputSection::MergeInputSection(ObjFile *, - const ELF32LE::Shdr *, StringRef); -template MergeInputSection::MergeInputSection(ObjFile *, - const ELF32BE::Shdr *, StringRef); -template MergeInputSection::MergeInputSection(ObjFile *, - const ELF64LE::Shdr *, StringRef); -template MergeInputSection::MergeInputSection(ObjFile *, - const ELF64BE::Shdr *, StringRef); +template MergeInputSection::MergeInputSection(ObjFile &, + const ELF32LE::Shdr &, StringRef); +template MergeInputSection::MergeInputSection(ObjFile &, + const ELF32BE::Shdr &, StringRef); +template MergeInputSection::MergeInputSection(ObjFile &, + const ELF64LE::Shdr &, StringRef); +template MergeInputSection::MergeInputSection(ObjFile &, + const ELF64BE::Shdr &, StringRef); -template EhInputSection::EhInputSection(ObjFile *, - const ELF32LE::Shdr *, StringRef); -template EhInputSection::EhInputSection(ObjFile *, - const ELF32BE::Shdr *, StringRef); -template EhInputSection::EhInputSection(ObjFile *, - const ELF64LE::Shdr *, StringRef); -template EhInputSection::EhInputSection(ObjFile *, - const ELF64BE::Shdr *, StringRef); +template EhInputSection::EhInputSection(ObjFile &, + const ELF32LE::Shdr &, StringRef); +template EhInputSection::EhInputSection(ObjFile &, + const ELF32BE::Shdr &, StringRef); +template EhInputSection::EhInputSection(ObjFile &, + const ELF64LE::Shdr &, StringRef); +template EhInputSection::EhInputSection(ObjFile &, + const ELF64BE::Shdr &, StringRef); template void EhInputSection::split(); template void EhInputSection::split(); Modified: vendor/lld/dist/ELF/InputSection.h ============================================================================== --- vendor/lld/dist/ELF/InputSection.h Sun Dec 24 01:00:48 2017 (r327129) +++ vendor/lld/dist/ELF/InputSection.h Sun Dec 24 01:00:50 2017 (r327130) @@ -93,7 +93,7 @@ class SectionBase { (protected) class InputSectionBase : public SectionBase { public: template - InputSectionBase(ObjFile *File, const typename ELFT::Shdr *Header, + InputSectionBase(ObjFile &File, const typename ELFT::Shdr &Header, StringRef Name, Kind SectionKind); InputSectionBase(InputFile *File, uint64_t Flags, uint32_t Type, @@ -168,7 +168,6 @@ class InputSectionBase : public SectionBase { (public) // Returns a source location string. Used to construct an error message. template std::string getLocation(uint64_t Offset); - template std::string getSrcMsg(const Symbol &Sym, uint64_t Offset); std::string getObjMsg(uint64_t Offset); @@ -216,8 +215,11 @@ static_assert(sizeof(SectionPiece) == 16, "SectionPiec class MergeInputSection : public InputSectionBase { public: template - MergeInputSection(ObjFile *F, const typename ELFT::Shdr *Header, + MergeInputSection(ObjFile &F, const typename ELFT::Shdr &Header, StringRef Name); + MergeInputSection(uint64_t Flags, uint32_t Type, uint64_t Entsize, + ArrayRef Data, StringRef Name); + static bool classof(const SectionBase *S) { return S->kind() == Merge; } void splitIntoPieces(); @@ -279,7 +281,7 @@ struct EhSectionPiece { class EhInputSection : public InputSectionBase { public: template - EhInputSection(ObjFile *F, const typename ELFT::Shdr *Header, + EhInputSection(ObjFile &F, const typename ELFT::Shdr &Header, StringRef Name); static bool classof(const SectionBase *S) { return S->kind() == EHFrame; } template void split(); @@ -298,10 +300,10 @@ class EhInputSection : public InputSectionBase { (publ // .eh_frame. It also includes the synthetic sections themselves. class InputSection : public InputSectionBase { public: - InputSection(uint64_t Flags, uint32_t Type, uint32_t Alignment, + InputSection(InputFile *F, uint64_t Flags, uint32_t Type, uint32_t Alignment, ArrayRef Data, StringRef Name, Kind K = Regular); template - InputSection(ObjFile *F, const typename ELFT::Shdr *Header, + InputSection(ObjFile &F, const typename ELFT::Shdr &Header, StringRef Name); // Write this section to a mmap'ed file, assuming Buf is pointing to Modified: vendor/lld/dist/ELF/MarkLive.cpp ============================================================================== --- vendor/lld/dist/ELF/MarkLive.cpp Sun Dec 24 01:00:48 2017 (r327129) +++ vendor/lld/dist/ELF/MarkLive.cpp Sun Dec 24 01:00:50 2017 (r327130) @@ -68,7 +68,7 @@ static void resolveReloc(InputSectionBase &Sec, RelT & B.Used = true; if (auto *SS = dyn_cast(&B)) if (!SS->isWeak()) - SS->getFile()->IsNeeded = true; + SS->getFile().IsNeeded = true; if (auto *D = dyn_cast(&B)) { auto *RelSec = dyn_cast_or_null(D->Section); @@ -246,7 +246,7 @@ template static void doGcSections() { // that point to .eh_frames. Otherwise, the garbage collector would drop // all of them. We also want to preserve personality routines and LSDA // referenced by .eh_frame sections, so we scan them for that here. - if (auto *EH = dyn_cast_or_null(Sec)) { + if (auto *EH = dyn_cast(Sec)) { EH->Live = true; scanEhFrameSection(*EH, Enqueue); } Modified: vendor/lld/dist/ELF/Relocations.cpp ============================================================================== --- vendor/lld/dist/ELF/Relocations.cpp Sun Dec 24 01:00:48 2017 (r327129) +++ vendor/lld/dist/ELF/Relocations.cpp Sun Dec 24 01:00:50 2017 (r327130) @@ -70,12 +70,11 @@ using namespace lld::elf; // >>> defined in /home/alice/src/foo.o // >>> referenced by bar.c:12 (/home/alice/src/bar.c:12) // >>> /home/alice/src/bar.o:(.text+0x1) -template static std::string getLocation(InputSectionBase &S, const Symbol &Sym, uint64_t Off) { std::string Msg = "\n>>> defined in " + toString(Sym.File) + "\n>>> referenced by "; - std::string Src = S.getSrcMsg(Sym, Off); + std::string Src = S.getSrcMsg(Sym, Off); if (!Src.empty()) Msg += Src + "\n>>> "; return Msg + S.getObjMsg(Off); @@ -365,7 +364,6 @@ static bool isRelExpr(RelExpr Expr) { // // If this function returns false, that means we need to emit a // dynamic relocation so that the relocation will be fixed at load-time. -template static bool isStaticLinkTimeConstant(RelExpr E, RelType Type, const Symbol &Sym, InputSectionBase &S, uint64_t RelOff) { // These expressions always compute a constant @@ -410,7 +408,7 @@ static bool isStaticLinkTimeConstant(RelExpr E, RelTyp return true; error("relocation " + toString(Type) + " cannot refer to absolute symbol: " + - toString(Sym) + getLocation(S, Sym, RelOff)); + toString(Sym) + getLocation(S, Sym, RelOff)); return true; } @@ -443,8 +441,8 @@ template static bool isReadOnly(SharedSym typedef typename ELFT::Phdr Elf_Phdr; // Determine if the symbol is read-only by scanning the DSO's program headers. - const SharedFile *File = SS->getFile(); - for (const Elf_Phdr &Phdr : check(File->getObj().program_headers())) + const SharedFile &File = SS->getFile(); + for (const Elf_Phdr &Phdr : check(File.getObj().program_headers())) if ((Phdr.p_type == ELF::PT_LOAD || Phdr.p_type == ELF::PT_GNU_RELRO) && !(Phdr.p_flags & ELF::PF_W) && SS->Value >= Phdr.p_vaddr && SS->Value < Phdr.p_vaddr + Phdr.p_memsz) @@ -461,14 +459,14 @@ template static std::vector getSymbolsAt(SharedSymbol *SS) { typedef typename ELFT::Sym Elf_Sym; - SharedFile *File = SS->getFile(); + SharedFile &File = SS->getFile(); std::vector Ret; - for (const Elf_Sym &S : File->getGlobalELFSyms()) { + for (const Elf_Sym &S : File.getGlobalELFSyms()) { if (S.st_shndx == SHN_UNDEF || S.st_shndx == SHN_ABS || S.st_value != SS->Value) continue; - StringRef Name = check(S.getName(File->getStringTable())); + StringRef Name = check(S.getName(File.getStringTable())); Symbol *Sym = Symtab->find(Name); if (auto *Alias = dyn_cast_or_null(Sym)) Ret.push_back(Alias); @@ -554,22 +552,57 @@ static void errorOrWarn(const Twine &Msg) { warn(Msg); } +// Returns PLT relocation expression. +// +// This handles a non PIC program call to function in a shared library. In +// an ideal world, we could just report an error saying the relocation can +// overflow at runtime. In the real world with glibc, crt1.o has a +// R_X86_64_PC32 pointing to libc.so. +// +// The general idea on how to handle such cases is to create a PLT entry and +// use that as the function value. +// +// For the static linking part, we just return a plt expr and everything +// else will use the the PLT entry as the address. +// +// The remaining problem is making sure pointer equality still works. We +// need the help of the dynamic linker for that. We let it know that we have +// a direct reference to a so symbol by creating an undefined symbol with a +// non zero st_value. Seeing that, the dynamic linker resolves the symbol to +// the value of the symbol we created. This is true even for got entries, so +// pointer equality is maintained. To avoid an infinite loop, the only entry +// that points to the real function is a dedicated got entry used by the +// plt. That is identified by special relocation types (R_X86_64_JUMP_SLOT, +// R_386_JMP_SLOT, etc). +static RelExpr getPltExpr(Symbol &Sym, RelExpr Expr, bool &IsConstant) { + Sym.NeedsPltAddr = true; + Sym.IsPreemptible = false; + IsConstant = true; + return toPlt(Expr); +} + template static RelExpr adjustExpr(Symbol &Sym, RelExpr Expr, RelType Type, - InputSectionBase &S, uint64_t RelOff) { + InputSectionBase &S, uint64_t RelOff, + bool &IsConstant) { // We can create any dynamic relocation if a section is simply writable. if (S.Flags & SHF_WRITE) return Expr; // Or, if we are allowed to create dynamic relocations against - // read-only sections (i.e. unless "-z notext" is given), + // read-only sections (i.e. when "-z notext" is given), // we can create a dynamic relocation as we want, too. - if (!Config->ZText) + if (!Config->ZText) { + // We use PLT for relocations that may overflow in runtime, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Dec 24 01:00:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E44CEE8828B; Sun, 24 Dec 2017 01:00:37 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 65CDD7EBB0; Sun, 24 Dec 2017 01:00:37 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBO10aLb074820; Sun, 24 Dec 2017 01:00:36 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBO10Xv8074026; Sun, 24 Dec 2017 01:00:33 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201712240100.vBO10Xv8074026@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 24 Dec 2017 01:00:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r327126 - in vendor/compiler-rt/dist: cmake cmake/Modules include/sanitizer lib/asan lib/asan/scripts lib/builtins lib/builtins/aarch64 lib/fuzzer lib/hwasan lib/msan lib/profile lib/sa... X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/compiler-rt/dist: cmake cmake/Modules include/sanitizer lib/asan lib/asan/scripts lib/builtins lib/builtins/aarch64 lib/fuzzer lib/hwasan lib/msan lib/profile lib/sanitizer_common lib/saniti... X-SVN-Commit-Revision: 327126 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Dec 2017 01:00:38 -0000 Author: dim Date: Sun Dec 24 01:00:33 2017 New Revision: 327126 URL: https://svnweb.freebsd.org/changeset/base/327126 Log: Vendor import of compiler-rt trunk r321414: https://llvm.org/svn/llvm-project/compiler-rt/trunk@321414 Added: vendor/compiler-rt/dist/lib/builtins/aarch64/ vendor/compiler-rt/dist/lib/builtins/aarch64/chkstk.S (contents, props changed) vendor/compiler-rt/dist/lib/sanitizer_common/sancov_begin.S (contents, props changed) vendor/compiler-rt/dist/lib/sanitizer_common/sancov_end.S (contents, props changed) vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_atomic_clang_mips.h (contents, props changed) vendor/compiler-rt/dist/test/sanitizer_common/TestCases/Linux/new_delete_test.cc (contents, props changed) vendor/compiler-rt/dist/test/ubsan/TestCases/Misc/Inputs/returns-unexpectedly.c (contents, props changed) Modified: vendor/compiler-rt/dist/cmake/Modules/AddCompilerRT.cmake vendor/compiler-rt/dist/cmake/config-ix.cmake vendor/compiler-rt/dist/include/sanitizer/allocator_interface.h vendor/compiler-rt/dist/include/sanitizer/asan_interface.h vendor/compiler-rt/dist/include/sanitizer/common_interface_defs.h vendor/compiler-rt/dist/include/sanitizer/coverage_interface.h vendor/compiler-rt/dist/include/sanitizer/esan_interface.h vendor/compiler-rt/dist/include/sanitizer/hwasan_interface.h vendor/compiler-rt/dist/include/sanitizer/lsan_interface.h vendor/compiler-rt/dist/include/sanitizer/msan_interface.h vendor/compiler-rt/dist/include/sanitizer/scudo_interface.h vendor/compiler-rt/dist/lib/asan/CMakeLists.txt vendor/compiler-rt/dist/lib/asan/scripts/asan_symbolize.py vendor/compiler-rt/dist/lib/builtins/CMakeLists.txt vendor/compiler-rt/dist/lib/fuzzer/FuzzerTracePC.h vendor/compiler-rt/dist/lib/hwasan/hwasan.cc vendor/compiler-rt/dist/lib/hwasan/hwasan_interface_internal.h vendor/compiler-rt/dist/lib/hwasan/hwasan_linux.cc vendor/compiler-rt/dist/lib/msan/msan_new_delete.cc vendor/compiler-rt/dist/lib/profile/InstrProfilingUtil.c vendor/compiler-rt/dist/lib/sanitizer_common/CMakeLists.txt vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_atomic_clang.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_atomic_clang_other.h vendor/compiler-rt/dist/lib/sanitizer_common/scripts/gen_dynamic_list.py vendor/compiler-rt/dist/lib/tsan/rtl/tsan_new_delete.cc vendor/compiler-rt/dist/lib/ubsan/ubsan_handlers.cc vendor/compiler-rt/dist/test/asan/TestCases/Linux/aligned_delete_test.cc vendor/compiler-rt/dist/test/hwasan/TestCases/halt-on-error.cc vendor/compiler-rt/dist/test/hwasan/TestCases/use-after-free.cc vendor/compiler-rt/dist/test/ubsan/TestCases/Misc/unreachable.cpp Modified: vendor/compiler-rt/dist/cmake/Modules/AddCompilerRT.cmake ============================================================================== --- vendor/compiler-rt/dist/cmake/Modules/AddCompilerRT.cmake Sun Dec 24 01:00:30 2017 (r327125) +++ vendor/compiler-rt/dist/cmake/Modules/AddCompilerRT.cmake Sun Dec 24 01:00:33 2017 (r327126) @@ -469,7 +469,7 @@ macro(add_custom_libcxx name prefix) message(FATAL_ERROR "libcxx not found!") endif() - cmake_parse_arguments(LIBCXX "" "" "DEPS;CFLAGS" ${ARGN}) + cmake_parse_arguments(LIBCXX "" "" "DEPS;CFLAGS;CMAKE_ARGS" ${ARGN}) foreach(flag ${LIBCXX_CFLAGS}) set(flagstr "${flagstr} ${flag}") endforeach() @@ -491,6 +491,7 @@ macro(add_custom_libcxx name prefix) -DCMAKE_INSTALL_PREFIX:PATH= -DLLVM_PATH=${LLVM_MAIN_SRC_DIR} -DLIBCXX_STANDALONE_BUILD=On + ${LIBCXX_CMAKE_ARGS} LOG_BUILD 1 LOG_CONFIGURE 1 LOG_INSTALL 1 Modified: vendor/compiler-rt/dist/cmake/config-ix.cmake ============================================================================== --- vendor/compiler-rt/dist/cmake/config-ix.cmake Sun Dec 24 01:00:30 2017 (r327125) +++ vendor/compiler-rt/dist/cmake/config-ix.cmake Sun Dec 24 01:00:33 2017 (r327126) @@ -486,7 +486,7 @@ set(COMPILER_RT_SANITIZERS_TO_BUILD all CACHE STRING list_replace(COMPILER_RT_SANITIZERS_TO_BUILD all "${ALL_SANITIZERS}") if (SANITIZER_COMMON_SUPPORTED_ARCH AND NOT LLVM_USE_SANITIZER AND - (OS_NAME MATCHES "Android|Darwin|Linux|FreeBSD|NetBSD|Fuchsia" OR + (OS_NAME MATCHES "Android|Darwin|Linux|FreeBSD|NetBSD|Fuchsia|SunOS" OR (OS_NAME MATCHES "Windows" AND (NOT MINGW AND NOT CYGWIN)))) set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE) else() @@ -505,7 +505,7 @@ else() set(COMPILER_RT_HAS_ASAN FALSE) endif() -if (OS_NAME MATCHES "Linux|FreeBSD|Windows|NetBSD") +if (OS_NAME MATCHES "Linux|FreeBSD|Windows|NetBSD|SunOS") set(COMPILER_RT_ASAN_HAS_STATIC_RUNTIME TRUE) else() set(COMPILER_RT_ASAN_HAS_STATIC_RUNTIME FALSE) @@ -556,7 +556,7 @@ else() endif() if (COMPILER_RT_HAS_SANITIZER_COMMON AND UBSAN_SUPPORTED_ARCH AND - OS_NAME MATCHES "Darwin|Linux|FreeBSD|NetBSD|Windows|Android|Fuchsia") + OS_NAME MATCHES "Darwin|Linux|FreeBSD|NetBSD|Windows|Android|Fuchsia|SunOS") set(COMPILER_RT_HAS_UBSAN TRUE) else() set(COMPILER_RT_HAS_UBSAN FALSE) Modified: vendor/compiler-rt/dist/include/sanitizer/allocator_interface.h ============================================================================== --- vendor/compiler-rt/dist/include/sanitizer/allocator_interface.h Sun Dec 24 01:00:30 2017 (r327125) +++ vendor/compiler-rt/dist/include/sanitizer/allocator_interface.h Sun Dec 24 01:00:33 2017 (r327126) @@ -32,7 +32,7 @@ extern "C" { size_t __sanitizer_get_allocated_size(const volatile void *p); /* Number of bytes, allocated and not yet freed by the application. */ - size_t __sanitizer_get_current_allocated_bytes(); + size_t __sanitizer_get_current_allocated_bytes(void); /* Number of bytes, mmaped by the allocator to fulfill allocation requests. Generally, for request of X bytes, allocator can reserve and add to free @@ -40,17 +40,17 @@ extern "C" { All these chunks count toward the heap size. Currently, allocator never releases memory to OS (instead, it just puts freed chunks to free lists). */ - size_t __sanitizer_get_heap_size(); + size_t __sanitizer_get_heap_size(void); /* Number of bytes, mmaped by the allocator, which can be used to fulfill allocation requests. When a user program frees memory chunk, it can first fall into quarantine and will count toward __sanitizer_get_free_bytes() later. */ - size_t __sanitizer_get_free_bytes(); + size_t __sanitizer_get_free_bytes(void); /* Number of bytes in unmapped pages, that are released to OS. Currently, always returns 0. */ - size_t __sanitizer_get_unmapped_bytes(); + size_t __sanitizer_get_unmapped_bytes(void); /* Malloc hooks that may be optionally provided by user. __sanitizer_malloc_hook(ptr, size) is called immediately after @@ -81,7 +81,7 @@ extern "C" { resources in attempt to reduce process RSS. Currently available with ASan only. */ - void __sanitizer_purge_allocator(); + void __sanitizer_purge_allocator(void); #ifdef __cplusplus } // extern "C" Modified: vendor/compiler-rt/dist/include/sanitizer/asan_interface.h ============================================================================== --- vendor/compiler-rt/dist/include/sanitizer/asan_interface.h Sun Dec 24 01:00:30 2017 (r327125) +++ vendor/compiler-rt/dist/include/sanitizer/asan_interface.h Sun Dec 24 01:00:33 2017 (r327126) @@ -64,19 +64,19 @@ extern "C" { // Useful for calling from a debugger to get information about an ASan error. // Returns 1 if an error has been (or is being) reported, otherwise returns 0. - int __asan_report_present(); + int __asan_report_present(void); // Useful for calling from a debugger to get information about an ASan error. // If an error has been (or is being) reported, the following functions return // the pc, bp, sp, address, access type (0 = read, 1 = write), access size and // bug description (e.g. "heap-use-after-free"). Otherwise they return 0. - void *__asan_get_report_pc(); - void *__asan_get_report_bp(); - void *__asan_get_report_sp(); - void *__asan_get_report_address(); - int __asan_get_report_access_type(); - size_t __asan_get_report_access_size(); - const char *__asan_get_report_description(); + void *__asan_get_report_pc(void); + void *__asan_get_report_bp(void); + void *__asan_get_report_sp(void); + void *__asan_get_report_address(void); + int __asan_get_report_access_type(void); + size_t __asan_get_report_access_size(void); + const char *__asan_get_report_description(void); // Useful for calling from the debugger to get information about a pointer. // Returns the category of the given pointer as a constant string. @@ -118,21 +118,21 @@ extern "C" { // User may provide function that would be called right when ASan detects // an error. This can be used to notice cases when ASan detects an error, but // the program crashes before ASan report is printed. - void __asan_on_error(); + void __asan_on_error(void); // Prints accumulated stats to stderr. Used for debugging. - void __asan_print_accumulated_stats(); + void __asan_print_accumulated_stats(void); // This function may be optionally provided by user and should return // a string containing ASan runtime options. See asan_flags.h for details. - const char* __asan_default_options(); + const char* __asan_default_options(void); // The following 2 functions facilitate garbage collection in presence of // asan's fake stack. // Returns an opaque handler to be used later in __asan_addr_is_in_fake_stack. // Returns NULL if the current thread does not have a fake stack. - void *__asan_get_current_fake_stack(); + void *__asan_get_current_fake_stack(void); // If fake_stack is non-NULL and addr belongs to a fake frame in // fake_stack, returns the address on real stack that corresponds to Modified: vendor/compiler-rt/dist/include/sanitizer/common_interface_defs.h ============================================================================== --- vendor/compiler-rt/dist/include/sanitizer/common_interface_defs.h Sun Dec 24 01:00:30 2017 (r327125) +++ vendor/compiler-rt/dist/include/sanitizer/common_interface_defs.h Sun Dec 24 01:00:33 2017 (r327126) @@ -115,7 +115,7 @@ extern "C" { const void *beg, const void *mid, const void *end); // Print the stack trace leading to this call. Useful for debugging user code. - void __sanitizer_print_stack_trace(); + void __sanitizer_print_stack_trace(void); // Symbolizes the supplied 'pc' using the format string 'fmt'. // Outputs at most 'out_buf_size' bytes into 'out_buf'. Modified: vendor/compiler-rt/dist/include/sanitizer/coverage_interface.h ============================================================================== --- vendor/compiler-rt/dist/include/sanitizer/coverage_interface.h Sun Dec 24 01:00:30 2017 (r327125) +++ vendor/compiler-rt/dist/include/sanitizer/coverage_interface.h Sun Dec 24 01:00:33 2017 (r327126) @@ -20,10 +20,10 @@ extern "C" { #endif // Record and dump coverage info. - void __sanitizer_cov_dump(); + void __sanitizer_cov_dump(void); // Clear collected coverage info. - void __sanitizer_cov_reset(); + void __sanitizer_cov_reset(void); // Dump collected coverage info. Sorts pcs by module into individual .sancov // files. Modified: vendor/compiler-rt/dist/include/sanitizer/esan_interface.h ============================================================================== --- vendor/compiler-rt/dist/include/sanitizer/esan_interface.h Sun Dec 24 01:00:30 2017 (r327125) +++ vendor/compiler-rt/dist/include/sanitizer/esan_interface.h Sun Dec 24 01:00:33 2017 (r327126) @@ -37,11 +37,11 @@ extern "C" { // This function can be called mid-run (or at the end of a run for // a server process that doesn't shut down normally) to request that // data for that point in the run be reported from the tool. -void COMPILER_RT_WEAK __esan_report(); +void COMPILER_RT_WEAK __esan_report(void); // This function returns the number of samples that the esan tool has collected // to this point. This is useful for testing. -unsigned int COMPILER_RT_WEAK __esan_get_sample_count(); +unsigned int COMPILER_RT_WEAK __esan_get_sample_count(void); #ifdef __cplusplus } // extern "C" Modified: vendor/compiler-rt/dist/include/sanitizer/hwasan_interface.h ============================================================================== --- vendor/compiler-rt/dist/include/sanitizer/hwasan_interface.h Sun Dec 24 01:00:30 2017 (r327125) +++ vendor/compiler-rt/dist/include/sanitizer/hwasan_interface.h Sun Dec 24 01:00:33 2017 (r327126) @@ -21,10 +21,10 @@ extern "C" { #endif // This function may be optionally provided by user and should return // a string containing HWASan runtime options. See asan_flags.h for details. - const char* __hwasan_default_options(); + const char* __hwasan_default_options(void); - void __hwasan_enable_allocator_tagging(); - void __hwasan_disable_allocator_tagging(); + void __hwasan_enable_allocator_tagging(void); + void __hwasan_disable_allocator_tagging(void); #ifdef __cplusplus } // extern "C" Modified: vendor/compiler-rt/dist/include/sanitizer/lsan_interface.h ============================================================================== --- vendor/compiler-rt/dist/include/sanitizer/lsan_interface.h Sun Dec 24 01:00:30 2017 (r327125) +++ vendor/compiler-rt/dist/include/sanitizer/lsan_interface.h Sun Dec 24 01:00:33 2017 (r327126) @@ -21,8 +21,8 @@ extern "C" { #endif // Allocations made between calls to __lsan_disable() and __lsan_enable() will // be treated as non-leaks. Disable/enable pairs may be nested. - void __lsan_disable(); - void __lsan_enable(); + void __lsan_disable(void); + void __lsan_enable(void); // The heap object into which p points will be treated as a non-leak. void __lsan_ignore_object(const void *p); @@ -49,7 +49,7 @@ extern "C" { // the time of first invocation of this function. // By calling this function early during process shutdown, you can instruct // LSan to ignore shutdown-only leaks which happen later on. - void __lsan_do_leak_check(); + void __lsan_do_leak_check(void); // Check for leaks now. Returns zero if no leaks have been found or if leak // detection is disabled, non-zero otherwise. @@ -58,7 +58,7 @@ extern "C" { // terminate the process. It does not affect the behavior of // __lsan_do_leak_check() or the end-of-process leak check, and is not // affected by them. - int __lsan_do_recoverable_leak_check(); + int __lsan_do_recoverable_leak_check(void); // The user may optionally provide this function to disallow leak checking // for the program it is linked into (if the return value is non-zero). This @@ -66,15 +66,15 @@ extern "C" { // that is unsupported. // To avoid dead stripping, you may need to define this function with // __attribute__((used)) - int __lsan_is_turned_off(); + int __lsan_is_turned_off(void); // This function may be optionally provided by user and should return // a string containing LSan runtime options. See lsan_flags.inc for details. - const char *__lsan_default_options(); + const char *__lsan_default_options(void); // This function may be optionally provided by the user and should return // a string containing LSan suppressions. - const char *__lsan_default_suppressions(); + const char *__lsan_default_suppressions(void); #ifdef __cplusplus } // extern "C" Modified: vendor/compiler-rt/dist/include/sanitizer/msan_interface.h ============================================================================== --- vendor/compiler-rt/dist/include/sanitizer/msan_interface.h Sun Dec 24 01:00:30 2017 (r327125) +++ vendor/compiler-rt/dist/include/sanitizer/msan_interface.h Sun Dec 24 01:00:33 2017 (r327126) @@ -31,10 +31,10 @@ extern "C" { int __msan_origin_is_descendant_or_same(uint32_t this_id, uint32_t prev_id); /* Returns non-zero if tracking origins. */ - int __msan_get_track_origins(); + int __msan_get_track_origins(void); /* Returns the origin id of the latest UMR in the calling thread. */ - uint32_t __msan_get_umr_origin(); + uint32_t __msan_get_umr_origin(void); /* Make memory region fully initialized (without changing its contents). */ void __msan_unpoison(const volatile void *a, size_t size); @@ -82,7 +82,7 @@ extern "C" { void __msan_dump_shadow(const volatile void *x, size_t size); /* Returns true if running under a dynamic tool (DynamoRio-based). */ - int __msan_has_dynamic_component(); + int __msan_has_dynamic_component(void); /* Tell MSan about newly allocated memory (ex.: custom allocator). Memory will be marked uninitialized, with origin at the call site. */ @@ -93,7 +93,7 @@ extern "C" { /* This function may be optionally provided by user and should return a string containing Msan runtime options. See msan_flags.h for details. */ - const char* __msan_default_options(); + const char* __msan_default_options(void); /* Deprecated. Call __sanitizer_set_death_callback instead. */ void __msan_set_death_callback(void (*callback)(void)); Modified: vendor/compiler-rt/dist/include/sanitizer/scudo_interface.h ============================================================================== --- vendor/compiler-rt/dist/include/sanitizer/scudo_interface.h Sun Dec 24 01:00:30 2017 (r327125) +++ vendor/compiler-rt/dist/include/sanitizer/scudo_interface.h Sun Dec 24 01:00:33 2017 (r327126) @@ -20,7 +20,7 @@ extern "C" { #endif // This function may be optionally provided by a user and should return // a string containing Scudo runtime options. See scudo_flags.h for details. - const char* __scudo_default_options(); + const char* __scudo_default_options(void); // This function allows to set the RSS limit at runtime. This can be either // the hard limit (HardLimit=1) or the soft limit (HardLimit=0). The limit Modified: vendor/compiler-rt/dist/lib/asan/CMakeLists.txt ============================================================================== --- vendor/compiler-rt/dist/lib/asan/CMakeLists.txt Sun Dec 24 01:00:30 2017 (r327125) +++ vendor/compiler-rt/dist/lib/asan/CMakeLists.txt Sun Dec 24 01:00:33 2017 (r327126) @@ -175,6 +175,11 @@ else() EXTRA asan.syms.extra) set(VERSION_SCRIPT_FLAG -Wl,--version-script,${CMAKE_CURRENT_BINARY_DIR}/clang_rt.asan-dynamic-${arch}.vers) + # The Solaris 11.4 linker supports a subset of GNU ld version scripts, + # but requires a special option to enable it. + if (OS_NAME MATCHES "SunOS") + list(APPEND VERSION_SCRIPT_FLAG -Wl,-z,gnu-version-script-compat) + endif() set_property(SOURCE ${CMAKE_CURRENT_BINARY_DIR}/dummy.cc APPEND PROPERTY Modified: vendor/compiler-rt/dist/lib/asan/scripts/asan_symbolize.py ============================================================================== --- vendor/compiler-rt/dist/lib/asan/scripts/asan_symbolize.py Sun Dec 24 01:00:30 2017 (r327125) +++ vendor/compiler-rt/dist/lib/asan/scripts/asan_symbolize.py Sun Dec 24 01:00:33 2017 (r327126) @@ -280,7 +280,7 @@ def BreakpadSymbolizerFactory(binary): def SystemSymbolizerFactory(system, addr, binary, arch): if system == 'Darwin': return DarwinSymbolizer(addr, binary, arch) - elif system in ['Linux', 'FreeBSD', 'NetBSD']: + elif system in ['Linux', 'FreeBSD', 'NetBSD', 'SunOS']: return Addr2LineSymbolizer(binary) @@ -370,7 +370,7 @@ class SymbolizationLoop(object): self.binary_name_filter = binary_name_filter self.dsym_hint_producer = dsym_hint_producer self.system = os.uname()[0] - if self.system not in ['Linux', 'Darwin', 'FreeBSD', 'NetBSD']: + if self.system not in ['Linux', 'Darwin', 'FreeBSD', 'NetBSD','SunOS']: raise Exception('Unknown system') self.llvm_symbolizers = {} self.last_llvm_symbolizer = None Modified: vendor/compiler-rt/dist/lib/builtins/CMakeLists.txt ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/CMakeLists.txt Sun Dec 24 01:00:30 2017 (r327125) +++ vendor/compiler-rt/dist/lib/builtins/CMakeLists.txt Sun Dec 24 01:00:33 2017 (r327126) @@ -446,6 +446,12 @@ set(aarch64_SOURCES ${GENERIC_TF_SOURCES} ${GENERIC_SOURCES}) +if (MINGW) + set(aarch64_SOURCES + ${aarch64_SOURCES} + aarch64/chkstk.S) +endif() + set(armhf_SOURCES ${arm_SOURCES}) set(armv7_SOURCES ${arm_SOURCES}) set(armv7s_SOURCES ${arm_SOURCES}) Added: vendor/compiler-rt/dist/lib/builtins/aarch64/chkstk.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/lib/builtins/aarch64/chkstk.S Sun Dec 24 01:00:33 2017 (r327126) @@ -0,0 +1,34 @@ +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. + +#include "../assembly.h" + +// __chkstk routine +// This routine is windows specific. +// http://msdn.microsoft.com/en-us/library/ms648426.aspx + +// This clobbers registers x16 and x17. +// Does not modify any memory or the stack pointer. + +// mov x15, #256 // Number of bytes of stack, in units of 16 byte +// bl __chkstk +// sub sp, sp, x15, lsl #4 + +#ifdef __aarch64__ + +#define PAGE_SIZE 4096 + + .p2align 2 +DEFINE_COMPILERRT_FUNCTION(__chkstk) + lsl x16, x15, #4 + mov x17, sp +1: + sub x17, x17, #PAGE_SIZE + subs x16, x16, #PAGE_SIZE + ldr xzr, [x17] + b.gt 1b + + ret +END_COMPILERRT_FUNCTION(__chkstk) + +#endif // __aarch64__ Modified: vendor/compiler-rt/dist/lib/fuzzer/FuzzerTracePC.h ============================================================================== --- vendor/compiler-rt/dist/lib/fuzzer/FuzzerTracePC.h Sun Dec 24 01:00:30 2017 (r327125) +++ vendor/compiler-rt/dist/lib/fuzzer/FuzzerTracePC.h Sun Dec 24 01:00:33 2017 (r327126) @@ -276,6 +276,7 @@ void TracePC::CollectFeatures(Callback HandleFeature) // Step function, grows similar to 8 * Log_2(A). auto StackDepthStepFunction = [](uint32_t A) -> uint32_t { + if (!A) return A; uint32_t Log2 = Log(A); if (Log2 < 3) return A; Log2 -= 3; Modified: vendor/compiler-rt/dist/lib/hwasan/hwasan.cc ============================================================================== --- vendor/compiler-rt/dist/lib/hwasan/hwasan.cc Sun Dec 24 01:00:30 2017 (r327125) +++ vendor/compiler-rt/dist/lib/hwasan/hwasan.cc Sun Dec 24 01:00:33 2017 (r327126) @@ -252,40 +252,112 @@ static void SigIll() { // __builtin_unreachable(); } -template -__attribute__((always_inline, nodebug)) -static void CheckAddress(uptr p) { +enum class ErrorAction { Abort, Recover }; +enum class AccessType { Load, Store }; + +template +__attribute__((always_inline, nodebug)) static void CheckAddress(uptr p) { tag_t ptr_tag = GetTagFromPointer(p); uptr ptr_raw = p & ~kAddressTagMask; tag_t mem_tag = *(tag_t *)MEM_TO_SHADOW(ptr_raw); - if (UNLIKELY(ptr_tag != mem_tag)) SigIll<0x100 + 0x10 * IsStore + LogSize>(); + if (UNLIKELY(ptr_tag != mem_tag)) { + SigIll<0x100 + 0x20 * (EA == ErrorAction::Recover) + + 0x10 * (AT == AccessType::Store) + LogSize>(); + if (EA == ErrorAction::Abort) __builtin_unreachable(); + } } -template -__attribute__((always_inline, nodebug)) -static void CheckAddressSized(uptr p, uptr sz) { +template +__attribute__((always_inline, nodebug)) static void CheckAddressSized(uptr p, + uptr sz) { CHECK_NE(0, sz); tag_t ptr_tag = GetTagFromPointer(p); uptr ptr_raw = p & ~kAddressTagMask; tag_t *shadow_first = (tag_t *)MEM_TO_SHADOW(ptr_raw); tag_t *shadow_last = (tag_t *)MEM_TO_SHADOW(ptr_raw + sz - 1); for (tag_t *t = shadow_first; t <= shadow_last; ++t) - if (UNLIKELY(ptr_tag != *t)) SigIll<0x100 + 0x10 * IsStore + 0xf>(); + if (UNLIKELY(ptr_tag != *t)) { + SigIll<0x100 + 0x20 * (EA == ErrorAction::Recover) + + 0x10 * (AT == AccessType::Store) + 0xf>(); + if (EA == ErrorAction::Abort) __builtin_unreachable(); + } } -void __hwasan_load(uptr p, uptr sz) { CheckAddressSized(p, sz); } -void __hwasan_load1(uptr p) { CheckAddress(p); } -void __hwasan_load2(uptr p) { CheckAddress(p); } -void __hwasan_load4(uptr p) { CheckAddress(p); } -void __hwasan_load8(uptr p) { CheckAddress(p); } -void __hwasan_load16(uptr p) { CheckAddress(p); } +void __hwasan_load(uptr p, uptr sz) { + CheckAddressSized(p, sz); +} +void __hwasan_load1(uptr p) { + CheckAddress(p); +} +void __hwasan_load2(uptr p) { + CheckAddress(p); +} +void __hwasan_load4(uptr p) { + CheckAddress(p); +} +void __hwasan_load8(uptr p) { + CheckAddress(p); +} +void __hwasan_load16(uptr p) { + CheckAddress(p); +} -void __hwasan_store(uptr p, uptr sz) { CheckAddressSized(p, sz); } -void __hwasan_store1(uptr p) { CheckAddress(p); } -void __hwasan_store2(uptr p) { CheckAddress(p); } -void __hwasan_store4(uptr p) { CheckAddress(p); } -void __hwasan_store8(uptr p) { CheckAddress(p); } -void __hwasan_store16(uptr p) { CheckAddress(p); } +void __hwasan_load_noabort(uptr p, uptr sz) { + CheckAddressSized(p, sz); +} +void __hwasan_load1_noabort(uptr p) { + CheckAddress(p); +} +void __hwasan_load2_noabort(uptr p) { + CheckAddress(p); +} +void __hwasan_load4_noabort(uptr p) { + CheckAddress(p); +} +void __hwasan_load8_noabort(uptr p) { + CheckAddress(p); +} +void __hwasan_load16_noabort(uptr p) { + CheckAddress(p); +} + +void __hwasan_store(uptr p, uptr sz) { + CheckAddressSized(p, sz); +} +void __hwasan_store1(uptr p) { + CheckAddress(p); +} +void __hwasan_store2(uptr p) { + CheckAddress(p); +} +void __hwasan_store4(uptr p) { + CheckAddress(p); +} +void __hwasan_store8(uptr p) { + CheckAddress(p); +} +void __hwasan_store16(uptr p) { + CheckAddress(p); +} + +void __hwasan_store_noabort(uptr p, uptr sz) { + CheckAddressSized(p, sz); +} +void __hwasan_store1_noabort(uptr p) { + CheckAddress(p); +} +void __hwasan_store2_noabort(uptr p) { + CheckAddress(p); +} +void __hwasan_store4_noabort(uptr p) { + CheckAddress(p); +} +void __hwasan_store8_noabort(uptr p) { + CheckAddress(p); +} +void __hwasan_store16_noabort(uptr p) { + CheckAddress(p); +} #if !SANITIZER_SUPPORTS_WEAK_HOOKS extern "C" { Modified: vendor/compiler-rt/dist/lib/hwasan/hwasan_interface_internal.h ============================================================================== --- vendor/compiler-rt/dist/lib/hwasan/hwasan_interface_internal.h Sun Dec 24 01:00:30 2017 (r327125) +++ vendor/compiler-rt/dist/lib/hwasan/hwasan_interface_internal.h Sun Dec 24 01:00:33 2017 (r327126) @@ -45,6 +45,19 @@ SANITIZER_INTERFACE_ATTRIBUTE void __hwasan_load16(uptr); SANITIZER_INTERFACE_ATTRIBUTE +void __hwasan_load_noabort(uptr, uptr); +SANITIZER_INTERFACE_ATTRIBUTE +void __hwasan_load1_noabort(uptr); +SANITIZER_INTERFACE_ATTRIBUTE +void __hwasan_load2_noabort(uptr); +SANITIZER_INTERFACE_ATTRIBUTE +void __hwasan_load4_noabort(uptr); +SANITIZER_INTERFACE_ATTRIBUTE +void __hwasan_load8_noabort(uptr); +SANITIZER_INTERFACE_ATTRIBUTE +void __hwasan_load16_noabort(uptr); + +SANITIZER_INTERFACE_ATTRIBUTE void __hwasan_store(uptr, uptr); SANITIZER_INTERFACE_ATTRIBUTE void __hwasan_store1(uptr); @@ -56,6 +69,19 @@ SANITIZER_INTERFACE_ATTRIBUTE void __hwasan_store8(uptr); SANITIZER_INTERFACE_ATTRIBUTE void __hwasan_store16(uptr); + +SANITIZER_INTERFACE_ATTRIBUTE +void __hwasan_store_noabort(uptr, uptr); +SANITIZER_INTERFACE_ATTRIBUTE +void __hwasan_store1_noabort(uptr); +SANITIZER_INTERFACE_ATTRIBUTE +void __hwasan_store2_noabort(uptr); +SANITIZER_INTERFACE_ATTRIBUTE +void __hwasan_store4_noabort(uptr); +SANITIZER_INTERFACE_ATTRIBUTE +void __hwasan_store8_noabort(uptr); +SANITIZER_INTERFACE_ATTRIBUTE +void __hwasan_store16_noabort(uptr); // Returns the offset of the first tag mismatch or -1 if the whole range is // good. Modified: vendor/compiler-rt/dist/lib/hwasan/hwasan_linux.cc ============================================================================== --- vendor/compiler-rt/dist/lib/hwasan/hwasan_linux.cc Sun Dec 24 01:00:30 2017 (r327125) +++ vendor/compiler-rt/dist/lib/hwasan/hwasan_linux.cc Sun Dec 24 01:00:33 2017 (r327126) @@ -174,12 +174,14 @@ struct AccessInfo { uptr size; bool is_store; bool is_load; + bool recover; }; #if defined(__aarch64__) static AccessInfo GetAccessInfo(siginfo_t *info, ucontext_t *uc) { // Access type is encoded in HLT immediate as 0x1XY, - // where X is 1 for store, 0 for load. + // where X&1 is 1 for store, 0 for load, + // and X&2 is 1 if the error is recoverable. // Valid values of Y are 0 to 4, which are interpreted as log2(access_size), // and 0xF, which means that access size is stored in X1 register. // Access address is always in X0 register. @@ -189,7 +191,8 @@ static AccessInfo GetAccessInfo(siginfo_t *info, ucont if ((code & 0xff00) != 0x100) return AccessInfo{0, 0, false, false}; // Not ours. bool is_store = code & 0x10; - unsigned size_log = code & 0xff; + bool recover = code & 0x20; + unsigned size_log = code & 0xf; if (size_log > 4 && size_log != 0xf) return AccessInfo{0, 0, false, false}; // Not ours. @@ -200,6 +203,7 @@ static AccessInfo GetAccessInfo(siginfo_t *info, ucont ai.size = uc->uc_mcontext.regs[1]; else ai.size = 1U << size_log; + ai.recover = recover; return ai; } #else @@ -223,7 +227,7 @@ static bool HwasanOnSIGILL(int signo, siginfo_t *info, ReportTagMismatch(stack, ai.addr, ai.size, ai.is_store); ++hwasan_report_count; - if (flags()->halt_on_error) + if (flags()->halt_on_error || !ai.recover) Die(); uc->uc_mcontext.pc += 4; Modified: vendor/compiler-rt/dist/lib/msan/msan_new_delete.cc ============================================================================== --- vendor/compiler-rt/dist/lib/msan/msan_new_delete.cc Sun Dec 24 01:00:30 2017 (r327125) +++ vendor/compiler-rt/dist/lib/msan/msan_new_delete.cc Sun Dec 24 01:00:33 2017 (r327126) @@ -22,9 +22,10 @@ using namespace __msan; // NOLINT -// Fake std::nothrow_t to avoid including . +// Fake std::nothrow_t and std::align_val_t to avoid including . namespace std { struct nothrow_t {}; + enum class align_val_t: size_t {}; } // namespace std @@ -34,6 +35,11 @@ namespace std { void *res = msan_malloc(size, &stack);\ if (!nothrow && UNLIKELY(!res)) DieOnFailure::OnOOM();\ return res +#define OPERATOR_NEW_BODY_ALIGN(nothrow) \ + GET_MALLOC_STACK_TRACE;\ + void *res = msan_memalign((uptr)align, size, &stack);\ + if (!nothrow && UNLIKELY(!res)) DieOnFailure::OnOOM();\ + return res; INTERCEPTOR_ATTRIBUTE void *operator new(size_t size) { OPERATOR_NEW_BODY(false /*nothrow*/); } @@ -47,6 +53,18 @@ INTERCEPTOR_ATTRIBUTE void *operator new[](size_t size, std::nothrow_t const&) { OPERATOR_NEW_BODY(true /*nothrow*/); } +INTERCEPTOR_ATTRIBUTE +void *operator new(size_t size, std::align_val_t align) +{ OPERATOR_NEW_BODY_ALIGN(false /*nothrow*/); } +INTERCEPTOR_ATTRIBUTE +void *operator new[](size_t size, std::align_val_t align) +{ OPERATOR_NEW_BODY_ALIGN(false /*nothrow*/); } +INTERCEPTOR_ATTRIBUTE +void *operator new(size_t size, std::align_val_t align, std::nothrow_t const&) +{ OPERATOR_NEW_BODY_ALIGN(true /*nothrow*/); } +INTERCEPTOR_ATTRIBUTE +void *operator new[](size_t size, std::align_val_t align, std::nothrow_t const&) +{ OPERATOR_NEW_BODY_ALIGN(true /*nothrow*/); } #define OPERATOR_DELETE_BODY \ GET_MALLOC_STACK_TRACE; \ @@ -62,5 +80,29 @@ INTERCEPTOR_ATTRIBUTE void operator delete[](void *ptr, std::nothrow_t const&) { OPERATOR_DELETE_BODY; } +INTERCEPTOR_ATTRIBUTE +void operator delete(void *ptr, size_t size) NOEXCEPT { OPERATOR_DELETE_BODY; } +INTERCEPTOR_ATTRIBUTE +void operator delete[](void *ptr, size_t size) NOEXCEPT +{ OPERATOR_DELETE_BODY; } +INTERCEPTOR_ATTRIBUTE +void operator delete(void *ptr, std::align_val_t align) NOEXCEPT +{ OPERATOR_DELETE_BODY; } +INTERCEPTOR_ATTRIBUTE +void operator delete[](void *ptr, std::align_val_t align) NOEXCEPT +{ OPERATOR_DELETE_BODY; } +INTERCEPTOR_ATTRIBUTE +void operator delete(void *ptr, std::align_val_t align, std::nothrow_t const&) +{ OPERATOR_DELETE_BODY; } +INTERCEPTOR_ATTRIBUTE +void operator delete[](void *ptr, std::align_val_t align, std::nothrow_t const&) +{ OPERATOR_DELETE_BODY; } +INTERCEPTOR_ATTRIBUTE +void operator delete(void *ptr, size_t size, std::align_val_t align) NOEXCEPT +{ OPERATOR_DELETE_BODY; } +INTERCEPTOR_ATTRIBUTE +void operator delete[](void *ptr, size_t size, std::align_val_t align) NOEXCEPT +{ OPERATOR_DELETE_BODY; } + #endif // MSAN_REPLACE_OPERATORS_NEW_AND_DELETE Modified: vendor/compiler-rt/dist/lib/profile/InstrProfilingUtil.c ============================================================================== --- vendor/compiler-rt/dist/lib/profile/InstrProfilingUtil.c Sun Dec 24 01:00:30 2017 (r327125) +++ vendor/compiler-rt/dist/lib/profile/InstrProfilingUtil.c Sun Dec 24 01:00:33 2017 (r327126) @@ -9,6 +9,7 @@ #ifdef _WIN32 #include +#include #include #include "WindowsMMap.h" #else Modified: vendor/compiler-rt/dist/lib/sanitizer_common/CMakeLists.txt ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/CMakeLists.txt Sun Dec 24 01:00:30 2017 (r327125) +++ vendor/compiler-rt/dist/lib/sanitizer_common/CMakeLists.txt Sun Dec 24 01:00:33 2017 (r327126) @@ -20,12 +20,15 @@ set(SANITIZER_SOURCES_NOTERMINATION sanitizer_platform_limits_linux.cc sanitizer_platform_limits_netbsd.cc sanitizer_platform_limits_posix.cc + sanitizer_platform_limits_solaris.cc sanitizer_posix.cc sanitizer_printf.cc sanitizer_procmaps_common.cc sanitizer_procmaps_freebsd.cc sanitizer_procmaps_linux.cc sanitizer_procmaps_mac.cc + sanitizer_procmaps_solaris.cc + sanitizer_solaris.cc sanitizer_stackdepot.cc sanitizer_stacktrace.cc sanitizer_stacktrace_printer.cc @@ -40,7 +43,7 @@ set(SANITIZER_SOURCES_NOTERMINATION sanitizer_thread_registry.cc sanitizer_win.cc) -if(UNIX AND NOT APPLE) +if(UNIX AND NOT APPLE AND NOT OS_NAME MATCHES "SunOS") list(APPEND SANITIZER_SOURCES_NOTERMINATION sanitizer_linux_x86_64.S) list(APPEND SANITIZER_SOURCES_NOTERMINATION @@ -122,6 +125,7 @@ set(SANITIZER_HEADERS sanitizer_platform_interceptors.h sanitizer_platform_limits_netbsd.h sanitizer_platform_limits_posix.h + sanitizer_platform_limits_solaris.h sanitizer_posix.h sanitizer_procmaps.h sanitizer_quarantine.h @@ -215,6 +219,38 @@ add_compiler_rt_object_libraries(RTSanitizerCommonLibc SOURCES ${SANITIZER_LIBCDEP_SOURCES} CFLAGS ${SANITIZER_NO_WEAK_HOOKS_CFLAGS} DEFS ${SANITIZER_COMMON_DEFINITIONS}) + +if(OS_NAME MATCHES "SunOS") + # Solaris ld doesn't support the non-standard GNU ld extension of adding + # __start_SECNAME and __stop_SECNAME labels to sections whose names are + # valid C identifiers. Instead we add our own definitions for the + # __sancov_guards section. + add_compiler_rt_object_libraries(SancovBegin + ARCHS ${SANITIZER_COMMON_SUPPORTED_ARCH} + SOURCES sancov_begin.S + CFLAGS ${SANITIZER_CFLAGS} + DEFS ${SANITIZER_COMMON_DEFINITIONS}) + + add_compiler_rt_runtime(clang_rt.sancov_begin + STATIC + ARCHS ${SANITIZER_COMMON_SUPPORTED_ARCH} + OBJECT_LIBS SancovBegin + CFLAGS ${SANITIZER_CFLAGS} + DEFS ${SANITIZER_COMMON_DEFINITIONS}) + + add_compiler_rt_object_libraries(SancovEnd + ARCHS ${SANITIZER_COMMON_SUPPORTED_ARCH} + SOURCES sancov_end.S + CFLAGS ${SANITIZER_CFLAGS} + DEFS ${SANITIZER_COMMON_DEFINITIONS}) + + add_compiler_rt_runtime(clang_rt.sancov_end + STATIC + ARCHS ${SANITIZER_COMMON_SUPPORTED_ARCH} + OBJECT_LIBS SancovEnd + CFLAGS ${SANITIZER_CFLAGS} + DEFS ${SANITIZER_COMMON_DEFINITIONS}) +endif() if(WIN32) add_compiler_rt_object_libraries(SanitizerCommonWeakInterception Added: vendor/compiler-rt/dist/lib/sanitizer_common/sancov_begin.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sancov_begin.S Sun Dec 24 01:00:33 2017 (r327126) @@ -0,0 +1,5 @@ + .type __start___sancov_guards,@object + .globl __start___sancov_guards + .section __sancov_guards,"aw",@progbits + .p2align 2 +__start___sancov_guards: Added: vendor/compiler-rt/dist/lib/sanitizer_common/sancov_end.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sancov_end.S Sun Dec 24 01:00:33 2017 (r327126) @@ -0,0 +1,5 @@ + .type __stop___sancov_guards,@object + .globl __stop___sancov_guards + .section __sancov_guards,"aw",@progbits + .p2align 2 +__stop___sancov_guards: Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_atomic_clang.h ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_atomic_clang.h Sun Dec 24 01:00:30 2017 (r327125) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_atomic_clang.h Sun Dec 24 01:00:33 2017 (r327126) @@ -78,17 +78,7 @@ INLINE bool atomic_compare_exchange_strong(volatile T typedef typename T::Type Type; Type cmpv = *cmp; Type prev; -#if defined(_MIPS_SIM) && _MIPS_SIM == _ABIO32 - if (sizeof(*a) == 8) { - Type volatile *val_ptr = const_cast(&a->val_dont_use); - prev = __mips_sync_val_compare_and_swap( - reinterpret_cast(val_ptr), (u64)cmpv, (u64)xchg); - } else { - prev = __sync_val_compare_and_swap(&a->val_dont_use, cmpv, xchg); - } -#else prev = __sync_val_compare_and_swap(&a->val_dont_use, cmpv, xchg); -#endif if (prev == cmpv) return true; *cmp = prev; return false; @@ -103,6 +93,13 @@ INLINE bool atomic_compare_exchange_weak(volatile T *a } } // namespace __sanitizer + +// This include provides explicit template instantiations for atomic_uint64_t +// on MIPS32, which does not directly support 8 byte atomics. It has to +// proceed the template definitions above. +#if defined(_MIPS_SIM) && defined(_ABIO32) + #include "sanitizer_atomic_clang_mips.h" +#endif #undef ATOMIC_ORDER Added: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_atomic_clang_mips.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_atomic_clang_mips.h Sun Dec 24 01:00:33 2017 (r327126) @@ -0,0 +1,118 @@ +//===-- sanitizer_atomic_clang_mips.h ---------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file is a part of ThreadSanitizer/AddressSanitizer runtime. +// Not intended for direct inclusion. Include sanitizer_atomic.h. +// +//===----------------------------------------------------------------------===// + +#ifndef SANITIZER_ATOMIC_CLANG_MIPS_H +#define SANITIZER_ATOMIC_CLANG_MIPS_H + +namespace __sanitizer { + +// MIPS32 does not support atomics > 4 bytes. To address this lack of +// functionality, the sanitizer library provides helper methods which use an +// internal spin lock mechanism to emulate atomic oprations when the size is +// 8 bytes. +static void __spin_lock(volatile int *lock) { + while (__sync_lock_test_and_set(lock, 1)) + while (*lock) { + } +} + +static void __spin_unlock(volatile int *lock) { __sync_lock_release(lock); } + +// Make sure the lock is on its own cache line to prevent false sharing. +// Put it inside a struct that is aligned and padded to the typical MIPS +// cacheline which is 32 bytes. +static struct { + int lock; + char pad[32 - sizeof(int)]; +} __attribute__((aligned(32))) lock = {0, {0}}; + +template <> +INLINE atomic_uint64_t::Type atomic_fetch_add(volatile atomic_uint64_t *ptr, + atomic_uint64_t::Type val, + memory_order mo) { + DCHECK(mo & + (memory_order_relaxed | memory_order_releasae | memory_order_seq_cst)); + DCHECK(!((uptr)ptr % sizeof(*ptr))); + + atomic_uint64_t::Type ret; + + __spin_lock(&lock.lock); + ret = *(const_cast(&ptr->val_dont_use)); + ptr->val_dont_use = ret + val; + __spin_unlock(&lock.lock); + + return ret; +} + +template <> +INLINE atomic_uint64_t::Type atomic_fetch_sub(volatile atomic_uint64_t *ptr, + atomic_uint64_t::Type val, + memory_order mo) { + return atomic_fetch_add(ptr, -val, mo); +} + +template <> +INLINE bool atomic_compare_exchange_strong(volatile atomic_uint64_t *ptr, + atomic_uint64_t::Type *cmp, + atomic_uint64_t::Type xchg, + memory_order mo) { + DCHECK(mo & + (memory_order_relaxed | memory_order_releasae | memory_order_seq_cst)); + DCHECK(!((uptr)ptr % sizeof(*ptr))); + + typedef atomic_uint64_t::Type Type; + Type cmpv = *cmp; + Type prev; + bool ret = false; + + __spin_lock(&lock.lock); + prev = *(const_cast(&ptr->val_dont_use)); + if (prev == cmpv) { + ret = true; + ptr->val_dont_use = xchg; + } + __spin_unlock(&lock.lock); + + return ret; +} + +template <> +INLINE atomic_uint64_t::Type atomic_load(const volatile atomic_uint64_t *ptr, + memory_order mo) { + DCHECK(mo & + (memory_order_relaxed | memory_order_releasae | memory_order_seq_cst)); + DCHECK(!((uptr)ptr % sizeof(*ptr))); + + atomic_uint64_t::Type zero = 0; + volatile atomic_uint64_t *Newptr = + const_cast(ptr); + return atomic_fetch_add(Newptr, zero, mo); +} + +template <> +INLINE void atomic_store(volatile atomic_uint64_t *ptr, atomic_uint64_t::Type v, + memory_order mo) { + DCHECK(mo & + (memory_order_relaxed | memory_order_releasae | memory_order_seq_cst)); + DCHECK(!((uptr)ptr % sizeof(*ptr))); + + __spin_lock(&lock.lock); + ptr->val_dont_use = v; + __spin_unlock(&lock.lock); +} + +} // namespace __sanitizer + +#endif // SANITIZER_ATOMIC_CLANG_MIPS_H + Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_atomic_clang_other.h ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_atomic_clang_other.h Sun Dec 24 01:00:30 2017 (r327125) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_atomic_clang_other.h Sun Dec 24 01:00:33 2017 (r327126) @@ -17,56 +17,7 @@ namespace __sanitizer { -// MIPS32 does not support atomic > 4 bytes. To address this lack of -// functionality, the sanitizer library provides helper methods which use an -// internal spin lock mechanism to emulate atomic oprations when the size is -// 8 bytes. -#if defined(_MIPS_SIM) && _MIPS_SIM == _ABIO32 -static void __spin_lock(volatile int *lock) { - while (__sync_lock_test_and_set(lock, 1)) - while (*lock) { - } -} -static void __spin_unlock(volatile int *lock) { __sync_lock_release(lock); } - - -// Make sure the lock is on its own cache line to prevent false sharing. -// Put it inside a struct that is aligned and padded to the typical MIPS -// cacheline which is 32 bytes. -static struct { - int lock; - char pad[32 - sizeof(int)]; -} __attribute__((aligned(32))) lock = {0}; - -template -T __mips_sync_fetch_and_add(volatile T *ptr, T val) { - T ret; - - __spin_lock(&lock.lock); - - ret = *ptr; - *ptr = ret + val; - - __spin_unlock(&lock.lock); - - return ret; -} - -template -T __mips_sync_val_compare_and_swap(volatile T *ptr, T oldval, T newval) { - T ret; - __spin_lock(&lock.lock); - - ret = *ptr; - if (ret == oldval) *ptr = newval; - - __spin_unlock(&lock.lock); - - return ret; -} -#endif *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Dec 24 01:01:11 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E815E883AD; Sun, 24 Dec 2017 01:01:11 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D90E07F0DA; Sun, 24 Dec 2017 01:01:09 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBO118qJ075208; Sun, 24 Dec 2017 01:01:08 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBO1181G075207; Sun, 24 Dec 2017 01:01:08 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201712240101.vBO1181G075207@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 24 Dec 2017 01:01:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r327133 - vendor/lldb/lldb-trunk-r321414 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/lldb/lldb-trunk-r321414 X-SVN-Commit-Revision: 327133 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Dec 2017 01:01:12 -0000 Author: dim Date: Sun Dec 24 01:01:08 2017 New Revision: 327133 URL: https://svnweb.freebsd.org/changeset/base/327133 Log: Tag lldb trunk r321414. Added: vendor/lldb/lldb-trunk-r321414/ - copied from r327132, vendor/lldb/dist/ From owner-svn-src-all@freebsd.org Sun Dec 24 01:00:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A548E8838E; Sun, 24 Dec 2017 01:00:59 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A0F37EEE4; Sun, 24 Dec 2017 01:00:57 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBO10ub4075071; Sun, 24 Dec 2017 01:00:56 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBO10u3G075070; Sun, 24 Dec 2017 01:00:56 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201712240100.vBO10u3G075070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 24 Dec 2017 01:00:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r327131 - vendor/lld/lld-trunk-r321414 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/lld/lld-trunk-r321414 X-SVN-Commit-Revision: 327131 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Dec 2017 01:00:59 -0000 Author: dim Date: Sun Dec 24 01:00:56 2017 New Revision: 327131 URL: https://svnweb.freebsd.org/changeset/base/327131 Log: Tag lld trunk r321414. Added: vendor/lld/lld-trunk-r321414/ - copied from r327130, vendor/lld/dist/ From owner-svn-src-all@freebsd.org Sun Dec 24 01:01:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F5CAE883A1; Sun, 24 Dec 2017 01:01:07 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9E29A7F002; Sun, 24 Dec 2017 01:01:04 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBO113il075161; Sun, 24 Dec 2017 01:01:03 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBO110JK075129; Sun, 24 Dec 2017 01:01:00 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201712240101.vBO110JK075129@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 24 Dec 2017 01:01:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r327132 - in vendor/lldb/dist: include/lldb/Interpreter include/lldb/Symbol include/lldb/Target include/lldb/Utility packages/Python/lldbsuite/test/expression_command/radar_9673664 pack... X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/lldb/dist: include/lldb/Interpreter include/lldb/Symbol include/lldb/Target include/lldb/Utility packages/Python/lldbsuite/test/expression_command/radar_9673664 packages/Python/lldbsuite/tes... X-SVN-Commit-Revision: 327132 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Dec 2017 01:01:07 -0000 Author: dim Date: Sun Dec 24 01:01:00 2017 New Revision: 327132 URL: https://svnweb.freebsd.org/changeset/base/327132 Log: Vendor import of lldb trunk r321414: https://llvm.org/svn/llvm-project/lldb/trunk@321414 Added: vendor/lldb/dist/packages/Python/lldbsuite/test/python_api/process/read-mem-cstring/ vendor/lldb/dist/packages/Python/lldbsuite/test/python_api/process/read-mem-cstring/Makefile (contents, props changed) vendor/lldb/dist/packages/Python/lldbsuite/test/python_api/process/read-mem-cstring/TestReadMemCString.py (contents, props changed) vendor/lldb/dist/packages/Python/lldbsuite/test/python_api/process/read-mem-cstring/main.c (contents, props changed) Modified: vendor/lldb/dist/include/lldb/Interpreter/OptionValueFileSpec.h vendor/lldb/dist/include/lldb/Symbol/ObjectFile.h vendor/lldb/dist/include/lldb/Target/Target.h vendor/lldb/dist/include/lldb/Utility/DataBufferLLVM.h vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/radar_9673664/TestExprHelpExamples.py vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/top-level/test.cpp vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpNew.py vendor/lldb/dist/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/TestConflictingSymbol.py vendor/lldb/dist/packages/Python/lldbsuite/test/lang/cpp/lambdas/main.cpp vendor/lldb/dist/scripts/Python/python-typemaps.swig vendor/lldb/dist/source/Interpreter/OptionValueFileSpec.cpp vendor/lldb/dist/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp vendor/lldb/dist/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp vendor/lldb/dist/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp vendor/lldb/dist/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp vendor/lldb/dist/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp vendor/lldb/dist/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp vendor/lldb/dist/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp vendor/lldb/dist/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp vendor/lldb/dist/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp vendor/lldb/dist/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h vendor/lldb/dist/source/Symbol/ObjectFile.cpp vendor/lldb/dist/source/Target/Target.cpp vendor/lldb/dist/source/Utility/DataBufferLLVM.cpp vendor/lldb/dist/tools/debugserver/debugserver.xcodeproj/project.pbxproj vendor/lldb/dist/tools/debugserver/source/RNBContext.cpp vendor/lldb/dist/tools/debugserver/source/RNBContext.h vendor/lldb/dist/tools/debugserver/source/debugserver.cpp vendor/lldb/dist/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp vendor/lldb/dist/tools/lldb-mi/MIUtilString.cpp vendor/lldb/dist/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp vendor/lldb/dist/unittests/tools/lldb-server/CMakeLists.txt vendor/lldb/dist/unittests/tools/lldb-server/tests/LLGSTest.cpp vendor/lldb/dist/unittests/tools/lldb-server/tests/TestClient.cpp vendor/lldb/dist/unittests/tools/lldb-server/tests/TestClient.h Modified: vendor/lldb/dist/include/lldb/Interpreter/OptionValueFileSpec.h ============================================================================== --- vendor/lldb/dist/include/lldb/Interpreter/OptionValueFileSpec.h Sun Dec 24 01:00:56 2017 (r327131) +++ vendor/lldb/dist/include/lldb/Interpreter/OptionValueFileSpec.h Sun Dec 24 01:01:00 2017 (r327132) @@ -77,7 +77,7 @@ class OptionValueFileSpec : public OptionValue { (publ void SetDefaultValue(const FileSpec &value) { m_default_value = value; } - const lldb::DataBufferSP &GetFileContents(bool null_terminate); + const lldb::DataBufferSP &GetFileContents(); void SetCompletionMask(uint32_t mask) { m_completion_mask = mask; } Modified: vendor/lldb/dist/include/lldb/Symbol/ObjectFile.h ============================================================================== --- vendor/lldb/dist/include/lldb/Symbol/ObjectFile.h Sun Dec 24 01:00:56 2017 (r327131) +++ vendor/lldb/dist/include/lldb/Symbol/ObjectFile.h Sun Dec 24 01:01:00 2017 (r327132) @@ -879,6 +879,9 @@ class ObjectFile : public std::enable_shared_from_this ConstString GetNextSyntheticSymbolName(); + static lldb::DataBufferSP MapFileData(const FileSpec &file, uint64_t Size, + uint64_t Offset); + private: DISALLOW_COPY_AND_ASSIGN(ObjectFile); }; Modified: vendor/lldb/dist/include/lldb/Target/Target.h ============================================================================== --- vendor/lldb/dist/include/lldb/Target/Target.h Sun Dec 24 01:00:56 2017 (r327131) +++ vendor/lldb/dist/include/lldb/Target/Target.h Sun Dec 24 01:01:00 2017 (r327132) @@ -161,7 +161,7 @@ class TargetProperties : public Properties { (public) lldb::LanguageType GetLanguage() const; - const char *GetExpressionPrefixContentsAsCString(); + llvm::StringRef GetExpressionPrefixContents(); bool GetUseHexImmediates() const; Modified: vendor/lldb/dist/include/lldb/Utility/DataBufferLLVM.h ============================================================================== --- vendor/lldb/dist/include/lldb/Utility/DataBufferLLVM.h Sun Dec 24 01:00:56 2017 (r327131) +++ vendor/lldb/dist/include/lldb/Utility/DataBufferLLVM.h Sun Dec 24 01:01:00 2017 (r327132) @@ -17,7 +17,7 @@ #include // for uint8_t, uint64_t namespace llvm { -class MemoryBuffer; +class WritableMemoryBuffer; class Twine; } @@ -28,10 +28,10 @@ class DataBufferLLVM : public DataBuffer { (public) ~DataBufferLLVM(); static std::shared_ptr - CreateSliceFromPath(const llvm::Twine &Path, uint64_t Size, uint64_t Offset, bool Private = false); + CreateSliceFromPath(const llvm::Twine &Path, uint64_t Size, uint64_t Offset); static std::shared_ptr - CreateFromPath(const llvm::Twine &Path, bool NullTerminate = false, bool Private = false); + CreateFromPath(const llvm::Twine &Path); uint8_t *GetBytes() override; const uint8_t *GetBytes() const override; @@ -42,10 +42,9 @@ class DataBufferLLVM : public DataBuffer { (public) private: /// \brief Construct a DataBufferLLVM from \p Buffer. \p Buffer must be a /// valid pointer. - explicit DataBufferLLVM(std::unique_ptr Buffer); - const uint8_t *GetBuffer() const; + explicit DataBufferLLVM(std::unique_ptr Buffer); - std::unique_ptr Buffer; + std::unique_ptr Buffer; }; } Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/radar_9673664/TestExprHelpExamples.py ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/radar_9673664/TestExprHelpExamples.py Sun Dec 24 01:00:56 2017 (r327131) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/radar_9673664/TestExprHelpExamples.py Sun Dec 24 01:01:00 2017 (r327132) @@ -42,7 +42,7 @@ class Radar9673644TestCase(TestBase): # rdar://problem/9673664 lldb expression evaluation problem - self.expect('expr char c[] = "foo"; c[0]', + self.expect('expr char str[] = "foo"; str[0]', substrs=["'f'"]) # runCmd: expr char c[] = "foo"; c[0] # output: (char) $0 = 'f' Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/top-level/test.cpp ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/top-level/test.cpp Sun Dec 24 01:00:56 2017 (r327131) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/top-level/test.cpp Sun Dec 24 01:01:00 2017 (r327132) @@ -42,11 +42,11 @@ class AnotherClass (public) int i; } s = { 15 }; - int as[4] = { 2, 3, 4, 5 }; + int numbers[4] = { 2, 3, 4, 5 }; - for (signed char a : as) + for (signed char number: numbers) { - s.i -= a; + s.i -= number; } return s.i; @@ -94,14 +94,14 @@ class DiamondD : public DiamondB, public DiamondC (pub int doTest() { - int a = m.memberResult(); - a += MyClass::staticResult(); - a += m.externResult(); - a += MyEnum::myEnumThree; - a += myEnumOne; - a += AnotherClass().complicatedFunction(); - a += DiamondD(3).accessor(); - return a; + int accumulator = m.memberResult(); + accumulator += MyClass::staticResult(); + accumulator += m.externResult(); + accumulator += MyEnum::myEnumThree; + accumulator += myEnumOne; + accumulator += AnotherClass().complicatedFunction(); + accumulator += DiamondD(3).accessor(); + return accumulator; } // -- Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py Sun Dec 24 01:00:56 2017 (r327131) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py Sun Dec 24 01:01:00 2017 (r327132) @@ -29,12 +29,14 @@ class ExecTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) @skipUnlessDarwin + @expectedFailureAll(oslist=['macosx'], bugnumber="rdar://36134350") # when building with cmake on green gragon or on ci.swift.org, this test fails. @expectedFailureAll(archs=['i386'], bugnumber="rdar://28656532") @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], bugnumber="rdar://problem/34559552") # this exec test has problems on ios systems def test_hitting_exec (self): self.do_test(False) @skipUnlessDarwin + @expectedFailureAll(oslist=['macosx'], bugnumber="rdar://36134350") # when building with cmake on green gragon or on ci.swift.org, this test fails. @expectedFailureAll(archs=['i386'], bugnumber="rdar://28656532") @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], bugnumber="rdar://problem/34559552") # this exec test has problems on ios systems def test_skipping_exec (self): Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpNew.py ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpNew.py Sun Dec 24 01:00:56 2017 (r327131) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpNew.py Sun Dec 24 01:01:00 2017 (r327132) @@ -117,7 +117,7 @@ class MiniDumpNewTestCase(TestBase): thread = self.process.GetThreadAtIndex(0) self.assertEqual(thread.GetStopReason(), lldb.eStopReasonNone) stop_description = thread.GetStopDescription(256) - self.assertEqual(stop_description, None) + self.assertEqual(stop_description, "") def do_test_deeper_stack(self, binary, core, pid): target = self.dbg.CreateTarget(binary) Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/TestConflictingSymbol.py ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/TestConflictingSymbol.py Sun Dec 24 01:00:56 2017 (r327131) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/TestConflictingSymbol.py Sun Dec 24 01:01:00 2017 (r327132) @@ -16,6 +16,13 @@ class TestConflictingSymbols(TestBase): mydir = TestBase.compute_mydir(__file__) NO_DEBUG_INFO_TESTCASE = True + def setUp(self): + TestBase.setUp(self) + + self.One_line = line_number('One/One.c', '// break here') + self.Two_line = line_number('Two/Two.c', '// break here') + self.main_line = line_number('main.c', '// break here') + def test_conflicting_symbols(self): self.build() exe = os.path.join(os.getcwd(), "a.out") @@ -27,15 +34,12 @@ class TestConflictingSymbols(TestBase): environment = self.registerSharedLibrariesWithTarget( target, ['One', 'Two']) - One_line = line_number('One/One.c', '// break here') - Two_line = line_number('Two/Two.c', '// break here') - main_line = line_number('main.c', '// break here') lldbutil.run_break_set_command( - self, 'breakpoint set -f One.c -l %s' % (One_line)) + self, 'breakpoint set -f One.c -l %s' % (self.One_line)) lldbutil.run_break_set_command( - self, 'breakpoint set -f Two.c -l %s' % (Two_line)) + self, 'breakpoint set -f Two.c -l %s' % (self.Two_line)) lldbutil.run_break_set_by_file_and_line( - self, 'main.c', main_line, num_expected_locations=1, loc_exact=True) + self, 'main.c', self.main_line, num_expected_locations=1, loc_exact=True) process = target.LaunchSimple( None, environment, self.get_process_working_directory()) @@ -88,3 +92,32 @@ class TestConflictingSymbols(TestBase): error=True, substrs=[ "Multiple internal symbols"]) + + @expectedFailureAll(bugnumber="llvm.org/pr35043") + def test_shadowed(self): + self.build() + exe = os.path.join(os.getcwd(), "a.out") + target = self.dbg.CreateTarget("a.out") + self.assertTrue(target, VALID_TARGET) + + # Register our shared libraries for remote targets so they get + # automatically uploaded + environment = self.registerSharedLibrariesWithTarget( + target, ['One', 'Two']) + + lldbutil.run_break_set_by_file_and_line(self, 'main.c', self.main_line) + + process = target.LaunchSimple( + None, environment, self.get_process_working_directory()) + self.assertTrue(process, PROCESS_IS_VALID) + + # The stop reason of the thread should be breakpoint. + self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, + substrs=['stopped', + 'stop reason = breakpoint']) + + # As we are shadowing the conflicting symbol, there should be no + # ambiguity in this expression. + self.expect( + "expr int conflicting_symbol = 474747; conflicting_symbol", + substrs=[ "474747"]) Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/lang/cpp/lambdas/main.cpp ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/lang/cpp/lambdas/main.cpp Sun Dec 24 01:00:56 2017 (r327131) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/lang/cpp/lambdas/main.cpp Sun Dec 24 01:01:00 2017 (r327132) @@ -11,7 +11,7 @@ int main (int argc, char const *argv[]) { - printf("Stop here\n"); //% self.runCmd("expression auto $add = [](int a, int b) { return a + b; }") + printf("Stop here\n"); //% self.runCmd("expression auto $add = [](int first, int second) { return first + second; }") //% self.expect("expression $add(2,3)", substrs = ['= 5']) return 0; } Added: vendor/lldb/dist/packages/Python/lldbsuite/test/python_api/process/read-mem-cstring/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/python_api/process/read-mem-cstring/Makefile Sun Dec 24 01:01:00 2017 (r327132) @@ -0,0 +1,6 @@ +LEVEL = ../../../make + +C_SOURCES := main.c +EXE := read-mem-cstring + +include $(LEVEL)/Makefile.rules Added: vendor/lldb/dist/packages/Python/lldbsuite/test/python_api/process/read-mem-cstring/TestReadMemCString.py ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/python_api/process/read-mem-cstring/TestReadMemCString.py Sun Dec 24 01:01:00 2017 (r327132) @@ -0,0 +1,57 @@ +"""Test reading c-strings from memory via SB API.""" + +from __future__ import print_function + +import os +import lldb +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + + +class TestReadMemCString(TestBase): + + mydir = TestBase.compute_mydir(__file__) + NO_DEBUG_INFO_TESTCASE = True + + def test_read_memory_c_string(self): + """Test corner case behavior of SBProcess::ReadCStringFromMemory""" + self.build() + self.dbg.SetAsync(False) + + self.main_source = "main.c" + self.main_source_spec = lldb.SBFileSpec(self.main_source) + self.exe = os.path.join(os.getcwd(), "read-mem-cstring") + + (target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint( + self, 'breakpoint here', self.main_source_spec, None, self.exe) + + frame = thread.GetFrameAtIndex(0) + + err = lldb.SBError() + + empty_str_addr = frame.FindVariable("empty_string").GetValueAsUnsigned(err) + self.assertTrue(err.Success()) + self.assertTrue(empty_str_addr != lldb.LLDB_INVALID_ADDRESS) + + one_letter_str_addr = frame.FindVariable("one_letter_string").GetValueAsUnsigned(err) + self.assertTrue(err.Success()) + self.assertTrue(one_letter_str_addr != lldb.LLDB_INVALID_ADDRESS) + + invalid_memory_str_addr = frame.FindVariable("invalid_memory_string").GetValueAsUnsigned(err) + self.assertTrue(err.Success()) + self.assertTrue(invalid_memory_str_addr != lldb.LLDB_INVALID_ADDRESS) + + # Important: An empty (0-length) c-string must come back as a Python string, not a + # None object. + empty_str = process.ReadCStringFromMemory(empty_str_addr, 2048, err) + self.assertTrue(err.Success()) + self.assertTrue(empty_str == "") + + one_letter_string = process.ReadCStringFromMemory(one_letter_str_addr, 2048, err) + self.assertTrue(err.Success()) + self.assertTrue(one_letter_string == "1") + + invalid_memory_string = process.ReadCStringFromMemory(invalid_memory_str_addr, 2048, err) + self.assertTrue(err.Fail()) + self.assertTrue(invalid_memory_string == "" or invalid_memory_string == None) Added: vendor/lldb/dist/packages/Python/lldbsuite/test/python_api/process/read-mem-cstring/main.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/python_api/process/read-mem-cstring/main.c Sun Dec 24 01:01:00 2017 (r327132) @@ -0,0 +1,11 @@ +#include +int main () +{ + const char *empty_string = ""; + const char *one_letter_string = "1"; + // This expects that lower 4k of memory will be mapped unreadable, which most + // OSs do (to catch null pointer dereferences). + const char *invalid_memory_string = (char*)0x100; + + return empty_string[0] + one_letter_string[0]; // breakpoint here +} Modified: vendor/lldb/dist/scripts/Python/python-typemaps.swig ============================================================================== --- vendor/lldb/dist/scripts/Python/python-typemaps.swig Sun Dec 24 01:00:56 2017 (r327131) +++ vendor/lldb/dist/scripts/Python/python-typemaps.swig Sun Dec 24 01:01:00 2017 (r327132) @@ -102,7 +102,8 @@ %typemap(argout) (char *dst, size_t dst_len) { Py_XDECREF($result); /* Blow away any previous result */ if (result == 0) { - $result = Py_None; + lldb_private::PythonString string(""); + $result = string.release(); Py_INCREF($result); } else { llvm::StringRef ref(static_cast($1), result); Modified: vendor/lldb/dist/source/Interpreter/OptionValueFileSpec.cpp ============================================================================== --- vendor/lldb/dist/source/Interpreter/OptionValueFileSpec.cpp Sun Dec 24 01:00:56 2017 (r327131) +++ vendor/lldb/dist/source/Interpreter/OptionValueFileSpec.cpp Sun Dec 24 01:01:00 2017 (r327132) @@ -113,14 +113,12 @@ size_t OptionValueFileSpec::AutoComplete( return matches.GetSize(); } -const lldb::DataBufferSP & -OptionValueFileSpec::GetFileContents(bool null_terminate) { +const lldb::DataBufferSP &OptionValueFileSpec::GetFileContents() { if (m_current_value) { const auto file_mod_time = FileSystem::GetModificationTime(m_current_value); if (m_data_sp && m_data_mod_time == file_mod_time) return m_data_sp; - m_data_sp = DataBufferLLVM::CreateFromPath(m_current_value.GetPath(), - null_terminate); + m_data_sp = DataBufferLLVM::CreateFromPath(m_current_value.GetPath()); m_data_mod_time = file_mod_time; } return m_data_sp; Modified: vendor/lldb/dist/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp Sun Dec 24 01:00:56 2017 (r327131) +++ vendor/lldb/dist/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp Sun Dec 24 01:01:00 2017 (r327132) @@ -1127,6 +1127,11 @@ DisassemblerLLVMC::DisassemblerLLVMC(const ArchSpec &a features_str += "+dspr2,"; } + // If any AArch64 variant, enable the ARMv8.2 ISA + // extensions so we can disassemble newer instructions. + if (triple.getArch() == llvm::Triple::aarch64) + features_str += "+v8.2a"; + m_disasm_ap.reset(new LLVMCDisassembler(triple_str, cpu, features_str.c_str(), flavor, *this)); if (!m_disasm_ap->IsValid()) { Modified: vendor/lldb/dist/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp Sun Dec 24 01:00:56 2017 (r327131) +++ vendor/lldb/dist/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp Sun Dec 24 01:01:00 2017 (r327132) @@ -24,7 +24,6 @@ #include "lldb/Target/Target.h" #include "lldb/Utility/ArchSpec.h" #include "lldb/Utility/DataBufferHeap.h" -#include "lldb/Utility/DataBufferLLVM.h" #include "lldb/Utility/Log.h" #include "lldb/Utility/Status.h" #include "lldb/Utility/Stream.h" @@ -406,8 +405,7 @@ ObjectFile *ObjectFileELF::CreateInstance(const lldb:: lldb::offset_t file_offset, lldb::offset_t length) { if (!data_sp) { - data_sp = - DataBufferLLVM::CreateSliceFromPath(file->GetPath(), length, file_offset, true); + data_sp = MapFileData(*file, length, file_offset); if (!data_sp) return nullptr; data_offset = 0; @@ -424,8 +422,7 @@ ObjectFile *ObjectFileELF::CreateInstance(const lldb:: // Update the data to contain the entire file if it doesn't already if (data_sp->GetByteSize() < length) { - data_sp = - DataBufferLLVM::CreateSliceFromPath(file->GetPath(), length, file_offset, true); + data_sp = MapFileData(*file, length, file_offset); if (!data_sp) return nullptr; data_offset = 0; @@ -684,8 +681,7 @@ size_t ObjectFileELF::GetModuleSpecifications( size_t section_header_end = header.e_shoff + header.e_shentsize; if (header.HasHeaderExtension() && section_header_end > data_sp->GetByteSize()) { - data_sp = DataBufferLLVM::CreateSliceFromPath( - file.GetPath(), section_header_end, file_offset); + data_sp = MapFileData(file, section_header_end, file_offset); if (data_sp) { data.SetData(data_sp); lldb::offset_t header_offset = data_offset; @@ -698,8 +694,7 @@ size_t ObjectFileELF::GetModuleSpecifications( section_header_end = header.e_shoff + header.e_shnum * header.e_shentsize; if (section_header_end > data_sp->GetByteSize()) { - data_sp = DataBufferLLVM::CreateSliceFromPath( - file.GetPath(), section_header_end, file_offset); + data_sp = MapFileData(file, section_header_end, file_offset); if (data_sp) data.SetData(data_sp); } @@ -741,8 +736,7 @@ size_t ObjectFileELF::GetModuleSpecifications( size_t program_headers_end = header.e_phoff + header.e_phnum * header.e_phentsize; if (program_headers_end > data_sp->GetByteSize()) { - data_sp = DataBufferLLVM::CreateSliceFromPath( - file.GetPath(), program_headers_end, file_offset); + data_sp = MapFileData(file, program_headers_end, file_offset); if (data_sp) data.SetData(data_sp); } @@ -757,8 +751,7 @@ size_t ObjectFileELF::GetModuleSpecifications( } if (segment_data_end > data_sp->GetByteSize()) { - data_sp = DataBufferLLVM::CreateSliceFromPath( - file.GetPath(), segment_data_end, file_offset); + data_sp = MapFileData(file, segment_data_end, file_offset); if (data_sp) data.SetData(data_sp); } @@ -767,8 +760,7 @@ size_t ObjectFileELF::GetModuleSpecifications( CalculateELFNotesSegmentsCRC32(program_headers, data); } else { // Need to map entire file into memory to calculate the crc. - data_sp = DataBufferLLVM::CreateSliceFromPath(file.GetPath(), -1, - file_offset); + data_sp = MapFileData(file, -1, file_offset); if (data_sp) { data.SetData(data_sp); gnu_debuglink_crc = calc_gnu_debuglink_crc32( Modified: vendor/lldb/dist/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Sun Dec 24 01:00:56 2017 (r327131) +++ vendor/lldb/dist/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Sun Dec 24 01:01:00 2017 (r327132) @@ -38,7 +38,7 @@ #include "lldb/Target/Thread.h" #include "lldb/Target/ThreadList.h" #include "lldb/Utility/ArchSpec.h" -#include "lldb/Utility/DataBufferLLVM.h" +#include "lldb/Utility/DataBuffer.h" #include "lldb/Utility/FileSpec.h" #include "lldb/Utility/Log.h" #include "lldb/Utility/Status.h" @@ -862,8 +862,7 @@ ObjectFile *ObjectFileMachO::CreateInstance(const lldb lldb::offset_t file_offset, lldb::offset_t length) { if (!data_sp) { - data_sp = - DataBufferLLVM::CreateSliceFromPath(file->GetPath(), length, file_offset); + data_sp = MapFileData(*file, length, file_offset); if (!data_sp) return nullptr; data_offset = 0; @@ -874,8 +873,7 @@ ObjectFile *ObjectFileMachO::CreateInstance(const lldb // Update the data to contain the entire file if it doesn't already if (data_sp->GetByteSize() < length) { - data_sp = - DataBufferLLVM::CreateSliceFromPath(file->GetPath(), length, file_offset); + data_sp = MapFileData(*file, length, file_offset); if (!data_sp) return nullptr; data_offset = 0; @@ -914,8 +912,7 @@ size_t ObjectFileMachO::GetModuleSpecifications( size_t header_and_load_cmds = header.sizeofcmds + MachHeaderSizeFromMagic(header.magic); if (header_and_load_cmds >= data_sp->GetByteSize()) { - data_sp = DataBufferLLVM::CreateSliceFromPath( - file.GetPath(), header_and_load_cmds, file_offset); + data_sp = MapFileData(file, header_and_load_cmds, file_offset); data.SetData(data_sp); data_offset = MachHeaderSizeFromMagic(header.magic); } @@ -1127,8 +1124,7 @@ bool ObjectFileMachO::ParseHeader() { ReadMemory(process_sp, m_memory_addr, header_and_lc_size); } else { // Read in all only the load command data from the file on disk - data_sp = DataBufferLLVM::CreateSliceFromPath( - m_file.GetPath(), header_and_lc_size, m_file_offset); + data_sp = MapFileData(m_file, header_and_lc_size, m_file_offset); if (data_sp->GetByteSize() != header_and_lc_size) return false; } @@ -2100,9 +2096,8 @@ UUID ObjectFileMachO::GetSharedCacheUUID(FileSpec dyld const ByteOrder byte_order, const uint32_t addr_byte_size) { UUID dsc_uuid; - DataBufferSP DscData = DataBufferLLVM::CreateSliceFromPath( - dyld_shared_cache.GetPath(), - sizeof(struct lldb_copy_dyld_cache_header_v1), 0); + DataBufferSP DscData = MapFileData( + dyld_shared_cache, sizeof(struct lldb_copy_dyld_cache_header_v1), 0); if (!DscData) return dsc_uuid; DataExtractor dsc_header_data(DscData, byte_order, addr_byte_size); @@ -2708,9 +2703,8 @@ size_t ObjectFileMachO::ParseSymtab() { // Process the dyld shared cache header to find the unmapped symbols - DataBufferSP dsc_data_sp = DataBufferLLVM::CreateSliceFromPath( - dsc_filespec.GetPath(), sizeof(struct lldb_copy_dyld_cache_header_v1), - 0); + DataBufferSP dsc_data_sp = MapFileData( + dsc_filespec, sizeof(struct lldb_copy_dyld_cache_header_v1), 0); if (!dsc_uuid.IsValid()) { dsc_uuid = GetSharedCacheUUID(dsc_filespec, byte_order, addr_byte_size); } @@ -2742,11 +2736,9 @@ size_t ObjectFileMachO::ParseSymtab() { if (uuid_match && mappingOffset >= sizeof(struct lldb_copy_dyld_cache_header_v1)) { - DataBufferSP dsc_mapping_info_data_sp = - DataBufferLLVM::CreateSliceFromPath( - dsc_filespec.GetPath(), - sizeof(struct lldb_copy_dyld_cache_mapping_info), - mappingOffset); + DataBufferSP dsc_mapping_info_data_sp = MapFileData( + dsc_filespec, sizeof(struct lldb_copy_dyld_cache_mapping_info), + mappingOffset); DataExtractor dsc_mapping_info_data(dsc_mapping_info_data_sp, byte_order, addr_byte_size); @@ -2770,9 +2762,7 @@ size_t ObjectFileMachO::ParseSymtab() { if (localSymbolsOffset && localSymbolsSize) { // Map the local symbols DataBufferSP dsc_local_symbols_data_sp = - DataBufferLLVM::CreateSliceFromPath(dsc_filespec.GetPath(), - localSymbolsSize, - localSymbolsOffset); + MapFileData(dsc_filespec, localSymbolsSize, localSymbolsOffset); if (dsc_local_symbols_data_sp) { DataExtractor dsc_local_symbols_data(dsc_local_symbols_data_sp, Modified: vendor/lldb/dist/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp Sun Dec 24 01:00:56 2017 (r327131) +++ vendor/lldb/dist/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp Sun Dec 24 01:01:00 2017 (r327132) @@ -22,7 +22,6 @@ #include "lldb/Target/Target.h" #include "lldb/Utility/ArchSpec.h" #include "lldb/Utility/DataBufferHeap.h" -#include "lldb/Utility/DataBufferLLVM.h" #include "lldb/Utility/FileSpec.h" #include "lldb/Utility/StreamString.h" #include "lldb/Utility/Timer.h" @@ -66,8 +65,7 @@ ObjectFile *ObjectFilePECOFF::CreateInstance(const lld lldb::offset_t file_offset, lldb::offset_t length) { if (!data_sp) { - data_sp = - DataBufferLLVM::CreateSliceFromPath(file->GetPath(), length, file_offset); + data_sp = MapFileData(file, length, file_offset); if (!data_sp) return nullptr; data_offset = 0; @@ -78,8 +76,7 @@ ObjectFile *ObjectFilePECOFF::CreateInstance(const lld // Update the data to contain the entire file if it doesn't already if (data_sp->GetByteSize() < length) { - data_sp = - DataBufferLLVM::CreateSliceFromPath(file->GetPath(), length, file_offset); + data_sp = MapFileData(file, length, file_offset); if (!data_sp) return nullptr; } @@ -436,8 +433,7 @@ DataExtractor ObjectFilePECOFF::ReadImageData(uint32_t if (m_file) { // A bit of a hack, but we intend to write to this buffer, so we can't // mmap it. - auto buffer_sp = - DataBufferLLVM::CreateSliceFromPath(m_file.GetPath(), size, offset, true); + auto buffer_sp = MapFileData(m_file, size, offset); return DataExtractor(buffer_sp, GetByteOrder(), GetAddressByteSize()); } ProcessSP process_sp(m_process_wp.lock()); Modified: vendor/lldb/dist/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp Sun Dec 24 01:00:56 2017 (r327131) +++ vendor/lldb/dist/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp Sun Dec 24 01:01:00 2017 (r327132) @@ -1173,7 +1173,7 @@ const char *PlatformDarwin::GetDeveloperDirectory() { xcode_dir_path.append("/usr/share/xcode-select/xcode_dir_path"); temp_file_spec.SetFile(xcode_dir_path, false); auto dir_buffer = - DataBufferLLVM::CreateFromPath(temp_file_spec.GetPath(), true); + DataBufferLLVM::CreateFromPath(temp_file_spec.GetPath()); if (dir_buffer && dir_buffer->GetByteSize() > 0) { llvm::StringRef path_ref(dir_buffer->GetChars()); // Trim tailing newlines and make sure there is enough room for a null Modified: vendor/lldb/dist/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp Sun Dec 24 01:00:56 2017 (r327131) +++ vendor/lldb/dist/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp Sun Dec 24 01:01:00 2017 (r327132) @@ -98,7 +98,7 @@ bool CommunicationKDP::SendRequestAndGetReply( #ifdef LLDB_CONFIGURATION_DEBUG // NOTE: this only works for packets that are in native endian byte order assert(request_packet.GetSize() == - *((uint16_t *)(request_packet.GetData() + 2))); + *((const uint16_t *)(request_packet.GetData() + 2))); #endif lldb::offset_t offset = 1; const uint32_t num_retries = 3; Modified: vendor/lldb/dist/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp Sun Dec 24 01:00:56 2017 (r327131) +++ vendor/lldb/dist/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp Sun Dec 24 01:01:00 2017 (r327132) @@ -60,6 +60,7 @@ StateType GDBRemoteClientBase::SendContinuePacketAndWa continue; if (steady_clock::now() >= m_interrupt_time + kInterruptTimeout) return eStateInvalid; + break; } case PacketResult::Success: break; Modified: vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp Sun Dec 24 01:00:56 2017 (r327131) +++ vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp Sun Dec 24 01:01:00 2017 (r327132) @@ -1743,8 +1743,8 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const S "DWARF DW_TAG_array_type DIE at 0x%8.8x has a " "class/union/struct element type DIE 0x%8.8x that is a " "forward declaration, not a complete definition.\nTry " - "compiling the source file with -fno-limit-debug-info or " - "disable -gmodule", + "compiling the source file with -fstandalone-debug or " + "disable -gmodules", die.GetOffset(), type_die_ref.die_offset); else module_sp->ReportError( @@ -2255,7 +2255,7 @@ bool DWARFASTParserClang::CompleteTypeFromDWARF(const if (die.GetCU()->GetProducer() == DWARFCompileUnit::eProducerClang) module->ReportError(":: Try compiling the source file with " - "-fno-limit-debug-info."); + "-fstandalone-debug."); // We have no choice other than to pretend that the base class // is complete. If we don't do this, clang will crash when we @@ -3095,7 +3095,7 @@ bool DWARFASTParserClang::ParseChildMembers( "DWARF DIE at 0x%8.8x (class %s) has a member variable " "0x%8.8x (%s) whose type is a forward declaration, not a " "complete definition.\nTry compiling the source file " - "with -fno-limit-debug-info", + "with -fstandalone-debug", parent_die.GetOffset(), parent_die.GetName(), die.GetOffset(), name); else Modified: vendor/lldb/dist/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp Sun Dec 24 01:00:56 2017 (r327131) +++ vendor/lldb/dist/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp Sun Dec 24 01:01:00 2017 (r327132) @@ -124,6 +124,8 @@ lldb::TypeSP PDBASTParser::CreateLLDBTypeFromPDBType(c } else if (auto type_def = llvm::dyn_cast(&type)) { lldb_private::Type *target_type = m_ast.GetSymbolFile()->ResolveTypeUID(type_def->getTypeId()); + if (!target_type) + return nullptr; std::string name = type_def->getName(); uint64_t bytes = type_def->getLength(); if (!target_type) @@ -179,6 +181,8 @@ lldb::TypeSP PDBASTParser::CreateLLDBTypeFromPDBType(c lldb_private::Type *element_type = m_ast.GetSymbolFile()->ResolveTypeUID(element_uid); + if (!element_type) + return nullptr; CompilerType element_ast_type = element_type->GetFullCompilerType(); CompilerType array_ast_type = m_ast.CreateArrayType(element_ast_type, num_elements, false); Modified: vendor/lldb/dist/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp Sun Dec 24 01:00:56 2017 (r327131) +++ vendor/lldb/dist/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp Sun Dec 24 01:01:00 2017 (r327132) @@ -19,14 +19,18 @@ #include "lldb/Symbol/ObjectFile.h" #include "lldb/Symbol/SymbolContext.h" #include "lldb/Symbol/TypeMap.h" +#include "lldb/Utility/RegularExpression.h" #include "llvm/DebugInfo/PDB/GenericError.h" +#include "llvm/DebugInfo/PDB/IPDBDataStream.h" #include "llvm/DebugInfo/PDB/IPDBEnumChildren.h" #include "llvm/DebugInfo/PDB/IPDBLineNumber.h" #include "llvm/DebugInfo/PDB/IPDBSourceFile.h" +#include "llvm/DebugInfo/PDB/IPDBTable.h" #include "llvm/DebugInfo/PDB/PDBSymbol.h" #include "llvm/DebugInfo/PDB/PDBSymbolCompiland.h" #include "llvm/DebugInfo/PDB/PDBSymbolCompilandDetails.h" +#include "llvm/DebugInfo/PDB/PDBSymbolData.h" #include "llvm/DebugInfo/PDB/PDBSymbolExe.h" #include "llvm/DebugInfo/PDB/PDBSymbolFunc.h" #include "llvm/DebugInfo/PDB/PDBSymbolFuncDebugEnd.h" @@ -93,6 +97,10 @@ SymbolFilePDB::SymbolFilePDB(lldb_private::ObjectFile SymbolFilePDB::~SymbolFilePDB() {} uint32_t SymbolFilePDB::CalculateAbilities() { + uint32_t abilities = 0; + if (!m_obj_file) + return 0; + if (!m_session_up) { // Lazily load and match the PDB file, but only do this once. std::string exePath = m_obj_file->GetFileSpec().GetPath(); @@ -100,10 +108,46 @@ uint32_t SymbolFilePDB::CalculateAbilities() { m_session_up); if (error) { llvm::consumeError(std::move(error)); - return 0; + auto module_sp = m_obj_file->GetModule(); + if (!module_sp) + return 0; + // See if any symbol file is specified through `--symfile` option. + FileSpec symfile = module_sp->GetSymbolFileFileSpec(); + if (!symfile) + return 0; + error = loadDataForPDB(PDB_ReaderType::DIA, + llvm::StringRef(symfile.GetPath()), + m_session_up); + if (error) { + llvm::consumeError(std::move(error)); + return 0; + } } } - return CompileUnits | LineTables; + if (!m_session_up.get()) + return 0; + + auto enum_tables_up = m_session_up->getEnumTables(); + if (!enum_tables_up) + return 0; + while (auto table_up = enum_tables_up->getNext()) { + if (table_up->getItemCount() == 0) + continue; + auto type = table_up->getTableType(); + switch (type) { + case PDB_TableType::Symbols: + // This table represents a store of symbols with types listed in + // PDBSym_Type + abilities |= (CompileUnits | Functions | Blocks | + GlobalVariables | LocalVariables | VariableTypes); + break; + case PDB_TableType::LineNumbers: + abilities |= LineTables; + break; + default: break; + } + } + return abilities; } void SymbolFilePDB::InitializeObject() { @@ -250,7 +294,8 @@ lldb_private::Type *SymbolFilePDB::ResolveTypeUID(lldb return nullptr; lldb::TypeSP result = pdb->CreateLLDBTypeFromPDBType(*pdb_type); - m_types.insert(std::make_pair(type_uid, result)); + if (result.get()) + m_types.insert(std::make_pair(type_uid, result)); return result.get(); } @@ -385,19 +430,16 @@ uint32_t SymbolFilePDB::FindTypes( std::string name_str = name.AsCString(); - // If this might be a regex, we have to return EVERY symbol and process them - // one by one, which is going to destroy performance on large PDB files. So - // try really hard not to use a regex match. - if (name_str.find_first_of("[]?*.-+\\") != std::string::npos) - FindTypesByRegex(name_str, max_matches, types); - else - FindTypesByName(name_str, max_matches, types); + // There is an assumption 'name' is not a regex + FindTypesByName(name_str, max_matches, types); + return types.GetSize(); } -void SymbolFilePDB::FindTypesByRegex(const std::string ®ex, - uint32_t max_matches, - lldb_private::TypeMap &types) { +void +SymbolFilePDB::FindTypesByRegex(const lldb_private::RegularExpression ®ex, + uint32_t max_matches, + lldb_private::TypeMap &types) { // When searching by regex, we need to go out of our way to limit the search // space as much as possible since this searches EVERYTHING in the PDB, // manually doing regex comparisons. PDB library isn't optimized for regex @@ -409,8 +451,6 @@ void SymbolFilePDB::FindTypesByRegex(const std::string auto global = m_session_up->getGlobalScope(); std::unique_ptr results; - std::regex re(regex); - uint32_t matches = 0; for (auto tag : tags_to_search) { @@ -433,7 +473,7 @@ void SymbolFilePDB::FindTypesByRegex(const std::string continue; } - if (!std::regex_match(type_name, re)) + if (!regex.Execute(type_name)) continue; // This should cause the type to get cached and stored in the `m_types` Modified: vendor/lldb/dist/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h ============================================================================== --- vendor/lldb/dist/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h Sun Dec 24 01:00:56 2017 (r327131) +++ vendor/lldb/dist/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h Sun Dec 24 01:01:00 2017 (r327132) @@ -172,7 +172,8 @@ class SymbolFilePDB : public lldb_private::SymbolFile const llvm::pdb::PDBSymbolCompiland &cu, llvm::DenseMap &index_map) const; - void FindTypesByRegex(const std::string ®ex, uint32_t max_matches, + void FindTypesByRegex(const lldb_private::RegularExpression ®ex, + uint32_t max_matches, lldb_private::TypeMap &types); void FindTypesByName(const std::string &name, uint32_t max_matches, Modified: vendor/lldb/dist/source/Symbol/ObjectFile.cpp ============================================================================== --- vendor/lldb/dist/source/Symbol/ObjectFile.cpp Sun Dec 24 01:00:56 2017 (r327131) +++ vendor/lldb/dist/source/Symbol/ObjectFile.cpp Sun Dec 24 01:01:00 2017 (r327132) @@ -688,3 +688,8 @@ Status ObjectFile::LoadInMemory(Target &target, bool s void ObjectFile::RelocateSection(lldb_private::Section *section) { } + +DataBufferSP ObjectFile::MapFileData(const FileSpec &file, uint64_t Size, + uint64_t Offset) { + return DataBufferLLVM::CreateSliceFromPath(file.GetPath(), Size, Offset); +} Modified: vendor/lldb/dist/source/Target/Target.cpp ============================================================================== --- vendor/lldb/dist/source/Target/Target.cpp Sun Dec 24 01:00:56 2017 (r327131) +++ vendor/lldb/dist/source/Target/Target.cpp Sun Dec 24 01:01:00 2017 (r327132) @@ -2313,7 +2313,7 @@ ExpressionResults Target::EvaluateExpression( result_valobj_sp = persistent_var_sp->GetValueObject(); execution_results = eExpressionCompleted; } else { - const char *prefix = GetExpressionPrefixContentsAsCString(); + llvm::StringRef prefix = GetExpressionPrefixContents(); Status error; execution_results = UserExpression::Evaluate(exe_ctx, options, expr, prefix, result_valobj_sp, error, @@ -4046,18 +4046,19 @@ LanguageType TargetProperties::GetLanguage() const { return LanguageType(); } -const char *TargetProperties::GetExpressionPrefixContentsAsCString() { +llvm::StringRef TargetProperties::GetExpressionPrefixContents() { const uint32_t idx = ePropertyExprPrefix; OptionValueFileSpec *file = m_collection_sp->GetPropertyAtIndexAsOptionValueFileSpec(nullptr, false, idx); if (file) { - const bool null_terminate = true; - DataBufferSP data_sp(file->GetFileContents(null_terminate)); + DataBufferSP data_sp(file->GetFileContents()); if (data_sp) - return (const char *)data_sp->GetBytes(); + return llvm::StringRef( + reinterpret_cast(data_sp->GetBytes()), + data_sp->GetByteSize()); } - return nullptr; + return ""; } bool TargetProperties::GetBreakpointsConsultPlatformAvoidList() { Modified: vendor/lldb/dist/source/Utility/DataBufferLLVM.cpp ============================================================================== --- vendor/lldb/dist/source/Utility/DataBufferLLVM.cpp Sun Dec 24 01:00:56 2017 (r327131) +++ vendor/lldb/dist/source/Utility/DataBufferLLVM.cpp Sun Dec 24 01:01:00 2017 (r327132) @@ -18,7 +18,8 @@ using namespace lldb_private; -DataBufferLLVM::DataBufferLLVM(std::unique_ptr MemBuffer) +DataBufferLLVM::DataBufferLLVM( + std::unique_ptr MemBuffer) : Buffer(std::move(MemBuffer)) { assert(Buffer != nullptr && "Cannot construct a DataBufferLLVM with a null buffer"); @@ -28,13 +29,13 @@ DataBufferLLVM::~DataBufferLLVM() {} std::shared_ptr DataBufferLLVM::CreateSliceFromPath(const llvm::Twine &Path, uint64_t Size, - uint64_t Offset, bool Private) { + uint64_t Offset) { // If the file resides non-locally, pass the volatile flag so that we don't // mmap it. - if (!Private) - Private = !llvm::sys::fs::is_local(Path); + bool IsVolatile = !llvm::sys::fs::is_local(Path); - auto Buffer = llvm::MemoryBuffer::getFileSlice(Path, Size, Offset, Private); + auto Buffer = + llvm::WritableMemoryBuffer::getFileSlice(Path, Size, Offset, IsVolatile); if (!Buffer) return nullptr; return std::shared_ptr( @@ -42,13 +43,12 @@ DataBufferLLVM::CreateSliceFromPath(const llvm::Twine } std::shared_ptr -DataBufferLLVM::CreateFromPath(const llvm::Twine &Path, bool NullTerminate, bool Private) { +DataBufferLLVM::CreateFromPath(const llvm::Twine &Path) { // If the file resides non-locally, pass the volatile flag so that we don't // mmap it. - if (!Private) - Private = !llvm::sys::fs::is_local(Path); + bool IsVolatile = !llvm::sys::fs::is_local(Path); - auto Buffer = llvm::MemoryBuffer::getFile(Path, -1, NullTerminate, Private); + auto Buffer = llvm::WritableMemoryBuffer::getFile(Path, -1, IsVolatile); if (!Buffer) return nullptr; return std::shared_ptr( @@ -56,15 +56,13 @@ DataBufferLLVM::CreateFromPath(const llvm::Twine &Path } uint8_t *DataBufferLLVM::GetBytes() { - return const_cast(GetBuffer()); + return reinterpret_cast(Buffer->getBufferStart()); } -const uint8_t *DataBufferLLVM::GetBytes() const { return GetBuffer(); } +const uint8_t *DataBufferLLVM::GetBytes() const { + return reinterpret_cast(Buffer->getBufferStart()); +} lldb::offset_t DataBufferLLVM::GetByteSize() const { return Buffer->getBufferSize(); -} - -const uint8_t *DataBufferLLVM::GetBuffer() const { - return reinterpret_cast(Buffer->getBufferStart()); } Modified: vendor/lldb/dist/tools/debugserver/debugserver.xcodeproj/project.pbxproj ============================================================================== --- vendor/lldb/dist/tools/debugserver/debugserver.xcodeproj/project.pbxproj Sun Dec 24 01:00:56 2017 (r327131) +++ vendor/lldb/dist/tools/debugserver/debugserver.xcodeproj/project.pbxproj Sun Dec 24 01:01:00 2017 (r327132) @@ -820,7 +820,7 @@ buildSettings = { CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; CLANG_CXX_LIBRARY = "libc++"; - "CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*]" = "source/debugserver-entitlements.plist"; + "CODE_SIGN_ENTITLEMENTS[sdk=*]" = "source/debugserver-entitlements.plist"; "CODE_SIGN_ENTITLEMENTS[sdk=macosx*]" = "source/debugserver-macosx-entitlements.plist"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "-"; "CODE_SIGN_IDENTITY[sdk=macosx*]" = "-"; @@ -920,8 +920,7 @@ buildSettings = { CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; CLANG_CXX_LIBRARY = "libc++"; - "CODE_SIGN_ENTITLEMENTS[sdk=*]" = "source/debugserver-macosx-entitlements.plist"; - "CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*]" = "source/debugserver-entitlements.plist"; + "CODE_SIGN_ENTITLEMENTS[sdk=*]" = "source/debugserver-entitlements.plist"; "CODE_SIGN_ENTITLEMENTS[sdk=macosx*]" = "source/debugserver-macosx-entitlements.plist"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=macosx*]" = ""; @@ -1020,8 +1019,7 @@ buildSettings = { CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; CLANG_CXX_LIBRARY = "libc++"; - "CODE_SIGN_ENTITLEMENTS[sdk=*]" = "source/debugserver-macosx-entitlements.plist"; - "CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*]" = "source/debugserver-entitlements.plist"; + "CODE_SIGN_ENTITLEMENTS[sdk=*]" = "source/debugserver-entitlements.plist"; "CODE_SIGN_ENTITLEMENTS[sdk=macosx*]" = "source/debugserver-macosx-entitlements.plist"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=macosx*]" = ""; @@ -1127,8 +1125,7 @@ CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_ENTITLEMENTS[sdk=*]" = "source/debugserver-macosx-entitlements.plist"; - "CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*]" = "source/debugserver-entitlements.plist"; + "CODE_SIGN_ENTITLEMENTS[sdk=*]" = "source/debugserver-entitlements.plist"; "CODE_SIGN_ENTITLEMENTS[sdk=macosx*]" = "source/debugserver-macosx-entitlements.plist"; CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; @@ -1209,8 +1206,7 @@ buildSettings = { CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; CLANG_CXX_LIBRARY = "libc++"; - "CODE_SIGN_ENTITLEMENTS[sdk=*]" = "source/debugserver-macosx-entitlements.plist"; - "CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*]" = "source/debugserver-entitlements.plist"; + "CODE_SIGN_ENTITLEMENTS[sdk=*]" = "source/debugserver-entitlements.plist"; "CODE_SIGN_ENTITLEMENTS[sdk=macosx*]" = "source/debugserver-macosx-entitlements.plist"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=macosx*]" = ""; @@ -1279,8 +1275,7 @@ buildSettings = { CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; CLANG_CXX_LIBRARY = "libc++"; - "CODE_SIGN_ENTITLEMENTS[sdk=*]" = "source/debugserver-macosx-entitlements.plist"; - "CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*]" = "source/debugserver-entitlements.plist"; + "CODE_SIGN_ENTITLEMENTS[sdk=*]" = "source/debugserver-entitlements.plist"; "CODE_SIGN_ENTITLEMENTS[sdk=macosx*]" = "source/debugserver-macosx-entitlements.plist"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=macosx*]" = ""; @@ -1352,7 +1347,7 @@ buildSettings = { CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; CLANG_CXX_LIBRARY = "libc++"; - "CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*]" = "source/debugserver-entitlements.plist"; + "CODE_SIGN_ENTITLEMENTS[sdk=*]" = "source/debugserver-entitlements.plist"; "CODE_SIGN_ENTITLEMENTS[sdk=macosx*]" = "source/debugserver-macosx-entitlements.plist"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "-"; "CODE_SIGN_IDENTITY[sdk=macosx*]" = "-"; @@ -1460,8 +1455,7 @@ buildSettings = { CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; CLANG_CXX_LIBRARY = "libc++"; - "CODE_SIGN_ENTITLEMENTS[sdk=*]" = "source/debugserver-macosx-entitlements.plist"; - "CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*]" = "source/debugserver-entitlements.plist"; + "CODE_SIGN_ENTITLEMENTS[sdk=*]" = "source/debugserver-entitlements.plist"; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Dec 24 01:00:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B421E88356; Sun, 24 Dec 2017 01:00:51 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3EAA47ED6C; Sun, 24 Dec 2017 01:00:49 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBO10mCT074965; Sun, 24 Dec 2017 01:00:48 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBO10m3c074964; Sun, 24 Dec 2017 01:00:48 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201712240100.vBO10m3c074964@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 24 Dec 2017 01:00:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r327129 - vendor/libc++/libc++-trunk-r321414 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/libc++/libc++-trunk-r321414 X-SVN-Commit-Revision: 327129 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Dec 2017 01:00:51 -0000 Author: dim Date: Sun Dec 24 01:00:48 2017 New Revision: 327129 URL: https://svnweb.freebsd.org/changeset/base/327129 Log: Tag libc++ trunk r321414. Added: vendor/libc++/libc++-trunk-r321414/ - copied from r327128, vendor/libc++/dist/ From owner-svn-src-all@freebsd.org Sun Dec 24 01:55:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B07ABE8C589; Sun, 24 Dec 2017 01:55:13 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B3DD2118; Sun, 24 Dec 2017 01:55:13 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBO1tC69099434; Sun, 24 Dec 2017 01:55:12 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBO1tCxX099433; Sun, 24 Dec 2017 01:55:12 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201712240155.vBO1tCxX099433@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 24 Dec 2017 01:55:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327140 - head/sbin/ipfw X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sbin/ipfw X-SVN-Commit-Revision: 327140 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Dec 2017 01:55:13 -0000 Author: ae Date: Sun Dec 24 01:55:12 2017 New Revision: 327140 URL: https://svnweb.freebsd.org/changeset/base/327140 Log: Fix rule number truncation, use uint16_t type to specify rulenum. PR: 224555 MFC after: 1 week Modified: head/sbin/ipfw/ipfw2.c Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Sun Dec 24 01:16:28 2017 (r327139) +++ head/sbin/ipfw/ipfw2.c Sun Dec 24 01:55:12 2017 (r327140) @@ -2256,12 +2256,13 @@ do_range_cmd(int cmd, ipfw_range_tlv *rt) void ipfw_sets_handler(char *av[]) { - uint32_t masks[2]; - int i; - uint8_t cmd, rulenum; ipfw_range_tlv rt; char *msg; size_t size; + uint32_t masks[2]; + int i; + uint16_t rulenum; + uint8_t cmd; av++; memset(&rt, 0, sizeof(rt)); From owner-svn-src-all@freebsd.org Sun Dec 24 02:05:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D0B8E8CEEC; Sun, 24 Dec 2017 02:05:20 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5736228B8; Sun, 24 Dec 2017 02:05:20 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBO25JnW003596; Sun, 24 Dec 2017 02:05:19 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBO25JQs003595; Sun, 24 Dec 2017 02:05:19 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201712240205.vBO25JQs003595@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 24 Dec 2017 02:05:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r327141 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 327141 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Dec 2017 02:05:20 -0000 Author: ae Date: Sun Dec 24 02:05:19 2017 New Revision: 327141 URL: https://svnweb.freebsd.org/changeset/base/327141 Log: MFC r326898: Fix possible memory leak. vxlan_ftable entries are sorted in descending order, due to wrong arguments order it is possible to stop search before existing element will be found. Then new element will be allocated in vxlan_ftable_update_locked() and can be inserted in the list second time or trigger MPASS() assertion with enabled INVARIANTS. PR: 224371 Modified: stable/11/sys/net/if_vxlan.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/if_vxlan.c ============================================================================== --- stable/11/sys/net/if_vxlan.c Sun Dec 24 01:55:12 2017 (r327140) +++ stable/11/sys/net/if_vxlan.c Sun Dec 24 02:05:19 2017 (r327141) @@ -778,7 +778,7 @@ vxlan_ftable_entry_lookup(struct vxlan_softc *sc, cons hash = VXLAN_SC_FTABLE_HASH(sc, mac); LIST_FOREACH(fe, &sc->vxl_ftable[hash], vxlfe_hash) { - dir = vxlan_ftable_addr_cmp(fe->vxlfe_mac, mac); + dir = vxlan_ftable_addr_cmp(mac, fe->vxlfe_mac); if (dir == 0) return (fe); if (dir > 0) From owner-svn-src-all@freebsd.org Sun Dec 24 02:06:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68985E8CFC6; Sun, 24 Dec 2017 02:06:18 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 32B4929B6; Sun, 24 Dec 2017 02:06:18 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBO26Hh8003695; Sun, 24 Dec 2017 02:06:17 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBO26HRc003694; Sun, 24 Dec 2017 02:06:17 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201712240206.vBO26HRc003694@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 24 Dec 2017 02:06:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r327142 - stable/10/sys/net X-SVN-Group: stable-10 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/10/sys/net X-SVN-Commit-Revision: 327142 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Dec 2017 02:06:18 -0000 Author: ae Date: Sun Dec 24 02:06:16 2017 New Revision: 327142 URL: https://svnweb.freebsd.org/changeset/base/327142 Log: MFC r326898: Fix possible memory leak. vxlan_ftable entries are sorted in descending order, due to wrong arguments order it is possible to stop search before existing element will be found. Then new element will be allocated in vxlan_ftable_update_locked() and can be inserted in the list second time or trigger MPASS() assertion with enabled INVARIANTS. PR: 224371 Modified: stable/10/sys/net/if_vxlan.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net/if_vxlan.c ============================================================================== --- stable/10/sys/net/if_vxlan.c Sun Dec 24 02:05:19 2017 (r327141) +++ stable/10/sys/net/if_vxlan.c Sun Dec 24 02:06:16 2017 (r327142) @@ -778,7 +778,7 @@ vxlan_ftable_entry_lookup(struct vxlan_softc *sc, cons hash = VXLAN_SC_FTABLE_HASH(sc, mac); LIST_FOREACH(fe, &sc->vxl_ftable[hash], vxlfe_hash) { - dir = vxlan_ftable_addr_cmp(fe->vxlfe_mac, mac); + dir = vxlan_ftable_addr_cmp(mac, fe->vxlfe_mac); if (dir == 0) return (fe); if (dir > 0) From owner-svn-src-all@freebsd.org Sun Dec 24 04:41:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22F2CE973DE; Sun, 24 Dec 2017 04:41:09 +0000 (UTC) (envelope-from shurd@sasktel.net) Received: from mail119c7.megamailservers.com (mail519c7.megamailservers.com [209.235.141.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5145767CD8; Sun, 24 Dec 2017 04:41:07 +0000 (UTC) (envelope-from shurd@sasktel.net) X-Authenticated-User: hurds.sasktel.net X-VIP: 69.49.109.87 Received: from [192.168.0.33] (c-107-5-177-180.hsd1.mi.comcast.net [107.5.177.180]) (authenticated bits=0) by mail119c7.megamailservers.com (8.14.9/8.13.1) with ESMTP id vBO4DbNr011121; Sat, 23 Dec 2017 23:13:38 -0500 Subject: Re: svn commit: r327013 - head/sys/net To: Oleg Bulyzhin Cc: Stephen Hurd , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Sean Bruno , erj@freebsd.org References: <201712200103.vBK13YgS025896@repo.freebsd.org> <20171222115825.GA69149@lath.RINET.ru> <16beab6b-3252-1f84-33f4-f9fc49f158a2@FreeBSD.org> <20171222225840.GA78272@lath.RINET.ru> <20171223105706.GA86594@lath.RINET.ru> From: Stephen Hurd Message-ID: <98940f9d-cbe6-8c98-054d-6069832080d4@sasktel.net> Date: Sat, 23 Dec 2017 23:13:37 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:51.0) Gecko/20100101 Firefox/51.0 SeaMonkey/2.48 MIME-Version: 1.0 In-Reply-To: <20171223105706.GA86594@lath.RINET.ru> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-CTCH-RefID: str=0001.0A020204.5A3F2973.0041, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.2 cv=IPRyMknG c=1 sm=1 tr=0 a=qjOqI3gpwxmQgA7j5BgDJQ==:117 a=qjOqI3gpwxmQgA7j5BgDJQ==:17 a=8nJEP1OIZ-IA:10 a=ZdTye3KDeUXdz7U2TQ4A:9 a=wPNLvfGTeEIA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Dec 2017 04:41:09 -0000 Oleg Bulyzhin wrote: > On Fri, Dec 22, 2017 at 07:11:36PM -0500, Stephen Hurd wrote: > >> Interesting... is this a standard GENERIC kernel, or is this a custom >> config? If a custom config, can you send it to me? >> >> Also, does this system have any other iflib drivers? igb, em, or bnxt? >> Can you include the log info (if any) for them as well? > It's custom kernel on my testing machine. It has em too but ix is probed first.. > If i comment out if_ix.ko load - it boots just fine (looks like if_em is > not calling iflib_irq_set_affinity()): > > em0: port 0xdc00-0xdc1f mem 0xfeae0000-0x > feafffff,0xfeac0000-0xfeadffff irq 17 at device 0.0 on pci3 > em0: attach_pre capping queues at 1 > em0: using 1024 tx descriptors and 1024 rx descriptors > em0: msix_init qsets capped at 1 > em0: PCIY_MSIX capability not found; or rid 0 == 0. > em0: Using a Legacy interrupt > em0: allocated for 1 tx_queues > em0: allocated for 1 rx_queues > ioapic0: routing intpin 17 (PCI IRQ 17) to lapic 0 vector 54 > em0: bpf attached > em0: Ethernet address: 00:15:17:3a:0c:7a > em0: netmap queues/slots: TX 1/1024, RX 1/1024 > > P.S. verbose dmesg & kernel conf attached Hrm, can you try it with: options EARLY_AP_STARTUP In slave-amd64-smp-debug? From owner-svn-src-all@freebsd.org Sun Dec 24 07:11:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70310EA1A9B; Sun, 24 Dec 2017 07:11:32 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4251A6C472; Sun, 24 Dec 2017 07:11:31 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id vBO7BNLw045405; Sat, 23 Dec 2017 23:11:23 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id vBO7BNRG045404; Sat, 23 Dec 2017 23:11:23 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201712240711.vBO7BNRG045404@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r327140 - head/sbin/ipfw In-Reply-To: <201712240155.vBO1tCxX099433@repo.freebsd.org> To: "Andrey V. Elsukov" Date: Sat, 23 Dec 2017 23:11:23 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Dec 2017 07:11:32 -0000 > Author: ae > Date: Sun Dec 24 01:55:12 2017 > New Revision: 327140 > URL: https://svnweb.freebsd.org/changeset/base/327140 > > Log: > Fix rule number truncation, use uint16_t type to specify rulenum. > > PR: 224555 > MFC after: 1 week > > Modified: > head/sbin/ipfw/ipfw2.c > > Modified: head/sbin/ipfw/ipfw2.c > ============================================================================== > --- head/sbin/ipfw/ipfw2.c Sun Dec 24 01:16:28 2017 (r327139) > +++ head/sbin/ipfw/ipfw2.c Sun Dec 24 01:55:12 2017 (r327140) > @@ -2256,12 +2256,13 @@ do_range_cmd(int cmd, ipfw_range_tlv *rt) > void > ipfw_sets_handler(char *av[]) > { > - uint32_t masks[2]; > - int i; > - uint8_t cmd, rulenum; > ipfw_range_tlv rt; > char *msg; > size_t size; > + uint32_t masks[2]; > + int i; Why do these 2 lines show up as null changes in the diff???? I can not see any change, not even white space. > + uint16_t rulenum; > + uint8_t cmd; > > av++; > memset(&rt, 0, sizeof(rt)); -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sun Dec 24 07:49:00 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A88E6EA3832; Sun, 24 Dec 2017 07:49:00 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward104o.mail.yandex.net (forward104o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::607]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4A5DB6D61C; Sun, 24 Dec 2017 07:49:00 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from mxback6j.mail.yandex.net (mxback6j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10f]) by forward104o.mail.yandex.net (Yandex) with ESMTP id 34944703468; Sun, 24 Dec 2017 10:48:57 +0300 (MSK) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [2a02:6b8:0:1a2d::27]) by mxback6j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id SFUZIm0zVz-mv4KtANF; Sun, 24 Dec 2017 10:48:57 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1514101737; bh=LBzgClZHINHP46r0nyz9mwMlMdTAdyfI95ApuAbfBak=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=rrd1l2KYXrj+6rWCqcUKtfXW+wXyAwfzkn+4iBW9AYFW9nQ/usjkayjX5OV/9zB3X nXFFvvMoUhLxSnyjOSRFG5EUnHuPFQOdR/aQrfYBLvVTqL0N1WmvyTxAK7l5QrdtL7 AvYIlPisjn9z7T6yllKMVGgCdqL4rCgiaezQUhJY= Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id osmpaQYpbm-muoCvPsx; Sun, 24 Dec 2017 10:48:56 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1514101736; bh=LBzgClZHINHP46r0nyz9mwMlMdTAdyfI95ApuAbfBak=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=HoOEkMBh8lIQBuuWx50epfR70tHcl9Q+ooA1OcyxbAOt9hY6/pXwEsaBtVaKH1FZg /8RghZm3uxdLEQXyl4SjKb07pi4bOgKPzn0k62NrCyiLu4OxjAWQkKSAB/dZVggT5i cpe2Cw5LB9kHFXHA292aFW99ANDRQvmJBcEvSgIo= Authentication-Results: smtp3o.mail.yandex.net; dkim=pass header.i=@yandex.ru Subject: Re: svn commit: r327140 - head/sbin/ipfw To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201712240711.vBO7BNRG045404@pdx.rh.CN85.dnsmgr.net> From: "Andrey V. Elsukov" Openpgp: id=E6591E1B41DA1516F0C9BC0001C5EA0410C8A17A Message-ID: Date: Sun, 24 Dec 2017 10:46:14 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <201712240711.vBO7BNRG045404@pdx.rh.CN85.dnsmgr.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="hploe8mi8b5CeIbHnELgS0brwST9uiIfp" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Dec 2017 07:49:00 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --hploe8mi8b5CeIbHnELgS0brwST9uiIfp Content-Type: multipart/mixed; boundary="Ua6VdxS4jpKDm90X0cEvNMeMts7m7TLRO"; protected-headers="v1" From: "Andrey V. Elsukov" To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r327140 - head/sbin/ipfw References: <201712240711.vBO7BNRG045404@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201712240711.vBO7BNRG045404@pdx.rh.CN85.dnsmgr.net> --Ua6VdxS4jpKDm90X0cEvNMeMts7m7TLRO Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 24.12.2017 10:11, Rodney W. Grimes wrote: >> - uint32_t masks[2]; >> - int i; >> - uint8_t cmd, rulenum; >> ipfw_range_tlv rt; >> char *msg; >> size_t size; >> + uint32_t masks[2]; >> + int i; >=20 > Why do these 2 lines show up as null changes in the diff???? > I can not see any change, not even white space. They are sorted by size according to style(9). --=20 WBR, Andrey V. Elsukov --Ua6VdxS4jpKDm90X0cEvNMeMts7m7TLRO-- --hploe8mi8b5CeIbHnELgS0brwST9uiIfp Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEzBAEBCAAdFiEE5lkeG0HaFRbwybwAAcXqBBDIoXoFAlo/W0YACgkQAcXqBBDI oXqQbAf9H7jy1BOF27AqaGydwPZ5iQPCZu2QgrrgYZA2xhDd10Ryk95XIT92c02i B1tK81jk9UCbbyTAG7wQD1hMTIGu5nH1yUdIpDZJvMW50EfsbhzkVPCg2FcyWLBN syHiVtcSSprpbO3gBHIaFdc3sKqQNJSJ4ALhO86Ajm7B8vl83pdmmyvpuEyDH0wQ ss3bI0M+m4nrbHSG0deRUyB/6wEBf1MW6htFkLMUyvDNdeH6EAhMLaC4KPNYtlI8 /LFQgpKl/fwoNWLUN9KA8CUXWq7E3cfgbmQUViqB8K82PW3Emoi7JQip1xVnSfTv Ih53ARmoSvSMy8jnvAeuBIM/MNLy7w== =7p/G -----END PGP SIGNATURE----- --hploe8mi8b5CeIbHnELgS0brwST9uiIfp-- From owner-svn-src-all@freebsd.org Sun Dec 24 09:11:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41C7CEA7C25 for ; Sun, 24 Dec 2017 09:11:06 +0000 (UTC) (envelope-from 0100016087ca1f30-a88d99db-d557-441e-abe8-6a0bd7c5d6e6-000000@amazonses.com) Received: from a8-56.smtp-out.amazonses.com (a8-56.smtp-out.amazonses.com [54.240.8.56]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 08AB570283 for ; Sun, 24 Dec 2017 09:11:05 +0000 (UTC) (envelope-from 0100016087ca1f30-a88d99db-d557-441e-abe8-6a0bd7c5d6e6-000000@amazonses.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ae7m2yrxjw65l2cqdpjxuucyrvy564tn; d=tarsnap.com; t=1514106659; h=Subject:To:References:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=jtk5PAnadJ/gvAecymUZ8A4CNnpHTHGuMCkmarYIf6A=; b=hR3uctxgn5W7fvk9n/diwLOR75S6/mCEgRelQu9Q+KiVn95oxsF88XlirZpwACvM 3+0J/FjJCsL73P70HjcGtqKg+rOPyCu+ljGe/O78czItYLq28Qrf7WDBG2nlW0uhoIu UxCEx7W1S3LgrTRJwEVFPHZUGxx3JpRcW2o3j/JI= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=224i4yxa5dv7c2xz3womw6peuasteono; d=amazonses.com; t=1514106659; h=Subject:To:References:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding:Feedback-ID; bh=jtk5PAnadJ/gvAecymUZ8A4CNnpHTHGuMCkmarYIf6A=; b=ij0o8SV9R6fDxzlrrrK81d7vDeAnG/A32mA1XggMRJPLWXrfwcygFG5S9HNCy9Tk qlgS9y7T5M0yAF0vGxwSLw1d1mXStcn6tjafTxp+vUBNsof/798Yoe4Hm11OWZbi1FE 3Eot1crC2D4C2drb1Amd1Ug3BlONCWTtQ8RL3oOU= Subject: Re: svn commit: r327120 - in head/sys: isa x86/isa To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201712232257.vBNMvEHk023093@repo.freebsd.org> From: Colin Percival Message-ID: <0100016087ca1f30-a88d99db-d557-441e-abe8-6a0bd7c5d6e6-000000@email.amazonses.com> Date: Sun, 24 Dec 2017 09:10:58 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <201712232257.vBNMvEHk023093@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SES-Outgoing: 2017.12.24-54.240.8.56 Feedback-ID: 1.us-east-1.Lv9FVjaNvvR5llaqfLoOVbo2VxOELl7cjN0AOyXnPlk=:AmazonSES X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Dec 2017 09:11:06 -0000 On 12/23/17 14:57, Warner Losh wrote: > - device_probe_and_attach(child); > + err = device_probe_and_attach(child); > + if (err == 0 && idev->id_vendorid == 0 && > + strcmp(kern_ident, "GENERIC") == 0) > + device_printf(child, > + "non-PNP ISA device will be removed from GENERIC in FreeBSD 12."); Maybe worth making this strncmp(kern_ident, "GENERIC", 7) so that it will catch GENERIC-NODEBUG as well? -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From owner-svn-src-all@freebsd.org Sun Dec 24 09:43:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00381E81C0F; Sun, 24 Dec 2017 09:43:38 +0000 (UTC) (envelope-from oleg@lath.rinet.ru) Received: from lath.rinet.ru (lath.rinet.ru [195.54.192.90]) by mx1.freebsd.org (Postfix) with ESMTP id 79DA771B85; Sun, 24 Dec 2017 09:43:36 +0000 (UTC) (envelope-from oleg@lath.rinet.ru) Received: by lath.rinet.ru (Postfix, from userid 222) id CA69C3D4; Sun, 24 Dec 2017 12:43:29 +0300 (MSK) Date: Sun, 24 Dec 2017 12:43:29 +0300 From: Oleg Bulyzhin To: Stephen Hurd Cc: Oleg Bulyzhin , Stephen Hurd , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Sean Bruno , erj@freebsd.org Subject: Re: svn commit: r327013 - head/sys/net Message-ID: <20171224094329.GA7580@lath.RINET.ru> References: <201712200103.vBK13YgS025896@repo.freebsd.org> <20171222115825.GA69149@lath.RINET.ru> <16beab6b-3252-1f84-33f4-f9fc49f158a2@FreeBSD.org> <20171222225840.GA78272@lath.RINET.ru> <20171223105706.GA86594@lath.RINET.ru> <98940f9d-cbe6-8c98-054d-6069832080d4@sasktel.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <98940f9d-cbe6-8c98-054d-6069832080d4@sasktel.net> User-Agent: Mutt/1.9.2 (2017-12-15) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Dec 2017 09:43:38 -0000 On Sat, Dec 23, 2017 at 11:13:37PM -0500, Stephen Hurd wrote: > Hrm, can you try it with: > options EARLY_AP_STARTUP > > In slave-amd64-smp-debug? yes, it does boot now: ix0: port 0xcc00-0xcc1f mem 0xfd e80000-0xfdefffff,0xfde7c000-0xfde7ffff irq 18 at device 0.0 on pci2 ix0: using 2048 tx descriptors and 2048 rx descriptors ix0: msix_init qsets capped at 16 ix0: pxm cpus: 4 queue msgs: 63 admincnt: 1 ix0: using 4 rx queues 4 tx queues ix0: attempting to allocate 5 MSI-X vectors (64 supported) msi: routing MSI-X IRQ 259 to local APIC 2 vector 48 msi: routing MSI-X IRQ 260 to local APIC 3 vector 48 msi: routing MSI-X IRQ 261 to local APIC 0 vector 53 msi: routing MSI-X IRQ 262 to local APIC 1 vector 49 msi: routing MSI-X IRQ 263 to local APIC 2 vector 49 ix0: using IRQs 259-263 for MSI-X ix0: Using MSIX interrupts with 5 vectors ix0: allocated for 4 queues ix0: allocated for 4 rx queues ix0: irq=259, type=0, qid=0, name=rxq0 msi: Assigning MSI-X IRQ 259 to local APIC 0 vector 54 ix0: irq=260, type=0, qid=1, name=rxq1 msi: Assigning MSI-X IRQ 260 to local APIC 1 vector 50 ix0: irq=261, type=0, qid=2, name=rxq2 msi: Assigning MSI-X IRQ 261 to local APIC 2 vector 48 ix0: irq=262, type=0, qid=3, name=rxq3 msi: Assigning MSI-X IRQ 262 to local APIC 3 vector 48 ix0: irq=259, type=1, qid=0, name=txq0 ix0: irq=260, type=1, qid=1, name=txq1 ix0: irq=261, type=1, qid=2, name=txq2 ix0: irq=262, type=1, qid=3, name=txq3 ix0: bpf attached ix0: Ethernet address: 90:e2:ba:49:ab:70 ix0: PCI Express Bus: Speed 5.0GT/s Width x8 ix0: netmap queues/slots: TX 4/2048, RX 4/2048 random: harvesting attach, 8 bytes (4 bits) from ix0 ix1: port 0xc880-0xc89f mem 0xfdd80000-0xfddfffff,0xfde78000-0xfde7bfff irq 19 at device 0.1 on pci2 ix1: using 2048 tx descriptors and 2048 rx descriptors ix1: msix_init qsets capped at 16 ix1: pxm cpus: 4 queue msgs: 63 admincnt: 1 ix1: using 4 rx queues 4 tx queues ix1: attempting to allocate 5 MSI-X vectors (64 supported) msi: routing MSI-X IRQ 264 to local APIC 3 vector 49 msi: routing MSI-X IRQ 265 to local APIC 0 vector 53 msi: routing MSI-X IRQ 266 to local APIC 1 vector 49 msi: routing MSI-X IRQ 267 to local APIC 2 vector 50 msi: routing MSI-X IRQ 268 to local APIC 3 vector 50 ix1: using IRQs 264-268 for MSI-X ix1: Using MSIX interrupts with 5 vectors ix1: allocated for 4 queues ix1: allocated for 4 rx queues ix1: irq=264, type=0, qid=0, name=rxq0 msi: Assigning MSI-X IRQ 264 to local APIC 0 vector 55 ix1: irq=265, type=0, qid=1, name=rxq1 msi: Assigning MSI-X IRQ 265 to local APIC 1 vector 51 ix1: irq=266, type=0, qid=2, name=rxq2 msi: Assigning MSI-X IRQ 266 to local APIC 2 vector 51 ix1: irq=267, type=0, qid=3, name=rxq3 msi: Assigning MSI-X IRQ 267 to local APIC 3 vector 49 ix1: irq=264, type=1, qid=0, name=txq0 ix1: irq=265, type=1, qid=1, name=txq1 ix1: irq=266, type=1, qid=2, name=txq2 ix1: irq=267, type=1, qid=3, name=txq3 ix1: bpf attached ix1: Ethernet address: 90:e2:ba:49:ab:71 ix1: PCI Express Bus: Speed 5.0GT/s Width x8 ix1: netmap queues/slots: TX 4/2048, RX 4/2048 random: harvesting attach, 8 bytes (4 bits) from ix1 random: harvesting attach, 8 bytes (4 bits) from pci2 random: harvesting attach, 8 bytes (4 bits) from pcib2 -- Oleg. ================================================================ === Oleg Bulyzhin -- OBUL-RIPN -- OBUL-RIPE -- oleg@rinet.ru === ================================================================ From owner-svn-src-all@freebsd.org Sun Dec 24 14:04:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09C00E90821; Sun, 24 Dec 2017 14:04:57 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C83C87B18D; Sun, 24 Dec 2017 14:04:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBOE4tU0007251; Sun, 24 Dec 2017 14:04:55 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBOE4tQ6007250; Sun, 24 Dec 2017 14:04:55 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201712241404.vBOE4tQ6007250@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 24 Dec 2017 14:04:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r327153 - vendor/llvm/llvm-trunk-r321426 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/llvm/llvm-trunk-r321426 X-SVN-Commit-Revision: 327153 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Dec 2017 14:04:57 -0000 Author: dim Date: Sun Dec 24 14:04:55 2017 New Revision: 327153 URL: https://svnweb.freebsd.org/changeset/base/327153 Log: Tag llvm trunk r321426. Added: vendor/llvm/llvm-trunk-r321426/ - copied from r327152, vendor/llvm/dist/ From owner-svn-src-all@freebsd.org Sun Dec 24 14:04:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4AC97E9080F; Sun, 24 Dec 2017 14:04:54 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B85477B186; Sun, 24 Dec 2017 14:04:53 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBOE4q7E007204; Sun, 24 Dec 2017 14:04:52 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBOE4pTg007189; Sun, 24 Dec 2017 14:04:51 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201712241404.vBOE4pTg007189@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 24 Dec 2017 14:04:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r327152 - in vendor/llvm/dist: lib/CodeGen/SelectionDAG lib/MC/MCParser lib/Target/Hexagon lib/Target/X86 lib/Transforms/Utils test/CodeGen/X86 test/MC/ELF X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/llvm/dist: lib/CodeGen/SelectionDAG lib/MC/MCParser lib/Target/Hexagon lib/Target/X86 lib/Transforms/Utils test/CodeGen/X86 test/MC/ELF X-SVN-Commit-Revision: 327152 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Dec 2017 14:04:54 -0000 Author: dim Date: Sun Dec 24 14:04:50 2017 New Revision: 327152 URL: https://svnweb.freebsd.org/changeset/base/327152 Log: Vendor import of llvm trunk r321426: https://llvm.org/svn/llvm-project/llvm/trunk@321426 Added: vendor/llvm/dist/test/CodeGen/X86/pr34080-2.ll vendor/llvm/dist/test/MC/ELF/comdat-name-number.s (contents, props changed) Modified: vendor/llvm/dist/lib/CodeGen/SelectionDAG/DAGCombiner.cpp vendor/llvm/dist/lib/MC/MCParser/DarwinAsmParser.cpp vendor/llvm/dist/lib/MC/MCParser/ELFAsmParser.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonISelDAGToDAGHVX.cpp vendor/llvm/dist/lib/Target/X86/X86ISelLowering.cpp vendor/llvm/dist/lib/Target/X86/X86InstrFPStack.td vendor/llvm/dist/lib/Target/X86/X86InstrInfo.td vendor/llvm/dist/lib/Transforms/Utils/LoopUtils.cpp vendor/llvm/dist/test/CodeGen/X86/avx512-calling-conv.ll vendor/llvm/dist/test/CodeGen/X86/avx512-cvt.ll vendor/llvm/dist/test/CodeGen/X86/avx512-schedule.ll vendor/llvm/dist/test/CodeGen/X86/pr34080.ll vendor/llvm/dist/test/CodeGen/X86/shrink_vmul.ll vendor/llvm/dist/test/CodeGen/X86/v8i1-masks.ll Modified: vendor/llvm/dist/lib/CodeGen/SelectionDAG/DAGCombiner.cpp ============================================================================== --- vendor/llvm/dist/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Sun Dec 24 13:39:32 2017 (r327151) +++ vendor/llvm/dist/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Sun Dec 24 14:04:50 2017 (r327152) @@ -3987,6 +3987,12 @@ SDValue DAGCombiner::visitAND(SDNode *N) { // reassociate and if (SDValue RAND = ReassociateOps(ISD::AND, SDLoc(N), N0, N1)) return RAND; + + // Try to convert a constant mask AND into a shuffle clear mask. + if (VT.isVector()) + if (SDValue Shuffle = XformToShuffleWithZero(N)) + return Shuffle; + // fold (and (or x, C), D) -> D if (C & D) == D auto MatchSubset = [](ConstantSDNode *LHS, ConstantSDNode *RHS) { return RHS->getAPIntValue().isSubsetOf(LHS->getAPIntValue()); @@ -16480,6 +16486,8 @@ SDValue DAGCombiner::visitFP16_TO_FP(SDNode *N) { /// e.g. AND V, <0xffffffff, 0, 0xffffffff, 0>. ==> /// vector_shuffle V, Zero, <0, 4, 2, 4> SDValue DAGCombiner::XformToShuffleWithZero(SDNode *N) { + assert(N->getOpcode() == ISD::AND && "Unexpected opcode!"); + EVT VT = N->getValueType(0); SDValue LHS = N->getOperand(0); SDValue RHS = peekThroughBitcast(N->getOperand(1)); @@ -16490,9 +16498,6 @@ SDValue DAGCombiner::XformToShuffleWithZero(SDNode *N) if (LegalOperations) return SDValue(); - if (N->getOpcode() != ISD::AND) - return SDValue(); - if (RHS.getOpcode() != ISD::BUILD_VECTOR) return SDValue(); @@ -16580,10 +16585,6 @@ SDValue DAGCombiner::SimplifyVBinOp(SDNode *N) { if (SDValue Fold = DAG.FoldConstantVectorArithmetic( N->getOpcode(), SDLoc(LHS), LHS.getValueType(), Ops, N->getFlags())) return Fold; - - // Try to convert a constant mask AND into a shuffle clear mask. - if (SDValue Shuffle = XformToShuffleWithZero(N)) - return Shuffle; // Type legalization might introduce new shuffles in the DAG. // Fold (VBinOp (shuffle (A, Undef, Mask)), (shuffle (B, Undef, Mask))) Modified: vendor/llvm/dist/lib/MC/MCParser/DarwinAsmParser.cpp ============================================================================== --- vendor/llvm/dist/lib/MC/MCParser/DarwinAsmParser.cpp Sun Dec 24 13:39:32 2017 (r327151) +++ vendor/llvm/dist/lib/MC/MCParser/DarwinAsmParser.cpp Sun Dec 24 14:04:50 2017 (r327152) @@ -1086,7 +1086,7 @@ bool DarwinAsmParser::parseVersionMin(StringRef Direct return false; } -Triple::OSType getOSTypeFromPlatform(MachO::PlatformType Type) { +static Triple::OSType getOSTypeFromPlatform(MachO::PlatformType Type) { switch (Type) { case MachO::PLATFORM_MACOS: return Triple::MacOSX; case MachO::PLATFORM_IOS: return Triple::IOS; Modified: vendor/llvm/dist/lib/MC/MCParser/ELFAsmParser.cpp ============================================================================== --- vendor/llvm/dist/lib/MC/MCParser/ELFAsmParser.cpp Sun Dec 24 13:39:32 2017 (r327151) +++ vendor/llvm/dist/lib/MC/MCParser/ELFAsmParser.cpp Sun Dec 24 14:04:50 2017 (r327152) @@ -423,8 +423,12 @@ bool ELFAsmParser::parseGroup(StringRef &GroupName) { if (L.isNot(AsmToken::Comma)) return TokError("expected group name"); Lex(); - if (getParser().parseIdentifier(GroupName)) + if (L.is(AsmToken::Integer)) { + GroupName = getTok().getString(); + Lex(); + } else if (getParser().parseIdentifier(GroupName)) { return true; + } if (L.is(AsmToken::Comma)) { Lex(); StringRef Linkage; Modified: vendor/llvm/dist/lib/Target/Hexagon/HexagonISelDAGToDAGHVX.cpp ============================================================================== --- vendor/llvm/dist/lib/Target/Hexagon/HexagonISelDAGToDAGHVX.cpp Sun Dec 24 13:39:32 2017 (r327151) +++ vendor/llvm/dist/lib/Target/Hexagon/HexagonISelDAGToDAGHVX.cpp Sun Dec 24 14:04:50 2017 (r327152) @@ -27,6 +27,8 @@ using namespace llvm; +namespace { + // -------------------------------------------------------------------- // Implementation of permutation networks. @@ -147,6 +149,7 @@ struct Coloring { (private) void build(); bool color(); }; +} // namespace std::pair Coloring::getUniqueColor(const NodeSet &Nodes) { uint8_t Color = None; @@ -300,6 +303,7 @@ void Coloring::dump() const { dbgs() << " }\n}\n"; } +namespace { // Base class of for reordering networks. They don't strictly need to be // permutations, as outputs with repeated occurrences of an input element // are allowed. @@ -408,8 +412,8 @@ struct BenesNetwork : public PermNetwork { private: bool route(ElemType *P, RowType *T, unsigned Size, unsigned Step); }; +} // namespace - bool ForwardDeltaNetwork::route(ElemType *P, RowType *T, unsigned Size, unsigned Step) { bool UseUp = false, UseDown = false; @@ -602,6 +606,7 @@ bool BenesNetwork::route(ElemType *P, RowType *T, unsi // Support for building selection results (output instructions that are // parts of the final selection). +namespace { struct OpRef { OpRef(SDValue V) : OpV(V) {} bool isValue() const { return OpV.getNode() != nullptr; } @@ -689,6 +694,7 @@ struct ResultStack { void print(raw_ostream &OS, const SelectionDAG &G) const; }; +} // namespace void OpRef::print(raw_ostream &OS, const SelectionDAG &G) const { if (isValue()) { @@ -740,6 +746,7 @@ void ResultStack::print(raw_ostream &OS, const Selecti } } +namespace { struct ShuffleMask { ShuffleMask(ArrayRef M) : Mask(M) { for (unsigned I = 0, E = Mask.size(); I != E; ++I) { @@ -763,6 +770,7 @@ struct ShuffleMask { return ShuffleMask(Mask.take_back(H)); } }; +} // namespace // -------------------------------------------------------------------- // The HvxSelector class. Modified: vendor/llvm/dist/lib/Target/X86/X86ISelLowering.cpp ============================================================================== --- vendor/llvm/dist/lib/Target/X86/X86ISelLowering.cpp Sun Dec 24 13:39:32 2017 (r327151) +++ vendor/llvm/dist/lib/Target/X86/X86ISelLowering.cpp Sun Dec 24 14:04:50 2017 (r327152) @@ -15543,7 +15543,6 @@ SDValue X86TargetLowering::LowerSINT_TO_FP(SDValue Op, MVT VT = Op.getSimpleValueType(); SDLoc dl(Op); - const TargetLowering &TLI = DAG.getTargetLoweringInfo(); if (SrcVT.isVector()) { if (SrcVT == MVT::v2i32 && VT == MVT::v2f64) { return DAG.getNode(X86ISD::CVTSI2P, dl, VT, @@ -15551,9 +15550,15 @@ SDValue X86TargetLowering::LowerSINT_TO_FP(SDValue Op, DAG.getUNDEF(SrcVT))); } if (SrcVT.getVectorElementType() == MVT::i1) { - if (SrcVT == MVT::v2i1 && TLI.isTypeLegal(SrcVT)) - return DAG.getNode(ISD::SINT_TO_FP, dl, Op.getValueType(), - DAG.getNode(ISD::SIGN_EXTEND, dl, MVT::v2i64, Src)); + if (SrcVT == MVT::v2i1) { + // For v2i1, we need to widen to v4i1 first. + assert(VT == MVT::v2f64 && "Unexpected type"); + Src = DAG.getNode(ISD::CONCAT_VECTORS, dl, MVT::v4i1, Src, + DAG.getUNDEF(MVT::v2i1)); + return DAG.getNode(X86ISD::CVTSI2P, dl, Op.getValueType(), + DAG.getNode(ISD::SIGN_EXTEND, dl, MVT::v4i32, Src)); + } + MVT IntegerVT = MVT::getVectorVT(MVT::i32, SrcVT.getVectorNumElements()); return DAG.getNode(ISD::SINT_TO_FP, dl, Op.getValueType(), DAG.getNode(ISD::SIGN_EXTEND, dl, IntegerVT, Src)); @@ -15903,9 +15908,15 @@ SDValue X86TargetLowering::lowerUINT_TO_FP_vec(SDValue SDLoc dl(Op); if (SrcVT.getVectorElementType() == MVT::i1) { - if (SrcVT == MVT::v2i1) - return DAG.getNode(ISD::UINT_TO_FP, dl, Op.getValueType(), - DAG.getNode(ISD::ZERO_EXTEND, dl, MVT::v2i64, N0)); + if (SrcVT == MVT::v2i1) { + // For v2i1, we need to widen to v4i1 first. + assert(Op.getValueType() == MVT::v2f64 && "Unexpected type"); + N0 = DAG.getNode(ISD::CONCAT_VECTORS, dl, MVT::v4i1, N0, + DAG.getUNDEF(MVT::v2i1)); + return DAG.getNode(X86ISD::CVTUI2P, dl, MVT::v2f64, + DAG.getNode(ISD::ZERO_EXTEND, dl, MVT::v4i32, N0)); + } + MVT IntegerVT = MVT::getVectorVT(MVT::i32, SrcVT.getVectorNumElements()); return DAG.getNode(ISD::UINT_TO_FP, dl, Op.getValueType(), DAG.getNode(ISD::ZERO_EXTEND, dl, IntegerVT, N0)); @@ -33047,10 +33058,8 @@ static SDValue WidenMaskArithmetic(SDNode *N, Selectio // The right side has to be a 'trunc' or a constant vector. bool RHSTrunc = N1.getOpcode() == ISD::TRUNCATE && N1.getOperand(0).getValueType() == VT; - ConstantSDNode *RHSConstSplat = nullptr; - if (auto *RHSBV = dyn_cast(N1)) - RHSConstSplat = RHSBV->getConstantSplatNode(); - if (!RHSTrunc && !RHSConstSplat) + if (!RHSTrunc && + !ISD::isBuildVectorOfConstantSDNodes(N1.getNode())) return SDValue(); const TargetLowering &TLI = DAG.getTargetLoweringInfo(); @@ -33060,13 +33069,10 @@ static SDValue WidenMaskArithmetic(SDNode *N, Selectio // Set N0 and N1 to hold the inputs to the new wide operation. N0 = N0->getOperand(0); - if (RHSConstSplat) { - N1 = DAG.getNode(ISD::ZERO_EXTEND, DL, VT.getVectorElementType(), - SDValue(RHSConstSplat, 0)); - N1 = DAG.getSplatBuildVector(VT, DL, N1); - } else if (RHSTrunc) { + if (RHSTrunc) N1 = N1->getOperand(0); - } + else + N1 = DAG.getNode(ISD::ZERO_EXTEND, DL, VT, N1); // Generate the wide operation. SDValue Op = DAG.getNode(Narrow->getOpcode(), DL, VT, N0, N1); Modified: vendor/llvm/dist/lib/Target/X86/X86InstrFPStack.td ============================================================================== --- vendor/llvm/dist/lib/Target/X86/X86InstrFPStack.td Sun Dec 24 13:39:32 2017 (r327151) +++ vendor/llvm/dist/lib/Target/X86/X86InstrFPStack.td Sun Dec 24 14:04:50 2017 (r327152) @@ -141,6 +141,7 @@ def _Fp80 : FpI_<(outs RFP80:$dst), (ins RFP80:$src1, // These instructions cannot address 80-bit memory. multiclass FPBinary { +let mayLoad = 1, hasSideEffects = 1 in { // ST(0) = ST(0) + [mem] def _Fp32m : FpIf32<(outs RFP32:$dst), (ins RFP32:$src1, f32mem:$src2), OneArgFPRW, @@ -177,10 +178,8 @@ def _Fp80m64: FpI_<(outs RFP80:$dst), (OpNode RFP80:$src1, (f80 (extloadf64 addr:$src2)))), (set RFP80:$dst, (OpNode (f80 (extloadf64 addr:$src2)), RFP80:$src1)))]>; -let mayLoad = 1 in def _F32m : FPI<0xD8, fp, (outs), (ins f32mem:$src), !strconcat("f", asmstring, "{s}\t$src")>; -let mayLoad = 1 in def _F64m : FPI<0xDC, fp, (outs), (ins f64mem:$src), !strconcat("f", asmstring, "{l}\t$src")>; // ST(0) = ST(0) + [memint] @@ -226,12 +225,11 @@ def _FpI32m80 : FpI_<(outs RFP80:$dst), (ins RFP80:$sr (OpNode RFP80:$src1, (X86fild addr:$src2, i32))), (set RFP80:$dst, (OpNode (X86fild addr:$src2, i32), RFP80:$src1)))]>; -let mayLoad = 1 in def _FI16m : FPI<0xDE, fp, (outs), (ins i16mem:$src), !strconcat("fi", asmstring, "{s}\t$src")>; -let mayLoad = 1 in def _FI32m : FPI<0xDA, fp, (outs), (ins i32mem:$src), !strconcat("fi", asmstring, "{l}\t$src")>; +} // mayLoad = 1, hasSideEffects = 1 } let Defs = [FPSW] in { Modified: vendor/llvm/dist/lib/Target/X86/X86InstrInfo.td ============================================================================== --- vendor/llvm/dist/lib/Target/X86/X86InstrInfo.td Sun Dec 24 13:39:32 2017 (r327151) +++ vendor/llvm/dist/lib/Target/X86/X86InstrInfo.td Sun Dec 24 14:04:50 2017 (r327152) @@ -832,9 +832,11 @@ def NoVLX : Predicate<"!Subtarget->hasVLX()">; def NoVLX_Or_NoBWI : Predicate<"!Subtarget->hasVLX() || !Subtarget->hasBWI()">; def NoVLX_Or_NoDQI : Predicate<"!Subtarget->hasVLX() || !Subtarget->hasDQI()">; def PKU : Predicate<"Subtarget->hasPKU()">; -def HasVNNI : Predicate<"Subtarget->hasVNNI()">; +def HasVNNI : Predicate<"Subtarget->hasVNNI()">, + AssemblerPredicate<"FeatureVNNI", "AVX-512 VNNI ISA">; -def HasBITALG : Predicate<"Subtarget->hasBITALG()">; +def HasBITALG : Predicate<"Subtarget->hasBITALG()">, + AssemblerPredicate<"FeatureBITALG", "AVX-512 BITALG ISA">; def HasPOPCNT : Predicate<"Subtarget->hasPOPCNT()">; def HasAES : Predicate<"Subtarget->hasAES()">; def HasVAES : Predicate<"Subtarget->hasVAES()">; @@ -866,7 +868,8 @@ def HasBMI2 : Predicate<"Subtarget->hasBMI2()">; def NoBMI2 : Predicate<"!Subtarget->hasBMI2()">; def HasVBMI : Predicate<"Subtarget->hasVBMI()">, AssemblerPredicate<"FeatureVBMI", "AVX-512 VBMI ISA">; -def HasVBMI2 : Predicate<"Subtarget->hasVBMI2()">; +def HasVBMI2 : Predicate<"Subtarget->hasVBMI2()">, + AssemblerPredicate<"FeatureVBMI2", "AVX-512 VBMI2 ISA">; def HasIFMA : Predicate<"Subtarget->hasIFMA()">, AssemblerPredicate<"FeatureIFMA", "AVX-512 IFMA ISA">; def HasRTM : Predicate<"Subtarget->hasRTM()">; Modified: vendor/llvm/dist/lib/Transforms/Utils/LoopUtils.cpp ============================================================================== --- vendor/llvm/dist/lib/Transforms/Utils/LoopUtils.cpp Sun Dec 24 13:39:32 2017 (r327151) +++ vendor/llvm/dist/lib/Transforms/Utils/LoopUtils.cpp Sun Dec 24 14:04:50 2017 (r327152) @@ -880,9 +880,10 @@ bool InductionDescriptor::isFPInductionPHI(PHINode *Ph /// If we are able to find such sequence, we return the instructions /// we found, namely %casted_phi and the instructions on its use-def chain up /// to the phi (not including the phi). -bool getCastsForInductionPHI( - PredicatedScalarEvolution &PSE, const SCEVUnknown *PhiScev, - const SCEVAddRecExpr *AR, SmallVectorImpl &CastInsts) { +static bool getCastsForInductionPHI(PredicatedScalarEvolution &PSE, + const SCEVUnknown *PhiScev, + const SCEVAddRecExpr *AR, + SmallVectorImpl &CastInsts) { assert(CastInsts.empty() && "CastInsts is expected to be empty."); auto *PN = cast(PhiScev->getValue()); Modified: vendor/llvm/dist/test/CodeGen/X86/avx512-calling-conv.ll ============================================================================== --- vendor/llvm/dist/test/CodeGen/X86/avx512-calling-conv.ll Sun Dec 24 13:39:32 2017 (r327151) +++ vendor/llvm/dist/test/CodeGen/X86/avx512-calling-conv.ll Sun Dec 24 14:04:50 2017 (r327152) @@ -228,14 +228,9 @@ define <8 x i1> @test7a(<8 x i32>%a, <8 x i32>%b) { ; KNL-NEXT: vpmovdw %zmm0, %ymm0 ; KNL-NEXT: ## kill: def %xmm0 killed %xmm0 killed %ymm0 ; KNL-NEXT: callq _func8xi1 -; KNL-NEXT: vpmovsxwq %xmm0, %zmm0 -; KNL-NEXT: vpsllq $63, %zmm0, %zmm0 -; KNL-NEXT: movb $85, %al -; KNL-NEXT: kmovw %eax, %k1 -; KNL-NEXT: vptestmq %zmm0, %zmm0, %k1 {%k1} -; KNL-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 {%k1} {z} -; KNL-NEXT: vpmovdw %zmm0, %ymm0 -; KNL-NEXT: ## kill: def %xmm0 killed %xmm0 killed %ymm0 +; KNL-NEXT: vpand {{.*}}(%rip), %xmm0, %xmm0 +; KNL-NEXT: vpsllw $15, %xmm0, %xmm0 +; KNL-NEXT: vpsraw $15, %xmm0, %xmm0 ; KNL-NEXT: popq %rax ; KNL-NEXT: retq ; @@ -247,12 +242,9 @@ define <8 x i1> @test7a(<8 x i32>%a, <8 x i32>%b) { ; SKX-NEXT: vpmovm2w %k0, %xmm0 ; SKX-NEXT: vzeroupper ; SKX-NEXT: callq _func8xi1 +; SKX-NEXT: vpand {{.*}}(%rip), %xmm0, %xmm0 ; SKX-NEXT: vpsllw $15, %xmm0, %xmm0 -; SKX-NEXT: vpmovw2m %xmm0, %k0 -; SKX-NEXT: movb $85, %al -; SKX-NEXT: kmovd %eax, %k1 -; SKX-NEXT: kandb %k1, %k0, %k0 -; SKX-NEXT: vpmovm2w %k0, %xmm0 +; SKX-NEXT: vpsraw $15, %xmm0, %xmm0 ; SKX-NEXT: popq %rax ; SKX-NEXT: retq ; @@ -264,14 +256,9 @@ define <8 x i1> @test7a(<8 x i32>%a, <8 x i32>%b) { ; KNL_X32-NEXT: vpmovdw %zmm0, %ymm0 ; KNL_X32-NEXT: ## kill: def %xmm0 killed %xmm0 killed %ymm0 ; KNL_X32-NEXT: calll _func8xi1 -; KNL_X32-NEXT: vpmovsxwq %xmm0, %zmm0 -; KNL_X32-NEXT: vpsllq $63, %zmm0, %zmm0 -; KNL_X32-NEXT: movb $85, %al -; KNL_X32-NEXT: kmovw %eax, %k1 -; KNL_X32-NEXT: vptestmq %zmm0, %zmm0, %k1 {%k1} -; KNL_X32-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 {%k1} {z} -; KNL_X32-NEXT: vpmovdw %zmm0, %ymm0 -; KNL_X32-NEXT: ## kill: def %xmm0 killed %xmm0 killed %ymm0 +; KNL_X32-NEXT: vpand LCPI7_0, %xmm0, %xmm0 +; KNL_X32-NEXT: vpsllw $15, %xmm0, %xmm0 +; KNL_X32-NEXT: vpsraw $15, %xmm0, %xmm0 ; KNL_X32-NEXT: addl $12, %esp ; KNL_X32-NEXT: retl %cmpRes = icmp sgt <8 x i32>%a, %b Modified: vendor/llvm/dist/test/CodeGen/X86/avx512-cvt.ll ============================================================================== --- vendor/llvm/dist/test/CodeGen/X86/avx512-cvt.ll Sun Dec 24 13:39:32 2017 (r327151) +++ vendor/llvm/dist/test/CodeGen/X86/avx512-cvt.ll Sun Dec 24 14:04:50 2017 (r327152) @@ -1691,8 +1691,8 @@ define <2 x double> @sbto2f64(<2 x double> %a) { ; VLDQ: # %bb.0: ; VLDQ-NEXT: vxorpd %xmm1, %xmm1, %xmm1 ; VLDQ-NEXT: vcmpltpd %xmm0, %xmm1, %k0 -; VLDQ-NEXT: vpmovm2q %k0, %xmm0 -; VLDQ-NEXT: vcvtqq2pd %xmm0, %xmm0 +; VLDQ-NEXT: vpmovm2d %k0, %xmm0 +; VLDQ-NEXT: vcvtdq2pd %xmm0, %xmm0 ; VLDQ-NEXT: retq ; ; VLNODQ-LABEL: sbto2f64: @@ -1700,12 +1700,8 @@ define <2 x double> @sbto2f64(<2 x double> %a) { ; VLNODQ-NEXT: vpxor %xmm1, %xmm1, %xmm1 ; VLNODQ-NEXT: vcmpltpd %xmm0, %xmm1, %k1 ; VLNODQ-NEXT: vpcmpeqd %xmm0, %xmm0, %xmm0 -; VLNODQ-NEXT: vmovdqa64 %xmm0, %xmm0 {%k1} {z} -; VLNODQ-NEXT: vpextrq $1, %xmm0, %rax -; VLNODQ-NEXT: vcvtsi2sdl %eax, %xmm2, %xmm1 -; VLNODQ-NEXT: vmovq %xmm0, %rax -; VLNODQ-NEXT: vcvtsi2sdl %eax, %xmm2, %xmm0 -; VLNODQ-NEXT: vmovlhps {{.*#+}} xmm0 = xmm0[0],xmm1[0] +; VLNODQ-NEXT: vmovdqa32 %xmm0, %xmm0 {%k1} {z} +; VLNODQ-NEXT: vcvtdq2pd %xmm0, %xmm0 ; VLNODQ-NEXT: retq %cmpres = fcmp ogt <2 x double> %a, zeroinitializer %1 = sitofp <2 x i1> %cmpres to <2 x double> @@ -2002,30 +1998,22 @@ define <2 x double> @ubto2f64(<2 x i32> %a) { ; NOVL-NEXT: vpxor %xmm1, %xmm1, %xmm1 ; NOVL-NEXT: vpblendd {{.*#+}} xmm0 = xmm0[0],xmm1[1],xmm0[2],xmm1[3] ; NOVL-NEXT: vpcmpgtq %xmm0, %xmm1, %xmm0 -; NOVL-NEXT: vpand {{.*}}(%rip), %xmm0, %xmm0 +; NOVL-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[0,2,2,3] +; NOVL-NEXT: vpbroadcastd {{.*#+}} xmm1 = [1,1,1,1] +; NOVL-NEXT: vpand %xmm1, %xmm0, %xmm0 +; NOVL-NEXT: vcvtudq2pd %ymm0, %zmm0 +; NOVL-NEXT: # kill: def %xmm0 killed %xmm0 killed %zmm0 +; NOVL-NEXT: vzeroupper ; NOVL-NEXT: retq ; -; VLDQ-LABEL: ubto2f64: -; VLDQ: # %bb.0: -; VLDQ-NEXT: vpxor %xmm1, %xmm1, %xmm1 -; VLDQ-NEXT: vpblendd {{.*#+}} xmm0 = xmm0[0],xmm1[1],xmm0[2],xmm1[3] -; VLDQ-NEXT: vpcmpltuq %xmm1, %xmm0, %k1 -; VLDQ-NEXT: vmovdqa64 {{.*}}(%rip), %xmm0 {%k1} {z} -; VLDQ-NEXT: vcvtqq2pd %xmm0, %xmm0 -; VLDQ-NEXT: retq -; -; VLNODQ-LABEL: ubto2f64: -; VLNODQ: # %bb.0: -; VLNODQ-NEXT: vpxor %xmm1, %xmm1, %xmm1 -; VLNODQ-NEXT: vpblendd {{.*#+}} xmm0 = xmm0[0],xmm1[1],xmm0[2],xmm1[3] -; VLNODQ-NEXT: vpcmpltuq %xmm1, %xmm0, %k1 -; VLNODQ-NEXT: vmovdqa64 {{.*}}(%rip), %xmm0 {%k1} {z} -; VLNODQ-NEXT: vpextrq $1, %xmm0, %rax -; VLNODQ-NEXT: vcvtsi2sdl %eax, %xmm2, %xmm1 -; VLNODQ-NEXT: vmovq %xmm0, %rax -; VLNODQ-NEXT: vcvtsi2sdl %eax, %xmm2, %xmm0 -; VLNODQ-NEXT: vmovlhps {{.*#+}} xmm0 = xmm0[0],xmm1[0] -; VLNODQ-NEXT: retq +; VL-LABEL: ubto2f64: +; VL: # %bb.0: +; VL-NEXT: vpxor %xmm1, %xmm1, %xmm1 +; VL-NEXT: vpblendd {{.*#+}} xmm0 = xmm0[0],xmm1[1],xmm0[2],xmm1[3] +; VL-NEXT: vpcmpltuq %xmm1, %xmm0, %k1 +; VL-NEXT: vpbroadcastd {{.*}}(%rip), %xmm0 {%k1} {z} +; VL-NEXT: vcvtudq2pd %xmm0, %xmm0 +; VL-NEXT: retq %mask = icmp ult <2 x i32> %a, zeroinitializer %1 = uitofp <2 x i1> %mask to <2 x double> ret <2 x double> %1 Modified: vendor/llvm/dist/test/CodeGen/X86/avx512-schedule.ll ============================================================================== --- vendor/llvm/dist/test/CodeGen/X86/avx512-schedule.ll Sun Dec 24 13:39:32 2017 (r327151) +++ vendor/llvm/dist/test/CodeGen/X86/avx512-schedule.ll Sun Dec 24 14:04:50 2017 (r327152) @@ -2602,16 +2602,16 @@ define <2 x double> @sbto2f64(<2 x double> %a) { ; GENERIC: # %bb.0: ; GENERIC-NEXT: vxorpd %xmm1, %xmm1, %xmm1 # sched: [1:1.00] ; GENERIC-NEXT: vcmpltpd %xmm0, %xmm1, %k0 # sched: [3:1.00] -; GENERIC-NEXT: vpmovm2q %k0, %xmm0 # sched: [1:0.33] -; GENERIC-NEXT: vcvtqq2pd %xmm0, %xmm0 # sched: [4:1.00] +; GENERIC-NEXT: vpmovm2d %k0, %xmm0 # sched: [1:0.33] +; GENERIC-NEXT: vcvtdq2pd %xmm0, %xmm0 # sched: [4:1.00] ; GENERIC-NEXT: retq # sched: [1:1.00] ; ; SKX-LABEL: sbto2f64: ; SKX: # %bb.0: ; SKX-NEXT: vxorpd %xmm1, %xmm1, %xmm1 # sched: [1:0.33] ; SKX-NEXT: vcmpltpd %xmm0, %xmm1, %k0 # sched: [3:1.00] -; SKX-NEXT: vpmovm2q %k0, %xmm0 # sched: [1:0.25] -; SKX-NEXT: vcvtqq2pd %xmm0, %xmm0 # sched: [4:0.33] +; SKX-NEXT: vpmovm2d %k0, %xmm0 # sched: [1:0.25] +; SKX-NEXT: vcvtdq2pd %xmm0, %xmm0 # sched: [5:1.00] ; SKX-NEXT: retq # sched: [7:1.00] %cmpres = fcmp ogt <2 x double> %a, zeroinitializer %1 = sitofp <2 x i1> %cmpres to <2 x double> @@ -2989,8 +2989,8 @@ define <2 x double> @ubto2f64(<2 x i32> %a) { ; GENERIC-NEXT: vpxor %xmm1, %xmm1, %xmm1 # sched: [1:0.33] ; GENERIC-NEXT: vpblendd {{.*#+}} xmm0 = xmm0[0],xmm1[1],xmm0[2],xmm1[3] sched: [1:0.50] ; GENERIC-NEXT: vpcmpltuq %xmm1, %xmm0, %k1 # sched: [3:1.00] -; GENERIC-NEXT: vmovdqa64 {{.*}}(%rip), %xmm0 {%k1} {z} # sched: [4:0.50] -; GENERIC-NEXT: vcvtqq2pd %xmm0, %xmm0 # sched: [4:1.00] +; GENERIC-NEXT: vpbroadcastd {{.*}}(%rip), %xmm0 {%k1} {z} # sched: [5:1.00] +; GENERIC-NEXT: vcvtudq2pd %xmm0, %xmm0 # sched: [4:1.00] ; GENERIC-NEXT: retq # sched: [1:1.00] ; ; SKX-LABEL: ubto2f64: @@ -2998,8 +2998,8 @@ define <2 x double> @ubto2f64(<2 x i32> %a) { ; SKX-NEXT: vpxor %xmm1, %xmm1, %xmm1 # sched: [1:0.33] ; SKX-NEXT: vpblendd {{.*#+}} xmm0 = xmm0[0],xmm1[1],xmm0[2],xmm1[3] sched: [1:0.33] ; SKX-NEXT: vpcmpltuq %xmm1, %xmm0, %k1 # sched: [3:1.00] -; SKX-NEXT: vmovdqa64 {{.*}}(%rip), %xmm0 {%k1} {z} # sched: [7:0.50] -; SKX-NEXT: vcvtqq2pd %xmm0, %xmm0 # sched: [4:0.33] +; SKX-NEXT: vpbroadcastd {{.*}}(%rip), %xmm0 {%k1} {z} # sched: [7:0.50] +; SKX-NEXT: vcvtudq2pd %xmm0, %xmm0 # sched: [5:1.00] ; SKX-NEXT: retq # sched: [7:1.00] %mask = icmp ult <2 x i32> %a, zeroinitializer %1 = uitofp <2 x i1> %mask to <2 x double> Added: vendor/llvm/dist/test/CodeGen/X86/pr34080-2.ll ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/llvm/dist/test/CodeGen/X86/pr34080-2.ll Sun Dec 24 14:04:50 2017 (r327152) @@ -0,0 +1,136 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: llc < %s -mtriple=i386-unknown-openbsd6.2 | FileCheck %s + +%struct.DateTime = type { i64, i32, i32, i32, i32, i32, double, i8 } + +define void @computeJD(%struct.DateTime*) nounwind { +; CHECK-LABEL: computeJD: +; CHECK: # %bb.0: +; CHECK-NEXT: pushl %ebp +; CHECK-NEXT: movl %esp, %ebp +; CHECK-NEXT: pushl %ebx +; CHECK-NEXT: pushl %edi +; CHECK-NEXT: pushl %esi +; CHECK-NEXT: andl $-8, %esp +; CHECK-NEXT: subl $32, %esp +; CHECK-NEXT: movl 8(%ebp), %ebx +; CHECK-NEXT: movl 8(%ebx), %esi +; CHECK-NEXT: xorl %eax, %eax +; CHECK-NEXT: cmpl $3, 12(%ebx) +; CHECK-NEXT: setl %al +; CHECK-NEXT: subl %eax, %esi +; CHECK-NEXT: movl $-1374389535, %ecx # imm = 0xAE147AE1 +; CHECK-NEXT: movl %esi, %eax +; CHECK-NEXT: imull %ecx +; CHECK-NEXT: movl %edx, %ecx +; CHECK-NEXT: movl %ecx, %eax +; CHECK-NEXT: shrl $31, %eax +; CHECK-NEXT: sarl $5, %ecx +; CHECK-NEXT: addl %eax, %ecx +; CHECK-NEXT: movl $1374389535, %edx # imm = 0x51EB851F +; CHECK-NEXT: movl %esi, %eax +; CHECK-NEXT: imull %edx +; CHECK-NEXT: movl %edx, %edi +; CHECK-NEXT: movl %edi, %eax +; CHECK-NEXT: shrl $31, %eax +; CHECK-NEXT: sarl $7, %edi +; CHECK-NEXT: addl %eax, %edi +; CHECK-NEXT: imull $36525, %esi, %eax # imm = 0x8EAD +; CHECK-NEXT: addl $172251900, %eax # imm = 0xA445AFC +; CHECK-NEXT: movl $1374389535, %edx # imm = 0x51EB851F +; CHECK-NEXT: imull %edx +; CHECK-NEXT: movl %edx, %eax +; CHECK-NEXT: shrl $31, %eax +; CHECK-NEXT: sarl $5, %edx +; CHECK-NEXT: addl %eax, %edx +; CHECK-NEXT: addl 16(%ebx), %ecx +; CHECK-NEXT: addl %edi, %ecx +; CHECK-NEXT: leal 257(%ecx,%edx), %eax +; CHECK-NEXT: movl %eax, {{[0-9]+}}(%esp) +; CHECK-NEXT: fildl {{[0-9]+}}(%esp) +; CHECK-NEXT: fadds {{\.LCPI.*}} +; CHECK-NEXT: fmuls {{\.LCPI.*}} +; CHECK-NEXT: fnstcw {{[0-9]+}}(%esp) +; CHECK-NEXT: movzwl {{[0-9]+}}(%esp), %eax +; CHECK-NEXT: movw $3199, {{[0-9]+}}(%esp) # imm = 0xC7F +; CHECK-NEXT: fldcw {{[0-9]+}}(%esp) +; CHECK-NEXT: movw %ax, {{[0-9]+}}(%esp) +; CHECK-NEXT: fistpll {{[0-9]+}}(%esp) +; CHECK-NEXT: fldcw {{[0-9]+}}(%esp) +; CHECK-NEXT: movb $1, 36(%ebx) +; CHECK-NEXT: imull $3600000, 20(%ebx), %eax # imm = 0x36EE80 +; CHECK-NEXT: imull $60000, 24(%ebx), %ecx # imm = 0xEA60 +; CHECK-NEXT: addl %eax, %ecx +; CHECK-NEXT: fldl 28(%ebx) +; CHECK-NEXT: fmuls {{\.LCPI.*}} +; CHECK-NEXT: fnstcw (%esp) +; CHECK-NEXT: movzwl (%esp), %eax +; CHECK-NEXT: movw $3199, (%esp) # imm = 0xC7F +; CHECK-NEXT: fldcw (%esp) +; CHECK-NEXT: movw %ax, (%esp) +; CHECK-NEXT: movl %ecx, %eax +; CHECK-NEXT: sarl $31, %eax +; CHECK-NEXT: fistpll {{[0-9]+}}(%esp) +; CHECK-NEXT: fldcw (%esp) +; CHECK-NEXT: addl {{[0-9]+}}(%esp), %ecx +; CHECK-NEXT: adcl {{[0-9]+}}(%esp), %eax +; CHECK-NEXT: addl {{[0-9]+}}(%esp), %ecx +; CHECK-NEXT: adcl {{[0-9]+}}(%esp), %eax +; CHECK-NEXT: movl %ecx, (%ebx) +; CHECK-NEXT: movl %eax, 4(%ebx) +; CHECK-NEXT: leal -12(%ebp), %esp +; CHECK-NEXT: popl %esi +; CHECK-NEXT: popl %edi +; CHECK-NEXT: popl %ebx +; CHECK-NEXT: popl %ebp +; CHECK-NEXT: retl + %2 = getelementptr inbounds %struct.DateTime, %struct.DateTime* %0, i32 0, i32 7 + %3 = getelementptr inbounds %struct.DateTime, %struct.DateTime* %0, i32 0, i32 1 + %4 = load i32, i32* %3, align 4 + %5 = getelementptr inbounds %struct.DateTime, %struct.DateTime* %0, i32 0, i32 2 + %6 = load i32, i32* %5, align 4 + %7 = getelementptr inbounds %struct.DateTime, %struct.DateTime* %0, i32 0, i32 3 + %8 = load i32, i32* %7, align 4 + %9 = icmp slt i32 %6, 3 + %10 = add i32 %6, 12 + %11 = select i1 %9, i32 %10, i32 %6 + %12 = sext i1 %9 to i32 + %13 = add i32 %4, %12 + %14 = sdiv i32 %13, -100 + %15 = sdiv i32 %13, 400 + %16 = mul i32 %13, 36525 + %17 = add i32 %16, 172251900 + %18 = sdiv i32 %17, 100 + %19 = mul i32 %11, 306001 + %20 = add i32 %19, 306001 + %21 = sdiv i32 %20, 10000 + %22 = add i32 %8, 2 + %23 = add i32 %22, %14 + %24 = add i32 %23, %15 + %25 = add i32 %24, 255 + %26 = add i32 %25, %18 + %27 = sitofp i32 %26 to double + %28 = fadd double %27, -1.524500e+03 + %29 = fmul double %28, 8.640000e+07 + %30 = fptosi double %29 to i64 + %31 = getelementptr inbounds %struct.DateTime, %struct.DateTime* %0, i32 0, i32 0 + store i8 1, i8* %2, align 4 + %32 = getelementptr inbounds %struct.DateTime, %struct.DateTime* %0, i32 0, i32 4 + %33 = load i32, i32* %32, align 4 + %34 = mul i32 %33, 3600000 + %35 = getelementptr inbounds %struct.DateTime, %struct.DateTime* %0, i32 0, i32 5 + %36 = load i32, i32* %35, align 4 + %37 = mul i32 %36, 60000 + %38 = add i32 %37, %34 + %39 = sext i32 %38 to i64 + %40 = getelementptr inbounds %struct.DateTime, %struct.DateTime* %0, i32 0, i32 6 + %41 = load double, double* %40, align 4 + %42 = fmul double %41, 1.000000e+03 + %43 = fptosi double %42 to i64 + %44 = add i64 %39, %43 + %45 = add i64 %44, %30 + store i64 %45, i64* %31, align 4 + ret void +} + +attributes #0 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="i486" "target-features"="+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } Modified: vendor/llvm/dist/test/CodeGen/X86/pr34080.ll ============================================================================== --- vendor/llvm/dist/test/CodeGen/X86/pr34080.ll Sun Dec 24 13:39:32 2017 (r327151) +++ vendor/llvm/dist/test/CodeGen/X86/pr34080.ll Sun Dec 24 14:04:50 2017 (r327152) @@ -1,6 +1,6 @@ ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=+sse2 | FileCheck %s --check-prefix=SSE2 -; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=+sse2 -mcpu=x86-64 | FileCheck %s --check-prefix=SSE2-BROKEN +; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=+sse2 -mcpu=x86-64 | FileCheck %s --check-prefix=SSE2-SCHEDULE ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=+sse3 | FileCheck %s --check-prefix=SSE3 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=+sse3 -mcpu=prescott | FileCheck %s --check-prefix=SSE3 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=+avx | FileCheck %s --check-prefix=AVX @@ -46,44 +46,44 @@ define void @_Z1fe(x86_fp80 %z) local_unnamed_addr #0 ; SSE2-NEXT: popq %rbp ; SSE2-NEXT: retq ; -; SSE2-BROKEN-LABEL: _Z1fe: -; SSE2-BROKEN: ## %bb.0: ## %entry -; SSE2-BROKEN-NEXT: pushq %rbp -; SSE2-BROKEN-NEXT: .cfi_def_cfa_offset 16 -; SSE2-BROKEN-NEXT: .cfi_offset %rbp, -16 -; SSE2-BROKEN-NEXT: movq %rsp, %rbp -; SSE2-BROKEN-NEXT: .cfi_def_cfa_register %rbp -; SSE2-BROKEN-NEXT: fnstcw -4(%rbp) -; SSE2-BROKEN-NEXT: fldt 16(%rbp) -; SSE2-BROKEN-NEXT: movzwl -4(%rbp), %eax -; SSE2-BROKEN-NEXT: movw $3199, -4(%rbp) ## imm = 0xC7F -; SSE2-BROKEN-NEXT: fldcw -4(%rbp) -; SSE2-BROKEN-NEXT: movw %ax, -4(%rbp) -; SSE2-BROKEN-NEXT: fistl -8(%rbp) -; SSE2-BROKEN-NEXT: fldcw -4(%rbp) -; SSE2-BROKEN-NEXT: cvtsi2sdl -8(%rbp), %xmm0 -; SSE2-BROKEN-NEXT: movsd %xmm0, -64(%rbp) -; SSE2-BROKEN-NEXT: movsd %xmm0, -32(%rbp) -; SSE2-BROKEN-NEXT: fsubl -32(%rbp) -; SSE2-BROKEN-NEXT: flds {{.*}}(%rip) -; SSE2-BROKEN-NEXT: fnstcw -2(%rbp) -; SSE2-BROKEN-NEXT: fmul %st(0), %st(1) -; SSE2-BROKEN-NEXT: movzwl -2(%rbp), %eax -; SSE2-BROKEN-NEXT: movw $3199, -2(%rbp) ## imm = 0xC7F -; SSE2-BROKEN-NEXT: fldcw -2(%rbp) -; SSE2-BROKEN-NEXT: movw %ax, -2(%rbp) -; SSE2-BROKEN-NEXT: fxch %st(1) -; SSE2-BROKEN-NEXT: fistl -12(%rbp) -; SSE2-BROKEN-NEXT: fldcw -2(%rbp) -; SSE2-BROKEN-NEXT: xorps %xmm0, %xmm0 -; SSE2-BROKEN-NEXT: cvtsi2sdl -12(%rbp), %xmm0 -; SSE2-BROKEN-NEXT: movsd %xmm0, -56(%rbp) -; SSE2-BROKEN-NEXT: movsd %xmm0, -24(%rbp) -; SSE2-BROKEN-NEXT: fsubl -24(%rbp) -; SSE2-BROKEN-NEXT: fmulp %st(1) -; SSE2-BROKEN-NEXT: fstpl -48(%rbp) -; SSE2-BROKEN-NEXT: popq %rbp -; SSE2-BROKEN-NEXT: retq +; SSE2-SCHEDULE-LABEL: _Z1fe: +; SSE2-SCHEDULE: ## %bb.0: ## %entry +; SSE2-SCHEDULE-NEXT: pushq %rbp +; SSE2-SCHEDULE-NEXT: .cfi_def_cfa_offset 16 +; SSE2-SCHEDULE-NEXT: .cfi_offset %rbp, -16 +; SSE2-SCHEDULE-NEXT: movq %rsp, %rbp +; SSE2-SCHEDULE-NEXT: .cfi_def_cfa_register %rbp +; SSE2-SCHEDULE-NEXT: fnstcw -4(%rbp) +; SSE2-SCHEDULE-NEXT: fldt 16(%rbp) +; SSE2-SCHEDULE-NEXT: movzwl -4(%rbp), %eax +; SSE2-SCHEDULE-NEXT: movw $3199, -4(%rbp) ## imm = 0xC7F +; SSE2-SCHEDULE-NEXT: fldcw -4(%rbp) +; SSE2-SCHEDULE-NEXT: movw %ax, -4(%rbp) +; SSE2-SCHEDULE-NEXT: fistl -8(%rbp) +; SSE2-SCHEDULE-NEXT: fldcw -4(%rbp) +; SSE2-SCHEDULE-NEXT: cvtsi2sdl -8(%rbp), %xmm0 +; SSE2-SCHEDULE-NEXT: movsd %xmm0, -64(%rbp) +; SSE2-SCHEDULE-NEXT: movsd %xmm0, -32(%rbp) +; SSE2-SCHEDULE-NEXT: fsubl -32(%rbp) +; SSE2-SCHEDULE-NEXT: flds {{.*}}(%rip) +; SSE2-SCHEDULE-NEXT: fnstcw -2(%rbp) +; SSE2-SCHEDULE-NEXT: fmul %st(0), %st(1) +; SSE2-SCHEDULE-NEXT: movzwl -2(%rbp), %eax +; SSE2-SCHEDULE-NEXT: movw $3199, -2(%rbp) ## imm = 0xC7F +; SSE2-SCHEDULE-NEXT: fldcw -2(%rbp) +; SSE2-SCHEDULE-NEXT: movw %ax, -2(%rbp) +; SSE2-SCHEDULE-NEXT: fxch %st(1) +; SSE2-SCHEDULE-NEXT: fistl -12(%rbp) +; SSE2-SCHEDULE-NEXT: fldcw -2(%rbp) +; SSE2-SCHEDULE-NEXT: xorps %xmm0, %xmm0 +; SSE2-SCHEDULE-NEXT: cvtsi2sdl -12(%rbp), %xmm0 +; SSE2-SCHEDULE-NEXT: movsd %xmm0, -56(%rbp) +; SSE2-SCHEDULE-NEXT: movsd %xmm0, -24(%rbp) +; SSE2-SCHEDULE-NEXT: fsubl -24(%rbp) +; SSE2-SCHEDULE-NEXT: fmulp %st(1) +; SSE2-SCHEDULE-NEXT: fstpl -48(%rbp) +; SSE2-SCHEDULE-NEXT: popq %rbp +; SSE2-SCHEDULE-NEXT: retq ; ; SSE3-LABEL: _Z1fe: ; SSE3: ## %bb.0: ## %entry Modified: vendor/llvm/dist/test/CodeGen/X86/shrink_vmul.ll ============================================================================== --- vendor/llvm/dist/test/CodeGen/X86/shrink_vmul.ll Sun Dec 24 13:39:32 2017 (r327151) +++ vendor/llvm/dist/test/CodeGen/X86/shrink_vmul.ll Sun Dec 24 14:04:50 2017 (r327152) @@ -1,6 +1,10 @@ ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py -; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+sse2 | FileCheck %s --check-prefix=X86 -; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse2 | FileCheck %s --check-prefix=X64 +; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+sse2 | FileCheck %s --check-prefix=X86 --check-prefix=X86-SSE +; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+avx | FileCheck %s --check-prefix=X86 --check-prefix=X86-AVX --check-prefix=X86-AVX1 +; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+avx2 | FileCheck %s --check-prefix=X86 --check-prefix=X86-AVX --check-prefix=X86-AVX2 +; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse2 | FileCheck %s --check-prefix=X64 --check-prefix=X64-SSE +; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx | FileCheck %s --check-prefix=X64 --check-prefix=X64-AVX --check-prefix=X64-AVX1 +; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx2 | FileCheck %s --check-prefix=X64 --check-prefix=X64-AVX --check-prefix=X64-AVX2 @c = external global i32*, align 8 @@ -11,42 +15,69 @@ ; %rst = mul <2 x i32> %op1, %op2 ; define void @mul_2xi8(i8* nocapture readonly %a, i8* nocapture readonly %b, i64 %index) { -; X86-LABEL: mul_2xi8: -; X86: # %bb.0: # %entry -; X86-NEXT: pushl %esi -; X86-NEXT: .cfi_def_cfa_offset 8 -; X86-NEXT: .cfi_offset %esi, -8 -; X86-NEXT: movl {{[0-9]+}}(%esp), %eax -; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx -; X86-NEXT: movl {{[0-9]+}}(%esp), %edx -; X86-NEXT: movl c, %esi -; X86-NEXT: movzwl (%edx,%ecx), %edx -; X86-NEXT: movd %edx, %xmm0 -; X86-NEXT: movzwl (%eax,%ecx), %eax -; X86-NEXT: movd %eax, %xmm1 -; X86-NEXT: pxor %xmm2, %xmm2 -; X86-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1],xmm0[2],xmm2[2],xmm0[3],xmm2[3],xmm0[4],xmm2[4],xmm0[5],xmm2[5],xmm0[6],xmm2[6],xmm0[7],xmm2[7] -; X86-NEXT: punpcklbw {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1],xmm1[2],xmm2[2],xmm1[3],xmm2[3],xmm1[4],xmm2[4],xmm1[5],xmm2[5],xmm1[6],xmm2[6],xmm1[7],xmm2[7] -; X86-NEXT: pmullw %xmm0, %xmm1 -; X86-NEXT: punpcklwd {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1],xmm1[2],xmm2[2],xmm1[3],xmm2[3] -; X86-NEXT: movq %xmm1, (%esi,%ecx,4) -; X86-NEXT: popl %esi -; X86-NEXT: retl +; X86-SSE-LABEL: mul_2xi8: +; X86-SSE: # %bb.0: # %entry +; X86-SSE-NEXT: pushl %esi +; X86-SSE-NEXT: .cfi_def_cfa_offset 8 +; X86-SSE-NEXT: .cfi_offset %esi, -8 +; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %eax +; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %ecx +; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %edx +; X86-SSE-NEXT: movl c, %esi +; X86-SSE-NEXT: movzwl (%edx,%ecx), %edx +; X86-SSE-NEXT: movd %edx, %xmm0 +; X86-SSE-NEXT: movzwl (%eax,%ecx), %eax +; X86-SSE-NEXT: movd %eax, %xmm1 +; X86-SSE-NEXT: pxor %xmm2, %xmm2 +; X86-SSE-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1],xmm0[2],xmm2[2],xmm0[3],xmm2[3],xmm0[4],xmm2[4],xmm0[5],xmm2[5],xmm0[6],xmm2[6],xmm0[7],xmm2[7] +; X86-SSE-NEXT: punpcklbw {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1],xmm1[2],xmm2[2],xmm1[3],xmm2[3],xmm1[4],xmm2[4],xmm1[5],xmm2[5],xmm1[6],xmm2[6],xmm1[7],xmm2[7] +; X86-SSE-NEXT: pmullw %xmm0, %xmm1 +; X86-SSE-NEXT: punpcklwd {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1],xmm1[2],xmm2[2],xmm1[3],xmm2[3] +; X86-SSE-NEXT: movq %xmm1, (%esi,%ecx,4) +; X86-SSE-NEXT: popl %esi +; X86-SSE-NEXT: retl ; -; X64-LABEL: mul_2xi8: -; X64: # %bb.0: # %entry -; X64-NEXT: movq {{.*}}(%rip), %rax -; X64-NEXT: movzwl (%rdi,%rdx), %ecx -; X64-NEXT: movd %ecx, %xmm0 -; X64-NEXT: movzwl (%rsi,%rdx), %ecx -; X64-NEXT: movd %ecx, %xmm1 -; X64-NEXT: pxor %xmm2, %xmm2 -; X64-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1],xmm0[2],xmm2[2],xmm0[3],xmm2[3],xmm0[4],xmm2[4],xmm0[5],xmm2[5],xmm0[6],xmm2[6],xmm0[7],xmm2[7] -; X64-NEXT: punpcklbw {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1],xmm1[2],xmm2[2],xmm1[3],xmm2[3],xmm1[4],xmm2[4],xmm1[5],xmm2[5],xmm1[6],xmm2[6],xmm1[7],xmm2[7] -; X64-NEXT: pmullw %xmm0, %xmm1 -; X64-NEXT: punpcklwd {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1],xmm1[2],xmm2[2],xmm1[3],xmm2[3] -; X64-NEXT: movq %xmm1, (%rax,%rdx,4) -; X64-NEXT: retq +; X86-AVX-LABEL: mul_2xi8: +; X86-AVX: # %bb.0: # %entry +; X86-AVX-NEXT: pushl %esi +; X86-AVX-NEXT: .cfi_def_cfa_offset 8 +; X86-AVX-NEXT: .cfi_offset %esi, -8 +; X86-AVX-NEXT: movl {{[0-9]+}}(%esp), %eax +; X86-AVX-NEXT: movl {{[0-9]+}}(%esp), %ecx +; X86-AVX-NEXT: movl {{[0-9]+}}(%esp), %edx +; X86-AVX-NEXT: movl c, %esi +; X86-AVX-NEXT: vpmovzxbq {{.*#+}} xmm0 = mem[0],zero,zero,zero,zero,zero,zero,zero,mem[1],zero,zero,zero,zero,zero,zero,zero +; X86-AVX-NEXT: vpmovzxbq {{.*#+}} xmm1 = mem[0],zero,zero,zero,zero,zero,zero,zero,mem[1],zero,zero,zero,zero,zero,zero,zero +; X86-AVX-NEXT: vpmulld %xmm0, %xmm1, %xmm0 +; X86-AVX-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[0,2,2,3] +; X86-AVX-NEXT: vmovq %xmm0, (%esi,%ecx,4) +; X86-AVX-NEXT: popl %esi +; X86-AVX-NEXT: retl +; +; X64-SSE-LABEL: mul_2xi8: +; X64-SSE: # %bb.0: # %entry +; X64-SSE-NEXT: movq {{.*}}(%rip), %rax +; X64-SSE-NEXT: movzwl (%rdi,%rdx), %ecx +; X64-SSE-NEXT: movd %ecx, %xmm0 +; X64-SSE-NEXT: movzwl (%rsi,%rdx), %ecx +; X64-SSE-NEXT: movd %ecx, %xmm1 +; X64-SSE-NEXT: pxor %xmm2, %xmm2 +; X64-SSE-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1],xmm0[2],xmm2[2],xmm0[3],xmm2[3],xmm0[4],xmm2[4],xmm0[5],xmm2[5],xmm0[6],xmm2[6],xmm0[7],xmm2[7] +; X64-SSE-NEXT: punpcklbw {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1],xmm1[2],xmm2[2],xmm1[3],xmm2[3],xmm1[4],xmm2[4],xmm1[5],xmm2[5],xmm1[6],xmm2[6],xmm1[7],xmm2[7] +; X64-SSE-NEXT: pmullw %xmm0, %xmm1 +; X64-SSE-NEXT: punpcklwd {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1],xmm1[2],xmm2[2],xmm1[3],xmm2[3] +; X64-SSE-NEXT: movq %xmm1, (%rax,%rdx,4) +; X64-SSE-NEXT: retq +; +; X64-AVX-LABEL: mul_2xi8: +; X64-AVX: # %bb.0: # %entry +; X64-AVX-NEXT: movq {{.*}}(%rip), %rax +; X64-AVX-NEXT: vpmovzxbq {{.*#+}} xmm0 = mem[0],zero,zero,zero,zero,zero,zero,zero,mem[1],zero,zero,zero,zero,zero,zero,zero +; X64-AVX-NEXT: vpmovzxbq {{.*#+}} xmm1 = mem[0],zero,zero,zero,zero,zero,zero,zero,mem[1],zero,zero,zero,zero,zero,zero,zero +; X64-AVX-NEXT: vpmulld %xmm0, %xmm1, %xmm0 +; X64-AVX-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[0,2,2,3] +; X64-AVX-NEXT: vmovq %xmm0, (%rax,%rdx,4) +; X64-AVX-NEXT: retq entry: %pre = load i32*, i32** @c %tmp6 = getelementptr inbounds i8, i8* %a, i64 %index @@ -71,38 +102,63 @@ entry: ; %rst = mul <4 x i32> %op1, %op2 ; define void @mul_4xi8(i8* nocapture readonly %a, i8* nocapture readonly %b, i64 %index) { -; X86-LABEL: mul_4xi8: -; X86: # %bb.0: # %entry -; X86-NEXT: pushl %esi -; X86-NEXT: .cfi_def_cfa_offset 8 -; X86-NEXT: .cfi_offset %esi, -8 -; X86-NEXT: movl {{[0-9]+}}(%esp), %eax -; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx -; X86-NEXT: movl {{[0-9]+}}(%esp), %edx -; X86-NEXT: movl c, %esi -; X86-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero -; X86-NEXT: movd {{.*#+}} xmm1 = mem[0],zero,zero,zero -; X86-NEXT: pxor %xmm2, %xmm2 -; X86-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1],xmm0[2],xmm2[2],xmm0[3],xmm2[3],xmm0[4],xmm2[4],xmm0[5],xmm2[5],xmm0[6],xmm2[6],xmm0[7],xmm2[7] -; X86-NEXT: punpcklbw {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1],xmm1[2],xmm2[2],xmm1[3],xmm2[3],xmm1[4],xmm2[4],xmm1[5],xmm2[5],xmm1[6],xmm2[6],xmm1[7],xmm2[7] -; X86-NEXT: pmullw %xmm0, %xmm1 -; X86-NEXT: punpcklwd {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1],xmm1[2],xmm2[2],xmm1[3],xmm2[3] -; X86-NEXT: movdqu %xmm1, (%esi,%ecx,4) -; X86-NEXT: popl %esi -; X86-NEXT: retl +; X86-SSE-LABEL: mul_4xi8: +; X86-SSE: # %bb.0: # %entry +; X86-SSE-NEXT: pushl %esi +; X86-SSE-NEXT: .cfi_def_cfa_offset 8 +; X86-SSE-NEXT: .cfi_offset %esi, -8 +; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %eax +; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %ecx +; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %edx +; X86-SSE-NEXT: movl c, %esi +; X86-SSE-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero +; X86-SSE-NEXT: movd {{.*#+}} xmm1 = mem[0],zero,zero,zero +; X86-SSE-NEXT: pxor %xmm2, %xmm2 +; X86-SSE-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1],xmm0[2],xmm2[2],xmm0[3],xmm2[3],xmm0[4],xmm2[4],xmm0[5],xmm2[5],xmm0[6],xmm2[6],xmm0[7],xmm2[7] +; X86-SSE-NEXT: punpcklbw {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1],xmm1[2],xmm2[2],xmm1[3],xmm2[3],xmm1[4],xmm2[4],xmm1[5],xmm2[5],xmm1[6],xmm2[6],xmm1[7],xmm2[7] +; X86-SSE-NEXT: pmullw %xmm0, %xmm1 +; X86-SSE-NEXT: punpcklwd {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1],xmm1[2],xmm2[2],xmm1[3],xmm2[3] +; X86-SSE-NEXT: movdqu %xmm1, (%esi,%ecx,4) +; X86-SSE-NEXT: popl %esi +; X86-SSE-NEXT: retl ; -; X64-LABEL: mul_4xi8: -; X64: # %bb.0: # %entry -; X64-NEXT: movq {{.*}}(%rip), %rax -; X64-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero -; X64-NEXT: movd {{.*#+}} xmm1 = mem[0],zero,zero,zero -; X64-NEXT: pxor %xmm2, %xmm2 -; X64-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1],xmm0[2],xmm2[2],xmm0[3],xmm2[3],xmm0[4],xmm2[4],xmm0[5],xmm2[5],xmm0[6],xmm2[6],xmm0[7],xmm2[7] -; X64-NEXT: punpcklbw {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1],xmm1[2],xmm2[2],xmm1[3],xmm2[3],xmm1[4],xmm2[4],xmm1[5],xmm2[5],xmm1[6],xmm2[6],xmm1[7],xmm2[7] -; X64-NEXT: pmullw %xmm0, %xmm1 -; X64-NEXT: punpcklwd {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1],xmm1[2],xmm2[2],xmm1[3],xmm2[3] -; X64-NEXT: movdqu %xmm1, (%rax,%rdx,4) -; X64-NEXT: retq +; X86-AVX-LABEL: mul_4xi8: +; X86-AVX: # %bb.0: # %entry +; X86-AVX-NEXT: pushl %esi +; X86-AVX-NEXT: .cfi_def_cfa_offset 8 +; X86-AVX-NEXT: .cfi_offset %esi, -8 +; X86-AVX-NEXT: movl {{[0-9]+}}(%esp), %eax +; X86-AVX-NEXT: movl {{[0-9]+}}(%esp), %ecx +; X86-AVX-NEXT: movl {{[0-9]+}}(%esp), %edx +; X86-AVX-NEXT: movl c, %esi +; X86-AVX-NEXT: vpmovzxbd {{.*#+}} xmm0 = mem[0],zero,zero,zero,mem[1],zero,zero,zero,mem[2],zero,zero,zero,mem[3],zero,zero,zero +; X86-AVX-NEXT: vpmovzxbd {{.*#+}} xmm1 = mem[0],zero,zero,zero,mem[1],zero,zero,zero,mem[2],zero,zero,zero,mem[3],zero,zero,zero +; X86-AVX-NEXT: vpmulld %xmm0, %xmm1, %xmm0 +; X86-AVX-NEXT: vmovdqu %xmm0, (%esi,%ecx,4) +; X86-AVX-NEXT: popl %esi +; X86-AVX-NEXT: retl +; +; X64-SSE-LABEL: mul_4xi8: +; X64-SSE: # %bb.0: # %entry +; X64-SSE-NEXT: movq {{.*}}(%rip), %rax +; X64-SSE-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero +; X64-SSE-NEXT: movd {{.*#+}} xmm1 = mem[0],zero,zero,zero +; X64-SSE-NEXT: pxor %xmm2, %xmm2 +; X64-SSE-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1],xmm0[2],xmm2[2],xmm0[3],xmm2[3],xmm0[4],xmm2[4],xmm0[5],xmm2[5],xmm0[6],xmm2[6],xmm0[7],xmm2[7] +; X64-SSE-NEXT: punpcklbw {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1],xmm1[2],xmm2[2],xmm1[3],xmm2[3],xmm1[4],xmm2[4],xmm1[5],xmm2[5],xmm1[6],xmm2[6],xmm1[7],xmm2[7] +; X64-SSE-NEXT: pmullw %xmm0, %xmm1 +; X64-SSE-NEXT: punpcklwd {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1],xmm1[2],xmm2[2],xmm1[3],xmm2[3] +; X64-SSE-NEXT: movdqu %xmm1, (%rax,%rdx,4) +; X64-SSE-NEXT: retq +; +; X64-AVX-LABEL: mul_4xi8: +; X64-AVX: # %bb.0: # %entry +; X64-AVX-NEXT: movq {{.*}}(%rip), %rax +; X64-AVX-NEXT: vpmovzxbd {{.*#+}} xmm0 = mem[0],zero,zero,zero,mem[1],zero,zero,zero,mem[2],zero,zero,zero,mem[3],zero,zero,zero +; X64-AVX-NEXT: vpmovzxbd {{.*#+}} xmm1 = mem[0],zero,zero,zero,mem[1],zero,zero,zero,mem[2],zero,zero,zero,mem[3],zero,zero,zero +; X64-AVX-NEXT: vpmulld %xmm0, %xmm1, %xmm0 +; X64-AVX-NEXT: vmovdqu %xmm0, (%rax,%rdx,4) +; X64-AVX-NEXT: retq entry: %pre = load i32*, i32** @c %tmp6 = getelementptr inbounds i8, i8* %a, i64 %index @@ -127,44 +183,106 @@ entry: ; %rst = mul <8 x i32> %op1, %op2 ; define void @mul_8xi8(i8* nocapture readonly %a, i8* nocapture readonly %b, i64 %index) { -; X86-LABEL: mul_8xi8: -; X86: # %bb.0: # %entry -; X86-NEXT: pushl %esi -; X86-NEXT: .cfi_def_cfa_offset 8 -; X86-NEXT: .cfi_offset %esi, -8 -; X86-NEXT: movl {{[0-9]+}}(%esp), %eax -; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx -; X86-NEXT: movl {{[0-9]+}}(%esp), %edx -; X86-NEXT: movl c, %esi -; X86-NEXT: movq {{.*#+}} xmm0 = mem[0],zero -; X86-NEXT: movq {{.*#+}} xmm1 = mem[0],zero -; X86-NEXT: pxor %xmm2, %xmm2 -; X86-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1],xmm0[2],xmm2[2],xmm0[3],xmm2[3],xmm0[4],xmm2[4],xmm0[5],xmm2[5],xmm0[6],xmm2[6],xmm0[7],xmm2[7] -; X86-NEXT: punpcklbw {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1],xmm1[2],xmm2[2],xmm1[3],xmm2[3],xmm1[4],xmm2[4],xmm1[5],xmm2[5],xmm1[6],xmm2[6],xmm1[7],xmm2[7] -; X86-NEXT: pmullw %xmm0, %xmm1 -; X86-NEXT: movdqa %xmm1, %xmm0 -; X86-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1],xmm0[2],xmm2[2],xmm0[3],xmm2[3] -; X86-NEXT: punpckhwd {{.*#+}} xmm1 = xmm1[4],xmm2[4],xmm1[5],xmm2[5],xmm1[6],xmm2[6],xmm1[7],xmm2[7] -; X86-NEXT: movdqu %xmm1, 16(%esi,%ecx,4) -; X86-NEXT: movdqu %xmm0, (%esi,%ecx,4) -; X86-NEXT: popl %esi -; X86-NEXT: retl +; X86-SSE-LABEL: mul_8xi8: +; X86-SSE: # %bb.0: # %entry +; X86-SSE-NEXT: pushl %esi +; X86-SSE-NEXT: .cfi_def_cfa_offset 8 +; X86-SSE-NEXT: .cfi_offset %esi, -8 +; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %eax +; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %ecx +; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %edx +; X86-SSE-NEXT: movl c, %esi +; X86-SSE-NEXT: movq {{.*#+}} xmm0 = mem[0],zero +; X86-SSE-NEXT: movq {{.*#+}} xmm1 = mem[0],zero +; X86-SSE-NEXT: pxor %xmm2, %xmm2 +; X86-SSE-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1],xmm0[2],xmm2[2],xmm0[3],xmm2[3],xmm0[4],xmm2[4],xmm0[5],xmm2[5],xmm0[6],xmm2[6],xmm0[7],xmm2[7] +; X86-SSE-NEXT: punpcklbw {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1],xmm1[2],xmm2[2],xmm1[3],xmm2[3],xmm1[4],xmm2[4],xmm1[5],xmm2[5],xmm1[6],xmm2[6],xmm1[7],xmm2[7] +; X86-SSE-NEXT: pmullw %xmm0, %xmm1 +; X86-SSE-NEXT: movdqa %xmm1, %xmm0 +; X86-SSE-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1],xmm0[2],xmm2[2],xmm0[3],xmm2[3] +; X86-SSE-NEXT: punpckhwd {{.*#+}} xmm1 = xmm1[4],xmm2[4],xmm1[5],xmm2[5],xmm1[6],xmm2[6],xmm1[7],xmm2[7] +; X86-SSE-NEXT: movdqu %xmm1, 16(%esi,%ecx,4) +; X86-SSE-NEXT: movdqu %xmm0, (%esi,%ecx,4) +; X86-SSE-NEXT: popl %esi +; X86-SSE-NEXT: retl ; -; X64-LABEL: mul_8xi8: -; X64: # %bb.0: # %entry -; X64-NEXT: movq {{.*}}(%rip), %rax -; X64-NEXT: movq {{.*#+}} xmm0 = mem[0],zero -; X64-NEXT: movq {{.*#+}} xmm1 = mem[0],zero -; X64-NEXT: pxor %xmm2, %xmm2 -; X64-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1],xmm0[2],xmm2[2],xmm0[3],xmm2[3],xmm0[4],xmm2[4],xmm0[5],xmm2[5],xmm0[6],xmm2[6],xmm0[7],xmm2[7] -; X64-NEXT: punpcklbw {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1],xmm1[2],xmm2[2],xmm1[3],xmm2[3],xmm1[4],xmm2[4],xmm1[5],xmm2[5],xmm1[6],xmm2[6],xmm1[7],xmm2[7] -; X64-NEXT: pmullw %xmm0, %xmm1 -; X64-NEXT: movdqa %xmm1, %xmm0 -; X64-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1],xmm0[2],xmm2[2],xmm0[3],xmm2[3] -; X64-NEXT: punpckhwd {{.*#+}} xmm1 = xmm1[4],xmm2[4],xmm1[5],xmm2[5],xmm1[6],xmm2[6],xmm1[7],xmm2[7] -; X64-NEXT: movdqu %xmm1, 16(%rax,%rdx,4) -; X64-NEXT: movdqu %xmm0, (%rax,%rdx,4) -; X64-NEXT: retq +; X86-AVX1-LABEL: mul_8xi8: +; X86-AVX1: # %bb.0: # %entry +; X86-AVX1-NEXT: pushl %esi +; X86-AVX1-NEXT: .cfi_def_cfa_offset 8 +; X86-AVX1-NEXT: .cfi_offset %esi, -8 +; X86-AVX1-NEXT: movl {{[0-9]+}}(%esp), %eax +; X86-AVX1-NEXT: movl {{[0-9]+}}(%esp), %ecx +; X86-AVX1-NEXT: movl {{[0-9]+}}(%esp), %edx +; X86-AVX1-NEXT: movl c, %esi +; X86-AVX1-NEXT: vpmovzxbd {{.*#+}} xmm0 = mem[0],zero,zero,zero,mem[1],zero,zero,zero,mem[2],zero,zero,zero,mem[3],zero,zero,zero +; X86-AVX1-NEXT: vpmovzxbd {{.*#+}} xmm1 = mem[0],zero,zero,zero,mem[1],zero,zero,zero,mem[2],zero,zero,zero,mem[3],zero,zero,zero +; X86-AVX1-NEXT: vpmovzxbd {{.*#+}} xmm2 = mem[0],zero,zero,zero,mem[1],zero,zero,zero,mem[2],zero,zero,zero,mem[3],zero,zero,zero +; X86-AVX1-NEXT: vpmulld %xmm0, %xmm2, %xmm0 +; X86-AVX1-NEXT: vpmovzxbd {{.*#+}} xmm2 = mem[0],zero,zero,zero,mem[1],zero,zero,zero,mem[2],zero,zero,zero,mem[3],zero,zero,zero +; X86-AVX1-NEXT: vpmulld %xmm1, %xmm2, %xmm1 +; X86-AVX1-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0 +; X86-AVX1-NEXT: vmovups %ymm0, (%esi,%ecx,4) +; X86-AVX1-NEXT: popl %esi +; X86-AVX1-NEXT: vzeroupper +; X86-AVX1-NEXT: retl +; +; X86-AVX2-LABEL: mul_8xi8: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Dec 24 14:05:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F224E90890; Sun, 24 Dec 2017 14:05:03 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 134647B1FA; Sun, 24 Dec 2017 14:05:02 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBOE51Hb007310; Sun, 24 Dec 2017 14:05:01 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBOE51s1007309; Sun, 24 Dec 2017 14:05:01 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201712241405.vBOE51s1007309@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 24 Dec 2017 14:05:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r327154 - vendor/clang/dist/lib/AST X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/clang/dist/lib/AST X-SVN-Commit-Revision: 327154 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Dec 2017 14:05:04 -0000 Author: dim Date: Sun Dec 24 14:05:01 2017 New Revision: 327154 URL: https://svnweb.freebsd.org/changeset/base/327154 Log: Vendor import of clang trunk r321426: https://llvm.org/svn/llvm-project/cfe/trunk@321426 Modified: vendor/clang/dist/lib/AST/ASTContext.cpp Modified: vendor/clang/dist/lib/AST/ASTContext.cpp ============================================================================== --- vendor/clang/dist/lib/AST/ASTContext.cpp Sun Dec 24 14:04:55 2017 (r327153) +++ vendor/clang/dist/lib/AST/ASTContext.cpp Sun Dec 24 14:05:01 2017 (r327154) @@ -2148,7 +2148,7 @@ static bool unionHasUniqueObjectRepresentations(const return true; } -bool isStructEmpty(QualType Ty) { +static bool isStructEmpty(QualType Ty) { const RecordDecl *RD = Ty->castAs()->getDecl(); if (!RD->field_empty()) From owner-svn-src-all@freebsd.org Sun Dec 24 14:05:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF923E908B5; Sun, 24 Dec 2017 14:05:07 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A7BDA7B29B; Sun, 24 Dec 2017 14:05:06 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBOE558S007356; Sun, 24 Dec 2017 14:05:05 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBOE55Ho007355; Sun, 24 Dec 2017 14:05:05 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201712241405.vBOE55Ho007355@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 24 Dec 2017 14:05:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r327155 - vendor/clang/clang-trunk-r321426 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/clang/clang-trunk-r321426 X-SVN-Commit-Revision: 327155 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Dec 2017 14:05:08 -0000 Author: dim Date: Sun Dec 24 14:05:04 2017 New Revision: 327155 URL: https://svnweb.freebsd.org/changeset/base/327155 Log: Tag clang trunk r321426. Added: vendor/clang/clang-trunk-r321426/ - copied from r327154, vendor/clang/dist/ From owner-svn-src-all@freebsd.org Sun Dec 24 14:05:11 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 833B3E908DC; Sun, 24 Dec 2017 14:05:11 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD9AF7B337; Sun, 24 Dec 2017 14:05:09 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBOE59Oo007405; Sun, 24 Dec 2017 14:05:09 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBOE59ph007404; Sun, 24 Dec 2017 14:05:09 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201712241405.vBOE59ph007404@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 24 Dec 2017 14:05:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r327156 - vendor/compiler-rt/compiler-rt-trunk-r321426 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/compiler-rt/compiler-rt-trunk-r321426 X-SVN-Commit-Revision: 327156 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Dec 2017 14:05:11 -0000 Author: dim Date: Sun Dec 24 14:05:08 2017 New Revision: 327156 URL: https://svnweb.freebsd.org/changeset/base/327156 Log: Tag compiler-rt trunk r321426. Added: vendor/compiler-rt/compiler-rt-trunk-r321426/ - copied from r327155, vendor/compiler-rt/dist/ From owner-svn-src-all@freebsd.org Sun Dec 24 14:05:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FAD4E90909; Sun, 24 Dec 2017 14:05:14 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ECFC07B39C; Sun, 24 Dec 2017 14:05:13 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBOE5DZF007451; Sun, 24 Dec 2017 14:05:13 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBOE5DuD007450; Sun, 24 Dec 2017 14:05:13 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201712241405.vBOE5DuD007450@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 24 Dec 2017 14:05:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r327157 - vendor/libc++/libc++-trunk-r321426 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/libc++/libc++-trunk-r321426 X-SVN-Commit-Revision: 327157 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Dec 2017 14:05:14 -0000 Author: dim Date: Sun Dec 24 14:05:12 2017 New Revision: 327157 URL: https://svnweb.freebsd.org/changeset/base/327157 Log: Tag libc++ trunk r321426. Added: vendor/libc++/libc++-trunk-r321426/ - copied from r327156, vendor/libc++/dist/ From owner-svn-src-all@freebsd.org Sun Dec 24 14:05:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6655BE909EB; Sun, 24 Dec 2017 14:05:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 509DF7B5A9; Sun, 24 Dec 2017 14:05:27 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBOE5Pni007597; Sun, 24 Dec 2017 14:05:25 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBOE5POi007596; Sun, 24 Dec 2017 14:05:25 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201712241405.vBOE5POi007596@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 24 Dec 2017 14:05:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r327160 - vendor/lldb/lldb-trunk-r321426 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/lldb/lldb-trunk-r321426 X-SVN-Commit-Revision: 327160 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Dec 2017 14:05:30 -0000 Author: dim Date: Sun Dec 24 14:05:25 2017 New Revision: 327160 URL: https://svnweb.freebsd.org/changeset/base/327160 Log: Tag lldb trunk r321426. Added: vendor/lldb/lldb-trunk-r321426/ - copied from r327159, vendor/lldb/dist/ From owner-svn-src-all@freebsd.org Sun Dec 24 14:05:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D751E90992; Sun, 24 Dec 2017 14:05:22 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A5FEF7B49D; Sun, 24 Dec 2017 14:05:20 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBOE5J5B007548; Sun, 24 Dec 2017 14:05:19 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBOE5JP9007547; Sun, 24 Dec 2017 14:05:19 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201712241405.vBOE5JP9007547@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 24 Dec 2017 14:05:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r327159 - vendor/lld/lld-trunk-r321426 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/lld/lld-trunk-r321426 X-SVN-Commit-Revision: 327159 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Dec 2017 14:05:22 -0000 Author: dim Date: Sun Dec 24 14:05:19 2017 New Revision: 327159 URL: https://svnweb.freebsd.org/changeset/base/327159 Log: Tag lld trunk r321426. Added: vendor/lld/lld-trunk-r321426/ - copied from r327158, vendor/lld/dist/ From owner-svn-src-all@freebsd.org Sun Dec 24 14:05:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06D94E90956; Sun, 24 Dec 2017 14:05:18 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D0CF17B403; Sun, 24 Dec 2017 14:05:17 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBOE5Ghe007502; Sun, 24 Dec 2017 14:05:16 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBOE5GLb007500; Sun, 24 Dec 2017 14:05:16 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201712241405.vBOE5GLb007500@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 24 Dec 2017 14:05:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r327158 - in vendor/lld/dist: ELF test/ELF/linkerscript X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/lld/dist: ELF test/ELF/linkerscript X-SVN-Commit-Revision: 327158 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Dec 2017 14:05:18 -0000 Author: dim Date: Sun Dec 24 14:05:16 2017 New Revision: 327158 URL: https://svnweb.freebsd.org/changeset/base/327158 Log: Vendor import of lld trunk r321426: https://llvm.org/svn/llvm-project/lld/trunk@321426 Modified: vendor/lld/dist/ELF/LinkerScript.cpp vendor/lld/dist/test/ELF/linkerscript/data-commands.s Modified: vendor/lld/dist/ELF/LinkerScript.cpp ============================================================================== --- vendor/lld/dist/ELF/LinkerScript.cpp Sun Dec 24 14:05:12 2017 (r327157) +++ vendor/lld/dist/ELF/LinkerScript.cpp Sun Dec 24 14:05:16 2017 (r327158) @@ -693,6 +693,8 @@ void LinkerScript::assignOffsets(OutputSection *Sec) { if (auto *Cmd = dyn_cast(Base)) { Cmd->Offset = Dot - Ctx->OutSec->Addr; Dot += Cmd->Size; + if (Ctx->MemRegion) + Ctx->MemRegionOffset[Ctx->MemRegion] += Cmd->Size; Ctx->OutSec->Size = Dot - Ctx->OutSec->Addr; continue; } Modified: vendor/lld/dist/test/ELF/linkerscript/data-commands.s ============================================================================== --- vendor/lld/dist/test/ELF/linkerscript/data-commands.s Sun Dec 24 14:05:12 2017 (r327157) +++ vendor/lld/dist/test/ELF/linkerscript/data-commands.s Sun Dec 24 14:05:16 2017 (r327158) @@ -44,6 +44,42 @@ # BE-NEXT: ff12ff11 22ff1122 3346ff11 22334455 # BE-NEXT: 667788 +# RUN: echo "MEMORY { \ +# RUN: rom (rwx) : ORIGIN = 0x00, LENGTH = 2K \ +# RUN: } \ +# RUN: SECTIONS { \ +# RUN: .foo : { \ +# RUN: *(.foo.1) \ +# RUN: BYTE(0x11) \ +# RUN: *(.foo.2) \ +# RUN: SHORT(0x1122) \ +# RUN: *(.foo.3) \ +# RUN: LONG(0x11223344) \ +# RUN: *(.foo.4) \ +# RUN: QUAD(0x1122334455667788) \ +# RUN: } > rom \ +# RUN: .bar : { \ +# RUN: *(.bar.1) \ +# RUN: BYTE(a + 1) \ +# RUN: *(.bar.2) \ +# RUN: SHORT(b) \ +# RUN: *(.bar.3) \ +# RUN: LONG(c + 2) \ +# RUN: *(.bar.4) \ +# RUN: QUAD(d) \ +# RUN: } > rom \ +# RUN: }" > %t-memory.script +# RUN: ld.lld -o %t-memory %t.o --script %t-memory.script +# RUN: llvm-objdump -s %t-memory | FileCheck %s --check-prefix=MEM + +# MEM: Contents of section .foo: +# MEM-NEXT: 0000 ff11ff22 11ff4433 2211ff88 77665544 +# MEM-NEXT: 0010 332211 + +# MEM: Contents of section .bar: +# MEM-NEXT: 0013 ff12ff22 11ff4633 2211ff88 77665544 +# MEM-NEXT: 0023 332211 + .global a a = 0x11 From owner-svn-src-all@freebsd.org Sun Dec 24 16:34:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26FCBE9B7C9; Sun, 24 Dec 2017 16:34:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E4DC080CC0; Sun, 24 Dec 2017 16:34:55 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBOGYsV4070752; Sun, 24 Dec 2017 16:34:54 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBOGYs92070751; Sun, 24 Dec 2017 16:34:54 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201712241634.vBOGYs92070751@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 24 Dec 2017 16:34:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327161 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 327161 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Dec 2017 16:34:56 -0000 Author: dim Date: Sun Dec 24 16:34:54 2017 New Revision: 327161 URL: https://svnweb.freebsd.org/changeset/base/327161 Log: Follow-up to r326375, by moving the block that disables errors on the new clang 6.0.0 -Wtautological-constant-compare warning to the WARNS <= 6 level. (This warning is still being worked on upstream to reduce false positives, but it is currently still too trigger happy.) Modified: head/share/mk/bsd.sys.mk Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Sun Dec 24 14:05:25 2017 (r327160) +++ head/share/mk/bsd.sys.mk Sun Dec 24 16:34:54 2017 (r327161) @@ -69,8 +69,11 @@ CWARNFLAGS+= -Wno-pointer-sign .if ${WARNS} <= 6 CWARNFLAGS.clang+= -Wno-empty-body -Wno-string-plus-int .if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 30400 -CWARNFLAGS.clang+= -Wno-unused-const-variable +CWARNFLAGS.clang+= -Wno-unused-const-variable .endif +.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 60000 +CWARNFLAGS.clang+= -Wno-error=tautological-constant-compare +.endif .endif # WARNS <= 6 .if ${WARNS} <= 3 CWARNFLAGS.clang+= -Wno-tautological-compare -Wno-unused-value\ @@ -80,9 +83,6 @@ CWARNFLAGS.clang+= -Wno-unused-local-typedef .endif .if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 40000 CWARNFLAGS.clang+= -Wno-address-of-packed-member -.endif -.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 60000 -CWARNFLAGS.clang+= -Wno-error=tautological-constant-compare .endif .endif # WARNS <= 3 .if ${WARNS} <= 2 From owner-svn-src-all@freebsd.org Sun Dec 24 16:36:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F093E9B96B; Sun, 24 Dec 2017 16:36:52 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 07D4A80E48; Sun, 24 Dec 2017 16:36:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBOGapfd070869; Sun, 24 Dec 2017 16:36:51 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBOGaprD070868; Sun, 24 Dec 2017 16:36:51 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712241636.vBOGaprD070868@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 24 Dec 2017 16:36:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327162 - head/sys/x86/isa X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/x86/isa X-SVN-Commit-Revision: 327162 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Dec 2017 16:36:52 -0000 Author: imp Date: Sun Dec 24 16:36:50 2017 New Revision: 327162 URL: https://svnweb.freebsd.org/changeset/base/327162 Log: Comment this out until I have time to get to the bottom of why it's failing for some people. Modified: head/sys/x86/isa/orm.c Modified: head/sys/x86/isa/orm.c ============================================================================== --- head/sys/x86/isa/orm.c Sun Dec 24 16:34:54 2017 (r327161) +++ head/sys/x86/isa/orm.c Sun Dec 24 16:36:50 2017 (r327162) @@ -156,7 +156,7 @@ orm_identify(driver_t* driver, device_t parent) device_set_desc(child, "ISA Option ROM"); else device_set_desc(child, "ISA Option ROMs"); - isa_set_vendorid(child, PNP_EISAID("PNP0C80")); +// isa_set_vendorid(child, PNP_EISAID("PNP0C80")); } static int From owner-svn-src-all@freebsd.org Sun Dec 24 16:39:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9F3AE9BCEA; Sun, 24 Dec 2017 16:39:58 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 83F601178; Sun, 24 Dec 2017 16:39:58 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBOGdvnn071010; Sun, 24 Dec 2017 16:39:57 GMT (envelope-from kan@FreeBSD.org) Received: (from kan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBOGdvX2071009; Sun, 24 Dec 2017 16:39:57 GMT (envelope-from kan@FreeBSD.org) Message-Id: <201712241639.vBOGdvX2071009@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kan set sender to kan@FreeBSD.org using -f From: Alexander Kabaev Date: Sun, 24 Dec 2017 16:39:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327163 - head/usr.sbin/efibootmgr X-SVN-Group: head X-SVN-Commit-Author: kan X-SVN-Commit-Paths: head/usr.sbin/efibootmgr X-SVN-Commit-Revision: 327163 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Dec 2017 16:39:58 -0000 Author: kan Date: Sun Dec 24 16:39:57 2017 New Revision: 327163 URL: https://svnweb.freebsd.org/changeset/base/327163 Log: Remove write-only opt and useless optlen variables. This squashes the warning gebnerated by GCC 6.x. Since variables that are now removed had come documentation value, put relevant bits in comment, so they can be resurrected from there when actually needed. Modified: head/usr.sbin/efibootmgr/efibootmgr.c Modified: head/usr.sbin/efibootmgr/efibootmgr.c ============================================================================== --- head/usr.sbin/efibootmgr/efibootmgr.c Sun Dec 24 16:36:50 2017 (r327162) +++ head/usr.sbin/efibootmgr/efibootmgr.c Sun Dec 24 16:39:57 2017 (r327163) @@ -707,10 +707,8 @@ print_loadopt_str(uint8_t *data, size_t datalen) uint8_t *ep = data + datalen; uint8_t *walker = data; efidp dp, edp; - void *opt; char buf[1024]; int len; - int optlen; int rv; int indent; @@ -734,10 +732,11 @@ print_loadopt_str(uint8_t *data, size_t datalen) if (walker > ep) return; edp = (efidp)walker; - // Everything left is the binary option args - opt = walker; - optlen = ep - walker; - + /* + * Everything left is the binary option args + * opt = walker; + * optlen = ep - walker; + */ indent = 1; while (dp < edp) { efidp_format_device_path(buf, sizeof(buf), dp, @@ -753,8 +752,6 @@ print_loadopt_str(uint8_t *data, size_t datalen) } dp = (efidp)((char *)dp + efidp_size(dp)); } - if (optlen == 0) - return; } static char * From owner-svn-src-all@freebsd.org Sun Dec 24 16:52:00 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5FA6E9D8F2; Sun, 24 Dec 2017 16:52:00 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9E14C1C27; Sun, 24 Dec 2017 16:52:00 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBOGpxIf079164; Sun, 24 Dec 2017 16:51:59 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBOGpxpw079162; Sun, 24 Dec 2017 16:51:59 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201712241651.vBOGpxpw079162@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 24 Dec 2017 16:51:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327164 - in head/contrib/binutils: bfd include X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head/contrib/binutils: bfd include X-SVN-Commit-Revision: 327164 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Dec 2017 16:52:00 -0000 Author: dim Date: Sun Dec 24 16:51:59 2017 New Revision: 327164 URL: https://svnweb.freebsd.org/changeset/base/327164 Log: Fix clang 6.0.0 compiler warnings in binutils Latest clang git has a warning -Wnull-pointer-arithmetic which will trigger a -Werror failure. Addition and subtraction from a null pointer is undefined behaviour and could be optimized into anything. Furthermore, using the difference between two pointers and casting the result back to a pointer is not portable since the size of ptrdiff_t does not necessary have to be the same as size of void* (this happens e.g. on CHERI). Using intptr_t instead fixes this portability issue and the compiler warning. Submitted by; Alexander Richardson Obtained from: CheriBSD Differential Revision: https://reviews.freebsd.org/D12928 MFC after: 3 days Modified: head/contrib/binutils/bfd/elflink.c head/contrib/binutils/include/obstack.h Modified: head/contrib/binutils/bfd/elflink.c ============================================================================== --- head/contrib/binutils/bfd/elflink.c Sun Dec 24 16:39:57 2017 (r327163) +++ head/contrib/binutils/bfd/elflink.c Sun Dec 24 16:51:59 2017 (r327164) @@ -4815,7 +4815,7 @@ _bfd_elf_archive_symbol_lookup (bfd *abfd, len = strlen (name); copy = bfd_alloc (abfd, len); if (copy == NULL) - return (struct elf_link_hash_entry *) 0 - 1; + return (struct elf_link_hash_entry *)(intptr_t)-1; first = p - name + 1; memcpy (copy, name, first); @@ -4927,7 +4927,7 @@ elf_link_add_archive_symbols (bfd *abfd, struct bfd_li } h = archive_symbol_lookup (abfd, info, symdef->name); - if (h == (struct elf_link_hash_entry *) 0 - 1) + if (h == (struct elf_link_hash_entry *)(intptr_t)-1) goto error_return; if (h == NULL) Modified: head/contrib/binutils/include/obstack.h ============================================================================== --- head/contrib/binutils/include/obstack.h Sun Dec 24 16:39:57 2017 (r327163) +++ head/contrib/binutils/include/obstack.h Sun Dec 24 16:51:59 2017 (r327164) @@ -119,11 +119,11 @@ extern "C" { may ignore the byte-within-word field of the pointer. */ #ifndef __PTR_TO_INT -# define __PTR_TO_INT(P) ((P) - (char *) 0) +# define __PTR_TO_INT(P) ((intptr_t)(P)) #endif #ifndef __INT_TO_PTR -# define __INT_TO_PTR(P) ((P) + (char *) 0) +# define __INT_TO_PTR(P) ((void*)(intptr_t)(P)) #endif /* We need the type of the resulting object. If __PTRDIFF_TYPE__ is @@ -427,7 +427,7 @@ __extension__ \ __o1->maybe_empty_object = 1; \ __o1->next_free \ = __INT_TO_PTR ((__PTR_TO_INT (__o1->next_free)+__o1->alignment_mask)\ - & ~ (__o1->alignment_mask)); \ + & ~(intptr_t)(__o1->alignment_mask)); \ if (__o1->next_free - (char *)__o1->chunk \ > __o1->chunk_limit - (char *)__o1->chunk) \ __o1->next_free = __o1->chunk_limit; \ From owner-svn-src-all@freebsd.org Sun Dec 24 17:34:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67632E9FEC8; Sun, 24 Dec 2017 17:34:12 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 18A3E339A; Sun, 24 Dec 2017 17:34:11 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with ESMTPA id TA9yeCztNS7BpTA9ze0oWx; Sun, 24 Dec 2017 10:34:04 -0700 X-Authority-Analysis: v=2.2 cv=NKylwwyg c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=ocR9PWop10UA:10 a=vaJtXVxTAAAA:8 a=6I5d2MoRAAAA:8 a=iKhvJSA4AAAA:8 a=YxBL1-UpAAAA:8 a=dQsZOMc29GdFCuA00QQA:9 a=CjuIK1q_8ugA:10 a=T48UvIGfvqsA:10 a=IjZwj45LgO3ly-622nXo:22 a=odh9cflL3HIXMm4fY7Wr:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 95FF89D; Sun, 24 Dec 2017 09:34:01 -0800 (PST) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id vBOHY1qO099086; Sun, 24 Dec 2017 09:34:01 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id vBOHY0bh099042; Sun, 24 Dec 2017 09:34:01 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201712241734.vBOHY0bh099042@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: "Andrey V. Elsukov" cc: rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327140 - head/sbin/ipfw In-Reply-To: Message from "Andrey V. Elsukov" of "Sun, 24 Dec 2017 10:46:14 +0300." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 24 Dec 2017 09:34:00 -0800 X-CMAE-Envelope: MS4wfLHCBXuspwIont+HGB+1aXtNnmB0o7XE7JcaUm+Mw7Hy6nV5cD8gVOt2IG//O0LjHiR+4Vh+hKEkixaEI6/BQzoOzxksuyv31HcNCruAkJufaNKuz9Bk y7DYrYPY8J1in1udgPjx6s28ui1aU8cBXM7YZxhI+uOA24nv7rbbkOQkRtRk+wUrUld/KPVxFG2Pki1468j3lYJAzkwk00RfW7rOPv5fHwoUryZcXpV59wC8 8e3vRnRjwoUp86mhFiXB35ZwGG4tpFqjOXX7uZLbB44E2Bk7YIQSYuGa9gKxRfFm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Dec 2017 17:34:12 -0000 In message , "Andrey V. Elsukov " writes: > This is an OpenPGP/MIME signed message (RFC 4880 and 3156) > --hploe8mi8b5CeIbHnELgS0brwST9uiIfp > Content-Type: multipart/mixed; boundary="Ua6VdxS4jpKDm90X0cEvNMeMts7m7TLRO"; > protected-headers="v1" > From: "Andrey V. Elsukov" > To: rgrimes@freebsd.org > Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, > svn-src-head@freebsd.org > Message-ID: > Subject: Re: svn commit: r327140 - head/sbin/ipfw > References: <201712240711.vBO7BNRG045404@pdx.rh.CN85.dnsmgr.net> > In-Reply-To: <201712240711.vBO7BNRG045404@pdx.rh.CN85.dnsmgr.net> > > --Ua6VdxS4jpKDm90X0cEvNMeMts7m7TLRO > Content-Type: text/plain; charset=utf-8 > Content-Language: en-US > Content-Transfer-Encoding: quoted-printable > > On 24.12.2017 10:11, Rodney W. Grimes wrote: > >> - uint32_t masks[2]; > >> - int i; > >> - uint8_t cmd, rulenum; > >> ipfw_range_tlv rt; > >> char *msg; > >> size_t size; > >> + uint32_t masks[2]; > >> + int i; > >=20 > > Why do these 2 lines show up as null changes in the diff???? > > I can not see any change, not even white space. > > They are sorted by size according to style(9). When I was still a grasshopper my sensei taught me not to batch commits. Looking back, this was wise advice as it is easier for those reading the logs to follow each intended change. The two commits should have been: 1) fix rule number truncation... and 2) sort size according to style(9). -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Sun Dec 24 17:59:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E873FEA130A; Sun, 24 Dec 2017 17:59:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B312C632F8; Sun, 24 Dec 2017 17:59:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBOHxmkC005083; Sun, 24 Dec 2017 17:59:48 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBOHxm5d005082; Sun, 24 Dec 2017 17:59:48 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712241759.vBOHxm5d005082@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 24 Dec 2017 17:59:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327166 - head/sys/x86/isa X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/x86/isa X-SVN-Commit-Revision: 327166 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Dec 2017 17:59:50 -0000 Author: imp Date: Sun Dec 24 17:59:48 2017 New Revision: 327166 URL: https://svnweb.freebsd.org/changeset/base/327166 Log: Further investigation shows this shouldn't have been added at all. Remove it. Modified: head/sys/x86/isa/orm.c Modified: head/sys/x86/isa/orm.c ============================================================================== --- head/sys/x86/isa/orm.c Sun Dec 24 16:53:55 2017 (r327165) +++ head/sys/x86/isa/orm.c Sun Dec 24 17:59:48 2017 (r327166) @@ -156,7 +156,6 @@ orm_identify(driver_t* driver, device_t parent) device_set_desc(child, "ISA Option ROM"); else device_set_desc(child, "ISA Option ROMs"); -// isa_set_vendorid(child, PNP_EISAID("PNP0C80")); } static int From owner-svn-src-all@freebsd.org Sun Dec 24 19:17:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F185EA560F; Sun, 24 Dec 2017 19:17:17 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 28BD566124; Sun, 24 Dec 2017 19:17:17 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBOJHGOw039297; Sun, 24 Dec 2017 19:17:16 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBOJHG9r039296; Sun, 24 Dec 2017 19:17:16 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201712241917.vBOJHG9r039296@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 24 Dec 2017 19:17:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327167 - head/sys/cddl/contrib/opensolaris/uts/common/sys X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/sys X-SVN-Commit-Revision: 327167 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Dec 2017 19:17:17 -0000 Author: dim Date: Sun Dec 24 19:17:15 2017 New Revision: 327167 URL: https://svnweb.freebsd.org/changeset/base/327167 Log: Remove obsolete register keyword from opensolaris's sysmacros.h. When compiling zfsd with recent clang, it leads to a warning about the register storage class being incompatible with C++17. MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h Sun Dec 24 17:59:48 2017 (r327166) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h Sun Dec 24 19:17:15 2017 (r327167) @@ -388,7 +388,7 @@ highbit(ulong_t i) #if defined(__FreeBSD__) && defined(_KERNEL) && defined(HAVE_INLINE_FLSL) return (flsl(i)); #else - register int h = 1; + int h = 1; if (i == 0) return (0); From owner-svn-src-all@freebsd.org Sun Dec 24 19:45:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A8F2EA6DF8; Sun, 24 Dec 2017 19:45:17 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4850567157; Sun, 24 Dec 2017 19:45:17 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBOJjGHI051699; Sun, 24 Dec 2017 19:45:16 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBOJjGV5051696; Sun, 24 Dec 2017 19:45:16 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201712241945.vBOJjGV5051696@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 24 Dec 2017 19:45:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327168 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 327168 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Dec 2017 19:45:17 -0000 Author: markj Date: Sun Dec 24 19:45:16 2017 New Revision: 327168 URL: https://svnweb.freebsd.org/changeset/base/327168 Log: Fix two problems with the page daemon control loop. Both issues caused the page daemon to erroneously go to sleep when applications are consuming free pages at a high rate, leaving the application threads blocked in VM_WAIT. 1) After completing an inactive queue scan, concurrent allocations may have prevented the page daemon from meeting the v_free_min threshold. In this case, the page daemon was going to sleep even when the inactive queue contained plenty of clean pages. 2) pagedaemon_wakeup() may be called without the free queues lock held. This can lead to a lost wakeup if a call occurs after the page daemon clears vm_pageout_wanted but before going to sleep. Fix 1) by ensuring that we start a new inactive queue scan immediately if v_free_count < v_free_min after a prior scan. Fix 2) by adding a new subroutine, pagedaemon_wait(), called from vm_wait() and vm_waitpfault(). It wakes up the page daemon if either vm_pages_needed or vm_pageout_wanted is false, and atomically sleeps on v_free_count. Reported by: jeff Reviewed by: alc MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D13424 Modified: head/sys/vm/vm_page.c head/sys/vm/vm_pageout.c head/sys/vm/vm_pageout.h Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sun Dec 24 19:17:15 2017 (r327167) +++ head/sys/vm/vm_page.c Sun Dec 24 19:45:16 2017 (r327168) @@ -2661,15 +2661,9 @@ _vm_wait(void) msleep(&vm_pageout_pages_needed, &vm_page_queue_free_mtx, PDROP | PSWP, "VMWait", 0); } else { - if (__predict_false(pageproc == NULL)) + if (pageproc == NULL) panic("vm_wait in early boot"); - if (!vm_pageout_wanted) { - vm_pageout_wanted = true; - wakeup(&vm_pageout_wanted); - } - vm_pages_needed = true; - msleep(&vm_cnt.v_free_count, &vm_page_queue_free_mtx, PDROP | PVM, - "vmwait", 0); + pagedaemon_wait(PVM, "vmwait"); } } @@ -2699,7 +2693,6 @@ vm_page_alloc_fail(vm_object_t object, int req) atomic_add_int(&vm_pageout_deficit, max((u_int)req >> VM_ALLOC_COUNT_SHIFT, 1)); - pagedaemon_wakeup(); if (req & (VM_ALLOC_WAITOK | VM_ALLOC_WAITFAIL)) { if (object != NULL) VM_OBJECT_WUNLOCK(object); @@ -2708,8 +2701,10 @@ vm_page_alloc_fail(vm_object_t object, int req) VM_OBJECT_WLOCK(object); if (req & VM_ALLOC_WAITOK) return (EAGAIN); - } else + } else { mtx_unlock(&vm_page_queue_free_mtx); + pagedaemon_wakeup(); + } return (0); } @@ -2728,13 +2723,7 @@ vm_waitpfault(void) { mtx_lock(&vm_page_queue_free_mtx); - if (!vm_pageout_wanted) { - vm_pageout_wanted = true; - wakeup(&vm_pageout_wanted); - } - vm_pages_needed = true; - msleep(&vm_cnt.v_free_count, &vm_page_queue_free_mtx, PDROP | PUSER, - "pfault", 0); + pagedaemon_wait(PUSER, "pfault"); } struct vm_pagequeue * Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Sun Dec 24 19:17:15 2017 (r327167) +++ head/sys/vm/vm_pageout.c Sun Dec 24 19:45:16 2017 (r327168) @@ -1829,10 +1829,14 @@ vm_pageout_worker(void *arg) pass++; } else { /* - * Yes. Sleep until pages need to be reclaimed or + * Yes. If threads are still sleeping in VM_WAIT + * then we immediately start a new scan. Otherwise, + * sleep until the next wakeup or until pages need to * have their reference stats updated. */ - if (mtx_sleep(&vm_pageout_wanted, + if (vm_pages_needed) { + mtx_unlock(&vm_page_queue_free_mtx); + } else if (mtx_sleep(&vm_pageout_wanted, &vm_page_queue_free_mtx, PDROP | PVM, "psleep", hz) == 0) { VM_CNT_INC(v_pdwakeups); @@ -1940,17 +1944,42 @@ vm_pageout(void) } /* - * Unless the free page queue lock is held by the caller, this function - * should be regarded as advisory. Specifically, the caller should - * not msleep() on &vm_cnt.v_free_count following this function unless - * the free page queue lock is held until the msleep() is performed. + * Perform an advisory wakeup of the page daemon. */ void pagedaemon_wakeup(void) { + mtx_assert(&vm_page_queue_free_mtx, MA_NOTOWNED); + if (!vm_pageout_wanted && curthread->td_proc != pageproc) { vm_pageout_wanted = true; wakeup(&vm_pageout_wanted); } +} + +/* + * Wake up the page daemon and wait for it to reclaim free pages. + * + * This function returns with the free queues mutex unlocked. + */ +void +pagedaemon_wait(int pri, const char *wmesg) +{ + + mtx_assert(&vm_page_queue_free_mtx, MA_OWNED); + + /* + * vm_pageout_wanted may have been set by an advisory wakeup, but if the + * page daemon is running on a CPU, the wakeup will have been lost. + * Thus, deliver a potentially spurious wakeup to ensure that the page + * daemon has been notified of the shortage. + */ + if (!vm_pageout_wanted || !vm_pages_needed) { + vm_pageout_wanted = true; + wakeup(&vm_pageout_wanted); + } + vm_pages_needed = true; + msleep(&vm_cnt.v_free_count, &vm_page_queue_free_mtx, PDROP | pri, + wmesg, 0); } Modified: head/sys/vm/vm_pageout.h ============================================================================== --- head/sys/vm/vm_pageout.h Sun Dec 24 19:17:15 2017 (r327167) +++ head/sys/vm/vm_pageout.h Sun Dec 24 19:45:16 2017 (r327168) @@ -96,11 +96,12 @@ extern bool vm_pages_needed; * Signal pageout-daemon and wait for it. */ -extern void pagedaemon_wakeup(void); +void pagedaemon_wait(int pri, const char *wmesg); +void pagedaemon_wakeup(void); #define VM_WAIT vm_wait() #define VM_WAITPFAULT vm_waitpfault() -extern void vm_wait(void); -extern void vm_waitpfault(void); +void vm_wait(void); +void vm_waitpfault(void); #ifdef _KERNEL int vm_pageout_flush(vm_page_t *, int, int, int, int *, boolean_t *); From owner-svn-src-all@freebsd.org Mon Dec 25 00:25:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACC7CE8ACCA; Mon, 25 Dec 2017 00:25:16 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 793866EC62; Mon, 25 Dec 2017 00:25:16 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBP0PFHE068022; Mon, 25 Dec 2017 00:25:15 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBP0PFTm068021; Mon, 25 Dec 2017 00:25:15 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201712250025.vBP0PFTm068021@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 25 Dec 2017 00:25:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r327170 - stable/11/sys/dev/sound/pci/hda X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/dev/sound/pci/hda X-SVN-Commit-Revision: 327170 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Dec 2017 00:25:16 -0000 Author: mav Date: Mon Dec 25 00:25:15 2017 New Revision: 327170 URL: https://svnweb.freebsd.org/changeset/base/327170 Log: MFC r326186: Slightly fix bidirectional stream number allocation. This logic is still imperfect, since it allows at most 15 bidirectional streams out of 30 allowed by specification, but at least now those should work better. On the other side I don't remember I ever saw controller supporting the bidirectional streams, so this is likely a nop change. Modified: stable/11/sys/dev/sound/pci/hda/hdac.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- stable/11/sys/dev/sound/pci/hda/hdac.c Sun Dec 24 20:17:36 2017 (r327169) +++ stable/11/sys/dev/sound/pci/hda/hdac.c Mon Dec 25 00:25:15 2017 (r327170) @@ -1801,7 +1801,7 @@ hdac_find_stream(struct hdac_softc *sc, int dir, int s int i, ss; ss = -1; - /* Allocate ISS/BSS first. */ + /* Allocate ISS/OSS first. */ if (dir == 0) { for (i = 0; i < sc->num_iss; i++) { if (sc->streams[i].stream == stream) { @@ -1869,7 +1869,7 @@ hdac_stream_alloc(device_t dev, device_t child, int di /* Allocate stream number */ if (ss >= sc->num_iss + sc->num_oss) - stream = 15 - (ss - sc->num_iss + sc->num_oss); + stream = 15 - (ss - sc->num_iss - sc->num_oss); else if (ss >= sc->num_iss) stream = ss - sc->num_iss + 1; else From owner-svn-src-all@freebsd.org Mon Dec 25 04:32:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE8D0E9A50A; Mon, 25 Dec 2017 04:32:16 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B99B17586D; Mon, 25 Dec 2017 04:32:16 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBP4WF40072035; Mon, 25 Dec 2017 04:32:15 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBP4WFuc072034; Mon, 25 Dec 2017 04:32:15 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201712250432.vBP4WFuc072034@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 25 Dec 2017 04:32:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r327171 - stable/11/usr.bin/gzip X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/11/usr.bin/gzip X-SVN-Commit-Revision: 327171 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Dec 2017 04:32:17 -0000 Author: delphij Date: Mon Dec 25 04:32:15 2017 New Revision: 327171 URL: https://svnweb.freebsd.org/changeset/base/327171 Log: MFC r326185: Set errno to EFTYPE instead of EINVAL to be more consistent with the rest of code. Modified: stable/11/usr.bin/gzip/zuncompress.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/gzip/zuncompress.c ============================================================================== --- stable/11/usr.bin/gzip/zuncompress.c Mon Dec 25 00:25:15 2017 (r327170) +++ stable/11/usr.bin/gzip/zuncompress.c Mon Dec 25 04:32:15 2017 (r327171) @@ -279,7 +279,7 @@ zread(void *cookie, char *rbp, int num) if (zs->u.r.zs_code > zs->zs_free_ent || zs->u.r.zs_oldcode == -1) { /* Bad stream. */ - errno = EINVAL; + errno = EFTYPE; return (-1); } *zs->u.r.zs_stackp++ = zs->u.r.zs_finchar; From owner-svn-src-all@freebsd.org Mon Dec 25 04:34:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F8D1E9A669; Mon, 25 Dec 2017 04:34:12 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DEB42759FB; Mon, 25 Dec 2017 04:34:11 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBP4YAvo072163; Mon, 25 Dec 2017 04:34:10 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBP4YA5l072162; Mon, 25 Dec 2017 04:34:10 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201712250434.vBP4YA5l072162@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 25 Dec 2017 04:34:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r327172 - stable/10/usr.bin/gzip X-SVN-Group: stable-10 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/10/usr.bin/gzip X-SVN-Commit-Revision: 327172 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Dec 2017 04:34:12 -0000 Author: delphij Date: Mon Dec 25 04:34:10 2017 New Revision: 327172 URL: https://svnweb.freebsd.org/changeset/base/327172 Log: MFC r326185: Set errno to EFTYPE instead of EINVAL to be more consistent with the rest of code. Modified: stable/10/usr.bin/gzip/zuncompress.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/gzip/zuncompress.c ============================================================================== --- stable/10/usr.bin/gzip/zuncompress.c Mon Dec 25 04:32:15 2017 (r327171) +++ stable/10/usr.bin/gzip/zuncompress.c Mon Dec 25 04:34:10 2017 (r327172) @@ -279,7 +279,7 @@ zread(void *cookie, char *rbp, int num) if (zs->u.r.zs_code > zs->zs_free_ent || zs->u.r.zs_oldcode == -1) { /* Bad stream. */ - errno = EINVAL; + errno = EFTYPE; return (-1); } *zs->u.r.zs_stackp++ = zs->u.r.zs_finchar; From owner-svn-src-all@freebsd.org Mon Dec 25 04:48:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B527BE9D566; Mon, 25 Dec 2017 04:48:45 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D70276248; Mon, 25 Dec 2017 04:48:45 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBP4miov076724; Mon, 25 Dec 2017 04:48:44 GMT (envelope-from kan@FreeBSD.org) Received: (from kan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBP4md1o076678; Mon, 25 Dec 2017 04:48:39 GMT (envelope-from kan@FreeBSD.org) Message-Id: <201712250448.vBP4md1o076678@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kan set sender to kan@FreeBSD.org using -f From: Alexander Kabaev Date: Mon, 25 Dec 2017 04:48:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327173 - in head/sys: arm/allwinner arm/allwinner/clk arm/arm arm/broadcom/bcm2835 arm64/arm64 cam/ata cam/scsi dev/al_eth dev/axgbe dev/e1000 dev/extres/clk dev/extres/regulator dev/f... X-SVN-Group: head X-SVN-Commit-Author: kan X-SVN-Commit-Paths: in head/sys: arm/allwinner arm/allwinner/clk arm/arm arm/broadcom/bcm2835 arm64/arm64 cam/ata cam/scsi dev/al_eth dev/axgbe dev/e1000 dev/extres/clk dev/extres/regulator dev/fdt dev/mii dev/mmc dev/mm... X-SVN-Commit-Revision: 327173 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Dec 2017 04:48:45 -0000 Author: kan Date: Mon Dec 25 04:48:39 2017 New Revision: 327173 URL: https://svnweb.freebsd.org/changeset/base/327173 Log: Do pass removing some write-only variables from the kernel. This reduces noise when kernel is compiled by newer GCC versions, such as one used by external toolchain ports. Reviewed by: kib, andrew(sys/arm and sys/arm64), emaste(partial), erj(partial) Reviewed by: jhb (sys/dev/pci/* sys/kern/vfs_aio.c and sys/kern/kern_synch.c) Differential Revision: https://reviews.freebsd.org/D10385 Modified: head/sys/arm/allwinner/aw_wdog.c head/sys/arm/allwinner/axp81x.c head/sys/arm/allwinner/clk/aw_pll.c head/sys/arm/allwinner/if_awg.c head/sys/arm/arm/gic.c head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c head/sys/arm64/arm64/gic_v3.c head/sys/arm64/arm64/gicv3_its.c head/sys/arm64/arm64/machdep.c head/sys/arm64/arm64/pmap.c head/sys/cam/ata/ata_da.c head/sys/cam/scsi/scsi_da.c head/sys/cam/scsi/scsi_pass.c head/sys/dev/al_eth/al_eth.c head/sys/dev/axgbe/xgbe-drv.c head/sys/dev/axgbe/xgbe-mdio.c head/sys/dev/e1000/igb_txrx.c head/sys/dev/extres/clk/clk_bus.c head/sys/dev/extres/regulator/regulator_bus.c head/sys/dev/fdt/fdt_common.c head/sys/dev/mii/rdcphy.c head/sys/dev/mmc/host/dwmmc.c head/sys/dev/mmc/mmc.c head/sys/dev/mmc/mmcsd.c head/sys/dev/ofw/ofw_bus_subr.c head/sys/dev/ofw/ofwpci.c head/sys/dev/pci/pci.c head/sys/dev/pci/pci_pci.c head/sys/dev/smc/if_smc_fdt.c head/sys/dev/uart/uart_bus_acpi.c head/sys/dev/uart/uart_dev_pl011.c head/sys/dev/uart/uart_dev_snps.c head/sys/dev/usb/controller/dwc_otg_fdt.c head/sys/dev/usb/controller/ehci.c head/sys/dev/usb/controller/ohci.c head/sys/dev/usb/controller/xhci.c head/sys/dev/usb/storage/umass.c head/sys/dev/usb/usb_dev.c head/sys/dev/vnic/nic_main.c head/sys/dev/vnic/nicvf_main.c head/sys/dev/vnic/nicvf_queues.c head/sys/fs/cd9660/cd9660_vfsops.c head/sys/fs/nfs/nfs_commonkrpc.c head/sys/fs/nfs/nfs_commonsubs.c head/sys/fs/nfsclient/nfs_clstate.c head/sys/fs/nfsserver/nfs_nfsdport.c head/sys/fs/nfsserver/nfs_nfsdstate.c head/sys/geom/geom_subr.c head/sys/geom/raid/g_raid.c head/sys/geom/raid/md_ddf.c head/sys/geom/raid/md_promise.c head/sys/geom/raid/tr_raid5.c head/sys/kern/kern_synch.c head/sys/kern/link_elf.c head/sys/kern/subr_msgbuf.c head/sys/kern/subr_sleepqueue.c head/sys/kern/subr_witness.c head/sys/kern/vfs_aio.c head/sys/kern/vfs_subr.c head/sys/net/if_ethersubr.c head/sys/net/if_gif.c head/sys/netinet/tcp_output.c head/sys/netinet6/in6_mcast.c head/sys/netinet6/in6_src.c head/sys/netinet6/mld6.c head/sys/netinet6/nd6.c head/sys/netinet6/nd6.h head/sys/netinet6/nd6_nbr.c head/sys/netinet6/raw_ip6.c head/sys/netinet6/udp6_usrreq.c head/sys/netipsec/key.c head/sys/netipsec/xform_ah.c head/sys/netipsec/xform_esp.c head/sys/netipsec/xform_ipcomp.c head/sys/nfs/nfs_fha.c head/sys/nlm/nlm_prot_impl.c head/sys/opencrypto/crypto.c head/sys/opencrypto/cryptosoft.c head/sys/rpc/clnt_dg.c head/sys/security/mac/mac_syscalls.c head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ffs/ffs_vnops.c Modified: head/sys/arm/allwinner/aw_wdog.c ============================================================================== --- head/sys/arm/allwinner/aw_wdog.c Mon Dec 25 04:34:10 2017 (r327172) +++ head/sys/arm/allwinner/aw_wdog.c Mon Dec 25 04:48:39 2017 (r327173) @@ -115,9 +115,6 @@ static void aw_wdog_shutdown_fn(void *, int); static int aw_wdog_probe(device_t dev) { - struct aw_wdog_softc *sc; - - sc = device_get_softc(dev); if (!ofw_bus_status_okay(dev)) return (ENXIO); Modified: head/sys/arm/allwinner/axp81x.c ============================================================================== --- head/sys/arm/allwinner/axp81x.c Mon Dec 25 04:34:10 2017 (r327172) +++ head/sys/arm/allwinner/axp81x.c Mon Dec 25 04:48:39 2017 (r327173) @@ -352,13 +352,11 @@ axp81x_shutdown(void *devp, int howto) static void axp81x_intr(void *arg) { - struct axp81x_softc *sc; device_t dev; uint8_t val; int error; dev = arg; - sc = device_get_softc(dev); error = axp81x_read(dev, AXP_IRQSTAT5, &val, 1); if (error != 0) Modified: head/sys/arm/allwinner/clk/aw_pll.c ============================================================================== --- head/sys/arm/allwinner/clk/aw_pll.c Mon Dec 25 04:34:10 2017 (r327172) +++ head/sys/arm/allwinner/clk/aw_pll.c Mon Dec 25 04:48:39 2017 (r327173) @@ -865,7 +865,7 @@ h3_pll1_set_freq(struct aw_pll_sc *sc, uint64_t fin, u int flags) { struct aw_pll_factor *f; - uint32_t val, n, k, m, p; + uint32_t val, m, p; int i; f = NULL; @@ -884,8 +884,6 @@ h3_pll1_set_freq(struct aw_pll_sc *sc, uint64_t fin, u DEVICE_LOCK(sc); PLL_READ(sc, &val); - n = (val & A23_PLL1_FACTOR_N) >> A23_PLL1_FACTOR_N_SHIFT; - k = (val & A23_PLL1_FACTOR_K) >> A23_PLL1_FACTOR_K_SHIFT; m = (val & A23_PLL1_FACTOR_M) >> A23_PLL1_FACTOR_M_SHIFT; p = (val & A23_PLL1_FACTOR_P) >> A23_PLL1_FACTOR_P_SHIFT; Modified: head/sys/arm/allwinner/if_awg.c ============================================================================== --- head/sys/arm/allwinner/if_awg.c Mon Dec 25 04:34:10 2017 (r327172) +++ head/sys/arm/allwinner/if_awg.c Mon Dec 25 04:48:39 2017 (r327173) @@ -1266,12 +1266,10 @@ awg_setup_extres(device_t dev) hwreset_t rst_ahb, rst_ephy; clk_t clk_ahb, clk_ephy; regulator_t reg; - phandle_t node; uint64_t freq; int error, div; sc = device_get_softc(dev); - node = ofw_bus_get_node(dev); rst_ahb = rst_ephy = NULL; clk_ahb = clk_ephy = NULL; reg = NULL; @@ -1713,13 +1711,11 @@ awg_attach(device_t dev) { uint8_t eaddr[ETHER_ADDR_LEN]; struct awg_softc *sc; - phandle_t node; int error; sc = device_get_softc(dev); sc->dev = dev; sc->type = ofw_bus_search_compatible(dev, compat_data)->ocd_data; - node = ofw_bus_get_node(dev); if (bus_alloc_resources(dev, awg_spec, sc->res) != 0) { device_printf(dev, "cannot allocate resources for device\n"); Modified: head/sys/arm/arm/gic.c ============================================================================== --- head/sys/arm/arm/gic.c Mon Dec 25 04:34:10 2017 (r327172) +++ head/sys/arm/arm/gic.c Mon Dec 25 04:48:39 2017 (r327173) @@ -1384,11 +1384,9 @@ int arm_gicv2m_attach(device_t dev) { struct arm_gicv2m_softc *sc; - struct arm_gic_softc *psc; uint32_t typer; int rid; - psc = device_get_softc(device_get_parent(dev)); sc = device_get_softc(dev); rid = 0; Modified: head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c Mon Dec 25 04:34:10 2017 (r327172) +++ head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c Mon Dec 25 04:48:39 2017 (r327173) @@ -1386,10 +1386,7 @@ bcm2835_cpufreq_attach(device_t dev) static int bcm2835_cpufreq_detach(device_t dev) { - struct bcm2835_cpufreq_softc *sc; - sc = device_get_softc(dev); - sema_destroy(&vc_sema); return (cpufreq_unregister(dev)); @@ -1400,7 +1397,10 @@ bcm2835_cpufreq_set(device_t dev, const struct cf_sett { struct bcm2835_cpufreq_softc *sc; uint32_t rate_hz, rem; - int cur_freq, resp_freq, arm_freq, min_freq, core_freq; + int resp_freq, arm_freq, min_freq, core_freq; +#ifdef DEBUG + int cur_freq; +#endif if (cf == NULL || cf->freq < 0) return (EINVAL); @@ -1425,8 +1425,10 @@ bcm2835_cpufreq_set(device_t dev, const struct cf_sett /* set new value and verify it */ VC_LOCK(sc); +#ifdef DEBUG cur_freq = bcm2835_cpufreq_get_clock_rate(sc, BCM2835_MBOX_CLOCK_ID_ARM); +#endif resp_freq = bcm2835_cpufreq_set_clock_rate(sc, BCM2835_MBOX_CLOCK_ID_ARM, rate_hz); DELAY(TRANSITION_LATENCY); Modified: head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Mon Dec 25 04:34:10 2017 (r327172) +++ head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Mon Dec 25 04:48:39 2017 (r327173) @@ -1017,7 +1017,7 @@ bcm_gpio_pic_map_fdt(struct bcm_gpio_softc *sc, struct u_int *irqp, uint32_t *modep) { u_int irq; - uint32_t mode, bank; + uint32_t mode; /* * The first cell is the interrupt number. @@ -1036,7 +1036,6 @@ bcm_gpio_pic_map_fdt(struct bcm_gpio_softc *sc, struct return (EINVAL); /* Only reasonable modes are supported. */ - bank = BCM_GPIO_BANK(irq); if (daf->cells[1] == 1) mode = GPIO_INTR_EDGE_RISING; else if (daf->cells[1] == 2) Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Mon Dec 25 04:34:10 2017 (r327172) +++ head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Mon Dec 25 04:48:39 2017 (r327173) @@ -103,14 +103,18 @@ static struct ofw_compat_data compat_data[] = { static int bcm_mbox_read_msg(struct bcm_mbox_softc *sc, int *ochan) { +#ifdef DEBUG uint32_t data; +#endif uint32_t msg; int chan; msg = mbox_read_4(sc, REG_READ); dprintf("bcm_mbox_intr: raw data %08x\n", msg); chan = MBOX_CHAN(msg); +#ifdef DEBUG data = MBOX_DATA(msg); +#endif if (sc->msg[chan]) { printf("bcm_mbox_intr: channel %d oveflow\n", chan); return (1); Modified: head/sys/arm64/arm64/gic_v3.c ============================================================================== --- head/sys/arm64/arm64/gic_v3.c Mon Dec 25 04:34:10 2017 (r327172) +++ head/sys/arm64/arm64/gic_v3.c Mon Dec 25 04:48:39 2017 (r327173) @@ -408,9 +408,7 @@ arm_gic_v3_intr(void *arg) struct intr_pic *pic; uint64_t active_irq; struct trapframe *tf; - bool first; - first = true; pic = sc->gic_pic; while (1) { Modified: head/sys/arm64/arm64/gicv3_its.c ============================================================================== --- head/sys/arm64/arm64/gicv3_its.c Mon Dec 25 04:34:10 2017 (r327172) +++ head/sys/arm64/arm64/gicv3_its.c Mon Dec 25 04:48:39 2017 (r327173) @@ -1105,12 +1105,10 @@ static int gicv3_its_release_msi(device_t dev, device_t child, int count, struct intr_irqsrc **isrc) { - struct gicv3_its_softc *sc; struct gicv3_its_irqsrc *girq; struct its_dev *its_dev; int i; - sc = device_get_softc(dev); its_dev = its_device_find(dev, child); KASSERT(its_dev != NULL, @@ -1165,11 +1163,9 @@ gicv3_its_alloc_msix(device_t dev, device_t child, dev static int gicv3_its_release_msix(device_t dev, device_t child, struct intr_irqsrc *isrc) { - struct gicv3_its_softc *sc; struct gicv3_its_irqsrc *girq; struct its_dev *its_dev; - sc = device_get_softc(dev); its_dev = its_device_find(dev, child); KASSERT(its_dev != NULL, @@ -1405,9 +1401,7 @@ its_cmd_prepare(struct its_cmd *cmd, struct its_cmd_de uint64_t target; uint8_t cmd_type; u_int size; - boolean_t error; - error = FALSE; cmd_type = desc->cmd_type; target = ITS_TARGET_NONE; Modified: head/sys/arm64/arm64/machdep.c ============================================================================== --- head/sys/arm64/arm64/machdep.c Mon Dec 25 04:34:10 2017 (r327172) +++ head/sys/arm64/arm64/machdep.c Mon Dec 25 04:48:39 2017 (r327173) @@ -630,14 +630,13 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask struct sigframe *fp, frame; struct sigacts *psp; struct sysentvec *sysent; - int code, onstack, sig; + int onstack, sig; td = curthread; p = td->td_proc; PROC_LOCK_ASSERT(p, MA_OWNED); sig = ksi->ksi_signo; - code = ksi->ksi_code; psp = p->p_sigacts; mtx_assert(&psp->ps_mtx, MA_OWNED); Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Mon Dec 25 04:34:10 2017 (r327172) +++ head/sys/arm64/arm64/pmap.c Mon Dec 25 04:48:39 2017 (r327173) @@ -621,7 +621,7 @@ pmap_bootstrap_l2(vm_offset_t l1pt, vm_offset_t va, vm static vm_offset_t pmap_bootstrap_l3(vm_offset_t l1pt, vm_offset_t va, vm_offset_t l3_start) { - vm_offset_t l2pt, l3pt; + vm_offset_t l3pt; vm_paddr_t pa; pd_entry_t *l2; u_int l2_slot; @@ -630,7 +630,6 @@ pmap_bootstrap_l3(vm_offset_t l1pt, vm_offset_t va, vm l2 = pmap_l2(kernel_pmap, va); l2 = (pd_entry_t *)rounddown2((uintptr_t)l2, PAGE_SIZE); - l2pt = (vm_offset_t)l2; l2_slot = pmap_l2_index(va); l3pt = l3_start; Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Mon Dec 25 04:34:10 2017 (r327172) +++ head/sys/cam/ata/ata_da.c Mon Dec 25 04:48:39 2017 (r327173) @@ -2631,10 +2631,8 @@ adaprobedone(struct cam_periph *periph, union ccb *ccb static void adazonedone(struct cam_periph *periph, union ccb *ccb) { - struct ada_softc *softc; struct bio *bp; - softc = periph->softc; bp = (struct bio *)ccb->ccb_h.ccb_bp; switch (bp->bio_zone.zone_cmd) { @@ -2649,7 +2647,7 @@ adazonedone(struct cam_periph *periph, union ccb *ccb) struct scsi_report_zones_hdr *hdr; struct scsi_report_zones_desc *desc; struct disk_zone_rep_entry *entry; - uint32_t num_alloced, hdr_len, num_avail; + uint32_t hdr_len, num_avail; uint32_t num_to_fill, i; rep = &bp->bio_zone.zone_params.report; @@ -2664,7 +2662,6 @@ adazonedone(struct cam_periph *periph, union ccb *ccb) * be different than the amount of data transferred to * the user. */ - num_alloced = rep->entries_allocated; hdr = (struct scsi_report_zones_hdr *)ccb->ataio.data_ptr; if (avail_len < sizeof(*hdr)) { /* Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Mon Dec 25 04:34:10 2017 (r327172) +++ head/sys/cam/scsi/scsi_da.c Mon Dec 25 04:48:39 2017 (r327173) @@ -1525,7 +1525,6 @@ daclose(struct disk *dp) struct cam_periph *periph; struct da_softc *softc; union ccb *ccb; - int error; periph = (struct cam_periph *)dp->d_drv1; softc = (struct da_softc *)periph->softc; @@ -1544,7 +1543,7 @@ daclose(struct disk *dp) /*cbfcnp*/dadone, MSG_SIMPLE_Q_TAG, /*begin_lba*/0, /*lb_count*/0, SSD_FULL_SIZE, 5 * 60 * 1000); - error = cam_periph_runccb(ccb, daerror, /*cam_flags*/0, + cam_periph_runccb(ccb, daerror, /*cam_flags*/0, /*sense_flags*/SF_RETRY_UA | SF_QUIET_IR, softc->disk->d_devstat); softc->flags &= ~DA_FLAG_DIRTY; @@ -2311,7 +2310,7 @@ dadeletemethodsysctl(SYSCTL_HANDLER_ARGS) char buf[16]; const char *p; struct da_softc *softc; - int i, error, methods, value; + int i, error, value; softc = (struct da_softc *)arg1; @@ -2324,7 +2323,6 @@ dadeletemethodsysctl(SYSCTL_HANDLER_ARGS) error = sysctl_handle_string(oidp, buf, sizeof(buf), req); if (error != 0 || req->newptr == NULL) return (error); - methods = softc->delete_available | (1 << DA_DELETE_DISABLE); for (i = 0; i <= DA_DELETE_MAX; i++) { if (strcmp(buf, da_delete_method_names[i]) == 0) break; @@ -3970,7 +3968,7 @@ dazonedone(struct cam_periph *periph, union ccb *ccb) struct scsi_report_zones_hdr *hdr; struct scsi_report_zones_desc *desc; struct disk_zone_rep_entry *entry; - uint32_t num_alloced, hdr_len, num_avail; + uint32_t hdr_len, num_avail; uint32_t num_to_fill, i; int ata; @@ -3987,7 +3985,6 @@ dazonedone(struct cam_periph *periph, union ccb *ccb) * the user. */ bp->bio_resid = ccb->csio.resid; - num_alloced = rep->entries_allocated; hdr = (struct scsi_report_zones_hdr *)ccb->csio.data_ptr; if (avail_len < sizeof(*hdr)) { /* Modified: head/sys/cam/scsi/scsi_pass.c ============================================================================== --- head/sys/cam/scsi/scsi_pass.c Mon Dec 25 04:34:10 2017 (r327172) +++ head/sys/cam/scsi/scsi_pass.c Mon Dec 25 04:48:39 2017 (r327173) @@ -1699,13 +1699,11 @@ static int passmemdone(struct cam_periph *periph, struct pass_io_req *io_req) { struct pass_softc *softc; - union ccb *ccb; int error; int i; error = 0; softc = (struct pass_softc *)periph->softc; - ccb = &io_req->ccb; switch (io_req->data_flags) { case CAM_DATA_VADDR: Modified: head/sys/dev/al_eth/al_eth.c ============================================================================== --- head/sys/dev/al_eth/al_eth.c Mon Dec 25 04:34:10 2017 (r327172) +++ head/sys/dev/al_eth/al_eth.c Mon Dec 25 04:48:39 2017 (r327173) @@ -272,7 +272,6 @@ al_probe(device_t dev) static int al_attach(device_t dev) { - struct al_eth_lm_context *lm_context; struct al_eth_adapter *adapter; struct sysctl_oid_list *child; struct sysctl_ctx_list *ctx; @@ -304,8 +303,6 @@ al_attach(device_t dev) AL_RX_LOCK_INIT(adapter); g_adapters[g_adapters_count] = adapter; - - lm_context = &adapter->lm_context; bar_udma = PCIR_BAR(AL_ETH_UDMA_BAR); adapter->udma_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, Modified: head/sys/dev/axgbe/xgbe-drv.c ============================================================================== --- head/sys/dev/axgbe/xgbe-drv.c Mon Dec 25 04:34:10 2017 (r327172) +++ head/sys/dev/axgbe/xgbe-drv.c Mon Dec 25 04:48:39 2017 (r327173) @@ -954,7 +954,7 @@ static int xgbe_rx_poll(struct xgbe_channel *channel, struct xgbe_packet_data *packet; struct ifnet *ifp = pdata->netdev; struct mbuf *m; - unsigned int incomplete, context_next, context; + unsigned int incomplete, context_next; unsigned int received = 0; int packet_count = 0; @@ -992,9 +992,6 @@ read_again: context_next = XGMAC_GET_BITS(packet->attributes, RX_PACKET_ATTRIBUTES, CONTEXT_NEXT); - context = XGMAC_GET_BITS(packet->attributes, - RX_PACKET_ATTRIBUTES, - CONTEXT); /* Earlier error, just drain the remaining data */ if (incomplete || context_next) { Modified: head/sys/dev/axgbe/xgbe-mdio.c ============================================================================== --- head/sys/dev/axgbe/xgbe-mdio.c Mon Dec 25 04:34:10 2017 (r327172) +++ head/sys/dev/axgbe/xgbe-mdio.c Mon Dec 25 04:48:39 2017 (r327173) @@ -752,36 +752,30 @@ static void xgbe_an_init(struct xgbe_prv_data *pdata) static void xgbe_phy_adjust_link(struct xgbe_prv_data *pdata) { - int new_state = 0; if (pdata->phy.link) { /* Flow control support */ pdata->pause_autoneg = pdata->phy.pause_autoneg; if (pdata->tx_pause != pdata->phy.tx_pause) { - new_state = 1; pdata->hw_if.config_tx_flow_control(pdata); pdata->tx_pause = pdata->phy.tx_pause; } if (pdata->rx_pause != pdata->phy.rx_pause) { - new_state = 1; pdata->hw_if.config_rx_flow_control(pdata); pdata->rx_pause = pdata->phy.rx_pause; } /* Speed support */ if (pdata->phy_speed != pdata->phy.speed) { - new_state = 1; pdata->phy_speed = pdata->phy.speed; } if (pdata->phy_link != pdata->phy.link) { - new_state = 1; pdata->phy_link = pdata->phy.link; } } else if (pdata->phy_link) { - new_state = 1; pdata->phy_link = 0; pdata->phy_speed = SPEED_UNKNOWN; } Modified: head/sys/dev/e1000/igb_txrx.c ============================================================================== --- head/sys/dev/e1000/igb_txrx.c Mon Dec 25 04:34:10 2017 (r327172) +++ head/sys/dev/e1000/igb_txrx.c Mon Dec 25 04:48:39 2017 (r327173) @@ -237,7 +237,7 @@ igb_isc_txd_encap(void *arg, if_pkt_info_t pi) int nsegs = pi->ipi_nsegs; bus_dma_segment_t *segs = pi->ipi_segs; union e1000_adv_tx_desc *txd = NULL; - int i, j, first, pidx_last; + int i, j, pidx_last; u32 olinfo_status, cmd_type_len, txd_flags; qidx_t ntxd; @@ -249,7 +249,7 @@ igb_isc_txd_encap(void *arg, if_pkt_info_t pi) if (pi->ipi_mflags & M_VLANTAG) cmd_type_len |= E1000_ADVTXD_DCMD_VLE; - first = i = pi->ipi_pidx; + i = pi->ipi_pidx; ntxd = scctx->isc_ntxd[0]; txd_flags = pi->ipi_flags & IPI_TX_INTR ? E1000_ADVTXD_DCMD_RS : 0; /* Consume the first descriptor */ Modified: head/sys/dev/extres/clk/clk_bus.c ============================================================================== --- head/sys/dev/extres/clk/clk_bus.c Mon Dec 25 04:34:10 2017 (r327172) +++ head/sys/dev/extres/clk/clk_bus.c Mon Dec 25 04:48:39 2017 (r327173) @@ -60,11 +60,9 @@ ofw_clkbus_probe(device_t dev) static int ofw_clkbus_attach(device_t dev) { - struct ofw_clkbus_softc *sc; phandle_t node, child; device_t cdev; - sc = device_get_softc(dev); node = ofw_bus_get_node(dev); simplebus_init(dev, node); Modified: head/sys/dev/extres/regulator/regulator_bus.c ============================================================================== --- head/sys/dev/extres/regulator/regulator_bus.c Mon Dec 25 04:34:10 2017 (r327172) +++ head/sys/dev/extres/regulator/regulator_bus.c Mon Dec 25 04:48:39 2017 (r327173) @@ -58,10 +58,8 @@ ofw_regulator_bus_probe(device_t dev) static int ofw_regulator_bus_attach(device_t dev) { - struct ofw_regulator_bus_softc *sc; phandle_t node, child; - sc = device_get_softc(dev); node = ofw_bus_get_node(dev); simplebus_init(dev, node); Modified: head/sys/dev/fdt/fdt_common.c ============================================================================== --- head/sys/dev/fdt/fdt_common.c Mon Dec 25 04:34:10 2017 (r327172) +++ head/sys/dev/fdt/fdt_common.c Mon Dec 25 04:48:39 2017 (r327173) @@ -155,7 +155,7 @@ fdt_get_range(phandle_t node, int range_id, u_long *ba pcell_t ranges[FDT_RANGES_SIZE], *rangesptr; pcell_t addr_cells, size_cells, par_addr_cells; u_long par_bus_addr, pbase, psize; - int err, len, tuple_size, tuples; + int err, len; if ((fdt_addrsize_cells(node, &addr_cells, &size_cells)) != 0) return (ENXIO); @@ -181,10 +181,6 @@ fdt_get_range(phandle_t node, int range_id, u_long *ba if (OF_getprop(node, "ranges", ranges, sizeof(ranges)) <= 0) return (EINVAL); - tuple_size = sizeof(pcell_t) * (addr_cells + par_addr_cells + - size_cells); - tuples = len / tuple_size; - if (par_addr_cells > 2 || addr_cells > 2 || size_cells > 2) return (ERANGE); @@ -600,11 +596,9 @@ fdt_get_reserved_regions(struct mem_region *mr, int *m pcell_t reserve[FDT_REG_CELLS * FDT_MEM_REGIONS]; pcell_t *reservep; phandle_t memory, root; - uint32_t memory_size; int addr_cells, size_cells; - int i, max_size, res_len, rv, tuple_size, tuples; + int i, res_len, rv, tuple_size, tuples; - max_size = sizeof(reserve); root = OF_finddevice("/"); memory = OF_finddevice("/memory"); if (memory == -1) { @@ -634,7 +628,6 @@ fdt_get_reserved_regions(struct mem_region *mr, int *m goto out; } - memory_size = 0; tuples = res_len / tuple_size; reservep = (pcell_t *)&reserve; for (i = 0; i < tuples; i++) { @@ -662,9 +655,8 @@ fdt_get_mem_regions(struct mem_region *mr, int *mrcnt, phandle_t memory; uint64_t memory_size; int addr_cells, size_cells; - int i, max_size, reg_len, rv, tuple_size, tuples; + int i, reg_len, rv, tuple_size, tuples; - max_size = sizeof(reg); memory = OF_finddevice("/memory"); if (memory == -1) { rv = ENXIO; Modified: head/sys/dev/mii/rdcphy.c ============================================================================== --- head/sys/dev/mii/rdcphy.c Mon Dec 25 04:34:10 2017 (r327172) +++ head/sys/dev/mii/rdcphy.c Mon Dec 25 04:48:39 2017 (r327173) @@ -185,11 +185,9 @@ static void rdcphy_status(struct mii_softc *sc) { struct mii_data *mii; - struct ifmedia_entry *ife; int bmsr, bmcr, physts; mii = sc->mii_pdata; - ife = mii->mii_media.ifm_cur; mii->mii_media_status = IFM_AVALID; mii->mii_media_active = IFM_ETHER; Modified: head/sys/dev/mmc/host/dwmmc.c ============================================================================== --- head/sys/dev/mmc/host/dwmmc.c Mon Dec 25 04:34:10 2017 (r327172) +++ head/sys/dev/mmc/host/dwmmc.c Mon Dec 25 04:48:39 2017 (r327173) @@ -751,12 +751,10 @@ static int dma_prepare(struct dwmmc_softc *sc, struct mmc_command *cmd) { struct mmc_data *data; - int len; int err; int reg; data = cmd->data; - len = data->len; reg = READ4(sc, SDMMC_INTMASK); reg &= ~(SDMMC_INTMASK_TXDR | SDMMC_INTMASK_RXDR); Modified: head/sys/dev/mmc/mmc.c ============================================================================== --- head/sys/dev/mmc/mmc.c Mon Dec 25 04:34:10 2017 (r327172) +++ head/sys/dev/mmc/mmc.c Mon Dec 25 04:48:39 2017 (r327173) @@ -1559,17 +1559,14 @@ mmc_host_timing(device_t dev, enum mmc_bus_timing timi static void mmc_log_card(device_t dev, struct mmc_ivars *ivar, int newcard) { - enum mmc_bus_timing max_timing, timing; + enum mmc_bus_timing timing; device_printf(dev, "Card at relative address 0x%04x%s:\n", ivar->rca, newcard ? " added" : ""); device_printf(dev, " card: %s\n", ivar->card_id_string); - max_timing = bus_timing_normal; for (timing = bus_timing_max; timing > bus_timing_normal; timing--) { - if (isset(&ivar->timings, timing)) { - max_timing = timing; + if (isset(&ivar->timings, timing)) break; - } } device_printf(dev, " quirks: %b\n", ivar->quirks, MMC_QUIRKS_FMT); device_printf(dev, " bus: %ubit, %uMHz (%s timing)\n", Modified: head/sys/dev/mmc/mmcsd.c ============================================================================== --- head/sys/dev/mmc/mmcsd.c Mon Dec 25 04:34:10 2017 (r327172) +++ head/sys/dev/mmc/mmcsd.c Mon Dec 25 04:48:39 2017 (r327173) @@ -755,11 +755,9 @@ mmcsd_close(struct disk *dp __unused) static void mmcsd_strategy(struct bio *bp) { - struct mmcsd_softc *sc; struct mmcsd_part *part; part = bp->bio_disk->d_drv1; - sc = part->sc; MMCSD_DISK_LOCK(part); if (part->running > 0 || part->suspend > 0) { bioq_disksort(&part->bio_queue, bp); Modified: head/sys/dev/ofw/ofw_bus_subr.c ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.c Mon Dec 25 04:34:10 2017 (r327172) +++ head/sys/dev/ofw/ofw_bus_subr.c Mon Dec 25 04:48:39 2017 (r327173) @@ -386,9 +386,8 @@ ofw_bus_search_intrmap(void *intr, int intrsz, void *r uint8_t *mptr; pcell_t paddrsz; pcell_t pintrsz; - int i, rsz, tsz; + int i, tsz; - rsz = -1; if (imapmsk != NULL) { for (i = 0; i < physsz; i++) ref[i] = uiregs[i] & uiimapmsk[i]; @@ -445,7 +444,7 @@ ofw_bus_msimap(phandle_t node, uint16_t pci_rid, phand { pcell_t *map, mask, msi_base, rid_base, rid_length; ssize_t len; - uint32_t masked_rid, rid; + uint32_t masked_rid; int err, i; /* TODO: This should be OF_searchprop_alloc if we had it */ @@ -462,7 +461,6 @@ ofw_bus_msimap(phandle_t node, uint16_t pci_rid, phand } err = ENOENT; - rid = 0; mask = 0xffffffff; OF_getencprop(node, "msi-map-mask", &mask, sizeof(mask)); Modified: head/sys/dev/ofw/ofwpci.c ============================================================================== --- head/sys/dev/ofw/ofwpci.c Mon Dec 25 04:34:10 2017 (r327172) +++ head/sys/dev/ofw/ofwpci.c Mon Dec 25 04:48:39 2017 (r327173) @@ -558,10 +558,7 @@ static int ofw_pci_deactivate_resource(device_t bus, device_t child, int type, int rid, struct resource *res) { - struct ofw_pci_softc *sc; vm_size_t psize; - - sc = device_get_softc(bus); if (type != SYS_RES_IOPORT && type != SYS_RES_MEMORY) { return (bus_generic_deactivate_resource(bus, child, type, rid, Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Mon Dec 25 04:34:10 2017 (r327172) +++ head/sys/dev/pci/pci.c Mon Dec 25 04:48:39 2017 (r327173) @@ -3980,7 +3980,6 @@ pci_rescan_method(device_t dev) { #define REG(n, w) PCIB_READ_CONFIG(pcib, busno, s, f, n, w) device_t pcib = device_get_parent(dev); - struct pci_softc *sc; device_t child, *devlist, *unchanged; int devcount, error, i, j, maxslots, oldcount; int busno, domain, s, f, pcifunchigh; @@ -4000,7 +3999,6 @@ pci_rescan_method(device_t dev) } else unchanged = NULL; - sc = device_get_softc(dev); domain = pcib_get_domain(dev); busno = pcib_get_bus(dev); maxslots = PCIB_MAXSLOTS(pcib); @@ -4077,11 +4075,9 @@ device_t pci_add_iov_child(device_t bus, device_t pf, uint16_t rid, uint16_t vid, uint16_t did) { - struct pci_devinfo *pf_dinfo, *vf_dinfo; + struct pci_devinfo *vf_dinfo; device_t pcib; int busno, slot, func; - - pf_dinfo = device_get_ivars(pf); pcib = device_get_parent(bus); Modified: head/sys/dev/pci/pci_pci.c ============================================================================== --- head/sys/dev/pci/pci_pci.c Mon Dec 25 04:34:10 2017 (r327172) +++ head/sys/dev/pci/pci_pci.c Mon Dec 25 04:48:39 2017 (r327173) @@ -1241,10 +1241,8 @@ static void pcib_pcie_ab_timeout(void *arg) { struct pcib_softc *sc; - device_t dev; sc = arg; - dev = sc->dev; mtx_assert(&Giant, MA_OWNED); if (sc->flags & PCIB_DETACH_PENDING) { sc->flags |= PCIB_DETACHING; @@ -1484,16 +1482,14 @@ pcib_cfg_save(struct pcib_softc *sc) static void pcib_cfg_restore(struct pcib_softc *sc) { - device_t dev; #ifndef NEW_PCIB uint16_t command; #endif - dev = sc->dev; #ifdef NEW_PCIB pcib_write_windows(sc, WIN_IO | WIN_MEM | WIN_PMEM); #else - command = pci_read_config(dev, PCIR_COMMAND, 2); + command = pci_read_config(sc->dev, PCIR_COMMAND, 2); if (command & PCIM_CMD_PORTEN) pcib_set_io_decode(sc); if (command & PCIM_CMD_MEMEN) Modified: head/sys/dev/smc/if_smc_fdt.c ============================================================================== --- head/sys/dev/smc/if_smc_fdt.c Mon Dec 25 04:34:10 2017 (r327172) +++ head/sys/dev/smc/if_smc_fdt.c Mon Dec 25 04:48:39 2017 (r327173) @@ -84,17 +84,8 @@ smc_fdt_probe(device_t dev) static int smc_fdt_attach(device_t dev) { - int err; - struct smc_softc *sc; - sc = device_get_softc(dev); - - err = smc_attach(dev); - if (err) { - return (err); - } - - return (0); + return smc_attach(dev); } static int Modified: head/sys/dev/uart/uart_bus_acpi.c ============================================================================== --- head/sys/dev/uart/uart_bus_acpi.c Mon Dec 25 04:34:10 2017 (r327172) +++ head/sys/dev/uart/uart_bus_acpi.c Mon Dec 25 04:48:39 2017 (r327173) @@ -104,13 +104,11 @@ static int uart_acpi_probe(device_t dev) { struct uart_softc *sc; - device_t parent; - parent = device_get_parent(dev); sc = device_get_softc(dev); #if defined(__i386__) || defined(__amd64__) - if (!ISA_PNP_PROBE(parent, dev, acpi_ns8250_ids)) { + if (!ISA_PNP_PROBE(device_get_parent(dev), dev, acpi_ns8250_ids)) { sc->sc_class = &uart_ns8250_class; return (uart_bus_probe(dev, 0, 0, 0, 0, 0)); } Modified: head/sys/dev/uart/uart_dev_pl011.c ============================================================================== --- head/sys/dev/uart/uart_dev_pl011.c Mon Dec 25 04:34:10 2017 (r327172) +++ head/sys/dev/uart/uart_dev_pl011.c Mon Dec 25 04:48:39 2017 (r327173) @@ -381,10 +381,8 @@ uart_pl011_bus_getsig(struct uart_softc *sc) static int uart_pl011_bus_ioctl(struct uart_softc *sc, int request, intptr_t data) { - struct uart_bas *bas; int error; - bas = &sc->sc_bas; error = 0; uart_lock(sc->sc_hwmtx); switch (request) { Modified: head/sys/dev/uart/uart_dev_snps.c ============================================================================== --- head/sys/dev/uart/uart_dev_snps.c Mon Dec 25 04:34:10 2017 (r327172) +++ head/sys/dev/uart/uart_dev_snps.c Mon Dec 25 04:48:39 2017 (r327173) @@ -110,9 +110,7 @@ UART_FDT_CLASS(compat_data); static int snps_get_clocks(device_t dev, clk_t *baudclk, clk_t *apb_pclk) { - struct snps_softc *sc; - sc = device_get_softc(dev); *baudclk = NULL; *apb_pclk = NULL; Modified: head/sys/dev/usb/controller/dwc_otg_fdt.c ============================================================================== --- head/sys/dev/usb/controller/dwc_otg_fdt.c Mon Dec 25 04:34:10 2017 (r327172) +++ head/sys/dev/usb/controller/dwc_otg_fdt.c Mon Dec 25 04:48:39 2017 (r327173) @@ -170,7 +170,6 @@ int dwc_otg_detach(device_t dev) { struct dwc_otg_fdt_softc *sc = device_get_softc(dev); - int err; /* during module unload there are lots of children leftover */ device_delete_children(dev); @@ -181,7 +180,7 @@ dwc_otg_detach(device_t dev) */ dwc_otg_uninit(&sc->sc_otg); - err = bus_teardown_intr(dev, sc->sc_otg.sc_irq_res, + bus_teardown_intr(dev, sc->sc_otg.sc_irq_res, sc->sc_otg.sc_intr_hdl); sc->sc_otg.sc_intr_hdl = NULL; } Modified: head/sys/dev/usb/controller/ehci.c ============================================================================== --- head/sys/dev/usb/controller/ehci.c Mon Dec 25 04:34:10 2017 (r327172) +++ head/sys/dev/usb/controller/ehci.c Mon Dec 25 04:48:39 2017 (r327173) @@ -1194,9 +1194,7 @@ ehci_non_isoc_done_sub(struct usb_xfer *xfer) static void ehci_non_isoc_done(struct usb_xfer *xfer) { - ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus); ehci_qh_t *qh; - uint32_t status; usb_error_t err = 0; DPRINTFN(13, "xfer=%p endpoint=%p transfer done\n", @@ -1215,8 +1213,6 @@ ehci_non_isoc_done(struct usb_xfer *xfer) qh = xfer->qh_start[xfer->flags_int.curr_dma_set]; usb_pc_cpu_invalidate(qh->page_cache); - - status = hc32toh(sc, qh->qh_qtd.qtd_status); /* reset scanner */ Modified: head/sys/dev/usb/controller/ohci.c ============================================================================== --- head/sys/dev/usb/controller/ohci.c Mon Dec 25 04:34:10 2017 (r327172) +++ head/sys/dev/usb/controller/ohci.c Mon Dec 25 04:48:39 2017 (r327173) @@ -2385,7 +2385,6 @@ ohci_xfer_setup(struct usb_setup_params *parm) { struct usb_page_search page_info; struct usb_page_cache *pc; - ohci_softc_t *sc; struct usb_xfer *xfer; void *last_obj; uint32_t ntd; @@ -2393,7 +2392,6 @@ ohci_xfer_setup(struct usb_setup_params *parm) uint32_t nqh; uint32_t n; - sc = OHCI_BUS2SC(parm->udev->bus); xfer = parm->curr_xfer; parm->hc_max_packet_size = 0x500; Modified: head/sys/dev/usb/controller/xhci.c ============================================================================== --- head/sys/dev/usb/controller/xhci.c Mon Dec 25 04:34:10 2017 (r327172) +++ head/sys/dev/usb/controller/xhci.c Mon Dec 25 04:48:39 2017 (r327173) @@ -3714,13 +3714,11 @@ xhci_xfer_setup(struct usb_setup_params *parm) { struct usb_page_search page_info; struct usb_page_cache *pc; - struct xhci_softc *sc; struct usb_xfer *xfer; void *last_obj; uint32_t ntd; uint32_t n; - sc = XHCI_BUS2SC(parm->udev->bus); xfer = parm->curr_xfer; /* Modified: head/sys/dev/usb/storage/umass.c ============================================================================== --- head/sys/dev/usb/storage/umass.c Mon Dec 25 04:34:10 2017 (r327172) +++ head/sys/dev/usb/storage/umass.c Mon Dec 25 04:48:39 2017 (r327173) @@ -1089,7 +1089,6 @@ static void umass_init_shuttle(struct umass_softc *sc) { struct usb_device_request req; - usb_error_t err; uint8_t status[2] = {0, 0}; /* @@ -1102,7 +1101,7 @@ umass_init_shuttle(struct umass_softc *sc) req.wIndex[0] = sc->sc_iface_no; req.wIndex[1] = 0; USETW(req.wLength, sizeof(status)); - err = usbd_do_request(sc->sc_udev, NULL, &req, &status); + usbd_do_request(sc->sc_udev, NULL, &req, &status); DPRINTF(sc, UDMASS_GEN, "Shuttle init returned 0x%02x%02x\n", status[0], status[1]); Modified: head/sys/dev/usb/usb_dev.c ============================================================================== --- head/sys/dev/usb/usb_dev.c Mon Dec 25 04:34:10 2017 (r327172) +++ head/sys/dev/usb/usb_dev.c Mon Dec 25 04:48:39 2017 (r327173) @@ -878,7 +878,7 @@ usb_open(struct cdev *dev, int fflags, int devtype, st struct usb_fs_privdata* pd = (struct usb_fs_privdata*)dev->si_drv1; struct usb_cdev_refdata refs; struct usb_cdev_privdata *cpd; - int err, ep; + int err; DPRINTFN(2, "%s fflags=0x%08x\n", devtoname(dev), fflags); @@ -890,7 +890,6 @@ usb_open(struct cdev *dev, int fflags, int devtype, st } cpd = malloc(sizeof(*cpd), M_USBDEV, M_WAITOK | M_ZERO); - ep = cpd->ep_addr = pd->ep_addr; usb_loc_fill(pd, cpd); err = usb_ref_device(cpd, &refs, 1); @@ -1412,8 +1411,6 @@ usb_read(struct cdev *dev, struct uio *uio, int ioflag struct usb_cdev_privdata* cpd; struct usb_fifo *f; struct usb_mbuf *m; - int fflags; - int resid; int io_len; int err; uint8_t tr_data = 0; @@ -1426,8 +1423,6 @@ usb_read(struct cdev *dev, struct uio *uio, int ioflag if (err) return (ENXIO); - fflags = cpd->fflags; - f = refs.rxfifo; if (f == NULL) { /* should not happen */ @@ -1435,8 +1430,6 @@ usb_read(struct cdev *dev, struct uio *uio, int ioflag return (EPERM); } - resid = uio->uio_resid; - mtx_lock(f->priv_mtx); /* check for permanent read error */ @@ -1536,8 +1529,6 @@ usb_write(struct cdev *dev, struct uio *uio, int iofla struct usb_fifo *f; struct usb_mbuf *m; uint8_t *pdata; - int fflags; - int resid; int io_len; int err; uint8_t tr_data = 0; @@ -1552,15 +1543,12 @@ usb_write(struct cdev *dev, struct uio *uio, int iofla if (err) return (ENXIO); - fflags = cpd->fflags; - f = refs.txfifo; if (f == NULL) { /* should not happen */ usb_unref_device(cpd, &refs); return (EPERM); } - resid = uio->uio_resid; mtx_lock(f->priv_mtx); Modified: head/sys/dev/vnic/nic_main.c ============================================================================== --- head/sys/dev/vnic/nic_main.c Mon Dec 25 04:34:10 2017 (r327172) +++ head/sys/dev/vnic/nic_main.c Mon Dec 25 04:48:39 2017 (r327173) @@ -761,9 +761,6 @@ static void nic_send_rss_size(struct nicpf *nic, int vf) { union nic_mbx mbx = {}; - uint64_t *msg; - - msg = (uint64_t *)&mbx; mbx.rss_size.msg = NIC_MBOX_MSG_RSS_SIZE; mbx.rss_size.ind_tbl_size = nic->rss_ind_tbl_size; Modified: head/sys/dev/vnic/nicvf_main.c ============================================================================== --- head/sys/dev/vnic/nicvf_main.c Mon Dec 25 04:34:10 2017 (r327172) +++ head/sys/dev/vnic/nicvf_main.c Mon Dec 25 04:48:39 2017 (r327173) @@ -425,7 +425,6 @@ nicvf_if_ioctl(struct ifnet *ifp, u_long cmd, caddr_t struct nicvf *nic; struct rcv_queue *rq; struct ifreq *ifr; - uint32_t flags; int mask, err; int rq_idx; #if defined(INET) || defined(INET6) @@ -482,7 +481,6 @@ nicvf_if_ioctl(struct ifnet *ifp, u_long cmd, caddr_t NICVF_CORE_LOCK(nic); if (if_getflags(ifp) & IFF_UP) { if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) { - flags = if_getflags(ifp) ^ nic->if_flags; if ((nic->if_flags & if_getflags(ifp)) & IFF_PROMISC) { /* Change promiscous mode */ Modified: head/sys/dev/vnic/nicvf_queues.c ============================================================================== --- head/sys/dev/vnic/nicvf_queues.c Mon Dec 25 04:34:10 2017 (r327172) +++ head/sys/dev/vnic/nicvf_queues.c Mon Dec 25 04:48:39 2017 (r327173) @@ -1714,13 +1714,12 @@ nicvf_sq_disable(struct nicvf *nic, int qidx) static void nicvf_sq_free_used_descs(struct nicvf *nic, struct snd_queue *sq, int qidx) { - uint64_t head, tail; + uint64_t head; struct snd_buff *snd_buff; struct sq_hdr_subdesc *hdr; NICVF_TX_LOCK(sq); head = nicvf_queue_reg_read(nic, NIC_QSET_SQ_0_7_HEAD, qidx) >> 4; - tail = nicvf_queue_reg_read(nic, NIC_QSET_SQ_0_7_TAIL, qidx) >> 4; while (sq->head != head) { hdr = (struct sq_hdr_subdesc *)GET_SQ_DESC(sq, sq->head); if (hdr->subdesc_type != SQ_DESC_TYPE_HEADER) { Modified: head/sys/fs/cd9660/cd9660_vfsops.c ============================================================================== --- head/sys/fs/cd9660/cd9660_vfsops.c Mon Dec 25 04:34:10 2017 (r327172) +++ head/sys/fs/cd9660/cd9660_vfsops.c Mon Dec 25 04:48:39 2017 (r327173) @@ -680,7 +680,6 @@ cd9660_vget_internal(mp, ino, flags, vpp, relocated, i struct iso_node *ip; struct buf *bp; struct vnode *vp; - struct cdev *dev; int error; struct thread *td; @@ -707,7 +706,6 @@ cd9660_vget_internal(mp, ino, flags, vpp, relocated, i */ imp = VFSTOISOFS(mp); - dev = imp->im_dev; /* Allocate a new vnode/iso_node. */ if ((error = getnewvnode("isofs", mp, &cd9660_vnodeops, &vp)) != 0) { Modified: head/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- head/sys/fs/nfs/nfs_commonkrpc.c Mon Dec 25 04:34:10 2017 (r327172) +++ head/sys/fs/nfs/nfs_commonkrpc.c Mon Dec 25 04:48:39 2017 (r327173) @@ -493,7 +493,7 @@ newnfs_request(struct nfsrv_descript *nd, struct nfsmo uint32_t retseq, retval, slotseq, *tl; time_t waituntil; int i = 0, j = 0, opcnt, set_sigset = 0, slot; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Dec 25 16:27:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20AB9E967A5; Mon, 25 Dec 2017 16:27:38 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD8A86A004; Mon, 25 Dec 2017 16:27:37 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBPGRa2L070122; Mon, 25 Dec 2017 16:27:36 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBPGRagi070121; Mon, 25 Dec 2017 16:27:36 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201712251627.vBPGRagi070121@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 25 Dec 2017 16:27:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327175 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 327175 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Dec 2017 16:27:38 -0000 Author: manu Date: Mon Dec 25 16:27:36 2017 New Revision: 327175 URL: https://svnweb.freebsd.org/changeset/base/327175 Log: Allwinner: Remove unused aw_console driver. Deleted: head/sys/arm/allwinner/aw_console.c Modified: head/sys/arm/allwinner/files.allwinner Modified: head/sys/arm/allwinner/files.allwinner ============================================================================== --- head/sys/arm/allwinner/files.allwinner Mon Dec 25 13:17:29 2017 (r327174) +++ head/sys/arm/allwinner/files.allwinner Mon Dec 25 16:27:36 2017 (r327175) @@ -30,7 +30,6 @@ arm/allwinner/aw_sid.c standard arm/allwinner/aw_thermal.c standard dev/iicbus/sy8106a.c optional sy8106a arm/allwinner/aw_cir.c optional aw_cir evdev -#arm/allwinner/aw_console.c standard arm/allwinner/a10_fb.c optional vt arm/allwinner/a10_hdmi.c optional hdmi From owner-svn-src-all@freebsd.org Mon Dec 25 16:40:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD297E97046; Mon, 25 Dec 2017 16:40:10 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 76FF36A571; Mon, 25 Dec 2017 16:40:10 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBPGe9pO074544; Mon, 25 Dec 2017 16:40:09 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBPGe9pT074543; Mon, 25 Dec 2017 16:40:09 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201712251640.vBPGe9pT074543@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 25 Dec 2017 16:40:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327176 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 327176 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Dec 2017 16:40:10 -0000 Author: manu Date: Mon Dec 25 16:40:09 2017 New Revision: 327176 URL: https://svnweb.freebsd.org/changeset/base/327176 Log: allwinner: aw_usbphy is also needed for ohci Modified: head/sys/arm/allwinner/files.allwinner Modified: head/sys/arm/allwinner/files.allwinner ============================================================================== --- head/sys/arm/allwinner/files.allwinner Mon Dec 25 16:27:36 2017 (r327175) +++ head/sys/arm/allwinner/files.allwinner Mon Dec 25 16:40:09 2017 (r327176) @@ -6,7 +6,7 @@ arm/allwinner/a10_codec.c optional sound arm/allwinner/a10_dmac.c standard arm/allwinner/a31_dmac.c standard arm/allwinner/a10_ehci.c optional ehci -arm/allwinner/aw_usbphy.c optional ehci +arm/allwinner/aw_usbphy.c optional ehci | ohci arm/allwinner/a10_gpio.c optional gpio arm/allwinner/a10_mmc.c optional mmc arm/allwinner/a10_sramc.c standard From owner-svn-src-all@freebsd.org Mon Dec 25 17:49:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63AA6E9BA3D; Mon, 25 Dec 2017 17:49:57 +0000 (UTC) (envelope-from pho@holm.cc) Received: from relay01.pair.com (relay01.pair.com [209.68.5.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 391456C70D; Mon, 25 Dec 2017 17:49:56 +0000 (UTC) (envelope-from pho@holm.cc) Received: from x2.osted.lan (87-58-223-204-dynamic.dk.customer.tdc.net [87.58.223.204]) by relay01.pair.com (Postfix) with ESMTP id A0DA0D0035C; Mon, 25 Dec 2017 12:49:48 -0500 (EST) Received: from x2.osted.lan (localhost [127.0.0.1]) by x2.osted.lan (8.14.9/8.14.9) with ESMTP id vBPHnkt9010027 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 25 Dec 2017 18:49:46 +0100 (CET) (envelope-from pho@x2.osted.lan) Received: (from pho@localhost) by x2.osted.lan (8.14.9/8.14.9/Submit) id vBPHnk5H010026; Mon, 25 Dec 2017 18:49:46 +0100 (CET) (envelope-from pho) Date: Mon, 25 Dec 2017 18:49:46 +0100 From: Peter Holm To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327168 - head/sys/vm Message-ID: <20171225174946.GA9941@x2.osted.lan> References: <201712241945.vBOJjGV5051696@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201712241945.vBOJjGV5051696@repo.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Dec 2017 17:49:57 -0000 On Sun, Dec 24, 2017 at 07:45:16PM +0000, Mark Johnston wrote: > Author: markj > Date: Sun Dec 24 19:45:16 2017 > New Revision: 327168 > URL: https://svnweb.freebsd.org/changeset/base/327168 > > Log: > Fix two problems with the page daemon control loop. > > Both issues caused the page daemon to erroneously go to sleep when > applications are consuming free pages at a high rate, leaving the > application threads blocked in VM_WAIT. > > 1) After completing an inactive queue scan, concurrent allocations may > have prevented the page daemon from meeting the v_free_min threshold. > In this case, the page daemon was going to sleep even when the > inactive queue contained plenty of clean pages. > 2) pagedaemon_wakeup() may be called without the free queues lock held. > This can lead to a lost wakeup if a call occurs after the page daemon > clears vm_pageout_wanted but before going to sleep. > > Fix 1) by ensuring that we start a new inactive queue scan immediately > if v_free_count < v_free_min after a prior scan. > > Fix 2) by adding a new subroutine, pagedaemon_wait(), called from > vm_wait() and vm_waitpfault(). It wakes up the page daemon if either > vm_pages_needed or vm_pageout_wanted is false, and atomically sleeps > on v_free_count. > > Reported by: jeff > Reviewed by: alc > MFC after: 2 weeks > Differential Revision: https://reviews.freebsd.org/D13424 > > Modified: > head/sys/vm/vm_page.c > head/sys/vm/vm_pageout.c > head/sys/vm/vm_pageout.h > I now see threads blocked in VM_WAIT? https://people.freebsd.org/~pho/stress/log/mark013.txt - Peter From owner-svn-src-all@freebsd.org Mon Dec 25 18:56:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0A09E9FE65; Mon, 25 Dec 2017 18:56:09 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 68CEC6E7A4; Mon, 25 Dec 2017 18:56:09 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBPIu8fJ032818; Mon, 25 Dec 2017 18:56:08 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBPIu8av032814; Mon, 25 Dec 2017 18:56:08 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712251856.vBPIu8av032814@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 25 Dec 2017 18:56:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327177 - in head/usr.sbin: . devmatch X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/usr.sbin: . devmatch X-SVN-Commit-Revision: 327177 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Dec 2017 18:56:09 -0000 Author: imp Date: Mon Dec 25 18:56:08 2017 New Revision: 327177 URL: https://svnweb.freebsd.org/changeset/base/327177 Log: Match unattached devices on the system to potential kernel modules. devmatch(8) matchs up devices in the system device tree with drivers that may match them. For each unattached device in the system, it tries to find matching PNP info in the linker hints and prints modules to load to claim the devices. In --unbound mode, devmatch can look for drivers that have attached to devices in the device tree and have plug and play information, but for which no PNP info exists. This helps find drivers that haven't been converted yet that are in use on this system. In addition, the ability to dump out linker.hints is provided. Future commits will add hooks to devd.conf and rc.d to fully automate using this information. Added: head/usr.sbin/devmatch/ head/usr.sbin/devmatch/Makefile (contents, props changed) head/usr.sbin/devmatch/devmatch.8 (contents, props changed) head/usr.sbin/devmatch/devmatch.c (contents, props changed) Modified: head/usr.sbin/Makefile Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Mon Dec 25 16:40:09 2017 (r327176) +++ head/usr.sbin/Makefile Mon Dec 25 18:56:08 2017 (r327177) @@ -21,6 +21,7 @@ SUBDIR= adduser \ dconschat \ devctl \ devinfo \ + devmath \ digictl \ diskinfo \ dumpcis \ Added: head/usr.sbin/devmatch/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/devmatch/Makefile Mon Dec 25 18:56:08 2017 (r327177) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +PROG= devmatch +MAN= devmatch.8 + +LIBADD= devinfo + +.include Added: head/usr.sbin/devmatch/devmatch.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/devmatch/devmatch.8 Mon Dec 25 18:56:08 2017 (r327177) @@ -0,0 +1,85 @@ +.\" +.\" Copyright (c) 2017 Netflix, Inc +.\" +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 December 25, 2017 +.Dt DEVMATCH 8 +.Os +.Sh NAME +.Nm devinfo +.Nd print information about unattached devices +.Sh SYNOPSIS +.Nm +.Op Fl aduv +.Op Fl -all +.Op Fl -dump +.Op Fl -unbound +.Op Fl -verbose +.Sh DESCRIPTION +The +.Nm +utility, without any arguments, prints all the kernel modules it has +found for all the unattached, enabled devices in the system. +.Bl -tag -width 20m +.It Fl a Fl -all +Include all devices, not just the ones that are unattached. +.It Fl d Fl -dump +Produce a human readable dump of the +.Pa linker.hints +file. +.It Fl u Fl -unbound +Attempt to produce a list of those drivers with PNP info whose driver +tables with that PNP info can't be found. +.It Fl v Fl -verbose +Produce more verbose output. +.El +.Sh SEE ALSO +.Xr devinfo 8 +.Sh BUGS +The kernel has hints in it, but we exclude it from the list of modules +to suggest for unmatched devices. +We exclude it when suggesting drivers, but include it when looking for +unbound devices or producing a full dump of +.Pa linker.hints . +This can be confusing. +.Pp +Some modules are hard links in +.Pa /boot/kernel +and will be reported twice. +.Pp +The PNP string's attributes are evaluated once per PNP entry on that +bus rather than once. +.Pp +The term PNP is overloaded in FreeBSD. +It means, generically, the identifying data the bus provides about a +device. +While this include old ISA PNP identifiers, it also includes the +logical equivalent in USB, PCI, and others. +.Pp +Many drivers currently lack proper PNP table decorations and need to +be updated. +.Sh AUTHORS +.An Warner Losh Aq Mt imp@FreeBSD.org Added: head/usr.sbin/devmatch/devmatch.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/devmatch/devmatch.c Mon Dec 25 18:56:08 2017 (r327177) @@ -0,0 +1,425 @@ +/*- + * Copyright (c) 2017 Netflix, Inc + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 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 + +/* options descriptor */ +static struct option longopts[] = { + { "all", no_argument, NULL, 'a' }, + { "dump", no_argument, NULL, 'd' }, + { "unbound", no_argument, NULL, 'u' }, + { "verbose", no_argument, NULL, 'v' }, + { NULL, 0, NULL, 0 } +}; + +static int all_flag; +static int dump_flag; +static int unbound_flag; +static int verbose_flag; + +static void *hints; +static void *hints_end; + +static void +read_linker_hints(void) +{ + char fn[MAXPATHLEN]; + struct stat sb; + char *modpath, *p, *q; + size_t buflen; + int fd; + + if (sysctlbyname("kern.module_path", NULL, &buflen, NULL, 0) < 0) + errx(1, "Can't find kernel module path."); + modpath = malloc(buflen); + if (modpath == NULL) + err(1, "Can't get memory for modpath."); + if (sysctlbyname("kern.module_path", modpath, &buflen, NULL, 0) < 0) + errx(1, "Can't find kernel module path."); + p = modpath; + while ((q = strsep(&p, ";")) != NULL) { + snprintf(fn, sizeof(fn), "%s/linker.hints", q); + if (stat(fn, &sb) != 0) + continue; + hints = malloc(sb.st_size); + if (hints == NULL) + err(1, "not enough space to read hints file of %ju bytes", (uintmax_t)sb.st_size); + fd = open(fn, O_RDONLY); + if (fd < 0) + err(1, "Can't open %s for reading", fn); + if (read(fd, hints, sb.st_size) != sb.st_size) + err(1, "Can't read in %ju bytes from %s", (uintmax_t)sb.st_size, fn); + close(fd); + break; + } + if (q == NULL) { + warnx("Can't read linker hints file."); + free(hints); + hints = NULL; + } + if (*(int *)(intptr_t)hints != LINKER_HINTS_VERSION) { + warnx("Linker hints version %d doesn't match expected %d.", + *(int *)(intptr_t)hints, LINKER_HINTS_VERSION); + free(hints); + hints = NULL; + } + if (hints != NULL) + hints_end = (void *)((intptr_t)hints + (intptr_t)sb.st_size); +} + +static int +getint(void **ptr) +{ + int *p = *ptr; + int rv; + + p = (int *)roundup2((intptr_t)p, sizeof(int)); + rv = *p++; + *ptr = p; + return rv; +} + +static void +getstr(void **ptr, char *val) +{ + int *p = *ptr; + char *c = (char *)p; + int len = *(uint8_t *)c; + + memcpy(val, c + 1, len); + val[len] = 0; + c += len + 1; + *ptr = (void *)c; +} + +static int +pnpval_as_int(const char *val, const char *pnpinfo) +{ + int rv; + char key[256]; + char *cp; + + if (pnpinfo == NULL) + return -1; + + cp = strchr(val, ';'); + key[0] = ' '; + if (cp == NULL) + strcpy(key + 1, val); + else { + memcpy(key + 1, val, cp - val); + key[cp - val + 1] = '\0'; + } + strcat(key, "="); + if (strncmp(key + 1, pnpinfo, strlen(key + 1)) == 0) + rv = strtol(pnpinfo + strlen(key + 1), NULL, 0); + else { + cp = strstr(pnpinfo, key); + if (cp == NULL) + rv = -1; + else + rv = strtol(cp + strlen(key), NULL, 0); + } + return rv; +} + +static void +quoted_strcpy(char *dst, const char *src) +{ + char q = ' '; + + if (*src == '\'' || *src == '"') + q = *src++; + while (*src && *src != q) + *dst++ = *src++; // XXX backtick quoting + *dst++ = '\0'; + // XXX overflow +} + +static char * +pnpval_as_str(const char *val, const char *pnpinfo) +{ + static char retval[256]; + char key[256]; + char *cp; + + if (pnpinfo == NULL) { + *retval = '\0'; + return retval; + } + + cp = strchr(val, ';'); + key[0] = ' '; + if (cp == NULL) + strcpy(key + 1, val); + else { + memcpy(key + 1, val, cp - val); + key[cp - val + 1] = '\0'; + } + strcat(key, "="); + if (strncmp(key + 1, pnpinfo, strlen(key + 1)) == 0) + quoted_strcpy(retval, pnpinfo + strlen(key + 1)); + else { + cp = strstr(pnpinfo, key); + if (cp == NULL) + strcpy(retval, "MISSING"); + else + quoted_strcpy(retval, cp + strlen(key)); + } + return retval; +} + +static void +search_hints(const char *bus, const char *dev, const char *pnpinfo) +{ + char val1[256], val2[256]; + int ival, len, ents, i, notme, mask, bit, v, found; + void *ptr, *walker; + char *lastmod = NULL, *cp, *s; + + walker = hints; + getint(&walker); + found = 0; + while (walker < hints_end) { + len = getint(&walker); + ival = getint(&walker); + ptr = walker; + switch (ival) { + case MDT_VERSION: + getstr(&ptr, val1); + ival = getint(&ptr); + getstr(&ptr, val2); + if (dump_flag) + printf("Version: if %s.%d kmod %s\n", val1, ival, val2); + break; + case MDT_MODULE: + getstr(&ptr, val1); + getstr(&ptr, val2); + if (lastmod) + free(lastmod); + lastmod = strdup(val2); + if (dump_flag) + printf("Module %s in %s\n", val1, val2); + break; + case MDT_PNP_INFO: + if (!dump_flag && !unbound_flag && strcmp(lastmod, "kernel") == 0) + break; + getstr(&ptr, val1); + getstr(&ptr, val2); + ents = getint(&ptr); + if (bus && strcmp(val1, bus) != 0) + break; + if (dump_flag) + printf("PNP info for bus %s format %s %d entries (%s)\n", + val1, val2, ents, lastmod); + for (i = 0; i < ents; i++) { + if (dump_flag) + printf(" "); + cp = val2; + notme = 0; + mask = -1; + bit = -1; + do { + switch (*cp) { + case 'I': + case 'J': + case 'G': + case 'L': + case 'M': + ival = getint(&ptr); + if (dump_flag) { + printf("%#x:", ival); + break; + } + if (bit >= 0 && ((1 << bit) & mask) == 0) + break; + v = pnpval_as_int(cp + 2, pnpinfo); + switch (*cp) { + case 'J': + if (ival == -1) + break; + /*FALLTHROUGH*/ + case 'I': + if (v != ival && ival != 0) + notme++; + break; + case 'G': + if (v < ival) + notme++; + break; + case 'L': + if (v > ival) + notme++; + break; + case 'M': + mask = ival; + break; + } + break; + case 'D': + case 'Z': + getstr(&ptr, val1); + if (dump_flag) { + printf("'%s':", val1); + break; + } + if (*cp == 'D') + break; + s = pnpval_as_str(cp + 2, pnpinfo); + if (strcmp(s, val1) != 0) + notme++; + break; + default: + break; + } + bit++; + cp = strchr(cp, ';'); + if (cp) + cp++; + } while (cp && *cp); + if (dump_flag) + printf("\n"); + else if (!notme) { + if (!unbound_flag) { + if (all_flag) + printf("%s: ", *dev ? dev : "unattahed" ); + printf("%s\n", lastmod); + } + found++; + } + } + break; + default: + if (dump_flag) + printf("Unknown Type %d len %d\n", ival, len); + break; + } + walker = (void *)(len - sizeof(int) + (intptr_t)walker); + } + if (unbound_flag && found == 0 && *pnpinfo) { + if (verbose_flag) + printf("------------------------- "); + printf("%s on %s pnpinfo %s", *dev ? dev : "unattahed", bus, pnpinfo); + if (verbose_flag) + printf(" -------------------------"); + printf("\n"); + } +} + +static int +find_unmatched(struct devinfo_dev *dev, void *arg) +{ + struct devinfo_dev *parent; + char *bus, *p; + + do { + if (!all_flag && dev->dd_name[0] != '\0') + break; + if (!(dev->dd_flags & DF_ENABLED)) + break; + parent = devinfo_handle_to_device(dev->dd_parent); + bus = strdup(parent->dd_name); + p = bus + strlen(bus) - 1; + while (p >= bus && isdigit(*p)) + p--; + *++p = '\0'; + if (verbose_flag) + printf("Searching %s %s bus at %s for pnpinfo %s\n", + dev->dd_name, bus, dev->dd_location, dev->dd_pnpinfo); + search_hints(bus, dev->dd_name, dev->dd_pnpinfo); + free(bus); + } while (0); + + return (devinfo_foreach_device_child(dev, find_unmatched, arg)); +} + +static void +usage(void) +{ + + errx(1, "devmatch [-adv]"); +} + +int +main(int argc, char **argv) +{ + struct devinfo_dev *root; + int ch; + + while ((ch = getopt_long(argc, argv, "aduv", + longopts, NULL)) != -1) { + switch (ch) { + case 'a': + all_flag++; + break; + case 'd': + dump_flag++; + break; + case 'u': + unbound_flag++; + break; + case 'v': + verbose_flag++; + break; + default: + usage(); + } + } + argc -= optind; + argv += optind; + + if (argc >= 1) + usage(); + + read_linker_hints(); + if (dump_flag) { + search_hints(NULL, NULL, NULL); + exit(0); + } + + if (devinfo_init()) + err(1, "devinfo_init"); + if ((root = devinfo_handle_to_device(DEVINFO_ROOT_DEVICE)) == NULL) + errx(1, "can't find root device"); + devinfo_foreach_device_child(root, find_unmatched, (void *)0); + devinfo_free(); +} From owner-svn-src-all@freebsd.org Mon Dec 25 19:08:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56861EA0B5A; Mon, 25 Dec 2017 19:08:40 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 241276F2EF; Mon, 25 Dec 2017 19:08:40 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBPJ8dHZ037740; Mon, 25 Dec 2017 19:08:39 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBPJ8d2n037739; Mon, 25 Dec 2017 19:08:39 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712251908.vBPJ8d2n037739@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 25 Dec 2017 19:08:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327178 - head/usr.sbin X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.sbin X-SVN-Commit-Revision: 327178 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Dec 2017 19:08:40 -0000 Author: imp Date: Mon Dec 25 19:08:39 2017 New Revision: 327178 URL: https://svnweb.freebsd.org/changeset/base/327178 Log: Doh! Never test in one tree and commit from another: Fix typo: devmath -> devmatch Sponsored by: Krampus! Carting off naughty committers for millennia Modified: head/usr.sbin/Makefile Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Mon Dec 25 18:56:08 2017 (r327177) +++ head/usr.sbin/Makefile Mon Dec 25 19:08:39 2017 (r327178) @@ -21,7 +21,7 @@ SUBDIR= adduser \ dconschat \ devctl \ devinfo \ - devmath \ + devmatch \ digictl \ diskinfo \ dumpcis \ From owner-svn-src-all@freebsd.org Mon Dec 25 19:11:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4AAE4EA0EE7; Mon, 25 Dec 2017 19:11:18 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BE9D66F52B; Mon, 25 Dec 2017 19:11:17 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from thor.intern.walstatt.dynvpn.de ([77.179.219.206]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MEXHd-1eiiUi11Y1-00FleR; Mon, 25 Dec 2017 20:06:01 +0100 Date: Mon, 25 Dec 2017 20:05:27 +0100 From: "O. Hartmann" To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327177 - in head/usr.sbin: . devmatch Message-ID: <20171225200554.71a71213@thor.intern.walstatt.dynvpn.de> In-Reply-To: <201712251856.vBPIu8av032814@repo.freebsd.org> References: <201712251856.vBPIu8av032814@repo.freebsd.org> Organization: WALSTATT User-Agent: OutScare 3.1415926 X-Operating-System: ImNotAnOperatingSystem 3.141592527 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/WkbZv=7gKi.w6jObxPedIQs"; protocol="application/pgp-signature" X-Provags-ID: V03:K0:razmKxwOerUsxsbklmd6GDbWoE0joQ7HAHjhoS0dZ09lIGXR6vq M39R2qGCBpgYn/4NIVvj1MHI/Wchu/nqEEe9DN4mkdR4gepTJvj74q9SlnGMxUNIEEpGlqO /L++yAibfMOmR9adkeXsnU8t402DEn47A6TN65EPPhQyMGRlSXZcldHiNhE/VBb3hng8s9P 0IHDUxdPgtnOM8Xau53KA== X-UI-Out-Filterresults: notjunk:1;V01:K0:H0HJHBZwk8Y=:xWaavrJTFBsMCOMmw/fJ4t uNzQ4Aq4eUCjxpYc9X7FotbKoBo/oSo5TWEn568Dru+omWHU9/fsWRq4NIeOUBT044HX+bsgL oR6/A9EWZsMOemGPwPcVGeaS5jtOzW6klVlH2NT6oQzgLMT4J1yYp+5ilz7EGGkM+l48Pe/Y8 H4ACetigasccoGlCh7eJAkekMa9hWrdj0M0t+sbDLzMVe2QF33mVFOxDxbfF5qqdC9dWBNMB0 jFhot3+yCxtm8gGlSoVebiZzP8x002UEvi/E5PHaHZ60hSEEQaRdzyRuTkjyC+roLmA+KG6So aeKKMG0Ubcn9aCmWiLPG2CfktguLS+70hUTr7HvCjr4RBy0za2EpjGAhAsxwfbMKpZxkTiLRm cGHEYzx8sFSlquUVAuid78HoYyJd9aiuZnE7n8TQfGhqbEXhg4txZxj+tzaqSIhTzzpA9gxGP kJX44d6NLKKVTg5iyzfejMjPeAXgW1KaORPBXrTIGDeIEOdLeKLIiforfthklqs6GtlFnlcLf eQnkAsshFiZhQbJsFREKnsd4Pk4or3mvpJwOVPpdMqKbj7S2htQ0dfdFgIL2NI4wAIi9KtHno QbGOj9eqpAPejgs7z5/YicKbUGSk1Gfic0VOWEYi4cpszUqJU32rUtmEXftCbtu61rl2besX6 B8hBdotISVwIi7qIFYBJtZoyV6PRkuaUucUSHMjAD4+kHwmg2+aurvUAFoAgCNG75LIGNT6wO 0OXA7I7KugP3dL4ii3GHEImcSocb9seWWEkqLvMtFgMQe+YrPct0jjlSjuyWRf7k/0ptAZjSY fRi9/puZzV7yZ8cldd8xVmmtanFSg== X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Dec 2017 19:11:18 -0000 --Sig_/WkbZv=7gKi.w6jObxPedIQs Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Am Mon, 25 Dec 2017 18:56:08 +0000 (UTC) Warner Losh schrieb: > Author: imp > Date: Mon Dec 25 18:56:08 2017 > New Revision: 327177 > URL: https://svnweb.freebsd.org/changeset/base/327177 >=20 > Log: > Match unattached devices on the system to potential kernel modules. > =20 > devmatch(8) matchs up devices in the system device tree with drivers > that may match them. For each unattached device in the system, it > tries to find matching PNP info in the linker hints and prints modules > to load to claim the devices. > =20 > In --unbound mode, devmatch can look for drivers that have attached to > devices in the device tree and have plug and play information, but for > which no PNP info exists. This helps find drivers that haven't been > converted yet that are in use on this system. > =20 > In addition, the ability to dump out linker.hints is provided. > =20 > Future commits will add hooks to devd.conf and rc.d to fully automate > using this information. >=20 > Added: > head/usr.sbin/devmatch/ > head/usr.sbin/devmatch/Makefile (contents, props changed) > head/usr.sbin/devmatch/devmatch.8 (contents, props changed) > head/usr.sbin/devmatch/devmatch.c (contents, props changed) > Modified: > head/usr.sbin/Makefile >=20 > Modified: head/usr.sbin/Makefile > =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/usr.sbin/Makefile Mon Dec 25 16:40:09 2017 (r327176) > +++ head/usr.sbin/Makefile Mon Dec 25 18:56:08 2017 (r327177) > @@ -21,6 +21,7 @@ SUBDIR=3D adduser \ > dconschat \ > devctl \ > devinfo \ > + devmath \ > digictl \ > diskinfo \ > dumpcis \ >=20 > Added: head/usr.sbin/devmatch/Makefile > =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 > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/usr.sbin/devmatch/Makefile Mon Dec 25 18:56:08 2017 (r327177) > @@ -0,0 +1,8 @@ > +# $FreeBSD$ > + > +PROG=3D devmatch > +MAN=3D devmatch.8 > + > +LIBADD=3D devinfo > + > +.include >=20 > Added: head/usr.sbin/devmatch/devmatch.8 > =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 > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/usr.sbin/devmatch/devmatch.8 Mon Dec 25 18:56:08 2017 (r327177) > @@ -0,0 +1,85 @@ > +.\" > +.\" Copyright (c) 2017 Netflix, Inc > +.\" > +.\" All rights reserved. > +.\" > +.\" Redistribution and use in source and binary forms, with or without > +.\" modification, are permitted provided that the following conditions > +.\" are met: > +.\" 1. Redistributions of source code must retain the above copyright > +.\" notice, this list of conditions and the following disclaimer. > +.\" 2. Redistributions in binary form must reproduce the above copyright > +.\" notice, this list of conditions and the following disclaimer in t= he > +.\" documentation and/or other materials provided with the distributi= on. > +.\" > +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR > +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRA= NTIES > +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIM= ED. > +.\" IN NO EVENT SHALL THE AUTHORS 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 US= E OF > +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > +.\" > +.\" $FreeBSD$ > +.\" > +.Dd December 25, 2017 > +.Dt DEVMATCH 8 > +.Os > +.Sh NAME > +.Nm devinfo > +.Nd print information about unattached devices > +.Sh SYNOPSIS > +.Nm > +.Op Fl aduv > +.Op Fl -all > +.Op Fl -dump > +.Op Fl -unbound > +.Op Fl -verbose > +.Sh DESCRIPTION > +The > +.Nm > +utility, without any arguments, prints all the kernel modules it has > +found for all the unattached, enabled devices in the system. > +.Bl -tag -width 20m > +.It Fl a Fl -all > +Include all devices, not just the ones that are unattached. > +.It Fl d Fl -dump > +Produce a human readable dump of the > +.Pa linker.hints > +file. > +.It Fl u Fl -unbound > +Attempt to produce a list of those drivers with PNP info whose driver > +tables with that PNP info can't be found. > +.It Fl v Fl -verbose > +Produce more verbose output. > +.El > +.Sh SEE ALSO > +.Xr devinfo 8 > +.Sh BUGS > +The kernel has hints in it, but we exclude it from the list of modules > +to suggest for unmatched devices. > +We exclude it when suggesting drivers, but include it when looking for > +unbound devices or producing a full dump of > +.Pa linker.hints . > +This can be confusing. > +.Pp > +Some modules are hard links in > +.Pa /boot/kernel > +and will be reported twice. > +.Pp > +The PNP string's attributes are evaluated once per PNP entry on that > +bus rather than once. > +.Pp > +The term PNP is overloaded in FreeBSD. > +It means, generically, the identifying data the bus provides about a > +device. > +While this include old ISA PNP identifiers, it also includes the > +logical equivalent in USB, PCI, and others. > +.Pp > +Many drivers currently lack proper PNP table decorations and need to > +be updated. > +.Sh AUTHORS > +.An Warner Losh Aq Mt imp@FreeBSD.org >=20 > Added: head/usr.sbin/devmatch/devmatch.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 > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/usr.sbin/devmatch/devmatch.c Mon Dec 25 18:56:08 2017 (r327177) > @@ -0,0 +1,425 @@ > +/*- > + * Copyright (c) 2017 Netflix, Inc > + * All rights reserved. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distributio= n. > + * > + * 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 PU= RPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIAB= LE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUE= NTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOO= DS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, S= TRICT > + * 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 > + > +/* options descriptor */ > +static struct option longopts[] =3D { > + { "all", no_argument, NULL, 'a' }, > + { "dump", no_argument, NULL, 'd' }, > + { "unbound", no_argument, NULL, 'u' }, > + { "verbose", no_argument, NULL, 'v' }, > + { NULL, 0, NULL, 0 } > +}; > + > +static int all_flag; > +static int dump_flag; > +static int unbound_flag; > +static int verbose_flag; > + > +static void *hints; > +static void *hints_end; > + > +static void > +read_linker_hints(void) > +{ > + char fn[MAXPATHLEN]; > + struct stat sb; > + char *modpath, *p, *q; > + size_t buflen; > + int fd; > + > + if (sysctlbyname("kern.module_path", NULL, &buflen, NULL, 0) < 0) > + errx(1, "Can't find kernel module path."); > + modpath =3D malloc(buflen); > + if (modpath =3D=3D NULL) > + err(1, "Can't get memory for modpath."); > + if (sysctlbyname("kern.module_path", modpath, &buflen, NULL, 0) < 0) > + errx(1, "Can't find kernel module path."); > + p =3D modpath; > + while ((q =3D strsep(&p, ";")) !=3D NULL) { > + snprintf(fn, sizeof(fn), "%s/linker.hints", q); > + if (stat(fn, &sb) !=3D 0) > + continue; > + hints =3D malloc(sb.st_size); > + if (hints =3D=3D NULL) > + err(1, "not enough space to read hints file of %ju bytes", > (uintmax_t)sb.st_size); > + fd =3D open(fn, O_RDONLY); > + if (fd < 0) > + err(1, "Can't open %s for reading", fn); > + if (read(fd, hints, sb.st_size) !=3D sb.st_size) > + err(1, "Can't read in %ju bytes from %s", > (uintmax_t)sb.st_size, fn); > + close(fd); > + break; > + } > + if (q =3D=3D NULL) { > + warnx("Can't read linker hints file."); > + free(hints); > + hints =3D NULL; > + } > + if (*(int *)(intptr_t)hints !=3D LINKER_HINTS_VERSION) { > + warnx("Linker hints version %d doesn't match expected %d.", > + *(int *)(intptr_t)hints, LINKER_HINTS_VERSION); > + free(hints); > + hints =3D NULL; > + } > + if (hints !=3D NULL) > + hints_end =3D (void *)((intptr_t)hints + (intptr_t)sb.st_size); > +} > + > +static int > +getint(void **ptr) > +{ > + int *p =3D *ptr; > + int rv; > + > + p =3D (int *)roundup2((intptr_t)p, sizeof(int)); > + rv =3D *p++; > + *ptr =3D p; > + return rv; > +} > + > +static void > +getstr(void **ptr, char *val) > +{ > + int *p =3D *ptr; > + char *c =3D (char *)p; > + int len =3D *(uint8_t *)c; > + > + memcpy(val, c + 1, len); > + val[len] =3D 0; > + c +=3D len + 1; > + *ptr =3D (void *)c; > +} > + > +static int > +pnpval_as_int(const char *val, const char *pnpinfo) > +{ > + int rv; > + char key[256]; > + char *cp; > + > + if (pnpinfo =3D=3D NULL) > + return -1; > + > + cp =3D strchr(val, ';'); > + key[0] =3D ' '; > + if (cp =3D=3D NULL) > + strcpy(key + 1, val); > + else { > + memcpy(key + 1, val, cp - val); > + key[cp - val + 1] =3D '\0'; > + } > + strcat(key, "=3D"); > + if (strncmp(key + 1, pnpinfo, strlen(key + 1)) =3D=3D 0) > + rv =3D strtol(pnpinfo + strlen(key + 1), NULL, 0); > + else { > + cp =3D strstr(pnpinfo, key); > + if (cp =3D=3D NULL) > + rv =3D -1; > + else > + rv =3D strtol(cp + strlen(key), NULL, 0); > + } > + return rv; > +} > + > +static void > +quoted_strcpy(char *dst, const char *src) > +{ > + char q =3D ' '; > + > + if (*src =3D=3D '\'' || *src =3D=3D '"') > + q =3D *src++; > + while (*src && *src !=3D q) > + *dst++ =3D *src++; // XXX backtick quoting > + *dst++ =3D '\0'; > + // XXX overflow > +} > + > +static char * > +pnpval_as_str(const char *val, const char *pnpinfo) > +{ > + static char retval[256]; > + char key[256]; > + char *cp; > + > + if (pnpinfo =3D=3D NULL) { > + *retval =3D '\0'; > + return retval; > + } > + > + cp =3D strchr(val, ';'); > + key[0] =3D ' '; > + if (cp =3D=3D NULL) > + strcpy(key + 1, val); > + else { > + memcpy(key + 1, val, cp - val); > + key[cp - val + 1] =3D '\0'; > + } > + strcat(key, "=3D"); > + if (strncmp(key + 1, pnpinfo, strlen(key + 1)) =3D=3D 0) > + quoted_strcpy(retval, pnpinfo + strlen(key + 1)); > + else { > + cp =3D strstr(pnpinfo, key); > + if (cp =3D=3D NULL) > + strcpy(retval, "MISSING"); > + else > + quoted_strcpy(retval, cp + strlen(key)); > + } > + return retval; > +} > + > +static void > +search_hints(const char *bus, const char *dev, const char *pnpinfo) > +{ > + char val1[256], val2[256]; > + int ival, len, ents, i, notme, mask, bit, v, found; > + void *ptr, *walker; > + char *lastmod =3D NULL, *cp, *s; > + > + walker =3D hints; > + getint(&walker); > + found =3D 0; > + while (walker < hints_end) { > + len =3D getint(&walker); > + ival =3D getint(&walker); > + ptr =3D walker; > + switch (ival) { > + case MDT_VERSION: > + getstr(&ptr, val1); > + ival =3D getint(&ptr); > + getstr(&ptr, val2); > + if (dump_flag) > + printf("Version: if %s.%d kmod %s\n", val1, ival, > val2); > + break; > + case MDT_MODULE: > + getstr(&ptr, val1); > + getstr(&ptr, val2); > + if (lastmod) > + free(lastmod); > + lastmod =3D strdup(val2); > + if (dump_flag) > + printf("Module %s in %s\n", val1, val2); > + break; > + case MDT_PNP_INFO: > + if (!dump_flag && !unbound_flag && strcmp(lastmod, "kernel") > =3D=3D 0) > + break; > + getstr(&ptr, val1); > + getstr(&ptr, val2); > + ents =3D getint(&ptr); > + if (bus && strcmp(val1, bus) !=3D 0) > + break; > + if (dump_flag) > + printf("PNP info for bus %s format %s %d entries > (%s)\n", > + val1, val2, ents, lastmod); > + for (i =3D 0; i < ents; i++) { > + if (dump_flag) > + printf(" "); > + cp =3D val2; > + notme =3D 0; > + mask =3D -1; > + bit =3D -1; > + do { > + switch (*cp) { > + case 'I': > + case 'J': > + case 'G': > + case 'L': > + case 'M': > + ival =3D getint(&ptr); > + if (dump_flag) { > + printf("%#x:", ival); > + break; > + } > + if (bit >=3D 0 && ((1 << bit) & mask) =3D=3D > 0) > + break; > + v =3D pnpval_as_int(cp + 2, pnpinfo); > + switch (*cp) { > + case 'J': > + if (ival =3D=3D -1) > + break; > + /*FALLTHROUGH*/ > + case 'I': > + if (v !=3D ival && ival !=3D 0) > + notme++; > + break; > + case 'G': > + if (v < ival) > + notme++; > + break; > + case 'L': > + if (v > ival) > + notme++; > + break; > + case 'M': > + mask =3D ival; > + break; > + } > + break; > + case 'D': > + case 'Z': > + getstr(&ptr, val1); > + if (dump_flag) { > + printf("'%s':", val1); > + break; > + } > + if (*cp =3D=3D 'D') > + break; > + s =3D pnpval_as_str(cp + 2, pnpinfo); > + if (strcmp(s, val1) !=3D 0) > + notme++; > + break; > + default: > + break; > + } > + bit++; > + cp =3D strchr(cp, ';'); > + if (cp) > + cp++; > + } while (cp && *cp); > + if (dump_flag) > + printf("\n"); > + else if (!notme) { > + if (!unbound_flag) { > + if (all_flag) > + printf("%s: ", *dev ? dev : > "unattahed" ); > + printf("%s\n", lastmod); > + } > + found++; > + } > + } > + break; > + default: > + if (dump_flag) > + printf("Unknown Type %d len %d\n", ival, len); > + break; > + } > + walker =3D (void *)(len - sizeof(int) + (intptr_t)walker); > + } > + if (unbound_flag && found =3D=3D 0 && *pnpinfo) { > + if (verbose_flag) > + printf("------------------------- "); > + printf("%s on %s pnpinfo %s", *dev ? dev : "unattahed", bus, pnpinfo); > + if (verbose_flag) > + printf(" -------------------------"); > + printf("\n"); > + } > +} > + > +static int > +find_unmatched(struct devinfo_dev *dev, void *arg) > +{ > + struct devinfo_dev *parent; > + char *bus, *p; > + > + do { > + if (!all_flag && dev->dd_name[0] !=3D '\0') > + break; > + if (!(dev->dd_flags & DF_ENABLED)) > + break; > + parent =3D devinfo_handle_to_device(dev->dd_parent); > + bus =3D strdup(parent->dd_name); > + p =3D bus + strlen(bus) - 1; > + while (p >=3D bus && isdigit(*p)) > + p--; > + *++p =3D '\0'; > + if (verbose_flag) > + printf("Searching %s %s bus at %s for pnpinfo %s\n", > + dev->dd_name, bus, dev->dd_location, dev->dd_pnpinfo); > + search_hints(bus, dev->dd_name, dev->dd_pnpinfo); > + free(bus); > + } while (0); > + > + return (devinfo_foreach_device_child(dev, find_unmatched, arg)); > +} > + > +static void > +usage(void) > +{ > + > + errx(1, "devmatch [-adv]"); > +} > + > +int > +main(int argc, char **argv) > +{ > + struct devinfo_dev *root; > + int ch; > + > + while ((ch =3D getopt_long(argc, argv, "aduv", > + longopts, NULL)) !=3D -1) { > + switch (ch) { > + case 'a': > + all_flag++; > + break; > + case 'd': > + dump_flag++; > + break; > + case 'u': > + unbound_flag++; > + break; > + case 'v': > + verbose_flag++; > + break; > + default: > + usage(); > + } > + } > + argc -=3D optind; > + argv +=3D optind; > + > + if (argc >=3D 1) > + usage(); > + > + read_linker_hints(); > + if (dump_flag) { > + search_hints(NULL, NULL, NULL); > + exit(0); > + } > + > + if (devinfo_init()) > + err(1, "devinfo_init"); > + if ((root =3D devinfo_handle_to_device(DEVINFO_ROOT_DEVICE)) =3D=3D NUL= L) > + errx(1, "can't find root device"); > + devinfo_foreach_device_child(root, find_unmatched, (void *)0); > + devinfo_free(); > +} > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" Well, I remeber that someone told me that "math" and "match" are different = thingis ;-) To be serious: there is some strange error ... [...] =3D=3D=3D> usr.sbin/devmath (includes) cd: /usr/src/usr.sbin/devmath: No such file or directory *** [includes_subdir_usr.sbin/devmath] Error code 2 make[3]: stopped in /usr/src/usr.sbin .ERROR_TARGET=3D'includes_subdir_usr.sbin/devmath' --=20 O. Hartmann Ich widerspreche der Nutzung oder =C3=9Cbermittlung meiner Daten f=C3=BCr Werbezwecke oder f=C3=BCr die Markt- oder Meinungsforschung (=C2=A7 28 Abs.= 4 BDSG). --Sig_/WkbZv=7gKi.w6jObxPedIQs Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iLUEARMKAB0WIQQZVZMzAtwC2T/86TrS528fyFhYlAUCWkFMEgAKCRDS528fyFhY lDmhAf0X9IoOG/6nnI0uCXCOyTVgi4EOaZwjWfaJmdVeU4Ng2QZ5zq6RiRAGWOeY u+Hk/VlZDqvS0gQGmWVdMers3TBfAf4oALvuJT9embmYzlC6hxHHDVzQhQLYrbJq QFQgUvc3x2c4USfJKaO/sWIbkdmLQV+ixkzQmeboLZEYlgYfxtCn =SYZy -----END PGP SIGNATURE----- --Sig_/WkbZv=7gKi.w6jObxPedIQs-- From owner-svn-src-all@freebsd.org Mon Dec 25 19:36:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17ED3EA227E; Mon, 25 Dec 2017 19:36:06 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D97D57012B; Mon, 25 Dec 2017 19:36:05 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBPJa4TN049938; Mon, 25 Dec 2017 19:36:04 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBPJa4qY049937; Mon, 25 Dec 2017 19:36:04 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201712251936.vBPJa4qY049937@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Mon, 25 Dec 2017 19:36:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327179 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 327179 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Dec 2017 19:36:06 -0000 Author: alc Date: Mon Dec 25 19:36:04 2017 New Revision: 327179 URL: https://svnweb.freebsd.org/changeset/base/327179 Log: Make the vm object bypass and collapse counters per CPU. Requested by: mjg Reviewed by: kib, markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D13611 Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Mon Dec 25 19:08:39 2017 (r327178) +++ head/sys/vm/vm_object.c Mon Dec 25 19:36:04 2017 (r327179) @@ -148,14 +148,25 @@ struct vm_object kernel_object_store; static SYSCTL_NODE(_vm_stats, OID_AUTO, object, CTLFLAG_RD, 0, "VM object stats"); -static long object_collapses; -SYSCTL_LONG(_vm_stats_object, OID_AUTO, collapses, CTLFLAG_RD, - &object_collapses, 0, "VM object collapses"); +static counter_u64_t object_collapses = EARLY_COUNTER; +SYSCTL_COUNTER_U64(_vm_stats_object, OID_AUTO, collapses, CTLFLAG_RD, + &object_collapses, + "VM object collapses"); -static long object_bypasses; -SYSCTL_LONG(_vm_stats_object, OID_AUTO, bypasses, CTLFLAG_RD, - &object_bypasses, 0, "VM object bypasses"); +static counter_u64_t object_bypasses = EARLY_COUNTER; +SYSCTL_COUNTER_U64(_vm_stats_object, OID_AUTO, bypasses, CTLFLAG_RD, + &object_bypasses, + "VM object bypasses"); +static void +counter_startup(void) +{ + + object_collapses = counter_u64_alloc(M_WAITOK); + object_bypasses = counter_u64_alloc(M_WAITOK); +} +SYSINIT(object_counters, SI_SUB_CPU, SI_ORDER_ANY, counter_startup, NULL); + static uma_zone_t obj_zone; static int vm_object_zinit(void *mem, int size, int flags); @@ -1875,7 +1886,7 @@ vm_object_collapse(vm_object_t object) vm_object_destroy(backing_object); vm_object_pip_wakeup(object); - object_collapses++; + counter_u64_add(object_collapses, 1); } else { /* * If we do not entirely shadow the backing object, @@ -1916,7 +1927,7 @@ vm_object_collapse(vm_object_t object) */ backing_object->ref_count--; VM_OBJECT_WUNLOCK(backing_object); - object_bypasses++; + counter_u64_add(object_bypasses, 1); } /* From owner-svn-src-all@freebsd.org Mon Dec 25 19:42:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0C7FEA26A6; Mon, 25 Dec 2017 19:42:05 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9AEA470459; Mon, 25 Dec 2017 19:42:05 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBPJg4XQ053159; Mon, 25 Dec 2017 19:42:04 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBPJg4tQ053157; Mon, 25 Dec 2017 19:42:04 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201712251942.vBPJg4tQ053157@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 25 Dec 2017 19:42:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327180 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 327180 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Dec 2017 19:42:05 -0000 Author: manu Date: Mon Dec 25 19:42:04 2017 New Revision: 327180 URL: https://svnweb.freebsd.org/changeset/base/327180 Log: aw_rtc: Add man page for this driver Reviewed by: bcr Differential Revision: https://reviews.freebsd.org/D13621 Added: head/share/man/man4/aw_rtc.4 (contents, props changed) Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Mon Dec 25 19:36:04 2017 (r327179) +++ head/share/man/man4/Makefile Mon Dec 25 19:42:04 2017 (r327180) @@ -70,6 +70,7 @@ MAN= aac.4 \ audit.4 \ auditpipe.4 \ aue.4 \ + aw_rtc.4 \ axe.4 \ axge.4 \ bce.4 \ Added: head/share/man/man4/aw_rtc.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/aw_rtc.4 Mon Dec 25 19:42:04 2017 (r327180) @@ -0,0 +1,63 @@ +.\"- +.\" Copyright (c) 2017 Emmanuel Vadot +.\" 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 Dec 25, 2017 +.Dt AW_RTC 4 +.Os +.Sh NAME +.Nm aw_rtc +.Nd driver for the RTC controller in Allwinner SoC. +.Sh DESCRIPTION +The +.Nm +device driver provides support for the Allwinner RTC controller. +.Sh HARDWARE +The current version of the +.Nm +driver supports the RTC controller with one of the following compatible +strings : +.Pp +.Bl -bullet -compact +.It +allwinner,sun4i-a10-rtc +.It +allwinner,sun7i-a20-rtc +.It +allwinner,sun6i-a31-rtc +.Re +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 11.0 . +.Sh AUTHORS +The +.Nm +device driver was written by +.An Vladimir Belian Aq Mt fate10@gmail.com . +This manual page was written by +.An Emmanuel Vadot Aq Mt manu@freebsd.org . From owner-svn-src-all@freebsd.org Mon Dec 25 19:49:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C979BEA2C4C; Mon, 25 Dec 2017 19:49:09 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9643D70803; Mon, 25 Dec 2017 19:49:09 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBPJn55Y054360; Mon, 25 Dec 2017 19:49:05 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBPJn5bQ054359; Mon, 25 Dec 2017 19:49:05 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201712251949.vBPJn5bQ054359@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Mon, 25 Dec 2017 19:49:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327181 - head/lib/libc/stdio X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/lib/libc/stdio X-SVN-Commit-Revision: 327181 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Dec 2017 19:49:09 -0000 Author: eadler Date: Mon Dec 25 19:49:05 2017 New Revision: 327181 URL: https://svnweb.freebsd.org/changeset/base/327181 Log: fsync(3): correctly document return values In r268924 the behavior of fflush was changed to return success on read only streams. Document this. Reported by: zrj@DragonFlyBSD.org Modified: head/lib/libc/stdio/fflush.3 Modified: head/lib/libc/stdio/fflush.3 ============================================================================== --- head/lib/libc/stdio/fflush.3 Mon Dec 25 19:42:04 2017 (r327180) +++ head/lib/libc/stdio/fflush.3 Mon Dec 25 19:49:05 2017 (r327181) @@ -32,7 +32,7 @@ .\" @(#)fflush.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd December 25, 2017 .Dt FFLUSH 3 .Os .Sh NAME @@ -87,9 +87,7 @@ is set to indicate the error. The .Fa stream argument -is not an open stream, or, in the case of -.Fn fflush , -not a stream open for writing. +is not an open stream. .El .Pp The function @@ -97,7 +95,12 @@ The function may also fail and set .Va errno for any of the errors specified for the routine -.Xr write 2 . +.Xr write 2 , +except that in case of +.Fa stream +being a read-only descriptor, +.Fn fflush +returns 0. .Sh SEE ALSO .Xr write 2 , .Xr fclose 3 , From owner-svn-src-all@freebsd.org Mon Dec 25 19:52:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D1B8EA3034; Mon, 25 Dec 2017 19:52:36 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk0-x244.google.com (mail-qk0-x244.google.com [IPv6:2607:f8b0:400d:c09::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E989370CFA; Mon, 25 Dec 2017 19:52:35 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qk0-x244.google.com with SMTP id q14so29141802qke.7; Mon, 25 Dec 2017 11:52:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=VVOgGleJDvSciMN/tIvCGuz1kEYQ4Mp3V7pIWDr8YQQ=; b=hDa291hHeX6feoa1tgGXHyekewZNJA7MRyijuf5sriOZrePfDHikvG55Ty/n+ZckrW UeYNHOK8NeCaZpI1ETQbdYDGNfZWbovQy/Ledaaor2ze6IIYi9sH81pdDd6tNSRaeZ99 NFS6WUM18iWxviv0sy9ZvObNuc36JRbEO4tEaBQliWGD0WHZpFeq9RsH/DUAuI4fxceE NMOkpUsqO2+91u6a5vnd7UxFbESPUqn1Bzr2ibp2ECKIN2S6kWoyhP3BMaLilJYF910A DEzHwv7tKIlnri+XAT8I6NwYIAyFO/7CdiDpes44PakDsQGgELmo8LY7rhh4NIIUz7L8 gV0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=VVOgGleJDvSciMN/tIvCGuz1kEYQ4Mp3V7pIWDr8YQQ=; b=Hex7LN3SG0riXOK/MjFRW4/rsZ695KSHXhPutgAWzq8qqPYJdTmFom9BZAC4ceSnxN SdkGKBmebE9Z7ygJHZRtXHUfXxReXx3I6DTnaNa71R6JEHK2TJa3Yaxf69bEqFOaUPSz W5+ChIEaGdoMADZDzc0DHuRp7CZRfrBI4I13/Zsm4zUxkeZbeOxblyJ+IelHpd3xjuZX PhxLm5B9NJyANbiKOdHTrGbTpqjfI4F0rRf9XtWWnuTgn+3Zk6Hufs4JaVyCvCvrzGe9 nNg2UEmHhjKBo2q+GKmZcOwVulKiONZGLoEaTYS3pGdwNNu5WyiWZchCJA4/16DuUDHN 9SYg== X-Gm-Message-State: AKGB3mLj14CARmSApyqEPaovYIMRF/hBjhmWVRmFIKA0N8dCvfGq3Npv /Q80x5kWl0u1LRnEFp0maf4TBQ== X-Google-Smtp-Source: ACJfBoswreQVH5qBghLSISZxXzQjPZ6w8Jyo7rI+n+F6LuVOsawzfmIFImeHG3rFD/xVhr5ohs7pqg== X-Received: by 10.233.222.71 with SMTP id s68mr30693255qkf.82.1514231554942; Mon, 25 Dec 2017 11:52:34 -0800 (PST) Received: from wkstn-mjohnston.west.isilon.com (c-76-104-203-143.hsd1.wa.comcast.net. [76.104.203.143]) by smtp.gmail.com with ESMTPSA id u26sm18870919qtb.1.2017.12.25.11.52.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Dec 2017 11:52:33 -0800 (PST) Sender: Mark Johnston Date: Mon, 25 Dec 2017 11:51:17 -0800 From: Mark Johnston To: Peter Holm Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327168 - head/sys/vm Message-ID: <20171225195117.GA68801@wkstn-mjohnston.west.isilon.com> References: <201712241945.vBOJjGV5051696@repo.freebsd.org> <20171225174946.GA9941@x2.osted.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171225174946.GA9941@x2.osted.lan> User-Agent: Mutt/1.9.1 (2017-09-22) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Dec 2017 19:52:36 -0000 On Mon, Dec 25, 2017 at 06:49:46PM +0100, Peter Holm wrote: > On Sun, Dec 24, 2017 at 07:45:16PM +0000, Mark Johnston wrote: > > Author: markj > > Date: Sun Dec 24 19:45:16 2017 > > New Revision: 327168 > > URL: https://svnweb.freebsd.org/changeset/base/327168 > > > > Log: > > Fix two problems with the page daemon control loop. > > > > Both issues caused the page daemon to erroneously go to sleep when > > applications are consuming free pages at a high rate, leaving the > > application threads blocked in VM_WAIT. > > > > 1) After completing an inactive queue scan, concurrent allocations may > > have prevented the page daemon from meeting the v_free_min threshold. > > In this case, the page daemon was going to sleep even when the > > inactive queue contained plenty of clean pages. > > 2) pagedaemon_wakeup() may be called without the free queues lock held. > > This can lead to a lost wakeup if a call occurs after the page daemon > > clears vm_pageout_wanted but before going to sleep. > > > > Fix 1) by ensuring that we start a new inactive queue scan immediately > > if v_free_count < v_free_min after a prior scan. > > > > Fix 2) by adding a new subroutine, pagedaemon_wait(), called from > > vm_wait() and vm_waitpfault(). It wakes up the page daemon if either > > vm_pages_needed or vm_pageout_wanted is false, and atomically sleeps > > on v_free_count. > > > > Reported by: jeff > > Reviewed by: alc > > MFC after: 2 weeks > > Differential Revision: https://reviews.freebsd.org/D13424 > > > > Modified: > > head/sys/vm/vm_page.c > > head/sys/vm/vm_pageout.c > > head/sys/vm/vm_pageout.h > > > > I now see threads blocked in VM_WAIT? > > https://people.freebsd.org/~pho/stress/log/mark013.txt Hmm, I don't see anything obviously wrong here. v_free_count is 38, well below the minimum threshold at which threads will block in VM_WAIT. The page daemon was running and vm_pages_needed is 1, which is expected. This just looks like a case of the page daemon failing to keep up with memory pressure. Do you not see threads entering VM_WAIT with this revision reverted? From owner-svn-src-all@freebsd.org Mon Dec 25 20:14:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0B89EA3F36; Mon, 25 Dec 2017 20:14:27 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B4CD37186F; Mon, 25 Dec 2017 20:14:26 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (31.89-11-148.nextgentel.com [89.11.148.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 2E709260362; Mon, 25 Dec 2017 21:14:23 +0100 (CET) Subject: Re: svn commit: r327177 - in head/usr.sbin: . devmatch To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201712251856.vBPIu8av032814@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <72cf7768-9577-24af-1635-085bca9383d1@selasky.org> Date: Mon, 25 Dec 2017 21:11:34 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <201712251856.vBPIu8av032814@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Dec 2017 20:14:28 -0000 Hi, Did you try sorting the hints, making them candidate for a binary search? I see the is a small bug hooking the utility into the parent Makefile. I guess this will be fixed soon. --HPS From owner-svn-src-all@freebsd.org Mon Dec 25 20:22:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 974E2EA4704 for ; Mon, 25 Dec 2017 20:22:03 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22c.google.com (mail-it0-x22c.google.com [IPv6:2607:f8b0:4001:c0b::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 58A9B71FF6 for ; Mon, 25 Dec 2017 20:22:03 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22c.google.com with SMTP id f190so21223556ita.5 for ; Mon, 25 Dec 2017 12:22:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=XexSCQjd1NfQzyl6MOmb6xBiH4PDq9rldCSRiu/Hjbs=; b=PbHn+0TrJEH0jjeH/j1iVMZwFwHPJAxenaZ4IQq9z3BP37RtKZRy7NRU5MlVKAP1Bm t/cx5yDO32jo3MDvP0PTl3ED/zcSVqlYoKCJ35FjkqR/Q7GYoZx4T9b7RlPwBsIlA/cD m3IvxwEtkY7TAZkVjGXAqpdJ7XhTATu52V3RSVSs1gGwf5/qIU6bNfH0rtSN0NOy21bT 0jvayIflxS57xSpNbVUNPK4lzeHmDWu11rMQMAOjTsZGdBqUMqETsIAzR3vSJc5YEcRu 9UtVYonl0/SlEqsjXu9tAitBV+a1rWZ/TusRtwiKR44eIcU/iWJ4qcwcUmBIunCBuDT5 YSJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=XexSCQjd1NfQzyl6MOmb6xBiH4PDq9rldCSRiu/Hjbs=; b=JwwvQx1tuodspnal65vmKz/oPs+xPATkmOnUZj7WdSQEhLmrTcjahgAkoMBvMRu2Y7 IuyeJKZaGcHtnGMhuAlb+uJzmlvHu8g8lF/Xj7w52KxPye+33FHq2kdNg8jwQlWowUXc Z6PNogptFE6uQh5uoMqffY2kh6YD8q9/JqLNyo0zTOxoNwMliPOfHSrq1ddu3Qo5rrfz tmO1i+K5Q/iu3SVZHtlAoxI8NthqPOtAuaVKFVvOVJ2ls9oAulqKdSvH8aGMLbV6K5nY WsRfxRbWlNrK30Mzzn2PfSAMnJMQRzMxVWeU6EH5nf73UW7tuR9FTPu6bUejhMjtgD5v DfGA== X-Gm-Message-State: AKGB3mKAx5ztBRO9slasyKiKrE65PMy8N7FYRXisphnsgmql5PCgTcs3 mC4f/UP3l+op98DPRBF4JhsiOfolbb5WpO7+dXJjWQ== X-Google-Smtp-Source: ACJfBotzOnylHViu9JRwB+wDC6tO+Ldn1NkPjtqqitKYMwG1Rr/McEwNiFknnduQDADa8bBrya1kC0/yUvD07NyLhhE= X-Received: by 10.36.133.135 with SMTP id r129mr32261694itd.69.1514233322555; Mon, 25 Dec 2017 12:22:02 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.108.204 with HTTP; Mon, 25 Dec 2017 12:22:01 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:6d84:6ad4:20b4:2721] Received: by 10.79.108.204 with HTTP; Mon, 25 Dec 2017 12:22:01 -0800 (PST) In-Reply-To: <72cf7768-9577-24af-1635-085bca9383d1@selasky.org> References: <201712251856.vBPIu8av032814@repo.freebsd.org> <72cf7768-9577-24af-1635-085bca9383d1@selasky.org> From: Warner Losh Date: Mon, 25 Dec 2017 13:22:01 -0700 X-Google-Sender-Auth: _DjVJf1Zvg1ZS1jx_S3PlrlZipk Message-ID: Subject: Re: svn commit: r327177 - in head/usr.sbin: . devmatch To: Hans Petter Selasky Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Dec 2017 20:22:03 -0000 On Dec 25, 2017 1:14 PM, "Hans Petter Selasky" wrote: Hi, Did you try sorting the hints, making them candidate for a binary search? I see the is a small bug hooking the utility into the parent Makefile. I guess this will be fixed soon. No. I've been contemplating what the best data structure to use would be since we have a number of and conditions coupled with don't care values as well as ranges. The bigger issue today is that we convert the pnp values for every single row... I wanted something working over a spped demon that wouldn't hit the tree for months... I'm hoping that this spurs the pnp table decoration in drivers... any optimization should also play well with my desire to do this for potential root devices in the boot loader... Warner From owner-svn-src-all@freebsd.org Mon Dec 25 20:54:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89631EA601B; Mon, 25 Dec 2017 20:54:02 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2716C731E7; Mon, 25 Dec 2017 20:54:02 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBPKs1LV083680; Mon, 25 Dec 2017 20:54:01 GMT (envelope-from phk@FreeBSD.org) Received: (from phk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBPKs0Zf083676; Mon, 25 Dec 2017 20:54:00 GMT (envelope-from phk@FreeBSD.org) Message-Id: <201712252054.vBPKs0Zf083676@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phk set sender to phk@FreeBSD.org using -f From: Poul-Henning Kamp Date: Mon, 25 Dec 2017 20:54:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327182 - in head/sys: arm/include arm64/include sys x86/include X-SVN-Group: head X-SVN-Commit-Author: phk X-SVN-Commit-Paths: in head/sys: arm/include arm64/include sys x86/include X-SVN-Commit-Revision: 327182 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Dec 2017 20:54:02 -0000 Author: phk Date: Mon Dec 25 20:54:00 2017 New Revision: 327182 URL: https://svnweb.freebsd.org/changeset/base/327182 Log: Introduce an architecture-agnostic to reduce platform divergence. Only architectures which pass arguments in registers (mips) and platforms which use really weird compilers (any?) would need to augment the contents of Convert x86, arm and arm64 architectures to use Added: head/sys/sys/_stdarg.h (contents, props changed) Modified: head/sys/arm/include/stdarg.h head/sys/arm64/include/stdarg.h head/sys/x86/include/stdarg.h Modified: head/sys/arm/include/stdarg.h ============================================================================== --- head/sys/arm/include/stdarg.h Mon Dec 25 19:49:05 2017 (r327181) +++ head/sys/arm/include/stdarg.h Mon Dec 25 20:54:00 2017 (r327182) @@ -1,9 +1,7 @@ /*- - * SPDX-License-Identifier: BSD-3-Clause + * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2002 David E. O'Brien. All rights reserved. - * Copyright (c) 1991, 1993 - * The Regents of the University of California. All rights reserved. + * Copyright (c) 2017 Poul-Henning Kamp. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -13,14 +11,11 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * 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 REGENTS OR CONTRIBUTORS BE LIABLE + * 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) @@ -29,55 +24,16 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)stdarg.h 8.1 (Berkeley) 6/10/93 * $FreeBSD$ */ #ifndef _MACHINE_STDARG_H_ #define _MACHINE_STDARG_H_ -#include -#include +#include -#ifndef _VA_LIST_DECLARED -#define _VA_LIST_DECLARED -typedef __va_list va_list; +#ifndef va_start + #error this file needs to be ported to your compiler #endif - -#ifdef __GNUCLIKE_BUILTIN_STDARG - -#define va_start(ap, last) \ - __builtin_va_start((ap), (last)) - -#define va_arg(ap, type) \ - __builtin_va_arg((ap), type) - -#if __ISO_C_VISIBLE >= 1999 -#define va_copy(dest, src) \ - __builtin_va_copy((dest), (src)) -#endif - -#define va_end(ap) \ - __builtin_va_end(ap) - -#else /* !__GNUCLIKE_BUILTIN_STDARG */ - -#define __va_size(type) \ - (((sizeof(type) + sizeof(int) - 1) / sizeof(int)) * sizeof(int)) - -#ifdef __GNUCLIKE_BUILTIN_NEXT_ARG -#define va_start(ap, last) \ - ((ap) = (va_list)__builtin_next_arg(last)) -#else /* !__GNUCLIKE_BUILTIN_NEXT_ARG */ -#define va_start(ap, last) \ - ((ap) = (va_list)&(last) + __va_size(last)) -#endif /* __GNUCLIKE_BUILTIN_NEXT_ARG */ - -#define va_arg(ap, type) \ - (*(type *)((ap) += __va_size(type), (ap) - __va_size(type))) - -#define va_end(ap) - -#endif /* __GNUCLIKE_BUILTIN_STDARG */ #endif /* !_MACHINE_STDARG_H_ */ Modified: head/sys/arm64/include/stdarg.h ============================================================================== --- head/sys/arm64/include/stdarg.h Mon Dec 25 19:49:05 2017 (r327181) +++ head/sys/arm64/include/stdarg.h Mon Dec 25 20:54:00 2017 (r327182) @@ -1,8 +1,8 @@ /*- - * Copyright (c) 2002 David E. O'Brien. All rights reserved. - * Copyright (c) 1991, 1993 - * The Regents of the University of California. All rights reserved. + * SPDX-License-Identifier: BSD-2-Clause * + * Copyright (c) 2017 Poul-Henning Kamp. All rights reserved. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -11,14 +11,11 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * 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 REGENTS OR CONTRIBUTORS BE LIABLE + * 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) @@ -27,41 +24,16 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)stdarg.h 8.1 (Berkeley) 6/10/93 * $FreeBSD$ */ #ifndef _MACHINE_STDARG_H_ #define _MACHINE_STDARG_H_ -#include -#include +#include -#ifndef _VA_LIST_DECLARED -#define _VA_LIST_DECLARED -typedef __va_list va_list; +#ifndef va_start + #error this file needs to be ported to your compiler #endif - -#ifdef __GNUCLIKE_BUILTIN_STDARG - -#define va_start(ap, last) \ - __builtin_va_start((ap), (last)) - -#define va_arg(ap, type) \ - __builtin_va_arg((ap), type) - -#if __ISO_C_VISIBLE >= 1999 -#define va_copy(dest, src) \ - __builtin_va_copy((dest), (src)) -#endif - -#define va_end(ap) \ - __builtin_va_end(ap) - -#else /* !__GNUCLIKE_BUILTIN_STDARG */ - -#error no support for your compiler - -#endif /* __GNUCLIKE_BUILTIN_STDARG */ #endif /* !_MACHINE_STDARG_H_ */ Added: head/sys/sys/_stdarg.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/_stdarg.h Mon Dec 25 20:54:00 2017 (r327182) @@ -0,0 +1,69 @@ +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (c) 2002 David E. O'Brien. All rights reserved. + * Copyright (c) 2017 Poul-Henning Kamp. 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 University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE 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 _SYS__STDARG_H_ +#define _SYS__STDARG_H_ + +#include +#include + +#ifndef _VA_LIST_DECLARED + #define _VA_LIST_DECLARED + typedef __va_list va_list; +#endif + +#ifdef __GNUCLIKE_BUILTIN_STDARG + #define va_start(ap, last) __builtin_va_start((ap), (last)) + #define va_arg(ap, type) __builtin_va_arg((ap), type) + #define __va_copy(dest, src) __builtin_va_copy((dest), (src)) + #if __ISO_C_VISIBLE >= 1999 + #define va_copy(dest, src) __va_copy(dest, src) + #endif +#define va_end(ap) __builtin_va_end(ap) +#endif + +#if defined(lint) && !defined(va_start) + /* + * Provide a fake implementation for lint's benefit + * This very much assumes that __va_list ends up being a pointer + */ + #define va_start(ap, last) ((void)((ap) = (char *) (&(last)+1))) + #if __ISO_C_VISIBLE >= 1999 + #define va_copy(dst, src) ((dst) = (src)) + #endif + #define va_arg(ap, type) (*(((type)*)(((ap) += sizeof(type)) - sizeof(type)))) + #define va_end(ap) ((void)0) +#endif + +#endif /* ! _SYS__STDARG_H_ */ + Modified: head/sys/x86/include/stdarg.h ============================================================================== --- head/sys/x86/include/stdarg.h Mon Dec 25 19:49:05 2017 (r327181) +++ head/sys/x86/include/stdarg.h Mon Dec 25 20:54:00 2017 (r327182) @@ -1,7 +1,7 @@ /*- - * SPDX-License-Identifier: BSD-3-Clause + * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2002 David E. O'Brien. All rights reserved. + * Copyright (c) 2017 Poul-Henning Kamp. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -11,9 +11,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 University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE @@ -33,35 +30,10 @@ #ifndef _MACHINE_STDARG_H_ #define _MACHINE_STDARG_H_ -#include -#include +#include -#ifndef _VA_LIST_DECLARED -#define _VA_LIST_DECLARED -typedef __va_list va_list; -#endif - -#ifdef __GNUCLIKE_BUILTIN_STDARG - -#define va_start(ap, last) \ - __builtin_va_start((ap), (last)) - -#define va_arg(ap, type) \ - __builtin_va_arg((ap), type) - -#define __va_copy(dest, src) \ - __builtin_va_copy((dest), (src)) - -#if __ISO_C_VISIBLE >= 1999 -#define va_copy(dest, src) \ - __va_copy(dest, src) -#endif - -#define va_end(ap) \ - __builtin_va_end(ap) - -#else -#error this file needs to be ported to your compiler +#ifndef va_start + #error this file needs to be ported to your compiler #endif #endif /* !_MACHINE_STDARG_H_ */ From owner-svn-src-all@freebsd.org Mon Dec 25 21:07:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43962EA691B; Mon, 25 Dec 2017 21:07:56 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E8F3739B5; Mon, 25 Dec 2017 21:07:55 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBPL7ttx088338; Mon, 25 Dec 2017 21:07:55 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBPL7tt1088336; Mon, 25 Dec 2017 21:07:55 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201712252107.vBPL7tt1088336@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Mon, 25 Dec 2017 21:07:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327183 - head X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 327183 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Dec 2017 21:07:56 -0000 Author: eadler Date: Mon Dec 25 21:07:54 2017 New Revision: 327183 URL: https://svnweb.freebsd.org/changeset/base/327183 Log: .git*: add gitattributes and gitignore For users of the git mirrors, lets provide useful git configuration files. Added: head/.gitattributes (contents, props changed) head/.gitignore (contents, props changed) Added: head/.gitattributes ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/.gitattributes Mon Dec 25 21:07:54 2017 (r327183) @@ -0,0 +1,5 @@ +*.c diff=cpp +*.h diff=cpp +*.cpp diff=cpp +*.hpp diff=cpp +*.py diff=python Added: head/.gitignore ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/.gitignore Mon Dec 25 21:07:54 2017 (r327183) @@ -0,0 +1,18 @@ +_.tinderbox.* +_.amd64.* +_.arm.* +_.arm64.* +_.i386.* +_.ia64.* +_.mips.* +_.pc98.* +_.powerpc.* +_.riscv.* +_.sparc64.* +_.sun4v.* +GPATH +GRTAGS +GTAGS +ID +cscope.out +?cscope.out From owner-svn-src-all@freebsd.org Mon Dec 25 21:40:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14C87EA7C71; Mon, 25 Dec 2017 21:40:21 +0000 (UTC) (envelope-from pho@holm.cc) Received: from relay01.pair.com (relay01.pair.com [209.68.5.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E19E4748EA; Mon, 25 Dec 2017 21:40:20 +0000 (UTC) (envelope-from pho@holm.cc) Received: from x2.osted.lan (87-58-223-204-dynamic.dk.customer.tdc.net [87.58.223.204]) by relay01.pair.com (Postfix) with ESMTP id E646DD00386; Mon, 25 Dec 2017 16:40:17 -0500 (EST) Received: from x2.osted.lan (localhost [127.0.0.1]) by x2.osted.lan (8.14.9/8.14.9) with ESMTP id vBPLeFPi013591 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 25 Dec 2017 22:40:15 +0100 (CET) (envelope-from pho@x2.osted.lan) Received: (from pho@localhost) by x2.osted.lan (8.14.9/8.14.9/Submit) id vBPLeFaG013590; Mon, 25 Dec 2017 22:40:15 +0100 (CET) (envelope-from pho) Date: Mon, 25 Dec 2017 22:40:15 +0100 From: Peter Holm To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327168 - head/sys/vm Message-ID: <20171225214015.GA13298@x2.osted.lan> References: <201712241945.vBOJjGV5051696@repo.freebsd.org> <20171225174946.GA9941@x2.osted.lan> <20171225195117.GA68801@wkstn-mjohnston.west.isilon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171225195117.GA68801@wkstn-mjohnston.west.isilon.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Dec 2017 21:40:21 -0000 On Mon, Dec 25, 2017 at 11:51:17AM -0800, Mark Johnston wrote: > On Mon, Dec 25, 2017 at 06:49:46PM +0100, Peter Holm wrote: > > On Sun, Dec 24, 2017 at 07:45:16PM +0000, Mark Johnston wrote: > > > Author: markj > > > Date: Sun Dec 24 19:45:16 2017 > > > New Revision: 327168 > > > URL: https://svnweb.freebsd.org/changeset/base/327168 > > > > > > Log: > > > Fix two problems with the page daemon control loop. > > > > > > Both issues caused the page daemon to erroneously go to sleep when > > > applications are consuming free pages at a high rate, leaving the > > > application threads blocked in VM_WAIT. > > > > > > 1) After completing an inactive queue scan, concurrent allocations may > > > have prevented the page daemon from meeting the v_free_min threshold. > > > In this case, the page daemon was going to sleep even when the > > > inactive queue contained plenty of clean pages. > > > 2) pagedaemon_wakeup() may be called without the free queues lock held. > > > This can lead to a lost wakeup if a call occurs after the page daemon > > > clears vm_pageout_wanted but before going to sleep. > > > > > > Fix 1) by ensuring that we start a new inactive queue scan immediately > > > if v_free_count < v_free_min after a prior scan. > > > > > > Fix 2) by adding a new subroutine, pagedaemon_wait(), called from > > > vm_wait() and vm_waitpfault(). It wakes up the page daemon if either > > > vm_pages_needed or vm_pageout_wanted is false, and atomically sleeps > > > on v_free_count. > > > > > > Reported by: jeff > > > Reviewed by: alc > > > MFC after: 2 weeks > > > Differential Revision: https://reviews.freebsd.org/D13424 > > > > > > Modified: > > > head/sys/vm/vm_page.c > > > head/sys/vm/vm_pageout.c > > > head/sys/vm/vm_pageout.h > > > > > > > I now see threads blocked in VM_WAIT? > > > > https://people.freebsd.org/~pho/stress/log/mark013.txt > > Hmm, I don't see anything obviously wrong here. v_free_count is 38, well > below the minimum threshold at which threads will block in VM_WAIT. The > page daemon was running and vm_pages_needed is 1, which is expected. > This just looks like a case of the page daemon failing to keep up with > memory pressure. Do you not see threads entering VM_WAIT with this > revision reverted? I have been running the same test on two hosts for one hours without seeing any problems. I'll keep the test run thru the night. -- Peter From owner-svn-src-all@freebsd.org Mon Dec 25 22:09:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F066EA90EC; Mon, 25 Dec 2017 22:09:27 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E9ED67588D; Mon, 25 Dec 2017 22:09:26 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBPM9QsW013334; Mon, 25 Dec 2017 22:09:26 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBPM9PDH013328; Mon, 25 Dec 2017 22:09:25 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201712252209.vBPM9PDH013328@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 25 Dec 2017 22:09:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327184 - in head/sys: arm/allwinner arm/allwinner/a10 dev/iicbus/twsi X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: arm/allwinner arm/allwinner/a10 dev/iicbus/twsi X-SVN-Commit-Revision: 327184 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Dec 2017 22:09:27 -0000 Author: manu Date: Mon Dec 25 22:09:25 2017 New Revision: 327184 URL: https://svnweb.freebsd.org/changeset/base/327184 Log: Change the remaining files using my personnal email address to my freebsd one Modified: head/sys/arm/allwinner/a10/a10_intc.c head/sys/arm/allwinner/allwinner_pinctrl.h head/sys/arm/allwinner/aw_mp.c head/sys/arm/allwinner/aw_mp.h head/sys/arm/allwinner/aw_wdog.c head/sys/dev/iicbus/twsi/a10_twsi.c Modified: head/sys/arm/allwinner/a10/a10_intc.c ============================================================================== --- head/sys/arm/allwinner/a10/a10_intc.c Mon Dec 25 21:07:54 2017 (r327183) +++ head/sys/arm/allwinner/a10/a10_intc.c Mon Dec 25 22:09:25 2017 (r327184) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2012 Ganbold Tsagaankhuu - * Copyright (c) 2016 Emmanuel Vadot + * Copyright (c) 2016 Emmanuel Vadot * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/arm/allwinner/allwinner_pinctrl.h ============================================================================== --- head/sys/arm/allwinner/allwinner_pinctrl.h Mon Dec 25 21:07:54 2017 (r327183) +++ head/sys/arm/allwinner/allwinner_pinctrl.h Mon Dec 25 22:09:25 2017 (r327184) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2016 Emmanuel Vadot + * Copyright (c) 2016 Emmanuel Vadot * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/arm/allwinner/aw_mp.c ============================================================================== --- head/sys/arm/allwinner/aw_mp.c Mon Dec 25 21:07:54 2017 (r327183) +++ head/sys/arm/allwinner/aw_mp.c Mon Dec 25 22:09:25 2017 (r327184) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2014 Ganbold Tsagaankhuu - * Copyright (c) 2016 Emmanuel Vadot + * Copyright (c) 2016 Emmanuel Vadot * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/arm/allwinner/aw_mp.h ============================================================================== --- head/sys/arm/allwinner/aw_mp.h Mon Dec 25 21:07:54 2017 (r327183) +++ head/sys/arm/allwinner/aw_mp.h Mon Dec 25 22:09:25 2017 (r327184) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2016 Emmanuel Vadot + * Copyright (c) 2016 Emmanuel Vadot * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/arm/allwinner/aw_wdog.c ============================================================================== --- head/sys/arm/allwinner/aw_wdog.c Mon Dec 25 21:07:54 2017 (r327183) +++ head/sys/arm/allwinner/aw_wdog.c Mon Dec 25 22:09:25 2017 (r327184) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2013 Oleksandr Tymoshenko - * Copyright (c) 2016 Emmanuel Vadot + * Copyright (c) 2016 Emmanuel Vadot * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/iicbus/twsi/a10_twsi.c ============================================================================== --- head/sys/dev/iicbus/twsi/a10_twsi.c Mon Dec 25 21:07:54 2017 (r327183) +++ head/sys/dev/iicbus/twsi/a10_twsi.c Mon Dec 25 22:09:25 2017 (r327184) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2016 Emmanuel Vadot + * Copyright (c) 2016 Emmanuel Vadot * All rights reserved. * * Redistribution and use in source and binary forms, with or without From owner-svn-src-all@freebsd.org Mon Dec 25 23:01:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE111E80161; Mon, 25 Dec 2017 23:01:10 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 88F2976F75; Mon, 25 Dec 2017 23:01:10 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBPN19Kx034001; Mon, 25 Dec 2017 23:01:09 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBPN19wQ034000; Mon, 25 Dec 2017 23:01:09 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201712252301.vBPN19wQ034000@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 25 Dec 2017 23:01:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327185 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 327185 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Dec 2017 23:01:10 -0000 Author: manu Date: Mon Dec 25 23:01:09 2017 New Revision: 327185 URL: https://svnweb.freebsd.org/changeset/base/327185 Log: aw_rsb.4: Remove useless .Re Modified: head/share/man/man4/aw_rtc.4 Modified: head/share/man/man4/aw_rtc.4 ============================================================================== --- head/share/man/man4/aw_rtc.4 Mon Dec 25 22:09:25 2017 (r327184) +++ head/share/man/man4/aw_rtc.4 Mon Dec 25 23:01:09 2017 (r327185) @@ -48,7 +48,6 @@ allwinner,sun4i-a10-rtc allwinner,sun7i-a20-rtc .It allwinner,sun6i-a31-rtc -.Re .Sh HISTORY The .Nm From owner-svn-src-all@freebsd.org Tue Dec 26 03:59:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B949E9AF69; Tue, 26 Dec 2017 03:59:51 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3AFD03905; Tue, 26 Dec 2017 03:59:51 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBQ3xodS059680; Tue, 26 Dec 2017 03:59:50 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBQ3xnca059676; Tue, 26 Dec 2017 03:59:49 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201712260359.vBQ3xnca059676@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 26 Dec 2017 03:59:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r327186 - in stable/11: cddl/usr.bin/ctfconvert cddl/usr.bin/ctfconvert/tests etc/mtree usr.bin/fold usr.bin/fold/tests usr.bin/rs usr.bin/rs/tests X-SVN-Group: stable-11 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in stable/11: cddl/usr.bin/ctfconvert cddl/usr.bin/ctfconvert/tests etc/mtree usr.bin/fold usr.bin/fold/tests usr.bin/rs usr.bin/rs/tests X-SVN-Commit-Revision: 327186 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 03:59:51 -0000 Author: asomers Date: Tue Dec 26 03:59:49 2017 New Revision: 327186 URL: https://svnweb.freebsd.org/changeset/base/327186 Log: MFC r326289: Add basic tests for ctfconvert(1), fold(1) and rs(1) Add basic command line parsing test coverage for these utilities. The tests were automatically generated based on their man pages. These tests can be expanded by hand for more thorough coverage. The aim is to generate very basic amount of test coverage for all the utilities in the base system. Tests generated via: https://github.com/shivansh/smoketestsuite/ Submitted by: shivansh Reviewed by: asomers Differential Revision: https://reviews.freebsd.org/D12424 Added: stable/11/cddl/usr.bin/ctfconvert/tests/ - copied from r326289, head/cddl/usr.bin/ctfconvert/tests/ stable/11/usr.bin/fold/tests/ - copied from r326289, head/usr.bin/fold/tests/ stable/11/usr.bin/rs/tests/ - copied from r326289, head/usr.bin/rs/tests/ Modified: stable/11/cddl/usr.bin/ctfconvert/Makefile stable/11/etc/mtree/BSD.tests.dist stable/11/usr.bin/fold/Makefile stable/11/usr.bin/rs/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/cddl/usr.bin/ctfconvert/Makefile ============================================================================== --- stable/11/cddl/usr.bin/ctfconvert/Makefile Mon Dec 25 23:01:09 2017 (r327185) +++ stable/11/cddl/usr.bin/ctfconvert/Makefile Tue Dec 26 03:59:49 2017 (r327186) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + .PATH: ${SRCTOP}/cddl/contrib/opensolaris/tools/ctf/common .PATH: ${SRCTOP}/cddl/contrib/opensolaris/tools/ctf/cvt @@ -35,5 +37,8 @@ CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris \ -I${OPENSOLARIS_SYS_DISTDIR}/uts/common LIBADD= dwarf elf z pthread + +HAS_TESTS= +SUBDIR.${MK_TESTS}+= tests .include Modified: stable/11/etc/mtree/BSD.tests.dist ============================================================================== --- stable/11/etc/mtree/BSD.tests.dist Mon Dec 25 23:01:09 2017 (r327185) +++ stable/11/etc/mtree/BSD.tests.dist Tue Dec 26 03:59:49 2017 (r327186) @@ -65,6 +65,8 @@ sbin .. usr.bin + ctfconvert + .. .. usr.sbin dtrace @@ -640,6 +642,8 @@ .. file2c .. + fold + .. getconf .. grep @@ -671,6 +675,8 @@ printf .. procstat + .. + rs .. sdiff .. Modified: stable/11/usr.bin/fold/Makefile ============================================================================== --- stable/11/usr.bin/fold/Makefile Mon Dec 25 23:01:09 2017 (r327185) +++ stable/11/usr.bin/fold/Makefile Tue Dec 26 03:59:49 2017 (r327186) @@ -1,6 +1,11 @@ # From: @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ +.include + PROG= fold + +HAS_TESTS= +SUBDIR.${MK_TESTS}+= tests .include Modified: stable/11/usr.bin/rs/Makefile ============================================================================== --- stable/11/usr.bin/rs/Makefile Mon Dec 25 23:01:09 2017 (r327185) +++ stable/11/usr.bin/rs/Makefile Tue Dec 26 03:59:49 2017 (r327186) @@ -1,5 +1,11 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 +# $FreeBSD$ +.include + PROG= rs + +HAS_TESTS= +SUBDIR.${MK_TESTS}+= tests .include From owner-svn-src-all@freebsd.org Tue Dec 26 04:00:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0EFC6E9D069; Tue, 26 Dec 2017 04:00:32 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C27503A85; Tue, 26 Dec 2017 04:00:31 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBQ40UFZ059803; Tue, 26 Dec 2017 04:00:30 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBQ40U6c059802; Tue, 26 Dec 2017 04:00:30 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201712260400.vBQ40U6c059802@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 26 Dec 2017 04:00:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r327187 - stable/11/usr.sbin/diskinfo X-SVN-Group: stable-11 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/11/usr.sbin/diskinfo X-SVN-Commit-Revision: 327187 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 04:00:32 -0000 Author: asomers Date: Tue Dec 26 04:00:30 2017 New Revision: 327187 URL: https://svnweb.freebsd.org/changeset/base/327187 Log: MFC r326290: diskinfo(8): Delete dead code in slog test Reported by: Coverity CID: 1377556 Reviewed by: mav Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D13275 Modified: stable/11/usr.sbin/diskinfo/diskinfo.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/diskinfo/diskinfo.c ============================================================================== --- stable/11/usr.sbin/diskinfo/diskinfo.c Tue Dec 26 03:59:49 2017 (r327186) +++ stable/11/usr.sbin/diskinfo/diskinfo.c Tue Dec 26 04:00:30 2017 (r327187) @@ -644,22 +644,22 @@ parwrite(int fd, size_t size, off_t off) { struct aiocb aios[MAXIOS]; off_t o; - size_t s; int n, error; struct aiocb *aiop; - for (n = 0, o = 0; size > MAXIO; n++, size -= s, o += s) { - s = (size >= MAXIO) ? MAXIO : size; + // if size > MAXIO, use AIO to write n - 1 pieces in parallel + for (n = 0, o = 0; size > MAXIO; n++, size -= MAXIO, o += MAXIO) { aiop = &aios[n]; bzero(aiop, sizeof(*aiop)); aiop->aio_buf = &buf[o]; aiop->aio_fildes = fd; aiop->aio_offset = off + o; - aiop->aio_nbytes = s; + aiop->aio_nbytes = MAXIO; error = aio_write(aiop); if (error != 0) err(EX_IOERR, "AIO write submit error"); } + // Use synchronous writes for the runt of size <= MAXIO error = pwrite(fd, &buf[o], size, off + o); if (error < 0) err(EX_IOERR, "Sync write error"); From owner-svn-src-all@freebsd.org Tue Dec 26 04:02:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE889E9D434; Tue, 26 Dec 2017 04:02:36 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D3283EE5; Tue, 26 Dec 2017 04:02:36 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBQ42Zwc063547; Tue, 26 Dec 2017 04:02:35 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBQ42ZJO063546; Tue, 26 Dec 2017 04:02:35 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201712260402.vBQ42ZJO063546@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 26 Dec 2017 04:02:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r327188 - stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-11 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 327188 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 04:02:37 -0000 Author: asomers Date: Tue Dec 26 04:02:35 2017 New Revision: 327188 URL: https://svnweb.freebsd.org/changeset/base/327188 Log: MFC r326401: Fix assertion when ZFS fails to open certain devices "panic: vdev_geom_close_locked: cp->private is NULL" This panic will result if ZFS fails to open a device due to either of the following reasons: 1) The device's sector size is greater than 8KB. 2) ZFS wants to open the device RW, but it can't be opened for writing. The solution is to change the initialization order to ensure that the assertion will be satisfied. PR: 221066 Reported by: David NewHamlet Reviewed by: avg Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D13278 Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Tue Dec 26 04:00:30 2017 (r327187) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Tue Dec 26 04:02:35 2017 (r327188) @@ -851,35 +851,10 @@ vdev_geom_open(vdev_t *vd, uint64_t *psize, uint64_t * if (cp == NULL) { ZFS_LOG(1, "Vdev %s not found.", vd->vdev_path); error = ENOENT; - } else if (cp->provider->sectorsize > VDEV_PAD_SIZE || - !ISP2(cp->provider->sectorsize)) { - ZFS_LOG(1, "Provider %s has unsupported sectorsize.", - cp->provider->name); - - vdev_geom_close_locked(vd); - error = EINVAL; - cp = NULL; - } else if (cp->acw == 0 && (spa_mode(vd->vdev_spa) & FWRITE) != 0) { - int i; - - for (i = 0; i < 5; i++) { - error = g_access(cp, 0, 1, 0); - if (error == 0) - break; - g_topology_unlock(); - tsleep(vd, 0, "vdev", hz / 2); - g_topology_lock(); - } - if (error != 0) { - printf("ZFS WARNING: Unable to open %s for writing (error=%d).\n", - cp->provider->name, error); - vdev_geom_close_locked(vd); - cp = NULL; - } - } - if (cp != NULL) { + } else { struct consumer_priv_t *priv; struct consumer_vdev_elem *elem; + int spamode; priv = (struct consumer_priv_t*)&cp->private; if (cp->private == NULL) @@ -887,6 +862,34 @@ vdev_geom_open(vdev_t *vd, uint64_t *psize, uint64_t * elem = g_malloc(sizeof(*elem), M_WAITOK|M_ZERO); elem->vd = vd; SLIST_INSERT_HEAD(priv, elem, elems); + + spamode = spa_mode(vd->vdev_spa); + if (cp->provider->sectorsize > VDEV_PAD_SIZE || + !ISP2(cp->provider->sectorsize)) { + ZFS_LOG(1, "Provider %s has unsupported sectorsize.", + cp->provider->name); + + vdev_geom_close_locked(vd); + error = EINVAL; + cp = NULL; + } else if (cp->acw == 0 && (spamode & FWRITE) != 0) { + int i; + + for (i = 0; i < 5; i++) { + error = g_access(cp, 0, 1, 0); + if (error == 0) + break; + g_topology_unlock(); + tsleep(vd, 0, "vdev", hz / 2); + g_topology_lock(); + } + if (error != 0) { + printf("ZFS WARNING: Unable to open %s for writing (error=%d).\n", + cp->provider->name, error); + vdev_geom_close_locked(vd); + cp = NULL; + } + } } /* Fetch initial physical path information for this device. */ From owner-svn-src-all@freebsd.org Tue Dec 26 04:07:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D668EE9DA2D; Tue, 26 Dec 2017 04:07:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A164863435; Tue, 26 Dec 2017 04:07:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBQ47I3g063770; Tue, 26 Dec 2017 04:07:18 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBQ47Ijj063769; Tue, 26 Dec 2017 04:07:18 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712260407.vBQ47Ijj063769@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 26 Dec 2017 04:07:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327189 - head/usr.sbin/devmatch X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.sbin/devmatch X-SVN-Commit-Revision: 327189 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 04:07:19 -0000 Author: imp Date: Tue Dec 26 04:07:18 2017 New Revision: 327189 URL: https://svnweb.freebsd.org/changeset/base/327189 Log: Fix typo Modified: head/usr.sbin/devmatch/devmatch.c Modified: head/usr.sbin/devmatch/devmatch.c ============================================================================== --- head/usr.sbin/devmatch/devmatch.c Tue Dec 26 04:02:35 2017 (r327188) +++ head/usr.sbin/devmatch/devmatch.c Tue Dec 26 04:07:18 2017 (r327189) @@ -321,7 +321,7 @@ search_hints(const char *bus, const char *dev, const c else if (!notme) { if (!unbound_flag) { if (all_flag) - printf("%s: ", *dev ? dev : "unattahed" ); + printf("%s: ", *dev ? dev : "unattached" ); printf("%s\n", lastmod); } found++; @@ -338,7 +338,7 @@ search_hints(const char *bus, const char *dev, const c if (unbound_flag && found == 0 && *pnpinfo) { if (verbose_flag) printf("------------------------- "); - printf("%s on %s pnpinfo %s", *dev ? dev : "unattahed", bus, pnpinfo); + printf("%s on %s pnpinfo %s", *dev ? dev : "unattached", bus, pnpinfo); if (verbose_flag) printf(" -------------------------"); printf("\n"); From owner-svn-src-all@freebsd.org Tue Dec 26 08:32:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 389C6EAA0A9; Tue, 26 Dec 2017 08:32:04 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EE2D46A60B; Tue, 26 Dec 2017 08:32:03 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBQ8W3HP074624; Tue, 26 Dec 2017 08:32:03 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBQ8W39U074623; Tue, 26 Dec 2017 08:32:03 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201712260832.vBQ8W39U074623@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 26 Dec 2017 08:32:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r327191 - stable/11/usr.bin/gzip X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/11/usr.bin/gzip X-SVN-Commit-Revision: 327191 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 08:32:04 -0000 Author: delphij Date: Tue Dec 26 08:32:02 2017 New Revision: 327191 URL: https://svnweb.freebsd.org/changeset/base/327191 Log: MFC r326791: Close the correct file descriptor. Modified: stable/11/usr.bin/gzip/gzip.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/gzip/gzip.c ============================================================================== --- stable/11/usr.bin/gzip/gzip.c Tue Dec 26 07:08:11 2017 (r327190) +++ stable/11/usr.bin/gzip/gzip.c Tue Dec 26 08:32:02 2017 (r327191) @@ -1717,7 +1717,7 @@ file_uncompress(char *file, char *outfile, size_t outs if (fd != -1) close(fd); if (zfd != -1 && zfd != STDOUT_FILENO) - close(fd); + close(zfd); return -1; } From owner-svn-src-all@freebsd.org Tue Dec 26 08:33:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CE7CEAA203; Tue, 26 Dec 2017 08:33:04 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CAF5B6A8D8; Tue, 26 Dec 2017 08:33:03 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBQ8X2cH074725; Tue, 26 Dec 2017 08:33:02 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBQ8X2dg074724; Tue, 26 Dec 2017 08:33:02 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201712260833.vBQ8X2dg074724@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 26 Dec 2017 08:33:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r327192 - stable/10/usr.bin/gzip X-SVN-Group: stable-10 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/10/usr.bin/gzip X-SVN-Commit-Revision: 327192 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 08:33:04 -0000 Author: delphij Date: Tue Dec 26 08:33:02 2017 New Revision: 327192 URL: https://svnweb.freebsd.org/changeset/base/327192 Log: MFC r326791: Close the correct file descriptor. Modified: stable/10/usr.bin/gzip/gzip.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/gzip/gzip.c ============================================================================== --- stable/10/usr.bin/gzip/gzip.c Tue Dec 26 08:32:02 2017 (r327191) +++ stable/10/usr.bin/gzip/gzip.c Tue Dec 26 08:33:02 2017 (r327192) @@ -1630,7 +1630,7 @@ file_uncompress(char *file, char *outfile, size_t outs if (fd != -1) close(fd); if (zfd != -1 && zfd != STDOUT_FILENO) - close(fd); + close(zfd); return -1; } From owner-svn-src-all@freebsd.org Tue Dec 26 09:55:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8298BE81584; Tue, 26 Dec 2017 09:55:37 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CD896D2CA; Tue, 26 Dec 2017 09:55:37 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBQ9tatZ008324; Tue, 26 Dec 2017 09:55:36 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBQ9taIL008323; Tue, 26 Dec 2017 09:55:36 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201712260955.vBQ9taIL008323@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 26 Dec 2017 09:55:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r327193 - stable/11/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 327193 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 09:55:37 -0000 Author: kib Date: Tue Dec 26 09:55:36 2017 New Revision: 327193 URL: https://svnweb.freebsd.org/changeset/base/327193 Log: MFC r326977: mlx5en: Avoid SFENCe on x86. Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Tue Dec 26 08:33:02 2017 (r327192) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Tue Dec 26 09:55:36 2017 (r327193) @@ -90,7 +90,7 @@ mlx5e_post_rx_wqes(struct mlx5e_rq *rq) } /* ensure wqes are visible to device before updating doorbell record */ - wmb(); + atomic_thread_fence_rel(); mlx5_wq_ll_update_db_record(&rq->wq); } @@ -391,7 +391,7 @@ wq_ll_pop: mlx5_cqwq_update_db_record(&rq->cq.wq); /* ensure cq space is freed before enabling more cqes */ - wmb(); + atomic_thread_fence_rel(); return (i); } From owner-svn-src-all@freebsd.org Tue Dec 26 09:57:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB122E817C2; Tue, 26 Dec 2017 09:57:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A29B76D4ED; Tue, 26 Dec 2017 09:57:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBQ9vFCq008430; Tue, 26 Dec 2017 09:57:15 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBQ9vFCk008428; Tue, 26 Dec 2017 09:57:15 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201712260957.vBQ9vFCk008428@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 26 Dec 2017 09:57:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r327194 - in stable/11/sys/x86: include x86 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11/sys/x86: include x86 X-SVN-Commit-Revision: 327194 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 09:57:17 -0000 Author: kib Date: Tue Dec 26 09:57:15 2017 New Revision: 327194 URL: https://svnweb.freebsd.org/changeset/base/327194 Log: MFC r327118: Add missed AVX512VL (128 and 256 bit vector length) extension identification bit. Modified: stable/11/sys/x86/include/specialreg.h stable/11/sys/x86/x86/identcpu.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/x86/include/specialreg.h ============================================================================== --- stable/11/sys/x86/include/specialreg.h Tue Dec 26 09:55:36 2017 (r327193) +++ stable/11/sys/x86/include/specialreg.h Tue Dec 26 09:57:15 2017 (r327194) @@ -362,6 +362,7 @@ #define CPUID_STDEXT_AVX512CD 0x10000000 #define CPUID_STDEXT_SHA 0x20000000 #define CPUID_STDEXT_AVX512BW 0x40000000 +#define CPUID_STDEXT_AVX512VL 0x80000000 /* * CPUID instruction 7 Structured Extended Features, leaf 0 ecx info Modified: stable/11/sys/x86/x86/identcpu.c ============================================================================== --- stable/11/sys/x86/x86/identcpu.c Tue Dec 26 09:55:36 2017 (r327193) +++ stable/11/sys/x86/x86/identcpu.c Tue Dec 26 09:57:15 2017 (r327194) @@ -961,6 +961,7 @@ printcpuinfo(void) "\035AVX512CD" "\036SHA" "\037AVX512BW" + "\040AVX512VL" ); } From owner-svn-src-all@freebsd.org Tue Dec 26 10:07:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C7DDE820FA; Tue, 26 Dec 2017 10:07:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D10076DA51; Tue, 26 Dec 2017 10:07:19 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBQA7IMh012516; Tue, 26 Dec 2017 10:07:18 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBQA7HEM012505; Tue, 26 Dec 2017 10:07:17 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201712261007.vBQA7HEM012505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 26 Dec 2017 10:07:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r327195 - in stable/11/sys: amd64/include arm/include arm64/include i386/include mips/include mips/mips powerpc/include riscv/include sparc64/include sys X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11/sys: amd64/include arm/include arm64/include i386/include mips/include mips/mips powerpc/include riscv/include sparc64/include sys X-SVN-Commit-Revision: 327195 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 10:07:20 -0000 Author: kib Date: Tue Dec 26 10:07:17 2017 New Revision: 327195 URL: https://svnweb.freebsd.org/changeset/base/327195 Log: MFC r326971, r327047 (by ian), r327053 (by marius), r327074, r327097: Add atomic_load(9) and atomic_store(9) operations. Added: stable/11/sys/sys/atomic_common.h - copied unchanged from r326971, head/sys/sys/atomic_common.h Modified: stable/11/sys/amd64/include/atomic.h stable/11/sys/arm/include/atomic.h stable/11/sys/arm64/include/atomic.h stable/11/sys/i386/include/atomic.h stable/11/sys/mips/include/atomic.h stable/11/sys/mips/mips/db_interface.c stable/11/sys/mips/mips/support.S stable/11/sys/powerpc/include/atomic.h stable/11/sys/riscv/include/atomic.h stable/11/sys/sparc64/include/atomic.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/include/atomic.h ============================================================================== --- stable/11/sys/amd64/include/atomic.h Tue Dec 26 09:57:15 2017 (r327194) +++ stable/11/sys/amd64/include/atomic.h Tue Dec 26 10:07:17 2017 (r327195) @@ -55,6 +55,8 @@ #define wmb() __asm __volatile("sfence;" : : : "memory") #define rmb() __asm __volatile("lfence;" : : : "memory") +#include + /* * Various simple operations on memory, each of which is atomic in the * presence of interrupts and multiple processors. Modified: stable/11/sys/arm/include/atomic.h ============================================================================== --- stable/11/sys/arm/include/atomic.h Tue Dec 26 09:57:15 2017 (r327194) +++ stable/11/sys/arm/include/atomic.h Tue Dec 26 10:07:17 2017 (r327195) @@ -39,6 +39,8 @@ #ifndef _MACHINE_ATOMIC_H_ #define _MACHINE_ATOMIC_H_ +#include + #include #ifndef _KERNEL @@ -51,32 +53,6 @@ #include #endif /* Arch >= v6 */ -static __inline int -atomic_load_32(volatile uint32_t *v) -{ - - return (*v); -} - -static __inline void -atomic_store_32(volatile uint32_t *dst, uint32_t src) -{ - *dst = src; -} - -static __inline int -atomic_load_long(volatile u_long *v) -{ - - return (*v); -} - -static __inline void -atomic_store_long(volatile u_long *dst, u_long src) -{ - *dst = src; -} - #define atomic_clear_ptr atomic_clear_32 #define atomic_clear_acq_ptr atomic_clear_acq_32 #define atomic_clear_rel_ptr atomic_clear_rel_32 @@ -90,7 +66,6 @@ atomic_store_long(volatile u_long *dst, u_long src) #define atomic_cmpset_acq_ptr atomic_cmpset_acq_32 #define atomic_cmpset_rel_ptr atomic_cmpset_rel_32 #define atomic_load_acq_ptr atomic_load_acq_32 -#define atomic_store_ptr atomic_store_32 #define atomic_store_rel_ptr atomic_store_rel_32 #define atomic_swap_ptr atomic_swap_32 #define atomic_readandclear_ptr atomic_readandclear_32 Modified: stable/11/sys/arm64/include/atomic.h ============================================================================== --- stable/11/sys/arm64/include/atomic.h Tue Dec 26 09:57:15 2017 (r327194) +++ stable/11/sys/arm64/include/atomic.h Tue Dec 26 10:07:17 2017 (r327195) @@ -29,6 +29,8 @@ #ifndef _MACHINE_ATOMIC_H_ #define _MACHINE_ATOMIC_H_ +#include + #define isb() __asm __volatile("isb" : : : "memory") /* Modified: stable/11/sys/i386/include/atomic.h ============================================================================== --- stable/11/sys/i386/include/atomic.h Tue Dec 26 09:57:15 2017 (r327194) +++ stable/11/sys/i386/include/atomic.h Tue Dec 26 10:07:17 2017 (r327195) @@ -32,6 +32,8 @@ #error this file needs sys/cdefs.h as a prerequisite #endif +#include + #ifdef _KERNEL #include #include Modified: stable/11/sys/mips/include/atomic.h ============================================================================== --- stable/11/sys/mips/include/atomic.h Tue Dec 26 09:57:15 2017 (r327194) +++ stable/11/sys/mips/include/atomic.h Tue Dec 26 10:07:17 2017 (r327195) @@ -34,6 +34,8 @@ #error this file needs sys/cdefs.h as a prerequisite #endif +#include + /* * Note: All the 64-bit atomic operations are only atomic when running * in 64-bit mode. It is assumed that code compiled for n32 and n64 @@ -337,23 +339,6 @@ atomic_store_rel_##WIDTH(__volatile uint##WIDTH##_t *p ATOMIC_STORE_LOAD(32) ATOMIC_STORE_LOAD(64) -#if !defined(__mips_n64) && !defined(__mips_n32) -void atomic_store_64(__volatile uint64_t *, uint64_t *); -void atomic_load_64(__volatile uint64_t *, uint64_t *); -#else -static __inline void -atomic_store_64(__volatile uint64_t *p, uint64_t *v) -{ - *p = *v; -} - -static __inline void -atomic_load_64(__volatile uint64_t *p, uint64_t *v) -{ - *v = *p; -} -#endif - #undef ATOMIC_STORE_LOAD /* Modified: stable/11/sys/mips/mips/db_interface.c ============================================================================== --- stable/11/sys/mips/mips/db_interface.c Tue Dec 26 09:57:15 2017 (r327194) +++ stable/11/sys/mips/mips/db_interface.c Tue Dec 26 10:07:17 2017 (r327195) @@ -150,6 +150,7 @@ db_read_bytes(vm_offset_t addr, size_t size, char *dat /* * 'addr' could be a memory-mapped I/O address. Try to * do atomic load/store in unit of size requested. + * size == 8 is only atomic on 64bit or n32 kernel. */ if ((size == 2 || size == 4 || size == 8) && ((addr & (size -1)) == 0) && @@ -162,9 +163,8 @@ db_read_bytes(vm_offset_t addr, size_t size, char *dat *(uint32_t *)data = *(uint32_t *)addr; break; case 8: - atomic_load_64((volatile u_int64_t *)addr, - (u_int64_t *)data); - break; + *(uint64_t *)data = *(uint64_t *)addr; + break; } } else { char *src; @@ -193,6 +193,7 @@ db_write_bytes(vm_offset_t addr, size_t size, char *da /* * 'addr' could be a memory-mapped I/O address. Try to * do atomic load/store in unit of size requested. + * size == 8 is only atomic on 64bit or n32 kernel. */ if ((size == 2 || size == 4 || size == 8) && ((addr & (size -1)) == 0) && @@ -205,9 +206,8 @@ db_write_bytes(vm_offset_t addr, size_t size, char *da *(uint32_t *)addr = *(uint32_t *)data; break; case 8: - atomic_store_64((volatile u_int64_t *)addr, - (u_int64_t *)data); - break; + *(uint64_t *)addr = *(uint64_t *)data; + break; } } else { char *dst; Modified: stable/11/sys/mips/mips/support.S ============================================================================== --- stable/11/sys/mips/mips/support.S Tue Dec 26 09:57:15 2017 (r327194) +++ stable/11/sys/mips/mips/support.S Tue Dec 26 10:07:17 2017 (r327195) @@ -839,74 +839,7 @@ LEAF(atomic_subtract_8) nop END(atomic_subtract_8) -/* - * atomic 64-bit register read/write assembly language support routines. - */ - .set noreorder # Noreorder is default style! - -#if !defined(__mips_n64) && !defined(__mips_n32) - /* - * I don't know if these routines have the right number of - * NOPs in it for all processors. XXX - * - * Maybe it would be better to just leave this undefined in that case. - * - * XXX These routines are not safe in the case of a TLB miss on a1 or - * a0 unless the trapframe is 64-bit, which it just isn't with O32. - * If we take any exception, not just an interrupt, the upper - * 32-bits will be clobbered. Use only N32 and N64 kernels if you - * want to use 64-bit registers while interrupts are enabled or - * with memory operations. Since this isn't even using load-linked - * and store-conditional, perhaps it should just use two registers - * instead, as is right and good with the O32 ABI. - */ -LEAF(atomic_store_64) - mfc0 t1, MIPS_COP_0_STATUS - and t2, t1, ~MIPS_SR_INT_IE - mtc0 t2, MIPS_COP_0_STATUS - nop - nop - nop - nop - ld t0, (a1) - nop - nop - sd t0, (a0) - nop - nop - mtc0 t1,MIPS_COP_0_STATUS - nop - nop - nop - nop - j ra - nop -END(atomic_store_64) - -LEAF(atomic_load_64) - mfc0 t1, MIPS_COP_0_STATUS - and t2, t1, ~MIPS_SR_INT_IE - mtc0 t2, MIPS_COP_0_STATUS - nop - nop - nop - nop - ld t0, (a0) - nop - nop - sd t0, (a1) - nop - nop - mtc0 t1,MIPS_COP_0_STATUS - nop - nop - nop - nop - j ra - nop -END(atomic_load_64) -#endif #if defined(DDB) || defined(DEBUG) Modified: stable/11/sys/powerpc/include/atomic.h ============================================================================== --- stable/11/sys/powerpc/include/atomic.h Tue Dec 26 09:57:15 2017 (r327194) +++ stable/11/sys/powerpc/include/atomic.h Tue Dec 26 10:07:17 2017 (r327195) @@ -36,6 +36,8 @@ #error this file needs sys/cdefs.h as a prerequisite #endif +#include + /* * The __ATOMIC_REL/ACQ() macros provide memory barriers only in conjunction * with the atomic lXarx/stXcx. sequences below. They are not exposed outside Modified: stable/11/sys/riscv/include/atomic.h ============================================================================== --- stable/11/sys/riscv/include/atomic.h Tue Dec 26 09:57:15 2017 (r327194) +++ stable/11/sys/riscv/include/atomic.h Tue Dec 26 10:07:17 2017 (r327195) @@ -37,6 +37,8 @@ #ifndef _MACHINE_ATOMIC_H_ #define _MACHINE_ATOMIC_H_ +#include + #define fence() __asm __volatile("fence" ::: "memory"); #define mb() fence() #define rmb() fence() Modified: stable/11/sys/sparc64/include/atomic.h ============================================================================== --- stable/11/sys/sparc64/include/atomic.h Tue Dec 26 09:57:15 2017 (r327194) +++ stable/11/sys/sparc64/include/atomic.h Tue Dec 26 10:07:17 2017 (r327195) @@ -37,6 +37,8 @@ #define wmb() mb() #define rmb() mb() +#include + /* Userland needs different ASI's. */ #ifdef _KERNEL #define __ASI_ATOMIC ASI_N @@ -253,11 +255,6 @@ atomic_fcmpset_rel_ ## name(volatile ptype p, vtype *e return (0); \ } \ \ -static __inline vtype \ -atomic_load_ ## name(volatile ptype p) \ -{ \ - return ((vtype)atomic_cas((p), 0, 0, sz)); \ -} \ static __inline vtype \ atomic_load_acq_ ## name(volatile ptype p) \ { \ Copied: stable/11/sys/sys/atomic_common.h (from r326971, head/sys/sys/atomic_common.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/sys/atomic_common.h Tue Dec 26 10:07:17 2017 (r327195, copy of r326971, head/sys/sys/atomic_common.h) @@ -0,0 +1,73 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2017 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * 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 _SYS_ATOMIC_COMMON_H_ +#define _SYS_ATOMIC_COMMON_H_ + +#ifndef _MACHINE_ATOMIC_H_ +#error do not include this header, use machine/atomic.h +#endif + +#define atomic_load_char(p) (*(volatile u_char *)(p)) +#define atomic_load_short(p) (*(volatile u_short *)(p)) +#define atomic_load_int(p) (*(volatile u_int *)(p)) +#define atomic_load_long(p) (*(volatile u_long *)(p)) +#define atomic_load_ptr(p) (*(volatile uintptr_t*)(p)) +#define atomic_load_8(p) (*(volatile uint8_t *)(p)) +#define atomic_load_16(p) (*(volatile uint16_t *)(p)) +#define atomic_load_32(p) (*(volatile uint32_t *)(p)) +#ifdef _LP64 +#define atomic_load_64(p) (*(volatile uint64_t *)(p)) +#endif + +#define atomic_store_char(p, v) \ + (*(volatile u_char *)(p) = (u_char)(v)) +#define atomic_store_short(p, v) \ + (*(volatile u_short *)(p) = (u_short)(v)) +#define atomic_store_int(p, v) \ + (*(volatile u_int *)(p) = (u_int)(v)) +#define atomic_store_long(p, v) \ + (*(volatile u_long *)(p) = (u_long)(v)) +#define atomic_store_ptr(p, v) \ + (*(uintptr_t *)(p) = (uintptr_t)(v)) +#define atomic_store_8(p, v) \ + (*(volatile uint8_t *)(p) = (uint8_t)(v)) +#define atomic_store_16(p, v) \ + (*(volatile uint16_t *)(p) = (uint16_t)(v)) +#define atomic_store_32(p, v) \ + (*(volatile uint32_t *)(p) = (uint32_t)(v)) +#ifdef _LP64 +#define atomic_store_64(p, v) \ + (*(volatile uint64_t *)(p) = (uint64_t)(v)) +#endif + +#endif From owner-svn-src-all@freebsd.org Tue Dec 26 10:09:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87F81E822D5; Tue, 26 Dec 2017 10:09:19 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 509C96DBE8; Tue, 26 Dec 2017 10:09:19 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBQA9IsV012629; Tue, 26 Dec 2017 10:09:18 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBQA9Ir0012628; Tue, 26 Dec 2017 10:09:18 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201712261009.vBQA9Ir0012628@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 26 Dec 2017 10:09:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r327196 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 327196 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 10:09:19 -0000 Author: kib Date: Tue Dec 26 10:09:18 2017 New Revision: 327196 URL: https://svnweb.freebsd.org/changeset/base/327196 Log: MFC r326973: Use atomic_load(9) to read ppsinfo sequence numbers. Modified: stable/11/sys/kern/kern_tc.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_tc.c ============================================================================== --- stable/11/sys/kern/kern_tc.c Tue Dec 26 10:07:17 2017 (r327195) +++ stable/11/sys/kern/kern_tc.c Tue Dec 26 10:09:18 2017 (r327196) @@ -1603,10 +1603,10 @@ pps_fetch(struct pps_fetch_args *fapi, struct pps_stat tv.tv_usec = fapi->timeout.tv_nsec / 1000; timo = tvtohz(&tv); } - aseq = pps->ppsinfo.assert_sequence; - cseq = pps->ppsinfo.clear_sequence; - while (aseq == pps->ppsinfo.assert_sequence && - cseq == pps->ppsinfo.clear_sequence) { + aseq = atomic_load_int(&pps->ppsinfo.assert_sequence); + cseq = atomic_load_int(&pps->ppsinfo.clear_sequence); + while (aseq == atomic_load_int(&pps->ppsinfo.assert_sequence) && + cseq == atomic_load_int(&pps->ppsinfo.clear_sequence)) { if (abi_aware(pps, 1) && pps->driver_mtx != NULL) { if (pps->flags & PPSFLAG_MTX_SPIN) { err = msleep_spin(pps, pps->driver_mtx, From owner-svn-src-all@freebsd.org Tue Dec 26 10:59:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 879FAE8542A; Tue, 26 Dec 2017 10:59:56 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 473D96FC92; Tue, 26 Dec 2017 10:59:56 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBQAxtJR034171; Tue, 26 Dec 2017 10:59:55 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBQAxtq7034170; Tue, 26 Dec 2017 10:59:55 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201712261059.vBQAxtq7034170@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 26 Dec 2017 10:59:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327197 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 327197 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 10:59:56 -0000 Author: manu Date: Tue Dec 26 10:59:54 2017 New Revision: 327197 URL: https://svnweb.freebsd.org/changeset/base/327197 Log: aw_rtc.4: Correct some error/style found by mandoc -Tlint Modified: head/share/man/man4/aw_rtc.4 Modified: head/share/man/man4/aw_rtc.4 ============================================================================== --- head/share/man/man4/aw_rtc.4 Tue Dec 26 10:09:18 2017 (r327196) +++ head/share/man/man4/aw_rtc.4 Tue Dec 26 10:59:54 2017 (r327197) @@ -30,7 +30,7 @@ .Os .Sh NAME .Nm aw_rtc -.Nd driver for the RTC controller in Allwinner SoC. +.Nd driver for the RTC controller in Allwinner SoC .Sh DESCRIPTION The .Nm @@ -48,6 +48,7 @@ allwinner,sun4i-a10-rtc allwinner,sun7i-a20-rtc .It allwinner,sun6i-a31-rtc +.El .Sh HISTORY The .Nm From owner-svn-src-all@freebsd.org Tue Dec 26 12:06:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB5AAE898C8; Tue, 26 Dec 2017 12:06:57 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F0AE728C3; Tue, 26 Dec 2017 12:06:57 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBQC6u50063651; Tue, 26 Dec 2017 12:06:56 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBQC6uf4063647; Tue, 26 Dec 2017 12:06:56 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201712261206.vBQC6uf4063647@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 26 Dec 2017 12:06:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327198 - in head: share/man/man4 sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head: share/man/man4 sys/arm/allwinner X-SVN-Commit-Revision: 327198 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 12:06:58 -0000 Author: manu Date: Tue Dec 26 12:06:56 2017 New Revision: 327198 URL: https://svnweb.freebsd.org/changeset/base/327198 Log: Allwinner: mmc: Rename driver to aw_mmc and add a man page for it Reviewed by: bcr (manpages) Differential Revision: https://reviews.freebsd.org/D13616 Added: head/share/man/man4/aw_mmc.4 (contents, props changed) head/sys/arm/allwinner/aw_mmc.c (contents, props changed) head/sys/arm/allwinner/aw_mmc.h (contents, props changed) Deleted: head/sys/arm/allwinner/a10_mmc.c head/sys/arm/allwinner/a10_mmc.h Modified: head/share/man/man4/Makefile head/sys/arm/allwinner/files.allwinner Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Tue Dec 26 10:59:54 2017 (r327197) +++ head/share/man/man4/Makefile Tue Dec 26 12:06:56 2017 (r327198) @@ -70,6 +70,7 @@ MAN= aac.4 \ audit.4 \ auditpipe.4 \ aue.4 \ + aw_mmc.4 \ aw_rtc.4 \ axe.4 \ axge.4 \ Added: head/share/man/man4/aw_mmc.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/aw_mmc.4 Tue Dec 26 12:06:56 2017 (r327198) @@ -0,0 +1,76 @@ +.\"- +.\" Copyright (c) 2017 Emmanuel Vadot +.\" 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 Dec 25, 2017 +.Dt AW_MMC 4 +.Os +.Sh NAME +.Nm aw_mmc +.Nd driver for the SD/MMC controller in Allwinner SoC +.Sh SYNOPSIS +.Cd "device mmc" +.Sh DESCRIPTION +The +.Nm +device driver provides support for the Allwinner SD/MMC host controller. +.Sh HARDWARE +The current version of the +.Nm +driver supports the SD/MMC controller with one of the following compatible strings : +.Pp +.Bl -bullet -compact +.It +allwinner,sun4i-a10-mmc +.It +allwinner,sun5i-a13-mmc +.It +allwinner,sun7i-a20-mmc +.It +allwinner,sun50i-a64-mmc +.El +.Sh SYSCTL VARIABLES +The following read-only variables are available via +.Xr sysctl 8 : +.Bl -tag -width indent +.It Va dev.aw_mmc.req_timeout +Request timeout in seconds (default: 10) . +.El +.Sh SEE ALSO +.Xr fdt 4 , +.Xr mmc 4 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 10.0 . +.Sh AUTHORS +The +.Nm +device driver was originally written by +.An Alexander Fedorov Aq Mt alexander.fedorov@rtlservice.com . +Later work and this manual page was done by +.An Emmanuel Vadot Aq Mt manu@freebsd.org . Added: head/sys/arm/allwinner/aw_mmc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/aw_mmc.c Tue Dec 26 12:06:56 2017 (r327198) @@ -0,0 +1,922 @@ +/*- + * Copyright (c) 2013 Alexander Fedorov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include + +#include +#include +#include + +#define AW_MMC_MEMRES 0 +#define AW_MMC_IRQRES 1 +#define AW_MMC_RESSZ 2 +#define AW_MMC_DMA_SEGS ((MAXPHYS / PAGE_SIZE) + 1) +#define AW_MMC_DMA_MAX_SIZE 0x2000 +#define AW_MMC_DMA_FTRGLEVEL 0x20070008 +#define AW_MMC_RESET_RETRY 1000 + +#define CARD_ID_FREQUENCY 400000 + +static struct ofw_compat_data compat_data[] = { + {"allwinner,sun4i-a10-mmc", 1}, + {"allwinner,sun5i-a13-mmc", 1}, + {"allwinner,sun7i-a20-mmc", 1}, + {"allwinner,sun50i-a64-mmc", 1}, + {NULL, 0} +}; + +struct aw_mmc_softc { + device_t aw_dev; + clk_t aw_clk_ahb; + clk_t aw_clk_mmc; + hwreset_t aw_rst_ahb; + int aw_bus_busy; + int aw_resid; + int aw_timeout; + struct callout aw_timeoutc; + struct mmc_host aw_host; + struct mmc_request * aw_req; + struct mtx aw_mtx; + struct resource * aw_res[AW_MMC_RESSZ]; + uint32_t aw_intr; + uint32_t aw_intr_wait; + void * aw_intrhand; + + /* Fields required for DMA access. */ + bus_addr_t aw_dma_desc_phys; + bus_dmamap_t aw_dma_map; + bus_dma_tag_t aw_dma_tag; + void * aw_dma_desc; + bus_dmamap_t aw_dma_buf_map; + bus_dma_tag_t aw_dma_buf_tag; + int aw_dma_map_err; +}; + +static struct resource_spec aw_mmc_res_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 0, RF_ACTIVE | RF_SHAREABLE }, + { -1, 0, 0 } +}; + +static int aw_mmc_probe(device_t); +static int aw_mmc_attach(device_t); +static int aw_mmc_detach(device_t); +static int aw_mmc_setup_dma(struct aw_mmc_softc *); +static int aw_mmc_reset(struct aw_mmc_softc *); +static void aw_mmc_intr(void *); +static int aw_mmc_update_clock(struct aw_mmc_softc *, uint32_t); + +static int aw_mmc_update_ios(device_t, device_t); +static int aw_mmc_request(device_t, device_t, struct mmc_request *); +static int aw_mmc_get_ro(device_t, device_t); +static int aw_mmc_acquire_host(device_t, device_t); +static int aw_mmc_release_host(device_t, device_t); + +#define AW_MMC_LOCK(_sc) mtx_lock(&(_sc)->aw_mtx) +#define AW_MMC_UNLOCK(_sc) mtx_unlock(&(_sc)->aw_mtx) +#define AW_MMC_READ_4(_sc, _reg) \ + bus_read_4((_sc)->aw_res[AW_MMC_MEMRES], _reg) +#define AW_MMC_WRITE_4(_sc, _reg, _value) \ + bus_write_4((_sc)->aw_res[AW_MMC_MEMRES], _reg, _value) + +static int +aw_mmc_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + device_set_desc(dev, "Allwinner Integrated MMC/SD controller"); + + return (BUS_PROBE_DEFAULT); +} + +static int +aw_mmc_attach(device_t dev) +{ + device_t child; + struct aw_mmc_softc *sc; + struct sysctl_ctx_list *ctx; + struct sysctl_oid_list *tree; + uint32_t bus_width; + phandle_t node; + int error; + + node = ofw_bus_get_node(dev); + sc = device_get_softc(dev); + sc->aw_dev = dev; + sc->aw_req = NULL; + if (bus_alloc_resources(dev, aw_mmc_res_spec, sc->aw_res) != 0) { + device_printf(dev, "cannot allocate device resources\n"); + return (ENXIO); + } + if (bus_setup_intr(dev, sc->aw_res[AW_MMC_IRQRES], + INTR_TYPE_MISC | INTR_MPSAFE, NULL, aw_mmc_intr, sc, + &sc->aw_intrhand)) { + bus_release_resources(dev, aw_mmc_res_spec, sc->aw_res); + device_printf(dev, "cannot setup interrupt handler\n"); + return (ENXIO); + } + mtx_init(&sc->aw_mtx, device_get_nameunit(sc->aw_dev), "aw_mmc", + MTX_DEF); + callout_init_mtx(&sc->aw_timeoutc, &sc->aw_mtx, 0); + + /* De-assert reset */ + if (hwreset_get_by_ofw_name(dev, 0, "ahb", &sc->aw_rst_ahb) == 0) { + error = hwreset_deassert(sc->aw_rst_ahb); + if (error != 0) { + device_printf(dev, "cannot de-assert reset\n"); + goto fail; + } + } + + /* Activate the module clock. */ + error = clk_get_by_ofw_name(dev, 0, "ahb", &sc->aw_clk_ahb); + if (error != 0) { + device_printf(dev, "cannot get ahb clock\n"); + goto fail; + } + error = clk_enable(sc->aw_clk_ahb); + if (error != 0) { + device_printf(dev, "cannot enable ahb clock\n"); + goto fail; + } + error = clk_get_by_ofw_name(dev, 0, "mmc", &sc->aw_clk_mmc); + if (error != 0) { + device_printf(dev, "cannot get mmc clock\n"); + goto fail; + } + error = clk_set_freq(sc->aw_clk_mmc, CARD_ID_FREQUENCY, + CLK_SET_ROUND_DOWN); + if (error != 0) { + device_printf(dev, "cannot init mmc clock\n"); + goto fail; + } + error = clk_enable(sc->aw_clk_mmc); + if (error != 0) { + device_printf(dev, "cannot enable mmc clock\n"); + goto fail; + } + + sc->aw_timeout = 10; + ctx = device_get_sysctl_ctx(dev); + tree = SYSCTL_CHILDREN(device_get_sysctl_tree(dev)); + SYSCTL_ADD_INT(ctx, tree, OID_AUTO, "req_timeout", CTLFLAG_RW, + &sc->aw_timeout, 0, "Request timeout in seconds"); + + /* Hardware reset */ + AW_MMC_WRITE_4(sc, AW_MMC_HWRST, 1); + DELAY(100); + AW_MMC_WRITE_4(sc, AW_MMC_HWRST, 0); + DELAY(500); + + /* Soft Reset controller. */ + if (aw_mmc_reset(sc) != 0) { + device_printf(dev, "cannot reset the controller\n"); + goto fail; + } + + if (aw_mmc_setup_dma(sc) != 0) { + device_printf(sc->aw_dev, "Couldn't setup DMA!\n"); + goto fail; + } + + if (OF_getencprop(node, "bus-width", &bus_width, sizeof(uint32_t)) <= 0) + bus_width = 4; + + sc->aw_host.f_min = 400000; + sc->aw_host.f_max = 52000000; + sc->aw_host.host_ocr = MMC_OCR_320_330 | MMC_OCR_330_340; + sc->aw_host.mode = mode_sd; + sc->aw_host.caps = MMC_CAP_HSPEED; + if (bus_width >= 4) + sc->aw_host.caps |= MMC_CAP_4_BIT_DATA; + if (bus_width >= 8) + sc->aw_host.caps |= MMC_CAP_8_BIT_DATA; + + child = device_add_child(dev, "mmc", -1); + if (child == NULL) { + device_printf(dev, "attaching MMC bus failed!\n"); + goto fail; + } + if (device_probe_and_attach(child) != 0) { + device_printf(dev, "attaching MMC child failed!\n"); + device_delete_child(dev, child); + goto fail; + } + + return (0); + +fail: + callout_drain(&sc->aw_timeoutc); + mtx_destroy(&sc->aw_mtx); + bus_teardown_intr(dev, sc->aw_res[AW_MMC_IRQRES], sc->aw_intrhand); + bus_release_resources(dev, aw_mmc_res_spec, sc->aw_res); + + return (ENXIO); +} + +static int +aw_mmc_detach(device_t dev) +{ + + return (EBUSY); +} + +static void +aw_dma_desc_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int err) +{ + struct aw_mmc_softc *sc; + + sc = (struct aw_mmc_softc *)arg; + if (err) { + sc->aw_dma_map_err = err; + return; + } + sc->aw_dma_desc_phys = segs[0].ds_addr; +} + +static int +aw_mmc_setup_dma(struct aw_mmc_softc *sc) +{ + int dma_desc_size, error; + + /* Allocate the DMA descriptor memory. */ + dma_desc_size = sizeof(struct aw_mmc_dma_desc) * AW_MMC_DMA_SEGS; + error = bus_dma_tag_create(bus_get_dma_tag(sc->aw_dev), + AW_MMC_DMA_ALIGN, 0, + BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, + dma_desc_size, 1, dma_desc_size, 0, NULL, NULL, &sc->aw_dma_tag); + if (error) + return (error); + error = bus_dmamem_alloc(sc->aw_dma_tag, &sc->aw_dma_desc, + BUS_DMA_WAITOK | BUS_DMA_ZERO, &sc->aw_dma_map); + if (error) + return (error); + + error = bus_dmamap_load(sc->aw_dma_tag, sc->aw_dma_map, + sc->aw_dma_desc, dma_desc_size, aw_dma_desc_cb, sc, 0); + if (error) + return (error); + if (sc->aw_dma_map_err) + return (sc->aw_dma_map_err); + + /* Create the DMA map for data transfers. */ + error = bus_dma_tag_create(bus_get_dma_tag(sc->aw_dev), + AW_MMC_DMA_ALIGN, 0, + BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, + AW_MMC_DMA_MAX_SIZE * AW_MMC_DMA_SEGS, AW_MMC_DMA_SEGS, + AW_MMC_DMA_MAX_SIZE, BUS_DMA_ALLOCNOW, NULL, NULL, + &sc->aw_dma_buf_tag); + if (error) + return (error); + error = bus_dmamap_create(sc->aw_dma_buf_tag, 0, + &sc->aw_dma_buf_map); + if (error) + return (error); + + return (0); +} + +static void +aw_dma_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int err) +{ + int i; + struct aw_mmc_dma_desc *dma_desc; + struct aw_mmc_softc *sc; + + sc = (struct aw_mmc_softc *)arg; + sc->aw_dma_map_err = err; + + if (err) + return; + + dma_desc = sc->aw_dma_desc; + for (i = 0; i < nsegs; i++) { + dma_desc[i].buf_size = segs[i].ds_len; + dma_desc[i].buf_addr = segs[i].ds_addr; + dma_desc[i].config = AW_MMC_DMA_CONFIG_CH | + AW_MMC_DMA_CONFIG_OWN; + if (i == 0) + dma_desc[i].config |= AW_MMC_DMA_CONFIG_FD; + if (i < (nsegs - 1)) { + dma_desc[i].config |= AW_MMC_DMA_CONFIG_DIC; + dma_desc[i].next = sc->aw_dma_desc_phys + + ((i + 1) * sizeof(struct aw_mmc_dma_desc)); + } else { + dma_desc[i].config |= AW_MMC_DMA_CONFIG_LD | + AW_MMC_DMA_CONFIG_ER; + dma_desc[i].next = 0; + } + } +} + +static int +aw_mmc_prepare_dma(struct aw_mmc_softc *sc) +{ + bus_dmasync_op_t sync_op; + int error; + struct mmc_command *cmd; + uint32_t val; + + cmd = sc->aw_req->cmd; + if (cmd->data->len > AW_MMC_DMA_MAX_SIZE * AW_MMC_DMA_SEGS) + return (EFBIG); + error = bus_dmamap_load(sc->aw_dma_buf_tag, sc->aw_dma_buf_map, + cmd->data->data, cmd->data->len, aw_dma_cb, sc, 0); + if (error) + return (error); + if (sc->aw_dma_map_err) + return (sc->aw_dma_map_err); + + if (cmd->data->flags & MMC_DATA_WRITE) + sync_op = BUS_DMASYNC_PREWRITE; + else + sync_op = BUS_DMASYNC_PREREAD; + bus_dmamap_sync(sc->aw_dma_buf_tag, sc->aw_dma_buf_map, sync_op); + bus_dmamap_sync(sc->aw_dma_tag, sc->aw_dma_map, BUS_DMASYNC_PREWRITE); + + /* Enable DMA */ + val = AW_MMC_READ_4(sc, AW_MMC_GCTL); + val &= ~AW_MMC_CTRL_FIFO_AC_MOD; + val |= AW_MMC_CTRL_DMA_ENB; + AW_MMC_WRITE_4(sc, AW_MMC_GCTL, val); + + /* Reset DMA */ + val |= AW_MMC_CTRL_DMA_RST; + AW_MMC_WRITE_4(sc, AW_MMC_GCTL, val); + + AW_MMC_WRITE_4(sc, AW_MMC_DMAC, AW_MMC_DMAC_IDMAC_SOFT_RST); + AW_MMC_WRITE_4(sc, AW_MMC_DMAC, + AW_MMC_DMAC_IDMAC_IDMA_ON | AW_MMC_DMAC_IDMAC_FIX_BURST); + + /* Enable RX or TX DMA interrupt */ + if (cmd->data->flags & MMC_DATA_WRITE) + val |= AW_MMC_IDST_TX_INT; + else + val |= AW_MMC_IDST_RX_INT; + AW_MMC_WRITE_4(sc, AW_MMC_IDIE, val); + + /* Set DMA descritptor list address */ + AW_MMC_WRITE_4(sc, AW_MMC_DLBA, sc->aw_dma_desc_phys); + + /* FIFO trigger level */ + AW_MMC_WRITE_4(sc, AW_MMC_FWLR, AW_MMC_DMA_FTRGLEVEL); + + return (0); +} + +static int +aw_mmc_reset(struct aw_mmc_softc *sc) +{ + int timeout; + + AW_MMC_WRITE_4(sc, AW_MMC_GCTL, AW_MMC_RESET); + timeout = 1000; + while (--timeout > 0) { + if ((AW_MMC_READ_4(sc, AW_MMC_GCTL) & AW_MMC_RESET) == 0) + break; + DELAY(100); + } + if (timeout == 0) + return (ETIMEDOUT); + + /* Set the timeout. */ + AW_MMC_WRITE_4(sc, AW_MMC_TMOR, + AW_MMC_TMOR_DTO_LMT_SHIFT(AW_MMC_TMOR_DTO_LMT_MASK) | + AW_MMC_TMOR_RTO_LMT_SHIFT(AW_MMC_TMOR_RTO_LMT_MASK)); + + /* Clear pending interrupts. */ + AW_MMC_WRITE_4(sc, AW_MMC_RISR, 0xffffffff); + AW_MMC_WRITE_4(sc, AW_MMC_IDST, 0xffffffff); + /* Unmask interrupts. */ + AW_MMC_WRITE_4(sc, AW_MMC_IMKR, + AW_MMC_INT_CMD_DONE | AW_MMC_INT_ERR_BIT | + AW_MMC_INT_DATA_OVER | AW_MMC_INT_AUTO_STOP_DONE); + /* Enable interrupts and AHB access. */ + AW_MMC_WRITE_4(sc, AW_MMC_GCTL, + AW_MMC_READ_4(sc, AW_MMC_GCTL) | AW_MMC_CTRL_INT_ENB); + + return (0); +} + +static void +aw_mmc_req_done(struct aw_mmc_softc *sc) +{ + struct mmc_command *cmd; + struct mmc_request *req; + uint32_t val, mask; + int retry; + + cmd = sc->aw_req->cmd; + if (cmd->error != MMC_ERR_NONE) { + /* Reset the FIFO and DMA engines. */ + mask = AW_MMC_CTRL_FIFO_RST | AW_MMC_CTRL_DMA_RST; + val = AW_MMC_READ_4(sc, AW_MMC_GCTL); + AW_MMC_WRITE_4(sc, AW_MMC_GCTL, val | mask); + + retry = AW_MMC_RESET_RETRY; + while (--retry > 0) { + val = AW_MMC_READ_4(sc, AW_MMC_GCTL); + if ((val & mask) == 0) + break; + DELAY(10); + } + if (retry == 0) + device_printf(sc->aw_dev, + "timeout resetting DMA/FIFO\n"); + aw_mmc_update_clock(sc, 1); + } + + req = sc->aw_req; + callout_stop(&sc->aw_timeoutc); + sc->aw_req = NULL; + sc->aw_intr = 0; + sc->aw_resid = 0; + sc->aw_dma_map_err = 0; + sc->aw_intr_wait = 0; + req->done(req); +} + +static void +aw_mmc_req_ok(struct aw_mmc_softc *sc) +{ + int timeout; + struct mmc_command *cmd; + uint32_t status; + + timeout = 1000; + while (--timeout > 0) { + status = AW_MMC_READ_4(sc, AW_MMC_STAR); + if ((status & AW_MMC_STAR_CARD_BUSY) == 0) + break; + DELAY(1000); + } + cmd = sc->aw_req->cmd; + if (timeout == 0) { + cmd->error = MMC_ERR_FAILED; + aw_mmc_req_done(sc); + return; + } + if (cmd->flags & MMC_RSP_PRESENT) { + if (cmd->flags & MMC_RSP_136) { + cmd->resp[0] = AW_MMC_READ_4(sc, AW_MMC_RESP3); + cmd->resp[1] = AW_MMC_READ_4(sc, AW_MMC_RESP2); + cmd->resp[2] = AW_MMC_READ_4(sc, AW_MMC_RESP1); + cmd->resp[3] = AW_MMC_READ_4(sc, AW_MMC_RESP0); + } else + cmd->resp[0] = AW_MMC_READ_4(sc, AW_MMC_RESP0); + } + /* All data has been transferred ? */ + if (cmd->data != NULL && (sc->aw_resid << 2) < cmd->data->len) + cmd->error = MMC_ERR_FAILED; + aw_mmc_req_done(sc); +} + +static void +aw_mmc_timeout(void *arg) +{ + struct aw_mmc_softc *sc; + + sc = (struct aw_mmc_softc *)arg; + if (sc->aw_req != NULL) { + device_printf(sc->aw_dev, "controller timeout\n"); + sc->aw_req->cmd->error = MMC_ERR_TIMEOUT; + aw_mmc_req_done(sc); + } else + device_printf(sc->aw_dev, + "Spurious timeout - no active request\n"); +} + +static void +aw_mmc_intr(void *arg) +{ + bus_dmasync_op_t sync_op; + struct aw_mmc_softc *sc; + struct mmc_data *data; + uint32_t idst, imask, rint; + + sc = (struct aw_mmc_softc *)arg; + AW_MMC_LOCK(sc); + rint = AW_MMC_READ_4(sc, AW_MMC_RISR); + idst = AW_MMC_READ_4(sc, AW_MMC_IDST); + imask = AW_MMC_READ_4(sc, AW_MMC_IMKR); + if (idst == 0 && imask == 0 && rint == 0) { + AW_MMC_UNLOCK(sc); + return; + } +#ifdef DEBUG + device_printf(sc->aw_dev, "idst: %#x, imask: %#x, rint: %#x\n", + idst, imask, rint); +#endif + if (sc->aw_req == NULL) { + device_printf(sc->aw_dev, + "Spurious interrupt - no active request, rint: 0x%08X\n", + rint); + goto end; + } + if (rint & AW_MMC_INT_ERR_BIT) { + device_printf(sc->aw_dev, "error rint: 0x%08X\n", rint); + if (rint & AW_MMC_INT_RESP_TIMEOUT) + sc->aw_req->cmd->error = MMC_ERR_TIMEOUT; + else + sc->aw_req->cmd->error = MMC_ERR_FAILED; + aw_mmc_req_done(sc); + goto end; + } + if (idst & AW_MMC_IDST_ERROR) { + device_printf(sc->aw_dev, "error idst: 0x%08x\n", idst); + sc->aw_req->cmd->error = MMC_ERR_FAILED; + aw_mmc_req_done(sc); + goto end; + } + + sc->aw_intr |= rint; + data = sc->aw_req->cmd->data; + if (data != NULL && (idst & AW_MMC_IDST_COMPLETE) != 0) { + if (data->flags & MMC_DATA_WRITE) + sync_op = BUS_DMASYNC_POSTWRITE; + else + sync_op = BUS_DMASYNC_POSTREAD; + bus_dmamap_sync(sc->aw_dma_buf_tag, sc->aw_dma_buf_map, + sync_op); + bus_dmamap_sync(sc->aw_dma_tag, sc->aw_dma_map, + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(sc->aw_dma_buf_tag, sc->aw_dma_buf_map); + sc->aw_resid = data->len >> 2; + } + if ((sc->aw_intr & sc->aw_intr_wait) == sc->aw_intr_wait) + aw_mmc_req_ok(sc); + +end: + AW_MMC_WRITE_4(sc, AW_MMC_IDST, idst); + AW_MMC_WRITE_4(sc, AW_MMC_RISR, rint); + AW_MMC_UNLOCK(sc); +} + +static int +aw_mmc_request(device_t bus, device_t child, struct mmc_request *req) +{ + int blksz; + struct aw_mmc_softc *sc; + struct mmc_command *cmd; + uint32_t cmdreg; + int err; + + sc = device_get_softc(bus); + AW_MMC_LOCK(sc); + if (sc->aw_req) { + AW_MMC_UNLOCK(sc); + return (EBUSY); + } + sc->aw_req = req; + cmd = req->cmd; + cmdreg = AW_MMC_CMDR_LOAD; + if (cmd->opcode == MMC_GO_IDLE_STATE) + cmdreg |= AW_MMC_CMDR_SEND_INIT_SEQ; + if (cmd->flags & MMC_RSP_PRESENT) + cmdreg |= AW_MMC_CMDR_RESP_RCV; + if (cmd->flags & MMC_RSP_136) + cmdreg |= AW_MMC_CMDR_LONG_RESP; + if (cmd->flags & MMC_RSP_CRC) + cmdreg |= AW_MMC_CMDR_CHK_RESP_CRC; + + sc->aw_intr = 0; + sc->aw_resid = 0; + sc->aw_intr_wait = AW_MMC_INT_CMD_DONE; + cmd->error = MMC_ERR_NONE; + if (cmd->data != NULL) { + sc->aw_intr_wait |= AW_MMC_INT_DATA_OVER; + cmdreg |= AW_MMC_CMDR_DATA_TRANS | AW_MMC_CMDR_WAIT_PRE_OVER; + if (cmd->data->flags & MMC_DATA_MULTI) { + cmdreg |= AW_MMC_CMDR_STOP_CMD_FLAG; + sc->aw_intr_wait |= AW_MMC_INT_AUTO_STOP_DONE; + } + if (cmd->data->flags & MMC_DATA_WRITE) + cmdreg |= AW_MMC_CMDR_DIR_WRITE; + blksz = min(cmd->data->len, MMC_SECTOR_SIZE); + AW_MMC_WRITE_4(sc, AW_MMC_BKSR, blksz); + AW_MMC_WRITE_4(sc, AW_MMC_BYCR, cmd->data->len); + + err = aw_mmc_prepare_dma(sc); + if (err != 0) + device_printf(sc->aw_dev, "prepare_dma failed: %d\n", err); + } + + AW_MMC_WRITE_4(sc, AW_MMC_CAGR, cmd->arg); + AW_MMC_WRITE_4(sc, AW_MMC_CMDR, cmdreg | cmd->opcode); + callout_reset(&sc->aw_timeoutc, sc->aw_timeout * hz, + aw_mmc_timeout, sc); + AW_MMC_UNLOCK(sc); + + return (0); +} + +static int +aw_mmc_read_ivar(device_t bus, device_t child, int which, + uintptr_t *result) +{ + struct aw_mmc_softc *sc; + + sc = device_get_softc(bus); + switch (which) { + default: + return (EINVAL); + case MMCBR_IVAR_BUS_MODE: + *(int *)result = sc->aw_host.ios.bus_mode; + break; + case MMCBR_IVAR_BUS_WIDTH: + *(int *)result = sc->aw_host.ios.bus_width; + break; + case MMCBR_IVAR_CHIP_SELECT: + *(int *)result = sc->aw_host.ios.chip_select; + break; + case MMCBR_IVAR_CLOCK: + *(int *)result = sc->aw_host.ios.clock; + break; + case MMCBR_IVAR_F_MIN: + *(int *)result = sc->aw_host.f_min; + break; + case MMCBR_IVAR_F_MAX: + *(int *)result = sc->aw_host.f_max; + break; + case MMCBR_IVAR_HOST_OCR: + *(int *)result = sc->aw_host.host_ocr; + break; + case MMCBR_IVAR_MODE: + *(int *)result = sc->aw_host.mode; + break; + case MMCBR_IVAR_OCR: + *(int *)result = sc->aw_host.ocr; + break; + case MMCBR_IVAR_POWER_MODE: + *(int *)result = sc->aw_host.ios.power_mode; + break; + case MMCBR_IVAR_VDD: + *(int *)result = sc->aw_host.ios.vdd; + break; + case MMCBR_IVAR_CAPS: + *(int *)result = sc->aw_host.caps; + break; + case MMCBR_IVAR_MAX_DATA: + *(int *)result = 65535; + break; + } + + return (0); +} + +static int +aw_mmc_write_ivar(device_t bus, device_t child, int which, + uintptr_t value) +{ + struct aw_mmc_softc *sc; + + sc = device_get_softc(bus); + switch (which) { + default: + return (EINVAL); + case MMCBR_IVAR_BUS_MODE: + sc->aw_host.ios.bus_mode = value; + break; + case MMCBR_IVAR_BUS_WIDTH: + sc->aw_host.ios.bus_width = value; + break; + case MMCBR_IVAR_CHIP_SELECT: + sc->aw_host.ios.chip_select = value; + break; + case MMCBR_IVAR_CLOCK: + sc->aw_host.ios.clock = value; + break; + case MMCBR_IVAR_MODE: + sc->aw_host.mode = value; + break; + case MMCBR_IVAR_OCR: + sc->aw_host.ocr = value; + break; + case MMCBR_IVAR_POWER_MODE: + sc->aw_host.ios.power_mode = value; + break; + case MMCBR_IVAR_VDD: + sc->aw_host.ios.vdd = value; + break; + /* These are read-only */ + case MMCBR_IVAR_CAPS: + case MMCBR_IVAR_HOST_OCR: + case MMCBR_IVAR_F_MIN: + case MMCBR_IVAR_F_MAX: + case MMCBR_IVAR_MAX_DATA: + return (EINVAL); + } + + return (0); +} + +static int +aw_mmc_update_clock(struct aw_mmc_softc *sc, uint32_t clkon) +{ + uint32_t cmdreg; + int retry; + uint32_t ckcr; + + ckcr = AW_MMC_READ_4(sc, AW_MMC_CKCR); + ckcr &= ~(AW_MMC_CKCR_CCLK_ENB | AW_MMC_CKCR_CCLK_CTRL); + + if (clkon) + ckcr |= AW_MMC_CKCR_CCLK_ENB; + + AW_MMC_WRITE_4(sc, AW_MMC_CKCR, ckcr); + + cmdreg = AW_MMC_CMDR_LOAD | AW_MMC_CMDR_PRG_CLK | + AW_MMC_CMDR_WAIT_PRE_OVER; + AW_MMC_WRITE_4(sc, AW_MMC_CMDR, cmdreg); + retry = 0xfffff; + while (--retry > 0) { + if ((AW_MMC_READ_4(sc, AW_MMC_CMDR) & AW_MMC_CMDR_LOAD) == 0) { + AW_MMC_WRITE_4(sc, AW_MMC_RISR, 0xffffffff); + return (0); + } + DELAY(10); + } + AW_MMC_WRITE_4(sc, AW_MMC_RISR, 0xffffffff); + device_printf(sc->aw_dev, "timeout updating clock\n"); + + return (ETIMEDOUT); +} + +static int +aw_mmc_update_ios(device_t bus, device_t child) +{ + int error; + struct aw_mmc_softc *sc; + struct mmc_ios *ios; + uint32_t ckcr; + + sc = device_get_softc(bus); + + ios = &sc->aw_host.ios; + + /* Set the bus width. */ + switch (ios->bus_width) { + case bus_width_1: + AW_MMC_WRITE_4(sc, AW_MMC_BWDR, AW_MMC_BWDR1); + break; + case bus_width_4: + AW_MMC_WRITE_4(sc, AW_MMC_BWDR, AW_MMC_BWDR4); + break; + case bus_width_8: + AW_MMC_WRITE_4(sc, AW_MMC_BWDR, AW_MMC_BWDR8); + break; + } + + if (ios->clock) { + + /* Disable clock */ + error = aw_mmc_update_clock(sc, 0); + if (error != 0) + return (error); + + /* Reset the divider. */ + ckcr = AW_MMC_READ_4(sc, AW_MMC_CKCR); + ckcr &= ~AW_MMC_CKCR_CCLK_DIV; + AW_MMC_WRITE_4(sc, AW_MMC_CKCR, ckcr); + + /* Set the MMC clock. */ + error = clk_set_freq(sc->aw_clk_mmc, ios->clock, + CLK_SET_ROUND_DOWN); + if (error != 0) { + device_printf(sc->aw_dev, + "failed to set frequency to %u Hz: %d\n", + ios->clock, error); + return (error); + } + + /* Enable clock. */ + error = aw_mmc_update_clock(sc, 1); + if (error != 0) + return (error); + } + + + return (0); +} + +static int +aw_mmc_get_ro(device_t bus, device_t child) +{ + + return (0); +} + +static int +aw_mmc_acquire_host(device_t bus, device_t child) +{ + struct aw_mmc_softc *sc; + int error; + + sc = device_get_softc(bus); + AW_MMC_LOCK(sc); + while (sc->aw_bus_busy) { + error = msleep(sc, &sc->aw_mtx, PCATCH, "mmchw", 0); + if (error != 0) { + AW_MMC_UNLOCK(sc); + return (error); + } + } + sc->aw_bus_busy++; + AW_MMC_UNLOCK(sc); + + return (0); +} + +static int +aw_mmc_release_host(device_t bus, device_t child) +{ + struct aw_mmc_softc *sc; + + sc = device_get_softc(bus); + AW_MMC_LOCK(sc); + sc->aw_bus_busy--; + wakeup(sc); + AW_MMC_UNLOCK(sc); + + return (0); +} + +static device_method_t aw_mmc_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, aw_mmc_probe), + DEVMETHOD(device_attach, aw_mmc_attach), + DEVMETHOD(device_detach, aw_mmc_detach), + + /* Bus interface */ + DEVMETHOD(bus_read_ivar, aw_mmc_read_ivar), + DEVMETHOD(bus_write_ivar, aw_mmc_write_ivar), + + /* MMC bridge interface */ + DEVMETHOD(mmcbr_update_ios, aw_mmc_update_ios), + DEVMETHOD(mmcbr_request, aw_mmc_request), + DEVMETHOD(mmcbr_get_ro, aw_mmc_get_ro), + DEVMETHOD(mmcbr_acquire_host, aw_mmc_acquire_host), + DEVMETHOD(mmcbr_release_host, aw_mmc_release_host), + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Dec 26 12:11:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B01EE89D79; Tue, 26 Dec 2017 12:11:06 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF59972CDC; Tue, 26 Dec 2017 12:11:05 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBQCB4c8063863; Tue, 26 Dec 2017 12:11:04 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBQCB4Po063860; Tue, 26 Dec 2017 12:11:04 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201712261211.vBQCB4Po063860@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 26 Dec 2017 12:11:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327199 - in head: share/man/man4 sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head: share/man/man4 sys/arm/allwinner X-SVN-Commit-Revision: 327199 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 12:11:06 -0000 Author: manu Date: Tue Dec 26 12:11:04 2017 New Revision: 327199 URL: https://svnweb.freebsd.org/changeset/base/327199 Log: Allwinner: gpio: Rename driver to aw_gpio and add man page for it Reviewed by: bcr (manpages) Differential Revision: https://reviews.freebsd.org/D13617 Added: head/share/man/man4/aw_gpio.4 (contents, props changed) head/sys/arm/allwinner/aw_gpio.c - copied, changed from r327196, head/sys/arm/allwinner/a10_gpio.c Deleted: head/sys/arm/allwinner/a10_gpio.c Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Tue Dec 26 12:06:56 2017 (r327198) +++ head/share/man/man4/Makefile Tue Dec 26 12:11:04 2017 (r327199) @@ -70,6 +70,7 @@ MAN= aac.4 \ audit.4 \ auditpipe.4 \ aue.4 \ + aw_gpio.4 \ aw_mmc.4 \ aw_rtc.4 \ axe.4 \ Added: head/share/man/man4/aw_gpio.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/aw_gpio.4 Tue Dec 26 12:11:04 2017 (r327199) @@ -0,0 +1,102 @@ +.\"- +.\" Copyright (c) 2017 Emmanuel Vadot +.\" 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 Dec 25, 2017 +.Dt AW_GPIO 4 +.Os +.Sh NAME +.Nm aw_gpio +.Nd driver for the GPIO and pin muxing functionalities on Allwinner SoC +.Sh SYNOPSIS +.Cd "device gpio" +.Cd "options SOC_ALLWINNER_A10" +.Cd "options SOC_ALLWINNER_A13" +.Cd "options SOC_ALLWINNER_A20" +.Cd "options SOC_ALLWINNER_A31" +.Cd "options SOC_ALLWINNER_A31S" +.Cd "options SOC_ALLWINNER_A33" +.Cd "options SOC_ALLWINNER_A83T" +.Cd "options SOC_ALLWINNER_H2PLUS" +.Cd "options SOC_ALLWINNER_H3" +.Cd "options SOC_ALLWINNER_A64" +.Cd "options SOC_ALLWINNER_H5" +.Sh DESCRIPTION +The +.Nm +device driver provides support for the Allwinner pin muxing and GPIO on +Allwinner SoCs. +.Sh HARDWARE +The current version of the +.Nm +driver supports the GPIO/pinmuxing controller with one of the following +compatible strings : +.Pp +.Bl -bullet -compact +.It +allwinner,sun4i-a10-pinctrl +.It +allwinner,sun5i-a13-pinctrl +.It +allwinner,sun7i-a20-pinctrl +.It +allwinner,sun6i-a31-pinctrl +.It +allwinner,sun6i-a31s-pinctrl +.It +allwinner,sun6i-a31-r-pinctrl +.It +allwinner,sun6i-a33-pinctrl +.It +allwinner,sun8i-a83t-pinctrl +.It +allwinner,sun8i-a83t-r-pinctrl +.It +allwinner,sun8i-h3-pinctrl +.It +allwinner,sun50i-h5-pinctrl +.It +allwinner,sun8i-h3-r-pinctrl +.It +allwinner,sun50i-a64-pinctrl +.It +allwinner,sun50i-a64-r-pinctrl +.El +.Sh SEE ALSO +.Xr fdt 4 , +.Xr gpio 4 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 10.0 . +.Sh AUTHORS +The +.Nm +device driver was originally written by +.An Ganbold Tsagaankhuu Aq Mt ganbold@freebsd.org . +This manual page was written by +.An Emmanuel Vadot Aq Mt manu@freebsd.org . Copied and modified: head/sys/arm/allwinner/aw_gpio.c (from r327196, head/sys/arm/allwinner/a10_gpio.c) ============================================================================== --- head/sys/arm/allwinner/a10_gpio.c Tue Dec 26 10:09:18 2017 (r327196, copy source) +++ head/sys/arm/allwinner/aw_gpio.c Tue Dec 26 12:11:04 2017 (r327199) @@ -62,15 +62,15 @@ __FBSDID("$FreeBSD$"); #include "gpio_if.h" -#define A10_GPIO_DEFAULT_CAPS (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT | \ +#define AW_GPIO_DEFAULT_CAPS (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT | \ GPIO_PIN_PULLUP | GPIO_PIN_PULLDOWN) -#define A10_GPIO_NONE 0 -#define A10_GPIO_PULLUP 1 -#define A10_GPIO_PULLDOWN 2 +#define AW_GPIO_NONE 0 +#define AW_GPIO_PULLUP 1 +#define AW_GPIO_PULLDOWN 2 -#define A10_GPIO_INPUT 0 -#define A10_GPIO_OUTPUT 1 +#define AW_GPIO_INPUT 0 +#define AW_GPIO_OUTPUT 1 #define AW_GPIO_DRV_MASK 0x3 #define AW_GPIO_PUD_MASK 0x3 @@ -78,7 +78,7 @@ __FBSDID("$FreeBSD$"); #define AW_PINCTRL 1 #define AW_R_PINCTRL 2 -/* Defined in a10_padconf.c */ +/* Defined in aw_padconf.c */ #ifdef SOC_ALLWINNER_A10 extern const struct allwinner_padconf a10_padconf; #endif @@ -173,7 +173,7 @@ struct clk_list { clk_t clk; }; -struct a10_gpio_softc { +struct aw_gpio_softc { device_t sc_dev; device_t sc_busdev; struct mtx sc_mtx; @@ -186,46 +186,46 @@ struct a10_gpio_softc { TAILQ_HEAD(, clk_list) clk_list; }; -#define A10_GPIO_LOCK(_sc) mtx_lock_spin(&(_sc)->sc_mtx) -#define A10_GPIO_UNLOCK(_sc) mtx_unlock_spin(&(_sc)->sc_mtx) -#define A10_GPIO_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->sc_mtx, MA_OWNED) +#define AW_GPIO_LOCK(_sc) mtx_lock_spin(&(_sc)->sc_mtx) +#define AW_GPIO_UNLOCK(_sc) mtx_unlock_spin(&(_sc)->sc_mtx) +#define AW_GPIO_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->sc_mtx, MA_OWNED) -#define A10_GPIO_GP_CFG(_bank, _idx) 0x00 + ((_bank) * 0x24) + ((_idx) << 2) -#define A10_GPIO_GP_DAT(_bank) 0x10 + ((_bank) * 0x24) -#define A10_GPIO_GP_DRV(_bank, _idx) 0x14 + ((_bank) * 0x24) + ((_idx) << 2) -#define A10_GPIO_GP_PUL(_bank, _idx) 0x1c + ((_bank) * 0x24) + ((_idx) << 2) +#define AW_GPIO_GP_CFG(_bank, _idx) 0x00 + ((_bank) * 0x24) + ((_idx) << 2) +#define AW_GPIO_GP_DAT(_bank) 0x10 + ((_bank) * 0x24) +#define AW_GPIO_GP_DRV(_bank, _idx) 0x14 + ((_bank) * 0x24) + ((_idx) << 2) +#define AW_GPIO_GP_PUL(_bank, _idx) 0x1c + ((_bank) * 0x24) + ((_idx) << 2) -#define A10_GPIO_GP_INT_CFG0 0x200 -#define A10_GPIO_GP_INT_CFG1 0x204 -#define A10_GPIO_GP_INT_CFG2 0x208 -#define A10_GPIO_GP_INT_CFG3 0x20c +#define AW_GPIO_GP_INT_CFG0 0x200 +#define AW_GPIO_GP_INT_CFG1 0x204 +#define AW_GPIO_GP_INT_CFG2 0x208 +#define AW_GPIO_GP_INT_CFG3 0x20c -#define A10_GPIO_GP_INT_CTL 0x210 -#define A10_GPIO_GP_INT_STA 0x214 -#define A10_GPIO_GP_INT_DEB 0x218 +#define AW_GPIO_GP_INT_CTL 0x210 +#define AW_GPIO_GP_INT_STA 0x214 +#define AW_GPIO_GP_INT_DEB 0x218 -static char *a10_gpio_parse_function(phandle_t node); -static const char **a10_gpio_parse_pins(phandle_t node, int *pins_nb); -static uint32_t a10_gpio_parse_bias(phandle_t node); -static int a10_gpio_parse_drive_strength(phandle_t node, uint32_t *drive); +static char *aw_gpio_parse_function(phandle_t node); +static const char **aw_gpio_parse_pins(phandle_t node, int *pins_nb); +static uint32_t aw_gpio_parse_bias(phandle_t node); +static int aw_gpio_parse_drive_strength(phandle_t node, uint32_t *drive); -static int a10_gpio_pin_get(device_t dev, uint32_t pin, unsigned int *value); -static int a10_gpio_pin_set(device_t dev, uint32_t pin, unsigned int value); -static int a10_gpio_pin_get_locked(struct a10_gpio_softc *sc, uint32_t pin, unsigned int *value); -static int a10_gpio_pin_set_locked(struct a10_gpio_softc *sc, uint32_t pin, unsigned int value); +static int aw_gpio_pin_get(device_t dev, uint32_t pin, unsigned int *value); +static int aw_gpio_pin_set(device_t dev, uint32_t pin, unsigned int value); +static int aw_gpio_pin_get_locked(struct aw_gpio_softc *sc, uint32_t pin, unsigned int *value); +static int aw_gpio_pin_set_locked(struct aw_gpio_softc *sc, uint32_t pin, unsigned int value); -#define A10_GPIO_WRITE(_sc, _off, _val) \ +#define AW_GPIO_WRITE(_sc, _off, _val) \ bus_space_write_4(_sc->sc_bst, _sc->sc_bsh, _off, _val) -#define A10_GPIO_READ(_sc, _off) \ +#define AW_GPIO_READ(_sc, _off) \ bus_space_read_4(_sc->sc_bst, _sc->sc_bsh, _off) static uint32_t -a10_gpio_get_function(struct a10_gpio_softc *sc, uint32_t pin) +aw_gpio_get_function(struct aw_gpio_softc *sc, uint32_t pin) { uint32_t bank, func, offset; /* Must be called with lock held. */ - A10_GPIO_LOCK_ASSERT(sc); + AW_GPIO_LOCK_ASSERT(sc); if (pin > sc->padconf->npins) return (0); @@ -233,13 +233,13 @@ a10_gpio_get_function(struct a10_gpio_softc *sc, uint3 pin = sc->padconf->pins[pin].pin; offset = ((pin & 0x07) << 2); - func = A10_GPIO_READ(sc, A10_GPIO_GP_CFG(bank, pin >> 3)); + func = AW_GPIO_READ(sc, AW_GPIO_GP_CFG(bank, pin >> 3)); return ((func >> offset) & 0x7); } static int -a10_gpio_set_function(struct a10_gpio_softc *sc, uint32_t pin, uint32_t f) +aw_gpio_set_function(struct aw_gpio_softc *sc, uint32_t pin, uint32_t f) { uint32_t bank, data, offset; @@ -248,127 +248,127 @@ a10_gpio_set_function(struct a10_gpio_softc *sc, uint3 return (EINVAL); /* Must be called with lock held. */ - A10_GPIO_LOCK_ASSERT(sc); + AW_GPIO_LOCK_ASSERT(sc); bank = sc->padconf->pins[pin].port; pin = sc->padconf->pins[pin].pin; offset = ((pin & 0x07) << 2); - data = A10_GPIO_READ(sc, A10_GPIO_GP_CFG(bank, pin >> 3)); + data = AW_GPIO_READ(sc, AW_GPIO_GP_CFG(bank, pin >> 3)); data &= ~(7 << offset); data |= (f << offset); - A10_GPIO_WRITE(sc, A10_GPIO_GP_CFG(bank, pin >> 3), data); + AW_GPIO_WRITE(sc, AW_GPIO_GP_CFG(bank, pin >> 3), data); return (0); } static uint32_t -a10_gpio_get_pud(struct a10_gpio_softc *sc, uint32_t pin) +aw_gpio_get_pud(struct aw_gpio_softc *sc, uint32_t pin) { uint32_t bank, offset, val; /* Must be called with lock held. */ - A10_GPIO_LOCK_ASSERT(sc); + AW_GPIO_LOCK_ASSERT(sc); bank = sc->padconf->pins[pin].port; pin = sc->padconf->pins[pin].pin; offset = ((pin & 0x0f) << 1); - val = A10_GPIO_READ(sc, A10_GPIO_GP_PUL(bank, pin >> 4)); + val = AW_GPIO_READ(sc, AW_GPIO_GP_PUL(bank, pin >> 4)); return ((val >> offset) & AW_GPIO_PUD_MASK); } static void -a10_gpio_set_pud(struct a10_gpio_softc *sc, uint32_t pin, uint32_t state) +aw_gpio_set_pud(struct aw_gpio_softc *sc, uint32_t pin, uint32_t state) { uint32_t bank, offset, val; - if (a10_gpio_get_pud(sc, pin) == state) + if (aw_gpio_get_pud(sc, pin) == state) return; /* Must be called with lock held. */ - A10_GPIO_LOCK_ASSERT(sc); + AW_GPIO_LOCK_ASSERT(sc); bank = sc->padconf->pins[pin].port; pin = sc->padconf->pins[pin].pin; offset = ((pin & 0x0f) << 1); - val = A10_GPIO_READ(sc, A10_GPIO_GP_PUL(bank, pin >> 4)); + val = AW_GPIO_READ(sc, AW_GPIO_GP_PUL(bank, pin >> 4)); val &= ~(AW_GPIO_PUD_MASK << offset); val |= (state << offset); - A10_GPIO_WRITE(sc, A10_GPIO_GP_PUL(bank, pin >> 4), val); + AW_GPIO_WRITE(sc, AW_GPIO_GP_PUL(bank, pin >> 4), val); } static uint32_t -a10_gpio_get_drv(struct a10_gpio_softc *sc, uint32_t pin) +aw_gpio_get_drv(struct aw_gpio_softc *sc, uint32_t pin) { uint32_t bank, offset, val; /* Must be called with lock held. */ - A10_GPIO_LOCK_ASSERT(sc); + AW_GPIO_LOCK_ASSERT(sc); bank = sc->padconf->pins[pin].port; pin = sc->padconf->pins[pin].pin; offset = ((pin & 0x0f) << 1); - val = A10_GPIO_READ(sc, A10_GPIO_GP_DRV(bank, pin >> 4)); + val = AW_GPIO_READ(sc, AW_GPIO_GP_DRV(bank, pin >> 4)); return ((val >> offset) & AW_GPIO_DRV_MASK); } static void -a10_gpio_set_drv(struct a10_gpio_softc *sc, uint32_t pin, uint32_t drive) +aw_gpio_set_drv(struct aw_gpio_softc *sc, uint32_t pin, uint32_t drive) { uint32_t bank, offset, val; - if (a10_gpio_get_drv(sc, pin) == drive) + if (aw_gpio_get_drv(sc, pin) == drive) return; /* Must be called with lock held. */ - A10_GPIO_LOCK_ASSERT(sc); + AW_GPIO_LOCK_ASSERT(sc); bank = sc->padconf->pins[pin].port; pin = sc->padconf->pins[pin].pin; offset = ((pin & 0x0f) << 1); - val = A10_GPIO_READ(sc, A10_GPIO_GP_DRV(bank, pin >> 4)); + val = AW_GPIO_READ(sc, AW_GPIO_GP_DRV(bank, pin >> 4)); val &= ~(AW_GPIO_DRV_MASK << offset); val |= (drive << offset); - A10_GPIO_WRITE(sc, A10_GPIO_GP_DRV(bank, pin >> 4), val); + AW_GPIO_WRITE(sc, AW_GPIO_GP_DRV(bank, pin >> 4), val); } static int -a10_gpio_pin_configure(struct a10_gpio_softc *sc, uint32_t pin, uint32_t flags) +aw_gpio_pin_configure(struct aw_gpio_softc *sc, uint32_t pin, uint32_t flags) { u_int val; int err = 0; /* Must be called with lock held. */ - A10_GPIO_LOCK_ASSERT(sc); + AW_GPIO_LOCK_ASSERT(sc); if (pin > sc->padconf->npins) return (EINVAL); /* Manage input/output. */ if (flags & GPIO_PIN_INPUT) { - err = a10_gpio_set_function(sc, pin, A10_GPIO_INPUT); + err = aw_gpio_set_function(sc, pin, AW_GPIO_INPUT); } else if ((flags & GPIO_PIN_OUTPUT) && - a10_gpio_get_function(sc, pin) != A10_GPIO_OUTPUT) { + aw_gpio_get_function(sc, pin) != AW_GPIO_OUTPUT) { if (flags & GPIO_PIN_PRESET_LOW) { - a10_gpio_pin_set_locked(sc, pin, 0); + aw_gpio_pin_set_locked(sc, pin, 0); } else if (flags & GPIO_PIN_PRESET_HIGH) { - a10_gpio_pin_set_locked(sc, pin, 1); + aw_gpio_pin_set_locked(sc, pin, 1); } else { /* Read the pin and preset output to current state. */ - err = a10_gpio_set_function(sc, pin, A10_GPIO_INPUT); + err = aw_gpio_set_function(sc, pin, AW_GPIO_INPUT); if (err == 0) { - a10_gpio_pin_get_locked(sc, pin, &val); - a10_gpio_pin_set_locked(sc, pin, val); + aw_gpio_pin_get_locked(sc, pin, &val); + aw_gpio_pin_set_locked(sc, pin, val); } } if (err == 0) - err = a10_gpio_set_function(sc, pin, A10_GPIO_OUTPUT); + err = aw_gpio_set_function(sc, pin, AW_GPIO_OUTPUT); } if (err) @@ -376,19 +376,19 @@ a10_gpio_pin_configure(struct a10_gpio_softc *sc, uint /* Manage Pull-up/pull-down. */ if (flags & GPIO_PIN_PULLUP) - a10_gpio_set_pud(sc, pin, A10_GPIO_PULLUP); + aw_gpio_set_pud(sc, pin, AW_GPIO_PULLUP); else if (flags & GPIO_PIN_PULLDOWN) - a10_gpio_set_pud(sc, pin, A10_GPIO_PULLDOWN); + aw_gpio_set_pud(sc, pin, AW_GPIO_PULLDOWN); else - a10_gpio_set_pud(sc, pin, A10_GPIO_NONE); + aw_gpio_set_pud(sc, pin, AW_GPIO_NONE); return (0); } static device_t -a10_gpio_get_bus(device_t dev) +aw_gpio_get_bus(device_t dev) { - struct a10_gpio_softc *sc; + struct aw_gpio_softc *sc; sc = device_get_softc(dev); @@ -396,9 +396,9 @@ a10_gpio_get_bus(device_t dev) } static int -a10_gpio_pin_max(device_t dev, int *maxpin) +aw_gpio_pin_max(device_t dev, int *maxpin) { - struct a10_gpio_softc *sc; + struct aw_gpio_softc *sc; sc = device_get_softc(dev); @@ -407,23 +407,23 @@ a10_gpio_pin_max(device_t dev, int *maxpin) } static int -a10_gpio_pin_getcaps(device_t dev, uint32_t pin, uint32_t *caps) +aw_gpio_pin_getcaps(device_t dev, uint32_t pin, uint32_t *caps) { - struct a10_gpio_softc *sc; + struct aw_gpio_softc *sc; sc = device_get_softc(dev); if (pin >= sc->padconf->npins) return (EINVAL); - *caps = A10_GPIO_DEFAULT_CAPS; + *caps = AW_GPIO_DEFAULT_CAPS; return (0); } static int -a10_gpio_pin_getflags(device_t dev, uint32_t pin, uint32_t *flags) +aw_gpio_pin_getflags(device_t dev, uint32_t pin, uint32_t *flags) { - struct a10_gpio_softc *sc; + struct aw_gpio_softc *sc; uint32_t func; uint32_t pud; @@ -431,13 +431,13 @@ a10_gpio_pin_getflags(device_t dev, uint32_t pin, uint if (pin >= sc->padconf->npins) return (EINVAL); - A10_GPIO_LOCK(sc); - func = a10_gpio_get_function(sc, pin); + AW_GPIO_LOCK(sc); + func = aw_gpio_get_function(sc, pin); switch (func) { - case A10_GPIO_INPUT: + case AW_GPIO_INPUT: *flags = GPIO_PIN_INPUT; break; - case A10_GPIO_OUTPUT: + case AW_GPIO_OUTPUT: *flags = GPIO_PIN_OUTPUT; break; default: @@ -445,27 +445,27 @@ a10_gpio_pin_getflags(device_t dev, uint32_t pin, uint break; } - pud = a10_gpio_get_pud(sc, pin); + pud = aw_gpio_get_pud(sc, pin); switch (pud) { - case A10_GPIO_PULLDOWN: + case AW_GPIO_PULLDOWN: *flags |= GPIO_PIN_PULLDOWN; break; - case A10_GPIO_PULLUP: + case AW_GPIO_PULLUP: *flags |= GPIO_PIN_PULLUP; break; default: break; } - A10_GPIO_UNLOCK(sc); + AW_GPIO_UNLOCK(sc); return (0); } static int -a10_gpio_pin_getname(device_t dev, uint32_t pin, char *name) +aw_gpio_pin_getname(device_t dev, uint32_t pin, char *name) { - struct a10_gpio_softc *sc; + struct aw_gpio_softc *sc; sc = device_get_softc(dev); if (pin >= sc->padconf->npins) @@ -479,29 +479,29 @@ a10_gpio_pin_getname(device_t dev, uint32_t pin, char } static int -a10_gpio_pin_setflags(device_t dev, uint32_t pin, uint32_t flags) +aw_gpio_pin_setflags(device_t dev, uint32_t pin, uint32_t flags) { - struct a10_gpio_softc *sc; + struct aw_gpio_softc *sc; int err; sc = device_get_softc(dev); if (pin > sc->padconf->npins) return (EINVAL); - A10_GPIO_LOCK(sc); - err = a10_gpio_pin_configure(sc, pin, flags); - A10_GPIO_UNLOCK(sc); + AW_GPIO_LOCK(sc); + err = aw_gpio_pin_configure(sc, pin, flags); + AW_GPIO_UNLOCK(sc); return (err); } static int -a10_gpio_pin_set_locked(struct a10_gpio_softc *sc, uint32_t pin, +aw_gpio_pin_set_locked(struct aw_gpio_softc *sc, uint32_t pin, unsigned int value) { uint32_t bank, data; - A10_GPIO_LOCK_ASSERT(sc); + AW_GPIO_LOCK_ASSERT(sc); if (pin > sc->padconf->npins) return (EINVAL); @@ -509,38 +509,38 @@ a10_gpio_pin_set_locked(struct a10_gpio_softc *sc, uin bank = sc->padconf->pins[pin].port; pin = sc->padconf->pins[pin].pin; - data = A10_GPIO_READ(sc, A10_GPIO_GP_DAT(bank)); + data = AW_GPIO_READ(sc, AW_GPIO_GP_DAT(bank)); if (value) data |= (1 << pin); else data &= ~(1 << pin); - A10_GPIO_WRITE(sc, A10_GPIO_GP_DAT(bank), data); + AW_GPIO_WRITE(sc, AW_GPIO_GP_DAT(bank), data); return (0); } static int -a10_gpio_pin_set(device_t dev, uint32_t pin, unsigned int value) +aw_gpio_pin_set(device_t dev, uint32_t pin, unsigned int value) { - struct a10_gpio_softc *sc; + struct aw_gpio_softc *sc; int ret; sc = device_get_softc(dev); - A10_GPIO_LOCK(sc); - ret = a10_gpio_pin_set_locked(sc, pin, value); - A10_GPIO_UNLOCK(sc); + AW_GPIO_LOCK(sc); + ret = aw_gpio_pin_set_locked(sc, pin, value); + AW_GPIO_UNLOCK(sc); return (ret); } static int -a10_gpio_pin_get_locked(struct a10_gpio_softc *sc,uint32_t pin, +aw_gpio_pin_get_locked(struct aw_gpio_softc *sc,uint32_t pin, unsigned int *val) { uint32_t bank, reg_data; - A10_GPIO_LOCK_ASSERT(sc); + AW_GPIO_LOCK_ASSERT(sc); if (pin > sc->padconf->npins) return (EINVAL); @@ -548,14 +548,14 @@ a10_gpio_pin_get_locked(struct a10_gpio_softc *sc,uint bank = sc->padconf->pins[pin].port; pin = sc->padconf->pins[pin].pin; - reg_data = A10_GPIO_READ(sc, A10_GPIO_GP_DAT(bank)); + reg_data = AW_GPIO_READ(sc, AW_GPIO_GP_DAT(bank)); *val = (reg_data & (1 << pin)) ? 1 : 0; return (0); } static char * -a10_gpio_parse_function(phandle_t node) +aw_gpio_parse_function(phandle_t node) { char *function; @@ -570,7 +570,7 @@ a10_gpio_parse_function(phandle_t node) } static const char ** -a10_gpio_parse_pins(phandle_t node, int *pins_nb) +aw_gpio_parse_pins(phandle_t node, int *pins_nb) { const char **pinlist; @@ -587,7 +587,7 @@ a10_gpio_parse_pins(phandle_t node, int *pins_nb) } static uint32_t -a10_gpio_parse_bias(phandle_t node) +aw_gpio_parse_bias(phandle_t node) { uint32_t bias; @@ -596,17 +596,17 @@ a10_gpio_parse_bias(phandle_t node) if (OF_getencprop(node, "allwinner,pull", &bias, sizeof(bias)) != -1) return (bias); if (OF_hasprop(node, "bias-disable")) - return (A10_GPIO_NONE); + return (AW_GPIO_NONE); if (OF_hasprop(node, "bias-pull-up")) - return (A10_GPIO_PULLUP); + return (AW_GPIO_PULLUP); if (OF_hasprop(node, "bias-pull-down")) - return (A10_GPIO_PULLDOWN); + return (AW_GPIO_PULLDOWN); - return (A10_GPIO_NONE); + return (AW_GPIO_NONE); } static int -a10_gpio_parse_drive_strength(phandle_t node, uint32_t *drive) +aw_gpio_parse_drive_strength(phandle_t node, uint32_t *drive) { uint32_t drive_str; @@ -624,24 +624,24 @@ a10_gpio_parse_drive_strength(phandle_t node, uint32_t } static int -a10_gpio_pin_get(device_t dev, uint32_t pin, unsigned int *val) +aw_gpio_pin_get(device_t dev, uint32_t pin, unsigned int *val) { - struct a10_gpio_softc *sc; + struct aw_gpio_softc *sc; int ret; sc = device_get_softc(dev); - A10_GPIO_LOCK(sc); - ret = a10_gpio_pin_get_locked(sc, pin, val); - A10_GPIO_UNLOCK(sc); + AW_GPIO_LOCK(sc); + ret = aw_gpio_pin_get_locked(sc, pin, val); + AW_GPIO_UNLOCK(sc); return (ret); } static int -a10_gpio_pin_toggle(device_t dev, uint32_t pin) +aw_gpio_pin_toggle(device_t dev, uint32_t pin) { - struct a10_gpio_softc *sc; + struct aw_gpio_softc *sc; uint32_t bank, data; sc = device_get_softc(dev); @@ -651,23 +651,23 @@ a10_gpio_pin_toggle(device_t dev, uint32_t pin) bank = sc->padconf->pins[pin].port; pin = sc->padconf->pins[pin].pin; - A10_GPIO_LOCK(sc); - data = A10_GPIO_READ(sc, A10_GPIO_GP_DAT(bank)); + AW_GPIO_LOCK(sc); + data = AW_GPIO_READ(sc, AW_GPIO_GP_DAT(bank)); if (data & (1 << pin)) data &= ~(1 << pin); else data |= (1 << pin); - A10_GPIO_WRITE(sc, A10_GPIO_GP_DAT(bank), data); - A10_GPIO_UNLOCK(sc); + AW_GPIO_WRITE(sc, AW_GPIO_GP_DAT(bank), data); + AW_GPIO_UNLOCK(sc); return (0); } static int -a10_gpio_pin_access_32(device_t dev, uint32_t first_pin, uint32_t clear_pins, +aw_gpio_pin_access_32(device_t dev, uint32_t first_pin, uint32_t clear_pins, uint32_t change_pins, uint32_t *orig_pins) { - struct a10_gpio_softc *sc; + struct aw_gpio_softc *sc; uint32_t bank, data, pin; sc = device_get_softc(dev); @@ -685,12 +685,12 @@ a10_gpio_pin_access_32(device_t dev, uint32_t first_pi if (pin != 0) return (EINVAL); - A10_GPIO_LOCK(sc); - data = A10_GPIO_READ(sc, A10_GPIO_GP_DAT(bank)); + AW_GPIO_LOCK(sc); + data = AW_GPIO_READ(sc, AW_GPIO_GP_DAT(bank)); if ((clear_pins | change_pins) != 0) - A10_GPIO_WRITE(sc, A10_GPIO_GP_DAT(bank), + AW_GPIO_WRITE(sc, AW_GPIO_GP_DAT(bank), (data & ~clear_pins) ^ change_pins); - A10_GPIO_UNLOCK(sc); + AW_GPIO_UNLOCK(sc); if (orig_pins != NULL) *orig_pins = data; @@ -699,10 +699,10 @@ a10_gpio_pin_access_32(device_t dev, uint32_t first_pi } static int -a10_gpio_pin_config_32(device_t dev, uint32_t first_pin, uint32_t num_pins, +aw_gpio_pin_config_32(device_t dev, uint32_t first_pin, uint32_t num_pins, uint32_t *pin_flags) { - struct a10_gpio_softc *sc; + struct aw_gpio_softc *sc; uint32_t bank, pin; int err; @@ -724,14 +724,14 @@ a10_gpio_pin_config_32(device_t dev, uint32_t first_pi */ for (err = 0, pin = first_pin; err == 0 && pin < num_pins; ++pin) { if (pin_flags[pin] & (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT)) - err = a10_gpio_pin_configure(sc, pin, pin_flags[pin]); + err = aw_gpio_pin_configure(sc, pin, pin_flags[pin]); } return (err); } static int -aw_find_pinnum_by_name(struct a10_gpio_softc *sc, const char *pinname) +aw_find_pinnum_by_name(struct aw_gpio_softc *sc, const char *pinname) { int i; @@ -743,7 +743,7 @@ aw_find_pinnum_by_name(struct a10_gpio_softc *sc, cons } static int -aw_find_pin_func(struct a10_gpio_softc *sc, int pin, const char *func) +aw_find_pin_func(struct aw_gpio_softc *sc, int pin, const char *func) { int i; @@ -758,7 +758,7 @@ aw_find_pin_func(struct a10_gpio_softc *sc, int pin, c static int aw_fdt_configure_pins(device_t dev, phandle_t cfgxref) { - struct a10_gpio_softc *sc; + struct aw_gpio_softc *sc; phandle_t node; const char **pinlist = NULL; char *pin_function = NULL; @@ -772,20 +772,20 @@ aw_fdt_configure_pins(device_t dev, phandle_t cfgxref) set_drive = false; /* Getting all prop for configuring pins */ - pinlist = a10_gpio_parse_pins(node, &pins_nb); + pinlist = aw_gpio_parse_pins(node, &pins_nb); if (pinlist == NULL) return (ENOENT); - pin_function = a10_gpio_parse_function(node); + pin_function = aw_gpio_parse_function(node); if (pin_function == NULL) { ret = ENOENT; goto out; } - if (a10_gpio_parse_drive_strength(node, &pin_drive) == 0) + if (aw_gpio_parse_drive_strength(node, &pin_drive) == 0) set_drive = true; - pin_pull = a10_gpio_parse_bias(node); + pin_pull = aw_gpio_parse_bias(node); /* Configure each pin to the correct function, drive and pull */ for (i = 0; i < pins_nb; i++) { @@ -800,16 +800,16 @@ aw_fdt_configure_pins(device_t dev, phandle_t cfgxref) goto out; } - A10_GPIO_LOCK(sc); + AW_GPIO_LOCK(sc); - if (a10_gpio_get_function(sc, pin_num) != pin_func) - a10_gpio_set_function(sc, pin_num, pin_func); + if (aw_gpio_get_function(sc, pin_num) != pin_func) + aw_gpio_set_function(sc, pin_num, pin_func); if (set_drive) - a10_gpio_set_drv(sc, pin_num, pin_drive); - if (pin_pull != A10_GPIO_NONE) - a10_gpio_set_pud(sc, pin_num, pin_pull); + aw_gpio_set_drv(sc, pin_num, pin_drive); + if (pin_pull != AW_GPIO_NONE) + aw_gpio_set_pud(sc, pin_num, pin_pull); - A10_GPIO_UNLOCK(sc); + AW_GPIO_UNLOCK(sc); } out: @@ -819,7 +819,7 @@ aw_fdt_configure_pins(device_t dev, phandle_t cfgxref) } static int -a10_gpio_probe(device_t dev) +aw_gpio_probe(device_t dev) { if (!ofw_bus_status_okay(dev)) @@ -833,11 +833,11 @@ a10_gpio_probe(device_t dev) } static int -a10_gpio_attach(device_t dev) +aw_gpio_attach(device_t dev) { int rid, error; phandle_t gpio; - struct a10_gpio_softc *sc; + struct aw_gpio_softc *sc; struct clk_list *clkp, *clkp_tmp; clk_t clk; hwreset_t rst = NULL; @@ -846,7 +846,7 @@ a10_gpio_attach(device_t dev) sc = device_get_softc(dev); sc->sc_dev = dev; - mtx_init(&sc->sc_mtx, "a10 gpio", "gpio", MTX_SPIN); + mtx_init(&sc->sc_mtx, "aw gpio", "gpio", MTX_SPIN); rid = 0; sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, @@ -951,14 +951,14 @@ fail: } static int -a10_gpio_detach(device_t dev) +aw_gpio_detach(device_t dev) { return (EBUSY); } static phandle_t -a10_gpio_get_node(device_t dev, device_t bus) +aw_gpio_get_node(device_t dev, device_t bus) { /* We only have one child, the GPIO bus, which needs our own node. */ @@ -966,10 +966,10 @@ a10_gpio_get_node(device_t dev, device_t bus) } static int -a10_gpio_map_gpios(device_t bus, phandle_t dev, phandle_t gparent, int gcells, +aw_gpio_map_gpios(device_t bus, phandle_t dev, phandle_t gparent, int gcells, pcell_t *gpios, uint32_t *pin, uint32_t *flags) { - struct a10_gpio_softc *sc; + struct aw_gpio_softc *sc; int i; sc = device_get_softc(bus); @@ -986,28 +986,28 @@ a10_gpio_map_gpios(device_t bus, phandle_t dev, phandl return (0); } -static device_method_t a10_gpio_methods[] = { +static device_method_t aw_gpio_methods[] = { /* Device interface */ - DEVMETHOD(device_probe, a10_gpio_probe), - DEVMETHOD(device_attach, a10_gpio_attach), - DEVMETHOD(device_detach, a10_gpio_detach), + DEVMETHOD(device_probe, aw_gpio_probe), + DEVMETHOD(device_attach, aw_gpio_attach), + DEVMETHOD(device_detach, aw_gpio_detach), /* GPIO protocol */ - DEVMETHOD(gpio_get_bus, a10_gpio_get_bus), - DEVMETHOD(gpio_pin_max, a10_gpio_pin_max), - DEVMETHOD(gpio_pin_getname, a10_gpio_pin_getname), - DEVMETHOD(gpio_pin_getflags, a10_gpio_pin_getflags), - DEVMETHOD(gpio_pin_getcaps, a10_gpio_pin_getcaps), - DEVMETHOD(gpio_pin_setflags, a10_gpio_pin_setflags), - DEVMETHOD(gpio_pin_get, a10_gpio_pin_get), - DEVMETHOD(gpio_pin_set, a10_gpio_pin_set), - DEVMETHOD(gpio_pin_toggle, a10_gpio_pin_toggle), - DEVMETHOD(gpio_pin_access_32, a10_gpio_pin_access_32), - DEVMETHOD(gpio_pin_config_32, a10_gpio_pin_config_32), - DEVMETHOD(gpio_map_gpios, a10_gpio_map_gpios), + DEVMETHOD(gpio_get_bus, aw_gpio_get_bus), + DEVMETHOD(gpio_pin_max, aw_gpio_pin_max), + DEVMETHOD(gpio_pin_getname, aw_gpio_pin_getname), + DEVMETHOD(gpio_pin_getflags, aw_gpio_pin_getflags), + DEVMETHOD(gpio_pin_getcaps, aw_gpio_pin_getcaps), + DEVMETHOD(gpio_pin_setflags, aw_gpio_pin_setflags), + DEVMETHOD(gpio_pin_get, aw_gpio_pin_get), + DEVMETHOD(gpio_pin_set, aw_gpio_pin_set), + DEVMETHOD(gpio_pin_toggle, aw_gpio_pin_toggle), + DEVMETHOD(gpio_pin_access_32, aw_gpio_pin_access_32), + DEVMETHOD(gpio_pin_config_32, aw_gpio_pin_config_32), + DEVMETHOD(gpio_map_gpios, aw_gpio_map_gpios), /* ofw_bus interface */ - DEVMETHOD(ofw_bus_get_node, a10_gpio_get_node), + DEVMETHOD(ofw_bus_get_node, aw_gpio_get_node), /* fdt_pinctrl interface */ DEVMETHOD(fdt_pinctrl_configure,aw_fdt_configure_pins), @@ -1015,13 +1015,13 @@ static device_method_t a10_gpio_methods[] = { DEVMETHOD_END }; -static devclass_t a10_gpio_devclass; +static devclass_t aw_gpio_devclass; -static driver_t a10_gpio_driver = { +static driver_t aw_gpio_driver = { "gpio", - a10_gpio_methods, - sizeof(struct a10_gpio_softc), + aw_gpio_methods, + sizeof(struct aw_gpio_softc), }; -EARLY_DRIVER_MODULE(a10_gpio, simplebus, a10_gpio_driver, a10_gpio_devclass, 0, 0, +EARLY_DRIVER_MODULE(aw_gpio, simplebus, aw_gpio_driver, aw_gpio_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE); From owner-svn-src-all@freebsd.org Tue Dec 26 12:35:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4AA2DE8B02E; Tue, 26 Dec 2017 12:35:04 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0BD42737FF; Tue, 26 Dec 2017 12:35:03 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBQCZ3fb076124; Tue, 26 Dec 2017 12:35:03 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBQCZ2Al076120; Tue, 26 Dec 2017 12:35:02 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201712261235.vBQCZ2Al076120@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 26 Dec 2017 12:35:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327200 - in head/sys: conf netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in head/sys: conf netinet X-SVN-Commit-Revision: 327200 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 12:35:04 -0000 Author: tuexen Date: Tue Dec 26 12:35:02 2017 New Revision: 327200 URL: https://svnweb.freebsd.org/changeset/base/327200 Log: When adding support for sending SCTP packets containing an ABORT chunk to ipfw in https://svnweb.freebsd.org/changeset/base/326233, a dependency on the SCTP stack was added to ipfw by accident. This was noted by Kevel Bowling in https://reviews.freebsd.org/D13594 where also a solution was suggested. This patch is based on Kevin's suggestion, but implements the required SCTP checksum computation without any dependency on other SCTP sources. While there, do some cleanups and improve comments. Thanks to Kevin Kevin Browling for reporting the issue and suggesting a fix. Modified: head/sys/conf/files head/sys/netinet/sctp_crc32.c head/sys/netinet/sctp_crc32.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Dec 26 12:11:04 2017 (r327199) +++ head/sys/conf/files Tue Dec 26 12:35:02 2017 (r327200) @@ -4255,7 +4255,7 @@ netinet/sctp_asconf.c optional inet sctp | inet6 sctp netinet/sctp_auth.c optional inet sctp | inet6 sctp netinet/sctp_bsd_addr.c optional inet sctp | inet6 sctp netinet/sctp_cc_functions.c optional inet sctp | inet6 sctp -netinet/sctp_crc32.c optional inet sctp | inet6 sctp +netinet/sctp_crc32.c optional inet | inet6 netinet/sctp_indata.c optional inet sctp | inet6 sctp netinet/sctp_input.c optional inet sctp | inet6 sctp netinet/sctp_output.c optional inet sctp | inet6 sctp Modified: head/sys/netinet/sctp_crc32.c ============================================================================== --- head/sys/netinet/sctp_crc32.c Tue Dec 26 12:11:04 2017 (r327199) +++ head/sys/netinet/sctp_crc32.c Tue Dec 26 12:35:02 2017 (r327200) @@ -35,29 +35,36 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_sctp.h" + +#ifdef SCTP #include #include #include #include +#else +#include +#include +#include +#include +#endif - static uint32_t sctp_finalize_crc32c(uint32_t crc32c) { uint32_t result; - #if BYTE_ORDER == BIG_ENDIAN uint8_t byte0, byte1, byte2, byte3; - #endif + /* Complement the result */ result = ~crc32c; #if BYTE_ORDER == BIG_ENDIAN /* - * For BIG-ENDIAN.. aka Motorola byte order the result is in - * little-endian form. So we must manually swap the bytes. Then we - * can call htonl() which does nothing... + * For BIG-ENDIAN platforms the result is in little-endian form. So + * we must swap the bytes to return the result in network byte + * order. */ byte0 = result & 0x000000ff; byte1 = (result >> 8) & 0x000000ff; @@ -66,56 +73,54 @@ sctp_finalize_crc32c(uint32_t crc32c) crc32c = ((byte0 << 24) | (byte1 << 16) | (byte2 << 8) | byte3); #else /* - * For INTEL platforms the result comes out in network order. No - * htonl is required or the swap above. So we optimize out both the - * htonl and the manual swap above. + * For LITTLE ENDIAN platforms the result is in already in network + * byte order. */ crc32c = result; #endif return (crc32c); } +/* + * Compute the SCTP checksum in network byte order for a given mbuf chain m + * which contains an SCTP packet starting at offset. + * Since this function is also called by ipfw, don't assume that + * it is compiled on a kernel with SCTP support. + */ uint32_t sctp_calculate_cksum(struct mbuf *m, uint32_t offset) { - /* - * given a mbuf chain with a packetheader offset by 'offset' - * pointing at a sctphdr (with csum set to 0) go through the chain - * of SCTP_BUF_NEXT()'s and calculate the SCTP checksum. This also - * has a side bonus as it will calculate the total length of the - * mbuf chain. Note: if offset is greater than the total mbuf - * length, checksum=1, pktlen=0 is returned (ie. no real error code) - */ uint32_t base = 0xffffffff; - struct mbuf *at; - at = m; - /* find the correct mbuf and offset into mbuf */ - while ((at != NULL) && (offset > (uint32_t)SCTP_BUF_LEN(at))) { - offset -= SCTP_BUF_LEN(at); /* update remaining offset - * left */ - at = SCTP_BUF_NEXT(at); - } - while (at != NULL) { - if ((SCTP_BUF_LEN(at) - offset) > 0) { - base = calculate_crc32c(base, - (unsigned char *)(SCTP_BUF_AT(at, offset)), - (unsigned int)(SCTP_BUF_LEN(at) - offset)); + while (offset > 0) { + KASSERT(m != NULL, ("sctp_calculate_cksum, offset > length of mbuf chain")); + if (offset < (uint32_t)m->m_len) { + break; } - if (offset) { - /* we only offset once into the first mbuf */ - if (offset < (uint32_t)SCTP_BUF_LEN(at)) - offset = 0; - else - offset -= SCTP_BUF_LEN(at); - } - at = SCTP_BUF_NEXT(at); + offset -= m->m_len; + m = m->m_next; } + if (offset > 0) { + base = calculate_crc32c(base, + (unsigned char *)(m->m_data + offset), + (unsigned int)(m->m_len - offset)); + m = m->m_next; + } + while (m != NULL) { + base = calculate_crc32c(base, + (unsigned char *)m->m_data, + (unsigned int)m->m_len); + m = m->m_next; + } base = sctp_finalize_crc32c(base); return (base); } - +#ifdef SCTP +/* + * Compute and insert the SCTP checksum in network byte order for a given + * mbuf chain m which contains an SCTP packet starting at offset. + */ void sctp_delayed_cksum(struct mbuf *m, uint32_t offset) { @@ -127,14 +132,15 @@ sctp_delayed_cksum(struct mbuf *m, uint32_t offset) offset += offsetof(struct sctphdr, checksum); if (offset + sizeof(uint32_t) > (uint32_t)(m->m_len)) { - SCTP_PRINTF("sctp_delayed_cksum(): m->len: %d, off: %d.\n", - (uint32_t)m->m_len, offset); - /* - * XXX this shouldn't happen, but if it does, the correct - * behavior may be to insert the checksum in the appropriate - * next mbuf in the chain. - */ +#ifdef INVARIANTS + panic("sctp_delayed_cksum(): m->m_len: %d, offset: %u.", + m->m_len, offset); +#else + SCTP_PRINTF("sctp_delayed_cksum(): m->m_len: %d, offset: %u.\n", + m->m_len, offset); +#endif return; } *(uint32_t *)(m->m_data + offset) = checksum; } +#endif Modified: head/sys/netinet/sctp_crc32.h ============================================================================== --- head/sys/netinet/sctp_crc32.h Tue Dec 26 12:11:04 2017 (r327199) +++ head/sys/netinet/sctp_crc32.h Tue Dec 26 12:35:02 2017 (r327200) @@ -40,6 +40,8 @@ __FBSDID("$FreeBSD$"); #if defined(_KERNEL) uint32_t sctp_calculate_cksum(struct mbuf *, uint32_t); +#ifdef SCTP void sctp_delayed_cksum(struct mbuf *, uint32_t offset); +#endif #endif /* _KERNEL */ #endif /* __crc32c_h__ */ From owner-svn-src-all@freebsd.org Tue Dec 26 12:41:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5999E8B8DF; Tue, 26 Dec 2017 12:41:04 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 768F373B6E; Tue, 26 Dec 2017 12:41:04 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from [192.168.1.204] (p57BB4707.dip0.t-ipconnect.de [87.187.71.7]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id 65627721E2825; Tue, 26 Dec 2017 13:40:51 +0100 (CET) From: Michael Tuexen Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 11.2 \(3445.5.20\)) Subject: Re: svn commit: r327200 - in head/sys: conf netinet Date: Tue, 26 Dec 2017 13:40:47 +0100 References: <201712261235.vBQCZ2Al076120@repo.freebsd.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <201712261235.vBQCZ2Al076120@repo.freebsd.org> Message-Id: <9F922F21-3319-4146-B6BE-9BC99E446AE3@freebsd.org> X-Mailer: Apple Mail (2.3445.5.20) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 12:41:04 -0000 > On 26. Dec 2017, at 13:35, Michael Tuexen wrote: >=20 > Author: tuexen > Date: Tue Dec 26 12:35:02 2017 > New Revision: 327200 > URL: https://svnweb.freebsd.org/changeset/base/327200 >=20 > Log: > When adding support for sending SCTP packets containing an ABORT = chunk > to ipfw in https://svnweb.freebsd.org/changeset/base/326233, > a dependency on the SCTP stack was added to ipfw by accident. >=20 > This was noted by Kevel Bowling in https://reviews.freebsd.org/D13594 > where also a solution was suggested. This patch is based on Kevin's > suggestion, but implements the required SCTP checksum computation > without any dependency on other SCTP sources. >=20 > While there, do some cleanups and improve comments. >=20 > Thanks to Kevin Kevin Browling for reporting the issue and suggesting > a fix. Thanks to Kevin Bowling. Sorry for the typo. Best regards Michael >=20 > Modified: > head/sys/conf/files > head/sys/netinet/sctp_crc32.c > head/sys/netinet/sctp_crc32.h >=20 > Modified: head/sys/conf/files > = =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/conf/files Tue Dec 26 12:11:04 2017 = (r327199) > +++ head/sys/conf/files Tue Dec 26 12:35:02 2017 = (r327200) > @@ -4255,7 +4255,7 @@ netinet/sctp_asconf.c optional inet = sctp | inet6 sctp > netinet/sctp_auth.c optional inet sctp | inet6 sctp > netinet/sctp_bsd_addr.c optional inet sctp | inet6 sctp > netinet/sctp_cc_functions.c optional inet sctp | inet6 sctp > -netinet/sctp_crc32.c optional inet sctp | inet6 sctp > +netinet/sctp_crc32.c optional inet | inet6 > netinet/sctp_indata.c optional inet sctp | inet6 sctp > netinet/sctp_input.c optional inet sctp | inet6 sctp > netinet/sctp_output.c optional inet sctp | inet6 sctp >=20 > Modified: head/sys/netinet/sctp_crc32.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/netinet/sctp_crc32.c Tue Dec 26 12:11:04 2017 = (r327199) > +++ head/sys/netinet/sctp_crc32.c Tue Dec 26 12:35:02 2017 = (r327200) > @@ -35,29 +35,36 @@ > #include > __FBSDID("$FreeBSD$"); >=20 > +#include "opt_sctp.h" > + > +#ifdef SCTP > #include > #include > #include > #include > +#else > +#include > +#include > +#include >=20 > +#include > +#endif >=20 > - > static uint32_t > sctp_finalize_crc32c(uint32_t crc32c) > { > uint32_t result; > - > #if BYTE_ORDER =3D=3D BIG_ENDIAN > uint8_t byte0, byte1, byte2, byte3; > - > #endif > + > /* Complement the result */ > result =3D ~crc32c; > #if BYTE_ORDER =3D=3D BIG_ENDIAN > /* > - * For BIG-ENDIAN.. aka Motorola byte order the result is in > - * little-endian form. So we must manually swap the bytes. Then = we > - * can call htonl() which does nothing... > + * For BIG-ENDIAN platforms the result is in little-endian form. = So > + * we must swap the bytes to return the result in network byte > + * order. > */ > byte0 =3D result & 0x000000ff; > byte1 =3D (result >> 8) & 0x000000ff; > @@ -66,56 +73,54 @@ sctp_finalize_crc32c(uint32_t crc32c) > crc32c =3D ((byte0 << 24) | (byte1 << 16) | (byte2 << 8) | = byte3); > #else > /* > - * For INTEL platforms the result comes out in network order. No > - * htonl is required or the swap above. So we optimize out both = the > - * htonl and the manual swap above. > + * For LITTLE ENDIAN platforms the result is in already in = network > + * byte order. > */ > crc32c =3D result; > #endif > return (crc32c); > } >=20 > +/* > + * Compute the SCTP checksum in network byte order for a given mbuf = chain m > + * which contains an SCTP packet starting at offset. > + * Since this function is also called by ipfw, don't assume that > + * it is compiled on a kernel with SCTP support. > + */ > uint32_t > sctp_calculate_cksum(struct mbuf *m, uint32_t offset) > { > - /* > - * given a mbuf chain with a packetheader offset by 'offset' > - * pointing at a sctphdr (with csum set to 0) go through the = chain > - * of SCTP_BUF_NEXT()'s and calculate the SCTP checksum. This = also > - * has a side bonus as it will calculate the total length of the > - * mbuf chain. Note: if offset is greater than the total mbuf > - * length, checksum=3D1, pktlen=3D0 is returned (ie. no real = error code) > - */ > uint32_t base =3D 0xffffffff; > - struct mbuf *at; >=20 > - at =3D m; > - /* find the correct mbuf and offset into mbuf */ > - while ((at !=3D NULL) && (offset > (uint32_t)SCTP_BUF_LEN(at))) = { > - offset -=3D SCTP_BUF_LEN(at); /* update remaining = offset > - * left */ > - at =3D SCTP_BUF_NEXT(at); > - } > - while (at !=3D NULL) { > - if ((SCTP_BUF_LEN(at) - offset) > 0) { > - base =3D calculate_crc32c(base, > - (unsigned char *)(SCTP_BUF_AT(at, offset)), > - (unsigned int)(SCTP_BUF_LEN(at) - offset)); > + while (offset > 0) { > + KASSERT(m !=3D NULL, ("sctp_calculate_cksum, offset > = length of mbuf chain")); > + if (offset < (uint32_t)m->m_len) { > + break; > } > - if (offset) { > - /* we only offset once into the first mbuf */ > - if (offset < (uint32_t)SCTP_BUF_LEN(at)) > - offset =3D 0; > - else > - offset -=3D SCTP_BUF_LEN(at); > - } > - at =3D SCTP_BUF_NEXT(at); > + offset -=3D m->m_len; > + m =3D m->m_next; > } > + if (offset > 0) { > + base =3D calculate_crc32c(base, > + (unsigned char *)(m->m_data + offset), > + (unsigned int)(m->m_len - offset)); > + m =3D m->m_next; > + } > + while (m !=3D NULL) { > + base =3D calculate_crc32c(base, > + (unsigned char *)m->m_data, > + (unsigned int)m->m_len); > + m =3D m->m_next; > + } > base =3D sctp_finalize_crc32c(base); > return (base); > } >=20 > - > +#ifdef SCTP > +/* > + * Compute and insert the SCTP checksum in network byte order for a = given > + * mbuf chain m which contains an SCTP packet starting at offset. > + */ > void > sctp_delayed_cksum(struct mbuf *m, uint32_t offset) > { > @@ -127,14 +132,15 @@ sctp_delayed_cksum(struct mbuf *m, uint32_t = offset) > offset +=3D offsetof(struct sctphdr, checksum); >=20 > if (offset + sizeof(uint32_t) > (uint32_t)(m->m_len)) { > - SCTP_PRINTF("sctp_delayed_cksum(): m->len: %d, off: = %d.\n", > - (uint32_t)m->m_len, offset); > - /* > - * XXX this shouldn't happen, but if it does, the = correct > - * behavior may be to insert the checksum in the = appropriate > - * next mbuf in the chain. > - */ > +#ifdef INVARIANTS > + panic("sctp_delayed_cksum(): m->m_len: %d, offset: %u.", > + m->m_len, offset); > +#else > + SCTP_PRINTF("sctp_delayed_cksum(): m->m_len: %d, offset: = %u.\n", > + m->m_len, offset); > +#endif > return; > } > *(uint32_t *)(m->m_data + offset) =3D checksum; > } > +#endif >=20 > Modified: head/sys/netinet/sctp_crc32.h > = =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/netinet/sctp_crc32.h Tue Dec 26 12:11:04 2017 = (r327199) > +++ head/sys/netinet/sctp_crc32.h Tue Dec 26 12:35:02 2017 = (r327200) > @@ -40,6 +40,8 @@ __FBSDID("$FreeBSD$"); >=20 > #if defined(_KERNEL) > uint32_t sctp_calculate_cksum(struct mbuf *, uint32_t); > +#ifdef SCTP > void sctp_delayed_cksum(struct mbuf *, uint32_t offset); > +#endif > #endif /* _KERNEL */ > #endif /* __crc32c_h__ */ >=20 From owner-svn-src-all@freebsd.org Tue Dec 26 14:26:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E79C8E92464; Tue, 26 Dec 2017 14:26:16 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BDB4E770F7; Tue, 26 Dec 2017 14:26:16 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBQEQF5Y021751; Tue, 26 Dec 2017 14:26:15 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBQEQFid021748; Tue, 26 Dec 2017 14:26:15 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201712261426.vBQEQFid021748@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 26 Dec 2017 14:26:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r327201 - stable/11/contrib/llvm/projects/libunwind/src X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: stable/11/contrib/llvm/projects/libunwind/src X-SVN-Commit-Revision: 327201 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 14:26:17 -0000 Author: dim Date: Tue Dec 26 14:26:15 2017 New Revision: 327201 URL: https://svnweb.freebsd.org/changeset/base/327201 Log: MFC r324536 (by emaste): libunwind: use upstream patch to disable executable stacks arm uses '@' as a comment character, and cannot use @progbits in the .section directive. Apply the upstream noexec stach change which avoids this issue. Obtained from: LLVM r277868 Modified: stable/11/contrib/llvm/projects/libunwind/src/UnwindRegistersRestore.S stable/11/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S stable/11/contrib/llvm/projects/libunwind/src/assembly.h Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/llvm/projects/libunwind/src/UnwindRegistersRestore.S ============================================================================== --- stable/11/contrib/llvm/projects/libunwind/src/UnwindRegistersRestore.S Tue Dec 26 12:35:02 2017 (r327200) +++ stable/11/contrib/llvm/projects/libunwind/src/UnwindRegistersRestore.S Tue Dec 26 14:26:15 2017 (r327201) @@ -484,4 +484,5 @@ DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind14Regis #endif - .section .note.GNU-stack,"",@progbits +NO_EXEC_STACK_DIRECTIVE + Modified: stable/11/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S ============================================================================== --- stable/11/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S Tue Dec 26 12:35:02 2017 (r327200) +++ stable/11/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S Tue Dec 26 14:26:15 2017 (r327201) @@ -470,4 +470,5 @@ DEFINE_LIBUNWIND_FUNCTION(unw_getcontext) #endif - .section .note.GNU-stack,"",@progbits +NO_EXEC_STACK_DIRECTIVE + Modified: stable/11/contrib/llvm/projects/libunwind/src/assembly.h ============================================================================== --- stable/11/contrib/llvm/projects/libunwind/src/assembly.h Tue Dec 26 12:35:02 2017 (r327200) +++ stable/11/contrib/llvm/projects/libunwind/src/assembly.h Tue Dec 26 14:26:15 2017 (r327201) @@ -35,19 +35,34 @@ #define SYMBOL_NAME(name) GLUE(__USER_LABEL_PREFIX__, name) #if defined(__APPLE__) + #define SYMBOL_IS_FUNC(name) +#define NO_EXEC_STACK_DIRECTIVE + #elif defined(__ELF__) + #if defined(__arm__) #define SYMBOL_IS_FUNC(name) .type name,%function #else #define SYMBOL_IS_FUNC(name) .type name,@function #endif + +#if defined(__GNU__) || defined(__ANDROID__) || defined(__FreeBSD__) +#define NO_EXEC_STACK_DIRECTIVE .section .note.GNU-stack,"",%progbits #else +#define NO_EXEC_STACK_DIRECTIVE +#endif + +#else + #define SYMBOL_IS_FUNC(name) \ .def name SEPARATOR \ .scl 2 SEPARATOR \ .type 32 SEPARATOR \ .endef + +#define NO_EXEC_STACK_DIRECTIVE + #endif #define DEFINE_LIBUNWIND_FUNCTION(name) \ From owner-svn-src-all@freebsd.org Tue Dec 26 14:34:39 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D687DE92C00; Tue, 26 Dec 2017 14:34:39 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A05EA776A1; Tue, 26 Dec 2017 14:34:39 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBQEYcIB025926; Tue, 26 Dec 2017 14:34:38 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBQEYcx5025925; Tue, 26 Dec 2017 14:34:38 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201712261434.vBQEYcx5025925@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 26 Dec 2017 14:34:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327202 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 327202 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 14:34:39 -0000 Author: manu Date: Tue Dec 26 14:34:38 2017 New Revision: 327202 URL: https://svnweb.freebsd.org/changeset/base/327202 Log: arm: a10_gpio.c was renamed aw_gpio.c While here order files in files.allwinner Modified: head/sys/arm/allwinner/files.allwinner Modified: head/sys/arm/allwinner/files.allwinner ============================================================================== --- head/sys/arm/allwinner/files.allwinner Tue Dec 26 14:26:15 2017 (r327201) +++ head/sys/arm/allwinner/files.allwinner Tue Dec 26 14:34:38 2017 (r327202) @@ -6,18 +6,18 @@ arm/allwinner/a10_codec.c optional sound arm/allwinner/a10_dmac.c standard arm/allwinner/a31_dmac.c standard arm/allwinner/a10_ehci.c optional ehci -arm/allwinner/aw_usbphy.c optional ehci | ohci -arm/allwinner/a10_gpio.c optional gpio arm/allwinner/a10_sramc.c standard +arm/allwinner/aw_gpio.c optional gpio +arm/allwinner/aw_if_dwc.c optional dwc +arm/allwinner/aw_machdep.c standard arm/allwinner/aw_mmc.c optional mmc +arm/allwinner/aw_mp.c optional smp arm/allwinner/aw_nmi.c optional intrng -arm/allwinner/aw_if_dwc.c optional dwc arm/allwinner/aw_rsb.c optional rsb | p2wi arm/allwinner/aw_rtc.c standard arm/allwinner/aw_ts.c standard +arm/allwinner/aw_usbphy.c optional ehci | ohci arm/allwinner/aw_wdog.c standard -arm/allwinner/aw_machdep.c standard -arm/allwinner/aw_mp.c optional smp arm/allwinner/axp209.c optional axp209 arm/allwinner/axp81x.c optional axp81x arm/allwinner/if_awg.c optional awg From owner-svn-src-all@freebsd.org Tue Dec 26 14:37:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 127AAE92F1C; Tue, 26 Dec 2017 14:37:49 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D0F7E778AC; Tue, 26 Dec 2017 14:37:48 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBQEblvV026080; Tue, 26 Dec 2017 14:37:47 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBQEblgW026079; Tue, 26 Dec 2017 14:37:47 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201712261437.vBQEblgW026079@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 26 Dec 2017 14:37:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327203 - head/sys/netinet/libalias X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet/libalias X-SVN-Commit-Revision: 327203 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 14:37:49 -0000 Author: tuexen Date: Tue Dec 26 14:37:47 2017 New Revision: 327203 URL: https://svnweb.freebsd.org/changeset/base/327203 Log: Allow the first (and second) argument of sn_calloc() be a sum. This fixes a bug reported in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=224103 PR: 224103 Modified: head/sys/netinet/libalias/alias_sctp.c Modified: head/sys/netinet/libalias/alias_sctp.c ============================================================================== --- head/sys/netinet/libalias/alias_sctp.c Tue Dec 26 14:34:38 2017 (r327202) +++ head/sys/netinet/libalias/alias_sctp.c Tue Dec 26 14:37:47 2017 (r327203) @@ -187,7 +187,7 @@ static MALLOC_DEFINE(M_SCTPNAT, "sctpnat", "sctp nat d /* Use kernel allocator. */ #ifdef _SYS_MALLOC_H_ #define sn_malloc(x) malloc(x, M_SCTPNAT, M_NOWAIT|M_ZERO) -#define sn_calloc(n,x) sn_malloc(x * n) +#define sn_calloc(n,x) sn_malloc((x) * (n)) #define sn_free(x) free(x, M_SCTPNAT) #endif// #ifdef _SYS_MALLOC_H_ From owner-svn-src-all@freebsd.org Tue Dec 26 14:44:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1586BE935B2; Tue, 26 Dec 2017 14:44:07 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92E9D77E3E; Tue, 26 Dec 2017 14:44:06 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBQEi5St030033; Tue, 26 Dec 2017 14:44:05 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBQEi3ob030006; Tue, 26 Dec 2017 14:44:03 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201712261444.vBQEi3ob030006@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 26 Dec 2017 14:44:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r327204 - in stable/11: . contrib/libc++/include contrib/llvm/include/llvm/Analysis contrib/llvm/include/llvm/CodeGen contrib/llvm/include/llvm/IR contrib/llvm/include/llvm/Support cont... X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable/11: . contrib/libc++/include contrib/llvm/include/llvm/Analysis contrib/llvm/include/llvm/CodeGen contrib/llvm/include/llvm/IR contrib/llvm/include/llvm/Support contrib/llvm/lib/AsmParser co... X-SVN-Commit-Revision: 327204 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 14:44:07 -0000 Author: dim Date: Tue Dec 26 14:44:02 2017 New Revision: 327204 URL: https://svnweb.freebsd.org/changeset/base/327204 Log: MFC r326496: Upgrade our copies of clang, llvm, lldb and libc++ to r319231 from the upstream release_50 branch. This corresponds to 5.0.1 rc2. MFC r326831: Pull in r315334 from upstream lld trunk (by Rafael Espindola): Don't create a dummy __tls_get_addr. We just don't need one with the current setup. We only error on undefined references that are used by some relocation. If we managed to relax all uses of __tls_get_addr, no relocation uses it and we don't produce an error. This is less code and fixes the case were we fail to relax. Before we would produce a broken output, but now we produce an error. Pull in r320390 from upstream lld trunk (by Rafael Espindola): Create reserved symbols early so they can be versioned. This fixes pr35570. We were creating these symbols after parsing version scripts, so they could not be versioned. We cannot move the version script parsing later because we need it for lto. One option is to move both addReservedSymbols and createSyntheticSections earlier. The disadvantage is that some sections created by createSyntheticSections replace other input sections. For example, gdb index replaces .debug_gnu_pubnames, so it wants to run after gc sections so that it can set S->Live to false. What this patch does instead is to move just the ElfHeader creation early. Pull in r320412 from upstream lld trunk (by Rafael Espindola): Handle symbols pointing to output sections. Now that gc sections runs after linker defined symbols are added it can see symbols that point to an OutputSection. Should fix a bot failure. Pull in r320431 from upstream lld trunk (by Peter Collingbourne): ELF: Do not follow relocation edges to output sections during GC. This fixes an assertion error introduced by r320390. Differential Revision: https://reviews.llvm.org/D41095 Together these fix handling of reserved symbols, in particular _end, which is needed to make brk(2) and sbrk(2) work correctly. This unbreaks the emacs ports on amd64, and also appears to unbreak most of world on i386. Differential Revision: https://reviews.freebsd.org/D13466 MFC r326879 (by emaste): lld: Simplify a boolean expression by De Morgan's laws. Cherry-pick lld r315653 by Rui Ueyama: I don't really understand what exactly this expression means, but at least I can mechanically transform it. Obtained from: LLVM r315653 MFC r326897 (by emaste): lld: Slightly simplify code and add comment. Cherry-pick lld r315658 by Rui Ueyama: This is not a mechanical transformation. Even though I believe this patch is correct, I'm not 100% sure if lld with this patch behaves exactly the same way as before on all edge cases. At least all tests still pass. I'm submitting this patch because it took almost a day to understand this function, and I don't want to lose it. This fixes jemalloc assertion failures observed at startup with i386 binaries and an lld-linked libc.so. Reviewed by: dim Obtained from: LLVM r315658 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D13503 MFC r326909: Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to 5.0.1 release (upstream r320880). Relnotes: yes MFC r326957 (by emaste): lld: Don't write preemptible symbol values to the .got. It is not necessary and matches what bfd and gold do. This was a regression from [LLVM] r315658. Obtained from: LLVM r321023 by Rafael Espíndola Modified: stable/11/ObsoleteFiles.inc stable/11/contrib/libc++/include/algorithm stable/11/contrib/libc++/include/deque stable/11/contrib/libc++/include/functional stable/11/contrib/libc++/include/list stable/11/contrib/libc++/include/string stable/11/contrib/libc++/include/type_traits stable/11/contrib/libc++/include/vector stable/11/contrib/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h stable/11/contrib/llvm/include/llvm/CodeGen/MachineRegisterInfo.h stable/11/contrib/llvm/include/llvm/IR/AutoUpgrade.h stable/11/contrib/llvm/include/llvm/Support/FormatVariadic.h stable/11/contrib/llvm/lib/AsmParser/LLParser.cpp stable/11/contrib/llvm/lib/Bitcode/Reader/BitcodeReader.cpp stable/11/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp stable/11/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h stable/11/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp stable/11/contrib/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp stable/11/contrib/llvm/lib/CodeGen/MachineRegisterInfo.cpp stable/11/contrib/llvm/lib/CodeGen/MachineVerifier.cpp stable/11/contrib/llvm/lib/IR/AutoUpgrade.cpp stable/11/contrib/llvm/lib/IR/ConstantFold.cpp stable/11/contrib/llvm/lib/Linker/IRMover.cpp stable/11/contrib/llvm/lib/Linker/LinkModules.cpp stable/11/contrib/llvm/lib/Support/Host.cpp stable/11/contrib/llvm/lib/Target/AArch64/AArch64FalkorHWPFFix.cpp stable/11/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp stable/11/contrib/llvm/lib/Target/AArch64/AArch64InstrInfo.td stable/11/contrib/llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp stable/11/contrib/llvm/lib/Target/ARM/ARMAsmPrinter.cpp stable/11/contrib/llvm/lib/Target/ARM/ARMCallLowering.cpp stable/11/contrib/llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp stable/11/contrib/llvm/lib/Target/ARM/ARMFastISel.cpp stable/11/contrib/llvm/lib/Target/ARM/ARMFrameLowering.cpp stable/11/contrib/llvm/lib/Target/ARM/ARMInstrInfo.td stable/11/contrib/llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp stable/11/contrib/llvm/lib/Target/ARM/ARMSubtarget.h stable/11/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp stable/11/contrib/llvm/lib/Target/AVR/AVRExpandPseudoInsts.cpp stable/11/contrib/llvm/lib/Target/AVR/AVRISelLowering.cpp stable/11/contrib/llvm/lib/Target/AVR/AVRISelLowering.h stable/11/contrib/llvm/lib/Target/AVR/AVRInstrInfo.cpp stable/11/contrib/llvm/lib/Target/AVR/AVRInstrInfo.h stable/11/contrib/llvm/lib/Target/AVR/AVRInstrInfo.td stable/11/contrib/llvm/lib/Target/AVR/AVRRegisterInfo.cpp stable/11/contrib/llvm/lib/Target/AVR/AVRTargetMachine.cpp stable/11/contrib/llvm/lib/Target/AVR/MCTargetDesc/AVRTargetStreamer.cpp stable/11/contrib/llvm/lib/Target/AVR/MCTargetDesc/AVRTargetStreamer.h stable/11/contrib/llvm/lib/Target/BPF/BPFISelLowering.cpp stable/11/contrib/llvm/lib/Target/BPF/BPFInstrInfo.td stable/11/contrib/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp stable/11/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsMCExpr.cpp stable/11/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp stable/11/contrib/llvm/lib/Target/Mips/MicroMipsDSPInstrInfo.td stable/11/contrib/llvm/lib/Target/Mips/MipsDSPInstrInfo.td stable/11/contrib/llvm/lib/Target/Mips/MipsFrameLowering.cpp stable/11/contrib/llvm/lib/Target/Mips/MipsMTInstrFormats.td stable/11/contrib/llvm/lib/Target/Mips/MipsMTInstrInfo.td stable/11/contrib/llvm/lib/Target/Mips/MipsSEFrameLowering.cpp stable/11/contrib/llvm/lib/Target/Mips/MipsSEInstrInfo.cpp stable/11/contrib/llvm/lib/Target/Mips/MipsSchedule.td stable/11/contrib/llvm/lib/Target/Mips/MipsScheduleGeneric.td stable/11/contrib/llvm/lib/Target/Mips/MipsTargetStreamer.h stable/11/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/NewGVN.cpp stable/11/contrib/llvm/tools/clang/include/clang/Basic/Attr.td stable/11/contrib/llvm/tools/clang/include/clang/Basic/AttrDocs.td stable/11/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsX86.def stable/11/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td stable/11/contrib/llvm/tools/clang/lib/AST/ExprConstant.cpp stable/11/contrib/llvm/tools/clang/lib/Basic/Targets.cpp stable/11/contrib/llvm/tools/clang/lib/Basic/Version.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGExpr.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGOpenMPRuntime.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGOpenMPRuntime.h stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGStmtOpenMP.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/CodeGenFunction.h stable/11/contrib/llvm/tools/clang/lib/Driver/ToolChain.cpp stable/11/contrib/llvm/tools/clang/lib/Driver/ToolChains/BareMetal.cpp stable/11/contrib/llvm/tools/clang/lib/Driver/ToolChains/BareMetal.h stable/11/contrib/llvm/tools/clang/lib/Driver/ToolChains/Clang.cpp stable/11/contrib/llvm/tools/clang/lib/Format/Format.cpp stable/11/contrib/llvm/tools/clang/lib/Headers/avx512fintrin.h stable/11/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp stable/11/contrib/llvm/tools/clang/lib/Sema/SemaDeclCXX.cpp stable/11/contrib/llvm/tools/clang/lib/Sema/SemaOpenMP.cpp stable/11/contrib/llvm/tools/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp stable/11/contrib/llvm/tools/lld/ELF/Driver.cpp stable/11/contrib/llvm/tools/lld/ELF/MarkLive.cpp stable/11/contrib/llvm/tools/lld/ELF/Relocations.cpp stable/11/contrib/llvm/tools/lld/ELF/SyntheticSections.cpp stable/11/contrib/llvm/tools/lld/ELF/SyntheticSections.h stable/11/contrib/llvm/tools/lld/ELF/Writer.cpp stable/11/contrib/llvm/tools/lld/ELF/Writer.h stable/11/contrib/llvm/tools/lld/lib/ReaderWriter/MachO/ArchHandler.h stable/11/contrib/llvm/tools/lld/lib/ReaderWriter/MachO/ArchHandler_arm.cpp stable/11/contrib/llvm/tools/lld/lib/ReaderWriter/MachO/ArchHandler_arm64.cpp stable/11/contrib/llvm/tools/lld/lib/ReaderWriter/MachO/ArchHandler_x86.cpp stable/11/contrib/llvm/tools/lld/lib/ReaderWriter/MachO/ArchHandler_x86_64.cpp stable/11/contrib/llvm/tools/lld/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp stable/11/contrib/llvm/tools/lldb/source/Expression/IRExecutionUnit.cpp stable/11/etc/mtree/BSD.debug.dist stable/11/etc/mtree/BSD.usr.dist stable/11/lib/clang/headers/Makefile stable/11/lib/clang/include/clang/Basic/Version.inc stable/11/lib/clang/include/clang/Config/config.h stable/11/lib/clang/include/lld/Config/Version.inc stable/11/lib/clang/include/llvm/Config/config.h stable/11/lib/clang/include/llvm/Config/llvm-config.h stable/11/lib/clang/include/llvm/Support/VCSRevision.h stable/11/lib/libclang_rt/Makefile.inc stable/11/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/11/ (props changed) Modified: stable/11/ObsoleteFiles.inc ============================================================================== --- stable/11/ObsoleteFiles.inc Tue Dec 26 14:37:47 2017 (r327203) +++ stable/11/ObsoleteFiles.inc Tue Dec 26 14:44:02 2017 (r327204) @@ -38,6 +38,123 @@ # xargs -n1 | sort | uniq -d; # done +# 20171226: new clang import which bumps version from 5.0.0 to 5.0.1. +OLD_FILES+=usr/lib/clang/5.0.0/include/sanitizer/allocator_interface.h +OLD_FILES+=usr/lib/clang/5.0.0/include/sanitizer/asan_interface.h +OLD_FILES+=usr/lib/clang/5.0.0/include/sanitizer/common_interface_defs.h +OLD_FILES+=usr/lib/clang/5.0.0/include/sanitizer/coverage_interface.h +OLD_FILES+=usr/lib/clang/5.0.0/include/sanitizer/dfsan_interface.h +OLD_FILES+=usr/lib/clang/5.0.0/include/sanitizer/esan_interface.h +OLD_FILES+=usr/lib/clang/5.0.0/include/sanitizer/linux_syscall_hooks.h +OLD_FILES+=usr/lib/clang/5.0.0/include/sanitizer/lsan_interface.h +OLD_FILES+=usr/lib/clang/5.0.0/include/sanitizer/msan_interface.h +OLD_FILES+=usr/lib/clang/5.0.0/include/sanitizer/tsan_interface.h +OLD_FILES+=usr/lib/clang/5.0.0/include/sanitizer/tsan_interface_atomic.h +OLD_DIRS+=usr/lib/clang/5.0.0/include/sanitizer +OLD_FILES+=usr/lib/clang/5.0.0/include/__clang_cuda_builtin_vars.h +OLD_FILES+=usr/lib/clang/5.0.0/include/__clang_cuda_cmath.h +OLD_FILES+=usr/lib/clang/5.0.0/include/__clang_cuda_complex_builtins.h +OLD_FILES+=usr/lib/clang/5.0.0/include/__clang_cuda_intrinsics.h +OLD_FILES+=usr/lib/clang/5.0.0/include/__clang_cuda_math_forward_declares.h +OLD_FILES+=usr/lib/clang/5.0.0/include/__clang_cuda_runtime_wrapper.h +OLD_FILES+=usr/lib/clang/5.0.0/include/__stddef_max_align_t.h +OLD_FILES+=usr/lib/clang/5.0.0/include/__wmmintrin_aes.h +OLD_FILES+=usr/lib/clang/5.0.0/include/__wmmintrin_pclmul.h +OLD_FILES+=usr/lib/clang/5.0.0/include/adxintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/altivec.h +OLD_FILES+=usr/lib/clang/5.0.0/include/ammintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/arm_acle.h +OLD_FILES+=usr/lib/clang/5.0.0/include/arm_neon.h +OLD_FILES+=usr/lib/clang/5.0.0/include/armintr.h +OLD_FILES+=usr/lib/clang/5.0.0/include/avx2intrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/avx512bwintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/avx512cdintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/avx512dqintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/avx512erintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/avx512fintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/avx512ifmaintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/avx512ifmavlintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/avx512pfintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/avx512vbmiintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/avx512vbmivlintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/avx512vlbwintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/avx512vlcdintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/avx512vldqintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/avx512vlintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/avx512vpopcntdqintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/avxintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/bmi2intrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/bmiintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/clflushoptintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/clzerointrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/cpuid.h +OLD_FILES+=usr/lib/clang/5.0.0/include/emmintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/f16cintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/fma4intrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/fmaintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/fxsrintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/htmintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/htmxlintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/ia32intrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/immintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/lwpintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/lzcntintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/mm3dnow.h +OLD_FILES+=usr/lib/clang/5.0.0/include/mm_malloc.h +OLD_FILES+=usr/lib/clang/5.0.0/include/mmintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/module.modulemap +OLD_FILES+=usr/lib/clang/5.0.0/include/msa.h +OLD_FILES+=usr/lib/clang/5.0.0/include/mwaitxintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/nmmintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/opencl-c.h +OLD_FILES+=usr/lib/clang/5.0.0/include/pkuintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/pmmintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/popcntintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/prfchwintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/rdseedintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/rtmintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/s390intrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/shaintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/smmintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/tbmintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/tmmintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/vadefs.h +OLD_FILES+=usr/lib/clang/5.0.0/include/vecintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/wmmintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/x86intrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/xmmintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/xopintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/xsavecintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/xsaveintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/xsaveoptintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/xsavesintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/xtestintrin.h +OLD_DIRS+=usr/lib/clang/5.0.0/include +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.asan-i386.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.asan-i386.so +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.asan-preinit-i386.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.asan-preinit-x86_64.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.asan-x86_64.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.asan-x86_64.so +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.asan_cxx-i386.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.asan_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.profile-arm.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.profile-armhf.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.profile-i386.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.profile-x86_64.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.safestack-i386.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.safestack-x86_64.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.stats-i386.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.stats-x86_64.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.stats_client-i386.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.stats_client-x86_64.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.ubsan_standalone-i386.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.ubsan_standalone-x86_64.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-i386.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-x86_64.a +OLD_DIRS+=usr/lib/clang/5.0.0/lib/freebsd +OLD_DIRS+=usr/lib/clang/5.0.0/lib +OLD_DIRS+=usr/lib/clang/5.0.0 # 20171204: Move fdformat man page from volume 1 to volume 8. OLD_FILES+=usr/share/man/man1/fdformat.1.gz # 20170926: new clang import which bumps version from 4.0.0 to 5.0.0. Modified: stable/11/contrib/libc++/include/algorithm ============================================================================== --- stable/11/contrib/libc++/include/algorithm Tue Dec 26 14:37:47 2017 (r327203) +++ stable/11/contrib/libc++/include/algorithm Tue Dec 26 14:44:02 2017 (r327204) @@ -3013,6 +3013,7 @@ template _UIntType __independent_bits_engine<_Engine, _UIntType>::__eval(true_type) { + const size_t _WRt = numeric_limits::digits; result_type _Sp = 0; for (size_t __k = 0; __k < __n0_; ++__k) { @@ -3021,7 +3022,7 @@ __independent_bits_engine<_Engine, _UIntType>::__eval( { __u = __e_() - _Engine::min(); } while (__u >= __y0_); - if (__w0_ < _WDt) + if (__w0_ < _WRt) _Sp <<= __w0_; else _Sp = 0; @@ -3034,7 +3035,7 @@ __independent_bits_engine<_Engine, _UIntType>::__eval( { __u = __e_() - _Engine::min(); } while (__u >= __y1_); - if (__w0_ < _WDt - 1) + if (__w0_ < _WRt - 1) _Sp <<= __w0_ + 1; else _Sp = 0; Modified: stable/11/contrib/libc++/include/deque ============================================================================== --- stable/11/contrib/libc++/include/deque Tue Dec 26 14:37:47 2017 (r327203) +++ stable/11/contrib/libc++/include/deque Tue Dec 26 14:44:02 2017 (r327204) @@ -1356,7 +1356,6 @@ class _LIBCPP_TEMPLATE_VIS deque (public) iterator insert(const_iterator __p, initializer_list __il) {return insert(__p, __il.begin(), __il.end());} #endif // _LIBCPP_CXX03_LANG - iterator insert(const_iterator __p, const value_type& __v); iterator insert(const_iterator __p, size_type __n, const value_type& __v); template @@ -2224,7 +2223,11 @@ deque<_Tp, _Allocator>::__append(_InpIter __f, _InpIte !__is_forward_iterator<_InpIter>::value>::type*) { for (; __f != __l; ++__f) +#ifdef _LIBCPP_CXX03_LANG push_back(*__f); +#else + emplace_back(*__f); +#endif } template Modified: stable/11/contrib/libc++/include/functional ============================================================================== --- stable/11/contrib/libc++/include/functional Tue Dec 26 14:37:47 2017 (r327203) +++ stable/11/contrib/libc++/include/functional Tue Dec 26 14:44:02 2017 (r327204) @@ -1597,9 +1597,11 @@ class _LIBCPP_TEMPLATE_VIS function<_Rp(_ArgTypes...)> return reinterpret_cast<__base*>(p); } - template ::value && - __invokable<_Fp&, _ArgTypes...>::value> - struct __callable; + template , function>::value>, + __invokable<_Fp&, _ArgTypes...> + >::value> + struct __callable; template struct __callable<_Fp, true> { @@ -1612,6 +1614,9 @@ class _LIBCPP_TEMPLATE_VIS function<_Rp(_ArgTypes...)> { static const bool value = false; }; + + template + using _EnableIfCallable = typename enable_if<__callable<_Fp>::value>::type; public: typedef _Rp result_type; @@ -1622,9 +1627,7 @@ class _LIBCPP_TEMPLATE_VIS function<_Rp(_ArgTypes...)> function(nullptr_t) _NOEXCEPT : __f_(0) {} function(const function&); function(function&&) _NOEXCEPT; - template::value && !is_same<_Fp, function>::value - >::type> + template> function(_Fp); #if _LIBCPP_STD_VER <= 14 @@ -1638,21 +1641,15 @@ class _LIBCPP_TEMPLATE_VIS function<_Rp(_ArgTypes...)> function(allocator_arg_t, const _Alloc&, const function&); template function(allocator_arg_t, const _Alloc&, function&&); - template::value>::type> + template> function(allocator_arg_t, const _Alloc& __a, _Fp __f); #endif function& operator=(const function&); function& operator=(function&&) _NOEXCEPT; function& operator=(nullptr_t) _NOEXCEPT; - template - typename enable_if - < - __callable::type>::value && - !is_same::type, function>::value, - function& - >::type - operator=(_Fp&&); + template> + function& operator=(_Fp&&); ~function(); @@ -1854,13 +1851,8 @@ function<_Rp(_ArgTypes...)>::operator=(nullptr_t) _NOE } template -template -typename enable_if -< - function<_Rp(_ArgTypes...)>::template __callable::type>::value && - !is_same::type, function<_Rp(_ArgTypes...)>>::value, - function<_Rp(_ArgTypes...)>& ->::type +template +function<_Rp(_ArgTypes...)>& function<_Rp(_ArgTypes...)>::operator=(_Fp&& __f) { function(_VSTD::forward<_Fp>(__f)).swap(*this); Modified: stable/11/contrib/libc++/include/list ============================================================================== --- stable/11/contrib/libc++/include/list Tue Dec 26 14:37:47 2017 (r327203) +++ stable/11/contrib/libc++/include/list Tue Dec 26 14:44:02 2017 (r327204) @@ -992,6 +992,15 @@ class _LIBCPP_TEMPLATE_VIS list (public) void push_front(const value_type& __x); void push_back(const value_type& __x); +#ifndef _LIBCPP_CXX03_LANG + template + _LIBCPP_INLINE_VISIBILITY + void __emplace_back(_Arg&& __arg) { emplace_back(_VSTD::forward<_Arg>(__arg)); } +#else + _LIBCPP_INLINE_VISIBILITY + void __emplace_back(value_type const& __arg) { push_back(__arg); } +#endif + iterator insert(const_iterator __p, const value_type& __x); iterator insert(const_iterator __p, size_type __n, const value_type& __x); template @@ -1189,7 +1198,7 @@ list<_Tp, _Alloc>::list(_InpIter __f, _InpIter __l, __get_db()->__insert_c(this); #endif for (; __f != __l; ++__f) - push_back(*__f); + __emplace_back(*__f); } template @@ -1202,7 +1211,7 @@ list<_Tp, _Alloc>::list(_InpIter __f, _InpIter __l, co __get_db()->__insert_c(this); #endif for (; __f != __l; ++__f) - push_back(*__f); + __emplace_back(*__f); } template Modified: stable/11/contrib/libc++/include/string ============================================================================== --- stable/11/contrib/libc++/include/string Tue Dec 26 14:37:47 2017 (r327203) +++ stable/11/contrib/libc++/include/string Tue Dec 26 14:44:02 2017 (r327204) @@ -259,7 +259,7 @@ class basic_string (public) size_type find(value_type c, size_type pos = 0) const noexcept; size_type rfind(const basic_string& str, size_type pos = npos) const noexcept; - size_type ffind(basic_string_view sv, size_type pos = 0) const noexcept; + size_type rfind(basic_string_view sv, size_type pos = npos) const noexcept; size_type rfind(const value_type* s, size_type pos, size_type n) const noexcept; size_type rfind(const value_type* s, size_type pos = npos) const noexcept; size_type rfind(value_type c, size_type pos = npos) const noexcept; @@ -271,7 +271,7 @@ class basic_string (public) size_type find_first_of(value_type c, size_type pos = 0) const noexcept; size_type find_last_of(const basic_string& str, size_type pos = npos) const noexcept; - size_type find_last_of(basic_string_view sv, size_type pos = 0) const noexcept; + size_type find_last_of(basic_string_view sv, size_type pos = npos) const noexcept; size_type find_last_of(const value_type* s, size_type pos, size_type n) const noexcept; size_type find_last_of(const value_type* s, size_type pos = npos) const noexcept; size_type find_last_of(value_type c, size_type pos = npos) const noexcept; @@ -283,7 +283,7 @@ class basic_string (public) size_type find_first_not_of(value_type c, size_type pos = 0) const noexcept; size_type find_last_not_of(const basic_string& str, size_type pos = npos) const noexcept; - size_type find_last_not_of(basic_string_view sv, size_type pos = 0) const noexcept; + size_type find_last_not_of(basic_string_view sv, size_type pos = npos) const noexcept; size_type find_last_not_of(const value_type* s, size_type pos, size_type n) const noexcept; size_type find_last_not_of(const value_type* s, size_type pos = npos) const noexcept; size_type find_last_not_of(value_type c, size_type pos = npos) const noexcept; @@ -1147,7 +1147,7 @@ class _LIBCPP_TEMPLATE_VIS basic_string (public) _LIBCPP_INLINE_VISIBILITY size_type rfind(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT; _LIBCPP_INLINE_VISIBILITY - size_type rfind(__self_view __sv, size_type __pos = 0) const _NOEXCEPT; + size_type rfind(__self_view __sv, size_type __pos = npos) const _NOEXCEPT; size_type rfind(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT; _LIBCPP_INLINE_VISIBILITY size_type rfind(const value_type* __s, size_type __pos = npos) const _NOEXCEPT; @@ -1166,7 +1166,7 @@ class _LIBCPP_TEMPLATE_VIS basic_string (public) _LIBCPP_INLINE_VISIBILITY size_type find_last_of(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT; _LIBCPP_INLINE_VISIBILITY - size_type find_last_of(__self_view __sv, size_type __pos = 0) const _NOEXCEPT; + size_type find_last_of(__self_view __sv, size_type __pos = npos) const _NOEXCEPT; size_type find_last_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT; _LIBCPP_INLINE_VISIBILITY size_type find_last_of(const value_type* __s, size_type __pos = npos) const _NOEXCEPT; @@ -1186,7 +1186,7 @@ class _LIBCPP_TEMPLATE_VIS basic_string (public) _LIBCPP_INLINE_VISIBILITY size_type find_last_not_of(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT; _LIBCPP_INLINE_VISIBILITY - size_type find_last_not_of(__self_view __sv, size_type __pos = 0) const _NOEXCEPT; + size_type find_last_not_of(__self_view __sv, size_type __pos = npos) const _NOEXCEPT; size_type find_last_not_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT; _LIBCPP_INLINE_VISIBILITY size_type find_last_not_of(const value_type* __s, size_type __pos = npos) const _NOEXCEPT; Modified: stable/11/contrib/libc++/include/type_traits ============================================================================== --- stable/11/contrib/libc++/include/type_traits Tue Dec 26 14:37:47 2017 (r327203) +++ stable/11/contrib/libc++/include/type_traits Tue Dec 26 14:44:02 2017 (r327204) @@ -4339,8 +4339,8 @@ struct __invokable_r using _Result = decltype( _VSTD::__invoke(_VSTD::declval<_Fp>(), _VSTD::declval<_Args>()...)); - static const bool value = - conditional< + using type = + typename conditional< !is_same<_Result, __nat>::value, typename conditional< is_void<_Ret>::value, @@ -4348,7 +4348,8 @@ struct __invokable_r is_convertible<_Result, _Ret> >::type, false_type - >::type::value; + >::type; + static const bool value = type::value; }; template Modified: stable/11/contrib/libc++/include/vector ============================================================================== --- stable/11/contrib/libc++/include/vector Tue Dec 26 14:37:47 2017 (r327203) +++ stable/11/contrib/libc++/include/vector Tue Dec 26 14:44:02 2017 (r327204) @@ -674,6 +674,17 @@ class _LIBCPP_TEMPLATE_VIS vector (public) const value_type* data() const _NOEXCEPT {return _VSTD::__to_raw_pointer(this->__begin_);} +#ifdef _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY + void __emplace_back(const value_type& __x) { push_back(__x); } +#else + template + _LIBCPP_INLINE_VISIBILITY + void __emplace_back(_Arg&& __arg) { + emplace_back(_VSTD::forward<_Arg>(__arg)); + } +#endif + _LIBCPP_INLINE_VISIBILITY void push_back(const_reference __x); #ifndef _LIBCPP_CXX03_LANG @@ -1128,7 +1139,7 @@ vector<_Tp, _Allocator>::vector(_InputIterator __first __get_db()->__insert_c(this); #endif for (; __first != __last; ++__first) - push_back(*__first); + __emplace_back(*__first); } template @@ -1145,7 +1156,7 @@ vector<_Tp, _Allocator>::vector(_InputIterator __first __get_db()->__insert_c(this); #endif for (; __first != __last; ++__first) - push_back(*__first); + __emplace_back(*__first); } template @@ -1365,7 +1376,7 @@ vector<_Tp, _Allocator>::assign(_InputIterator __first { clear(); for (; __first != __last; ++__first) - push_back(*__first); + __emplace_back(*__first); } template Modified: stable/11/contrib/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h ============================================================================== --- stable/11/contrib/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h Tue Dec 26 14:37:47 2017 (r327203) +++ stable/11/contrib/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h Tue Dec 26 14:44:02 2017 (r327204) @@ -652,6 +652,12 @@ class TargetTransformInfoImplCRTPBase : public TargetT auto GTI = gep_type_begin(PointeeType, Operands); Type *TargetType; + + // Handle the case where the GEP instruction has a single operand, + // the basis, therefore TargetType is a nullptr. + if (Operands.empty()) + return !BaseGV ? TTI::TCC_Free : TTI::TCC_Basic; + for (auto I = Operands.begin(); I != Operands.end(); ++I, ++GTI) { TargetType = GTI.getIndexedType(); // We assume that the cost of Scalar GEP with constant index and the Modified: stable/11/contrib/llvm/include/llvm/CodeGen/MachineRegisterInfo.h ============================================================================== --- stable/11/contrib/llvm/include/llvm/CodeGen/MachineRegisterInfo.h Tue Dec 26 14:37:47 2017 (r327203) +++ stable/11/contrib/llvm/include/llvm/CodeGen/MachineRegisterInfo.h Tue Dec 26 14:44:02 2017 (r327204) @@ -807,6 +807,14 @@ class MachineRegisterInfo { (public) return getReservedRegs().test(PhysReg); } + /// Returns true when the given register unit is considered reserved. + /// + /// Register units are considered reserved when for at least one of their + /// root registers, the root register and all super registers are reserved. + /// This currently iterates the register hierarchy and may be slower than + /// expected. + bool isReservedRegUnit(unsigned Unit) const; + /// isAllocatable - Returns true when PhysReg belongs to an allocatable /// register class and it hasn't been reserved. /// Modified: stable/11/contrib/llvm/include/llvm/IR/AutoUpgrade.h ============================================================================== --- stable/11/contrib/llvm/include/llvm/IR/AutoUpgrade.h Tue Dec 26 14:37:47 2017 (r327203) +++ stable/11/contrib/llvm/include/llvm/IR/AutoUpgrade.h Tue Dec 26 14:44:02 2017 (r327204) @@ -51,6 +51,8 @@ namespace llvm { /// module is modified. bool UpgradeModuleFlags(Module &M); + void UpgradeSectionAttributes(Module &M); + /// If the given TBAA tag uses the scalar TBAA format, create a new node /// corresponding to the upgrade to the struct-path aware TBAA format. /// Otherwise return the \p TBAANode itself. Modified: stable/11/contrib/llvm/include/llvm/Support/FormatVariadic.h ============================================================================== --- stable/11/contrib/llvm/include/llvm/Support/FormatVariadic.h Tue Dec 26 14:37:47 2017 (r327203) +++ stable/11/contrib/llvm/include/llvm/Support/FormatVariadic.h Tue Dec 26 14:44:02 2017 (r327204) @@ -94,6 +94,15 @@ class formatv_object_base { (public) Adapters.reserve(ParamCount); } + formatv_object_base(formatv_object_base const &rhs) = delete; + + formatv_object_base(formatv_object_base &&rhs) + : Fmt(std::move(rhs.Fmt)), + Adapters(), // Adapters are initialized by formatv_object + Replacements(std::move(rhs.Replacements)) { + Adapters.reserve(rhs.Adapters.size()); + }; + void format(raw_ostream &S) const { for (auto &R : Replacements) { if (R.Type == ReplacementType::Empty) @@ -147,6 +156,14 @@ template class formatv_object : publi formatv_object(StringRef Fmt, Tuple &&Params) : formatv_object_base(Fmt, std::tuple_size::value), Parameters(std::move(Params)) { + Adapters = apply_tuple(create_adapters(), Parameters); + } + + formatv_object(formatv_object const &rhs) = delete; + + formatv_object(formatv_object &&rhs) + : formatv_object_base(std::move(rhs)), + Parameters(std::move(rhs.Parameters)) { Adapters = apply_tuple(create_adapters(), Parameters); } }; Modified: stable/11/contrib/llvm/lib/AsmParser/LLParser.cpp ============================================================================== --- stable/11/contrib/llvm/lib/AsmParser/LLParser.cpp Tue Dec 26 14:37:47 2017 (r327203) +++ stable/11/contrib/llvm/lib/AsmParser/LLParser.cpp Tue Dec 26 14:44:02 2017 (r327204) @@ -240,6 +240,7 @@ bool LLParser::ValidateEndOfModule() { UpgradeDebugInfo(*M); UpgradeModuleFlags(*M); + UpgradeSectionAttributes(*M); if (!Slots) return false; Modified: stable/11/contrib/llvm/lib/Bitcode/Reader/BitcodeReader.cpp ============================================================================== --- stable/11/contrib/llvm/lib/Bitcode/Reader/BitcodeReader.cpp Tue Dec 26 14:37:47 2017 (r327203) +++ stable/11/contrib/llvm/lib/Bitcode/Reader/BitcodeReader.cpp Tue Dec 26 14:44:02 2017 (r327204) @@ -264,7 +264,7 @@ Expected hasObjCCategoryInModule(BitstreamCursor if (convertToString(Record, 0, S)) return error("Invalid record"); // Check for the i386 and other (x86_64, ARM) conventions - if (S.find("__DATA, __objc_catlist") != std::string::npos || + if (S.find("__DATA,__objc_catlist") != std::string::npos || S.find("__OBJC,__category") != std::string::npos) return true; break; Modified: stable/11/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp ============================================================================== --- stable/11/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp Tue Dec 26 14:37:47 2017 (r327203) +++ stable/11/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp Tue Dec 26 14:44:02 2017 (r327204) @@ -621,6 +621,7 @@ void DwarfCompileUnit::constructAbstractSubprogramScop auto *SP = cast(Scope->getScopeNode()); DIE *ContextDIE; + DwarfCompileUnit *ContextCU = this; if (includeMinimalInlineScopes()) ContextDIE = &getUnitDie(); @@ -631,18 +632,23 @@ void DwarfCompileUnit::constructAbstractSubprogramScop else if (auto *SPDecl = SP->getDeclaration()) { ContextDIE = &getUnitDie(); getOrCreateSubprogramDIE(SPDecl); - } else + } else { ContextDIE = getOrCreateContextDIE(resolve(SP->getScope())); + // The scope may be shared with a subprogram that has already been + // constructed in another CU, in which case we need to construct this + // subprogram in the same CU. + ContextCU = DD->lookupCU(ContextDIE->getUnitDie()); + } // Passing null as the associated node because the abstract definition // shouldn't be found by lookup. - AbsDef = &createAndAddDIE(dwarf::DW_TAG_subprogram, *ContextDIE, nullptr); - applySubprogramAttributesToDefinition(SP, *AbsDef); + AbsDef = &ContextCU->createAndAddDIE(dwarf::DW_TAG_subprogram, *ContextDIE, nullptr); + ContextCU->applySubprogramAttributesToDefinition(SP, *AbsDef); - if (!includeMinimalInlineScopes()) - addUInt(*AbsDef, dwarf::DW_AT_inline, None, dwarf::DW_INL_inlined); - if (DIE *ObjectPointer = createAndAddScopeChildren(Scope, *AbsDef)) - addDIEEntry(*AbsDef, dwarf::DW_AT_object_pointer, *ObjectPointer); + if (!ContextCU->includeMinimalInlineScopes()) + ContextCU->addUInt(*AbsDef, dwarf::DW_AT_inline, None, dwarf::DW_INL_inlined); + if (DIE *ObjectPointer = ContextCU->createAndAddScopeChildren(Scope, *AbsDef)) + ContextCU->addDIEEntry(*AbsDef, dwarf::DW_AT_object_pointer, *ObjectPointer); } DIE *DwarfCompileUnit::constructImportedEntityDIE( Modified: stable/11/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h ============================================================================== --- stable/11/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h Tue Dec 26 14:37:47 2017 (r327203) +++ stable/11/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h Tue Dec 26 14:44:02 2017 (r327204) @@ -283,7 +283,7 @@ class DwarfDebug : public DebugHandlerBase { // 0, referencing the comp_dir of all the type units that use it. MCDwarfDwoLineTable SplitTypeUnitFileTable; /// @} - + /// True iff there are multiple CUs in this module. bool SingleCU; bool IsDarwin; @@ -562,6 +562,9 @@ class DwarfDebug : public DebugHandlerBase { bool isLexicalScopeDIENull(LexicalScope *Scope); bool hasDwarfPubSections(bool includeMinimalInlineScopes) const; + + /// Find the matching DwarfCompileUnit for the given CU DIE. + DwarfCompileUnit *lookupCU(const DIE *Die) { return CUDieMap.lookup(Die); } }; } // End of namespace llvm Modified: stable/11/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp ============================================================================== --- stable/11/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp Tue Dec 26 14:37:47 2017 (r327203) +++ stable/11/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp Tue Dec 26 14:44:02 2017 (r327204) @@ -131,13 +131,12 @@ bool DwarfExpression::addMachineReg(const TargetRegist // Intersection between the bits we already emitted and the bits // covered by this subregister. - SmallBitVector Intersection(RegSize, false); - Intersection.set(Offset, Offset + Size); - Intersection ^= Coverage; + SmallBitVector CurSubReg(RegSize, false); + CurSubReg.set(Offset, Offset + Size); // If this sub-register has a DWARF number and we haven't covered // its range, emit a DWARF piece for it. - if (Reg >= 0 && Intersection.any()) { + if (Reg >= 0 && CurSubReg.test(Coverage)) { // Emit a piece for any gap in the coverage. if (Offset > CurPos) DwarfRegs.push_back({-1, Offset - CurPos, nullptr}); Modified: stable/11/contrib/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp ============================================================================== --- stable/11/contrib/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp Tue Dec 26 14:37:47 2017 (r327203) +++ stable/11/contrib/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp Tue Dec 26 14:44:02 2017 (r327204) @@ -269,8 +269,9 @@ void LiveIntervals::computeRegUnitRange(LiveRange &LR, // may share super-registers. That's OK because createDeadDefs() is // idempotent. It is very rare for a register unit to have multiple roots, so // uniquing super-registers is probably not worthwhile. - bool IsReserved = true; + bool IsReserved = false; for (MCRegUnitRootIterator Root(Unit, TRI); Root.isValid(); ++Root) { + bool IsRootReserved = true; for (MCSuperRegIterator Super(*Root, TRI, /*IncludeSelf=*/true); Super.isValid(); ++Super) { unsigned Reg = *Super; @@ -279,9 +280,12 @@ void LiveIntervals::computeRegUnitRange(LiveRange &LR, // A register unit is considered reserved if all its roots and all their // super registers are reserved. if (!MRI->isReserved(Reg)) - IsReserved = false; + IsRootReserved = false; } + IsReserved |= IsRootReserved; } + assert(IsReserved == MRI->isReservedRegUnit(Unit) && + "reserved computation mismatch"); // Now extend LR to reach all uses. // Ignore uses of reserved registers. We only track defs of those. @@ -924,7 +928,7 @@ class LiveIntervals::HMEditor { (public) // kill flags. This is wasteful. Eventually, LiveVariables will strip all kill // flags, and postRA passes will use a live register utility instead. LiveRange *getRegUnitLI(unsigned Unit) { - if (UpdateFlags) + if (UpdateFlags && !MRI.isReservedRegUnit(Unit)) return &LIS.getRegUnit(Unit); return LIS.getCachedRegUnit(Unit); } Modified: stable/11/contrib/llvm/lib/CodeGen/MachineRegisterInfo.cpp ============================================================================== --- stable/11/contrib/llvm/lib/CodeGen/MachineRegisterInfo.cpp Tue Dec 26 14:37:47 2017 (r327203) +++ stable/11/contrib/llvm/lib/CodeGen/MachineRegisterInfo.cpp Tue Dec 26 14:44:02 2017 (r327204) @@ -601,3 +601,21 @@ void MachineRegisterInfo::setCalleeSavedRegs(ArrayRef< UpdatedCSRs.push_back(0); IsUpdatedCSRsInitialized = true; } + +bool MachineRegisterInfo::isReservedRegUnit(unsigned Unit) const { + const TargetRegisterInfo *TRI = getTargetRegisterInfo(); + for (MCRegUnitRootIterator Root(Unit, TRI); Root.isValid(); ++Root) { + bool IsRootReserved = true; + for (MCSuperRegIterator Super(*Root, TRI, /*IncludeSelf=*/true); + Super.isValid(); ++Super) { + unsigned Reg = *Super; + if (!isReserved(Reg)) { + IsRootReserved = false; + break; + } + } + if (IsRootReserved) + return true; + } + return false; +} Modified: stable/11/contrib/llvm/lib/CodeGen/MachineVerifier.cpp ============================================================================== --- stable/11/contrib/llvm/lib/CodeGen/MachineVerifier.cpp Tue Dec 26 14:37:47 2017 (r327203) +++ stable/11/contrib/llvm/lib/CodeGen/MachineVerifier.cpp Tue Dec 26 14:44:02 2017 (r327204) @@ -1316,6 +1316,8 @@ void MachineVerifier::checkLiveness(const MachineOpera // Check the cached regunit intervals. if (TargetRegisterInfo::isPhysicalRegister(Reg) && !isReserved(Reg)) { for (MCRegUnitIterator Units(Reg, TRI); Units.isValid(); ++Units) { + if (MRI->isReservedRegUnit(*Units)) + continue; if (const LiveRange *LR = LiveInts->getCachedRegUnit(*Units)) checkLivenessAtUse(MO, MONum, UseIdx, *LR, *Units); } Modified: stable/11/contrib/llvm/lib/IR/AutoUpgrade.cpp ============================================================================== --- stable/11/contrib/llvm/lib/IR/AutoUpgrade.cpp Tue Dec 26 14:37:47 2017 (r327203) +++ stable/11/contrib/llvm/lib/IR/AutoUpgrade.cpp Tue Dec 26 14:44:02 2017 (r327204) @@ -2271,6 +2271,24 @@ bool llvm::UpgradeModuleFlags(Module &M) { } } } + // Upgrade Objective-C Image Info Section. Removed the whitespce in the + // section name so that llvm-lto will not complain about mismatching + // module flags that is functionally the same. + if (ID->getString() == "Objective-C Image Info Section") { + if (auto *Value = dyn_cast_or_null(Op->getOperand(2))) { + SmallVector ValueComp; + Value->getString().split(ValueComp, " "); + if (ValueComp.size() != 1) { + std::string NewValue; + for (auto &S : ValueComp) + NewValue += S.str(); + Metadata *Ops[3] = {Op->getOperand(0), Op->getOperand(1), + MDString::get(M.getContext(), NewValue)}; + ModFlags->setOperand(I, MDNode::get(M.getContext(), Ops)); + Changed = true; + } + } + } } // "Objective-C Class Properties" is recently added for Objective-C. We @@ -2285,6 +2303,35 @@ bool llvm::UpgradeModuleFlags(Module &M) { } return Changed; +} + +void llvm::UpgradeSectionAttributes(Module &M) { + auto TrimSpaces = [](StringRef Section) -> std::string { + SmallVector Components; + Section.split(Components, ','); + + SmallString<32> Buffer; + raw_svector_ostream OS(Buffer); + + for (auto Component : Components) + OS << ',' << Component.trim(); + + return OS.str().substr(1); + }; + + for (auto &GV : M.globals()) { + if (!GV.hasSection()) + continue; + + StringRef Section = GV.getSection(); + + if (!Section.startswith("__DATA, __objc_catlist")) + continue; + + // __DATA, __objc_catlist, regular, no_dead_strip + // __DATA,__objc_catlist,regular,no_dead_strip + GV.setSection(TrimSpaces(Section)); + } } static bool isOldLoopArgument(Metadata *MD) { Modified: stable/11/contrib/llvm/lib/IR/ConstantFold.cpp ============================================================================== --- stable/11/contrib/llvm/lib/IR/ConstantFold.cpp Tue Dec 26 14:37:47 2017 (r327203) +++ stable/11/contrib/llvm/lib/IR/ConstantFold.cpp Tue Dec 26 14:44:02 2017 (r327204) @@ -2199,6 +2199,9 @@ Constant *llvm::ConstantFoldGetElementPtr(Type *Pointe Unknown = true; continue; } + if (!isa(Idxs[i - 1])) + // FIXME: add the support of cosntant vector index. + continue; if (InRangeIndex && i == *InRangeIndex + 1) { // If an index is marked inrange, we cannot apply this canonicalization to // the following index, as that will cause the inrange index to point to Modified: stable/11/contrib/llvm/lib/Linker/IRMover.cpp ============================================================================== --- stable/11/contrib/llvm/lib/Linker/IRMover.cpp Tue Dec 26 14:37:47 2017 (r327203) +++ stable/11/contrib/llvm/lib/Linker/IRMover.cpp Tue Dec 26 14:44:02 2017 (r327204) @@ -640,6 +640,10 @@ GlobalValue *IRLinker::copyGlobalValueProto(const Glob } else { if (ForDefinition) NewGV = copyGlobalAliasProto(cast(SGV)); + else if (SGV->getValueType()->isFunctionTy()) + NewGV = + Function::Create(cast(TypeMap.get(SGV->getValueType())), + GlobalValue::ExternalLinkage, SGV->getName(), &DstM); else NewGV = new GlobalVariable( DstM, TypeMap.get(SGV->getValueType()), Modified: stable/11/contrib/llvm/lib/Linker/LinkModules.cpp ============================================================================== --- stable/11/contrib/llvm/lib/Linker/LinkModules.cpp Tue Dec 26 14:37:47 2017 (r327203) +++ stable/11/contrib/llvm/lib/Linker/LinkModules.cpp Tue Dec 26 14:44:02 2017 (r327204) @@ -329,8 +329,18 @@ bool ModuleLinker::shouldLinkFromSource(bool &LinkFrom bool ModuleLinker::linkIfNeeded(GlobalValue &GV) { GlobalValue *DGV = getLinkedToGlobal(&GV); - if (shouldLinkOnlyNeeded() && !(DGV && DGV->isDeclaration())) - return false; + if (shouldLinkOnlyNeeded()) { + // Always import variables with appending linkage. + if (!GV.hasAppendingLinkage()) { + // Don't import globals unless they are referenced by the destination + // module. + if (!DGV) + return false; + // Don't import globals that are already defined in the destination module + if (!DGV->isDeclaration()) + return false; + } + } if (DGV && !GV.hasLocalLinkage() && !GV.hasAppendingLinkage()) { auto *DGVar = dyn_cast(DGV); Modified: stable/11/contrib/llvm/lib/Support/Host.cpp ============================================================================== --- stable/11/contrib/llvm/lib/Support/Host.cpp Tue Dec 26 14:37:47 2017 (r327203) +++ stable/11/contrib/llvm/lib/Support/Host.cpp Tue Dec 26 14:44:02 2017 (r327204) @@ -208,6 +208,7 @@ StringRef sys::detail::getHostCPUNameForARM( .Case("0x06f", "krait") // APQ8064 .Case("0x201", "kryo") .Case("0x205", "kryo") + .Case("0xc00", "falkor") .Default("generic"); return "generic"; Modified: stable/11/contrib/llvm/lib/Target/AArch64/AArch64FalkorHWPFFix.cpp ============================================================================== --- stable/11/contrib/llvm/lib/Target/AArch64/AArch64FalkorHWPFFix.cpp Tue Dec 26 14:37:47 2017 (r327203) +++ stable/11/contrib/llvm/lib/Target/AArch64/AArch64FalkorHWPFFix.cpp Tue Dec 26 14:44:02 2017 (r327204) @@ -220,27 +220,27 @@ static Optional getLoadInfo(const MachineIns default: return None; + case AArch64::LD1i64: + case AArch64::LD2i64: + DestRegIdx = 0; + BaseRegIdx = 3; + OffsetIdx = -1; + IsPrePost = false; + break; + case AArch64::LD1i8: case AArch64::LD1i16: case AArch64::LD1i32: - case AArch64::LD1i64: case AArch64::LD2i8: case AArch64::LD2i16: case AArch64::LD2i32: - case AArch64::LD2i64: case AArch64::LD3i8: case AArch64::LD3i16: case AArch64::LD3i32: + case AArch64::LD3i64: case AArch64::LD4i8: case AArch64::LD4i16: case AArch64::LD4i32: - DestRegIdx = 0; - BaseRegIdx = 3; - OffsetIdx = -1; - IsPrePost = false; - break; - - case AArch64::LD3i64: case AArch64::LD4i64: DestRegIdx = -1; BaseRegIdx = 3; @@ -264,23 +264,16 @@ static Optional getLoadInfo(const MachineIns case AArch64::LD1Rv4s: case AArch64::LD1Rv8h: case AArch64::LD1Rv16b: - case AArch64::LD1Twov1d: - case AArch64::LD1Twov2s: - case AArch64::LD1Twov4h: - case AArch64::LD1Twov8b: - case AArch64::LD2Twov2s: - case AArch64::LD2Twov4s: - case AArch64::LD2Twov8b: - case AArch64::LD2Rv1d: - case AArch64::LD2Rv2s: - case AArch64::LD2Rv4s: - case AArch64::LD2Rv8b: DestRegIdx = 0; BaseRegIdx = 1; OffsetIdx = -1; IsPrePost = false; break; + case AArch64::LD1Twov1d: + case AArch64::LD1Twov2s: + case AArch64::LD1Twov4h: + case AArch64::LD1Twov8b: case AArch64::LD1Twov2d: case AArch64::LD1Twov4s: case AArch64::LD1Twov8h: @@ -301,10 +294,17 @@ static Optional getLoadInfo(const MachineIns case AArch64::LD1Fourv4s: case AArch64::LD1Fourv8h: case AArch64::LD1Fourv16b: + case AArch64::LD2Twov2s: + case AArch64::LD2Twov4s: + case AArch64::LD2Twov8b: case AArch64::LD2Twov2d: case AArch64::LD2Twov4h: case AArch64::LD2Twov8h: case AArch64::LD2Twov16b: + case AArch64::LD2Rv1d: + case AArch64::LD2Rv2s: + case AArch64::LD2Rv4s: + case AArch64::LD2Rv8b: case AArch64::LD2Rv2d: case AArch64::LD2Rv4h: case AArch64::LD2Rv8h: @@ -345,32 +345,32 @@ static Optional getLoadInfo(const MachineIns IsPrePost = false; break; + case AArch64::LD1i64_POST: + case AArch64::LD2i64_POST: + DestRegIdx = 1; + BaseRegIdx = 4; + OffsetIdx = 5; + IsPrePost = true; + break; + case AArch64::LD1i8_POST: case AArch64::LD1i16_POST: case AArch64::LD1i32_POST: - case AArch64::LD1i64_POST: case AArch64::LD2i8_POST: case AArch64::LD2i16_POST: case AArch64::LD2i32_POST: - case AArch64::LD2i64_POST: case AArch64::LD3i8_POST: case AArch64::LD3i16_POST: case AArch64::LD3i32_POST: + case AArch64::LD3i64_POST: case AArch64::LD4i8_POST: case AArch64::LD4i16_POST: case AArch64::LD4i32_POST: - DestRegIdx = 1; - BaseRegIdx = 4; - OffsetIdx = 5; - IsPrePost = false; - break; - - case AArch64::LD3i64_POST: case AArch64::LD4i64_POST: DestRegIdx = -1; BaseRegIdx = 4; OffsetIdx = 5; - IsPrePost = false; + IsPrePost = true; break; case AArch64::LD1Onev1d_POST: @@ -389,23 +389,16 @@ static Optional getLoadInfo(const MachineIns case AArch64::LD1Rv4s_POST: case AArch64::LD1Rv8h_POST: case AArch64::LD1Rv16b_POST: - case AArch64::LD1Twov1d_POST: - case AArch64::LD1Twov2s_POST: - case AArch64::LD1Twov4h_POST: - case AArch64::LD1Twov8b_POST: - case AArch64::LD2Twov2s_POST: - case AArch64::LD2Twov4s_POST: - case AArch64::LD2Twov8b_POST: - case AArch64::LD2Rv1d_POST: - case AArch64::LD2Rv2s_POST: - case AArch64::LD2Rv4s_POST: - case AArch64::LD2Rv8b_POST: DestRegIdx = 1; BaseRegIdx = 2; OffsetIdx = 3; - IsPrePost = false; + IsPrePost = true; break; + case AArch64::LD1Twov1d_POST: + case AArch64::LD1Twov2s_POST: + case AArch64::LD1Twov4h_POST: + case AArch64::LD1Twov8b_POST: case AArch64::LD1Twov2d_POST: case AArch64::LD1Twov4s_POST: case AArch64::LD1Twov8h_POST: @@ -426,10 +419,17 @@ static Optional getLoadInfo(const MachineIns case AArch64::LD1Fourv4s_POST: case AArch64::LD1Fourv8h_POST: case AArch64::LD1Fourv16b_POST: + case AArch64::LD2Twov2s_POST: + case AArch64::LD2Twov4s_POST: + case AArch64::LD2Twov8b_POST: case AArch64::LD2Twov2d_POST: case AArch64::LD2Twov4h_POST: case AArch64::LD2Twov8h_POST: case AArch64::LD2Twov16b_POST: + case AArch64::LD2Rv1d_POST: + case AArch64::LD2Rv2s_POST: + case AArch64::LD2Rv4s_POST: + case AArch64::LD2Rv8b_POST: case AArch64::LD2Rv2d_POST: case AArch64::LD2Rv4h_POST: case AArch64::LD2Rv8h_POST: @@ -467,7 +467,7 @@ static Optional getLoadInfo(const MachineIns DestRegIdx = -1; BaseRegIdx = 2; OffsetIdx = 3; - IsPrePost = false; + IsPrePost = true; break; case AArch64::LDRBBroW: @@ -572,8 +572,12 @@ static Optional getLoadInfo(const MachineIns IsPrePost = true; break; - case AArch64::LDPDi: + case AArch64::LDNPDi: + case AArch64::LDNPQi: + case AArch64::LDNPSi: case AArch64::LDPQi: + case AArch64::LDPDi: + case AArch64::LDPSi: DestRegIdx = -1; BaseRegIdx = 2; OffsetIdx = 3; @@ -581,7 +585,6 @@ static Optional getLoadInfo(const MachineIns break; case AArch64::LDPSWi: - case AArch64::LDPSi: case AArch64::LDPWi: case AArch64::LDPXi: DestRegIdx = 0; @@ -592,18 +595,18 @@ static Optional getLoadInfo(const MachineIns case AArch64::LDPQpost: case AArch64::LDPQpre: + case AArch64::LDPDpost: + case AArch64::LDPDpre: + case AArch64::LDPSpost: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Dec 26 15:24:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83111E99124; Tue, 26 Dec 2017 15:24:43 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A0A679A16; Tue, 26 Dec 2017 15:24:43 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBQFOgSX046910; Tue, 26 Dec 2017 15:24:42 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBQFOggM046909; Tue, 26 Dec 2017 15:24:42 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201712261524.vBQFOggM046909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 26 Dec 2017 15:24:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327205 - head/sys/netinet/libalias X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet/libalias X-SVN-Commit-Revision: 327205 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 15:24:43 -0000 Author: tuexen Date: Tue Dec 26 15:24:42 2017 New Revision: 327205 URL: https://svnweb.freebsd.org/changeset/base/327205 Log: Fix CID 1008936. Modified: head/sys/netinet/libalias/alias_sctp.c Modified: head/sys/netinet/libalias/alias_sctp.c ============================================================================== --- head/sys/netinet/libalias/alias_sctp.c Tue Dec 26 14:44:02 2017 (r327204) +++ head/sys/netinet/libalias/alias_sctp.c Tue Dec 26 15:24:42 2017 (r327205) @@ -2118,31 +2118,31 @@ FindSctpGlobal(struct libalias *la, struct in_addr g_a * @return pointer to association or NULL */ static struct sctp_nat_assoc* -FindSctpLocalT(struct libalias *la, struct in_addr g_addr, uint32_t l_vtag, uint16_t g_port, uint16_t l_port) +FindSctpLocalT(struct libalias *la, struct in_addr g_addr, uint32_t l_vtag, uint16_t g_port, uint16_t l_port) { u_int i; struct sctp_nat_assoc *assoc = NULL, *lastmatch = NULL; struct sctp_GlobalAddress *G_Addr = NULL; int cnt = 0; - + if (l_vtag != 0) { /* an init packet, vtag==0 */ i = SN_TABLE_HASH(l_vtag, g_port, la->sctpNatTableSize); LIST_FOREACH(assoc, &la->sctpTableGlobal[i], list_G) { if ((assoc->g_vtag == l_vtag) && (assoc->g_port == g_port) && (assoc->l_port == l_port)) { if (assoc->num_Gaddr) { LIST_FOREACH(G_Addr, &(assoc->Gaddr), list_Gaddr) { - if(G_Addr->g_addr.s_addr == G_Addr->g_addr.s_addr) - return(assoc); /* full match */ + if (G_Addr->g_addr.s_addr == g_addr.s_addr) + return (assoc); /* full match */ } } else { - if (++cnt > 1) return(NULL); + if (++cnt > 1) return (NULL); lastmatch = assoc; } } } } /* If there is more than one match we do not know which local address to send to */ - return( cnt ? lastmatch : NULL ); + return (cnt ? lastmatch : NULL); } /** @ingroup Hash From owner-svn-src-all@freebsd.org Tue Dec 26 15:29:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7848CE995D9; Tue, 26 Dec 2017 15:29:12 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B8F879D17; Tue, 26 Dec 2017 15:29:12 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBQFTBK1047102; Tue, 26 Dec 2017 15:29:11 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBQFTBE6047101; Tue, 26 Dec 2017 15:29:11 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201712261529.vBQFTBE6047101@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 26 Dec 2017 15:29:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327206 - head/sys/netinet/libalias X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet/libalias X-SVN-Commit-Revision: 327206 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 15:29:12 -0000 Author: tuexen Date: Tue Dec 26 15:29:11 2017 New Revision: 327206 URL: https://svnweb.freebsd.org/changeset/base/327206 Log: Fix CID 1008428. MFC after: 1 week Modified: head/sys/netinet/libalias/alias_sctp.c Modified: head/sys/netinet/libalias/alias_sctp.c ============================================================================== --- head/sys/netinet/libalias/alias_sctp.c Tue Dec 26 15:24:42 2017 (r327205) +++ head/sys/netinet/libalias/alias_sctp.c Tue Dec 26 15:29:11 2017 (r327206) @@ -422,9 +422,9 @@ int sysctl_chg_loglevel(SYSCTL_HANDLER_ARGS) error = sysctl_handle_int(oidp, &level, 0, req); if (error) return (error); - sysctl_log_level = (level > SN_LOG_DEBUG_MAX)?(SN_LOG_DEBUG_MAX):(level); - sysctl_log_level = (level < SN_LOG_LOW)?(SN_LOG_LOW):(level); - + level = (level > SN_LOG_DEBUG_MAX)?(SN_LOG_DEBUG_MAX):(level); + level = (level < SN_LOG_LOW)?(SN_LOG_LOW):(level); + sysctl_log_level = level; return (0); } From owner-svn-src-all@freebsd.org Tue Dec 26 15:35:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6DC0AE99D0C; Tue, 26 Dec 2017 15:35:20 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 362E57A1DF; Tue, 26 Dec 2017 15:35:20 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBQFZJu3051288; Tue, 26 Dec 2017 15:35:19 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBQFZJCC051287; Tue, 26 Dec 2017 15:35:19 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201712261535.vBQFZJCC051287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 26 Dec 2017 15:35:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327207 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 327207 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 15:35:20 -0000 Author: manu Date: Tue Dec 26 15:35:19 2017 New Revision: 327207 URL: https://svnweb.freebsd.org/changeset/base/327207 Log: arm64: a10_gpio.c and a10_mmc.c were renamed aw_gpio.c and aw_mmc.c Modified: head/sys/conf/files.arm64 Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Tue Dec 26 15:29:11 2017 (r327206) +++ head/sys/conf/files.arm64 Tue Dec 26 15:35:19 2017 (r327207) @@ -24,8 +24,8 @@ cloudabi64_vdso_blob.o optional compat_cloudabi64 \ clean "cloudabi64_vdso_blob.o" # arm/allwinner/a10_ehci.c optional ehci aw_ehci fdt -arm/allwinner/a10_gpio.c optional gpio aw_gpio fdt -arm/allwinner/a10_mmc.c optional mmc aw_mmc fdt +arm/allwinner/aw_gpio.c optional gpio aw_gpio fdt +arm/allwinner/aw_mmc.c optional mmc aw_mmc fdt arm/allwinner/a64/a64_padconf.c optional soc_allwinner_a64 fdt arm/allwinner/a64/a64_r_padconf.c optional soc_allwinner_a64 fdt arm/allwinner/h3/h3_padconf.c optional soc_allwinner_h5 fdt From owner-svn-src-all@freebsd.org Tue Dec 26 16:00:00 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF76CE9E2BA; Tue, 26 Dec 2017 16:00:00 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CFB807AD71; Tue, 26 Dec 2017 16:00:00 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 0CE40311C; Tue, 26 Dec 2017 16:00:00 +0000 (UTC) Date: Tue, 26 Dec 2017 16:00:00 +0000 From: Alexey Dokuchaev To: Michael Tuexen Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327205 - head/sys/netinet/libalias Message-ID: <20171226160000.GB90333@FreeBSD.org> References: <201712261524.vBQFOggM046909@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201712261524.vBQFOggM046909@repo.freebsd.org> User-Agent: Mutt/1.9.2 (2017-12-15) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 16:00:01 -0000 On Tue, Dec 26, 2017 at 03:24:42PM +0000, Michael Tuexen wrote: > New Revision: 327205 > URL: https://svnweb.freebsd.org/changeset/base/327205 > > Log: > Fix CID 1008936. I'm afraid this is a rather bad commit message. It should have described what was the problem and how it was approached (fixed). Listing CID is part of the metadata; it cannot replace proper commit log. Also, please do not mix functional and substantial amount of style changes in a single commit. ./danfe From owner-svn-src-all@freebsd.org Tue Dec 26 16:06:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9390DE9E8D4; Tue, 26 Dec 2017 16:06:12 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D5587B20D; Tue, 26 Dec 2017 16:06:12 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBQG6BAJ063887; Tue, 26 Dec 2017 16:06:11 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBQG6BB1063886; Tue, 26 Dec 2017 16:06:11 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201712261606.vBQG6BB1063886@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 26 Dec 2017 16:06:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327208 - head/sys/netinet/libalias X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet/libalias X-SVN-Commit-Revision: 327208 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 16:06:12 -0000 Author: tuexen Date: Tue Dec 26 16:06:11 2017 New Revision: 327208 URL: https://svnweb.freebsd.org/changeset/base/327208 Log: Clearify issue reported in CID 1008198. MFC after: 3 days Modified: head/sys/netinet/libalias/alias_sctp.c Modified: head/sys/netinet/libalias/alias_sctp.c ============================================================================== --- head/sys/netinet/libalias/alias_sctp.c Tue Dec 26 15:35:19 2017 (r327207) +++ head/sys/netinet/libalias/alias_sctp.c Tue Dec 26 16:06:11 2017 (r327208) @@ -1376,6 +1376,7 @@ AddGlobalIPAddresses(struct sctp_nat_msg *sm, struct s case SCTP_ADD_IP_ADDRESS: /* skip to address parameter - leave param_size so bytes left will be calculated properly*/ param = (struct sctp_paramhdr *) &((struct sctp_asconf_addrv4_param *) param)->addrp; + /* FALLTHROUGH */ case SCTP_IPV4_ADDRESS: ipv4_param = (struct sctp_ipv4addr_param *) param; /* add addresses to association */ From owner-svn-src-all@freebsd.org Tue Dec 26 16:12:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67412E9EED8; Tue, 26 Dec 2017 16:12:05 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C4377B660; Tue, 26 Dec 2017 16:12:05 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBQGC4Ye066323; Tue, 26 Dec 2017 16:12:04 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBQGC4wj066322; Tue, 26 Dec 2017 16:12:04 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201712261612.vBQGC4wj066322@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 26 Dec 2017 16:12:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327209 - head/sys/netinet/libalias X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet/libalias X-SVN-Commit-Revision: 327209 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 16:12:05 -0000 Author: tuexen Date: Tue Dec 26 16:12:04 2017 New Revision: 327209 URL: https://svnweb.freebsd.org/changeset/base/327209 Log: Clearify CID 1008197. MFC after: 3 days Modified: head/sys/netinet/libalias/alias_sctp.c Modified: head/sys/netinet/libalias/alias_sctp.c ============================================================================== --- head/sys/netinet/libalias/alias_sctp.c Tue Dec 26 16:06:11 2017 (r327208) +++ head/sys/netinet/libalias/alias_sctp.c Tue Dec 26 16:12:04 2017 (r327209) @@ -1737,27 +1737,28 @@ ProcessSctpMsg(struct libalias *la, int direction, str static int ID_process(struct libalias *la, int direction, struct sctp_nat_assoc *assoc, struct sctp_nat_msg *sm) { - switch(sm->msg) { + switch (sm->msg) { case SN_SCTP_ASCONF: /* a packet containing an ASCONF chunk with ADDIP */ if (!sysctl_accept_global_ootb_addip && (direction == SN_TO_LOCAL)) - return(SN_DROP_PKT); + return (SN_DROP_PKT); /* if this Asconf packet does not contain the Vtag parameters it is of no use in Idle state */ if (!GetAsconfVtags(la, sm, &(assoc->l_vtag), &(assoc->g_vtag), direction)) - return(SN_DROP_PKT); + return (SN_DROP_PKT); + /* FALLTHROUGH */ case SN_SCTP_INIT: /* a packet containing an INIT chunk or an ASCONF AddIP */ if (sysctl_track_global_addresses) AddGlobalIPAddresses(sm, assoc, direction); - switch(direction){ + switch (direction) { case SN_TO_GLOBAL: assoc->l_addr = sm->ip_hdr->ip_src; assoc->a_addr = FindAliasAddress(la, assoc->l_addr); assoc->l_port = sm->sctp_hdr->src_port; assoc->g_port = sm->sctp_hdr->dest_port; - if(sm->msg == SN_SCTP_INIT) + if (sm->msg == SN_SCTP_INIT) assoc->g_vtag = sm->sctpchnk.Init->initiate_tag; if (AddSctpAssocGlobal(la, assoc)) /* DB clash *///**** need to add dst address return((sm->msg == SN_SCTP_INIT) ? SN_REPLY_ABORT : SN_REPLY_ERROR); - if(sm->msg == SN_SCTP_ASCONF) { + if (sm->msg == SN_SCTP_ASCONF) { if (AddSctpAssocLocal(la, assoc, sm->ip_hdr->ip_dst)) /* DB clash */ return(SN_REPLY_ERROR); assoc->TableRegister |= SN_WAIT_TOLOCAL; /* wait for tolocal ack */ @@ -1768,25 +1769,25 @@ ID_process(struct libalias *la, int direction, struct assoc->a_addr = sm->ip_hdr->ip_dst; assoc->l_port = sm->sctp_hdr->dest_port; assoc->g_port = sm->sctp_hdr->src_port; - if(sm->msg == SN_SCTP_INIT) + if (sm->msg == SN_SCTP_INIT) assoc->l_vtag = sm->sctpchnk.Init->initiate_tag; if (AddSctpAssocLocal(la, assoc, sm->ip_hdr->ip_src)) /* DB clash */ return((sm->msg == SN_SCTP_INIT) ? SN_REPLY_ABORT : SN_REPLY_ERROR); - if(sm->msg == SN_SCTP_ASCONF) { + if (sm->msg == SN_SCTP_ASCONF) { if (AddSctpAssocGlobal(la, assoc)) /* DB clash */ //**** need to add src address return(SN_REPLY_ERROR); assoc->TableRegister |= SN_WAIT_TOGLOBAL; /* wait for toglobal ack */ } break; } - assoc->state = (sm->msg == SN_SCTP_INIT) ? SN_INi : SN_INa; - assoc->exp = SN_I_T(la); - sctp_AddTimeOut(la,assoc); - return(SN_NAT_PKT); + assoc->state = (sm->msg == SN_SCTP_INIT) ? SN_INi : SN_INa; + assoc->exp = SN_I_T(la); + sctp_AddTimeOut(la,assoc); + return (SN_NAT_PKT); default: /* Any other type of SCTP message is not valid in Idle */ - return(SN_DROP_PKT); + return (SN_DROP_PKT); } -return(SN_DROP_PKT);/* shouldn't get here very bad: log, drop and hope for the best */ + return (SN_DROP_PKT);/* shouldn't get here very bad: log, drop and hope for the best */ } /** @ingroup state_machine From owner-svn-src-all@freebsd.org Tue Dec 26 16:13:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67B46E9F01F; Tue, 26 Dec 2017 16:13:22 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D8077B815; Tue, 26 Dec 2017 16:13:22 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBQGDLeq068082; Tue, 26 Dec 2017 16:13:21 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBQGDKVM068077; Tue, 26 Dec 2017 16:13:20 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201712261613.vBQGDKVM068077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 26 Dec 2017 16:13:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327210 - in head/share/man/man4: . man4.arm X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/share/man/man4: . man4.arm X-SVN-Commit-Revision: 327210 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 16:13:22 -0000 Author: manu Date: Tue Dec 26 16:13:20 2017 New Revision: 327210 URL: https://svnweb.freebsd.org/changeset/base/327210 Log: Move arm specific man page to man4.arm subfolder Reported by: ian Added: head/share/man/man4/man4.arm/aw_gpio.4 - copied unchanged from r327209, head/share/man/man4/aw_gpio.4 head/share/man/man4/man4.arm/aw_mmc.4 - copied unchanged from r327209, head/share/man/man4/aw_mmc.4 head/share/man/man4/man4.arm/aw_rtc.4 - copied unchanged from r327209, head/share/man/man4/aw_rtc.4 Deleted: head/share/man/man4/aw_gpio.4 head/share/man/man4/aw_mmc.4 head/share/man/man4/aw_rtc.4 Modified: head/share/man/man4/Makefile head/share/man/man4/man4.arm/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Tue Dec 26 16:12:04 2017 (r327209) +++ head/share/man/man4/Makefile Tue Dec 26 16:13:20 2017 (r327210) @@ -70,9 +70,6 @@ MAN= aac.4 \ audit.4 \ auditpipe.4 \ aue.4 \ - aw_gpio.4 \ - aw_mmc.4 \ - aw_rtc.4 \ axe.4 \ axge.4 \ bce.4 \ Modified: head/share/man/man4/man4.arm/Makefile ============================================================================== --- head/share/man/man4/man4.arm/Makefile Tue Dec 26 16:12:04 2017 (r327209) +++ head/share/man/man4/man4.arm/Makefile Tue Dec 26 16:13:20 2017 (r327210) @@ -2,7 +2,10 @@ PACKAGE=runtime-manuals -MAN= cgem.4 \ +MAN= aw_gpio.4 \ + aw_mmc.4 \ + aw_rtc.4 \ + cgem.4 \ devcfg.4 \ mge.4 \ npe.4 \ Copied: head/share/man/man4/man4.arm/aw_gpio.4 (from r327209, head/share/man/man4/aw_gpio.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/man4.arm/aw_gpio.4 Tue Dec 26 16:13:20 2017 (r327210, copy of r327209, head/share/man/man4/aw_gpio.4) @@ -0,0 +1,102 @@ +.\"- +.\" Copyright (c) 2017 Emmanuel Vadot +.\" 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 Dec 25, 2017 +.Dt AW_GPIO 4 +.Os +.Sh NAME +.Nm aw_gpio +.Nd driver for the GPIO and pin muxing functionalities on Allwinner SoC +.Sh SYNOPSIS +.Cd "device gpio" +.Cd "options SOC_ALLWINNER_A10" +.Cd "options SOC_ALLWINNER_A13" +.Cd "options SOC_ALLWINNER_A20" +.Cd "options SOC_ALLWINNER_A31" +.Cd "options SOC_ALLWINNER_A31S" +.Cd "options SOC_ALLWINNER_A33" +.Cd "options SOC_ALLWINNER_A83T" +.Cd "options SOC_ALLWINNER_H2PLUS" +.Cd "options SOC_ALLWINNER_H3" +.Cd "options SOC_ALLWINNER_A64" +.Cd "options SOC_ALLWINNER_H5" +.Sh DESCRIPTION +The +.Nm +device driver provides support for the Allwinner pin muxing and GPIO on +Allwinner SoCs. +.Sh HARDWARE +The current version of the +.Nm +driver supports the GPIO/pinmuxing controller with one of the following +compatible strings : +.Pp +.Bl -bullet -compact +.It +allwinner,sun4i-a10-pinctrl +.It +allwinner,sun5i-a13-pinctrl +.It +allwinner,sun7i-a20-pinctrl +.It +allwinner,sun6i-a31-pinctrl +.It +allwinner,sun6i-a31s-pinctrl +.It +allwinner,sun6i-a31-r-pinctrl +.It +allwinner,sun6i-a33-pinctrl +.It +allwinner,sun8i-a83t-pinctrl +.It +allwinner,sun8i-a83t-r-pinctrl +.It +allwinner,sun8i-h3-pinctrl +.It +allwinner,sun50i-h5-pinctrl +.It +allwinner,sun8i-h3-r-pinctrl +.It +allwinner,sun50i-a64-pinctrl +.It +allwinner,sun50i-a64-r-pinctrl +.El +.Sh SEE ALSO +.Xr fdt 4 , +.Xr gpio 4 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 10.0 . +.Sh AUTHORS +The +.Nm +device driver was originally written by +.An Ganbold Tsagaankhuu Aq Mt ganbold@freebsd.org . +This manual page was written by +.An Emmanuel Vadot Aq Mt manu@freebsd.org . Copied: head/share/man/man4/man4.arm/aw_mmc.4 (from r327209, head/share/man/man4/aw_mmc.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/man4.arm/aw_mmc.4 Tue Dec 26 16:13:20 2017 (r327210, copy of r327209, head/share/man/man4/aw_mmc.4) @@ -0,0 +1,76 @@ +.\"- +.\" Copyright (c) 2017 Emmanuel Vadot +.\" 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 Dec 25, 2017 +.Dt AW_MMC 4 +.Os +.Sh NAME +.Nm aw_mmc +.Nd driver for the SD/MMC controller in Allwinner SoC +.Sh SYNOPSIS +.Cd "device mmc" +.Sh DESCRIPTION +The +.Nm +device driver provides support for the Allwinner SD/MMC host controller. +.Sh HARDWARE +The current version of the +.Nm +driver supports the SD/MMC controller with one of the following compatible strings : +.Pp +.Bl -bullet -compact +.It +allwinner,sun4i-a10-mmc +.It +allwinner,sun5i-a13-mmc +.It +allwinner,sun7i-a20-mmc +.It +allwinner,sun50i-a64-mmc +.El +.Sh SYSCTL VARIABLES +The following read-only variables are available via +.Xr sysctl 8 : +.Bl -tag -width indent +.It Va dev.aw_mmc.req_timeout +Request timeout in seconds (default: 10) . +.El +.Sh SEE ALSO +.Xr fdt 4 , +.Xr mmc 4 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 10.0 . +.Sh AUTHORS +The +.Nm +device driver was originally written by +.An Alexander Fedorov Aq Mt alexander.fedorov@rtlservice.com . +Later work and this manual page was done by +.An Emmanuel Vadot Aq Mt manu@freebsd.org . Copied: head/share/man/man4/man4.arm/aw_rtc.4 (from r327209, head/share/man/man4/aw_rtc.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/man4.arm/aw_rtc.4 Tue Dec 26 16:13:20 2017 (r327210, copy of r327209, head/share/man/man4/aw_rtc.4) @@ -0,0 +1,63 @@ +.\"- +.\" Copyright (c) 2017 Emmanuel Vadot +.\" 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 Dec 25, 2017 +.Dt AW_RTC 4 +.Os +.Sh NAME +.Nm aw_rtc +.Nd driver for the RTC controller in Allwinner SoC +.Sh DESCRIPTION +The +.Nm +device driver provides support for the Allwinner RTC controller. +.Sh HARDWARE +The current version of the +.Nm +driver supports the RTC controller with one of the following compatible +strings : +.Pp +.Bl -bullet -compact +.It +allwinner,sun4i-a10-rtc +.It +allwinner,sun7i-a20-rtc +.It +allwinner,sun6i-a31-rtc +.El +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 11.0 . +.Sh AUTHORS +The +.Nm +device driver was written by +.An Vladimir Belian Aq Mt fate10@gmail.com . +This manual page was written by +.An Emmanuel Vadot Aq Mt manu@freebsd.org . From owner-svn-src-all@freebsd.org Tue Dec 26 16:14:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15A9BE9F1A7; Tue, 26 Dec 2017 16:14:16 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E96AA7BA29; Tue, 26 Dec 2017 16:14:15 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 3D2663705; Tue, 26 Dec 2017 16:14:15 +0000 (UTC) Date: Tue, 26 Dec 2017 16:14:15 +0000 From: Alexey Dokuchaev To: Michael Tuexen Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327209 - head/sys/netinet/libalias Message-ID: <20171226161415.GC90333@FreeBSD.org> References: <201712261612.vBQGC4wj066322@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201712261612.vBQGC4wj066322@repo.freebsd.org> User-Agent: Mutt/1.9.2 (2017-12-15) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 16:14:16 -0000 On Tue, Dec 26, 2017 at 04:12:04PM +0000, Michael Tuexen wrote: > New Revision: 327209 > URL: https://svnweb.freebsd.org/changeset/base/327209 > > Log: > Clearify CID 1008197. Again, this "clarifies" nothing. I see a bunch of style(9) bugs fixed, and fail to see how/why those had upset Coverity. ./danfe From owner-svn-src-all@freebsd.org Tue Dec 26 16:20:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55F33E9F866; Tue, 26 Dec 2017 16:20:40 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1FF3A7BFFC; Tue, 26 Dec 2017 16:20:40 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBQGKdLY068762; Tue, 26 Dec 2017 16:20:39 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBQGKd0r068760; Tue, 26 Dec 2017 16:20:39 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201712261620.vBQGKd0r068760@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Tue, 26 Dec 2017 16:20:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327211 - head/usr.sbin/nandtool X-SVN-Group: head X-SVN-Commit-Author: jilles X-SVN-Commit-Paths: head/usr.sbin/nandtool X-SVN-Commit-Revision: 327211 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 16:20:40 -0000 Author: jilles Date: Tue Dec 26 16:20:38 2017 New Revision: 327211 URL: https://svnweb.freebsd.org/changeset/base/327211 Log: nandtool: Add missing mode for open() with O_CREAT If O_CREAT is given, open() needs a mode argument. Follow the umask by passing 0666. Reviewed by: imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D13607 Modified: head/usr.sbin/nandtool/nand_read.c head/usr.sbin/nandtool/nand_readoob.c Modified: head/usr.sbin/nandtool/nand_read.c ============================================================================== --- head/usr.sbin/nandtool/nand_read.c Tue Dec 26 16:13:20 2017 (r327210) +++ head/usr.sbin/nandtool/nand_read.c Tue Dec 26 16:20:38 2017 (r327211) @@ -52,7 +52,7 @@ int nand_read(struct cmd_param *params) } if ((out = param_get_string(params, "out"))) { - out_fd = open(out, O_WRONLY|O_CREAT); + out_fd = open(out, O_WRONLY|O_CREAT, 0666); if (out_fd == -1) { perrorf("Cannot open %s for writing", out); return (1); Modified: head/usr.sbin/nandtool/nand_readoob.c ============================================================================== --- head/usr.sbin/nandtool/nand_readoob.c Tue Dec 26 16:13:20 2017 (r327210) +++ head/usr.sbin/nandtool/nand_readoob.c Tue Dec 26 16:20:38 2017 (r327211) @@ -59,7 +59,7 @@ int nand_read_oob(struct cmd_param *params) } if ((out = param_get_string(params, "out"))) { - if ((fd_out = open(out, O_WRONLY | O_CREAT)) == -1) { + if ((fd_out = open(out, O_WRONLY | O_CREAT, 0666)) == -1) { perrorf("Cannot open %s", out); ret = 1; goto out; From owner-svn-src-all@freebsd.org Tue Dec 26 16:23:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2886E9FB6B; Tue, 26 Dec 2017 16:23:19 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A33357C3D6; Tue, 26 Dec 2017 16:23:19 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBQGNIuB072529; Tue, 26 Dec 2017 16:23:18 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBQGNINt072527; Tue, 26 Dec 2017 16:23:18 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201712261623.vBQGNINt072527@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Tue, 26 Dec 2017 16:23:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327212 - head/bin/sh X-SVN-Group: head X-SVN-Commit-Author: jilles X-SVN-Commit-Paths: head/bin/sh X-SVN-Commit-Revision: 327212 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 16:23:20 -0000 Author: jilles Date: Tue Dec 26 16:23:18 2017 New Revision: 327212 URL: https://svnweb.freebsd.org/changeset/base/327212 Log: sh: Don't leak wait* implementation details from jobs.c Modified: head/bin/sh/eval.c head/bin/sh/jobs.c Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Tue Dec 26 16:20:38 2017 (r327211) +++ head/bin/sh/eval.c Tue Dec 26 16:23:18 2017 (r327212) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include /* For WIFSIGNALED(status) */ #include /* @@ -840,7 +839,7 @@ evalcommand(union node *cmd, int flags, struct backcmd struct parsefile *savetopfile; volatile int e; char *lastarg; - int realstatus; + int signaled; int do_clearcmdentry; const char *path = pathval(); int i; @@ -1163,9 +1162,9 @@ cmddone: parent: /* parent process gets here (if we forked) */ if (mode == FORK_FG) { /* argument to fork */ INTOFF; - exitstatus = waitforjob(jp, &realstatus); + exitstatus = waitforjob(jp, &signaled); INTON; - if (iflag && loopnest > 0 && WIFSIGNALED(realstatus)) { + if (iflag && loopnest > 0 && signaled) { evalskip = SKIPBREAK; skipcount = loopnest; } Modified: head/bin/sh/jobs.c ============================================================================== --- head/bin/sh/jobs.c Tue Dec 26 16:20:38 2017 (r327211) +++ head/bin/sh/jobs.c Tue Dec 26 16:23:18 2017 (r327212) @@ -1016,7 +1016,7 @@ vforkexecshell(struct job *jp, char **argv, char **env */ int -waitforjob(struct job *jp, int *origstatus) +waitforjob(struct job *jp, int *signaled) { #if JOBS int propagate_int = jp->jobctl && jp->foreground; @@ -1039,8 +1039,8 @@ waitforjob(struct job *jp, int *origstatus) setcurjob(jp); #endif status = jp->ps[jp->nprocs - 1].status; - if (origstatus != NULL) - *origstatus = status; + if (signaled != NULL) + *signaled = WIFSIGNALED(status); /* convert to 8 bits */ if (WIFEXITED(status)) st = WEXITSTATUS(status); From owner-svn-src-all@freebsd.org Tue Dec 26 16:29:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6ED1DEA021E; Tue, 26 Dec 2017 16:29:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 395FC7C847; Tue, 26 Dec 2017 16:29:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBQGTekH072926; Tue, 26 Dec 2017 16:29:40 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBQGTed6072925; Tue, 26 Dec 2017 16:29:40 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201712261629.vBQGTed6072925@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 26 Dec 2017 16:29:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327213 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 327213 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 16:29:41 -0000 Author: markj Date: Tue Dec 26 16:29:39 2017 New Revision: 327213 URL: https://svnweb.freebsd.org/changeset/base/327213 Log: Ensure that pass > 0 when starting a scan with vm_pages_needed == 1. Otherwise the page daemon will not reclaim pages and thus will not wake threads sleeping in VM_WAIT. Reported and tested by: pho Reviewed by: alc, kib X-MFC with: r327168 Differential Revision: https://reviews.freebsd.org/D13640 Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Tue Dec 26 16:23:18 2017 (r327212) +++ head/sys/vm/vm_pageout.c Tue Dec 26 16:29:39 2017 (r327213) @@ -1836,6 +1836,8 @@ vm_pageout_worker(void *arg) */ if (vm_pages_needed) { mtx_unlock(&vm_page_queue_free_mtx); + if (pass == 0) + pass++; } else if (mtx_sleep(&vm_pageout_wanted, &vm_page_queue_free_mtx, PDROP | PVM, "psleep", hz) == 0) { From owner-svn-src-all@freebsd.org Tue Dec 26 16:33:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 313B5EA08DC; Tue, 26 Dec 2017 16:33:57 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BFBC37CCF0; Tue, 26 Dec 2017 16:33:56 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBQGXu4g076796; Tue, 26 Dec 2017 16:33:56 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBQGXtN9076795; Tue, 26 Dec 2017 16:33:55 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201712261633.vBQGXtN9076795@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 26 Dec 2017 16:33:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327214 - head/sys/netinet/libalias X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet/libalias X-SVN-Commit-Revision: 327214 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 16:33:57 -0000 Author: tuexen Date: Tue Dec 26 16:33:55 2017 New Revision: 327214 URL: https://svnweb.freebsd.org/changeset/base/327214 Log: White cleanups. Modified: head/sys/netinet/libalias/alias_sctp.c Modified: head/sys/netinet/libalias/alias_sctp.c ============================================================================== --- head/sys/netinet/libalias/alias_sctp.c Tue Dec 26 16:29:39 2017 (r327213) +++ head/sys/netinet/libalias/alias_sctp.c Tue Dec 26 16:33:55 2017 (r327214) @@ -27,7 +27,7 @@ */ /* - * Alias_sctp forms part of the libalias kernel module to handle + * Alias_sctp forms part of the libalias kernel module to handle * Network Address Translation (NAT) for the SCTP protocol. * * This software was developed by David A. Hayes and Jason But @@ -39,13 +39,13 @@ * proposed by Jason But and Grenville Armitage: * http://caia.swin.edu.au/urp/sonata/ * - * + * * This project has been made possible in part by a grant from * the Cisco University Research Program Fund at Community * Foundation Silicon Valley. * */ -/** @mainpage +/** @mainpage * Alias_sctp is part of the SONATA (http://caia.swin.edu.au/urp/sonata) project * to develop and release a BSD licensed implementation of a Network Address * Translation (NAT) module that supports the Stream Control Transmission @@ -176,7 +176,7 @@ static void SctpAliasLog(const char *format, ...); * * Calls the higher level ShowAliasStats() in alias_db.c which logs all current * statistics about the libalias instance - including SCTP statistics - * + * * @param la Pointer to the libalias instance */ void SctpShowAliasStats(struct libalias *la); @@ -261,7 +261,7 @@ static MALLOC_DEFINE(M_SCTPNAT, "sctpnat", "sctp nat d * Define various log levels and a macro to call specified log functions only if * the current log level (sysctl_log_level) matches the specified level @{ */ -#define SN_LOG_LOW 0 +#define SN_LOG_LOW 0 #define SN_LOG_EVENT 1 #define SN_LOG_INFO 2 #define SN_LOG_DETAIL 3 @@ -422,8 +422,8 @@ int sysctl_chg_loglevel(SYSCTL_HANDLER_ARGS) error = sysctl_handle_int(oidp, &level, 0, req); if (error) return (error); - level = (level > SN_LOG_DEBUG_MAX)?(SN_LOG_DEBUG_MAX):(level); - level = (level < SN_LOG_LOW)?(SN_LOG_LOW):(level); + level = (level > SN_LOG_DEBUG_MAX) ? (SN_LOG_DEBUG_MAX) : (level); + level = (level < SN_LOG_LOW) ? (SN_LOG_LOW) : (level); sysctl_log_level = level; return (0); } @@ -443,12 +443,11 @@ int sysctl_chg_timer(SYSCTL_HANDLER_ARGS) error = sysctl_handle_int(oidp, &timer, 0, req); if (error) return (error); - timer = (timer > SN_MAX_TIMER)?(SN_MAX_TIMER):(timer); + timer = (timer > SN_MAX_TIMER) ? (SN_MAX_TIMER) : (timer); - if (((u_int *)arg1) != &sysctl_holddown_timer) - { - timer = (timer < SN_MIN_TIMER)?(SN_MIN_TIMER):(timer); - } + if (((u_int *)arg1) != &sysctl_holddown_timer) { + timer = (timer < SN_MIN_TIMER) ? (SN_MIN_TIMER) : (timer); + } *(u_int *)arg1 = timer; @@ -472,11 +471,11 @@ int sysctl_chg_hashtable_size(SYSCTL_HANDLER_ARGS) error = sysctl_handle_int(oidp, &size, 0, req); if (error) return (error); - size = (size < SN_MIN_HASH_SIZE)?(SN_MIN_HASH_SIZE):((size > SN_MAX_HASH_SIZE)?(SN_MAX_HASH_SIZE):(size)); + size = (size < SN_MIN_HASH_SIZE) ? (SN_MIN_HASH_SIZE) : ((size > SN_MAX_HASH_SIZE) ? (SN_MAX_HASH_SIZE) : (size)); size |= 0x00000001; /* make odd */ - for(;(((size % 3) == 0) || ((size % 5) == 0) || ((size % 7) == 0) || ((size % 11) == 0)); size+=2); + for (;(((size % 3) == 0) || ((size % 5) == 0) || ((size % 7) == 0) || ((size % 11) == 0)); size+=2); sysctl_hashtable_size = size; return (0); @@ -485,7 +484,7 @@ int sysctl_chg_hashtable_size(SYSCTL_HANDLER_ARGS) /** @ingroup sysctl * @brief sysctl callback for changing net.inet.ip.alias.sctp.error_on_ootb * - * Updates the error_on_clash sysctl variable. + * Updates the error_on_clash sysctl variable. * If set to 0, no ErrorM will be sent if there is a look up table clash * If set to 1, an ErrorM is sent only to the local side * If set to 2, an ErrorM is sent to the local side and global side if there is @@ -540,16 +539,16 @@ int sysctl_chg_initialising_chunk_proc_limit(SYSCTL_HA if (error) return (error); sysctl_initialising_chunk_proc_limit = (proclimit < 1) ? 1: proclimit; - sysctl_chunk_proc_limit = + sysctl_chunk_proc_limit = (sysctl_chunk_proc_limit < sysctl_initialising_chunk_proc_limit) ? sysctl_initialising_chunk_proc_limit : sysctl_chunk_proc_limit; - + return (0); } /** @ingroup sysctl * @brief sysctl callback for changing net.inet.ip.alias.sctp.chunk_proc_limit * - * Updates the chunk_proc_limit sysctl variable. + * Updates the chunk_proc_limit sysctl variable. * Number of chunks that should be processed to find key chunk: * >= initialising_chunk_proc_limit (A high value is a DoS risk) */ @@ -561,7 +560,7 @@ int sysctl_chg_chunk_proc_limit(SYSCTL_HANDLER_ARGS) error = sysctl_handle_int(oidp, &proclimit, 0, req); if (error) return (error); - sysctl_chunk_proc_limit = + sysctl_chunk_proc_limit = (proclimit < sysctl_initialising_chunk_proc_limit) ? sysctl_initialising_chunk_proc_limit : proclimit; return (0); @@ -571,7 +570,7 @@ int sysctl_chg_chunk_proc_limit(SYSCTL_HANDLER_ARGS) /** @ingroup sysctl * @brief sysctl callback for changing net.inet.ip.alias.sctp.param_proc_limit * - * Updates the param_proc_limit sysctl variable. + * Updates the param_proc_limit sysctl variable. * Number of parameters that should be processed to find key parameters: * > 1 (A high value is a DoS risk) */ @@ -583,7 +582,7 @@ int sysctl_chg_param_proc_limit(SYSCTL_HANDLER_ARGS) error = sysctl_handle_int(oidp, &proclimit, 0, req); if (error) return (error); - sysctl_param_proc_limit = + sysctl_param_proc_limit = (proclimit < 2) ? 2 : proclimit; return (0); @@ -614,9 +613,9 @@ int sysctl_chg_track_global_addresses(SYSCTL_HANDLER_A * CODE BEGINS HERE * ---------------------------------------------------------------------- */ -/** +/** * @brief Initialises the SCTP NAT Implementation - * + * * Creates the look-up tables and the timer queue and initialises all state * variables * @@ -650,7 +649,7 @@ void AliasSctpInit(struct libalias *la) la->sctpLinkCount = 0; } -/** +/** * @brief Cleans-up the SCTP NAT Implementation prior to unloading * * Removes all entries from the timer queue, freeing associations as it goes. @@ -705,7 +704,7 @@ void AliasSctpTerm(struct libalias *la) * @param la Pointer to the relevant libalias instance * @param pip Pointer to IP packet to process * @param direction SN_TO_LOCAL | SN_TO_GLOBAL - * + * * @return PKT_ALIAS_OK | PKT_ALIAS_IGNORE | PKT_ALIAS_ERROR */ int @@ -717,10 +716,10 @@ SctpAlias(struct libalias *la, struct ip *pip, int dir if ((direction != SN_TO_LOCAL) && (direction != SN_TO_GLOBAL)) { SctpAliasLog("ERROR: Invalid direction\n"); - return(PKT_ALIAS_ERROR); + return (PKT_ALIAS_ERROR); } - sctp_CheckTimers(la); /* Check timers */ + sctp_CheckTimers(la); /* Check timers */ /* Parse the packet */ rtnval = sctp_PktParser(la, direction, pip, &msg, &assoc); //using *char (change to mbuf when get code from paolo) @@ -735,24 +734,24 @@ SctpAlias(struct libalias *la, struct ip *pip, int dir } SN_LOG(SN_LOG_EVENT, logsctperror("SN_PARSE_ERROR", msg.sctp_hdr->v_tag, rtnval, direction)); - return(PKT_ALIAS_ERROR); + return (PKT_ALIAS_ERROR); case SN_PARSE_ERROR_PARTIALLOOKUP: if (sysctl_error_on_ootb > SN_LOCALandPARTIAL_ERROR_ON_OOTB) { SN_LOG(SN_LOG_EVENT, logsctperror("SN_PARSE_ERROR", msg.sctp_hdr->v_tag, rtnval, direction)); - return(PKT_ALIAS_ERROR); + return (PKT_ALIAS_ERROR); } case SN_PARSE_ERROR_LOOKUP: if (sysctl_error_on_ootb == SN_ERROR_ON_OOTB || (sysctl_error_on_ootb == SN_LOCALandPARTIAL_ERROR_ON_OOTB && direction == SN_TO_LOCAL) || (sysctl_error_on_ootb == SN_LOCAL_ERROR_ON_OOTB && direction == SN_TO_GLOBAL)) { TxAbortErrorM(la, &msg, assoc, SN_REFLECT_ERROR, direction); /*NB assoc=NULL */ - return(PKT_ALIAS_RESPOND); + return (PKT_ALIAS_RESPOND); } default: SN_LOG(SN_LOG_EVENT, logsctperror("SN_PARSE_ERROR", msg.sctp_hdr->v_tag, rtnval, direction)); - return(PKT_ALIAS_ERROR); + return (PKT_ALIAS_ERROR); } SN_LOG(SN_LOG_DETAIL, @@ -770,9 +769,9 @@ SctpAlias(struct libalias *la, struct ip *pip, int dir ); SN_LOG(SN_LOG_DEBUG, logTimerQ(la)); - switch(rtnval){ + switch (rtnval) { case SN_NAT_PKT: - switch(direction) { + switch (direction) { case SN_TO_LOCAL: DifferentialChecksum(&(msg.ip_hdr->ip_sum), &(assoc->l_addr), &(msg.ip_hdr->ip_dst), 2); @@ -794,7 +793,7 @@ SctpAlias(struct libalias *la, struct ip *pip, int dir break; case SN_REPLY_ABORT: case SN_REPLY_ERROR: - case SN_SEND_ABORT: + case SN_SEND_ABORT: TxAbortErrorM(la, &msg, assoc, rtnval, direction); break; default: @@ -814,22 +813,22 @@ SctpAlias(struct libalias *la, struct ip *pip, int dir freeGlobalAddressList(assoc); sn_free(assoc); } - switch(rtnval) { + switch (rtnval) { case SN_NAT_PKT: - return(PKT_ALIAS_OK); + return (PKT_ALIAS_OK); case SN_SEND_ABORT: - return(PKT_ALIAS_OK); + return (PKT_ALIAS_OK); case SN_REPLY_ABORT: case SN_REPLY_ERROR: case SN_REFLECT_ERROR: - return(PKT_ALIAS_RESPOND); + return (PKT_ALIAS_RESPOND); case SN_DROP_PKT: default: - return(PKT_ALIAS_ERROR); + return (PKT_ALIAS_ERROR); } } -/** +/** * @brief Send an AbortM or ErrorM * * We construct the new SCTP packet to send in place of the existing packet we @@ -865,7 +864,7 @@ SctpAlias(struct libalias *la, struct ip *pip, int dir static uint32_t local_sctp_finalize_crc32(uint32_t crc32c) { - /* This routine is duplicated from SCTP + /* This routine is duplicated from SCTP * we need to do that since it MAY be that SCTP * is NOT compiled into the kernel. The CRC32C routines * however are always available in libkern. @@ -924,7 +923,7 @@ TxAbortErrorM(struct libalias *la, struct sctp_nat_msg ip->ip_hl = 5; /* 5*32 bit words */ ip->ip_tos = 0; ip->ip_len = htons(ip_size); - ip->ip_id = sm->ip_hdr->ip_id; + ip->ip_id = sm->ip_hdr->ip_id; ip->ip_off = 0; ip->ip_ttl = 255; ip->ip_p = IPPROTO_SCTP; @@ -937,7 +936,7 @@ TxAbortErrorM(struct libalias *la, struct sctp_nat_msg chunk_hdr->chunk_type = (sndrply & SN_TX_ABORT) ? SCTP_ABORT_ASSOCIATION : SCTP_OPERATION_ERROR; chunk_hdr->chunk_flags = SCTP_MIDDLEBOX_FLAG; if (include_error_cause) { - error_cause->code = htons((sndrply & SN_REFLECT_ERROR) ? SCTP_MISSING_NAT : SCTP_NAT_TABLE_COLLISION); + error_cause->code = htons((sndrply & SN_REFLECT_ERROR) ? SCTP_MISSING_NAT : SCTP_NAT_TABLE_COLLISION); error_cause->length = htons(sizeof(struct sctp_error_cause)); chunk_hdr->chunk_length = htons(sizeof(*chunk_hdr) + sizeof(struct sctp_error_cause)); } else { @@ -945,22 +944,22 @@ TxAbortErrorM(struct libalias *la, struct sctp_nat_msg } /* set specific values */ - switch(sndrply) { + switch (sndrply) { case SN_REFLECT_ERROR: chunk_hdr->chunk_flags |= SCTP_HAD_NO_TCB; /* set Tbit */ - sctp_hdr->v_tag = sm->sctp_hdr->v_tag; + sctp_hdr->v_tag = sm->sctp_hdr->v_tag; break; case SN_REPLY_ERROR: - sctp_hdr->v_tag = (direction == SN_TO_LOCAL) ? assoc->g_vtag : assoc->l_vtag ; + sctp_hdr->v_tag = (direction == SN_TO_LOCAL) ? assoc->g_vtag : assoc->l_vtag ; break; case SN_SEND_ABORT: - sctp_hdr->v_tag = sm->sctp_hdr->v_tag; + sctp_hdr->v_tag = sm->sctp_hdr->v_tag; break; case SN_REPLY_ABORT: sctp_hdr->v_tag = sm->sctpchnk.Init->initiate_tag; break; } - + /* Set send/reply values */ if (sndrply == SN_SEND_ABORT) { /*pass through NAT */ ip->ip_src = (direction == SN_TO_LOCAL) ? sm->ip_hdr->ip_src : assoc->a_addr; @@ -973,10 +972,10 @@ TxAbortErrorM(struct libalias *la, struct sctp_nat_msg sctp_hdr->src_port = sm->sctp_hdr->dest_port; sctp_hdr->dest_port = sm->sctp_hdr->src_port; } - + /* Calculate IP header checksum */ ip->ip_sum = in_cksum_hdr(ip); - + /* calculate SCTP header CRC32 */ sctp_hdr->checksum = 0; sctp_hdr->checksum = local_sctp_finalize_crc32(calculate_crc32c(0xffffffff, (unsigned char *) sctp_hdr, sctp_size)); @@ -1003,18 +1002,18 @@ TxAbortErrorM(struct libalias *la, struct sctp_nat_msg */ /** @ingroup packet_parser * @brief Parses SCTP packets for the key SCTP chunk that will be processed - * + * * This module parses SCTP packets for the key SCTP chunk that will be processed * The module completes the sctp_nat_msg structure and either retrieves the * relevant (existing) stored association from the Hash Tables or creates a new * association entity with state SN_ID * * @param la Pointer to the relevant libalias instance - * @param direction SN_TO_LOCAL | SN_TO_GLOBAL - * @param pip + * @param direction SN_TO_LOCAL | SN_TO_GLOBAL + * @param pip * @param sm Pointer to sctp message information * @param passoc Pointer to the association this SCTP Message belongs to - * + * * @return SN_PARSE_OK | SN_PARSE_ERROR_* */ static int @@ -1049,26 +1048,26 @@ sctp_PktParser(struct libalias *la, int direction, str /* Check SCTP header length and move to first chunk */ if (bytes_left < sizeof(struct sctphdr)) { sm->sctp_hdr = NULL; - return(SN_PARSE_ERROR_IPSHL); /* packet not long enough*/ + return (SN_PARSE_ERROR_IPSHL); /* packet not long enough*/ } sm->sctp_hdr = sctp_hdr = (struct sctphdr *) ip_next(pip); bytes_left -= sizeof(struct sctphdr); - + /* Check for valid ports (zero valued ports would find partially initialised associations */ if (sctp_hdr->src_port == 0 || sctp_hdr->dest_port == 0) - return(SN_PARSE_ERROR_PORT); + return (SN_PARSE_ERROR_PORT); /* Check length of first chunk */ if (bytes_left < SN_MIN_CHUNK_SIZE) /* malformed chunk - could cause endless loop*/ - return(SN_PARSE_ERROR_CHHL); /* packet not long enough for this chunk */ - + return (SN_PARSE_ERROR_CHHL); /* packet not long enough for this chunk */ + /* First chunk */ chunk_hdr = SN_SCTP_FIRSTCHUNK(sctp_hdr); - + chunk_length = SCTP_SIZE32(ntohs(chunk_hdr->chunk_length)); if ((chunk_length < SN_MIN_CHUNK_SIZE) || (chunk_length > bytes_left)) /* malformed chunk - could cause endless loop*/ - return(SN_PARSE_ERROR_CHHL); + return (SN_PARSE_ERROR_CHHL); if ((chunk_hdr->chunk_flags & SCTP_HAD_NO_TCB) && ((chunk_hdr->chunk_type == SCTP_ABORT_ASSOCIATION) || @@ -1091,43 +1090,43 @@ sctp_PktParser(struct libalias *la, int direction, str sm->msg = SN_SCTP_OTHER;/* Initialise to largest value*/ sm->chunk_length = 0; /* only care about length for key chunks */ while (IS_SCTP_CONTROL(chunk_hdr)) { - switch(chunk_hdr->chunk_type) { + switch (chunk_hdr->chunk_type) { case SCTP_INITIATION: if (chunk_length < sizeof(struct sctp_init_chunk)) /* malformed chunk*/ - return(SN_PARSE_ERROR_CHHL); + return (SN_PARSE_ERROR_CHHL); sm->msg = SN_SCTP_INIT; sm->sctpchnk.Init = (struct sctp_init *) ((char *) chunk_hdr + sizeof(struct sctp_chunkhdr)); sm->chunk_length = chunk_length; /* if no existing association, create a new one */ if (*passoc == NULL) { - if (sctp_hdr->v_tag == 0){ //Init requires vtag=0 + if (sctp_hdr->v_tag == 0) { //Init requires vtag=0 *passoc = (struct sctp_nat_assoc *) sn_malloc(sizeof(struct sctp_nat_assoc)); - if (*passoc == NULL) {/* out of resources */ - return(SN_PARSE_ERROR_AS_MALLOC); + if (*passoc == NULL) {/* out of resources */ + return (SN_PARSE_ERROR_AS_MALLOC); } /* Initialise association - malloc initialises memory to zeros */ (*passoc)->state = SN_ID; LIST_INIT(&((*passoc)->Gaddr)); /* always initialise to avoid memory problems */ (*passoc)->TableRegister = SN_NULL_TBL; - return(SN_PARSE_OK); + return (SN_PARSE_OK); } - return(SN_PARSE_ERROR_VTAG); + return (SN_PARSE_ERROR_VTAG); } - return(SN_PARSE_ERROR_LOOKUP); + return (SN_PARSE_ERROR_LOOKUP); case SCTP_INITIATION_ACK: if (chunk_length < sizeof(struct sctp_init_ack_chunk)) /* malformed chunk*/ - return(SN_PARSE_ERROR_CHHL); + return (SN_PARSE_ERROR_CHHL); sm->msg = SN_SCTP_INITACK; sm->sctpchnk.InitAck = (struct sctp_init_ack *) ((char *) chunk_hdr + sizeof(struct sctp_chunkhdr)); sm->chunk_length = chunk_length; - return ((*passoc == NULL)?(SN_PARSE_ERROR_LOOKUP):(SN_PARSE_OK)); + return ((*passoc == NULL) ? (SN_PARSE_ERROR_LOOKUP) : (SN_PARSE_OK)); case SCTP_ABORT_ASSOCIATION: /* access only minimum sized chunk */ sm->msg = SN_SCTP_ABORT; sm->chunk_length = chunk_length; - return ((*passoc == NULL)?(SN_PARSE_ERROR_LOOKUP_ABORT):(SN_PARSE_OK)); + return ((*passoc == NULL) ? (SN_PARSE_ERROR_LOOKUP_ABORT) : (SN_PARSE_OK)); case SCTP_SHUTDOWN_ACK: if (chunk_length < sizeof(struct sctp_shutdown_ack_chunk)) /* malformed chunk*/ - return(SN_PARSE_ERROR_CHHL); + return (SN_PARSE_ERROR_CHHL); if (sm->msg > SN_SCTP_SHUTACK) { sm->msg = SN_SCTP_SHUTACK; sm->chunk_length = chunk_length; @@ -1138,11 +1137,11 @@ sctp_PktParser(struct libalias *la, int direction, str sm->msg = SN_SCTP_SHUTCOMP; sm->chunk_length = chunk_length; } - return ((*passoc == NULL)?(SN_PARSE_ERROR_LOOKUP):(SN_PARSE_OK)); + return ((*passoc == NULL) ? (SN_PARSE_ERROR_LOOKUP) : (SN_PARSE_OK)); case SCTP_ASCONF: if (sm->msg > SN_SCTP_ASCONF) { if (chunk_length < (sizeof(struct sctp_asconf_chunk) + sizeof(struct sctp_ipv4addr_param))) /* malformed chunk*/ - return(SN_PARSE_ERROR_CHHL); + return (SN_PARSE_ERROR_CHHL); //leave parameter searching to later, if required param_hdr = (struct sctp_paramhdr *) ((char *) chunk_hdr + sizeof(struct sctp_asconf_chunk)); /*compulsory IP parameter*/ if (ntohs(param_hdr->param_type) == SCTP_IPV4_ADDRESS) { @@ -1151,38 +1150,38 @@ sctp_PktParser(struct libalias *la, int direction, str ipv4addr.s_addr = ((struct sctp_ipv4addr_param *) param_hdr)->addr; *passoc = FindSctpGlobal(la, ipv4addr, sctp_hdr->v_tag, sctp_hdr->src_port, sctp_hdr->dest_port, &partial_match); } - param_hdr = (struct sctp_paramhdr *) + param_hdr = (struct sctp_paramhdr *) ((char *) param_hdr + sizeof(struct sctp_ipv4addr_param)); /*asconf's compulsory address parameter */ sm->chunk_length = chunk_length - sizeof(struct sctp_asconf_chunk) - sizeof(struct sctp_ipv4addr_param); /* rest of chunk */ } else { if (chunk_length < (sizeof(struct sctp_asconf_chunk) + sizeof(struct sctp_ipv6addr_param))) /* malformed chunk*/ - return(SN_PARSE_ERROR_CHHL); - param_hdr = (struct sctp_paramhdr *) - ((char *) param_hdr + sizeof(struct sctp_ipv6addr_param)); /*asconf's compulsory address parameter */ + return (SN_PARSE_ERROR_CHHL); + param_hdr = (struct sctp_paramhdr *) + ((char *) param_hdr + sizeof(struct sctp_ipv6addr_param)); /*asconf's compulsory address parameter */ sm->chunk_length = chunk_length - sizeof(struct sctp_asconf_chunk) - sizeof(struct sctp_ipv6addr_param); /* rest of chunk */ } sm->msg = SN_SCTP_ASCONF; sm->sctpchnk.Asconf = param_hdr; - + if (*passoc == NULL) { /* AddIP with no association */ *passoc = (struct sctp_nat_assoc *) sn_malloc(sizeof(struct sctp_nat_assoc)); - if (*passoc == NULL) {/* out of resources */ - return(SN_PARSE_ERROR_AS_MALLOC); + if (*passoc == NULL) {/* out of resources */ + return (SN_PARSE_ERROR_AS_MALLOC); } /* Initialise association - malloc initialises memory to zeros */ (*passoc)->state = SN_ID; LIST_INIT(&((*passoc)->Gaddr)); /* always initialise to avoid memory problems */ (*passoc)->TableRegister = SN_NULL_TBL; - return(SN_PARSE_OK); + return (SN_PARSE_OK); } } break; case SCTP_ASCONF_ACK: if (sm->msg > SN_SCTP_ASCONFACK) { if (chunk_length < sizeof(struct sctp_asconf_ack_chunk)) /* malformed chunk*/ - return(SN_PARSE_ERROR_CHHL); + return (SN_PARSE_ERROR_CHHL); //leave parameter searching to later, if required - param_hdr = (struct sctp_paramhdr *) ((char *) chunk_hdr + param_hdr = (struct sctp_paramhdr *) ((char *) chunk_hdr + sizeof(struct sctp_asconf_ack_chunk)); sm->msg = SN_SCTP_ASCONFACK; sm->sctpchnk.Asconf = param_hdr; @@ -1195,33 +1194,33 @@ sctp_PktParser(struct libalias *la, int direction, str /* if no association is found exit - we need to find an Init or AddIP within sysctl_initialising_chunk_proc_limit */ if ((*passoc == NULL) && (chunk_count >= sysctl_initialising_chunk_proc_limit)) - return(SN_PARSE_ERROR_LOOKUP); + return (SN_PARSE_ERROR_LOOKUP); /* finished with this chunk, on to the next chunk*/ bytes_left-= chunk_length; /* Is this the end of the packet ? */ if (bytes_left == 0) - return (*passoc == NULL)?(SN_PARSE_ERROR_LOOKUP):(SN_PARSE_OK); + return (*passoc == NULL) ? (SN_PARSE_ERROR_LOOKUP) : (SN_PARSE_OK); /* Are there enough bytes in packet to at least retrieve length of next chunk ? */ if (bytes_left < SN_MIN_CHUNK_SIZE) - return(SN_PARSE_ERROR_CHHL); + return (SN_PARSE_ERROR_CHHL); chunk_hdr = SN_SCTP_NEXTCHUNK(chunk_hdr); /* Is the chunk long enough to not cause endless look and are there enough bytes in packet to read the chunk ? */ chunk_length = SCTP_SIZE32(ntohs(chunk_hdr->chunk_length)); if ((chunk_length < SN_MIN_CHUNK_SIZE) || (chunk_length > bytes_left)) - return(SN_PARSE_ERROR_CHHL); - if(++chunk_count > sysctl_chunk_proc_limit) - return(SN_PARSE_OK); /* limit for processing chunks, take what we get */ + return (SN_PARSE_ERROR_CHHL); + if (++chunk_count > sysctl_chunk_proc_limit) + return (SN_PARSE_OK); /* limit for processing chunks, take what we get */ } if (*passoc == NULL) - return (partial_match)?(SN_PARSE_ERROR_PARTIALLOOKUP):(SN_PARSE_ERROR_LOOKUP); + return (partial_match) ? (SN_PARSE_ERROR_PARTIALLOOKUP) : (SN_PARSE_ERROR_LOOKUP); else - return(SN_PARSE_OK); + return (SN_PARSE_OK); } /** @ingroup packet_parser @@ -1229,7 +1228,7 @@ sctp_PktParser(struct libalias *la, int direction, str * * GetAsconfVtags scans an Asconf Chunk for the vtags parameter, and then * extracts the vtags. - * + * * GetAsconfVtags is not called from within sctp_PktParser. It is called only * from within ID_process when an AddIP has been received. * @@ -1237,9 +1236,9 @@ sctp_PktParser(struct libalias *la, int direction, str * @param sm Pointer to sctp message information * @param l_vtag Pointer to the local vtag in the association this SCTP Message belongs to * @param g_vtag Pointer to the local vtag in the association this SCTP Message belongs to - * @param direction SN_TO_LOCAL | SN_TO_GLOBAL - * - * @return 1 - success | 0 - fail + * @param direction SN_TO_LOCAL | SN_TO_GLOBAL + * + * @return 1 - success | 0 - fail */ static int GetAsconfVtags(struct libalias *la, struct sctp_nat_msg *sm, uint32_t *l_vtag, uint32_t *g_vtag, int direction) @@ -1251,7 +1250,7 @@ GetAsconfVtags(struct libalias *la, struct sctp_nat_ms uint32_t local_vtag; uint32_t remote_vtag; } __attribute__((packed)); - + struct sctp_vtag_param *vtag_param; struct sctp_paramhdr *param; int bytes_left; @@ -1266,7 +1265,7 @@ GetAsconfVtags(struct libalias *la, struct sctp_nat_ms while((bytes_left >= param_size) && (bytes_left >= SN_VTAG_PARAM_SIZE)) { if (ntohs(param->param_type) == SCTP_VTAG_PARAM) { vtag_param = (struct sctp_vtag_param *) param; - switch(direction) { + switch (direction) { /* The Internet draft is a little ambigious as to order of these vtags. We think it is this way around. If we are wrong, the order will need to be changed. */ @@ -1279,11 +1278,11 @@ GetAsconfVtags(struct libalias *la, struct sctp_nat_ms *l_vtag = vtag_param->local_vtag; break; } - return(1); /* found */ + return (1); /* found */ } bytes_left -= param_size; - if (bytes_left < SN_MIN_PARAM_SIZE) return(0); + if (bytes_left < SN_MIN_PARAM_SIZE) return (0); param = SN_SCTP_NEXTPARAM(param); param_size = SCTP_SIZE32(ntohs(param->param_length)); @@ -1291,22 +1290,22 @@ GetAsconfVtags(struct libalias *la, struct sctp_nat_ms SN_LOG(SN_LOG_EVENT, logsctperror("Parameter parse limit exceeded (GetAsconfVtags)", sm->sctp_hdr->v_tag, sysctl_param_proc_limit, direction)); - return(0); /* not found limit exceeded*/ + return (0); /* not found limit exceeded*/ } } - return(0); /* not found */ + return (0); /* not found */ } /** @ingroup packet_parser * @brief AddGlobalIPAddresses from Init,InitAck,or AddIP packets - * + * * AddGlobalIPAddresses scans an SCTP chunk (in sm) for Global IP addresses, and * adds them. * * @param sm Pointer to sctp message information * @param assoc Pointer to the association this SCTP Message belongs to - * @param direction SN_TO_LOCAL | SN_TO_GLOBAL - * + * @param direction SN_TO_LOCAL | SN_TO_GLOBAL + * */ static void AddGlobalIPAddresses(struct sctp_nat_msg *sm, struct sctp_nat_assoc *assoc, int direction) @@ -1319,7 +1318,7 @@ AddGlobalIPAddresses(struct sctp_nat_msg *sm, struct s int param_size; int param_count, addr_param_count = 0; - switch(direction) { + switch (direction) { case SN_TO_GLOBAL: /* does not contain global addresses */ g_addr = sm->ip_hdr->ip_dst; bytes_left = 0; /* force exit */ @@ -1327,7 +1326,7 @@ AddGlobalIPAddresses(struct sctp_nat_msg *sm, struct s case SN_TO_LOCAL: g_addr = sm->ip_hdr->ip_src; param_count = 1; - switch(sm->msg) { + switch (sm->msg) { case SN_SCTP_INIT: bytes_left = sm->chunk_length - sizeof(struct sctp_init_chunk); param = (struct sctp_paramhdr *)((char *)sm->sctpchnk.Init + sizeof(struct sctp_init)); @@ -1342,16 +1341,16 @@ AddGlobalIPAddresses(struct sctp_nat_msg *sm, struct s break; } } - if (bytes_left >= SN_MIN_PARAM_SIZE) + if (bytes_left >= SN_MIN_PARAM_SIZE) param_size = SCTP_SIZE32(ntohs(param->param_length)); else param_size = bytes_left+1; /* force skip loop */ - - if ((assoc->state == SN_ID) && ((sm->msg == SN_SCTP_INIT) || (bytes_left < SN_MIN_PARAM_SIZE))) {/* add pkt address */ + + if ((assoc->state == SN_ID) && ((sm->msg == SN_SCTP_INIT) || (bytes_left < SN_MIN_PARAM_SIZE))) {/* add pkt address */ G_Addr = (struct sctp_GlobalAddress *) sn_malloc(sizeof(struct sctp_GlobalAddress)); - if (G_Addr == NULL) {/* out of resources */ + if (G_Addr == NULL) {/* out of resources */ SN_LOG(SN_LOG_EVENT, - logsctperror("AddGlobalIPAddress: No resources for adding global address - revert to no tracking", + logsctperror("AddGlobalIPAddress: No resources for adding global address - revert to no tracking", sm->sctp_hdr->v_tag, 0, direction)); assoc->num_Gaddr = 0; /* don't track any more for this assoc*/ sysctl_track_global_addresses=0; @@ -1360,7 +1359,7 @@ AddGlobalIPAddresses(struct sctp_nat_msg *sm, struct s G_Addr->g_addr = g_addr; if (!Add_Global_Address_to_List(assoc, G_Addr)) SN_LOG(SN_LOG_EVENT, - logsctperror("AddGlobalIPAddress: Address already in list", + logsctperror("AddGlobalIPAddress: Address already in list", sm->sctp_hdr->v_tag, assoc->num_Gaddr, direction)); } @@ -1368,11 +1367,11 @@ AddGlobalIPAddresses(struct sctp_nat_msg *sm, struct s while((bytes_left >= param_size) && (bytes_left >= sizeof(struct sctp_ipv4addr_param))) { if (assoc->num_Gaddr >= sysctl_track_global_addresses) { SN_LOG(SN_LOG_EVENT, - logsctperror("AddGlobalIPAddress: Maximum Number of addresses reached", + logsctperror("AddGlobalIPAddress: Maximum Number of addresses reached", sm->sctp_hdr->v_tag, sysctl_track_global_addresses, direction)); return; } - switch(ntohs(param->param_type)) { + switch (ntohs(param->param_type)) { case SCTP_ADD_IP_ADDRESS: /* skip to address parameter - leave param_size so bytes left will be calculated properly*/ param = (struct sctp_paramhdr *) &((struct sctp_asconf_addrv4_param *) param)->addrp; @@ -1381,9 +1380,9 @@ AddGlobalIPAddresses(struct sctp_nat_msg *sm, struct s ipv4_param = (struct sctp_ipv4addr_param *) param; /* add addresses to association */ G_Addr = (struct sctp_GlobalAddress *) sn_malloc(sizeof(struct sctp_GlobalAddress)); - if (G_Addr == NULL) {/* out of resources */ + if (G_Addr == NULL) {/* out of resources */ SN_LOG(SN_LOG_EVENT, - logsctperror("AddGlobalIPAddress: No resources for adding global address - revert to no tracking", + logsctperror("AddGlobalIPAddress: No resources for adding global address - revert to no tracking", sm->sctp_hdr->v_tag, 0, direction)); assoc->num_Gaddr = 0; /* don't track any more for this assoc*/ sysctl_track_global_addresses=0; @@ -1395,22 +1394,22 @@ AddGlobalIPAddresses(struct sctp_nat_msg *sm, struct s G_Addr->g_addr = g_addr; if (!Add_Global_Address_to_List(assoc, G_Addr)) SN_LOG(SN_LOG_EVENT, - logsctperror("AddGlobalIPAddress: Address already in list", + logsctperror("AddGlobalIPAddress: Address already in list", sm->sctp_hdr->v_tag, assoc->num_Gaddr, direction)); return; /*shouldn't be any other addresses if the zero address is given*/ } else { G_Addr->g_addr.s_addr = ipv4_param->addr; if (!Add_Global_Address_to_List(assoc, G_Addr)) SN_LOG(SN_LOG_EVENT, - logsctperror("AddGlobalIPAddress: Address already in list", + logsctperror("AddGlobalIPAddress: Address already in list", sm->sctp_hdr->v_tag, assoc->num_Gaddr, direction)); } - } - + } + bytes_left -= param_size; if (bytes_left < SN_MIN_PARAM_SIZE) break; - + param = SN_SCTP_NEXTPARAM(param); param_size = SCTP_SIZE32(ntohs(param->param_length)); if (++param_count > sysctl_param_proc_limit) { @@ -1422,39 +1421,39 @@ AddGlobalIPAddresses(struct sctp_nat_msg *sm, struct s } if (addr_param_count == 0) { SN_LOG(SN_LOG_DETAIL, - logsctperror("AddGlobalIPAddress: no address parameters to add", + logsctperror("AddGlobalIPAddress: no address parameters to add", sm->sctp_hdr->v_tag, assoc->num_Gaddr, direction)); } } -/** +/** * @brief Add_Global_Address_to_List * * Adds a global IP address to an associations address list, if it is not * already there. The first address added us usually the packet's address, and * is most likely to be used, so it is added at the beginning. Subsequent * addresses are added after this one. - * + * * @param assoc Pointer to the association this SCTP Message belongs to * @param G_addr Pointer to the global address to add * - * @return 1 - success | 0 - fail + * @return 1 - success | 0 - fail */ static int Add_Global_Address_to_List(struct sctp_nat_assoc *assoc, struct sctp_GlobalAddress *G_addr) { - struct sctp_GlobalAddress *iter_G_Addr = NULL, *first_G_Addr = NULL; - first_G_Addr = LIST_FIRST(&(assoc->Gaddr)); + struct sctp_GlobalAddress *iter_G_Addr = NULL, *first_G_Addr = NULL; + first_G_Addr = LIST_FIRST(&(assoc->Gaddr)); if (first_G_Addr == NULL) { LIST_INSERT_HEAD(&(assoc->Gaddr), G_addr, list_Gaddr); /* add new address to beginning of list*/ } else { LIST_FOREACH(iter_G_Addr, &(assoc->Gaddr), list_Gaddr) { if (G_addr->g_addr.s_addr == iter_G_Addr->g_addr.s_addr) - return(0); /* already exists, so don't add */ + return (0); /* already exists, so don't add */ } LIST_INSERT_AFTER(first_G_Addr, G_addr, list_Gaddr); /* add address to end of list*/ } - assoc->num_Gaddr++; - return(1); /* success */ + assoc->num_Gaddr++; + return (1); /* success */ } /** @ingroup packet_parser @@ -1467,8 +1466,8 @@ static int Add_Global_Address_to_List(struct sctp_nat * * @param sm Pointer to sctp message information * @param assoc Pointer to the association this SCTP Message belongs to - * @param direction SN_TO_LOCAL | SN_TO_GLOBAL - * + * @param direction SN_TO_LOCAL | SN_TO_GLOBAL + * */ static void RmGlobalIPAddresses(struct sctp_nat_msg *sm, struct sctp_nat_assoc *assoc, int direction) @@ -1481,7 +1480,7 @@ RmGlobalIPAddresses(struct sctp_nat_msg *sm, struct sc int param_size; int param_count; - if(direction == SN_TO_GLOBAL) + if (direction == SN_TO_GLOBAL) g_addr = sm->ip_hdr->ip_dst; else g_addr = sm->ip_hdr->ip_src; @@ -1489,29 +1488,29 @@ RmGlobalIPAddresses(struct sctp_nat_msg *sm, struct sc bytes_left = sm->chunk_length; param_count = 1; param = sm->sctpchnk.Asconf; - if (bytes_left >= SN_MIN_PARAM_SIZE) { + if (bytes_left >= SN_MIN_PARAM_SIZE) { param_size = SCTP_SIZE32(ntohs(param->param_length)); } else { SN_LOG(SN_LOG_EVENT, - logsctperror("RmGlobalIPAddress: truncated packet - cannot remove IP addresses", + logsctperror("RmGlobalIPAddress: truncated packet - cannot remove IP addresses", sm->sctp_hdr->v_tag, sysctl_track_global_addresses, direction)); return; } - + /* step through Asconf parameters */ while((bytes_left >= param_size) && (bytes_left >= sizeof(struct sctp_ipv4addr_param))) { if (ntohs(param->param_type) == SCTP_DEL_IP_ADDRESS) { asconf_ipv4_param = (struct sctp_asconf_addrv4_param *) param; if (asconf_ipv4_param->addrp.addr == INADDR_ANY) { /* remove all bar pkt address */ LIST_FOREACH_SAFE(G_Addr, &(assoc->Gaddr), list_Gaddr, G_Addr_tmp) { - if(G_Addr->g_addr.s_addr != sm->ip_hdr->ip_src.s_addr) { + if (G_Addr->g_addr.s_addr != sm->ip_hdr->ip_src.s_addr) { if (assoc->num_Gaddr > 1) { /* only delete if more than one */ LIST_REMOVE(G_Addr, list_Gaddr); sn_free(G_Addr); assoc->num_Gaddr--; } else { SN_LOG(SN_LOG_EVENT, - logsctperror("RmGlobalIPAddress: Request to remove last IP address (didn't)", + logsctperror("RmGlobalIPAddress: Request to remove last IP address (didn't)", sm->sctp_hdr->v_tag, assoc->num_Gaddr, direction)); } } @@ -1519,7 +1518,7 @@ RmGlobalIPAddresses(struct sctp_nat_msg *sm, struct sc return; /*shouldn't be any other addresses if the zero address is given*/ } else { LIST_FOREACH_SAFE(G_Addr, &(assoc->Gaddr), list_Gaddr, G_Addr_tmp) { - if(G_Addr->g_addr.s_addr == asconf_ipv4_param->addrp.addr) { + if (G_Addr->g_addr.s_addr == asconf_ipv4_param->addrp.addr) { if (assoc->num_Gaddr > 1) { /* only delete if more than one */ LIST_REMOVE(G_Addr, list_Gaddr); sn_free(G_Addr); @@ -1527,22 +1526,22 @@ RmGlobalIPAddresses(struct sctp_nat_msg *sm, struct sc break; /* Since add only adds new addresses, there should be no double entries */ } else { SN_LOG(SN_LOG_EVENT, - logsctperror("RmGlobalIPAddress: Request to remove last IP address (didn't)", + logsctperror("RmGlobalIPAddress: Request to remove last IP address (didn't)", sm->sctp_hdr->v_tag, assoc->num_Gaddr, direction)); } } } } - } + } bytes_left -= param_size; if (bytes_left == 0) return; else if (bytes_left < SN_MIN_PARAM_SIZE) { SN_LOG(SN_LOG_EVENT, - logsctperror("RmGlobalIPAddress: truncated packet - may not have removed all IP addresses", + logsctperror("RmGlobalIPAddress: truncated packet - may not have removed all IP addresses", sm->sctp_hdr->v_tag, sysctl_track_global_addresses, direction)); return; } - + param = SN_SCTP_NEXTPARAM(param); param_size = SCTP_SIZE32(ntohs(param->param_length)); if (++param_count > sysctl_param_proc_limit) { @@ -1569,11 +1568,11 @@ RmGlobalIPAddresses(struct sctp_nat_msg *sm, struct sc * Since there is currently no connection on this path, there should be no other * ASCONF configuration parameters outstanding, so we presume that if there is * an ACK that it is responding to the AddIP and activate the new association. - * + * * @param la Pointer to the relevant libalias instance * @param sm Pointer to sctp message information - * @param direction SN_TO_LOCAL | SN_TO_GLOBAL - * + * @param direction SN_TO_LOCAL | SN_TO_GLOBAL + * * @return 1 - success | 0 - fail */ static int @@ -1588,45 +1587,45 @@ IsASCONFack(struct libalias *la, struct sctp_nat_msg * param = sm->sctpchnk.Asconf; param_size = SCTP_SIZE32(ntohs(param->param_length)); if (param_size == 8) - return(1); /*success - default acknowledgement of everything */ + return (1); /*success - default acknowledgement of everything */ bytes_left = sm->chunk_length; if (bytes_left < param_size) - return(0); /* not found */ + return (0); /* not found */ /* step through Asconf parameters */ while(bytes_left >= SN_ASCONFACK_PARAM_SIZE) { if (ntohs(param->param_type) == SCTP_SUCCESS_REPORT) - return(1); /* success - but can't match correlation IDs - should only be one */ + return (1); /* success - but can't match correlation IDs - should only be one */ /* check others just in case */ bytes_left -= param_size; if (bytes_left >= SN_MIN_PARAM_SIZE) { param = SN_SCTP_NEXTPARAM(param); } else { - return(0); + return (0); } param_size = SCTP_SIZE32(ntohs(param->param_length)); - if (bytes_left < param_size) return(0); + if (bytes_left < param_size) return (0); if (++param_count > sysctl_param_proc_limit) { SN_LOG(SN_LOG_EVENT, - logsctperror("Parameter parse limit exceeded (IsASCONFack)", + logsctperror("Parameter parse limit exceeded (IsASCONFack)", sm->sctp_hdr->v_tag, sysctl_param_proc_limit, direction)); - return(0); /* not found limit exceeded*/ + return (0); /* not found limit exceeded*/ } } - return(0); /* not success */ + return (0); /* not success */ } /** @ingroup packet_parser - * @brief Check to see if ASCONF contains an Add IP or Del IP parameter - * + * @brief Check to see if ASCONF contains an Add IP or Del IP parameter + * * IsADDorDEL scans an ASCONF packet to see if it contains an AddIP or DelIP * parameter * * @param la Pointer to the relevant libalias instance * @param sm Pointer to sctp message information - * @param direction SN_TO_LOCAL | SN_TO_GLOBAL - * + * @param direction SN_TO_LOCAL | SN_TO_GLOBAL + * * @return SCTP_ADD_IP_ADDRESS | SCTP_DEL_IP_ADDRESS | 0 - fail */ static int @@ -1643,31 +1642,31 @@ IsADDorDEL(struct libalias *la, struct sctp_nat_msg *s bytes_left = sm->chunk_length; if (bytes_left < param_size) - return(0); /* not found */ + return (0); /* not found */ /* step through Asconf parameters */ while(bytes_left >= SN_ASCONFACK_PARAM_SIZE) { if (ntohs(param->param_type) == SCTP_ADD_IP_ADDRESS) - return(SCTP_ADD_IP_ADDRESS); - else if (ntohs(param->param_type) == SCTP_DEL_IP_ADDRESS) - return(SCTP_DEL_IP_ADDRESS); + return (SCTP_ADD_IP_ADDRESS); + else if (ntohs(param->param_type) == SCTP_DEL_IP_ADDRESS) + return (SCTP_DEL_IP_ADDRESS); /* check others just in case */ bytes_left -= param_size; if (bytes_left >= SN_MIN_PARAM_SIZE) { param = SN_SCTP_NEXTPARAM(param); } else { - return(0); /*Neither found */ + return (0); /*Neither found */ } param_size = SCTP_SIZE32(ntohs(param->param_length)); - if (bytes_left < param_size) return(0); + if (bytes_left < param_size) return (0); if (++param_count > sysctl_param_proc_limit) { SN_LOG(SN_LOG_EVENT, - logsctperror("Parameter parse limit exceeded IsADDorDEL)", + logsctperror("Parameter parse limit exceeded IsADDorDEL)", sm->sctp_hdr->v_tag, sysctl_param_proc_limit, direction)); - return(0); /* not found limit exceeded*/ + return (0); /* not found limit exceeded*/ } } - return(0); /*Neither found */ + return (0); /*Neither found */ } /* ---------------------------------------------------------------------- @@ -1690,7 +1689,7 @@ IsADDorDEL(struct libalias *la, struct sctp_nat_msg *s * each state. * * @param la Pointer to the relevant libalias instance - * @param direction SN_TO_LOCAL | SN_TO_GLOBAL + * @param direction SN_TO_LOCAL | SN_TO_GLOBAL * @param sm Pointer to sctp message information * @param assoc Pointer to the association this SCTP Message belongs to * @@ -1707,17 +1706,17 @@ ProcessSctpMsg(struct libalias *la, int direction, str *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Dec 26 16:34:39 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2F35EA0A73; Tue, 26 Dec 2017 16:34:39 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 995B17CEE1; Tue, 26 Dec 2017 16:34:38 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id vBQGYWQB056953; Tue, 26 Dec 2017 08:34:32 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id vBQGYVFB056952; Tue, 26 Dec 2017 08:34:31 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201712261634.vBQGYVFB056952@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r327209 - head/sys/netinet/libalias In-Reply-To: <201712261612.vBQGC4wj066322@repo.freebsd.org> To: Michael Tuexen Date: Tue, 26 Dec 2017 08:34:31 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 16:34:39 -0000 > Author: tuexen > Date: Tue Dec 26 16:12:04 2017 > New Revision: 327209 > URL: https://svnweb.freebsd.org/changeset/base/327209 > > Log: > Clearify CID 1008197. > > MFC after: 3 days This and the prior few commits log entries leave a great deal to be desired from the perspective of someone reading this. > Modified: > head/sys/netinet/libalias/alias_sctp.c > > Modified: head/sys/netinet/libalias/alias_sctp.c > ============================================================================== > --- head/sys/netinet/libalias/alias_sctp.c Tue Dec 26 16:06:11 2017 (r327208) > +++ head/sys/netinet/libalias/alias_sctp.c Tue Dec 26 16:12:04 2017 (r327209) > @@ -1737,27 +1737,28 @@ ProcessSctpMsg(struct libalias *la, int direction, str > static int > ID_process(struct libalias *la, int direction, struct sctp_nat_assoc *assoc, struct sctp_nat_msg *sm) > { > - switch(sm->msg) { > + switch (sm->msg) { > case SN_SCTP_ASCONF: /* a packet containing an ASCONF chunk with ADDIP */ > if (!sysctl_accept_global_ootb_addip && (direction == SN_TO_LOCAL)) > - return(SN_DROP_PKT); > + return (SN_DROP_PKT); > /* if this Asconf packet does not contain the Vtag parameters it is of no use in Idle state */ > if (!GetAsconfVtags(la, sm, &(assoc->l_vtag), &(assoc->g_vtag), direction)) > - return(SN_DROP_PKT); > + return (SN_DROP_PKT); > + /* FALLTHROUGH */ > case SN_SCTP_INIT: /* a packet containing an INIT chunk or an ASCONF AddIP */ > if (sysctl_track_global_addresses) > AddGlobalIPAddresses(sm, assoc, direction); > - switch(direction){ > + switch (direction) { > case SN_TO_GLOBAL: > assoc->l_addr = sm->ip_hdr->ip_src; > assoc->a_addr = FindAliasAddress(la, assoc->l_addr); > assoc->l_port = sm->sctp_hdr->src_port; > assoc->g_port = sm->sctp_hdr->dest_port; > - if(sm->msg == SN_SCTP_INIT) > + if (sm->msg == SN_SCTP_INIT) > assoc->g_vtag = sm->sctpchnk.Init->initiate_tag; > if (AddSctpAssocGlobal(la, assoc)) /* DB clash *///**** need to add dst address > return((sm->msg == SN_SCTP_INIT) ? SN_REPLY_ABORT : SN_REPLY_ERROR); > - if(sm->msg == SN_SCTP_ASCONF) { > + if (sm->msg == SN_SCTP_ASCONF) { > if (AddSctpAssocLocal(la, assoc, sm->ip_hdr->ip_dst)) /* DB clash */ > return(SN_REPLY_ERROR); > assoc->TableRegister |= SN_WAIT_TOLOCAL; /* wait for tolocal ack */ > @@ -1768,25 +1769,25 @@ ID_process(struct libalias *la, int direction, struct > assoc->a_addr = sm->ip_hdr->ip_dst; > assoc->l_port = sm->sctp_hdr->dest_port; > assoc->g_port = sm->sctp_hdr->src_port; > - if(sm->msg == SN_SCTP_INIT) > + if (sm->msg == SN_SCTP_INIT) > assoc->l_vtag = sm->sctpchnk.Init->initiate_tag; > if (AddSctpAssocLocal(la, assoc, sm->ip_hdr->ip_src)) /* DB clash */ > return((sm->msg == SN_SCTP_INIT) ? SN_REPLY_ABORT : SN_REPLY_ERROR); > - if(sm->msg == SN_SCTP_ASCONF) { > + if (sm->msg == SN_SCTP_ASCONF) { > if (AddSctpAssocGlobal(la, assoc)) /* DB clash */ //**** need to add src address > return(SN_REPLY_ERROR); > assoc->TableRegister |= SN_WAIT_TOGLOBAL; /* wait for toglobal ack */ > } > break; > } > - assoc->state = (sm->msg == SN_SCTP_INIT) ? SN_INi : SN_INa; > - assoc->exp = SN_I_T(la); > - sctp_AddTimeOut(la,assoc); > - return(SN_NAT_PKT); > + assoc->state = (sm->msg == SN_SCTP_INIT) ? SN_INi : SN_INa; > + assoc->exp = SN_I_T(la); > + sctp_AddTimeOut(la,assoc); > + return (SN_NAT_PKT); > default: /* Any other type of SCTP message is not valid in Idle */ > - return(SN_DROP_PKT); > + return (SN_DROP_PKT); > } > -return(SN_DROP_PKT);/* shouldn't get here very bad: log, drop and hope for the best */ > + return (SN_DROP_PKT);/* shouldn't get here very bad: log, drop and hope for the best */ > } > > /** @ingroup state_machine > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Tue Dec 26 16:38:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE894EA0E43; Tue, 26 Dec 2017 16:38:05 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 937637D0EC; Tue, 26 Dec 2017 16:38:05 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBQGc414077010; Tue, 26 Dec 2017 16:38:04 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBQGc46N077009; Tue, 26 Dec 2017 16:38:04 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201712261638.vBQGc46N077009@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 26 Dec 2017 16:38:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327215 - head/sys/dev/extres/syscon X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/extres/syscon X-SVN-Commit-Revision: 327215 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 16:38:05 -0000 Author: kevans Date: Tue Dec 26 16:38:04 2017 New Revision: 327215 URL: https://svnweb.freebsd.org/changeset/base/327215 Log: extres/syscon: Commit missing bits from r327106 r327106 introduced kobj to syscon so it can be subclassed and fit in with the rest of the syscon framework. The diff for syscon.c was misapplied in a clean tree prior to commit, so bring it back to what was included in the review and tested. The entire file has basically been rewritten from what was present prior to the kobj work. Pointy hat to: me Modified: head/sys/dev/extres/syscon/syscon.c Modified: head/sys/dev/extres/syscon/syscon.c ============================================================================== --- head/sys/dev/extres/syscon/syscon.c Tue Dec 26 16:33:55 2017 (r327214) +++ head/sys/dev/extres/syscon/syscon.c Tue Dec 26 16:38:04 2017 (r327215) @@ -33,153 +33,223 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_platform.h" + #include #include #include #include +#include +#include #include #include +#include +#include #include +#ifdef FDT #include #include +#endif #include "syscon_if.h" +#include "syscon.h" -#define SYSCON_LOCK(_sc) mtx_lock(&(_sc)->mtx) -#define SYSCON_UNLOCK(_sc) mtx_unlock(&(_sc)->mtx) -#define SYSCON_LOCK_INIT(_sc) mtx_init(&(_sc)->mtx, \ - device_get_nameunit((_sc)->dev), "syscon", MTX_DEF) -#define SYSCON_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->mtx); -#define SYSCON_ASSERT_LOCKED(_sc) mtx_assert(&(_sc)->mtx, MA_OWNED); -#define SYSCON_ASSERT_UNLOCKED(_sc) mtx_assert(&(_sc)->mtx, MA_NOTOWNED); +/* + * Syscon interface details + */ +typedef TAILQ_HEAD(syscon_list, syscon) syscon_list_t; -struct syscon_softc { - device_t dev; - struct resource *mem_res; - struct mtx mtx; +/* + * Declarations + */ +static int syscon_method_init(struct syscon *syscon); +static int syscon_method_uninit(struct syscon *syscon); + +MALLOC_DEFINE(M_SYSCON, "syscon", "Syscon driver"); + +static syscon_list_t syscon_list = TAILQ_HEAD_INITIALIZER(syscon_list); +static struct sx syscon_topo_lock; +SX_SYSINIT(syscon_topology, &syscon_topo_lock, "Syscon topology lock"); + +/* + * Syscon methods. + */ +static syscon_method_t syscon_methods[] = { + SYSCONMETHOD(syscon_init, syscon_method_init), + SYSCONMETHOD(syscon_uninit, syscon_method_uninit), + + SYSCONMETHOD_END }; +DEFINE_CLASS_0(syscon, syscon_class, syscon_methods, 0); -static struct ofw_compat_data compat_data[] = { - {"syscon", 1}, - {NULL, 0} +#define SYSCON_TOPO_SLOCK() sx_slock(&syscon_topo_lock) +#define SYSCON_TOPO_XLOCK() sx_xlock(&syscon_topo_lock) +#define SYSCON_TOPO_UNLOCK() sx_unlock(&syscon_topo_lock) +#define SYSCON_TOPO_ASSERT() sx_assert(&syscon_topo_lock, SA_LOCKED) +#define SYSCON_TOPO_XASSERT() sx_assert(&syscon_topo_lock, SA_XLOCKED) + +/* + * Default syscon methods for base class. + */ +static int +syscon_method_init(struct syscon *syscon) +{ + + return (0); }; -static uint32_t -syscon_read_4(device_t dev, device_t consumer, bus_size_t offset) +static int +syscon_method_uninit(struct syscon *syscon) { - struct syscon_softc *sc; - uint32_t val; - sc = device_get_softc(dev); + return (0); +}; - SYSCON_LOCK(sc); - val = bus_read_4(sc->mem_res, offset); - SYSCON_UNLOCK(sc); - return (val); -} +void * +syscon_get_softc(struct syscon *syscon) +{ -static void -syscon_write_4(device_t dev, device_t consumer, bus_size_t offset, uint32_t val) + return (syscon->softc); +}; + +/* + * Create and initialize syscon object, but do not register it. + */ +struct syscon * +syscon_create(device_t pdev, syscon_class_t syscon_class) { - struct syscon_softc *sc; + struct syscon *syscon; - sc = device_get_softc(dev); + /* Create object and initialize it. */ + syscon = malloc(sizeof(struct syscon), M_SYSCON, + M_WAITOK | M_ZERO); + kobj_init((kobj_t)syscon, (kobj_class_t)syscon_class); - SYSCON_LOCK(sc); - bus_write_4(sc->mem_res, offset, val); - SYSCON_UNLOCK(sc); + /* Allocate softc if required. */ + if (syscon_class->size > 0) + syscon->softc = malloc(syscon_class->size, M_SYSCON, + M_WAITOK | M_ZERO); + + /* Rest of init. */ + syscon->pdev = pdev; + return (syscon); } -static void -syscon_modify_4(device_t dev, device_t consumer, bus_size_t offset, - uint32_t clear_bits, uint32_t set_bits) +/* Register syscon object. */ +struct syscon * +syscon_register(struct syscon *syscon) { - struct syscon_softc *sc; - uint32_t val; + int rv; - sc = device_get_softc(dev); +#ifdef FDT + if (syscon->ofw_node <= 0) + syscon->ofw_node = ofw_bus_get_node(syscon->pdev); + if (syscon->ofw_node <= 0) + return (NULL); +#endif - SYSCON_LOCK(sc); - val = bus_read_4(sc->mem_res, offset); - val &= ~clear_bits; - val |= set_bits; - bus_write_4(sc->mem_res, offset, val); - SYSCON_UNLOCK(sc); + rv = SYSCON_INIT(syscon); + if (rv != 0) { + printf("SYSCON_INIT failed: %d\n", rv); + return (NULL); + } + +#ifdef FDT + OF_device_register_xref(OF_xref_from_node(syscon->ofw_node), + syscon->pdev); +#endif + SYSCON_TOPO_XLOCK(); + TAILQ_INSERT_TAIL(&syscon_list, syscon, syscon_link); + SYSCON_TOPO_UNLOCK(); + return (syscon); } -static int -syscon_probe(device_t dev) +int +syscon_unregister(struct syscon *syscon) { - if (!ofw_bus_status_okay(dev)) - return (ENXIO); - if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) - return (ENXIO); - - device_set_desc(dev, "syscon"); - return (BUS_PROBE_GENERIC); + SYSCON_TOPO_XLOCK(); + TAILQ_REMOVE(&syscon_list, syscon, syscon_link); + SYSCON_TOPO_UNLOCK(); +#ifdef FDT + OF_device_register_xref(OF_xref_from_node(syscon->ofw_node), NULL); +#endif + return (SYSCON_UNINIT(syscon)); } -static int -syscon_attach(device_t dev) +/** + * Provider methods + */ +#ifdef FDT +static struct syscon * +syscon_find_by_ofw_node(phandle_t node) { - struct syscon_softc *sc; - int rid; - phandle_t node; + struct syscon *entry; - sc = device_get_softc(dev); - sc->dev = dev; - node = ofw_bus_get_node(sc->dev); + SYSCON_TOPO_ASSERT(); - SYSCON_LOCK_INIT(sc); - - rid = 0; - sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, - RF_ACTIVE); - if (sc->mem_res == NULL) { - device_printf(dev, "Cannot allocate memory resource\n"); - return (ENXIO); + TAILQ_FOREACH(entry, &syscon_list, syscon_link) { + if (entry->ofw_node == node) + return (entry); } - OF_device_register_xref(OF_xref_from_node(node), dev); - - return (0); + return (NULL); } -static int -syscon_detach(device_t dev) +struct syscon * +syscon_create_ofw_node(device_t pdev, syscon_class_t syscon_class, + phandle_t node) { - struct syscon_softc *sc; + struct syscon *syscon; - sc = device_get_softc(dev); + syscon = syscon_create(pdev, syscon_class); + if (syscon == NULL) + return (NULL); + syscon->ofw_node = node; + if (syscon_register(syscon) == NULL) + return (NULL); + return (syscon); +} - OF_device_register_xref(OF_xref_from_device(dev), NULL); +phandle_t +syscon_get_ofw_node(struct syscon *syscon) +{ - SYSCON_LOCK_DESTROY(sc); - if (sc->mem_res != NULL) - bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->mem_res); - return (0); + return (syscon->ofw_node); } -static device_method_t syscon_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, syscon_probe), - DEVMETHOD(device_attach, syscon_attach), - DEVMETHOD(device_detach, syscon_detach), +int +syscon_get_by_ofw_property(device_t cdev, phandle_t cnode, char *name, + struct syscon **syscon) +{ + pcell_t *cells; + int ncells; - /* Syscon interface */ - DEVMETHOD(syscon_read_4, syscon_read_4), - DEVMETHOD(syscon_write_4, syscon_write_4), - DEVMETHOD(syscon_modify_4, syscon_modify_4), + if (cnode <= 0) + cnode = ofw_bus_get_node(cdev); + if (cnode <= 0) { + device_printf(cdev, + "%s called on not ofw based device\n", __func__); + return (ENXIO); + } + ncells = OF_getencprop_alloc(cnode, name, sizeof(pcell_t), + (void **)&cells); + if (ncells < 1) + return (ENXIO); - DEVMETHOD_END -}; - -DEFINE_CLASS_0(syscon, syscon_driver, syscon_methods, - sizeof(struct syscon_softc)); -static devclass_t syscon_devclass; -EARLY_DRIVER_MODULE(syscon, simplebus, syscon_driver, syscon_devclass, 0, 0, - BUS_PASS_BUS + BUS_PASS_ORDER_LATE); -MODULE_VERSION(syscon, 1); + /* Translate to syscon node. */ + SYSCON_TOPO_SLOCK(); + *syscon = syscon_find_by_ofw_node(OF_node_from_xref(cells[0])); + if (*syscon == NULL) { + SYSCON_TOPO_UNLOCK(); + device_printf(cdev, "Failed to find syscon node\n"); + OF_prop_free(cells); + return (ENODEV); + } + SYSCON_TOPO_UNLOCK(); + OF_prop_free(cells); + return (0); +} +#endif From owner-svn-src-all@freebsd.org Tue Dec 26 16:50:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B72DAEA19B6; Tue, 26 Dec 2017 16:50:51 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C7B17D844; Tue, 26 Dec 2017 16:50:51 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBQGoogS081625; Tue, 26 Dec 2017 16:50:50 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBQGono4081620; Tue, 26 Dec 2017 16:50:49 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201712261650.vBQGono4081620@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 26 Dec 2017 16:50:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327216 - in head/share/man/man4: . man4.arm X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/share/man/man4: . man4.arm X-SVN-Commit-Revision: 327216 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 16:50:51 -0000 Author: manu Date: Tue Dec 26 16:50:49 2017 New Revision: 327216 URL: https://svnweb.freebsd.org/changeset/base/327216 Log: man4: Move back allwinner man page to share/man/man4 But only install them for arm or aarch64 since they are used on both arch. Added: head/share/man/man4/aw_gpio.4 - copied unchanged from r327215, head/share/man/man4/man4.arm/aw_gpio.4 head/share/man/man4/aw_mmc.4 - copied unchanged from r327215, head/share/man/man4/man4.arm/aw_mmc.4 head/share/man/man4/aw_rtc.4 - copied unchanged from r327215, head/share/man/man4/man4.arm/aw_rtc.4 Deleted: head/share/man/man4/man4.arm/aw_gpio.4 head/share/man/man4/man4.arm/aw_mmc.4 head/share/man/man4/man4.arm/aw_rtc.4 Modified: head/share/man/man4/Makefile head/share/man/man4/man4.arm/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Tue Dec 26 16:38:04 2017 (r327215) +++ head/share/man/man4/Makefile Tue Dec 26 16:50:49 2017 (r327216) @@ -70,6 +70,9 @@ MAN= aac.4 \ audit.4 \ auditpipe.4 \ aue.4 \ + ${_aw_gpio.4} \ + ${_aw_mmc.4} \ + ${_aw_rtc.4} \ axe.4 \ axge.4 \ bce.4 \ @@ -754,6 +757,12 @@ MLINKS+=xl.4 if_xl.4 .if ${MACHINE_CPUARCH} == "aarch64" _armv8crypto.4= armv8crypto.4 +.endif + +.if ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "aarch64" +_aw_gpio.4= aw_gpio.4 +_aw_mmc.4= aw_mmc.4 +_aw_rtc.4= aw_rtc.4 .endif .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" Copied: head/share/man/man4/aw_gpio.4 (from r327215, head/share/man/man4/man4.arm/aw_gpio.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/aw_gpio.4 Tue Dec 26 16:50:49 2017 (r327216, copy of r327215, head/share/man/man4/man4.arm/aw_gpio.4) @@ -0,0 +1,102 @@ +.\"- +.\" Copyright (c) 2017 Emmanuel Vadot +.\" 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 Dec 25, 2017 +.Dt AW_GPIO 4 +.Os +.Sh NAME +.Nm aw_gpio +.Nd driver for the GPIO and pin muxing functionalities on Allwinner SoC +.Sh SYNOPSIS +.Cd "device gpio" +.Cd "options SOC_ALLWINNER_A10" +.Cd "options SOC_ALLWINNER_A13" +.Cd "options SOC_ALLWINNER_A20" +.Cd "options SOC_ALLWINNER_A31" +.Cd "options SOC_ALLWINNER_A31S" +.Cd "options SOC_ALLWINNER_A33" +.Cd "options SOC_ALLWINNER_A83T" +.Cd "options SOC_ALLWINNER_H2PLUS" +.Cd "options SOC_ALLWINNER_H3" +.Cd "options SOC_ALLWINNER_A64" +.Cd "options SOC_ALLWINNER_H5" +.Sh DESCRIPTION +The +.Nm +device driver provides support for the Allwinner pin muxing and GPIO on +Allwinner SoCs. +.Sh HARDWARE +The current version of the +.Nm +driver supports the GPIO/pinmuxing controller with one of the following +compatible strings : +.Pp +.Bl -bullet -compact +.It +allwinner,sun4i-a10-pinctrl +.It +allwinner,sun5i-a13-pinctrl +.It +allwinner,sun7i-a20-pinctrl +.It +allwinner,sun6i-a31-pinctrl +.It +allwinner,sun6i-a31s-pinctrl +.It +allwinner,sun6i-a31-r-pinctrl +.It +allwinner,sun6i-a33-pinctrl +.It +allwinner,sun8i-a83t-pinctrl +.It +allwinner,sun8i-a83t-r-pinctrl +.It +allwinner,sun8i-h3-pinctrl +.It +allwinner,sun50i-h5-pinctrl +.It +allwinner,sun8i-h3-r-pinctrl +.It +allwinner,sun50i-a64-pinctrl +.It +allwinner,sun50i-a64-r-pinctrl +.El +.Sh SEE ALSO +.Xr fdt 4 , +.Xr gpio 4 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 10.0 . +.Sh AUTHORS +The +.Nm +device driver was originally written by +.An Ganbold Tsagaankhuu Aq Mt ganbold@freebsd.org . +This manual page was written by +.An Emmanuel Vadot Aq Mt manu@freebsd.org . Copied: head/share/man/man4/aw_mmc.4 (from r327215, head/share/man/man4/man4.arm/aw_mmc.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/aw_mmc.4 Tue Dec 26 16:50:49 2017 (r327216, copy of r327215, head/share/man/man4/man4.arm/aw_mmc.4) @@ -0,0 +1,76 @@ +.\"- +.\" Copyright (c) 2017 Emmanuel Vadot +.\" 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 Dec 25, 2017 +.Dt AW_MMC 4 +.Os +.Sh NAME +.Nm aw_mmc +.Nd driver for the SD/MMC controller in Allwinner SoC +.Sh SYNOPSIS +.Cd "device mmc" +.Sh DESCRIPTION +The +.Nm +device driver provides support for the Allwinner SD/MMC host controller. +.Sh HARDWARE +The current version of the +.Nm +driver supports the SD/MMC controller with one of the following compatible strings : +.Pp +.Bl -bullet -compact +.It +allwinner,sun4i-a10-mmc +.It +allwinner,sun5i-a13-mmc +.It +allwinner,sun7i-a20-mmc +.It +allwinner,sun50i-a64-mmc +.El +.Sh SYSCTL VARIABLES +The following read-only variables are available via +.Xr sysctl 8 : +.Bl -tag -width indent +.It Va dev.aw_mmc.req_timeout +Request timeout in seconds (default: 10) . +.El +.Sh SEE ALSO +.Xr fdt 4 , +.Xr mmc 4 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 10.0 . +.Sh AUTHORS +The +.Nm +device driver was originally written by +.An Alexander Fedorov Aq Mt alexander.fedorov@rtlservice.com . +Later work and this manual page was done by +.An Emmanuel Vadot Aq Mt manu@freebsd.org . Copied: head/share/man/man4/aw_rtc.4 (from r327215, head/share/man/man4/man4.arm/aw_rtc.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/aw_rtc.4 Tue Dec 26 16:50:49 2017 (r327216, copy of r327215, head/share/man/man4/man4.arm/aw_rtc.4) @@ -0,0 +1,63 @@ +.\"- +.\" Copyright (c) 2017 Emmanuel Vadot +.\" 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 Dec 25, 2017 +.Dt AW_RTC 4 +.Os +.Sh NAME +.Nm aw_rtc +.Nd driver for the RTC controller in Allwinner SoC +.Sh DESCRIPTION +The +.Nm +device driver provides support for the Allwinner RTC controller. +.Sh HARDWARE +The current version of the +.Nm +driver supports the RTC controller with one of the following compatible +strings : +.Pp +.Bl -bullet -compact +.It +allwinner,sun4i-a10-rtc +.It +allwinner,sun7i-a20-rtc +.It +allwinner,sun6i-a31-rtc +.El +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 11.0 . +.Sh AUTHORS +The +.Nm +device driver was written by +.An Vladimir Belian Aq Mt fate10@gmail.com . +This manual page was written by +.An Emmanuel Vadot Aq Mt manu@freebsd.org . Modified: head/share/man/man4/man4.arm/Makefile ============================================================================== --- head/share/man/man4/man4.arm/Makefile Tue Dec 26 16:38:04 2017 (r327215) +++ head/share/man/man4/man4.arm/Makefile Tue Dec 26 16:50:49 2017 (r327216) @@ -2,10 +2,7 @@ PACKAGE=runtime-manuals -MAN= aw_gpio.4 \ - aw_mmc.4 \ - aw_rtc.4 \ - cgem.4 \ +MAN= cgem.4 \ devcfg.4 \ mge.4 \ npe.4 \ From owner-svn-src-all@freebsd.org Tue Dec 26 16:54:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57ABAEA1FF1; Tue, 26 Dec 2017 16:54:26 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (mail-n.franken.de [193.175.24.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1B5CA7DFA4; Tue, 26 Dec 2017 16:54:25 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from [192.168.1.204] (p57BB4707.dip0.t-ipconnect.de [87.187.71.7]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id 0E0A7721E280D; Tue, 26 Dec 2017 17:54:20 +0100 (CET) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.2 \(3445.5.20\)) Subject: Re: svn commit: r327205 - head/sys/netinet/libalias From: Michael Tuexen In-Reply-To: <20171226160000.GB90333@FreeBSD.org> Date: Tue, 26 Dec 2017 17:54:18 +0100 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <6ED1D4C5-0A61-463D-AAB2-662E36D2E4FB@freebsd.org> References: <201712261524.vBQFOggM046909@repo.freebsd.org> <20171226160000.GB90333@FreeBSD.org> To: Alexey Dokuchaev X-Mailer: Apple Mail (2.3445.5.20) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 16:54:26 -0000 > On 26. Dec 2017, at 17:00, Alexey Dokuchaev wrote: >=20 > On Tue, Dec 26, 2017 at 03:24:42PM +0000, Michael Tuexen wrote: >> New Revision: 327205 >> URL: https://svnweb.freebsd.org/changeset/base/327205 >>=20 >> Log: >> Fix CID 1008936. >=20 > I'm afraid this is a rather bad commit message. It should have = described > what was the problem and how it was approached (fixed). Listing CID = is > part of the metadata; it cannot replace proper commit log. It replaced a comparison left side =3D=3D right side with identical left and right sides with the correct condition. I guess that was a copy and = paste error. >=20 > Also, please do not mix functional and substantial amount of style = changes > in a single commit. Yepp. You are right. Will do in the future... Best regards Michael >=20 > ./danfe From owner-svn-src-all@freebsd.org Tue Dec 26 16:55:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58B66EA2141; Tue, 26 Dec 2017 16:55:56 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F30617E130; Tue, 26 Dec 2017 16:55:55 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from [192.168.1.204] (p57BB4707.dip0.t-ipconnect.de [87.187.71.7]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id ED25C721E280D; Tue, 26 Dec 2017 17:55:51 +0100 (CET) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.2 \(3445.5.20\)) Subject: Re: svn commit: r327209 - head/sys/netinet/libalias From: Michael Tuexen In-Reply-To: <20171226161415.GC90333@FreeBSD.org> Date: Tue, 26 Dec 2017 17:55:49 +0100 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: 7bit Message-Id: <075ABF39-8543-4351-A8D5-7B8DE10A255C@freebsd.org> References: <201712261612.vBQGC4wj066322@repo.freebsd.org> <20171226161415.GC90333@FreeBSD.org> To: Alexey Dokuchaev X-Mailer: Apple Mail (2.3445.5.20) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 16:55:56 -0000 > On 26. Dec 2017, at 17:14, Alexey Dokuchaev wrote: > > On Tue, Dec 26, 2017 at 04:12:04PM +0000, Michael Tuexen wrote: >> New Revision: 327209 >> URL: https://svnweb.freebsd.org/changeset/base/327209 >> >> Log: >> Clearify CID 1008197. > > Again, this "clarifies" nothing. I see a bunch of style(9) bugs fixed, > and fail to see how/why those had upset Coverity. I added a /* FALLTHROUGH */ Coverity was complaining that a break was possibly missing. Should not have also fixed some style(9) issues and indentation issues in the same function. Best regards Michael > > ./danfe From owner-svn-src-all@freebsd.org Tue Dec 26 17:12:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47ABDEA3176; Tue, 26 Dec 2017 17:12:18 +0000 (UTC) (envelope-from bryanv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D4BF7ED25; Tue, 26 Dec 2017 17:12:18 +0000 (UTC) (envelope-from bryanv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBQHCHeB092988; Tue, 26 Dec 2017 17:12:17 GMT (envelope-from bryanv@FreeBSD.org) Received: (from bryanv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBQHCHpI092987; Tue, 26 Dec 2017 17:12:17 GMT (envelope-from bryanv@FreeBSD.org) Message-Id: <201712261712.vBQHCHpI092987@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bryanv set sender to bryanv@FreeBSD.org using -f From: Bryan Venteicher Date: Tue, 26 Dec 2017 17:12:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r327217 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: bryanv X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 327217 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 17:12:18 -0000 Author: bryanv Date: Tue Dec 26 17:12:16 2017 New Revision: 327217 URL: https://svnweb.freebsd.org/changeset/base/327217 Log: MFC r326480: Add if media and link status events to vxlan Modified: stable/11/sys/net/if_vxlan.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/if_vxlan.c ============================================================================== --- stable/11/sys/net/if_vxlan.c Tue Dec 26 16:50:49 2017 (r327216) +++ stable/11/sys/net/if_vxlan.c Tue Dec 26 17:12:16 2017 (r327217) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -177,6 +178,7 @@ struct vxlan_softc { uint8_t vxl_hwaddr[ETHER_ADDR_LEN]; int vxl_mc_ifindex; struct ifnet *vxl_mc_ifp; + struct ifmedia vxl_media; char vxl_mc_ifname[IFNAMSIZ]; LIST_ENTRY(vxlan_softc) vxl_entry; LIST_ENTRY(vxlan_softc) vxl_ifdetach_list; @@ -342,6 +344,8 @@ static void vxlan_clone_destroy(struct ifnet *); static uint32_t vxlan_mac_hash(struct vxlan_softc *, const uint8_t *); static void vxlan_fakeaddr(struct vxlan_softc *); +static int vxlan_media_change(struct ifnet *); +static void vxlan_media_status(struct ifnet *, struct ifmediareq *); static int vxlan_sockaddr_cmp(const union vxlan_sockaddr *, const struct sockaddr *); @@ -1655,6 +1659,7 @@ vxlan_init(void *xsc) vxlan_timer, sc); VXLAN_WUNLOCK(sc); + if_link_state_change(ifp, LINK_STATE_UP); out: vxlan_init_complete(sc); } @@ -1710,6 +1715,7 @@ vxlan_teardown_locked(struct vxlan_softc *sc) sc->vxl_sock = NULL; VXLAN_WUNLOCK(sc); + if_link_state_change(ifp, LINK_STATE_DOWN); if (vso != NULL) { vxlan_socket_remove_softc(vso, sc); @@ -2219,6 +2225,12 @@ vxlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t dat case SIOCSIFFLAGS: error = vxlan_ioctl_ifflags(sc); break; + + case SIOCSIFMEDIA: + case SIOCGIFMEDIA: + error = ifmedia_ioctl(ifp, ifr, &sc->vxl_media, cmd); + break; + default: error = ether_ioctl(ifp, cmd, data); break; @@ -2685,6 +2697,10 @@ vxlan_clone_create(struct if_clone *ifc, int unit, cad ifp->if_transmit = vxlan_transmit; ifp->if_qflush = vxlan_qflush; + ifmedia_init(&sc->vxl_media, 0, vxlan_media_change, vxlan_media_status); + ifmedia_add(&sc->vxl_media, IFM_ETHER | IFM_AUTO, 0, NULL); + ifmedia_set(&sc->vxl_media, IFM_ETHER | IFM_AUTO); + vxlan_fakeaddr(sc); ether_ifattach(ifp, sc->vxl_hwaddr); @@ -2711,6 +2727,7 @@ vxlan_clone_destroy(struct ifnet *ifp) ether_ifdetach(ifp); if_free(ifp); + ifmedia_removeall(&sc->vxl_media); vxlan_ftable_fini(sc); @@ -2768,6 +2785,22 @@ vxlan_fakeaddr(struct vxlan_softc *sc) arc4rand(sc->vxl_hwaddr, ETHER_ADDR_LEN, 1); sc->vxl_hwaddr[0] &= ~1; sc->vxl_hwaddr[0] |= 2; +} + +static int +vxlan_media_change(struct ifnet *ifp) +{ + + /* Ignore. */ + return (0); +} + +static void +vxlan_media_status(struct ifnet *ifp, struct ifmediareq *ifmr) +{ + + ifmr->ifm_status = IFM_ACTIVE | IFM_AVALID; + ifmr->ifm_active = IFM_ETHER | IFM_FDX; } static int From owner-svn-src-all@freebsd.org Tue Dec 26 17:59:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71BE7EA5BC7; Tue, 26 Dec 2017 17:59:38 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 480F3806C1; Tue, 26 Dec 2017 17:59:38 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBQHxboG011273; Tue, 26 Dec 2017 17:59:37 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBQHxbuq011272; Tue, 26 Dec 2017 17:59:37 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201712261759.vBQHxbuq011272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Tue, 26 Dec 2017 17:59:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327218 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 327218 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 17:59:38 -0000 Author: alc Date: Tue Dec 26 17:59:37 2017 New Revision: 327218 URL: https://svnweb.freebsd.org/changeset/base/327218 Log: Refactor vm_map_find(), creating a separate function, vm_map_alignspace(), for finding aligned free space in the given map. With this change, we always return KERN_NO_SPACE when we fail to find free space. Whereas, previously, we might return KERN_INVALID_ADDRESS. Also, with this change, we explicitly check for address wrap, rather than relying upon the map's min and max addresses to establish sentinel-like regions. This refactoring was inspired by the problem that we addressed in r326098. Reviewed by: kib Tested by: pho Discussed with: markj MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D13346 Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Tue Dec 26 17:12:16 2017 (r327217) +++ head/sys/vm/vm_map.c Tue Dec 26 17:59:37 2017 (r327218) @@ -132,6 +132,9 @@ static int vmspace_zinit(void *mem, int size, int flag static int vm_map_zinit(void *mem, int ize, int flags); static void _vm_map_init(vm_map_t map, pmap_t pmap, vm_offset_t min, vm_offset_t max); +static int vm_map_alignspace(vm_map_t map, vm_object_t object, + vm_ooffset_t offset, vm_offset_t *addr, vm_size_t length, + vm_offset_t max_addr, vm_offset_t alignment); static void vm_map_entry_deallocate(vm_map_entry_t entry, boolean_t system_map); static void vm_map_entry_dispose(vm_map_t map, vm_map_entry_t entry); static void vm_map_entry_unwire(vm_map_t map, vm_map_entry_t entry); @@ -1484,6 +1487,70 @@ vm_map_fixed(vm_map_t map, vm_object_t object, vm_ooff } /* + * Searches for the specified amount of free space in the given map with the + * specified alignment. Performs an address-ordered, first-fit search from + * the given address "*addr", with an optional upper bound "max_addr". If the + * parameter "alignment" is zero, then the alignment is computed from the + * given (object, offset) pair so as to enable the greatest possible use of + * superpage mappings. Returns KERN_SUCCESS and the address of the free space + * in "*addr" if successful. Otherwise, returns KERN_NO_SPACE. + * + * The map must be locked. Initially, there must be at least "length" bytes + * of free space at the given address. + */ +static int +vm_map_alignspace(vm_map_t map, vm_object_t object, vm_ooffset_t offset, + vm_offset_t *addr, vm_size_t length, vm_offset_t max_addr, + vm_offset_t alignment) +{ + vm_offset_t aligned_addr, free_addr; + + VM_MAP_ASSERT_LOCKED(map); + free_addr = *addr; + KASSERT(!vm_map_findspace(map, free_addr, length, addr) && + free_addr == *addr, ("caller provided insufficient free space")); + for (;;) { + /* + * At the start of every iteration, the free space at address + * "*addr" is at least "length" bytes. + */ + if (alignment == 0) + pmap_align_superpage(object, offset, addr, length); + else if ((*addr & (alignment - 1)) != 0) { + *addr &= ~(alignment - 1); + *addr += alignment; + } + aligned_addr = *addr; + if (aligned_addr == free_addr) { + /* + * Alignment did not change "*addr", so "*addr" must + * still provide sufficient free space. + */ + return (KERN_SUCCESS); + } + + /* + * Test for address wrap on "*addr". A wrapped "*addr" could + * be a valid address, in which case vm_map_findspace() cannot + * be relied upon to fail. + */ + if (aligned_addr < free_addr || + vm_map_findspace(map, aligned_addr, length, addr) || + (max_addr != 0 && *addr + length > max_addr)) + return (KERN_NO_SPACE); + free_addr = *addr; + if (free_addr == aligned_addr) { + /* + * If a successful call to vm_map_findspace() did not + * change "*addr", then "*addr" must still be aligned + * and provide sufficient free space. + */ + return (KERN_SUCCESS); + } + } +} + +/* * vm_map_find finds an unallocated region in the target address * map with the given length. The search is defined to be * first-fit from the specified address; the region found is @@ -1498,8 +1565,8 @@ vm_map_find(vm_map_t map, vm_object_t object, vm_ooffs vm_size_t length, vm_offset_t max_addr, int find_space, vm_prot_t prot, vm_prot_t max, int cow) { - vm_offset_t alignment, initial_addr, start; - int result; + vm_offset_t alignment, min_addr; + int rv; KASSERT((cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) == 0 || object == NULL, @@ -1512,50 +1579,39 @@ vm_map_find(vm_map_t map, vm_object_t object, vm_ooffs alignment = (vm_offset_t)1 << (find_space >> 8); } else alignment = 0; - initial_addr = *addr; vm_map_lock(map); + if (find_space != VMFS_NO_SPACE) { + KASSERT(find_space == VMFS_ANY_SPACE || + find_space == VMFS_OPTIMAL_SPACE || + find_space == VMFS_SUPER_SPACE || + alignment != 0, ("unexpected VMFS flag")); + min_addr = *addr; again: - start = initial_addr; - do { - if (find_space != VMFS_NO_SPACE) { - if (vm_map_findspace(map, start, length, addr) || - (max_addr != 0 && *addr + length > max_addr)) { - if (find_space == VMFS_OPTIMAL_SPACE) { - find_space = VMFS_ANY_SPACE; - goto again; - } - vm_map_unlock(map); - return (KERN_NO_SPACE); + if (vm_map_findspace(map, min_addr, length, addr) || + (max_addr != 0 && *addr + length > max_addr)) { + rv = KERN_NO_SPACE; + goto done; + } + if (find_space != VMFS_ANY_SPACE && + (rv = vm_map_alignspace(map, object, offset, addr, length, + max_addr, alignment)) != KERN_SUCCESS) { + if (find_space == VMFS_OPTIMAL_SPACE) { + find_space = VMFS_ANY_SPACE; + goto again; } - switch (find_space) { - case VMFS_SUPER_SPACE: - case VMFS_OPTIMAL_SPACE: - pmap_align_superpage(object, offset, addr, - length); - break; - case VMFS_ANY_SPACE: - break; - default: - if ((*addr & (alignment - 1)) != 0) { - *addr &= ~(alignment - 1); - *addr += alignment; - } - break; - } - - start = *addr; + goto done; } - if ((cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) != 0) { - result = vm_map_stack_locked(map, start, length, - sgrowsiz, prot, max, cow); - } else { - result = vm_map_insert(map, object, offset, start, - start + length, prot, max, cow); - } - } while (result == KERN_NO_SPACE && find_space != VMFS_NO_SPACE && - find_space != VMFS_ANY_SPACE); + } + if ((cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) != 0) { + rv = vm_map_stack_locked(map, *addr, length, sgrowsiz, prot, + max, cow); + } else { + rv = vm_map_insert(map, object, offset, *addr, *addr + length, + prot, max, cow); + } +done: vm_map_unlock(map); - return (result); + return (rv); } /* From owner-svn-src-all@freebsd.org Tue Dec 26 18:10:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82EE4EA64AD; Tue, 26 Dec 2017 18:10:35 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CA8480DAD; Tue, 26 Dec 2017 18:10:35 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBQIAYH0017571; Tue, 26 Dec 2017 18:10:34 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBQIAYTU017570; Tue, 26 Dec 2017 18:10:34 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201712261810.vBQIAYTU017570@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 26 Dec 2017 18:10:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327219 - head/contrib/elftoolchain/readelf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/elftoolchain/readelf X-SVN-Commit-Revision: 327219 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 18:10:35 -0000 Author: emaste Date: Tue Dec 26 18:10:34 2017 New Revision: 327219 URL: https://svnweb.freebsd.org/changeset/base/327219 Log: readelf: report byte size for DT_PREINIT_ARRAYSZ Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/readelf/readelf.c Modified: head/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- head/contrib/elftoolchain/readelf/readelf.c Tue Dec 26 17:59:37 2017 (r327218) +++ head/contrib/elftoolchain/readelf/readelf.c Tue Dec 26 18:10:34 2017 (r327219) @@ -2753,6 +2753,7 @@ dump_dyn_val(struct readelf *re, GElf_Dyn *dyn, uint32 case DT_SYMENT: case DT_RELSZ: case DT_RELENT: + case DT_PREINIT_ARRAYSZ: case DT_INIT_ARRAYSZ: case DT_FINI_ARRAYSZ: case DT_GNU_CONFLICTSZ: From owner-svn-src-all@freebsd.org Tue Dec 26 18:34:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38707EA789B; Tue, 26 Dec 2017 18:34:09 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 02410202B; Tue, 26 Dec 2017 18:34:08 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBQIY8iL028284; Tue, 26 Dec 2017 18:34:08 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBQIY888028283; Tue, 26 Dec 2017 18:34:08 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201712261834.vBQIY888028283@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 26 Dec 2017 18:34:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327220 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 327220 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 18:34:09 -0000 Author: ian Date: Tue Dec 26 18:34:07 2017 New Revision: 327220 URL: https://svnweb.freebsd.org/changeset/base/327220 Log: Update the FDT example for the lm75 sensor to match current devicetree standards and what the existing driver expects. Also change 'like' to 'such as' where the text is providing an example rather than a simile. Modified: head/share/man/man4/lm75.4 Modified: head/share/man/man4/lm75.4 ============================================================================== --- head/share/man/man4/lm75.4 Tue Dec 26 18:10:34 2017 (r327219) +++ head/share/man/man4/lm75.4 Tue Dec 26 18:34:07 2017 (r327220) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 11, 2014 +.Dd December 26, 2017 .Dt LM75 4 .Os .Sh NAME @@ -122,7 +122,7 @@ clones may not work reliably. .Pp On a .Xr device.hints 5 -based system, like +based system, such as .Li MIPS , these values are configurable for .Nm : @@ -140,19 +140,18 @@ i2c address on the .Pp On a .Xr FDT 4 -based system, like +based system, such as .Li ARM , the DTS part for a .Nm device usually looks like: .Bd -literal i2c { - + /* Properties describing the controller appear here. */ ... - - lm750 { + lm750@49 { compatible = "national,lm75"; - i2c-address = <0x49>; + reg = <0x49>; }; }; .Ed From owner-svn-src-all@freebsd.org Tue Dec 26 18:42:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB1A6EA7FF6; Tue, 26 Dec 2017 18:42:30 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 85F1F2AAA; Tue, 26 Dec 2017 18:42:30 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBQIgTuD033063; Tue, 26 Dec 2017 18:42:29 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBQIgTox033062; Tue, 26 Dec 2017 18:42:29 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201712261842.vBQIgTox033062@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 26 Dec 2017 18:42:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327221 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 327221 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 18:42:30 -0000 Author: ian Date: Tue Dec 26 18:42:29 2017 New Revision: 327221 URL: https://svnweb.freebsd.org/changeset/base/327221 Log: Complete the changing of the old "i2c-address" property to the modern "reg" property by updating the description text to match the updated example. This should have been part of r327220 Modified: head/share/man/man4/lm75.4 Modified: head/share/man/man4/lm75.4 ============================================================================== --- head/share/man/man4/lm75.4 Tue Dec 26 18:34:07 2017 (r327220) +++ head/share/man/man4/lm75.4 Tue Dec 26 18:42:29 2017 (r327221) @@ -157,13 +157,11 @@ i2c { .Ed .Pp Where: -.Bl -tag -width ".Va i2c-address" +.Bl -tag -width ".Va compatible" .It Va compatible Should always be set to "national,lm75". -.It Va i2c-address -The -.Va i2c-address -property indicates which i2c address the +.It Va reg +Indicates which 7-bit i2c address the .Nm is wired at. .Nm From owner-svn-src-all@freebsd.org Tue Dec 26 19:02:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73C02EA9249; Tue, 26 Dec 2017 19:02:58 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49AF9391E; Tue, 26 Dec 2017 19:02:58 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBQJ2v56042265; Tue, 26 Dec 2017 19:02:57 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBQJ2vrb042262; Tue, 26 Dec 2017 19:02:57 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201712261902.vBQJ2vrb042262@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 26 Dec 2017 19:02:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327222 - in head/sys: arm/arm conf X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys: arm/arm conf X-SVN-Commit-Revision: 327222 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 19:02:58 -0000 Author: ian Date: Tue Dec 26 19:02:56 2017 New Revision: 327222 URL: https://svnweb.freebsd.org/changeset/base/327222 Log: Add a new ARM kernel option, LOCORE_MAP_MB, to control the size of the kernel VA mapping in the temporary page tables set up by locore-v6.S. The number used to be hard-coded to 64MB, which is still the default if the kernel option is not specified. However, 64MB is insufficient for using a large mdroot filesystem. The hard-coded number can't be safely increased because too large a number may run into memory-mapped IO space on some SoCs that must not be mapped as ordinary memory. Modified: head/sys/arm/arm/genassym.c head/sys/arm/arm/locore-v6.S head/sys/conf/options.arm Modified: head/sys/arm/arm/genassym.c ============================================================================== --- head/sys/arm/arm/genassym.c Tue Dec 26 18:42:29 2017 (r327221) +++ head/sys/arm/arm/genassym.c Tue Dec 26 19:02:56 2017 (r327222) @@ -161,3 +161,12 @@ ASSYM(DCACHE_LINE_SIZE, offsetof(struct cpuinfo, dcach ASSYM(DCACHE_LINE_MASK, offsetof(struct cpuinfo, dcache_line_mask)); ASSYM(ICACHE_LINE_SIZE, offsetof(struct cpuinfo, icache_line_size)); ASSYM(ICACHE_LINE_MASK, offsetof(struct cpuinfo, icache_line_mask)); + +/* + * Emit the LOCORE_MAP_MB option as a #define only if the option was set. + */ +#include "opt_locore.h" + +#ifdef LOCORE_MAP_MB +ASSYM(LOCORE_MAP_MB, LOCORE_MAP_MB); +#endif Modified: head/sys/arm/arm/locore-v6.S ============================================================================== --- head/sys/arm/arm/locore-v6.S Tue Dec 26 18:42:29 2017 (r327221) +++ head/sys/arm/arm/locore-v6.S Tue Dec 26 19:02:56 2017 (r327222) @@ -38,6 +38,11 @@ __FBSDID("$FreeBSD$"); +/* We map 64MB of kernel unless overridden in assym.s by the kernel option. */ +#ifndef LOCORE_MAP_MB +#define LOCORE_MAP_MB 64 +#endif + #if __ARM_ARCH >= 7 #if defined(__ARM_ARCH_7VE__) || defined(__clang__) /* @@ -176,12 +181,13 @@ ASENTRY_NP(_start) bl build_pagetables /* - * Next we do 64MiB starting at the physical load address, mapped to - * the VA the kernel is linked for. + * Next we map the kernel starting at the physical load address, mapped + * to the VA the kernel is linked for. The default size we map is 64MiB + * but it can be overridden with a kernel option. */ mov r1, r5 ldr r2, =(KERNVIRTADDR) - mov r3, #64 + ldr r3, =(LOCORE_MAP_MB) bl build_pagetables /* Create a device mapping for early_printf if specified. */ Modified: head/sys/conf/options.arm ============================================================================== --- head/sys/conf/options.arm Tue Dec 26 18:42:29 2017 (r327221) +++ head/sys/conf/options.arm Tue Dec 26 19:02:56 2017 (r327222) @@ -35,6 +35,7 @@ KERNBASE opt_global.h KERNVIRTADDR opt_global.h LINUX_BOOT_ABI opt_global.h LOADERRAMADDR opt_global.h +LOCORE_MAP_MB opt_locore.h NKPT2PG opt_pmap.h PHYSADDR opt_global.h PLATFORM opt_global.h From owner-svn-src-all@freebsd.org Tue Dec 26 19:50:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC018EAB67B; Tue, 26 Dec 2017 19:50:24 +0000 (UTC) (envelope-from mizhka@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A688464743; Tue, 26 Dec 2017 19:50:24 +0000 (UTC) (envelope-from mizhka@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBQJoNAf060045; Tue, 26 Dec 2017 19:50:23 GMT (envelope-from mizhka@FreeBSD.org) Received: (from mizhka@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBQJoNQb060044; Tue, 26 Dec 2017 19:50:23 GMT (envelope-from mizhka@FreeBSD.org) Message-Id: <201712261950.vBQJoNQb060044@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mizhka set sender to mizhka@FreeBSD.org using -f From: Michael Zhilin Date: Tue, 26 Dec 2017 19:50:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327223 - head/sys/mips/conf X-SVN-Group: head X-SVN-Commit-Author: mizhka X-SVN-Commit-Paths: head/sys/mips/conf X-SVN-Commit-Revision: 327223 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 19:50:25 -0000 Author: mizhka Date: Tue Dec 26 19:50:23 2017 New Revision: 327223 URL: https://svnweb.freebsd.org/changeset/base/327223 Log: [mips] fix compilation of TP-WN1043ND kernel configuration This compilation issue has been found thanks to freebsd-wifi-build: - gpioiic requires "gpio_if.h", so "device gpio" is mandatory - rtl8366rb works over MDIO interface, so "device mdio" is mandatory Compilation is checked on FreeBSD 12-CURRENT machine. Modified: head/sys/mips/conf/TP-WN1043ND Modified: head/sys/mips/conf/TP-WN1043ND ============================================================================== --- head/sys/mips/conf/TP-WN1043ND Tue Dec 26 19:02:56 2017 (r327222) +++ head/sys/mips/conf/TP-WN1043ND Tue Dec 26 19:50:23 2017 (r327223) @@ -18,6 +18,7 @@ hints "TP-WN1043ND.hints" options AR71XX_REALMEM=32*1024*1024 # i2c GPIO bus +device gpio device gpioiic device iicbb device iicbus @@ -27,6 +28,7 @@ device iic device etherswitch # RTL8366RB support +device mdio device rtl8366rb # read MSDOS formatted disks - USB From owner-svn-src-all@freebsd.org Tue Dec 26 20:33:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8B47E80D46; Tue, 26 Dec 2017 20:33:46 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9C1F56639D; Tue, 26 Dec 2017 20:33:46 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBQKXjRr080366; Tue, 26 Dec 2017 20:33:45 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBQKXjSg080365; Tue, 26 Dec 2017 20:33:45 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201712262033.vBQKXjSg080365@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Tue, 26 Dec 2017 20:33:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r327224 - stable/11/share/man/man9 X-SVN-Group: stable-11 X-SVN-Commit-Author: alc X-SVN-Commit-Paths: stable/11/share/man/man9 X-SVN-Commit-Revision: 327224 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 20:33:47 -0000 Author: alc Date: Tue Dec 26 20:33:45 2017 New Revision: 327224 URL: https://svnweb.freebsd.org/changeset/base/327224 Log: MFC r326982 Document the semantics of atomic_thread_fence operations. Add atomic_load_ and atomic_store_, and explain why they exist. Define the synchronizes-with relationship and its effects. Reorder and revise some of the existing text. For example, more precisely describe when ordinary accesses are atomic. Modified: stable/11/share/man/man9/atomic.9 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man9/atomic.9 ============================================================================== --- stable/11/share/man/man9/atomic.9 Tue Dec 26 19:50:23 2017 (r327223) +++ stable/11/share/man/man9/atomic.9 Tue Dec 26 20:33:45 2017 (r327224) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 23, 2017 +.Dd December 19, 2017 .Dt ATOMIC 9 .Os .Sh NAME @@ -36,7 +36,8 @@ .Nm atomic_readandclear , .Nm atomic_set , .Nm atomic_subtract , -.Nm atomic_store +.Nm atomic_store , +.Nm atomic_thread_fence .Nd atomic operations .Sh SYNOPSIS .In sys/types.h @@ -60,7 +61,7 @@ .Ft .Fn atomic_fetchadd_ "volatile *p" " v" .Ft -.Fn atomic_load_acq_ "volatile *p" +.Fn atomic_load_[acq_] "volatile *p" .Ft .Fn atomic_readandclear_ "volatile *p" .Ft void @@ -68,19 +69,33 @@ .Ft void .Fn atomic_subtract_[acq_|rel_] "volatile *p" " v" .Ft void -.Fn atomic_store_rel_ "volatile *p" " v" +.Fn atomic_store_[rel_] "volatile *p" " v" .Ft .Fn atomic_swap_ "volatile *p" " v" .Ft int .Fn atomic_testandclear_ "volatile *p" "u_int v" .Ft int .Fn atomic_testandset_ "volatile *p" "u_int v" +.Ft void +.Fn atomic_thread_fence_[acq|acq_rel|rel|seq_cst] "void" .Sh DESCRIPTION -All of these operations are performed atomically across multiple -threads and in the presence of interrupts, meaning that they are -performed in an indivisible manner from the perspective of concurrently +Atomic operations are commonly used to implement reference counts and as +building blocks for synchronization primitives, such as mutexes. +.Pp +All of these operations are performed +.Em atomically +across multiple threads and in the presence of interrupts, meaning that they +are performed in an indivisible manner from the perspective of concurrently running threads and interrupt handlers. .Pp +On all architectures supported by +.Fx , +ordinary loads and stores of integers in cache-coherent memory are +inherently atomic if the integer is naturally aligned and its size does not +exceed the processor's word size. +However, such loads and stores may be elided from the program by +the compiler, whereas atomic operations are always performed. +.Pp When atomic operations are performed on cache-coherent memory, all operations on the same location are totally ordered. .Pp @@ -93,29 +108,16 @@ interrupt handler will observe a .Em torn write , or partial modification of the location. .Pp -On all architectures supported by -.Fx , -ordinary loads and stores of naturally aligned integer types -are atomic, as executed by the processor. -.Pp -Atomic operations can be used to implement reference counts or as -building blocks for synchronization primitives such as mutexes. -.Pp -The semantics of -.Fx Ns 's -atomic operations are almost identical to those of the similarly named -C11 operations. -The one important difference is that the C11 standard does not -require ordinary loads and stores to ever be atomic. -This is is why the -.Fn atomic_load_explicit memory_order_relaxed -operation exists in the C11 standard, but is not provided by -.In machine/atomic.h . +Except as noted below, the semantics of these operations are almost +identical to the semantics of similarly named C11 atomic operations. .Ss Types -Each atomic operation operates on a specific +Most atomic operations act upon a specific .Fa type . -The type to use is indicated in the function name. -The available types that can be used are: +That type is indicated in the function name. +In contrast to C11 atomic operations, +.Fx Ns 's +atomic operations are performed on ordinary integer types. +The available types are: .Pp .Bl -tag -offset indent -width short -compact .It Li int @@ -147,8 +149,7 @@ unsigned 8-bit integer unsigned 16-bit integer .El .Pp -These must not be used in MI code because the instructions to implement them -efficiently might not be available. +These types must not be used in machine-independent code. .Ss Acquire and Release Operations By default, a thread's accesses to different memory locations might not be performed in @@ -167,52 +168,64 @@ Moreover, in some cases, such as the implementation of threads, arbitrary reordering might result in the incorrect execution of the program. To constrain the reordering that both the compiler and processor might perform -on a thread's accesses, the thread should use atomic operations with +on a thread's accesses, a programmer can use atomic operations with .Em acquire and .Em release semantics. .Pp -Most of the atomic operations on memory have three variants. +Atomic operations on memory have up to three variants. The first variant performs the operation without imposing any ordering constraints on memory accesses to other locations. The second variant has acquire semantics, and the third variant has release semantics. -In effect, operations with acquire and release semantics establish one-way -barriers to reordering. .Pp -When an atomic operation has acquire semantics, the effects of the operation -must have completed before any subsequent load or store (by program order) is +When an atomic operation has acquire semantics, the operation must have +completed before any subsequent load or store (by program order) is performed. Conversely, acquire semantics do not require that prior loads or stores have completed before the atomic operation is performed. +An atomic operation can only have acquire semantics if it performs a load +from memory. To denote acquire semantics, the suffix .Dq Li _acq is inserted into the function name immediately prior to the .Dq Li _ Ns Aq Fa type suffix. -For example, to subtract two integers ensuring that subsequent loads and -stores happen after the subtraction is performed, use +For example, to subtract two integers ensuring that the subtraction is +completed before any subsequent loads and stores are performed, use .Fn atomic_subtract_acq_int . .Pp -When an atomic operation has release semantics, the effects of all prior -loads or stores (by program order) must have completed before the operation -is performed. -Conversely, release semantics do not require that the effects of the -atomic operation must have completed before any subsequent load or store is -performed. +When an atomic operation has release semantics, all prior loads or stores +(by program order) must have completed before the operation is performed. +Conversely, release semantics do not require that the atomic operation must +have completed before any subsequent load or store is performed. +An atomic operation can only have release semantics if it performs a store +to memory. To denote release semantics, the suffix .Dq Li _rel is inserted into the function name immediately prior to the .Dq Li _ Ns Aq Fa type suffix. For example, to add two long integers ensuring that all prior loads and -stores happen before the addition, use +stores are completed before the addition is performed, use .Fn atomic_add_rel_long . .Pp -The one-way barriers provided by acquire and release operations allow the -implementations of common synchronization primitives to express their -ordering requirements without also imposing unnecessary ordering. +When a release operation by one thread +.Em synchronizes with +an acquire operation by another thread, usually meaning that the acquire +operation reads the value written by the release operation, then the effects +of all prior stores by the releasing thread must become visible to +subsequent loads by the acquiring thread. +Moreover, the effects of all stores (by other threads) that were visible to +the releasing thread must also become visible to the acquiring thread. +These rules only apply to the synchronizing threads. +Other threads might observe these stores in a different order. +.Pp +In effect, atomic operations with acquire and release semantics establish +one-way barriers to reordering that enable the implementations of +synchronization primitives to express their ordering requirements without +also imposing unnecessary ordering. For example, for a critical section guarded by a mutex, an acquire operation when the mutex is locked and a release operation when the mutex is unlocked will prevent any loads or stores from moving outside of the critical @@ -220,6 +233,61 @@ section. However, they will not prevent the compiler or processor from moving loads or stores into the critical section, which does not violate the semantics of a mutex. +.Ss Thread Fence Operations +Alternatively, a programmer can use atomic thread fence operations to +constrain the reordering of accesses. +In contrast to other atomic operations, fences do not, themselves, access +memory. +.Pp +When a fence has acquire semantics, all prior loads (by program order) must +have completed before any subsequent load or store is performed. +Thus, an acquire fence is a two-way barrier for load operations. +To denote acquire semantics, the suffix +.Dq Li _acq +is appended to the function name, for example, +.Fn atomic_thread_fence_acq . +.Pp +When a fence has release semantics, all prior loads or stores (by program +order) must have completed before any subsequent store operation is +performed. +Thus, a release fence is a two-way barrier for store operations. +To denote release semantics, the suffix +.Dq Li _rel +is appended to the function name, for example, +.Fn atomic_thread_fence_rel . +.Pp +Although +.Fn atomic_thread_fence_acq_rel +implements both acquire and release semantics, it is not a full barrier. +For example, a store prior to the fence (in program order) may be completed +after a load subsequent to the fence. +In contrast, +.Fn atomic_thread_fence_seq_cst +implements a full barrier. +Neither loads nor stores may cross this barrier in either direction. +.Pp +In C11, a release fence by one thread synchronizes with an acquire fence by +another thread when an atomic load that is prior to the acquire fence (by +program order) reads the value written by an atomic store that is subsequent +to the release fence. +In constrast, in FreeBSD, because of the atomicity of ordinary, naturally +aligned loads and stores, fences can also be synchronized by ordinary loads +and stores. +This simplifies the implementation and use of some synchronization +primitives in +.Fx . +.Pp +Since neither a compiler nor a processor can foresee which (atomic) load +will read the value written by an (atomic) store, the ordering constraints +imposed by fences must be more restrictive than acquire loads and release +stores. +Essentially, this is why fences are two-way barriers. +.Pp +Although fences impose more restrictive ordering than acquire loads and +release stores, by separating access from ordering, they can sometimes +facilitate more efficient implementations of synchronization primitives. +For example, they can be used to avoid executing a memory barrier until a +memory access shows that some condition is satisfied. .Ss Multiple Processors In multiprocessor systems, the atomicity of the atomic operations on memory depends on support for cache coherence in the underlying architecture. @@ -326,12 +394,6 @@ and do not have any variants with memory barriers at t .Bd -literal -compact return (*p); .Ed -.El -.Pp -The -.Fn atomic_load -functions are only provided with acquire memory barriers. -.Bl -hang .It Fn atomic_readandclear p .Bd -literal -compact tmp = *p; @@ -363,12 +425,6 @@ and do not have any variants with memory barriers at t .Bd -literal -compact *p = v; .Ed -.El -.Pp -The -.Fn atomic_store -functions are only provided with release memory barriers. -.Bl -hang .It Fn atomic_swap p v .Bd -literal -compact tmp = *p; From owner-svn-src-all@freebsd.org Tue Dec 26 20:56:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC8C2E81F66; Tue, 26 Dec 2017 20:56:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A642F66F5A; Tue, 26 Dec 2017 20:56:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBQKut9s088922; Tue, 26 Dec 2017 20:56:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBQKutfe088921; Tue, 26 Dec 2017 20:56:55 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201712262056.vBQKutfe088921@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 26 Dec 2017 20:56:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r327225 - stable/11/share/man/man9 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/share/man/man9 X-SVN-Commit-Revision: 327225 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 20:56:57 -0000 Author: kib Date: Tue Dec 26 20:56:55 2017 New Revision: 327225 URL: https://svnweb.freebsd.org/changeset/base/327225 Log: MFC r327088: Update HISTORY section for the atomic(9) page. Modified: stable/11/share/man/man9/atomic.9 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man9/atomic.9 ============================================================================== --- stable/11/share/man/man9/atomic.9 Tue Dec 26 20:33:45 2017 (r327224) +++ stable/11/share/man/man9/atomic.9 Tue Dec 26 20:56:55 2017 (r327225) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 19, 2017 +.Dd December 22, 2017 .Dt ATOMIC 9 .Os .Sh NAME @@ -175,8 +175,11 @@ and semantics. .Pp Atomic operations on memory have up to three variants. -The first variant performs the operation without imposing any ordering -constraints on memory accesses to other locations. +The first, or +.Em relaxed +variant, performs the operation without imposing any ordering constraints on +accesses to other memory locations. +This variant is the default. The second variant has acquire semantics, and the third variant has release semantics. .Pp @@ -546,43 +549,54 @@ The .Fn atomic_set , and .Fn atomic_subtract -operations were first introduced in +operations were introduced in .Fx 3.0 . -This first set only supported the types +Initially, these operations were defined on the types .Dq Li char , .Dq Li short , .Dq Li int , and .Dq Li long . +.Pp The .Fn atomic_cmpset , -.Fn atomic_load , +.Fn atomic_load_acq , .Fn atomic_readandclear , and -.Fn atomic_store +.Fn atomic_store_rel operations were added in .Fx 5.0 . -The types +Simultaneously, the acquire and release variants were introduced, and +support was added for operation on the types .Dq Li 8 , .Dq Li 16 , .Dq Li 32 , .Dq Li 64 , and -.Dq Li ptr -and all of the acquire and release variants -were added in -.Fx 5.0 -as well. +.Dq Li ptr . +.Pp The .Fn atomic_fetchadd -operations were added in +operation was added in .Fx 6.0 . +.Pp The .Fn atomic_swap and .Fn atomic_testandset operations were added in .Fx 10.0 . +.Pp +The .Fn atomic_testandclear -operation was added in +and +.Fn atomic_thread_fence +operations were added in .Fx 11.0 . +.Pp +The relaxed variants of +.Fn atomic_load +and +.Fn atomic_store +were added in +.Fx 12.0 . From owner-svn-src-all@freebsd.org Tue Dec 26 22:05:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9097E85E35; Tue, 26 Dec 2017 22:05:56 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C0B9969657; Tue, 26 Dec 2017 22:05:56 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBQM5tEa021742; Tue, 26 Dec 2017 22:05:55 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBQM5tsp021741; Tue, 26 Dec 2017 22:05:55 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201712262205.vBQM5tsp021741@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 26 Dec 2017 22:05:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327226 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 327226 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 22:05:57 -0000 Author: ian Date: Tue Dec 26 22:05:55 2017 New Revision: 327226 URL: https://svnweb.freebsd.org/changeset/base/327226 Log: Add a section describing how to tune ARM kernel options to use an MD_ROOT filesystem larger than about 50-55 MiB. The description of VM_KMEM_SIZE_SCALE is roughly as hand-wavy as my understanding of the option, but at least mentioning that it's a factor and giving an empirical datapoint that works will give folks some idea of what to tweak if they have problems. Modified: head/share/man/man4/md.4 Modified: head/share/man/man4/md.4 ============================================================================== --- head/share/man/man4/md.4 Tue Dec 26 20:56:55 2017 (r327225) +++ head/share/man/man4/md.4 Tue Dec 26 22:05:55 2017 (r327226) @@ -7,7 +7,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 7, 2017 +.Dd December 26, 2017 .Dt MD 4 .Os .Sh NAME @@ -93,6 +93,47 @@ disk found in the .Xr mdconfig 8 man page. Other tools will also create these images, such as NanoBSD. +.Sh ARM KERNEL OPTIONS +On armv6 and armv7 architectures, an MD_ROOT image larger than +approximately 55 MiB may require building a custom kernel using +several tuning options related to kernel memory usage. +.Bl -tag -width indent +.It Cd options LOCORE_MAP_MB= +This configures how much memory is mapped for the kernel during +the early initialization stages. +The value must be at least as large as the kernel plus all preloaded +modules, including the root image. +There is no downside to setting this value too large, as long +as it does not exceed the amount of physical memory. +The default is 64 MiB. +.It Cd options NKPT2PG= +This configures the number of kernel L2 page table pages to +preallocate during kernel initialization. +Each L2 page can map 4 MiB of kernel space. +The value must be large enough to map the kernel plus all preloaded +modules, including the root image. +The default value is 32, which is sufficient to map 128 MiB. +.It Cd options VM_KMEM_SIZE_SCALE= +This configures the amount of kernel virtual address (KVA) space to +dedicate to the kmem_arena map. +The value is the ratio of physical to virtual pages. +The default value of 3 allocates a page of KVA for each 3 pages +of physical ram in the system. + +The kernel and modules, including the root image, also consume KVA. +The combination of a large root image and the default scaling +may preallocate so much KVA to kmem_arena that there is not enough +remaining address space to allocate kernel stacks, IO buffers, +and other resources that are not part of kmem_arena. +Overallocating kmem_arena space is likely to manifest as failure to +launch userland processes with "cannot allocate kernel stack" messages. + +Setting the value too high may result in kernel failure to allocate +memory because kmem_arena is too small, and the failure may require +significant runtime to manifest. +Empirically, a value of 5 works well for a 200 MiB root image on +a system with 2 GiB of physical ram. +.El .Sh SEE ALSO .Xr gpart 8 , .Xr loader 8 , From owner-svn-src-all@freebsd.org Tue Dec 26 23:16:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4EB62E899B8; Tue, 26 Dec 2017 23:16:12 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B3886BDFE; Tue, 26 Dec 2017 23:16:12 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBQNGBgG051861; Tue, 26 Dec 2017 23:16:11 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBQNGBKA051860; Tue, 26 Dec 2017 23:16:11 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201712262316.vBQNGBKA051860@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Tue, 26 Dec 2017 23:16:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327227 - head/lib/libufs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/lib/libufs X-SVN-Commit-Revision: 327227 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 23:16:12 -0000 Author: mckusick Date: Tue Dec 26 23:16:11 2017 New Revision: 327227 URL: https://svnweb.freebsd.org/changeset/base/327227 Log: Missing disk close in libufs. Modified: head/lib/libufs/type.c Modified: head/lib/libufs/type.c ============================================================================== --- head/lib/libufs/type.c Tue Dec 26 22:05:55 2017 (r327226) +++ head/lib/libufs/type.c Tue Dec 26 23:16:11 2017 (r327227) @@ -83,6 +83,7 @@ ufs_disk_fillout(struct uufsd *disk, const char *name) } if (sbread(disk) == -1) { ERROR(disk, "could not read superblock to fill out disk"); + ufs_disk_close(disk); return (-1); } return (0); From owner-svn-src-all@freebsd.org Wed Dec 27 00:34:15 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91357E8DFBE; Wed, 27 Dec 2017 00:34:15 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FD646F106; Wed, 27 Dec 2017 00:34:15 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBR0YEeL087033; Wed, 27 Dec 2017 00:34:14 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBR0YDoW087027; Wed, 27 Dec 2017 00:34:13 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201712270034.vBR0YDoW087027@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 27 Dec 2017 00:34:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r327228 - in stable/11/sys/cam: ata nvme scsi X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/11/sys/cam: ata nvme scsi X-SVN-Commit-Revision: 327228 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Dec 2017 00:34:15 -0000 Author: mav Date: Wed Dec 27 00:34:13 2017 New Revision: 327228 URL: https://svnweb.freebsd.org/changeset/base/327228 Log: MFC r326835: Reduce size of several on-stack string buffers. Submitted by: Dmitry Luhtionov Modified: stable/11/sys/cam/ata/ata_da.c stable/11/sys/cam/ata/ata_pmp.c stable/11/sys/cam/nvme/nvme_da.c stable/11/sys/cam/scsi/scsi_cd.c stable/11/sys/cam/scsi/scsi_da.c stable/11/sys/cam/scsi/scsi_sa.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ata/ata_da.c ============================================================================== --- stable/11/sys/cam/ata/ata_da.c Tue Dec 26 23:16:11 2017 (r327227) +++ stable/11/sys/cam/ata/ata_da.c Wed Dec 27 00:34:13 2017 (r327228) @@ -1386,7 +1386,7 @@ adasysctlinit(void *context, int pending) { struct cam_periph *periph; struct ada_softc *softc; - char tmpstr[80], tmpstr2[80]; + char tmpstr[32], tmpstr2[16]; periph = (struct cam_periph *)context; Modified: stable/11/sys/cam/ata/ata_pmp.c ============================================================================== --- stable/11/sys/cam/ata/ata_pmp.c Tue Dec 26 23:16:11 2017 (r327227) +++ stable/11/sys/cam/ata/ata_pmp.c Wed Dec 27 00:34:13 2017 (r327228) @@ -338,7 +338,7 @@ pmpsysctlinit(void *context, int pending) { struct cam_periph *periph; struct pmp_softc *softc; - char tmpstr[80], tmpstr2[80]; + char tmpstr[32], tmpstr2[16]; periph = (struct cam_periph *)context; if (cam_periph_acquire(periph) != CAM_REQ_CMP) Modified: stable/11/sys/cam/nvme/nvme_da.c ============================================================================== --- stable/11/sys/cam/nvme/nvme_da.c Tue Dec 26 23:16:11 2017 (r327227) +++ stable/11/sys/cam/nvme/nvme_da.c Wed Dec 27 00:34:13 2017 (r327228) @@ -592,7 +592,7 @@ ndasysctlinit(void *context, int pending) { struct cam_periph *periph; struct nda_softc *softc; - char tmpstr[80], tmpstr2[80]; + char tmpstr[32], tmpstr2[16]; periph = (struct cam_periph *)context; Modified: stable/11/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_cd.c Tue Dec 26 23:16:11 2017 (r327227) +++ stable/11/sys/cam/scsi/scsi_cd.c Wed Dec 27 00:34:13 2017 (r327228) @@ -469,7 +469,7 @@ cdsysctlinit(void *context, int pending) { struct cam_periph *periph; struct cd_softc *softc; - char tmpstr[80], tmpstr2[80]; + char tmpstr[32], tmpstr2[16]; periph = (struct cam_periph *)context; if (cam_periph_acquire(periph) != CAM_REQ_CMP) Modified: stable/11/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_da.c Tue Dec 26 23:16:11 2017 (r327227) +++ stable/11/sys/cam/scsi/scsi_da.c Wed Dec 27 00:34:13 2017 (r327228) @@ -1919,7 +1919,7 @@ dasysctlinit(void *context, int pending) { struct cam_periph *periph; struct da_softc *softc; - char tmpstr[80], tmpstr2[80]; + char tmpstr[32], tmpstr2[16]; struct ccb_trans_settings cts; periph = (struct cam_periph *)context; Modified: stable/11/sys/cam/scsi/scsi_sa.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_sa.c Tue Dec 26 23:16:11 2017 (r327227) +++ stable/11/sys/cam/scsi/scsi_sa.c Wed Dec 27 00:34:13 2017 (r327228) @@ -2294,7 +2294,7 @@ sasysctlinit(void *context, int pending) { struct cam_periph *periph; struct sa_softc *softc; - char tmpstr[80], tmpstr2[80]; + char tmpstr[32], tmpstr2[16]; periph = (struct cam_periph *)context; /* From owner-svn-src-all@freebsd.org Wed Dec 27 03:18:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5E8AE9DD0D; Wed, 27 Dec 2017 03:18:14 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7718974348; Wed, 27 Dec 2017 03:18:14 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBR3IDIA053965; Wed, 27 Dec 2017 03:18:13 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBR3IDKd053964; Wed, 27 Dec 2017 03:18:13 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201712270318.vBR3IDKd053964@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 27 Dec 2017 03:18:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r327229 - stable/11/contrib/tcpdump X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/contrib/tcpdump X-SVN-Commit-Revision: 327229 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Dec 2017 03:18:14 -0000 Author: emaste Date: Wed Dec 27 03:18:13 2017 New Revision: 327229 URL: https://svnweb.freebsd.org/changeset/base/327229 Log: MFC r317409 by glebius: Cherry-pick 5d3c5151c2b885aab36627bafb8539238da27b2d, it fixes use after free if tcpdump(1) is run on non-existent interface. Modified: stable/11/contrib/tcpdump/tcpdump.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/tcpdump/tcpdump.c ============================================================================== --- stable/11/contrib/tcpdump/tcpdump.c Wed Dec 27 00:34:13 2017 (r327228) +++ stable/11/contrib/tcpdump/tcpdump.c Wed Dec 27 03:18:13 2017 (r327229) @@ -1085,9 +1085,9 @@ open_interface(const char *device, netdissect_options /* * Return an error for our caller to handle. */ - pcap_close(pc); snprintf(ebuf, PCAP_ERRBUF_SIZE, "%s: %s\n(%s)", device, pcap_statustostr(status), cp); + pcap_close(pc); return (NULL); } else if (status == PCAP_ERROR_PERM_DENIED && *cp != '\0') error("%s: %s\n(%s)", device, From owner-svn-src-all@freebsd.org Wed Dec 27 03:23:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89260E9E4FE; Wed, 27 Dec 2017 03:23:04 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 23DE974984; Wed, 27 Dec 2017 03:23:04 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBR3N36d058256; Wed, 27 Dec 2017 03:23:03 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBR3N2HN058244; Wed, 27 Dec 2017 03:23:02 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201712270323.vBR3N2HN058244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Wed, 27 Dec 2017 03:23:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327230 - in head: bin/pax etc etc/devd usr.bin/localedef usr.bin/mail usr.bin/xargs usr.sbin/ctld usr.sbin/makefs usr.sbin/nfsd usr.sbin/rpc.lockd X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: in head: bin/pax etc etc/devd usr.bin/localedef usr.bin/mail usr.bin/xargs usr.sbin/ctld usr.sbin/makefs usr.sbin/nfsd usr.sbin/rpc.lockd X-SVN-Commit-Revision: 327230 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Dec 2017 03:23:04 -0000 Author: eadler Date: Wed Dec 27 03:23:01 2017 New Revision: 327230 URL: https://svnweb.freebsd.org/changeset/base/327230 Log: userland: Fix several typos and minor errors - duplicate words - typos - references to old versions of FreeBSD Reviewed by: imp, benno Modified: head/bin/pax/buf_subs.c head/etc/devd/hyperv.conf head/etc/portsnap.conf head/etc/rc.initdiskless head/etc/rc.subr head/usr.bin/localedef/ctype.c head/usr.bin/mail/cmd3.c head/usr.bin/xargs/strnsubst.c head/usr.sbin/ctld/login.c head/usr.sbin/makefs/cd9660.c head/usr.sbin/nfsd/nfsd.c head/usr.sbin/rpc.lockd/lockd_lock.c Modified: head/bin/pax/buf_subs.c ============================================================================== --- head/bin/pax/buf_subs.c Wed Dec 27 03:18:13 2017 (r327229) +++ head/bin/pax/buf_subs.c Wed Dec 27 03:23:01 2017 (r327230) @@ -485,7 +485,7 @@ wr_rdbuf(char *out, int outcnt) int cnt; /* - * while there is data to copy copy into the write buffer. when the + * while there is data to copy into the write buffer. when the * write buffer fills, flush it to the archive and continue */ while (outcnt > 0) { Modified: head/etc/devd/hyperv.conf ============================================================================== --- head/etc/devd/hyperv.conf Wed Dec 27 03:18:13 2017 (r327229) +++ head/etc/devd/hyperv.conf Wed Dec 27 03:23:01 2017 (r327230) @@ -39,39 +39,39 @@ notify 11 { # # How network VF works with hn(4) on Hyper-V in non-transparent mode: # -# - Each network VF has a cooresponding hn(4). -# - The network VF and the it's cooresponding hn(4) have the same hardware +# - Each network VF has a corresponding hn(4). +# - The network VF and the it's corresponding hn(4) have the same hardware # address. # - Once the network VF is up, e.g. ifconfig VF up: # o All of the transmission should go through the network VF. # o Most of the reception goes through the network VF. -# o Small amount of reception may go through the cooresponding hn(4). -# This reception will happen, even if the the cooresponding hn(4) is -# down. The cooresponding hn(4) will change the reception interface +# o Small amount of reception may go through the corresponding hn(4). +# This reception will happen, even if the corresponding hn(4) is +# down. The corresponding hn(4) will change the reception interface # to the network VF, so that network layer and application layer will # be tricked into thinking that these packets were received by the # network VF. -# o The cooresponding hn(4) pretends the physical link is down. +# o The corresponding hn(4) pretends the physical link is down. # - Once the network VF is down or detached: -# o All of the transmission should go through the cooresponding hn(4). -# o All of the reception goes through the cooresponding hn(4). -# o The cooresponding hn(4) fallbacks to the original physical link +# o All of the transmission should go through the corresponding hn(4). +# o All of the reception goes through the corresponding hn(4). +# o The corresponding hn(4) fallbacks to the original physical link # detection logic. # # All these features are mainly used to help live migration, during which # the network VF will be detached, while the network communication to the # VM must not be cut off. In order to reach this level of live migration # transparency, we use failover mode lagg(4) with the network VF and the -# cooresponding hn(4) attached to it. +# corresponding hn(4) attached to it. # # To ease user configuration for both network VF and non-network VF, the # lagg(4) will be created by the following rules, and the configuration -# of the cooresponding hn(4) will be applied to the lagg(4) automatically. +# of the corresponding hn(4) will be applied to the lagg(4) automatically. # # NOTE: # If live migration is not needed at all, the following rules could be # commented out, and the network VF interface could be used exclusively. -# Most often the cooresponding hn(4) could be completely ignored. +# Most often the corresponding hn(4) could be completely ignored. # # # Default workflow for the network VF bringup: Modified: head/etc/portsnap.conf ============================================================================== --- head/etc/portsnap.conf Wed Dec 27 03:18:13 2017 (r327229) +++ head/etc/portsnap.conf Wed Dec 27 03:23:01 2017 (r327230) @@ -30,7 +30,6 @@ KEYPRINT=9b5feee6d69f170e3dd0a2c8e469ddbd64f13f978f2f3 # REFUSE korean polish portuguese russian ukrainian vietnamese # List of INDEX files to build and the DESCRIBE file to use for each -#INDEX INDEX-9 DESCRIBE.9 #INDEX INDEX-10 DESCRIBE.10 #INDEX INDEX-11 DESCRIBE.11 INDEX INDEX-12 DESCRIBE.12 Modified: head/etc/rc.initdiskless ============================================================================== --- head/etc/rc.initdiskless Wed Dec 27 03:18:13 2017 (r327229) +++ head/etc/rc.initdiskless Wed Dec 27 03:23:01 2017 (r327230) @@ -67,7 +67,7 @@ # /conf/T/M/remount # The contents of the file is a mount command. E.g. if # /conf/1.2.3.4/foo/remount contains "mount -o ro /dev/ad0s3", -# then /dev/ad0s3 will be be mounted on /conf/1.2.3.4/foo/ +# then /dev/ad0s3 will be mounted on /conf/1.2.3.4/foo/ # # /conf/T/M/remount_optional # If this file exists, then failure to execute the mount Modified: head/etc/rc.subr ============================================================================== --- head/etc/rc.subr Wed Dec 27 03:18:13 2017 (r327229) +++ head/etc/rc.subr Wed Dec 27 03:23:01 2017 (r327230) @@ -1542,7 +1542,7 @@ debug() # is created. # # update `file' has changed and needs to be backed up. -# If `cur' exists, it is copied to to `back' +# If `cur' exists, it is copied to `back' # and then `file' is copied to `cur'. # # remove `file' is no longer being tracked by the backups Modified: head/usr.bin/localedef/ctype.c ============================================================================== --- head/usr.bin/localedef/ctype.c Wed Dec 27 03:18:13 2017 (r327229) +++ head/usr.bin/localedef/ctype.c Wed Dec 27 03:23:01 2017 (r327230) @@ -224,7 +224,7 @@ add_ctype_range(wchar_t end) * A word about widths: if the width mask is specified, then libc * unconditionally honors it. Otherwise, it assumes printable * characters have width 1, and non-printable characters have width - * -1 (except for NULL which is special with with 0). Hence, we have + * -1 (except for NULL which is special with width 0). Hence, we have * no need to inject defaults here -- the "default" unset value of 0 * indicates that libc should use its own logic in wcwidth as described. */ Modified: head/usr.bin/mail/cmd3.c ============================================================================== --- head/usr.bin/mail/cmd3.c Wed Dec 27 03:18:13 2017 (r327229) +++ head/usr.bin/mail/cmd3.c Wed Dec 27 03:23:01 2017 (r327230) @@ -261,7 +261,7 @@ dorespond(int *msgvec) } /* - * Modify the subject we are replying to to begin with Re: if + * Modify the message subject to begin with "Re:" if * it does not already. */ char * Modified: head/usr.bin/xargs/strnsubst.c ============================================================================== --- head/usr.bin/xargs/strnsubst.c Wed Dec 27 03:18:13 2017 (r327229) +++ head/usr.bin/xargs/strnsubst.c Wed Dec 27 03:23:01 2017 (r327230) @@ -37,7 +37,7 @@ strnsubst(char **str, const char *match, const char *r if (s1 == NULL) return; /* - * If maxsize is 0 then set it to to the length of s1, because we have + * If maxsize is 0 then set it to the length of s1, because we have * to duplicate s1. XXX we maybe should double-check whether the match * appears in s1. If it doesn't, then we also have to set the length * to the length of s1, to avoid modifying the argument. It may make Modified: head/usr.sbin/ctld/login.c ============================================================================== --- head/usr.sbin/ctld/login.c Wed Dec 27 03:18:13 2017 (r327229) +++ head/usr.sbin/ctld/login.c Wed Dec 27 03:23:01 2017 (r327230) @@ -748,7 +748,7 @@ login_negotiate(struct connection *conn, struct pdu *r /* * RFC 3720, 10.13.5. Status-Class and Status-Detail, says * the redirection SHOULD be accepted by the initiator before - * authentication, but MUST be be accepted afterwards; that's + * authentication, but MUST be accepted afterwards; that's * why we're doing it here and not earlier. */ redirected = login_target_redirect(conn, request); Modified: head/usr.sbin/makefs/cd9660.c ============================================================================== --- head/usr.sbin/makefs/cd9660.c Wed Dec 27 03:18:13 2017 (r327229) +++ head/usr.sbin/makefs/cd9660.c Wed Dec 27 03:23:01 2017 (r327230) @@ -2121,7 +2121,7 @@ cd9660_add_generic_bootimage(iso9660_disk *diskStructu } if (diskStructure->verbose_level > 0) { - printf("Generic boot image image has size %lld\n", + printf("Generic boot image has size %lld\n", (long long)stbuf.st_size); } Modified: head/usr.sbin/nfsd/nfsd.c ============================================================================== --- head/usr.sbin/nfsd/nfsd.c Wed Dec 27 03:18:13 2017 (r327229) +++ head/usr.sbin/nfsd/nfsd.c Wed Dec 27 03:23:01 2017 (r327230) @@ -761,10 +761,10 @@ main(int argc, char **argv) setproctitle("master"); /* - * We always want a master to have a clean way to to shut nfsd down + * We always want a master to have a clean way to shut nfsd down * (with unregistration): if the master is killed, it unregisters and * kills all children. If we run for UDP only (and so do not have to - * loop waiting waiting for accept), we instead make the parent + * loop waiting for accept), we instead make the parent * a "server" too. start_server will not return. */ if (!tcpflag) Modified: head/usr.sbin/rpc.lockd/lockd_lock.c ============================================================================== --- head/usr.sbin/rpc.lockd/lockd_lock.c Wed Dec 27 03:18:13 2017 (r327229) +++ head/usr.sbin/rpc.lockd/lockd_lock.c Wed Dec 27 03:23:01 2017 (r327230) @@ -883,7 +883,7 @@ test_nfslock(const struct file_lock *fl, struct file_l * While this seems to be intuitively wrong, it is required for proper * Posix semantics during unlock. It is absolutely imperative to not * unlock the main lock before the two child locks are established. Thus, - * one has be be able to create duplicate locks over an existing lock + * one has to be able to create duplicate locks over an existing lock * 2) It currently accepts duplicate locks from the same id,pid */ From owner-svn-src-all@freebsd.org Wed Dec 27 03:23:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F7ACE9E57A; Wed, 27 Dec 2017 03:23:27 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18E2974AD3; Wed, 27 Dec 2017 03:23:25 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBR3NO4a058335; Wed, 27 Dec 2017 03:23:24 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBR3NMF1058306; Wed, 27 Dec 2017 03:23:22 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201712270323.vBR3NMF1058306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Wed, 27 Dec 2017 03:23:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327231 - in head/sys: amd64/amd64 dev/ath dev/bhnd/nvram dev/cadence dev/de dev/drm dev/e1000 dev/isci/scil dev/iwm dev/mvs dev/mwl dev/sfxge/common dev/sio dev/sound/isa dev/syscons f... X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: in head/sys: amd64/amd64 dev/ath dev/bhnd/nvram dev/cadence dev/de dev/drm dev/e1000 dev/isci/scil dev/iwm dev/mvs dev/mwl dev/sfxge/common dev/sio dev/sound/isa dev/syscons fs/nfsclient i386/i386 ker... X-SVN-Commit-Revision: 327231 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Dec 2017 03:23:27 -0000 Author: eadler Date: Wed Dec 27 03:23:21 2017 New Revision: 327231 URL: https://svnweb.freebsd.org/changeset/base/327231 Log: kernel: Fix several typos and minor errors - duplicate words - typos - references to old versions of FreeBSD Reviewed by: imp, benno Modified: head/sys/amd64/amd64/support.S head/sys/dev/ath/if_ath.c head/sys/dev/bhnd/nvram/bhnd_nvram_store_subr.c head/sys/dev/cadence/if_cgem.c head/sys/dev/de/if_de.c head/sys/dev/drm/mga_state.c head/sys/dev/e1000/e1000_82543.c head/sys/dev/isci/scil/scic_sds_remote_node_context.c head/sys/dev/isci/scil/scif_sas_controller.c head/sys/dev/iwm/if_iwmreg.h head/sys/dev/mvs/mvs_pci.c head/sys/dev/mwl/if_mwl.c head/sys/dev/sfxge/common/siena_nvram.c head/sys/dev/sio/sio.c head/sys/dev/sound/isa/mss.h head/sys/dev/syscons/scvgarndr.c head/sys/fs/nfsclient/nfs_clrpcops.c head/sys/i386/i386/support.s head/sys/kern/vfs_subr.c head/sys/mips/conf/BERI_SOCKIT head/sys/net/altq/altq_hfsc.h head/sys/net/bpf.c head/sys/net80211/ieee80211_ht.c head/sys/net80211/ieee80211_scan_sta.c head/sys/powerpc/booke/locore.S head/sys/sparc64/pci/sbbc.c head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/amd64/amd64/support.S ============================================================================== --- head/sys/amd64/amd64/support.S Wed Dec 27 03:23:01 2017 (r327230) +++ head/sys/amd64/amd64/support.S Wed Dec 27 03:23:21 2017 (r327231) @@ -596,7 +596,7 @@ END(subyte) * copyinstr(from, to, maxlen, int *lencopied) - MP SAFE * %rdi, %rsi, %rdx, %rcx * - * copy a string from from to to, stop when a 0 character is reached. + * copy a string from 'from' to 'to', stop when a 0 character is reached. * return ENAMETOOLONG if string is longer than maxlen, and * EFAULT on protection violations. If lencopied is non-zero, * return the actual length in *lencopied. Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Wed Dec 27 03:23:01 2017 (r327230) +++ head/sys/dev/ath/if_ath.c Wed Dec 27 03:23:21 2017 (r327231) @@ -1081,7 +1081,7 @@ ath_attach(u_int16_t devid, struct ath_softc *sc) sc->sc_txq_node_psq_maxdepth = 16; /* - * Default the maximum queue to to 1/4'th the TX buffers, or + * Default the maximum queue to 1/4'th the TX buffers, or * 64, whichever is smaller. */ sc->sc_txq_node_maxdepth = MIN(64, ath_txbuf / 4); Modified: head/sys/dev/bhnd/nvram/bhnd_nvram_store_subr.c ============================================================================== --- head/sys/dev/bhnd/nvram/bhnd_nvram_store_subr.c Wed Dec 27 03:23:01 2017 (r327230) +++ head/sys/dev/bhnd/nvram/bhnd_nvram_store_subr.c Wed Dec 27 03:23:21 2017 (r327231) @@ -748,7 +748,7 @@ bhnd_nvstore_var_register_path(struct bhnd_nvram_store } /** - * Resolve the device path entry referenced referenced by @p info. + * Resolve the device path entry referenced by @p info. * * @param sc The NVRAM store to be updated. * @param info Variable name information descriptor containing Modified: head/sys/dev/cadence/if_cgem.c ============================================================================== --- head/sys/dev/cadence/if_cgem.c Wed Dec 27 03:23:01 2017 (r327230) +++ head/sys/dev/cadence/if_cgem.c Wed Dec 27 03:23:21 2017 (r327231) @@ -811,7 +811,7 @@ cgem_start_locked(if_t ifp) WR4(sc, CGEM_NET_CTRL, sc->net_ctl_shadow | CGEM_NET_CTRL_START_TX); - /* If there is a BPF listener, bounce a copy to to him. */ + /* If there is a BPF listener, bounce a copy to him. */ ETHER_BPF_MTAP(ifp, m); } } Modified: head/sys/dev/de/if_de.c ============================================================================== --- head/sys/dev/de/if_de.c Wed Dec 27 03:23:01 2017 (r327230) +++ head/sys/dev/de/if_de.c Wed Dec 27 03:23:21 2017 (r327231) @@ -3920,7 +3920,7 @@ tulip_txput(tulip_softc_t * const sc, struct mbuf *m) * a bit reminiscent of going on the Ark two by two * since each descriptor for the TULIP can describe * two buffers. So we advance through packet filling - * each of the two entries at a time to to fill each + * each of the two entries at a time to fill each * descriptor. Clear the first and last segment bits * in each descriptor (actually just clear everything * but the end-of-ring or chain bits) to make sure Modified: head/sys/dev/drm/mga_state.c ============================================================================== --- head/sys/dev/drm/mga_state.c Wed Dec 27 03:23:01 2017 (r327230) +++ head/sys/dev/drm/mga_state.c Wed Dec 27 03:23:21 2017 (r327231) @@ -258,7 +258,7 @@ static __inline__ void mga_g200_emit_pipe(drm_mga_priv MGA_WR42, 0x0000ffff, MGA_WR60, 0x0000ffff); - /* Padding required to to hardware bug. + /* Padding required due to hardware bug. */ DMA_BLOCK(MGA_DMAPAD, 0xffffffff, MGA_DMAPAD, 0xffffffff, @@ -340,7 +340,7 @@ static __inline__ void mga_g400_emit_pipe(drm_mga_priv MGA_WR52, MGA_G400_WR_MAGIC, /* tex1 width */ MGA_WR60, MGA_G400_WR_MAGIC); /* tex1 height */ - /* Padding required to to hardware bug */ + /* Padding required due to hardware bug */ DMA_BLOCK(MGA_DMAPAD, 0xffffffff, MGA_DMAPAD, 0xffffffff, MGA_DMAPAD, 0xffffffff, Modified: head/sys/dev/e1000/e1000_82543.c ============================================================================== --- head/sys/dev/e1000/e1000_82543.c Wed Dec 27 03:23:01 2017 (r327230) +++ head/sys/dev/e1000/e1000_82543.c Wed Dec 27 03:23:21 2017 (r327231) @@ -1310,7 +1310,7 @@ static s32 e1000_check_for_copper_link_82543(struct e1 * turn it on. For compatibility with a TBI link * partner, we will store bad packets. Some * frames have an additional byte on the end and - * will look like CRC errors to to the hardware. + * will look like CRC errors to the hardware. */ if (!e1000_tbi_sbp_enabled_82543(hw)) { e1000_set_tbi_sbp_82543(hw, TRUE); Modified: head/sys/dev/isci/scil/scic_sds_remote_node_context.c ============================================================================== --- head/sys/dev/isci/scil/scic_sds_remote_node_context.c Wed Dec 27 03:23:01 2017 (r327230) +++ head/sys/dev/isci/scil/scic_sds_remote_node_context.c Wed Dec 27 03:23:21 2017 (r327231) @@ -899,7 +899,7 @@ SCI_STATUS scic_sds_remote_node_context_tx_suspended_s * * @param[in] this_rnc The remote node context which is to receive the task * request. -* @param[in] the_request The task request to be transmitted to to the remote +* @param[in] the_request The task request to be transmitted to the remote * target device. * * @return SCI_STATUS Modified: head/sys/dev/isci/scil/scif_sas_controller.c ============================================================================== --- head/sys/dev/isci/scil/scif_sas_controller.c Wed Dec 27 03:23:01 2017 (r327230) +++ head/sys/dev/isci/scil/scif_sas_controller.c Wed Dec 27 03:23:21 2017 (r327231) @@ -913,7 +913,7 @@ void scif_sas_controller_free_internal_request( fw_controller, fw_internal_request_buffer )); - //return the memory to to pool. + //return the memory to the pool. if( !sci_pool_full(fw_controller->internal_request_memory_pool) ) { sci_pool_put( Modified: head/sys/dev/iwm/if_iwmreg.h ============================================================================== --- head/sys/dev/iwm/if_iwmreg.h Wed Dec 27 03:23:01 2017 (r327230) +++ head/sys/dev/iwm/if_iwmreg.h Wed Dec 27 03:23:21 2017 (r327231) @@ -3734,7 +3734,7 @@ struct iwm_uapsd_misbehaving_ap_notif { * beacon filtering; beacons will not be forced to be sent to driver * regardless of whether its temperature has been changed. * @bf_enable_beacon_filter: 1, beacon filtering is enabled; 0, disabled. - * @bf_filter_escape_timer: Send beacons to to driver if no beacons were passed + * @bf_filter_escape_timer: Send beacons to the driver if no beacons were passed * for a specific period of time. Units: Beacons. * @ba_escape_timer: Fully receive and parse beacon if no beacons were passed * for a longer period of time then this escape-timeout. Units: Beacons. Modified: head/sys/dev/mvs/mvs_pci.c ============================================================================== --- head/sys/dev/mvs/mvs_pci.c Wed Dec 27 03:23:01 2017 (r327230) +++ head/sys/dev/mvs/mvs_pci.c Wed Dec 27 03:23:21 2017 (r327231) @@ -338,7 +338,7 @@ mvs_intr(void *data) ic = ATA_INL(ctlr->r_mem, CHIP_MIC); if (ctlr->msi) { - /* We have to to mask MSI during processing. */ + /* We have to mask MSI during processing. */ mtx_lock(&ctlr->mtx); ATA_OUTL(ctlr->r_mem, CHIP_MIM, 0); ctlr->msia = 1; /* Deny MIM update during processing. */ Modified: head/sys/dev/mwl/if_mwl.c ============================================================================== --- head/sys/dev/mwl/if_mwl.c Wed Dec 27 03:23:01 2017 (r327230) +++ head/sys/dev/mwl/if_mwl.c Wed Dec 27 03:23:21 2017 (r327231) @@ -1239,7 +1239,7 @@ mwl_reset_vap(struct ieee80211vap *vap, int state) /* * Reset the hardware w/o losing operational state. - * Used to to reset or reload hardware state for a vap. + * Used to reset or reload hardware state for a vap. */ static int mwl_reset(struct ieee80211vap *vap, u_long cmd) Modified: head/sys/dev/sfxge/common/siena_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nvram.c Wed Dec 27 03:23:01 2017 (r327230) +++ head/sys/dev/sfxge/common/siena_nvram.c Wed Dec 27 03:23:21 2017 (r327231) @@ -527,7 +527,7 @@ siena_nvram_partn_get_version( : MC_CMD_NVRAM_TYPE_DYNAMIC_CFG_PORT1; /* * Ingore missing partitions on port 2, assuming they're due - * to to running on a single port part. + * to running on a single port part. */ if ((1 << dcfg_partn) & ~enp->en_u.siena.enu_partn_mask) { if (entry->port == 2) Modified: head/sys/dev/sio/sio.c ============================================================================== --- head/sys/dev/sio/sio.c Wed Dec 27 03:23:01 2017 (r327230) +++ head/sys/dev/sio/sio.c Wed Dec 27 03:23:21 2017 (r327231) @@ -592,7 +592,7 @@ sioprobe(dev, xrid, rclk, noprobe) * junk after a (very fast) soft reboot and (apparently) after * master reset. * XXX what about the UART bug avoided by waiting in comparam()? - * We don't want to to wait long enough to drain at 2 bps. + * We don't want to wait long enough to drain at 2 bps. */ if (iobase == siocniobase) DELAY((16 + 1) * 1000000 / (comdefaultrate / 10)); Modified: head/sys/dev/sound/isa/mss.h ============================================================================== --- head/sys/dev/sound/isa/mss.h Wed Dec 27 03:23:01 2017 (r327230) +++ head/sys/dev/sound/isa/mss.h Wed Dec 27 03:23:21 2017 (r327231) @@ -183,7 +183,7 @@ typedef struct mixer_def mixer_tab[32][2]; * The AD1848 codec has generic input lines called Line, Aux1 and Aux2. * Soundcard manufacturers have connected actual inputs (CD, synth, line, * etc) to these inputs in different order. Therefore it's difficult - * to assign mixer channels to to these inputs correctly. The following + * to assign mixer channels to these inputs correctly. The following * contains two alternative mappings. The first one is for GUS MAX and * the second is just a generic one (line1, line2 and line3). * (Actually this is not a mapping but rather some kind of interleaving Modified: head/sys/dev/syscons/scvgarndr.c ============================================================================== --- head/sys/dev/syscons/scvgarndr.c Wed Dec 27 03:23:01 2017 (r327230) +++ head/sys/dev/syscons/scvgarndr.c Wed Dec 27 03:23:21 2017 (r327231) @@ -682,7 +682,7 @@ draw_txtmouse(scr_stat *scp, int x, int y) } else #endif /* SC_ALT_MOUSE_IMAGE */ { - /* Red, magenta and brown are mapped to green to to keep it readable */ + /* Red, magenta and brown are mapped to green to keep it readable */ static const int col_conv[16] = { 6, 6, 6, 6, 2, 2, 2, 6, 14, 14, 14, 14, 10, 10, 10, 14 }; Modified: head/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clrpcops.c Wed Dec 27 03:23:01 2017 (r327230) +++ head/sys/fs/nfsclient/nfs_clrpcops.c Wed Dec 27 03:23:21 2017 (r327231) @@ -5815,7 +5815,7 @@ nfsm_copym(struct mbuf *m, int off, int xfer) /* * Find a file layout that will handle the first bytes of the requested - * range and return the information from it needed to to the I/O operation. + * range and return the information from it needed to the I/O operation. */ int nfscl_findlayoutforio(struct nfscllayout *lyp, uint64_t off, uint32_t rwaccess, Modified: head/sys/i386/i386/support.s ============================================================================== --- head/sys/i386/i386/support.s Wed Dec 27 03:23:01 2017 (r327230) +++ head/sys/i386/i386/support.s Wed Dec 27 03:23:21 2017 (r327231) @@ -556,7 +556,7 @@ END(subyte) /* * copyinstr(from, to, maxlen, int *lencopied) - MP SAFE * - * copy a string from from to to, stop when a 0 character is reached. + * copy a string from 'from' to 'to', stop when a 0 character is reached. * return ENAMETOOLONG if string is longer than maxlen, and * EFAULT on protection violations. If lencopied is non-zero, * return the actual length in *lencopied. Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Wed Dec 27 03:23:01 2017 (r327230) +++ head/sys/kern/vfs_subr.c Wed Dec 27 03:23:21 2017 (r327231) @@ -349,7 +349,7 @@ PCTRIE_DEFINE(BUF, buf, b_lblkno, buf_trie_alloc, buf_ * * Reevaluate the following cap on the number of vnodes after the physical * memory size exceeds 512GB. In the limit, as the physical memory size - * grows, the ratio of the memory size in KB to to vnodes approaches 64:1. + * grows, the ratio of the memory size in KB to vnodes approaches 64:1. */ #ifndef MAXVNODES_MAX #define MAXVNODES_MAX (512 * 1024 * 1024 / 64) /* 8M */ Modified: head/sys/mips/conf/BERI_SOCKIT ============================================================================== --- head/sys/mips/conf/BERI_SOCKIT Wed Dec 27 03:23:01 2017 (r327230) +++ head/sys/mips/conf/BERI_SOCKIT Wed Dec 27 03:23:21 2017 (r327231) @@ -2,7 +2,7 @@ # BERI_SOCKIT -- Kernel for the SRI/Cambridge "BERI" (Bluespec Extensible # RISC Implementation) FPGA soft core, as configured in its Terasic SoCKit # reference configuration. This kernel configration must be further -# specialized to to include a root filesystem specification. +# specialized to include a root filesystem specification. # # $FreeBSD$ # Modified: head/sys/net/altq/altq_hfsc.h ============================================================================== --- head/sys/net/altq/altq_hfsc.h Wed Dec 27 03:23:01 2017 (r327230) +++ head/sys/net/altq/altq_hfsc.h Wed Dec 27 03:23:21 2017 (r327231) @@ -192,7 +192,7 @@ struct hfsc_class_stats { * representation. * the slope values are scaled to avoid overflow. * the inverse slope values as well as the y-projection of the 1st - * segment are kept in order to to avoid 64-bit divide operations + * segment are kept in order to avoid 64-bit divide operations * that are expensive on 32-bit architectures. * * note: Intel Pentium TSC never wraps around in several thousands of years. Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Wed Dec 27 03:23:01 2017 (r327230) +++ head/sys/net/bpf.c Wed Dec 27 03:23:21 2017 (r327231) @@ -689,7 +689,7 @@ bpf_check_upgrade(u_long cmd, struct bpf_d *d, struct * Check if cmd looks like snaplen setting from * pcap_bpf.c:pcap_open_live(). * Note we're not checking .k value here: - * while pcap_open_live() definitely sets to to non-zero value, + * while pcap_open_live() definitely sets to non-zero value, * we'd prefer to treat k=0 (deny ALL) case the same way: e.g. * do not consider upgrading immediately */ Modified: head/sys/net80211/ieee80211_ht.c ============================================================================== --- head/sys/net80211/ieee80211_ht.c Wed Dec 27 03:23:01 2017 (r327230) +++ head/sys/net80211/ieee80211_ht.c Wed Dec 27 03:23:21 2017 (r327231) @@ -3354,7 +3354,7 @@ ieee80211_add_htinfo_body(uint8_t *frm, struct ieee802 } /* - * Add 802.11n HT information information element. + * Add 802.11n HT information element. */ uint8_t * ieee80211_add_htinfo(uint8_t *frm, struct ieee80211_node *ni) Modified: head/sys/net80211/ieee80211_scan_sta.c ============================================================================== --- head/sys/net80211/ieee80211_scan_sta.c Wed Dec 27 03:23:01 2017 (r327230) +++ head/sys/net80211/ieee80211_scan_sta.c Wed Dec 27 03:23:21 2017 (r327231) @@ -119,7 +119,7 @@ static void sta_flush_table(struct sta_table *); /* * match_bss returns a bitmask describing if an entry is suitable * for use. If non-zero the entry was deemed not suitable and it's - * contents explains why. The following flags are or'd to to this + * contents explains why. The following flags are or'd to this * mask and can be used to figure out why the entry was rejected. */ #define MATCH_CHANNEL 0x00001 /* channel mismatch */ Modified: head/sys/powerpc/booke/locore.S ============================================================================== --- head/sys/powerpc/booke/locore.S Wed Dec 27 03:23:01 2017 (r327230) +++ head/sys/powerpc/booke/locore.S Wed Dec 27 03:23:21 2017 (r327231) @@ -114,7 +114,7 @@ __start: * - Switch to temp mapping * - Map 64MB of RAM in TLB1[1] * - Use AS=1, set EPN to KERNBASE and RPN to kernel load address - * - Switch to to TLB1[1] mapping + * - Switch to TLB1[1] mapping * - Invalidate temp mapping * * locore registers use: Modified: head/sys/sparc64/pci/sbbc.c ============================================================================== --- head/sys/sparc64/pci/sbbc.c Wed Dec 27 03:23:01 2017 (r327230) +++ head/sys/sparc64/pci/sbbc.c Wed Dec 27 03:23:21 2017 (r327231) @@ -327,7 +327,7 @@ sbbc_pci_attach(device_t dev) int error, rid; uint32_t val; - /* Nothing to to if we're not the chosen one. */ + /* Nothing to do if we're not the chosen one. */ if ((node = OF_finddevice("/chosen")) == -1) { device_printf(dev, "failed to find /chosen\n"); return (ENXIO); Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Wed Dec 27 03:23:01 2017 (r327230) +++ head/sys/ufs/ffs/ffs_softdep.c Wed Dec 27 03:23:21 2017 (r327231) @@ -6903,7 +6903,7 @@ softdep_setup_freeblocks(ip, length, flags) UFS_UNLOCK(ump); DIP_SET(ip, i_blocks, DIP(ip, i_blocks) - datablocks); /* - * Push the zero'ed inode to to its disk buffer so that we are free + * Push the zero'ed inode to its disk buffer so that we are free * to delete its dependencies below. Once the dependencies are gone * the buffer can be safely released. */ From owner-svn-src-all@freebsd.org Wed Dec 27 03:23:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8AAD3E9E5FC; Wed, 27 Dec 2017 03:23:45 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 62FF774BF2; Wed, 27 Dec 2017 03:23:43 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBR3Ngbu058411; Wed, 27 Dec 2017 03:23:42 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBR3NfAE058404; Wed, 27 Dec 2017 03:23:41 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201712270323.vBR3NfAE058404@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Wed, 27 Dec 2017 03:23:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327232 - in head/lib: libc/include libc/sparc64/fpu libedit libefivar msun/src X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: in head/lib: libc/include libc/sparc64/fpu libedit libefivar msun/src X-SVN-Commit-Revision: 327232 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Dec 2017 03:23:45 -0000 Author: eadler Date: Wed Dec 27 03:23:41 2017 New Revision: 327232 URL: https://svnweb.freebsd.org/changeset/base/327232 Log: lib: Fix several typos and minor errors - duplicate words - typos - references to old versions of FreeBSD Reviewed by: imp, benno Modified: head/lib/libc/include/reentrant.h head/lib/libc/sparc64/fpu/fpu_reg.h head/lib/libedit/map.c head/lib/libedit/refresh.c head/lib/libefivar/uefi-dputil.c head/lib/msun/src/catrig.c Modified: head/lib/libc/include/reentrant.h ============================================================================== --- head/lib/libc/include/reentrant.h Wed Dec 27 03:23:21 2017 (r327231) +++ head/lib/libc/include/reentrant.h Wed Dec 27 03:23:41 2017 (r327232) @@ -67,7 +67,7 @@ * Implementation Details: * * The mutex primitives used by the library (mutex_t, mutex_lock, etc.) - * are macros which expand to the cooresponding primitives provided by + * are macros which expand to the corresponding primitives provided by * the thread engine or to nothing. The latter is used so that code is * not unreasonably cluttered with #ifdefs when all thread safe support * is removed. Modified: head/lib/libc/sparc64/fpu/fpu_reg.h ============================================================================== --- head/lib/libc/sparc64/fpu/fpu_reg.h Wed Dec 27 03:23:21 2017 (r327231) +++ head/lib/libc/sparc64/fpu/fpu_reg.h Wed Dec 27 03:23:41 2017 (r327232) @@ -31,7 +31,7 @@ #define _LIBC_SPARC64_FPU_FPU_REG_H_ /* - * These are not really of type char[]. They are are arrays of functions defined + * These are not really of type char[]. They are arrays of functions defined * in fpu_reg.S; each array member loads/stores a certain fpu register of the * given size. */ Modified: head/lib/libedit/map.c ============================================================================== --- head/lib/libedit/map.c Wed Dec 27 03:23:21 2017 (r327231) +++ head/lib/libedit/map.c Wed Dec 27 03:23:41 2017 (r327232) @@ -370,7 +370,7 @@ private const el_action_t el_map_vi_insert[] = { * NOTE: These mappings do NOT Correspond well * to the KSH VI editing assignments. * On the other and they are convenient and - * many people have have gotten used to them. + * many people have gotten used to them. */ /* 0 */ ED_UNASSIGNED, /* ^@ */ /* 1 */ ED_MOVE_TO_BEG, /* ^A */ Modified: head/lib/libedit/refresh.c ============================================================================== --- head/lib/libedit/refresh.c Wed Dec 27 03:23:21 2017 (r327231) +++ head/lib/libedit/refresh.c Wed Dec 27 03:23:41 2017 (r327232) @@ -1148,7 +1148,7 @@ re_fastaddc(EditLine *el) /* re_clear_display(): - * clear the screen buffers so that new new prompt starts fresh. + * clear the screen buffers so that new prompt starts fresh. */ protected void re_clear_display(EditLine *el) Modified: head/lib/libefivar/uefi-dputil.c ============================================================================== --- head/lib/libefivar/uefi-dputil.c Wed Dec 27 03:23:21 2017 (r327231) +++ head/lib/libefivar/uefi-dputil.c Wed Dec 27 03:23:41 2017 (r327232) @@ -134,7 +134,7 @@ GetDevicePathSize ( @param MaxSize The maximum size of the device path data structure. @retval TRUE DevicePath is valid. - @retval FALSE The length of any node node in the DevicePath is less + @retval FALSE The length of any node in the DevicePath is less than sizeof (EFI_DEVICE_PATH_PROTOCOL). @retval FALSE If MaxSize is not zero, the size of the DevicePath exceeds MaxSize. Modified: head/lib/msun/src/catrig.c ============================================================================== --- head/lib/msun/src/catrig.c Wed Dec 27 03:23:21 2017 (r327231) +++ head/lib/msun/src/catrig.c Wed Dec 27 03:23:41 2017 (r327232) @@ -611,7 +611,7 @@ catanh(double complex z) if (ax < SQRT_3_EPSILON / 2 && ay < SQRT_3_EPSILON / 2) { /* * z = 0 was filtered out above. All other cases must raise - * inexact, but this is the only only that needs to do it + * inexact, but this is the only case that needs to do it * explicitly. */ raise_inexact(); From owner-svn-src-all@freebsd.org Wed Dec 27 03:24:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE8D9E9E64D; Wed, 27 Dec 2017 03:24:01 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 466CF74D33; Wed, 27 Dec 2017 03:23:59 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBR3Nwmf058465; Wed, 27 Dec 2017 03:23:58 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBR3Nw8h058459; Wed, 27 Dec 2017 03:23:58 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201712270323.vBR3Nw8h058459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Wed, 27 Dec 2017 03:23:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327233 - in head: . sbin/devfs tests/sys/fifo tests/sys/kern tools/regression/bpf/bpf_filter X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: in head: . sbin/devfs tests/sys/fifo tests/sys/kern tools/regression/bpf/bpf_filter X-SVN-Commit-Revision: 327233 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Dec 2017 03:24:01 -0000 Author: eadler Date: Wed Dec 27 03:23:58 2017 New Revision: 327233 URL: https://svnweb.freebsd.org/changeset/base/327233 Log: other: Fix several typos and minor errors - duplicate words - typos - references to old versions of FreeBSD Reviewed by: imp, benno Modified: head/UPDATING head/sbin/devfs/rule.c head/tests/sys/fifo/fifo_io.c head/tests/sys/kern/ptrace_test.c head/tools/regression/bpf/bpf_filter/bpf_test.c Modified: head/UPDATING ============================================================================== --- head/UPDATING Wed Dec 27 03:23:41 2017 (r327232) +++ head/UPDATING Wed Dec 27 03:23:58 2017 (r327233) @@ -821,7 +821,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: 20150623: An additional fix for the issue described in the 20150614 sendmail - entry below has been been committed in revision 284717. + entry below has been committed in revision 284717. 20150616: FreeBSD's old make (fmake) has been removed from the system. It is @@ -829,7 +829,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: 20150615: The fix for the issue described in the 20150614 sendmail entry - below has been been committed in revision 284436. The work + below has been committed in revision 284436. The work around described in that entry is no longer needed unless the default setting is overridden by a confDH_PARAMETERS configuration setting of '5' or pointing to a 512 bit DH parameter file. Modified: head/sbin/devfs/rule.c ============================================================================== --- head/sbin/devfs/rule.c Wed Dec 27 03:23:41 2017 (r327232) +++ head/sbin/devfs/rule.c Wed Dec 27 03:23:58 2017 (r327233) @@ -267,7 +267,7 @@ ruleset_main(int ac, char **av) * differs from the other rulespec_in*() routines in that it also * calls ioctl() for the rules, since it is impractical (and not very * useful) to return a list (or array) of rules, just so the caller - * can call call ioctl() for each of them. + * can call ioctl() for each of them. */ static void rulespec_infp(FILE *fp, unsigned long request, devfs_rsnum rsnum) Modified: head/tests/sys/fifo/fifo_io.c ============================================================================== --- head/tests/sys/fifo/fifo_io.c Wed Dec 27 03:23:41 2017 (r327232) +++ head/tests/sys/fifo/fifo_io.c Wed Dec 27 03:23:58 2017 (r327233) @@ -1178,7 +1178,7 @@ test_events_write_read_byte(void) } /* - * Read the byte from the reader_fd, and now confirm that that fifo + * Read the byte from the reader_fd, and now confirm that the fifo * becomes unreadable. */ len = read(reader_fd, &ch, sizeof(ch)); Modified: head/tests/sys/kern/ptrace_test.c ============================================================================== --- head/tests/sys/kern/ptrace_test.c Wed Dec 27 03:23:41 2017 (r327232) +++ head/tests/sys/kern/ptrace_test.c Wed Dec 27 03:23:58 2017 (r327233) @@ -2958,7 +2958,7 @@ ATF_TC_BODY(ptrace__PT_CONTINUE_with_sigmask, tc) /* * Verify that if ptrace stops due to a signal but continues with * a different signal that the new signal is routed to a thread - * that can accept it, and that that thread is awakened by the signal + * that can accept it, and that the thread is awakened by the signal * in a timely manner. */ ATF_TC_WITHOUT_HEAD(ptrace__PT_CONTINUE_with_signal_thread_sigmask); Modified: head/tools/regression/bpf/bpf_filter/bpf_test.c ============================================================================== --- head/tools/regression/bpf/bpf_filter/bpf_test.c Wed Dec 27 03:23:41 2017 (r327232) +++ head/tools/regression/bpf/bpf_filter/bpf_test.c Wed Dec 27 03:23:58 2017 (r327233) @@ -149,7 +149,7 @@ bpf_validate(const struct bpf_insn *f, int len) if (!BPF_VALIDATE_CODE(p->code)) return (0); /* - * Check that that jumps are forward, and within + * Check that jumps are forward, and within * the code block. */ if (BPF_CLASS(p->code) == BPF_JMP) { From owner-svn-src-all@freebsd.org Wed Dec 27 03:24:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45AC5E9E6FA; Wed, 27 Dec 2017 03:24:28 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A6CA774EB2; Wed, 27 Dec 2017 03:24:27 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBR3OQZ5058546; Wed, 27 Dec 2017 03:24:26 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBR3OOGr058526; Wed, 27 Dec 2017 03:24:24 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201712270324.vBR3OOGr058526@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 27 Dec 2017 03:24:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r327234 - stable/11/contrib/tcpdump X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/contrib/tcpdump X-SVN-Commit-Revision: 327234 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Dec 2017 03:24:28 -0000 Author: emaste Date: Wed Dec 27 03:24:24 2017 New Revision: 327234 URL: https://svnweb.freebsd.org/changeset/base/327234 Log: MFC r326613: Update tcpdump to 4.9.2 It contains many fixes, including bounds checking, buffer overflows (in SLIP and bittok2str_internal), buffer over-reads, and infinite loops. One other notable change: Do not use getprotobynumber() for protocol name resolution. Do not do any protocol name resolution if -n is specified. Relnotes: Yes Security: CVE-2017-11108, CVE-2017-11541, CVE-2017-11542 Security: CVE-2017-11543, CVE-2017-12893, CVE-2017-12894 Security: CVE-2017-12895, CVE-2017-12896, CVE-2017-12897 Security: CVE-2017-12898, CVE-2017-12899, CVE-2017-12900 Security: CVE-2017-12901, CVE-2017-12902, CVE-2017-12985 Security: CVE-2017-12986, CVE-2017-12987, CVE-2017-12988 Security: CVE-2017-12989, CVE-2017-12990, CVE-2017-12991 Security: CVE-2017-12992, CVE-2017-12993, CVE-2017-12994 Security: CVE-2017-12995, CVE-2017-12996, CVE-2017-12997 Security: CVE-2017-12998, CVE-2017-12999, CVE-2017-13000 Security: CVE-2017-13001, CVE-2017-13002, CVE-2017-13003 Security: CVE-2017-13004, CVE-2017-13005, CVE-2017-13006 Security: CVE-2017-13007, CVE-2017-13008, CVE-2017-13009 Security: CVE-2017-13010, CVE-2017-13011, CVE-2017-13012 Security: CVE-2017-13013, CVE-2017-13014, CVE-2017-13015 Security: CVE-2017-13016, CVE-2017-13017, CVE-2017-13018 Security: CVE-2017-13019, CVE-2017-13020, CVE-2017-13021 Security: CVE-2017-13022, CVE-2017-13023, CVE-2017-13024 Security: CVE-2017-13025, CVE-2017-13026, CVE-2017-13027 Security: CVE-2017-13028, CVE-2017-13029, CVE-2017-13030 Security: CVE-2017-13031, CVE-2017-13032, CVE-2017-13033 Security: CVE-2017-13034, CVE-2017-13035, CVE-2017-13036 Security: CVE-2017-13037, CVE-2017-13038, CVE-2017-13039 Security: CVE-2017-13040, CVE-2017-13041, CVE-2017-13042 Security: CVE-2017-13043, CVE-2017-13044, CVE-2017-13045 Security: CVE-2017-13046, CVE-2017-13047, CVE-2017-13048 Security: CVE-2017-13049, CVE-2017-13050, CVE-2017-13051 Security: CVE-2017-13052, CVE-2017-13053, CVE-2017-13054 Security: CVE-2017-13055, CVE-2017-13687, CVE-2017-13688 Security: CVE-2017-13689, CVE-2017-13690, CVE-2017-13725 Added: - copied unchanged from r326613, head/contrib/tcpdump/funcattrs.h Directory Properties: stable/11/contrib/tcpdump/funcattrs.h (props changed) Modified: stable/11/contrib/tcpdump/CHANGES stable/11/contrib/tcpdump/CONTRIBUTING stable/11/contrib/tcpdump/CREDITS stable/11/contrib/tcpdump/INSTALL.txt stable/11/contrib/tcpdump/Makefile.in stable/11/contrib/tcpdump/PLATFORMS stable/11/contrib/tcpdump/README.md stable/11/contrib/tcpdump/VERSION stable/11/contrib/tcpdump/addrtoname.c stable/11/contrib/tcpdump/addrtoname.h stable/11/contrib/tcpdump/addrtostr.c stable/11/contrib/tcpdump/af.c stable/11/contrib/tcpdump/af.h stable/11/contrib/tcpdump/checksum.c stable/11/contrib/tcpdump/config.h.in stable/11/contrib/tcpdump/configure stable/11/contrib/tcpdump/configure.in stable/11/contrib/tcpdump/extract.h stable/11/contrib/tcpdump/gmpls.c stable/11/contrib/tcpdump/gmpls.h stable/11/contrib/tcpdump/ip6.h stable/11/contrib/tcpdump/ipproto.c stable/11/contrib/tcpdump/ipproto.h stable/11/contrib/tcpdump/l2vpn.c stable/11/contrib/tcpdump/l2vpn.h stable/11/contrib/tcpdump/netdissect-stdinc.h stable/11/contrib/tcpdump/netdissect.h stable/11/contrib/tcpdump/nlpid.c stable/11/contrib/tcpdump/nlpid.h stable/11/contrib/tcpdump/oui.c stable/11/contrib/tcpdump/oui.h stable/11/contrib/tcpdump/print-802_11.c stable/11/contrib/tcpdump/print-802_15_4.c stable/11/contrib/tcpdump/print-aodv.c stable/11/contrib/tcpdump/print-arp.c stable/11/contrib/tcpdump/print-atm.c stable/11/contrib/tcpdump/print-beep.c stable/11/contrib/tcpdump/print-bfd.c stable/11/contrib/tcpdump/print-bgp.c stable/11/contrib/tcpdump/print-bootp.c stable/11/contrib/tcpdump/print-cfm.c stable/11/contrib/tcpdump/print-chdlc.c stable/11/contrib/tcpdump/print-cnfp.c stable/11/contrib/tcpdump/print-decnet.c stable/11/contrib/tcpdump/print-dhcp6.c stable/11/contrib/tcpdump/print-domain.c stable/11/contrib/tcpdump/print-eap.c stable/11/contrib/tcpdump/print-eigrp.c stable/11/contrib/tcpdump/print-esp.c stable/11/contrib/tcpdump/print-ether.c stable/11/contrib/tcpdump/print-fr.c stable/11/contrib/tcpdump/print-frag6.c stable/11/contrib/tcpdump/print-gre.c stable/11/contrib/tcpdump/print-hncp.c stable/11/contrib/tcpdump/print-icmp.c stable/11/contrib/tcpdump/print-icmp6.c stable/11/contrib/tcpdump/print-ip.c stable/11/contrib/tcpdump/print-ip6.c stable/11/contrib/tcpdump/print-ip6opts.c stable/11/contrib/tcpdump/print-isakmp.c stable/11/contrib/tcpdump/print-isoclns.c stable/11/contrib/tcpdump/print-juniper.c stable/11/contrib/tcpdump/print-l2tp.c stable/11/contrib/tcpdump/print-ldp.c stable/11/contrib/tcpdump/print-llc.c stable/11/contrib/tcpdump/print-lldp.c stable/11/contrib/tcpdump/print-lmp.c stable/11/contrib/tcpdump/print-lspping.c stable/11/contrib/tcpdump/print-m3ua.c stable/11/contrib/tcpdump/print-mobility.c stable/11/contrib/tcpdump/print-mpcp.c stable/11/contrib/tcpdump/print-mpls.c stable/11/contrib/tcpdump/print-mptcp.c stable/11/contrib/tcpdump/print-nfs.c stable/11/contrib/tcpdump/print-null.c stable/11/contrib/tcpdump/print-olsr.c stable/11/contrib/tcpdump/print-ospf6.c stable/11/contrib/tcpdump/print-pgm.c stable/11/contrib/tcpdump/print-pim.c stable/11/contrib/tcpdump/print-pktap.c stable/11/contrib/tcpdump/print-ppp.c stable/11/contrib/tcpdump/print-radius.c stable/11/contrib/tcpdump/print-resp.c stable/11/contrib/tcpdump/print-ripng.c stable/11/contrib/tcpdump/print-rpki-rtr.c stable/11/contrib/tcpdump/print-rsvp.c stable/11/contrib/tcpdump/print-rt6.c stable/11/contrib/tcpdump/print-rx.c stable/11/contrib/tcpdump/print-sip.c stable/11/contrib/tcpdump/print-sl.c stable/11/contrib/tcpdump/print-slow.c stable/11/contrib/tcpdump/print-stp.c stable/11/contrib/tcpdump/print-syslog.c stable/11/contrib/tcpdump/print-telnet.c stable/11/contrib/tcpdump/print-tftp.c stable/11/contrib/tcpdump/print-vqp.c stable/11/contrib/tcpdump/print-vtp.c stable/11/contrib/tcpdump/print-wb.c stable/11/contrib/tcpdump/print-zephyr.c stable/11/contrib/tcpdump/print.c stable/11/contrib/tcpdump/signature.c stable/11/contrib/tcpdump/signature.h stable/11/contrib/tcpdump/smbutil.c stable/11/contrib/tcpdump/tcpdump.1.in stable/11/contrib/tcpdump/tcpdump.c stable/11/contrib/tcpdump/util-print.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/tcpdump/CHANGES ============================================================================== --- stable/11/contrib/tcpdump/CHANGES Wed Dec 27 03:23:58 2017 (r327233) +++ stable/11/contrib/tcpdump/CHANGES Wed Dec 27 03:24:24 2017 (r327234) @@ -1,10 +1,119 @@ +Sunday September 3, 2017 denis@ovsienko.info + Summary for 4.9.2 tcpdump release + Do not use getprotobynumber() for protocol name resolution. Do not do + any protocol name resolution if -n is specified. + Improve errors detection in the test scripts. + Fix a segfault with OpenSSL 1.1 and improve OpenSSL usage. + Clean up IS-IS printing. + Fix buffer overflow vulnerabilities: + CVE-2017-11543 (SLIP) + CVE-2017-13011 (bittok2str_internal) + Fix infinite loop vulnerabilities: + CVE-2017-12989 (RESP) + CVE-2017-12990 (ISAKMP) + CVE-2017-12995 (DNS) + CVE-2017-12997 (LLDP) + Fix buffer over-read vulnerabilities: + CVE-2017-11541 (safeputs) + CVE-2017-11542 (PIMv1) + CVE-2017-12893 (SMB/CIFS) + CVE-2017-12894 (lookup_bytestring) + CVE-2017-12895 (ICMP) + CVE-2017-12896 (ISAKMP) + CVE-2017-12897 (ISO CLNS) + CVE-2017-12898 (NFS) + CVE-2017-12899 (DECnet) + CVE-2017-12900 (tok2strbuf) + CVE-2017-12901 (EIGRP) + CVE-2017-12902 (Zephyr) + CVE-2017-12985 (IPv6) + CVE-2017-12986 (IPv6 routing headers) + CVE-2017-12987 (IEEE 802.11) + CVE-2017-12988 (telnet) + CVE-2017-12991 (BGP) + CVE-2017-12992 (RIPng) + CVE-2017-12993 (Juniper) + CVE-2017-11542 (PIMv1) + CVE-2017-11541 (safeputs) + CVE-2017-12994 (BGP) + CVE-2017-12996 (PIMv2) + CVE-2017-12998 (ISO IS-IS) + CVE-2017-12999 (ISO IS-IS) + CVE-2017-13000 (IEEE 802.15.4) + CVE-2017-13001 (NFS) + CVE-2017-13002 (AODV) + CVE-2017-13003 (LMP) + CVE-2017-13004 (Juniper) + CVE-2017-13005 (NFS) + CVE-2017-13006 (L2TP) + CVE-2017-13007 (Apple PKTAP) + CVE-2017-13008 (IEEE 802.11) + CVE-2017-13009 (IPv6 mobility) + CVE-2017-13010 (BEEP) + CVE-2017-13012 (ICMP) + CVE-2017-13013 (ARP) + CVE-2017-13014 (White Board) + CVE-2017-13015 (EAP) + CVE-2017-11543 (SLIP) + CVE-2017-13016 (ISO ES-IS) + CVE-2017-13017 (DHCPv6) + CVE-2017-13018 (PGM) + CVE-2017-13019 (PGM) + CVE-2017-13020 (VTP) + CVE-2017-13021 (ICMPv6) + CVE-2017-13022 (IP) + CVE-2017-13023 (IPv6 mobility) + CVE-2017-13024 (IPv6 mobility) + CVE-2017-13025 (IPv6 mobility) + CVE-2017-13026 (ISO IS-IS) + CVE-2017-13027 (LLDP) + CVE-2017-13028 (BOOTP) + CVE-2017-13029 (PPP) + CVE-2017-13030 (PIM) + CVE-2017-13031 (IPv6 fragmentation header) + CVE-2017-13032 (RADIUS) + CVE-2017-13033 (VTP) + CVE-2017-13034 (PGM) + CVE-2017-13035 (ISO IS-IS) + CVE-2017-13036 (OSPFv3) + CVE-2017-13037 (IP) + CVE-2017-13038 (PPP) + CVE-2017-13039 (ISAKMP) + CVE-2017-13040 (MPTCP) + CVE-2017-13041 (ICMPv6) + CVE-2017-13042 (HNCP) + CVE-2017-13043 (BGP) + CVE-2017-13044 (HNCP) + CVE-2017-13045 (VQP) + CVE-2017-13046 (BGP) + CVE-2017-13047 (ISO ES-IS) + CVE-2017-13048 (RSVP) + CVE-2017-13049 (Rx) + CVE-2017-13050 (RPKI-Router) + CVE-2017-13051 (RSVP) + CVE-2017-13052 (CFM) + CVE-2017-13053 (BGP) + CVE-2017-13054 (LLDP) + CVE-2017-13055 (ISO IS-IS) + CVE-2017-13687 (Cisco HDLC) + CVE-2017-13688 (OLSR) + CVE-2017-13689 (IKEv1) + CVE-2017-13690 (IKEv2) + CVE-2017-13725 (IPv6 routing headers) + +Sunday July 23, 2017 denis@ovsienko.info + Summary for 4.9.1 tcpdump release + CVE-2017-11108/Fix bounds checking for STP. + Make assorted documentation updates and fix a few typos in tcpdump output. + Fixup -C for file size >2GB (GH #488). + Show AddressSanitizer presence in version output. + Fix a bug in test scripts (exposed in GH #613). + On FreeBSD adjust Capsicum capabilities for netmap. + On Linux fix a use-after-free when the requested interface does not exist. + Wednesday January 18, 2017 devel.fx.lebail@orange.fr Summary for 4.9.0 tcpdump release General updates: - Improve separation frontend/backend (tcpdump/libnetdissect) - Don't require IPv6 library support in order to support IPv6 addresses - Introduce data types to use for integral values in packet structures - Fix display of timestamps with -tt, -ttt and -ttttt options Fix some heap overflows found with American Fuzzy Lop by Hanno Boeck and others (More information in the log with CVE-2016-* and CVE-2017-*) Change the way protocols print link-layer addresses (Fix heap overflows @@ -35,14 +144,6 @@ Wednesday January 18, 2017 devel.fx.lebail@orange.fr Don't drop CAP_SYS_CHROOT before chrooting Fixes issue where statistics not reported when -G and -W options used - New printers supporting: - Generic Protocol Extension for VXLAN (VXLAN-GPE) - Home Networking Control Protocol (HNCP), RFCs 7787 and 7788 - Locator/Identifier Separation Protocol (LISP), type 3 and type 4 packets - Marvell Extended Distributed Switch Architecture header (MEDSA) - Network Service Header (NSH) - REdis Serialization Protocol (RESP) - Updated printers: 802.11: Beginnings of 11ac radiotap support 802.11: Check the Protected bit for management frames @@ -61,7 +162,6 @@ Wednesday January 18, 2017 devel.fx.lebail@orange.fr ATM: Fix an incorrect bounds check BFD: Update specification from draft to RFC 5880 BFD: Update to print optional authentication field - BGP: Add decoding of ADD-PATH capability BGP: Add support for the AIGP attribute (RFC7311) BGP: Print LARGE_COMMUNITY Path Attribute BGP: Update BGP numbers from IANA; Print minor values for FSM notification @@ -78,7 +178,6 @@ Wednesday January 18, 2017 devel.fx.lebail@orange.fr DTP: Improve packet integrity checks EGP: Fix bounds checks ESP: Don't use OpenSSL_add_all_algorithms() in OpenSSL 1.1.0 or later - ESP: Handle OpenSSL 1.1.x Ethernet: Add some bounds checking before calling isoclns_print (Fix a heap overflow) Ethernet: Print the Length/Type field as length when needed FDDI: Fix -e output for FDDI @@ -87,7 +186,6 @@ Wednesday January 18, 2017 devel.fx.lebail@orange.fr Geneve: Fix error message with invalid option length; Update list option classes HNCP: Fix incorrect time interval format. Fix handling of IPv4 prefixes ICMP6: Fetch a 32-bit big-endian quantity with EXTRACT_32BITS() - ICMP6: dagid is always an IPv6 address, not an opaque 128-bit string IGMP: Add a length check IP: Add a bounds check (Fix a heap overflow) IP: Check before fetching the protocol version (Fix a heap overflow) @@ -115,7 +213,6 @@ Wednesday January 18, 2017 devel.fx.lebail@orange.fr MPLS LSP ping: Update printing for RFC 4379, bug fixes, more bounds checks MPLS: "length" is now the *remaining* packet length MPLS: Add bounds and length checks (Fix a heap overflow) - NFS: Add a test that makes unaligned accesses NFS: Don't assume the ONC RPC header is nicely aligned NFS: Don't overflow the Opaque_Handle buffer (Fix a segmentation fault) NFS: Don't run past the end of an NFSv3 file handle @@ -130,7 +227,6 @@ Wednesday January 18, 2017 devel.fx.lebail@orange.fr PGM: Print the formatted IP address, not the raw binary address, as a string PIM: Add some bounds checking (Fix a heap overflow) PIMv2: Fix checksumming of Register messages - PPI: Pass an adjusted struct pcap_pkthdr to the sub-printer PPP: Add some bounds checks (Fix a heap overflow) PPP: Report invalid PAP AACK/ANAK packets Q.933: Add a missing bounds check @@ -171,16 +267,46 @@ Wednesday January 18, 2017 devel.fx.lebail@orange.fr UDLD: Fix an infinite loop UDP: Add a bounds check (Fix a heap overflow) UDP: Check against the packet length first - UDP: Don't do the DDP-over-UDP heuristic check up front VAT: Add some bounds checks VTP: Add a test on Mgmt Domain Name length VTP: Add bounds checks and filter out non-printable characters VXLAN: Add a bound check and a test case ZeroMQ: Fix an infinite loop -Tuesday April 14, 2015 guy@alum.mit.edu - Summary for 4.8.0 tcpdump release +Tuesday October 25, 2016 mcr@sandelman.ca + Summary for 4.8.1 tcpdump release Fix "-x" for Apple PKTAP and PPI packets + Improve separation frontend/backend (tcpdump/libnetdissect) + Fix display of timestamps with -tt, -ttt and -ttttt options + Add support for the Marvell Extended Distributed Switch Architecture header + Use PRIx64 to print a 64-bit number in hex. + Printer for HNCP (RFCs 7787 and 7788). + dagid is always an IPv6 address, not an opaque 128-bit string, and other fixes to RPL printer. + RSVP: Add bounds and length checks + OSPF: Do more bounds checking + Handle OpenSSL 1.1.x. + Initial support for the REdis Serialization Protocol known as RESP. + Add printing function for Generic Protocol Extension for VXLAN + draft-ietf-nvo3-vxlan-gpe-01 + Network Service Header: draft-ietf-sfc-nsh-01 + Don't recompile the filter if the new file has the same DLT. + Pass an adjusted struct pcap_pkthdr to the sub-printer. + Add three test cases for already fixed CVEs + CVE-2014-8767: OLSR + CVE-2014-8768: Geonet + CVE-2014-8769: AODV + Don't do the DDP-over-UDP heuristic first: GitHub issue #499. + Use the new debugging routines in libpcap. + Harmonize TCP source or destination ports tests with UDP ones + Introduce data types to use for integral values in packet structures. + RSVP: Fix an infinite loop + Support of Type 3 and Type 4 LISP packets. + Don't require IPv6 library support in order to support IPv6 addresses. + Many many changes to support libnetdissect usage. + Add a test that makes unaligned accesses: GitHub issue #478. + add a DNSSEC test case: GH #445 and GH #467. + BGP: add decoding of ADD-PATH capability + fixes to LLC header printing, and RFC948-style IP packets Friday April 10, 2015 guy@alum.mit.edu Summary for 4.7.4 tcpdump release Modified: stable/11/contrib/tcpdump/CONTRIBUTING ============================================================================== --- stable/11/contrib/tcpdump/CONTRIBUTING Wed Dec 27 03:23:58 2017 (r327233) +++ stable/11/contrib/tcpdump/CONTRIBUTING Wed Dec 27 03:24:24 2017 (r327234) @@ -3,6 +3,44 @@ Some Information for Contributors You want to contribute to Tcpdump, Thanks! Please, read these lines. + +How to report bugs and other problems +------------------------------------- +To report a security issue (segfault, buffer overflow, infinite loop, arbitrary +code execution etc) please send an e-mail to security@tcpdump.org, do not use +the bug tracker! + +To report a non-security problem (failure to compile, incorrect output in the +protocol printout, missing support for a particular protocol etc) please check +first that it reproduces with the latest stable release of tcpdump and the latest +stable release of libpcap. If it does, please check that the problem reproduces +with the current git master branch of tcpdump and the current git master branch of +libpcap. If it does (and it is not a security-related problem, otherwise see +above), please navigate to https://github.com/the-tcpdump-group/tcpdump/issues +and check if the problem has already been reported. If it has not, please open +a new issue and provide the following details: + +* tcpdump and libpcap version (tcpdump --version) +* operating system name and version and any other details that may be relevant + (uname -a, compiler name and version, CPU type etc.) +* configure flags if any were used +* statement of the problem +* steps to reproduce + +Please note that if you know exactly how to solve the problem and the solution +would not be too intrusive, it would be best to contribute some development time +and open a pull request instead as discussed below. + +Still not sure how to do? Feel free to [subscribe](http://www.tcpdump.org/#mailing-lists) +to the mailing list tcpdump-workers@lists.tcpdump.org and ask! + + +How to add new code and to update existing code +----------------------------------------------- + +0) Check that there isn't a pull request already opened for the changes you + intend to make. + 1) Fork the Tcpdump repository on GitHub from https://github.com/the-tcpdump-group/tcpdump (See https://help.github.com/articles/fork-a-repo/) @@ -12,8 +50,11 @@ Please, read these lines. on Linux and OSX before sending pull requests. (See http://docs.travis-ci.com/user/getting-started/) -3) Clone your repository +3) Setup your git working copy git clone https://github.com//tcpdump.git + cd tcpdump + git remote add upstream https://github.com/the-tcpdump-group/tcpdump + git fetch upstream 4) Do a 'touch .devel' in your working directory. Currently, the effect is @@ -47,19 +88,26 @@ Please, read these lines. 7) Test with 'make check' Don't send a pull request if 'make check' gives failed tests. -8) Rebase your commits against upstream/master - (To keep linearity) +8) Try to rebase your commits to keep the history simple. + git rebase upstream/master + (If the rebase fails and you cannot resolve, issue "git rebase --abort" + and ask for help in the pull request comment.) -9) Initiate and send a pull request +9) Once 100% happy, put your work into your forked repository. + git push + +10) Initiate and send a pull request (See https://help.github.com/articles/using-pull-requests/) -Some remarks ------------- + +Code style and generic remarks +------------------------------ a) A thorough reading of some other printers code is useful. b) Put the normative reference if any as comments (RFC, etc.). -c) Put the format of packets/headers/options as comments. +c) Put the format of packets/headers/options as comments if there is no + published normative reference. d) The printer may receive incomplete packet in the buffer, truncated at any random position, for example by capturing with '-s size' option. Modified: stable/11/contrib/tcpdump/CREDITS ============================================================================== --- stable/11/contrib/tcpdump/CREDITS Wed Dec 27 03:23:58 2017 (r327233) +++ stable/11/contrib/tcpdump/CREDITS Wed Dec 27 03:24:24 2017 (r327234) @@ -5,7 +5,7 @@ The current maintainers: Denis Ovsienko Fulvio Risso Guy Harris - Hannes Gredler + Hannes Gredler Michael Richardson Francois-Xavier Le Bail @@ -39,6 +39,7 @@ Additional people who have contributed patches: Bjoern A. Zeeb Bram Brent L. Bates + Brian Carpenter Brian Ginsbach Bruce M. Simpson Carles Kishimoto Bisbe @@ -54,6 +55,7 @@ Additional people who have contributed patches: Craig Rodrigues Crist J. Clark Daniel Hagerty + Daniel Lee Darren Reed David Binderman David Horn @@ -85,6 +87,7 @@ Additional people who have contributed patches: Greg Stark Hank Leininger Hannes Viertel + Hanno Böck Harry Raaymakers Heinz-Ado Arnolds Hendrik Scholz @@ -111,6 +114,7 @@ Additional people who have contributed patches: Juliusz Chroboczek Kaarthik Sivakumar Kaladhar Musunuru + Kamil Frankowicz Karl Norby Kazushi Sugyo Kelly Carmichael @@ -123,7 +127,6 @@ Additional people who have contributed patches: Larry Lile Lennert Buytenhek Loganaden Velvindron - Daniel Lee Loris Degioanni Love Hörnquist-Åstrand Lucas C. Villa Real @@ -166,6 +169,7 @@ Additional people who have contributed patches: Paolo Abeni Pascal Hennequin Pasvorn Boonmark + Patrik Lundquist Paul Ferrell Paul Mundt Paul S. Traina Modified: stable/11/contrib/tcpdump/INSTALL.txt ============================================================================== --- stable/11/contrib/tcpdump/INSTALL.txt Wed Dec 27 03:23:58 2017 (r327233) +++ stable/11/contrib/tcpdump/INSTALL.txt Wed Dec 27 03:24:24 2017 (r327234) @@ -37,6 +37,7 @@ Please see "PLATFORMS" for notes about tested platform FILES ----- CHANGES - description of differences between releases +CONTRIBUTING - guidelines for contributing CREDITS - people that have helped tcpdump along INSTALL.txt - this file LICENSE - the license under which tcpdump is distributed Modified: stable/11/contrib/tcpdump/Makefile.in ============================================================================== --- stable/11/contrib/tcpdump/Makefile.in Wed Dec 27 03:23:58 2017 (r327233) +++ stable/11/contrib/tcpdump/Makefile.in Wed Dec 27 03:24:24 2017 (r327234) @@ -263,6 +263,7 @@ HDR = \ ether.h \ ethertype.h \ extract.h \ + funcattrs.h \ getopt_long.h \ gmpls.h \ gmt2local.h \ Modified: stable/11/contrib/tcpdump/PLATFORMS ============================================================================== --- stable/11/contrib/tcpdump/PLATFORMS Wed Dec 27 03:23:58 2017 (r327233) +++ stable/11/contrib/tcpdump/PLATFORMS Wed Dec 27 03:24:24 2017 (r327234) @@ -1,9 +1,16 @@ -== Tested platforms == -NetBSD 5.1/i386 (mcr - 2012/4/1) -Debian Linux (squeeze/i386) (mcr - 2012/4/1) +In many operating systems tcpdump is available as a native package or port, +which simplifies installation of updates and long-term maintenance. However, +the native packages are sometimes a few versions behind and to try a more +recent snapshot it will take to compile tcpdump from the source code. ---- -RedHat Linux 6.1/i386 (assar) -FreeBSD 2.2.8/i386 (itojun) +tcpdump compiles and works on at least the following platforms: - +* AIX +* FreeBSD +* HP-UX 11i +* Linux (any) with glibc (usually just works) +* Linux (any) with musl libc (sometimes fails to compile, please report any bugs) +* Mac OS X / macOS +* NetBSD +* OpenWrt +* Solaris Modified: stable/11/contrib/tcpdump/README.md ============================================================================== --- stable/11/contrib/tcpdump/README.md Wed Dec 27 03:23:58 2017 (r327233) +++ stable/11/contrib/tcpdump/README.md Wed Dec 27 03:24:24 2017 (r327234) @@ -3,25 +3,21 @@ [![Build Status](https://travis-ci.org/the-tcpdump-group/tcpdump.png)](https://travis-ci.org/the-tcpdump-group/tcpdump) -TCPDUMP 4.x.y -Now maintained by "The Tcpdump Group" -See www.tcpdump.org +To report a security issue please send an e-mail to security@tcpdump.org. -Please send inquiries/comments/reports to: +To report bugs and other problems, contribute patches, request a +feature, provide generic feedback etc please see the file +CONTRIBUTING in the tcpdump source tree root. -* tcpdump-workers@lists.tcpdump.org +TCPDUMP 4.x.y +Now maintained by "The Tcpdump Group" +See www.tcpdump.org Anonymous Git is available via: git clone git://bpf.tcpdump.org/tcpdump -Please submit patches by forking the branch on GitHub at: - -* http://github.com/the-tcpdump-group/tcpdump/tree/master - -and issuing a pull request. - -formerly from Lawrence Berkeley National Laboratory +formerly from Lawrence Berkeley National Laboratory Network Research Group ftp://ftp.ee.lbl.gov/old/tcpdump.tar.Z (3.4) @@ -70,20 +66,6 @@ Another tool that tcpdump users might find useful is t It is a program that can be used to extract portions of tcpdump binary trace files. See the above distribution for further details and documentation. - -Problems, bugs, questions, desirable enhancements, etc. should be sent -to the address "tcpdump-workers@lists.tcpdump.org". Bugs, support -requests, and feature requests may also be submitted on the GitHub issue -tracker for tcpdump at: - -* https://github.com/the-tcpdump-group/tcpdump/issues - -Source code contributions, etc. should be sent to the email address -above or submitted by forking the branch on GitHub at: - -* http://github.com/the-tcpdump-group/tcpdump/tree/master - -and issuing a pull request. Current versions can be found at www.tcpdump.org. Modified: stable/11/contrib/tcpdump/VERSION ============================================================================== --- stable/11/contrib/tcpdump/VERSION Wed Dec 27 03:23:58 2017 (r327233) +++ stable/11/contrib/tcpdump/VERSION Wed Dec 27 03:24:24 2017 (r327234) @@ -1 +1 @@ -4.9.0 +4.9.2 Modified: stable/11/contrib/tcpdump/addrtoname.c ============================================================================== --- stable/11/contrib/tcpdump/addrtoname.c Wed Dec 27 03:23:58 2017 (r327233) +++ stable/11/contrib/tcpdump/addrtoname.c Wed Dec 27 03:24:24 2017 (r327234) @@ -150,14 +150,24 @@ struct enamemem { u_short e_addr2; const char *e_name; u_char *e_nsap; /* used only for nsaptable[] */ -#define e_bs e_nsap /* for bytestringtable */ struct enamemem *e_nxt; }; static struct enamemem enametable[HASHNAMESIZE]; static struct enamemem nsaptable[HASHNAMESIZE]; -static struct enamemem bytestringtable[HASHNAMESIZE]; +struct bsnamemem { + u_short bs_addr0; + u_short bs_addr1; + u_short bs_addr2; + const char *bs_name; + u_char *bs_bytes; + unsigned int bs_nbytes; + struct bsnamemem *bs_nxt; +}; + +static struct bsnamemem bytestringtable[HASHNAMESIZE]; + struct protoidmem { uint32_t p_oui; u_short p_proto; @@ -342,7 +352,7 @@ getname6(netdissect_options *ndo, const u_char *ap) return (p->name); } -static const char hex[] = "0123456789abcdef"; +static const char hex[16] = "0123456789abcdef"; /* Find the hash node that corresponds the ether address 'ep' */ @@ -380,11 +390,11 @@ lookup_emem(netdissect_options *ndo, const u_char *ep) * with length 'nlen' */ -static inline struct enamemem * +static inline struct bsnamemem * lookup_bytestring(netdissect_options *ndo, register const u_char *bs, const unsigned int nlen) { - struct enamemem *tp; + struct bsnamemem *tp; register u_int i, j, k; if (nlen >= 6) { @@ -399,26 +409,28 @@ lookup_bytestring(netdissect_options *ndo, register co i = j = k = 0; tp = &bytestringtable[(i ^ j) & (HASHNAMESIZE-1)]; - while (tp->e_nxt) - if (tp->e_addr0 == i && - tp->e_addr1 == j && - tp->e_addr2 == k && - memcmp((const char *)bs, (const char *)(tp->e_bs), nlen) == 0) + while (tp->bs_nxt) + if (nlen == tp->bs_nbytes && + tp->bs_addr0 == i && + tp->bs_addr1 == j && + tp->bs_addr2 == k && + memcmp((const char *)bs, (const char *)(tp->bs_bytes), nlen) == 0) return tp; else - tp = tp->e_nxt; + tp = tp->bs_nxt; - tp->e_addr0 = i; - tp->e_addr1 = j; - tp->e_addr2 = k; + tp->bs_addr0 = i; + tp->bs_addr1 = j; + tp->bs_addr2 = k; - tp->e_bs = (u_char *) calloc(1, nlen + 1); - if (tp->e_bs == NULL) + tp->bs_bytes = (u_char *) calloc(1, nlen); + if (tp->bs_bytes == NULL) (*ndo->ndo_error)(ndo, "lookup_bytestring: calloc"); - memcpy(tp->e_bs, bs, nlen); - tp->e_nxt = (struct enamemem *)calloc(1, sizeof(*tp)); - if (tp->e_nxt == NULL) + memcpy(tp->bs_bytes, bs, nlen); + tp->bs_nbytes = nlen; + tp->bs_nxt = (struct bsnamemem *)calloc(1, sizeof(*tp)); + if (tp->bs_nxt == NULL) (*ndo->ndo_error)(ndo, "lookup_bytestring: calloc"); return tp; @@ -445,11 +457,11 @@ lookup_nsap(netdissect_options *ndo, register const u_ tp = &nsaptable[(i ^ j) & (HASHNAMESIZE-1)]; while (tp->e_nxt) - if (tp->e_addr0 == i && + if (nsap_length == tp->e_nsap[0] && + tp->e_addr0 == i && tp->e_addr1 == j && tp->e_addr2 == k && - tp->e_nsap[0] == nsap_length && - memcmp((const char *)&(nsap[1]), + memcmp((const char *)nsap, (char *)&(tp->e_nsap[1]), nsap_length) == 0) return tp; else @@ -549,12 +561,12 @@ le64addr_string(netdissect_options *ndo, const u_char const unsigned int len = 8; register u_int i; register char *cp; - register struct enamemem *tp; + register struct bsnamemem *tp; char buf[BUFSIZE]; tp = lookup_bytestring(ndo, ep, len); - if (tp->e_name) - return (tp->e_name); + if (tp->bs_name) + return (tp->bs_name); cp = buf; for (i = len; i > 0 ; --i) { @@ -566,11 +578,11 @@ le64addr_string(netdissect_options *ndo, const u_char *cp = '\0'; - tp->e_name = strdup(buf); - if (tp->e_name == NULL) + tp->bs_name = strdup(buf); + if (tp->bs_name == NULL) (*ndo->ndo_error)(ndo, "le64addr_string: strdup(buf)"); - return (tp->e_name); + return (tp->bs_name); } const char * @@ -579,7 +591,7 @@ linkaddr_string(netdissect_options *ndo, const u_char { register u_int i; register char *cp; - register struct enamemem *tp; + register struct bsnamemem *tp; if (len == 0) return (""); @@ -591,11 +603,11 @@ linkaddr_string(netdissect_options *ndo, const u_char return (q922_string(ndo, ep, len)); tp = lookup_bytestring(ndo, ep, len); - if (tp->e_name) - return (tp->e_name); + if (tp->bs_name) + return (tp->bs_name); - tp->e_name = cp = (char *)malloc(len*3); - if (tp->e_name == NULL) + tp->bs_name = cp = (char *)malloc(len*3); + if (tp->bs_name == NULL) (*ndo->ndo_error)(ndo, "linkaddr_string: malloc"); *cp++ = hex[*ep >> 4]; *cp++ = hex[*ep++ & 0xf]; @@ -605,7 +617,7 @@ linkaddr_string(netdissect_options *ndo, const u_char *cp++ = hex[*ep++ & 0xf]; } *cp = '\0'; - return (tp->e_name); + return (tp->bs_name); } const char * Modified: stable/11/contrib/tcpdump/addrtoname.h ============================================================================== --- stable/11/contrib/tcpdump/addrtoname.h Wed Dec 27 03:23:58 2017 (r327233) +++ stable/11/contrib/tcpdump/addrtoname.h Wed Dec 27 03:24:24 2017 (r327234) @@ -33,7 +33,8 @@ enum { LINKADDR_ETHER, LINKADDR_FRELAY, LINKADDR_IEEE1394, - LINKADDR_ATM + LINKADDR_ATM, + LINKADDR_OTHER }; #define BUFSIZE 128 Modified: stable/11/contrib/tcpdump/addrtostr.c ============================================================================== --- stable/11/contrib/tcpdump/addrtostr.c Wed Dec 27 03:23:58 2017 (r327233) +++ stable/11/contrib/tcpdump/addrtostr.c Wed Dec 27 03:24:24 2017 (r327234) @@ -110,25 +110,24 @@ addrtostr6 (const void *src, char *dst, size_t size) size_t space_left, added_space; int snprintfed; struct { - long base; - long len; + int base; + int len; } best, cur; - u_long words [IN6ADDRSZ / INT16SZ]; + uint16_t words [IN6ADDRSZ / INT16SZ]; int i; /* Preprocess: * Copy the input (bytewise) array into a wordwise array. * Find the longest run of 0x00's in src[] for :: shorthanding. */ - memset (words, 0, sizeof(words)); - for (i = 0; i < IN6ADDRSZ; i++) - words[i/2] |= (srcaddr[i] << ((1 - (i % 2)) << 3)); + for (i = 0; i < (IN6ADDRSZ / INT16SZ); i++) + words[i] = (srcaddr[2*i] << 8) | srcaddr[2*i + 1]; best.len = 0; best.base = -1; cur.len = 0; cur.base = -1; - for (i = 0; i < (IN6ADDRSZ / INT16SZ); i++) + for (i = 0; i < (int)(IN6ADDRSZ / INT16SZ); i++) { if (words[i] == 0) { @@ -161,7 +160,7 @@ addrtostr6 (const void *src, char *dst, size_t size) *dp++ = c; \ space_left--; \ } - for (i = 0; i < (IN6ADDRSZ / INT16SZ); i++) + for (i = 0; i < (int)(IN6ADDRSZ / INT16SZ); i++) { /* Are we inside the best run of 0x00's? */ @@ -192,7 +191,7 @@ addrtostr6 (const void *src, char *dst, size_t size) space_left -= added_space; break; } - snprintfed = snprintf (dp, space_left, "%lx", words[i]); + snprintfed = snprintf (dp, space_left, "%x", words[i]); if (snprintfed < 0) return (NULL); if ((size_t) snprintfed >= space_left) Modified: stable/11/contrib/tcpdump/af.c ============================================================================== --- stable/11/contrib/tcpdump/af.c Wed Dec 27 03:23:58 2017 (r327233) +++ stable/11/contrib/tcpdump/af.c Wed Dec 27 03:24:24 2017 (r327234) @@ -12,7 +12,7 @@ * LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE. * - * Original code by Hannes Gredler (hannes@juniper.net) + * Original code by Hannes Gredler (hannes@gredler.at) */ #ifdef HAVE_CONFIG_H Modified: stable/11/contrib/tcpdump/af.h ============================================================================== --- stable/11/contrib/tcpdump/af.h Wed Dec 27 03:23:58 2017 (r327233) +++ stable/11/contrib/tcpdump/af.h Wed Dec 27 03:24:24 2017 (r327234) @@ -12,7 +12,7 @@ * LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE. * - * Original code by Hannes Gredler (hannes@juniper.net) + * Original code by Hannes Gredler (hannes@gredler.at) */ extern const struct tok af_values[]; Modified: stable/11/contrib/tcpdump/checksum.c ============================================================================== --- stable/11/contrib/tcpdump/checksum.c Wed Dec 27 03:23:58 2017 (r327233) +++ stable/11/contrib/tcpdump/checksum.c Wed Dec 27 03:24:24 2017 (r327234) @@ -14,7 +14,7 @@ * * miscellaneous checksumming routines * - * Original code by Hannes Gredler (hannes@juniper.net) + * Original code by Hannes Gredler (hannes@gredler.at) */ #ifdef HAVE_CONFIG_H Modified: stable/11/contrib/tcpdump/config.h.in ============================================================================== --- stable/11/contrib/tcpdump/config.h.in Wed Dec 27 03:23:58 2017 (r327233) +++ stable/11/contrib/tcpdump/config.h.in Wed Dec 27 03:24:24 2017 (r327234) @@ -34,6 +34,9 @@ /* Define to 1 if you have the `ether_ntohost' function. */ #undef HAVE_ETHER_NTOHOST +/* Define to 1 if you have the `EVP_CipherInit_ex' function. */ +#undef HAVE_EVP_CIPHERINIT_EX + /* Define to 1 if you have the `EVP_CIPHER_CTX_new' function. */ #undef HAVE_EVP_CIPHER_CTX_NEW Modified: stable/11/contrib/tcpdump/configure ============================================================================== --- stable/11/contrib/tcpdump/configure Wed Dec 27 03:23:58 2017 (r327233) +++ stable/11/contrib/tcpdump/configure Wed Dec 27 03:24:24 2017 (r327234) @@ -5801,7 +5801,7 @@ if test "x$ac_cv_func_pcap_loop" = xyes; then : else - as_fn_error $? "Report this to tcpdump-workers@lists.tcpdump.org, and include the + as_fn_error $? "This is a bug, please follow the guidelines in CONTRIBUTING and include the config.log file in your report. If you have downloaded libpcap from tcpdump.org, and built it yourself, please also include the config.log file from the libpcap source directory, the Makefile from the libpcap @@ -8116,17 +8116,32 @@ fi done # - # OK, do we have EVP_CIPHER_CTX_new? + # OK, then: + # + # 1) do we have EVP_CIPHER_CTX_new? # If so, we use it to allocate an # EVP_CIPHER_CTX, as EVP_CIPHER_CTX may be # opaque; otherwise, we allocate it ourselves. # - for ac_func in EVP_CIPHER_CTX_new + # 2) do we have EVP_CipherInit_ex()? + # If so, we use it, because we need to be + # able to make two "initialize the cipher" + # calls, one with the cipher and key, and + # one with the IV, and, as of OpenSSL 1.1, + # You Can't Do That with EVP_CipherInit(), + # because a call to EVP_CipherInit() will + # unconditionally clear the context, and + # if you don't supply a cipher, it'll + # clear the cipher, rendering the context + # unusable and causing a crash. + # + for ac_func in EVP_CIPHER_CTX_new EVP_CipherInit_ex do : - ac_fn_c_check_func "$LINENO" "EVP_CIPHER_CTX_new" "ac_cv_func_EVP_CIPHER_CTX_new" -if test "x$ac_cv_func_EVP_CIPHER_CTX_new" = xyes; then : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF -#define HAVE_EVP_CIPHER_CTX_NEW 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi Modified: stable/11/contrib/tcpdump/configure.in ============================================================================== --- stable/11/contrib/tcpdump/configure.in Wed Dec 27 03:23:58 2017 (r327233) +++ stable/11/contrib/tcpdump/configure.in Wed Dec 27 03:24:24 2017 (r327234) @@ -935,12 +935,26 @@ if test "$want_libcrypto" != "no"; then if test "$ac_cv_lib_crypto_DES_cbc_encrypt" = "yes"; then AC_CHECK_HEADERS(openssl/evp.h) # - # OK, do we have EVP_CIPHER_CTX_new? + # OK, then: + # + # 1) do we have EVP_CIPHER_CTX_new? # If so, we use it to allocate an # EVP_CIPHER_CTX, as EVP_CIPHER_CTX may be # opaque; otherwise, we allocate it ourselves. # - AC_CHECK_FUNCS(EVP_CIPHER_CTX_new) + # 2) do we have EVP_CipherInit_ex()? + # If so, we use it, because we need to be + # able to make two "initialize the cipher" + # calls, one with the cipher and key, and + # one with the IV, and, as of OpenSSL 1.1, + # You Can't Do That with EVP_CipherInit(), + # because a call to EVP_CipherInit() will + # unconditionally clear the context, and + # if you don't supply a cipher, it'll + # clear the cipher, rendering the context + # unusable and causing a crash. + # + AC_CHECK_FUNCS(EVP_CIPHER_CTX_new EVP_CipherInit_ex) fi ]) fi Modified: stable/11/contrib/tcpdump/extract.h ============================================================================== --- stable/11/contrib/tcpdump/extract.h Wed Dec 27 03:23:58 2017 (r327233) +++ stable/11/contrib/tcpdump/extract.h Wed Dec 27 03:24:24 2017 (r327234) @@ -20,8 +20,48 @@ */ /* - * Macros to extract possibly-unaligned big-endian integral values. + * For 8-bit values; provided for the sake of completeness. Byte order + * isn't relevant, and alignment isn't an issue. */ +#define EXTRACT_8BITS(p) (*(p)) +#define EXTRACT_LE_8BITS(p) (*(p)) + +/* + * Inline functions or macros to extract possibly-unaligned big-endian + * integral values. + */ +#include "funcattrs.h" + +/* + * If we have versions of GCC or Clang that support an __attribute__ + * to say "if we're building with unsigned behavior sanitization, + * don't complain about undefined behavior in this function", we + * label these functions with that attribute - we *know* it's undefined + * in the C standard, but we *also* know it does what we want with + * the ISA we're targeting and the compiler we're using. + * + * For GCC 4.9.0 and later, we use __attribute__((no_sanitize_undefined)); + * pre-5.0 GCC doesn't have __has_attribute, and I'm not sure whether + * GCC or Clang first had __attribute__((no_sanitize(XXX)). + * + * For Clang, we check for __attribute__((no_sanitize(XXX)) with + * __has_attribute, as there are versions of Clang that support + * __attribute__((no_sanitize("undefined")) but don't support + * __attribute__((no_sanitize_undefined)). + * + * We define this here, rather than in funcattrs.h, because we + * only want it used here, we don't want it to be broadly used. + * (Any printer will get this defined, but this should at least + * make it harder for people to find.) + */ +#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 409) +#define UNALIGNED_OK __attribute__((no_sanitize_undefined)) +#elif __has_attribute(no_sanitize) +#define UNALIGNED_OK __attribute__((no_sanitize("undefined"))) +#else +#define UNALIGNED_OK +#endif + #ifdef LBL_ALIGN /* * The processor doesn't natively handle unaligned loads. @@ -31,7 +71,7 @@ defined(__mips) || defined(__mips__)) /* - * This is a GCC-compatible compiler and we have __attribute__, which +* This is a GCC-compatible compiler and we have __attribute__, which * we assume that mean we have __attribute__((packed)), and this is * MIPS or Alpha, which has instructions that can help when doing * unaligned loads. @@ -88,19 +128,19 @@ typedef struct { uint32_t val; } __attribute__((packed)) unaligned_uint32_t; -static inline uint16_t +UNALIGNED_OK static inline uint16_t EXTRACT_16BITS(const void *p) { return ((uint16_t)ntohs(((const unaligned_uint16_t *)(p))->val)); } -static inline uint32_t +UNALIGNED_OK static inline uint32_t EXTRACT_32BITS(const void *p) { return ((uint32_t)ntohl(((const unaligned_uint32_t *)(p))->val)); } -static inline uint64_t +UNALIGNED_OK static inline uint64_t EXTRACT_64BITS(const void *p) { return ((uint64_t)(((uint64_t)ntohl(((const unaligned_uint32_t *)(p) + 0)->val)) << 32 | @@ -138,19 +178,19 @@ EXTRACT_64BITS(const void *p) * The processor natively handles unaligned loads, so we can just * cast the pointer and fetch through it. */ -static inline uint16_t +static inline uint16_t UNALIGNED_OK EXTRACT_16BITS(const void *p) { return ((uint16_t)ntohs(*(const uint16_t *)(p))); } -static inline uint32_t +static inline uint32_t UNALIGNED_OK EXTRACT_32BITS(const void *p) { return ((uint32_t)ntohl(*(const uint32_t *)(p))); } -static inline uint64_t +static inline uint64_t UNALIGNED_OK EXTRACT_64BITS(const void *p) { return ((uint64_t)(((uint64_t)ntohl(*((const uint32_t *)(p) + 0))) << 32 | @@ -193,7 +233,6 @@ EXTRACT_64BITS(const void *p) * Macros to extract possibly-unaligned little-endian integral values. * XXX - do loads on little-endian machines that support unaligned loads? */ -#define EXTRACT_LE_8BITS(p) (*(p)) #define EXTRACT_LE_16BITS(p) \ ((uint16_t)(((uint16_t)(*((const uint8_t *)(p) + 1)) << 8) | \ ((uint16_t)(*((const uint8_t *)(p) + 0)) << 0))) @@ -242,3 +281,6 @@ EXTRACT_64BITS(const void *p) #define ND_TTEST_64BITS(p) ND_TTEST2(*(p), 8) #define ND_TCHECK_64BITS(p) ND_TCHECK2(*(p), 8) + +#define ND_TTEST_128BITS(p) ND_TTEST2(*(p), 16) +#define ND_TCHECK_128BITS(p) ND_TCHECK2(*(p), 16) Copied: stable/11/contrib/tcpdump/funcattrs.h (from r326613, head/contrib/tcpdump/funcattrs.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/contrib/tcpdump/funcattrs.h Wed Dec 27 03:24:24 2017 (r327234, copy of r326613, head/contrib/tcpdump/funcattrs.h) @@ -0,0 +1,122 @@ +/* -*- Mode: c; tab-width: 8; indent-tabs-mode: 1; c-basic-offset: 8; -*- */ +/* + * Copyright (c) 1993, 1994, 1995, 1996, 1997 + * The Regents of the University of California. 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. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the Computer Systems + * Engineering Group at Lawrence Berkeley Laboratory. + * 4. Neither the name of the University nor of the Laboratory may be used + * to endorse or promote products derived from this software without + * specific prior written permission. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Dec 27 05:59:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3BC67EA563C; Wed, 27 Dec 2017 05:59:49 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0635E78F8C; Wed, 27 Dec 2017 05:59:48 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBR5xlYV020715; Wed, 27 Dec 2017 05:59:47 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBR5xlBH020714; Wed, 27 Dec 2017 05:59:47 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201712270559.vBR5xlBH020714@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 27 Dec 2017 05:59:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327235 - head/usr.bin/mail X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/usr.bin/mail X-SVN-Commit-Revision: 327235 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Dec 2017 05:59:49 -0000 Author: delphij Date: Wed Dec 27 05:59:47 2017 New Revision: 327235 URL: https://svnweb.freebsd.org/changeset/base/327235 Log: Don't initialize lastlong before assigning it. MFC after: 2 weeks Modified: head/usr.bin/mail/collect.c Modified: head/usr.bin/mail/collect.c ============================================================================== --- head/usr.bin/mail/collect.c Wed Dec 27 03:24:24 2017 (r327234) +++ head/usr.bin/mail/collect.c Wed Dec 27 05:59:47 2017 (r327235) @@ -133,7 +133,6 @@ collect(struct header *hp, int printheaders) escape = ESCAPE; eofcount = 0; hadintr = 0; - lastlong = 0; longline = 0; if (!setjmp(colljmp)) { From owner-svn-src-all@freebsd.org Wed Dec 27 06:23:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51103EA65F4; Wed, 27 Dec 2017 06:23:52 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 287E279AE3; Wed, 27 Dec 2017 06:23:52 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBR6Npf4032994; Wed, 27 Dec 2017 06:23:51 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBR6NoRX032990; Wed, 27 Dec 2017 06:23:50 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201712270623.vBR6NoRX032990@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 27 Dec 2017 06:23:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327236 - in head: etc/mail libexec/dma/dmagent share/man/man5 usr.bin/mail X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in head: etc/mail libexec/dma/dmagent share/man/man5 usr.bin/mail X-SVN-Commit-Revision: 327236 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Dec 2017 06:23:52 -0000 Author: delphij Date: Wed Dec 27 06:23:50 2017 New Revision: 327236 URL: https://svnweb.freebsd.org/changeset/base/327236 Log: Replace send-mail with the more standarized sendmail, we do not create links for send-mail in mailwrapper so it did not work anyway. MFC after: 2 weeks Modified: head/etc/mail/mailer.conf head/libexec/dma/dmagent/mailer.conf head/share/man/man5/mailer.conf.5 head/usr.bin/mail/names.c Modified: head/etc/mail/mailer.conf ============================================================================== --- head/etc/mail/mailer.conf Wed Dec 27 05:59:47 2017 (r327235) +++ head/etc/mail/mailer.conf Wed Dec 27 06:23:50 2017 (r327236) @@ -3,7 +3,6 @@ # Execute the "real" sendmail program, named /usr/libexec/sendmail/sendmail # sendmail /usr/libexec/sendmail/sendmail -send-mail /usr/libexec/sendmail/sendmail mailq /usr/libexec/sendmail/sendmail newaliases /usr/libexec/sendmail/sendmail hoststat /usr/libexec/sendmail/sendmail Modified: head/libexec/dma/dmagent/mailer.conf ============================================================================== --- head/libexec/dma/dmagent/mailer.conf Wed Dec 27 05:59:47 2017 (r327235) +++ head/libexec/dma/dmagent/mailer.conf Wed Dec 27 06:23:50 2017 (r327236) @@ -1,5 +1,4 @@ # $FreeBSD$ sendmail /usr/libexec/dma -send-mail /usr/libexec/dma mailq /usr/libexec/dma Modified: head/share/man/man5/mailer.conf.5 ============================================================================== --- head/share/man/man5/mailer.conf.5 Wed Dec 27 05:59:47 2017 (r327235) +++ head/share/man/man5/mailer.conf.5 Wed Dec 27 06:23:50 2017 (r327236) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 18, 2016 +.Dd December 26, 2017 .Dt MAILER.CONF 5 .Os .Sh NAME @@ -96,7 +96,6 @@ program: # Execute the "real" sendmail program located in # /usr/libexec/sendmail/sendmail sendmail /usr/libexec/sendmail/sendmail -send-mail /usr/libexec/sendmail/sendmail mailq /usr/libexec/sendmail/sendmail newaliases /usr/libexec/sendmail/sendmail .Ed @@ -109,7 +108,6 @@ to replace .Bd -literal -offset indent # Emulate sendmail using postfix sendmail /usr/local/sbin/sendmail -send-mail /usr/local/sbin/sendmail mailq /usr/local/sbin/sendmail newaliases /usr/local/sbin/sendmail .Ed @@ -122,7 +120,6 @@ to replace .Bd -literal -offset indent # Emulate sendmail using exim sendmail /usr/local/sbin/exim -send-mail /usr/local/sbin/exim mailq /usr/local/sbin/exim -bp newaliases /usr/bin/true rmail /usr/local/sbin/exim -i -oee @@ -136,7 +133,6 @@ to replace .Bd -literal -offset indent # Send outgoing mail to a smart relay using mini_sendmail sendmail /usr/local/bin/mini_sendmail -srelayhost -send-mail /usr/local/bin/mini_sendmail -srelayhost .Ed .Pp Using @@ -146,7 +142,6 @@ to replace .Bd -literal -offset indent # Execute dma instead of sendmail sendmail /usr/libexec/dma -send-mail /usr/libexec/dma mailq /usr/libexec/dma newaliases /usr/libexec/dma rmail /usr/libexec/dma Modified: head/usr.bin/mail/names.c ============================================================================== --- head/usr.bin/mail/names.c Wed Dec 27 05:59:47 2017 (r327235) +++ head/usr.bin/mail/names.c Wed Dec 27 06:23:50 2017 (r327236) @@ -575,7 +575,7 @@ unpack(struct name *np) extra++; top = (char **)salloc((t + extra) * sizeof(*top)); ap = top; - *ap++ = "send-mail"; + *ap++ = "sendmail"; *ap++ = "-i"; if (metoo) *ap++ = "-m"; From owner-svn-src-all@freebsd.org Wed Dec 27 14:50:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D61CDE92B1F; Wed, 27 Dec 2017 14:50:08 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9BC82682BA; Wed, 27 Dec 2017 14:50:08 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBREo75M042906; Wed, 27 Dec 2017 14:50:07 GMT (envelope-from ume@FreeBSD.org) Received: (from ume@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBREo7vM042905; Wed, 27 Dec 2017 14:50:07 GMT (envelope-from ume@FreeBSD.org) Message-Id: <201712271450.vBREo7vM042905@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ume set sender to ume@FreeBSD.org using -f From: Hajimu UMEMOTO Date: Wed, 27 Dec 2017 14:50:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r327238 - in stable: 10/lib/libc/net 11/lib/libc/net X-SVN-Group: stable-10 X-SVN-Commit-Author: ume X-SVN-Commit-Paths: in stable: 10/lib/libc/net 11/lib/libc/net X-SVN-Commit-Revision: 327238 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Dec 2017 14:50:09 -0000 Author: ume Date: Wed Dec 27 14:50:07 2017 New Revision: 327238 URL: https://svnweb.freebsd.org/changeset/base/327238 Log: MFC r327029: Don't ignore trailing spaces after numerical IP addresses. PR: 224403 Modified: stable/10/lib/libc/net/getaddrinfo.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/lib/libc/net/getaddrinfo.c Directory Properties: stable/11/ (props changed) Modified: stable/10/lib/libc/net/getaddrinfo.c ============================================================================== --- stable/10/lib/libc/net/getaddrinfo.c Wed Dec 27 09:25:45 2017 (r327237) +++ stable/10/lib/libc/net/getaddrinfo.c Wed Dec 27 14:50:07 2017 (r327238) @@ -1243,7 +1243,8 @@ explore_numeric(const struct addrinfo *pai, const char * does not accept. So we need to separate the case for * AF_INET. */ - if (inet_aton(hostname, (struct in_addr *)pton) != 1) + if (inet_aton(hostname, (struct in_addr *)pton) != 1 || + hostname[strspn(hostname, "0123456789.xabcdefXABCDEF")] != '\0') return 0; break; default: From owner-svn-src-all@freebsd.org Wed Dec 27 14:50:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4282BE92B28; Wed, 27 Dec 2017 14:50:09 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 09BCF682BC; Wed, 27 Dec 2017 14:50:08 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBREo7Yu042913; Wed, 27 Dec 2017 14:50:07 GMT (envelope-from ume@FreeBSD.org) Received: (from ume@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBREo7rY042912; Wed, 27 Dec 2017 14:50:07 GMT (envelope-from ume@FreeBSD.org) Message-Id: <201712271450.vBREo7rY042912@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ume set sender to ume@FreeBSD.org using -f From: Hajimu UMEMOTO Date: Wed, 27 Dec 2017 14:50:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r327238 - in stable: 10/lib/libc/net 11/lib/libc/net X-SVN-Group: stable-11 X-SVN-Commit-Author: ume X-SVN-Commit-Paths: in stable: 10/lib/libc/net 11/lib/libc/net X-SVN-Commit-Revision: 327238 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Dec 2017 14:50:09 -0000 Author: ume Date: Wed Dec 27 14:50:07 2017 New Revision: 327238 URL: https://svnweb.freebsd.org/changeset/base/327238 Log: MFC r327029: Don't ignore trailing spaces after numerical IP addresses. PR: 224403 Modified: stable/11/lib/libc/net/getaddrinfo.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/lib/libc/net/getaddrinfo.c Directory Properties: stable/10/ (props changed) Modified: stable/11/lib/libc/net/getaddrinfo.c ============================================================================== --- stable/11/lib/libc/net/getaddrinfo.c Wed Dec 27 09:25:45 2017 (r327237) +++ stable/11/lib/libc/net/getaddrinfo.c Wed Dec 27 14:50:07 2017 (r327238) @@ -1275,7 +1275,8 @@ explore_numeric(const struct addrinfo *pai, const char * does not accept. So we need to separate the case for * AF_INET. */ - if (inet_aton(hostname, (struct in_addr *)pton) != 1) + if (inet_aton(hostname, (struct in_addr *)pton) != 1 || + hostname[strspn(hostname, "0123456789.xabcdefXABCDEF")] != '\0') return 0; p = pton; break; From owner-svn-src-all@freebsd.org Wed Dec 27 15:39:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C6C2E96868; Wed, 27 Dec 2017 15:39:32 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 087F16A11D; Wed, 27 Dec 2017 15:39:31 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBRFdVjc064180; Wed, 27 Dec 2017 15:39:31 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBRFdVKu064179; Wed, 27 Dec 2017 15:39:31 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201712271539.vBRFdVKu064179@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 27 Dec 2017 15:39:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327239 - head/sys/cam/ctl X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/cam/ctl X-SVN-Commit-Revision: 327239 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Dec 2017 15:39:32 -0000 Author: manu Date: Wed Dec 27 15:39:31 2017 New Revision: 327239 URL: https://svnweb.freebsd.org/changeset/base/327239 Log: ctl: Correct comment in ctl_worker_thread The incoming queue is handled before the RtR one. No functional change. MFC after: 3 days Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Wed Dec 27 14:50:07 2017 (r327238) +++ head/sys/cam/ctl/ctl.c Wed Dec 27 15:39:31 2017 (r327239) @@ -13352,8 +13352,8 @@ ctl_work_thread(void *arg) * We handle the queues in this order: * - ISC * - done queue (to free up resources, unblock other commands) - * - RtR queue * - incoming queue + * - RtR queue * * If those queues are empty, we break out of the loop and * go to sleep. From owner-svn-src-all@freebsd.org Wed Dec 27 18:22:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17F1EEA582B; Wed, 27 Dec 2017 18:22:04 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D3F3C70542; Wed, 27 Dec 2017 18:22:03 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBRIM2Lp034928; Wed, 27 Dec 2017 18:22:02 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBRIM2og034927; Wed, 27 Dec 2017 18:22:02 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201712271822.vBRIM2og034927@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 27 Dec 2017 18:22:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327240 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 327240 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Dec 2017 18:22:04 -0000 Author: kevans Date: Wed Dec 27 18:22:02 2017 New Revision: 327240 URL: https://svnweb.freebsd.org/changeset/base/327240 Log: if_awg: Respect rgmii-*id PHY configurations phy-mode can be one of: rgmii, rgmii-id, rgmii-txid, rgmii-rxid; as this was written, any of these alternate -id configurations would break as we fail to configure syscon for rgmii. Instead, simply check that phy-mode is configured for rgmii and we'll let the PHY driver handle any internal delay configuration. The pine64 should eventually specify phy-mode = "rgmii-txid" to address gigabit issues when rx delay is configured, motivating this change. Modified: head/sys/arm/allwinner/if_awg.c Modified: head/sys/arm/allwinner/if_awg.c ============================================================================== --- head/sys/arm/allwinner/if_awg.c Wed Dec 27 15:39:31 2017 (r327239) +++ head/sys/arm/allwinner/if_awg.c Wed Dec 27 18:22:02 2017 (r327240) @@ -1177,7 +1177,7 @@ awg_setup_phy(device_t dev) if (sc->res[_RES_SYSCON] != NULL) { reg = bus_read_4(sc->res[_RES_SYSCON], 0); reg &= ~(EMAC_CLK_PIT | EMAC_CLK_SRC | EMAC_CLK_RMII_EN); - if (strcmp(phy_type, "rgmii") == 0) + if (strncmp(phy_type, "rgmii", 5) == 0) reg |= EMAC_CLK_PIT_RGMII | EMAC_CLK_SRC_RGMII; else if (strcmp(phy_type, "rmii") == 0) reg |= EMAC_CLK_RMII_EN; @@ -1217,7 +1217,7 @@ awg_setup_phy(device_t dev) device_printf(dev, "EMAC clock: 0x%08x\n", reg); bus_write_4(sc->res[_RES_SYSCON], 0, reg); } else { - if (strcmp(phy_type, "rgmii") == 0) + if (strncmp(phy_type, "rgmii", 5) == 0) tx_parent_name = "emac_int_tx"; else tx_parent_name = "mii_phy_tx"; From owner-svn-src-all@freebsd.org Wed Dec 27 18:30:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DBBDEEA5CB8; Wed, 27 Dec 2017 18:30:25 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B578E70846; Wed, 27 Dec 2017 18:30:25 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBRIUO4p036152; Wed, 27 Dec 2017 18:30:24 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBRIUOFM036151; Wed, 27 Dec 2017 18:30:24 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712271830.vBRIUOFM036151@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 27 Dec 2017 18:30:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327241 - head/usr.sbin/devmatch X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.sbin/devmatch X-SVN-Commit-Revision: 327241 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Dec 2017 18:30:26 -0000 Author: imp Date: Wed Dec 27 18:30:24 2017 New Revision: 327241 URL: https://svnweb.freebsd.org/changeset/base/327241 Log: Fix a bunch of issues (and a few non-issues but appeasement is easier than arguing) Coverity found: o Use open + fstat rather than stat + open to avoid any races for a file that's static for the life of the system. This will prevent any problems should someone insert a new device while installing a kernel in the future. o Use strlcpy instead of strcpy as a failsafe to knowing that the strings can't possibly be larger than the buffer due to data source limits (though in the future these limits might be more dynamic). o If we can't find the hints file, return rather than dereference a NULL pointer. o Check for lastmod before calling strcmp in case a PNP entry comes before a module entry. That's not allowed, but within the realm of crazy things programmers do. o Free lastmod before exiting search_hints() to avoid a leak. CID: 1383971, 1383970, 1383969, 1383965, 1383963, 1383960 Modified: head/usr.sbin/devmatch/devmatch.c Modified: head/usr.sbin/devmatch/devmatch.c ============================================================================== --- head/usr.sbin/devmatch/devmatch.c Wed Dec 27 18:22:02 2017 (r327240) +++ head/usr.sbin/devmatch/devmatch.c Wed Dec 27 18:30:24 2017 (r327241) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -78,14 +79,17 @@ read_linker_hints(void) p = modpath; while ((q = strsep(&p, ";")) != NULL) { snprintf(fn, sizeof(fn), "%s/linker.hints", q); - if (stat(fn, &sb) != 0) - continue; + fd = open(fn, O_RDONLY); + if (fd < 0) { + if (errno == ENOENT) + continue; + err(1, "Can't open %s for reading", fn); + } + if (fstat(fd, &sb) != 0) + err(1, "Can't fstat %s\n", fn); hints = malloc(sb.st_size); if (hints == NULL) err(1, "not enough space to read hints file of %ju bytes", (uintmax_t)sb.st_size); - fd = open(fn, O_RDONLY); - if (fd < 0) - err(1, "Can't open %s for reading", fn); if (read(fd, hints, sb.st_size) != sb.st_size) err(1, "Can't read in %ju bytes from %s", (uintmax_t)sb.st_size, fn); close(fd); @@ -95,6 +99,7 @@ read_linker_hints(void) warnx("Can't read linker hints file."); free(hints); hints = NULL; + return; } if (*(int *)(intptr_t)hints != LINKER_HINTS_VERSION) { warnx("Linker hints version %d doesn't match expected %d.", @@ -144,12 +149,12 @@ pnpval_as_int(const char *val, const char *pnpinfo) cp = strchr(val, ';'); key[0] = ' '; if (cp == NULL) - strcpy(key + 1, val); + strlcpy(key + 1, val, sizeof(key) - 1); else { memcpy(key + 1, val, cp - val); key[cp - val + 1] = '\0'; } - strcat(key, "="); + strlcat(key, "=", sizeof(key)); if (strncmp(key + 1, pnpinfo, strlen(key + 1)) == 0) rv = strtol(pnpinfo + strlen(key + 1), NULL, 0); else { @@ -241,7 +246,7 @@ search_hints(const char *bus, const char *dev, const c printf("Module %s in %s\n", val1, val2); break; case MDT_PNP_INFO: - if (!dump_flag && !unbound_flag && strcmp(lastmod, "kernel") == 0) + if (!dump_flag && !unbound_flag && lastmod && strcmp(lastmod, "kernel") == 0) break; getstr(&ptr, val1); getstr(&ptr, val2); @@ -343,6 +348,7 @@ search_hints(const char *bus, const char *dev, const c printf(" -------------------------"); printf("\n"); } + free(lastmod); } static int From owner-svn-src-all@freebsd.org Wed Dec 27 19:12:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16FEBEA7706; Wed, 27 Dec 2017 19:12:34 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D86CA71DB1; Wed, 27 Dec 2017 19:12:33 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBRJCWx1056609; Wed, 27 Dec 2017 19:12:32 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBRJCW1G056608; Wed, 27 Dec 2017 19:12:32 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201712271912.vBRJCW1G056608@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Wed, 27 Dec 2017 19:12:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327242 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 327242 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Dec 2017 19:12:34 -0000 Author: shurd Date: Wed Dec 27 19:12:32 2017 New Revision: 327242 URL: https://svnweb.freebsd.org/changeset/base/327242 Log: Fix indentation. Sponsored by: Limelight Networks Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Wed Dec 27 18:30:24 2017 (r327241) +++ head/sys/net/iflib.c Wed Dec 27 19:12:32 2017 (r327242) @@ -2635,7 +2635,7 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) if ((m->m_pkthdr.csum_flags & (CSUM_L4_CALC|CSUM_L4_VALID)) == (CSUM_L4_CALC|CSUM_L4_VALID)) { if (lro_possible && tcp_lro_rx(&rxq->ifr_lc, m, 0) == 0) - continue; + continue; } } #endif From owner-svn-src-all@freebsd.org Wed Dec 27 19:13:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0356EA7841; Wed, 27 Dec 2017 19:13:51 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BD2E871F2D; Wed, 27 Dec 2017 19:13:51 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBRJDoJV056706; Wed, 27 Dec 2017 19:13:50 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBRJDol2056702; Wed, 27 Dec 2017 19:13:50 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201712271913.vBRJDol2056702@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 27 Dec 2017 19:13:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327243 - in head/sys/ufs: ffs ufs X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: in head/sys/ufs: ffs ufs X-SVN-Commit-Revision: 327243 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Dec 2017 19:13:52 -0000 Author: pfg Date: Wed Dec 27 19:13:50 2017 New Revision: 327243 URL: https://svnweb.freebsd.org/changeset/base/327243 Log: SPDX: Complete License ID tags for UFS. Modified: head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ffs/ffs_balloc.c head/sys/ufs/ffs/ffs_vnops.c head/sys/ufs/ufs/dinode.h Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Wed Dec 27 19:12:32 2017 (r327242) +++ head/sys/ufs/ffs/ffs_alloc.c Wed Dec 27 19:13:50 2017 (r327243) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-3-Clause + * SPDX-License-Identifier: (BSD-2-Clause-FreeBSD AND BSD-3-Clause) * * Copyright (c) 2002 Networks Associates Technology, Inc. * All rights reserved. Modified: head/sys/ufs/ffs/ffs_balloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_balloc.c Wed Dec 27 19:12:32 2017 (r327242) +++ head/sys/ufs/ffs/ffs_balloc.c Wed Dec 27 19:13:50 2017 (r327243) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-3-Clause + * SPDX-License-Identifier: (BSD-2-Clause-FreeBSD AND BSD-3-Clause) * * Copyright (c) 2002 Networks Associates Technology, Inc. * All rights reserved. Modified: head/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vnops.c Wed Dec 27 19:12:32 2017 (r327242) +++ head/sys/ufs/ffs/ffs_vnops.c Wed Dec 27 19:13:50 2017 (r327243) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-3-Clause + * SPDX-License-Identifier: (BSD-2-Clause-FreeBSD AND BSD-3-Clause) * * Copyright (c) 2002, 2003 Networks Associates Technology, Inc. * All rights reserved. Modified: head/sys/ufs/ufs/dinode.h ============================================================================== --- head/sys/ufs/ufs/dinode.h Wed Dec 27 19:12:32 2017 (r327242) +++ head/sys/ufs/ufs/dinode.h Wed Dec 27 19:13:50 2017 (r327243) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: (BSD-2-Clause-FreeBSD AND BSD-3-Clause) * * Copyright (c) 2002 Networks Associates Technology, Inc. * All rights reserved. From owner-svn-src-all@freebsd.org Wed Dec 27 19:14:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 923D2EA78C6; Wed, 27 Dec 2017 19:14:16 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5FA1572071; Wed, 27 Dec 2017 19:14:16 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBRJEFnx056770; Wed, 27 Dec 2017 19:14:15 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBRJEFnt056769; Wed, 27 Dec 2017 19:14:15 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201712271914.vBRJEFnt056769@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Wed, 27 Dec 2017 19:14:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327244 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 327244 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Dec 2017 19:14:16 -0000 Author: shurd Date: Wed Dec 27 19:14:15 2017 New Revision: 327244 URL: https://svnweb.freebsd.org/changeset/base/327244 Log: Remove assertion that's not true for !EARLY_AP_STARTUP gtask->gt_taskqueue is NULL when EARLY_AP_STARTUP is not enabled. Remove assertion to allow this config to work. Reported by: oleg Sponsored by: Limelight Networks Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Wed Dec 27 19:13:50 2017 (r327243) +++ head/sys/net/iflib.c Wed Dec 27 19:14:15 2017 (r327244) @@ -5174,7 +5174,6 @@ iflib_irq_set_affinity(if_ctx_t ctx, int irq, iflib_in if (cpuid > ctx->ifc_cpuid_highest) ctx->ifc_cpuid_highest = cpuid; #endif - MPASS(gtask->gt_taskqueue != NULL); return 0; } From owner-svn-src-all@freebsd.org Wed Dec 27 19:40:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04D17EA8AC2; Wed, 27 Dec 2017 19:40:05 +0000 (UTC) (envelope-from shurd@sasktel.net) Received: from mail34c7.megamailservers.com (mail34c7.megamailservers.com [69.49.98.143]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FCC872E0B; Wed, 27 Dec 2017 19:40:04 +0000 (UTC) (envelope-from shurd@sasktel.net) Received: from mail34c7.megamailservers.com (localhost [127.0.0.1]) by mail34c7.megamailservers.com (8.14.9/8.13.1) with ESMTP id vBRJF1aH026936 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 27 Dec 2017 14:15:01 -0500 Received: (from webmail@localhost) by mail34c7.megamailservers.com (8.14.9/8.12.2/Submit) id vBRJF1fv026935; Wed, 27 Dec 2017 14:15:01 -0500 Received: from 96-92-42-173-static.hfc.comcastbusiness.net (96-92-42-173-static.hfc.comcastbusiness.net [96.92.42.173]) by webmail.sasktel.net (Webmail 5.0 V.V.I.) with HTTP for ; Wed, 27 Dec 2017 13:15:01 -0600 Message-ID: <20171227131501.091kr68834s4wcgc@webmail.sasktel.net> From: shurd@sasktel.net Reply-to: shurd@sasktel.net To: Stephen Hurd , Oleg Bulyzhin Cc: Oleg Bulyzhin , Stephen Hurd , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Sean Bruno , erj@freebsd.org Subject: Re: svn commit: r327013 - head/sys/net Date: Wed, 27 Dec 2017 13:15:01 -0600 X-Priority: 3 X-Authenticated-User: shurd.sasktel.net References: <201712200103.vBK13YgS025896@repo.freebsd.org> <20171222115825.GA69149@lath.RINET.ru> <16beab6b-3252-1f84-33f4-f9fc49f158a2@FreeBSD.org> <20171222225840.GA78272@lath.RINET.ru> <20171223105706.GA86594@lath.RINET.ru> <98940f9d-cbe6-8c98-054d-6069832080d4@sasktel.net> <20171224094329.GA7580@lath.RINET.ru> In-Reply-To: <20171224094329.GA7580@lath.RINET.ru> MIME-Version: 1.0 User-Agent: Webmail 6.0 X-CTCH-RefID: str=0001.0A020205.5A43F135.0087, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.2 cv=JoeBlIwC c=1 sm=1 tr=0 a=WkljmVdYkabdwxfqvArNOQ==:117 a=sKQkgkx3tBUQ55hxqPYCBw==:17 a=v2NWgMxlncYA:10 a=ikZSrtty1KYA:10 a=ocR9PWop10UA:10 a=G-JvYgQUlsIBVzUhMCsA:9 a=76o55tVMl3Ngey11ZYsA:9 a=QEXdDO2ut3YA:10 a=6I5d2MoRAAAA:8 a=yKcmgUoRqjSua8HKyQgA:9 a=_W_S_7VecoQA:10 a=IjZwj45LgO3ly-622nXo:22 X-WHL: LR Content-Type: text/plain; charset=UTF-8; format="flowed" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Content-Description: Plaintext Version of Message X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Dec 2017 19:40:05 -0000 On Sun, 24 Dec 2017 12:43:29 +0300, Oleg Bulyzhin wrote: On Sat, Dec 23, 2017 at 11:13:37PM -0500, Stephen Hurd wrote: > Hrm, can you try it with: > options EARLY_AP_STARTUP > > In slave-amd64-smp-debug? yes, it does boot now: =C2=A0 Should be fixed for !EARLY_AP_STARTUP as of r327244.=C2=A0 Thanks for the r= eport. From owner-svn-src-all@freebsd.org Wed Dec 27 20:09:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE2DFEAA6BA; Wed, 27 Dec 2017 20:09:51 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9600B75E2B; Wed, 27 Dec 2017 20:09:51 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBRK9ovf082735; Wed, 27 Dec 2017 20:09:50 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBRK9oPg082732; Wed, 27 Dec 2017 20:09:50 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201712272009.vBRK9oPg082732@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 27 Dec 2017 20:09:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327245 - head/sbin/ccdconfig X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sbin/ccdconfig X-SVN-Commit-Revision: 327245 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Dec 2017 20:09:51 -0000 Author: pfg Date: Wed Dec 27 20:09:50 2017 New Revision: 327245 URL: https://svnweb.freebsd.org/changeset/base/327245 Log: ccdconfig: Update licensing terms. The code originate in NetBSD and there are the copyright notes have been assigned to the NetBSD Foundation. Update the files up to the point where we started diverging. Further relaxation of the licensing terms are possible after we check the NetBSD updates, and contact the local authors. In the case of ccdconfig.8 this reinstates the 3rd clause but since the code is not directly from Berkeley, the change was bogus. Obtained from: NetBSD Modified: head/sbin/ccdconfig/ccdconfig.8 head/sbin/ccdconfig/ccdconfig.c head/sbin/ccdconfig/pathnames.h Modified: head/sbin/ccdconfig/ccdconfig.8 ============================================================================== --- head/sbin/ccdconfig/ccdconfig.8 Wed Dec 27 19:14:15 2017 (r327244) +++ head/sbin/ccdconfig/ccdconfig.8 Wed Dec 27 20:09:50 2017 (r327245) @@ -1,8 +1,11 @@ -.\" $NetBSD: ccdconfig.8,v 1.1.2.1 1995/11/11 02:43:33 thorpej Exp $ +.\" $NetBSD: ccdconfig.8,v 1.4 1996/02/28 01:01:17 thorpej Exp $ .\" -.\" Copyright (c) 1995 Jason R. Thorpe. +.\" Copyright (c) 1996 The NetBSD Foundation, Inc. .\" All rights reserved. .\" +.\" This code is derived from software contributed to The NetBSD Foundation +.\" by Jason R. Thorpe. +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -11,8 +14,13 @@ .\" 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. -.\" 4. The name of the author may not be used to endorse or promote products -.\" derived from this software without specific prior written permission. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the NetBSD +.\" Foundation, Inc. and its contributors. +.\" 4. Neither the name of The NetBSD Foundation nor the names of its +.\" contributors may be used to endorse or promote products derived +.\" from this software without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES Modified: head/sbin/ccdconfig/ccdconfig.c ============================================================================== --- head/sbin/ccdconfig/ccdconfig.c Wed Dec 27 19:14:15 2017 (r327244) +++ head/sbin/ccdconfig/ccdconfig.c Wed Dec 27 20:09:50 2017 (r327245) @@ -1,10 +1,15 @@ +/* $NetBSD: ccdconfig.c,v 1.6 1996/05/16 07:11:18 thorpej Exp $ */ + /*- * SPDX-License-Identifier: BSD-4-Clause * * Copyright (c) 2003 Poul-Henning Kamp - * Copyright (c) 1995 Jason R. Thorpe. + * Copyright (c) 1996 The NetBSD Foundation, Inc. * All rights reserved. * + * This code is derived from software contributed to The NetBSD Foundation + * by Jason R. Thorpe. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -15,22 +20,23 @@ * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: - * This product includes software developed for the NetBSD Project - * by Jason R. Thorpe. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE 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. + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. */ #include Modified: head/sbin/ccdconfig/pathnames.h ============================================================================== --- head/sbin/ccdconfig/pathnames.h Wed Dec 27 19:14:15 2017 (r327244) +++ head/sbin/ccdconfig/pathnames.h Wed Dec 27 20:09:50 2017 (r327245) @@ -1,11 +1,14 @@ -/* $NetBSD: pathnames.h,v 1.1 1995/08/17 16:37:20 thorpej Exp $ */ +/* $NetBSD: pathnames.h,v 1.4 2008/04/28 20:23:07 martin Exp $ */ /*- - * SPDX-License-Identifier: BSD-4-Clause + * SPDX-License-Identifier: BSD-2-Clause-NetBSD * - * Copyright (c) 1995 Jason R. Thorpe. + * Copyright (c) 1996 The NetBSD Foundation, Inc. * All rights reserved. * + * This code is derived from software contributed to The NetBSD Foundation + * by Jason R. Thorpe. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -14,24 +17,18 @@ * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed for the NetBSD Project - * by Jason R. Thorpe. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. * - * 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. + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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-all@freebsd.org Wed Dec 27 20:33:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE734EABA3D; Wed, 27 Dec 2017 20:33:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B60476D54; Wed, 27 Dec 2017 20:33:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBRKXbfj095095; Wed, 27 Dec 2017 20:33:37 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBRKXbcK095094; Wed, 27 Dec 2017 20:33:37 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712272033.vBRKXbcK095094@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 27 Dec 2017 20:33:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327246 - head/usr.sbin/devmatch X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.sbin/devmatch X-SVN-Commit-Revision: 327246 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Dec 2017 20:33:38 -0000 Author: imp Date: Wed Dec 27 20:33:37 2017 New Revision: 327246 URL: https://svnweb.freebsd.org/changeset/base/327246 Log: Use strl* here too. CID: 1383969 Modified: head/usr.sbin/devmatch/devmatch.c Modified: head/usr.sbin/devmatch/devmatch.c ============================================================================== --- head/usr.sbin/devmatch/devmatch.c Wed Dec 27 20:09:50 2017 (r327245) +++ head/usr.sbin/devmatch/devmatch.c Wed Dec 27 20:33:37 2017 (r327246) @@ -195,12 +195,12 @@ pnpval_as_str(const char *val, const char *pnpinfo) cp = strchr(val, ';'); key[0] = ' '; if (cp == NULL) - strcpy(key + 1, val); + strlcpy(key + 1, val, sizeof(key) - 1); else { memcpy(key + 1, val, cp - val); key[cp - val + 1] = '\0'; } - strcat(key, "="); + strlcat(key, "=", sizeof(key)); if (strncmp(key + 1, pnpinfo, strlen(key + 1)) == 0) quoted_strcpy(retval, pnpinfo + strlen(key + 1)); else { From owner-svn-src-all@freebsd.org Wed Dec 27 20:42:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AACB7EAC125; Wed, 27 Dec 2017 20:42:31 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78372774AA; Wed, 27 Dec 2017 20:42:31 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBRKgUAZ099530; Wed, 27 Dec 2017 20:42:30 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBRKgUUj099529; Wed, 27 Dec 2017 20:42:30 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201712272042.vBRKgUUj099529@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Wed, 27 Dec 2017 20:42:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327247 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 327247 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Dec 2017 20:42:31 -0000 Author: shurd Date: Wed Dec 27 20:42:30 2017 New Revision: 327247 URL: https://svnweb.freebsd.org/changeset/base/327247 Log: Don't pass rids to taskqgroup_attach() As everywhere else, we want to pass rman_get_start(irq->ii_res). This caused set affinity errors when not using MSI-X vectors (legacy and MSI interrupts). Reported by: sbruno Sponsored by: Limelight Networks Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Wed Dec 27 20:33:37 2017 (r327246) +++ head/sys/net/iflib.c Wed Dec 27 20:42:30 2017 (r327247) @@ -5347,10 +5347,10 @@ iflib_legacy_setup(if_ctx_t ctx, driver_filter_t filte if ((err = _iflib_irq_alloc(ctx, irq, tqrid, iflib_fast_intr_ctx, NULL, info, name)) != 0) return (err); GROUPTASK_INIT(gtask, 0, fn, q); - taskqgroup_attach(tqg, gtask, q, tqrid, name); + taskqgroup_attach(tqg, gtask, q, rman_get_start(irq->ii_res), name); GROUPTASK_INIT(&txq->ift_task, 0, _task_fn_tx, txq); - taskqgroup_attach(qgroup_if_io_tqg, &txq->ift_task, txq, tqrid, "tx"); + taskqgroup_attach(qgroup_if_io_tqg, &txq->ift_task, txq, rman_get_start(irq->ii_res), "tx"); return (0); } From owner-svn-src-all@freebsd.org Wed Dec 27 21:21:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A1C4EADBE8; Wed, 27 Dec 2017 21:21:04 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 569F278B7E; Wed, 27 Dec 2017 21:21:04 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBRLL32J014549; Wed, 27 Dec 2017 21:21:03 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBRLL3Vc014547; Wed, 27 Dec 2017 21:21:03 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201712272121.vBRLL3Vc014547@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 27 Dec 2017 21:21:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327248 - in head/lib/libc: locale mips X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: in head/lib/libc: locale mips X-SVN-Commit-Revision: 327248 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Dec 2017 21:21:04 -0000 Author: pfg Date: Wed Dec 27 21:21:03 2017 New Revision: 327248 URL: https://svnweb.freebsd.org/changeset/base/327248 Log: SPDX: Fix some License ID tags for libc. Modified: head/lib/libc/locale/euc.c head/lib/libc/mips/SYS.h Modified: head/lib/libc/locale/euc.c ============================================================================== --- head/lib/libc/locale/euc.c Wed Dec 27 20:42:30 2017 (r327247) +++ head/lib/libc/locale/euc.c Wed Dec 27 21:21:03 2017 (r327248) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-4-Clause + * SPDX-License-Identifier: BSD-3-Clause * * Copyright 2013 Garrett D'Amore * Copyright 2011 Nexenta Systems, Inc. All rights reserved. Modified: head/lib/libc/mips/SYS.h ============================================================================== --- head/lib/libc/mips/SYS.h Wed Dec 27 20:42:30 2017 (r327247) +++ head/lib/libc/mips/SYS.h Wed Dec 27 21:21:03 2017 (r327248) @@ -2,7 +2,7 @@ /* $FreeBSD$ */ /*- - * SPDX-License-Identifier: BSD-4-Clause + * SPDX-License-Identifier: (BSD-4-Clause AND BSD-3-Clause) * * Copyright (c) 1996 Jonathan Stone * All rights reserved. From owner-svn-src-all@freebsd.org Wed Dec 27 21:36:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD9CAEAE5FF; Wed, 27 Dec 2017 21:36:38 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B1BE793F1; Wed, 27 Dec 2017 21:36:38 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBRLab7Z021018; Wed, 27 Dec 2017 21:36:37 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBRLabN3021017; Wed, 27 Dec 2017 21:36:37 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201712272136.vBRLabN3021017@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 27 Dec 2017 21:36:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327249 - head/lib/libcam X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/lib/libcam X-SVN-Commit-Revision: 327249 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Dec 2017 21:36:38 -0000 Author: pfg Date: Wed Dec 27 21:36:37 2017 New Revision: 327249 URL: https://svnweb.freebsd.org/changeset/base/327249 Log: SPDX: Small for a license ID tags. Use parenthesis for grouping as suggested by the spec. Modified: head/lib/libcam/camlib.h Modified: head/lib/libcam/camlib.h ============================================================================== --- head/lib/libcam/camlib.h Wed Dec 27 21:21:03 2017 (r327248) +++ head/lib/libcam/camlib.h Wed Dec 27 21:36:37 2017 (r327249) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-4-Clause AND BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: (BSD-2-Clause-FreeBSD AND BSD-4-Clause) * * Copyright (c) 1997, 1998 Kenneth D. Merry. * All rights reserved. From owner-svn-src-all@freebsd.org Wed Dec 27 21:40:00 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60F1CEAE7DD; Wed, 27 Dec 2017 21:40:00 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 374FC795BE; Wed, 27 Dec 2017 21:40:00 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBRLdxoU021196; Wed, 27 Dec 2017 21:39:59 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBRLdvis021177; Wed, 27 Dec 2017 21:39:57 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201712272139.vBRLdvis021177@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 27 Dec 2017 21:39:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327250 - in head/sys: arm/allwinner arm/altera/socfpga arm/amlogic/aml8726 arm/annapurna/alpine arm/broadcom/bcm2835 arm/freescale/imx arm/freescale/vybrid arm/lpc arm/mv arm/nvidia/te... X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: arm/allwinner arm/altera/socfpga arm/amlogic/aml8726 arm/annapurna/alpine arm/broadcom/bcm2835 arm/freescale/imx arm/freescale/vybrid arm/lpc arm/mv arm/nvidia/tegra124 arm/qemu arm/ralin... X-SVN-Commit-Revision: 327250 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Dec 2017 21:40:00 -0000 Author: manu Date: Wed Dec 27 21:39:57 2017 New Revision: 327250 URL: https://svnweb.freebsd.org/changeset/base/327250 Log: arm: Add kern/kern_clocksource.c to files.arm Instead of adding it to every files.vendor, add it to the common arch file. Modified: head/sys/arm/allwinner/files.allwinner head/sys/arm/altera/socfpga/files.socfpga head/sys/arm/amlogic/aml8726/files.aml8726 head/sys/arm/annapurna/alpine/files.alpine head/sys/arm/broadcom/bcm2835/files.bcm283x head/sys/arm/freescale/imx/files.imx5 head/sys/arm/freescale/imx/files.imx6 head/sys/arm/freescale/vybrid/files.vybrid head/sys/arm/lpc/files.lpc head/sys/arm/mv/files.mv head/sys/arm/nvidia/tegra124/files.tegra124 head/sys/arm/qemu/files.qemu head/sys/arm/ralink/files.ralink head/sys/arm/rockchip/files.rk30xx head/sys/arm/samsung/exynos/files.exynos5 head/sys/arm/ti/files.ti head/sys/arm/versatile/files.versatile head/sys/arm/xilinx/files.zynq7 head/sys/conf/files.arm Modified: head/sys/arm/allwinner/files.allwinner ============================================================================== --- head/sys/arm/allwinner/files.allwinner Wed Dec 27 21:36:37 2017 (r327249) +++ head/sys/arm/allwinner/files.allwinner Wed Dec 27 21:39:57 2017 (r327250) @@ -1,5 +1,4 @@ # $FreeBSD$ -kern/kern_clocksource.c standard arm/allwinner/a10_ahci.c optional ahci arm/allwinner/a10_codec.c optional sound Modified: head/sys/arm/altera/socfpga/files.socfpga ============================================================================== --- head/sys/arm/altera/socfpga/files.socfpga Wed Dec 27 21:36:37 2017 (r327249) +++ head/sys/arm/altera/socfpga/files.socfpga Wed Dec 27 21:39:57 2017 (r327250) @@ -1,7 +1,5 @@ # $FreeBSD$ -kern/kern_clocksource.c standard - arm/altera/socfpga/socfpga_common.c standard arm/altera/socfpga/socfpga_machdep.c standard arm/altera/socfpga/socfpga_manager.c standard Modified: head/sys/arm/amlogic/aml8726/files.aml8726 ============================================================================== --- head/sys/arm/amlogic/aml8726/files.aml8726 Wed Dec 27 21:36:37 2017 (r327249) +++ head/sys/arm/amlogic/aml8726/files.aml8726 Wed Dec 27 21:39:57 2017 (r327250) @@ -1,7 +1,5 @@ #$FreeBSD$ -kern/kern_clocksource.c standard - arm/amlogic/aml8726/aml8726_l2cache.c standard arm/amlogic/aml8726/aml8726_machdep.c standard Modified: head/sys/arm/annapurna/alpine/files.alpine ============================================================================== --- head/sys/arm/annapurna/alpine/files.alpine Wed Dec 27 21:36:37 2017 (r327249) +++ head/sys/arm/annapurna/alpine/files.alpine Wed Dec 27 21:39:57 2017 (r327250) @@ -1,7 +1,5 @@ # $FreeBSD$ -kern/kern_clocksource.c standard - arm/versatile/sp804.c standard dev/uart/uart_dev_ns8250.c optional uart Modified: head/sys/arm/broadcom/bcm2835/files.bcm283x ============================================================================== --- head/sys/arm/broadcom/bcm2835/files.bcm283x Wed Dec 27 21:36:37 2017 (r327249) +++ head/sys/arm/broadcom/bcm2835/files.bcm283x Wed Dec 27 21:39:57 2017 (r327250) @@ -17,8 +17,6 @@ arm/broadcom/bcm2835/bcm2835_vcio.c standard arm/broadcom/bcm2835/bcm2835_wdog.c standard arm/broadcom/bcm2835/bcm283x_dwc_fdt.c optional dwcotg fdt -kern/kern_clocksource.c standard - dev/mbox/mbox_if.m standard arm/broadcom/bcm2835/bcm2835_audio.c optional sound vchiq \ Modified: head/sys/arm/freescale/imx/files.imx5 ============================================================================== --- head/sys/arm/freescale/imx/files.imx5 Wed Dec 27 21:36:37 2017 (r327249) +++ head/sys/arm/freescale/imx/files.imx5 Wed Dec 27 21:39:57 2017 (r327250) @@ -1,5 +1,4 @@ # $FreeBSD$ -kern/kern_clocksource.c standard # Init arm/freescale/imx/imx_common.c standard Modified: head/sys/arm/freescale/imx/files.imx6 ============================================================================== --- head/sys/arm/freescale/imx/files.imx6 Wed Dec 27 21:36:37 2017 (r327249) +++ head/sys/arm/freescale/imx/files.imx6 Wed Dec 27 21:39:57 2017 (r327250) @@ -1,11 +1,6 @@ # $FreeBSD$ # -# Standard ARM support. -# -kern/kern_clocksource.c standard - -# # Standard imx6 devices and support. # arm/freescale/fsl_ocotp.c standard Modified: head/sys/arm/freescale/vybrid/files.vybrid ============================================================================== --- head/sys/arm/freescale/vybrid/files.vybrid Wed Dec 27 21:36:37 2017 (r327249) +++ head/sys/arm/freescale/vybrid/files.vybrid Wed Dec 27 21:39:57 2017 (r327250) @@ -1,7 +1,5 @@ # $FreeBSD$ -kern/kern_clocksource.c standard - arm/freescale/vybrid/vf_machdep.c standard arm/freescale/vybrid/vf_ccm.c standard arm/freescale/vybrid/vf_anadig.c standard Modified: head/sys/arm/lpc/files.lpc ============================================================================== --- head/sys/arm/lpc/files.lpc Wed Dec 27 21:36:37 2017 (r327249) +++ head/sys/arm/lpc/files.lpc Wed Dec 27 21:39:57 2017 (r327250) @@ -13,4 +13,3 @@ arm/lpc/lpc_spi.c optional lpcspi arm/lpc/lpc_dmac.c optional dmac arm/lpc/ssd1289.c optional ssd1289 dev/uart/uart_dev_lpc.c optional uart -kern/kern_clocksource.c standard Modified: head/sys/arm/mv/files.mv ============================================================================== --- head/sys/arm/mv/files.mv Wed Dec 27 21:36:37 2017 (r327249) +++ head/sys/arm/mv/files.mv Wed Dec 27 21:39:57 2017 (r327250) @@ -33,5 +33,3 @@ dev/uart/uart_dev_snps.c optional uart dev/usb/controller/ehci_mv.c optional ehci dev/usb/controller/xhci_mv.c optional xhci dev/ahci/ahci_mv_fdt.c optional ahci - -kern/kern_clocksource.c standard Modified: head/sys/arm/nvidia/tegra124/files.tegra124 ============================================================================== --- head/sys/arm/nvidia/tegra124/files.tegra124 Wed Dec 27 21:36:37 2017 (r327249) +++ head/sys/arm/nvidia/tegra124/files.tegra124 Wed Dec 27 21:39:57 2017 (r327250) @@ -1,11 +1,6 @@ # $FreeBSD$ # -# Standard ARM support. -# -kern/kern_clocksource.c standard - -# # Standard tegra124 devices and support. # arm/nvidia/tegra124/tegra124_machdep.c standard Modified: head/sys/arm/qemu/files.qemu ============================================================================== --- head/sys/arm/qemu/files.qemu Wed Dec 27 21:36:37 2017 (r327249) +++ head/sys/arm/qemu/files.qemu Wed Dec 27 21:39:57 2017 (r327250) @@ -1,11 +1,6 @@ # $FreeBSD$ # -# Standard ARM support. -# -kern/kern_clocksource.c standard - -# # Standard qemu virt devices and support. # arm/qemu/virt_machdep.c standard Modified: head/sys/arm/ralink/files.ralink ============================================================================== --- head/sys/arm/ralink/files.ralink Wed Dec 27 21:36:37 2017 (r327249) +++ head/sys/arm/ralink/files.ralink Wed Dec 27 21:39:57 2017 (r327250) @@ -5,5 +5,3 @@ arm/ralink/rt1310_gpio.c optional rt1310gpio arm/ralink/rt1310_timer.c standard arm/ralink/if_fv.c optional fv -kern/kern_clocksource.c standard - Modified: head/sys/arm/rockchip/files.rk30xx ============================================================================== --- head/sys/arm/rockchip/files.rk30xx Wed Dec 27 21:36:37 2017 (r327249) +++ head/sys/arm/rockchip/files.rk30xx Wed Dec 27 21:39:57 2017 (r327250) @@ -1,5 +1,4 @@ # $FreeBSD$ -kern/kern_clocksource.c standard arm/rockchip/rk30xx_machdep.c standard arm/rockchip/rk30xx_pmu.c standard Modified: head/sys/arm/samsung/exynos/files.exynos5 ============================================================================== --- head/sys/arm/samsung/exynos/files.exynos5 Wed Dec 27 21:36:37 2017 (r327249) +++ head/sys/arm/samsung/exynos/files.exynos5 Wed Dec 27 21:39:57 2017 (r327250) @@ -1,7 +1,5 @@ # $FreeBSD$ -kern/kern_clocksource.c standard - arm/samsung/exynos/exynos5_mct.c standard arm/samsung/exynos/exynos5_mp.c optional smp arm/samsung/exynos/exynos5_machdep.c standard Modified: head/sys/arm/ti/files.ti ============================================================================== --- head/sys/arm/ti/files.ti Wed Dec 27 21:36:37 2017 (r327249) +++ head/sys/arm/ti/files.ti Wed Dec 27 21:39:57 2017 (r327250) @@ -1,7 +1,5 @@ #$FreeBSD$ -kern/kern_clocksource.c standard - arm/ti/ti_cpuid.c standard arm/ti/ti_hwmods.c standard arm/ti/ti_machdep.c standard Modified: head/sys/arm/versatile/files.versatile ============================================================================== --- head/sys/arm/versatile/files.versatile Wed Dec 27 21:36:37 2017 (r327249) +++ head/sys/arm/versatile/files.versatile Wed Dec 27 21:39:57 2017 (r327250) @@ -8,5 +8,3 @@ arm/versatile/versatile_common.c standard arm/versatile/versatile_pci.c optional pci arm/versatile/versatile_scm.c standard arm/versatile/versatile_sic.c standard - -kern/kern_clocksource.c standard Modified: head/sys/arm/xilinx/files.zynq7 ============================================================================== --- head/sys/arm/xilinx/files.zynq7 Wed Dec 27 21:36:37 2017 (r327249) +++ head/sys/arm/xilinx/files.zynq7 Wed Dec 27 21:39:57 2017 (r327250) @@ -3,8 +3,6 @@ # # $FreeBSD$ -kern/kern_clocksource.c standard - arm/xilinx/zy7_machdep.c standard arm/xilinx/zy7_l2cache.c standard arm/xilinx/zy7_slcr.c standard Modified: head/sys/conf/files.arm ============================================================================== --- head/sys/conf/files.arm Wed Dec 27 21:36:37 2017 (r327249) +++ head/sys/conf/files.arm Wed Dec 27 21:39:57 2017 (r327250) @@ -145,6 +145,7 @@ font.h optional sc \ compile-with "uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x16.fnt && file2c 'u_char dflt_font_16[16*256] = {' '};' < ${SC_DFLT_FONT}-8x16 > font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x14.fnt && file2c 'u_char dflt_font_14[14*256] = {' '};' < ${SC_DFLT_FONT}-8x14 >> font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x8.fnt && file2c 'u_char dflt_font_8[8*256] = {' '};' < ${SC_DFLT_FONT}-8x8 >> font.h" \ no-obj no-implicit-rule before-depend \ clean "font.h ${SC_DFLT_FONT}-8x14 ${SC_DFLT_FONT}-8x16 ${SC_DFLT_FONT}-8x8" +kern/kern_clocksource.c standard kern/msi_if.m optional intrng kern/pic_if.m optional intrng kern/subr_busdma_bufalloc.c standard From owner-svn-src-all@freebsd.org Wed Dec 27 21:56:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B586CE8040E; Wed, 27 Dec 2017 21:56:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9455179F30; Wed, 27 Dec 2017 21:56:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-5.local (astound-66-234-202-155.ca.astound.net [66.234.202.155]) by mail.baldwin.cx (Postfix) with ESMTPSA id 06F5810A8C2; Wed, 27 Dec 2017 16:56:02 -0500 (EST) Subject: Re: svn commit: r327166 - head/sys/x86/isa To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201712241759.vBOHxm5d005082@repo.freebsd.org> From: John Baldwin Message-ID: Date: Wed, 27 Dec 2017 13:56:01 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <201712241759.vBOHxm5d005082@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Wed, 27 Dec 2017 16:56:03 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Dec 2017 21:56:04 -0000 On 12/24/17 9:59 AM, Warner Losh wrote: > Author: imp > Date: Sun Dec 24 17:59:48 2017 > New Revision: 327166 > URL: https://svnweb.freebsd.org/changeset/base/327166 > > Log: > Further investigation shows this shouldn't have been added at all. > Remove it. > > Modified: > head/sys/x86/isa/orm.c > > Modified: head/sys/x86/isa/orm.c > ============================================================================== > --- head/sys/x86/isa/orm.c Sun Dec 24 16:53:55 2017 (r327165) > +++ head/sys/x86/isa/orm.c Sun Dec 24 17:59:48 2017 (r327166) > @@ -156,7 +156,6 @@ orm_identify(driver_t* driver, device_t parent) > device_set_desc(child, "ISA Option ROM"); > else > device_set_desc(child, "ISA Option ROMs"); > -// isa_set_vendorid(child, PNP_EISAID("PNP0C80")); > } So does this mean orm0 will trigger warnings in GENERIC now? -- John Baldwin From owner-svn-src-all@freebsd.org Wed Dec 27 21:58:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C17D2E80604; Wed, 27 Dec 2017 21:58:20 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8DCDE7A0C7; Wed, 27 Dec 2017 21:58:20 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBRLwJL8029738; Wed, 27 Dec 2017 21:58:19 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBRLwJ95029736; Wed, 27 Dec 2017 21:58:19 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201712272158.vBRLwJ95029736@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 27 Dec 2017 21:58:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327251 - in head/sys/arm: allwinner freescale/imx X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys/arm: allwinner freescale/imx X-SVN-Commit-Revision: 327251 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Dec 2017 21:58:20 -0000 Author: manu Date: Wed Dec 27 21:58:19 2017 New Revision: 327251 URL: https://svnweb.freebsd.org/changeset/base/327251 Log: arm: hdmi_if.m is already in files.arm Do not require it in files.vendor Modified: head/sys/arm/allwinner/files.allwinner head/sys/arm/freescale/imx/files.imx6 Modified: head/sys/arm/allwinner/files.allwinner ============================================================================== --- head/sys/arm/allwinner/files.allwinner Wed Dec 27 21:39:57 2017 (r327250) +++ head/sys/arm/allwinner/files.allwinner Wed Dec 27 21:58:19 2017 (r327251) @@ -33,7 +33,6 @@ arm/allwinner/aw_cir.c optional aw_cir evdev arm/allwinner/a10_fb.c optional vt arm/allwinner/a10_hdmi.c optional hdmi arm/allwinner/a10_hdmiaudio.c optional hdmi sound -dev/hdmi/hdmi_if.m optional hdmi arm/allwinner/aw_reset.c standard arm/allwinner/aw_ccu.c standard Modified: head/sys/arm/freescale/imx/files.imx6 ============================================================================== --- head/sys/arm/freescale/imx/files.imx6 Wed Dec 27 21:39:57 2017 (r327250) +++ head/sys/arm/freescale/imx/files.imx6 Wed Dec 27 21:58:19 2017 (r327251) @@ -22,7 +22,6 @@ arm/freescale/imx/imx6_audmux.c optional sound arm/freescale/imx/imx6_ssi.c optional sound arm/freescale/imx/imx6_ahci.c optional ahci -dev/hdmi/hdmi_if.m optional hdmi dev/hdmi/dwc_hdmi.c optional hdmi arm/freescale/imx/imx6_hdmi.c optional hdmi From owner-svn-src-all@freebsd.org Wed Dec 27 22:01:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16817E809FE; Wed, 27 Dec 2017 22:01:32 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E52587A33B; Wed, 27 Dec 2017 22:01:31 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBRM1Vdr030630; Wed, 27 Dec 2017 22:01:31 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBRM1VQu030629; Wed, 27 Dec 2017 22:01:31 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201712272201.vBRM1VQu030629@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 27 Dec 2017 22:01:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327252 - head/sys/sparc64/include X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/sparc64/include X-SVN-Commit-Revision: 327252 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Dec 2017 22:01:32 -0000 Author: pfg Date: Wed Dec 27 22:01:30 2017 New Revision: 327252 URL: https://svnweb.freebsd.org/changeset/base/327252 Log: sparc64: Update idprom.h. We only take a small part of the NetBSD file in sys/dev/sun/idprom.h. Bring some comments and update the license. Obtained from: NetBSD (CVS rev 1.3) Modified: head/sys/sparc64/include/idprom.h Modified: head/sys/sparc64/include/idprom.h ============================================================================== --- head/sys/sparc64/include/idprom.h Wed Dec 27 21:58:19 2017 (r327251) +++ head/sys/sparc64/include/idprom.h Wed Dec 27 22:01:30 2017 (r327252) @@ -1,9 +1,12 @@ /*- - * SPDX-License-Identifier: BSD-4-Clause + * SPDX-License-Identifier: BSD-2-Clause-NetBSD * - * Copyright (c) 1993 Adam Glass + * Copyright (c) 1996 The NetBSD Foundation, Inc. * All rights reserved. * + * This code is derived from software contributed to The NetBSD Foundation + * by Adam Glass. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -12,25 +15,20 @@ * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Adam Glass. - * 4. The name of the Author may not be used to endorse or promote products - * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY Adam Glass ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. * - * from: NetBSD: idprom.h,v 1.2 1998/09/05 23:57:26 eeh Exp + * from: NetBSD: idprom.h,v 1.3 2008/04/28 20:23:58 martin Exp * * $FreeBSD$ */ @@ -52,13 +50,14 @@ struct idprom { int id_date; /* date of manufacture */ u_char id_hostid[3]; /* ``host id'' bytes */ u_char id_checksum; /* xor of everything else */ + /* Note: The rest is excluded from the checksum! */ char id_undef[16]; /* undefined */ }; -#define ID_SUN4_100 0x22 -#define ID_SUN4_200 0x21 -#define ID_SUN4_300 0x23 -#define ID_SUN4_400 0x24 +#define ID_SUN4_100 0x22 /* Sun 4/100 */ +#define ID_SUN4_200 0x21 /* Sun 4/200 */ +#define ID_SUN4_300 0x23 /* Sun 4/300 */ +#define ID_SUN4_400 0x24 /* Sun 4/400 */ #define IDPROM_VERSION 1 From owner-svn-src-all@freebsd.org Wed Dec 27 22:01:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45D9DE80A6E for ; Wed, 27 Dec 2017 22:01:45 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x230.google.com (mail-it0-x230.google.com [IPv6:2607:f8b0:4001:c0b::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D68247A495 for ; Wed, 27 Dec 2017 22:01:44 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x230.google.com with SMTP id u62so26400307ita.2 for ; Wed, 27 Dec 2017 14:01:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=noTFGAOjDjJhQHG2H3UQEPhUmxSGntXisFmxZzKD0D0=; b=VXdxEN1qvNAPISBsM/3Vl9HBvW/oyf3ha+YswiFzVm6BY4E3cAuCNRGccbTbiukrxP gAyBFYJ9uzvBHxGixETOd+tcWZWBYM3C3hfeLepAq9wzzbtCrjccTrEMAKtNk+ffGo8J 8Yah4cDczJsb+80s/Tktp7u3/uX0WY9A6dH94ocKaMsKH7R4jWNkZyFORoBmgxMAu2mX xUzDQAsa+tS2IYN9e+hQ0PRnfoxShiUFlgiimIMzXpf9enhgFI1NMTeIcaBzrECmHhkz dz4Gi8HidNdt/dkHil67GnopcSHCpHlD4uyV1Nfetuv41w7G8Dg6yehp10Bd2nc+bqBx UmDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=noTFGAOjDjJhQHG2H3UQEPhUmxSGntXisFmxZzKD0D0=; b=EnYq+JLlIWWC3axa8rkzCEmywfNuzBT+3tZf2/nhOVF9jILQRIZsb+kz0A0246FwE5 XCZ9b/+xGaFdj3h5q0JfNmuWQrAzF+u4j6qt/OvcGcp7d66wNqyk3HdkbjV8bS+WhzUz 9becHXZKAnNTg+hSMbtEtaoMyFkv0TWH73ZsRbjUWxL4VLzCLCToWjBGWo+8DGD2KxH/ mXxrI9DQZBoVcM6zj7M0JNnqQDOVpFxN0hVILKblzxcf96jKJSzCtUX+779+b3WGY5Yh vdYfN7x8oV0hhPQCiGfrn0zFiS9krX4XU9l+rt4PBLbrpJl6LrgKlh4qxIkzc5NGL/Jd hx9w== X-Gm-Message-State: AKGB3mKE/sAwyoX8CJ36E80J9gO+kBamuQJbw0mj93WMBAedpjk8ZwUZ c3gerLO4HSkpez4xSM3RW8Lf58vWEILPpQCMkjj2ig== X-Google-Smtp-Source: ACJfBousHJi/2p6KB9Y1ohdNowQr90123PvO231BkKGQ/B11rj71HRD7Zj4W5emTx2zAxWbrVDuDt2006idHv+44vZY= X-Received: by 10.36.133.135 with SMTP id r129mr41234098itd.69.1514412103889; Wed, 27 Dec 2017 14:01:43 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.108.204 with HTTP; Wed, 27 Dec 2017 14:01:43 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:dd6a:b4e5:7da5:f5db] Received: by 10.79.108.204 with HTTP; Wed, 27 Dec 2017 14:01:43 -0800 (PST) In-Reply-To: References: <201712241759.vBOHxm5d005082@repo.freebsd.org> From: Warner Losh Date: Wed, 27 Dec 2017 15:01:43 -0700 X-Google-Sender-Auth: q4W53rbTmOpZq9Ucs0Eli1DdDww Message-ID: Subject: Re: svn commit: r327166 - head/sys/x86/isa To: John Baldwin Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Dec 2017 22:01:45 -0000 On Dec 27, 2017 2:56 PM, "John Baldwin" wrote: On 12/24/17 9:59 AM, Warner Losh wrote: > Author: imp > Date: Sun Dec 24 17:59:48 2017 > New Revision: 327166 > URL: https://svnweb.freebsd.org/changeset/base/327166 > > Log: > Further investigation shows this shouldn't have been added at all. > Remove it. > > Modified: > head/sys/x86/isa/orm.c > > Modified: head/sys/x86/isa/orm.c > ============================================================ ================== > --- head/sys/x86/isa/orm.c Sun Dec 24 16:53:55 2017 (r327165) > +++ head/sys/x86/isa/orm.c Sun Dec 24 17:59:48 2017 (r327166) > @@ -156,7 +156,6 @@ orm_identify(driver_t* driver, device_t parent) > device_set_desc(child, "ISA Option ROM"); > else > device_set_desc(child, "ISA Option ROMs"); > -// isa_set_vendorid(child, PNP_EISAID("PNP0C80")); > } So does this mean orm0 will trigger warnings in GENERIC now? No. The setting was redundant. Warner From owner-svn-src-all@freebsd.org Wed Dec 27 22:18:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24ED1E815E4; Wed, 27 Dec 2017 22:18:58 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F09217AF13; Wed, 27 Dec 2017 22:18:57 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBRMIvKi038082; Wed, 27 Dec 2017 22:18:57 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBRMIuKi038078; Wed, 27 Dec 2017 22:18:56 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201712272218.vBRMIuKi038078@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Wed, 27 Dec 2017 22:18:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327253 - head/sbin/dump X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sbin/dump X-SVN-Commit-Revision: 327253 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Dec 2017 22:18:58 -0000 Author: mckusick Date: Wed Dec 27 22:18:56 2017 New Revision: 327253 URL: https://svnweb.freebsd.org/changeset/base/327253 Log: In preparation for converting to libufs to read the superblock, change conflicting function names: getino => getinode bread => blkread No functional change. Modified: head/sbin/dump/dump.h head/sbin/dump/main.c head/sbin/dump/tape.c head/sbin/dump/traverse.c Modified: head/sbin/dump/dump.h ============================================================================== --- head/sbin/dump/dump.h Wed Dec 27 22:01:30 2017 (r327252) +++ head/sbin/dump/dump.h Wed Dec 27 22:18:56 2017 (r327253) @@ -108,7 +108,7 @@ int mapfiles(ino_t maxino, long *tapesize); int mapdirs(ino_t maxino, long *tapesize); /* file dumping routines */ -void bread(ufs2_daddr_t blkno, char *buf, int size); +void blkread(ufs2_daddr_t blkno, char *buf, int size); ssize_t cread(int fd, void *buf, size_t nbytes, off_t offset); void dumpino(union dinode *dp, ino_t ino); void dumpmap(char *map, int type, ino_t ino); @@ -127,7 +127,7 @@ void dumpabort(int signo) __dead2; void dump_getfstab(void); char *rawname(char *cp); -union dinode *getino(ino_t inum, int *mode); +union dinode *getinode(ino_t inum, int *mode); /* rdump routines */ #ifdef RDUMP Modified: head/sbin/dump/main.c ============================================================================== --- head/sbin/dump/main.c Wed Dec 27 22:01:30 2017 (r327252) +++ head/sbin/dump/main.c Wed Dec 27 22:18:56 2017 (r327253) @@ -439,8 +439,8 @@ main(int argc, char *argv[]) sync(); sblock = (struct fs *)sblock_buf; for (i = 0; sblock_try[i] != -1; i++) { - sblock->fs_fsize = SBLOCKSIZE; /* needed in bread */ - bread(sblock_try[i] >> dev_bshift, (char *) sblock, SBLOCKSIZE); + sblock->fs_fsize = SBLOCKSIZE; /* needed in blkread */ + blkread(sblock_try[i]>>dev_bshift, (char *) sblock, SBLOCKSIZE); if ((sblock->fs_magic == FS_UFS1_MAGIC || (sblock->fs_magic == FS_UFS2_MAGIC && sblock->fs_sblockloc == sblock_try[i])) && @@ -556,7 +556,7 @@ main(int argc, char *argv[]) /* * Skip directory inodes deleted and maybe reallocated */ - dp = getino(ino, &mode); + dp = getinode(ino, &mode); if (mode != IFDIR) continue; (void)dumpino(dp, ino); @@ -575,7 +575,7 @@ main(int argc, char *argv[]) /* * Skip inodes deleted and reallocated as directories. */ - dp = getino(ino, &mode); + dp = getinode(ino, &mode); if (mode == IFDIR) continue; (void)dumpino(dp, ino); Modified: head/sbin/dump/tape.c ============================================================================== --- head/sbin/dump/tape.c Wed Dec 27 22:01:30 2017 (r327252) +++ head/sbin/dump/tape.c Wed Dec 27 22:18:56 2017 (r327253) @@ -786,7 +786,7 @@ doslave(int cmd, int slave_number) for (trecno = 0; trecno < ntrec; trecno += p->count, p += p->count) { if (p->dblk) { - bread(p->dblk, slp->tblock[trecno], + blkread(p->dblk, slp->tblock[trecno], p->count * TP_BSIZE); } else { if (p->count != 1 || atomic(read, cmd, Modified: head/sbin/dump/traverse.c ============================================================================== --- head/sbin/dump/traverse.c Wed Dec 27 22:01:30 2017 (r327252) +++ head/sbin/dump/traverse.c Wed Dec 27 22:18:56 2017 (r327253) @@ -162,7 +162,7 @@ mapfiles(ino_t maxino, long *tapesize) quit("mapfiles: cannot allocate memory.\n"); for (cg = 0; cg < sblock->fs_ncg; cg++) { ino = cg * sblock->fs_ipg; - bread(fsbtodb(sblock, cgtod(sblock, cg)), (char *)cgp, + blkread(fsbtodb(sblock, cgtod(sblock, cg)), (char *)cgp, sblock->fs_cgsize); if (sblock->fs_magic == FS_UFS2_MAGIC) inosused = cgp->cg_initediblk; @@ -194,7 +194,7 @@ mapfiles(ino_t maxino, long *tapesize) } for (i = 0; i < inosused; i++, ino++) { if (ino < UFS_ROOTINO || - (dp = getino(ino, &mode)) == NULL || + (dp = getinode(ino, &mode)) == NULL || (mode & IFMT) == 0) continue; if (ino >= maxino) { @@ -276,7 +276,7 @@ mapdirs(ino_t maxino, long *tapesize) nodump = !nonodump && (TSTINO(ino, usedinomap) == 0); if ((isdir & 1) == 0 || (TSTINO(ino, dumpinomap) && !nodump)) continue; - dp = getino(ino, &i); + dp = getinode(ino, &i); /* * inode buf may change in searchdir(). */ @@ -342,7 +342,7 @@ dirindir( int ret = 0; int i; - bread(fsbtodb(sblock, blkno), (char *)&idblk, (int)sblock->fs_bsize); + blkread(fsbtodb(sblock, blkno), (char *)&idblk, (int)sblock->fs_bsize); if (ind_level <= 0) { for (i = 0; *filesize > 0 && i < NINDIR(sblock); i++) { if (sblock->fs_magic == FS_UFS1_MAGIC) @@ -395,7 +395,7 @@ searchdir( if (dblk == NULL && (dblk = malloc(sblock->fs_bsize)) == NULL) quit("searchdir: cannot allocate indirect memory.\n"); - bread(fsbtodb(sblock, blkno), dblk, (int)size); + blkread(fsbtodb(sblock, blkno), dblk, (int)size); if (filesize < size) size = filesize; for (loc = 0; loc < size; ) { @@ -420,7 +420,7 @@ searchdir( continue; } if (nodump) { - ip = getino(dp->d_ino, &mode); + ip = getinode(dp->d_ino, &mode); if (TSTINO(dp->d_ino, dumpinomap)) { CLRINO(dp->d_ino, dumpinomap); *tapesize -= blockest(ip); @@ -591,7 +591,7 @@ dmpindir(union dinode *dp, ino_t ino, ufs2_daddr_t blk int i, cnt, last; if (blk != 0) - bread(fsbtodb(sblock, blk), (char *)&idblk, + blkread(fsbtodb(sblock, blk), (char *)&idblk, (int)sblock->fs_bsize); else memset(&idblk, 0, sblock->fs_bsize); @@ -871,7 +871,7 @@ writeheader(ino_t ino) } union dinode * -getino(ino_t inum, int *modep) +getinode(ino_t inum, int *modep) { static ino_t minino, maxino; static caddr_t inoblock; @@ -883,7 +883,7 @@ getino(ino_t inum, int *modep) curino = inum; if (inum >= minino && inum < maxino) goto gotit; - bread(fsbtodb(sblock, ino_to_fsba(sblock, inum)), inoblock, + blkread(fsbtodb(sblock, ino_to_fsba(sblock, inum)), inoblock, (int)sblock->fs_bsize); minino = inum - (inum % INOPB(sblock)); maxino = minino + INOPB(sblock); @@ -908,7 +908,7 @@ int breaderrors = 0; #define BREADEMAX 32 void -bread(ufs2_daddr_t blkno, char *buf, int size) +blkread(ufs2_daddr_t blkno, char *buf, int size) { int secsize, bytes, resid, xfer, base, cnt, i; static char *tmpbuf; From owner-svn-src-all@freebsd.org Wed Dec 27 22:44:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B816E82D8B; Wed, 27 Dec 2017 22:44:52 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1BFFB7C096; Wed, 27 Dec 2017 22:44:52 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBRMipGW050976; Wed, 27 Dec 2017 22:44:51 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBRMip8S050975; Wed, 27 Dec 2017 22:44:51 GMT (envelope-from np@FreeBSD.org) Message-Id: <201712272244.vBRMip8S050975@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 27 Dec 2017 22:44:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327254 - head/sys/dev/cxgbe/iw_cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/iw_cxgbe X-SVN-Commit-Revision: 327254 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Dec 2017 22:44:52 -0000 Author: np Date: Wed Dec 27 22:44:50 2017 New Revision: 327254 URL: https://svnweb.freebsd.org/changeset/base/327254 Log: cxgbe/iw_cxgbe: Fix iWARP over VLANs (catch up with r326169). Submitted by: KrishnamRaju ErapaRaju @ Chelsio Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/cm.c Wed Dec 27 22:18:56 2017 (r327253) +++ head/sys/dev/cxgbe/iw_cxgbe/cm.c Wed Dec 27 22:44:50 2017 (r327254) @@ -339,24 +339,28 @@ find_real_listen_ep(struct c4iw_listen_ep *master_lep, { struct adapter *adap = NULL; struct c4iw_listen_ep *lep = NULL; - struct sockaddr_storage remote = { 0 }; - struct ifnet *new_conn_ifp = NULL; + struct ifnet *ifp = NULL, *hw_ifp = NULL; struct listen_port_info *port_info = NULL; - int err = 0, i = 0, - found_portinfo = 0, found_lep = 0; + int i = 0, found_portinfo = 0, found_lep = 0; uint16_t port; - /* STEP 1: get 'ifnet' based on socket's remote address */ - GET_REMOTE_ADDR(&remote, so); + /* + * STEP 1: Figure out 'ifp' of the physical interface, not pseudo + * interfaces like vlan, lagg, etc.. + * TBD: lagg support, lagg + vlan support. + */ + ifp = TOEPCB(so)->l2te->ifp; + if (ifp->if_type == IFT_L2VLAN) { + hw_ifp = VLAN_TRUNKDEV(ifp); + if (hw_ifp == NULL) { + CTR4(KTR_IW_CXGBE, "%s: Failed to get parent ifnet of " + "vlan ifnet %p, sock %p, master_lep %p", + __func__, ifp, so, master_lep); + return (NULL); + } + } else + hw_ifp = ifp; - err = get_ifnet_from_raddr(&remote, &new_conn_ifp); - if (err) { - CTR4(KTR_IW_CXGBE, "%s: Failed to get ifnet, sock %p, " - "master_lep %p err %d", - __func__, so, master_lep, err); - return (NULL); - } - /* STEP 2: Find 'port_info' with listener local port address. */ port = (master_lep->com.local_addr.ss_family == AF_INET) ? ((struct sockaddr_in *)&master_lep->com.local_addr)->sin_port : @@ -379,7 +383,7 @@ find_real_listen_ep(struct c4iw_listen_ep *master_lep, list_for_each_entry(lep, &port_info->lep_list, listen_ep_list) { adap = lep->com.dev->rdev.adap; for_each_port(adap, i) { - if (new_conn_ifp == adap->port[i]->vi[0].ifp) { + if (hw_ifp == adap->port[i]->vi[0].ifp) { found_lep =1; goto out; } From owner-svn-src-all@freebsd.org Wed Dec 27 22:47:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 100D0E8310C; Wed, 27 Dec 2017 22:47:58 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CEDB47C31F; Wed, 27 Dec 2017 22:47:57 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBRMlu4H051283; Wed, 27 Dec 2017 22:47:56 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBRMluv2051281; Wed, 27 Dec 2017 22:47:56 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201712272247.vBRMluv2051281@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 27 Dec 2017 22:47:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327255 - head/sys/arm/xscale/ixp425 X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/arm/xscale/ixp425 X-SVN-Commit-Revision: 327255 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Dec 2017 22:47:58 -0000 Author: pfg Date: Wed Dec 27 22:47:56 2017 New Revision: 327255 URL: https://svnweb.freebsd.org/changeset/base/327255 Log: SPDX: fix license ID tags for arm/xscale. Use parenthesis for grouping as suggested by the spec. Modified: head/sys/arm/xscale/ixp425/ixp425_npe.c head/sys/arm/xscale/ixp425/ixp425_npereg.h Modified: head/sys/arm/xscale/ixp425/ixp425_npe.c ============================================================================== --- head/sys/arm/xscale/ixp425/ixp425_npe.c Wed Dec 27 22:44:50 2017 (r327254) +++ head/sys/arm/xscale/ixp425/ixp425_npe.c Wed Dec 27 22:47:56 2017 (r327255) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-3-Clause + * SPDX-License-Identifier: (BSD-2-Clause-FreeBSD AND BSD-3-Clause) * * Copyright (c) 2006-2008 Sam Leffler, Errno Consulting * All rights reserved. Modified: head/sys/arm/xscale/ixp425/ixp425_npereg.h ============================================================================== --- head/sys/arm/xscale/ixp425/ixp425_npereg.h Wed Dec 27 22:44:50 2017 (r327254) +++ head/sys/arm/xscale/ixp425/ixp425_npereg.h Wed Dec 27 22:47:56 2017 (r327255) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-3-Clause + * SPDX-License-Identifier: (BSD-2-Clause-FreeBSD AND BSD-3-Clause) * * Copyright (c) 2006 Sam Leffler, Errno Consulting * All rights reserved. From owner-svn-src-all@freebsd.org Thu Dec 28 01:12:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53495E8B3A2; Thu, 28 Dec 2017 01:12:31 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 07DD61219; Thu, 28 Dec 2017 01:12:30 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBS1CT2J014906; Thu, 28 Dec 2017 01:12:29 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBS1CTvu014897; Thu, 28 Dec 2017 01:12:29 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201712280112.vBS1CTvu014897@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 28 Dec 2017 01:12:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327256 - head/sys/arm/xscale/ixp425 X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/arm/xscale/ixp425 X-SVN-Commit-Revision: 327256 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 01:12:31 -0000 Author: pfg Date: Thu Dec 28 01:12:28 2017 New Revision: 327256 URL: https://svnweb.freebsd.org/changeset/base/327256 Log: arm/ixp425: Drop 3rd and 4th clauses from Ichiro FUKUHARA's license. This syncs us with NetBSD as much of our changes have been upstreamed. Obtained from: NetBSD Modified: head/sys/arm/xscale/ixp425/ixdp425_pci.c head/sys/arm/xscale/ixp425/ixdp425reg.h head/sys/arm/xscale/ixp425/ixp425.c head/sys/arm/xscale/ixp425/ixp425_pci.c head/sys/arm/xscale/ixp425/ixp425_pci_space.c head/sys/arm/xscale/ixp425/ixp425_space.c head/sys/arm/xscale/ixp425/ixp425_timer.c head/sys/arm/xscale/ixp425/ixp425reg.h head/sys/arm/xscale/ixp425/ixp425var.h Modified: head/sys/arm/xscale/ixp425/ixdp425_pci.c ============================================================================== --- head/sys/arm/xscale/ixp425/ixdp425_pci.c Wed Dec 27 22:47:56 2017 (r327255) +++ head/sys/arm/xscale/ixp425/ixdp425_pci.c Thu Dec 28 01:12:28 2017 (r327256) @@ -1,6 +1,6 @@ -/* $NetBSD: ixdp425_pci.c,v 1.5 2005/12/11 12:17:09 christos Exp $ */ +/* $NetBSD: ixdp425_pci.c,v 1.6 2009/10/21 14:15:51 rmind Exp $ */ /*- - * SPDX-License-Identifier: BSD-4-Clause + * SPDX-License-Identifier: BSD-2-Clause-NetBSD * * Copyright (c) 2003 * Ichiro FUKUHARA . @@ -14,12 +14,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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Ichiro FUKUHARA. - * 4. The name of the company nor the name of the author may be used to - * endorse or promote products derived from this software without specific - * prior written permission. * * THIS SOFTWARE IS PROVIDED BY ICHIRO FUKUHARA ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES Modified: head/sys/arm/xscale/ixp425/ixdp425reg.h ============================================================================== --- head/sys/arm/xscale/ixp425/ixdp425reg.h Wed Dec 27 22:47:56 2017 (r327255) +++ head/sys/arm/xscale/ixp425/ixdp425reg.h Thu Dec 28 01:12:28 2017 (r327256) @@ -1,6 +1,6 @@ -/* $NetBSD: ixdp425reg.h,v 1.6 2005/12/11 12:17:09 christos Exp $ */ +/* $NetBSD: ixdp425reg.h,v 1.7 2009/10/21 14:15:51 rmind Exp $ */ /*- - * SPDX-License-Identifier: BSD-4-Clause + * SPDX-License-Identifier: BSD-2-Clause-NetBSD * * Copyright (c) 2003 * Ichiro FUKUHARA . @@ -14,12 +14,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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Ichiro FUKUHARA. - * 4. The name of the company nor the name of the author may be used to - * endorse or promote products derived from this software without specific - * prior written permission. * * THIS SOFTWARE IS PROVIDED BY ICHIRO FUKUHARA ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES Modified: head/sys/arm/xscale/ixp425/ixp425.c ============================================================================== --- head/sys/arm/xscale/ixp425/ixp425.c Wed Dec 27 22:47:56 2017 (r327255) +++ head/sys/arm/xscale/ixp425/ixp425.c Thu Dec 28 01:12:28 2017 (r327256) @@ -1,7 +1,7 @@ -/* $NetBSD: ixp425.c,v 1.10 2005/12/11 12:16:51 christos Exp $ */ +/* $NetBSD: ixp425.c,v 1.13 2009/10/21 14:15:50 rmind Exp $ */ /*- - * SPDX-License-Identifier: BSD-4-Clause + * SPDX-License-Identifier: BSD-2-Clause-NetBSD * * Copyright (c) 2003 * Ichiro FUKUHARA . @@ -15,12 +15,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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Ichiro FUKUHARA. - * 4. The name of the company nor the name of the author may be used to - * endorse or promote products derived from this software without specific - * prior written permission. * * THIS SOFTWARE IS PROVIDED BY ICHIRO FUKUHARA ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES Modified: head/sys/arm/xscale/ixp425/ixp425_pci.c ============================================================================== --- head/sys/arm/xscale/ixp425/ixp425_pci.c Wed Dec 27 22:47:56 2017 (r327255) +++ head/sys/arm/xscale/ixp425/ixp425_pci.c Thu Dec 28 01:12:28 2017 (r327256) @@ -1,7 +1,7 @@ -/* $NetBSD: ixp425_pci.c,v 1.5 2006/04/10 03:36:03 simonb Exp $ */ +/* $NetBSD: ixp425_pci.c,v 1.6 2009/10/21 14:15:50 rmind Exp $ */ /*- - * SPDX-License-Identifier: BSD-4-Clause + * SPDX-License-Identifier: BSD-2-Clause-NetBSD * * Copyright (c) 2003 * Ichiro FUKUHARA . @@ -15,12 +15,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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Ichiro FUKUHARA. - * 4. The name of the company nor the name of the author may be used to - * endorse or promote products derived from this software without specific - * prior written permission. * * THIS SOFTWARE IS PROVIDED BY ICHIRO FUKUHARA ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES Modified: head/sys/arm/xscale/ixp425/ixp425_pci_space.c ============================================================================== --- head/sys/arm/xscale/ixp425/ixp425_pci_space.c Wed Dec 27 22:47:56 2017 (r327255) +++ head/sys/arm/xscale/ixp425/ixp425_pci_space.c Thu Dec 28 01:12:28 2017 (r327256) @@ -1,7 +1,7 @@ -/* $NetBSD: ixp425_pci_space.c,v 1.6 2006/04/10 03:36:03 simonb Exp $ */ +/* $NetBSD: ixp425_pci_space.c,v 1.7 2009/10/21 14:15:51 rmind Exp $ */ /*- - * SPDX-License-Identifier: BSD-4-Clause + * SPDX-License-Identifier: BSD-2-Clause-NetBSD * * Copyright (c) 2003 * Ichiro FUKUHARA . @@ -15,12 +15,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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Ichiro FUKUHARA. - * 4. The name of the company nor the name of the author may be used to - * endorse or promote products derived from this software without specific - * prior written permission. * * THIS SOFTWARE IS PROVIDED BY ICHIRO FUKUHARA ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES Modified: head/sys/arm/xscale/ixp425/ixp425_space.c ============================================================================== --- head/sys/arm/xscale/ixp425/ixp425_space.c Wed Dec 27 22:47:56 2017 (r327255) +++ head/sys/arm/xscale/ixp425/ixp425_space.c Thu Dec 28 01:12:28 2017 (r327256) @@ -1,7 +1,7 @@ -/* $NetBSD: ixp425_space.c,v 1.6 2006/04/10 03:36:03 simonb Exp $ */ +/* $NetBSD: ixp425_space.c,v 1.7 2009/10/21 14:15:51 rmind Exp $ */ /*- - * SPDX-License-Identifier: BSD-4-Clause + * SPDX-License-Identifier: BSD-2-Clause-NetBSD * * Copyright (c) 2003 * Ichiro FUKUHARA . @@ -15,12 +15,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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Ichiro FUKUHARA. - * 4. The name of the company nor the name of the author may be used to - * endorse or promote products derived from this software without specific - * prior written permission. * * THIS SOFTWARE IS PROVIDED BY ICHIRO FUKUHARA ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES Modified: head/sys/arm/xscale/ixp425/ixp425_timer.c ============================================================================== --- head/sys/arm/xscale/ixp425/ixp425_timer.c Wed Dec 27 22:47:56 2017 (r327255) +++ head/sys/arm/xscale/ixp425/ixp425_timer.c Thu Dec 28 01:12:28 2017 (r327256) @@ -1,7 +1,7 @@ -/* $NetBSD: ixp425_timer.c,v 1.11 2006/04/10 03:36:03 simonb Exp $ */ +/* $NetBSD: ixp425_timer.c,v 1.15 2009/10/21 14:15:51 rmind Exp $ */ /*- - * SPDX-License-Identifier: BSD-4-Clause + * SPDX-License-Identifier: BSD-2-Clause-NetBSD * * Copyright (c) 2003 * Ichiro FUKUHARA . @@ -15,12 +15,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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Ichiro FUKUHARA. - * 4. The name of the company nor the name of the author may be used to - * endorse or promote products derived from this software without specific - * prior written permission. * * THIS SOFTWARE IS PROVIDED BY ICHIRO FUKUHARA ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES Modified: head/sys/arm/xscale/ixp425/ixp425reg.h ============================================================================== --- head/sys/arm/xscale/ixp425/ixp425reg.h Wed Dec 27 22:47:56 2017 (r327255) +++ head/sys/arm/xscale/ixp425/ixp425reg.h Thu Dec 28 01:12:28 2017 (r327256) @@ -1,6 +1,6 @@ -/* $NetBSD: ixp425reg.h,v 1.19 2005/12/11 12:16:51 christos Exp $ */ +/* $NetBSD: ixp425reg.h,v 1.21 2009/10/21 14:15:51 rmind Exp $ */ /*- - * SPDX-License-Identifier: BSD-4-Clause + * SPDX-License-Identifier: BSD-2-Clause-NetBSD * * Copyright (c) 2003 * Ichiro FUKUHARA . @@ -14,12 +14,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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Ichiro FUKUHARA. - * 4. The name of the company nor the name of the author may be used to - * endorse or promote products derived from this software without specific - * prior written permission. * * THIS SOFTWARE IS PROVIDED BY ICHIRO FUKUHARA ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES Modified: head/sys/arm/xscale/ixp425/ixp425var.h ============================================================================== --- head/sys/arm/xscale/ixp425/ixp425var.h Wed Dec 27 22:47:56 2017 (r327255) +++ head/sys/arm/xscale/ixp425/ixp425var.h Thu Dec 28 01:12:28 2017 (r327256) @@ -1,7 +1,7 @@ -/* $NetBSD: ixp425var.h,v 1.10 2006/04/10 03:36:03 simonb Exp $ */ +/* $NetBSD: ixp425var.h,v 1.12 2009/10/21 14:15:51 rmind Exp $ */ /*- - * SPDX-License-Identifier: BSD-4-Clause + * SPDX-License-Identifier: BSD-2-Clause-NetBSD * * Copyright (c) 2003 * Ichiro FUKUHARA . @@ -15,12 +15,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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Ichiro FUKUHARA. - * 4. The name of the company nor the name of the author may be used to - * endorse or promote products derived from this software without specific - * prior written permission. * * THIS SOFTWARE IS PROVIDED BY ICHIRO FUKUHARA ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES From owner-svn-src-all@freebsd.org Thu Dec 28 01:20:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41192E8C251; Thu, 28 Dec 2017 01:20:32 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0903E1A9E; Thu, 28 Dec 2017 01:20:31 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBS1KVq7015265; Thu, 28 Dec 2017 01:20:31 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBS1KV2G015264; Thu, 28 Dec 2017 01:20:31 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201712280120.vBS1KV2G015264@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 28 Dec 2017 01:20:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327257 - head/sys/libkern X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/libkern X-SVN-Commit-Revision: 327257 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 01:20:32 -0000 Author: pfg Date: Thu Dec 28 01:20:30 2017 New Revision: 327257 URL: https://svnweb.freebsd.org/changeset/base/327257 Log: SPDX: fix wrong license ID tag in libkern. Modified: head/sys/libkern/strstr.c Modified: head/sys/libkern/strstr.c ============================================================================== --- head/sys/libkern/strstr.c Thu Dec 28 01:12:28 2017 (r327256) +++ head/sys/libkern/strstr.c Thu Dec 28 01:20:30 2017 (r327257) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-4-Clause + * SPDX-License-Identifier: BSD-3-Clause * * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. From owner-svn-src-all@freebsd.org Thu Dec 28 01:21:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46A31E8C40C; Thu, 28 Dec 2017 01:21:32 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 10A3F1E2E; Thu, 28 Dec 2017 01:21:31 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBS1LV7i016905; Thu, 28 Dec 2017 01:21:31 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBS1LVds016904; Thu, 28 Dec 2017 01:21:31 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201712280121.vBS1LVds016904@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Thu, 28 Dec 2017 01:21:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327258 - head/usr.sbin/bsdinstall/partedit X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: head/usr.sbin/bsdinstall/partedit X-SVN-Commit-Revision: 327258 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 01:21:32 -0000 Author: nwhitehorn Date: Thu Dec 28 01:21:30 2017 New Revision: 327258 URL: https://svnweb.freebsd.org/changeset/base/327258 Log: Fix bug introduced in r326674, in which efi boot partitions created by the installer but not mounted (i.e. with boot1.efifat dd'ed to them rather than the forthcoming proper filesystem) would get newfs_msdos run on them immediately after the boot code was copied. This would overwrite the bootstrap code, causing the EFI system partition to be blanked and resulting in an unbootable system. PR: 224562 Modified: head/usr.sbin/bsdinstall/partedit/gpart_ops.c Modified: head/usr.sbin/bsdinstall/partedit/gpart_ops.c ============================================================================== --- head/usr.sbin/bsdinstall/partedit/gpart_ops.c Thu Dec 28 01:20:30 2017 (r327257) +++ head/usr.sbin/bsdinstall/partedit/gpart_ops.c Thu Dec 28 01:21:30 2017 (r327258) @@ -942,7 +942,9 @@ add_boot_partition(struct ggeom *geom, struct gprovide choice = 0; if (choice == 0) { /* yes */ + struct partition_metadata *md; const char *bootmount = NULL; + char *bootpartname = NULL; char sizestr[7]; humanize_number(sizestr, 7, @@ -950,7 +952,21 @@ add_boot_partition(struct ggeom *geom, struct gprovide HN_NOSPACE | HN_DECIMAL); gpart_create(pp, bootpart_type(scheme, &bootmount), - sizestr, bootmount, NULL, 0); + sizestr, bootmount, &bootpartname, 0); + + if (bootpartname == NULL) /* Error reported to user already */ + return 0; + + /* If the part is not mountable, make sure newfs isn't set */ + if (bootmount == NULL) { + md = get_part_metadata(bootpartname, 0); + if (md != NULL && md->newfs != NULL) { + free(md->newfs); + md->newfs = NULL; + } + } + + free(bootpartname); return (bootpart_size(scheme)); } From owner-svn-src-all@freebsd.org Thu Dec 28 01:31:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 692ACE8D716; Thu, 28 Dec 2017 01:31:30 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 28EBE26E1; Thu, 28 Dec 2017 01:31:30 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBS1VTC1020451; Thu, 28 Dec 2017 01:31:29 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBS1VSpP020446; Thu, 28 Dec 2017 01:31:28 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201712280131.vBS1VSpP020446@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 28 Dec 2017 01:31:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327259 - in head: lib/libc/sys lib/libopenbsd sbin/ipfw usr.sbin/ntp/doc X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: in head: lib/libc/sys lib/libopenbsd sbin/ipfw usr.sbin/ntp/doc X-SVN-Commit-Revision: 327259 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 01:31:30 -0000 Author: eadler Date: Thu Dec 28 01:31:28 2017 New Revision: 327259 URL: https://svnweb.freebsd.org/changeset/base/327259 Log: Fix a few more speelling errors Reviewed by: bjk Reviewed by: jilles (incl formal "accept") Differential Revision: https://reviews.freebsd.org/D13650 Modified: head/lib/libc/sys/kqueue.2 head/lib/libc/sys/sendfile.2 head/lib/libopenbsd/imsg_init.3 head/sbin/ipfw/ipfw.8 head/usr.sbin/ntp/doc/ntp.conf.5 Modified: head/lib/libc/sys/kqueue.2 ============================================================================== --- head/lib/libc/sys/kqueue.2 Thu Dec 28 01:21:30 2017 (r327258) +++ head/lib/libc/sys/kqueue.2 Thu Dec 28 01:31:28 2017 (r327259) @@ -190,7 +190,7 @@ The .Fa ext[2] and .Fa ext[3] -members are always passed throught the kernel as-is, +members are always passed through the kernel as-is, making additional context available to application. .El .Pp Modified: head/lib/libc/sys/sendfile.2 ============================================================================== --- head/lib/libc/sys/sendfile.2 Thu Dec 28 01:21:30 2017 (r327258) +++ head/lib/libc/sys/sendfile.2 Thu Dec 28 01:31:28 2017 (r327259) @@ -190,7 +190,7 @@ may read ahead when reading the file. A macro .Fn SF_FLAGS is provided to combine readahead amount and flags. -Example shows specifing readahead of 16 pages and +An example showing specifying readahead of 16 pages and .Dv SF_NOCACHE flag: .Pp Modified: head/lib/libopenbsd/imsg_init.3 ============================================================================== --- head/lib/libopenbsd/imsg_init.3 Thu Dec 28 01:21:30 2017 (r327258) +++ head/lib/libopenbsd/imsg_init.3 Thu Dec 28 01:31:28 2017 (r327259) @@ -347,7 +347,7 @@ On success returns a pointer to the buffer; on failure it returns NULL. .Pp .Fn ibuf_dynamic -allocates a resizeable buffer of initial length +allocates a resizable buffer of initial length .Fa len and maximum size .Fa max . Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Thu Dec 28 01:21:30 2017 (r327258) +++ head/sbin/ipfw/ipfw.8 Thu Dec 28 01:31:28 2017 (r327259) @@ -3020,7 +3020,7 @@ supports in-kernel IPv6/IPv4 network address and proto Stateful NAT64 translation allows IPv6-only clients to contact IPv4 servers using unicast TCP, UDP or ICMP protocols. One or more IPv4 addresses assigned to a stateful NAT64 translator are shared -among serveral IPv6-only clients. +among several IPv6-only clients. When stateful NAT64 is used in conjunction with DNS64, no changes are usually required in the IPv6 client or the IPv4 server. The kernel module Modified: head/usr.sbin/ntp/doc/ntp.conf.5 ============================================================================== --- head/usr.sbin/ntp/doc/ntp.conf.5 Thu Dec 28 01:21:30 2017 (r327258) +++ head/usr.sbin/ntp/doc/ntp.conf.5 Thu Dec 28 01:31:28 2017 (r327259) @@ -2550,7 +2550,7 @@ While this is generally a feature as it allows for quick recovery if a server key has changed, a properly forged and appropriately delivered crypto\-NAK packet can be used in a DoS attack. -If you have active noticable problems with this type of DoS attack +If you have active noticeable problems with this type of DoS attack then you should consider disabling this option. You can check your @@ -2598,7 +2598,7 @@ While this is generally a feature as it allows for quick recovery if a server key has changed, a properly forged and appropriately delivered crypto\-NAK packet can be used in a DoS attack. -If you have active noticable problems with this type of DoS attack +If you have active noticeable problems with this type of DoS attack then you should consider disabling this option. You can check your @@ -2618,7 +2618,7 @@ While this is generally a feature as it allows for quick recovery, if this type of packet is carefully forged and sent during an appropriate window it can be used for a DoS attack. -If you have active noticable problems with this type of DoS attack +If you have active noticeable problems with this type of DoS attack then you should consider disabling this option. You can check your From owner-svn-src-all@freebsd.org Thu Dec 28 03:04:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05365E9F8CE; Thu, 28 Dec 2017 03:04:38 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BBB35663D1; Thu, 28 Dec 2017 03:04:37 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBS34aeB061838; Thu, 28 Dec 2017 03:04:36 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBS34axE061837; Thu, 28 Dec 2017 03:04:36 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201712280304.vBS34axE061837@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 28 Dec 2017 03:04:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327260 - head/sys/dev/spibus X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/dev/spibus X-SVN-Commit-Revision: 327260 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 03:04:38 -0000 Author: pfg Date: Thu Dec 28 03:04:36 2017 New Revision: 327260 URL: https://svnweb.freebsd.org/changeset/base/327260 Log: SPDX: fix wrong license ID tag in dev/spibus. Modified: head/sys/dev/spibus/ofw_spibus.c Modified: head/sys/dev/spibus/ofw_spibus.c ============================================================================== --- head/sys/dev/spibus/ofw_spibus.c Thu Dec 28 01:31:28 2017 (r327259) +++ head/sys/dev/spibus/ofw_spibus.c Thu Dec 28 03:04:36 2017 (r327260) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-4-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2009, Nathan Whitehorn * Copyright (c) 2013 The FreeBSD Foundation From owner-svn-src-all@freebsd.org Thu Dec 28 03:10:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50502E9FFE0; Thu, 28 Dec 2017 03:10:58 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1AB7E668CE; Thu, 28 Dec 2017 03:10:58 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBS3AvpO063026; Thu, 28 Dec 2017 03:10:57 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBS3AvAv063025; Thu, 28 Dec 2017 03:10:57 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201712280310.vBS3AvAv063025@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 28 Dec 2017 03:10:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327261 - head/sys/dev/cesa X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/dev/cesa X-SVN-Commit-Revision: 327261 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 03:10:58 -0000 Author: pfg Date: Thu Dec 28 03:10:57 2017 New Revision: 327261 URL: https://svnweb.freebsd.org/changeset/base/327261 Log: SPDX: fix wrong license ID tag in dev/cesa. Modified: head/sys/dev/cesa/cesa.h Modified: head/sys/dev/cesa/cesa.h ============================================================================== --- head/sys/dev/cesa/cesa.h Thu Dec 28 03:04:36 2017 (r327260) +++ head/sys/dev/cesa/cesa.h Thu Dec 28 03:10:57 2017 (r327261) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-4-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (C) 2009-2011 Semihalf. * All rights reserved. From owner-svn-src-all@freebsd.org Thu Dec 28 05:33:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3BD68EA7999; Thu, 28 Dec 2017 05:33:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 063606B1B1; Thu, 28 Dec 2017 05:33:00 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBS5X0IB024030; Thu, 28 Dec 2017 05:33:00 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBS5X0eY024029; Thu, 28 Dec 2017 05:33:00 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712280533.vBS5X0eY024029@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 28 Dec 2017 05:33:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327262 - head/usr.sbin/binmiscctl X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.sbin/binmiscctl X-SVN-Commit-Revision: 327262 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 05:33:01 -0000 Author: imp Date: Thu Dec 28 05:32:59 2017 New Revision: 327262 URL: https://svnweb.freebsd.org/changeset/base/327262 Log: Don't leak resources on duplicate -m or -M arguments. Last one wins. CID: 1204385, 1204384 Modified: head/usr.sbin/binmiscctl/binmiscctl.c Modified: head/usr.sbin/binmiscctl/binmiscctl.c ============================================================================== --- head/usr.sbin/binmiscctl/binmiscctl.c Thu Dec 28 03:10:57 2017 (r327261) +++ head/usr.sbin/binmiscctl/binmiscctl.c Thu Dec 28 05:32:59 2017 (r327262) @@ -299,10 +299,12 @@ add_cmd(__unused int argc, char *argv[], ximgact_binmi break; case 'm': + free(magic); magic = strdup(optarg); break; case 'M': + free(mask); mask = strdup(optarg); xbe->xbe_flags |= IBF_USE_MASK; break; From owner-svn-src-all@freebsd.org Thu Dec 28 05:33:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3CFFEA79E9; Thu, 28 Dec 2017 05:33:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE1BF6B2F3; Thu, 28 Dec 2017 05:33:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBS5XJse024099; Thu, 28 Dec 2017 05:33:19 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBS5XJRC024098; Thu, 28 Dec 2017 05:33:19 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712280533.vBS5XJRC024098@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 28 Dec 2017 05:33:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327263 - head/usr.sbin/btxld X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.sbin/btxld X-SVN-Commit-Revision: 327263 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 05:33:21 -0000 Author: imp Date: Thu Dec 28 05:33:19 2017 New Revision: 327263 URL: https://svnweb.freebsd.org/changeset/base/327263 Log: Explicitly ignore return value from remove. We wouldn't do anything differently if we can't unlink the temporary file. Also, free the temporary file name when we set it to NULL. CID: 1006909, 719448 Modified: head/usr.sbin/btxld/btxld.c Modified: head/usr.sbin/btxld/btxld.c ============================================================================== --- head/usr.sbin/btxld/btxld.c Thu Dec 28 05:32:59 2017 (r327262) +++ head/usr.sbin/btxld/btxld.c Thu Dec 28 05:33:19 2017 (r327263) @@ -189,7 +189,7 @@ static void cleanup(void) { if (tname) - remove(tname); + (void)remove(tname); } /* @@ -287,6 +287,7 @@ btxld(const char *iname) err(2, "%s", tname); if (rename(tname, oname)) err(2, "%s: Can't rename to %s", tname, oname); + free((void*)(intptr_t)tname); tname = NULL; if (verbose) { printf(binfo, btx.btx_majver, btx.btx_minver, btx.btx_textsz, From owner-svn-src-all@freebsd.org Thu Dec 28 05:33:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50359EA7A2A; Thu, 28 Dec 2017 05:33:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18F176B32A; Thu, 28 Dec 2017 05:33:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBS5XPIQ024154; Thu, 28 Dec 2017 05:33:25 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBS5XOgr024152; Thu, 28 Dec 2017 05:33:24 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712280533.vBS5XOgr024152@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 28 Dec 2017 05:33:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327264 - head/usr.sbin/cpucontrol X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.sbin/cpucontrol X-SVN-Commit-Revision: 327264 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 05:33:26 -0000 Author: imp Date: Thu Dec 28 05:33:24 2017 New Revision: 327264 URL: https://svnweb.freebsd.org/changeset/base/327264 Log: Use proper failure path rather than just returning. CID: 1199354, 1006894, 1006893, 1006892 Modified: head/usr.sbin/cpucontrol/intel.c head/usr.sbin/cpucontrol/via.c Modified: head/usr.sbin/cpucontrol/intel.c ============================================================================== --- head/usr.sbin/cpucontrol/intel.c Thu Dec 28 05:33:19 2017 (r327263) +++ head/usr.sbin/cpucontrol/intel.c Thu Dec 28 05:33:24 2017 (r327264) @@ -261,7 +261,7 @@ matched: if (revision >= fw_header->revision) { WARNX(1, "skipping %s of rev %#x: up to date", path, fw_header->revision); - return; + goto fail; } fprintf(stderr, "%s: updating cpu %s from rev %#x to rev %#x... ", path, dev, revision, fw_header->revision); Modified: head/usr.sbin/cpucontrol/via.c ============================================================================== --- head/usr.sbin/cpucontrol/via.c Thu Dec 28 05:33:19 2017 (r327263) +++ head/usr.sbin/cpucontrol/via.c Thu Dec 28 05:33:24 2017 (r327264) @@ -140,7 +140,7 @@ via_update(const char *dev, const char *path) fd = open(path, O_RDONLY, 0); if (fd < 0) { WARN(0, "open(%s)", path); - return; + goto fail; } error = fstat(fd, &st); if (error != 0) { From owner-svn-src-all@freebsd.org Thu Dec 28 05:33:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CF0AEA7A75; Thu, 28 Dec 2017 05:33:32 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A268E6B418; Thu, 28 Dec 2017 05:33:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBS5XUsp024207; Thu, 28 Dec 2017 05:33:30 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBS5XT2O024205; Thu, 28 Dec 2017 05:33:29 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712280533.vBS5XT2O024205@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 28 Dec 2017 05:33:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327265 - head/usr.bin/rpcgen X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.bin/rpcgen X-SVN-Commit-Revision: 327265 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 05:33:33 -0000 Author: imp Date: Thu Dec 28 05:33:29 2017 New Revision: 327265 URL: https://svnweb.freebsd.org/changeset/base/327265 Log: Plug two resource leaks. CID: 92077, 92074 Modified: head/usr.bin/rpcgen/rpc_parse.c head/usr.bin/rpcgen/rpc_scan.c Modified: head/usr.bin/rpcgen/rpc_parse.c ============================================================================== --- head/usr.bin/rpcgen/rpc_parse.c Thu Dec 28 05:33:24 2017 (r327264) +++ head/usr.bin/rpcgen/rpc_parse.c Thu Dec 28 05:33:29 2017 (r327265) @@ -93,6 +93,7 @@ get_definition(void) def_const(defp); break; case TOK_EOF: + free(defp); return (NULL); default: error("definition keyword expected"); Modified: head/usr.bin/rpcgen/rpc_scan.c ============================================================================== --- head/usr.bin/rpcgen/rpc_scan.c Thu Dec 28 05:33:24 2017 (r327264) +++ head/usr.bin/rpcgen/rpc_scan.c Thu Dec 28 05:33:29 2017 (r327265) @@ -490,6 +490,7 @@ docppline(char *line, int *lineno, const char **fname) *p = 0; if (*file == 0) { *fname = NULL; + free(file); } else { *fname = file; } From owner-svn-src-all@freebsd.org Thu Dec 28 05:33:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18A16EA7AAD; Thu, 28 Dec 2017 05:33:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C26FD6B497; Thu, 28 Dec 2017 05:33:35 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBS5XYqj024260; Thu, 28 Dec 2017 05:33:34 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBS5XYQu024259; Thu, 28 Dec 2017 05:33:34 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712280533.vBS5XYQu024259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 28 Dec 2017 05:33:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327266 - head/usr.bin/rpcgen X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.bin/rpcgen X-SVN-Commit-Revision: 327266 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 05:33:36 -0000 Author: imp Date: Thu Dec 28 05:33:34 2017 New Revision: 327266 URL: https://svnweb.freebsd.org/changeset/base/327266 Log: Free some variables before they go out of scope. CID: 92074, 270099 Modified: head/usr.bin/rpcgen/rpc_main.c Modified: head/usr.bin/rpcgen/rpc_main.c ============================================================================== --- head/usr.bin/rpcgen/rpc_main.c Thu Dec 28 05:33:29 2017 (r327265) +++ head/usr.bin/rpcgen/rpc_main.c Thu Dec 28 05:33:34 2017 (r327266) @@ -484,7 +484,9 @@ generate_guard(const char *pathname) ; strcpy(guard, tmp); } + tmp = guard; guard = extendfile(guard, "_H_RPCGEN"); + free(tmp); return (guard); } @@ -502,13 +504,14 @@ h_output(const char *infile, const char *define, int e const char *guard; list *l; xdrfunc *xdrfuncp; + void *tmp = NULL; open_input(infile, define); outfilename = extend ? extendfile(infile, outfile) : outfile; open_output(infile, outfilename); add_warning(); if (outfilename || infile){ - guard = generate_guard(outfilename ? outfilename: infile); + guard = tmp = generate_guard(outfilename ? outfilename: infile); } else guard = "STDIN_"; @@ -574,6 +577,7 @@ h_output(const char *infile, const char *define, int e f_print(fout, "#endif\n"); f_print(fout, "\n#endif /* !_%s */\n", guard); + free(tmp); } /* From owner-svn-src-all@freebsd.org Thu Dec 28 05:33:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBB0EEA7B15; Thu, 28 Dec 2017 05:33:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 23D4B6B668; Thu, 28 Dec 2017 05:33:45 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBS5Xi5p024367; Thu, 28 Dec 2017 05:33:44 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBS5XiWm024366; Thu, 28 Dec 2017 05:33:44 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712280533.vBS5XiWm024366@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 28 Dec 2017 05:33:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327268 - head/usr.bin/column X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.bin/column X-SVN-Commit-Revision: 327268 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 05:33:47 -0000 Author: imp Date: Thu Dec 28 05:33:44 2017 New Revision: 327268 URL: https://svnweb.freebsd.org/changeset/base/327268 Log: Free data after we're done with it. CID: 271595, 275337, 1368743 Modified: head/usr.bin/column/column.c Modified: head/usr.bin/column/column.c ============================================================================== --- head/usr.bin/column/column.c Thu Dec 28 05:33:39 2017 (r327267) +++ head/usr.bin/column/column.c Thu Dec 28 05:33:44 2017 (r327268) @@ -270,7 +270,12 @@ maketbl(void) (void)wprintf(L"%ls%*ls", t->list[coloff], lens[coloff] - t->len[coloff] + 2, L" "); (void)wprintf(L"%ls\n", t->list[coloff]); + free(t->list); + free(t->len); } + free(lens); + free(cols); + free(tbl); } #define DEFNUM 1000 From owner-svn-src-all@freebsd.org Thu Dec 28 05:33:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F01CEA7B36; Thu, 28 Dec 2017 05:33:52 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C538E6B741; Thu, 28 Dec 2017 05:33:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBS5XniW024421; Thu, 28 Dec 2017 05:33:49 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBS5XnBw024420; Thu, 28 Dec 2017 05:33:49 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712280533.vBS5XnBw024420@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 28 Dec 2017 05:33:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327269 - head/usr.bin/msgs X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.bin/msgs X-SVN-Commit-Revision: 327269 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 05:33:52 -0000 Author: imp Date: Thu Dec 28 05:33:49 2017 New Revision: 327269 URL: https://svnweb.freebsd.org/changeset/base/327269 Log: Close cpfrom in an error case. CID: 271771 Modified: head/usr.bin/msgs/msgs.c Modified: head/usr.bin/msgs/msgs.c ============================================================================== --- head/usr.bin/msgs/msgs.c Thu Dec 28 05:33:44 2017 (r327268) +++ head/usr.bin/msgs/msgs.c Thu Dec 28 05:33:49 2017 (r327269) @@ -804,6 +804,7 @@ ask(const char *prompt) mailing = NO; fseeko(newmsg, oldpos, SEEK_SET); ask(prompt); + fclose(cpfrom); return; } From owner-svn-src-all@freebsd.org Thu Dec 28 05:34:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CFBBEA7BDD; Thu, 28 Dec 2017 05:34:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 830476B9C4; Thu, 28 Dec 2017 05:34:05 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBS5Y4IC024584; Thu, 28 Dec 2017 05:34:04 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBS5Y4pR024583; Thu, 28 Dec 2017 05:34:04 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712280534.vBS5Y4pR024583@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 28 Dec 2017 05:34:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327272 - head/usr.sbin/kgmon X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.sbin/kgmon X-SVN-Commit-Revision: 327272 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 05:34:07 -0000 Author: imp Date: Thu Dec 28 05:34:04 2017 New Revision: 327272 URL: https://svnweb.freebsd.org/changeset/base/327272 Log: Free zbuf when kflag is true too. CID: 273376 Modified: head/usr.sbin/kgmon/kgmon.c Modified: head/usr.sbin/kgmon/kgmon.c ============================================================================== --- head/usr.sbin/kgmon/kgmon.c Thu Dec 28 05:33:59 2017 (r327271) +++ head/usr.sbin/kgmon/kgmon.c Thu Dec 28 05:34:04 2017 (r327272) @@ -511,6 +511,7 @@ reset(struct kvmvars *kvp) if (kvm_write(kvp->kd, (u_long)kvp->gpm.tos, zbuf, kvp->gpm.tossize) != (ssize_t)kvp->gpm.tossize) errx(15, "tos zero: %s", kvm_geterr(kvp->kd)); + free(zbuf); return; } (void)seteuid(0); From owner-svn-src-all@freebsd.org Thu Dec 28 05:34:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92062EA7BA6; Thu, 28 Dec 2017 05:34:02 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 779406B8F7; Thu, 28 Dec 2017 05:34:00 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBS5XxaA024526; Thu, 28 Dec 2017 05:33:59 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBS5XxHn024525; Thu, 28 Dec 2017 05:33:59 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712280533.vBS5XxHn024525@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 28 Dec 2017 05:33:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327271 - head/lib/libutil X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/lib/libutil X-SVN-Commit-Revision: 327271 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 05:34:02 -0000 Author: imp Date: Thu Dec 28 05:33:59 2017 New Revision: 327271 URL: https://svnweb.freebsd.org/changeset/base/327271 Log: Close slave on fork error to prevent pty fd leak. CID: 978209 Modified: head/lib/libutil/pty.c Modified: head/lib/libutil/pty.c ============================================================================== --- head/lib/libutil/pty.c Thu Dec 28 05:33:54 2017 (r327270) +++ head/lib/libutil/pty.c Thu Dec 28 05:33:59 2017 (r327271) @@ -101,12 +101,13 @@ forkpty(int *amaster, char *name, struct termios *term return (-1); switch (pid = fork()) { case -1: + (void)close(slave); return (-1); case 0: /* * child */ - (void) close(master); + (void)close(master); login_tty(slave); return (0); } From owner-svn-src-all@freebsd.org Thu Dec 28 05:33:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A497EA7B61; Thu, 28 Dec 2017 05:33:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A61AC6B803; Thu, 28 Dec 2017 05:33:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBS5XsWJ024472; Thu, 28 Dec 2017 05:33:54 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBS5XsBA024471; Thu, 28 Dec 2017 05:33:54 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712280533.vBS5XsBA024471@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 28 Dec 2017 05:33:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327270 - head/sbin/pfctl X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/pfctl X-SVN-Commit-Revision: 327270 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 05:33:57 -0000 Author: imp Date: Thu Dec 28 05:33:54 2017 New Revision: 327270 URL: https://svnweb.freebsd.org/changeset/base/327270 Log: Free path before returnig. CID: 977827 Modified: head/sbin/pfctl/pfctl.c Modified: head/sbin/pfctl/pfctl.c ============================================================================== --- head/sbin/pfctl/pfctl.c Thu Dec 28 05:33:49 2017 (r327269) +++ head/sbin/pfctl/pfctl.c Thu Dec 28 05:33:54 2017 (r327270) @@ -1510,6 +1510,7 @@ pfctl_rules(int dev, char *filename, int opts, int opt if (pfctl_trans(dev, t, DIOCXCOMMIT, osize)) ERR("DIOCXCOMMIT"); } + free(path); return (0); _error: @@ -1519,6 +1520,7 @@ _error: err(1, "DIOCXROLLBACK"); exit(1); } else { /* sub ruleset */ + free(path); return (-1); } From owner-svn-src-all@freebsd.org Thu Dec 28 05:34:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38286EA7BFB; Thu, 28 Dec 2017 05:34:12 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 53CE76BA7B; Thu, 28 Dec 2017 05:34:09 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBS5Y8Ic024635; Thu, 28 Dec 2017 05:34:08 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBS5Y8Cw024634; Thu, 28 Dec 2017 05:34:08 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712280534.vBS5Y8Cw024634@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 28 Dec 2017 05:34:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327273 - head/sbin/fsdb X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/fsdb X-SVN-Commit-Revision: 327273 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 05:34:12 -0000 Author: imp Date: Thu Dec 28 05:34:08 2017 New Revision: 327273 URL: https://svnweb.freebsd.org/changeset/base/327273 Log: Plug memory leak by freeing wantedblk{32,64}. CID: 273655, 273656 Modified: head/sbin/fsdb/fsdb.c Modified: head/sbin/fsdb/fsdb.c ============================================================================== --- head/sbin/fsdb/fsdb.c Thu Dec 28 05:34:04 2017 (r327272) +++ head/sbin/fsdb/fsdb.c Thu Dec 28 05:34:08 2017 (r327273) @@ -565,6 +565,8 @@ CMDFUNCSTART(findblk) end: curinum = ocurrent; curinode = ginode(curinum); + free(wantedblk32); + free(wantedblk64); return 0; } From owner-svn-src-all@freebsd.org Thu Dec 28 05:34:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5861CEA7C45; Thu, 28 Dec 2017 05:34:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DA7B26BC6B; Thu, 28 Dec 2017 05:34:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBS5YJ9b024742; Thu, 28 Dec 2017 05:34:19 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBS5YJ8F024741; Thu, 28 Dec 2017 05:34:19 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712280534.vBS5YJ8F024741@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 28 Dec 2017 05:34:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327275 - head/sbin/newfs_msdos X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/newfs_msdos X-SVN-Commit-Revision: 327275 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 05:34:23 -0000 Author: imp Date: Thu Dec 28 05:34:19 2017 New Revision: 327275 URL: https://svnweb.freebsd.org/changeset/base/327275 Log: Close fd and fd1 before returning now that we're done with them. CID: 978234, 978236 Modified: head/sbin/newfs_msdos/mkfs_msdos.c Modified: head/sbin/newfs_msdos/mkfs_msdos.c ============================================================================== --- head/sbin/newfs_msdos/mkfs_msdos.c Thu Dec 28 05:34:14 2017 (r327274) +++ head/sbin/newfs_msdos/mkfs_msdos.c Thu Dec 28 05:34:19 2017 (r327275) @@ -247,6 +247,7 @@ mkfs_msdos(const char *fname, const char *dtype, const img = NULL; rv = -1; + fd = fd1 = -1; if (o.block_size && o.sectors_per_cluster) { warnx("Cannot specify both block size and sectors per cluster"); @@ -716,6 +717,8 @@ mkfs_msdos(const char *fname, const char *dtype, const rv = 0; done: free(img); + close(fd); + close(fd1); return rv; } From owner-svn-src-all@freebsd.org Thu Dec 28 05:34:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15317EA7D14; Thu, 28 Dec 2017 05:34:44 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C32396BFCD; Thu, 28 Dec 2017 05:34:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBS5Yc9g024953; Thu, 28 Dec 2017 05:34:38 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBS5Yc5t024952; Thu, 28 Dec 2017 05:34:38 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712280534.vBS5Yc5t024952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 28 Dec 2017 05:34:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327279 - head/usr.sbin/fwcontrol X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.sbin/fwcontrol X-SVN-Commit-Revision: 327279 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 05:34:45 -0000 Author: imp Date: Thu Dec 28 05:34:38 2017 New Revision: 327279 URL: https://svnweb.freebsd.org/changeset/base/327279 Log: Close fd when we're done dv-sending the file. CID: 978413 Modified: head/usr.sbin/fwcontrol/fwdv.c Modified: head/usr.sbin/fwcontrol/fwdv.c ============================================================================== --- head/usr.sbin/fwcontrol/fwdv.c Thu Dec 28 05:34:34 2017 (r327278) +++ head/usr.sbin/fwcontrol/fwdv.c Thu Dec 28 05:34:38 2017 (r327279) @@ -417,4 +417,5 @@ send_end: + (end.tv_usec - start.tv_usec) * 1e-6; fprintf(stderr, "%d frames, %.2f secs, %.2f frames/sec\n", frames, rtime, frames/rtime); + close(fd); } From owner-svn-src-all@freebsd.org Thu Dec 28 05:34:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B245EEA7CE0; Thu, 28 Dec 2017 05:34:41 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B7D4A6BF0E; Thu, 28 Dec 2017 05:34:35 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBS5YYW2024899; Thu, 28 Dec 2017 05:34:34 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBS5YYAS024898; Thu, 28 Dec 2017 05:34:34 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712280534.vBS5YYAS024898@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 28 Dec 2017 05:34:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327278 - head/usr.bin/showmount X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.bin/showmount X-SVN-Commit-Revision: 327278 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 05:34:41 -0000 Author: imp Date: Thu Dec 28 05:34:34 2017 New Revision: 327278 URL: https://svnweb.freebsd.org/changeset/base/327278 Log: Free mp on a couple of error paths. CID: 978387 Modified: head/usr.bin/showmount/showmount.c Modified: head/usr.bin/showmount/showmount.c ============================================================================== --- head/usr.bin/showmount/showmount.c Thu Dec 28 05:34:29 2017 (r327277) +++ head/usr.bin/showmount/showmount.c Thu Dec 28 05:34:34 2017 (r327278) @@ -279,11 +279,15 @@ xdr_mntdump(XDR *xdrsp, struct mountlist **mlp) return (0); mp->ml_left = mp->ml_right = (struct mountlist *)0; strp = mp->ml_host; - if (!xdr_string(xdrsp, &strp, MNTNAMLEN)) + if (!xdr_string(xdrsp, &strp, MNTNAMLEN)) { + free(mp); return (0); + } strp = mp->ml_dirp; - if (!xdr_string(xdrsp, &strp, MNTPATHLEN)) + if (!xdr_string(xdrsp, &strp, MNTPATHLEN)) { + free(mp); return (0); + } /* * Build a binary tree on sorted order of either host or dirp. From owner-svn-src-all@freebsd.org Thu Dec 28 05:34:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F506EA7C7F; Thu, 28 Dec 2017 05:34:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 74C8F6BD26; Thu, 28 Dec 2017 05:34:25 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBS5YOi3024794; Thu, 28 Dec 2017 05:34:24 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBS5YOfr024793; Thu, 28 Dec 2017 05:34:24 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712280534.vBS5YOfr024793@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 28 Dec 2017 05:34:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327276 - head/sbin/routed X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/routed X-SVN-Commit-Revision: 327276 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 05:34:28 -0000 Author: imp Date: Thu Dec 28 05:34:24 2017 New Revision: 327276 URL: https://svnweb.freebsd.org/changeset/base/327276 Log: When bind fails, make sure we closed the socket we tried to bind the address to. CID: 978244 Modified: head/sbin/routed/main.c Modified: head/sbin/routed/main.c ============================================================================== --- head/sbin/routed/main.c Thu Dec 28 05:34:19 2017 (r327275) +++ head/sbin/routed/main.c Thu Dec 28 05:34:24 2017 (r327276) @@ -667,6 +667,7 @@ get_rip_sock(naddr addr, if (bind(s, (struct sockaddr *)&rsin, sizeof(rsin)) < 0) { if (serious) BADERR(errno != EADDRINUSE, "bind(rip_sock)"); + close(s); return -1; } fix_sock(s,"rip_sock"); From owner-svn-src-all@freebsd.org Thu Dec 28 05:33:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B257AEA7AF1; Thu, 28 Dec 2017 05:33:42 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DACE86B5A5; Thu, 28 Dec 2017 05:33:40 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBS5XdYa024313; Thu, 28 Dec 2017 05:33:39 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBS5XduV024312; Thu, 28 Dec 2017 05:33:39 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712280533.vBS5XduV024312@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 28 Dec 2017 05:33:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327267 - head/usr.bin/tcopy X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.bin/tcopy X-SVN-Commit-Revision: 327267 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 05:33:43 -0000 Author: imp Date: Thu Dec 28 05:33:39 2017 New Revision: 327267 URL: https://svnweb.freebsd.org/changeset/base/327267 Log: Free inb on error return. CID: 270099 Modified: head/usr.bin/tcopy/tcopy.c Modified: head/usr.bin/tcopy/tcopy.c ============================================================================== --- head/usr.bin/tcopy/tcopy.c Thu Dec 28 05:33:34 2017 (r327266) +++ head/usr.bin/tcopy/tcopy.c Thu Dec 28 05:33:39 2017 (r327267) @@ -263,6 +263,7 @@ r2: if (inn != outn) { if (!inn) { if (eot++) { fprintf(msg, "tcopy: tapes are identical.\n"); + free(inb); return; } } else { From owner-svn-src-all@freebsd.org Thu Dec 28 05:34:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B03FEA7C1C; Thu, 28 Dec 2017 05:34:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 394A76BB7F; Thu, 28 Dec 2017 05:34:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBS5YE2D024689; Thu, 28 Dec 2017 05:34:14 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBS5YEgr024688; Thu, 28 Dec 2017 05:34:14 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712280534.vBS5YEgr024688@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 28 Dec 2017 05:34:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327274 - head/usr.sbin/ndiscvt X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.sbin/ndiscvt X-SVN-Commit-Revision: 327274 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 05:34:19 -0000 Author: imp Date: Thu Dec 28 05:34:14 2017 New Revision: 327274 URL: https://svnweb.freebsd.org/changeset/base/327274 Log: Don't leak outfile. Free it before we return from bincvt. CID: 273685 Modified: head/usr.sbin/ndiscvt/ndiscvt.c Modified: head/usr.sbin/ndiscvt/ndiscvt.c ============================================================================== --- head/usr.sbin/ndiscvt/ndiscvt.c Thu Dec 28 05:34:08 2017 (r327273) +++ head/usr.sbin/ndiscvt/ndiscvt.c Thu Dec 28 05:34:14 2017 (r327274) @@ -213,6 +213,7 @@ bincvt(char *sysfile, char *outfile, void *img, int fs tname, sysfile, tname, tname, sysfile, outfile, outfile); printf("%s", sysbuf); system(sysbuf); + free(outfile); return; } From owner-svn-src-all@freebsd.org Thu Dec 28 05:34:39 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 909CDEA7CC4; Thu, 28 Dec 2017 05:34:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 622076BE1E; Thu, 28 Dec 2017 05:34:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBS5YTKf024848; Thu, 28 Dec 2017 05:34:29 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBS5YTcr024847; Thu, 28 Dec 2017 05:34:29 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712280534.vBS5YTcr024847@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 28 Dec 2017 05:34:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327277 - head/usr.bin/wall X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.bin/wall X-SVN-Commit-Revision: 327277 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 05:34:39 -0000 Author: imp Date: Thu Dec 28 05:34:29 2017 New Revision: 327277 URL: https://svnweb.freebsd.org/changeset/base/327277 Log: Close the fp rather than the fd since we fdopen the fd so we don't leak the FILE *. CID: 978383 Modified: head/usr.bin/wall/wall.c Modified: head/usr.bin/wall/wall.c ============================================================================== --- head/usr.bin/wall/wall.c Thu Dec 28 05:34:24 2017 (r327276) +++ head/usr.bin/wall/wall.c Thu Dec 28 05:34:29 2017 (r327277) @@ -290,5 +290,5 @@ makemsg(char *fname) err(1, "out of memory"); if ((int)fread(mbuf, sizeof(*mbuf), mbufsize, fp) != mbufsize) err(1, "can't read temporary file"); - (void)close(fd); + fclose(fp); } From owner-svn-src-all@freebsd.org Thu Dec 28 07:31:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69EB3EAC89B; Thu, 28 Dec 2017 07:31:17 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A0C66FC0E; Thu, 28 Dec 2017 07:31:17 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBS7VG57071460; Thu, 28 Dec 2017 07:31:16 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBS7VEhT071440; Thu, 28 Dec 2017 07:31:14 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201712280731.vBS7VEhT071440@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 28 Dec 2017 07:31:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327280 - in head/sys: arm/allwinner arm/altera/socfpga arm/amlogic/aml8726 arm/annapurna/alpine arm/broadcom/bcm2835 arm/freescale/imx arm/freescale/vybrid arm/lpc arm/mv arm/nvidia/te... X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: arm/allwinner arm/altera/socfpga arm/amlogic/aml8726 arm/annapurna/alpine arm/broadcom/bcm2835 arm/freescale/imx arm/freescale/vybrid arm/lpc arm/mv arm/nvidia/tegra124 arm/qemu arm/ralin... X-SVN-Commit-Revision: 327280 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 07:31:17 -0000 Author: manu Date: Thu Dec 28 07:31:14 2017 New Revision: 327280 URL: https://svnweb.freebsd.org/changeset/base/327280 Log: Revert r327250 as it broke the build for some armv6 kernel and all armv4/5 Reported by: ian Modified: head/sys/arm/allwinner/files.allwinner head/sys/arm/altera/socfpga/files.socfpga head/sys/arm/amlogic/aml8726/files.aml8726 head/sys/arm/annapurna/alpine/files.alpine head/sys/arm/broadcom/bcm2835/files.bcm283x head/sys/arm/freescale/imx/files.imx5 head/sys/arm/freescale/imx/files.imx6 head/sys/arm/freescale/vybrid/files.vybrid head/sys/arm/lpc/files.lpc head/sys/arm/mv/files.mv head/sys/arm/nvidia/tegra124/files.tegra124 head/sys/arm/qemu/files.qemu head/sys/arm/ralink/files.ralink head/sys/arm/rockchip/files.rk30xx head/sys/arm/samsung/exynos/files.exynos5 head/sys/arm/ti/files.ti head/sys/arm/versatile/files.versatile head/sys/arm/xilinx/files.zynq7 head/sys/conf/files.arm Modified: head/sys/arm/allwinner/files.allwinner ============================================================================== --- head/sys/arm/allwinner/files.allwinner Thu Dec 28 05:34:38 2017 (r327279) +++ head/sys/arm/allwinner/files.allwinner Thu Dec 28 07:31:14 2017 (r327280) @@ -1,4 +1,5 @@ # $FreeBSD$ +kern/kern_clocksource.c standard arm/allwinner/a10_ahci.c optional ahci arm/allwinner/a10_codec.c optional sound Modified: head/sys/arm/altera/socfpga/files.socfpga ============================================================================== --- head/sys/arm/altera/socfpga/files.socfpga Thu Dec 28 05:34:38 2017 (r327279) +++ head/sys/arm/altera/socfpga/files.socfpga Thu Dec 28 07:31:14 2017 (r327280) @@ -1,5 +1,7 @@ # $FreeBSD$ +kern/kern_clocksource.c standard + arm/altera/socfpga/socfpga_common.c standard arm/altera/socfpga/socfpga_machdep.c standard arm/altera/socfpga/socfpga_manager.c standard Modified: head/sys/arm/amlogic/aml8726/files.aml8726 ============================================================================== --- head/sys/arm/amlogic/aml8726/files.aml8726 Thu Dec 28 05:34:38 2017 (r327279) +++ head/sys/arm/amlogic/aml8726/files.aml8726 Thu Dec 28 07:31:14 2017 (r327280) @@ -1,5 +1,7 @@ #$FreeBSD$ +kern/kern_clocksource.c standard + arm/amlogic/aml8726/aml8726_l2cache.c standard arm/amlogic/aml8726/aml8726_machdep.c standard Modified: head/sys/arm/annapurna/alpine/files.alpine ============================================================================== --- head/sys/arm/annapurna/alpine/files.alpine Thu Dec 28 05:34:38 2017 (r327279) +++ head/sys/arm/annapurna/alpine/files.alpine Thu Dec 28 07:31:14 2017 (r327280) @@ -1,5 +1,7 @@ # $FreeBSD$ +kern/kern_clocksource.c standard + arm/versatile/sp804.c standard dev/uart/uart_dev_ns8250.c optional uart Modified: head/sys/arm/broadcom/bcm2835/files.bcm283x ============================================================================== --- head/sys/arm/broadcom/bcm2835/files.bcm283x Thu Dec 28 05:34:38 2017 (r327279) +++ head/sys/arm/broadcom/bcm2835/files.bcm283x Thu Dec 28 07:31:14 2017 (r327280) @@ -17,6 +17,8 @@ arm/broadcom/bcm2835/bcm2835_vcio.c standard arm/broadcom/bcm2835/bcm2835_wdog.c standard arm/broadcom/bcm2835/bcm283x_dwc_fdt.c optional dwcotg fdt +kern/kern_clocksource.c standard + dev/mbox/mbox_if.m standard arm/broadcom/bcm2835/bcm2835_audio.c optional sound vchiq \ Modified: head/sys/arm/freescale/imx/files.imx5 ============================================================================== --- head/sys/arm/freescale/imx/files.imx5 Thu Dec 28 05:34:38 2017 (r327279) +++ head/sys/arm/freescale/imx/files.imx5 Thu Dec 28 07:31:14 2017 (r327280) @@ -1,4 +1,5 @@ # $FreeBSD$ +kern/kern_clocksource.c standard # Init arm/freescale/imx/imx_common.c standard Modified: head/sys/arm/freescale/imx/files.imx6 ============================================================================== --- head/sys/arm/freescale/imx/files.imx6 Thu Dec 28 05:34:38 2017 (r327279) +++ head/sys/arm/freescale/imx/files.imx6 Thu Dec 28 07:31:14 2017 (r327280) @@ -1,6 +1,11 @@ # $FreeBSD$ # +# Standard ARM support. +# +kern/kern_clocksource.c standard + +# # Standard imx6 devices and support. # arm/freescale/fsl_ocotp.c standard Modified: head/sys/arm/freescale/vybrid/files.vybrid ============================================================================== --- head/sys/arm/freescale/vybrid/files.vybrid Thu Dec 28 05:34:38 2017 (r327279) +++ head/sys/arm/freescale/vybrid/files.vybrid Thu Dec 28 07:31:14 2017 (r327280) @@ -1,5 +1,7 @@ # $FreeBSD$ +kern/kern_clocksource.c standard + arm/freescale/vybrid/vf_machdep.c standard arm/freescale/vybrid/vf_ccm.c standard arm/freescale/vybrid/vf_anadig.c standard Modified: head/sys/arm/lpc/files.lpc ============================================================================== --- head/sys/arm/lpc/files.lpc Thu Dec 28 05:34:38 2017 (r327279) +++ head/sys/arm/lpc/files.lpc Thu Dec 28 07:31:14 2017 (r327280) @@ -13,3 +13,4 @@ arm/lpc/lpc_spi.c optional lpcspi arm/lpc/lpc_dmac.c optional dmac arm/lpc/ssd1289.c optional ssd1289 dev/uart/uart_dev_lpc.c optional uart +kern/kern_clocksource.c standard Modified: head/sys/arm/mv/files.mv ============================================================================== --- head/sys/arm/mv/files.mv Thu Dec 28 05:34:38 2017 (r327279) +++ head/sys/arm/mv/files.mv Thu Dec 28 07:31:14 2017 (r327280) @@ -33,3 +33,5 @@ dev/uart/uart_dev_snps.c optional uart dev/usb/controller/ehci_mv.c optional ehci dev/usb/controller/xhci_mv.c optional xhci dev/ahci/ahci_mv_fdt.c optional ahci + +kern/kern_clocksource.c standard Modified: head/sys/arm/nvidia/tegra124/files.tegra124 ============================================================================== --- head/sys/arm/nvidia/tegra124/files.tegra124 Thu Dec 28 05:34:38 2017 (r327279) +++ head/sys/arm/nvidia/tegra124/files.tegra124 Thu Dec 28 07:31:14 2017 (r327280) @@ -1,6 +1,11 @@ # $FreeBSD$ # +# Standard ARM support. +# +kern/kern_clocksource.c standard + +# # Standard tegra124 devices and support. # arm/nvidia/tegra124/tegra124_machdep.c standard Modified: head/sys/arm/qemu/files.qemu ============================================================================== --- head/sys/arm/qemu/files.qemu Thu Dec 28 05:34:38 2017 (r327279) +++ head/sys/arm/qemu/files.qemu Thu Dec 28 07:31:14 2017 (r327280) @@ -1,6 +1,11 @@ # $FreeBSD$ # +# Standard ARM support. +# +kern/kern_clocksource.c standard + +# # Standard qemu virt devices and support. # arm/qemu/virt_machdep.c standard Modified: head/sys/arm/ralink/files.ralink ============================================================================== --- head/sys/arm/ralink/files.ralink Thu Dec 28 05:34:38 2017 (r327279) +++ head/sys/arm/ralink/files.ralink Thu Dec 28 07:31:14 2017 (r327280) @@ -5,3 +5,5 @@ arm/ralink/rt1310_gpio.c optional rt1310gpio arm/ralink/rt1310_timer.c standard arm/ralink/if_fv.c optional fv +kern/kern_clocksource.c standard + Modified: head/sys/arm/rockchip/files.rk30xx ============================================================================== --- head/sys/arm/rockchip/files.rk30xx Thu Dec 28 05:34:38 2017 (r327279) +++ head/sys/arm/rockchip/files.rk30xx Thu Dec 28 07:31:14 2017 (r327280) @@ -1,4 +1,5 @@ # $FreeBSD$ +kern/kern_clocksource.c standard arm/rockchip/rk30xx_machdep.c standard arm/rockchip/rk30xx_pmu.c standard Modified: head/sys/arm/samsung/exynos/files.exynos5 ============================================================================== --- head/sys/arm/samsung/exynos/files.exynos5 Thu Dec 28 05:34:38 2017 (r327279) +++ head/sys/arm/samsung/exynos/files.exynos5 Thu Dec 28 07:31:14 2017 (r327280) @@ -1,5 +1,7 @@ # $FreeBSD$ +kern/kern_clocksource.c standard + arm/samsung/exynos/exynos5_mct.c standard arm/samsung/exynos/exynos5_mp.c optional smp arm/samsung/exynos/exynos5_machdep.c standard Modified: head/sys/arm/ti/files.ti ============================================================================== --- head/sys/arm/ti/files.ti Thu Dec 28 05:34:38 2017 (r327279) +++ head/sys/arm/ti/files.ti Thu Dec 28 07:31:14 2017 (r327280) @@ -1,5 +1,7 @@ #$FreeBSD$ +kern/kern_clocksource.c standard + arm/ti/ti_cpuid.c standard arm/ti/ti_hwmods.c standard arm/ti/ti_machdep.c standard Modified: head/sys/arm/versatile/files.versatile ============================================================================== --- head/sys/arm/versatile/files.versatile Thu Dec 28 05:34:38 2017 (r327279) +++ head/sys/arm/versatile/files.versatile Thu Dec 28 07:31:14 2017 (r327280) @@ -8,3 +8,5 @@ arm/versatile/versatile_common.c standard arm/versatile/versatile_pci.c optional pci arm/versatile/versatile_scm.c standard arm/versatile/versatile_sic.c standard + +kern/kern_clocksource.c standard Modified: head/sys/arm/xilinx/files.zynq7 ============================================================================== --- head/sys/arm/xilinx/files.zynq7 Thu Dec 28 05:34:38 2017 (r327279) +++ head/sys/arm/xilinx/files.zynq7 Thu Dec 28 07:31:14 2017 (r327280) @@ -3,6 +3,8 @@ # # $FreeBSD$ +kern/kern_clocksource.c standard + arm/xilinx/zy7_machdep.c standard arm/xilinx/zy7_l2cache.c standard arm/xilinx/zy7_slcr.c standard Modified: head/sys/conf/files.arm ============================================================================== --- head/sys/conf/files.arm Thu Dec 28 05:34:38 2017 (r327279) +++ head/sys/conf/files.arm Thu Dec 28 07:31:14 2017 (r327280) @@ -145,7 +145,6 @@ font.h optional sc \ compile-with "uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x16.fnt && file2c 'u_char dflt_font_16[16*256] = {' '};' < ${SC_DFLT_FONT}-8x16 > font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x14.fnt && file2c 'u_char dflt_font_14[14*256] = {' '};' < ${SC_DFLT_FONT}-8x14 >> font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x8.fnt && file2c 'u_char dflt_font_8[8*256] = {' '};' < ${SC_DFLT_FONT}-8x8 >> font.h" \ no-obj no-implicit-rule before-depend \ clean "font.h ${SC_DFLT_FONT}-8x14 ${SC_DFLT_FONT}-8x16 ${SC_DFLT_FONT}-8x8" -kern/kern_clocksource.c standard kern/msi_if.m optional intrng kern/pic_if.m optional intrng kern/subr_busdma_bufalloc.c standard From owner-svn-src-all@freebsd.org Thu Dec 28 08:22:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E182EAED6B; Thu, 28 Dec 2017 08:22:28 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 65728713CD; Thu, 28 Dec 2017 08:22:28 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBS8MR8v095326; Thu, 28 Dec 2017 08:22:27 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBS8MQol095318; Thu, 28 Dec 2017 08:22:26 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201712280822.vBS8MQol095318@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 28 Dec 2017 08:22:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327281 - in head: bin/sh/tests/builtins share/man/man4 share/man/man5 share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: in head: bin/sh/tests/builtins share/man/man4 share/man/man5 share/man/man9 X-SVN-Commit-Revision: 327281 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 08:22:28 -0000 Author: eadler Date: Thu Dec 28 08:22:26 2017 New Revision: 327281 URL: https://svnweb.freebsd.org/changeset/base/327281 Log: Fix a few speelling errors - man pages - bin/sh Reviewed by: jilles Modified: head/bin/sh/tests/builtins/var-assign.0 head/share/man/man4/ip.4 head/share/man/man4/nand.4 head/share/man/man5/rc.conf.5 head/share/man/man9/iflibdd.9 head/share/man/man9/iflibtxrx.9 head/share/man/man9/uio.9 Modified: head/bin/sh/tests/builtins/var-assign.0 ============================================================================== --- head/bin/sh/tests/builtins/var-assign.0 Thu Dec 28 07:31:14 2017 (r327280) +++ head/bin/sh/tests/builtins/var-assign.0 Thu Dec 28 08:22:26 2017 (r327281) @@ -47,7 +47,7 @@ do ${SH} -c "VAR=1; VAR=0 ${cmd}; exit \${VAR}" >/dev/null 2>&1 done -# For other built-ins and utilites they do not. +# For other built-ins and utilities they do not. set -- ${UTILS} for cmd in "$@" do Modified: head/share/man/man4/ip.4 ============================================================================== --- head/share/man/man4/ip.4 Thu Dec 28 07:31:14 2017 (r327280) +++ head/share/man/man4/ip.4 Thu Dec 28 08:22:26 2017 (r327281) @@ -224,7 +224,7 @@ or the socket should be bound to a local address and t .Dv IP_SENDSRCADDR should be .Dv INADDR_ANY . -In the latter case bound address is overriden via generic source address +In the latter case bound address is overridden via generic source address selection logic, which would choose IP address of interface closest to destination. .Pp Modified: head/share/man/man4/nand.4 ============================================================================== --- head/share/man/man4/nand.4 Thu Dec 28 07:31:14 2017 (r327280) +++ head/share/man/man4/nand.4 Thu Dec 28 08:22:26 2017 (r327281) @@ -41,7 +41,7 @@ The .Fx .Nm framework consists of a set of interfaces that aim to provide an extensible, -object oriented environement for NAND controllers and NAND Flash memory chips +object oriented environment for NAND controllers and NAND Flash memory chips from various hardware vendors, and to allow for uniform and flexible management of the NAND devices. It comprises of the following major components: Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Thu Dec 28 07:31:14 2017 (r327280) +++ head/share/man/man5/rc.conf.5 Thu Dec 28 08:22:26 2017 (r327281) @@ -989,7 +989,7 @@ is set to the list of instances that should be started at system boot time. If .Va pflog_instances -is set, for each whitespace-seperated +is set, for each whitespace-separated .Ar element in the list, .Ao Ar element Ac Ns Va _dev @@ -1031,7 +1031,7 @@ If multiple instances of .Xr ftp-proxy 8 are desired at boot time, .Va ftpproxy_instances -should contain a whitespace-seperated list of instance names. +should contain a whitespace-separated list of instance names. For each .Ar element in the list, a variable named Modified: head/share/man/man9/iflibdd.9 ============================================================================== --- head/share/man/man9/iflibdd.9 Thu Dec 28 07:31:14 2017 (r327280) +++ head/share/man/man9/iflibdd.9 Thu Dec 28 08:22:26 2017 (r327281) @@ -179,7 +179,7 @@ .Fc .Sh FUNCTIONS The above named functions are device dependent configuration functions. -These routines are registerd with iflib by the driver and are called from the +These routines are registered with iflib by the driver and are called from the corresponding iflib function to configure device specific functions and registers. .Ss Device Dependent Functions Modified: head/share/man/man9/iflibtxrx.9 ============================================================================== --- head/share/man/man9/iflibtxrx.9 Thu Dec 28 07:31:14 2017 (r327280) +++ head/share/man/man9/iflibtxrx.9 Thu Dec 28 08:22:26 2017 (r327281) @@ -190,7 +190,7 @@ event. .Sh FUNCTIONS All function calls are associated exclusively with either packet transmission or receipt. -The void *sc passed as the first arguement to all of the following functions +The void *sc passed as the first argument to all of the following functions represents the driver's softc. .Ss Transmit Packet Functions .Bl -ohang -offset indent Modified: head/share/man/man9/uio.9 ============================================================================== --- head/share/man/man9/uio.9 Thu Dec 28 07:31:14 2017 (r327280) +++ head/share/man/man9/uio.9 Thu Dec 28 08:22:26 2017 (r327281) @@ -149,7 +149,7 @@ transfers when the request partially overlaps the buff When .Va uio_offset is greater than or equal to the buffer size, the result is success -with no bytes transfered, effectively signaling EOF. +with no bytes transferred, effectively signaling EOF. .Sh RETURN VALUES On success .Fn uiomove , From owner-svn-src-all@freebsd.org Thu Dec 28 08:25:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35CDFEAEFF0; Thu, 28 Dec 2017 08:25:49 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D423715DB; Thu, 28 Dec 2017 08:25:48 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBS8Pm1T095483; Thu, 28 Dec 2017 08:25:48 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBS8PmCh095482; Thu, 28 Dec 2017 08:25:48 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201712280825.vBS8PmCh095482@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 28 Dec 2017 08:25:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327282 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 327282 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 08:25:49 -0000 Author: eadler Date: Thu Dec 28 08:25:47 2017 New Revision: 327282 URL: https://svnweb.freebsd.org/changeset/base/327282 Log: Update pci_vendors to 2017.12.20 Modified: head/share/misc/pci_vendors Modified: head/share/misc/pci_vendors ============================================================================== --- head/share/misc/pci_vendors Thu Dec 28 08:22:26 2017 (r327281) +++ head/share/misc/pci_vendors Thu Dec 28 08:25:47 2017 (r327282) @@ -3,8 +3,8 @@ # # List of PCI ID's # -# Version: 2017.12.06 -# Date: 2017-12-06 03:15:02 +# Version: 2017.12.20 +# Date: 2017-12-20 03:15:01 # # Maintained by Albert Pool, Martin Mares, and other volunteers from # the PCI ID Project at http://pci-ids.ucw.cz/. @@ -586,6 +586,7 @@ 0096 SAS3004 PCI-Express Fusion-MPT SAS-3 0097 SAS3008 PCI-Express Fusion-MPT SAS-3 1000 3090 SAS9311-8i + 1000 30a0 SAS9300-8e 1000 30e0 SAS9300-8i 1000 3130 SAS 9300-16i 1028 1f45 HBA330 Adapter @@ -2508,6 +2509,7 @@ 6842 Thames LE [Radeon HD 7000M Series] 6843 Thames [Radeon HD 7670M] 6861 Vega 10 XT [Radeon PRO WX 9100] + 6862 Vega 10 XT [Radeon PRO SSG] 6863 Vega 10 XTX [Radeon Vega Frontier Edition] 687f Vega 10 XT [Radeon RX Vega 64] 6888 Cypress XT [FirePro V8800] @@ -4043,6 +4045,11 @@ 1423 Family 15h (Models 30h-3fh) I/O Memory Management Unit 1424 Family 15h (Models 30h-3fh) Processor Root Port 1426 Family 15h (Models 30h-3fh) Processor Root Port + 142e Liverpool Processor Function 0 + 142f Liverpool Processor Function 1 + 1430 Liverpool Processor Function 2 + 1431 Liverpool Processor Function 3 + 1432 Liverpool Processor Function 4 1436 Liverpool Processor Root Complex 1437 Liverpool I/O Memory Management Unit 1438 Liverpool Processor Root Port @@ -5652,6 +5659,22 @@ 90a3 Aeolia Memory (DDR3/SPM) 90a4 Aeolia USB 3.0 xHCI Host Controller 90bc SxS Pro+ memory card + 90c8 Belize ACPI + 90c9 Belize Ethernet Controller + 90ca Belize SATA AHCI Controller + 90cb Belize SD/MMC Host Controller + 90cc Belize PCI Express Glue and Miscellaneous Devices + 90cd Belize DMA Controller + 90ce Belize Memory (DDR3/SPM) + 90cf Belize USB 3.0 xHCI Host Controller + 90d7 Baikal ACPI + 90d8 Baikal Ethernet Controller + 90d9 Baikal SATA AHCI Controller + 90da Baikal SD/MMC Host Controller + 90db Baikal PCI Express Glue and Miscellaneous Devices + 90dc Baikal DMA Controller + 90dd Baikal Memory (DDR3/SPM) + 90de Baikal USB 3.0 xHCI Host Controller 104e Oak Technology, Inc 0017 OTI-64017 0107 OTI-107 [Spitfire] @@ -10836,11 +10859,12 @@ 13d8 GM204M [GeForce GTX 970M] 13d9 GM204M [GeForce GTX 965M] 13da GM204M [GeForce GTX 980 Mobile] - 13e7 GM204 [GeForce GTX 980 Engineering Sample] + 13e7 GM204GL [GeForce GTX 980 Engineering Sample] 13f0 GM204GL [Quadro M5000] 13f1 GM204GL [Quadro M4000] 13f2 GM204GL [Tesla M60] 13f3 GM204GL [Tesla M6] + 10de 1184 GRID M6-8Q 13f8 GM204GLM [Quadro M5000M / M5000 SE] 13f9 GM204GLM [Quadro M4000M] 13fa GM204GLM [Quadro M3000M] @@ -10939,7 +10963,7 @@ 1cb3 GP107GL [Quadro P400] 1d01 GP108 [GeForce GT 1030] 1d10 GP108M [GeForce MX150] - 1d81 GV100 + 1d81 GV100 [TITAN V] 1db1 GV100 [Tesla V100 SXM2] 1db4 GV100 [Tesla V100 PCIe] 10df Emulex Corporation @@ -15644,6 +15668,7 @@ 0252 XR17V252 Dual UART PCI controller 0254 XR17V254 Quad UART PCI controller 0258 XR17V258 Octal UART PCI controller + 0352 XR17V3521 Dual PCIe UART 13a9 Siemens Medical Systems, Ultrasound Group 13aa Broadband Networks Inc 13ab Arcom Control Systems Ltd @@ -18255,6 +18280,8 @@ 1556 PLDA 1100 PCI Express Core Reference Design 110f PCI Express Core Reference Design Virtual Function + 1110 XpressRich Reference Design + 1113 XpressSwitch 1557 MEDIASTAR Co Ltd 1558 CLEVO/KAPOK Computer 1559 SI LOGIC Ltd @@ -18410,6 +18437,7 @@ 020b MT27710 Family [ConnectX-4 Lx Flash Recovery] 020d MT28800 Family [ConnectX-5 Flash Recovery] 020f MT28908A0 Family [ConnectX-6 Flash Recovery] + 0210 MT28908A0 Family [ConnectX-6 Secure Flash Recovery] 0211 MT416842 Family [BlueField SoC Flash Recovery] # reserved for RM#105916 024e MT53100 [Spectrum-2, Flash recovery mode] @@ -18474,6 +18502,7 @@ 15b3 0050 ConnectX-4 100 GbE Dual Port QSFP28 Adapter 1014 MT27700 Family [ConnectX-4 Virtual Function] 1015 MT27710 Family [ConnectX-4 Lx] + 15b3 0004 ConnectX-4 Lx Stand-up dual-port 10GbE MCX4121A-XCAT 15b3 0005 Mellanox Technologies ConnectX-4 Lx Stand-up single-port 40GbE MCX4131A-BCAT 15b3 0016 ConnectX-4 Lx 25 GbE Dual Port SFP28 Adapter 15b3 0020 MCX4411A-ACQN, ConnectX-4 Lx EN OCP, 1x25Gb @@ -18531,6 +18560,7 @@ 7121 NPS-600 configuration and management interface 7122 NPS-600 network interface PF 7123 NPS-600 network interface VF + 8200 Innova-2 FPGA a2d0 MT416842 BlueField SoC Crypto enabled a2d1 MT416842 BlueField SoC Crypto disabled a2d2 MT416842 BlueField integrated ConnectX-5 network controller @@ -18567,6 +18597,7 @@ 0015 ZBox 15b7 Sandisk Corp 2001 Skyhawk Series NVME SSD + 5001 WD Black NVMe SSD 15b8 ADDI-DATA GmbH 1001 APCI1516 SP controller (16 digi outputs) 1003 APCI1032 SP controller (32 digi inputs w/ opto coupler) @@ -18715,6 +18746,11 @@ 1006 Format synchronizer, model 10500 1007 Format synchronizer, model 21000 2002 Fast Universal Data Output + 3100 IO31000 Frame Synchronizer and I/O + 3200 IO32000 Frame Synchronizer and I/O + 4002 High Rate Demodulator + 5001 High Rate FEC + 6001 High Rate Demodulator and FEC 1631 Packard Bell B.V. 1638 Standard Microsystems Corp [SMC] 1100 SMC2602W EZConnect / Addtron AWA-100 / Eumitcom PCI WL11000 @@ -20072,11 +20108,15 @@ 1924 8019 SFN8542-R2 8000 Series 10/40G Adapter 1924 801a SFN8722-R1 8000 Series OCP 10G Adapter 1924 801b SFN8522-R3 8000 Series 10G Adapter + 0b03 SFC9250 10/25/40/50/100G Ethernet Controller + 1924 801d x2522-R1 2000 Series 10/25G Adapter + 1924 801e x2542-R1 2000 Series 40/100G Adapter 1803 SFC9020 10G Ethernet Controller (Virtual Function) 1813 SFL9021 10GBASE-T Ethernet Controller (Virtual Function) 1903 SFC9120 10G Ethernet Controller (Virtual Function) 1923 SFC9140 10/40G Ethernet Controller (Virtual Function) 1a03 SFC9220 10/40G Ethernet Controller (Virtual Function) + 1b03 SFC9250 10/25/40/50/100G Ethernet Controller (Virtual Function) 6703 SFC4000 rev A iSCSI/Onload [Solarstorm] 10b8 0102 SMC10GPCIe-10BT (A2) [TigerCard] 10b8 0103 SMC10GPCIe-10BT (A3) [TigerCard] @@ -20945,6 +20985,7 @@ 1d7c Aerotech, Inc. 1d87 Fuzhou Rockchip Electronics Co., Ltd 1d8f Enyx +1d94 Chengdu Higon IC Design Co.Ltd 1d95 Graphcore Ltd 1da1 Teko Telecom S.r.l. 1da2 Sapphire Technology Limited @@ -23661,8 +23702,9 @@ 15c7 Ethernet Connection X553 1GbE 15c8 Ethernet Connection X553/X557-AT 10GBASE-T 15ce Ethernet Connection X553 10 GbE SFP+ - 15d0 Ethernet SDI Adapter FM10420-100GbE-QDA2 + 15d0 Ethernet SDI Adapter 8086 0001 Ethernet SDI Adapter FM10420-100GbE-QDA2 + 8086 0002 Ethernet SDI Adapter FM10840-MTP2 15d1 Ethernet Controller 10G X550T 8086 0002 Ethernet Converged Network Adapter X550-T1 8086 001b Ethernet Server Adapter X550-T1 for OCP @@ -23687,6 +23729,14 @@ 15e3 Ethernet Connection (5) I219-LM 15e4 Ethernet Connection X553 1GbE 15e5 Ethernet Connection X553 1GbE + 15e7 JHL7540 Thunderbolt 3 Bridge [Titan Ridge 2C 2018] + 15e8 JHL7540 Thunderbolt 3 NHI [Titan Ridge 2C 2018] + 15e9 JHL7540 Thunderbolt 3 USB Controller [Titan Ridge 2C 2018] + 15ea JHL7540 Thunderbolt 3 Bridge [Titan Ridge 4C 2018] + 15eb JHL7540 Thunderbolt 3 NHI [Titan Ridge 4C 2018] + 15ec JHL7540 Thunderbolt 3 USB Controller [Titan Ridge 4C 2018] + 15ef JHL7540 Thunderbolt 3 Bridge [Titan Ridge DD 2018] + 15f0 JHL7540 Thunderbolt 3 USB Controller [Titan Ridge DD 2018] 1600 Broadwell-U Host Bridge -OPI 1601 Broadwell-U PCI Express x16 Controller 1602 Broadwell-U Integrated Graphics @@ -24113,6 +24163,7 @@ 144d c652 NP300E5C series laptop 1849 1e2d Motherboard 1e31 7 Series/C210 Series Chipset Family USB xHCI Host Controller + 103c 179b Elitebook 8470p 103c 17ab ProBook 6570b 1043 108d VivoBook X202EV 1043 1477 N56VZ @@ -25486,6 +25537,12 @@ 103c 31fe ProLiant DL140 G3 15d9 8680 X7DVL-E-O motherboard 15d9 9680 X7DBN Motherboard + 2700 Optane SSD 900P Series + 8086 3900 900P Series [Add-in Card] + 8086 3901 900P Series [2.5" SFF] + 2701 Optane DC P4800X Series SSD + 8086 3904 DC P4800X Series [Add-in Card] + 8086 3905 DC P4800X Series [2.5" SFF] 2770 82945G/GZ/P/PL Memory Controller Hub 1028 01ad OptiPlex GX620 103c 2a3b Pavilion A1512X @@ -29020,6 +29077,11 @@ 103c 0701 Smart Array P204i-b SR Gen10 103c 1100 Smart Array P816i-a SR Gen10 103c 1101 Smart Array P416ie-m SR G10 + 152d 8a22 QS-8204-8i + 152d 8a23 QS-8238-16i + 152d 8a24 QS-8236-16i + 152d 8a36 QS-8240-24i + 152d 8a37 QS-8242-24i 9005 0800 SmartRAID 3154-8i 9005 0801 SmartRAID 3152-8i 9005 0802 SmartRAID 3151-4i From owner-svn-src-all@freebsd.org Thu Dec 28 12:40:33 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76D3DE8D3BC; Thu, 28 Dec 2017 12:40:33 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from mail-io0-x241.google.com (mail-io0-x241.google.com [IPv6:2607:f8b0:4001:c06::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3DC0578D9E; Thu, 28 Dec 2017 12:40:33 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: by mail-io0-x241.google.com with SMTP id t63so1167222iod.0; Thu, 28 Dec 2017 04:40:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=DGUqeL7FdIvAmOnn66CQPL8BaylpjCbZc3Z21Lqg8Gs=; b=pLXER97jprVffjl4v+cxSgizVCjj3NpfFZz53o4LiEE/eTy9VyzmYlbr0jgs6GrkdR LJk2f4YbXiuZ6A1HXwhKDeq1WN4HKdRuVMcD5+f6yK4F+iZUSxruQUoZKQlLhUNP1MVa ho+wigOJM+4vdUo6w2foPHrsXIYFw8SGnyMnKDCDQQ0xAdSD8pX8iMvJgQK5QbYLh9Fu O3f4tSw4Ub3uZ37b3gNY3tP7uBZYgB3hklbqK5yqGXDV2aMYFy43Hrkk/dUdrBDrQhlp C4LHE0jrjH+m62KQJdbNt7vMZ2yhSRSTOHb6ZowxzqpyFjGPqCC1zyxGuJ6pjwd6Xp9n 24yQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=DGUqeL7FdIvAmOnn66CQPL8BaylpjCbZc3Z21Lqg8Gs=; b=cOJhtRvzWhzCkXjQyMIRfxxb6Iy82QlCWHsHnuZ5QygsGSicjjB70N3TzR0q3M+CdO vQ3780Gzxjfcoa+NnzfB/GdgxxxaEmBOzLbaG7QcosB/K0TO6zuEENOZhquct59HPuJB oT65FQpZvD39xSozc59r/q+F3llKKJ0kqhNsXWDt2tSn5CeL1Qay/LY6SVhkad/4LgAw Mi+isVavIL7ziV8vmwuooaSfrTzQGp3Za7gEVM7AnOQEzv/9PNRUpHtqKoStEjhZq5+p XnzjHda1RPFbvViV5G2/8eGD2OrIqve+brx24IH1Y5UOBRu0Ftn4Obk9FoIPk7HmcYtj HsBw== X-Gm-Message-State: AKGB3mJAJPnL4wXLkihbdmRZP1sOB/CmGkYip+T2Vt32hSC9I45DtEMG tsH8ersM1P9HW4YI6mhcjfsWBw+szyevcAND7VpGog== X-Google-Smtp-Source: ACJfBotLR1xXZxcT9ftGKcg+4Mi93qSNxmyxr3W/DzQrsZDxYK4lxP1MfwD+KiocGMmY0HdpEfhk4HDF0eo2JSJmbF0= X-Received: by 10.107.142.200 with SMTP id q191mr26054874iod.133.1514464832532; Thu, 28 Dec 2017 04:40:32 -0800 (PST) MIME-Version: 1.0 Sender: antoine.brodin.freebsd@gmail.com Received: by 10.107.190.1 with HTTP; Thu, 28 Dec 2017 04:40:31 -0800 (PST) In-Reply-To: <201711112239.vABMdXS2053880@repo.freebsd.org> References: <201711112239.vABMdXS2053880@repo.freebsd.org> From: Antoine Brodin Date: Thu, 28 Dec 2017 12:40:31 +0000 X-Google-Sender-Auth: 16xBxfR3Ix7B1IjhVUv0ygM3qvI Message-ID: Subject: Re: svn commit: r325726 - head/sys/kern To: Mateusz Guzik , David Chisnall Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 12:40:33 -0000 On Sat, Nov 11, 2017 at 10:39 PM, Mateusz Guzik wrote: > Author: mjg > Date: Sat Nov 11 22:39:33 2017 > New Revision: 325726 > URL: https://svnweb.freebsd.org/changeset/base/325726 > > Log: > Avoid locking and refing in sysctl_kern_proc_args if possible. > > Turns out the sysctl is called a lot e.g. by pkg-static. > > Modified: > head/sys/kern/kern_proc.c Hi, There is a regression after this commit: x11-toolkits/gnustep-gui no longer builds. You can find a failure log at http://pb2.nyi.freebsd.org/data/111i386-default-PR224618/2017-12-28_12h28m51s/logs/errors/gnustep-gui-0.25.1_3.log The failure seems to be from lang/gnustep-base: /* get the argument vectors */ vectors = kvm_getargv(kptr, proc_ptr, 0); Cheers, Antoine From owner-svn-src-all@freebsd.org Thu Dec 28 12:59:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05B13E8E395; Thu, 28 Dec 2017 12:59:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C4798796B0; Thu, 28 Dec 2017 12:59:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBSCxmk0008551; Thu, 28 Dec 2017 12:59:48 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBSCxmRg008550; Thu, 28 Dec 2017 12:59:48 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201712281259.vBSCxmRg008550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 28 Dec 2017 12:59:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327283 - head/usr.sbin/cpucontrol X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/usr.sbin/cpucontrol X-SVN-Commit-Revision: 327283 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 12:59:50 -0000 Author: kib Date: Thu Dec 28 12:59:48 2017 New Revision: 327283 URL: https://svnweb.freebsd.org/changeset/base/327283 Log: Complete r327264 by fixing yet another return without cleanup. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/usr.sbin/cpucontrol/intel.c Modified: head/usr.sbin/cpucontrol/intel.c ============================================================================== --- head/usr.sbin/cpucontrol/intel.c Thu Dec 28 08:25:47 2017 (r327282) +++ head/usr.sbin/cpucontrol/intel.c Thu Dec 28 12:59:48 2017 (r327283) @@ -147,7 +147,7 @@ intel_update(const char *dev, const char *path) fd = open(path, O_RDONLY, 0); if (fd < 0) { WARN(0, "open(%s)", path); - return; + goto fail; } error = fstat(fd, &st); if (error != 0) { From owner-svn-src-all@freebsd.org Thu Dec 28 13:01:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3852E8E628; Thu, 28 Dec 2017 13:01:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E274799D5; Thu, 28 Dec 2017 13:01:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBSD1RkH010146; Thu, 28 Dec 2017 13:01:27 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBSD1RN4010145; Thu, 28 Dec 2017 13:01:27 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201712281301.vBSD1RN4010145@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 28 Dec 2017 13:01:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327284 - head/usr.sbin/cpucontrol X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/usr.sbin/cpucontrol X-SVN-Commit-Revision: 327284 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 13:01:28 -0000 Author: kib Date: Thu Dec 28 13:01:27 2017 New Revision: 327284 URL: https://svnweb.freebsd.org/changeset/base/327284 Log: Style. Remove useless return. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/usr.sbin/cpucontrol/intel.c Modified: head/usr.sbin/cpucontrol/intel.c ============================================================================== --- head/usr.sbin/cpucontrol/intel.c Thu Dec 28 12:59:48 2017 (r327283) +++ head/usr.sbin/cpucontrol/intel.c Thu Dec 28 13:01:27 2017 (r327284) @@ -88,7 +88,7 @@ intel_update(const char *dev, const char *path) intel_fw_header_t *fw_header; intel_cpu_signature_t *ext_table; intel_ext_header_t *ext_header; - uint32_t signature, flags; + uint32_t sig, signature, flags; int32_t revision; ssize_t ext_size; size_t ext_table_size; @@ -231,7 +231,8 @@ intel_update(const char *dev, const char *path) for (i = 0; i < (ext_table_size / sizeof(uint32_t)); i++) sum += *((uint32_t *)ext_header + i); if (sum != 0) { - WARNX(2, "%s: extended signature table checksum invalid", + WARNX(2, + "%s: extended signature table checksum invalid", path); goto no_table; } @@ -246,10 +247,10 @@ no_table: */ if (signature == fw_header->cpu_signature && (flags & fw_header->cpu_flags) != 0) - goto matched; + goto matched; else if (have_ext_table != 0) { for (i = 0; i < ext_header->sig_count; i++) { - uint32_t sig = ext_table[i].cpu_signature; + sig = ext_table[i].cpu_signature; if (signature == sig && (flags & ext_table[i].cpu_flags) != 0) goto matched; @@ -264,14 +265,14 @@ matched: goto fail; } fprintf(stderr, "%s: updating cpu %s from rev %#x to rev %#x... ", - path, dev, revision, fw_header->revision); + path, dev, revision, fw_header->revision); args.data = fw_data; args.size = data_size; error = ioctl(devfd, CPUCTL_UPDATE, &args); if (error < 0) { - error = errno; + error = errno; fprintf(stderr, "failed.\n"); - errno = error; + errno = error; WARN(0, "ioctl()"); goto fail; } @@ -285,5 +286,4 @@ fail: close(devfd); if (fd >= 0) close(fd); - return; } From owner-svn-src-all@freebsd.org Thu Dec 28 13:16:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5338AE991C4; Thu, 28 Dec 2017 13:16:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A8B87A0DD; Thu, 28 Dec 2017 13:16:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBSDGXnx017001; Thu, 28 Dec 2017 13:16:33 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBSDGXVI016999; Thu, 28 Dec 2017 13:16:33 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201712281316.vBSDGXVI016999@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 28 Dec 2017 13:16:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327285 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 327285 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 13:16:34 -0000 Author: kib Date: Thu Dec 28 13:16:32 2017 New Revision: 327285 URL: https://svnweb.freebsd.org/changeset/base/327285 Log: Make kern_proc_vmmap_resident() externally accesible, and move the vmmap_skip_res_cnt control check inside it. Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D13595 Modified: head/sys/kern/kern_proc.c head/sys/sys/proc.h Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Thu Dec 28 13:01:27 2017 (r327284) +++ head/sys/kern/kern_proc.c Thu Dec 28 13:16:32 2017 (r327285) @@ -2280,9 +2280,9 @@ sysctl_kern_proc_ovmmap(SYSCTL_HANDLER_ARGS) CTASSERT(sizeof(struct kinfo_vmentry) == KINFO_VMENTRY_SIZE); #endif -static void +void kern_proc_vmmap_resident(vm_map_t map, vm_map_entry_t entry, - struct kinfo_vmentry *kve) + int *resident_count, bool *super) { vm_object_t obj, tobj; vm_page_t m, m_adv; @@ -2290,6 +2290,11 @@ kern_proc_vmmap_resident(vm_map_t map, vm_map_entry_t vm_paddr_t locked_pa; vm_pindex_t pi, pi_adv, pindex; + *super = false; + *resident_count = 0; + if (vmmap_skip_res_cnt) + return; + locked_pa = 0; obj = entry->object.vm_object; addr = entry->start; @@ -2322,7 +2327,7 @@ kern_proc_vmmap_resident(vm_map_t map, vm_map_entry_t (addr & (pagesizes[1] - 1)) == 0 && (pmap_mincore(map->pmap, addr, &locked_pa) & MINCORE_SUPER) != 0) { - kve->kve_flags |= KVME_FLAG_SUPER; + *super = true; pi_adv = atop(pagesizes[1]); } else { /* @@ -2334,7 +2339,7 @@ kern_proc_vmmap_resident(vm_map_t map, vm_map_entry_t */ pi_adv = 1; } - kve->kve_resident += pi_adv; + *resident_count += pi_adv; next:; } PA_UNLOCK_COND(locked_pa); @@ -2358,6 +2363,7 @@ kern_proc_vmmap_out(struct proc *p, struct sbuf *sb, s vm_offset_t addr; unsigned int last_timestamp; int error; + bool super; PROC_LOCK_ASSERT(p, MA_OWNED); @@ -2390,8 +2396,10 @@ kern_proc_vmmap_out(struct proc *p, struct sbuf *sb, s if (obj->backing_object == NULL) kve->kve_private_resident = obj->resident_page_count; - if (!vmmap_skip_res_cnt) - kern_proc_vmmap_resident(map, entry, kve); + kern_proc_vmmap_resident(map, entry, + &kve->kve_resident, &super); + if (super) + kve->kve_flags |= KVME_FLAG_SUPER; for (tobj = obj; tobj != NULL; tobj = tobj->backing_object) { if (tobj != obj && tobj != lobj) @@ -3112,6 +3120,7 @@ resume_all_proc(void) cp = curproc; sx_xlock(&allproc_lock); +again: LIST_REMOVE(cp, p_list); LIST_INSERT_HEAD(&allproc, cp, p_list); for (;;) { @@ -3131,6 +3140,12 @@ resume_all_proc(void) } else { PROC_UNLOCK(p); } + } + /* Did the loop above missed any stopped process ? */ + LIST_FOREACH(p, &allproc, p_list) { + /* No need for proc lock. */ + if ((p->p_flag & P_TOTAL_STOP) != 0) + goto again; } sx_xunlock(&allproc_lock); } Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Thu Dec 28 13:01:27 2017 (r327284) +++ head/sys/sys/proc.h Thu Dec 28 13:16:32 2017 (r327285) @@ -184,6 +184,8 @@ struct td_sched; struct thread; struct trapframe; struct turnstile; +struct vm_map; +struct vm_map_entry; /* * XXX: Does this belong in resource.h or resourcevar.h instead? @@ -1004,6 +1006,8 @@ void fork_exit(void (*)(void *, struct trapframe *), v struct trapframe *); void fork_return(struct thread *, struct trapframe *); int inferior(struct proc *p); +void kern_proc_vmmap_resident(struct vm_map *map, struct vm_map_entry *entry, + int *resident_count, bool *super); void kern_yield(int); void kick_proc0(void); void killjobc(void); From owner-svn-src-all@freebsd.org Thu Dec 28 13:23:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D31F2E99822; Thu, 28 Dec 2017 13:23:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9129B7A63D; Thu, 28 Dec 2017 13:23:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBSDNDK2020910; Thu, 28 Dec 2017 13:23:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBSDNDHM020909; Thu, 28 Dec 2017 13:23:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201712281323.vBSDNDHM020909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 28 Dec 2017 13:23:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327286 - head/sys/fs/procfs X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/fs/procfs X-SVN-Commit-Revision: 327286 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 13:23:14 -0000 Author: kib Date: Thu Dec 28 13:23:13 2017 New Revision: 327286 URL: https://svnweb.freebsd.org/changeset/base/327286 Log: Reuse kern_proc_vmmap_resident() for procfs_map resident count. The existing algorithm in procfs_map() to calculate count of resident pages in an entry is too primitive, resulting in too long run time for large sparse mapping entries. Re-use the kern_proc_vmmap_resident() from kern_proc.c which only looks at the existing pages in the iterations. Also, this makes procfs to honor kern.proc_vmmap_skip_resident_count, if user does not need this information. Reported by: Glenn Weinberg PR: 224532 No objections from: des (procfs maintainer) Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D13595 Modified: head/sys/fs/procfs/procfs_map.c Modified: head/sys/fs/procfs/procfs_map.c ============================================================================== --- head/sys/fs/procfs/procfs_map.c Thu Dec 28 13:16:32 2017 (r327285) +++ head/sys/fs/procfs/procfs_map.c Thu Dec 28 13:23:13 2017 (r327286) @@ -84,12 +84,17 @@ procfs_doprocmap(PFS_FILL_ARGS) vm_map_t map; vm_map_entry_t entry, tmp_entry; struct vnode *vp; - char *fullpath, *freepath; + char *fullpath, *freepath, *type; struct ucred *cred; - int error; + vm_object_t obj, tobj, lobj; + int error, privateresident, ref_count, resident, shadow_count, flags; + vm_offset_t e_start, e_end; + vm_eflags_t e_eflags; + vm_prot_t e_prot; unsigned int last_timestamp; + bool super; #ifdef COMPAT_FREEBSD32 - int wrap32 = 0; + bool wrap32; #endif PROC_LOCK(p); @@ -102,11 +107,12 @@ procfs_doprocmap(PFS_FILL_ARGS) return (EOPNOTSUPP); #ifdef COMPAT_FREEBSD32 - if (SV_CURPROC_FLAG(SV_ILP32)) { - if (!(SV_PROC_FLAG(p, SV_ILP32))) - return (EOPNOTSUPP); - wrap32 = 1; - } + wrap32 = false; + if (SV_CURPROC_FLAG(SV_ILP32)) { + if (!(SV_PROC_FLAG(p, SV_ILP32))) + return (EOPNOTSUPP); + wrap32 = true; + } #endif vm = vmspace_acquire_ref(p); @@ -116,14 +122,6 @@ procfs_doprocmap(PFS_FILL_ARGS) vm_map_lock_read(map); for (entry = map->header.next; entry != &map->header; entry = entry->next) { - vm_object_t obj, tobj, lobj; - int ref_count, shadow_count, flags; - vm_offset_t e_start, e_end, addr; - int resident, privateresident; - char *type; - vm_eflags_t e_eflags; - vm_prot_t e_prot; - if (entry->eflags & MAP_ENTRY_IS_SUB_MAP) continue; @@ -132,6 +130,7 @@ procfs_doprocmap(PFS_FILL_ARGS) e_start = entry->start; e_end = entry->end; privateresident = 0; + resident = 0; obj = entry->object.vm_object; if (obj != NULL) { VM_OBJECT_RLOCK(obj); @@ -140,20 +139,17 @@ procfs_doprocmap(PFS_FILL_ARGS) } cred = (entry->cred) ? entry->cred : (obj ? obj->cred : NULL); - resident = 0; - addr = entry->start; - while (addr < entry->end) { - if (pmap_extract(map->pmap, addr)) - resident++; - addr += PAGE_SIZE; - } - - for (lobj = tobj = obj; tobj; tobj = tobj->backing_object) { + for (lobj = tobj = obj; tobj != NULL; + tobj = tobj->backing_object) { if (tobj != obj) VM_OBJECT_RLOCK(tobj); - if (lobj != obj) - VM_OBJECT_RUNLOCK(lobj); lobj = tobj; + } + if (obj != NULL) + kern_proc_vmmap_resident(map, entry, &resident, &super); + for (tobj = obj; tobj != NULL; tobj = tobj->backing_object) { + if (tobj != obj && tobj != lobj) + VM_OBJECT_RUNLOCK(tobj); } last_timestamp = map->timestamp; vm_map_unlock_read(map); From owner-svn-src-all@freebsd.org Thu Dec 28 14:14:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 720E5EA0BAC; Thu, 28 Dec 2017 14:14:37 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C7717CE40; Thu, 28 Dec 2017 14:14:37 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBSEEa7H043375; Thu, 28 Dec 2017 14:14:36 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBSEEasG043373; Thu, 28 Dec 2017 14:14:36 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201712281414.vBSEEasG043373@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 28 Dec 2017 14:14:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327287 - head/sys/i386/isa X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/i386/isa X-SVN-Commit-Revision: 327287 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 14:14:37 -0000 Author: pfg Date: Thu Dec 28 14:14:35 2017 New Revision: 327287 URL: https://svnweb.freebsd.org/changeset/base/327287 Log: sys/i386/isa/elink*: sync with (older) NetBSD. Make it easier to identify the point where we started diverging from NetBSD. Newer versions of these files have been updated to a new license so this information may become useful some day. Obtained from: NetBSD Modified: head/sys/i386/isa/elink.c head/sys/i386/isa/elink.h Modified: head/sys/i386/isa/elink.c ============================================================================== --- head/sys/i386/isa/elink.c Thu Dec 28 13:23:13 2017 (r327286) +++ head/sys/i386/isa/elink.c Thu Dec 28 14:14:35 2017 (r327287) @@ -1,7 +1,9 @@ +/* $NetBSD: elink.c,v 1.6 1995/01/07 21:37:54 mycroft Exp $ */ + /*- * SPDX-License-Identifier: BSD-4-Clause * - * Copyright (c) 1994 Charles Hannum. All rights reserved. + * Copyright (c) 1994, 1995 Charles Hannum. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -46,9 +48,9 @@ __FBSDID("$FreeBSD$"); #include /* - * Issue a `global reset' to all cards. We have to be careful to do this only - * once during autoconfig, to prevent resetting boards that have already been - * configured. + * Issue a `global reset' to all cards, and reset the ID state machines. We + * have to be careful to do the global reset only once during autoconfig, to + * prevent resetting boards that have already been configured. */ void elink_reset() @@ -59,8 +61,8 @@ elink_reset() x = 1; outb(ELINK_ID_PORT, ELINK_RESET); } - outb(ELINK_ID_PORT, 0); - outb(ELINK_ID_PORT, 0); + outb(ELINK_ID_PORT, 0x00); + outb(ELINK_ID_PORT, 0x00); return; } Modified: head/sys/i386/isa/elink.h ============================================================================== --- head/sys/i386/isa/elink.h Thu Dec 28 13:23:13 2017 (r327286) +++ head/sys/i386/isa/elink.h Thu Dec 28 14:14:35 2017 (r327287) @@ -1,3 +1,5 @@ +/* $NetBSD: elink.h,v 1.3 1994/10/27 04:17:11 cgd Exp $ */ + /*- * SPDX-License-Identifier: BSD-4-Clause * From owner-svn-src-all@freebsd.org Thu Dec 28 14:26:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48C88EA16C8; Thu, 28 Dec 2017 14:26:35 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 138DE7D46B; Thu, 28 Dec 2017 14:26:34 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBSEQYtv047604; Thu, 28 Dec 2017 14:26:34 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBSEQYp2047603; Thu, 28 Dec 2017 14:26:34 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201712281426.vBSEQYp2047603@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 28 Dec 2017 14:26:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327288 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 327288 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 14:26:35 -0000 Author: pfg Date: Thu Dec 28 14:26:33 2017 New Revision: 327288 URL: https://svnweb.freebsd.org/changeset/base/327288 Log: sys/sys/chio.h: add NetBSD RCS ID. Make it easier to identify the point where we started diverging from NetBSD. Newer versions of this file has been updated to a new license so this information may become useful some day. Obtained from: NetBSD Modified: head/sys/sys/chio.h Modified: head/sys/sys/chio.h ============================================================================== --- head/sys/sys/chio.h Thu Dec 28 14:14:35 2017 (r327287) +++ head/sys/sys/chio.h Thu Dec 28 14:26:33 2017 (r327288) @@ -1,3 +1,5 @@ +/* $NetBSD: chio.h,v 1.9 1997/09/29 17:32:26 mjacob Exp $ */ + /*- * SPDX-License-Identifier: BSD-4-Clause * From owner-svn-src-all@freebsd.org Thu Dec 28 15:28:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC1E0EA4A74; Thu, 28 Dec 2017 15:28:22 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3F3967F47E; Thu, 28 Dec 2017 15:28:22 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id vBSFS8sr059339 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 28 Dec 2017 17:28:11 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua vBSFS8sr059339 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id vBSFS8cC059338; Thu, 28 Dec 2017 17:28:08 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 28 Dec 2017 17:28:08 +0200 From: Konstantin Belousov To: "Pedro F. Giffuni" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327287 - head/sys/i386/isa Message-ID: <20171228152808.GF1684@kib.kiev.ua> References: <201712281414.vBSEEasG043373@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201712281414.vBSEEasG043373@repo.freebsd.org> User-Agent: Mutt/1.9.2 (2017-12-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 15:28:22 -0000 On Thu, Dec 28, 2017 at 02:14:36PM +0000, Pedro F. Giffuni wrote: > Author: pfg > Date: Thu Dec 28 14:14:35 2017 > New Revision: 327287 > URL: https://svnweb.freebsd.org/changeset/base/327287 > > Log: > sys/i386/isa/elink*: sync with (older) NetBSD. > > Make it easier to identify the point where we started diverging from > NetBSD. Newer versions of these files have been updated to a new license > so this information may become useful some day. > > Obtained from: NetBSD > > Modified: > head/sys/i386/isa/elink.c > head/sys/i386/isa/elink.h I think that these files, if touched, should be moved to sys/dev/ep. Also files.i386 seems to reference ghost options 'ie'. From owner-svn-src-all@freebsd.org Thu Dec 28 16:27:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABCD5EA7777; Thu, 28 Dec 2017 16:27:03 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mailout.stack.nl (mailout05.stack.nl [IPv6:2001:610:1108:5010::202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.stack.nl", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 770B81568; Thu, 28 Dec 2017 16:27:03 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from toad2.stack.nl (toad2.stack.nl [IPv6:2001:610:1108:5010::161]) by mailout.stack.nl (Postfix) with ESMTP id 94BF93F; Thu, 28 Dec 2017 17:25:25 +0100 (CET) Received: by toad2.stack.nl (Postfix, from userid 1677) id 8B24C892B5; Thu, 28 Dec 2017 17:25:25 +0100 (CET) Date: Thu, 28 Dec 2017 17:25:25 +0100 From: Jilles Tjoelker To: Antoine Brodin Cc: Mateusz Guzik , David Chisnall , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r325726 - head/sys/kern Message-ID: <20171228162525.GA32705@stack.nl> References: <201711112239.vABMdXS2053880@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.0 (2017-02-23) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 16:27:03 -0000 On Thu, Dec 28, 2017 at 12:40:31PM +0000, Antoine Brodin wrote: > On Sat, Nov 11, 2017 at 10:39 PM, Mateusz Guzik wrote: > > Author: mjg > > Date: Sat Nov 11 22:39:33 2017 > > New Revision: 325726 > > URL: https://svnweb.freebsd.org/changeset/base/325726 > > Log: > > Avoid locking and refing in sysctl_kern_proc_args if possible. > > Turns out the sysctl is called a lot e.g. by pkg-static. > > Modified: > > head/sys/kern/kern_proc.c > There is a regression after this commit: x11-toolkits/gnustep-gui no > longer builds. > You can find a failure log at > http://pb2.nyi.freebsd.org/data/111i386-default-PR224618/2017-12-28_12h28m51s/logs/errors/gnustep-gui-0.25.1_3.log > The failure seems to be from lang/gnustep-base: > /* get the argument vectors */ > vectors = kvm_getargv(kptr, proc_ptr, 0); It looks like the new fast path only works properly if p->p_args is not NULL. If p->p_args is NULL, this usually means that the arguments are longer than ps_arg_cache_limit and must be retrieved from (pageable) process memory and not wired p->p_args->ar_args. It is possible to duplicate that piece of code as well but that is probably not worth it. A simple reproducer is sh -c 'n=$(sysctl -n kern.ps_arg_cache_limit); exec ps -p "$$" -o "args=$(printf "%0${n}d" 0)"' On head, the second line is [ps] indicating that KERN_PROC_ARGS did not return the expected string. On stable/10 and stable/11, the second line is a truncated version of the command line like ps -p 86963 -o args=0000000000000000000000000000000000000000000000000000000000 A prerequisite for this reproducer is that kern.ps_arg_cache_limit is not set so high that it is impractical to exceed it but not {ARG_MAX}. -- Jilles Tjoelker From owner-svn-src-all@freebsd.org Thu Dec 28 17:44:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC639EAB2BF; Thu, 28 Dec 2017 17:44:31 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 83C5663724; Thu, 28 Dec 2017 17:44:31 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBSHiURf031077; Thu, 28 Dec 2017 17:44:30 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBSHiUE1031075; Thu, 28 Dec 2017 17:44:30 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201712281744.vBSHiUE1031075@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 28 Dec 2017 17:44:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327289 - head/libexec/rpc.sprayd X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/libexec/rpc.sprayd X-SVN-Commit-Revision: 327289 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 17:44:31 -0000 Author: pfg Date: Thu Dec 28 17:44:30 2017 New Revision: 327289 URL: https://svnweb.freebsd.org/changeset/base/327289 Log: rpc.sprayd: Bring some changes from NetBSD. Most notable, other than some style issues: CVS 1.11: do not use LOG_CONS. CVS 1.13: consistently use exit instead of return in main(). use LOG_WARNING instead of LOG_ERR for non critical errors. Obtained from: NetBSD MFC after: 2 weeks Modified: head/libexec/rpc.sprayd/rpc.sprayd.8 head/libexec/rpc.sprayd/sprayd.c Modified: head/libexec/rpc.sprayd/rpc.sprayd.8 ============================================================================== --- head/libexec/rpc.sprayd/rpc.sprayd.8 Thu Dec 28 14:26:33 2017 (r327288) +++ head/libexec/rpc.sprayd/rpc.sprayd.8 Thu Dec 28 17:44:30 2017 (r327289) @@ -1,3 +1,4 @@ +.\" $NetBSD: rpc.sprayd.8,v 1.9 2003/02/25 10:34:50 wiz Exp $ .\" .\" Copyright (c) 1994 Christos Zoulas .\" All rights reserved. @@ -29,11 +30,12 @@ .\" .\" $FreeBSD$ .\" -.Dd June 22, 1994 +.Dd December 27, 2017 .Dt RPC.SPRAYD 8 .Os .Sh NAME -.Nm rpc.sprayd +.Nm rpc.sprayd , +.Nm sprayd .Nd spray server .Sh SYNOPSIS .Nm /usr/libexec/rpc.sprayd Modified: head/libexec/rpc.sprayd/sprayd.c ============================================================================== --- head/libexec/rpc.sprayd/sprayd.c Thu Dec 28 14:26:33 2017 (r327288) +++ head/libexec/rpc.sprayd/sprayd.c Thu Dec 28 17:44:30 2017 (r327289) @@ -1,3 +1,5 @@ +/* $NetBSD: sprayd.c,v 1.14 2006/05/09 20:18:07 mrg Exp $ */ + /*- * SPDX-License-Identifier: BSD-4-Clause * @@ -64,7 +66,7 @@ static int from_inetd = 1; void cleanup(int sig __unused) { - (void) rpcb_unset(SPRAYPROG, SPRAYVERS, NULL); + (void)rpcb_unset(SPRAYPROG, SPRAYVERS, NULL); exit(0); } @@ -93,17 +95,17 @@ main(int argc, char *argv[]) if (!from_inetd) { daemon(0, 0); - (void) rpcb_unset(SPRAYPROG, SPRAYVERS, NULL); + (void)rpcb_unset(SPRAYPROG, SPRAYVERS, NULL); - (void) signal(SIGINT, cleanup); - (void) signal(SIGTERM, cleanup); - (void) signal(SIGHUP, cleanup); + (void)signal(SIGINT, cleanup); + (void)signal(SIGTERM, cleanup); + (void)signal(SIGHUP, cleanup); } else { - (void) signal(SIGALRM, die); + (void)signal(SIGALRM, die); alarm(TIMEOUT); } - openlog("rpc.sprayd", LOG_CONS|LOG_PID, LOG_DAEMON); + openlog("rpc.sprayd", LOG_PID, LOG_DAEMON); if (from_inetd) { transp = svc_tli_create(0, NULL, NULL, 0, 0); @@ -120,7 +122,7 @@ main(int argc, char *argv[]) syslog(LOG_ERR, "unable to register (SPRAYPROG, SPRAYVERS, %s)", (!from_inetd)?"udp":"(inetd)"); - return 1; + exit(1); } svc_run(); @@ -138,7 +140,7 @@ spray_service(struct svc_req *rqstp, SVCXPRT *transp) switch (rqstp->rq_proc) { case SPRAYPROC_CLEAR: scum.counter = 0; - (void) gettimeofday(&clear, 0); + (void)gettimeofday(&clear, 0); /*FALLTHROUGH*/ case NULLPROC: @@ -150,7 +152,7 @@ spray_service(struct svc_req *rqstp, SVCXPRT *transp) return; case SPRAYPROC_GET: - (void) gettimeofday(&get, 0); + (void)gettimeofday(&get, 0); timersub(&get, &clear, &get); scum.clock.sec = get.tv_sec; scum.clock.usec = get.tv_usec; @@ -163,6 +165,6 @@ spray_service(struct svc_req *rqstp, SVCXPRT *transp) if (!svc_sendreply(transp, (xdrproc_t)xdr_spraycumul, &scum)) { svcerr_systemerr(transp); - syslog(LOG_ERR, "bad svc_sendreply"); + syslog(LOG_WARNING, "bad svc_sendreply"); } } From owner-svn-src-all@freebsd.org Thu Dec 28 17:51:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3DFCDEAB8B7; Thu, 28 Dec 2017 17:51:55 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 15FAD63BD9; Thu, 28 Dec 2017 17:51:55 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBSHpssp035098; Thu, 28 Dec 2017 17:51:54 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBSHpsYM035096; Thu, 28 Dec 2017 17:51:54 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201712281751.vBSHpsYM035096@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 28 Dec 2017 17:51:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327290 - head/libexec/rpc.sprayd X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/libexec/rpc.sprayd X-SVN-Commit-Revision: 327290 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 17:51:55 -0000 Author: pfg Date: Thu Dec 28 17:51:53 2017 New Revision: 327290 URL: https://svnweb.freebsd.org/changeset/base/327290 Log: rpc.sprayd: Remove 3rd and 4th clauses in christos' license. Obtained from: NetBSD Modified: head/libexec/rpc.sprayd/rpc.sprayd.8 head/libexec/rpc.sprayd/sprayd.c Modified: head/libexec/rpc.sprayd/rpc.sprayd.8 ============================================================================== --- head/libexec/rpc.sprayd/rpc.sprayd.8 Thu Dec 28 17:44:30 2017 (r327289) +++ head/libexec/rpc.sprayd/rpc.sprayd.8 Thu Dec 28 17:51:53 2017 (r327290) @@ -1,4 +1,4 @@ -.\" $NetBSD: rpc.sprayd.8,v 1.9 2003/02/25 10:34:50 wiz Exp $ +.\" $NetBSD: rpc.sprayd.8,v 1.10 2009/10/21 01:07:46 snj Exp $ .\" .\" Copyright (c) 1994 Christos Zoulas .\" All rights reserved. @@ -11,11 +11,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. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by Christos Zoulas. -.\" 4. The name of the author may not be used to endorse or promote products -.\" derived from this software without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES Modified: head/libexec/rpc.sprayd/sprayd.c ============================================================================== --- head/libexec/rpc.sprayd/sprayd.c Thu Dec 28 17:44:30 2017 (r327289) +++ head/libexec/rpc.sprayd/sprayd.c Thu Dec 28 17:51:53 2017 (r327290) @@ -1,7 +1,7 @@ -/* $NetBSD: sprayd.c,v 1.14 2006/05/09 20:18:07 mrg Exp $ */ +/* $NetBSD: sprayd.c,v 1.15 2009/10/21 01:07:46 snj Exp $ */ /*- - * SPDX-License-Identifier: BSD-4-Clause + * SPDX-License-Identifier: BSD-2-Clause-NetBSD * * Copyright (c) 1994 Christos Zoulas * All rights reserved. @@ -14,11 +14,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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Christos Zoulas. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES From owner-svn-src-all@freebsd.org Thu Dec 28 17:56:00 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4DAD4EABB21; Thu, 28 Dec 2017 17:56:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 184E763E71; Thu, 28 Dec 2017 17:56:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBSHtxKm035309; Thu, 28 Dec 2017 17:55:59 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBSHtxLA035308; Thu, 28 Dec 2017 17:55:59 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201712281755.vBSHtxLA035308@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 28 Dec 2017 17:55:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327291 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 327291 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 17:56:00 -0000 Author: jhb Date: Thu Dec 28 17:55:58 2017 New Revision: 327291 URL: https://svnweb.freebsd.org/changeset/base/327291 Log: Remove a stale reference to ie(4). This was missed in r304513. Submitted by: kib Modified: head/sys/conf/files.i386 Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Thu Dec 28 17:51:53 2017 (r327290) +++ head/sys/conf/files.i386 Thu Dec 28 17:55:58 2017 (r327291) @@ -518,7 +518,7 @@ i386/ibcs2/ibcs2_util.c optional ibcs2 i386/ibcs2/ibcs2_xenix.c optional ibcs2 i386/ibcs2/ibcs2_xenix_sysent.c optional ibcs2 i386/ibcs2/imgact_coff.c optional ibcs2 -i386/isa/elink.c optional ep | ie +i386/isa/elink.c optional ep i386/isa/npx.c standard i386/isa/pmtimer.c optional pmtimer i386/isa/prof_machdep.c optional profiling-routine From owner-svn-src-all@freebsd.org Thu Dec 28 18:51:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60384EAE171; Thu, 28 Dec 2017 18:51:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A81D65CE2; Thu, 28 Dec 2017 18:51:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBSIpZKP058666; Thu, 28 Dec 2017 18:51:35 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBSIpZxV058665; Thu, 28 Dec 2017 18:51:35 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201712281851.vBSIpZxV058665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 28 Dec 2017 18:51:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327292 - head/sys/dev/pccard X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/dev/pccard X-SVN-Commit-Revision: 327292 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 18:51:36 -0000 Author: jhb Date: Thu Dec 28 18:51:35 2017 New Revision: 327292 URL: https://svnweb.freebsd.org/changeset/base/327292 Log: Minor formatting and style tweaks to some comments. Modified: head/sys/dev/pccard/pccardvar.h Modified: head/sys/dev/pccard/pccardvar.h ============================================================================== --- head/sys/dev/pccard/pccardvar.h Thu Dec 28 17:55:58 2017 (r327291) +++ head/sys/dev/pccard/pccardvar.h Thu Dec 28 18:51:35 2017 (r327292) @@ -89,15 +89,14 @@ struct pccard_product { /** * Note: There's no cis3 or cis4 reported for NOMATCH / pnpinfo events for - * pccard It's unclear if we actually need that for automatic loading or - * not. These stirngs are informative, according to the standard. Some Linux - * drivers match on them, for example. However, FreeBSD's hardware probing is a - * little different than Linux so it turns out we don't need them. Some cards - * use CIS3 or CIS4 for a textual representation of the MAC address. In short, - * they aren't needed even though our friends in Linux have them. It is my + * pccard. It's unclear if we actually need that for automatic loading or + * not. These strings are informative, according to the standard. Some Linux + * drivers match on them, for example. However, FreeBSD's hardware probing is a + * little different than Linux, so it turns out we don't need them. Some cards + * use CIS3 or CIS4 for a textual representation of the MAC address. In short, * belief that all the entries in Linux don't actually need to be separate there - * either, but it's hard to eliminate them and retest on old, possibly rare, - * hardware so they persist. Despite years of collecting ~300 different PC Cards + * either, but they persist since it's hard to eliminate them and retest on old, + * possibly rare, hardware. Despite years of collecting ~300 different PC Cards * off E-Bay, I've not been able to find any that need CIS3/CIS4 to select which * device attaches. */ @@ -111,7 +110,7 @@ typedef int (*pccard_product_match_fn) (device_t dev, #include "card_if.h" /* - * make this inline so that we don't have to worry about dangling references + * Make this inline so that we don't have to worry about dangling references * to it in the modules or the code. */ static inline const struct pccard_product * From owner-svn-src-all@freebsd.org Thu Dec 28 19:42:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 419D5EB04E3; Thu, 28 Dec 2017 19:42:55 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0A96467ACF; Thu, 28 Dec 2017 19:42:54 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBSJgsKM081699; Thu, 28 Dec 2017 19:42:54 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBSJgsp8081698; Thu, 28 Dec 2017 19:42:54 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201712281942.vBSJgsp8081698@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 28 Dec 2017 19:42:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327293 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 327293 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 19:42:55 -0000 Author: pfg Date: Thu Dec 28 19:42:53 2017 New Revision: 327293 URL: https://svnweb.freebsd.org/changeset/base/327293 Log: netinet6/ip6_id.c: niels kindly dropped clause 3/4 from the license. This file is supposed to be based on the OpenBSD CVS v1.6 but checking the OpenBSD repository the license had already dropped the 2&3 clasues by then. Catch up with the licensing. Obtained from: OpenBSD (CVS 1.2) Modified: head/sys/netinet6/ip6_id.c Modified: head/sys/netinet6/ip6_id.c ============================================================================== --- head/sys/netinet6/ip6_id.c Thu Dec 28 18:51:35 2017 (r327292) +++ head/sys/netinet6/ip6_id.c Thu Dec 28 19:42:53 2017 (r327293) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: (BSD-3-Clause AND BSD-2-Clause) + * * Copyright (C) 2003 WIDE Project. * All rights reserved. * @@ -30,8 +32,6 @@ */ /*- - * SPDX-License-Identifier: BSD-4-Clause AND BSD-3-Clause - * * Copyright 1998 Niels Provos * All rights reserved. * @@ -48,11 +48,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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Niels Provos. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES From owner-svn-src-all@freebsd.org Thu Dec 28 20:10:11 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCB29EB17C8; Thu, 28 Dec 2017 20:10:11 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7EA7F68B3B; Thu, 28 Dec 2017 20:10:11 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBSKAAc2090558; Thu, 28 Dec 2017 20:10:10 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBSKAAgw090557; Thu, 28 Dec 2017 20:10:10 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201712282010.vBSKAAgw090557@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 28 Dec 2017 20:10:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327294 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 327294 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 20:10:11 -0000 Author: pfg Date: Thu Dec 28 20:10:10 2017 New Revision: 327294 URL: https://svnweb.freebsd.org/changeset/base/327294 Log: Revert r327293 netinet6/ip6_id.c: niels kindly dropped clause 3/4 from the license. I was looking at the wrong file. There is an important merge that must be done before I can bring this change. Modified: head/sys/netinet6/ip6_id.c Modified: head/sys/netinet6/ip6_id.c ============================================================================== --- head/sys/netinet6/ip6_id.c Thu Dec 28 19:42:53 2017 (r327293) +++ head/sys/netinet6/ip6_id.c Thu Dec 28 20:10:10 2017 (r327294) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: (BSD-3-Clause AND BSD-2-Clause) + * SPDX-License-Identifier: (BSD-3-Clause AND BSD-4-Clause) * * Copyright (C) 2003 WIDE Project. * All rights reserved. @@ -48,6 +48,11 @@ * 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. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Niels Provos. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES From owner-svn-src-all@freebsd.org Thu Dec 28 20:26:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80731EB23E3; Thu, 28 Dec 2017 20:26:52 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B3DF69601; Thu, 28 Dec 2017 20:26:52 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBSKQpwp098716; Thu, 28 Dec 2017 20:26:51 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBSKQpwC098715; Thu, 28 Dec 2017 20:26:51 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201712282026.vBSKQpwC098715@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 28 Dec 2017 20:26:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327295 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 327295 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 20:26:52 -0000 Author: pfg Date: Thu Dec 28 20:26:51 2017 New Revision: 327295 URL: https://svnweb.freebsd.org/changeset/base/327295 Log: Start syncing changes from OpenBSD's ip6_id.c instead of ip_id.c. correct non-repetitive ID code, based on comments from niels provos. - seed2 is necessary, but use it as "seed2 + x" not "seed2 ^ x". - skipping number is not needed, so disable it for 16bit generator (makes the repetition period to 30000) Obtained from: OpenBSD (CVS rev. 1.2) MFC after: 1 week Modified: head/sys/netinet6/ip6_id.c Modified: head/sys/netinet6/ip6_id.c ============================================================================== --- head/sys/netinet6/ip6_id.c Thu Dec 28 20:10:10 2017 (r327294) +++ head/sys/netinet6/ip6_id.c Thu Dec 28 20:26:51 2017 (r327295) @@ -65,7 +65,7 @@ * (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: ip_id.c,v 1.6 2002/03/15 18:19:52 millert Exp $ + * $OpenBSD: ip6_id.c,v 1.2 2003/12/10 07:21:01 itojun Exp $ */ #include @@ -232,15 +232,12 @@ static u_int32_t randomid(struct randomtab *p) { int i, n; - u_int32_t tmp; if (p->ru_counter >= p->ru_max || time_uptime > p->ru_reseed) initid(p); - tmp = arc4random(); - /* Skip a random number of ids */ - n = tmp & 0x3; tmp = tmp >> 2; + n = arc4random() & 0x3; if (p->ru_counter + n >= p->ru_max) initid(p); @@ -251,7 +248,7 @@ randomid(struct randomtab *p) p->ru_counter += i; - return (p->ru_seed ^ pmod(p->ru_g, p->ru_seed2 ^ p->ru_x, p->ru_n)) | + return (p->ru_seed ^ pmod(p->ru_g, p->ru_seed2 + p->ru_x, p->ru_n)) | p->ru_msb; } From owner-svn-src-all@freebsd.org Thu Dec 28 20:35:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81890EB2B39; Thu, 28 Dec 2017 20:35:22 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBEA69CA0; Thu, 28 Dec 2017 20:35:22 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBSKZLu9003026; Thu, 28 Dec 2017 20:35:21 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBSKZLdO003025; Thu, 28 Dec 2017 20:35:21 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201712282035.vBSKZLdO003025@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 28 Dec 2017 20:35:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327296 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 327296 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 20:35:22 -0000 Author: pfg Date: Thu Dec 28 20:35:21 2017 New Revision: 327296 URL: https://svnweb.freebsd.org/changeset/base/327296 Log: netinet6/ip6_id.c: niels kindly dropped clause 3/4 from the license. This bring back r327293 from OpenBSD, with the important difference that we are now getting it from their ip6_id.c file. Obtained from: OpenBSD (CVS v1.3) Modified: head/sys/netinet6/ip6_id.c Modified: head/sys/netinet6/ip6_id.c ============================================================================== --- head/sys/netinet6/ip6_id.c Thu Dec 28 20:26:51 2017 (r327295) +++ head/sys/netinet6/ip6_id.c Thu Dec 28 20:35:21 2017 (r327296) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: (BSD-3-Clause AND BSD-4-Clause) + * SPDX-License-Identifier: (BSD-3-Clause AND BSD-2-Clause) * * Copyright (C) 2003 WIDE Project. * All rights reserved. @@ -48,11 +48,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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Niels Provos. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES @@ -65,7 +60,7 @@ * (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: ip6_id.c,v 1.2 2003/12/10 07:21:01 itojun Exp $ + * $OpenBSD: ip6_id.c,v 1.3 2003/12/12 06:57:12 itojun Exp $ */ #include From owner-svn-src-all@freebsd.org Thu Dec 28 20:40:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF1BCEB2F77; Thu, 28 Dec 2017 20:40:57 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A6C26A0A8; Thu, 28 Dec 2017 20:40:57 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBSKeulu004041; Thu, 28 Dec 2017 20:40:56 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBSKeupq004040; Thu, 28 Dec 2017 20:40:56 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201712282040.vBSKeupq004040@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 28 Dec 2017 20:40:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327297 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 327297 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 20:40:57 -0000 Author: pfg Date: Thu Dec 28 20:40:56 2017 New Revision: 327297 URL: https://svnweb.freebsd.org/changeset/base/327297 Log: Fix some typos. Obtained from: OpenBSD (CVS v1.5) Modified: head/sys/netinet6/ip6_id.c Modified: head/sys/netinet6/ip6_id.c ============================================================================== --- head/sys/netinet6/ip6_id.c Thu Dec 28 20:35:21 2017 (r327296) +++ head/sys/netinet6/ip6_id.c Thu Dec 28 20:40:56 2017 (r327297) @@ -81,7 +81,7 @@ __FBSDID("$FreeBSD$"); * The transaction id is determined by: * id[n] = seed xor (g^X[n] mod n) * - * Effectivly the id is restricted to the lower (bits - 1) bits, thus + * Effectively the id is restricted to the lower (bits - 1) bits, thus * yielding two different cycles by toggling the msb on and off. * This avoids reuse issues caused by reseeding. */ @@ -172,7 +172,7 @@ pmod(u_int32_t gen, u_int32_t expo, u_int32_t mod) } /* - * Initalizes the seed and chooses a suitable generator. Also toggles + * Initializes the seed and chooses a suitable generator. Also toggles * the msb flag. The msb flag is used to generate two distinct * cycles of random numbers and thus avoiding reuse of ids. * From owner-svn-src-all@freebsd.org Thu Dec 28 21:09:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1CB3E80569; Thu, 28 Dec 2017 21:09:37 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC46F6B3B5; Thu, 28 Dec 2017 21:09:37 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBSL9aON015784; Thu, 28 Dec 2017 21:09:36 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBSL9ar6015783; Thu, 28 Dec 2017 21:09:36 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201712282109.vBSL9ar6015783@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 28 Dec 2017 21:09:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327298 - head/stand/fdt X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/fdt X-SVN-Commit-Revision: 327298 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 21:09:38 -0000 Author: kevans Date: Thu Dec 28 21:09:36 2017 New Revision: 327298 URL: https://svnweb.freebsd.org/changeset/base/327298 Log: stand/fdt: Fix loading of multiple fdt_overlays fdt_load_dtb_overlays was written to unload previous overlay when a new valid one is come across. fdt_apply_overlays further down is written to iterate over all .dtbo's currently loaded and apply them one-by-one. Correct fdt_load_dtb_overlays to stop dropping valid overlays that were previously loaded and match expectations. Reviewed by: gonzo, imp Differential Revision: https://reviews.freebsd.org/D13659 Modified: head/stand/fdt/fdt_loader_cmd.c Modified: head/stand/fdt/fdt_loader_cmd.c ============================================================================== --- head/stand/fdt/fdt_loader_cmd.c Thu Dec 28 20:40:56 2017 (r327297) +++ head/stand/fdt/fdt_loader_cmd.c Thu Dec 28 21:09:36 2017 (r327298) @@ -281,14 +281,12 @@ fdt_load_dtb_file(const char * filename) static int fdt_load_dtb_overlay(const char * filename) { - struct preloaded_file *bfp, *oldbfp; + struct preloaded_file *bfp; struct fdt_header header; int err; debugf("fdt_load_dtb_overlay(%s)\n", filename); - oldbfp = file_findfile(filename, "dtbo"); - /* Attempt to load and validate a new dtb from a file. */ if ((bfp = file_loadraw(filename, "dtbo", 1)) == NULL) { printf("failed to load file '%s'\n", filename); @@ -309,10 +307,6 @@ fdt_load_dtb_overlay(const char * filename) fdt_strerror(err)); return (1); } - - /* A new dtb was validated, discard any previous file. */ - if (oldbfp) - file_discard(oldbfp); return (0); } From owner-svn-src-all@freebsd.org Thu Dec 28 21:12:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CA49E808E5; Thu, 28 Dec 2017 21:12:28 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 56F066B7AE; Thu, 28 Dec 2017 21:12:28 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBSLCRJP019794; Thu, 28 Dec 2017 21:12:27 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBSLCRqx019793; Thu, 28 Dec 2017 21:12:27 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201712282112.vBSLCRqx019793@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 28 Dec 2017 21:12:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327299 - head/stand/fdt X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/fdt X-SVN-Commit-Revision: 327299 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 21:12:28 -0000 Author: kevans Date: Thu Dec 28 21:12:27 2017 New Revision: 327299 URL: https://svnweb.freebsd.org/changeset/base/327299 Log: stand/fdt: Avoid bailout when dtbo has no fixups In the case of a simple dtbo where fragment uses target-path and the overlay contains no references, /__fixups__ will not be included by either our dtc or dtc from ports, but the file still has valid fragments to be applied. Additional testing found that /__symbols__ might also be omitted if it's empty, which is not necessarily an error. Reviewed by: gonzo, imp Differential Revision: https://reviews.freebsd.org/D13663 Modified: head/stand/fdt/fdt_overlay.c Modified: head/stand/fdt/fdt_overlay.c ============================================================================== --- head/stand/fdt/fdt_overlay.c Thu Dec 28 21:09:36 2017 (r327298) +++ head/stand/fdt/fdt_overlay.c Thu Dec 28 21:12:27 2017 (r327299) @@ -324,10 +324,16 @@ fdt_overlay_do_fixups(void *main_fdtp, void *overlay_f main_symbols_o = fdt_path_offset(main_fdtp, "/__symbols__"); overlay_fixups_o = fdt_path_offset(overlay_fdtp, "/__fixups__"); - if (main_symbols_o < 0) + if (main_symbols_o < 0) { + if (main_symbols_o == -FDT_ERR_NOTFOUND) + return (0); return (-1); - if (overlay_fixups_o < 0) + } + if (overlay_fixups_o < 0) { + if (overlay_fixups_o == -FDT_ERR_NOTFOUND) + return (0); return (-1); + } for (fixup_prop_o = fdt_first_property_offset(overlay_fdtp, overlay_fixups_o); fixup_prop_o >= 0; From owner-svn-src-all@freebsd.org Thu Dec 28 21:22:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DEB3CE811DB; Thu, 28 Dec 2017 21:22:54 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E80D6BE31; Thu, 28 Dec 2017 21:22:54 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBSLMrQb024135; Thu, 28 Dec 2017 21:22:53 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBSLMoJK024103; Thu, 28 Dec 2017 21:22:50 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201712282122.vBSLMoJK024103@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 28 Dec 2017 21:22:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r327300 - in vendor/llvm/dist: bindings/go/llvm cmake cmake/modules docs include/llvm/Analysis include/llvm/BinaryFormat include/llvm/CodeGen include/llvm/IR include/llvm/ProfileData li... X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/llvm/dist: bindings/go/llvm cmake cmake/modules docs include/llvm/Analysis include/llvm/BinaryFormat include/llvm/CodeGen include/llvm/IR include/llvm/ProfileData lib/Analysis lib/CodeGen/Se... X-SVN-Commit-Revision: 327300 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 21:22:55 -0000 Author: dim Date: Thu Dec 28 21:22:49 2017 New Revision: 327300 URL: https://svnweb.freebsd.org/changeset/base/327300 Log: Vendor import of llvm trunk r321530: https://llvm.org/svn/llvm-project/llvm/trunk@321530 Added: vendor/llvm/dist/test/Analysis/Lint/noalias-byval.ll vendor/llvm/dist/test/Analysis/ScalarEvolution/truncate.ll vendor/llvm/dist/test/CodeGen/AArch64/combine-and-like.ll vendor/llvm/dist/test/MC/ELF/comdat-declaration-errors.s (contents, props changed) vendor/llvm/dist/test/MC/X86/PREFETCH-32.s (contents, props changed) vendor/llvm/dist/test/MC/X86/PREFETCH-64.s (contents, props changed) vendor/llvm/dist/test/MC/X86/RDPMC-32.s (contents, props changed) vendor/llvm/dist/test/MC/X86/RDPMC-64.s (contents, props changed) vendor/llvm/dist/test/MC/X86/RDRAND-32.s (contents, props changed) vendor/llvm/dist/test/MC/X86/RDRAND-64.s (contents, props changed) vendor/llvm/dist/test/MC/X86/RDSEED-32.s (contents, props changed) vendor/llvm/dist/test/MC/X86/RDSEED-64.s (contents, props changed) vendor/llvm/dist/test/MC/X86/RDTSCP-32.s (contents, props changed) vendor/llvm/dist/test/MC/X86/RDTSCP-64.s (contents, props changed) vendor/llvm/dist/test/MC/X86/RDWRFSGS-64.s (contents, props changed) vendor/llvm/dist/test/MC/X86/x86_64-asm-match.s (contents, props changed) vendor/llvm/dist/test/SafepointIRVerifier/from-same-relocation-in-phi-nodes.ll vendor/llvm/dist/test/ThinLTO/X86/Inputs/noinline.ll vendor/llvm/dist/test/ThinLTO/X86/noinline.ll vendor/llvm/dist/test/Transforms/InstCombine/extractelement.ll vendor/llvm/dist/test/Transforms/InstSimplify/extract-element.ll vendor/llvm/dist/test/Transforms/LoopUnroll/runtime-epilog-debuginfo.ll vendor/llvm/dist/test/Transforms/RewriteStatepointsForGC/check_traversal_order.ll vendor/llvm/dist/test/tools/llvm-readobj/Inputs/needed-libs.obj.coff-am64 (contents, props changed) vendor/llvm/dist/test/tools/llvm-readobj/coff-needed-libs.test Deleted: vendor/llvm/dist/test/Transforms/MemCpyOpt/memcpy-invoke-memcpy.ll vendor/llvm/dist/test/Transforms/MemCpyOpt/merge-into-memset.ll vendor/llvm/dist/test/Transforms/MemCpyOpt/mixed-sizes.ll vendor/llvm/dist/test/Transforms/MemCpyOpt/nonlocal-memcpy-memcpy.ll vendor/llvm/dist/test/Transforms/SimplifyCFG/X86/if-conversion.ll Modified: vendor/llvm/dist/bindings/go/llvm/ir_test.go vendor/llvm/dist/cmake/config-ix.cmake vendor/llvm/dist/cmake/modules/CheckAtomic.cmake vendor/llvm/dist/cmake/modules/CheckCompilerVersion.cmake vendor/llvm/dist/docs/ProgrammersManual.rst vendor/llvm/dist/include/llvm/Analysis/InstructionSimplify.h vendor/llvm/dist/include/llvm/Analysis/MemoryDependenceAnalysis.h vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfo.h vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfoImpl.h vendor/llvm/dist/include/llvm/BinaryFormat/COFF.h vendor/llvm/dist/include/llvm/CodeGen/BasicTTIImpl.h vendor/llvm/dist/include/llvm/IR/IntrinsicsAMDGPU.td vendor/llvm/dist/include/llvm/ProfileData/SampleProf.h vendor/llvm/dist/lib/Analysis/DemandedBits.cpp vendor/llvm/dist/lib/Analysis/InstructionSimplify.cpp vendor/llvm/dist/lib/Analysis/Lint.cpp vendor/llvm/dist/lib/Analysis/MemoryDependenceAnalysis.cpp vendor/llvm/dist/lib/Analysis/ModuleSummaryAnalysis.cpp vendor/llvm/dist/lib/Analysis/ScalarEvolution.cpp vendor/llvm/dist/lib/Analysis/ScalarEvolutionExpander.cpp vendor/llvm/dist/lib/Analysis/TargetTransformInfo.cpp vendor/llvm/dist/lib/Analysis/ValueTracking.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/DAGCombiner.cpp vendor/llvm/dist/lib/IR/SafepointIRVerifier.cpp vendor/llvm/dist/lib/LTO/ThinLTOCodeGenerator.cpp vendor/llvm/dist/lib/MC/MCParser/ELFAsmParser.cpp vendor/llvm/dist/lib/ProfileData/Coverage/CoverageMapping.cpp vendor/llvm/dist/lib/Support/ARMAttributeParser.cpp vendor/llvm/dist/lib/Support/CommandLine.cpp vendor/llvm/dist/lib/TableGen/Main.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64InstrInfo.cpp vendor/llvm/dist/lib/Target/NVPTX/NVPTXAsmPrinter.cpp vendor/llvm/dist/lib/Target/NVPTX/NVPTXMCExpr.cpp vendor/llvm/dist/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp vendor/llvm/dist/lib/Target/X86/AsmParser/X86AsmParser.cpp vendor/llvm/dist/lib/Target/X86/X86.td vendor/llvm/dist/lib/Target/X86/X86ISelLowering.cpp vendor/llvm/dist/lib/Target/X86/X86ISelLowering.h vendor/llvm/dist/lib/Target/X86/X86InstrAVX512.td vendor/llvm/dist/lib/Target/X86/X86InstrSSE.td vendor/llvm/dist/lib/Transforms/IPO/SampleProfile.cpp vendor/llvm/dist/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineCalls.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineVectorOps.cpp vendor/llvm/dist/lib/Transforms/Instrumentation/AddressSanitizer.cpp vendor/llvm/dist/lib/Transforms/Scalar/GVNSink.cpp vendor/llvm/dist/lib/Transforms/Scalar/MemCpyOptimizer.cpp vendor/llvm/dist/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp vendor/llvm/dist/lib/Transforms/Utils/LoopUnrollRuntime.cpp vendor/llvm/dist/lib/Transforms/Utils/SimplifyCFG.cpp vendor/llvm/dist/test/Analysis/DemandedBits/basic.ll vendor/llvm/dist/test/Analysis/DemandedBits/intrinsics.ll vendor/llvm/dist/test/CodeGen/AArch64/aarch64-combine-fmul-fsub.mir vendor/llvm/dist/test/CodeGen/X86/avx512-schedule.ll vendor/llvm/dist/test/CodeGen/X86/branch_instruction_and_target_split_perf_nops.mir vendor/llvm/dist/test/CodeGen/X86/combine-pmuldq.ll vendor/llvm/dist/test/CodeGen/X86/fdiv-combine.ll vendor/llvm/dist/test/CodeGen/X86/gather-addresses.ll vendor/llvm/dist/test/CodeGen/X86/masked_gather_scatter.ll vendor/llvm/dist/test/CodeGen/X86/setcc-combine.ll vendor/llvm/dist/test/CodeGen/X86/shrink_vmul.ll vendor/llvm/dist/test/CodeGen/X86/slow-pmulld.ll vendor/llvm/dist/test/CodeGen/X86/sse2-schedule.ll vendor/llvm/dist/test/MC/ARM/branch-disassemble.s vendor/llvm/dist/test/MC/X86/x86-64.s vendor/llvm/dist/test/SafepointIRVerifier/unrecorded-live-at-sp.ll vendor/llvm/dist/test/SafepointIRVerifier/uses-in-phi-nodes.ll vendor/llvm/dist/test/Transforms/InstCombine/X86/X86FsubCmpCombine.ll vendor/llvm/dist/test/Transforms/InstCombine/intrinsics.ll vendor/llvm/dist/test/Transforms/InstCombine/minmax-fold.ll vendor/llvm/dist/test/Transforms/InstCombine/minmax-fp.ll vendor/llvm/dist/test/Transforms/InstCombine/rem.ll vendor/llvm/dist/test/Transforms/LoopUnroll/runtime-loop1.ll vendor/llvm/dist/test/tools/llvm-cov/cov-comdat.test vendor/llvm/dist/test/tools/llvm-objdump/X86/hex-displacement.test vendor/llvm/dist/tools/dsymutil/CFBundle.cpp vendor/llvm/dist/tools/llvm-cov/CodeCoverage.cpp vendor/llvm/dist/tools/llvm-objdump/llvm-objdump.cpp vendor/llvm/dist/tools/llvm-readobj/COFFDumper.cpp vendor/llvm/dist/tools/llvm-readobj/ELFDumper.cpp vendor/llvm/dist/tools/yaml2obj/yaml2obj.cpp vendor/llvm/dist/unittests/Analysis/ScalarEvolutionTest.cpp vendor/llvm/dist/utils/TableGen/CodeGenDAGPatterns.cpp vendor/llvm/dist/utils/TableGen/DFAPacketizerEmitter.cpp vendor/llvm/dist/utils/TableGen/IntrinsicEmitter.cpp Modified: vendor/llvm/dist/bindings/go/llvm/ir_test.go ============================================================================== --- vendor/llvm/dist/bindings/go/llvm/ir_test.go Thu Dec 28 21:12:27 2017 (r327299) +++ vendor/llvm/dist/bindings/go/llvm/ir_test.go Thu Dec 28 21:22:49 2017 (r327300) @@ -142,7 +142,7 @@ func TestSubtypes(t *testing.T) { int_pointer := PointerType(cont.Int32Type(), 0) int_inner := int_pointer.Subtypes() if len(int_inner) != 1 { - t.Errorf("Got size %d, though wanted 1") + t.Errorf("Got size %d, though wanted 1", len(int_inner)) } if int_inner[0] != cont.Int32Type() { t.Errorf("Expected int32 type") @@ -151,7 +151,7 @@ func TestSubtypes(t *testing.T) { st_pointer := cont.StructType([]Type{cont.Int32Type(), cont.Int8Type()}, false) st_inner := st_pointer.Subtypes() if len(st_inner) != 2 { - t.Errorf("Got size %d, though wanted 2") + t.Errorf("Got size %d, though wanted 2", len(int_inner)) } if st_inner[0] != cont.Int32Type() { t.Errorf("Expected first struct field to be int32") Modified: vendor/llvm/dist/cmake/config-ix.cmake ============================================================================== --- vendor/llvm/dist/cmake/config-ix.cmake Thu Dec 28 21:12:27 2017 (r327299) +++ vendor/llvm/dist/cmake/config-ix.cmake Thu Dec 28 21:22:49 2017 (r327300) @@ -17,7 +17,7 @@ include(HandleLLVMStdlib) if( UNIX AND NOT (BEOS OR HAIKU) ) # Used by check_symbol_exists: - set(CMAKE_REQUIRED_LIBRARIES m) + list(APPEND CMAKE_REQUIRED_LIBRARIES "m") endif() # x86_64 FreeBSD 9.2 requires libcxxrt to be specified explicitly. if( CMAKE_SYSTEM MATCHES "FreeBSD-9.2-RELEASE" AND Modified: vendor/llvm/dist/cmake/modules/CheckAtomic.cmake ============================================================================== --- vendor/llvm/dist/cmake/modules/CheckAtomic.cmake Thu Dec 28 21:12:27 2017 (r327299) +++ vendor/llvm/dist/cmake/modules/CheckAtomic.cmake Thu Dec 28 21:22:49 2017 (r327300) @@ -8,7 +8,7 @@ INCLUDE(CheckLibraryExists) function(check_working_cxx_atomics varname) set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS}) - set(CMAKE_REQUIRED_FLAGS "-std=c++11") + set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -std=c++11") CHECK_CXX_SOURCE_COMPILES(" #include std::atomic x; Modified: vendor/llvm/dist/cmake/modules/CheckCompilerVersion.cmake ============================================================================== --- vendor/llvm/dist/cmake/modules/CheckCompilerVersion.cmake Thu Dec 28 21:12:27 2017 (r327299) +++ vendor/llvm/dist/cmake/modules/CheckCompilerVersion.cmake Thu Dec 28 21:22:49 2017 (r327300) @@ -28,7 +28,7 @@ if(NOT DEFINED LLVM_COMPILER_CHECKED) # bug in libstdc++4.6 that is fixed in libstdc++4.7. set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS}) set(OLD_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}) - set(CMAKE_REQUIRED_FLAGS "-std=c++0x") + set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -std=c++0x") check_cxx_source_compiles(" #include std::atomic x(0.0f); Modified: vendor/llvm/dist/docs/ProgrammersManual.rst ============================================================================== --- vendor/llvm/dist/docs/ProgrammersManual.rst Thu Dec 28 21:12:27 2017 (r327299) +++ vendor/llvm/dist/docs/ProgrammersManual.rst Thu Dec 28 21:22:49 2017 (r327300) @@ -1040,7 +1040,7 @@ line argument: .. code-block:: c++ - DEBUG(errs() << "I am here!\n"); + DEBUG(dbgs() << "I am here!\n"); Then you can run your pass like this: @@ -1076,10 +1076,10 @@ follows: .. code-block:: c++ #define DEBUG_TYPE "foo" - DEBUG(errs() << "'foo' debug type\n"); + DEBUG(dbgs() << "'foo' debug type\n"); #undef DEBUG_TYPE #define DEBUG_TYPE "bar" - DEBUG(errs() << "'bar' debug type\n")); + DEBUG(dbgs() << "'bar' debug type\n"); #undef DEBUG_TYPE Then you can run your pass like this: @@ -1120,8 +1120,8 @@ preceding example could be written as: .. code-block:: c++ - DEBUG_WITH_TYPE("foo", errs() << "'foo' debug type\n"); - DEBUG_WITH_TYPE("bar", errs() << "'bar' debug type\n")); + DEBUG_WITH_TYPE("foo", dbgs() << "'foo' debug type\n"); + DEBUG_WITH_TYPE("bar", dbgs() << "'bar' debug type\n"); .. _Statistic: Modified: vendor/llvm/dist/include/llvm/Analysis/InstructionSimplify.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/InstructionSimplify.h Thu Dec 28 21:12:27 2017 (r327299) +++ vendor/llvm/dist/include/llvm/Analysis/InstructionSimplify.h Thu Dec 28 21:22:49 2017 (r327300) @@ -197,6 +197,9 @@ Value *SimplifyBinOp(unsigned Opcode, Value *LHS, Valu Value *SimplifyFPBinOp(unsigned Opcode, Value *LHS, Value *RHS, FastMathFlags FMF, const SimplifyQuery &Q); +/// Given a callsite, fold the result or return null. +Value *SimplifyCall(ImmutableCallSite CS, const SimplifyQuery &Q); + /// Given a function and iterators over arguments, fold the result or return /// null. Value *SimplifyCall(ImmutableCallSite CS, Value *V, User::op_iterator ArgBegin, Modified: vendor/llvm/dist/include/llvm/Analysis/MemoryDependenceAnalysis.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/MemoryDependenceAnalysis.h Thu Dec 28 21:12:27 2017 (r327299) +++ vendor/llvm/dist/include/llvm/Analysis/MemoryDependenceAnalysis.h Thu Dec 28 21:22:49 2017 (r327300) @@ -407,12 +407,6 @@ class MemoryDependenceResults { (public) void getNonLocalPointerDependency(Instruction *QueryInst, SmallVectorImpl &Result); - /// Perform a dependency query specifically for QueryInst's access to Loc. - /// The other comments for getNonLocalPointerDependency apply here as well. - void getNonLocalPointerDependencyFrom(Instruction *QueryInst, - const MemoryLocation &Loc, bool isLoad, - SmallVectorImpl &Result); - /// Removes an instruction from the dependence analysis, updating the /// dependence of instructions that previously depended on it. void removeInstruction(Instruction *InstToRemove); Modified: vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfo.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfo.h Thu Dec 28 21:12:27 2017 (r327299) +++ vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfo.h Thu Dec 28 21:22:49 2017 (r327300) @@ -646,9 +646,6 @@ class TargetTransformInfo { (public) /// \brief Additional properties of an operand's values. enum OperandValueProperties { OP_None = 0, OP_PowerOf2 = 1 }; - /// \return True if target can execute instructions out of order. - bool isOutOfOrder() const; - /// \return The number of scalar or vector registers that the target has. /// If 'Vectors' is true, it returns the number of vector registers. If it is /// set to false, it returns the number of scalar registers. @@ -1021,7 +1018,6 @@ class TargetTransformInfo::Concept { (public) Type *Ty) = 0; virtual int getIntImmCost(Intrinsic::ID IID, unsigned Idx, const APInt &Imm, Type *Ty) = 0; - virtual bool isOutOfOrder() const = 0; virtual unsigned getNumberOfRegisters(bool Vector) = 0; virtual unsigned getRegisterBitWidth(bool Vector) const = 0; virtual unsigned getMinVectorRegisterBitWidth() = 0; @@ -1298,9 +1294,6 @@ class TargetTransformInfo::Model final : public Target int getIntImmCost(Intrinsic::ID IID, unsigned Idx, const APInt &Imm, Type *Ty) override { return Impl.getIntImmCost(IID, Idx, Imm, Ty); - } - bool isOutOfOrder() const override { - return Impl.isOutOfOrder(); } unsigned getNumberOfRegisters(bool Vector) override { return Impl.getNumberOfRegisters(Vector); Modified: vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfoImpl.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfoImpl.h Thu Dec 28 21:12:27 2017 (r327299) +++ vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfoImpl.h Thu Dec 28 21:22:49 2017 (r327300) @@ -337,8 +337,6 @@ class TargetTransformInfoImplBase { (public) return TTI::TCC_Free; } - bool isOutOfOrder() const { return false; } - unsigned getNumberOfRegisters(bool Vector) { return 8; } unsigned getRegisterBitWidth(bool Vector) const { return 32; } Modified: vendor/llvm/dist/include/llvm/BinaryFormat/COFF.h ============================================================================== --- vendor/llvm/dist/include/llvm/BinaryFormat/COFF.h Thu Dec 28 21:12:27 2017 (r327299) +++ vendor/llvm/dist/include/llvm/BinaryFormat/COFF.h Thu Dec 28 21:22:49 2017 (r327300) @@ -95,7 +95,7 @@ enum MachineTypes : unsigned { MT_Invalid = 0xffff, IMAGE_FILE_MACHINE_UNKNOWN = 0x0, - IMAGE_FILE_MACHINE_AM33 = 0x13, + IMAGE_FILE_MACHINE_AM33 = 0x1D3, IMAGE_FILE_MACHINE_AMD64 = 0x8664, IMAGE_FILE_MACHINE_ARM = 0x1C0, IMAGE_FILE_MACHINE_ARMNT = 0x1C4, Modified: vendor/llvm/dist/include/llvm/CodeGen/BasicTTIImpl.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/BasicTTIImpl.h Thu Dec 28 21:12:27 2017 (r327299) +++ vendor/llvm/dist/include/llvm/CodeGen/BasicTTIImpl.h Thu Dec 28 21:22:49 2017 (r327300) @@ -402,10 +402,6 @@ class BasicTTIImplBase : public TargetTransformInfoImp return BaseT::getInstructionLatency(I); } - bool isOutOfOrder() const { - return getST()->getSchedModel().isOutOfOrder(); - } - /// @} /// \name Vector TTI Implementations Modified: vendor/llvm/dist/include/llvm/IR/IntrinsicsAMDGPU.td ============================================================================== --- vendor/llvm/dist/include/llvm/IR/IntrinsicsAMDGPU.td Thu Dec 28 21:12:27 2017 (r327299) +++ vendor/llvm/dist/include/llvm/IR/IntrinsicsAMDGPU.td Thu Dec 28 21:22:49 2017 (r327300) @@ -288,7 +288,8 @@ class AMDGPUAtomicIncIntrin : Intrinsic<[llvm_anyint_t llvm_i32_ty, // ordering llvm_i32_ty, // scope llvm_i1_ty], // isVolatile - [IntrArgMemOnly, NoCapture<0>] + [IntrArgMemOnly, NoCapture<0>], "", + [SDNPMemOperand] >; def int_amdgcn_atomic_inc : AMDGPUAtomicIncIntrin; Modified: vendor/llvm/dist/include/llvm/ProfileData/SampleProf.h ============================================================================== --- vendor/llvm/dist/include/llvm/ProfileData/SampleProf.h Thu Dec 28 21:12:27 2017 (r327299) +++ vendor/llvm/dist/include/llvm/ProfileData/SampleProf.h Thu Dec 28 21:22:49 2017 (r327300) @@ -226,8 +226,8 @@ class FunctionSamples { (public) sampleprof_error addCalledTargetSamples(uint32_t LineOffset, uint32_t Discriminator, - const std::string &FName, - uint64_t Num, uint64_t Weight = 1) { + StringRef FName, uint64_t Num, + uint64_t Weight = 1) { return BodySamples[LineLocation(LineOffset, Discriminator)].addCalledTarget( FName, Num, Weight); } Modified: vendor/llvm/dist/lib/Analysis/DemandedBits.cpp ============================================================================== --- vendor/llvm/dist/lib/Analysis/DemandedBits.cpp Thu Dec 28 21:12:27 2017 (r327299) +++ vendor/llvm/dist/lib/Analysis/DemandedBits.cpp Thu Dec 28 21:22:49 2017 (r327300) @@ -385,8 +385,8 @@ bool DemandedBits::isInstructionDead(Instruction *I) { void DemandedBits::print(raw_ostream &OS) { performAnalysis(); for (auto &KV : AliveBits) { - OS << "DemandedBits: 0x" << utohexstr(KV.second.getLimitedValue()) << " for " - << *KV.first << "\n"; + OS << "DemandedBits: 0x" << Twine::utohexstr(KV.second.getLimitedValue()) + << " for " << *KV.first << '\n'; } } Modified: vendor/llvm/dist/lib/Analysis/InstructionSimplify.cpp ============================================================================== --- vendor/llvm/dist/lib/Analysis/InstructionSimplify.cpp Thu Dec 28 21:12:27 2017 (r327299) +++ vendor/llvm/dist/lib/Analysis/InstructionSimplify.cpp Thu Dec 28 21:22:49 2017 (r327300) @@ -3897,8 +3897,9 @@ static Value *SimplifyExtractElementInst(Value *Vec, V // If extracting a specified index from the vector, see if we can recursively // find a previously computed scalar that was inserted into the vector. if (auto *IdxC = dyn_cast(Idx)) - if (Value *Elt = findScalarElement(Vec, IdxC->getZExtValue())) - return Elt; + if (IdxC->getValue().ule(Vec->getType()->getVectorNumElements())) + if (Value *Elt = findScalarElement(Vec, IdxC->getZExtValue())) + return Elt; // An undef extract index can be arbitrarily chosen to be an out-of-range // index value, which would result in the instruction being undef. @@ -4494,6 +4495,22 @@ static Value *SimplifyIntrinsic(Function *F, IterTy Ar return *ArgBegin; return nullptr; } + case Intrinsic::bswap: { + Value *IIOperand = *ArgBegin; + Value *X = nullptr; + // bswap(bswap(x)) -> x + if (match(IIOperand, m_BSwap(m_Value(X)))) + return X; + return nullptr; + } + case Intrinsic::bitreverse: { + Value *IIOperand = *ArgBegin; + Value *X = nullptr; + // bitreverse(bitreverse(x)) -> x + if (match(IIOperand, m_BitReverse(m_Value(X)))) + return X; + return nullptr; + } default: return nullptr; } @@ -4548,6 +4565,16 @@ static Value *SimplifyIntrinsic(Function *F, IterTy Ar return SimplifyRelativeLoad(C0, C1, Q.DL); return nullptr; } + case Intrinsic::powi: + if (ConstantInt *Power = dyn_cast(RHS)) { + // powi(x, 0) -> 1.0 + if (Power->isZero()) + return ConstantFP::get(LHS->getType(), 1.0); + // powi(x, 1) -> x + if (Power->isOne()) + return LHS; + } + return nullptr; default: return nullptr; } @@ -4616,6 +4643,12 @@ Value *llvm::SimplifyCall(ImmutableCallSite CS, Value return ::SimplifyCall(CS, V, Args.begin(), Args.end(), Q, RecursionLimit); } +Value *llvm::SimplifyCall(ImmutableCallSite ICS, const SimplifyQuery &Q) { + CallSite CS(const_cast(ICS.getInstruction())); + return ::SimplifyCall(CS, CS.getCalledValue(), CS.arg_begin(), CS.arg_end(), + Q, RecursionLimit); +} + /// See if we can compute a simplified version of this instruction. /// If not, this returns null. @@ -4750,8 +4783,7 @@ Value *llvm::SimplifyInstruction(Instruction *I, const break; case Instruction::Call: { CallSite CS(cast(I)); - Result = SimplifyCall(CS, CS.getCalledValue(), CS.arg_begin(), CS.arg_end(), - Q); + Result = SimplifyCall(CS, Q); break; } #define HANDLE_CAST_INST(num, opc, clas) case Instruction::opc: Modified: vendor/llvm/dist/lib/Analysis/Lint.cpp ============================================================================== --- vendor/llvm/dist/lib/Analysis/Lint.cpp Thu Dec 28 21:12:27 2017 (r327299) +++ vendor/llvm/dist/lib/Analysis/Lint.cpp Thu Dec 28 21:22:49 2017 (r327300) @@ -265,13 +265,21 @@ void Lint::visitCallSite(CallSite CS) { // Check that noalias arguments don't alias other arguments. This is // not fully precise because we don't know the sizes of the dereferenced // memory regions. - if (Formal->hasNoAliasAttr() && Actual->getType()->isPointerTy()) - for (CallSite::arg_iterator BI = CS.arg_begin(); BI != AE; ++BI) + if (Formal->hasNoAliasAttr() && Actual->getType()->isPointerTy()) { + AttributeList PAL = CS.getAttributes(); + unsigned ArgNo = 0; + for (CallSite::arg_iterator BI = CS.arg_begin(); BI != AE; ++BI) { + // Skip ByVal arguments since they will be memcpy'd to the callee's + // stack so we're not really passing the pointer anyway. + if (PAL.hasParamAttribute(ArgNo++, Attribute::ByVal)) + continue; if (AI != BI && (*BI)->getType()->isPointerTy()) { AliasResult Result = AA->alias(*AI, *BI); Assert(Result != MustAlias && Result != PartialAlias, "Unusual: noalias argument aliases another argument", &I); } + } + } // Check that an sret argument points to valid memory. if (Formal->hasStructRetAttr() && Actual->getType()->isPointerTy()) { Modified: vendor/llvm/dist/lib/Analysis/MemoryDependenceAnalysis.cpp ============================================================================== --- vendor/llvm/dist/lib/Analysis/MemoryDependenceAnalysis.cpp Thu Dec 28 21:12:27 2017 (r327299) +++ vendor/llvm/dist/lib/Analysis/MemoryDependenceAnalysis.cpp Thu Dec 28 21:22:49 2017 (r327300) @@ -920,14 +920,6 @@ void MemoryDependenceResults::getNonLocalPointerDepend Instruction *QueryInst, SmallVectorImpl &Result) { const MemoryLocation Loc = MemoryLocation::get(QueryInst); bool isLoad = isa(QueryInst); - return getNonLocalPointerDependencyFrom(QueryInst, Loc, isLoad, Result); -} - -void MemoryDependenceResults::getNonLocalPointerDependencyFrom( - Instruction *QueryInst, - const MemoryLocation &Loc, - bool isLoad, - SmallVectorImpl &Result) { BasicBlock *FromBB = QueryInst->getParent(); assert(FromBB); @@ -1127,15 +1119,21 @@ bool MemoryDependenceResults::getNonLocalPointerDepFro // If we already have a cache entry for this CacheKey, we may need to do some // work to reconcile the cache entry and the current query. if (!Pair.second) { - if (CacheInfo->Size != Loc.Size) { - // The query's Size differs from the cached one. Throw out the - // cached data and proceed with the query at the new size. + if (CacheInfo->Size < Loc.Size) { + // The query's Size is greater than the cached one. Throw out the + // cached data and proceed with the query at the greater size. CacheInfo->Pair = BBSkipFirstBlockPair(); CacheInfo->Size = Loc.Size; for (auto &Entry : CacheInfo->NonLocalDeps) if (Instruction *Inst = Entry.getResult().getInst()) RemoveFromReverseMap(ReverseNonLocalPtrDeps, Inst, CacheKey); CacheInfo->NonLocalDeps.clear(); + } else if (CacheInfo->Size > Loc.Size) { + // This query's Size is less than the cached one. Conservatively restart + // the query using the greater size. + return getNonLocalPointerDepFromBB( + QueryInst, Pointer, Loc.getWithNewSize(CacheInfo->Size), isLoad, + StartBB, Result, Visited, SkipFirstBlock); } // If the query's AATags are inconsistent with the cached one, Modified: vendor/llvm/dist/lib/Analysis/ModuleSummaryAnalysis.cpp ============================================================================== --- vendor/llvm/dist/lib/Analysis/ModuleSummaryAnalysis.cpp Thu Dec 28 21:12:27 2017 (r327299) +++ vendor/llvm/dist/lib/Analysis/ModuleSummaryAnalysis.cpp Thu Dec 28 21:22:49 2017 (r327300) @@ -306,7 +306,9 @@ computeFunctionSummary(ModuleSummaryIndex &Index, cons NonRenamableLocal || HasInlineAsmMaybeReferencingInternal || // Inliner doesn't handle variadic functions. // FIXME: refactor this to use the same code that inliner is using. - F.isVarArg(); + F.isVarArg() || + // Don't try to import functions with noinline attribute. + F.getAttributes().hasFnAttribute(Attribute::NoInline); GlobalValueSummary::GVFlags Flags(F.getLinkage(), NotEligibleForImport, /* Live = */ false, F.isDSOLocal()); FunctionSummary::FFlags FunFlags{ Modified: vendor/llvm/dist/lib/Analysis/ScalarEvolution.cpp ============================================================================== --- vendor/llvm/dist/lib/Analysis/ScalarEvolution.cpp Thu Dec 28 21:12:27 2017 (r327299) +++ vendor/llvm/dist/lib/Analysis/ScalarEvolution.cpp Thu Dec 28 21:22:49 2017 (r327300) @@ -1268,7 +1268,11 @@ const SCEV *ScalarEvolution::getTruncateExpr(const SCE } if (!hasTrunc) return getAddExpr(Operands); - UniqueSCEVs.FindNodeOrInsertPos(ID, IP); // Mutates IP, returns NULL. + // In spite we checked in the beginning that ID is not in the cache, + // it is possible that during recursion and different modification + // ID came to cache, so if we found it, just return it. + if (const SCEV *S = UniqueSCEVs.FindNodeOrInsertPos(ID, IP)) + return S; } // trunc(x1*x2*...*xN) --> trunc(x1)*trunc(x2)*...*trunc(xN) if we can @@ -1284,7 +1288,11 @@ const SCEV *ScalarEvolution::getTruncateExpr(const SCE } if (!hasTrunc) return getMulExpr(Operands); - UniqueSCEVs.FindNodeOrInsertPos(ID, IP); // Mutates IP, returns NULL. + // In spite we checked in the beginning that ID is not in the cache, + // it is possible that during recursion and different modification + // ID came to cache, so if we found it, just return it. + if (const SCEV *S = UniqueSCEVs.FindNodeOrInsertPos(ID, IP)) + return S; } // If the input value is a chrec scev, truncate the chrec's operands. Modified: vendor/llvm/dist/lib/Analysis/ScalarEvolutionExpander.cpp ============================================================================== --- vendor/llvm/dist/lib/Analysis/ScalarEvolutionExpander.cpp Thu Dec 28 21:12:27 2017 (r327299) +++ vendor/llvm/dist/lib/Analysis/ScalarEvolutionExpander.cpp Thu Dec 28 21:22:49 2017 (r327300) @@ -187,8 +187,21 @@ Value *SCEVExpander::InsertBinop(Instruction::BinaryOp // generated code. if (isa(IP)) ScanLimit++; + + // Conservatively, do not use any instruction which has any of wrap/exact + // flags installed. + // TODO: Instead of simply disable poison instructions we can be clever + // here and match SCEV to this instruction. + auto canGeneratePoison = [](Instruction *I) { + if (isa(I) && + (I->hasNoSignedWrap() || I->hasNoUnsignedWrap())) + return true; + if (isa(I) && I->isExact()) + return true; + return false; + }; if (IP->getOpcode() == (unsigned)Opcode && IP->getOperand(0) == LHS && - IP->getOperand(1) == RHS) + IP->getOperand(1) == RHS && !canGeneratePoison(&*IP)) return &*IP; if (IP == BlockBegin) break; } Modified: vendor/llvm/dist/lib/Analysis/TargetTransformInfo.cpp ============================================================================== --- vendor/llvm/dist/lib/Analysis/TargetTransformInfo.cpp Thu Dec 28 21:12:27 2017 (r327299) +++ vendor/llvm/dist/lib/Analysis/TargetTransformInfo.cpp Thu Dec 28 21:22:49 2017 (r327300) @@ -314,10 +314,6 @@ int TargetTransformInfo::getIntImmCost(Intrinsic::ID I return Cost; } -bool TargetTransformInfo::isOutOfOrder() const { - return TTIImpl->isOutOfOrder(); -} - unsigned TargetTransformInfo::getNumberOfRegisters(bool Vector) const { return TTIImpl->getNumberOfRegisters(Vector); } Modified: vendor/llvm/dist/lib/Analysis/ValueTracking.cpp ============================================================================== --- vendor/llvm/dist/lib/Analysis/ValueTracking.cpp Thu Dec 28 21:12:27 2017 (r327299) +++ vendor/llvm/dist/lib/Analysis/ValueTracking.cpp Thu Dec 28 21:22:49 2017 (r327300) @@ -4238,14 +4238,14 @@ static SelectPatternResult matchSelectPattern(CmpInst: LHS = CmpLHS; RHS = CmpRHS; - // If the predicate is an "or-equal" (FP) predicate, then signed zeroes may - // return inconsistent results between implementations. - // (0.0 <= -0.0) ? 0.0 : -0.0 // Returns 0.0 - // minNum(0.0, -0.0) // May return -0.0 or 0.0 (IEEE 754-2008 5.3.1) - // Therefore we behave conservatively and only proceed if at least one of the - // operands is known to not be zero, or if we don't care about signed zeroes. + // Signed zero may return inconsistent results between implementations. + // (0.0 <= -0.0) ? 0.0 : -0.0 // Returns 0.0 + // minNum(0.0, -0.0) // May return -0.0 or 0.0 (IEEE 754-2008 5.3.1) + // Therefore, we behave conservatively and only proceed if at least one of the + // operands is known to not be zero or if we don't care about signed zero. switch (Pred) { default: break; + // FIXME: Include OGT/OLT/UGT/ULT. case CmpInst::FCMP_OGE: case CmpInst::FCMP_OLE: case CmpInst::FCMP_UGE: case CmpInst::FCMP_ULE: if (!FMF.noSignedZeros() && !isKnownNonZero(CmpLHS) && @@ -4493,14 +4493,24 @@ SelectPatternResult llvm::matchSelectPattern(Value *V, // Deal with type mismatches. if (CastOp && CmpLHS->getType() != TrueVal->getType()) { - if (Value *C = lookThroughCast(CmpI, TrueVal, FalseVal, CastOp)) + if (Value *C = lookThroughCast(CmpI, TrueVal, FalseVal, CastOp)) { + // If this is a potential fmin/fmax with a cast to integer, then ignore + // -0.0 because there is no corresponding integer value. + if (*CastOp == Instruction::FPToSI || *CastOp == Instruction::FPToUI) + FMF.setNoSignedZeros(); return ::matchSelectPattern(Pred, FMF, CmpLHS, CmpRHS, cast(TrueVal)->getOperand(0), C, LHS, RHS); - if (Value *C = lookThroughCast(CmpI, FalseVal, TrueVal, CastOp)) + } + if (Value *C = lookThroughCast(CmpI, FalseVal, TrueVal, CastOp)) { + // If this is a potential fmin/fmax with a cast to integer, then ignore + // -0.0 because there is no corresponding integer value. + if (*CastOp == Instruction::FPToSI || *CastOp == Instruction::FPToUI) + FMF.setNoSignedZeros(); return ::matchSelectPattern(Pred, FMF, CmpLHS, CmpRHS, C, cast(FalseVal)->getOperand(0), LHS, RHS); + } } return ::matchSelectPattern(Pred, FMF, CmpLHS, CmpRHS, TrueVal, FalseVal, LHS, RHS); Modified: vendor/llvm/dist/lib/CodeGen/SelectionDAG/DAGCombiner.cpp ============================================================================== --- vendor/llvm/dist/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Thu Dec 28 21:12:27 2017 (r327299) +++ vendor/llvm/dist/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Thu Dec 28 21:22:49 2017 (r327300) @@ -1922,14 +1922,16 @@ SDValue DAGCombiner::foldBinOpIntoSelect(SDNode *BO) { EVT VT = Sel.getValueType(); SDLoc DL(Sel); SDValue NewCT = DAG.getNode(BinOpcode, DL, VT, CT, C1); - assert((NewCT.isUndef() || isConstantOrConstantVector(NewCT) || - isConstantFPBuildVectorOrConstantFP(NewCT)) && - "Failed to constant fold a binop with constant operands"); + if (!NewCT.isUndef() && + !isConstantOrConstantVector(NewCT, true) && + !isConstantFPBuildVectorOrConstantFP(NewCT)) + return SDValue(); SDValue NewCF = DAG.getNode(BinOpcode, DL, VT, CF, C1); - assert((NewCF.isUndef() || isConstantOrConstantVector(NewCF) || - isConstantFPBuildVectorOrConstantFP(NewCF)) && - "Failed to constant fold a binop with constant operands"); + if (!NewCF.isUndef() && + !isConstantOrConstantVector(NewCF, true) && + !isConstantFPBuildVectorOrConstantFP(NewCF)) + return SDValue(); return DAG.getSelect(DL, VT, Sel.getOperand(0), NewCT, NewCF); } @@ -3577,7 +3579,8 @@ SDValue DAGCombiner::foldLogicOfSetCCs(bool IsAnd, SDV // TODO: What is the 'or' equivalent of this fold? // (and (setne X, 0), (setne X, -1)) --> (setuge (add X, 1), 2) - if (IsAnd && LL == RL && CC0 == CC1 && IsInteger && CC0 == ISD::SETNE && + if (IsAnd && LL == RL && CC0 == CC1 && OpVT.getScalarSizeInBits() > 1 && + IsInteger && CC0 == ISD::SETNE && ((isNullConstant(LR) && isAllOnesConstant(RR)) || (isAllOnesConstant(LR) && isNullConstant(RR)))) { SDValue One = DAG.getConstant(1, DL, OpVT); @@ -3641,15 +3644,18 @@ SDValue DAGCombiner::visitANDLike(SDValue N0, SDValue if (N0.getOpcode() == ISD::ADD && N1.getOpcode() == ISD::SRL && VT.getSizeInBits() <= 64) { if (ConstantSDNode *ADDI = dyn_cast(N0.getOperand(1))) { - APInt ADDC = ADDI->getAPIntValue(); - if (!TLI.isLegalAddImmediate(ADDC.getSExtValue())) { + if (ConstantSDNode *SRLI = dyn_cast(N1.getOperand(1))) { // Look for (and (add x, c1), (lshr y, c2)). If C1 wasn't a legal // immediate for an add, but it is legal if its top c2 bits are set, // transform the ADD so the immediate doesn't need to be materialized // in a register. - if (ConstantSDNode *SRLI = dyn_cast(N1.getOperand(1))) { + APInt ADDC = ADDI->getAPIntValue(); + APInt SRLC = SRLI->getAPIntValue(); + if (ADDC.getMinSignedBits() <= 64 && + SRLC.ult(VT.getSizeInBits()) && + !TLI.isLegalAddImmediate(ADDC.getSExtValue())) { APInt Mask = APInt::getHighBitsSet(VT.getSizeInBits(), - SRLI->getZExtValue()); + SRLC.getZExtValue()); if (DAG.MaskedValueIsZero(N0.getOperand(1), Mask)) { ADDC |= Mask; if (TLI.isLegalAddImmediate(ADDC.getSExtValue())) { Modified: vendor/llvm/dist/lib/IR/SafepointIRVerifier.cpp ============================================================================== --- vendor/llvm/dist/lib/IR/SafepointIRVerifier.cpp Thu Dec 28 21:12:27 2017 (r327299) +++ vendor/llvm/dist/lib/IR/SafepointIRVerifier.cpp Thu Dec 28 21:22:49 2017 (r327300) @@ -237,6 +237,59 @@ class InstructionVerifier; /// Builds BasicBlockState for each BB of the function. /// It can traverse function for verification and provides all required /// information. +/// +/// GC pointer may be in one of three states: relocated, unrelocated and +/// poisoned. +/// Relocated pointer may be used without any restrictions. +/// Unrelocated pointer cannot be dereferenced, passed as argument to any call +/// or returned. Unrelocated pointer may be safely compared against another +/// unrelocated pointer or against a pointer exclusively derived from null. +/// Poisoned pointers are produced when we somehow derive pointer from relocated +/// and unrelocated pointers (e.g. phi, select). This pointers may be safely +/// used in a very limited number of situations. Currently the only way to use +/// it is comparison against constant exclusively derived from null. All +/// limitations arise due to their undefined state: this pointers should be +/// treated as relocated and unrelocated simultaneously. +/// Rules of deriving: +/// R + U = P - that's where the poisoned pointers come from +/// P + X = P +/// U + U = U +/// R + R = R +/// X + C = X +/// Where "+" - any operation that somehow derive pointer, U - unrelocated, +/// R - relocated and P - poisoned, C - constant, X - U or R or P or C or +/// nothing (in case when "+" is unary operation). +/// Deriving of pointers by itself is always safe. +/// NOTE: when we are making decision on the status of instruction's result: +/// a) for phi we need to check status of each input *at the end of +/// corresponding predecessor BB*. +/// b) for other instructions we need to check status of each input *at the +/// current point*. +/// +/// FIXME: This works fairly well except one case +/// bb1: +/// p = *some GC-ptr def* +/// p1 = gep p, offset +/// / | +/// / | +/// bb2: | +/// safepoint | +/// \ | +/// \ | +/// bb3: +/// p2 = phi [p, bb2] [p1, bb1] +/// p3 = phi [p, bb2] [p, bb1] +/// here p and p1 is unrelocated +/// p2 and p3 is poisoned (though they shouldn't be) +/// +/// This leads to some weird results: +/// cmp eq p, p2 - illegal instruction (false-positive) +/// cmp eq p1, p2 - illegal instruction (false-positive) +/// cmp eq p, p3 - illegal instruction (false-positive) +/// cmp eq p, p1 - ok +/// To fix this we need to introduce conception of generations and be able to +/// check if two values belong to one generation or not. This way p2 will be +/// considered to be unrelocated and no false alarm will happen. class GCPtrTracker { const Function &F; SpecificBumpPtrAllocator BSAllocator; @@ -244,6 +297,9 @@ class GCPtrTracker { // This set contains defs of unrelocated pointers that are proved to be legal // and don't need verification. DenseSet ValidUnrelocatedDefs; + // This set contains poisoned defs. They can be safely ignored during + // verification too. + DenseSet PoisonedDefs; public: GCPtrTracker(const Function &F, const DominatorTree &DT); @@ -251,6 +307,8 @@ class GCPtrTracker { BasicBlockState *getBasicBlockState(const BasicBlock *BB); const BasicBlockState *getBasicBlockState(const BasicBlock *BB) const; + bool isValuePoisoned(const Value *V) const { return PoisonedDefs.count(V); } + /// Traverse each BB of the function and call /// InstructionVerifier::verifyInstruction for each possibly invalid /// instruction. @@ -349,7 +407,9 @@ const BasicBlockState *GCPtrTracker::getBasicBlockStat } bool GCPtrTracker::instructionMayBeSkipped(const Instruction *I) const { - return ValidUnrelocatedDefs.count(I); + // Poisoned defs are skipped since they are always safe by itself by + // definition (for details see comment to this class). + return ValidUnrelocatedDefs.count(I) || PoisonedDefs.count(I); } void GCPtrTracker::verifyFunction(GCPtrTracker &&Tracker, @@ -418,31 +478,78 @@ bool GCPtrTracker::removeValidUnrelocatedDefs(const Ba "Passed Contribution should be from the passed BasicBlockState!"); AvailableValueSet AvailableSet = BBS->AvailableIn; bool ContributionChanged = false; + // For explanation why instructions are processed this way see + // "Rules of deriving" in the comment to this class. for (const Instruction &I : *BB) { - bool ProducesUnrelocatedPointer = false; - if ((isa(I) || isa(I)) && - containsGCPtrType(I.getType())) { - // GEP/bitcast of unrelocated pointer is legal by itself but this - // def shouldn't appear in any AvailableSet. + bool ValidUnrelocatedPointerDef = false; + bool PoisonedPointerDef = false; + // TODO: `select` instructions should be handled here too. + if (const PHINode *PN = dyn_cast(&I)) { + if (containsGCPtrType(PN->getType())) { + // If both is true, output is poisoned. + bool HasRelocatedInputs = false; + bool HasUnrelocatedInputs = false; + for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) { + const BasicBlock *InBB = PN->getIncomingBlock(i); + const Value *InValue = PN->getIncomingValue(i); + + if (isNotExclusivelyConstantDerived(InValue)) { + if (isValuePoisoned(InValue)) { + // If any of inputs is poisoned, output is always poisoned too. + HasRelocatedInputs = true; + HasUnrelocatedInputs = true; + break; + } + if (BlockMap[InBB]->AvailableOut.count(InValue)) + HasRelocatedInputs = true; + else + HasUnrelocatedInputs = true; + } + } + if (HasUnrelocatedInputs) { + if (HasRelocatedInputs) + PoisonedPointerDef = true; + else + ValidUnrelocatedPointerDef = true; + } + } + } else if ((isa(I) || isa(I)) && + containsGCPtrType(I.getType())) { + // GEP/bitcast of unrelocated pointer is legal by itself but this def + // shouldn't appear in any AvailableSet. for (const Value *V : I.operands()) if (containsGCPtrType(V->getType()) && isNotExclusivelyConstantDerived(V) && !AvailableSet.count(V)) { - ProducesUnrelocatedPointer = true; + if (isValuePoisoned(V)) + PoisonedPointerDef = true; + else + ValidUnrelocatedPointerDef = true; break; } } - if (!ProducesUnrelocatedPointer) { - bool Cleared = false; - transferInstruction(I, Cleared, AvailableSet); - (void)Cleared; - } else { - // Remove def of unrelocated pointer from Contribution of this BB - // and trigger update of all its successors. + assert(!(ValidUnrelocatedPointerDef && PoisonedPointerDef) && + "Value cannot be both unrelocated and poisoned!"); + if (ValidUnrelocatedPointerDef) { + // Remove def of unrelocated pointer from Contribution of this BB and + // trigger update of all its successors. Contribution.erase(&I); + PoisonedDefs.erase(&I); ValidUnrelocatedDefs.insert(&I); - DEBUG(dbgs() << "Removing " << I << " from Contribution of " + DEBUG(dbgs() << "Removing urelocated " << I << " from Contribution of " << BB->getName() << "\n"); ContributionChanged = true; + } else if (PoisonedPointerDef) { + // Mark pointer as poisoned, remove its def from Contribution and trigger + // update of all successors. + Contribution.erase(&I); + PoisonedDefs.insert(&I); + DEBUG(dbgs() << "Removing poisoned " << I << " from Contribution of " + << BB->getName() << "\n"); + ContributionChanged = true; + } else { + bool Cleared = false; + transferInstruction(I, Cleared, AvailableSet); + (void)Cleared; } } return ContributionChanged; @@ -524,8 +631,8 @@ void InstructionVerifier::verifyInstruction( // Returns true if LHS and RHS are unrelocated pointers and they are // valid unrelocated uses. - auto hasValidUnrelocatedUse = [&AvailableSet, baseTyLHS, baseTyRHS, &LHS, - &RHS] () { + auto hasValidUnrelocatedUse = [&AvailableSet, Tracker, baseTyLHS, baseTyRHS, + &LHS, &RHS] () { // A cmp instruction has valid unrelocated pointer operands only if // both operands are unrelocated pointers. // In the comparison between two pointers, if one is an unrelocated @@ -545,12 +652,23 @@ void InstructionVerifier::verifyInstruction( (baseTyLHS == BaseType::NonConstant && baseTyRHS == BaseType::ExclusivelySomeConstant)) return false; + + // If one of pointers is poisoned and other is not exclusively derived + // from null it is an invalid expression: it produces poisoned result + // and unless we want to track all defs (not only gc pointers) the only + // option is to prohibit such instructions. + if ((Tracker->isValuePoisoned(LHS) && baseTyRHS != ExclusivelyNull) || + (Tracker->isValuePoisoned(RHS) && baseTyLHS != ExclusivelyNull)) + return false; + // All other cases are valid cases enumerated below: - // 1. Comparison between an exlusively derived null pointer and a + // 1. Comparison between an exclusively derived null pointer and a // constant base pointer. - // 2. Comparison between an exlusively derived null pointer and a + // 2. Comparison between an exclusively derived null pointer and a // non-constant unrelocated base pointer. // 3. Comparison between 2 unrelocated pointers. + // 4. Comparison between a pointer exclusively derived from null and a + // non-constant poisoned pointer. return true; }; if (!hasValidUnrelocatedUse()) { Modified: vendor/llvm/dist/lib/LTO/ThinLTOCodeGenerator.cpp ============================================================================== --- vendor/llvm/dist/lib/LTO/ThinLTOCodeGenerator.cpp Thu Dec 28 21:12:27 2017 (r327299) +++ vendor/llvm/dist/lib/LTO/ThinLTOCodeGenerator.cpp Thu Dec 28 21:22:49 2017 (r327300) @@ -76,7 +76,7 @@ static void saveTempBitcode(const Module &TheModule, S if (TempDir.empty()) return; // User asked to save temps, let dump the bitcode file after import. - std::string SaveTempPath = (TempDir + llvm::utostr(count) + Suffix).str(); + std::string SaveTempPath = (TempDir + llvm::Twine(count) + Suffix).str(); std::error_code EC; raw_fd_ostream OS(SaveTempPath, EC, sys::fs::F_None); if (EC) Modified: vendor/llvm/dist/lib/MC/MCParser/ELFAsmParser.cpp ============================================================================== --- vendor/llvm/dist/lib/MC/MCParser/ELFAsmParser.cpp Thu Dec 28 21:12:27 2017 (r327299) +++ vendor/llvm/dist/lib/MC/MCParser/ELFAsmParser.cpp Thu Dec 28 21:22:49 2017 (r327300) @@ -427,13 +427,13 @@ bool ELFAsmParser::parseGroup(StringRef &GroupName) { GroupName = getTok().getString(); Lex(); } else if (getParser().parseIdentifier(GroupName)) { - return true; + return TokError("invalid group name"); } if (L.is(AsmToken::Comma)) { Lex(); StringRef Linkage; if (getParser().parseIdentifier(Linkage)) - return true; + return TokError("invalid linkage"); if (Linkage != "comdat") return TokError("Linkage must be 'comdat'"); } Modified: vendor/llvm/dist/lib/ProfileData/Coverage/CoverageMapping.cpp ============================================================================== --- vendor/llvm/dist/lib/ProfileData/Coverage/CoverageMapping.cpp Thu Dec 28 21:12:27 2017 (r327299) +++ vendor/llvm/dist/lib/ProfileData/Coverage/CoverageMapping.cpp Thu Dec 28 21:22:49 2017 (r327300) @@ -628,7 +628,7 @@ CoverageMapping::getInstantiationGroups(StringRef File } std::vector Result; - for (const auto &InstantiationSet : InstantiationSetCollector) { + for (auto &InstantiationSet : InstantiationSetCollector) { InstantiationGroup IG{InstantiationSet.first.first, InstantiationSet.first.second, std::move(InstantiationSet.second)}; Modified: vendor/llvm/dist/lib/Support/ARMAttributeParser.cpp ============================================================================== --- vendor/llvm/dist/lib/Support/ARMAttributeParser.cpp Thu Dec 28 21:12:27 2017 (r327299) +++ vendor/llvm/dist/lib/Support/ARMAttributeParser.cpp Thu Dec 28 21:22:49 2017 (r327300) @@ -666,7 +666,7 @@ void ARMAttributeParser::ParseSubsection(const uint8_t ParseIndexList(Data, Offset, Indicies); break; default: - errs() << "unrecognised tag: 0x" << utohexstr(Tag) << '\n'; + errs() << "unrecognised tag: 0x" << Twine::utohexstr(Tag) << '\n'; return; } Modified: vendor/llvm/dist/lib/Support/CommandLine.cpp ============================================================================== --- vendor/llvm/dist/lib/Support/CommandLine.cpp Thu Dec 28 21:12:27 2017 (r327299) +++ vendor/llvm/dist/lib/Support/CommandLine.cpp Thu Dec 28 21:22:49 2017 (r327300) @@ -688,7 +688,9 @@ static bool EatsUnboundedNumberOfValues(const Option * O->getNumOccurrencesFlag() == cl::OneOrMore; } -static bool isWhitespace(char C) { return strchr(" \t\n\r\f\v", C); } +static bool isWhitespace(char C) { + return C == ' ' || C == '\t' || C == '\r' || C == '\n'; +} static bool isQuote(char C) { return C == '\"' || C == '\''; } @@ -709,17 +711,19 @@ void cl::TokenizeGNUCommandLine(StringRef Src, StringS break; } + char C = Src[I]; + // Backslash escapes the next character. - if (I + 1 < E && Src[I] == '\\') { + if (I + 1 < E && C == '\\') { ++I; // Skip the escape. Token.push_back(Src[I]); continue; } // Consume a quoted string. - if (isQuote(Src[I])) { - char Quote = Src[I++]; - while (I != E && Src[I] != Quote) { + if (isQuote(C)) { + ++I; + while (I != E && Src[I] != C) { // Backslash escapes the next character. if (Src[I] == '\\' && I + 1 != E) ++I; @@ -732,7 +736,7 @@ void cl::TokenizeGNUCommandLine(StringRef Src, StringS } // End the token if this is whitespace. - if (isWhitespace(Src[I])) { + if (isWhitespace(C)) { if (!Token.empty()) NewArgv.push_back(Saver.save(StringRef(Token)).data()); Token.clear(); @@ -740,7 +744,7 @@ void cl::TokenizeGNUCommandLine(StringRef Src, StringS } // This is a normal character. Append it. - Token.push_back(Src[I]); + Token.push_back(C); } // Append the last token after hitting EOF with no whitespace. @@ -798,25 +802,27 @@ void cl::TokenizeWindowsCommandLine(StringRef Src, Str // end of the source string. enum { INIT, UNQUOTED, QUOTED } State = INIT; for (size_t I = 0, E = Src.size(); I != E; ++I) { + char C = Src[I]; + // INIT state indicates that the current input index is at the start of // the string or between tokens. if (State == INIT) { - if (isWhitespace(Src[I])) { + if (isWhitespace(C)) { // Mark the end of lines in response files - if (MarkEOLs && Src[I] == '\n') + if (MarkEOLs && C == '\n') NewArgv.push_back(nullptr); continue; } - if (Src[I] == '"') { + if (C == '"') { State = QUOTED; continue; } - if (Src[I] == '\\') { + if (C == '\\') { I = parseBackslash(Src, I, Token); State = UNQUOTED; continue; } - Token.push_back(Src[I]); + Token.push_back(C); State = UNQUOTED; continue; } @@ -825,38 +831,38 @@ void cl::TokenizeWindowsCommandLine(StringRef Src, Str // quotes. if (State == UNQUOTED) { // Whitespace means the end of the token. - if (isWhitespace(Src[I])) { + if (isWhitespace(C)) { NewArgv.push_back(Saver.save(StringRef(Token)).data()); Token.clear(); State = INIT; // Mark the end of lines in response files - if (MarkEOLs && Src[I] == '\n') + if (MarkEOLs && C == '\n') NewArgv.push_back(nullptr); continue; } - if (Src[I] == '"') { + if (C == '"') { State = QUOTED; continue; } - if (Src[I] == '\\') { + if (C == '\\') { I = parseBackslash(Src, I, Token); continue; } - Token.push_back(Src[I]); + Token.push_back(C); continue; } // QUOTED state means that it's reading a token quoted by double quotes. if (State == QUOTED) { - if (Src[I] == '"') { + if (C == '"') { State = UNQUOTED; continue; } - if (Src[I] == '\\') { + if (C == '\\') { I = parseBackslash(Src, I, Token); continue; } - Token.push_back(Src[I]); + Token.push_back(C); } } // Append the last token after hitting EOF with no whitespace. Modified: vendor/llvm/dist/lib/TableGen/Main.cpp ============================================================================== --- vendor/llvm/dist/lib/TableGen/Main.cpp Thu Dec 28 21:12:27 2017 (r327299) +++ vendor/llvm/dist/lib/TableGen/Main.cpp Thu Dec 28 21:22:49 2017 (r327300) @@ -110,7 +110,7 @@ int llvm::TableGenMain(char *argv0, TableGenMainFn *Ma return 1; if (ErrorsPrinted > 0) - return reportError(argv0, utostr(ErrorsPrinted) + " errors.\n"); + return reportError(argv0, Twine(ErrorsPrinted) + " errors.\n"); // Declare success. Out.keep(); Modified: vendor/llvm/dist/lib/Target/AArch64/AArch64InstrInfo.cpp ============================================================================== --- vendor/llvm/dist/lib/Target/AArch64/AArch64InstrInfo.cpp Thu Dec 28 21:12:27 2017 (r327299) +++ vendor/llvm/dist/lib/Target/AArch64/AArch64InstrInfo.cpp Thu Dec 28 21:22:49 2017 (r327300) @@ -3673,15 +3673,6 @@ static bool getFMAPatterns(MachineInstr &Root, } break; case AArch64::FSUBv2f32: - if (canCombineWithFMUL(MBB, Root.getOperand(1), - AArch64::FMULv2i32_indexed)) { - Patterns.push_back(MachineCombinerPattern::FMLSv2i32_indexed_OP1); - Found = true; - } else if (canCombineWithFMUL(MBB, Root.getOperand(1), - AArch64::FMULv2f32)) { - Patterns.push_back(MachineCombinerPattern::FMLSv2f32_OP1); - Found = true; - } if (canCombineWithFMUL(MBB, Root.getOperand(2), AArch64::FMULv2i32_indexed)) { Patterns.push_back(MachineCombinerPattern::FMLSv2i32_indexed_OP2); @@ -3691,17 +3682,17 @@ static bool getFMAPatterns(MachineInstr &Root, Patterns.push_back(MachineCombinerPattern::FMLSv2f32_OP2); Found = true; } - break; - case AArch64::FSUBv2f64: if (canCombineWithFMUL(MBB, Root.getOperand(1), - AArch64::FMULv2i64_indexed)) { - Patterns.push_back(MachineCombinerPattern::FMLSv2i64_indexed_OP1); + AArch64::FMULv2i32_indexed)) { + Patterns.push_back(MachineCombinerPattern::FMLSv2i32_indexed_OP1); Found = true; } else if (canCombineWithFMUL(MBB, Root.getOperand(1), *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Dec 28 21:22:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E034E811F3; Thu, 28 Dec 2017 21:22:59 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 67FF26BE34; Thu, 28 Dec 2017 21:22:59 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBSLMwgN024182; Thu, 28 Dec 2017 21:22:58 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBSLMw9t024181; Thu, 28 Dec 2017 21:22:58 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201712282122.vBSLMw9t024181@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 28 Dec 2017 21:22:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r327301 - vendor/llvm/llvm-trunk-r321530 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/llvm/llvm-trunk-r321530 X-SVN-Commit-Revision: 327301 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 21:22:59 -0000 Author: dim Date: Thu Dec 28 21:22:58 2017 New Revision: 327301 URL: https://svnweb.freebsd.org/changeset/base/327301 Log: Tag llvm trunk r321530. Added: vendor/llvm/llvm-trunk-r321530/ - copied from r327300, vendor/llvm/dist/ From owner-svn-src-all@freebsd.org Thu Dec 28 21:23:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06DF6E81286; Thu, 28 Dec 2017 21:23:16 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 41A596C009; Thu, 28 Dec 2017 21:23:13 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBSLNC0Q024346; Thu, 28 Dec 2017 21:23:12 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBSLNCeU024342; Thu, 28 Dec 2017 21:23:12 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201712282123.vBSLNCeU024342@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 28 Dec 2017 21:23:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r327304 - in vendor/compiler-rt/dist: lib/builtins lib/ubsan lib/xray/tests/unit test/ubsan/TestCases/TypeCheck X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/compiler-rt/dist: lib/builtins lib/ubsan lib/xray/tests/unit test/ubsan/TestCases/TypeCheck X-SVN-Commit-Revision: 327304 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 21:23:16 -0000 Author: dim Date: Thu Dec 28 21:23:12 2017 New Revision: 327304 URL: https://svnweb.freebsd.org/changeset/base/327304 Log: Vendor import of compiler-rt trunk r321530: https://llvm.org/svn/llvm-project/compiler-rt/trunk@321530 Modified: vendor/compiler-rt/dist/lib/builtins/CMakeLists.txt vendor/compiler-rt/dist/lib/ubsan/ubsan_handlers.cc vendor/compiler-rt/dist/lib/xray/tests/unit/fdr_logging_test.cc vendor/compiler-rt/dist/test/ubsan/TestCases/TypeCheck/vptr.cpp Modified: vendor/compiler-rt/dist/lib/builtins/CMakeLists.txt ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/CMakeLists.txt Thu Dec 28 21:23:09 2017 (r327303) +++ vendor/compiler-rt/dist/lib/builtins/CMakeLists.txt Thu Dec 28 21:23:12 2017 (r327304) @@ -232,8 +232,6 @@ set(x86_ARCH_SOURCES if (NOT MSVC) set(x86_64_SOURCES - x86_64/chkstk.S - x86_64/chkstk2.S x86_64/floatdidf.c x86_64/floatdisf.c x86_64/floatdixf.c @@ -253,8 +251,6 @@ if (NOT MSVC) set(i386_SOURCES i386/ashldi3.S i386/ashrdi3.S - i386/chkstk.S - i386/chkstk2.S i386/divdi3.S i386/floatdidf.S i386/floatdisf.S Modified: vendor/compiler-rt/dist/lib/ubsan/ubsan_handlers.cc ============================================================================== --- vendor/compiler-rt/dist/lib/ubsan/ubsan_handlers.cc Thu Dec 28 21:23:09 2017 (r327303) +++ vendor/compiler-rt/dist/lib/ubsan/ubsan_handlers.cc Thu Dec 28 21:23:12 2017 (r327304) @@ -38,7 +38,8 @@ bool ignoreReport(SourceLocation SLoc, ReportOptions O const char *TypeCheckKinds[] = { "load of", "store to", "reference binding to", "member access within", "member call on", "constructor call on", "downcast of", "downcast of", - "upcast of", "cast to virtual base of", "_Nonnull binding to"}; + "upcast of", "cast to virtual base of", "_Nonnull binding to", + "dynamic operation on"}; } static void handleTypeMismatchImpl(TypeMismatchData *Data, ValueHandle Pointer, Modified: vendor/compiler-rt/dist/lib/xray/tests/unit/fdr_logging_test.cc ============================================================================== --- vendor/compiler-rt/dist/lib/xray/tests/unit/fdr_logging_test.cc Thu Dec 28 21:23:09 2017 (r327303) +++ vendor/compiler-rt/dist/lib/xray/tests/unit/fdr_logging_test.cc Thu Dec 28 21:23:12 2017 (r327304) @@ -13,6 +13,7 @@ #include "xray_fdr_logging.h" #include "gtest/gtest.h" +#include #include #include #include Modified: vendor/compiler-rt/dist/test/ubsan/TestCases/TypeCheck/vptr.cpp ============================================================================== --- vendor/compiler-rt/dist/test/ubsan/TestCases/TypeCheck/vptr.cpp Thu Dec 28 21:23:09 2017 (r327303) +++ vendor/compiler-rt/dist/test/ubsan/TestCases/TypeCheck/vptr.cpp Thu Dec 28 21:23:12 2017 (r327304) @@ -1,41 +1,53 @@ -// RUN: %clangxx -frtti -fsanitize=null,vptr -fno-sanitize-recover=null,vptr -g %s -O3 -o %t -mllvm -enable-tail-merge=false -// RUN: %run %t rT && %run %t mT && %run %t fT && %run %t cT -// RUN: %run %t rU && %run %t mU && %run %t fU && %run %t cU -// RUN: %run %t rS && %run %t rV && %run %t oV -// RUN: %env_ubsan_opts=print_stacktrace=1 not %run %t mS 2>&1 | FileCheck %s --check-prefix=CHECK-MEMBER --check-prefix=CHECK-%os-MEMBER --strict-whitespace -// RUN: %env_ubsan_opts=print_stacktrace=1 not %run %t fS 2>&1 | FileCheck %s --check-prefix=CHECK-MEMFUN --strict-whitespace -// RUN: %env_ubsan_opts=print_stacktrace=1 not %run %t cS 2>&1 | FileCheck %s --check-prefix=CHECK-DOWNCAST --check-prefix=CHECK-%os-DOWNCAST --strict-whitespace -// RUN: %env_ubsan_opts=print_stacktrace=1 not %run %t mV 2>&1 | FileCheck %s --check-prefix=CHECK-MEMBER --check-prefix=CHECK-%os-MEMBER --strict-whitespace -// RUN: %env_ubsan_opts=print_stacktrace=1 not %run %t fV 2>&1 | FileCheck %s --check-prefix=CHECK-MEMFUN --strict-whitespace -// RUN: %env_ubsan_opts=print_stacktrace=1 not %run %t cV 2>&1 | FileCheck %s --check-prefix=CHECK-DOWNCAST --check-prefix=CHECK-%os-DOWNCAST --strict-whitespace -// RUN: %env_ubsan_opts=print_stacktrace=1 not %run %t oU 2>&1 | FileCheck %s --check-prefix=CHECK-OFFSET --check-prefix=CHECK-%os-OFFSET --strict-whitespace -// RUN: %env_ubsan_opts=print_stacktrace=1 not %run %t m0 2>&1 | FileCheck %s --check-prefix=CHECK-INVALID-MEMBER --check-prefix=CHECK-%os-NULL-MEMBER --strict-whitespace -// RUN: %env_ubsan_opts=print_stacktrace=1 not %run %t m0 2>&1 | FileCheck %s --check-prefix=CHECK-INVALID-MEMBER --check-prefix=CHECK-%os-NULL-MEMBER --strict-whitespace -// RUN: not %run %t nN 2>&1 | FileCheck %s --check-prefix=CHECK-NULL-MEMFUN --strict-whitespace +// RUN: %clangxx -frtti -fsanitize=null,vptr -g %s -O3 -o %t -mllvm -enable-tail-merge=false +// RUN: %env_ubsan_opts=halt_on_error=1 %run %t rT +// RUN: %env_ubsan_opts=halt_on_error=1 %run %t mT +// RUN: %env_ubsan_opts=halt_on_error=1 %run %t fT +// RUN: %env_ubsan_opts=halt_on_error=1 %run %t cT +// RUN: %env_ubsan_opts=halt_on_error=1 %run %t rU +// RUN: %env_ubsan_opts=halt_on_error=1 %run %t mU +// RUN: %env_ubsan_opts=halt_on_error=1 %run %t fU +// RUN: %env_ubsan_opts=halt_on_error=1 %run %t cU +// RUN: %env_ubsan_opts=halt_on_error=1 %run %t rS +// RUN: %env_ubsan_opts=halt_on_error=1 %run %t rV +// RUN: %env_ubsan_opts=halt_on_error=1 %run %t oV +// RUN: %env_ubsan_opts=halt_on_error=1 %run %t zN +// RUN: %env_ubsan_opts=halt_on_error=1:print_stacktrace=1 not %run %t mS 2>&1 | FileCheck %s --check-prefix=CHECK-MEMBER --check-prefix=CHECK-%os-MEMBER --strict-whitespace +// RUN: %env_ubsan_opts=halt_on_error=1:print_stacktrace=1 not %run %t fS 2>&1 | FileCheck %s --check-prefix=CHECK-MEMFUN --strict-whitespace +// RUN: %env_ubsan_opts=halt_on_error=1:print_stacktrace=1 not %run %t cS 2>&1 | FileCheck %s --check-prefix=CHECK-DOWNCAST --check-prefix=CHECK-%os-DOWNCAST --strict-whitespace +// RUN: %env_ubsan_opts=halt_on_error=1:print_stacktrace=1 not %run %t mV 2>&1 | FileCheck %s --check-prefix=CHECK-MEMBER --check-prefix=CHECK-%os-MEMBER --strict-whitespace +// RUN: %env_ubsan_opts=halt_on_error=1:print_stacktrace=1 not %run %t fV 2>&1 | FileCheck %s --check-prefix=CHECK-MEMFUN --strict-whitespace +// RUN: %env_ubsan_opts=halt_on_error=1:print_stacktrace=1 not %run %t cV 2>&1 | FileCheck %s --check-prefix=CHECK-DOWNCAST --check-prefix=CHECK-%os-DOWNCAST --strict-whitespace +// RUN: %env_ubsan_opts=halt_on_error=1:print_stacktrace=1 not %run %t oU 2>&1 | FileCheck %s --check-prefix=CHECK-OFFSET --check-prefix=CHECK-%os-OFFSET --strict-whitespace +// RUN: %env_ubsan_opts=halt_on_error=1:print_stacktrace=1 not %run %t m0 2>&1 | FileCheck %s --check-prefix=CHECK-INVALID-MEMBER --check-prefix=CHECK-%os-NULL-MEMBER --strict-whitespace +// RUN: %env_ubsan_opts=halt_on_error=1:print_stacktrace=1 not %run %t m0 2>&1 | FileCheck %s --check-prefix=CHECK-INVALID-MEMBER --check-prefix=CHECK-%os-NULL-MEMBER --strict-whitespace +// RUN: %env_ubsan_opts=halt_on_error=1 not %run %t nN 2>&1 | FileCheck %s --check-prefix=CHECK-NULL-MEMFUN --strict-whitespace +// RUN: %env_ubsan_opts=print_stacktrace=1 %run %t dT 2>&1 | FileCheck %s --check-prefix=CHECK-DYNAMIC --check-prefix=CHECK-%os-DYNAMIC --strict-whitespace // RUN: (echo "vptr_check:S"; echo "vptr_check:T"; echo "vptr_check:U") > %t.supp -// RUN: %env_ubsan_opts=suppressions='"%t.supp"' %run %t mS -// RUN: %env_ubsan_opts=suppressions='"%t.supp"' %run %t fS -// RUN: %env_ubsan_opts=suppressions='"%t.supp"' %run %t cS -// RUN: %env_ubsan_opts=suppressions='"%t.supp"' %run %t mV -// RUN: %env_ubsan_opts=suppressions='"%t.supp"' %run %t fV -// RUN: %env_ubsan_opts=suppressions='"%t.supp"' %run %t cV -// RUN: %env_ubsan_opts=suppressions='"%t.supp"' %run %t oU +// RUN: %env_ubsan_opts=halt_on_error=1:suppressions='"%t.supp"' %run %t mS +// RUN: %env_ubsan_opts=halt_on_error=1:suppressions='"%t.supp"' %run %t fS +// RUN: %env_ubsan_opts=halt_on_error=1:suppressions='"%t.supp"' %run %t cS +// RUN: %env_ubsan_opts=halt_on_error=1:suppressions='"%t.supp"' %run %t mV +// RUN: %env_ubsan_opts=halt_on_error=1:suppressions='"%t.supp"' %run %t fV +// RUN: %env_ubsan_opts=halt_on_error=1:suppressions='"%t.supp"' %run %t cV +// RUN: %env_ubsan_opts=halt_on_error=1:suppressions='"%t.supp"' %run %t oU +// RUN: %env_ubsan_opts=halt_on_error=1:suppressions='"%t.supp"' %run %t dT // RUN: echo "vptr_check:S" > %t.loc-supp -// RUN: %env_ubsan_opts=suppressions='"%t.loc-supp"' not %run %t x- 2>&1 | FileCheck %s --check-prefix=CHECK-LOC-SUPPRESS +// RUN: %env_ubsan_opts=halt_on_error=1:suppressions='"%t.loc-supp"' not %run %t x- 2>&1 | FileCheck %s --check-prefix=CHECK-LOC-SUPPRESS // REQUIRES: stable-runtime, cxxabi // UNSUPPORTED: win32 // Suppressions file not pushed to the device. // UNSUPPORTED: android #include +#include #include #include struct S { S() : a(0) {} - ~S() {} + ~S(); int a; int f() { return 0; } virtual int v() { return 0; } @@ -52,13 +64,23 @@ struct U : S, T { virtual int v() { return 2; } }; struct V : S {}; -// Make p global so that lsan does not complain. +namespace { + struct W {}; +} + T *p = 0; +bool dtorCheck = false; + volatile void *sink1, *sink2; int access_p(T *p, char type); +S::~S() { + if (dtorCheck) + access_p(p, '~'); +} + int main(int argc, char **argv) { assert(argc > 1); fprintf(stderr, "Test case: %s\n", argv[1]); @@ -180,6 +202,51 @@ int access_p(T *p, char type) { case 'n': // CHECK-NULL-MEMFUN: vptr.cpp:[[@LINE+1]]:15: runtime error: member call on null pointer of type 'T' return p->g(); + + case 'd': + dtorCheck = true; + delete p; + dtorCheck = false; + return 0; + case '~': + // CHECK-DYNAMIC: vptr.cpp:[[@LINE+6]]:11: runtime error: dynamic operation on address [[PTR:0x[0-9a-f]*]] which does not point to an object of type 'T' + // CHECK-DYNAMIC-NEXT: [[PTR]]: note: object is of type 'S' + // CHECK-DYNAMIC-NEXT: {{^ .. .. .. .. .. .. .. .. .. .. .. .. }} + // CHECK-DYNAMIC-NEXT: {{^ \^~~~~~~~~~~(~~~~~~~~~~~~)? *$}} + // CHECK-DYNAMIC-NEXT: {{^ vptr for}} 'S' + // CHECK-Linux-DYNAMIC: #0 {{.*}}access_p{{.*}}vptr.cpp:[[@LINE+1]] + (void)dynamic_cast(p); + // CHECK-DYNAMIC: vptr.cpp:[[@LINE+6]]:11: runtime error: dynamic operation on address [[PTR:0x[0-9a-f]*]] which does not point to an object of type 'T' + // CHECK-DYNAMIC-NEXT: [[PTR]]: note: object is of type 'S' + // CHECK-DYNAMIC-NEXT: {{^ .. .. .. .. .. .. .. .. .. .. .. .. }} + // CHECK-DYNAMIC-NEXT: {{^ \^~~~~~~~~~~(~~~~~~~~~~~~)? *$}} + // CHECK-DYNAMIC-NEXT: {{^ vptr for}} 'S' + // CHECK-Linux-DYNAMIC: #0 {{.*}}access_p{{.*}}vptr.cpp:[[@LINE+1]] + (void)dynamic_cast(p); + try { + // CHECK-DYNAMIC: vptr.cpp:[[@LINE+6]]:13: runtime error: dynamic operation on address [[PTR:0x[0-9a-f]*]] which does not point to an object of type 'T' + // CHECK-DYNAMIC-NEXT: [[PTR]]: note: object is of type 'S' + // CHECK-DYNAMIC-NEXT: {{^ .. .. .. .. .. .. .. .. .. .. .. .. }} + // CHECK-DYNAMIC-NEXT: {{^ \^~~~~~~~~~~(~~~~~~~~~~~~)? *$}} + // CHECK-DYNAMIC-NEXT: {{^ vptr for}} 'S' + // CHECK-Linux-DYNAMIC: #0 {{.*}}access_p{{.*}}vptr.cpp:[[@LINE+1]] + (void)dynamic_cast(*p); + } catch (std::bad_cast &) {} + // CHECK-DYNAMIC: vptr.cpp:[[@LINE+6]]:18: runtime error: dynamic operation on address [[PTR:0x[0-9a-f]*]] which does not point to an object of type 'T' + // CHECK-DYNAMIC-NEXT: [[PTR]]: note: object is of type 'S' + // CHECK-DYNAMIC-NEXT: {{^ .. .. .. .. .. .. .. .. .. .. .. .. }} + // CHECK-DYNAMIC-NEXT: {{^ \^~~~~~~~~~~(~~~~~~~~~~~~)? *$}} + // CHECK-DYNAMIC-NEXT: {{^ vptr for}} 'S' + // CHECK-Linux-DYNAMIC: #0 {{.*}}access_p{{.*}}vptr.cpp:[[@LINE+1]] + (void)typeid(*p); + return 0; + + case 'z': + (void)dynamic_cast(p); + try { + (void)typeid(*p); + } catch (std::bad_typeid &) {} + return 0; } return 0; } From owner-svn-src-all@freebsd.org Thu Dec 28 21:23:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28BAFE812D5; Thu, 28 Dec 2017 21:23:21 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E25D46C09D; Thu, 28 Dec 2017 21:23:20 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBSLNJR9024444; Thu, 28 Dec 2017 21:23:19 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBSLNJ4V024443; Thu, 28 Dec 2017 21:23:19 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201712282123.vBSLNJ4V024443@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 28 Dec 2017 21:23:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r327306 - vendor/libc++/dist/src/experimental/filesystem X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/libc++/dist/src/experimental/filesystem X-SVN-Commit-Revision: 327306 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 21:23:21 -0000 Author: dim Date: Thu Dec 28 21:23:19 2017 New Revision: 327306 URL: https://svnweb.freebsd.org/changeset/base/327306 Log: Vendor import of libc++ trunk r321530: https://llvm.org/svn/llvm-project/libcxx/trunk@321530 Modified: vendor/libc++/dist/src/experimental/filesystem/operations.cpp Modified: vendor/libc++/dist/src/experimental/filesystem/operations.cpp ============================================================================== --- vendor/libc++/dist/src/experimental/filesystem/operations.cpp Thu Dec 28 21:23:16 2017 (r327305) +++ vendor/libc++/dist/src/experimental/filesystem/operations.cpp Thu Dec 28 21:23:19 2017 (r327306) @@ -512,6 +512,7 @@ using StatT = struct stat; #if defined(__APPLE__) TimeSpec extract_mtime(StatT const& st) { return st.st_mtimespec; } +__attribute__((unused)) // Suppress warning TimeSpec extract_atime(StatT const& st) { return st.st_atimespec; } #else TimeSpec extract_mtime(StatT const& st) { return st.st_mtim; } From owner-svn-src-all@freebsd.org Thu Dec 28 21:23:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F292E81383; Thu, 28 Dec 2017 21:23:35 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7258C6C2DC; Thu, 28 Dec 2017 21:23:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBSLNWbZ024610; Thu, 28 Dec 2017 21:23:32 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBSLNW8F024609; Thu, 28 Dec 2017 21:23:32 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201712282123.vBSLNW8F024609@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 28 Dec 2017 21:23:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r327309 - vendor/lld/lld-trunk-r321530 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/lld/lld-trunk-r321530 X-SVN-Commit-Revision: 327309 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 21:23:35 -0000 Author: dim Date: Thu Dec 28 21:23:32 2017 New Revision: 327309 URL: https://svnweb.freebsd.org/changeset/base/327309 Log: Tag lld trunk r321530. Added: vendor/lld/lld-trunk-r321530/ - copied from r327308, vendor/lld/dist/ From owner-svn-src-all@freebsd.org Thu Dec 28 21:23:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08C49E81268; Thu, 28 Dec 2017 21:23:13 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F06206BF84; Thu, 28 Dec 2017 21:23:11 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBSLN9HP024294; Thu, 28 Dec 2017 21:23:09 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBSLN9T5024293; Thu, 28 Dec 2017 21:23:09 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201712282123.vBSLN9T5024293@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 28 Dec 2017 21:23:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r327303 - vendor/clang/clang-trunk-r321530 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/clang/clang-trunk-r321530 X-SVN-Commit-Revision: 327303 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 21:23:13 -0000 Author: dim Date: Thu Dec 28 21:23:09 2017 New Revision: 327303 URL: https://svnweb.freebsd.org/changeset/base/327303 Log: Tag clang trunk r321530. Added: vendor/clang/clang-trunk-r321530/ - copied from r327302, vendor/clang/dist/ From owner-svn-src-all@freebsd.org Thu Dec 28 21:23:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3745AE8124F; Thu, 28 Dec 2017 21:23:06 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B57CA6BEA2; Thu, 28 Dec 2017 21:23:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBSLN4QZ024247; Thu, 28 Dec 2017 21:23:04 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBSLN3c2024234; Thu, 28 Dec 2017 21:23:03 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201712282123.vBSLN3c2024234@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 28 Dec 2017 21:23:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r327302 - in vendor/clang/dist: include/clang/AST include/clang/Basic include/clang/Driver include/clang/Parse lib/AST lib/Analysis lib/Basic/Targets lib/CodeGen lib/Driver lib/Driver/T... X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/clang/dist: include/clang/AST include/clang/Basic include/clang/Driver include/clang/Parse lib/AST lib/Analysis lib/Basic/Targets lib/CodeGen lib/Driver lib/Driver/ToolChains lib/Headers lib... X-SVN-Commit-Revision: 327302 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 21:23:06 -0000 Author: dim Date: Thu Dec 28 21:23:03 2017 New Revision: 327302 URL: https://svnweb.freebsd.org/changeset/base/327302 Log: Vendor import of clang trunk r321530: https://llvm.org/svn/llvm-project/cfe/trunk@321530 Added: vendor/clang/dist/lib/Headers/avx512bitalgintrin.h (contents, props changed) vendor/clang/dist/lib/Headers/avx512vbmi2intrin.h (contents, props changed) vendor/clang/dist/lib/Headers/avx512vlbitalgintrin.h (contents, props changed) vendor/clang/dist/lib/Headers/avx512vlvbmi2intrin.h (contents, props changed) vendor/clang/dist/lib/Headers/avx512vlvnniintrin.h (contents, props changed) vendor/clang/dist/lib/Headers/avx512vnniintrin.h (contents, props changed) vendor/clang/dist/lib/Headers/gfniintrin.h (contents, props changed) vendor/clang/dist/lib/Headers/vaesintrin.h (contents, props changed) vendor/clang/dist/lib/Headers/vpclmulqdqintrin.h (contents, props changed) vendor/clang/dist/test/CodeGen/avx512bitalg-builtins.c (contents, props changed) vendor/clang/dist/test/CodeGen/avx512vbmi2-builtins.c (contents, props changed) vendor/clang/dist/test/CodeGen/avx512vlbitalg-builtins.c (contents, props changed) vendor/clang/dist/test/CodeGen/avx512vlvbmi2-builtins.c (contents, props changed) vendor/clang/dist/test/CodeGen/avx512vlvnni-builtins.c (contents, props changed) vendor/clang/dist/test/CodeGen/avx512vnni-builtins.c (contents, props changed) vendor/clang/dist/test/CodeGen/gfni-builtins.c (contents, props changed) vendor/clang/dist/test/CodeGen/vaes-builtins.c (contents, props changed) vendor/clang/dist/test/CodeGen/vpclmulqdq-builtins.c (contents, props changed) vendor/clang/dist/test/Index/skipped-bodies-ctors.cpp (contents, props changed) vendor/clang/dist/test/OpenMP/target_enter_data_depend_codegen.cpp (contents, props changed) vendor/clang/dist/test/OpenMP/target_exit_data_depend_codegen.cpp (contents, props changed) vendor/clang/dist/test/OpenMP/target_update_depend_codegen.cpp (contents, props changed) Modified: vendor/clang/dist/include/clang/AST/Stmt.h vendor/clang/dist/include/clang/Basic/BuiltinsX86.def vendor/clang/dist/include/clang/Basic/DiagnosticParseKinds.td vendor/clang/dist/include/clang/Driver/Options.td vendor/clang/dist/include/clang/Parse/Parser.h vendor/clang/dist/lib/AST/ASTImporter.cpp vendor/clang/dist/lib/AST/Decl.cpp vendor/clang/dist/lib/AST/Stmt.cpp vendor/clang/dist/lib/Analysis/BodyFarm.cpp vendor/clang/dist/lib/Basic/Targets/AArch64.cpp vendor/clang/dist/lib/Basic/Targets/ARM.cpp vendor/clang/dist/lib/Basic/Targets/X86.cpp vendor/clang/dist/lib/Basic/Targets/X86.h vendor/clang/dist/lib/CodeGen/CGBuiltin.cpp vendor/clang/dist/lib/CodeGen/CGExpr.cpp vendor/clang/dist/lib/CodeGen/CGExprCXX.cpp vendor/clang/dist/lib/CodeGen/CGOpenMPRuntime.cpp vendor/clang/dist/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp vendor/clang/dist/lib/CodeGen/CGStmtOpenMP.cpp vendor/clang/dist/lib/CodeGen/CodeGenFunction.h vendor/clang/dist/lib/Driver/SanitizerArgs.cpp vendor/clang/dist/lib/Driver/ToolChains/Clang.cpp vendor/clang/dist/lib/Driver/ToolChains/CommonArgs.cpp vendor/clang/dist/lib/Driver/ToolChains/Darwin.cpp vendor/clang/dist/lib/Driver/ToolChains/Hexagon.cpp vendor/clang/dist/lib/Headers/CMakeLists.txt vendor/clang/dist/lib/Headers/immintrin.h vendor/clang/dist/lib/Parse/ParseDecl.cpp vendor/clang/dist/lib/Parse/Parser.cpp vendor/clang/dist/lib/Sema/SemaDeclCXX.cpp vendor/clang/dist/lib/Sema/SemaExprCXX.cpp vendor/clang/dist/lib/Sema/SemaLookup.cpp vendor/clang/dist/lib/Sema/SemaOpenMP.cpp vendor/clang/dist/lib/Sema/SemaStmt.cpp vendor/clang/dist/lib/Sema/SemaTemplateInstantiateDecl.cpp vendor/clang/dist/lib/Serialization/ASTReaderStmt.cpp vendor/clang/dist/test/CodeGen/attr-target-x86.c vendor/clang/dist/test/CodeGenCXX/ubsan-vtable-checks.cpp vendor/clang/dist/test/Driver/x86-target-features.c vendor/clang/dist/test/OpenMP/nvptx_data_sharing.cpp vendor/clang/dist/test/OpenMP/nvptx_target_teams_codegen.cpp vendor/clang/dist/test/OpenMP/teams_distribute_parallel_for_num_threads_codegen.cpp vendor/clang/dist/test/OpenMP/teams_distribute_parallel_for_simd_num_threads_codegen.cpp vendor/clang/dist/test/Parser/c2x-attributes.c vendor/clang/dist/test/Parser/cxx-decl.cpp vendor/clang/dist/test/Parser/cxx0x-attributes.cpp vendor/clang/dist/test/Preprocessor/arm-acle-6.4.c vendor/clang/dist/test/Preprocessor/arm-acle-6.5.c vendor/clang/dist/test/Preprocessor/arm-target-features.c vendor/clang/dist/test/Preprocessor/predefined-arch-macros.c vendor/clang/dist/test/Preprocessor/x86_target_features.c vendor/clang/dist/unittests/AST/ASTImporterTest.cpp vendor/clang/dist/utils/TableGen/NeonEmitter.cpp Modified: vendor/clang/dist/include/clang/AST/Stmt.h ============================================================================== --- vendor/clang/dist/include/clang/AST/Stmt.h Thu Dec 28 21:22:58 2017 (r327301) +++ vendor/clang/dist/include/clang/AST/Stmt.h Thu Dec 28 21:23:03 2017 (r327302) @@ -592,15 +592,21 @@ class NullStmt : public Stmt { (public) }; /// CompoundStmt - This represents a group of statements like { stmt stmt }. -class CompoundStmt : public Stmt { +class CompoundStmt final : public Stmt, + private llvm::TrailingObjects { friend class ASTStmtReader; + friend TrailingObjects; - Stmt** Body = nullptr; SourceLocation LBraceLoc, RBraceLoc; + CompoundStmt(ArrayRef Stmts, SourceLocation LB, SourceLocation RB); + explicit CompoundStmt(EmptyShell Empty) : Stmt(CompoundStmtClass, Empty) {} + + void setStmts(ArrayRef Stmts); + public: - CompoundStmt(const ASTContext &C, ArrayRef Stmts, - SourceLocation LB, SourceLocation RB); + static CompoundStmt *Create(const ASTContext &C, ArrayRef Stmts, + SourceLocation LB, SourceLocation RB); // \brief Build an empty compound statement with a location. explicit CompoundStmt(SourceLocation Loc) @@ -609,12 +615,8 @@ class CompoundStmt : public Stmt { (public) } // \brief Build an empty compound statement. - explicit CompoundStmt(EmptyShell Empty) : Stmt(CompoundStmtClass, Empty) { - CompoundStmtBits.NumStmts = 0; - } + static CompoundStmt *CreateEmpty(const ASTContext &C, unsigned NumStmts); - void setStmts(const ASTContext &C, ArrayRef Stmts); - bool body_empty() const { return CompoundStmtBits.NumStmts == 0; } unsigned size() const { return CompoundStmtBits.NumStmts; } @@ -622,14 +624,16 @@ class CompoundStmt : public Stmt { (public) using body_range = llvm::iterator_range; body_range body() { return body_range(body_begin(), body_end()); } - body_iterator body_begin() { return Body; } - body_iterator body_end() { return Body + size(); } - Stmt *body_front() { return !body_empty() ? Body[0] : nullptr; } - Stmt *body_back() { return !body_empty() ? Body[size()-1] : nullptr; } + body_iterator body_begin() { return getTrailingObjects(); } + body_iterator body_end() { return body_begin() + size(); } + Stmt *body_front() { return !body_empty() ? body_begin()[0] : nullptr; } + Stmt *body_back() { + return !body_empty() ? body_begin()[size() - 1] : nullptr; + } void setLastStmt(Stmt *S) { assert(!body_empty() && "setLastStmt"); - Body[size()-1] = S; + body_begin()[size() - 1] = S; } using const_body_iterator = Stmt* const *; @@ -639,15 +643,17 @@ class CompoundStmt : public Stmt { (public) return body_const_range(body_begin(), body_end()); } - const_body_iterator body_begin() const { return Body; } - const_body_iterator body_end() const { return Body + size(); } + const_body_iterator body_begin() const { + return getTrailingObjects(); + } + const_body_iterator body_end() const { return body_begin() + size(); } const Stmt *body_front() const { - return !body_empty() ? Body[0] : nullptr; + return !body_empty() ? body_begin()[0] : nullptr; } const Stmt *body_back() const { - return !body_empty() ? Body[size() - 1] : nullptr; + return !body_empty() ? body_begin()[size() - 1] : nullptr; } using reverse_body_iterator = std::reverse_iterator; @@ -682,13 +688,10 @@ class CompoundStmt : public Stmt { (public) } // Iterators - child_range children() { - return child_range(Body, Body + CompoundStmtBits.NumStmts); - } + child_range children() { return child_range(body_begin(), body_end()); } const_child_range children() const { - return const_child_range(child_iterator(Body), - child_iterator(Body + CompoundStmtBits.NumStmts)); + return const_child_range(body_begin(), body_end()); } }; @@ -875,8 +878,11 @@ class LabelStmt : public Stmt { (public) /// /// Represents an attribute applied to a statement. For example: /// [[omp::for(...)]] for (...) { ... } -class AttributedStmt : public Stmt { +class AttributedStmt final + : public Stmt, + private llvm::TrailingObjects { friend class ASTStmtReader; + friend TrailingObjects; Stmt *SubStmt; SourceLocation AttrLoc; @@ -894,11 +900,9 @@ class AttributedStmt : public Stmt { } const Attr *const *getAttrArrayPtr() const { - return reinterpret_cast(this + 1); + return getTrailingObjects(); } - const Attr **getAttrArrayPtr() { - return reinterpret_cast(this + 1); - } + const Attr **getAttrArrayPtr() { return getTrailingObjects(); } public: static AttributedStmt *Create(const ASTContext &C, SourceLocation Loc, Modified: vendor/clang/dist/include/clang/Basic/BuiltinsX86.def ============================================================================== --- vendor/clang/dist/include/clang/Basic/BuiltinsX86.def Thu Dec 28 21:22:58 2017 (r327301) +++ vendor/clang/dist/include/clang/Basic/BuiltinsX86.def Thu Dec 28 21:23:03 2017 (r327302) @@ -429,9 +429,34 @@ TARGET_BUILTIN(__builtin_ia32_aesdeclast128, "V2LLiV2L TARGET_BUILTIN(__builtin_ia32_aesimc128, "V2LLiV2LLi", "", "aes") TARGET_BUILTIN(__builtin_ia32_aeskeygenassist128, "V2LLiV2LLiIc", "", "aes") +// VAES +TARGET_BUILTIN(__builtin_ia32_aesenc256, "V4LLiV4LLiV4LLi", "", "vaes") +TARGET_BUILTIN(__builtin_ia32_aesenc512, "V8LLiV8LLiV8LLi", "", "avx512f,vaes") +TARGET_BUILTIN(__builtin_ia32_aesenclast256, "V4LLiV4LLiV4LLi", "", "vaes") +TARGET_BUILTIN(__builtin_ia32_aesenclast512, "V8LLiV8LLiV8LLi", "", "avx512f,vaes") +TARGET_BUILTIN(__builtin_ia32_aesdec256, "V4LLiV4LLiV4LLi", "", "vaes") +TARGET_BUILTIN(__builtin_ia32_aesdec512, "V8LLiV8LLiV8LLi", "", "avx512f,vaes") +TARGET_BUILTIN(__builtin_ia32_aesdeclast256, "V4LLiV4LLiV4LLi", "", "vaes") +TARGET_BUILTIN(__builtin_ia32_aesdeclast512, "V8LLiV8LLiV8LLi", "", "avx512f,vaes") + +// GFNI +TARGET_BUILTIN(__builtin_ia32_vgf2p8affineinvqb_v16qi, "V16cV16cV16cIc", "", "gfni") +TARGET_BUILTIN(__builtin_ia32_vgf2p8affineinvqb_v32qi, "V32cV32cV32cIc", "", "avx,gfni") +TARGET_BUILTIN(__builtin_ia32_vgf2p8affineinvqb_v64qi, "V64cV64cV64cIc", "", "avx512bw,gfni") +TARGET_BUILTIN(__builtin_ia32_vgf2p8affineqb_v16qi, "V16cV16cV16cIc", "", "gfni") +TARGET_BUILTIN(__builtin_ia32_vgf2p8affineqb_v32qi, "V32cV32cV32cIc", "", "avx,gfni") +TARGET_BUILTIN(__builtin_ia32_vgf2p8affineqb_v64qi, "V64cV64cV64cIc", "", "avx512bw,gfni") +TARGET_BUILTIN(__builtin_ia32_vgf2p8mulb_v16qi, "V16cV16cV16c", "", "gfni") +TARGET_BUILTIN(__builtin_ia32_vgf2p8mulb_v32qi, "V32cV32cV32c", "", "avx,gfni") +TARGET_BUILTIN(__builtin_ia32_vgf2p8mulb_v64qi, "V64cV64cV64c", "", "avx512bw,gfni") + // CLMUL TARGET_BUILTIN(__builtin_ia32_pclmulqdq128, "V2LLiV2LLiV2LLiIc", "", "pclmul") +// VPCLMULQDQ +TARGET_BUILTIN(__builtin_ia32_pclmulqdq256, "V4LLiV4LLiV4LLiIc", "", "vpclmulqdq") +TARGET_BUILTIN(__builtin_ia32_pclmulqdq512, "V8LLiV8LLiV8LLiIc", "", "avx512f,vpclmulqdq") + // AVX TARGET_BUILTIN(__builtin_ia32_addsubpd256, "V4dV4dV4d", "", "avx") TARGET_BUILTIN(__builtin_ia32_addsubps256, "V8fV8fV8f", "", "avx") @@ -954,6 +979,31 @@ TARGET_BUILTIN(__builtin_ia32_vpermt2varq512_mask, "V8 TARGET_BUILTIN(__builtin_ia32_vpermt2varps512_mask, "V16fV16iV16fV16fUs", "", "avx512f") TARGET_BUILTIN(__builtin_ia32_vpermt2varpd512_mask, "V8dV8LLiV8dV8dUc", "", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vpdpbusd128_mask, "V4iV4iV4iV4iUc", "", "avx512vl,avx512vnni") +TARGET_BUILTIN(__builtin_ia32_vpdpbusd256_mask, "V8iV8iV8iV8iUc", "", "avx512vl,avx512vnni") +TARGET_BUILTIN(__builtin_ia32_vpdpbusd512_mask, "V16iV16iV16iV16iUs", "", "avx512vnni") +TARGET_BUILTIN(__builtin_ia32_vpdpbusds128_mask, "V4iV4iV4iV4iUc", "", "avx512vl,avx512vnni") +TARGET_BUILTIN(__builtin_ia32_vpdpbusds256_mask, "V8iV8iV8iV8iUc", "", "avx512vl,avx512vnni") +TARGET_BUILTIN(__builtin_ia32_vpdpbusds512_mask, "V16iV16iV16iV16iUs", "", "avx512vnni") +TARGET_BUILTIN(__builtin_ia32_vpdpwssd128_mask, "V4iV4iV4iV4iUc", "", "avx512vl,avx512vnni") +TARGET_BUILTIN(__builtin_ia32_vpdpwssd256_mask, "V8iV8iV8iV8iUc", "", "avx512vl,avx512vnni") +TARGET_BUILTIN(__builtin_ia32_vpdpwssd512_mask, "V16iV16iV16iV16iUs", "", "avx512vnni") +TARGET_BUILTIN(__builtin_ia32_vpdpwssds128_mask, "V4iV4iV4iV4iUc", "", "avx512vl,avx512vnni") +TARGET_BUILTIN(__builtin_ia32_vpdpwssds256_mask, "V8iV8iV8iV8iUc", "", "avx512vl,avx512vnni") +TARGET_BUILTIN(__builtin_ia32_vpdpwssds512_mask, "V16iV16iV16iV16iUs", "", "avx512vnni") +TARGET_BUILTIN(__builtin_ia32_vpdpbusd128_maskz, "V4iV4iV4iV4iUc", "", "avx512vl,avx512vnni") +TARGET_BUILTIN(__builtin_ia32_vpdpbusd256_maskz, "V8iV8iV8iV8iUc", "", "avx512vl,avx512vnni") +TARGET_BUILTIN(__builtin_ia32_vpdpbusd512_maskz, "V16iV16iV16iV16iUs", "", "avx512vnni") +TARGET_BUILTIN(__builtin_ia32_vpdpbusds128_maskz, "V4iV4iV4iV4iUc", "", "avx512vl,avx512vnni") +TARGET_BUILTIN(__builtin_ia32_vpdpbusds256_maskz, "V8iV8iV8iV8iUc", "", "avx512vl,avx512vnni") +TARGET_BUILTIN(__builtin_ia32_vpdpbusds512_maskz, "V16iV16iV16iV16iUs", "", "avx512vnni") +TARGET_BUILTIN(__builtin_ia32_vpdpwssd128_maskz, "V4iV4iV4iV4iUc", "", "avx512vl,avx512vnni") +TARGET_BUILTIN(__builtin_ia32_vpdpwssd256_maskz, "V8iV8iV8iV8iUc", "", "avx512vl,avx512vnni") +TARGET_BUILTIN(__builtin_ia32_vpdpwssd512_maskz, "V16iV16iV16iV16iUs", "", "avx512vnni") +TARGET_BUILTIN(__builtin_ia32_vpdpwssds128_maskz, "V4iV4iV4iV4iUc", "", "avx512vl,avx512vnni") +TARGET_BUILTIN(__builtin_ia32_vpdpwssds256_maskz, "V8iV8iV8iV8iUc", "", "avx512vl,avx512vnni") +TARGET_BUILTIN(__builtin_ia32_vpdpwssds512_maskz, "V16iV16iV16iV16iUs", "", "avx512vnni") + TARGET_BUILTIN(__builtin_ia32_gather3div2df, "V2dV2ddC*V2LLiUcIi","","avx512vl") TARGET_BUILTIN(__builtin_ia32_gather3div2di, "V2LLiV2LLiLLiC*V2LLiUcIi","","avx512vl") TARGET_BUILTIN(__builtin_ia32_gather3div4df, "V4dV4ddC*V4LLiUcIi","","avx512vl") @@ -1067,6 +1117,17 @@ TARGET_BUILTIN(__builtin_ia32_vpopcntq_256, "V4LLiV4LL TARGET_BUILTIN(__builtin_ia32_vpopcntd_512, "V16iV16i", "", "avx512vpopcntdq") TARGET_BUILTIN(__builtin_ia32_vpopcntq_512, "V8LLiV8LLi", "", "avx512vpopcntdq") +TARGET_BUILTIN(__builtin_ia32_vpopcntb_128, "V16cV16c", "", "avx512vl,avx512bitalg") +TARGET_BUILTIN(__builtin_ia32_vpopcntw_128, "V8sV8s", "", "avx512vl,avx512bitalg") +TARGET_BUILTIN(__builtin_ia32_vpopcntb_256, "V32cV32c", "", "avx512vl,avx512bitalg") +TARGET_BUILTIN(__builtin_ia32_vpopcntw_256, "V16sV16s", "", "avx512vl,avx512bitalg") +TARGET_BUILTIN(__builtin_ia32_vpopcntb_512, "V64cV64c", "", "avx512bitalg") +TARGET_BUILTIN(__builtin_ia32_vpopcntw_512, "V32sV32s", "", "avx512bitalg") + +TARGET_BUILTIN(__builtin_ia32_vpshufbitqmb128_mask, "UsV16cV16cUs", "", "avx512vl,avx512bitalg") +TARGET_BUILTIN(__builtin_ia32_vpshufbitqmb256_mask, "UiV32cV32cUi", "", "avx512vl,avx512bitalg") +TARGET_BUILTIN(__builtin_ia32_vpshufbitqmb512_mask, "ULLiV64cV64cULLi", "", "avx512bitalg") + TARGET_BUILTIN(__builtin_ia32_vpermi2varhi128_mask, "V8sV8sV8sV8sUc", "", "avx512vl,avx512bw") TARGET_BUILTIN(__builtin_ia32_vpermi2varhi256_mask, "V16sV16sV16sV16sUs", "", "avx512vl,avx512bw") TARGET_BUILTIN(__builtin_ia32_vpermt2varhi128_mask, "V8sV8sV8sV8sUc", "", "avx512vl,avx512bw") @@ -1107,6 +1168,12 @@ TARGET_BUILTIN(__builtin_ia32_compressdf128_mask, "V2d TARGET_BUILTIN(__builtin_ia32_compressdf256_mask, "V4dV4dV4dUc", "", "avx512vl") TARGET_BUILTIN(__builtin_ia32_compressdi128_mask, "V2LLiV2LLiV2LLiUc", "", "avx512vl") TARGET_BUILTIN(__builtin_ia32_compressdi256_mask, "V4LLiV4LLiV4LLiUc", "", "avx512vl") + +TARGET_BUILTIN(__builtin_ia32_compresshi128_mask, "V8sV8sV8sUc","","avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_compresshi256_mask, "V16sV16sV16sUs","","avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_compressqi128_mask, "V16cV16cV16cUs","","avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_compressqi256_mask, "V32cV32cV32cUi","","avx512vl,avx512vbmi2") + TARGET_BUILTIN(__builtin_ia32_compresssf128_mask, "V4fV4fV4fUc", "", "avx512vl") TARGET_BUILTIN(__builtin_ia32_compresssf256_mask, "V8fV8fV8fUc", "", "avx512vl") TARGET_BUILTIN(__builtin_ia32_compresssi128_mask, "V4iV4iV4iUc", "", "avx512vl") @@ -1115,6 +1182,12 @@ TARGET_BUILTIN(__builtin_ia32_compressstoredf128_mask, TARGET_BUILTIN(__builtin_ia32_compressstoredf256_mask, "vV4d*V4dUc", "", "avx512vl") TARGET_BUILTIN(__builtin_ia32_compressstoredi128_mask, "vV2LLi*V2LLiUc", "", "avx512vl") TARGET_BUILTIN(__builtin_ia32_compressstoredi256_mask, "vV4LLi*V4LLiUc", "", "avx512vl") + +TARGET_BUILTIN(__builtin_ia32_compressstorehi128_mask, "vV8s*V8sUc", "", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_compressstorehi256_mask, "vV16s*V16sUs", "", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_compressstoreqi128_mask, "vV16c*V16cUs", "", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_compressstoreqi256_mask, "vV32c*V32cUi", "", "avx512vl,avx512vbmi2") + TARGET_BUILTIN(__builtin_ia32_compressstoresf128_mask, "vV4f*V4fUc", "", "avx512vl") TARGET_BUILTIN(__builtin_ia32_compressstoresf256_mask, "vV8f*V8fUc", "", "avx512vl") TARGET_BUILTIN(__builtin_ia32_compressstoresi128_mask, "vV4i*V4iUc", "", "avx512vl") @@ -1147,10 +1220,22 @@ TARGET_BUILTIN(__builtin_ia32_expanddf128_mask, "V2dV2 TARGET_BUILTIN(__builtin_ia32_expanddf256_mask, "V4dV4dV4dUc", "", "avx512vl") TARGET_BUILTIN(__builtin_ia32_expanddi128_mask, "V2LLiV2LLiV2LLiUc", "", "avx512vl") TARGET_BUILTIN(__builtin_ia32_expanddi256_mask, "V4LLiV4LLiV4LLiUc", "", "avx512vl") + +TARGET_BUILTIN(__builtin_ia32_expandhi128_mask, "V8sV8sV8sUc", "", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_expandhi256_mask, "V16sV16sV16sUs", "", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_expandqi128_mask, "V16cV16cV16cUs", "", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_expandqi256_mask, "V32cV32cV32cUi", "", "avx512vl,avx512vbmi2") + TARGET_BUILTIN(__builtin_ia32_expandloaddf128_mask, "V2dV2d*V2dUc", "", "avx512vl") TARGET_BUILTIN(__builtin_ia32_expandloaddf256_mask, "V4dV4d*V4dUc", "", "avx512vl") TARGET_BUILTIN(__builtin_ia32_expandloaddi128_mask, "V4iV2LLi*V2LLiUc", "", "avx512vl") TARGET_BUILTIN(__builtin_ia32_expandloaddi256_mask, "V4LLiV4LLi*V4LLiUc", "", "avx512vl") + +TARGET_BUILTIN(__builtin_ia32_expandloadhi128_mask, "V8sV8sC*V8sUc", "", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_expandloadhi256_mask, "V16sV16sC*V16sUs", "", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_expandloadqi128_mask, "V16cV16cC*V16cUs", "", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_expandloadqi256_mask, "V32cV32cC*V32cUi", "", "avx512vl,avx512vbmi2") + TARGET_BUILTIN(__builtin_ia32_expandloadsf128_mask, "V4fV4f*V4fUc", "", "avx512vl") TARGET_BUILTIN(__builtin_ia32_expandloadsf256_mask, "V8fV8f*V8fUc", "", "avx512vl") TARGET_BUILTIN(__builtin_ia32_expandloadsi128_mask, "V4iV4i*V4iUc", "", "avx512vl") @@ -1223,6 +1308,65 @@ TARGET_BUILTIN(__builtin_ia32_vpermt2varq128_mask, "V2 TARGET_BUILTIN(__builtin_ia32_vpermt2varq128_maskz, "V2LLiV2LLiV2LLiV2LLiUc", "", "avx512vl") TARGET_BUILTIN(__builtin_ia32_vpermt2varq256_mask, "V4LLiV4LLiV4LLiV4LLiUc", "", "avx512vl") TARGET_BUILTIN(__builtin_ia32_vpermt2varq256_maskz, "V4LLiV4LLiV4LLiV4LLiUc", "", "avx512vl") + +TARGET_BUILTIN(__builtin_ia32_vpshldd128_mask, "V4iV4iV4iIiV4iUc", "", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldd256_mask, "V8iV8iV8iIiV8iUc", "", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldd512_mask, "V16iV16iV16iIiV16iUs", "", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldq128_mask, "V2LLiV2LLiV2LLiIiV2LLiUc", "", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldq256_mask, "V4LLiV4LLiV4LLiIiV4LLiUc", "", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldq512_mask, "V8LLiV8LLiV8LLiIiV8LLiUc", "", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldw128_mask, "V8sV8sV8sIiV8sUc", "", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldw256_mask, "V16sV16sV16sIiV16sUs", "", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldw512_mask, "V32sV32sV32sIiV32sUi", "", "avx512vbmi2") + +TARGET_BUILTIN(__builtin_ia32_vpshldvd128_mask, "V4iV4iV4iV4iUc", "", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldvd256_mask, "V8iV8iV8iV8iUc", "", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldvd512_mask, "V16iV16iV16iV16iUs", "", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldvq128_mask, "V2LLiV2LLiV2LLiV2LLiUc", "", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldvq256_mask, "V4LLiV4LLiV4LLiV4LLiUc", "", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldvq512_mask, "V8LLiV8LLiV8LLiV8LLiUc", "", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldvw128_mask, "V8sV8sV8sV8sUc", "", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldvw256_mask, "V16sV16sV16sV16sUs", "", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldvw512_mask, "V32sV32sV32sV32sUi", "", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldvd128_maskz, "V4iV4iV4iV4iUc", "", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldvd256_maskz, "V8iV8iV8iV8iUc", "", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldvd512_maskz, "V16iV16iV16iV16iUs", "", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldvq128_maskz, "V2LLiV2LLiV2LLiV2LLiUc", "", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldvq256_maskz, "V4LLiV4LLiV4LLiV4LLiUc", "", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldvq512_maskz, "V8LLiV8LLiV8LLiV8LLiUc", "", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldvw128_maskz, "V8sV8sV8sV8sUc", "", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldvw256_maskz, "V16sV16sV16sV16sUs", "", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldvw512_maskz, "V32sV32sV32sV32sUi", "", "avx512vbmi2") + +TARGET_BUILTIN(__builtin_ia32_vpshrdvd128_mask, "V4iV4iV4iV4iUc", "", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdvd256_mask, "V8iV8iV8iV8iUc", "", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdvd512_mask, "V16iV16iV16iV16iUs", "", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdvq128_mask, "V2LLiV2LLiV2LLiV2LLiUc", "", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdvq256_mask, "V4LLiV4LLiV4LLiV4LLiUc", "", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdvq512_mask, "V8LLiV8LLiV8LLiV8LLiUc", "", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdvw128_mask, "V8sV8sV8sV8sUc", "", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdvw256_mask, "V16sV16sV16sV16sUs", "", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdvw512_mask, "V32sV32sV32sV32sUi", "", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdvd128_maskz, "V4iV4iV4iV4iUc", "", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdvd256_maskz, "V8iV8iV8iV8iUc", "", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdvd512_maskz, "V16iV16iV16iV16iUs", "", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdvq128_maskz, "V2LLiV2LLiV2LLiV2LLiUc", "", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdvq256_maskz, "V4LLiV4LLiV4LLiV4LLiUc", "", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdvq512_maskz, "V8LLiV8LLiV8LLiV8LLiUc", "", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdvw128_maskz, "V8sV8sV8sV8sUc", "", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdvw256_maskz, "V16sV16sV16sV16sUs", "", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdvw512_maskz, "V32sV32sV32sV32sUi", "", "avx512vbmi2") + +TARGET_BUILTIN(__builtin_ia32_vpshrdd128_mask, "V4iV4iV4iiV4iUc", "", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdd256_mask, "V8iV8iV8iiV8iUc", "", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdd512_mask, "V16iV16iV16iiV16iUs", "", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdq128_mask, "V2LLiV2LLiV2LLiiV2LLiUc", "", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdq256_mask, "V4LLiV4LLiV4LLiiV4LLiUc", "", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdq512_mask, "V8LLiV8LLiV8LLiiV8LLiUc", "", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdw128_mask, "V8sV8sV8siV8sUc", "", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdw256_mask, "V16sV16sV16siV16sUs", "", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdw512_mask, "V32sV32sV32siV32sUi", "", "avx512vbmi2") + TARGET_BUILTIN(__builtin_ia32_pmovswb512_mask, "V32cV32sV32cUi", "", "avx512bw") TARGET_BUILTIN(__builtin_ia32_pmovuswb512_mask, "V32cV32sV32cUi", "", "avx512bw") TARGET_BUILTIN(__builtin_ia32_pmovwb512_mask, "V32cV32sV32cUi", "", "avx512bw") @@ -1677,14 +1821,20 @@ TARGET_BUILTIN(__builtin_ia32_dbpsadbw512_mask, "V32sV TARGET_BUILTIN(__builtin_ia32_psadbw512, "V8LLiV64cV64c","","avx512bw") TARGET_BUILTIN(__builtin_ia32_compressdf512_mask, "V8dV8dV8dUc","","avx512f") TARGET_BUILTIN(__builtin_ia32_compressdi512_mask, "V8LLiV8LLiV8LLiUc","","avx512f") +TARGET_BUILTIN(__builtin_ia32_compresshi512_mask, "V32sV32sV32sUi","","avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_compressqi512_mask, "V64cV64cV64cULLi","","avx512vbmi2") TARGET_BUILTIN(__builtin_ia32_compresssf512_mask, "V16fV16fV16fUs","","avx512f") TARGET_BUILTIN(__builtin_ia32_compresssi512_mask, "V16iV16iV16iUs","","avx512f") TARGET_BUILTIN(__builtin_ia32_cmpsd_mask, "UcV2dV2dIiUcIi","","avx512f") TARGET_BUILTIN(__builtin_ia32_cmpss_mask, "UcV4fV4fIiUcIi","","avx512f") TARGET_BUILTIN(__builtin_ia32_expanddf512_mask, "V8dV8dV8dUc","","avx512f") TARGET_BUILTIN(__builtin_ia32_expanddi512_mask, "V8LLiV8LLiV8LLiUc","","avx512f") +TARGET_BUILTIN(__builtin_ia32_expandhi512_mask, "V32sV32sV32sUi","","avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_expandqi512_mask, "V64cV64cV64cULLi","","avx512vbmi2") TARGET_BUILTIN(__builtin_ia32_expandloaddf512_mask, "V8dV8dC*V8dUc","","avx512f") TARGET_BUILTIN(__builtin_ia32_expandloaddi512_mask, "V8LLiV8LLiC*V8LLiUc","","avx512f") +TARGET_BUILTIN(__builtin_ia32_expandloadhi512_mask, "V32sV32sC*V32sUi","","avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_expandloadqi512_mask, "V64cV64cC*V64cULLi","","avx512vbmi2") TARGET_BUILTIN(__builtin_ia32_expandloadsf512_mask, "V16fV16fC*V16fUs","","avx512f") TARGET_BUILTIN(__builtin_ia32_expandloadsi512_mask, "V16iV16iC*V16iUs","","avx512f") TARGET_BUILTIN(__builtin_ia32_expandsf512_mask, "V16fV16fV16fUs","","avx512f") @@ -1692,6 +1842,8 @@ TARGET_BUILTIN(__builtin_ia32_expandsi512_mask, "V16iV TARGET_BUILTIN(__builtin_ia32_cvtps2pd512_mask, "V8dV8fV8dUcIi","","avx512f") TARGET_BUILTIN(__builtin_ia32_compressstoredf512_mask, "vV8d*V8dUc","","avx512f") TARGET_BUILTIN(__builtin_ia32_compressstoredi512_mask, "vV8LLi*V8LLiUc","","avx512f") +TARGET_BUILTIN(__builtin_ia32_compressstorehi512_mask, "vV32s*V32sUi","","avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_compressstoreqi512_mask, "vV64c*V64cULLi","","avx512vbmi2") TARGET_BUILTIN(__builtin_ia32_compressstoresf512_mask, "vV16f*V16fUs","","avx512f") TARGET_BUILTIN(__builtin_ia32_compressstoresi512_mask, "vV16i*V16iUs","","avx512f") TARGET_BUILTIN(__builtin_ia32_vcvtph2ps_mask, "V4fV8sV4fUc","","avx512vl") Modified: vendor/clang/dist/include/clang/Basic/DiagnosticParseKinds.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/DiagnosticParseKinds.td Thu Dec 28 21:22:58 2017 (r327301) +++ vendor/clang/dist/include/clang/Basic/DiagnosticParseKinds.td Thu Dec 28 21:23:03 2017 (r327302) @@ -587,6 +587,7 @@ def ext_using_attribute_ns : ExtWarn< def err_using_attribute_ns_conflict : Error< "attribute with scope specifier cannot follow default scope specifier">; def err_attributes_not_allowed : Error<"an attribute list cannot appear here">; +def err_attributes_misplaced : Error<"misplaced attributes; expected attributes here">; def err_l_square_l_square_not_attribute : Error< "C++11 only allows consecutive left square brackets when " "introducing an attribute">; Modified: vendor/clang/dist/include/clang/Driver/Options.td ============================================================================== --- vendor/clang/dist/include/clang/Driver/Options.td Thu Dec 28 21:22:58 2017 (r327301) +++ vendor/clang/dist/include/clang/Driver/Options.td Thu Dec 28 21:23:03 2017 (r327302) @@ -2467,6 +2467,8 @@ def mavx2 : Flag<["-"], "mavx2">, Group, Group; def mavx512f : Flag<["-"], "mavx512f">, Group; def mno_avx512f : Flag<["-"], "mno-avx512f">, Group; +def mavx512bitalg : Flag<["-"], "mavx512bitalg">, Group; +def mno_avx512bitalg : Flag<["-"], "mno-avx512bitalg">, Group; def mavx512bw : Flag<["-"], "mavx512bw">, Group; def mno_avx512bw : Flag<["-"], "mno-avx512bw">, Group; def mavx512cd : Flag<["-"], "mavx512cd">, Group; @@ -2481,8 +2483,12 @@ def mavx512pf : Flag<["-"], "mavx512pf">, Group, Group; def mavx512vbmi : Flag<["-"], "mavx512vbmi">, Group; def mno_avx512vbmi : Flag<["-"], "mno-avx512vbmi">, Group; +def mavx512vbmi2 : Flag<["-"], "mavx512vbmi2">, Group; +def mno_avx512vbmi2 : Flag<["-"], "mno-avx512vbmi2">, Group; def mavx512vl : Flag<["-"], "mavx512vl">, Group; def mno_avx512vl : Flag<["-"], "mno-avx512vl">, Group; +def mavx512vnni : Flag<["-"], "mavx512vnni">, Group; +def mno_avx512vnni : Flag<["-"], "mno-avx512vnni">, Group; def mavx512vpopcntdq : Flag<["-"], "mavx512vpopcntdq">, Group; def mno_avx512vpopcntdq : Flag<["-"], "mno-avx512vpopcntdq">, Group; def madx : Flag<["-"], "madx">, Group; @@ -2511,6 +2517,8 @@ def mfsgsbase : Flag<["-"], "mfsgsbase">, Group, Group; def mfxsr : Flag<["-"], "mfxsr">, Group; def mno_fxsr : Flag<["-"], "mno-fxsr">, Group; +def mgfni : Flag<["-"], "mgfni">, Group; +def mno_gfni : Flag<["-"], "mno-gfni">, Group; def mlwp : Flag<["-"], "mlwp">, Group; def mno_lwp : Flag<["-"], "mno-lwp">, Group; def mlzcnt : Flag<["-"], "mlzcnt">, Group; @@ -2543,6 +2551,10 @@ def msha : Flag<["-"], "msha">, Group, Group; def mtbm : Flag<["-"], "mtbm">, Group; def mno_tbm : Flag<["-"], "mno-tbm">, Group; +def mvaes : Flag<["-"], "mvaes">, Group; +def mno_vaes : Flag<["-"], "mno-vaes">, Group; +def mvpclmulqdq : Flag<["-"], "mvpclmulqdq">, Group; +def mno_vpclmulqdq : Flag<["-"], "mno-vpclmulqdq">, Group; def mxop : Flag<["-"], "mxop">, Group; def mno_xop : Flag<["-"], "mno-xop">, Group; def mxsave : Flag<["-"], "mxsave">, Group; Modified: vendor/clang/dist/include/clang/Parse/Parser.h ============================================================================== --- vendor/clang/dist/include/clang/Parse/Parser.h Thu Dec 28 21:22:58 2017 (r327301) +++ vendor/clang/dist/include/clang/Parse/Parser.h Thu Dec 28 21:23:03 2017 (r327302) @@ -2200,13 +2200,16 @@ class Parser : public CodeCompletionHandler { (private void stripTypeAttributesOffDeclSpec(ParsedAttributesWithRange &Attrs, DeclSpec &DS, Sema::TagUseKind TUK); - - void ProhibitAttributes(ParsedAttributesWithRange &attrs) { + + // FixItLoc = possible correct location for the attributes + void ProhibitAttributes(ParsedAttributesWithRange &attrs, + SourceLocation FixItLoc = SourceLocation()) { if (!attrs.Range.isValid()) return; - DiagnoseProhibitedAttributes(attrs); + DiagnoseProhibitedAttributes(attrs, FixItLoc); attrs.clear(); } - void DiagnoseProhibitedAttributes(ParsedAttributesWithRange &attrs); + void DiagnoseProhibitedAttributes(ParsedAttributesWithRange &attrs, + SourceLocation FixItLoc); // Forbid C++11 and C2x attributes that appear on certain syntactic locations // which standard permits but we don't supported yet, for example, attributes Modified: vendor/clang/dist/lib/AST/ASTImporter.cpp ============================================================================== --- vendor/clang/dist/lib/AST/ASTImporter.cpp Thu Dec 28 21:22:58 2017 (r327301) +++ vendor/clang/dist/lib/AST/ASTImporter.cpp Thu Dec 28 21:23:03 2017 (r327302) @@ -134,12 +134,17 @@ namespace clang { bool ImportTemplateArguments(const TemplateArgument *FromArgs, unsigned NumFromArgs, SmallVectorImpl &ToArgs); + template + bool ImportTemplateArgumentListInfo(const InContainerTy &Container, + TemplateArgumentListInfo &ToTAInfo); bool IsStructuralMatch(RecordDecl *FromRecord, RecordDecl *ToRecord, bool Complain = true); bool IsStructuralMatch(VarDecl *FromVar, VarDecl *ToVar, bool Complain = true); bool IsStructuralMatch(EnumDecl *FromEnum, EnumDecl *ToRecord); bool IsStructuralMatch(EnumConstantDecl *FromEC, EnumConstantDecl *ToEC); + bool IsStructuralMatch(FunctionTemplateDecl *From, + FunctionTemplateDecl *To); bool IsStructuralMatch(ClassTemplateDecl *From, ClassTemplateDecl *To); bool IsStructuralMatch(VarTemplateDecl *From, VarTemplateDecl *To); Decl *VisitDecl(Decl *D); @@ -195,6 +200,7 @@ namespace clang { ClassTemplateSpecializationDecl *D); Decl *VisitVarTemplateDecl(VarTemplateDecl *D); Decl *VisitVarTemplateSpecializationDecl(VarTemplateSpecializationDecl *D); + Decl *VisitFunctionTemplateDecl(FunctionTemplateDecl *D); // Importing statements DeclGroupRef ImportDeclGroup(DeclGroupRef DG); @@ -280,6 +286,7 @@ namespace clang { Expr *VisitCXXDeleteExpr(CXXDeleteExpr *E); Expr *VisitCXXConstructExpr(CXXConstructExpr *E); Expr *VisitCXXMemberCallExpr(CXXMemberCallExpr *E); + Expr *VisitCXXDependentScopeMemberExpr(CXXDependentScopeMemberExpr *E); Expr *VisitExprWithCleanups(ExprWithCleanups *EWC); Expr *VisitCXXThisExpr(CXXThisExpr *E); Expr *VisitCXXBoolLiteralExpr(CXXBoolLiteralExpr *E); @@ -1247,6 +1254,18 @@ bool ASTNodeImporter::ImportTemplateArguments(const Te return false; } +template +bool ASTNodeImporter::ImportTemplateArgumentListInfo( + const InContainerTy &Container, TemplateArgumentListInfo &ToTAInfo) { + for (const auto &FromLoc : Container) { + if (auto ToLoc = ImportTemplateArgumentLoc(FromLoc)) + ToTAInfo.addArgument(*ToLoc); + else + return true; + } + return false; +} + bool ASTNodeImporter::IsStructuralMatch(RecordDecl *FromRecord, RecordDecl *ToRecord, bool Complain) { // Eliminate a potential failure point where we attempt to re-import @@ -1280,6 +1299,14 @@ bool ASTNodeImporter::IsStructuralMatch(EnumDecl *From return Ctx.IsStructurallyEquivalent(FromEnum, ToEnum); } +bool ASTNodeImporter::IsStructuralMatch(FunctionTemplateDecl *From, + FunctionTemplateDecl *To) { + StructuralEquivalenceContext Ctx( + Importer.getFromContext(), Importer.getToContext(), + Importer.getNonEquivalentDecls(), false, false); + return Ctx.IsStructurallyEquivalent(From, To); +} + bool ASTNodeImporter::IsStructuralMatch(EnumConstantDecl *FromEC, EnumConstantDecl *ToEC) { @@ -4197,6 +4224,64 @@ Decl *ASTNodeImporter::VisitVarTemplateSpecializationD return D2; } +Decl *ASTNodeImporter::VisitFunctionTemplateDecl(FunctionTemplateDecl *D) { + DeclContext *DC, *LexicalDC; + DeclarationName Name; + SourceLocation Loc; + NamedDecl *ToD; + + if (ImportDeclParts(D, DC, LexicalDC, Name, ToD, Loc)) + return nullptr; + + if (ToD) + return ToD; + + // Try to find a function in our own ("to") context with the same name, same + // type, and in the same context as the function we're importing. + if (!LexicalDC->isFunctionOrMethod()) { + unsigned IDNS = Decl::IDNS_Ordinary; + SmallVector FoundDecls; + DC->getRedeclContext()->localUncachedLookup(Name, FoundDecls); + for (unsigned I = 0, N = FoundDecls.size(); I != N; ++I) { + if (!FoundDecls[I]->isInIdentifierNamespace(IDNS)) + continue; + + if (FunctionTemplateDecl *FoundFunction = + dyn_cast(FoundDecls[I])) { + if (FoundFunction->hasExternalFormalLinkage() && + D->hasExternalFormalLinkage()) { + if (IsStructuralMatch(D, FoundFunction)) { + Importer.Imported(D, FoundFunction); + // FIXME: Actually try to merge the body and other attributes. + return FoundFunction; + } + } + } + } + } + + TemplateParameterList *Params = + ImportTemplateParameterList(D->getTemplateParameters()); + if (!Params) + return nullptr; + + FunctionDecl *TemplatedFD = + cast_or_null(Importer.Import(D->getTemplatedDecl())); + if (!TemplatedFD) + return nullptr; + + FunctionTemplateDecl *ToFunc = FunctionTemplateDecl::Create( + Importer.getToContext(), DC, Loc, Name, Params, TemplatedFD); + + TemplatedFD->setDescribedFunctionTemplate(ToFunc); + ToFunc->setAccess(D->getAccess()); + ToFunc->setLexicalDeclContext(LexicalDC); + Importer.Imported(D, ToFunc); + + LexicalDC->addDeclInternal(ToFunc); + return ToFunc; +} + //---------------------------------------------------------------------------- // Import Statements //---------------------------------------------------------------------------- @@ -4321,9 +4406,8 @@ Stmt *ASTNodeImporter::VisitCompoundStmt(CompoundStmt SourceLocation ToLBraceLoc = Importer.Import(S->getLBracLoc()); SourceLocation ToRBraceLoc = Importer.Import(S->getRBracLoc()); - return new (Importer.getToContext()) CompoundStmt(Importer.getToContext(), - ToStmts, - ToLBraceLoc, ToRBraceLoc); + return CompoundStmt::Create(Importer.getToContext(), ToStmts, ToLBraceLoc, + ToRBraceLoc); } Stmt *ASTNodeImporter::VisitCaseStmt(CaseStmt *S) { @@ -5757,6 +5841,47 @@ Expr *ASTNodeImporter::VisitCXXPseudoDestructorExpr( Importer.Import(E->getQualifierLoc()), ScopeInfo, Importer.Import(E->getColonColonLoc()), Importer.Import(E->getTildeLoc()), Storage); +} + +Expr *ASTNodeImporter::VisitCXXDependentScopeMemberExpr( + CXXDependentScopeMemberExpr *E) { + Expr *Base = nullptr; + if (!E->isImplicitAccess()) { + Base = Importer.Import(E->getBase()); + if (!Base) + return nullptr; + } + + QualType BaseType = Importer.Import(E->getBaseType()); + if (BaseType.isNull()) + return nullptr; + + TemplateArgumentListInfo ToTAInfo(Importer.Import(E->getLAngleLoc()), + Importer.Import(E->getRAngleLoc())); + TemplateArgumentListInfo *ResInfo = nullptr; + if (E->hasExplicitTemplateArgs()) { + if (ImportTemplateArgumentListInfo(E->template_arguments(), ToTAInfo)) + return nullptr; + ResInfo = &ToTAInfo; + } + + DeclarationName Name = Importer.Import(E->getMember()); + if (!E->getMember().isEmpty() && Name.isEmpty()) + return nullptr; + + DeclarationNameInfo MemberNameInfo(Name, Importer.Import(E->getMemberLoc())); + // Import additional name location/type info. + ImportDeclarationNameLoc(E->getMemberNameInfo(), MemberNameInfo); + auto ToFQ = Importer.Import(E->getFirstQualifierFoundInScope()); + if (!ToFQ && E->getFirstQualifierFoundInScope()) + return nullptr; + + return CXXDependentScopeMemberExpr::Create( + Importer.getToContext(), Base, BaseType, E->isArrow(), + Importer.Import(E->getOperatorLoc()), + Importer.Import(E->getQualifierLoc()), + Importer.Import(E->getTemplateKeywordLoc()), + cast_or_null(ToFQ), MemberNameInfo, ResInfo); } Expr *ASTNodeImporter::VisitCallExpr(CallExpr *E) { Modified: vendor/clang/dist/lib/AST/Decl.cpp ============================================================================== --- vendor/clang/dist/lib/AST/Decl.cpp Thu Dec 28 21:22:58 2017 (r327301) +++ vendor/clang/dist/lib/AST/Decl.cpp Thu Dec 28 21:23:03 2017 (r327302) @@ -1550,7 +1550,7 @@ void NamedDecl::printQualifiedName(raw_ostream &OS, // the enum-specifier. Each scoped enumerator is declared in the // scope of the enumeration. // For the case of unscoped enumerator, do not include in the qualified - // name any information about its enum enclosing scope, as is visibility + // name any information about its enum enclosing scope, as its visibility // is global. if (ED->isScoped()) OS << *ED; Modified: vendor/clang/dist/lib/AST/Stmt.cpp ============================================================================== --- vendor/clang/dist/lib/AST/Stmt.cpp Thu Dec 28 21:22:58 2017 (r327301) +++ vendor/clang/dist/lib/AST/Stmt.cpp Thu Dec 28 21:23:03 2017 (r327302) @@ -299,31 +299,34 @@ SourceLocation Stmt::getLocEnd() const { llvm_unreachable("unknown statement kind"); } -CompoundStmt::CompoundStmt(const ASTContext &C, ArrayRef Stmts, - SourceLocation LB, SourceLocation RB) - : Stmt(CompoundStmtClass), LBraceLoc(LB), RBraceLoc(RB) { +CompoundStmt::CompoundStmt(ArrayRef Stmts, SourceLocation LB, + SourceLocation RB) + : Stmt(CompoundStmtClass), LBraceLoc(LB), RBraceLoc(RB) { CompoundStmtBits.NumStmts = Stmts.size(); + setStmts(Stmts); +} + +void CompoundStmt::setStmts(ArrayRef Stmts) { assert(CompoundStmtBits.NumStmts == Stmts.size() && "NumStmts doesn't fit in bits of CompoundStmtBits.NumStmts!"); - if (Stmts.empty()) { - Body = nullptr; - return; - } + std::copy(Stmts.begin(), Stmts.end(), body_begin()); +} - Body = new (C) Stmt*[Stmts.size()]; - std::copy(Stmts.begin(), Stmts.end(), Body); +CompoundStmt *CompoundStmt::Create(const ASTContext &C, ArrayRef Stmts, + SourceLocation LB, SourceLocation RB) { + void *Mem = + C.Allocate(totalSizeToAlloc(Stmts.size()), alignof(CompoundStmt)); + return new (Mem) CompoundStmt(Stmts, LB, RB); } -void CompoundStmt::setStmts(const ASTContext &C, ArrayRef Stmts) { - if (Body) - C.Deallocate(Body); - CompoundStmtBits.NumStmts = Stmts.size(); - assert(CompoundStmtBits.NumStmts == Stmts.size() && - "NumStmts doesn't fit in bits of CompoundStmtBits.NumStmts!"); - - Body = new (C) Stmt*[Stmts.size()]; - std::copy(Stmts.begin(), Stmts.end(), Body); +CompoundStmt *CompoundStmt::CreateEmpty(const ASTContext &C, + unsigned NumStmts) { + void *Mem = + C.Allocate(totalSizeToAlloc(NumStmts), alignof(CompoundStmt)); + CompoundStmt *New = new (Mem) CompoundStmt(EmptyShell()); + New->CompoundStmtBits.NumStmts = NumStmts; + return New; } const char *LabelStmt::getName() const { @@ -334,7 +337,7 @@ AttributedStmt *AttributedStmt::Create(const ASTContex ArrayRef Attrs, Stmt *SubStmt) { assert(!Attrs.empty() && "Attrs should not be empty"); - void *Mem = C.Allocate(sizeof(AttributedStmt) + sizeof(Attr *) * Attrs.size(), + void *Mem = C.Allocate(totalSizeToAlloc(Attrs.size()), alignof(AttributedStmt)); return new (Mem) AttributedStmt(Loc, Attrs, SubStmt); } @@ -342,7 +345,7 @@ AttributedStmt *AttributedStmt::Create(const ASTContex AttributedStmt *AttributedStmt::CreateEmpty(const ASTContext &C, unsigned NumAttrs) { assert(NumAttrs > 0 && "NumAttrs should be greater than zero"); - void *Mem = C.Allocate(sizeof(AttributedStmt) + sizeof(Attr *) * NumAttrs, + void *Mem = C.Allocate(totalSizeToAlloc(NumAttrs), alignof(AttributedStmt)); return new (Mem) AttributedStmt(EmptyShell(), NumAttrs); } Modified: vendor/clang/dist/lib/Analysis/BodyFarm.cpp ============================================================================== --- vendor/clang/dist/lib/Analysis/BodyFarm.cpp Thu Dec 28 21:22:58 2017 (r327301) +++ vendor/clang/dist/lib/Analysis/BodyFarm.cpp Thu Dec 28 21:23:03 2017 (r327302) @@ -133,7 +133,7 @@ BinaryOperator *ASTMaker::makeComparison(const Expr *L } CompoundStmt *ASTMaker::makeCompound(ArrayRef Stmts) { - return new (C) CompoundStmt(C, Stmts, SourceLocation(), SourceLocation()); + return CompoundStmt::Create(C, Stmts, SourceLocation(), SourceLocation()); } DeclRefExpr *ASTMaker::makeDeclRefExpr( Modified: vendor/clang/dist/lib/Basic/Targets/AArch64.cpp ============================================================================== --- vendor/clang/dist/lib/Basic/Targets/AArch64.cpp Thu Dec 28 21:22:58 2017 (r327301) +++ vendor/clang/dist/lib/Basic/Targets/AArch64.cpp Thu Dec 28 21:23:03 2017 (r327302) @@ -159,7 +159,7 @@ void AArch64TargetInfo::getTargetDefines(const LangOpt Builder.defineMacro("__ARM_FP_FAST", "1"); Builder.defineMacro("__ARM_SIZEOF_WCHAR_T", - llvm::utostr(Opts.WCharSize ? Opts.WCharSize : 4)); + Twine(Opts.WCharSize ? Opts.WCharSize : 4)); Builder.defineMacro("__ARM_SIZEOF_MINIMAL_ENUM", Opts.ShortEnums ? "1" : "4"); Modified: vendor/clang/dist/lib/Basic/Targets/ARM.cpp ============================================================================== --- vendor/clang/dist/lib/Basic/Targets/ARM.cpp Thu Dec 28 21:22:58 2017 (r327301) +++ vendor/clang/dist/lib/Basic/Targets/ARM.cpp Thu Dec 28 21:23:03 2017 (r327302) @@ -582,7 +582,7 @@ void ARMTargetInfo::getTargetDefines(const LangOptions // ACLE 6.4.4 LDREX/STREX if (LDREX) - Builder.defineMacro("__ARM_FEATURE_LDREX", "0x" + llvm::utohexstr(LDREX)); + Builder.defineMacro("__ARM_FEATURE_LDREX", "0x" + Twine::utohexstr(LDREX)); // ACLE 6.4.5 CLZ if (ArchVersion == 5 || (ArchVersion == 6 && CPUProfile != "M") || @@ -591,7 +591,7 @@ void ARMTargetInfo::getTargetDefines(const LangOptions // ACLE 6.5.1 Hardware Floating Point if (HW_FP) - Builder.defineMacro("__ARM_FP", "0x" + llvm::utohexstr(HW_FP)); + Builder.defineMacro("__ARM_FP", "0x" + Twine::utohexstr(HW_FP)); // ACLE predefines. Builder.defineMacro("__ARM_ACLE", "200"); @@ -672,11 +672,11 @@ void ARMTargetInfo::getTargetDefines(const LangOptions // current AArch32 NEON implementations do not support double-precision // floating-point even when it is present in VFP. Builder.defineMacro("__ARM_NEON_FP", - "0x" + llvm::utohexstr(HW_FP & ~HW_FP_DP)); + "0x" + Twine::utohexstr(HW_FP & ~HW_FP_DP)); } Builder.defineMacro("__ARM_SIZEOF_WCHAR_T", - llvm::utostr(Opts.WCharSize ? Opts.WCharSize : 4)); + Twine(Opts.WCharSize ? Opts.WCharSize : 4)); Builder.defineMacro("__ARM_SIZEOF_MINIMAL_ENUM", Opts.ShortEnums ? "1" : "4"); Modified: vendor/clang/dist/lib/Basic/Targets/X86.cpp ============================================================================== --- vendor/clang/dist/lib/Basic/Targets/X86.cpp Thu Dec 28 21:22:58 2017 (r327301) +++ vendor/clang/dist/lib/Basic/Targets/X86.cpp Thu Dec 28 21:23:03 2017 (r327302) @@ -132,7 +132,14 @@ bool X86TargetInfo::initFeatureMap( break; case CK_Icelake: - // TODO: Add icelake features here. + setFeatureEnabledImpl(Features, "vaes", true); + setFeatureEnabledImpl(Features, "gfni", true); + setFeatureEnabledImpl(Features, "vpclmulqdq", true); + setFeatureEnabledImpl(Features, "avx512bitalg", true); + setFeatureEnabledImpl(Features, "avx512vnni", true); + setFeatureEnabledImpl(Features, "avx512vbmi2", true); + setFeatureEnabledImpl(Features, "avx512vpopcntdq", true); + setFeatureEnabledImpl(Features, "clwb", true); LLVM_FALLTHROUGH; case CK_Cannonlake: setFeatureEnabledImpl(Features, "avx512ifma", true); @@ -145,8 +152,10 @@ bool X86TargetInfo::initFeatureMap( setFeatureEnabledImpl(Features, "avx512dq", true); setFeatureEnabledImpl(Features, "avx512bw", true); setFeatureEnabledImpl(Features, "avx512vl", true); - setFeatureEnabledImpl(Features, "pku", true); - setFeatureEnabledImpl(Features, "clwb", true); + if (Kind == CK_SkylakeServer) { + setFeatureEnabledImpl(Features, "pku", true); + setFeatureEnabledImpl(Features, "clwb", true); + } LLVM_FALLTHROUGH; case CK_SkylakeClient: setFeatureEnabledImpl(Features, "xsavec", true); @@ -443,7 +452,7 @@ void X86TargetInfo::setSSELevel(llvm::StringMap LLVM_FALLTHROUGH; case SSE2: Features["sse2"] = Features["pclmul"] = Features["aes"] = Features["sha"] = - false; + Features["gfni"] = false; LLVM_FALLTHROUGH; case SSE3: Features["sse3"] = false; @@ -460,7 +469,7 @@ void X86TargetInfo::setSSELevel(llvm::StringMap LLVM_FALLTHROUGH; case AVX: Features["fma"] = Features["avx"] = Features["f16c"] = Features["xsave"] = - Features["xsaveopt"] = false; + Features["xsaveopt"] = Features["vaes"] = Features["vpclmulqdq"] = false; setXOPLevel(Features, FMA4, false); LLVM_FALLTHROUGH; case AVX2: @@ -470,7 +479,9 @@ void X86TargetInfo::setSSELevel(llvm::StringMap Features["avx512f"] = Features["avx512cd"] = Features["avx512er"] = Features["avx512pf"] = Features["avx512dq"] = Features["avx512bw"] = Features["avx512vl"] = Features["avx512vbmi"] = - Features["avx512ifma"] = Features["avx512vpopcntdq"] = false; + Features["avx512ifma"] = Features["avx512vpopcntdq"] = + Features["avx512bitalg"] = Features["avx512vnni"] = + Features["avx512vbmi2"] = false; break; } } @@ -572,9 +583,26 @@ void X86TargetInfo::setFeatureEnabledImpl(llvm::String } else if (Name == "aes") { if (Enabled) setSSELevel(Features, SSE2, Enabled); + else + Features["vaes"] = false; + } else if (Name == "vaes") { + if (Enabled) { + setSSELevel(Features, AVX, Enabled); + Features["aes"] = true; + } } else if (Name == "pclmul") { if (Enabled) setSSELevel(Features, SSE2, Enabled); + else + Features["vpclmulqdq"] = false; + } else if (Name == "vpclmulqdq") { + if (Enabled) { + setSSELevel(Features, AVX, Enabled); + Features["pclmul"] = true; + } + } else if (Name == "gfni") { + if (Enabled) + setSSELevel(Features, SSE2, Enabled); } else if (Name == "avx") { setSSELevel(Features, AVX, Enabled); } else if (Name == "avx2") { @@ -584,15 +612,17 @@ void X86TargetInfo::setFeatureEnabledImpl(llvm::String } else if (Name == "avx512cd" || Name == "avx512er" || Name == "avx512pf" || Name == "avx512dq" || Name == "avx512bw" || Name == "avx512vl" || Name == "avx512vbmi" || Name == "avx512ifma" || - Name == "avx512vpopcntdq") { + Name == "avx512vpopcntdq" || Name == "avx512bitalg" || + Name == "avx512vnni" || Name == "avx512vbmi2") { if (Enabled) setSSELevel(Features, AVX512F, Enabled); - // Enable BWI instruction if VBMI is being enabled. - if (Name == "avx512vbmi" && Enabled) + // Enable BWI instruction if VBMI/VBMI2/BITALG is being enabled. + if ((Name.startswith("avx512vbmi") || Name == "avx512bitalg") && Enabled) Features["avx512bw"] = true; - // Also disable VBMI if BWI is being disabled. + // Also disable VBMI/VBMI2/BITALG if BWI is being disabled. if (Name == "avx512bw" && !Enabled) - Features["avx512vbmi"] = false; + Features["avx512vbmi"] = Features["avx512vbmi2"] = + Features["avx512bitalg"] = false; } else if (Name == "fma") { if (Enabled) setSSELevel(Features, AVX, Enabled); @@ -636,8 +666,12 @@ bool X86TargetInfo::handleTargetFeatures(std::vector Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79D60E812A1; Thu, 28 Dec 2017 21:23:18 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A3956C08F; Thu, 28 Dec 2017 21:23:18 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBSLNGsE024394; Thu, 28 Dec 2017 21:23:16 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBSLNGNn024393; Thu, 28 Dec 2017 21:23:16 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201712282123.vBSLNGNn024393@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 28 Dec 2017 21:23:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r327305 - vendor/compiler-rt/compiler-rt-trunk-r321530 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/compiler-rt/compiler-rt-trunk-r321530 X-SVN-Commit-Revision: 327305 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 21:23:18 -0000 Author: dim Date: Thu Dec 28 21:23:16 2017 New Revision: 327305 URL: https://svnweb.freebsd.org/changeset/base/327305 Log: Tag compiler-rt trunk r321530. Added: vendor/compiler-rt/compiler-rt-trunk-r321530/ - copied from r327304, vendor/compiler-rt/dist/ From owner-svn-src-all@freebsd.org Thu Dec 28 21:23:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5682E81357; Thu, 28 Dec 2017 21:23:31 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CE0C6C209; Thu, 28 Dec 2017 21:23:29 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBSLNSwJ024563; Thu, 28 Dec 2017 21:23:28 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBSLNPQ5024536; Thu, 28 Dec 2017 21:23:25 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201712282123.vBSLNPQ5024536@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 28 Dec 2017 21:23:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r327308 - in vendor/lld/dist: COFF ELF ELF/Arch test/COFF test/ELF test/ELF/Inputs X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/lld/dist: COFF ELF ELF/Arch test/COFF test/ELF test/ELF/Inputs X-SVN-Commit-Revision: 327308 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 21:23:32 -0000 Author: dim Date: Thu Dec 28 21:23:25 2017 New Revision: 327308 URL: https://svnweb.freebsd.org/changeset/base/327308 Log: Vendor import of lld trunk r321530: https://llvm.org/svn/llvm-project/lld/trunk@321530 Added: vendor/lld/dist/test/COFF/ignore4217.yaml vendor/lld/dist/test/ELF/Inputs/writable-sec-plt-reloc.s (contents, props changed) vendor/lld/dist/test/ELF/Inputs/znotext-copy-relocations.s (contents, props changed) vendor/lld/dist/test/ELF/Inputs/znotext-plt-relocations-protected.s (contents, props changed) vendor/lld/dist/test/ELF/writable-sec-plt-reloc.s (contents, props changed) vendor/lld/dist/test/ELF/znotext-copy-relocation.s (contents, props changed) vendor/lld/dist/test/ELF/znotext-plt-relocations-protected.s (contents, props changed) vendor/lld/dist/test/ELF/znotext-weak-undef.s (contents, props changed) Modified: vendor/lld/dist/COFF/Config.h vendor/lld/dist/COFF/Driver.cpp vendor/lld/dist/COFF/Driver.h vendor/lld/dist/COFF/DriverUtils.cpp vendor/lld/dist/COFF/Options.td vendor/lld/dist/COFF/SymbolTable.cpp vendor/lld/dist/ELF/Arch/X86.cpp vendor/lld/dist/ELF/Arch/X86_64.cpp vendor/lld/dist/ELF/Relocations.cpp vendor/lld/dist/ELF/ScriptLexer.cpp vendor/lld/dist/ELF/ScriptParser.cpp vendor/lld/dist/test/ELF/arm-thumb-no-undefined-thunk.s vendor/lld/dist/test/ELF/arm-undefined-weak.s vendor/lld/dist/test/ELF/gnu-ifunc-i386.s vendor/lld/dist/test/ELF/gnu-ifunc.s vendor/lld/dist/test/ELF/x86-64-dyn-rel-error.s vendor/lld/dist/test/ELF/x86-64-dyn-rel-error2.s Modified: vendor/lld/dist/COFF/Config.h ============================================================================== --- vendor/lld/dist/COFF/Config.h Thu Dec 28 21:23:22 2017 (r327307) +++ vendor/lld/dist/COFF/Config.h Thu Dec 28 21:23:25 2017 (r327308) @@ -174,6 +174,7 @@ struct Configuration { bool HighEntropyVA = false; bool AppContainer = false; bool MinGW = false; + bool WarnLocallyDefinedImported = true; }; extern Configuration *Config; Modified: vendor/lld/dist/COFF/Driver.cpp ============================================================================== --- vendor/lld/dist/COFF/Driver.cpp Thu Dec 28 21:23:22 2017 (r327307) +++ vendor/lld/dist/COFF/Driver.cpp Thu Dec 28 21:23:25 2017 (r327308) @@ -227,7 +227,7 @@ static bool isDecorated(StringRef Sym) { void LinkerDriver::parseDirectives(StringRef S) { ArgParser Parser; // .drectve is always tokenized using Windows shell rules. - opt::InputArgList Args = Parser.parse(S); + opt::InputArgList Args = Parser.parseDirectives(S); for (auto *Arg : Args) { switch (Arg->getOption().getUnaliasedOption().getID()) { @@ -245,6 +245,13 @@ void LinkerDriver::parseDirectives(StringRef S) { Config->Entry = addUndefined(mangle(Arg->getValue())); break; case OPT_export: { + // If a common header file contains dllexported function + // declarations, many object files may end up with having the + // same /EXPORT options. In order to save cost of parsing them, + // we dedup them first. + if (!DirectivesExports.insert(Arg->getValue()).second) + break; + Export E = parseExport(Arg->getValue()); if (Config->Machine == I386 && Config->MinGW) { if (!isDecorated(E.Name)) @@ -794,6 +801,13 @@ void LinkerDriver::link(ArrayRef ArgsArr for (auto *Arg : Args.filtered(OPT_libpath)) SearchPaths.push_back(Arg->getValue()); addLibSearchPaths(); + + // Handle /ignore + for (auto *Arg : Args.filtered(OPT_ignore)) { + if (StringRef(Arg->getValue()) == "4217") + Config->WarnLocallyDefinedImported = false; + // Other warning numbers are ignored. + } // Handle /out if (auto *Arg = Args.getLastArg(OPT_out)) Modified: vendor/lld/dist/COFF/Driver.h ============================================================================== --- vendor/lld/dist/COFF/Driver.h Thu Dec 28 21:23:22 2017 (r327307) +++ vendor/lld/dist/COFF/Driver.h Thu Dec 28 21:23:25 2017 (r327308) @@ -16,6 +16,7 @@ #include "lld/Common/Reproduce.h" #include "llvm/ADT/Optional.h" #include "llvm/ADT/StringRef.h" +#include "llvm/ADT/StringSet.h" #include "llvm/Object/Archive.h" #include "llvm/Object/COFF.h" #include "llvm/Option/Arg.h" @@ -54,6 +55,10 @@ class ArgParser { (public) // Tokenizes a given string and then parses as command line options. llvm::opt::InputArgList parse(StringRef S) { return parse(tokenize(S)); } + // Tokenizes a given string and then parses as command line options in + // .drectve section. + llvm::opt::InputArgList parseDirectives(StringRef S); + private: // Parses command line options. llvm::opt::InputArgList parse(llvm::ArrayRef Args); @@ -123,6 +128,8 @@ class LinkerDriver { (private) std::list> TaskQueue; std::vector FilePaths; std::vector Resources; + + llvm::StringSet<> DirectivesExports; }; // Functions below this line are defined in DriverUtils.cpp. Modified: vendor/lld/dist/COFF/DriverUtils.cpp ============================================================================== --- vendor/lld/dist/COFF/DriverUtils.cpp Thu Dec 28 21:23:22 2017 (r327307) +++ vendor/lld/dist/COFF/DriverUtils.cpp Thu Dec 28 21:23:25 2017 (r327308) @@ -750,6 +750,22 @@ opt::InputArgList ArgParser::parse(ArrayRefgetSpelling()); + return Args; +} + // link.exe has an interesting feature. If LINK or _LINK_ environment // variables exist, their contents are handled as command line strings. // So you can pass extra arguments using them. Modified: vendor/lld/dist/COFF/Options.td ============================================================================== --- vendor/lld/dist/COFF/Options.td Thu Dec 28 21:23:22 2017 (r327307) +++ vendor/lld/dist/COFF/Options.td Thu Dec 28 21:23:25 2017 (r327308) @@ -29,6 +29,7 @@ def export : P<"export", "Export a function">; // No help text because /failifmismatch is not intended to be used by the user. def failifmismatch : P<"failifmismatch", "">; def heap : P<"heap", "Size of the heap">; +def ignore : P<"ignore", "Specify warning codes to ignore">; def implib : P<"implib", "Import library name">; def libpath : P<"libpath", "Additional library search path">; def linkrepro : P<"linkrepro", "Dump linker invocation and input files for debugging">; @@ -155,7 +156,6 @@ def fastfail : F<"fastfail">; def delay : QF<"delay">; def errorreport : QF<"errorreport">; def idlout : QF<"idlout">; -def ignore : QF<"ignore">; def maxilksize : QF<"maxilksize">; def natvis : QF<"natvis">; def pdbaltpath : QF<"pdbaltpath">; Modified: vendor/lld/dist/COFF/SymbolTable.cpp ============================================================================== --- vendor/lld/dist/COFF/SymbolTable.cpp Thu Dec 28 21:23:22 2017 (r327307) +++ vendor/lld/dist/COFF/SymbolTable.cpp Thu Dec 28 21:23:25 2017 (r327308) @@ -117,9 +117,10 @@ void SymbolTable::reportRemainingUndefines() { for (Symbol *B : Config->GCRoot) { if (Undefs.count(B)) errorOrWarn(": undefined symbol: " + B->getName()); - if (Symbol *Imp = LocalImports.lookup(B)) - warn(": locally defined symbol imported: " + Imp->getName() + - " (defined in " + toString(Imp->getFile()) + ")"); + if (Config->WarnLocallyDefinedImported) + if (Symbol *Imp = LocalImports.lookup(B)) + warn(": locally defined symbol imported: " + Imp->getName() + + " (defined in " + toString(Imp->getFile()) + ")"); } for (ObjFile *File : ObjFile::Instances) { @@ -128,9 +129,11 @@ void SymbolTable::reportRemainingUndefines() { continue; if (Undefs.count(Sym)) errorOrWarn(toString(File) + ": undefined symbol: " + Sym->getName()); - if (Symbol *Imp = LocalImports.lookup(Sym)) - warn(toString(File) + ": locally defined symbol imported: " + - Imp->getName() + " (defined in " + toString(Imp->getFile()) + ")"); + if (Config->WarnLocallyDefinedImported) + if (Symbol *Imp = LocalImports.lookup(Sym)) + warn(toString(File) + ": locally defined symbol imported: " + + Imp->getName() + " (defined in " + toString(Imp->getFile()) + + ")"); } } } Modified: vendor/lld/dist/ELF/Arch/X86.cpp ============================================================================== --- vendor/lld/dist/ELF/Arch/X86.cpp Thu Dec 28 21:23:22 2017 (r327307) +++ vendor/lld/dist/ELF/Arch/X86.cpp Thu Dec 28 21:23:25 2017 (r327308) @@ -192,9 +192,9 @@ void X86::writePltHeader(uint8_t *Buf) const { } const uint8_t PltData[] = { - 0xff, 0x35, 0x00, 0x00, 0x00, 0x00, // pushl (GOTPLT+4) - 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, // jmp *(GOTPLT+8) - 0x90, 0x90, 0x90, 0x90 // nop + 0xff, 0x35, 0, 0, 0, 0, // pushl (GOTPLT+4) + 0xff, 0x25, 0, 0, 0, 0, // jmp *(GOTPLT+8) + 0x90, 0x90, 0x90, 0x90, // nop }; memcpy(Buf, PltData, sizeof(PltData)); uint32_t GotPlt = InX::GotPlt->getVA(); @@ -206,9 +206,9 @@ void X86::writePlt(uint8_t *Buf, uint64_t GotPltEntryA uint64_t PltEntryAddr, int32_t Index, unsigned RelOff) const { const uint8_t Inst[] = { - 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, // jmp *foo_in_GOT|*foo@GOT(%ebx) - 0x68, 0x00, 0x00, 0x00, 0x00, // pushl $reloc_offset - 0xe9, 0x00, 0x00, 0x00, 0x00 // jmp .PLT0@PC + 0xff, 0x00, 0, 0, 0, 0, // jmp *foo_in_GOT or jmp *foo@GOT(%ebx) + 0x68, 0, 0, 0, 0, // pushl $reloc_offset + 0xe9, 0, 0, 0, 0, // jmp .PLT0@PC }; memcpy(Buf, Inst, sizeof(Inst)); @@ -318,7 +318,7 @@ void X86::relaxTlsGdToLe(uint8_t *Loc, RelType Type, u // subl $x@ntpoff,%eax const uint8_t Inst[] = { 0x65, 0xa1, 0x00, 0x00, 0x00, 0x00, // movl %gs:0, %eax - 0x81, 0xe8, 0x00, 0x00, 0x00, 0x00 // subl 0(%ebx), %eax + 0x81, 0xe8, 0, 0, 0, 0, // subl Val(%ebx), %eax }; memcpy(Loc - 3, Inst, sizeof(Inst)); write32le(Loc + 5, Val); @@ -333,7 +333,7 @@ void X86::relaxTlsGdToIe(uint8_t *Loc, RelType Type, u // addl x@gotntpoff(%ebx), %eax const uint8_t Inst[] = { 0x65, 0xa1, 0x00, 0x00, 0x00, 0x00, // movl %gs:0, %eax - 0x03, 0x83, 0x00, 0x00, 0x00, 0x00 // addl 0(%ebx), %eax + 0x03, 0x83, 0, 0, 0, 0, // addl Val(%ebx), %eax }; memcpy(Loc - 3, Inst, sizeof(Inst)); write32le(Loc + 5, Val); @@ -394,7 +394,7 @@ void X86::relaxTlsLdToLe(uint8_t *Loc, RelType Type, u const uint8_t Inst[] = { 0x65, 0xa1, 0x00, 0x00, 0x00, 0x00, // movl %gs:0,%eax 0x90, // nop - 0x8d, 0x74, 0x26, 0x00 // leal 0(%esi,1),%esi + 0x8d, 0x74, 0x26, 0x00, // leal 0(%esi,1),%esi }; memcpy(Loc - 2, Inst, sizeof(Inst)); } Modified: vendor/lld/dist/ELF/Arch/X86_64.cpp ============================================================================== --- vendor/lld/dist/ELF/Arch/X86_64.cpp Thu Dec 28 21:23:22 2017 (r327307) +++ vendor/lld/dist/ELF/Arch/X86_64.cpp Thu Dec 28 21:23:25 2017 (r327308) @@ -129,9 +129,9 @@ void X86_64::writeGotPlt(uint8_t *Buf, const Sym template void X86_64::writePltHeader(uint8_t *Buf) const { const uint8_t PltData[] = { - 0xff, 0x35, 0x00, 0x00, 0x00, 0x00, // pushq GOTPLT+8(%rip) - 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, // jmp *GOTPLT+16(%rip) - 0x0f, 0x1f, 0x40, 0x00 // nop + 0xff, 0x35, 0, 0, 0, 0, // pushq GOTPLT+8(%rip) + 0xff, 0x25, 0, 0, 0, 0, // jmp *GOTPLT+16(%rip) + 0x0f, 0x1f, 0x40, 0x00, // nop }; memcpy(Buf, PltData, sizeof(PltData)); uint64_t GotPlt = InX::GotPlt->getVA(); @@ -145,9 +145,9 @@ void X86_64::writePlt(uint8_t *Buf, uint64_t Got uint64_t PltEntryAddr, int32_t Index, unsigned RelOff) const { const uint8_t Inst[] = { - 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, // jmpq *got(%rip) - 0x68, 0x00, 0x00, 0x00, 0x00, // pushq - 0xe9, 0x00, 0x00, 0x00, 0x00 // jmpq plt[0] + 0xff, 0x25, 0, 0, 0, 0, // jmpq *got(%rip) + 0x68, 0, 0, 0, 0, // pushq + 0xe9, 0, 0, 0, 0, // jmpq plt[0] }; memcpy(Buf, Inst, sizeof(Inst)); @@ -175,7 +175,7 @@ void X86_64::relaxTlsGdToLe(uint8_t *Loc, RelTyp // lea x@tpoff,%rax const uint8_t Inst[] = { 0x64, 0x48, 0x8b, 0x04, 0x25, 0x00, 0x00, 0x00, 0x00, // mov %fs:0x0,%rax - 0x48, 0x8d, 0x80, 0x00, 0x00, 0x00, 0x00 // lea x@tpoff,%rax + 0x48, 0x8d, 0x80, 0, 0, 0, 0, // lea x@tpoff,%rax }; memcpy(Loc - 4, Inst, sizeof(Inst)); @@ -198,7 +198,7 @@ void X86_64::relaxTlsGdToIe(uint8_t *Loc, RelTyp // addq x@tpoff,%rax const uint8_t Inst[] = { 0x64, 0x48, 0x8b, 0x04, 0x25, 0x00, 0x00, 0x00, 0x00, // mov %fs:0x0,%rax - 0x48, 0x03, 0x05, 0x00, 0x00, 0x00, 0x00 // addq x@tpoff,%rax + 0x48, 0x03, 0x05, 0, 0, 0, 0, // addq x@tpoff,%rax }; memcpy(Loc - 4, Inst, sizeof(Inst)); @@ -274,9 +274,9 @@ void X86_64::relaxTlsLdToLe(uint8_t *Loc, RelTyp } const uint8_t Inst[] = { - 0x66, 0x66, // .word 0x6666 - 0x66, // .byte 0x66 - 0x64, 0x48, 0x8b, 0x04, 0x25, 0x00, 0x00, 0x00, 0x00 // mov %fs:0,%rax + 0x66, 0x66, // .word 0x6666 + 0x66, // .byte 0x66 + 0x64, 0x48, 0x8b, 0x04, 0x25, 0x00, 0x00, 0x00, 0x00, // mov %fs:0,%rax }; memcpy(Loc - 3, Inst, sizeof(Inst)); } Modified: vendor/lld/dist/ELF/Relocations.cpp ============================================================================== --- vendor/lld/dist/ELF/Relocations.cpp Thu Dec 28 21:23:22 2017 (r327307) +++ vendor/lld/dist/ELF/Relocations.cpp Thu Dec 28 21:23:25 2017 (r327308) @@ -581,44 +581,38 @@ static RelExpr getPltExpr(Symbol &Sym, RelExpr Expr, b return toPlt(Expr); } +// This modifies the expression if we can use a copy relocation or point the +// symbol to the PLT. template static RelExpr adjustExpr(Symbol &Sym, RelExpr Expr, RelType Type, InputSectionBase &S, uint64_t RelOff, bool &IsConstant) { - // We can create any dynamic relocation if a section is simply writable. - if (S.Flags & SHF_WRITE) - return Expr; - - // Or, if we are allowed to create dynamic relocations against - // read-only sections (i.e. when "-z notext" is given), - // we can create a dynamic relocation as we want, too. - if (!Config->ZText) { - // We use PLT for relocations that may overflow in runtime, - // see comment for getPltExpr(). - if (Sym.isFunc() && !Target->isPicRel(Type)) - return getPltExpr(Sym, Expr, IsConstant); - return Expr; - } - // If a relocation can be applied at link-time, we don't need to // create a dynamic relocation in the first place. if (IsConstant) return Expr; - // If we got here we know that this relocation would require the dynamic - // linker to write a value to read only memory. - - // If the relocation is to a weak undef, give up on it and produce a - // non preemptible 0. - if (Sym.isUndefWeak()) { + // If the relocation is to a weak undef, and we are producing + // executable, give up on it and produce a non preemptible 0. + if (!Config->Shared && Sym.isUndefWeak()) { Sym.IsPreemptible = false; IsConstant = true; return Expr; } + // We can create any dynamic relocation supported by the dynamic linker if a + // section is writable or we are passed -z notext. + bool CanWrite = (S.Flags & SHF_WRITE) || !Config->ZText; + if (CanWrite && Target->isPicRel(Type)) + return Expr; + + // If we got here we know that this relocation would require the dynamic + // linker to write a value to read only memory or use an unsupported + // relocation. + // We can hack around it if we are producing an executable and // the refered symbol can be preemepted to refer to the executable. - if (Config->Shared || (Config->Pic && !isRelExpr(Expr))) { + if (!CanWrite && (Config->Shared || (Config->Pic && !isRelExpr(Expr)))) { error( "can't create dynamic relocation " + toString(Type) + " against " + (Sym.getName().empty() ? "local symbol" : "symbol: " + toString(Sym)) + @@ -626,6 +620,11 @@ static RelExpr adjustExpr(Symbol &Sym, RelExpr Expr, R getLocation(S, Sym, RelOff)); return Expr; } + + // Copy relocations are only possible if we are creating an executable and the + // symbol is shared. + if (!Sym.isShared() || Config->Shared) + return Expr; if (Sym.getVisibility() != STV_DEFAULT) { error("cannot preempt symbol: " + toString(Sym) + Modified: vendor/lld/dist/ELF/ScriptLexer.cpp ============================================================================== --- vendor/lld/dist/ELF/ScriptLexer.cpp Thu Dec 28 21:23:22 2017 (r327307) +++ vendor/lld/dist/ELF/ScriptLexer.cpp Thu Dec 28 21:23:25 2017 (r327308) @@ -115,11 +115,19 @@ void ScriptLexer::tokenize(MemoryBufferRef MB) { continue; } + // ">foo" is parsed to ">" and "foo", but ">>" is parsed to ">>". + if (S.startswith("<<") || S.startswith("<=") || S.startswith(">>") || + S.startswith(">=")) { + Vec.push_back(S.substr(0, 2)); + S = S.substr(2); + continue; + } + // Unquoted token. This is more relaxed than tokens in C-like language, // so that you can write "file-name.cpp" as one bare token, for example. size_t Pos = S.find_first_not_of( "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" - "0123456789_.$/\\~=+[]*?-!<>^:"); + "0123456789_.$/\\~=+[]*?-!^:"); // A character that cannot start a word (which is usually a // punctuation) forms a single character token. Modified: vendor/lld/dist/ELF/ScriptParser.cpp ============================================================================== --- vendor/lld/dist/ELF/ScriptParser.cpp Thu Dec 28 21:23:22 2017 (r327307) +++ vendor/lld/dist/ELF/ScriptParser.cpp Thu Dec 28 21:23:25 2017 (r327308) @@ -151,6 +151,7 @@ static ExprValue add(ExprValue A, ExprValue B) { } static ExprValue sub(ExprValue A, ExprValue B) { + // The distance between two symbols in sections is absolute. if (!A.isAbsolute() && !B.isAbsolute()) return A.getValue() - B.getValue(); return {A.Sec, false, A.getSectionOffset() - B.getValue(), A.Loc}; @@ -707,8 +708,6 @@ OutputSection *ScriptParser::readOutputSectionDescript if (consume(">")) Cmd->MemoryRegionName = next(); - else if (peek().startswith(">")) - Cmd->MemoryRegionName = next().drop_front(); Cmd->Phdrs = readOutputSectionPhdrs(); Added: vendor/lld/dist/test/COFF/ignore4217.yaml ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lld/dist/test/COFF/ignore4217.yaml Thu Dec 28 21:23:25 2017 (r327308) @@ -0,0 +1,72 @@ +# Tests that /ignore:4217 suppresses "locally defined symbol imported" warnings. +# RUN: yaml2obj < %s > %t.obj + +# RUN: lld-link -entry:main -out:%t.exe %t.obj 2>&1 \ +# RUN: | FileCheck -check-prefix=WARNINGS %s +# RUN: lld-link -ignore:4217 -entry:main -out:%t.exe %t.obj 2>&1 \ +# RUN: | FileCheck -allow-empty -check-prefix=SUPPRESSED %s + +# WARNINGS: locally defined symbol imported +# SUPPRESSED-NOT: locally defined symbol imported + +--- !COFF +header: + Machine: IMAGE_FILE_MACHINE_AMD64 + Characteristics: [ ] +sections: + - Name: .text + Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ] + Alignment: 16 + SectionData: B82A000000C3662E0F1F8400000000004883EC28C744242400000000E800000000904883C428C3 + Relocations: + - VirtualAddress: 29 + SymbolName: __imp_foo + Type: IMAGE_REL_AMD64_REL32 + - Name: .data + Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ] + Alignment: 4 + SectionData: '' +symbols: + - Name: .text + Value: 0 + SectionNumber: 1 + SimpleType: IMAGE_SYM_TYPE_NULL + ComplexType: IMAGE_SYM_DTYPE_NULL + StorageClass: IMAGE_SYM_CLASS_STATIC + SectionDefinition: + Length: 39 + NumberOfRelocations: 1 + NumberOfLinenumbers: 0 + CheckSum: 3087210877 + Number: 1 + - Name: .data + Value: 0 + SectionNumber: 2 + SimpleType: IMAGE_SYM_TYPE_NULL + ComplexType: IMAGE_SYM_DTYPE_NULL + StorageClass: IMAGE_SYM_CLASS_STATIC + SectionDefinition: + Length: 0 + NumberOfRelocations: 0 + NumberOfLinenumbers: 0 + CheckSum: 0 + Number: 2 + - Name: foo + Value: 0 + SectionNumber: 1 + SimpleType: IMAGE_SYM_TYPE_NULL + ComplexType: IMAGE_SYM_DTYPE_FUNCTION + StorageClass: IMAGE_SYM_CLASS_EXTERNAL + - Name: main + Value: 16 + SectionNumber: 1 + SimpleType: IMAGE_SYM_TYPE_NULL + ComplexType: IMAGE_SYM_DTYPE_FUNCTION + StorageClass: IMAGE_SYM_CLASS_EXTERNAL + - Name: __imp_foo + Value: 0 + SectionNumber: 0 + SimpleType: IMAGE_SYM_TYPE_NULL + ComplexType: IMAGE_SYM_DTYPE_NULL + StorageClass: IMAGE_SYM_CLASS_EXTERNAL +... Added: vendor/lld/dist/test/ELF/Inputs/writable-sec-plt-reloc.s ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lld/dist/test/ELF/Inputs/writable-sec-plt-reloc.s Thu Dec 28 21:23:25 2017 (r327308) @@ -0,0 +1,4 @@ + .global foo + .type foo, @function +foo: + retq Added: vendor/lld/dist/test/ELF/Inputs/znotext-copy-relocations.s ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lld/dist/test/ELF/Inputs/znotext-copy-relocations.s Thu Dec 28 21:23:25 2017 (r327308) @@ -0,0 +1,5 @@ +.global foo +.type foo,@object +.size foo, 8 +foo: +.quad 42 Added: vendor/lld/dist/test/ELF/Inputs/znotext-plt-relocations-protected.s ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lld/dist/test/ELF/Inputs/znotext-plt-relocations-protected.s Thu Dec 28 21:23:25 2017 (r327308) @@ -0,0 +1,5 @@ +.global foo +.type foo,@function +.protected foo +foo: + nop Modified: vendor/lld/dist/test/ELF/arm-thumb-no-undefined-thunk.s ============================================================================== --- vendor/lld/dist/test/ELF/arm-thumb-no-undefined-thunk.s Thu Dec 28 21:23:22 2017 (r327307) +++ vendor/lld/dist/test/ELF/arm-thumb-no-undefined-thunk.s Thu Dec 28 21:23:25 2017 (r327308) @@ -21,4 +21,4 @@ _start: // 69636 = 0x11004 = next instruction // CHECK: 11000: {{.*}} bl #0 // CHECK-NEXT: 11004: {{.*}} b.w #0 <_start+0x8> -// CHECK-NEXT: 11008: {{.*}} b.w #0 <_start+0xC> +// CHECK-NEXT: 11008: {{.*}} b.w #0 <_start+0xc> Modified: vendor/lld/dist/test/ELF/arm-undefined-weak.s ============================================================================== --- vendor/lld/dist/test/ELF/arm-undefined-weak.s Thu Dec 28 21:23:22 2017 (r327307) +++ vendor/lld/dist/test/ELF/arm-undefined-weak.s Thu Dec 28 21:23:25 2017 (r327308) @@ -32,7 +32,7 @@ _start: // CHECK: 11000: {{.*}} b #-4 <_start+0x4> // CHECK-NEXT: 11004: {{.*}} bl #-4 <_start+0x8> // blx is transformed into bl so we don't change state -// CHECK-NEXT: 11008: {{.*}} bl #-4 <_start+0xC> +// CHECK-NEXT: 11008: {{.*}} bl #-4 <_start+0xc> // CHECK-NEXT: 1100c: {{.*}} movt r0, #0 // CHECK-NEXT: 11010: {{.*}} movw r0, #0 // CHECK: 11014: {{.*}} .word 0x00000000 Modified: vendor/lld/dist/test/ELF/gnu-ifunc-i386.s ============================================================================== --- vendor/lld/dist/test/ELF/gnu-ifunc-i386.s Thu Dec 28 21:23:22 2017 (r327307) +++ vendor/lld/dist/test/ELF/gnu-ifunc-i386.s Thu Dec 28 21:23:25 2017 (r327308) @@ -102,10 +102,10 @@ // DISASM-NEXT: .plt: // DISASM-NEXT: 11020: ff 25 00 20 01 00 jmpl *73728 // DISASM-NEXT: 11026: 68 10 00 00 00 pushl $16 -// DISASM-NEXT: 1102b: e9 e0 ff ff ff jmp -32 <_start+0xE> +// DISASM-NEXT: 1102b: e9 e0 ff ff ff jmp -32 <_start+0xe> // DISASM-NEXT: 11030: ff 25 04 20 01 00 jmpl *73732 // DISASM-NEXT: 11036: 68 18 00 00 00 pushl $24 -// DISASM-NEXT: 1103b: e9 d0 ff ff ff jmp -48 <_start+0xE> +// DISASM-NEXT: 1103b: e9 d0 ff ff ff jmp -48 <_start+0xe> .text .type foo STT_GNU_IFUNC Modified: vendor/lld/dist/test/ELF/gnu-ifunc.s ============================================================================== --- vendor/lld/dist/test/ELF/gnu-ifunc.s Thu Dec 28 21:23:22 2017 (r327307) +++ vendor/lld/dist/test/ELF/gnu-ifunc.s Thu Dec 28 21:23:25 2017 (r327308) @@ -102,10 +102,10 @@ // DISASM-NEXT: .plt: // DISASM-NEXT: 201020: {{.*}} jmpq *4058(%rip) // DISASM-NEXT: 201026: {{.*}} pushq $0 -// DISASM-NEXT: 20102b: {{.*}} jmp -32 <_start+0xE> +// DISASM-NEXT: 20102b: {{.*}} jmp -32 <_start+0xe> // DISASM-NEXT: 201030: {{.*}} jmpq *4050(%rip) // DISASM-NEXT: 201036: {{.*}} pushq $1 -// DISASM-NEXT: 20103b: {{.*}} jmp -48 <_start+0xE> +// DISASM-NEXT: 20103b: {{.*}} jmp -48 <_start+0xe> .text .type foo STT_GNU_IFUNC Added: vendor/lld/dist/test/ELF/writable-sec-plt-reloc.s ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lld/dist/test/ELF/writable-sec-plt-reloc.s Thu Dec 28 21:23:25 2017 (r327308) @@ -0,0 +1,14 @@ +# REQUIRES: x86 +# RUN: llvm-mc %s -o %t.o -filetype=obj -triple=x86_64-pc-linux +# RUN: llvm-mc %p/Inputs/writable-sec-plt-reloc.s -o %t2.o -filetype=obj -triple=x86_64-pc-linux +# RUN: ld.lld %t2.o -o %t2.so -shared +# RUN: ld.lld %t.o %t2.so -o %t +# RUN: llvm-readelf --symbols -r %t | FileCheck %s + +# CHECK: R_X86_64_JUMP_SLOT {{.*}} foo + 0 +# CHECK: 0000000000201010 0 FUNC GLOBAL DEFAULT UND foo + +.section .bar,"awx" +.global _start +_start: + call foo Modified: vendor/lld/dist/test/ELF/x86-64-dyn-rel-error.s ============================================================================== --- vendor/lld/dist/test/ELF/x86-64-dyn-rel-error.s Thu Dec 28 21:23:22 2017 (r327307) +++ vendor/lld/dist/test/ELF/x86-64-dyn-rel-error.s Thu Dec 28 21:23:25 2017 (r327308) @@ -2,12 +2,12 @@ // RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o // RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/shared.s -o %t2.o // RUN: ld.lld %t2.o -shared -o %t2.so -// RUN: not ld.lld %t.o %t2.so -o %t 2>&1 | FileCheck %s +// RUN: not ld.lld -shared %t.o %t2.so -o %t 2>&1 | FileCheck %s .global _start _start: .data - .long bar + .long zed // CHECK: relocation R_X86_64_32 cannot be used against shared object; recompile with -fPIC Modified: vendor/lld/dist/test/ELF/x86-64-dyn-rel-error2.s ============================================================================== --- vendor/lld/dist/test/ELF/x86-64-dyn-rel-error2.s Thu Dec 28 21:23:22 2017 (r327307) +++ vendor/lld/dist/test/ELF/x86-64-dyn-rel-error2.s Thu Dec 28 21:23:25 2017 (r327308) @@ -2,7 +2,7 @@ // RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o // RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/shared.s -o %t2.o // RUN: ld.lld %t2.o -shared -o %t2.so -// RUN: not ld.lld %t.o %t2.so -o %t 2>&1 | FileCheck %s +// RUN: not ld.lld -shared %t.o %t2.so -o %t 2>&1 | FileCheck %s // CHECK: relocation R_X86_64_PC32 cannot be used against shared object; recompile with -fPIC // CHECK: >>> defined in {{.*}}.so @@ -11,4 +11,4 @@ .global _start _start: .data - .long bar - . + .long zed - . Added: vendor/lld/dist/test/ELF/znotext-copy-relocation.s ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lld/dist/test/ELF/znotext-copy-relocation.s Thu Dec 28 21:23:25 2017 (r327308) @@ -0,0 +1,16 @@ +# REQUIRES: x86 +# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o +# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/znotext-copy-relocations.s -o %t2.o +# RUN: ld.lld %t2.o -o %t2.so -shared +# RUN: ld.lld -z notext %t.o %t2.so -o %t +# RUN: llvm-readobj -r %t | FileCheck %s + +# CHECK: Relocations [ +# CHECK-NEXT: Section ({{.*}}) .rela.dyn { +# CHECK-NEXT: R_X86_64_COPY foo 0x0 +# CHECK-NEXT: } +# CHECK-NEXT: ] + +.global _start +_start: +.long foo Added: vendor/lld/dist/test/ELF/znotext-plt-relocations-protected.s ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lld/dist/test/ELF/znotext-plt-relocations-protected.s Thu Dec 28 21:23:25 2017 (r327308) @@ -0,0 +1,11 @@ +# REQUIRES: x86 +# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o +# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/znotext-plt-relocations-protected.s -o %t2.o +# RUN: ld.lld %t2.o -o %t2.so -shared +# RUN: not ld.lld -z notext %t.o %t2.so -o %t 2>&1 | FileCheck %s + +# CHECK: error: cannot preempt symbol: foo + +.global _start +_start: +callq foo Added: vendor/lld/dist/test/ELF/znotext-weak-undef.s ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lld/dist/test/ELF/znotext-weak-undef.s Thu Dec 28 21:23:25 2017 (r327308) @@ -0,0 +1,16 @@ +# REQUIRES: x86 +# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o +# RUN: not ld.lld -z notext -shared %t.o -o %t 2>&1 | FileCheck %s +# CHECK: relocation R_X86_64_32 cannot be used against shared object; recompile with -fPIC + +# RUN: ld.lld -z notext %t.o -o %t +# RUN: llvm-readobj -r %t | FileCheck %s --check-prefix=EXE +# EXE: Relocations [ +# EXE-NEXT: ] + +.text +.global foo +.weak foo + +_start: +mov $foo,%eax From owner-svn-src-all@freebsd.org Thu Dec 28 21:23:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E032E813DA; Thu, 28 Dec 2017 21:23:40 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 860D36C362; Thu, 28 Dec 2017 21:23:36 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBSLNZEd024660; Thu, 28 Dec 2017 21:23:35 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBSLNZ67024657; Thu, 28 Dec 2017 21:23:35 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201712282123.vBSLNZ67024657@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 28 Dec 2017 21:23:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r327310 - in vendor/lldb/dist: source/Plugins/SymbolFile/PDB unittests/SymbolFile/PDB X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/lldb/dist: source/Plugins/SymbolFile/PDB unittests/SymbolFile/PDB X-SVN-Commit-Revision: 327310 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 21:23:41 -0000 Author: dim Date: Thu Dec 28 21:23:35 2017 New Revision: 327310 URL: https://svnweb.freebsd.org/changeset/base/327310 Log: Vendor import of lldb trunk r321530: https://llvm.org/svn/llvm-project/lldb/trunk@321530 Modified: vendor/lldb/dist/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h vendor/lldb/dist/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp Modified: vendor/lldb/dist/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h ============================================================================== --- vendor/lldb/dist/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h Thu Dec 28 21:23:32 2017 (r327309) +++ vendor/lldb/dist/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h Thu Dec 28 21:23:35 2017 (r327310) @@ -140,6 +140,10 @@ class SymbolFilePDB : public lldb_private::SymbolFile size_t FindTypes(const std::vector &context, bool append, lldb_private::TypeMap &types) override; + void FindTypesByRegex(const lldb_private::RegularExpression ®ex, + uint32_t max_matches, + lldb_private::TypeMap &types); + lldb_private::TypeList *GetTypeList() override; size_t GetTypes(lldb_private::SymbolContextScope *sc_scope, @@ -171,10 +175,6 @@ class SymbolFilePDB : public lldb_private::SymbolFile void BuildSupportFileIdToSupportFileIndexMap( const llvm::pdb::PDBSymbolCompiland &cu, llvm::DenseMap &index_map) const; - - void FindTypesByRegex(const lldb_private::RegularExpression ®ex, - uint32_t max_matches, - lldb_private::TypeMap &types); void FindTypesByName(const std::string &name, uint32_t max_matches, lldb_private::TypeMap &types); Modified: vendor/lldb/dist/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp ============================================================================== --- vendor/lldb/dist/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp Thu Dec 28 21:23:32 2017 (r327309) +++ vendor/lldb/dist/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp Thu Dec 28 21:23:35 2017 (r327310) @@ -512,20 +512,15 @@ TEST_F(SymbolFilePDBTests, TestRegexNameMatch) { SymbolVendor *plugin = module->GetSymbolVendor(); SymbolFilePDB *symfile = static_cast(plugin->GetSymbolFile()); - SymbolContext sc; - llvm::DenseSet searched_files; TypeMap results; - uint32_t num_results = symfile->FindTypes(sc, ConstString(".*"), nullptr, - false, 0, searched_files, results); - EXPECT_GT(num_results, 1u); - EXPECT_EQ(num_results, results.GetSize()); + + symfile->FindTypesByRegex(RegularExpression(".*"), 0, results); + EXPECT_GT(results.GetSize(), 1u); // We expect no exception thrown if the given regex can't be compiled results.Clear(); - num_results = symfile->FindTypes(sc, ConstString("**"), nullptr, - false, 0, searched_files, results); - EXPECT_EQ(num_results, 0u); - EXPECT_EQ(num_results, results.GetSize()); + symfile->FindTypesByRegex(RegularExpression("**"), 0, results); + EXPECT_EQ(0u, results.GetSize()); } TEST_F(SymbolFilePDBTests, TestMaxMatches) { @@ -539,7 +534,8 @@ TEST_F(SymbolFilePDBTests, TestMaxMatches) { SymbolContext sc; llvm::DenseSet searched_files; TypeMap results; - uint32_t num_results = symfile->FindTypes(sc, ConstString(".*"), nullptr, + const ConstString name("ClassTypedef"); + uint32_t num_results = symfile->FindTypes(sc, name, nullptr, false, 0, searched_files, results); // Try to limit ourselves from 1 to 10 results, otherwise we could be doing // this thousands of times. @@ -549,7 +545,7 @@ TEST_F(SymbolFilePDBTests, TestMaxMatches) { uint32_t iterations = std::min(num_results, 10u); for (uint32_t i = 1; i <= iterations; ++i) { uint32_t num_limited_results = symfile->FindTypes( - sc, ConstString(".*"), nullptr, false, i, searched_files, results); + sc, name, nullptr, false, i, searched_files, results); EXPECT_EQ(i, num_limited_results); EXPECT_EQ(num_limited_results, results.GetSize()); } From owner-svn-src-all@freebsd.org Thu Dec 28 21:23:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79731E813F8; Thu, 28 Dec 2017 21:23:47 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89CD36C430; Thu, 28 Dec 2017 21:23:40 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBSLNe8e024707; Thu, 28 Dec 2017 21:23:40 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBSLNe3j024706; Thu, 28 Dec 2017 21:23:40 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201712282123.vBSLNe3j024706@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 28 Dec 2017 21:23:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r327311 - vendor/lldb/lldb-trunk-r321530 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/lldb/lldb-trunk-r321530 X-SVN-Commit-Revision: 327311 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 21:23:47 -0000 Author: dim Date: Thu Dec 28 21:23:39 2017 New Revision: 327311 URL: https://svnweb.freebsd.org/changeset/base/327311 Log: Tag lldb trunk r321530. Added: vendor/lldb/lldb-trunk-r321530/ - copied from r327310, vendor/lldb/dist/ From owner-svn-src-all@freebsd.org Thu Dec 28 21:23:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EB5EE8130F; Thu, 28 Dec 2017 21:23:24 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CFD7B6C0F9; Thu, 28 Dec 2017 21:23:23 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBSLNM6e024490; Thu, 28 Dec 2017 21:23:22 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBSLNMW7024489; Thu, 28 Dec 2017 21:23:22 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201712282123.vBSLNMW7024489@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 28 Dec 2017 21:23:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r327307 - vendor/libc++/libc++-trunk-r321530 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/libc++/libc++-trunk-r321530 X-SVN-Commit-Revision: 327307 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 21:23:24 -0000 Author: dim Date: Thu Dec 28 21:23:22 2017 New Revision: 327307 URL: https://svnweb.freebsd.org/changeset/base/327307 Log: Tag libc++ trunk r321530. Added: vendor/libc++/libc++-trunk-r321530/ - copied from r327306, vendor/libc++/dist/ From owner-svn-src-all@freebsd.org Thu Dec 28 21:26:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BF98E818FE; Thu, 28 Dec 2017 21:26:42 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 533C86CCD9; Thu, 28 Dec 2017 21:26:42 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBSLQfUF024856; Thu, 28 Dec 2017 21:26:41 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBSLQe7D024851; Thu, 28 Dec 2017 21:26:40 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201712282126.vBSLQe7D024851@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 28 Dec 2017 21:26:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327312 - head/sys/dev/e1000 X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/sys/dev/e1000 X-SVN-Commit-Revision: 327312 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 21:26:42 -0000 Author: sbruno Date: Thu Dec 28 21:26:40 2017 New Revision: 327312 URL: https://svnweb.freebsd.org/changeset/base/327312 Log: e1000: Add support for Ice Lake and Cannon Lake Ths add initial support for Ice Lake and Cannon Lake ethernet devices. This also addressed errata 1.5.4.4 for Sky Lake and Kabby Lake devices: https://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/i218-i219-ethernet-connection-spec-update.pdf?asset=9561 Submitted by: Kevin Bowling Relnotes: Yes Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D13660 Modified: head/sys/dev/e1000/e1000_api.c head/sys/dev/e1000/e1000_hw.h head/sys/dev/e1000/e1000_ich8lan.c head/sys/dev/e1000/e1000_ich8lan.h head/sys/dev/e1000/if_em.c Modified: head/sys/dev/e1000/e1000_api.c ============================================================================== --- head/sys/dev/e1000/e1000_api.c Thu Dec 28 21:23:39 2017 (r327311) +++ head/sys/dev/e1000/e1000_api.c Thu Dec 28 21:26:40 2017 (r327312) @@ -311,6 +311,16 @@ s32 e1000_set_mac_type(struct e1000_hw *hw) case E1000_DEV_ID_PCH_SPT_I219_V5: mac->type = e1000_pch_spt; break; + case E1000_DEV_ID_PCH_CNP_I219_LM6: + case E1000_DEV_ID_PCH_CNP_I219_V6: + case E1000_DEV_ID_PCH_CNP_I219_LM7: + case E1000_DEV_ID_PCH_CNP_I219_V7: + case E1000_DEV_ID_PCH_ICP_I219_LM8: + case E1000_DEV_ID_PCH_ICP_I219_V8: + case E1000_DEV_ID_PCH_ICP_I219_LM9: + case E1000_DEV_ID_PCH_ICP_I219_V9: + mac->type = e1000_pch_cnp; + break; case E1000_DEV_ID_82575EB_COPPER: case E1000_DEV_ID_82575EB_FIBER_SERDES: case E1000_DEV_ID_82575GB_QUAD_COPPER: @@ -462,6 +472,7 @@ s32 e1000_setup_init_funcs(struct e1000_hw *hw, bool i case e1000_pch2lan: case e1000_pch_lpt: case e1000_pch_spt: + case e1000_pch_cnp: e1000_init_function_pointers_ich8lan(hw); break; case e1000_82575: Modified: head/sys/dev/e1000/e1000_hw.h ============================================================================== --- head/sys/dev/e1000/e1000_hw.h Thu Dec 28 21:23:39 2017 (r327311) +++ head/sys/dev/e1000/e1000_hw.h Thu Dec 28 21:26:40 2017 (r327312) @@ -147,6 +147,14 @@ struct e1000_hw; #define E1000_DEV_ID_PCH_SPT_I219_V4 0x15D8 #define E1000_DEV_ID_PCH_SPT_I219_LM5 0x15E3 #define E1000_DEV_ID_PCH_SPT_I219_V5 0x15D6 +#define E1000_DEV_ID_PCH_CNP_I219_LM6 0x15BD +#define E1000_DEV_ID_PCH_CNP_I219_V6 0x15BE +#define E1000_DEV_ID_PCH_CNP_I219_LM7 0x15BB +#define E1000_DEV_ID_PCH_CNP_I219_V7 0x15BC +#define E1000_DEV_ID_PCH_ICP_I219_LM8 0x15DF +#define E1000_DEV_ID_PCH_ICP_I219_V8 0x15E0 +#define E1000_DEV_ID_PCH_ICP_I219_LM9 0x15E1 +#define E1000_DEV_ID_PCH_ICP_I219_V9 0x15E2 #define E1000_DEV_ID_82576 0x10C9 #define E1000_DEV_ID_82576_FIBER 0x10E6 #define E1000_DEV_ID_82576_SERDES 0x10E7 @@ -233,6 +241,7 @@ enum e1000_mac_type { e1000_pch2lan, e1000_pch_lpt, e1000_pch_spt, + e1000_pch_cnp, e1000_82575, e1000_82576, e1000_82580, Modified: head/sys/dev/e1000/e1000_ich8lan.c ============================================================================== --- head/sys/dev/e1000/e1000_ich8lan.c Thu Dec 28 21:23:39 2017 (r327311) +++ head/sys/dev/e1000/e1000_ich8lan.c Thu Dec 28 21:26:40 2017 (r327312) @@ -345,6 +345,7 @@ static s32 e1000_init_phy_workarounds_pchlan(struct e1 switch (hw->mac.type) { case e1000_pch_lpt: case e1000_pch_spt: + case e1000_pch_cnp: if (e1000_phy_is_accessible_pchlan(hw)) break; @@ -493,6 +494,7 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_h case e1000_pch2lan: case e1000_pch_lpt: case e1000_pch_spt: + case e1000_pch_cnp: /* In case the PHY needs to be in mdio slow mode, * set slow mode and try to get the PHY id again. */ @@ -794,6 +796,7 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_ /* fall-through */ case e1000_pch_lpt: case e1000_pch_spt: + case e1000_pch_cnp: /* multicast address update for pch2 */ mac->ops.update_mc_addr_list = e1000_update_mc_addr_list_pch2lan; @@ -1831,6 +1834,7 @@ void e1000_init_function_pointers_ich8lan(struct e1000 case e1000_pch2lan: case e1000_pch_lpt: case e1000_pch_spt: + case e1000_pch_cnp: hw->phy.ops.init_params = e1000_init_phy_params_pchlan; break; default: @@ -2295,6 +2299,7 @@ static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw case e1000_pch2lan: case e1000_pch_lpt: case e1000_pch_spt: + case e1000_pch_cnp: sw_cfg_mask = E1000_FEXTNVM_SW_CONFIG_ICH8M; break; default: @@ -2655,6 +2660,8 @@ static s32 e1000_hv_phy_workarounds_ich8lan(struct e10 e1000_phy_sw_reset_generic(hw); ret_val = hw->phy.ops.write_reg(hw, PHY_CONTROL, 0x3140); + if (ret_val) + return ret_val; } } @@ -3412,6 +3419,7 @@ static s32 e1000_valid_nvm_bank_detect_ich8lan(struct switch (hw->mac.type) { case e1000_pch_spt: + case e1000_pch_cnp: bank1_offset = nvm->flash_bank_size; act_offset = E1000_ICH_NVM_SIG_WORD; @@ -4387,6 +4395,7 @@ static s32 e1000_validate_nvm_checksum_ich8lan(struct switch (hw->mac.type) { case e1000_pch_lpt: case e1000_pch_spt: + case e1000_pch_cnp: word = NVM_COMPAT; valid_csum_mask = NVM_COMPAT_VALID_CSUM; break; Modified: head/sys/dev/e1000/e1000_ich8lan.h ============================================================================== --- head/sys/dev/e1000/e1000_ich8lan.h Thu Dec 28 21:23:39 2017 (r327311) +++ head/sys/dev/e1000/e1000_ich8lan.h Thu Dec 28 21:26:40 2017 (r327312) @@ -124,7 +124,8 @@ #define NVM_SIZE_MULTIPLIER 4096 /*multiplier for NVMS field*/ #define E1000_FLASH_BASE_ADDR 0xE000 /*offset of NVM access regs*/ #define E1000_CTRL_EXT_NVMVS 0x3 /*NVM valid sector */ -#define E1000_TARC0_CB_MULTIQ_3_REQ (1 << 28 | 1 << 29) +#define E1000_TARC0_CB_MULTIQ_3_REQ 0x30000000 +#define E1000_TARC0_CB_MULTIQ_2_REQ 0x20000000 #define PCIE_ICH8_SNOOP_ALL PCIE_NO_SNOOP_ALL #define E1000_ICH_RAR_ENTRIES 7 Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Thu Dec 28 21:23:39 2017 (r327311) +++ head/sys/dev/e1000/if_em.c Thu Dec 28 21:26:40 2017 (r327312) @@ -166,6 +166,14 @@ static pci_vendor_info_t em_vendor_info_array[] = PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_V4, "Intel(R) PRO/1000 Network Connection"), PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_LM5, "Intel(R) PRO/1000 Network Connection"), PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_V5, "Intel(R) PRO/1000 Network Connection"), + PVID(0x8086, E1000_DEV_ID_PCH_CNP_I219_LM6, "Intel(R) PRO/1000 Network Connection"), + PVID(0x8086, E1000_DEV_ID_PCH_CNP_I219_V6, "Intel(R) PRO/1000 Network Connection"), + PVID(0x8086, E1000_DEV_ID_PCH_CNP_I219_LM7, "Intel(R) PRO/1000 Network Connection"), + PVID(0x8086, E1000_DEV_ID_PCH_CNP_I219_V7, "Intel(R) PRO/1000 Network Connection"), + PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_LM8, "Intel(R) PRO/1000 Network Connection"), + PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_V8, "Intel(R) PRO/1000 Network Connection"), + PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_LM9, "Intel(R) PRO/1000 Network Connection"), + PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_V9, "Intel(R) PRO/1000 Network Connection"), /* required last entry */ PVID_END }; @@ -862,7 +870,7 @@ em_if_attach_pre(if_ctx_t ctx) ** so use the same tag and an offset handle for the ** FLASH read/write macros in the shared code. */ - else if (hw->mac.type == e1000_pch_spt) { + else if (hw->mac.type >= e1000_pch_spt) { adapter->osdep.flash_bus_space_tag = adapter->osdep.mem_bus_space_tag; adapter->osdep.flash_bus_space_handle = @@ -1132,6 +1140,7 @@ em_if_mtu_set(if_ctx_t ctx, uint32_t mtu) case e1000_pch2lan: case e1000_pch_lpt: case e1000_pch_spt: + case e1000_pch_cnp: case e1000_82574: case e1000_82583: case e1000_80003es2lan: @@ -2416,6 +2425,7 @@ em_reset(if_ctx_t ctx) case e1000_pch2lan: case e1000_pch_lpt: case e1000_pch_spt: + case e1000_pch_cnp: pba = E1000_PBA_26K; break; case e1000_82575: @@ -2524,6 +2534,7 @@ em_reset(if_ctx_t ctx) case e1000_pch2lan: case e1000_pch_lpt: case e1000_pch_spt: + case e1000_pch_cnp: hw->fc.high_water = 0x5C20; hw->fc.low_water = 0x5048; hw->fc.pause_time = 0x0650; @@ -3054,13 +3065,16 @@ em_initialize_transmit_unit(if_ctx_t ctx) /* This write will effectively turn on the transmit unit. */ E1000_WRITE_REG(&adapter->hw, E1000_TCTL, tctl); + /* SPT and KBL errata workarounds */ if (hw->mac.type == e1000_pch_spt) { u32 reg; reg = E1000_READ_REG(hw, E1000_IOSFPC); reg |= E1000_RCTL_RDMTS_HEX; E1000_WRITE_REG(hw, E1000_IOSFPC, reg); + /* i218-i219 Specification Update 1.5.4.4 */ reg = E1000_READ_REG(hw, E1000_TARC(0)); - reg |= E1000_TARC0_CB_MULTIQ_3_REQ; + reg &= E1000_TARC0_CB_MULTIQ_3_REQ; + reg |= E1000_TARC0_CB_MULTIQ_2_REQ; E1000_WRITE_REG(hw, E1000_TARC(0), reg); } } From owner-svn-src-all@freebsd.org Thu Dec 28 21:35:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DD36E82171; Thu, 28 Dec 2017 21:35:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 286356D5FC; Thu, 28 Dec 2017 21:35:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBSLZsbP029407; Thu, 28 Dec 2017 21:35:54 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBSLZsrT029405; Thu, 28 Dec 2017 21:35:54 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201712282135.vBSLZsrT029405@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 28 Dec 2017 21:35:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327313 - head/sys/i386/conf X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/i386/conf X-SVN-Commit-Revision: 327313 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 21:35:55 -0000 Author: jhb Date: Thu Dec 28 21:35:53 2017 New Revision: 327313 URL: https://svnweb.freebsd.org/changeset/base/327313 Log: Remove a few more dangling references to ie(4). Modified: head/sys/i386/conf/GENERIC head/sys/i386/conf/NOTES Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Thu Dec 28 21:26:40 2017 (r327312) +++ head/sys/i386/conf/GENERIC Thu Dec 28 21:35:53 2017 (r327313) @@ -283,7 +283,6 @@ device ed # NE[12]000, SMC Ultra, 3c503, DS8390 car device ex # Intel EtherExpress Pro/10 and Pro/10+ device ep # Etherlink III based cards device fe # Fujitsu MB8696x based cards -device ie # EtherExpress 8/16, 3C507, StarLAN 10 etc. device sn # SMC's 9000 series of Ethernet chips device xe # Xircom pccard Ethernet Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Thu Dec 28 21:26:40 2017 (r327312) +++ head/sys/i386/conf/NOTES Thu Dec 28 21:35:53 2017 (r327313) @@ -528,8 +528,6 @@ hint.mse.0.irq="5" # ed: Western Digital and SMC 80xx; Novell NE1000 and NE2000; 3Com 3C503 # HP PC Lan+, various PC Card devices # (requires miibus) -# ie: AT&T StarLAN 10 and EN100; 3Com 3C507; unknown NI5210; -# Intel EtherExpress # ipw: Intel PRO/Wireless 2100 IEEE 802.11 adapter # iwi: Intel PRO/Wireless 2200BG/2225BG/2915ABG IEEE 802.11 adapters # Requires the iwi firmware module From owner-svn-src-all@freebsd.org Thu Dec 28 21:46:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAAD0E82975; Thu, 28 Dec 2017 21:46:10 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 74CBD6DB48; Thu, 28 Dec 2017 21:46:10 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBSLk9J3033653; Thu, 28 Dec 2017 21:46:09 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBSLk9Uo033652; Thu, 28 Dec 2017 21:46:09 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201712282146.vBSLk9Uo033652@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Thu, 28 Dec 2017 21:46:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327314 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 327314 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 21:46:10 -0000 Author: marius Date: Thu Dec 28 21:46:09 2017 New Revision: 327314 URL: https://svnweb.freebsd.org/changeset/base/327314 Log: With the advent of interrupt remapping, Intel has repurposed bit 11 (now: Interrupt_Index[15]) and assigned the previously reserved bits 55:48 (Interrupt_Index[14:0] goes into 63:49 while Destination Field used 63:56 and bit 48 now is Interrupt_Format) in the IO redirection tables (see the VT-d specification, "5.1.5.1 I/OxAPIC Programming"). Thus, when not using interrupt remapping, ensure that all previously reserved bits in the high part of the RTEs are zero instead of doing a read-modify-write for their Destination Field bits only. Otherwise, on machines based on Apollo Lake and its derivatives such as Denverton, typically some of the previously preserved bits remain set after boot when not employing interrupt remapping. The result is that INTx interrupts are not getting delivered. Note: With an AMD IOMMU, interrupt remapping apparently bypasses the IO APIC altogether. Submitted by: loos (modulo comment) Reviewed by: jhb (modulo comment) Modified: head/sys/x86/x86/io_apic.c Modified: head/sys/x86/x86/io_apic.c ============================================================================== --- head/sys/x86/x86/io_apic.c Thu Dec 28 21:35:53 2017 (r327313) +++ head/sys/x86/x86/io_apic.c Thu Dec 28 21:46:09 2017 (r327314) @@ -308,7 +308,7 @@ static void ioapic_program_intpin(struct ioapic_intsrc *intpin) { struct ioapic *io = (struct ioapic *)intpin->io_intsrc.is_pic; - uint32_t low, high, value; + uint32_t low, high; #ifdef ACPI_DMAR int error; #endif @@ -354,7 +354,11 @@ ioapic_program_intpin(struct ioapic_intsrc *intpin) } #endif - /* Set the destination. */ + /* + * Set the destination. Note that with Intel interrupt remapping, + * the previously reserved bits 55:48 now have a purpose so ensure + * these are zero. + */ low = IOART_DESTPHY; high = intpin->io_cpu << APIC_ID_SHIFT; @@ -392,10 +396,7 @@ ioapic_program_intpin(struct ioapic_intsrc *intpin) } /* Write the values to the APIC. */ - value = ioapic_read(io->io_addr, IOAPIC_REDTBL_HI(intpin->io_intpin)); - value &= ~IOART_DEST; - value |= high; - ioapic_write(io->io_addr, IOAPIC_REDTBL_HI(intpin->io_intpin), value); + ioapic_write(io->io_addr, IOAPIC_REDTBL_HI(intpin->io_intpin), high); intpin->io_lowreg = low; ioapic_write(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin), low); } From owner-svn-src-all@freebsd.org Thu Dec 28 22:03:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 567E8E8390E; Thu, 28 Dec 2017 22:03:10 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 20B636E494; Thu, 28 Dec 2017 22:03:10 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBSM39hQ041837; Thu, 28 Dec 2017 22:03:09 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBSM39LF041836; Thu, 28 Dec 2017 22:03:09 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201712282203.vBSM39LF041836@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Thu, 28 Dec 2017 22:03:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327315 - head/sys/dev/sdhci X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/sys/dev/sdhci X-SVN-Commit-Revision: 327315 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 22:03:10 -0000 Author: marius Date: Thu Dec 28 22:03:08 2017 New Revision: 327315 URL: https://svnweb.freebsd.org/changeset/base/327315 Log: Probe Intel Denverton eMMC 5.0 controllers. Modified: head/sys/dev/sdhci/sdhci_pci.c Modified: head/sys/dev/sdhci/sdhci_pci.c ============================================================================== --- head/sys/dev/sdhci/sdhci_pci.c Thu Dec 28 21:46:09 2017 (r327314) +++ head/sys/dev/sdhci/sdhci_pci.c Thu Dec 28 22:03:08 2017 (r327315) @@ -122,6 +122,12 @@ static const struct sdhci_device { SDHCI_QUIRK_MMC_DDR52 | SDHCI_QUIRK_CAPS_BIT63_FOR_MMC_HS400 | SDHCI_QUIRK_PRESET_VALUE_BROKEN }, + { 0x19db8086, 0xffff, "Intel Denverton eMMC 5.0 Controller", + SDHCI_QUIRK_INTEL_POWER_UP_RESET | + SDHCI_QUIRK_WAIT_WHILE_BUSY | + SDHCI_QUIRK_MMC_DDR52 | + SDHCI_QUIRK_CAPS_BIT63_FOR_MMC_HS400 | + SDHCI_QUIRK_PRESET_VALUE_BROKEN }, { 0x22948086, 0xffff, "Intel Braswell eMMC 4.5.1 Controller", SDHCI_QUIRK_DATA_TIMEOUT_1MHZ | SDHCI_QUIRK_INTEL_POWER_UP_RESET | From owner-svn-src-all@freebsd.org Thu Dec 28 22:56:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50D95E8627B; Thu, 28 Dec 2017 22:56:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 19C906FD6B; Thu, 28 Dec 2017 22:56:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBSMuVop062845; Thu, 28 Dec 2017 22:56:31 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBSMuVpr062844; Thu, 28 Dec 2017 22:56:31 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201712282256.vBSMuVpr062844@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 28 Dec 2017 22:56:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327316 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 327316 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 22:56:32 -0000 Author: kib Date: Thu Dec 28 22:56:30 2017 New Revision: 327316 URL: https://svnweb.freebsd.org/changeset/base/327316 Log: In vm_swapout_map_deactivate_pages(), it is enough to lock the map for read. Reviewed by: alc, markj (as part of the larger patch) Tested by: pho (again, as part of the larger patch) Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D13671 Modified: head/sys/vm/vm_swapout.c Modified: head/sys/vm/vm_swapout.c ============================================================================== --- head/sys/vm/vm_swapout.c Thu Dec 28 22:03:08 2017 (r327315) +++ head/sys/vm/vm_swapout.c Thu Dec 28 22:56:30 2017 (r327316) @@ -263,7 +263,7 @@ vm_swapout_map_deactivate_pages(vm_map_t map, long des vm_object_t obj, bigobj; int nothingwired; - if (!vm_map_trylock(map)) + if (!vm_map_trylock_read(map)) return; bigobj = NULL; @@ -327,7 +327,7 @@ vm_swapout_map_deactivate_pages(vm_map_t map, long des vm_map_max(map)); } - vm_map_unlock(map); + vm_map_unlock_read(map); } /* From owner-svn-src-all@freebsd.org Thu Dec 28 22:57:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89240E86398; Thu, 28 Dec 2017 22:57:36 +0000 (UTC) (envelope-from robak@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E2336FEF1; Thu, 28 Dec 2017 22:57:35 +0000 (UTC) (envelope-from robak@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBSMvZh4062924; Thu, 28 Dec 2017 22:57:35 GMT (envelope-from robak@FreeBSD.org) Received: (from robak@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBSMvZqR062921; Thu, 28 Dec 2017 22:57:35 GMT (envelope-from robak@FreeBSD.org) Message-Id: <201712282257.vBSMvZqR062921@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: robak set sender to robak@FreeBSD.org using -f From: Bartek Rutkowski Date: Thu, 28 Dec 2017 22:57:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327317 - in head/lib/libutil: . tests X-SVN-Group: head X-SVN-Commit-Author: robak X-SVN-Commit-Paths: in head/lib/libutil: . tests X-SVN-Commit-Revision: 327317 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 22:57:36 -0000 Author: robak (ports committer) Date: Thu Dec 28 22:57:34 2017 New Revision: 327317 URL: https://svnweb.freebsd.org/changeset/base/327317 Log: humanize_number(3): fix math edge case in rounding large numbers Fix for remainder overflow, when in rare cases adding remainder to divider exceeded 1 and turned the total to 1000 in final formatting, taking up the space for the unit character. The fix continues the division of the original number if the above case happens -- added the appropriate check to the for loop performing the division. This lowers the value shown, to make it fit into the buffer space provided (1.0M for 4+1 character buffer, as used by ls). Add test case for the reported bug and extend test program to support providing buffer length (ls -lh uses 5, tests hard-coded 4). PR: 224498 Submitted by: Pawel Biernacki Reported by: Masachika Ishizuka Reviewed by: cem, kib Approved by: cem, kib MFC after: 1 week Sponsored by: Mysterious Code Ltd. Differential Revision: D13578 Modified: head/lib/libutil/humanize_number.3 head/lib/libutil/humanize_number.c head/lib/libutil/tests/humanize_number_test.c Modified: head/lib/libutil/humanize_number.3 ============================================================================== --- head/lib/libutil/humanize_number.3 Thu Dec 28 22:56:30 2017 (r327316) +++ head/lib/libutil/humanize_number.3 Thu Dec 28 22:57:34 2017 (r327317) @@ -200,3 +200,9 @@ The .Dv HN_IEC_PREFIXES flag was introduced in .Fx 9.0 . +.Sh CAVEATS +For numbers greater than 999 using buffer length of 4 and less can cause +rounding errors. +When using +.Dv HN_IEC_PREFIXES +the same error occurs for buffer length of 5 or less. Modified: head/lib/libutil/humanize_number.c ============================================================================== --- head/lib/libutil/humanize_number.c Thu Dec 28 22:56:30 2017 (r327316) +++ head/lib/libutil/humanize_number.c Thu Dec 28 22:57:34 2017 (r327317) @@ -145,7 +145,8 @@ humanize_number(char *buf, size_t len, int64_t quotien */ for (i = 0; (quotient >= max || (quotient == max - 1 && - remainder >= divisordeccut)) && i < maxscale; i++) { + (remainder >= divisordeccut || remainder >= + divisor / 2))) && i < maxscale; i++) { remainder = quotient % divisor; quotient /= divisor; } Modified: head/lib/libutil/tests/humanize_number_test.c ============================================================================== --- head/lib/libutil/tests/humanize_number_test.c Thu Dec 28 22:56:30 2017 (r327316) +++ head/lib/libutil/tests/humanize_number_test.c Thu Dec 28 22:57:34 2017 (r327317) @@ -49,333 +49,337 @@ static struct { int64_t num; int flags; int scale; + size_t buflen; } test_args[] = { /* tests 0-13 test 1000 suffixes */ - { 2, "0 ", (int64_t)0L, HN_DIVISOR_1000, HN_AUTOSCALE }, - { 3, "1 k", (int64_t)500L, HN_DIVISOR_1000, HN_AUTOSCALE }, - { 3, "1 M", (int64_t)500*1000L, HN_DIVISOR_1000, HN_AUTOSCALE }, - { 3, "1 G", (int64_t)500*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE }, - { 3, "1 T", (int64_t)500*1000*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE }, - { 3, "1 P", (int64_t)500*1000*1000*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE }, - { 3, "1 E", (int64_t)500*1000*1000*1000*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE }, - { 2, "1 ", (int64_t)1L, HN_DIVISOR_1000, HN_AUTOSCALE }, - { 3, "2 k", (int64_t)1500L, HN_DIVISOR_1000, HN_AUTOSCALE }, - { 3, "2 M", (int64_t)1500*1000L, HN_DIVISOR_1000, HN_AUTOSCALE }, - { 3, "2 G", (int64_t)1500*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE }, - { 3, "2 T", (int64_t)1500*1000*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE }, - { 3, "2 P", (int64_t)1500*1000*1000*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE }, - { 3, "2 E", (int64_t)1500*1000*1000*1000*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE }, + { 2, "0 ", (int64_t)0L, HN_DIVISOR_1000, HN_AUTOSCALE, 4 }, + { 3, "1 k", (int64_t)500L, HN_DIVISOR_1000, HN_AUTOSCALE, 4 }, + { 3, "1 M", (int64_t)500*1000L, HN_DIVISOR_1000, HN_AUTOSCALE, 4 }, + { 3, "1 G", (int64_t)500*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE, 4 }, + { 3, "1 T", (int64_t)500*1000*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE, 4 }, + { 3, "1 P", (int64_t)500*1000*1000*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE, 4 }, + { 3, "1 E", (int64_t)500*1000*1000*1000*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE, 4 }, + { 2, "1 ", (int64_t)1L, HN_DIVISOR_1000, HN_AUTOSCALE, 4 }, + { 3, "2 k", (int64_t)1500L, HN_DIVISOR_1000, HN_AUTOSCALE, 4 }, + { 3, "2 M", (int64_t)1500*1000L, HN_DIVISOR_1000, HN_AUTOSCALE, 4 }, + { 3, "2 G", (int64_t)1500*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE, 4 }, + { 3, "2 T", (int64_t)1500*1000*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE, 4 }, + { 3, "2 P", (int64_t)1500*1000*1000*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE, 4 }, + { 3, "2 E", (int64_t)1500*1000*1000*1000*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE, 4 }, /* tests 14-27 test 1024 suffixes */ - { 2, "0 ", (int64_t)0L, 0, HN_AUTOSCALE }, - { 3, "1 K", (int64_t)512L, 0, HN_AUTOSCALE }, - { 3, "1 M", (int64_t)512*1024L, 0, HN_AUTOSCALE }, - { 3, "1 G", (int64_t)512*1024*1024L, 0, HN_AUTOSCALE }, - { 3, "1 T", (int64_t)512*1024*1024*1024L, 0, HN_AUTOSCALE }, - { 3, "1 P", (int64_t)512*1024*1024*1024*1024L, 0, HN_AUTOSCALE }, - { 3, "1 E", (int64_t)512*1024*1024*1024*1024*1024L, 0, HN_AUTOSCALE }, - { 2, "1 ", (int64_t)1L, 0, HN_AUTOSCALE }, - { 3, "2 K", (int64_t)1536L, 0, HN_AUTOSCALE }, - { 3, "2 M", (int64_t)1536*1024L, 0, HN_AUTOSCALE }, - { 3, "2 G", (int64_t)1536*1024*1024L, 0, HN_AUTOSCALE }, - { 3, "2 T", (int64_t)1536*1024*1024*1024L, 0, HN_AUTOSCALE }, - { 3, "2 P", (int64_t)1536*1024*1024*1024*1024L, 0, HN_AUTOSCALE }, - { 3, "2 E", (int64_t)1536*1024*1024*1024*1024*1024L, 0, HN_AUTOSCALE }, + { 2, "0 ", (int64_t)0L, 0, HN_AUTOSCALE, 4 }, + { 3, "1 K", (int64_t)512L, 0, HN_AUTOSCALE, 4 }, + { 3, "1 M", (int64_t)512*1024L, 0, HN_AUTOSCALE, 4 }, + { 3, "1 G", (int64_t)512*1024*1024L, 0, HN_AUTOSCALE, 4 }, + { 3, "1 T", (int64_t)512*1024*1024*1024L, 0, HN_AUTOSCALE, 4 }, + { 3, "1 P", (int64_t)512*1024*1024*1024*1024L, 0, HN_AUTOSCALE, 4 }, + { 3, "1 E", (int64_t)512*1024*1024*1024*1024*1024L, 0, HN_AUTOSCALE, 4 }, + { 2, "1 ", (int64_t)1L, 0, HN_AUTOSCALE, 4 }, + { 3, "2 K", (int64_t)1536L, 0, HN_AUTOSCALE, 4 }, + { 3, "2 M", (int64_t)1536*1024L, 0, HN_AUTOSCALE, 4 }, + { 3, "2 G", (int64_t)1536*1024*1024L, 0, HN_AUTOSCALE, 4 }, + { 3, "2 T", (int64_t)1536*1024*1024*1024L, 0, HN_AUTOSCALE, 4 }, + { 3, "2 P", (int64_t)1536*1024*1024*1024*1024L, 0, HN_AUTOSCALE, 4 }, + { 3, "2 E", (int64_t)1536*1024*1024*1024*1024*1024L, 0, HN_AUTOSCALE, 4 }, /* tests 28-37 test rounding */ - { 3, "0 M", (int64_t)500*1000L-1, HN_DIVISOR_1000, HN_AUTOSCALE }, - { 3, "1 M", (int64_t)500*1000L, HN_DIVISOR_1000, HN_AUTOSCALE }, - { 3, "1 M", (int64_t)1000*1000L + 500*1000L-1, HN_DIVISOR_1000, HN_AUTOSCALE }, - { 3, "2 M", (int64_t)1000*1000L + 500*1000L, HN_DIVISOR_1000, HN_AUTOSCALE }, - { 3, "0 K", (int64_t)512L-1, 0, HN_AUTOSCALE }, - { 3, "1 K", (int64_t)512L, 0, HN_AUTOSCALE }, - { 3, "0 M", (int64_t)512*1024L-1, 0, HN_AUTOSCALE }, - { 3, "1 M", (int64_t)512*1024L, 0, HN_AUTOSCALE }, - { 3, "1 M", (int64_t)1024*1024L + 512*1024L-1, 0, HN_AUTOSCALE }, - { 3, "2 M", (int64_t)1024*1024L + 512*1024L, 0, HN_AUTOSCALE }, + { 3, "0 M", (int64_t)500*1000L-1, HN_DIVISOR_1000, HN_AUTOSCALE, 4 }, + { 3, "1 M", (int64_t)500*1000L, HN_DIVISOR_1000, HN_AUTOSCALE, 4 }, + { 3, "1 M", (int64_t)1000*1000L + 500*1000L-1, HN_DIVISOR_1000, HN_AUTOSCALE, 4 }, + { 3, "2 M", (int64_t)1000*1000L + 500*1000L, HN_DIVISOR_1000, HN_AUTOSCALE, 4 }, + { 3, "0 K", (int64_t)512L-1, 0, HN_AUTOSCALE, 4 }, + { 3, "1 K", (int64_t)512L, 0, HN_AUTOSCALE, 4 }, + { 3, "0 M", (int64_t)512*1024L-1, 0, HN_AUTOSCALE, 4 }, + { 3, "1 M", (int64_t)512*1024L, 0, HN_AUTOSCALE, 4 }, + { 3, "1 M", (int64_t)1024*1024L + 512*1024L-1, 0, HN_AUTOSCALE, 4 }, + { 3, "2 M", (int64_t)1024*1024L + 512*1024L, 0, HN_AUTOSCALE, 4 }, /* tests 38-61 test specific scale factors with 1000 divisor */ - { 3, "0 k", (int64_t)0L, HN_DIVISOR_1000, 1 }, - { 3, "1 k", (int64_t)500L, HN_DIVISOR_1000, 1 }, - { 3, "0 M", (int64_t)500L, HN_DIVISOR_1000, 2 }, - { 3, "1 M", (int64_t)500*1000L, HN_DIVISOR_1000, 2 }, - { 3, "0 G", (int64_t)500*1000L, HN_DIVISOR_1000, 3 }, - { 3, "1 G", (int64_t)500*1000*1000L, HN_DIVISOR_1000, 3 }, - { 3, "0 T", (int64_t)500*1000*1000L, HN_DIVISOR_1000, 4 }, - { 3, "1 T", (int64_t)500*1000*1000*1000L, HN_DIVISOR_1000, 4 }, - { 3, "0 P", (int64_t)500*1000*1000*1000L, HN_DIVISOR_1000, 5 }, - { 3, "1 P", (int64_t)500*1000*1000*1000*1000L, HN_DIVISOR_1000, 5 }, - { 3, "0 E", (int64_t)500*1000*1000*1000*1000L, HN_DIVISOR_1000, 6 }, - { 3, "1 E", (int64_t)500*1000*1000*1000*1000*1000L, HN_DIVISOR_1000, 6 }, - { 3, "0 k", (int64_t)1L, HN_DIVISOR_1000, 1 }, - { 3, "2 k", (int64_t)1500L, HN_DIVISOR_1000, 1 }, - { 3, "0 M", (int64_t)1500L, HN_DIVISOR_1000, 2 }, - { 3, "2 M", (int64_t)1500*1000L, HN_DIVISOR_1000, 2 }, - { 3, "0 G", (int64_t)1500*1000L, HN_DIVISOR_1000, 3 }, - { 3, "2 G", (int64_t)1500*1000*1000L, HN_DIVISOR_1000, 3 }, - { 3, "0 T", (int64_t)1500*1000*1000L, HN_DIVISOR_1000, 4 }, - { 3, "2 T", (int64_t)1500*1000*1000*1000L, HN_DIVISOR_1000, 4 }, - { 3, "0 P", (int64_t)1500*1000*1000*1000L, HN_DIVISOR_1000, 5 }, - { 3, "2 P", (int64_t)1500*1000*1000*1000*1000L, HN_DIVISOR_1000, 5 }, - { 3, "0 E", (int64_t)1500*1000*1000*1000*1000L, HN_DIVISOR_1000, 6 }, - { 3, "2 E", (int64_t)1500*1000*1000*1000*1000*1000L, HN_DIVISOR_1000, 6 }, + { 3, "0 k", (int64_t)0L, HN_DIVISOR_1000, 1, 4 }, + { 3, "1 k", (int64_t)500L, HN_DIVISOR_1000, 1, 4 }, + { 3, "0 M", (int64_t)500L, HN_DIVISOR_1000, 2, 4 }, + { 3, "1 M", (int64_t)500*1000L, HN_DIVISOR_1000, 2, 4 }, + { 3, "0 G", (int64_t)500*1000L, HN_DIVISOR_1000, 3, 4 }, + { 3, "1 G", (int64_t)500*1000*1000L, HN_DIVISOR_1000, 3, 4 }, + { 3, "0 T", (int64_t)500*1000*1000L, HN_DIVISOR_1000, 4, 4 }, + { 3, "1 T", (int64_t)500*1000*1000*1000L, HN_DIVISOR_1000, 4, 4 }, + { 3, "0 P", (int64_t)500*1000*1000*1000L, HN_DIVISOR_1000, 5, 4 }, + { 3, "1 P", (int64_t)500*1000*1000*1000*1000L, HN_DIVISOR_1000, 5, 4 }, + { 3, "0 E", (int64_t)500*1000*1000*1000*1000L, HN_DIVISOR_1000, 6, 4 }, + { 3, "1 E", (int64_t)500*1000*1000*1000*1000*1000L, HN_DIVISOR_1000, 6, 4 }, + { 3, "0 k", (int64_t)1L, HN_DIVISOR_1000, 1, 4 }, + { 3, "2 k", (int64_t)1500L, HN_DIVISOR_1000, 1, 4 }, + { 3, "0 M", (int64_t)1500L, HN_DIVISOR_1000, 2, 4 }, + { 3, "2 M", (int64_t)1500*1000L, HN_DIVISOR_1000, 2, 4 }, + { 3, "0 G", (int64_t)1500*1000L, HN_DIVISOR_1000, 3, 4 }, + { 3, "2 G", (int64_t)1500*1000*1000L, HN_DIVISOR_1000, 3, 4 }, + { 3, "0 T", (int64_t)1500*1000*1000L, HN_DIVISOR_1000, 4, 4 }, + { 3, "2 T", (int64_t)1500*1000*1000*1000L, HN_DIVISOR_1000, 4, 4 }, + { 3, "0 P", (int64_t)1500*1000*1000*1000L, HN_DIVISOR_1000, 5, 4 }, + { 3, "2 P", (int64_t)1500*1000*1000*1000*1000L, HN_DIVISOR_1000, 5, 4 }, + { 3, "0 E", (int64_t)1500*1000*1000*1000*1000L, HN_DIVISOR_1000, 6, 4 }, + { 3, "2 E", (int64_t)1500*1000*1000*1000*1000*1000L, HN_DIVISOR_1000, 6, 4 }, /* tests 62-85 test specific scale factors with 1024 divisor */ - { 3, "0 K", (int64_t)0L, 0, 1 }, - { 3, "1 K", (int64_t)512L, 0, 1 }, - { 3, "0 M", (int64_t)512L, 0, 2 }, - { 3, "1 M", (int64_t)512*1024L, 0, 2 }, - { 3, "0 G", (int64_t)512*1024L, 0, 3 }, - { 3, "1 G", (int64_t)512*1024*1024L, 0, 3 }, - { 3, "0 T", (int64_t)512*1024*1024L, 0, 4 }, - { 3, "1 T", (int64_t)512*1024*1024*1024L, 0, 4 }, - { 3, "0 P", (int64_t)512*1024*1024*1024L, 0, 5 }, - { 3, "1 P", (int64_t)512*1024*1024*1024*1024L, 0, 5 }, - { 3, "0 E", (int64_t)512*1024*1024*1024*1024L, 0, 6 }, - { 3, "1 E", (int64_t)512*1024*1024*1024*1024*1024L, 0, 6 }, - { 3, "0 K", (int64_t)1L, 0, 1 }, - { 3, "2 K", (int64_t)1536L, 0, 1 }, - { 3, "0 M", (int64_t)1536L, 0, 2 }, - { 3, "2 M", (int64_t)1536*1024L, 0, 2 }, - { 3, "0 G", (int64_t)1536*1024L, 0, 3 }, - { 3, "2 G", (int64_t)1536*1024*1024L, 0, 3 }, - { 3, "0 T", (int64_t)1536*1024*1024L, 0, 4 }, - { 3, "2 T", (int64_t)1536*1024*1024*1024L, 0, 4 }, - { 3, "0 P", (int64_t)1536*1024*1024*1024L, 0, 5 }, - { 3, "2 P", (int64_t)1536*1024*1024*1024*1024L, 0, 5 }, - { 3, "0 E", (int64_t)1536*1024*1024*1024*1024L, 0, 6 }, - { 3, "2 E", (int64_t)1536*1024*1024*1024*1024*1024L, 0, 6 }, + { 3, "0 K", (int64_t)0L, 0, 1, 4 }, + { 3, "1 K", (int64_t)512L, 0, 1, 4 }, + { 3, "0 M", (int64_t)512L, 0, 2, 4 }, + { 3, "1 M", (int64_t)512*1024L, 0, 2, 4 }, + { 3, "0 G", (int64_t)512*1024L, 0, 3, 4 }, + { 3, "1 G", (int64_t)512*1024*1024L, 0, 3, 4 }, + { 3, "0 T", (int64_t)512*1024*1024L, 0, 4, 4 }, + { 3, "1 T", (int64_t)512*1024*1024*1024L, 0, 4, 4 }, + { 3, "0 P", (int64_t)512*1024*1024*1024L, 0, 5, 4 }, + { 3, "1 P", (int64_t)512*1024*1024*1024*1024L, 0, 5, 4 }, + { 3, "0 E", (int64_t)512*1024*1024*1024*1024L, 0, 6, 4 }, + { 3, "1 E", (int64_t)512*1024*1024*1024*1024*1024L, 0, 6, 4 }, + { 3, "0 K", (int64_t)1L, 0, 1, 4 }, + { 3, "2 K", (int64_t)1536L, 0, 1, 4 }, + { 3, "0 M", (int64_t)1536L, 0, 2, 4 }, + { 3, "2 M", (int64_t)1536*1024L, 0, 2, 4 }, + { 3, "0 G", (int64_t)1536*1024L, 0, 3, 4 }, + { 3, "2 G", (int64_t)1536*1024*1024L, 0, 3, 4 }, + { 3, "0 T", (int64_t)1536*1024*1024L, 0, 4, 4 }, + { 3, "2 T", (int64_t)1536*1024*1024*1024L, 0, 4, 4 }, + { 3, "0 P", (int64_t)1536*1024*1024*1024L, 0, 5, 4 }, + { 3, "2 P", (int64_t)1536*1024*1024*1024*1024L, 0, 5, 4 }, + { 3, "0 E", (int64_t)1536*1024*1024*1024*1024L, 0, 6, 4 }, + { 3, "2 E", (int64_t)1536*1024*1024*1024*1024*1024L, 0, 6, 4 }, /* tests 86-99 test invalid specific scale values of < 0 or >= 7 with and without HN_DIVISOR_1000 set */ /* all should return errors with new code; with old, the latter 3 are instead processed as if having AUTOSCALE and/or GETSCALE set */ - { -1, "", (int64_t)1L, 0, 7 }, - { -1, "", (int64_t)1L, HN_DIVISOR_1000, 7 }, - { -1, "", (int64_t)1L, 0, 1000 }, - { -1, "", (int64_t)1L, HN_DIVISOR_1000, 1000 }, - { -1, "", (int64_t)0L, 0, 1000*1000 }, - { -1, "", (int64_t)0L, HN_DIVISOR_1000, 1000*1000 }, - { -1, "", (int64_t)0L, 0, INT_MAX }, - { -1, "", (int64_t)0L, HN_DIVISOR_1000, INT_MAX }, + { -1, "", (int64_t)1L, 0, 7, 4 }, + { -1, "", (int64_t)1L, HN_DIVISOR_1000, 7, 4 }, + { -1, "", (int64_t)1L, 0, 1000, 4 }, + { -1, "", (int64_t)1L, HN_DIVISOR_1000, 1000, 4 }, + { -1, "", (int64_t)0L, 0, 1000*1000, 4 }, + { -1, "", (int64_t)0L, HN_DIVISOR_1000, 1000*1000, 4 }, + { -1, "", (int64_t)0L, 0, INT_MAX, 4 }, + { -1, "", (int64_t)0L, HN_DIVISOR_1000, INT_MAX, 4 }, /* Negative scale values are not handled well by the existing library routine - should report as error */ /* all should return errors with new code, fail assertion with old */ - { -1, "", (int64_t)1L, 0, -1 }, - { -1, "", (int64_t)1L, HN_DIVISOR_1000, -1 }, - { -1, "", (int64_t)1L, 0, -1000 }, - { -1, "", (int64_t)1L, HN_DIVISOR_1000, -1000 }, + { -1, "", (int64_t)1L, 0, -1, 4 }, + { -1, "", (int64_t)1L, HN_DIVISOR_1000, -1, 4 }, + { -1, "", (int64_t)1L, 0, -1000, 4 }, + { -1, "", (int64_t)1L, HN_DIVISOR_1000, -1000, 4 }, /* __INT_MIN doesn't print properly, skipped. */ - { -1, "", (int64_t)1L, 0, -__INT_MAX }, - { -1, "", (int64_t)1L, HN_DIVISOR_1000, -__INT_MAX }, + { -1, "", (int64_t)1L, 0, -__INT_MAX, 4 }, + { -1, "", (int64_t)1L, HN_DIVISOR_1000, -__INT_MAX, 4 }, /* tests for scale == 0, without autoscale */ /* tests 100-114 test scale 0 with 1000 divisor - print first N digits */ - { 2, "0 ", (int64_t)0L, HN_DIVISOR_1000, 0 }, - { 2, "1 ", (int64_t)1L, HN_DIVISOR_1000, 0 }, - { 3, "10 ", (int64_t)10L, HN_DIVISOR_1000, 0 }, - { 3, "0 M", (int64_t)150L, HN_DIVISOR_1000, HN_NOSPACE }, - { 3, "0 M", (int64_t)500L, HN_DIVISOR_1000, HN_NOSPACE }, - { 3, "0 M", (int64_t)999L, HN_DIVISOR_1000, HN_NOSPACE }, - { 4, "150", (int64_t)150L, HN_DIVISOR_1000, 0 }, - { 4, "500", (int64_t)500L, HN_DIVISOR_1000, 0 }, - { 4, "999", (int64_t)999L, HN_DIVISOR_1000, 0 }, - { 5, "100", (int64_t)1000L, HN_DIVISOR_1000, 0 }, - { 5, "150", (int64_t)1500L, HN_DIVISOR_1000, 0 }, - { 7, "500", (int64_t)500*1000L, HN_DIVISOR_1000, 0 }, - { 8, "150", (int64_t)1500*1000L, HN_DIVISOR_1000, 0 }, - { 10, "500", (int64_t)500*1000*1000L, HN_DIVISOR_1000, 0 }, - { 11, "150", (int64_t)1500*1000*1000L, HN_DIVISOR_1000, 0 }, + { 2, "0 ", (int64_t)0L, HN_DIVISOR_1000, 0, 4 }, + { 2, "1 ", (int64_t)1L, HN_DIVISOR_1000, 0, 4 }, + { 3, "10 ", (int64_t)10L, HN_DIVISOR_1000, 0, 4 }, + { 3, "0 M", (int64_t)150L, HN_DIVISOR_1000, HN_NOSPACE, 4 }, + { 3, "0 M", (int64_t)500L, HN_DIVISOR_1000, HN_NOSPACE, 4 }, + { 3, "0 M", (int64_t)999L, HN_DIVISOR_1000, HN_NOSPACE, 4 }, + { 4, "150", (int64_t)150L, HN_DIVISOR_1000, 0, 4 }, + { 4, "500", (int64_t)500L, HN_DIVISOR_1000, 0, 4 }, + { 4, "999", (int64_t)999L, HN_DIVISOR_1000, 0, 4 }, + { 5, "100", (int64_t)1000L, HN_DIVISOR_1000, 0, 4 }, + { 5, "150", (int64_t)1500L, HN_DIVISOR_1000, 0, 4 }, + { 7, "500", (int64_t)500*1000L, HN_DIVISOR_1000, 0, 4 }, + { 8, "150", (int64_t)1500*1000L, HN_DIVISOR_1000, 0, 4 }, + { 10, "500", (int64_t)500*1000*1000L, HN_DIVISOR_1000, 0, 4 }, + { 11, "150", (int64_t)1500*1000*1000L, HN_DIVISOR_1000, 0, 4 }, /* tests 115-126 test scale 0 with 1024 divisor - print first N digits */ - { 2, "0 ", (int64_t)0L, 0, 0 }, - { 2, "1 ", (int64_t)1L, 0, 0 }, - { 3, "10 ", (int64_t)10L, 0, 0 }, - { 4, "150", (int64_t)150L, 0, 0 }, - { 4, "500", (int64_t)500L, 0, 0 }, - { 4, "999", (int64_t)999L, 0, 0 }, - { 5, "100", (int64_t)1000L, 0, 0 }, - { 5, "150", (int64_t)1500L, 0, 0 }, - { 7, "500", (int64_t)500*1000L, 0, 0 }, - { 8, "150", (int64_t)1500*1000L, 0, 0 }, - { 10, "500", (int64_t)500*1000*1000L, 0, 0 }, - { 11, "150", (int64_t)1500*1000*1000L, 0, 0 }, + { 2, "0 ", (int64_t)0L, 0, 0, 4 }, + { 2, "1 ", (int64_t)1L, 0, 0, 4 }, + { 3, "10 ", (int64_t)10L, 0, 0, 4 }, + { 4, "150", (int64_t)150L, 0, 0, 4 }, + { 4, "500", (int64_t)500L, 0, 0, 4 }, + { 4, "999", (int64_t)999L, 0, 0, 4 }, + { 5, "100", (int64_t)1000L, 0, 0, 4 }, + { 5, "150", (int64_t)1500L, 0, 0, 4 }, + { 7, "500", (int64_t)500*1000L, 0, 0, 4 }, + { 8, "150", (int64_t)1500*1000L, 0, 0, 4 }, + { 10, "500", (int64_t)500*1000*1000L, 0, 0, 4 }, + { 11, "150", (int64_t)1500*1000*1000L, 0, 0, 4 }, + /* Test case for rounding of edge numbers around 999.5+, see PR224498. + * Require buflen >= 5 */ + { 4, "1.0M", (int64_t)1023500, HN_DECIMAL|HN_B|HN_NOSPACE, HN_AUTOSCALE, 5 }, + /* Test boundary cases for very large positive/negative number formatting */ /* Explicit scale, divisor 1024 */ - /* XXX = requires length 5 (buflen 6) for some cases*/ - /* KLUDGE - test loop below will bump length 5 up to 5 */ - { 3, "8 E", INT64_MAX, 0, 6 }, - { 4, "-8 E", -INT64_MAX, 0, 6 }, - { 3, "0 E", (int64_t)92*1024*1024*1024*1024*1024L, 0, 6 }, - { 3, "0 E", -(int64_t)92*1024*1024*1024*1024*1024L, 0, 6 }, - { 3, "0 E", (int64_t)82*1024*1024*1024*1024*1024L, 0, 6 }, - { 3, "0 E", -(int64_t)82*1024*1024*1024*1024*1024L, 0, 6 }, - { 3, "0 E", (int64_t)81*1024*1024*1024*1024*1024L, 0, 6 }, - { 3, "0 E", -(int64_t)81*1024*1024*1024*1024*1024L, 0, 6 }, - { 4, "92 P", (int64_t)92*1024*1024*1024*1024*1024L, 0, 5 }, - { 5, "-92 P", -(int64_t)92*1024*1024*1024*1024*1024L, 0, 5 }, - { 4, "82 P", (int64_t)82*1024*1024*1024*1024*1024L, 0, 5 }, - { 5, "-82 P", -(int64_t)82*1024*1024*1024*1024*1024L, 0, 5 }, - { 4, "81 P", (int64_t)81*1024*1024*1024*1024*1024L, 0, 5 }, - { 5, "-81 P", -(int64_t)81*1024*1024*1024*1024*1024L, 0, 5 }, + /* Requires buflen >= 6 */ + { 3, "8 E", INT64_MAX, 0, 6, 6 }, + { 4, "-8 E", -INT64_MAX, 0, 6, 6 }, + { 3, "0 E", (int64_t)92*1024*1024*1024*1024*1024L, 0, 6, 6 }, + { 3, "0 E", -(int64_t)92*1024*1024*1024*1024*1024L, 0, 6, 6 }, + { 3, "0 E", (int64_t)82*1024*1024*1024*1024*1024L, 0, 6, 6 }, + { 3, "0 E", -(int64_t)82*1024*1024*1024*1024*1024L, 0, 6, 6 }, + { 3, "0 E", (int64_t)81*1024*1024*1024*1024*1024L, 0, 6, 6 }, + { 3, "0 E", -(int64_t)81*1024*1024*1024*1024*1024L, 0, 6, 6 }, + { 4, "92 P", (int64_t)92*1024*1024*1024*1024*1024L, 0, 5, 6 }, + { 5, "-92 P", -(int64_t)92*1024*1024*1024*1024*1024L, 0, 5, 6 }, + { 4, "82 P", (int64_t)82*1024*1024*1024*1024*1024L, 0, 5, 6 }, + { 5, "-82 P", -(int64_t)82*1024*1024*1024*1024*1024L, 0, 5, 6 }, + { 4, "81 P", (int64_t)81*1024*1024*1024*1024*1024L, 0, 5, 6 }, + { 5, "-81 P", -(int64_t)81*1024*1024*1024*1024*1024L, 0, 5, 6 }, /* Explicit scale, divisor 1000 */ - { 3, "9 E", INT64_MAX, HN_DIVISOR_1000, 6 }, - { 4, "-9 E", -INT64_MAX, HN_DIVISOR_1000, 6 }, - { 3, "0 E", (int64_t)82*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, 6 }, - { 3, "0 E", -(int64_t)82*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, 6 }, - { 3, "0 E", (int64_t)82*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, 6 }, - { 3, "0 E", -(int64_t)82*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, 6 }, - { 4, "92 P", (int64_t)82*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, 5 }, - { 5, "-92 P", -(int64_t)82*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, 5 }, - { 4, "91 P", (int64_t)81*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, 5 }, - { 5, "-91 P", -(int64_t)81*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, 5 }, + { 3, "9 E", INT64_MAX, HN_DIVISOR_1000, 6, 6 }, + { 4, "-9 E", -INT64_MAX, HN_DIVISOR_1000, 6, 6 }, + { 3, "0 E", (int64_t)82*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, 6, 6 }, + { 3, "0 E", -(int64_t)82*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, 6, 6 }, + { 3, "0 E", (int64_t)82*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, 6, 6 }, + { 3, "0 E", -(int64_t)82*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, 6, 6 }, + { 4, "92 P", (int64_t)82*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, 5, 6 }, + { 5, "-92 P", -(int64_t)82*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, 5, 6 }, + { 4, "91 P", (int64_t)81*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, 5, 6 }, + { 5, "-91 P", -(int64_t)81*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, 5, 6 }, /* Autoscale, divisor 1024 */ - { 3, "8 E", INT64_MAX, 0, HN_AUTOSCALE }, - { 4, "-8 E", -INT64_MAX, 0, HN_AUTOSCALE }, - { 4, "92 P", (int64_t)92*1024*1024*1024*1024*1024L, 0, HN_AUTOSCALE }, - { 5, "-92 P", -(int64_t)92*1024*1024*1024*1024*1024L, 0, HN_AUTOSCALE }, - { 4, "82 P", (int64_t)82*1024*1024*1024*1024*1024L, 0, HN_AUTOSCALE }, - { 5, "-82 P", -(int64_t)82*1024*1024*1024*1024*1024L, 0, HN_AUTOSCALE }, - { 4, "81 P", (int64_t)81*1024*1024*1024*1024*1024L, 0, HN_AUTOSCALE }, - { 5, "-81 P", -(int64_t)81*1024*1024*1024*1024*1024L, 0, HN_AUTOSCALE }, + { 3, "8 E", INT64_MAX, 0, HN_AUTOSCALE, 6 }, + { 4, "-8 E", -INT64_MAX, 0, HN_AUTOSCALE, 6 }, + { 4, "92 P", (int64_t)92*1024*1024*1024*1024*1024L, 0, HN_AUTOSCALE, 6 }, + { 5, "-92 P", -(int64_t)92*1024*1024*1024*1024*1024L, 0, HN_AUTOSCALE, 6 }, + { 4, "82 P", (int64_t)82*1024*1024*1024*1024*1024L, 0, HN_AUTOSCALE, 6 }, + { 5, "-82 P", -(int64_t)82*1024*1024*1024*1024*1024L, 0, HN_AUTOSCALE, 6 }, + { 4, "81 P", (int64_t)81*1024*1024*1024*1024*1024L, 0, HN_AUTOSCALE, 6 }, + { 5, "-81 P", -(int64_t)81*1024*1024*1024*1024*1024L, 0, HN_AUTOSCALE, 6 }, /* Autoscale, divisor 1000 */ - { 3, "9 E", INT64_MAX, HN_DIVISOR_1000, HN_AUTOSCALE }, - { 4, "-9 E", -INT64_MAX, HN_DIVISOR_1000, HN_AUTOSCALE }, - { 4, "92 P", (int64_t)82*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, HN_AUTOSCALE }, - { 5, "-92 P", -(int64_t)82*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, HN_AUTOSCALE }, - { 4, "91 P", (int64_t)81*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, HN_AUTOSCALE }, - { 5, "-91 P", -(int64_t)81*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, HN_AUTOSCALE }, + { 3, "9 E", INT64_MAX, HN_DIVISOR_1000, HN_AUTOSCALE, 6 }, + { 4, "-9 E", -INT64_MAX, HN_DIVISOR_1000, HN_AUTOSCALE, 6 }, + { 4, "92 P", (int64_t)82*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, HN_AUTOSCALE, 6 }, + { 5, "-92 P", -(int64_t)82*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, HN_AUTOSCALE, 6 }, + { 4, "91 P", (int64_t)81*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, HN_AUTOSCALE, 6 }, + { 5, "-91 P", -(int64_t)81*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, HN_AUTOSCALE, 6 }, /* 0 scale, divisor 1024 */ - { 12, "skdj", INT64_MAX, 0, 0 }, - { 21, "-9223", -INT64_MAX, 0, 0 }, - { 19, "10358", (int64_t)92*1024*1024*1024*1024*1024L, 0, 0 }, - { 20, "-1035", -(int64_t)92*1024*1024*1024*1024*1024L, 0, 0 }, - { 18, "92323", (int64_t)82*1024*1024*1024*1024*1024L, 0, 0 }, - { 19, "-9232", -(int64_t)82*1024*1024*1024*1024*1024L, 0, 0 }, - { 18, "91197", (int64_t)81*1024*1024*1024*1024*1024L, 0, 0 }, - { 19, "-9119", -(int64_t)81*1024*1024*1024*1024*1024L, 0, 0 }, + { 12, "skdj", INT64_MAX, 0, 0, 6 }, + { 21, "-9223", -INT64_MAX, 0, 0, 6 }, + { 19, "10358", (int64_t)92*1024*1024*1024*1024*1024L, 0, 0, 6 }, + { 20, "-1035", -(int64_t)92*1024*1024*1024*1024*1024L, 0, 0, 6 }, + { 18, "92323", (int64_t)82*1024*1024*1024*1024*1024L, 0, 0, 6 }, + { 19, "-9232", -(int64_t)82*1024*1024*1024*1024*1024L, 0, 0, 6 }, + { 18, "91197", (int64_t)81*1024*1024*1024*1024*1024L, 0, 0, 6 }, + { 19, "-9119", -(int64_t)81*1024*1024*1024*1024*1024L, 0, 0, 6 }, /* 0 scale, divisor 1000 */ /* XXX - why does this fail? */ - { -1, "", INT64_MAX, HN_DIVISOR_1000, 0 }, - { 21, "-9223", -INT64_MAX, HN_DIVISOR_1000, 0 }, - { 19, "10358", (int64_t)92*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, 0 }, - { 20, "-1035", -(int64_t)92*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, 0 }, - { 18, "92323", (int64_t)82*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, 0 }, - { 19, "-9232", -(int64_t)82*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, 0 }, + { -1, "", INT64_MAX, HN_DIVISOR_1000, 0, 6 }, + { 21, "-9223", -INT64_MAX, HN_DIVISOR_1000, 0, 6 }, + { 19, "10358", (int64_t)92*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, 0, 6 }, + { 20, "-1035", -(int64_t)92*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, 0, 6 }, + { 18, "92323", (int64_t)82*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, 0, 6 }, + { 19, "-9232", -(int64_t)82*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, 0, 6 }, /* Expected to pass */ - { 18, "91197", (int64_t)81*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, 0 }, - { 19, "-9119", -(int64_t)81*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, 0 }, + { 18, "91197", (int64_t)81*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, 0, 6 }, + { 19, "-9119", -(int64_t)81*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, 0, 6 }, /* Need to implement tests for GETSCALE */ -/* { ?, "", (int64_t)0L, HN_DIVISOR_1000, HN_GETSCALE }, +/* { ?, "", (int64_t)0L, HN_DIVISOR_1000, HN_GETSCALE, 6 }, ... */ /* Tests for HN_DECIMAL */ /* Positive, Autoscale */ - { 5, "500 k", (int64_t)500*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE }, - { 5, "994 k", (int64_t)994*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE }, - { 5, "995 k", (int64_t)995*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE }, - { 5, "999 k", (int64_t)999*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE }, - { 5, "1.0 M", (int64_t)1000*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE }, - { 5, "1.5 M", (int64_t)1500*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE }, - { 5, "1.9 M", (int64_t)1949*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE }, - { 5, "2.0 M", (int64_t)1950*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE }, - { 5, "9.9 M", (int64_t)9949*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE }, - { 4, "10 M", (int64_t)9950*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE }, - { 5, "500 M", (int64_t)500*1000*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE }, - { 5, "994 M", (int64_t)994*1000*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE }, - { 5, "995 M", (int64_t)995*1000*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE }, - { 5, "999 M", (int64_t)999*1000*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE }, + { 5, "500 k", (int64_t)500*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE, 6 }, + { 5, "994 k", (int64_t)994*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE, 6 }, + { 5, "995 k", (int64_t)995*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE, 6 }, + { 5, "999 k", (int64_t)999*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE, 6 }, + { 5, "1.0 M", (int64_t)1000*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE, 6 }, + { 5, "1.5 M", (int64_t)1500*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE, 6 }, + { 5, "1.9 M", (int64_t)1949*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE, 6 }, + { 5, "2.0 M", (int64_t)1950*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE, 6 }, + { 5, "9.9 M", (int64_t)9949*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE, 6 }, + { 4, "10 M", (int64_t)9950*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE, 6 }, + { 5, "500 M", (int64_t)500*1000*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE, 6 }, + { 5, "994 M", (int64_t)994*1000*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE, 6 }, + { 5, "995 M", (int64_t)995*1000*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE, 6 }, + { 5, "999 M", (int64_t)999*1000*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE, 6 }, - { 5, "500 K", (int64_t)500*1024L, HN_DECIMAL, HN_AUTOSCALE }, - { 5, "994 K", (int64_t)994*1024L, HN_DECIMAL, HN_AUTOSCALE }, - { 5, "995 K", (int64_t)995*1024L, HN_DECIMAL, HN_AUTOSCALE }, - { 5, "999 K", (int64_t)999*1024L, HN_DECIMAL, HN_AUTOSCALE }, - { 5, "1.0 M", (int64_t)1000*1024L, HN_DECIMAL, HN_AUTOSCALE }, - { 5, "1.0 M", (int64_t)1018*1024L, HN_DECIMAL, HN_AUTOSCALE }, - { 5, "1.0 M", (int64_t)1019*1024L, HN_DECIMAL, HN_AUTOSCALE }, - { 5, "1.5 M", (int64_t)1536*1024L, HN_DECIMAL, HN_AUTOSCALE }, - { 5, "1.9 M", (int64_t)1996*1024L, HN_DECIMAL, HN_AUTOSCALE }, - { 5, "2.0 M", (int64_t)1997*1024L, HN_DECIMAL, HN_AUTOSCALE }, - { 5, "2.0 M", (int64_t)2047*1024L, HN_DECIMAL, HN_AUTOSCALE }, - { 5, "2.0 M", (int64_t)2048*1024L, HN_DECIMAL, HN_AUTOSCALE }, - { 5, "2.0 M", (int64_t)2099*1024L, HN_DECIMAL, HN_AUTOSCALE }, - { 5, "2.1 M", (int64_t)2100*1024L, HN_DECIMAL, HN_AUTOSCALE }, - { 5, "9.9 M", (int64_t)10188*1024L, HN_DECIMAL, HN_AUTOSCALE }, + { 5, "500 K", (int64_t)500*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 }, + { 5, "994 K", (int64_t)994*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 }, + { 5, "995 K", (int64_t)995*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 }, + { 5, "999 K", (int64_t)999*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 }, + { 5, "1.0 M", (int64_t)1000*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 }, + { 5, "1.0 M", (int64_t)1018*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 }, + { 5, "1.0 M", (int64_t)1019*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 }, + { 5, "1.5 M", (int64_t)1536*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 }, + { 5, "1.9 M", (int64_t)1996*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 }, + { 5, "2.0 M", (int64_t)1997*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 }, + { 5, "2.0 M", (int64_t)2047*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 }, + { 5, "2.0 M", (int64_t)2048*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 }, + { 5, "2.0 M", (int64_t)2099*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 }, + { 5, "2.1 M", (int64_t)2100*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 }, + { 5, "9.9 M", (int64_t)10188*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 }, /* XXX - shouldn't the following two be "10. M"? */ - { 4, "10 M", (int64_t)10189*1024L, HN_DECIMAL, HN_AUTOSCALE }, - { 4, "10 M", (int64_t)10240*1024L, HN_DECIMAL, HN_AUTOSCALE }, - { 5, "500 M", (int64_t)500*1024*1024L, HN_DECIMAL, HN_AUTOSCALE }, - { 5, "994 M", (int64_t)994*1024*1024L, HN_DECIMAL, HN_AUTOSCALE }, - { 5, "995 M", (int64_t)995*1024*1024L, HN_DECIMAL, HN_AUTOSCALE }, - { 5, "999 M", (int64_t)999*1024*1024L, HN_DECIMAL, HN_AUTOSCALE }, - { 5, "1.0 G", (int64_t)1000*1024*1024L, HN_DECIMAL, HN_AUTOSCALE }, - { 5, "1.0 G", (int64_t)1023*1024*1024L, HN_DECIMAL, HN_AUTOSCALE }, + { 4, "10 M", (int64_t)10189*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 }, + { 4, "10 M", (int64_t)10240*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 }, + { 5, "500 M", (int64_t)500*1024*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 }, + { 5, "994 M", (int64_t)994*1024*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 }, + { 5, "995 M", (int64_t)995*1024*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 }, + { 5, "999 M", (int64_t)999*1024*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 }, + { 5, "1.0 G", (int64_t)1000*1024*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 }, + { 5, "1.0 G", (int64_t)1023*1024*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 }, /* Negative, Autoscale - should pass */ - { 6, "-1.5 ", -(int64_t)1500*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE }, - { 6, "-1.9 ", -(int64_t)1949*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE }, - { 6, "-9.9 ", -(int64_t)9949*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE }, + { 6, "-1.5 ", -(int64_t)1500*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE, 6 }, + { 6, "-1.9 ", -(int64_t)1949*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE, 6 }, + { 6, "-9.9 ", -(int64_t)9949*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE, 6 }, - { 6, "-1.5 ", -(int64_t)1536*1024L, HN_DECIMAL, HN_AUTOSCALE }, - { 6, "-1.9 ", -(int64_t)1949*1024L, HN_DECIMAL, HN_AUTOSCALE }, - { 6, "-9.7 ", -(int64_t)9949*1024L, HN_DECIMAL, HN_AUTOSCALE }, + { 6, "-1.5 ", -(int64_t)1536*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 }, + { 6, "-1.9 ", -(int64_t)1949*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 }, + { 6, "-9.7 ", -(int64_t)9949*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 }, /* Positive/negative, at maximum scale */ - { 5, "500 P", (int64_t)500*1000*1000*1000*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE }, - { 5, "1.9 E", (int64_t)1949*1000*1000*1000*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE }, - { 5, "8.9 E", (int64_t)8949*1000*1000*1000*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE }, - { 5, "9.2 E", INT64_MAX, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE }, + { 5, "500 P", (int64_t)500*1000*1000*1000*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE, 6 }, + { 5, "1.9 E", (int64_t)1949*1000*1000*1000*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE, 6 }, + { 5, "8.9 E", (int64_t)8949*1000*1000*1000*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE, 6 }, + { 5, "9.2 E", INT64_MAX, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE, 6 }, /* Negatives work with latest rev only: */ - { 6, "-9.2 ", -INT64_MAX, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE }, - { 6, "-8.9 ", -(int64_t)8949*1000*1000*1000*1000*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE }, + { 6, "-9.2 ", -INT64_MAX, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE, 6 }, + { 6, "-8.9 ", -(int64_t)8949*1000*1000*1000*1000*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE, 6 }, - { 5, "8.0 E", INT64_MAX, HN_DECIMAL, HN_AUTOSCALE }, - { 5, "7.9 E", INT64_MAX-(int64_t)100*1024*1024*1024*1024*1024LL, HN_DECIMAL, HN_AUTOSCALE }, - { 6, "-8.0 ", -INT64_MAX, HN_DECIMAL, HN_AUTOSCALE }, - { 6, "-7.9 ", -INT64_MAX+(int64_t)100*1024*1024*1024*1024*1024LL, HN_DECIMAL, HN_AUTOSCALE }, + { 5, "8.0 E", INT64_MAX, HN_DECIMAL, HN_AUTOSCALE, 6 }, + { 5, "7.9 E", INT64_MAX-(int64_t)100*1024*1024*1024*1024*1024LL, HN_DECIMAL, HN_AUTOSCALE, 6 }, + { 6, "-8.0 ", -INT64_MAX, HN_DECIMAL, HN_AUTOSCALE, 6 }, + { 6, "-7.9 ", -INT64_MAX+(int64_t)100*1024*1024*1024*1024*1024LL, HN_DECIMAL, HN_AUTOSCALE, 6 }, /* Positive, Fixed scales */ - { 5, "500 k", (int64_t)500*1000L, HN_DECIMAL|HN_DIVISOR_1000, 1 }, - { 5, "0.5 M", (int64_t)500*1000L, HN_DECIMAL|HN_DIVISOR_1000, 2 }, - { 5, "949 k", (int64_t)949*1000L, HN_DECIMAL|HN_DIVISOR_1000, 1 }, - { 5, "0.9 M", (int64_t)949*1000L, HN_DECIMAL|HN_DIVISOR_1000, 2 }, - { 5, "950 k", (int64_t)950*1000L, HN_DECIMAL|HN_DIVISOR_1000, 1 }, - { 5, "1.0 M", (int64_t)950*1000L, HN_DECIMAL|HN_DIVISOR_1000, 2 }, - { 5, "999 k", (int64_t)999*1000L, HN_DECIMAL|HN_DIVISOR_1000, 1 }, - { 5, "1.0 M", (int64_t)999*1000L, HN_DECIMAL|HN_DIVISOR_1000, 2 }, - { 5, "1.5 M", (int64_t)1500*1000L, HN_DECIMAL|HN_DIVISOR_1000, 2 }, - { 5, "1.9 M", (int64_t)1949*1000L, HN_DECIMAL|HN_DIVISOR_1000, 2 }, - { 5, "2.0 M", (int64_t)1950*1000L, HN_DECIMAL|HN_DIVISOR_1000, 2 }, - { 5, "9.9 M", (int64_t)9949*1000L, HN_DECIMAL|HN_DIVISOR_1000, 2 }, - { 4, "10 M", (int64_t)9950*1000L, HN_DECIMAL|HN_DIVISOR_1000, 2 }, - { 5, "500 M", (int64_t)500*1000*1000L, HN_DECIMAL|HN_DIVISOR_1000, 2 }, - { 5, "0.5 G", (int64_t)500*1000*1000L, HN_DECIMAL|HN_DIVISOR_1000, 3 }, - { 5, "999 M", (int64_t)999*1000*1000L, HN_DECIMAL|HN_DIVISOR_1000, 2 }, - { 5, "1.0 G", (int64_t)999*1000*1000L, HN_DECIMAL|HN_DIVISOR_1000, 3 }, + { 5, "500 k", (int64_t)500*1000L, HN_DECIMAL|HN_DIVISOR_1000, 1, 6 }, + { 5, "0.5 M", (int64_t)500*1000L, HN_DECIMAL|HN_DIVISOR_1000, 2, 6 }, + { 5, "949 k", (int64_t)949*1000L, HN_DECIMAL|HN_DIVISOR_1000, 1, 6 }, + { 5, "0.9 M", (int64_t)949*1000L, HN_DECIMAL|HN_DIVISOR_1000, 2, 6 }, + { 5, "950 k", (int64_t)950*1000L, HN_DECIMAL|HN_DIVISOR_1000, 1, 6 }, + { 5, "1.0 M", (int64_t)950*1000L, HN_DECIMAL|HN_DIVISOR_1000, 2, 6 }, + { 5, "999 k", (int64_t)999*1000L, HN_DECIMAL|HN_DIVISOR_1000, 1, 6 }, + { 5, "1.0 M", (int64_t)999*1000L, HN_DECIMAL|HN_DIVISOR_1000, 2, 6 }, + { 5, "1.5 M", (int64_t)1500*1000L, HN_DECIMAL|HN_DIVISOR_1000, 2, 6 }, + { 5, "1.9 M", (int64_t)1949*1000L, HN_DECIMAL|HN_DIVISOR_1000, 2, 6 }, + { 5, "2.0 M", (int64_t)1950*1000L, HN_DECIMAL|HN_DIVISOR_1000, 2, 6 }, + { 5, "9.9 M", (int64_t)9949*1000L, HN_DECIMAL|HN_DIVISOR_1000, 2, 6 }, + { 4, "10 M", (int64_t)9950*1000L, HN_DECIMAL|HN_DIVISOR_1000, 2, 6 }, + { 5, "500 M", (int64_t)500*1000*1000L, HN_DECIMAL|HN_DIVISOR_1000, 2, 6 }, + { 5, "0.5 G", (int64_t)500*1000*1000L, HN_DECIMAL|HN_DIVISOR_1000, 3, 6 }, + { 5, "999 M", (int64_t)999*1000*1000L, HN_DECIMAL|HN_DIVISOR_1000, 2, 6 }, + { 5, "1.0 G", (int64_t)999*1000*1000L, HN_DECIMAL|HN_DIVISOR_1000, 3, 6 }, /* Positive/negative, at maximum scale */ - { 5, "500 P", (int64_t)500*1000*1000*1000*1000*1000L, HN_DIVISOR_1000, 5 }, - { 5, "1.0 E", (int64_t)500*1000*1000*1000*1000*1000L, HN_DIVISOR_1000, 6 }, - { 5, "1.9 E", (int64_t)1949*1000*1000*1000*1000*1000L, HN_DIVISOR_1000, 6 }, - { 5, "8.9 E", (int64_t)8949*1000*1000*1000*1000*1000L, HN_DIVISOR_1000, 6 }, - { 5, "9.2 E", INT64_MAX, HN_DECIMAL|HN_DIVISOR_1000, 6 }, + { 5, "500 P", (int64_t)500*1000*1000*1000*1000*1000L, HN_DIVISOR_1000, 5, 6 }, + { 5, "1.0 E", (int64_t)500*1000*1000*1000*1000*1000L, HN_DIVISOR_1000, 6, 6 }, + { 5, "1.9 E", (int64_t)1949*1000*1000*1000*1000*1000L, HN_DIVISOR_1000, 6, 6 }, + { 5, "8.9 E", (int64_t)8949*1000*1000*1000*1000*1000L, HN_DIVISOR_1000, 6, 6 }, + { 5, "9.2 E", INT64_MAX, HN_DECIMAL|HN_DIVISOR_1000, 6, 6 }, /* HN_DECIMAL + binary + fixed scale cases not completed */ - { 5, "512 K", (int64_t)512*1024L, HN_DECIMAL, 1 }, - { 5, "0.5 M", (int64_t)512*1024L, HN_DECIMAL, 2 }, + { 5, "512 K", (int64_t)512*1024L, HN_DECIMAL, 1, 6 }, + { 5, "0.5 M", (int64_t)512*1024L, HN_DECIMAL, 2, 6 }, /* Negative, Fixed scales */ /* Not yet added, but should work with latest rev */ @@ -439,9 +443,9 @@ static struct { } flags[] = { { HN_AUTOSCALE, "HN_AUTOSCALE" }, { HN_GETSCALE, "HN_GETSCALE" }, - { HN_DIVISOR_1000, "HN_DIVISOR_1000"}, - { HN_B, "HN_B"}, - { HN_DECIMAL, "HN_DECIMAL"}, + { HN_DIVISOR_1000, "HN_DIVISOR_1000" }, + { HN_B, "HN_B" }, + { HN_DECIMAL, "HN_DECIMAL" }, }; static const char *separator = "|"; @@ -496,13 +500,14 @@ main(int argc, char * const argv[]) { char *buf; char *flag_str, *scale_str; - size_t buflen, errcnt, i, skipped, tested; + size_t blen, buflen, errcnt, i, skipped, tested; int r; int includeNegScale; int includeExabyteTests; int verbose; - buflen = 4; + buf = NULL; + buflen = 0; includeNegScale = 0; includeExabyteTests = 0; verbose = 0; @@ -510,7 +515,6 @@ main(int argc, char * const argv[]) read_options(argc, argv, &buflen, &includeNegScale, &includeExabyteTests, &verbose); - buf = malloc(buflen); errcnt = 0; tested = 0; skipped = 0; @@ -520,16 +524,8 @@ main(int argc, char * const argv[]) printf("1..%zu\n", nitems(test_args)); for (i = 0; i < nitems(test_args); i++) { - /* KLUDGE */ - if (test_args[i].num == INT64_MAX && buflen == 4) { - /* Start final tests which require buffer of 6 */ - free(buf); - buflen = 6; - buf = malloc(buflen); - if (verbose) - printf("Buffer length increased to %zu\n", - buflen); - } + blen = (buflen > 0) ? buflen : test_args[i].buflen; + buf = realloc(buf, blen); if (test_args[i].scale < 0 && ! includeNegScale) { skipped++; @@ -542,7 +538,7 @@ main(int argc, char * const argv[]) continue; } - r = humanize_number(buf, buflen, test_args[i].num, "", + r = humanize_number(buf, blen, test_args[i].num, "", test_args[i].scale, test_args[i].flags); flag_str = str_flags(test_args[i].flags, "[no flags]"); scale_str = str_scale(test_args[i].scale); @@ -553,7 +549,7 @@ main(int argc, char * const argv[]) "buflen: %zu, got: %d + \"%s\", " "expected %d + \"%s\"; num = %jd, " "scale = %s, flags= %s.\n", - i, buflen, r, buf, test_args[i].retval, + i, blen, r, buf, test_args[i].retval, test_args[i].res, (intmax_t)test_args[i].num, scale_str, flag_str); @@ -565,10 +561,10 @@ main(int argc, char * const argv[]) if (verbose) printf("result mismatch on index %zu, got: " "\"%s\", expected \"%s\"; num = %jd, " - "scale = %s, flags= %s.\n", + "buflen: %zu, scale = %s, flags= %s.\n", i, buf, test_args[i].res, (intmax_t)test_args[i].num, - scale_str, flag_str); + blen, scale_str, flag_str); else printf("not ok %zu # buf \"%s\" != \"%s\"\n", i + 1, buf, test_args[i].res); @@ -577,15 +573,15 @@ main(int argc, char * const argv[]) if (verbose) printf("successful result on index %zu, " "returned %d, got: \"%s\"; num = %jd, " - "scale = %s, flags= %s.\n", - i, r, buf, - (intmax_t)test_args[i].num, - scale_str, flag_str); + "buflen = %zd, scale = %s, flags= %s.\n", + i, r, buf, (intmax_t)test_args[i].num, + blen, scale_str, flag_str); else printf("ok %zu\n", i + 1); } tested++; } + free(buf); if (verbose) printf("total errors: %zu/%zu tests, %zu skipped\n", errcnt, From owner-svn-src-all@freebsd.org Thu Dec 28 23:49:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3087E89114; Thu, 28 Dec 2017 23:49:54 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9CEAC71C6F; Thu, 28 Dec 2017 23:49:54 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBSNnrVq083637; Thu, 28 Dec 2017 23:49:53 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBSNnrsx083636; Thu, 28 Dec 2017 23:49:53 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201712282349.vBSNnrsx083636@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Thu, 28 Dec 2017 23:49:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327318 - in head/sys: conf powerpc/ofw X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: in head/sys: conf powerpc/ofw X-SVN-Commit-Revision: 327318 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 23:49:54 -0000 Author: nwhitehorn Date: Thu Dec 28 23:49:53 2017 New Revision: 327318 URL: https://svnweb.freebsd.org/changeset/base/327318 Log: Remove ELF note for Open Firmware. It is marked optional in a single 1996 draft of a never-finalized standard (CHRP) and is irrelevant in practice on FreeBSD since we load the kernel with loader(8) on Open Firmware platforms anyway. Moreover, loader(8), which is directly loaded by Open Firmware, has never had an equivalent note. MFC after: 2 weeks Deleted: head/sys/powerpc/ofw/ofwmagic.S Modified: head/sys/conf/files.powerpc Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Thu Dec 28 22:57:34 2017 (r327317) +++ head/sys/conf/files.powerpc Thu Dec 28 23:49:53 2017 (r327318) @@ -158,7 +158,6 @@ powerpc/ofw/ofw_real.c optional aim powerpc/ofw/ofw_syscons.c optional sc aim powerpc/ofw/ofwcall32.S optional aim powerpc powerpc/ofw/ofwcall64.S optional aim powerpc64 -powerpc/ofw/ofwmagic.S optional aim powerpc/ofw/openpic_ofw.c optional aim | fdt powerpc/ofw/rtas.c optional aim powerpc/powermac/ata_kauai.c optional powermac ata | powermac atamacio From owner-svn-src-all@freebsd.org Thu Dec 28 23:50:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C49AE89233; Thu, 28 Dec 2017 23:50:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 06F7071DBE; Thu, 28 Dec 2017 23:50:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBSNoMCc083719; Thu, 28 Dec 2017 23:50:22 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBSNoMQ3083718; Thu, 28 Dec 2017 23:50:22 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201712282350.vBSNoMQ3083718@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 28 Dec 2017 23:50:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327319 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 327319 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 23:50:23 -0000 Author: kib Date: Thu Dec 28 23:50:21 2017 New Revision: 327319 URL: https://svnweb.freebsd.org/changeset/base/327319 Log: Clean up the comment. Reviewed by: alc, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D13671 Modified: head/sys/vm/vm_swapout.c Modified: head/sys/vm/vm_swapout.c ============================================================================== --- head/sys/vm/vm_swapout.c Thu Dec 28 23:49:53 2017 (r327318) +++ head/sys/vm/vm_swapout.c Thu Dec 28 23:50:21 2017 (r327319) @@ -715,8 +715,7 @@ loop: } /* - * We would like to bring someone in. (only if there is space). - * [What checks the space? ] + * We would like to bring someone in. */ faultin(p); PROC_UNLOCK(p); From owner-svn-src-all@freebsd.org Thu Dec 28 23:57:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D227CE8A042; Thu, 28 Dec 2017 23:57:21 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 549CB724C6; Thu, 28 Dec 2017 23:57:21 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBSNvKm7087933; Thu, 28 Dec 2017 23:57:20 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBSNvJtP087920; Thu, 28 Dec 2017 23:57:19 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201712282357.vBSNvJtP087920@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 28 Dec 2017 23:57:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r327320 - in vendor/llvm/dist: include/llvm/Support lib/CodeGen/SelectionDAG lib/LTO lib/Target/X86 test/CodeGen/PowerPC test/CodeGen/X86 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/llvm/dist: include/llvm/Support lib/CodeGen/SelectionDAG lib/LTO lib/Target/X86 test/CodeGen/PowerPC test/CodeGen/X86 X-SVN-Commit-Revision: 327320 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 23:57:21 -0000 Author: dim Date: Thu Dec 28 23:57:18 2017 New Revision: 327320 URL: https://svnweb.freebsd.org/changeset/base/327320 Log: Vendor import of llvm trunk r321545: https://llvm.org/svn/llvm-project/llvm/trunk@321545 Added: vendor/llvm/dist/test/CodeGen/X86/win32-eh-available-externally.ll Modified: vendor/llvm/dist/include/llvm/Support/KnownBits.h vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAG.cpp vendor/llvm/dist/lib/LTO/LTOModule.cpp vendor/llvm/dist/lib/Target/X86/X86ISelLowering.cpp vendor/llvm/dist/lib/Target/X86/X86InstrAVX512.td vendor/llvm/dist/lib/Target/X86/X86WinEHState.cpp vendor/llvm/dist/test/CodeGen/PowerPC/combine_loads_from_build_pair.ll vendor/llvm/dist/test/CodeGen/X86/bitcast-int-to-vector-bool-sext.ll vendor/llvm/dist/test/CodeGen/X86/bitcast-int-to-vector-bool-zext.ll vendor/llvm/dist/test/CodeGen/X86/bitcast-int-to-vector-bool.ll vendor/llvm/dist/test/CodeGen/X86/setcc-wide-types.ll Modified: vendor/llvm/dist/include/llvm/Support/KnownBits.h ============================================================================== --- vendor/llvm/dist/include/llvm/Support/KnownBits.h Thu Dec 28 23:50:21 2017 (r327319) +++ vendor/llvm/dist/include/llvm/Support/KnownBits.h Thu Dec 28 23:57:18 2017 (r327320) @@ -100,13 +100,11 @@ struct KnownBits { (public) /// Make this value negative. void makeNegative() { - assert(!isNonNegative() && "Can't make a non-negative value negative"); One.setSignBit(); } /// Make this value negative. void makeNonNegative() { - assert(!isNegative() && "Can't make a negative value non-negative"); Zero.setSignBit(); } Modified: vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp ============================================================================== --- vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp Thu Dec 28 23:50:21 2017 (r327319) +++ vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp Thu Dec 28 23:57:18 2017 (r327320) @@ -49,6 +49,8 @@ using namespace llvm; +#define DEBUG_TYPE "legalizevectorops" + namespace { class VectorLegalizer { @@ -226,7 +228,8 @@ SDValue VectorLegalizer::LegalizeOp(SDValue Op) { if (Op.getOpcode() == ISD::LOAD) { LoadSDNode *LD = cast(Op.getNode()); ISD::LoadExtType ExtType = LD->getExtensionType(); - if (LD->getMemoryVT().isVector() && ExtType != ISD::NON_EXTLOAD) + if (LD->getMemoryVT().isVector() && ExtType != ISD::NON_EXTLOAD) { + DEBUG(dbgs() << "\nLegalizing extending vector load: "; Node->dump(&DAG)); switch (TLI.getLoadExtAction(LD->getExtensionType(), LD->getValueType(0), LD->getMemoryVT())) { default: llvm_unreachable("This action is not supported yet!"); @@ -252,11 +255,14 @@ SDValue VectorLegalizer::LegalizeOp(SDValue Op) { Changed = true; return LegalizeOp(ExpandLoad(Op)); } + } } else if (Op.getOpcode() == ISD::STORE) { StoreSDNode *ST = cast(Op.getNode()); EVT StVT = ST->getMemoryVT(); MVT ValVT = ST->getValue().getSimpleValueType(); - if (StVT.isVector() && ST->isTruncatingStore()) + if (StVT.isVector() && ST->isTruncatingStore()) { + DEBUG(dbgs() << "\nLegalizing truncating vector store: "; + Node->dump(&DAG)); switch (TLI.getTruncStoreAction(ValVT, StVT)) { default: llvm_unreachable("This action is not supported yet!"); case TargetLowering::Legal: @@ -270,6 +276,7 @@ SDValue VectorLegalizer::LegalizeOp(SDValue Op) { Changed = true; return LegalizeOp(ExpandStore(Op)); } + } } else if (Op.getOpcode() == ISD::MSCATTER || Op.getOpcode() == ISD::MSTORE) HasVectorValue = true; @@ -376,6 +383,8 @@ SDValue VectorLegalizer::LegalizeOp(SDValue Op) { break; } + DEBUG(dbgs() << "\nLegalizing vector op: "; Node->dump(&DAG)); + switch (TLI.getOperationAction(Node->getOpcode(), QueryType)) { default: llvm_unreachable("This action is not supported yet!"); case TargetLowering::Promote: @@ -383,12 +392,16 @@ SDValue VectorLegalizer::LegalizeOp(SDValue Op) { Changed = true; break; case TargetLowering::Legal: + DEBUG(dbgs() << "Legal node: nothing to do\n"); break; case TargetLowering::Custom: { + DEBUG(dbgs() << "Trying custom legalization\n"); if (SDValue Tmp1 = TLI.LowerOperation(Op, DAG)) { + DEBUG(dbgs() << "Successfully custom legalized node\n"); Result = Tmp1; break; } + DEBUG(dbgs() << "Could not custom legalize node\n"); LLVM_FALLTHROUGH; } case TargetLowering::Expand: Modified: vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAG.cpp ============================================================================== --- vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Thu Dec 28 23:50:21 2017 (r327319) +++ vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Thu Dec 28 23:57:18 2017 (r327320) @@ -5943,7 +5943,9 @@ SDValue SelectionDAG::getLoad(ISD::MemIndexedMode AM, CSEMap.InsertNode(N, IP); InsertNode(N); - return SDValue(N, 0); + SDValue V(N, 0); + NewSDValueDbgMsg(V, "Creating new node: ", this); + return V; } SDValue SelectionDAG::getLoad(EVT VT, const SDLoc &dl, SDValue Chain, @@ -6043,7 +6045,9 @@ SDValue SelectionDAG::getStore(SDValue Chain, const SD CSEMap.InsertNode(N, IP); InsertNode(N); - return SDValue(N, 0); + SDValue V(N, 0); + NewSDValueDbgMsg(V, "Creating new node: ", this); + return V; } SDValue SelectionDAG::getTruncStore(SDValue Chain, const SDLoc &dl, SDValue Val, @@ -6108,7 +6112,9 @@ SDValue SelectionDAG::getTruncStore(SDValue Chain, con CSEMap.InsertNode(N, IP); InsertNode(N); - return SDValue(N, 0); + SDValue V(N, 0); + NewSDValueDbgMsg(V, "Creating new node: ", this); + return V; } SDValue SelectionDAG::getIndexedStore(SDValue OrigStore, const SDLoc &dl, @@ -6134,7 +6140,9 @@ SDValue SelectionDAG::getIndexedStore(SDValue OrigStor CSEMap.InsertNode(N, IP); InsertNode(N); - return SDValue(N, 0); + SDValue V(N, 0); + NewSDValueDbgMsg(V, "Creating new node: ", this); + return V; } SDValue SelectionDAG::getMaskedLoad(EVT VT, const SDLoc &dl, SDValue Chain, @@ -6160,7 +6168,9 @@ SDValue SelectionDAG::getMaskedLoad(EVT VT, const SDLo CSEMap.InsertNode(N, IP); InsertNode(N); - return SDValue(N, 0); + SDValue V(N, 0); + NewSDValueDbgMsg(V, "Creating new node: ", this); + return V; } SDValue SelectionDAG::getMaskedStore(SDValue Chain, const SDLoc &dl, @@ -6189,7 +6199,9 @@ SDValue SelectionDAG::getMaskedStore(SDValue Chain, co CSEMap.InsertNode(N, IP); InsertNode(N); - return SDValue(N, 0); + SDValue V(N, 0); + NewSDValueDbgMsg(V, "Creating new node: ", this); + return V; } SDValue SelectionDAG::getMaskedGather(SDVTList VTs, EVT VT, const SDLoc &dl, @@ -6224,7 +6236,9 @@ SDValue SelectionDAG::getMaskedGather(SDVTList VTs, EV CSEMap.InsertNode(N, IP); InsertNode(N); - return SDValue(N, 0); + SDValue V(N, 0); + NewSDValueDbgMsg(V, "Creating new node: ", this); + return V; } SDValue SelectionDAG::getMaskedScatter(SDVTList VTs, EVT VT, const SDLoc &dl, @@ -6256,7 +6270,9 @@ SDValue SelectionDAG::getMaskedScatter(SDVTList VTs, E CSEMap.InsertNode(N, IP); InsertNode(N); - return SDValue(N, 0); + SDValue V(N, 0); + NewSDValueDbgMsg(V, "Creating new node: ", this); + return V; } SDValue SelectionDAG::getVAArg(EVT VT, const SDLoc &dl, SDValue Chain, @@ -7112,6 +7128,8 @@ void SelectionDAG::transferDbgValues(SDValue From, SDV void SelectionDAG::salvageDebugInfo(SDNode &N) { if (!N.getHasDebugValue()) return; + + SmallVector ClonedDVs; for (auto DV : GetDbgValues(&N)) { if (DV->isInvalidated()) continue; @@ -7135,13 +7153,16 @@ void SelectionDAG::salvageDebugInfo(SDNode &N) { SDDbgValue *Clone = getDbgValue(DV->getVariable(), DIExpr, N0.getNode(), N0.getResNo(), DV->isIndirect(), DV->getDebugLoc(), DV->getOrder()); + ClonedDVs.push_back(Clone); DV->setIsInvalidated(); - AddDbgValue(Clone, N0.getNode(), false); DEBUG(dbgs() << "SALVAGE: Rewriting"; N0.getNode()->dumprFull(this); dbgs() << " into " << *DIExpr << '\n'); } } } + + for (SDDbgValue *Dbg : ClonedDVs) + AddDbgValue(Dbg, Dbg->getSDNode(), false); } namespace { Modified: vendor/llvm/dist/lib/LTO/LTOModule.cpp ============================================================================== --- vendor/llvm/dist/lib/LTO/LTOModule.cpp Thu Dec 28 23:50:21 2017 (r327319) +++ vendor/llvm/dist/lib/LTO/LTOModule.cpp Thu Dec 28 23:57:18 2017 (r327320) @@ -388,24 +388,20 @@ void LTOModule::addDefinedDataSymbol(StringRef Name, c // from the ObjC data structures generated by the front end. // special case if this data blob is an ObjC class definition - std::string Section = v->getSection(); - if (Section.compare(0, 15, "__OBJC,__class,") == 0) { - if (const GlobalVariable *gv = dyn_cast(v)) { - addObjCClass(gv); + if (const GlobalVariable *GV = dyn_cast(v)) { + StringRef Section = GV->getSection(); + if (Section.startswith("__OBJC,__class,")) { + addObjCClass(GV); } - } - // special case if this data blob is an ObjC category definition - else if (Section.compare(0, 18, "__OBJC,__category,") == 0) { - if (const GlobalVariable *gv = dyn_cast(v)) { - addObjCCategory(gv); + // special case if this data blob is an ObjC category definition + else if (Section.startswith("__OBJC,__category,")) { + addObjCCategory(GV); } - } - // special case if this data blob is the list of referenced classes - else if (Section.compare(0, 18, "__OBJC,__cls_refs,") == 0) { - if (const GlobalVariable *gv = dyn_cast(v)) { - addObjCClassRef(gv); + // special case if this data blob is the list of referenced classes + else if (Section.startswith("__OBJC,__cls_refs,")) { + addObjCClassRef(GV); } } } Modified: vendor/llvm/dist/lib/Target/X86/X86ISelLowering.cpp ============================================================================== --- vendor/llvm/dist/lib/Target/X86/X86ISelLowering.cpp Thu Dec 28 23:50:21 2017 (r327319) +++ vendor/llvm/dist/lib/Target/X86/X86ISelLowering.cpp Thu Dec 28 23:57:18 2017 (r327320) @@ -16281,7 +16281,7 @@ static SDValue LowerZERO_EXTEND_Mask(SDValue Op, // Truncate if we had to extend i16/i8 above. if (VT != ExtVT) { WideVT = MVT::getVectorVT(VT.getVectorElementType(), NumElts); - SelectedVal = DAG.getNode(X86ISD::VTRUNC, DL, WideVT, SelectedVal); + SelectedVal = DAG.getNode(ISD::TRUNCATE, DL, WideVT, SelectedVal); } // Extract back to 128/256-bit if we widened. @@ -18426,7 +18426,7 @@ static SDValue LowerSIGN_EXTEND_Mask(SDValue Op, // Truncate if we had to extend i16/i8 above. if (VT != ExtVT) { WideVT = MVT::getVectorVT(VTElt, NumElts); - V = DAG.getNode(X86ISD::VTRUNC, dl, WideVT, V); + V = DAG.getNode(ISD::TRUNCATE, dl, WideVT, V); } // Extract back to 128/256-bit if we widened. @@ -18679,6 +18679,14 @@ static SDValue LowerExtended1BitVectorLoad(SDValue Op, // Replace chain users with the new chain. assert(Load->getNumValues() == 2 && "Loads must carry a chain!"); DAG.ReplaceAllUsesOfValueWith(SDValue(Ld, 1), Load.getValue(1)); + if (Subtarget.hasVLX()) { + // Extract to v4i1/v2i1. + SDValue Extract = DAG.getNode(ISD::EXTRACT_SUBVECTOR, dl, MemVT, Load, + DAG.getIntPtrConstant(0, dl)); + // Finally, do a normal sign-extend to the desired register. + return DAG.getNode(ExtOpcode, dl, Op.getValueType(), Extract); + } + MVT ExtVT = MVT::getVectorVT(VT.getScalarType(), 8); SDValue ExtVec = DAG.getNode(ExtOpcode, dl, ExtVT, Load); @@ -18698,22 +18706,25 @@ static SDValue LowerExtended1BitVectorLoad(SDValue Op, if (NumElts <= 8) { // A subset, assume that we have only AVX-512F - unsigned NumBitsToLoad = 8; - MVT TypeToLoad = MVT::getIntegerVT(NumBitsToLoad); - SDValue Load = DAG.getLoad(TypeToLoad, dl, Ld->getChain(), + SDValue Load = DAG.getLoad(MVT::i8, dl, Ld->getChain(), Ld->getBasePtr(), Ld->getMemOperand()); // Replace chain users with the new chain. assert(Load->getNumValues() == 2 && "Loads must carry a chain!"); DAG.ReplaceAllUsesOfValueWith(SDValue(Ld, 1), Load.getValue(1)); - MVT MaskVT = MVT::getVectorVT(MVT::i1, NumBitsToLoad); - SDValue BitVec = DAG.getBitcast(MaskVT, Load); + SDValue BitVec = DAG.getBitcast(MVT::v8i1, Load); if (NumElts == 8) return DAG.getNode(ExtOpcode, dl, VT, BitVec); - // we should take care to v4i1 and v2i1 + if (Subtarget.hasVLX()) { + // Extract to v4i1/v2i1. + SDValue Extract = DAG.getNode(ISD::EXTRACT_SUBVECTOR, dl, MemVT, BitVec, + DAG.getIntPtrConstant(0, dl)); + // Finally, do a normal sign-extend to the desired register. + return DAG.getNode(ExtOpcode, dl, Op.getValueType(), Extract); + } MVT ExtVT = MVT::getVectorVT(VT.getScalarType(), 8); SDValue ExtVec = DAG.getNode(ExtOpcode, dl, ExtVT, BitVec); @@ -18728,13 +18739,12 @@ static SDValue LowerExtended1BitVectorLoad(SDValue Op, Ld->getBasePtr(), Ld->getMemOperand()); - SDValue BasePtrHi = - DAG.getNode(ISD::ADD, dl, BasePtr.getValueType(), BasePtr, - DAG.getConstant(2, dl, BasePtr.getValueType())); + SDValue BasePtrHi = DAG.getMemBasePlusOffset(BasePtr, 2, dl); - SDValue LoadHi = DAG.getLoad(MVT::v16i1, dl, Ld->getChain(), - BasePtrHi, - Ld->getMemOperand()); + SDValue LoadHi = DAG.getLoad(MVT::v16i1, dl, Ld->getChain(), BasePtrHi, + Ld->getPointerInfo().getWithOffset(2), + MinAlign(Ld->getAlignment(), 2U), + Ld->getMemOperand()->getFlags()); SDValue NewChain = DAG.getNode(ISD::TokenFactor, dl, MVT::Other, LoadLo.getValue(1), LoadHi.getValue(1)); @@ -34051,15 +34061,14 @@ static SDValue combineLoad(SDNode *N, SelectionDAG &DA Ptr = DAG.getMemBasePlusOffset(Ptr, 16, dl); SDValue Load2 = - DAG.getLoad(HalfVT, dl, Ld->getChain(), Ptr, Ld->getPointerInfo(), - std::min(16U, Alignment), Ld->getMemOperand()->getFlags()); + DAG.getLoad(HalfVT, dl, Ld->getChain(), Ptr, + Ld->getPointerInfo().getWithOffset(16), + MinAlign(Alignment, 16U), Ld->getMemOperand()->getFlags()); SDValue TF = DAG.getNode(ISD::TokenFactor, dl, MVT::Other, Load1.getValue(1), Load2.getValue(1)); - SDValue NewVec = DAG.getUNDEF(RegVT); - NewVec = insert128BitVector(NewVec, Load1, 0, DAG, dl); - NewVec = insert128BitVector(NewVec, Load2, NumElems / 2, DAG, dl); + SDValue NewVec = DAG.getNode(ISD::CONCAT_VECTORS, dl, RegVT, Load1, Load2); return DCI.CombineTo(N, NewVec, TF, true); } @@ -34465,8 +34474,9 @@ static SDValue combineStore(SDNode *N, SelectionDAG &D DAG.getStore(St->getChain(), dl, Value0, Ptr0, St->getPointerInfo(), Alignment, St->getMemOperand()->getFlags()); SDValue Ch1 = - DAG.getStore(St->getChain(), dl, Value1, Ptr1, St->getPointerInfo(), - std::min(16U, Alignment), St->getMemOperand()->getFlags()); + DAG.getStore(St->getChain(), dl, Value1, Ptr1, + St->getPointerInfo().getWithOffset(16), + MinAlign(Alignment, 16U), St->getMemOperand()->getFlags()); return DAG.getNode(ISD::TokenFactor, dl, MVT::Other, Ch0, Ch1); } Modified: vendor/llvm/dist/lib/Target/X86/X86InstrAVX512.td ============================================================================== --- vendor/llvm/dist/lib/Target/X86/X86InstrAVX512.td Thu Dec 28 23:50:21 2017 (r327319) +++ vendor/llvm/dist/lib/Target/X86/X86InstrAVX512.td Thu Dec 28 23:57:18 2017 (r327320) @@ -8704,17 +8704,6 @@ def rr : AVX512XS8I, EVEX, Sched<[WriteMove]>; } -// Use 512bit version to implement 128/256 bit in case NoVLX. -multiclass avx512_convert_mask_to_vector_lowering { - - def : Pat<(X86Info.VT (X86vsext (X86Info.KVT X86Info.KRC:$src))), - (X86Info.VT (EXTRACT_SUBREG - (_.VT (!cast(NAME#"Zrr") - (_.KVT (COPY_TO_REGCLASS X86Info.KRC:$src,_.KRC)))), - X86Info.SubRegIdx))>; -} - multiclass cvt_mask_by_elt_width opc, AVX512VLVectorVTInfo VTInfo, string OpcodeStr, Predicate prd> { let Predicates = [prd] in @@ -8724,11 +8713,6 @@ let Predicates = [prd] in defm Z256 : cvt_by_vec_width, EVEX_V256; defm Z128 : cvt_by_vec_width, EVEX_V128; } -let Predicates = [prd, NoVLX] in { - defm Z256_Alt : avx512_convert_mask_to_vector_lowering; - defm Z128_Alt : avx512_convert_mask_to_vector_lowering; - } - } defm VPMOVM2B : cvt_mask_by_elt_width<0x28, avx512vl_i8_info, "vpmovm2" , HasBWI>; Modified: vendor/llvm/dist/lib/Target/X86/X86WinEHState.cpp ============================================================================== --- vendor/llvm/dist/lib/Target/X86/X86WinEHState.cpp Thu Dec 28 23:50:21 2017 (r327319) +++ vendor/llvm/dist/lib/Target/X86/X86WinEHState.cpp Thu Dec 28 23:57:18 2017 (r327320) @@ -149,6 +149,12 @@ void WinEHStatePass::getAnalysisUsage(AnalysisUsage &A } bool WinEHStatePass::runOnFunction(Function &F) { + // Don't insert state stores or exception handler thunks for + // available_externally functions. The handler needs to reference the LSDA, + // which will not be emitted in this case. + if (F.hasAvailableExternallyLinkage()) + return false; + // Check the personality. Do nothing if this personality doesn't use funclets. if (!F.hasPersonalityFn()) return false; Modified: vendor/llvm/dist/test/CodeGen/PowerPC/combine_loads_from_build_pair.ll ============================================================================== --- vendor/llvm/dist/test/CodeGen/PowerPC/combine_loads_from_build_pair.ll Thu Dec 28 23:50:21 2017 (r327319) +++ vendor/llvm/dist/test/CodeGen/PowerPC/combine_loads_from_build_pair.ll Thu Dec 28 23:57:18 2017 (r327320) @@ -12,6 +12,8 @@ define i64 @func1(i64 %p1, i64 %p2, i64 %p3, i64 %p4, ; CHECK-DAG: [[LOBITS:t[0-9]+]]: i32,ch = load ; CHECK-DAG: [[HIBITS:t[0-9]+]]: i32,ch = load ; CHECK: Combining: t{{[0-9]+}}: i64 = build_pair [[LOBITS]], [[HIBITS]] +; CHECK-NEXT: Creating new node +; CHECK-SAME: load @ext_i2_2i64(i2 %a0) { ; AVX512-NEXT: movb %dil, -{{[0-9]+}}(%rsp) ; AVX512-NEXT: movzbl -{{[0-9]+}}(%rsp), %eax ; AVX512-NEXT: kmovd %eax, %k1 -; AVX512-NEXT: vpternlogq $255, %zmm0, %zmm0, %zmm0 {%k1} {z} -; AVX512-NEXT: # kill: def %xmm0 killed %xmm0 killed %zmm0 -; AVX512-NEXT: vzeroupper +; AVX512-NEXT: vpcmpeqd %xmm0, %xmm0, %xmm0 +; AVX512-NEXT: vmovdqa64 %xmm0, %xmm0 {%k1} {z} ; AVX512-NEXT: retq %1 = bitcast i2 %a0 to <2 x i1> %2 = sext <2 x i1> %1 to <2 x i64> @@ -91,10 +90,8 @@ define <4 x i32> @ext_i4_4i32(i4 %a0) { ; AVX512-NEXT: movb %dil, -{{[0-9]+}}(%rsp) ; AVX512-NEXT: movzbl -{{[0-9]+}}(%rsp), %eax ; AVX512-NEXT: kmovd %eax, %k1 -; AVX512-NEXT: vpcmpeqd %ymm0, %ymm0, %ymm0 -; AVX512-NEXT: vmovdqa32 %ymm0, %ymm0 {%k1} {z} -; AVX512-NEXT: # kill: def %xmm0 killed %xmm0 killed %ymm0 -; AVX512-NEXT: vzeroupper +; AVX512-NEXT: vpcmpeqd %xmm0, %xmm0, %xmm0 +; AVX512-NEXT: vmovdqa32 %xmm0, %xmm0 {%k1} {z} ; AVX512-NEXT: retq %1 = bitcast i4 %a0 to <4 x i1> %2 = sext <4 x i1> %1 to <4 x i32> @@ -246,8 +243,8 @@ define <4 x i64> @ext_i4_4i64(i4 %a0) { ; AVX512-NEXT: movb %dil, -{{[0-9]+}}(%rsp) ; AVX512-NEXT: movzbl -{{[0-9]+}}(%rsp), %eax ; AVX512-NEXT: kmovd %eax, %k1 -; AVX512-NEXT: vpternlogq $255, %zmm0, %zmm0, %zmm0 {%k1} {z} -; AVX512-NEXT: # kill: def %ymm0 killed %ymm0 killed %zmm0 +; AVX512-NEXT: vpcmpeqd %ymm0, %ymm0, %ymm0 +; AVX512-NEXT: vmovdqa64 %ymm0, %ymm0 {%k1} {z} ; AVX512-NEXT: retq %1 = bitcast i4 %a0 to <4 x i1> %2 = sext <4 x i1> %1 to <4 x i64> Modified: vendor/llvm/dist/test/CodeGen/X86/bitcast-int-to-vector-bool-zext.ll ============================================================================== --- vendor/llvm/dist/test/CodeGen/X86/bitcast-int-to-vector-bool-zext.ll Thu Dec 28 23:50:21 2017 (r327319) +++ vendor/llvm/dist/test/CodeGen/X86/bitcast-int-to-vector-bool-zext.ll Thu Dec 28 23:57:18 2017 (r327320) @@ -63,9 +63,7 @@ define <2 x i64> @ext_i2_2i64(i2 %a0) { ; AVX512VLBW-NEXT: movb %dil, -{{[0-9]+}}(%rsp) ; AVX512VLBW-NEXT: movzbl -{{[0-9]+}}(%rsp), %eax ; AVX512VLBW-NEXT: kmovd %eax, %k1 -; AVX512VLBW-NEXT: vpbroadcastq {{.*}}(%rip), %zmm0 {%k1} {z} -; AVX512VLBW-NEXT: # kill: def %xmm0 killed %xmm0 killed %zmm0 -; AVX512VLBW-NEXT: vzeroupper +; AVX512VLBW-NEXT: vmovdqa64 {{.*}}(%rip), %xmm0 {%k1} {z} ; AVX512VLBW-NEXT: retq %1 = bitcast i2 %a0 to <2 x i1> %2 = zext <2 x i1> %1 to <2 x i64> @@ -120,9 +118,7 @@ define <4 x i32> @ext_i4_4i32(i4 %a0) { ; AVX512VLBW-NEXT: movb %dil, -{{[0-9]+}}(%rsp) ; AVX512VLBW-NEXT: movzbl -{{[0-9]+}}(%rsp), %eax ; AVX512VLBW-NEXT: kmovd %eax, %k1 -; AVX512VLBW-NEXT: vpbroadcastd {{.*}}(%rip), %ymm0 {%k1} {z} -; AVX512VLBW-NEXT: # kill: def %xmm0 killed %xmm0 killed %ymm0 -; AVX512VLBW-NEXT: vzeroupper +; AVX512VLBW-NEXT: vpbroadcastd {{.*}}(%rip), %xmm0 {%k1} {z} ; AVX512VLBW-NEXT: retq %1 = bitcast i4 %a0 to <4 x i1> %2 = zext <4 x i1> %1 to <4 x i32> @@ -317,8 +313,7 @@ define <4 x i64> @ext_i4_4i64(i4 %a0) { ; AVX512VLBW-NEXT: movb %dil, -{{[0-9]+}}(%rsp) ; AVX512VLBW-NEXT: movzbl -{{[0-9]+}}(%rsp), %eax ; AVX512VLBW-NEXT: kmovd %eax, %k1 -; AVX512VLBW-NEXT: vpbroadcastq {{.*}}(%rip), %zmm0 {%k1} {z} -; AVX512VLBW-NEXT: # kill: def %ymm0 killed %ymm0 killed %zmm0 +; AVX512VLBW-NEXT: vpbroadcastq {{.*}}(%rip), %ymm0 {%k1} {z} ; AVX512VLBW-NEXT: retq %1 = bitcast i4 %a0 to <4 x i1> %2 = zext <4 x i1> %1 to <4 x i64> Modified: vendor/llvm/dist/test/CodeGen/X86/bitcast-int-to-vector-bool.ll ============================================================================== --- vendor/llvm/dist/test/CodeGen/X86/bitcast-int-to-vector-bool.ll Thu Dec 28 23:50:21 2017 (r327319) +++ vendor/llvm/dist/test/CodeGen/X86/bitcast-int-to-vector-bool.ll Thu Dec 28 23:57:18 2017 (r327320) @@ -46,9 +46,8 @@ define <2 x i1> @bitcast_i2_2i1(i2 zeroext %a0) { ; AVX512-NEXT: movb %dil, -{{[0-9]+}}(%rsp) ; AVX512-NEXT: movzbl -{{[0-9]+}}(%rsp), %eax ; AVX512-NEXT: kmovd %eax, %k1 -; AVX512-NEXT: vpternlogq $255, %zmm0, %zmm0, %zmm0 {%k1} {z} -; AVX512-NEXT: # kill: def %xmm0 killed %xmm0 killed %zmm0 -; AVX512-NEXT: vzeroupper +; AVX512-NEXT: vpcmpeqd %xmm0, %xmm0, %xmm0 +; AVX512-NEXT: vmovdqa64 %xmm0, %xmm0 {%k1} {z} ; AVX512-NEXT: retq %1 = bitcast i2 %a0 to <2 x i1> ret <2 x i1> %1 @@ -90,10 +89,8 @@ define <4 x i1> @bitcast_i4_4i1(i4 zeroext %a0) { ; AVX512-NEXT: movb %dil, -{{[0-9]+}}(%rsp) ; AVX512-NEXT: movzbl -{{[0-9]+}}(%rsp), %eax ; AVX512-NEXT: kmovd %eax, %k1 -; AVX512-NEXT: vpcmpeqd %ymm0, %ymm0, %ymm0 -; AVX512-NEXT: vmovdqa32 %ymm0, %ymm0 {%k1} {z} -; AVX512-NEXT: # kill: def %xmm0 killed %xmm0 killed %ymm0 -; AVX512-NEXT: vzeroupper +; AVX512-NEXT: vpcmpeqd %xmm0, %xmm0, %xmm0 +; AVX512-NEXT: vmovdqa32 %xmm0, %xmm0 {%k1} {z} ; AVX512-NEXT: retq %1 = bitcast i4 %a0 to <4 x i1> ret <4 x i1> %1 Modified: vendor/llvm/dist/test/CodeGen/X86/setcc-wide-types.ll ============================================================================== --- vendor/llvm/dist/test/CodeGen/X86/setcc-wide-types.ll Thu Dec 28 23:50:21 2017 (r327319) +++ vendor/llvm/dist/test/CodeGen/X86/setcc-wide-types.ll Thu Dec 28 23:57:18 2017 (r327320) @@ -138,3 +138,255 @@ define i32 @eq_i256(<4 x i64> %x, <4 x i64> %y) { ret i32 %zext } +; This test models the expansion of 'memcmp(a, b, 32) != 0' +; if we allowed 2 pairs of 16-byte loads per block. + +define i32 @ne_i128_pair(i128* %a, i128* %b) { +; SSE2-LABEL: ne_i128_pair: +; SSE2: # %bb.0: +; SSE2-NEXT: movq (%rdi), %rax +; SSE2-NEXT: movq 8(%rdi), %rcx +; SSE2-NEXT: xorq (%rsi), %rax +; SSE2-NEXT: xorq 8(%rsi), %rcx +; SSE2-NEXT: movq 24(%rdi), %rdx +; SSE2-NEXT: movq 16(%rdi), %rdi +; SSE2-NEXT: xorq 16(%rsi), %rdi +; SSE2-NEXT: orq %rax, %rdi +; SSE2-NEXT: xorq 24(%rsi), %rdx +; SSE2-NEXT: orq %rcx, %rdx +; SSE2-NEXT: xorl %eax, %eax +; SSE2-NEXT: orq %rdi, %rdx +; SSE2-NEXT: setne %al +; SSE2-NEXT: retq +; +; AVX2-LABEL: ne_i128_pair: +; AVX2: # %bb.0: +; AVX2-NEXT: movq (%rdi), %rax +; AVX2-NEXT: movq 8(%rdi), %rcx +; AVX2-NEXT: xorq (%rsi), %rax +; AVX2-NEXT: xorq 8(%rsi), %rcx +; AVX2-NEXT: movq 24(%rdi), %rdx +; AVX2-NEXT: movq 16(%rdi), %rdi +; AVX2-NEXT: xorq 16(%rsi), %rdi +; AVX2-NEXT: orq %rax, %rdi +; AVX2-NEXT: xorq 24(%rsi), %rdx +; AVX2-NEXT: orq %rcx, %rdx +; AVX2-NEXT: xorl %eax, %eax +; AVX2-NEXT: orq %rdi, %rdx +; AVX2-NEXT: setne %al +; AVX2-NEXT: retq + %a0 = load i128, i128* %a + %b0 = load i128, i128* %b + %xor1 = xor i128 %a0, %b0 + %ap1 = getelementptr i128, i128* %a, i128 1 + %bp1 = getelementptr i128, i128* %b, i128 1 + %a1 = load i128, i128* %ap1 + %b1 = load i128, i128* %bp1 + %xor2 = xor i128 %a1, %b1 + %or = or i128 %xor1, %xor2 + %cmp = icmp ne i128 %or, 0 + %z = zext i1 %cmp to i32 + ret i32 %z +} + +; This test models the expansion of 'memcmp(a, b, 32) == 0' +; if we allowed 2 pairs of 16-byte loads per block. + +define i32 @eq_i128_pair(i128* %a, i128* %b) { +; SSE2-LABEL: eq_i128_pair: +; SSE2: # %bb.0: +; SSE2-NEXT: movq (%rdi), %rax +; SSE2-NEXT: movq 8(%rdi), %rcx +; SSE2-NEXT: xorq (%rsi), %rax +; SSE2-NEXT: xorq 8(%rsi), %rcx +; SSE2-NEXT: movq 24(%rdi), %rdx +; SSE2-NEXT: movq 16(%rdi), %rdi +; SSE2-NEXT: xorq 16(%rsi), %rdi +; SSE2-NEXT: orq %rax, %rdi +; SSE2-NEXT: xorq 24(%rsi), %rdx +; SSE2-NEXT: orq %rcx, %rdx +; SSE2-NEXT: xorl %eax, %eax +; SSE2-NEXT: orq %rdi, %rdx +; SSE2-NEXT: sete %al +; SSE2-NEXT: retq +; +; AVX2-LABEL: eq_i128_pair: +; AVX2: # %bb.0: +; AVX2-NEXT: movq (%rdi), %rax +; AVX2-NEXT: movq 8(%rdi), %rcx +; AVX2-NEXT: xorq (%rsi), %rax +; AVX2-NEXT: xorq 8(%rsi), %rcx +; AVX2-NEXT: movq 24(%rdi), %rdx +; AVX2-NEXT: movq 16(%rdi), %rdi +; AVX2-NEXT: xorq 16(%rsi), %rdi +; AVX2-NEXT: orq %rax, %rdi +; AVX2-NEXT: xorq 24(%rsi), %rdx +; AVX2-NEXT: orq %rcx, %rdx +; AVX2-NEXT: xorl %eax, %eax +; AVX2-NEXT: orq %rdi, %rdx +; AVX2-NEXT: sete %al +; AVX2-NEXT: retq + %a0 = load i128, i128* %a + %b0 = load i128, i128* %b + %xor1 = xor i128 %a0, %b0 + %ap1 = getelementptr i128, i128* %a, i128 1 + %bp1 = getelementptr i128, i128* %b, i128 1 + %a1 = load i128, i128* %ap1 + %b1 = load i128, i128* %bp1 + %xor2 = xor i128 %a1, %b1 + %or = or i128 %xor1, %xor2 + %cmp = icmp eq i128 %or, 0 + %z = zext i1 %cmp to i32 + ret i32 %z +} + +; This test models the expansion of 'memcmp(a, b, 64) != 0' +; if we allowed 2 pairs of 32-byte loads per block. + +define i32 @ne_i256_pair(i256* %a, i256* %b) { +; SSE2-LABEL: ne_i256_pair: +; SSE2: # %bb.0: +; SSE2-NEXT: movq 16(%rdi), %r9 +; SSE2-NEXT: movq 24(%rdi), %r11 +; SSE2-NEXT: movq (%rdi), %r8 +; SSE2-NEXT: movq 8(%rdi), %r10 +; SSE2-NEXT: xorq 8(%rsi), %r10 +; SSE2-NEXT: xorq 24(%rsi), %r11 +; SSE2-NEXT: xorq (%rsi), %r8 +; SSE2-NEXT: xorq 16(%rsi), %r9 +; SSE2-NEXT: movq 48(%rdi), %rdx +; SSE2-NEXT: movq 32(%rdi), %rax +; SSE2-NEXT: movq 56(%rdi), %rcx +; SSE2-NEXT: movq 40(%rdi), %rdi +; SSE2-NEXT: xorq 40(%rsi), %rdi +; SSE2-NEXT: xorq 56(%rsi), %rcx +; SSE2-NEXT: orq %r11, %rcx +; SSE2-NEXT: orq %rdi, %rcx +; SSE2-NEXT: orq %r10, %rcx +; SSE2-NEXT: xorq 32(%rsi), %rax +; SSE2-NEXT: xorq 48(%rsi), %rdx +; SSE2-NEXT: orq %r9, %rdx +; SSE2-NEXT: orq %rax, %rdx +; SSE2-NEXT: orq %r8, %rdx +; SSE2-NEXT: xorl %eax, %eax +; SSE2-NEXT: orq %rcx, %rdx +; SSE2-NEXT: setne %al +; SSE2-NEXT: retq +; +; AVX2-LABEL: ne_i256_pair: +; AVX2: # %bb.0: +; AVX2-NEXT: movq 16(%rdi), %r9 +; AVX2-NEXT: movq 24(%rdi), %r11 +; AVX2-NEXT: movq (%rdi), %r8 +; AVX2-NEXT: movq 8(%rdi), %r10 +; AVX2-NEXT: xorq 8(%rsi), %r10 +; AVX2-NEXT: xorq 24(%rsi), %r11 +; AVX2-NEXT: xorq (%rsi), %r8 +; AVX2-NEXT: xorq 16(%rsi), %r9 +; AVX2-NEXT: movq 48(%rdi), %rdx +; AVX2-NEXT: movq 32(%rdi), %rax +; AVX2-NEXT: movq 56(%rdi), %rcx +; AVX2-NEXT: movq 40(%rdi), %rdi +; AVX2-NEXT: xorq 40(%rsi), %rdi +; AVX2-NEXT: xorq 56(%rsi), %rcx +; AVX2-NEXT: orq %r11, %rcx +; AVX2-NEXT: orq %rdi, %rcx +; AVX2-NEXT: orq %r10, %rcx +; AVX2-NEXT: xorq 32(%rsi), %rax +; AVX2-NEXT: xorq 48(%rsi), %rdx +; AVX2-NEXT: orq %r9, %rdx +; AVX2-NEXT: orq %rax, %rdx +; AVX2-NEXT: orq %r8, %rdx +; AVX2-NEXT: xorl %eax, %eax +; AVX2-NEXT: orq %rcx, %rdx +; AVX2-NEXT: setne %al +; AVX2-NEXT: retq + %a0 = load i256, i256* %a + %b0 = load i256, i256* %b + %xor1 = xor i256 %a0, %b0 + %ap1 = getelementptr i256, i256* %a, i256 1 + %bp1 = getelementptr i256, i256* %b, i256 1 + %a1 = load i256, i256* %ap1 + %b1 = load i256, i256* %bp1 + %xor2 = xor i256 %a1, %b1 + %or = or i256 %xor1, %xor2 + %cmp = icmp ne i256 %or, 0 + %z = zext i1 %cmp to i32 + ret i32 %z +} + +; This test models the expansion of 'memcmp(a, b, 64) == 0' +; if we allowed 2 pairs of 32-byte loads per block. + +define i32 @eq_i256_pair(i256* %a, i256* %b) { +; SSE2-LABEL: eq_i256_pair: +; SSE2: # %bb.0: +; SSE2-NEXT: movq 16(%rdi), %r9 +; SSE2-NEXT: movq 24(%rdi), %r11 +; SSE2-NEXT: movq (%rdi), %r8 +; SSE2-NEXT: movq 8(%rdi), %r10 +; SSE2-NEXT: xorq 8(%rsi), %r10 +; SSE2-NEXT: xorq 24(%rsi), %r11 +; SSE2-NEXT: xorq (%rsi), %r8 +; SSE2-NEXT: xorq 16(%rsi), %r9 +; SSE2-NEXT: movq 48(%rdi), %rdx +; SSE2-NEXT: movq 32(%rdi), %rax +; SSE2-NEXT: movq 56(%rdi), %rcx +; SSE2-NEXT: movq 40(%rdi), %rdi +; SSE2-NEXT: xorq 40(%rsi), %rdi +; SSE2-NEXT: xorq 56(%rsi), %rcx +; SSE2-NEXT: orq %r11, %rcx +; SSE2-NEXT: orq %rdi, %rcx +; SSE2-NEXT: orq %r10, %rcx +; SSE2-NEXT: xorq 32(%rsi), %rax +; SSE2-NEXT: xorq 48(%rsi), %rdx +; SSE2-NEXT: orq %r9, %rdx +; SSE2-NEXT: orq %rax, %rdx +; SSE2-NEXT: orq %r8, %rdx +; SSE2-NEXT: xorl %eax, %eax +; SSE2-NEXT: orq %rcx, %rdx +; SSE2-NEXT: sete %al +; SSE2-NEXT: retq +; +; AVX2-LABEL: eq_i256_pair: +; AVX2: # %bb.0: +; AVX2-NEXT: movq 16(%rdi), %r9 +; AVX2-NEXT: movq 24(%rdi), %r11 +; AVX2-NEXT: movq (%rdi), %r8 +; AVX2-NEXT: movq 8(%rdi), %r10 +; AVX2-NEXT: xorq 8(%rsi), %r10 +; AVX2-NEXT: xorq 24(%rsi), %r11 +; AVX2-NEXT: xorq (%rsi), %r8 +; AVX2-NEXT: xorq 16(%rsi), %r9 +; AVX2-NEXT: movq 48(%rdi), %rdx +; AVX2-NEXT: movq 32(%rdi), %rax +; AVX2-NEXT: movq 56(%rdi), %rcx +; AVX2-NEXT: movq 40(%rdi), %rdi +; AVX2-NEXT: xorq 40(%rsi), %rdi +; AVX2-NEXT: xorq 56(%rsi), %rcx +; AVX2-NEXT: orq %r11, %rcx +; AVX2-NEXT: orq %rdi, %rcx +; AVX2-NEXT: orq %r10, %rcx +; AVX2-NEXT: xorq 32(%rsi), %rax +; AVX2-NEXT: xorq 48(%rsi), %rdx +; AVX2-NEXT: orq %r9, %rdx +; AVX2-NEXT: orq %rax, %rdx +; AVX2-NEXT: orq %r8, %rdx +; AVX2-NEXT: xorl %eax, %eax +; AVX2-NEXT: orq %rcx, %rdx +; AVX2-NEXT: sete %al +; AVX2-NEXT: retq + %a0 = load i256, i256* %a + %b0 = load i256, i256* %b + %xor1 = xor i256 %a0, %b0 + %ap1 = getelementptr i256, i256* %a, i256 1 + %bp1 = getelementptr i256, i256* %b, i256 1 + %a1 = load i256, i256* %ap1 + %b1 = load i256, i256* %bp1 + %xor2 = xor i256 %a1, %b1 + %or = or i256 %xor1, %xor2 + %cmp = icmp eq i256 %or, 0 + %z = zext i1 %cmp to i32 + ret i32 %z +} + Added: vendor/llvm/dist/test/CodeGen/X86/win32-eh-available-externally.ll ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/llvm/dist/test/CodeGen/X86/win32-eh-available-externally.ll Thu Dec 28 23:57:18 2017 (r327320) @@ -0,0 +1,28 @@ +; RUN: opt -S -x86-winehstate < %s | FileCheck %s --check-prefix=IR +; RUN: llc < %s | FileCheck %s --check-prefix=ASM + +; IR-NOT: define.*__ehhandler +; IR: define available_externally void @foo(void ()*) +; IR-NOT: define.*__ehhandler + +; No code should be emitted. +; ASM-NOT: __ehtable +; ASM-NOT: __ehhandler + +target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32" +target triple = "i686-pc-windows-msvc" + +declare i32 @__CxxFrameHandler3(...) unnamed_addr + +define available_externally void @foo(void ()*) personality i32 (...)* @__CxxFrameHandler3 { +start: + invoke void %0() + to label %good unwind label %bad + +good: ; preds = %start + ret void + +bad: ; preds = %start + %cleanuppad = cleanuppad within none [] + cleanupret from %cleanuppad unwind to caller +} From owner-svn-src-all@freebsd.org Thu Dec 28 23:57:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B528EE8A050; Thu, 28 Dec 2017 23:57:24 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7F351724C8; Thu, 28 Dec 2017 23:57:24 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBSNvN3t087980; Thu, 28 Dec 2017 23:57:23 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBSNvNhU087979; Thu, 28 Dec 2017 23:57:23 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201712282357.vBSNvNhU087979@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 28 Dec 2017 23:57:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r327321 - vendor/llvm/llvm-trunk-r321545 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/llvm/llvm-trunk-r321545 X-SVN-Commit-Revision: 327321 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 23:57:24 -0000 Author: dim Date: Thu Dec 28 23:57:23 2017 New Revision: 327321 URL: https://svnweb.freebsd.org/changeset/base/327321 Log: Tag llvm trunk r321545. Added: vendor/llvm/llvm-trunk-r321545/ - copied from r327320, vendor/llvm/dist/ From owner-svn-src-all@freebsd.org Thu Dec 28 23:58:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC193E8A1EC; Thu, 28 Dec 2017 23:58:26 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A5E0872746; Thu, 28 Dec 2017 23:58:26 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBSNwPgI088053; Thu, 28 Dec 2017 23:58:25 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBSNwPKO088052; Thu, 28 Dec 2017 23:58:25 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201712282358.vBSNwPKO088052@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 28 Dec 2017 23:58:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r327322 - vendor/clang/clang-trunk-r321545 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/clang/clang-trunk-r321545 X-SVN-Commit-Revision: 327322 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 23:58:27 -0000 Author: dim Date: Thu Dec 28 23:58:25 2017 New Revision: 327322 URL: https://svnweb.freebsd.org/changeset/base/327322 Log: Tag clang trunk r321545. Added: vendor/clang/clang-trunk-r321545/ - copied from r327321, vendor/clang/dist/ From owner-svn-src-all@freebsd.org Thu Dec 28 23:58:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0501E8A212; Thu, 28 Dec 2017 23:58:29 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A7C927274A; Thu, 28 Dec 2017 23:58:29 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBSNwS7A088105; Thu, 28 Dec 2017 23:58:28 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBSNwSeX088101; Thu, 28 Dec 2017 23:58:28 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201712282358.vBSNwSeX088101@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 28 Dec 2017 23:58:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r327323 - in vendor/compiler-rt/dist: lib/sanitizer_common lib/tsan/rtl test/msan X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/compiler-rt/dist: lib/sanitizer_common lib/tsan/rtl test/msan X-SVN-Commit-Revision: 327323 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 23:58:29 -0000 Author: dim Date: Thu Dec 28 23:58:28 2017 New Revision: 327323 URL: https://svnweb.freebsd.org/changeset/base/327323 Log: Vendor import of compiler-rt trunk r321545: https://llvm.org/svn/llvm-project/compiler-rt/trunk@321545 Added: vendor/compiler-rt/dist/test/msan/pthread_getname_np.cc (contents, props changed) Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common_interceptors.inc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform_interceptors.h vendor/compiler-rt/dist/lib/tsan/rtl/tsan_libdispatch_mac.cc Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common_interceptors.inc ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common_interceptors.inc Thu Dec 28 23:58:25 2017 (r327322) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common_interceptors.inc Thu Dec 28 23:58:28 2017 (r327323) @@ -4551,6 +4551,20 @@ INTERCEPTOR(int, pthread_setname_np, uptr thread, cons #define INIT_PTHREAD_SETNAME_NP #endif +#if SANITIZER_INTERCEPT_PTHREAD_GETNAME_NP +INTERCEPTOR(int, pthread_getname_np, uptr thread, char *name, SIZE_T len) { + void *ctx; + COMMON_INTERCEPTOR_ENTER(ctx, pthread_getname_np, thread, name, len); + int res = REAL(pthread_getname_np)(thread, name, len); + if (!res) + COMMON_INTERCEPTOR_WRITE_RANGE(ctx, name, internal_strnlen(name, len) + 1); + return res; +} +#define INIT_PTHREAD_GETNAME_NP COMMON_INTERCEPT_FUNCTION(pthread_getname_np); +#else +#define INIT_PTHREAD_GETNAME_NP +#endif + #if SANITIZER_INTERCEPT_SINCOS INTERCEPTOR(void, sincos, double x, double *sin, double *cos) { void *ctx; @@ -6541,6 +6555,7 @@ static void InitializeCommonInterceptors() { INIT_TTYNAME_R; INIT_TEMPNAM; INIT_PTHREAD_SETNAME_NP; + INIT_PTHREAD_GETNAME_NP; INIT_SINCOS; INIT_REMQUO; INIT_LGAMMA; Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform_interceptors.h ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform_interceptors.h Thu Dec 28 23:58:25 2017 (r327322) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform_interceptors.h Thu Dec 28 23:58:28 2017 (r327323) @@ -343,6 +343,8 @@ #define SANITIZER_INTERCEPT_PHTREAD_MUTEX SI_POSIX #define SANITIZER_INTERCEPT_PTHREAD_SETNAME_NP \ (SI_FREEBSD || SI_NETBSD || SI_LINUX_NOT_ANDROID || SI_SOLARIS) +#define SANITIZER_INTERCEPT_PTHREAD_GETNAME_NP \ + (SI_FREEBSD || SI_LINUX_NOT_ANDROID || SI_SOLARIS) #define SANITIZER_INTERCEPT_TLS_GET_ADDR \ (SI_FREEBSD || SI_NETBSD || SI_LINUX_NOT_ANDROID || SI_SOLARIS) Modified: vendor/compiler-rt/dist/lib/tsan/rtl/tsan_libdispatch_mac.cc ============================================================================== --- vendor/compiler-rt/dist/lib/tsan/rtl/tsan_libdispatch_mac.cc Thu Dec 28 23:58:25 2017 (r327322) +++ vendor/compiler-rt/dist/lib/tsan/rtl/tsan_libdispatch_mac.cc Thu Dec 28 23:58:28 2017 (r327323) @@ -25,6 +25,11 @@ #include #include +// DISPATCH_NOESCAPE is not defined prior to XCode 8. +#ifndef DISPATCH_NOESCAPE +#define DISPATCH_NOESCAPE +#endif + typedef long long_t; // NOLINT namespace __tsan { Added: vendor/compiler-rt/dist/test/msan/pthread_getname_np.cc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/test/msan/pthread_getname_np.cc Thu Dec 28 23:58:28 2017 (r327323) @@ -0,0 +1,34 @@ +// RUN: %clangxx_msan -std=c++11 -O0 %s -o %t && %run %t +// UNSUPPORTED: android, netbsd + +// Regression test for a deadlock in pthread_getattr_np + +#include +#include +#include +#include + +#include + +void *ThreadFn(void *) { + return nullptr; +} + +int main(void) { + pthread_t t; + int res = pthread_create(&t, 0, ThreadFn, 0); + assert(!res); + + const char *kMyThreadName = "my-thread-name"; + res = pthread_setname_np(t, kMyThreadName); + assert(!res); + + char buf[100]; + res = pthread_getname_np(t, buf, sizeof(buf)); + assert(!res); + assert(strcmp(buf, kMyThreadName) == 0); + + res = pthread_join(t, 0); + assert(!res); + return 0; +} From owner-svn-src-all@freebsd.org Thu Dec 28 23:58:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA535E8A254; Thu, 28 Dec 2017 23:58:34 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8EBA3727BA; Thu, 28 Dec 2017 23:58:34 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBSNwXwG088153; Thu, 28 Dec 2017 23:58:33 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBSNwXtZ088152; Thu, 28 Dec 2017 23:58:33 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201712282358.vBSNwXtZ088152@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 28 Dec 2017 23:58:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r327324 - vendor/compiler-rt/compiler-rt-trunk-r321545 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/compiler-rt/compiler-rt-trunk-r321545 X-SVN-Commit-Revision: 327324 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 23:58:35 -0000 Author: dim Date: Thu Dec 28 23:58:33 2017 New Revision: 327324 URL: https://svnweb.freebsd.org/changeset/base/327324 Log: Tag compiler-rt trunk r321545. Added: vendor/compiler-rt/compiler-rt-trunk-r321545/ - copied from r327323, vendor/compiler-rt/dist/ From owner-svn-src-all@freebsd.org Thu Dec 28 23:58:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25E6AE8A2AC; Thu, 28 Dec 2017 23:58:45 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 70AA27292C; Thu, 28 Dec 2017 23:58:42 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBSNwfUZ088202; Thu, 28 Dec 2017 23:58:41 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBSNwfps088201; Thu, 28 Dec 2017 23:58:41 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201712282358.vBSNwfps088201@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 28 Dec 2017 23:58:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r327325 - vendor/libc++/libc++-trunk-r321545 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/libc++/libc++-trunk-r321545 X-SVN-Commit-Revision: 327325 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 23:58:45 -0000 Author: dim Date: Thu Dec 28 23:58:41 2017 New Revision: 327325 URL: https://svnweb.freebsd.org/changeset/base/327325 Log: Tag libc++ trunk r321545. Added: vendor/libc++/libc++-trunk-r321545/ - copied from r327324, vendor/libc++/dist/ From owner-svn-src-all@freebsd.org Thu Dec 28 23:58:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12BCAE8A2DA; Thu, 28 Dec 2017 23:58:49 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E3A8D729D0; Thu, 28 Dec 2017 23:58:46 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBSNwjaS088251; Thu, 28 Dec 2017 23:58:45 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBSNwj1V088250; Thu, 28 Dec 2017 23:58:45 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201712282358.vBSNwj1V088250@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 28 Dec 2017 23:58:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r327326 - vendor/lld/lld-trunk-r321545 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/lld/lld-trunk-r321545 X-SVN-Commit-Revision: 327326 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 23:58:49 -0000 Author: dim Date: Thu Dec 28 23:58:45 2017 New Revision: 327326 URL: https://svnweb.freebsd.org/changeset/base/327326 Log: Tag lld trunk r321545. Added: vendor/lld/lld-trunk-r321545/ - copied from r327325, vendor/lld/dist/ From owner-svn-src-all@freebsd.org Thu Dec 28 23:58:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91C23E8A323; Thu, 28 Dec 2017 23:58:53 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5974972AA1; Thu, 28 Dec 2017 23:58:53 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBSNwqbu088299; Thu, 28 Dec 2017 23:58:52 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBSNwqxc088298; Thu, 28 Dec 2017 23:58:52 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201712282358.vBSNwqxc088298@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 28 Dec 2017 23:58:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r327327 - vendor/lldb/lldb-trunk-r321545 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/lldb/lldb-trunk-r321545 X-SVN-Commit-Revision: 327327 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 23:58:53 -0000 Author: dim Date: Thu Dec 28 23:58:52 2017 New Revision: 327327 URL: https://svnweb.freebsd.org/changeset/base/327327 Log: Tag lldb trunk r321545. Added: vendor/lldb/lldb-trunk-r321545/ - copied from r327326, vendor/lldb/dist/ From owner-svn-src-all@freebsd.org Fri Dec 29 00:27:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA4F8E8E00B; Fri, 29 Dec 2017 00:27:13 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 74B9273C4C; Fri, 29 Dec 2017 00:27:13 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBT0RCco000662; Fri, 29 Dec 2017 00:27:12 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBT0RC2C000660; Fri, 29 Dec 2017 00:27:12 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201712290027.vBT0RC2C000660@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 29 Dec 2017 00:27:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327329 - head/sys/dev/txp X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/dev/txp X-SVN-Commit-Revision: 327329 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Dec 2017 00:27:13 -0000 Author: pfg Date: Fri Dec 29 00:27:12 2017 New Revision: 327329 URL: https://svnweb.freebsd.org/changeset/base/327329 Log: dev/txp: Update if_txpreg.h to match OpenBSD's version. Resolve a minor mismatch: TXP_CMD_READ_VERSION instead of TXP_CMD_VERSIONS_READ. Curiously the later is defined but not used in OpenBSD. Obtained from: OpenBSD (CVS 1.31-1.34) MFC after: 1 week Modified: head/sys/dev/txp/if_txp.c head/sys/dev/txp/if_txpreg.h Modified: head/sys/dev/txp/if_txp.c ============================================================================== --- head/sys/dev/txp/if_txp.c Fri Dec 29 00:21:50 2017 (r327328) +++ head/sys/dev/txp/if_txp.c Fri Dec 29 00:27:12 2017 (r327329) @@ -373,7 +373,7 @@ txp_attach(device_t dev) * diagnose sleep image specific issues. */ rsp = NULL; - if (txp_ext_command(sc, TXP_CMD_READ_VERSION, 0, 0, 0, NULL, 0, + if (txp_ext_command(sc, TXP_CMD_VERSIONS_READ, 0, 0, 0, NULL, 0, &rsp, TXP_CMD_WAIT)) { device_printf(dev, "can not read sleep image version\n"); error = ENXIO; Modified: head/sys/dev/txp/if_txpreg.h ============================================================================== --- head/sys/dev/txp/if_txpreg.h Fri Dec 29 00:21:50 2017 (r327328) +++ head/sys/dev/txp/if_txpreg.h Fri Dec 29 00:27:12 2017 (r327329) @@ -1,4 +1,4 @@ -/* $OpenBSD: if_txpreg.h,v 1.30 2001/06/23 04:18:02 jason Exp $ */ +/* $OpenBSD: if_txpreg.h,v 1.34 2001/11/05 17:25:58 art Exp $ */ /* $FreeBSD$ */ /*- @@ -166,7 +166,7 @@ #define TXP_CMD_FILTER_TABLE_MODE_WRITE 0x3d #define TXP_CMD_FILTER_TCL_WRITE 0x3e #define TXP_CMD_FILTER_TBL_READ 0x3f -#define TXP_CMD_READ_VERSION 0x43 +#define TXP_CMD_VERSIONS_READ 0x43 #define TXP_CMD_FILTER_DEFINE 0x45 #define TXP_CMD_ADD_WAKEUP_PKT 0x46 #define TXP_CMD_ADD_SLEEP_PKT 0x47 @@ -384,6 +384,7 @@ struct txp_frag_desc { #define FRAG_FLAGS_TYPE_OPT 0x03 /* type: options */ #define FRAG_FLAGS_TYPE_RX 0x04 /* type: command */ #define FRAG_FLAGS_TYPE_RESP 0x05 /* type: response */ +#define FRAG_FLAGS_VALID 0x80 /* valid descriptor */ struct txp_opt_desc { uint8_t opt_desctype:3, From owner-svn-src-all@freebsd.org Fri Dec 29 00:59:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 432B0E9E995; Fri, 29 Dec 2017 00:59:58 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D8A974ACE; Fri, 29 Dec 2017 00:59:57 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBT0xvJZ013380; Fri, 29 Dec 2017 00:59:57 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBT0xv0U013379; Fri, 29 Dec 2017 00:59:57 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201712290059.vBT0xv0U013379@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 29 Dec 2017 00:59:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327331 - head/sys/dev/txp X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/dev/txp X-SVN-Commit-Revision: 327331 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Dec 2017 00:59:58 -0000 Author: pfg Date: Fri Dec 29 00:59:56 2017 New Revision: 327331 URL: https://svnweb.freebsd.org/changeset/base/327331 Log: if_txpreg.h: drop clauses 3 and 4. Obtained from: OpenBSD (CVS 1.35) Modified: head/sys/dev/txp/if_txpreg.h Modified: head/sys/dev/txp/if_txpreg.h ============================================================================== --- head/sys/dev/txp/if_txpreg.h Fri Dec 29 00:56:15 2017 (r327330) +++ head/sys/dev/txp/if_txpreg.h Fri Dec 29 00:59:56 2017 (r327331) @@ -1,8 +1,8 @@ -/* $OpenBSD: if_txpreg.h,v 1.34 2001/11/05 17:25:58 art Exp $ */ +/* $OpenBSD: if_txpreg.h,v 1.35 2003/06/04 19:36:33 deraadt Exp $ */ /* $FreeBSD$ */ /*- - * SPDX-License-Identifier: BSD-4-Clause + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2001 Aaron Campbell . * All rights reserved. @@ -15,11 +15,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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Aaron Campbell. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES From owner-svn-src-all@freebsd.org Fri Dec 29 02:30:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15AB0EA3427; Fri, 29 Dec 2017 02:30:23 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E0BE8771C0; Fri, 29 Dec 2017 02:30:22 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBT2UMI8050313; Fri, 29 Dec 2017 02:30:22 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBT2UMRd050312; Fri, 29 Dec 2017 02:30:22 GMT (envelope-from np@FreeBSD.org) Message-Id: <201712290230.vBT2UMRd050312@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 29 Dec 2017 02:30:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327332 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 327332 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Dec 2017 02:30:23 -0000 Author: np Date: Fri Dec 29 02:30:21 2017 New Revision: 327332 URL: https://svnweb.freebsd.org/changeset/base/327332 Log: cxgbe(4): Reduce duplication by consolidating minor variations of the same code into a single routine. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Fri Dec 29 00:59:56 2017 (r327331) +++ head/sys/dev/cxgbe/t4_sge.c Fri Dec 29 02:30:21 2017 (r327332) @@ -198,6 +198,8 @@ static int free_ring(struct adapter *, bus_dma_tag_t, static int alloc_iq_fl(struct vi_info *, struct sge_iq *, struct sge_fl *, int, int); static int free_iq_fl(struct vi_info *, struct sge_iq *, struct sge_fl *); +static void add_iq_sysctls(struct sysctl_ctx_list *, struct sysctl_oid *, + struct sge_iq *); static void add_fl_sysctls(struct adapter *, struct sysctl_ctx_list *, struct sysctl_oid *, struct sge_fl *); static int alloc_fwq(struct adapter *); @@ -2824,6 +2826,27 @@ free_iq_fl(struct vi_info *vi, struct sge_iq *iq, stru } static void +add_iq_sysctls(struct sysctl_ctx_list *ctx, struct sysctl_oid *oid, + struct sge_iq *iq) +{ + struct sysctl_oid_list *children = SYSCTL_CHILDREN(oid); + + SYSCTL_ADD_UAUTO(ctx, children, OID_AUTO, "ba", CTLFLAG_RD, &iq->ba, + "bus address of descriptor ring"); + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "dmalen", CTLFLAG_RD, NULL, + iq->qsize * IQ_ESIZE, "descriptor ring size in bytes"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "abs_id", + CTLTYPE_INT | CTLFLAG_RD, &iq->abs_id, 0, sysctl_uint16, "I", + "absolute id of the queue"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cntxt_id", + CTLTYPE_INT | CTLFLAG_RD, &iq->cntxt_id, 0, sysctl_uint16, "I", + "SGE context id of the queue"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cidx", + CTLTYPE_INT | CTLFLAG_RD, &iq->cidx, 0, sysctl_uint16, "I", + "consumer index"); +} + +static void add_fl_sysctls(struct adapter *sc, struct sysctl_ctx_list *ctx, struct sysctl_oid *oid, struct sge_fl *fl) { @@ -2890,22 +2913,8 @@ alloc_fwq(struct adapter *sc) oid = SYSCTL_ADD_NODE(&sc->ctx, children, OID_AUTO, "fwq", CTLFLAG_RD, NULL, "firmware event queue"); - children = SYSCTL_CHILDREN(oid); + add_iq_sysctls(&sc->ctx, oid, fwq); - SYSCTL_ADD_UAUTO(&sc->ctx, children, OID_AUTO, "ba", CTLFLAG_RD, - &fwq->ba, "bus address of descriptor ring"); - SYSCTL_ADD_INT(&sc->ctx, children, OID_AUTO, "dmalen", CTLFLAG_RD, NULL, - fwq->qsize * IQ_ESIZE, "descriptor ring size in bytes"); - SYSCTL_ADD_PROC(&sc->ctx, children, OID_AUTO, "abs_id", - CTLTYPE_INT | CTLFLAG_RD, &fwq->abs_id, 0, sysctl_uint16, "I", - "absolute id of the queue"); - SYSCTL_ADD_PROC(&sc->ctx, children, OID_AUTO, "cntxt_id", - CTLTYPE_INT | CTLFLAG_RD, &fwq->cntxt_id, 0, sysctl_uint16, "I", - "SGE context id of the queue"); - SYSCTL_ADD_PROC(&sc->ctx, children, OID_AUTO, "cidx", - CTLTYPE_INT | CTLFLAG_RD, &fwq->cidx, 0, sysctl_uint16, "I", - "consumer index"); - return (0); } @@ -3007,19 +3016,7 @@ alloc_rxq(struct vi_info *vi, struct sge_rxq *rxq, int NULL, "rx queue"); children = SYSCTL_CHILDREN(oid); - SYSCTL_ADD_UAUTO(&vi->ctx, children, OID_AUTO, "ba", CTLFLAG_RD, - &rxq->iq.ba, "bus address of descriptor ring"); - SYSCTL_ADD_INT(&vi->ctx, children, OID_AUTO, "dmalen", CTLFLAG_RD, NULL, - rxq->iq.qsize * IQ_ESIZE, "descriptor ring size in bytes"); - SYSCTL_ADD_PROC(&vi->ctx, children, OID_AUTO, "abs_id", - CTLTYPE_INT | CTLFLAG_RD, &rxq->iq.abs_id, 0, sysctl_uint16, "I", - "absolute id of the queue"); - SYSCTL_ADD_PROC(&vi->ctx, children, OID_AUTO, "cntxt_id", - CTLTYPE_INT | CTLFLAG_RD, &rxq->iq.cntxt_id, 0, sysctl_uint16, "I", - "SGE context id of the queue"); - SYSCTL_ADD_PROC(&vi->ctx, children, OID_AUTO, "cidx", - CTLTYPE_INT | CTLFLAG_RD, &rxq->iq.cidx, 0, sysctl_uint16, "I", - "consumer index"); + add_iq_sysctls(&vi->ctx, oid, &rxq->iq); #if defined(INET) || defined(INET6) SYSCTL_ADD_U64(&vi->ctx, children, OID_AUTO, "lro_queued", CTLFLAG_RD, &rxq->lro.lro_queued, 0, NULL); @@ -3075,22 +3072,7 @@ alloc_ofld_rxq(struct vi_info *vi, struct sge_ofld_rxq snprintf(name, sizeof(name), "%d", idx); oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, name, CTLFLAG_RD, NULL, "rx queue"); - children = SYSCTL_CHILDREN(oid); - - SYSCTL_ADD_UAUTO(&vi->ctx, children, OID_AUTO, "ba", CTLFLAG_RD, - &ofld_rxq->iq.ba, "bus address of descriptor ring"); - SYSCTL_ADD_INT(&vi->ctx, children, OID_AUTO, "dmalen", CTLFLAG_RD, NULL, - ofld_rxq->iq.qsize * IQ_ESIZE, "descriptor ring size in bytes"); - SYSCTL_ADD_PROC(&vi->ctx, children, OID_AUTO, "abs_id", - CTLTYPE_INT | CTLFLAG_RD, &ofld_rxq->iq.abs_id, 0, sysctl_uint16, - "I", "absolute id of the queue"); - SYSCTL_ADD_PROC(&vi->ctx, children, OID_AUTO, "cntxt_id", - CTLTYPE_INT | CTLFLAG_RD, &ofld_rxq->iq.cntxt_id, 0, sysctl_uint16, - "I", "SGE context id of the queue"); - SYSCTL_ADD_PROC(&vi->ctx, children, OID_AUTO, "cidx", - CTLTYPE_INT | CTLFLAG_RD, &ofld_rxq->iq.cidx, 0, sysctl_uint16, "I", - "consumer index"); - + add_iq_sysctls(&vi->ctx, oid, &ofld_rxq->iq); add_fl_sysctls(pi->adapter, &vi->ctx, oid, &ofld_rxq->fl); return (rc); From owner-svn-src-all@freebsd.org Fri Dec 29 04:50:00 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5111AEA96AC; Fri, 29 Dec 2017 04:50:00 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 27F3F7B972; Fri, 29 Dec 2017 04:50:00 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBT4nxcC010150; Fri, 29 Dec 2017 04:49:59 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBT4nxjq010149; Fri, 29 Dec 2017 04:49:59 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201712290449.vBT4nxjq010149@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Fri, 29 Dec 2017 04:49:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327333 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 327333 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Dec 2017 04:50:00 -0000 Author: eadler Date: Fri Dec 29 04:49:59 2017 New Revision: 327333 URL: https://svnweb.freebsd.org/changeset/base/327333 Log: bsd-family-tree: add HardenedBSD This adds HardenedBSD which is a pseudo-fork of FreeBSD. It hasn't had a release yet, but does does have active users and a community. As such document it as a branch off of FreeBSD-stable. Ideally this adds enough space so that future releases are easy enough to add. Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Fri Dec 29 02:30:21 2017 (r327332) +++ head/share/misc/bsd-family-tree Fri Dec 29 04:49:59 2017 (r327333) @@ -357,15 +357,23 @@ FreeBSD 5.2 | | | | FreeBSD | | | | DragonFly 5.0.0 | 11.1 FreeBSD | | | | | | 10.4 | | OpenBSD 6.2 DragonFly 5.0.1 - | | | | | | - | | | | | DragonFly 5.0.2 - | | | | | | - | | | | | | - | v | | | | - | | | | | -FreeBSD 12 -current | NetBSD -current OpenBSD -current DragonFly -current - | | | | | - v v v v v + | | | v | | | + | | | | | DragonFly 5.0.2 + | | | | | | + | | FreeBSD | | | + | | 10-stable | | | + | FreeBSD \ | | | + | 11-stable \ | | | + | / `| | | | + | HardenedBSD | | | | + | 11-stable HardenedBSD | | | + | 10-stable | | | + | | | | + | | | | + | | | | +FreeBSD 12 -current NetBSD -current OpenBSD -current DragonFly -current + | | | | + v v v v Time ---------------- From owner-svn-src-all@freebsd.org Fri Dec 29 05:01:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01A10EA9F30; Fri, 29 Dec 2017 05:01:09 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BECCA7BF53; Fri, 29 Dec 2017 05:01:08 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBT517nQ014478; Fri, 29 Dec 2017 05:01:07 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBT5170p014477; Fri, 29 Dec 2017 05:01:07 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201712290501.vBT5170p014477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Fri, 29 Dec 2017 05:01:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327334 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 327334 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Dec 2017 05:01:09 -0000 Author: eadler Date: Fri Dec 29 05:01:07 2017 New Revision: 327334 URL: https://svnweb.freebsd.org/changeset/base/327334 Log: bsd-family-tree: add NetBSD 6.0.6 This was a missing release. Released on the same day as 6.1.5 per https://blog.netbsd.org/tnf/entry/netbsd_6_1_5_and Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Fri Dec 29 04:49:59 2017 (r327333) +++ head/share/misc/bsd-family-tree Fri Dec 29 05:01:07 2017 (r327334) @@ -290,6 +290,9 @@ FreeBSD 5.2 | | | | | | | | | | | | | | | | | | NetBSD | | | | | | | | 6.0.5 | | + | | | | | | | | | + | | | | | | NetBSD | | + | | | | | | 6.0.6 | | | | | | | | | | | | | | | |`-NetBSD 6.1 | | | | FreeBSD | | | | | @@ -703,6 +706,7 @@ DragonFly 3.8.1 2014-06-16 [DFB] DragonFly 3.6.3 2014-06-17 [DFB] FreeBSD 9.3 2014-07-05 [FBD] DragonFly 3.8.2 2014-08-08 [DFB] +NetBSD 6.0.6 2014-09-22 [NDB] NetBSD 6.1.5 2014-09-22 [NBD] Mac OS X 10.10 2014-10-16 [APL] OpenBSD 5.6 2014-11-01 [OBD] From owner-svn-src-all@freebsd.org Fri Dec 29 06:22:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 723C4EACD5C; Fri, 29 Dec 2017 06:22:06 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3FA107E1A9; Fri, 29 Dec 2017 06:22:06 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBT6M5IN051297; Fri, 29 Dec 2017 06:22:05 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBT6M5PZ051296; Fri, 29 Dec 2017 06:22:05 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201712290622.vBT6M5PZ051296@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 29 Dec 2017 06:22:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327335 - head/sbin/fsdb X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/sbin/fsdb X-SVN-Commit-Revision: 327335 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Dec 2017 06:22:06 -0000 Author: delphij Date: Fri Dec 29 06:22:05 2017 New Revision: 327335 URL: https://svnweb.freebsd.org/changeset/base/327335 Log: The fix in r327273 turns a memory leak into freeing wild pointer. Fix this by freeing only the initialized pointer. Modified: head/sbin/fsdb/fsdb.c Modified: head/sbin/fsdb/fsdb.c ============================================================================== --- head/sbin/fsdb/fsdb.c Fri Dec 29 05:01:07 2017 (r327334) +++ head/sbin/fsdb/fsdb.c Fri Dec 29 06:22:05 2017 (r327335) @@ -565,8 +565,10 @@ CMDFUNCSTART(findblk) end: curinum = ocurrent; curinode = ginode(curinum); - free(wantedblk32); - free(wantedblk64); + if (is_ufs2) + free(wantedblk64); + else + free(wantedblk32); return 0; } From owner-svn-src-all@freebsd.org Fri Dec 29 07:23:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0436EEAEF7E; Fri, 29 Dec 2017 07:23:20 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BEE167FA68; Fri, 29 Dec 2017 07:23:19 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBT7NIn8075940; Fri, 29 Dec 2017 07:23:18 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBT7NIwQ075939; Fri, 29 Dec 2017 07:23:18 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201712290723.vBT7NIwQ075939@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 29 Dec 2017 07:23:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327336 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 327336 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Dec 2017 07:23:20 -0000 Author: cy Date: Fri Dec 29 07:23:18 2017 New Revision: 327336 URL: https://svnweb.freebsd.org/changeset/base/327336 Log: Correct the comment describing badrs which is bad router solicitiation, not bad router advertisement. MFC after: 3 days Modified: head/sys/netinet/icmp6.h Modified: head/sys/netinet/icmp6.h ============================================================================== --- head/sys/netinet/icmp6.h Fri Dec 29 06:22:05 2017 (r327335) +++ head/sys/netinet/icmp6.h Fri Dec 29 07:23:18 2017 (r327336) @@ -628,7 +628,7 @@ struct icmp6stat { uint64_t icp6s_nd_badopt; /* bad ND options */ uint64_t icp6s_badns; /* bad neighbor solicitation */ uint64_t icp6s_badna; /* bad neighbor advertisement */ - uint64_t icp6s_badrs; /* bad router advertisement */ + uint64_t icp6s_badrs; /* bad router solicitation */ uint64_t icp6s_badra; /* bad router advertisement */ uint64_t icp6s_badredirect; /* bad redirect message */ }; From owner-svn-src-all@freebsd.org Fri Dec 29 10:47:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37303E816C0; Fri, 29 Dec 2017 10:47:26 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EAA6B652E0; Fri, 29 Dec 2017 10:47:25 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBTAlPMb060113; Fri, 29 Dec 2017 10:47:25 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBTAlOC5060107; Fri, 29 Dec 2017 10:47:24 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201712291047.vBTAlOC5060107@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 29 Dec 2017 10:47:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r327337 - stable/11/sys/netinet6 X-SVN-Group: stable-11 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/11/sys/netinet6 X-SVN-Commit-Revision: 327337 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Dec 2017 10:47:26 -0000 Author: ae Date: Fri Dec 29 10:47:24 2017 New Revision: 327337 URL: https://svnweb.freebsd.org/changeset/base/327337 Log: MFC r326876: Follow the RFC6980 and silently ignore following IPv6 NDP messages that had the IPv6 fragmentation header: o Neighbor Solicitation o Neighbor Advertisement o Router Solicitation o Router Advertisement o Redirect Introduce M_FRAGMENTED mbuf flag, and set it after IPv6 fragment reassembly is completed. Then check the presence of this flag in correspondig ND6 handling routines. PR: 224247 Modified: stable/11/sys/netinet6/frag6.c stable/11/sys/netinet6/icmp6.c stable/11/sys/netinet6/in6.h stable/11/sys/netinet6/nd6_nbr.c stable/11/sys/netinet6/nd6_rtr.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet6/frag6.c ============================================================================== --- stable/11/sys/netinet6/frag6.c Fri Dec 29 07:23:18 2017 (r327336) +++ stable/11/sys/netinet6/frag6.c Fri Dec 29 10:47:24 2017 (r327337) @@ -225,6 +225,7 @@ frag6_input(struct mbuf **mp, int *offp, int proto) IP6STAT_INC(ip6s_reassembled); in6_ifstat_inc(dstifp, ifs6_reass_ok); *offp = offset; + m->m_flags |= M_FRAGMENTED; return (ip6f->ip6f_nxt); } @@ -825,5 +826,6 @@ ip6_deletefraghdr(struct mbuf *m, int offset, int wait m_cat(m, t); } + m->m_flags |= M_FRAGMENTED; return (0); } Modified: stable/11/sys/netinet6/icmp6.c ============================================================================== --- stable/11/sys/netinet6/icmp6.c Fri Dec 29 07:23:18 2017 (r327336) +++ stable/11/sys/netinet6/icmp6.c Fri Dec 29 10:47:24 2017 (r327337) @@ -2249,6 +2249,10 @@ icmp6_redirect_input(struct mbuf *m, int off) if (!V_icmp6_rediraccept) goto freeit; + /* RFC 6980: Nodes MUST silently ignore fragments */ + if(m->m_flags & M_FRAGMENTED) + goto freeit; + #ifndef PULLDOWN_TEST IP6_EXTHDR_CHECK(m, off, icmp6len,); nd_rd = (struct nd_redirect *)((caddr_t)ip6 + off); Modified: stable/11/sys/netinet6/in6.h ============================================================================== --- stable/11/sys/netinet6/in6.h Fri Dec 29 07:23:18 2017 (r327336) +++ stable/11/sys/netinet6/in6.h Fri Dec 29 10:47:24 2017 (r327337) @@ -653,6 +653,7 @@ struct ip6_mtuinfo { #define M_LOOP M_PROTO6 #define M_AUTHIPDGM M_PROTO7 #define M_RTALERT_MLD M_PROTO8 +#define M_FRAGMENTED M_PROTO9 /* contained fragment header */ #ifdef _KERNEL struct cmsghdr; Modified: stable/11/sys/netinet6/nd6_nbr.c ============================================================================== --- stable/11/sys/netinet6/nd6_nbr.c Fri Dec 29 07:23:18 2017 (r327336) +++ stable/11/sys/netinet6/nd6_nbr.c Fri Dec 29 10:47:24 2017 (r327337) @@ -135,6 +135,10 @@ nd6_ns_input(struct mbuf *m, int off, int icmp6len) struct sockaddr_dl proxydl; char ip6bufs[INET6_ADDRSTRLEN], ip6bufd[INET6_ADDRSTRLEN]; + /* RFC 6980: Nodes MUST silently ignore fragments */ + if(m->m_flags & M_FRAGMENTED) + goto freeit; + rflag = (V_ip6_forwarding) ? ND_NA_FLAG_ROUTER : 0; if (ND_IFINFO(ifp)->flags & ND6_IFF_ACCEPT_RTADV && V_ip6_norbit_raif) rflag = 0; @@ -628,6 +632,10 @@ nd6_na_input(struct mbuf *m, int off, int icmp6len) size_t linkhdrsize; int lladdr_off; char ip6bufs[INET6_ADDRSTRLEN], ip6bufd[INET6_ADDRSTRLEN]; + + /* RFC 6980: Nodes MUST silently ignore fragments */ + if(m->m_flags & M_FRAGMENTED) + goto freeit; if (ip6->ip6_hlim != 255) { nd6log((LOG_ERR, Modified: stable/11/sys/netinet6/nd6_rtr.c ============================================================================== --- stable/11/sys/netinet6/nd6_rtr.c Fri Dec 29 07:23:18 2017 (r327336) +++ stable/11/sys/netinet6/nd6_rtr.c Fri Dec 29 10:47:24 2017 (r327337) @@ -137,6 +137,10 @@ nd6_rs_input(struct mbuf *m, int off, int icmp6len) if (!V_ip6_forwarding || ND_IFINFO(ifp)->flags & ND6_IFF_ACCEPT_RTADV) goto freeit; + /* RFC 6980: Nodes MUST silently ignore fragments */ + if(m->m_flags & M_FRAGMENTED) + goto freeit; + /* Sanity checks */ if (ip6->ip6_hlim != 255) { nd6log((LOG_ERR, @@ -225,6 +229,10 @@ nd6_ra_input(struct mbuf *m, int off, int icmp6len) * ND6_IFF_ACCEPT_RTADV is on the receiving interface. */ if (!(ndi->flags & ND6_IFF_ACCEPT_RTADV)) + goto freeit; + + /* RFC 6980: Nodes MUST silently ignore fragments */ + if(m->m_flags & M_FRAGMENTED) goto freeit; if (ip6->ip6_hlim != 255) { From owner-svn-src-all@freebsd.org Fri Dec 29 12:48:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A17F3E87A47; Fri, 29 Dec 2017 12:48:20 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C1FE68B4C; Fri, 29 Dec 2017 12:48:20 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBTCmJuu010067; Fri, 29 Dec 2017 12:48:19 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBTCmJqd010065; Fri, 29 Dec 2017 12:48:19 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201712291248.vBTCmJqd010065@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Fri, 29 Dec 2017 12:48:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327339 - head/sys/dev/sdhci X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/sys/dev/sdhci X-SVN-Commit-Revision: 327339 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Dec 2017 12:48:20 -0000 Author: marius Date: Fri Dec 29 12:48:19 2017 New Revision: 327339 URL: https://svnweb.freebsd.org/changeset/base/327339 Log: - There is no need to keep the tuning error and re-tuning interrupts enabled (though, no interrupt generation enabled for them) all the time as soon as (re-)tuning is supported; only enable them and let them generate interrupts when actually using (re-)tuning. - Also disable all interrupts except SDHCI_INT_DATA_AVAIL ones while executing tuning and not just their signaling. Modified: head/sys/dev/sdhci/sdhci.c Modified: head/sys/dev/sdhci/sdhci.c ============================================================================== --- head/sys/dev/sdhci/sdhci.c Fri Dec 29 12:47:23 2017 (r327338) +++ head/sys/dev/sdhci/sdhci.c Fri Dec 29 12:48:19 2017 (r327339) @@ -301,7 +301,7 @@ sdhci_init(struct sdhci_slot *slot) slot->intmask |= SDHCI_INT_CARD_REMOVE | SDHCI_INT_CARD_INSERT; } - WR4(slot, SDHCI_INT_ENABLE, slot->intmask | sdhci_tuning_intmask(slot)); + WR4(slot, SDHCI_INT_ENABLE, slot->intmask); WR4(slot, SDHCI_SIGNAL_ENABLE, slot->intmask); } @@ -654,6 +654,7 @@ sdhci_card_task(void *arg, int pending __unused) xpt_rescan(ccb); #else slot->intmask &= ~sdhci_tuning_intmask(slot); + WR4(slot, SDHCI_INT_ENABLE, slot->intmask); WR4(slot, SDHCI_SIGNAL_ENABLE, slot->intmask); slot->opt &= ~SDHCI_TUNING_ENABLED; SDHCI_UNLOCK(slot); @@ -1338,6 +1339,7 @@ sdhci_generic_tune(device_t brdev __unused, device_t r if (err == 0) { slot->opt |= SDHCI_TUNING_ENABLED; slot->intmask |= sdhci_tuning_intmask(slot); + WR4(slot, SDHCI_INT_ENABLE, slot->intmask); WR4(slot, SDHCI_SIGNAL_ENABLE, slot->intmask); if (slot->retune_ticks) { callout_reset(&slot->retune_callout, slot->retune_ticks, @@ -1406,6 +1408,7 @@ sdhci_exec_tuning(struct sdhci_slot *slot, bool reset) */ intmask = slot->intmask; slot->intmask = SDHCI_INT_DATA_AVAIL; + WR4(slot, SDHCI_INT_ENABLE, SDHCI_INT_DATA_AVAIL); WR4(slot, SDHCI_SIGNAL_ENABLE, SDHCI_INT_DATA_AVAIL); hostctrl2 = RD2(slot, SDHCI_HOST_CONTROL2); @@ -1438,6 +1441,7 @@ sdhci_exec_tuning(struct sdhci_slot *slot, bool reset) slot->opt = opt; slot->intmask = intmask; + WR4(slot, SDHCI_INT_ENABLE, intmask); WR4(slot, SDHCI_SIGNAL_ENABLE, intmask); if ((hostctrl2 & (SDHCI_CTRL2_EXEC_TUNING | From owner-svn-src-all@freebsd.org Fri Dec 29 14:31:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76599E8E67F; Fri, 29 Dec 2017 14:31:44 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DE5B6BDED; Fri, 29 Dec 2017 14:31:44 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBTEVhiW055874; Fri, 29 Dec 2017 14:31:43 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBTEVhx9055873; Fri, 29 Dec 2017 14:31:43 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201712291431.vBTEVhx9055873@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Fri, 29 Dec 2017 14:31:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327342 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 327342 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Dec 2017 14:31:44 -0000 Author: eadler Date: Fri Dec 29 14:31:43 2017 New Revision: 327342 URL: https://svnweb.freebsd.org/changeset/base/327342 Log: bsd-family-tree: add NetBSD 7.1.1; correct NetBSD abbrev Reported by: Herbert J. Skuhra Reported by: N.J. Mann Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Fri Dec 29 12:51:26 2017 (r327341) +++ head/share/misc/bsd-family-tree Fri Dec 29 14:31:43 2017 (r327342) @@ -355,15 +355,15 @@ FreeBSD 5.2 | | | | 11.0 | 10.12 | | NetBSD 7.0.2 | | | | | | | | | | | | | | | *- NetBSD 7.1 | | - | | | macOS | | DragonFly 4.8.0 - | | | 10.13 | OpenBSD 6.1 | - | FreeBSD | | | | DragonFly 5.0.0 - | 11.1 FreeBSD | | | | - | | 10.4 | | OpenBSD 6.2 DragonFly 5.0.1 - | | | v | | | - | | | | | DragonFly 5.0.2 - | | | | | | - | | FreeBSD | | | + | | | macOS | | | DragonFly 4.8.0 + | | | 10.13 | | OpenBSD 6.1 | + | FreeBSD | | | | | DragonFly 5.0.0 + | 11.1 FreeBSD | | | | | + | | 10.4 | | | OpenBSD 6.2 DragonFly 5.0.1 + | | | v | | | | + | | | | | | DragonFly 5.0.2 + | | | | | | | + | | FreeBSD | NetBSD 7.1.1 | | | | 10-stable | | | | FreeBSD \ | | | | 11-stable \ | | | @@ -698,15 +698,15 @@ NetBSD 6.0.4 2014-01-25 [NBD] NetBSD 6.1.3 2014-01-25 [NBD] DragonFly 3.6.1 2014-02-22 [DFB] DragonFly 3.6.2 2014-04-10 [DFB] -NetBSD 6.0.5 2014-04-12 [NDB] -NetBSD 6.1.4 2014-04-12 [NDB] +NetBSD 6.0.5 2014-04-12 [NBD] +NetBSD 6.1.4 2014-04-12 [NBD] OpenBSD 5.5 2014-05-01 [OBD] DragonFly 3.8.0 2014-06-04 [DFB] DragonFly 3.8.1 2014-06-16 [DFB] DragonFly 3.6.3 2014-06-17 [DFB] FreeBSD 9.3 2014-07-05 [FBD] DragonFly 3.8.2 2014-08-08 [DFB] -NetBSD 6.0.6 2014-09-22 [NDB] +NetBSD 6.0.6 2014-09-22 [NBD] NetBSD 6.1.5 2014-09-22 [NBD] Mac OS X 10.10 2014-10-16 [APL] OpenBSD 5.6 2014-11-01 [OBD] @@ -741,6 +741,7 @@ OpenBSD 6.2 2017-10-09 [OBD] DragonFly 5.0.0 2017-10-16 [DFB] DragonFly 5.0.1 2017-11-06 [DFB] DragonFly 5.0.2 2017-12-04 [DFB] +NetBSD 7.1.1 2017-12-22 [NBD] Bibliography ------------------------ From owner-svn-src-all@freebsd.org Fri Dec 29 14:56:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BA5EE9EE9B; Fri, 29 Dec 2017 14:56:47 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 68E116CB83; Fri, 29 Dec 2017 14:56:47 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBTEukEw064217; Fri, 29 Dec 2017 14:56:46 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBTEukI4064216; Fri, 29 Dec 2017 14:56:46 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201712291456.vBTEukI4064216@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Fri, 29 Dec 2017 14:56:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327343 - head/lib/libc/locale X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/lib/libc/locale X-SVN-Commit-Revision: 327343 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Dec 2017 14:56:47 -0000 Author: eadler Date: Fri Dec 29 14:56:46 2017 New Revision: 327343 URL: https://svnweb.freebsd.org/changeset/base/327343 Log: libc/locale: fix an off-by-one in newlocale Reported by: zrj@DragonFlyBSD.org Modified: head/lib/libc/locale/xlocale.c Modified: head/lib/libc/locale/xlocale.c ============================================================================== --- head/lib/libc/locale/xlocale.c Fri Dec 29 14:31:43 2017 (r327342) +++ head/lib/libc/locale/xlocale.c Fri Dec 29 14:56:46 2017 (r327343) @@ -275,7 +275,7 @@ locale_t newlocale(int mask, const char *locale, local for (type=0 ; typecomponents[type] = constructors[type](realLocale, new); From owner-svn-src-all@freebsd.org Fri Dec 29 15:04:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04063E9F5CB; Fri, 29 Dec 2017 15:04:51 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C55D26D087; Fri, 29 Dec 2017 15:04:50 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBTF4nYZ068601; Fri, 29 Dec 2017 15:04:49 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBTF4nK8068600; Fri, 29 Dec 2017 15:04:49 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201712291504.vBTF4nK8068600@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Fri, 29 Dec 2017 15:04:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327344 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 327344 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Dec 2017 15:04:51 -0000 Author: eadler Date: Fri Dec 29 15:04:49 2017 New Revision: 327344 URL: https://svnweb.freebsd.org/changeset/base/327344 Log: locale: add cnr (Montenegrin) See https://www.loc.gov/standards/iso639-2/php/code_changes.php Modified: head/share/misc/iso639 Modified: head/share/misc/iso639 ============================================================================== --- head/share/misc/iso639 Fri Dec 29 14:56:46 2017 (r327343) +++ head/share/misc/iso639 Fri Dec 29 15:04:49 2017 (r327344) @@ -127,6 +127,7 @@ cu chu chu Church Slavic; Old Slavonic; Church Slavoni cv chv chv Chuvash chy chy Cheyenne cmc cmc Chamic languages + cnr cnr Montenegrin cop cop Coptic kw cor cor Cornish co cos cos Corsican From owner-svn-src-all@freebsd.org Fri Dec 29 15:38:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E253EA102A; Fri, 29 Dec 2017 15:38:45 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DEF2F6E034; Fri, 29 Dec 2017 15:38:44 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBTFcigc081381; Fri, 29 Dec 2017 15:38:44 GMT (envelope-from phk@FreeBSD.org) Received: (from phk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBTFchoN081380; Fri, 29 Dec 2017 15:38:43 GMT (envelope-from phk@FreeBSD.org) Message-Id: <201712291538.vBTFchoN081380@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phk set sender to phk@FreeBSD.org using -f From: Poul-Henning Kamp Date: Fri, 29 Dec 2017 15:38:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327345 - head/tools/tools/sysbuild X-SVN-Group: head X-SVN-Commit-Author: phk X-SVN-Commit-Paths: head/tools/tools/sysbuild X-SVN-Commit-Revision: 327345 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Dec 2017 15:38:45 -0000 Author: phk Date: Fri Dec 29 15:38:43 2017 New Revision: 327345 URL: https://svnweb.freebsd.org/changeset/base/327345 Log: Add a crude workaround for ports with flavors Modified: head/tools/tools/sysbuild/sysbuild.sh Modified: head/tools/tools/sysbuild/sysbuild.sh ============================================================================== --- head/tools/tools/sysbuild/sysbuild.sh Fri Dec 29 15:04:49 2017 (r327344) +++ head/tools/tools/sysbuild/sysbuild.sh Fri Dec 29 15:38:43 2017 (r327345) @@ -196,13 +196,20 @@ ports_recurse() ( echo "$t" >> /tmp/_.plist.tdone for d do + fl="" if [ ! -d $d ] ; then - echo "Missing port $d ($t)" 1>&2 - continue + fl=FLAVOR=`expr $d : '.*@\(.*\)'` + bd=`expr $d : '\(.*\)@.*'` + if [ ! -d $bd ] ; then + echo "Missing port $d ($t) (fl $fl) (bd $bd)" 1>&2 + continue + fi + echo "Flavored port $d ($t) (fl $fl) (bd $bd)" 1>&2 + d=$bd fi d=`cd /usr/ports && cd $d && /bin/pwd` if [ ! -f $d/Makefile ] ; then - echo "Missing port $d" 1>&2 + echo "Missing port (Makefile) $d" 1>&2 continue fi if [ "x$t" != "x." ] ; then @@ -216,7 +223,7 @@ ports_recurse() ( ( cd $d l="" - for a in `ports_make -V _UNIFIED_DEPENDS` + for a in `ports_make -V _UNIFIED_DEPENDS $fl` do x=`expr "$a" : '.*:\(.*\)'` l="${l} ${x}" From owner-svn-src-all@freebsd.org Fri Dec 29 16:06:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7E3FEA2AC9; Fri, 29 Dec 2017 16:06:12 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8B82B6F47D; Fri, 29 Dec 2017 16:06:12 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBTG6BNt094090; Fri, 29 Dec 2017 16:06:11 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBTG6Amr094072; Fri, 29 Dec 2017 16:06:10 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201712291606.vBTG6Amr094072@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 29 Dec 2017 16:06:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327346 - head/tests/sys/geom/class/eli X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/geom/class/eli X-SVN-Commit-Revision: 327346 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Dec 2017 16:06:13 -0000 Author: asomers Date: Fri Dec 29 16:06:10 2017 New Revision: 327346 URL: https://svnweb.freebsd.org/changeset/base/327346 Log: Fix potential TOCTTOU bug in the geli tests This change mostly reverts r293436, which introduced the bug due to a belief that geli(8) would allocate md(4) devices by itself. However, that belief is incorrect. Instead of using linear probing to find available md(4) numbers, it's best to use the existing attach_md function. Reviewed by: ngie MFC after: 2 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D13666 Modified: head/tests/sys/geom/class/eli/attach_d_test.sh head/tests/sys/geom/class/eli/conf.sh head/tests/sys/geom/class/eli/configure_b_B_test.sh head/tests/sys/geom/class/eli/delkey_test.sh head/tests/sys/geom/class/eli/detach_l_test.sh head/tests/sys/geom/class/eli/init_B_test.sh head/tests/sys/geom/class/eli/init_J_test.sh head/tests/sys/geom/class/eli/init_a_test.sh head/tests/sys/geom/class/eli/init_alias_test.sh head/tests/sys/geom/class/eli/init_i_P_test.sh head/tests/sys/geom/class/eli/init_test.sh head/tests/sys/geom/class/eli/integrity_copy_test.sh head/tests/sys/geom/class/eli/integrity_data_test.sh head/tests/sys/geom/class/eli/integrity_hmac_test.sh head/tests/sys/geom/class/eli/kill_test.sh head/tests/sys/geom/class/eli/nokey_test.sh head/tests/sys/geom/class/eli/onetime_a_test.sh head/tests/sys/geom/class/eli/onetime_d_test.sh head/tests/sys/geom/class/eli/onetime_test.sh head/tests/sys/geom/class/eli/readonly_test.sh head/tests/sys/geom/class/eli/resize_test.sh head/tests/sys/geom/class/eli/setkey_test.sh Modified: head/tests/sys/geom/class/eli/attach_d_test.sh ============================================================================== --- head/tests/sys/geom/class/eli/attach_d_test.sh Fri Dec 29 15:38:43 2017 (r327345) +++ head/tests/sys/geom/class/eli/attach_d_test.sh Fri Dec 29 16:06:10 2017 (r327346) @@ -6,30 +6,30 @@ base=`basename $0` sectors=100 keyfile=`mktemp $base.XXXXXX` || exit 1 -mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 +md=$(attach_md -t malloc -s `expr $sectors + 1`) echo "1..3" dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 -geli init -B none -P -K $keyfile md${no} -geli attach -d -p -k $keyfile md${no} -if [ -c /dev/md${no}.eli ]; then +geli init -B none -P -K $keyfile ${md} +geli attach -d -p -k $keyfile ${md} +if [ -c /dev/${md}.eli ]; then echo "ok 1" else echo "not ok 1" fi # Be sure it doesn't detach on read. -dd if=/dev/md${no}.eli of=/dev/null 2>/dev/null +dd if=/dev/${md}.eli of=/dev/null 2>/dev/null sleep 1 -if [ -c /dev/md${no}.eli ]; then +if [ -c /dev/${md}.eli ]; then echo "ok 2" else echo "not ok 2" fi -true > /dev/md${no}.eli +true > /dev/${md}.eli sleep 1 -if [ ! -c /dev/md${no}.eli ]; then +if [ ! -c /dev/${md}.eli ]; then echo "ok 3" else echo "not ok 3" Modified: head/tests/sys/geom/class/eli/conf.sh ============================================================================== --- head/tests/sys/geom/class/eli/conf.sh Fri Dec 29 15:38:43 2017 (r327345) +++ head/tests/sys/geom/class/eli/conf.sh Fri Dec 29 16:06:10 2017 (r327346) @@ -4,13 +4,6 @@ class="eli" base=`basename $0` -# We need to use linear probing in order to detect the first available md(4) -# device instead of using mdconfig -a -t, because geli(8) attachs md(4) devices -no=0 -while [ -c /dev/md$no ]; do - : $(( no += 1 )) -done - # Execute `func` for each combination of cipher, sectorsize, and hmac algo # `func` usage should be: # func @@ -61,8 +54,14 @@ for_each_geli_config_nointegrity() { geli_test_cleanup() { - [ -c /dev/md${no}.eli ] && geli detach md${no}.eli - mdconfig -d -u $no + if [ -f "$TEST_MDS_FILE" ]; then + while read md; do + [ -c /dev/${md}.eli ] && \ + geli detach $md.eli 2>/dev/null + mdconfig -d -u $md 2>/dev/null + done < $TEST_MDS_FILE + fi + rm -f "$TEST_MDS_FILE" } trap geli_test_cleanup ABRT EXIT INT TERM Modified: head/tests/sys/geom/class/eli/configure_b_B_test.sh ============================================================================== --- head/tests/sys/geom/class/eli/configure_b_B_test.sh Fri Dec 29 15:38:43 2017 (r327345) +++ head/tests/sys/geom/class/eli/configure_b_B_test.sh Fri Dec 29 16:06:10 2017 (r327346) @@ -5,123 +5,123 @@ base=`basename $0` sectors=100 -mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 +md=$(attach_md -t malloc -s `expr $sectors + 1`) echo "1..17" -geli init -B none -P -K /dev/null md${no} +geli init -B none -P -K /dev/null ${md} if [ $? -eq 0 ]; then echo "ok 1" else echo "not ok 1" fi -geli dump md${no} | egrep 'flags: 0x0$' >/dev/null +geli dump ${md} | egrep 'flags: 0x0$' >/dev/null if [ $? -eq 0 ]; then echo "ok 2" else echo "not ok 2" fi -geli init -B none -b -P -K /dev/null md${no} +geli init -B none -b -P -K /dev/null ${md} if [ $? -eq 0 ]; then echo "ok 3" else echo "not ok 3" fi -geli dump md${no} | egrep 'flags: 0x2$' >/dev/null +geli dump ${md} | egrep 'flags: 0x2$' >/dev/null if [ $? -eq 0 ]; then echo "ok 4" else echo "not ok 4" fi -geli configure -B md${no} +geli configure -B ${md} if [ $? -eq 0 ]; then echo "ok 5" else echo "not ok 5" fi -geli dump md${no} | egrep 'flags: 0x0$' >/dev/null +geli dump ${md} | egrep 'flags: 0x0$' >/dev/null if [ $? -eq 0 ]; then echo "ok 6" else echo "not ok 6" fi -geli configure -b md${no} +geli configure -b ${md} if [ $? -eq 0 ]; then echo "ok 7" else echo "not ok 7" fi -geli dump md${no} | egrep 'flags: 0x2$' >/dev/null +geli dump ${md} | egrep 'flags: 0x2$' >/dev/null if [ $? -eq 0 ]; then echo "ok 8" else echo "not ok 8" fi -geli attach -p -k /dev/null md${no} +geli attach -p -k /dev/null ${md} if [ $? -eq 0 ]; then echo "ok 9" else echo "not ok 9" fi -geli list md${no}.eli | egrep '^Flags: .*BOOT' >/dev/null +geli list ${md}.eli | egrep '^Flags: .*BOOT' >/dev/null if [ $? -eq 0 ]; then echo "ok 10" else echo "not ok 10" fi -geli configure -B md${no} +geli configure -B ${md} if [ $? -eq 0 ]; then echo "ok 11" else echo "not ok 11" fi -geli list md${no}.eli | egrep '^Flags: .*BOOT' >/dev/null +geli list ${md}.eli | egrep '^Flags: .*BOOT' >/dev/null if [ $? -ne 0 ]; then echo "ok 12" else echo "not ok 12" fi -geli dump md${no} | egrep 'flags: 0x0$' >/dev/null +geli dump ${md} | egrep 'flags: 0x0$' >/dev/null if [ $? -eq 0 ]; then echo "ok 13" else echo "not ok 13" fi -geli configure -b md${no} +geli configure -b ${md} if [ $? -eq 0 ]; then echo "ok 14" else echo "not ok 14" fi -geli list md${no}.eli | egrep '^Flags: .*BOOT' >/dev/null +geli list ${md}.eli | egrep '^Flags: .*BOOT' >/dev/null if [ $? -eq 0 ]; then echo "ok 15" else echo "not ok 15" fi -geli dump md${no} | egrep 'flags: 0x2$' >/dev/null +geli dump ${md} | egrep 'flags: 0x2$' >/dev/null if [ $? -eq 0 ]; then echo "ok 16" else echo "not ok 16" fi -geli detach md${no} +geli detach ${md} if [ $? -eq 0 ]; then echo "ok 17" else Modified: head/tests/sys/geom/class/eli/delkey_test.sh ============================================================================== --- head/tests/sys/geom/class/eli/delkey_test.sh Fri Dec 29 15:38:43 2017 (r327345) +++ head/tests/sys/geom/class/eli/delkey_test.sh Fri Dec 29 16:06:10 2017 (r327346) @@ -9,7 +9,7 @@ keyfile1=`mktemp $base.XXXXXX` || exit 1 keyfile2=`mktemp $base.XXXXXX` || exit 1 keyfile3=`mktemp $base.XXXXXX` || exit 1 keyfile4=`mktemp $base.XXXXXX` || exit 1 -mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 +md=$(attach_md -t malloc -s `expr $sectors + 1`) echo "1..14" @@ -18,21 +18,21 @@ dd if=/dev/random of=${keyfile2} bs=512 count=16 >/dev dd if=/dev/random of=${keyfile3} bs=512 count=16 >/dev/null 2>&1 dd if=/dev/random of=${keyfile4} bs=512 count=16 >/dev/null 2>&1 -geli init -B none -P -K $keyfile1 md${no} -geli attach -p -k $keyfile1 md${no} -geli setkey -n 1 -P -K $keyfile2 md${no} +geli init -B none -P -K $keyfile1 ${md} +geli attach -p -k $keyfile1 ${md} +geli setkey -n 1 -P -K $keyfile2 ${md} # Remove key 0 for attached provider. -geli delkey -n 0 md${no} +geli delkey -n 0 ${md} if [ $? -eq 0 ]; then echo "ok 1" else echo "not ok 1" fi -geli detach md${no} +geli detach ${md} # We cannot use keyfile1 anymore. -geli attach -p -k $keyfile1 md${no} 2>/dev/null +geli attach -p -k $keyfile1 ${md} 2>/dev/null if [ $? -ne 0 ]; then echo "ok 2" else @@ -40,7 +40,7 @@ else fi # Attach with key 1. -geli attach -p -k $keyfile2 md${no} +geli attach -p -k $keyfile2 ${md} if [ $? -eq 0 ]; then echo "ok 3" else @@ -48,7 +48,7 @@ else fi # We cannot remove last key without -f option (for attached provider). -geli delkey -n 1 md${no} 2>/dev/null +geli delkey -n 1 ${md} 2>/dev/null if [ $? -ne 0 ]; then echo "ok 4" else @@ -56,7 +56,7 @@ else fi # Remove last key for attached provider. -geli delkey -f -n 1 md${no} +geli delkey -f -n 1 ${md} if [ $? -eq 0 ]; then echo "ok 5" else @@ -64,16 +64,16 @@ else fi # If there are no valid keys, but provider is attached, we can save situation. -geli setkey -n 0 -P -K $keyfile3 md${no} +geli setkey -n 0 -P -K $keyfile3 ${md} if [ $? -eq 0 ]; then echo "ok 6" else echo "not ok 6" fi -geli detach md${no} +geli detach ${md} # We cannot use keyfile2 anymore. -geli attach -p -k $keyfile2 md${no} 2>/dev/null +geli attach -p -k $keyfile2 ${md} 2>/dev/null if [ $? -ne 0 ]; then echo "ok 7" else @@ -81,7 +81,7 @@ else fi # Attach with key 0. -geli attach -p -k $keyfile3 md${no} +geli attach -p -k $keyfile3 ${md} if [ $? -eq 0 ]; then echo "ok 8" else @@ -89,16 +89,16 @@ else fi # Setup key 1. -geli setkey -n 1 -P -K $keyfile4 md${no} +geli setkey -n 1 -P -K $keyfile4 ${md} if [ $? -eq 0 ]; then echo "ok 9" else echo "not ok 9" fi -geli detach md${no} +geli detach ${md} # Remove key 1 for detached provider. -geli delkey -n 1 md${no} +geli delkey -n 1 ${md} if [ $? -eq 0 ]; then echo "ok 10" else @@ -106,7 +106,7 @@ else fi # We cannot use keyfile4 anymore. -geli attach -p -k $keyfile4 md${no} 2>/dev/null +geli attach -p -k $keyfile4 ${md} 2>/dev/null if [ $? -ne 0 ]; then echo "ok 11" else @@ -114,7 +114,7 @@ else fi # We cannot remove last key without -f option (for detached provider). -geli delkey -n 0 md${no} 2>/dev/null +geli delkey -n 0 ${md} 2>/dev/null if [ $? -ne 0 ]; then echo "ok 12" else @@ -122,7 +122,7 @@ else fi # Remove last key for detached provider. -geli delkey -f -n 0 md${no} +geli delkey -f -n 0 ${md} if [ $? -eq 0 ]; then echo "ok 13" else @@ -130,7 +130,7 @@ else fi # We cannot use keyfile3 anymore. -geli attach -p -k $keyfile3 md${no} 2>/dev/null +geli attach -p -k $keyfile3 ${md} 2>/dev/null if [ $? -ne 0 ]; then echo "ok 14" else Modified: head/tests/sys/geom/class/eli/detach_l_test.sh ============================================================================== --- head/tests/sys/geom/class/eli/detach_l_test.sh Fri Dec 29 15:38:43 2017 (r327345) +++ head/tests/sys/geom/class/eli/detach_l_test.sh Fri Dec 29 16:06:10 2017 (r327346) @@ -6,36 +6,36 @@ base=`basename $0` sectors=100 keyfile=`mktemp $base.XXXXXX` || exit 1 -mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 +md=$(attach_md -t malloc -s `expr $sectors + 1`) echo "1..4" dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 -geli init -B none -P -K $keyfile md${no} -geli attach -p -k $keyfile md${no} -if [ -c /dev/md${no}.eli ]; then +geli init -B none -P -K $keyfile ${md} +geli attach -p -k $keyfile ${md} +if [ -c /dev/${md}.eli ]; then echo "ok 1" else echo "not ok 1" fi # Be sure it doesn't detach before 'detach -l'. -dd if=/dev/md${no}.eli of=/dev/null 2>/dev/null +dd if=/dev/${md}.eli of=/dev/null 2>/dev/null sleep 1 -if [ -c /dev/md${no}.eli ]; then +if [ -c /dev/${md}.eli ]; then echo "ok 2" else echo "not ok 2" fi -geli detach -l md${no} -if [ -c /dev/md${no}.eli ]; then +geli detach -l ${md} +if [ -c /dev/${md}.eli ]; then echo "ok 3" else echo "not ok 3" fi -dd if=/dev/md${no}.eli of=/dev/null 2>/dev/null +dd if=/dev/${md}.eli of=/dev/null 2>/dev/null sleep 1 -if [ ! -c /dev/md${no}.eli ]; then +if [ ! -c /dev/${md}.eli ]; then echo "ok 4" else echo "not ok 4" Modified: head/tests/sys/geom/class/eli/init_B_test.sh ============================================================================== --- head/tests/sys/geom/class/eli/init_B_test.sh Fri Dec 29 15:38:43 2017 (r327345) +++ head/tests/sys/geom/class/eli/init_B_test.sh Fri Dec 29 16:06:10 2017 (r327346) @@ -12,90 +12,90 @@ echo "1..13" dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 -mdconfig -a -t malloc -s $sectors -u $no || exit 1 +md=$(attach_md -t malloc -s `expr $sectors`) # -B none -rm -f /var/backups/md${no}.eli -geli init -B none -P -K $keyfile md${no} 2>/dev/null -if [ ! -f /var/backups/md${no}.eli ]; then +rm -f /var/backups/${md}.eli +geli init -B none -P -K $keyfile ${md} 2>/dev/null +if [ ! -f /var/backups/${md}.eli ]; then echo "ok 1 - -B none" else echo "not ok 1 - -B none" fi # no -B -rm -f /var/backups/md${no}.eli -geli init -P -K $keyfile md${no} >/dev/null 2>&1 -if [ -f /var/backups/md${no}.eli ]; then +rm -f /var/backups/${md}.eli +geli init -P -K $keyfile ${md} >/dev/null 2>&1 +if [ -f /var/backups/${md}.eli ]; then echo "ok 2 - no -B" else echo "not ok 2 - no -B" fi -geli clear md${no} -geli attach -p -k $keyfile md${no} 2>/dev/null +geli clear ${md} +geli attach -p -k $keyfile ${md} 2>/dev/null if [ $? -ne 0 ]; then echo "ok 3 - no -B" else echo "not ok 3 - no -B" fi -if [ ! -c /dev/md${no}.eli ]; then +if [ ! -c /dev/${md}.eli ]; then echo "ok 4 - no -B" else echo "not ok 4 - no -B" fi -geli restore /var/backups/md${no}.eli md${no} +geli restore /var/backups/${md}.eli ${md} if [ $? -eq 0 ]; then echo "ok 5 - no -B" else echo "not ok 5 - no -B" fi -geli attach -p -k $keyfile md${no} 2>/dev/null +geli attach -p -k $keyfile ${md} 2>/dev/null if [ $? -eq 0 ]; then echo "ok 6 - no -B" else echo "not ok 6 - no -B" fi -if [ -c /dev/md${no}.eli ]; then +if [ -c /dev/${md}.eli ]; then echo "ok 7 - no -B" else echo "not ok 7 - no -B" fi -geli detach md${no} -rm -f /var/backups/md${no}.eli +geli detach ${md} +rm -f /var/backups/${md}.eli # -B file rm -f $backupfile -geli init -B $backupfile -P -K $keyfile md${no} >/dev/null 2>&1 +geli init -B $backupfile -P -K $keyfile ${md} >/dev/null 2>&1 if [ -f $backupfile ]; then echo "ok 8 - -B file" else echo "not ok 8 - -B file" fi -geli clear md${no} -geli attach -p -k $keyfile md${no} 2>/dev/null +geli clear ${md} +geli attach -p -k $keyfile ${md} 2>/dev/null if [ $? -ne 0 ]; then echo "ok 9 - -B file" else echo "not ok 9 - -B file" fi -if [ ! -c /dev/md${no}.eli ]; then +if [ ! -c /dev/${md}.eli ]; then echo "ok 10 - -B file" else echo "not ok 10 - -B file" fi -geli restore $backupfile md${no} +geli restore $backupfile ${md} if [ $? -eq 0 ]; then echo "ok 11 - -B file" else echo "not ok 11 - -B file" fi -geli attach -p -k $keyfile md${no} 2>/dev/null +geli attach -p -k $keyfile ${md} 2>/dev/null if [ $? -eq 0 ]; then echo "ok 12 - -B file" else echo "not ok 12 - -B file" fi -if [ -c /dev/md${no}.eli ]; then +if [ -c /dev/${md}.eli ]; then echo "ok 13 - -B file" else echo "not ok 13 - -B file" Modified: head/tests/sys/geom/class/eli/init_J_test.sh ============================================================================== --- head/tests/sys/geom/class/eli/init_J_test.sh Fri Dec 29 15:38:43 2017 (r327345) +++ head/tests/sys/geom/class/eli/init_J_test.sh Fri Dec 29 16:06:10 2017 (r327346) @@ -9,7 +9,7 @@ keyfile0=`mktemp $base.XXXXXX` || exit 1 keyfile1=`mktemp $base.XXXXXX` || exit 1 passfile0=`mktemp $base.XXXXXX` || exit 1 passfile1=`mktemp $base.XXXXXX` || exit 1 -mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 +md=$(attach_md -t malloc -s `expr $sectors + 1`) echo "1..150" @@ -20,106 +20,106 @@ dd if=/dev/random bs=512 count=16 2>/dev/null | sha1 > i=1 for iter in -1 0 64; do - geli init -i ${iter} -B none -J ${passfile0} -P md${no} 2>/dev/null && echo -n "not " + geli init -i ${iter} -B none -J ${passfile0} -P ${md} 2>/dev/null && echo -n "not " echo "ok ${i}"; i=$((i+1)) - geli init -i ${iter} -B none -J ${passfile0} -P -K ${keyfile0} md${no} 2>/dev/null && echo -n "not " + geli init -i ${iter} -B none -J ${passfile0} -P -K ${keyfile0} ${md} 2>/dev/null && echo -n "not " echo "ok ${i}"; i=$((i+1)) - geli init -i ${iter} -B none -J ${passfile0} -K ${keyfile0} md${no} 2>/dev/null || echo -n "not " + geli init -i ${iter} -B none -J ${passfile0} -K ${keyfile0} ${md} 2>/dev/null || echo -n "not " echo "ok ${i}"; i=$((i+1)) - geli attach -k ${keyfile0} -p md${no} 2>/dev/null && echo -n "not " + geli attach -k ${keyfile0} -p ${md} 2>/dev/null && echo -n "not " echo "ok ${i}"; i=$((i+1)) - geli attach -j ${passfile0} md${no} 2>/dev/null && echo -n "not " + geli attach -j ${passfile0} ${md} 2>/dev/null && echo -n "not " echo "ok ${i}"; i=$((i+1)) - geli attach -j ${keyfile0} md${no} 2>/dev/null && echo -n "not " + geli attach -j ${keyfile0} ${md} 2>/dev/null && echo -n "not " echo "ok ${i}"; i=$((i+1)) - geli attach -k ${passfile0} -p md${no} 2>/dev/null && echo -n "not " + geli attach -k ${passfile0} -p ${md} 2>/dev/null && echo -n "not " echo "ok ${i}"; i=$((i+1)) - geli attach -j ${keyfile0} -k ${passfile0} md${no} 2>/dev/null && echo -n "not " + geli attach -j ${keyfile0} -k ${passfile0} ${md} 2>/dev/null && echo -n "not " echo "ok ${i}"; i=$((i+1)) - geli attach -j ${keyfile0} -k ${keyfile0} md${no} 2>/dev/null && echo -n "not " + geli attach -j ${keyfile0} -k ${keyfile0} ${md} 2>/dev/null && echo -n "not " echo "ok ${i}"; i=$((i+1)) - geli attach -j ${passfile0} -k ${passfile0} md${no} 2>/dev/null && echo -n "not " + geli attach -j ${passfile0} -k ${passfile0} ${md} 2>/dev/null && echo -n "not " echo "ok ${i}"; i=$((i+1)) - geli attach -j ${passfile0} -k ${keyfile0} md${no} 2>/dev/null || echo -n "not " + geli attach -j ${passfile0} -k ${keyfile0} ${md} 2>/dev/null || echo -n "not " echo "ok ${i}"; i=$((i+1)) - geli detach md${no} || echo -n "not " + geli detach ${md} || echo -n "not " echo "ok ${i}"; i=$((i+1)) - cat ${keyfile0} | geli attach -j ${passfile0} -k - md${no} 2>/dev/null || echo -n "not " + cat ${keyfile0} | geli attach -j ${passfile0} -k - ${md} 2>/dev/null || echo -n "not " echo "ok ${i}"; i=$((i+1)) - geli detach md${no} || echo -n "not " + geli detach ${md} || echo -n "not " echo "ok ${i}"; i=$((i+1)) - cat ${passfile0} | geli attach -j - -k ${keyfile0} md${no} 2>/dev/null || echo -n "not " + cat ${passfile0} | geli attach -j - -k ${keyfile0} ${md} 2>/dev/null || echo -n "not " echo "ok ${i}"; i=$((i+1)) - geli detach md${no} || echo -n "not " + geli detach ${md} || echo -n "not " echo "ok ${i}"; i=$((i+1)) - geli init -i ${iter} -B none -J ${passfile0} -J ${passfile1} -P md${no} 2>/dev/null && echo -n "not " + geli init -i ${iter} -B none -J ${passfile0} -J ${passfile1} -P ${md} 2>/dev/null && echo -n "not " echo "ok ${i}"; i=$((i+1)) - geli init -i ${iter} -B none -J ${passfile0} -J ${passfile1} -P -K ${keyfile0} -K ${keyfile1} md${no} 2>/dev/null && echo -n "not " + geli init -i ${iter} -B none -J ${passfile0} -J ${passfile1} -P -K ${keyfile0} -K ${keyfile1} ${md} 2>/dev/null && echo -n "not " echo "ok ${i}"; i=$((i+1)) - geli init -i ${iter} -B none -J ${passfile0} -J ${passfile1} -K ${keyfile0} -K ${keyfile1} md${no} 2>/dev/null || echo -n "not " + geli init -i ${iter} -B none -J ${passfile0} -J ${passfile1} -K ${keyfile0} -K ${keyfile1} ${md} 2>/dev/null || echo -n "not " echo "ok ${i}"; i=$((i+1)) - geli attach -k ${keyfile0} -p md${no} 2>/dev/null && echo -n "not " + geli attach -k ${keyfile0} -p ${md} 2>/dev/null && echo -n "not " echo "ok ${i}"; i=$((i+1)) - geli attach -k ${keyfile1} -p md${no} 2>/dev/null && echo -n "not " + geli attach -k ${keyfile1} -p ${md} 2>/dev/null && echo -n "not " echo "ok ${i}"; i=$((i+1)) - geli attach -j ${passfile0} md${no} 2>/dev/null && echo -n "not " + geli attach -j ${passfile0} ${md} 2>/dev/null && echo -n "not " echo "ok ${i}"; i=$((i+1)) - geli attach -j ${passfile1} md${no} 2>/dev/null && echo -n "not " + geli attach -j ${passfile1} ${md} 2>/dev/null && echo -n "not " echo "ok ${i}"; i=$((i+1)) - geli attach -k ${keyfile0} -k ${keyfile1} -p md${no} 2>/dev/null && echo -n "not " + geli attach -k ${keyfile0} -k ${keyfile1} -p ${md} 2>/dev/null && echo -n "not " echo "ok ${i}"; i=$((i+1)) - geli attach -j ${passfile0} -j ${passfile1} md${no} 2>/dev/null && echo -n "not " + geli attach -j ${passfile0} -j ${passfile1} ${md} 2>/dev/null && echo -n "not " echo "ok ${i}"; i=$((i+1)) - geli attach -k ${keyfile0} -j ${passfile0} md${no} 2>/dev/null && echo -n "not " + geli attach -k ${keyfile0} -j ${passfile0} ${md} 2>/dev/null && echo -n "not " echo "ok ${i}"; i=$((i+1)) - geli attach -k ${keyfile0} -j ${passfile1} md${no} 2>/dev/null && echo -n "not " + geli attach -k ${keyfile0} -j ${passfile1} ${md} 2>/dev/null && echo -n "not " echo "ok ${i}"; i=$((i+1)) - geli attach -k ${keyfile1} -j ${passfile0} md${no} 2>/dev/null && echo -n "not " + geli attach -k ${keyfile1} -j ${passfile0} ${md} 2>/dev/null && echo -n "not " echo "ok ${i}"; i=$((i+1)) - geli attach -k ${keyfile1} -j ${passfile1} md${no} 2>/dev/null && echo -n "not " + geli attach -k ${keyfile1} -j ${passfile1} ${md} 2>/dev/null && echo -n "not " echo "ok ${i}"; i=$((i+1)) - geli attach -k ${keyfile0} -j ${passfile0} -j ${passfile1} md${no} 2>/dev/null && echo -n "not " + geli attach -k ${keyfile0} -j ${passfile0} -j ${passfile1} ${md} 2>/dev/null && echo -n "not " echo "ok ${i}"; i=$((i+1)) - geli attach -k ${keyfile1} -j ${passfile0} -j ${passfile1} md${no} 2>/dev/null && echo -n "not " + geli attach -k ${keyfile1} -j ${passfile0} -j ${passfile1} ${md} 2>/dev/null && echo -n "not " echo "ok ${i}"; i=$((i+1)) - geli attach -k ${keyfile0} -k ${keyfile1} -j ${passfile0} md${no} 2>/dev/null && echo -n "not " + geli attach -k ${keyfile0} -k ${keyfile1} -j ${passfile0} ${md} 2>/dev/null && echo -n "not " echo "ok ${i}"; i=$((i+1)) - geli attach -k ${keyfile0} -k ${keyfile1} -j ${passfile1} md${no} 2>/dev/null && echo -n "not " + geli attach -k ${keyfile0} -k ${keyfile1} -j ${passfile1} ${md} 2>/dev/null && echo -n "not " echo "ok ${i}"; i=$((i+1)) - geli attach -k ${keyfile1} -k ${keyfile0} -j ${passfile0} -j ${passfile1} md${no} 2>/dev/null && echo -n "not " + geli attach -k ${keyfile1} -k ${keyfile0} -j ${passfile0} -j ${passfile1} ${md} 2>/dev/null && echo -n "not " echo "ok ${i}"; i=$((i+1)) - geli attach -k ${keyfile0} -k ${keyfile1} -j ${passfile1} -j ${passfile0} md${no} 2>/dev/null && echo -n "not " + geli attach -k ${keyfile0} -k ${keyfile1} -j ${passfile1} -j ${passfile0} ${md} 2>/dev/null && echo -n "not " echo "ok ${i}"; i=$((i+1)) - geli attach -k ${keyfile1} -k ${keyfile0} -j ${passfile1} -j ${passfile0} md${no} 2>/dev/null && echo -n "not " + geli attach -k ${keyfile1} -k ${keyfile0} -j ${passfile1} -j ${passfile0} ${md} 2>/dev/null && echo -n "not " echo "ok ${i}"; i=$((i+1)) - geli attach -j ${passfile0} -j ${passfile1} -k ${keyfile0} -k ${keyfile1} md${no} 2>/dev/null || echo -n "not " + geli attach -j ${passfile0} -j ${passfile1} -k ${keyfile0} -k ${keyfile1} ${md} 2>/dev/null || echo -n "not " echo "ok ${i}"; i=$((i+1)) - geli detach md${no} || echo -n "not " + geli detach ${md} || echo -n "not " echo "ok ${i}"; i=$((i+1)) - cat ${passfile0} | geli attach -j - -j ${passfile1} -k ${keyfile0} -k ${keyfile1} md${no} 2>/dev/null || echo -n "not " + cat ${passfile0} | geli attach -j - -j ${passfile1} -k ${keyfile0} -k ${keyfile1} ${md} 2>/dev/null || echo -n "not " echo "ok ${i}"; i=$((i+1)) - geli detach md${no} || echo -n "not " + geli detach ${md} || echo -n "not " echo "ok ${i}"; i=$((i+1)) - cat ${passfile1} | geli attach -j ${passfile0} -j - -k ${keyfile0} -k ${keyfile1} md${no} 2>/dev/null || echo -n "not " + cat ${passfile1} | geli attach -j ${passfile0} -j - -k ${keyfile0} -k ${keyfile1} ${md} 2>/dev/null || echo -n "not " echo "ok ${i}"; i=$((i+1)) - geli detach md${no} || echo -n "not " + geli detach ${md} || echo -n "not " echo "ok ${i}"; i=$((i+1)) - cat ${keyfile0} | geli attach -j ${passfile0} -j ${passfile1} -k - -k ${keyfile1} md${no} 2>/dev/null || echo -n "not " + cat ${keyfile0} | geli attach -j ${passfile0} -j ${passfile1} -k - -k ${keyfile1} ${md} 2>/dev/null || echo -n "not " echo "ok ${i}"; i=$((i+1)) - geli detach md${no} || echo -n "not " + geli detach ${md} || echo -n "not " echo "ok ${i}"; i=$((i+1)) - cat ${keyfile1} | geli attach -j ${passfile0} -j ${passfile1} -k ${keyfile0} -k - md${no} 2>/dev/null || echo -n "not " + cat ${keyfile1} | geli attach -j ${passfile0} -j ${passfile1} -k ${keyfile0} -k - ${md} 2>/dev/null || echo -n "not " echo "ok ${i}"; i=$((i+1)) - geli detach md${no} || echo -n "not " + geli detach ${md} || echo -n "not " echo "ok ${i}"; i=$((i+1)) - cat ${keyfile0} ${keyfile1} | geli attach -j ${passfile0} -j ${passfile1} -k - md${no} 2>/dev/null || echo -n "not " + cat ${keyfile0} ${keyfile1} | geli attach -j ${passfile0} -j ${passfile1} -k - ${md} 2>/dev/null || echo -n "not " echo "ok ${i}"; i=$((i+1)) - geli detach md${no} || echo -n "not " + geli detach ${md} || echo -n "not " echo "ok ${i}"; i=$((i+1)) - cat ${passfile0} ${passfile1} | awk '{printf "%s", $0}' | geli attach -j - -k ${keyfile0} -k ${keyfile1} md${no} 2>/dev/null || echo -n "not " + cat ${passfile0} ${passfile1} | awk '{printf "%s", $0}' | geli attach -j - -k ${keyfile0} -k ${keyfile1} ${md} 2>/dev/null || echo -n "not " echo "ok ${i}"; i=$((i+1)) - geli detach md${no} || echo -n "not " + geli detach ${md} || echo -n "not " echo "ok ${i}"; i=$((i+1)) done Modified: head/tests/sys/geom/class/eli/init_a_test.sh ============================================================================== --- head/tests/sys/geom/class/eli/init_a_test.sh Fri Dec 29 15:38:43 2017 (r327345) +++ head/tests/sys/geom/class/eli/init_a_test.sh Fri Dec 29 16:06:10 2017 (r327346) @@ -15,16 +15,16 @@ do_test() { ealgo=${cipher%%:*} keylen=${cipher##*:} - mdconfig -a -t malloc -s `expr $secsize \* $sectors + 512`b -u $no || exit 1 - geli init -B none -a $aalgo -e $ealgo -l $keylen -P -K $keyfile -s $secsize md${no} 2>/dev/null - geli attach -p -k $keyfile md${no} + md=$(attach_md -t malloc -s `expr $secsize \* $sectors + 512`b) + geli init -B none -a $aalgo -e $ealgo -l $keylen -P -K $keyfile -s $secsize ${md} 2>/dev/null + geli attach -p -k $keyfile ${md} - secs=`diskinfo /dev/md${no}.eli | awk '{print $4}'` + secs=`diskinfo /dev/${md}.eli | awk '{print $4}'` - dd if=${rnd} of=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null + dd if=${rnd} of=/dev/${md}.eli bs=${secsize} count=${secs} 2>/dev/null md_rnd=`dd if=${rnd} bs=${secsize} count=${secs} 2>/dev/null | md5` - md_ddev=`dd if=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null | md5` + md_ddev=`dd if=/dev/${md}.eli bs=${secsize} count=${secs} 2>/dev/null | md5` if [ ${md_rnd} = ${md_ddev} ]; then echo "ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" @@ -33,8 +33,8 @@ do_test() { fi i=$((i+1)) - geli detach md${no} - mdconfig -d -u $no + geli detach ${md} + mdconfig -d -u ${md} } echo "1..600" Modified: head/tests/sys/geom/class/eli/init_alias_test.sh ============================================================================== --- head/tests/sys/geom/class/eli/init_alias_test.sh Fri Dec 29 15:38:43 2017 (r327345) +++ head/tests/sys/geom/class/eli/init_alias_test.sh Fri Dec 29 16:06:10 2017 (r327346) @@ -15,10 +15,10 @@ do_test() { expected_ealgo=$3 expected_keylen=$4 - geli init -B none -e $ealgo -l $keylen -P -K $keyfile md${no} 2>/dev/null - geli attach -p -k $keyfile md${no} - real_ealgo=`geli list md${no}.eli | awk '/EncryptionAlgorithm/ {print $2}'` - real_keylen=`geli list md${no}.eli | awk '/KeyLength/ {print $2}'` + geli init -B none -e $ealgo -l $keylen -P -K $keyfile ${md} 2>/dev/null + geli attach -p -k $keyfile ${md} + real_ealgo=`geli list ${md}.eli | awk '/EncryptionAlgorithm/ {print $2}'` + real_keylen=`geli list ${md}.eli | awk '/KeyLength/ {print $2}'` if [ ${real_ealgo} = ${expected_ealgo} ]; then echo "ok $i - ${ealgo} aliased to ${real_ealgo}" @@ -34,12 +34,12 @@ do_test() { fi i=$((i+1)) - geli detach md${no} + geli detach ${md} } echo "1..38" i=1 -mdconfig -a -t malloc -s 1024k -u $no || exit 1 +md=$(attach_md -t malloc -s 1024k) dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 for spec in aes:0:AES-XTS:128 aes:128:AES-XTS:128 aes:256:AES-XTS:256 \ Modified: head/tests/sys/geom/class/eli/init_i_P_test.sh ============================================================================== --- head/tests/sys/geom/class/eli/init_i_P_test.sh Fri Dec 29 15:38:43 2017 (r327345) +++ head/tests/sys/geom/class/eli/init_i_P_test.sh Fri Dec 29 16:06:10 2017 (r327346) @@ -6,13 +6,13 @@ base=`basename $0` sectors=100 keyfile=`mktemp $base.XXXXXX` || exit 1 -mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 +md=$(attach_md -t malloc -s `expr $sectors + 1`) echo "1..1" dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 -geli init -B none -i 64 -P -K ${keyfile} md${no} 2>/dev/null +geli init -B none -i 64 -P -K ${keyfile} ${md} 2>/dev/null if [ $? -ne 0 ]; then echo "ok 1" else Modified: head/tests/sys/geom/class/eli/init_test.sh ============================================================================== --- head/tests/sys/geom/class/eli/init_test.sh Fri Dec 29 15:38:43 2017 (r327345) +++ head/tests/sys/geom/class/eli/init_test.sh Fri Dec 29 16:06:10 2017 (r327346) @@ -16,19 +16,19 @@ do_test() { ealgo=${cipher%%:*} keylen=${cipher##*:} - mdconfig -a -t malloc -s `expr $secsize \* $sectors + 512`b -u $no || exit 1 + md=$(attach_md -t malloc -s `expr $secsize \* $sectors + 512`b) - geli init -B none -e $ealgo -l $keylen -P -K $keyfile -s $secsize md${no} 2>/dev/null - geli attach -p -k $keyfile md${no} + geli init -B none -e $ealgo -l $keylen -P -K $keyfile -s $secsize ${md} 2>/dev/null + geli attach -p -k $keyfile ${md} - secs=`diskinfo /dev/md${no}.eli | awk '{print $4}'` + secs=`diskinfo /dev/${md}.eli | awk '{print $4}'` dd if=/dev/random of=${rnd} bs=${secsize} count=${secs} >/dev/null 2>&1 - dd if=${rnd} of=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null + dd if=${rnd} of=/dev/${md}.eli bs=${secsize} count=${secs} 2>/dev/null md_rnd=`dd if=${rnd} bs=${secsize} count=${secs} 2>/dev/null | md5` - md_ddev=`dd if=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null | md5` - md_edev=`dd if=/dev/md${no} bs=${secsize} count=${secs} 2>/dev/null | md5` + md_ddev=`dd if=/dev/${md}.eli bs=${secsize} count=${secs} 2>/dev/null | md5` + md_edev=`dd if=/dev/${md} bs=${secsize} count=${secs} 2>/dev/null | md5` if [ ${md_rnd} = ${md_ddev} ]; then echo "ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" @@ -43,8 +43,8 @@ do_test() { fi i=$((i+1)) - geli detach md${no} - mdconfig -d -u $no + geli detach ${md} + mdconfig -d -u ${md} } i=1 Modified: head/tests/sys/geom/class/eli/integrity_copy_test.sh ============================================================================== --- head/tests/sys/geom/class/eli/integrity_copy_test.sh Fri Dec 29 15:38:43 2017 (r327345) +++ head/tests/sys/geom/class/eli/integrity_copy_test.sh Fri Dec 29 16:06:10 2017 (r327346) @@ -16,13 +16,13 @@ do_test() { ealgo=${cipher%%:*} keylen=${cipher##*:} - mdconfig -a -t malloc -s `expr $secsize \* 2 + 512`b -u $no || exit 1 - geli init -B none -a $aalgo -e $ealgo -l $keylen -P -K $keyfile -s $secsize md${no} 2>/dev/null - geli attach -p -k $keyfile md${no} + md=$(attach_md -t malloc -s `expr $secsize \* 2 + 512`b) + geli init -B none -a $aalgo -e $ealgo -l $keylen -P -K $keyfile -s $secsize ${md} 2>/dev/null + geli attach -p -k $keyfile ${md} - dd if=/dev/random of=/dev/md${no}.eli bs=${secsize} count=1 >/dev/null 2>&1 + dd if=/dev/random of=/dev/${md}.eli bs=${secsize} count=1 >/dev/null 2>&1 - dd if=/dev/md${no}.eli bs=${secsize} count=1 >/dev/null 2>&1 + dd if=/dev/${md}.eli bs=${secsize} count=1 >/dev/null 2>&1 if [ $? -eq 0 ]; then echo "ok $i - small 1 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" else @@ -30,14 +30,14 @@ do_test() { fi i=$((i+1)) - geli detach md${no} + geli detach ${md} # Copy first small sector to the second small sector. # This should be detected as corruption. - dd if=/dev/md${no} of=${sector} bs=512 count=1 >/dev/null 2>&1 - dd if=${sector} of=/dev/md${no} bs=512 count=1 seek=1 >/dev/null 2>&1 - geli attach -p -k $keyfile md${no} + dd if=/dev/${md} of=${sector} bs=512 count=1 >/dev/null 2>&1 + dd if=${sector} of=/dev/${md} bs=512 count=1 seek=1 >/dev/null 2>&1 + geli attach -p -k $keyfile ${md} - dd if=/dev/md${no}.eli of=/dev/null bs=${secsize} count=1 >/dev/null 2>&1 + dd if=/dev/${md}.eli of=/dev/null bs=${secsize} count=1 >/dev/null 2>&1 if [ $? -ne 0 ]; then echo "ok $i - small 2 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" else @@ -45,14 +45,14 @@ do_test() { fi i=$((i+1)) - ms=`diskinfo /dev/md${no} | awk '{print $3 - 512}'` - ns=`diskinfo /dev/md${no}.eli | awk '{print $4}'` + ms=`diskinfo /dev/${md} | awk '{print $3 - 512}'` + ns=`diskinfo /dev/${md}.eli | awk '{print $4}'` usecsize=`echo "($ms / $ns) - (($ms / $ns) % 512)" | bc` # Fix the corruption - dd if=/dev/random of=/dev/md${no}.eli bs=${secsize} count=2 >/dev/null 2>&1 + dd if=/dev/random of=/dev/${md}.eli bs=${secsize} count=2 >/dev/null 2>&1 - dd if=/dev/md${no}.eli bs=${secsize} count=2 >/dev/null 2>&1 + dd if=/dev/${md}.eli bs=${secsize} count=2 >/dev/null 2>&1 if [ $? -eq 0 ]; then echo "ok $i - big 1 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" else @@ -60,14 +60,14 @@ do_test() { fi i=$((i+1)) - geli detach md${no} + geli detach ${md} # Copy first big sector to the second big sector. # This should be detected as corruption. - dd if=/dev/md${no} of=${sector} bs=${usecsize} count=1 >/dev/null 2>&1 - dd if=${sector} of=/dev/md${no} bs=${usecsize} count=1 seek=1 >/dev/null 2>&1 - geli attach -p -k $keyfile md${no} + dd if=/dev/${md} of=${sector} bs=${usecsize} count=1 >/dev/null 2>&1 + dd if=${sector} of=/dev/${md} bs=${usecsize} count=1 seek=1 >/dev/null 2>&1 + geli attach -p -k $keyfile ${md} - dd if=/dev/md${no}.eli of=/dev/null bs=${secsize} count=2 >/dev/null 2>&1 + dd if=/dev/${md}.eli of=/dev/null bs=${secsize} count=2 >/dev/null 2>&1 if [ $? -ne 0 ]; then echo "ok $i - big 2 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" else @@ -75,8 +75,8 @@ do_test() { fi i=$((i+1)) - geli detach md${no} - mdconfig -d -u $no + geli detach ${md} + mdconfig -d -u ${md} } Modified: head/tests/sys/geom/class/eli/integrity_data_test.sh ============================================================================== --- head/tests/sys/geom/class/eli/integrity_data_test.sh Fri Dec 29 15:38:43 2017 (r327345) +++ head/tests/sys/geom/class/eli/integrity_data_test.sh Fri Dec 29 16:06:10 2017 (r327346) @@ -16,16 +16,16 @@ do_test() { ealgo=${cipher%%:*} keylen=${cipher##*:} - mdconfig -a -t malloc -s `expr $secsize \* 2 + 512`b -u $no || exit 1 - geli init -B none -a $aalgo -e $ealgo -l $keylen -P -K $keyfile -s $secsize md${no} 2>/dev/null + md=$(attach_md -t malloc -s `expr $secsize \* 2 + 512`b) + geli init -B none -a $aalgo -e $ealgo -l $keylen -P -K $keyfile -s $secsize ${md} 2>/dev/null # Corrupt 8 bytes of data. - dd if=/dev/md${no} of=${sector} bs=512 count=1 >/dev/null 2>&1 + dd if=/dev/${md} of=${sector} bs=512 count=1 >/dev/null 2>&1 dd if=/dev/random of=${sector} bs=1 count=8 seek=64 conv=notrunc >/dev/null 2>&1 - dd if=${sector} of=/dev/md${no} bs=512 count=1 >/dev/null 2>&1 - geli attach -p -k $keyfile md${no} + dd if=${sector} of=/dev/${md} bs=512 count=1 >/dev/null 2>&1 + geli attach -p -k $keyfile ${md} - dd if=/dev/md${no}.eli of=/dev/null bs=${secsize} count=1 >/dev/null 2>&1 + dd if=/dev/${md}.eli of=/dev/null bs=${secsize} count=1 >/dev/null 2>&1 if [ $? -ne 0 ]; then echo "ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" else @@ -33,8 +33,8 @@ do_test() { fi i=$((i+1)) - geli detach md${no} - mdconfig -d -u $no + geli detach ${md} + mdconfig -d -u ${md} } i=1 Modified: head/tests/sys/geom/class/eli/integrity_hmac_test.sh ============================================================================== --- head/tests/sys/geom/class/eli/integrity_hmac_test.sh Fri Dec 29 15:38:43 2017 (r327345) +++ head/tests/sys/geom/class/eli/integrity_hmac_test.sh Fri Dec 29 16:06:10 2017 (r327346) @@ -16,16 +16,16 @@ do_test() { ealgo=${cipher%%:*} keylen=${cipher##*:} - mdconfig -a -t malloc -s `expr $secsize \* 2 + 512`b -u $no || exit 2 - geli init -B none -a $aalgo -e $ealgo -l $keylen -P -K $keyfile -s $secsize md${no} 2>/dev/null + md=$(attach_md -t malloc -s `expr $secsize \* 2 + 512`b) + geli init -B none -a $aalgo -e $ealgo -l $keylen -P -K $keyfile -s $secsize ${md} 2>/dev/null # Corrupt 8 bytes of HMAC. - dd if=/dev/md${no} of=${sector} bs=512 count=1 >/dev/null 2>&1 + dd if=/dev/${md} of=${sector} bs=512 count=1 >/dev/null 2>&1 dd if=/dev/random of=${sector} bs=1 count=16 conv=notrunc >/dev/null 2>&1 - dd if=${sector} of=/dev/md${no} bs=512 count=1 >/dev/null 2>&1 - geli attach -p -k $keyfile md${no} + dd if=${sector} of=/dev/${md} bs=512 count=1 >/dev/null 2>&1 + geli attach -p -k $keyfile ${md} - dd if=/dev/md${no}.eli bs=${secsize} count=1 >/dev/null 2>&1 + dd if=/dev/${md}.eli bs=${secsize} count=1 >/dev/null 2>&1 if [ $? -ne 0 ]; then echo "ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" else @@ -33,8 +33,8 @@ do_test() { fi i=$((i+1)) - geli detach md${no} - mdconfig -d -u $no + geli detach ${md} + mdconfig -d -u ${md} } Modified: head/tests/sys/geom/class/eli/kill_test.sh ============================================================================== --- head/tests/sys/geom/class/eli/kill_test.sh Fri Dec 29 15:38:43 2017 (r327345) +++ head/tests/sys/geom/class/eli/kill_test.sh Fri Dec 29 16:06:10 2017 (r327346) @@ -7,19 +7,19 @@ base=`basename $0` sectors=100 keyfile1=`mktemp $base.XXXXXX` || exit 1 keyfile2=`mktemp $base.XXXXXX` || exit 1 -mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 +md=$(attach_md -t malloc -s `expr $sectors + 1`) echo "1..9" *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Dec 29 16:13:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6DB56EA31E7; Fri, 29 Dec 2017 16:13:08 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C8E06FB37; Fri, 29 Dec 2017 16:13:08 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBTGD729098440; Fri, 29 Dec 2017 16:13:07 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBTGD6hR098431; Fri, 29 Dec 2017 16:13:06 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201712291613.vBTGD6hR098431@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 29 Dec 2017 16:13:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327347 - head/tests/sys/geom/class/eli X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/geom/class/eli X-SVN-Commit-Revision: 327347 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Dec 2017 16:13:08 -0000 Author: asomers Date: Fri Dec 29 16:13:06 2017 New Revision: 327347 URL: https://svnweb.freebsd.org/changeset/base/327347 Log: geli: factor out some common code in the geli tests No functional change. MFC after: 2 weeks Sponsored by: Spectra Logic Corp Modified: head/tests/sys/geom/class/eli/conf.sh head/tests/sys/geom/class/eli/init_a_test.sh head/tests/sys/geom/class/eli/init_test.sh head/tests/sys/geom/class/eli/integrity_copy_test.sh head/tests/sys/geom/class/eli/integrity_data_test.sh head/tests/sys/geom/class/eli/integrity_hmac_test.sh head/tests/sys/geom/class/eli/onetime_a_test.sh head/tests/sys/geom/class/eli/onetime_test.sh Modified: head/tests/sys/geom/class/eli/conf.sh ============================================================================== --- head/tests/sys/geom/class/eli/conf.sh Fri Dec 29 16:06:10 2017 (r327346) +++ head/tests/sys/geom/class/eli/conf.sh Fri Dec 29 16:13:06 2017 (r327347) @@ -23,7 +23,11 @@ for_each_geli_config() { for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 \ hmac/sha384 hmac/sha512; do for secsize in 512 1024 2048 4096 8192; do + bytes=`expr $secsize \* $sectors + 512`b + md=$(attach_md -t malloc -s $bytes) ${func} $cipher $aalgo $secsize + geli detach ${md} 2>/dev/null + mdconfig -d -u ${md} 2>/dev/null done done done @@ -46,7 +50,11 @@ for_each_geli_config_nointegrity() { ealgo=${cipher%%:*} keylen=${cipher##*:} for secsize in 512 1024 2048 4096 8192; do + bytes=`expr $secsize \* $sectors + 512`b + md=$(attach_md -t malloc -s $bytes) ${func} $cipher $aalgo $secsize + geli detach ${md} 2>/dev/null + mdconfig -d -u ${md} 2>/dev/null done done } Modified: head/tests/sys/geom/class/eli/init_a_test.sh ============================================================================== --- head/tests/sys/geom/class/eli/init_a_test.sh Fri Dec 29 16:06:10 2017 (r327346) +++ head/tests/sys/geom/class/eli/init_a_test.sh Fri Dec 29 16:13:06 2017 (r327347) @@ -15,7 +15,6 @@ do_test() { ealgo=${cipher%%:*} keylen=${cipher##*:} - md=$(attach_md -t malloc -s `expr $secsize \* $sectors + 512`b) geli init -B none -a $aalgo -e $ealgo -l $keylen -P -K $keyfile -s $secsize ${md} 2>/dev/null geli attach -p -k $keyfile ${md} @@ -32,9 +31,6 @@ do_test() { echo "not ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" fi i=$((i+1)) - - geli detach ${md} - mdconfig -d -u ${md} } echo "1..600" Modified: head/tests/sys/geom/class/eli/init_test.sh ============================================================================== --- head/tests/sys/geom/class/eli/init_test.sh Fri Dec 29 16:06:10 2017 (r327346) +++ head/tests/sys/geom/class/eli/init_test.sh Fri Dec 29 16:13:06 2017 (r327347) @@ -16,8 +16,6 @@ do_test() { ealgo=${cipher%%:*} keylen=${cipher##*:} - md=$(attach_md -t malloc -s `expr $secsize \* $sectors + 512`b) - geli init -B none -e $ealgo -l $keylen -P -K $keyfile -s $secsize ${md} 2>/dev/null geli attach -p -k $keyfile ${md} @@ -42,9 +40,6 @@ do_test() { echo "not ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" fi i=$((i+1)) - - geli detach ${md} - mdconfig -d -u ${md} } i=1 Modified: head/tests/sys/geom/class/eli/integrity_copy_test.sh ============================================================================== --- head/tests/sys/geom/class/eli/integrity_copy_test.sh Fri Dec 29 16:06:10 2017 (r327346) +++ head/tests/sys/geom/class/eli/integrity_copy_test.sh Fri Dec 29 16:13:06 2017 (r327347) @@ -4,6 +4,7 @@ . $(dirname $0)/conf.sh base=`basename $0` +sectors=2 keyfile=`mktemp $base.XXXXXX` || exit 1 sector=`mktemp $base.XXXXXX` || exit 1 @@ -16,7 +17,6 @@ do_test() { ealgo=${cipher%%:*} keylen=${cipher##*:} - md=$(attach_md -t malloc -s `expr $secsize \* 2 + 512`b) geli init -B none -a $aalgo -e $ealgo -l $keylen -P -K $keyfile -s $secsize ${md} 2>/dev/null geli attach -p -k $keyfile ${md} @@ -65,18 +65,13 @@ do_test() { # This should be detected as corruption. dd if=/dev/${md} of=${sector} bs=${usecsize} count=1 >/dev/null 2>&1 dd if=${sector} of=/dev/${md} bs=${usecsize} count=1 seek=1 >/dev/null 2>&1 - geli attach -p -k $keyfile ${md} - - dd if=/dev/${md}.eli of=/dev/null bs=${secsize} count=2 >/dev/null 2>&1 + geli attach -p -k $keyfile ${md} 2>/dev/null if [ $? -ne 0 ]; then echo "ok $i - big 2 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" else echo "not ok $i - big 2 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" fi i=$((i+1)) - - geli detach ${md} - mdconfig -d -u ${md} } Modified: head/tests/sys/geom/class/eli/integrity_data_test.sh ============================================================================== --- head/tests/sys/geom/class/eli/integrity_data_test.sh Fri Dec 29 16:06:10 2017 (r327346) +++ head/tests/sys/geom/class/eli/integrity_data_test.sh Fri Dec 29 16:13:06 2017 (r327347) @@ -4,6 +4,7 @@ . $(dirname $0)/conf.sh base=`basename $0` +sectors=2 keyfile=`mktemp $base.XXXXXX` || exit 1 sector=`mktemp $base.XXXXXX` || exit 1 @@ -16,7 +17,6 @@ do_test() { ealgo=${cipher%%:*} keylen=${cipher##*:} - md=$(attach_md -t malloc -s `expr $secsize \* 2 + 512`b) geli init -B none -a $aalgo -e $ealgo -l $keylen -P -K $keyfile -s $secsize ${md} 2>/dev/null # Corrupt 8 bytes of data. @@ -32,9 +32,6 @@ do_test() { echo "not ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" fi i=$((i+1)) - - geli detach ${md} - mdconfig -d -u ${md} } i=1 Modified: head/tests/sys/geom/class/eli/integrity_hmac_test.sh ============================================================================== --- head/tests/sys/geom/class/eli/integrity_hmac_test.sh Fri Dec 29 16:06:10 2017 (r327346) +++ head/tests/sys/geom/class/eli/integrity_hmac_test.sh Fri Dec 29 16:13:06 2017 (r327347) @@ -4,6 +4,7 @@ . $(dirname $0)/conf.sh base=`basename $0` +sectors=2 keyfile=`mktemp $base.XXXXXX` || exit 1 sector=`mktemp $base.XXXXXX` || exit 1 @@ -16,7 +17,6 @@ do_test() { ealgo=${cipher%%:*} keylen=${cipher##*:} - md=$(attach_md -t malloc -s `expr $secsize \* 2 + 512`b) geli init -B none -a $aalgo -e $ealgo -l $keylen -P -K $keyfile -s $secsize ${md} 2>/dev/null # Corrupt 8 bytes of HMAC. @@ -32,9 +32,6 @@ do_test() { echo "not ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" fi i=$((i+1)) - - geli detach ${md} - mdconfig -d -u ${md} } Modified: head/tests/sys/geom/class/eli/onetime_a_test.sh ============================================================================== --- head/tests/sys/geom/class/eli/onetime_a_test.sh Fri Dec 29 16:06:10 2017 (r327346) +++ head/tests/sys/geom/class/eli/onetime_a_test.sh Fri Dec 29 16:13:06 2017 (r327347) @@ -16,7 +16,6 @@ do_test() { ealgo=${cipher%%:*} keylen=${cipher##*:} - md=$(attach_md -t malloc -s `expr $secsize \* $sectors + 512`b) geli onetime -a $aalgo -e $ealgo -l $keylen -s $secsize ${md} 2>/dev/null secs=`diskinfo /dev/${md}.eli | awk '{print $4}'` @@ -32,9 +31,6 @@ do_test() { echo "not ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" fi i=$((i+1)) - - geli detach ${md} - mdconfig -d -u ${md} } i=1 Modified: head/tests/sys/geom/class/eli/onetime_test.sh ============================================================================== --- head/tests/sys/geom/class/eli/onetime_test.sh Fri Dec 29 16:06:10 2017 (r327346) +++ head/tests/sys/geom/class/eli/onetime_test.sh Fri Dec 29 16:13:06 2017 (r327347) @@ -15,7 +15,6 @@ do_test() { keylen=${cipher##*:} rnd=`mktemp $base.XXXXXX` || exit 1 - md=$(attach_md -t malloc -s `expr $secsize \* $sectors`b) geli onetime -e $ealgo -l $keylen -s $secsize ${md} 2>/dev/null @@ -41,9 +40,7 @@ do_test() { fi i=$((i+1)) - geli detach ${md} rm -f $rnd - mdconfig -d -u ${md} } i=1 From owner-svn-src-all@freebsd.org Fri Dec 29 16:48:15 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 804EDEA529D; Fri, 29 Dec 2017 16:48:15 +0000 (UTC) (envelope-from roberto@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A43B71593; Fri, 29 Dec 2017 16:48:15 +0000 (UTC) (envelope-from roberto@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBTGmE7f011672; Fri, 29 Dec 2017 16:48:14 GMT (envelope-from roberto@FreeBSD.org) Received: (from roberto@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBTGmEkD011671; Fri, 29 Dec 2017 16:48:14 GMT (envelope-from roberto@FreeBSD.org) Message-Id: <201712291648.vBTGmEkD011671@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: roberto set sender to roberto@FreeBSD.org using -f From: Ollivier Robert Date: Fri, 29 Dec 2017 16:48:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r327348 - stable/11/usr.sbin/syslogd X-SVN-Group: stable-11 X-SVN-Commit-Author: roberto X-SVN-Commit-Paths: stable/11/usr.sbin/syslogd X-SVN-Commit-Revision: 327348 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Dec 2017 16:48:15 -0000 Author: roberto Date: Fri Dec 29 16:48:14 2017 New Revision: 327348 URL: https://svnweb.freebsd.org/changeset/base/327348 Log: In stable/11, support for including config. files is broken and only the last one is taken into account. Code in 12-CURRENT s different and works so commit is in stable/11. Patch by Alexander Zagrebin in the PR. PR: 220884 Relnotes: yes Submitted by: Dan McGregor Modified: stable/11/usr.sbin/syslogd/syslogd.c Modified: stable/11/usr.sbin/syslogd/syslogd.c ============================================================================== --- stable/11/usr.sbin/syslogd/syslogd.c Fri Dec 29 16:13:06 2017 (r327347) +++ stable/11/usr.sbin/syslogd/syslogd.c Fri Dec 29 16:48:14 2017 (r327348) @@ -1632,7 +1632,7 @@ configfiles(const struct dirent *dp) return (1); } -static void +static struct filed ** readconfigfile(FILE *cf, struct filed **nextp, int allow_includes) { FILE *cf2; @@ -1693,7 +1693,7 @@ readconfigfile(FILE *cf, struct filed **nextp, int all if (cf2 == NULL) continue; dprintf("reading %s\n", file); - readconfigfile(cf2, nextp, 0); + nextp = readconfigfile(cf2, nextp, 0); fclose(cf2); } free(ent); @@ -1760,6 +1760,7 @@ readconfigfile(FILE *cf, struct filed **nextp, int all nextp = &f->f_next; cfline(cline, f, prog, host); } + return nextp; } /* From owner-svn-src-all@freebsd.org Fri Dec 29 17:02:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA4D5EA5E5C; Fri, 29 Dec 2017 17:02:23 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B425D71E92; Fri, 29 Dec 2017 17:02:23 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBTH2MtH019915; Fri, 29 Dec 2017 17:02:22 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBTH2Msk019911; Fri, 29 Dec 2017 17:02:22 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201712291702.vBTH2Msk019911@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Fri, 29 Dec 2017 17:02:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327349 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 327349 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Dec 2017 17:02:24 -0000 Author: alc Date: Fri Dec 29 17:02:22 2017 New Revision: 327349 URL: https://svnweb.freebsd.org/changeset/base/327349 Log: After r327168, the variable "vm_pageout_wanted" can be static. MFC after: 2 weeks Modified: head/sys/vm/vm_pageout.c head/sys/vm/vm_pageout.h Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Fri Dec 29 16:48:14 2017 (r327348) +++ head/sys/vm/vm_pageout.c Fri Dec 29 17:02:22 2017 (r327349) @@ -150,7 +150,7 @@ SDT_PROBE_DEFINE(vm, , , vm__lowmem_scan); int vm_pageout_deficit; /* Estimated number of pages deficit */ u_int vm_pageout_wakeup_thresh; static int vm_pageout_oom_seq = 12; -bool vm_pageout_wanted; /* Event on which pageout daemon sleeps */ +static bool vm_pageout_wanted; /* Event on which pageout daemon sleeps */ bool vm_pages_needed; /* Are threads waiting for free pages? */ /* Pending request for dirty page laundering. */ Modified: head/sys/vm/vm_pageout.h ============================================================================== --- head/sys/vm/vm_pageout.h Fri Dec 29 16:48:14 2017 (r327348) +++ head/sys/vm/vm_pageout.h Fri Dec 29 17:02:22 2017 (r327349) @@ -76,7 +76,6 @@ extern int vm_page_max_wired; extern int vm_pageout_deficit; extern int vm_pageout_page_count; -extern bool vm_pageout_wanted; extern bool vm_pages_needed; #define VM_OOM_MEM 1 From owner-svn-src-all@freebsd.org Fri Dec 29 18:08:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E956EA8851; Fri, 29 Dec 2017 18:08:32 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 219F673D5F; Fri, 29 Dec 2017 18:08:32 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBTI8VQE044998; Fri, 29 Dec 2017 18:08:31 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBTI8Vn0044996; Fri, 29 Dec 2017 18:08:31 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201712291808.vBTI8Vn0044996@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 29 Dec 2017 18:08:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327350 - in head/stand: efi/fdt uboot/fdt X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/stand: efi/fdt uboot/fdt X-SVN-Commit-Revision: 327350 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Dec 2017 18:08:32 -0000 Author: kevans Date: Fri Dec 29 18:08:30 2017 New Revision: 327350 URL: https://svnweb.freebsd.org/changeset/base/327350 Log: stand/fdt: Consistently apply fdt_overlays Overlays were previously not applied when U-Boot provides FDT or EFI provides FDT, only when we load FDT from /boot/dtb given name from U-Boot. Make all three paths lead to loading fdt_overlays and applying them, so that fdt_overlays can be expected to Just Work. Reviewed by: gonzo, imp, manu Differential Revision: https://reviews.freebsd.org/D13664 Modified: head/stand/efi/fdt/efi_fdt.c head/stand/uboot/fdt/uboot_fdt.c Modified: head/stand/efi/fdt/efi_fdt.c ============================================================================== --- head/stand/efi/fdt/efi_fdt.c Fri Dec 29 17:02:22 2017 (r327349) +++ head/stand/efi/fdt/efi_fdt.c Fri Dec 29 18:08:30 2017 (r327350) @@ -44,19 +44,27 @@ int fdt_platform_load_dtb(void) { struct fdt_header *hdr; + const char *s; hdr = efi_get_table(&fdtdtb); - if (hdr != NULL) { - if (fdt_load_dtb_addr(hdr) == 0) { - printf("Using DTB provided by EFI at %p.\n", hdr); - return (0); - } + if (hdr == NULL) + return (1); + if (fdt_load_dtb_addr(hdr) != 0) + return (1); + printf("Using DTB provided by EFI at %p.\n", hdr); + + s = getenv("fdt_overlays"); + if (s != NULL && *s != '\0') { + printf("Loading DTB overlays: '%s'\n", s); + fdt_load_dtb_overlays(s); } - return (1); + return (0); } void fdt_platform_fixups(void) { + + fdt_apply_overlays(); } Modified: head/stand/uboot/fdt/uboot_fdt.c ============================================================================== --- head/stand/uboot/fdt/uboot_fdt.c Fri Dec 29 17:02:22 2017 (r327349) +++ head/stand/uboot/fdt/uboot_fdt.c Fri Dec 29 18:08:30 2017 (r327350) @@ -64,7 +64,8 @@ fdt_platform_load_dtb(void) if (fdt_load_dtb_addr(hdr) == 0) { printf("Using DTB provided by U-Boot at " "address %p.\n", hdr); - return (0); + rv = 0; + goto exit; } } } @@ -83,9 +84,11 @@ fdt_platform_load_dtb(void) if (fdt_load_dtb_file(s) == 0) { printf("Loaded DTB from file '%s'.\n", s); rv = 0; + goto exit; } } +exit: if (rv == 0) { s = getenv("fdt_overlays"); if (s == NULL) From owner-svn-src-all@freebsd.org Fri Dec 29 18:08:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35B6DEA887A; Fri, 29 Dec 2017 18:08:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ECE7173D80; Fri, 29 Dec 2017 18:08:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBTI8aKK045050; Fri, 29 Dec 2017 18:08:36 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBTI8Z7Z045048; Fri, 29 Dec 2017 18:08:35 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712291808.vBTI8Z7Z045048@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 29 Dec 2017 18:08:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327351 - head/stand X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand X-SVN-Commit-Revision: 327351 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Dec 2017 18:08:37 -0000 Author: imp Date: Fri Dec 29 18:08:35 2017 New Revision: 327351 URL: https://svnweb.freebsd.org/changeset/base/327351 Log: Fix ubldr. uboot/lib uses defines for the loader. It's part of the loader, but not compile as loader (it's building a library), so we can't just include loader.mk for the defines. Move LOADER_DISK_SUPPORT back to defs.mk for the moment. Sponsored by: Netflix Modified: head/stand/defs.mk head/stand/loader.mk Modified: head/stand/defs.mk ============================================================================== --- head/stand/defs.mk Fri Dec 29 18:08:30 2017 (r327350) +++ head/stand/defs.mk Fri Dec 29 18:08:35 2017 (r327351) @@ -58,6 +58,13 @@ LIBGELIBOOT= ${BOOTOBJ}/geli/libgeliboot.a .endif # MK_LOADER_GELI .endif # HAVE_GELI +# These should be confined to loader.mk, but can't because uboot/lib +# also uses it. It's part of loader, but isn't a loader so we can't +# just include loader.mk +.if ${LOADER_DISK_SUPPORT:Uyes} == "yes" +CFLAGS+= -DLOADER_DISK_SUPPORT +.endif + # Machine specific flags for all builds here # All PowerPC builds are 32 bit. We have no 64-bit loaders on powerpc Modified: head/stand/loader.mk ============================================================================== --- head/stand/loader.mk Fri Dec 29 18:08:30 2017 (r327350) +++ head/stand/loader.mk Fri Dec 29 18:08:35 2017 (r327351) @@ -105,15 +105,12 @@ CFLAGS+= -DLOADER_NFS_SUPPORT CFLAGS+= -DLOADER_TFTP_SUPPORT .endif -# Disk and partition support -.if ${LOADER_DISK_SUPPORT:Uyes} == "yes" -CFLAGS+= -DLOADER_DISK_SUPPORT +# Partition support .if ${LOADER_GPT_SUPPORT:Uyes} == "yes" CFLAGS+= -DLOADER_GPT_SUPPORT .endif .if ${LOADER_MBR_SUPPORT:Uyes} == "yes" CFLAGS+= -DLOADER_MBR_SUPPORT -.endif .endif .if defined(HAVE_ZFS) From owner-svn-src-all@freebsd.org Fri Dec 29 18:09:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 934B8EA8918; Fri, 29 Dec 2017 18:09:07 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D2AD73FF8; Fri, 29 Dec 2017 18:09:07 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBTI96cT045120; Fri, 29 Dec 2017 18:09:06 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBTI96mT045119; Fri, 29 Dec 2017 18:09:06 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201712291809.vBTI96mT045119@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 29 Dec 2017 18:09:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327352 - head/tests/sys/geom/class/eli X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/geom/class/eli X-SVN-Commit-Revision: 327352 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Dec 2017 18:09:07 -0000 Author: asomers Date: Fri Dec 29 18:09:06 2017 New Revision: 327352 URL: https://svnweb.freebsd.org/changeset/base/327352 Log: Fix a harmless typo from r310786 I copy/pasted a reference to an undefined shell variable. MFC after: 2 weeks Modified: head/tests/sys/geom/class/eli/conf.sh Modified: head/tests/sys/geom/class/eli/conf.sh ============================================================================== --- head/tests/sys/geom/class/eli/conf.sh Fri Dec 29 18:08:35 2017 (r327351) +++ head/tests/sys/geom/class/eli/conf.sh Fri Dec 29 18:09:06 2017 (r327352) @@ -52,7 +52,7 @@ for_each_geli_config_nointegrity() { for secsize in 512 1024 2048 4096 8192; do bytes=`expr $secsize \* $sectors + 512`b md=$(attach_md -t malloc -s $bytes) - ${func} $cipher $aalgo $secsize + ${func} $cipher $secsize geli detach ${md} 2>/dev/null mdconfig -d -u ${md} 2>/dev/null done From owner-svn-src-all@freebsd.org Fri Dec 29 18:42:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 269B7EAA37D; Fri, 29 Dec 2017 18:42:57 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E52B275645; Fri, 29 Dec 2017 18:42:56 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBTIguIR061532; Fri, 29 Dec 2017 18:42:56 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBTIguuc061531; Fri, 29 Dec 2017 18:42:56 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201712291842.vBTIguuc061531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 29 Dec 2017 18:42:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327353 - head/tests/sys/geom/class/eli X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/geom/class/eli X-SVN-Commit-Revision: 327353 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Dec 2017 18:42:57 -0000 Author: asomers Date: Fri Dec 29 18:42:55 2017 New Revision: 327353 URL: https://svnweb.freebsd.org/changeset/base/327353 Log: geli: fix the resize test on arm64 The resize test used bsdlabel(8), which is not available on all architectures. Change it to use gpart(8) instead, which should be available everywhere. PR: 221763 Reported by: andrew MFC after: 2 weeks Modified: head/tests/sys/geom/class/eli/resize_test.sh Modified: head/tests/sys/geom/class/eli/resize_test.sh ============================================================================== --- head/tests/sys/geom/class/eli/resize_test.sh Fri Dec 29 18:09:06 2017 (r327352) +++ head/tests/sys/geom/class/eli/resize_test.sh Fri Dec 29 18:42:55 2017 (r327353) @@ -25,17 +25,16 @@ fsck_md() } setsize() { - partszMB=$1 unitszMB=$2 + partszMB=$1 - { - echo a: $(($partszMB * $BLKS_PER_MB)) 0 4.2BSD 1024 8192 - echo c: $(($unitszMB * $BLKS_PER_MB)) 0 unused 0 0 - } | bsdlabel -R $md /dev/stdin + gpart resize -i 1 -s ${partszMB}m ${md} } # Initialise -setsize 10 40 || echo -n "not " +gpart create -s BSD ${md} +gpart add -t freebsd-ufs -s 10m ${md} +setsize 10 || echo -n "not " echo ok $i - "Sized ${md}a to 10m" i=$((i + 1)) @@ -63,7 +62,7 @@ geli detach ${md}a.eli || echo -n "not " echo ok $i - "Detached ${md}a.eli" i=$((i + 1)) -setsize 20 40 || echo -n "not " +setsize 20 || echo -n "not " echo ok $i - "Sized ${md}a to 20m" i=$((i + 1)) geli attach -pktmp.key ${md}a && echo -n "not " @@ -93,7 +92,7 @@ geli detach ${md}a.eli || echo -n "not " echo ok $i - "Detached ${md}a.eli" i=$((i + 1)) -setsize 30 40 || echo -n "not " +setsize 30 || echo -n "not " echo ok $i - "Sized ${md}a to 30m" i=$((i + 1)) From owner-svn-src-all@freebsd.org Fri Dec 29 19:05:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E155EAB5F7; Fri, 29 Dec 2017 19:05:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 356F177624; Fri, 29 Dec 2017 19:05:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBTJ57lb072872; Fri, 29 Dec 2017 19:05:07 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBTJ57gI072871; Fri, 29 Dec 2017 19:05:07 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201712291905.vBTJ57gI072871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 29 Dec 2017 19:05:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327354 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 327354 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Dec 2017 19:05:08 -0000 Author: kib Date: Fri Dec 29 19:05:07 2017 New Revision: 327354 URL: https://svnweb.freebsd.org/changeset/base/327354 Log: Style. Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D13678 Modified: head/sys/vm/vm_swapout.c Modified: head/sys/vm/vm_swapout.c ============================================================================== --- head/sys/vm/vm_swapout.c Fri Dec 29 18:42:55 2017 (r327353) +++ head/sys/vm/vm_swapout.c Fri Dec 29 19:05:07 2017 (r327354) @@ -556,16 +556,14 @@ vm_thread_swapin(struct thread *td) { vm_object_t ksobj; vm_page_t ma[KSTACK_MAX_PAGES]; - int pages; + int a, count, i, j, pages, rv; pages = td->td_kstack_pages; ksobj = td->td_kstack_obj; VM_OBJECT_WLOCK(ksobj); (void)vm_page_grab_pages(ksobj, 0, VM_ALLOC_NORMAL | VM_ALLOC_WIRED, ma, pages); - for (int i = 0; i < pages;) { - int j, a, count, rv; - + for (i = 0; i < pages;) { vm_page_assert_xbusied(ma[i]); if (ma[i]->valid == VM_PAGE_BITS_ALL) { vm_page_xunbusy(ma[i]); @@ -642,13 +640,9 @@ faultin(struct proc *p) void swapper(void) { - struct proc *p; + struct proc *p, *pp; struct thread *td; - struct proc *pp; - int slptime; - int swtime; - int ppri; - int pri; + int ppri, pri, slptime, swtime; loop: if (vm_page_count_min()) { @@ -735,15 +729,15 @@ swapout_procs(int action) { struct proc *p; struct thread *td; - int didswap = 0; + struct vmspace *vm; + int minslptime, slptime; + bool didswap; + minslptime = 100000; + didswap = false; retry: sx_slock(&allproc_lock); FOREACH_PROC_IN_SYSTEM(p) { - struct vmspace *vm; - int minslptime = 100000; - int slptime; - PROC_LOCK(p); /* * Watch out for a process in @@ -793,17 +787,20 @@ retry: goto nextproc; /* - * only aiod changes vmspace, however it will be + * Only aiod changes vmspace. However, it will be * skipped because of the if statement above checking - * for P_SYSTEM + * for P_SYSTEM. */ - if ((p->p_flag & (P_INMEM|P_SWAPPINGOUT|P_SWAPPINGIN)) != P_INMEM) + if ((p->p_flag & (P_INMEM | P_SWAPPINGOUT | P_SWAPPINGIN)) != + P_INMEM) goto nextproc; switch (p->p_state) { default: - /* Don't swap out processes in any sort - * of 'special' state. */ + /* + * Don't swap out processes in any sort + * of 'special' state. + */ break; case PRS_NORMAL: @@ -846,9 +843,9 @@ retry: * idle processes >= swap_idle_threshold2, * then swap the process out. */ - if (((action & VM_SWAP_NORMAL) == 0) && - (((action & VM_SWAP_IDLE) == 0) || - (slptime < swap_idle_threshold2))) { + if ((action & VM_SWAP_NORMAL) == 0 && + ((action & VM_SWAP_IDLE) == 0 || + slptime < swap_idle_threshold2)) { thread_unlock(td); goto nextproc; } @@ -863,12 +860,12 @@ retry: * or if this process is idle and the system is * configured to swap proactively, swap it out. */ - if ((action & VM_SWAP_NORMAL) || - ((action & VM_SWAP_IDLE) && - (minslptime > swap_idle_threshold2))) { + if ((action & VM_SWAP_NORMAL) != 0 || + ((action & VM_SWAP_IDLE) != 0 && + minslptime > swap_idle_threshold2)) { _PRELE(p); if (swapout(p) == 0) - didswap++; + didswap = true; PROC_UNLOCK(p); vm_map_unlock(&vm->vm_map); vmspace_free(vm); @@ -938,9 +935,10 @@ swapout(struct proc *p) P_INMEM, ("swapout: lost a swapout race?")); /* - * remember the process resident count + * Remember the resident count. */ p->p_vmspace->vm_swrss = vmspace_resident_count(p->p_vmspace); + /* * Check and mark all threads before we proceed. */ From owner-svn-src-all@freebsd.org Fri Dec 29 19:07:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2246AEAB851; Fri, 29 Dec 2017 19:07:52 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E0DE677861; Fri, 29 Dec 2017 19:07:51 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBTJ7otK072992; Fri, 29 Dec 2017 19:07:50 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBTJ7oe5072991; Fri, 29 Dec 2017 19:07:50 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201712291907.vBTJ7oe5072991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Fri, 29 Dec 2017 19:07:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327355 - head/sys/dev/mmc X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/sys/dev/mmc X-SVN-Commit-Revision: 327355 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Dec 2017 19:07:52 -0000 Author: marius Date: Fri Dec 29 19:07:50 2017 New Revision: 327355 URL: https://svnweb.freebsd.org/changeset/base/327355 Log: - Don't allow userland to switch partitions; it's next to impossible to recover from that, especially when something goes wrong. - When userland changes EXT_CSD, update the kernel copy before using relevant EXT_CSD bits in mmcsd_switch_part(). Modified: head/sys/dev/mmc/mmcsd.c Modified: head/sys/dev/mmc/mmcsd.c ============================================================================== --- head/sys/dev/mmc/mmcsd.c Fri Dec 29 19:05:07 2017 (r327354) +++ head/sys/dev/mmc/mmcsd.c Fri Dec 29 19:07:50 2017 (r327355) @@ -914,6 +914,16 @@ mmcsd_ioctl_cmd(struct mmcsd_part *part, struct mmc_io default: break; } + /* + * No partition switching in userland; it's almost impossible + * to recover from that, especially if things go wrong. + */ + if (cmd.opcode == MMC_SWITCH_FUNC && dp != NULL && + (((uint8_t *)dp)[EXT_CSD_PART_CONFIG] & + EXT_CSD_PART_CONFIG_ACC_MASK) != sc->part_curr) { + err = EINVAL; + goto out; + } } dev = sc->dev; mmcbus = sc->mmcbus; @@ -934,7 +944,7 @@ mmcsd_ioctl_cmd(struct mmcsd_part *part, struct mmc_io if (part->type == EXT_CSD_PART_CONFIG_ACC_RPMB) { /* * If the request went to the RPMB partition, try to ensure - * that the command actually has completed ... + * that the command actually has completed. */ retries = MMCSD_CMD_RETRIES; do { @@ -946,13 +956,6 @@ mmcsd_ioctl_cmd(struct mmcsd_part *part, struct mmc_io break; DELAY(1000); } while (retries-- > 0); - -switch_back: - /* ... and always switch back to the default partition. */ - err = mmcsd_switch_part(mmcbus, dev, rca, - EXT_CSD_PART_CONFIG_ACC_DEFAULT); - if (err != MMC_ERR_NONE) - goto release; } /* * If EXT_CSD was changed, our copy is outdated now. Specifically, @@ -961,6 +964,17 @@ switch_back: */ if (cmd.opcode == MMC_SWITCH_FUNC) { err = mmc_send_ext_csd(mmcbus, dev, sc->ext_csd); + if (err != MMC_ERR_NONE) + goto release; + } +switch_back: + if (part->type == EXT_CSD_PART_CONFIG_ACC_RPMB) { + /* + * If the request went to the RPMB partition, always switch + * back to the default partition (see mmcsd_switch_part()). + */ + err = mmcsd_switch_part(mmcbus, dev, rca, + EXT_CSD_PART_CONFIG_ACC_DEFAULT); if (err != MMC_ERR_NONE) goto release; } From owner-svn-src-all@freebsd.org Fri Dec 29 20:00:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6052BEADA95; Fri, 29 Dec 2017 20:00:20 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2AC6479346; Fri, 29 Dec 2017 20:00:20 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBTK0JMK093745; Fri, 29 Dec 2017 20:00:19 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBTK0JGd093744; Fri, 29 Dec 2017 20:00:19 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201712292000.vBTK0JGd093744@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 29 Dec 2017 20:00:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327356 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 327356 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Dec 2017 20:00:20 -0000 Author: ian Date: Fri Dec 29 20:00:19 2017 New Revision: 327356 URL: https://svnweb.freebsd.org/changeset/base/327356 Log: Correct a mistake and reword a couple sentences to clarify that "the value" refers to the scale value, not the kmem_arena size that results from scaling. Suggested by: alc@ Modified: head/share/man/man4/md.4 Modified: head/share/man/man4/md.4 ============================================================================== --- head/share/man/man4/md.4 Fri Dec 29 19:07:50 2017 (r327355) +++ head/share/man/man4/md.4 Fri Dec 29 20:00:19 2017 (r327356) @@ -116,19 +116,19 @@ The default value is 32, which is sufficient to map 12 .It Cd options VM_KMEM_SIZE_SCALE= This configures the amount of kernel virtual address (KVA) space to dedicate to the kmem_arena map. -The value is the ratio of physical to virtual pages. +The scale value is the ratio of physical to virtual pages. The default value of 3 allocates a page of KVA for each 3 pages of physical ram in the system. The kernel and modules, including the root image, also consume KVA. The combination of a large root image and the default scaling -may preallocate so much KVA to kmem_arena that there is not enough +may preallocate so much KVA that there is not enough remaining address space to allocate kernel stacks, IO buffers, and other resources that are not part of kmem_arena. Overallocating kmem_arena space is likely to manifest as failure to launch userland processes with "cannot allocate kernel stack" messages. -Setting the value too high may result in kernel failure to allocate +Setting the scale value too high may result in kernel failure to allocate memory because kmem_arena is too small, and the failure may require significant runtime to manifest. Empirically, a value of 5 works well for a 200 MiB root image on From owner-svn-src-all@freebsd.org Fri Dec 29 20:25:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC241EAEC9C; Fri, 29 Dec 2017 20:25:16 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B68A87A4C4; Fri, 29 Dec 2017 20:25:16 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBTKPFcm006139; Fri, 29 Dec 2017 20:25:15 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBTKPFjC006138; Fri, 29 Dec 2017 20:25:15 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201712292025.vBTKPFjC006138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Fri, 29 Dec 2017 20:25:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327357 - head/sys/powerpc/aim X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: head/sys/powerpc/aim X-SVN-Commit-Revision: 327357 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Dec 2017 20:25:17 -0000 Author: nwhitehorn Date: Fri Dec 29 20:25:15 2017 New Revision: 327357 URL: https://svnweb.freebsd.org/changeset/base/327357 Log: Maintain alignment of in-code 64-bit quantities by design rather than luck. If these are not aligned, the linker has to emit a different type of relocation that the early boot self-relocation code cannot handle, even in principle, resulting in them being set to zero and the kernel crashing. MFC after: 1 week Modified: head/sys/powerpc/aim/trap_subr64.S Modified: head/sys/powerpc/aim/trap_subr64.S ============================================================================== --- head/sys/powerpc/aim/trap_subr64.S Fri Dec 29 20:00:19 2017 (r327356) +++ head/sys/powerpc/aim/trap_subr64.S Fri Dec 29 20:25:15 2017 (r327357) @@ -297,7 +297,8 @@ dtrace_invop_calltrap_addr: * not still hanging around in the trap handling region * once the MMU is turned on. */ - .globl CNAME(rstcode), CNAME(rstcodeend) + .globl CNAME(rstcode), CNAME(rstcodeend), CNAME(cpu_reset_handler) + .p2align 3 CNAME(rstcode): /* Explicitly set MSR[SF] */ mfmsr %r9 @@ -305,8 +306,9 @@ CNAME(rstcode): insrdi %r9,%r8,1,0 mtmsrd %r9 isync + bl 1f - .llong cpu_reset + .llong cpu_reset_handler /* Make sure to maintain 8-byte alignment */ 1: mflr %r9 ld %r9,0(%r9) mtlr %r9 @@ -314,7 +316,7 @@ CNAME(rstcode): blr CNAME(rstcodeend): -cpu_reset: +cpu_reset_handler: GET_TOCBASE(%r2) ld %r1,TOC_REF(tmpstk)(%r2) /* get new SP */ @@ -569,6 +571,7 @@ CNAME(aliend): * Has to handle standard pagetable spills */ .globl CNAME(dsitrap),CNAME(dsiend) + .p2align 3 CNAME(dsitrap): mtsprg1 %r1 /* save SP */ GET_CPUINFO(%r1) @@ -831,6 +834,7 @@ dbleave: * In case of KDB we want a separate trap catcher for it */ .globl CNAME(dblow),CNAME(dbend) + .p2align 3 CNAME(dblow): mtsprg1 %r1 /* save SP */ mtsprg2 %r29 /* save r29 */ @@ -859,6 +863,7 @@ CNAME(dblow): std %r30,(PC_DBSAVE+CPUSAVE_R30)(%r1) /* free r30 */ std %r31,(PC_DBSAVE+CPUSAVE_R31)(%r1) /* free r31 */ mflr %r28 /* save LR */ + nop /* alignment */ bl 9f /* Begin branch */ .llong dbtrap 9: mflr %r1 From owner-svn-src-all@freebsd.org Fri Dec 29 20:30:11 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 925FDEAEF25; Fri, 29 Dec 2017 20:30:11 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 66C707A6A3; Fri, 29 Dec 2017 20:30:11 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBTKUAYY006357; Fri, 29 Dec 2017 20:30:10 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBTKUA2V006354; Fri, 29 Dec 2017 20:30:10 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201712292030.vBTKUA2V006354@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Fri, 29 Dec 2017 20:30:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327358 - in head/sys: conf powerpc/aim powerpc/include X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: in head/sys: conf powerpc/aim powerpc/include X-SVN-Commit-Revision: 327358 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Dec 2017 20:30:11 -0000 Author: nwhitehorn Date: Fri Dec 29 20:30:10 2017 New Revision: 327358 URL: https://svnweb.freebsd.org/changeset/base/327358 Log: Add support for 64-bit PowerPC kernels to be directly loaded by kexec, which is used as the bootloader on a number of PPC64 platforms. This involves the following pieces: - Making the first instruction a valid kernel entry point, since kexec ignores the ELF entry value. This requires a separate section and linker magic to prevent the linker from filling the beginning of the section with stubs. - Adding an entry point at 0x60 past the first instruction for systems lacking firmware CPU shutdown support (notably PS3). - Linker script changes to support the above. MFC after: 1 month Modified: head/sys/conf/ldscript.powerpc64 head/sys/powerpc/aim/locore64.S head/sys/powerpc/include/vmparam.h Modified: head/sys/conf/ldscript.powerpc64 ============================================================================== --- head/sys/conf/ldscript.powerpc64 Fri Dec 29 20:25:15 2017 (r327357) +++ head/sys/conf/ldscript.powerpc64 Fri Dec 29 20:30:10 2017 (r327358) @@ -8,8 +8,12 @@ SEARCH_DIR(/usr/lib); PROVIDE (__stack = 0); SECTIONS { - /* Read-only sections, merged into text segment: */ + /* Low-address wrapper for bootloaders (kexec/kboot) that can't parse ELF */ + . = kernbase - 0x100; + .kboot : { *(.text.kboot) } + + /* Read-only sections, merged into text segment: */ . = kernbase; PROVIDE (begin = .); @@ -27,6 +31,9 @@ SECTIONS /* Do not emit PT_INTERP section, which confuses some loaders (kexec-lite) */ .interpX : { *(.interp) } : NONE /DISCARD/ : { *(.interp) } + + /* Also delete notes */ + /DISCARD/ : { *(.note.*) } .hash : { *(.hash) } .dynsym : { *(.dynsym) } Modified: head/sys/powerpc/aim/locore64.S ============================================================================== --- head/sys/powerpc/aim/locore64.S Fri Dec 29 20:25:15 2017 (r327357) +++ head/sys/powerpc/aim/locore64.S Fri Dec 29 20:30:10 2017 (r327358) @@ -61,6 +61,47 @@ GLOBAL(tmpstk) TOC_ENTRY(tmpstk) +/* + * Entry point for bootloaders that do not fully implement ELF and start + * at the beginning of the image (kexec, notably). In its own section so + * that it ends up before any linker-generated call stubs and actually at + * the beginning of the image. kexec on some systems also enters at + * (start of image) + 0x60, so put a spin loop there. + */ + .section ".text.kboot", "x", @progbits +kbootentry: + b __start +. = kbootentry + 0x40 /* Magic address used in platform layer */ + .global smp_spin_sem +ap_kexec_spin_sem: + .long -1 +. = kbootentry + 0x60 /* Entry point for kexec APs */ +ap_kexec_start: /* At 0x60 past start, copied to 0x60 by kexec */ + /* r3 set to CPU ID by kexec */ + + /* Invalidate icache for low-memory copy and jump there */ + li %r0,0x80 + dcbst 0,%r0 + sync + icbi 0,%r0 + isync + ba 0x78 /* Absolute branch to next inst */ + +1: or 31,31,31 /* yield */ + sync + lwz %r1,0x40(0) /* Spin on ap_kexec_spin_sem */ + cmpw %r1,%r3 /* Until it equals our CPU ID */ + bne 1b + + /* Released */ + or 2,2,2 /* unyield */ + ba EXC_RST + + +/* + * Now start the real text section + */ + .text .globl btext btext: Modified: head/sys/powerpc/include/vmparam.h ============================================================================== --- head/sys/powerpc/include/vmparam.h Fri Dec 29 20:25:15 2017 (r327357) +++ head/sys/powerpc/include/vmparam.h Fri Dec 29 20:30:10 2017 (r327358) @@ -108,7 +108,7 @@ #endif #ifdef AIM -#define KERNBASE 0x00100000UL /* start of kernel virtual */ +#define KERNBASE 0x00100100UL /* start of kernel virtual */ #ifndef __powerpc64__ #define VM_MIN_KERNEL_ADDRESS ((vm_offset_t)KERNEL_SR << ADDR_SR_SHFT) From owner-svn-src-all@freebsd.org Fri Dec 29 20:33:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C0FEEAF38D; Fri, 29 Dec 2017 20:33:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 145867AC37; Fri, 29 Dec 2017 20:33:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBTKXuW1010555; Fri, 29 Dec 2017 20:33:56 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBTKXu7E010554; Fri, 29 Dec 2017 20:33:56 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201712292033.vBTKXu7E010554@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 29 Dec 2017 20:33:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327359 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 327359 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Dec 2017 20:33:57 -0000 Author: kib Date: Fri Dec 29 20:33:56 2017 New Revision: 327359 URL: https://svnweb.freebsd.org/changeset/base/327359 Log: Do not lock vm map in swapout_procs(). Neither swapout_procs() nor swapout() access the map. Since the process' vmspace is referenced only to obtain the pointer to the vm_map, the reference is not needed as well. Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D13681 Modified: head/sys/vm/vm_swapout.c Modified: head/sys/vm/vm_swapout.c ============================================================================== --- head/sys/vm/vm_swapout.c Fri Dec 29 20:30:10 2017 (r327358) +++ head/sys/vm/vm_swapout.c Fri Dec 29 20:33:56 2017 (r327359) @@ -729,7 +729,6 @@ swapout_procs(int action) { struct proc *p; struct thread *td; - struct vmspace *vm; int minslptime, slptime; bool didswap; @@ -763,24 +762,6 @@ retry: PROC_UNLOCK(p); sx_sunlock(&allproc_lock); - /* - * Do not swapout a process that - * is waiting for VM data - * structures as there is a possible - * deadlock. Test this first as - * this may block. - * - * Lock the map until swapout - * finishes, or a thread of this - * process may attempt to alter - * the map. - */ - vm = vmspace_acquire_ref(p); - if (vm == NULL) - goto nextproc2; - if (!vm_map_trylock(&vm->vm_map)) - goto nextproc1; - PROC_LOCK(p); if (p->p_lock != 1 || (p->p_flag & (P_STOPPED_SINGLE | P_TRACED | P_SYSTEM)) != 0) @@ -867,17 +848,11 @@ retry: if (swapout(p) == 0) didswap = true; PROC_UNLOCK(p); - vm_map_unlock(&vm->vm_map); - vmspace_free(vm); goto retry; } } nextproc: PROC_UNLOCK(p); - vm_map_unlock(&vm->vm_map); -nextproc1: - vmspace_free(vm); -nextproc2: sx_slock(&allproc_lock); PRELE(p); } From owner-svn-src-all@freebsd.org Fri Dec 29 21:09:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2BB4EB097C; Fri, 29 Dec 2017 21:09:18 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A7287BB5C; Fri, 29 Dec 2017 21:09:18 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBTL9Hwu023078; Fri, 29 Dec 2017 21:09:17 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBTL9HFl023077; Fri, 29 Dec 2017 21:09:17 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201712292109.vBTL9HFl023077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Fri, 29 Dec 2017 21:09:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327360 - head/sys/powerpc/pseries X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: head/sys/powerpc/pseries X-SVN-Commit-Revision: 327360 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Dec 2017 21:09:18 -0000 Author: nwhitehorn Date: Fri Dec 29 21:09:17 2017 New Revision: 327360 URL: https://svnweb.freebsd.org/changeset/base/327360 Log: Enhance the CHRP/pSeries platform layer: - Densely number CPUs to avoid systems with CPUs with very high ID numbers - Always have the BSP be CPU 0 to avoid remnant brokenness with non-0 BSPs in other parts of the kernel. - Improve parsing of the device tree CPU listings on SMT systems. - Allow reboot via RTAS as well as OF for pSeries systems booted by FDT without functioning Open Firmware. Obtained from: projects/powernv MFC after: 3 weeks Modified: head/sys/powerpc/pseries/platform_chrp.c Modified: head/sys/powerpc/pseries/platform_chrp.c ============================================================================== --- head/sys/powerpc/pseries/platform_chrp.c Fri Dec 29 20:33:56 2017 (r327359) +++ head/sys/powerpc/pseries/platform_chrp.c Fri Dec 29 21:09:17 2017 (r327360) @@ -114,6 +114,8 @@ static platform_def_t chrp_platform = { PLATFORM_DEF(chrp_platform); +#define BSP_MUST_BE_CPU_ZERO + static int chrp_probe(platform_t plat) { @@ -279,13 +281,31 @@ chrp_real_maxaddr(platform_t plat) static u_long chrp_timebase_freq(platform_t plat, struct cpuref *cpuref) { - phandle_t phandle; + char buf[8]; + phandle_t cpu, dev, root; + int res; int32_t ticks = -1; - phandle = cpuref->cr_hwref; + root = OF_peer(0); - OF_getencprop(phandle, "timebase-frequency", &ticks, sizeof(ticks)); + dev = OF_child(root); + while (dev != 0) { + res = OF_getprop(dev, "name", buf, sizeof(buf)); + if (res > 0 && strcmp(buf, "cpus") == 0) + break; + dev = OF_peer(dev); + } + for (cpu = OF_child(dev); cpu != 0; cpu = OF_peer(cpu)) { + res = OF_getprop(cpu, "device_type", buf, sizeof(buf)); + if (res > 0 && strcmp(buf, "cpu") == 0) + break; + } + if (cpu == 0) + return (512000000); + + OF_getencprop(cpu, "timebase-frequency", &ticks, sizeof(ticks)); + if (ticks <= 0) panic("Unable to determine timebase frequency!"); @@ -293,11 +313,11 @@ chrp_timebase_freq(platform_t plat, struct cpuref *cpu } static int -chrp_smp_first_cpu(platform_t plat, struct cpuref *cpuref) +chrp_cpuref_for_server(struct cpuref *cpuref, int cpu_n, int server) { char buf[8]; phandle_t cpu, dev, root; - int res, cpuid; + int res, cpuid, i, j; root = OF_peer(0); @@ -318,71 +338,84 @@ chrp_smp_first_cpu(platform_t plat, struct cpuref *cpu return (ENOENT); } - cpu = OF_child(dev); - - while (cpu != 0) { + i = 0; + for (cpu = OF_child(dev); cpu != 0; cpu = OF_peer(cpu)) { res = OF_getprop(cpu, "device_type", buf, sizeof(buf)); - if (res > 0 && strcmp(buf, "cpu") == 0) - break; - cpu = OF_peer(cpu); + if (res <= 0 || strcmp(buf, "cpu") != 0) + continue; + + res = OF_getproplen(cpu, "ibm,ppc-interrupt-server#s"); + if (res > 0) { + cell_t interrupt_servers[res/sizeof(cell_t)]; + OF_getencprop(cpu, "ibm,ppc-interrupt-server#s", + interrupt_servers, res); + for (j = 0; j < res/sizeof(cell_t); j++) { + cpuid = interrupt_servers[j]; + if (server != -1 && cpuid == server) + break; + if (cpu_n != -1 && cpu_n == i) + break; + i++; + } + + if (j != res/sizeof(cell_t)) + break; + } else { + res = OF_getencprop(cpu, "reg", &cpuid, sizeof(cpuid)); + if (res <= 0) + cpuid = 0; + if (server != -1 && cpuid == server) + break; + if (cpu_n != -1 && cpu_n == i) + break; + i++; + } } + if (cpu == 0) return (ENOENT); - cpuref->cr_hwref = cpu; - res = OF_getencprop(cpu, "ibm,ppc-interrupt-server#s", &cpuid, - sizeof(cpuid)); - if (res <= 0) - res = OF_getencprop(cpu, "reg", &cpuid, sizeof(cpuid)); - if (res <= 0) - cpuid = 0; - cpuref->cr_cpuid = cpuid; + cpuref->cr_hwref = cpuid; + cpuref->cr_cpuid = i; return (0); } static int +chrp_smp_first_cpu(platform_t plat, struct cpuref *cpuref) +{ +#ifdef BSP_MUST_BE_CPU_ZERO + return (chrp_smp_get_bsp(plat, cpuref)); +#else + return (chrp_cpuref_for_server(cpuref, 0, -1)); +#endif +} + +static int chrp_smp_next_cpu(platform_t plat, struct cpuref *cpuref) { - char buf[8]; - phandle_t cpu; - int i, res, cpuid; +#ifdef BSP_MUST_BE_CPU_ZERO + int bsp, ncpus, err; + struct cpuref scratch; - /* Check for whether it should be the next thread */ - res = OF_getproplen(cpuref->cr_hwref, "ibm,ppc-interrupt-server#s"); - if (res > 0) { - cell_t interrupt_servers[res/sizeof(cell_t)]; - OF_getencprop(cpuref->cr_hwref, "ibm,ppc-interrupt-server#s", - interrupt_servers, res); - for (i = 0; i < res/sizeof(cell_t) - 1; i++) { - if (interrupt_servers[i] == cpuref->cr_cpuid) { - cpuref->cr_cpuid = interrupt_servers[i+1]; - return (0); - } - } - } + chrp_smp_get_bsp(plat, &scratch); + chrp_cpuref_for_server(&scratch, -1, scratch.cr_hwref); + bsp = scratch.cr_cpuid; - /* Next CPU core/package */ - cpu = OF_peer(cpuref->cr_hwref); - while (cpu != 0) { - res = OF_getprop(cpu, "device_type", buf, sizeof(buf)); - if (res > 0 && strcmp(buf, "cpu") == 0) - break; - cpu = OF_peer(cpu); - } - if (cpu == 0) + for (ncpus = bsp; chrp_cpuref_for_server(&scratch, ncpus, -1) != + ENOENT; ncpus++) {} + if (cpuref->cr_cpuid + 1 == ncpus) return (ENOENT); - - cpuref->cr_hwref = cpu; - res = OF_getencprop(cpu, "ibm,ppc-interrupt-server#s", &cpuid, - sizeof(cpuid)); - if (res <= 0) - res = OF_getencprop(cpu, "reg", &cpuid, sizeof(cpuid)); - if (res <= 0) - cpuid = 0; - cpuref->cr_cpuid = cpuid; - - return (0); + err = chrp_cpuref_for_server(cpuref, + (cpuref->cr_cpuid + bsp + 1) % ncpus, -1); + if (cpuref->cr_cpuid >= bsp) + cpuref->cr_cpuid -= bsp; + else + cpuref->cr_cpuid = ncpus - (bsp - cpuref->cr_cpuid); + return (err); +#else + return (chrp_cpuref_for_server(cpuref, cpuref->cr_cpuid+1, -1)); +#endif } static int @@ -403,14 +436,17 @@ chrp_smp_get_bsp(platform_t plat, struct cpuref *cpure bsp = OF_instance_to_package(inst); /* Pick the primary thread. Can it be any other? */ - cpuref->cr_hwref = bsp; res = OF_getencprop(bsp, "ibm,ppc-interrupt-server#s", &cpuid, sizeof(cpuid)); if (res <= 0) res = OF_getencprop(bsp, "reg", &cpuid, sizeof(cpuid)); if (res <= 0) cpuid = 0; + + chrp_cpuref_for_server(cpuref, -1, cpuid); +#ifdef BSP_MUST_BE_CPU_ZERO cpuref->cr_cpuid = cpuid; +#endif return (0); } @@ -438,7 +474,7 @@ chrp_smp_start_cpu(platform_t plat, struct pcpu *pc) ap_pcpu = pc; powerpc_sync(); - result = rtas_call_method(start_cpu, 3, 1, pc->pc_cpuid, EXC_RST, pc, + result = rtas_call_method(start_cpu, 3, 1, pc->pc_hwref, EXC_RST, pc, &err); if (result < 0 || err != 0) { printf("RTAS error (%d/%d): unable to start AP %d\n", @@ -456,39 +492,62 @@ chrp_smp_start_cpu(platform_t plat, struct pcpu *pc) static struct cpu_group * chrp_smp_topo(platform_t plat) { - struct pcpu *pc, *last_pc; - int i, ncores, ncpus; + char buf[8]; + phandle_t cpu, dev, root; + int res, nthreads; - ncores = ncpus = 0; - last_pc = NULL; - for (i = 0; i <= mp_maxid; i++) { - pc = pcpu_find(i); - if (pc == NULL) + root = OF_peer(0); + + dev = OF_child(root); + while (dev != 0) { + res = OF_getprop(dev, "name", buf, sizeof(buf)); + if (res > 0 && strcmp(buf, "cpus") == 0) + break; + dev = OF_peer(dev); + } + + nthreads = 1; + for (cpu = OF_child(dev); cpu != 0; cpu = OF_peer(cpu)) { + res = OF_getprop(cpu, "device_type", buf, sizeof(buf)); + if (res <= 0 || strcmp(buf, "cpu") != 0) continue; - if (last_pc == NULL || pc->pc_hwref != last_pc->pc_hwref) - ncores++; - last_pc = pc; - ncpus++; + + res = OF_getproplen(cpu, "ibm,ppc-interrupt-server#s"); + + if (res >= 0) + nthreads = res / sizeof(cell_t); + else + nthreads = 1; + break; } - if (ncpus % ncores != 0) { + if (mp_ncpus % nthreads != 0) { printf("WARNING: Irregular SMP topology. Performance may be " - "suboptimal (%d CPUS, %d cores)\n", ncpus, ncores); + "suboptimal (%d threads, %d on first core)\n", + mp_ncpus, nthreads); return (smp_topo_none()); } /* Don't do anything fancier for non-threaded SMP */ - if (ncpus == ncores) + if (nthreads == 1) return (smp_topo_none()); - return (smp_topo_1level(CG_SHARE_L1, ncpus / ncores, CG_FLAG_SMT)); + return (smp_topo_1level(CG_SHARE_L1, nthreads, CG_FLAG_SMT)); } #endif static void chrp_reset(platform_t platform) { - OF_reboot(); + cell_t token, status; + + if (rtas_exists()) { + token = rtas_token_lookup("system-reboot"); + if (token != -1) + rtas_call_method(token, 0, 1, &status); + } else { + OF_reboot(); + } } #ifdef __powerpc64__ From owner-svn-src-all@freebsd.org Fri Dec 29 21:37:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DECCEB19EF; Fri, 29 Dec 2017 21:37:38 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DCC5F7C942; Fri, 29 Dec 2017 21:37:37 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBTLbbMc035371; Fri, 29 Dec 2017 21:37:37 GMT (envelope-from maxim@FreeBSD.org) Received: (from maxim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBTLbbVg035370; Fri, 29 Dec 2017 21:37:37 GMT (envelope-from maxim@FreeBSD.org) Message-Id: <201712292137.vBTLbbVg035370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: maxim set sender to maxim@FreeBSD.org using -f From: Maxim Konovalov Date: Fri, 29 Dec 2017 21:37:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327361 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: maxim X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 327361 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Dec 2017 21:37:38 -0000 Author: maxim Date: Fri Dec 29 21:37:36 2017 New Revision: 327361 URL: https://svnweb.freebsd.org/changeset/base/327361 Log: Sort by time. Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Fri Dec 29 21:09:17 2017 (r327360) +++ head/share/misc/bsd-family-tree Fri Dec 29 21:37:36 2017 (r327361) @@ -729,8 +729,8 @@ NetBSD 7.0.1 2016-05-22 [NBD] DragonFly 4.6.0 2016-08-02 [DFB] OpenBSD 6.0 2016-09-01 [OBD] macOS 10.12 2016-09-20 [APL] -NetBSD 7.0.2 2016-10-21 [NBD] FreeBSD 11.0 2016-10-10 [FBD] +NetBSD 7.0.2 2016-10-21 [NBD] NetBSD 7.1 2017-03-11 [NBD] DragonFly 4.8.0 2017-03-27 [DFB] OpenBSD 6.1 2017-04-11 [OBD] From owner-svn-src-all@freebsd.org Fri Dec 29 22:08:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42F1AEB2D2A; Fri, 29 Dec 2017 22:08:45 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A2B87D9EB; Fri, 29 Dec 2017 22:08:45 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBTM8ioW048011; Fri, 29 Dec 2017 22:08:44 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBTM8hpG048007; Fri, 29 Dec 2017 22:08:43 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201712292208.vBTM8hpG048007@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 29 Dec 2017 22:08:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327362 - in head/usr.bin/find: . tests X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/usr.bin/find: . tests X-SVN-Commit-Revision: 327362 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Dec 2017 22:08:45 -0000 Author: cem Date: Fri Dec 29 22:08:43 2017 New Revision: 327362 URL: https://svnweb.freebsd.org/changeset/base/327362 Log: find(1): Fix -newer and -samefile to conform to POSIX[0] By default, or with the -P flag, find(1) should evaluate paths "physically." For symlinks, this means using the link itself instead of the target. Historically (since the import of BSD 4.4-lite from CSRG), find(1) has failed to refer to the link itself, at least for -newer and -samefile. [0]: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/find.html PR: 222698 Reported by: Harald Schmalzbauer Sponsored by: Dell EMC Isilon Added: head/usr.bin/find/tests/ head/usr.bin/find/tests/Makefile (contents, props changed) head/usr.bin/find/tests/find_test.sh (contents, props changed) Modified: head/usr.bin/find/Makefile head/usr.bin/find/function.c Modified: head/usr.bin/find/Makefile ============================================================================== --- head/usr.bin/find/Makefile Fri Dec 29 21:37:36 2017 (r327361) +++ head/usr.bin/find/Makefile Fri Dec 29 22:08:43 2017 (r327362) @@ -8,4 +8,7 @@ YFLAGS= NO_WMISSING_VARIABLE_DECLARATIONS= +#HAS_TESTS= +#SUBDIR.${MK_TESTS}+= tests + .include Modified: head/usr.bin/find/function.c ============================================================================== --- head/usr.bin/find/function.c Fri Dec 29 21:37:36 2017 (r327361) +++ head/usr.bin/find/function.c Fri Dec 29 22:08:43 2017 (r327362) @@ -1066,12 +1066,17 @@ c_samefile(OPTION *option, char ***argvp) char *fn; PLAN *new; struct stat sb; + int error; fn = nextarg(option, argvp); ftsoptions &= ~FTS_NOSTAT; new = palloc(option); - if (stat(fn, &sb)) + if (ftsoptions & FTS_PHYSICAL) + error = lstat(fn, &sb); + else + error = stat(fn, &sb); + if (error != 0) err(1, "%s", fn); new->i_data = sb.st_ino; return new; @@ -1201,6 +1206,7 @@ c_newer(OPTION *option, char ***argvp) char *fn_or_tspec; PLAN *new; struct stat sb; + int error; fn_or_tspec = nextarg(option, argvp); ftsoptions &= ~FTS_NOSTAT; @@ -1214,7 +1220,11 @@ c_newer(OPTION *option, char ***argvp) /* Use the seconds only in the comparison. */ new->t_data.tv_nsec = 999999999; } else { - if (stat(fn_or_tspec, &sb)) + if (ftsoptions & FTS_PHYSICAL) + error = lstat(fn_or_tspec, &sb); + else + error = stat(fn_or_tspec, &sb); + if (error != 0) err(1, "%s", fn_or_tspec); if (option->flags & F_TIME2_C) new->t_data = sb.st_ctim; Added: head/usr.bin/find/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/find/tests/Makefile Fri Dec 29 22:08:43 2017 (r327362) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +ATF_TESTS_SH= find_test + +.include Added: head/usr.bin/find/tests/find_test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/find/tests/find_test.sh Fri Dec 29 22:08:43 2017 (r327362) @@ -0,0 +1,73 @@ +# +# Copyright 2017, Conrad Meyer . +# +# 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 +# OWNER 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$ +# + +atf_test_case find_newer_link +find_newer_link_head() +{ + atf_set "descr" "Verifies that -newer correctly uses a symlink, " \ + "rather than its target, for comparison" +} +find_newer_link_body() +{ + atf_check -s exit:0 mkdir test + atf_check -s exit:0 ln -s file1 test/link + atf_check -s exit:0 sleep 1.1 + atf_check -s exit:0 touch test/file2 + atf_check -s exit:0 sleep 1.1 + atf_check -s exit:0 touch test/file1 + + # find(1) should evaluate 'link' as a symlink rather than its target + # (with -P / without -L flags). Since link was created first, the + # other two files should be newer. + echo -e "test\ntest/file1\ntest/file2" > expout + atf_check -s exit:0 -o save:output find test -newer test/link + atf_check -s exit:0 -o file:expout sort < output +} + +atf_test_case find_samefile_link +find_samefile_link_head() +{ + atf_set "descr" "Verifies that -samefile correctly uses a symlink, " \ + "rather than its target, for comparison" +} +find_samefile_link_body() +{ + atf_check -s exit:0 mkdir test + atf_check -s exit:0 touch test/file3 + atf_check -s exit:0 ln -s file3 test/link2 + + # find(1) should evaluate 'link' as a symlink rather than its target + # (with -P / without -L flags). + atf_check -s exit:0 -o "inline:test/link2\n" find test -samefile test/link2 +} + +atf_init_test_cases() +{ + atf_add_test_case find_newer_link + atf_add_test_case find_samefile_link +} From owner-svn-src-all@freebsd.org Fri Dec 29 22:24:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9215EB382A; Fri, 29 Dec 2017 22:24:42 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9343C7E6FF; Fri, 29 Dec 2017 22:24:42 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBTMOfUU056772; Fri, 29 Dec 2017 22:24:41 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBTMOfDH056770; Fri, 29 Dec 2017 22:24:41 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201712292224.vBTMOfDH056770@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 29 Dec 2017 22:24:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327364 - in head/sys/dev: ahci usb/controller X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys/dev: ahci usb/controller X-SVN-Commit-Revision: 327364 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Dec 2017 22:24:42 -0000 Author: cem Date: Fri Dec 29 22:24:41 2017 New Revision: 327364 URL: https://svnweb.freebsd.org/changeset/base/327364 Log: Add AHCI/XHCI device IDs found on AMD 1950X+X399 system A follow-up to r327094. Sponsored by: Dell EMC Isilon Modified: head/sys/dev/ahci/ahci_pci.c head/sys/dev/usb/controller/xhci_pci.c Modified: head/sys/dev/ahci/ahci_pci.c ============================================================================== --- head/sys/dev/ahci/ahci_pci.c Fri Dec 29 22:10:06 2017 (r327363) +++ head/sys/dev/ahci/ahci_pci.c Fri Dec 29 22:24:41 2017 (r327364) @@ -68,6 +68,7 @@ static const struct { AHCI_Q_ATI_PMP_BUG | AHCI_Q_1MSI}, /* Not sure SB8x0/SB9x0 needs this quirk. Be conservative though */ {0x43951002, 0x00, "AMD SB8x0/SB9x0", AHCI_Q_ATI_PMP_BUG}, + {0x43b61022, 0x00, "AMD X399", 0}, {0x43b71022, 0x00, "AMD 300 Series", 0}, {0x78001022, 0x00, "AMD Hudson-2", 0}, {0x78011022, 0x00, "AMD Hudson-2", 0}, Modified: head/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- head/sys/dev/usb/controller/xhci_pci.c Fri Dec 29 22:10:06 2017 (r327363) +++ head/sys/dev/usb/controller/xhci_pci.c Fri Dec 29 22:24:41 2017 (r327364) @@ -99,6 +99,8 @@ xhci_pci_match(device_t self) switch (device_id) { case 0x145c1022: return ("AMD KERNCZ USB 3.0 controller"); + case 0x43ba1022: + return ("AMD X399 USB 3.0 controller"); case 0x43bb1022: return ("AMD 300 Series USB 3.0 controller"); case 0x78141022: From owner-svn-src-all@freebsd.org Fri Dec 29 22:41:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E98ACEB416C for ; Fri, 29 Dec 2017 22:41:10 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wm0-x231.google.com (mail-wm0-x231.google.com [IPv6:2a00:1450:400c:c09::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 744CA7F001 for ; Fri, 29 Dec 2017 22:41:10 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wm0-x231.google.com with SMTP id f206so49796730wmf.5 for ; Fri, 29 Dec 2017 14:41:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=/OY9FfCMFlkYN50hnaI71HTEHESXqXv/wm496+VkCbM=; b=BYJbV1IfpbPI7iWj+qP4Af7Bg3OTo78QhGQorIpSZsd4nK+L+vVgkMr67oA/bZwmWX UOjpdtiRFinO1cfw32JAZwIgcFCESpcdMuXF86sgzRD2Ix1fySJ2inowy0pdA9PYj1XV zoGjx1Rkle/qeY06A8JDHci0DYhcze5wJfyhLjJKGlQ+WLAnuI72soZsZoblkNZkol3M lv0f7RzEXpTGlFupIScX6o4eINnXSuu3b8g+LYA77iKhHXpftTL1RpOCzhc6DNza00jv REHAgzozBhuSlnFBhPcjJaRssCzA/7jMu1U7udMLvkISLcPH03emS6GoSV5D/QlohBVO WhjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=/OY9FfCMFlkYN50hnaI71HTEHESXqXv/wm496+VkCbM=; b=Lhn1bL0p+anJqss2TrQxTFF3N8mANBxMa35no93tkwGfXRjhGaz3NLZRUEYnY/w8tQ cYflRCL/EIF6X2pv4BmRJwNUPniAWh53OMQSC0f6gwxo0pMmCMWoGZvkFhjGDoBy6Rj9 aAeWofqi5Rrl0IugY1U25EDL/pvq+XfTHWDmnf28CBCtEXfcUPhLuxuApum44WAczsDw KZHpSeSJbck8y2gF7UHJXyZuK8og3zubPjFGNopQ9HN7MH8GJbsDDIQ2fNdr68PntZcD fkfF9wBE83AJDl7x9b/eHyuRL3tpSMw4B/E+UDn/RHR+/sAA2RBRykmoaeSlGpY+j+nT tIew== X-Gm-Message-State: AKGB3mLpZ+gZ8aJiLUuCR1pBInQGXz7ggbyZ7CKvj1r07Z3VgK6pZsq2 q0Gagj0mcMZ+Z3NktiDhB5iiQE8MfCIQAEMEYx0nSg== X-Google-Smtp-Source: ACJfBotCiY3hgWnZpOcssJIVs3DscCoSRPO41z6O8hrnzArH7yyU2T3E3fw3tkm/v1tEtv0kpJLN108abQzjHTLPXS4= X-Received: by 10.80.208.195 with SMTP id g3mr46280884edf.246.1514587268703; Fri, 29 Dec 2017 14:41:08 -0800 (PST) MIME-Version: 1.0 Received: by 10.80.149.174 with HTTP; Fri, 29 Dec 2017 14:41:08 -0800 (PST) In-Reply-To: <201712292208.vBTM8hpG048007@repo.freebsd.org> References: <201712292208.vBTM8hpG048007@repo.freebsd.org> From: Oliver Pinter Date: Fri, 29 Dec 2017 23:41:08 +0100 Message-ID: Subject: Re: svn commit: r327362 - in head/usr.bin/find: . tests To: Conrad Meyer Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Dec 2017 22:41:11 -0000 On Friday, December 29, 2017, Conrad Meyer wrote: > Author: cem > Date: Fri Dec 29 22:08:43 2017 > New Revision: 327362 > URL: https://svnweb.freebsd.org/changeset/base/327362 > > Log: > find(1): Fix -newer and -samefile to conform to POSIX[0] > > By default, or with the -P flag, find(1) should evaluate paths > "physically." > For symlinks, this means using the link itself instead of the target. > > Historically (since the import of BSD 4.4-lite from CSRG), find(1) has > failed to refer to the link itself, at least for -newer and -samefile. > > [0]: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/find.html > > PR: 222698 > Reported by: Harald Schmalzbauer > Sponsored by: Dell EMC Isilon > > Added: > head/usr.bin/find/tests/ > head/usr.bin/find/tests/Makefile (contents, props changed) > head/usr.bin/find/tests/find_test.sh (contents, props changed) > Modified: > head/usr.bin/find/Makefile > head/usr.bin/find/function.c > > Modified: head/usr.bin/find/Makefile > ============================================================ > ================== > --- head/usr.bin/find/Makefile Fri Dec 29 21:37:36 2017 (r327361) > +++ head/usr.bin/find/Makefile Fri Dec 29 22:08:43 2017 (r327362) > @@ -8,4 +8,7 @@ YFLAGS= > > NO_WMISSING_VARIABLE_DECLARATIONS= > > +#HAS_TESTS= > +#SUBDIR.${MK_TESTS}+= tests Why did you comment out these tests? > + > .include > > Modified: head/usr.bin/find/function.c > ============================================================ > ================== > --- head/usr.bin/find/function.c Fri Dec 29 21:37:36 2017 > (r327361) > +++ head/usr.bin/find/function.c Fri Dec 29 22:08:43 2017 > (r327362) > @@ -1066,12 +1066,17 @@ c_samefile(OPTION *option, char ***argvp) > char *fn; > PLAN *new; > struct stat sb; > + int error; > > fn = nextarg(option, argvp); > ftsoptions &= ~FTS_NOSTAT; > > new = palloc(option); > - if (stat(fn, &sb)) > + if (ftsoptions & FTS_PHYSICAL) > + error = lstat(fn, &sb); > + else > + error = stat(fn, &sb); > + if (error != 0) > err(1, "%s", fn); > new->i_data = sb.st_ino; > return new; > @@ -1201,6 +1206,7 @@ c_newer(OPTION *option, char ***argvp) > char *fn_or_tspec; > PLAN *new; > struct stat sb; > + int error; > > fn_or_tspec = nextarg(option, argvp); > ftsoptions &= ~FTS_NOSTAT; > @@ -1214,7 +1220,11 @@ c_newer(OPTION *option, char ***argvp) > /* Use the seconds only in the comparison. */ > new->t_data.tv_nsec = 999999999; > } else { > - if (stat(fn_or_tspec, &sb)) > + if (ftsoptions & FTS_PHYSICAL) > + error = lstat(fn_or_tspec, &sb); > + else > + error = stat(fn_or_tspec, &sb); > + if (error != 0) > err(1, "%s", fn_or_tspec); > if (option->flags & F_TIME2_C) > new->t_data = sb.st_ctim; > > Added: head/usr.bin/find/tests/Makefile > ============================================================ > ================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/usr.bin/find/tests/Makefile Fri Dec 29 22:08:43 2017 > (r327362) > @@ -0,0 +1,5 @@ > +# $FreeBSD$ > + > +ATF_TESTS_SH= find_test > + > +.include > > Added: head/usr.bin/find/tests/find_test.sh > ============================================================ > ================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/usr.bin/find/tests/find_test.sh Fri Dec 29 22:08:43 2017 > (r327362) > @@ -0,0 +1,73 @@ > +# > +# Copyright 2017, Conrad Meyer . > +# > +# 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 > +# OWNER 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$ > +# > + > +atf_test_case find_newer_link > +find_newer_link_head() > +{ > + atf_set "descr" "Verifies that -newer correctly uses a symlink, " \ > + "rather than its target, for comparison" > +} > +find_newer_link_body() > +{ > + atf_check -s exit:0 mkdir test > + atf_check -s exit:0 ln -s file1 test/link > + atf_check -s exit:0 sleep 1.1 > + atf_check -s exit:0 touch test/file2 > + atf_check -s exit:0 sleep 1.1 > + atf_check -s exit:0 touch test/file1 > + > + # find(1) should evaluate 'link' as a symlink rather than its > target > + # (with -P / without -L flags). Since link was created first, the > + # other two files should be newer. > + echo -e "test\ntest/file1\ntest/file2" > expout > + atf_check -s exit:0 -o save:output find test -newer test/link > + atf_check -s exit:0 -o file:expout sort < output > +} > + > +atf_test_case find_samefile_link > +find_samefile_link_head() > +{ > + atf_set "descr" "Verifies that -samefile correctly uses a symlink, > " \ > + "rather than its target, for comparison" > +} > +find_samefile_link_body() > +{ > + atf_check -s exit:0 mkdir test > + atf_check -s exit:0 touch test/file3 > + atf_check -s exit:0 ln -s file3 test/link2 > + > + # find(1) should evaluate 'link' as a symlink rather than its > target > + # (with -P / without -L flags). > + atf_check -s exit:0 -o "inline:test/link2\n" find test -samefile > test/link2 > +} > + > +atf_init_test_cases() > +{ > + atf_add_test_case find_newer_link > + atf_add_test_case find_samefile_link > +} > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-all@freebsd.org Fri Dec 29 22:47:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80FC8EB460E; Fri, 29 Dec 2017 22:47:46 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f182.google.com (mail-io0-f182.google.com [209.85.223.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FCED7F3FB; Fri, 29 Dec 2017 22:47:45 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f182.google.com with SMTP id 87so38204507ior.5; Fri, 29 Dec 2017 14:47:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=w8xy2B+g4D4KKQvvAI+TTkycVV5hX/ThhqUiUuEQ7vQ=; b=OZQfuDTSTJFOjUBUxftiruQib7hEpGti9YGUa0bb89sNCHYkzoJjgg5sPXFDFF8MjD BUsSBHAkla3NeKmdrhYzKao6K5KP/j8noSXtT7r6gqRVW4f/XGHLMT8JbWMbI3OwvRFv oSA35dicu8M2Ty4s3kgVGML4bABtjFq9SNadXTrEoFwZd7RMLQLOt0XPURbpMfueETYE ts78J+M5j0FlcvC8QGBTrl8Tx8TqOkwNAzoodDkHCzEd/5qdBkEaqLB6z7Y6FJqY78lI a1ufJnrTiMfxkcr97MPnXYGfqhI5nMrC8Gfr6D32bJKhX5hj6MjJhmQO9ApjDBRNpqr7 cZAQ== X-Gm-Message-State: AKGB3mJtmxz8G2YJfqE8pwuxdGPrllzMTNVcWQCjM3GYVatNC1p9hclt V9Dd2vIoMcOtqOKnEGWSylktfl4R X-Google-Smtp-Source: ACJfBot9BDQdW8Mlu2eMIoyozh9IVBrONy1nnkkm79Hlb9M2ZQd0Iiva04+Lcxna8uosWxhS7p8KzA== X-Received: by 10.107.189.6 with SMTP id n6mr6018061iof.127.1514587659250; Fri, 29 Dec 2017 14:47:39 -0800 (PST) Received: from mail-it0-f44.google.com (mail-it0-f44.google.com. [209.85.214.44]) by smtp.gmail.com with ESMTPSA id c23sm16762841iod.5.2017.12.29.14.47.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Dec 2017 14:47:38 -0800 (PST) Received: by mail-it0-f44.google.com with SMTP id f143so32895588itb.0; Fri, 29 Dec 2017 14:47:38 -0800 (PST) X-Received: by 10.36.0.209 with SMTP id 200mr47439116ita.55.1514587658741; Fri, 29 Dec 2017 14:47:38 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.15.193 with HTTP; Fri, 29 Dec 2017 14:47:38 -0800 (PST) In-Reply-To: References: <201712292208.vBTM8hpG048007@repo.freebsd.org> From: Conrad Meyer Date: Fri, 29 Dec 2017 14:47:38 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r327362 - in head/usr.bin/find: . tests To: Oliver Pinter Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Dec 2017 22:47:46 -0000 On Fri, Dec 29, 2017 at 2:41 PM, Oliver Pinter wrote: > Why did you comment out these tests? I think unit tests are a good idea for this kind of change, which is why I wrote them. And I run them before commit. But I'm not interested in tilting at the test build infrastructure to actually enable them. Someone else can hook them up to the build if they want to. Conrad From owner-svn-src-all@freebsd.org Fri Dec 29 22:50:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4EE1DEB47C6 for ; Fri, 29 Dec 2017 22:50:23 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wm0-x22a.google.com (mail-wm0-x22a.google.com [IPv6:2a00:1450:400c:c09::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D2B5B7F5A2 for ; Fri, 29 Dec 2017 22:50:22 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wm0-x22a.google.com with SMTP id g75so50486592wme.0 for ; Fri, 29 Dec 2017 14:50:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=bUr4zIgRGMLGrUCaRSNK51fFoCtB2sf6egU9DNgNqRM=; b=XCQ/Is+7T+MhgB68LssLRfjncwfSDRYDgSu5ZmEqfvi/uvtl4C9DFM6q1gihTK++Zm OgWDQ87IOIsY8OqhbeGQPODVaPqgeD9EeMgzk2Iackv0T56aLKt9VIKWIZU+wt0Q9H8O 8G93kJzGgjC5mpsCBsmpVTxAjF+3YFrZLI2OSWOPeMTdtDpV/wEBm0ST3sg/g+Sr9+hm kcGQafctYMXSOpig3FZhLTiIdMyNg+7TpcJrAiecPjdvG9XSt/5kNPfR8zwe84wJ1f93 RqsW+zBl3WIayUoj7CkW4Ye62WVJGueZ7aRV2CZaWnL54I6SdGABSRIGp6huM+iyDC/z lSpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=bUr4zIgRGMLGrUCaRSNK51fFoCtB2sf6egU9DNgNqRM=; b=C5T627fCr4oj/vjSYoub2cIpdhQG7Lc5A3fBMULRim/CDtxjNTpx7buaSJKtfpbrI0 YlTUrdjWMQZUeTy+Ne/s0BNP5f1kWD98w39DwUHxtqCblqB2dLdhAEGmRdV1LDvP35JT 6b90EtqZIb1TMViXGhbziiJ5g2iXv+c4a+boKMslxTQwpxalm/v0N+TEYdfZ4SS7r5+V Ugnv/WC/Y4Csk3z5yT4uMgsw1diMszeNXsyi1T3DPwG1yAiHtxdggq2/4o2RVhbEgroN p0eOx1wpQBj/K39kVCvknX7doTUugxG1KEX0pcYBRET/16ikdbXhtK6wx5sjjzO6iQ9d hzXQ== X-Gm-Message-State: AKGB3mKaSVVX6VXTuksPJ7i1oJzvMMlnzNuwcYszepU6MdWxdWCNM6ah CaY+X5jOaWvklnJG1iFc2FkedIcSTUKqJr/uo1rCjw== X-Google-Smtp-Source: ACJfBos3jlKalp6eQ3AM/6giqmr8LibMGASwNoGMRxrE1ftkNTyWFITMnFm/RSBGaPL/RKMPnwjWA5s6mxckg+BTO2M= X-Received: by 10.80.142.88 with SMTP id 24mr47732215edx.153.1514587821335; Fri, 29 Dec 2017 14:50:21 -0800 (PST) MIME-Version: 1.0 Received: by 10.80.149.174 with HTTP; Fri, 29 Dec 2017 14:50:21 -0800 (PST) In-Reply-To: References: <201712292208.vBTM8hpG048007@repo.freebsd.org> From: Oliver Pinter Date: Fri, 29 Dec 2017 23:50:21 +0100 Message-ID: Subject: Re: svn commit: r327362 - in head/usr.bin/find: . tests To: "cem@freebsd.org" Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Dec 2017 22:50:23 -0000 On Friday, December 29, 2017, Conrad Meyer wrote: > On Fri, Dec 29, 2017 at 2:41 PM, Oliver Pinter > wrote: > > Why did you comment out these tests? > > I think unit tests are a good idea for this kind of change, which is > why I wrote them. And I run them before commit. But I'm not > interested in tilting at the test build infrastructure to actually > enable them. Someone else can hook them up to the build if they want > to. Okay. That's fine. Thanks for the clarification. > > Conrad > From owner-svn-src-all@freebsd.org Fri Dec 29 23:56:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4205BE8193A; Fri, 29 Dec 2017 23:56:08 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C11F1D3F; Fri, 29 Dec 2017 23:56:07 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBTNu6HR094374; Fri, 29 Dec 2017 23:56:06 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBTNu6dV094373; Fri, 29 Dec 2017 23:56:06 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201712292356.vBTNu6dV094373@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Fri, 29 Dec 2017 23:56:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327365 - head/targets/pseudo/userland X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/targets/pseudo/userland X-SVN-Commit-Revision: 327365 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Dec 2017 23:56:08 -0000 Author: eadler Date: Fri Dec 29 23:56:06 2017 New Revision: 327365 URL: https://svnweb.freebsd.org/changeset/base/327365 Log: Remove a reference to burncd I'm unclear of the purpose of this pseudo-target but while its here keep it up to date Modified: head/targets/pseudo/userland/Makefile.depend Modified: head/targets/pseudo/userland/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/Makefile.depend Fri Dec 29 22:24:41 2017 (r327364) +++ head/targets/pseudo/userland/Makefile.depend Fri Dec 29 23:56:06 2017 (r327365) @@ -528,7 +528,6 @@ DIRDEPS+= \ usr.sbin/bsnmpd/modules/snmp_wlan \ usr.sbin/bsnmpd/tools/bsnmptools \ usr.sbin/bsnmpd/tools/libbsnmptools \ - usr.sbin/burncd \ usr.sbin/cdcontrol \ usr.sbin/chkgrp \ usr.sbin/chown \ From owner-svn-src-all@freebsd.org Fri Dec 29 23:58:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C84C1E81CE4; Fri, 29 Dec 2017 23:58:06 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 928CA1EDC; Fri, 29 Dec 2017 23:58:06 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBTNw5xN094495; Fri, 29 Dec 2017 23:58:05 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBTNw5NE094494; Fri, 29 Dec 2017 23:58:05 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201712292358.vBTNw5NE094494@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Fri, 29 Dec 2017 23:58:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327366 - head/share/examples/sunrpc/msg X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/share/examples/sunrpc/msg X-SVN-Commit-Revision: 327366 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Dec 2017 23:58:06 -0000 Author: eadler Date: Fri Dec 29 23:58:05 2017 New Revision: 327366 URL: https://svnweb.freebsd.org/changeset/base/327366 Log: examples: fix typo Modified: head/share/examples/sunrpc/msg/msg_proc.c Modified: head/share/examples/sunrpc/msg/msg_proc.c ============================================================================== --- head/share/examples/sunrpc/msg/msg_proc.c Fri Dec 29 23:56:06 2017 (r327365) +++ head/share/examples/sunrpc/msg/msg_proc.c Fri Dec 29 23:58:05 2017 (r327366) @@ -9,7 +9,7 @@ #include "msg.h" /* need this too: msg.h will be generated by rpcgen */ /* - * Remote verson of "printmessage" + * Remote version of "printmessage" */ int * printmessage_1(msg) From owner-svn-src-all@freebsd.org Sat Dec 30 00:20:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3415CE85523; Sat, 30 Dec 2017 00:20:53 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D98F06347F; Sat, 30 Dec 2017 00:20:52 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBU0KpMW008435; Sat, 30 Dec 2017 00:20:51 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBU0KnGF008410; Sat, 30 Dec 2017 00:20:49 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201712300020.vBU0KnGF008410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 30 Dec 2017 00:20:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327367 - in head/sys: arm/allwinner arm/altera/socfpga arm/arm arm/broadcom/bcm2835 arm/conf arm/freescale/imx arm/freescale/vybrid arm/include arm/mv/armada38x arm/mv/armadaxp arm/nvi... X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys: arm/allwinner arm/altera/socfpga arm/arm arm/broadcom/bcm2835 arm/conf arm/freescale/imx arm/freescale/vybrid arm/include arm/mv/armada38x arm/mv/armadaxp arm/nvidia/tegra124 arm/rockchip... X-SVN-Commit-Revision: 327367 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 00:20:53 -0000 Author: ian Date: Sat Dec 30 00:20:49 2017 New Revision: 327367 URL: https://svnweb.freebsd.org/changeset/base/327367 Log: Make kernel option KERNVIRTADDR optional, remove it from std. files that can use the default value. It used to be required that the low-order bits of KERNVIRTADDR matched the low-order bits of the physical load address for all arm platforms. That hasn't been a requirement for armv6 platforms since FreeBSD 10. There is no longer any relationship between load addr and KERNVIRTADDR except that both must be aligned to a 2 MiB boundary. This change makes the default KERNVIRTADDR value 0xc0000000, and removes the options from all the platforms that can use the default value. The default is now defined in vmparam.h, and that file is now included in a few new places that reference KERNVIRTADDR, since it may not come in via the forced-include of opt_global.h on the compile command line. Modified: head/sys/arm/allwinner/std.allwinner head/sys/arm/allwinner/std.allwinner_up head/sys/arm/altera/socfpga/std.socfpga head/sys/arm/arm/dump_machdep.c head/sys/arm/arm/elf_trampoline.c head/sys/arm/arm/genassym.c head/sys/arm/arm/machdep_boot.c head/sys/arm/broadcom/bcm2835/std.rpi head/sys/arm/conf/GENERIC head/sys/arm/conf/NOTES head/sys/arm/freescale/imx/std.imx51 head/sys/arm/freescale/imx/std.imx53 head/sys/arm/freescale/imx/std.imx6 head/sys/arm/freescale/vybrid/std.vybrid head/sys/arm/include/vmparam.h head/sys/arm/mv/armada38x/std.armada38x head/sys/arm/mv/armadaxp/std.armadaxp head/sys/arm/nvidia/tegra124/std.tegra124 head/sys/arm/rockchip/std.rk30xx head/sys/arm/samsung/exynos/std.exynos5250 head/sys/arm/samsung/exynos/std.exynos5420 head/sys/arm/ti/am335x/std.am335x head/sys/arm/ti/omap4/std.omap4 head/sys/arm/xilinx/std.zynq7 head/sys/conf/Makefile.arm Modified: head/sys/arm/allwinner/std.allwinner ============================================================================== --- head/sys/arm/allwinner/std.allwinner Fri Dec 29 23:58:05 2017 (r327366) +++ head/sys/arm/allwinner/std.allwinner Sat Dec 30 00:20:49 2017 (r327367) @@ -5,9 +5,6 @@ cpu CPU_CORTEXA machine arm armv7 makeoptions CONF_CFLAGS="-march=armv7a" -makeoptions KERNVIRTADDR=0xc0200000 -options KERNVIRTADDR=0xc0200000 - options IPI_IRQ_START=0 options IPI_IRQ_END=15 Modified: head/sys/arm/allwinner/std.allwinner_up ============================================================================== --- head/sys/arm/allwinner/std.allwinner_up Fri Dec 29 23:58:05 2017 (r327366) +++ head/sys/arm/allwinner/std.allwinner_up Sat Dec 30 00:20:49 2017 (r327367) @@ -5,9 +5,6 @@ cpu CPU_CORTEXA machine arm armv7 makeoptions CONF_CFLAGS="-march=armv7a" -makeoptions KERNVIRTADDR=0xc0200000 -options KERNVIRTADDR=0xc0200000 - files "../allwinner/files.allwinner_up" files "../allwinner/files.allwinner" files "../allwinner/a10/files.a10" Modified: head/sys/arm/altera/socfpga/std.socfpga ============================================================================== --- head/sys/arm/altera/socfpga/std.socfpga Fri Dec 29 23:58:05 2017 (r327366) +++ head/sys/arm/altera/socfpga/std.socfpga Sat Dec 30 00:20:49 2017 (r327367) @@ -4,9 +4,6 @@ cpu CPU_CORTEXA machine arm armv7 makeoptions CONF_CFLAGS="-march=armv7a" -makeoptions KERNVIRTADDR=0xc0f00000 -options KERNVIRTADDR=0xc0f00000 - options IPI_IRQ_START=0 options IPI_IRQ_END=15 Modified: head/sys/arm/arm/dump_machdep.c ============================================================================== --- head/sys/arm/arm/dump_machdep.c Fri Dec 29 23:58:05 2017 (r327366) +++ head/sys/arm/arm/dump_machdep.c Sat Dec 30 00:20:49 2017 (r327367) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include /* For KERNVIRTADDR */ int do_minidump = 1; SYSCTL_INT(_debug, OID_AUTO, minidump, CTLFLAG_RWTUN, &do_minidump, 0, Modified: head/sys/arm/arm/elf_trampoline.c ============================================================================== --- head/sys/arm/arm/elf_trampoline.c Fri Dec 29 23:58:05 2017 (r327366) +++ head/sys/arm/arm/elf_trampoline.c Sat Dec 30 00:20:49 2017 (r327367) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include /* For KERNVIRTADDR */ #if __ARM_ARCH >= 6 #error "elf_trampline is not supported on ARMv6/v7 platforms" Modified: head/sys/arm/arm/genassym.c ============================================================================== --- head/sys/arm/arm/genassym.c Fri Dec 29 23:58:05 2017 (r327366) +++ head/sys/arm/arm/genassym.c Sat Dec 30 00:20:49 2017 (r327367) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include /* For KERNVIRTADDR */ #include #include @@ -59,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include ASSYM(KERNBASE, KERNBASE); +ASSYM(KERNVIRTADDR, KERNVIRTADDR); #if __ARM_ARCH >= 6 ASSYM(CPU_ASID_KERNEL,CPU_ASID_KERNEL); #endif Modified: head/sys/arm/arm/machdep_boot.c ============================================================================== --- head/sys/arm/arm/machdep_boot.c Fri Dec 29 23:58:05 2017 (r327366) +++ head/sys/arm/arm/machdep_boot.c Sat Dec 30 00:20:49 2017 (r327367) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include /* For KERNVIRTADDR */ #ifdef FDT #include Modified: head/sys/arm/broadcom/bcm2835/std.rpi ============================================================================== --- head/sys/arm/broadcom/bcm2835/std.rpi Fri Dec 29 23:58:05 2017 (r327366) +++ head/sys/arm/broadcom/bcm2835/std.rpi Sat Dec 30 00:20:49 2017 (r327367) @@ -1,5 +1,3 @@ # $FreeBSD$ -options KERNVIRTADDR=0xc0100000 -makeoptions KERNVIRTADDR=0xc0100000 options LINUX_BOOT_ABI Modified: head/sys/arm/conf/GENERIC ============================================================================== --- head/sys/arm/conf/GENERIC Fri Dec 29 23:58:05 2017 (r327366) +++ head/sys/arm/conf/GENERIC Sat Dec 30 00:20:49 2017 (r327367) @@ -25,9 +25,6 @@ options SMP_ON_UP machine arm armv7 makeoptions CONF_CFLAGS="-march=armv7a" -makeoptions KERNVIRTADDR=0xc0000000 -options KERNVIRTADDR=0xc0000000 - include "std.armv7" files "../allwinner/files.allwinner" files "../allwinner/files.allwinner_up" Modified: head/sys/arm/conf/NOTES ============================================================================== --- head/sys/arm/conf/NOTES Fri Dec 29 23:58:05 2017 (r327366) +++ head/sys/arm/conf/NOTES Sat Dec 30 00:20:49 2017 (r327367) @@ -24,11 +24,9 @@ files "../xscale/ixp425/files.ixp425" files "../xscale/pxa/files.pxa" options PHYSADDR=0x00000000 -options KERNVIRTADDR=0xc0000000 makeoptions LDFLAGS="-zmuldefs" makeoptions KERNPHYSADDR=0x00000000 -makeoptions KERNVIRTADDR=0xc0000000 options FDT Modified: head/sys/arm/freescale/imx/std.imx51 ============================================================================== --- head/sys/arm/freescale/imx/std.imx51 Fri Dec 29 23:58:05 2017 (r327366) +++ head/sys/arm/freescale/imx/std.imx51 Sat Dec 30 00:20:49 2017 (r327367) @@ -3,9 +3,6 @@ machine arm armv7 cpu CPU_CORTEXA makeoptions CONF_CFLAGS="-march=armv7a" -options KERNVIRTADDR=0xc0100000 -makeoptions KERNVIRTADDR=0xc0100000 - device fdt_pinctrl files "../freescale/imx/files.imx5" Modified: head/sys/arm/freescale/imx/std.imx53 ============================================================================== --- head/sys/arm/freescale/imx/std.imx53 Fri Dec 29 23:58:05 2017 (r327366) +++ head/sys/arm/freescale/imx/std.imx53 Sat Dec 30 00:20:49 2017 (r327367) @@ -3,9 +3,6 @@ machine arm armv7 cpu CPU_CORTEXA makeoptions CONF_CFLAGS="-march=armv7a" -options KERNVIRTADDR=0xc0100000 -makeoptions KERNVIRTADDR=0xc0100000 - device fdt_pinctrl files "../freescale/imx/files.imx5" Modified: head/sys/arm/freescale/imx/std.imx6 ============================================================================== --- head/sys/arm/freescale/imx/std.imx6 Fri Dec 29 23:58:05 2017 (r327366) +++ head/sys/arm/freescale/imx/std.imx6 Sat Dec 30 00:20:49 2017 (r327367) @@ -3,9 +3,6 @@ machine arm armv7 cpu CPU_CORTEXA makeoptions CONF_CFLAGS="-march=armv7a" -options KERNVIRTADDR = 0xc2000000 -makeoptions KERNVIRTADDR = 0xc2000000 - options IPI_IRQ_START=0 options IPI_IRQ_END=15 Modified: head/sys/arm/freescale/vybrid/std.vybrid ============================================================================== --- head/sys/arm/freescale/vybrid/std.vybrid Fri Dec 29 23:58:05 2017 (r327366) +++ head/sys/arm/freescale/vybrid/std.vybrid Sat Dec 30 00:20:49 2017 (r327367) @@ -4,7 +4,4 @@ cpu CPU_CORTEXA machine arm armv7 makeoptions CONF_CFLAGS="-march=armv7a" -makeoptions KERNVIRTADDR=0xc0100000 -options KERNVIRTADDR=0xc0100000 - files "../freescale/vybrid/files.vybrid" Modified: head/sys/arm/include/vmparam.h ============================================================================== --- head/sys/arm/include/vmparam.h Fri Dec 29 23:58:05 2017 (r327366) +++ head/sys/arm/include/vmparam.h Sat Dec 30 00:20:49 2017 (r327367) @@ -75,6 +75,19 @@ #endif /* + * The virtual address the kernel is linked to run at. For armv4/5 platforms + * the low-order 30 bits of this must match the low-order bits of the physical + * address the kernel is loaded at, so the value is most often provided as a + * kernel config option in the std.platform file. For armv6/7 the kernel can + * be loaded at any 2MB boundary, and KERNVIRTADDR can also be set to any 2MB + * boundary. It is typically overridden in the std.platform file only when + * KERNBASE is also set to a lower address to provide more KVA. + */ +#ifndef KERNVIRTADDR +#define KERNVIRTADDR 0xc0000000 +#endif + +/* * max number of non-contig chunks of physical RAM you can have */ Modified: head/sys/arm/mv/armada38x/std.armada38x ============================================================================== --- head/sys/arm/mv/armada38x/std.armada38x Fri Dec 29 23:58:05 2017 (r327366) +++ head/sys/arm/mv/armada38x/std.armada38x Sat Dec 30 00:20:49 2017 (r327367) @@ -5,8 +5,6 @@ cpu CPU_CORTEXA machine arm armv7 makeoptions CONF_CFLAGS="-march=armv7a" -makeoptions KERNVIRTADDR=0xc0000000 -options KERNVIRTADDR=0xc0000000 options IPI_IRQ_START=0 options IPI_IRQ_END=15 Modified: head/sys/arm/mv/armadaxp/std.armadaxp ============================================================================== --- head/sys/arm/mv/armadaxp/std.armadaxp Fri Dec 29 23:58:05 2017 (r327366) +++ head/sys/arm/mv/armadaxp/std.armadaxp Sat Dec 30 00:20:49 2017 (r327367) @@ -1,4 +1,2 @@ # $FreeBSD$ -makeoptions KERNVIRTADDR=0xc0200000 -options KERNVIRTADDR=0xc0200000 Modified: head/sys/arm/nvidia/tegra124/std.tegra124 ============================================================================== --- head/sys/arm/nvidia/tegra124/std.tegra124 Fri Dec 29 23:58:05 2017 (r327366) +++ head/sys/arm/nvidia/tegra124/std.tegra124 Sat Dec 30 00:20:49 2017 (r327367) @@ -3,9 +3,6 @@ cpu CPU_CORTEXA machine arm armv7 makeoptions CONF_CFLAGS="-march=armv7a" -options KERNVIRTADDR = 0xc0200000 -makeoptions KERNVIRTADDR = 0xc0200000 - options INTRNG options IPI_IRQ_START=0 Modified: head/sys/arm/rockchip/std.rk30xx ============================================================================== --- head/sys/arm/rockchip/std.rk30xx Fri Dec 29 23:58:05 2017 (r327366) +++ head/sys/arm/rockchip/std.rk30xx Sat Dec 30 00:20:49 2017 (r327367) @@ -5,9 +5,6 @@ cpu CPU_CORTEXA machine arm armv7 makeoptions CONF_CFLAGS="-march=armv7a" -makeoptions KERNVIRTADDR=0xc0400000 -options KERNVIRTADDR=0xc0400000 - options IPI_IRQ_START=0 options IPI_IRQ_END=15 Modified: head/sys/arm/samsung/exynos/std.exynos5250 ============================================================================== --- head/sys/arm/samsung/exynos/std.exynos5250 Fri Dec 29 23:58:05 2017 (r327366) +++ head/sys/arm/samsung/exynos/std.exynos5250 Sat Dec 30 00:20:49 2017 (r327367) @@ -4,9 +4,6 @@ cpu CPU_CORTEXA machine arm armv7 makeoptions CONF_CFLAGS="-march=armv7a" -makeoptions KERNVIRTADDR=0xc0f00000 -options KERNVIRTADDR=0xc0f00000 - options IPI_IRQ_START=0 options IPI_IRQ_END=15 Modified: head/sys/arm/samsung/exynos/std.exynos5420 ============================================================================== --- head/sys/arm/samsung/exynos/std.exynos5420 Fri Dec 29 23:58:05 2017 (r327366) +++ head/sys/arm/samsung/exynos/std.exynos5420 Sat Dec 30 00:20:49 2017 (r327367) @@ -4,9 +4,6 @@ cpu CPU_CORTEXA machine arm armv7 makeoptions CONF_CFLAGS="-march=armv7a" -makeoptions KERNVIRTADDR=0xc0f00000 -options KERNVIRTADDR=0xc0f00000 - options IPI_IRQ_START=0 options IPI_IRQ_END=15 Modified: head/sys/arm/ti/am335x/std.am335x ============================================================================== --- head/sys/arm/ti/am335x/std.am335x Fri Dec 29 23:58:05 2017 (r327366) +++ head/sys/arm/ti/am335x/std.am335x Sat Dec 30 00:20:49 2017 (r327367) @@ -5,7 +5,4 @@ include "../ti/std.ti" cpu CPU_CORTEXA -options KERNVIRTADDR=0xc0200000 # Used in ldscript.arm -makeoptions KERNVIRTADDR=0xc0200000 - options SOC_TI_AM335X Modified: head/sys/arm/ti/omap4/std.omap4 ============================================================================== --- head/sys/arm/ti/omap4/std.omap4 Fri Dec 29 23:58:05 2017 (r327366) +++ head/sys/arm/ti/omap4/std.omap4 Sat Dec 30 00:20:49 2017 (r327367) @@ -5,7 +5,4 @@ include "../ti/std.ti" cpu CPU_CORTEXA -options KERNVIRTADDR=0xc0200000 # Used in ldscript.arm -makeoptions KERNVIRTADDR=0xc0200000 - options SOC_OMAP4 Modified: head/sys/arm/xilinx/std.zynq7 ============================================================================== --- head/sys/arm/xilinx/std.zynq7 Fri Dec 29 23:58:05 2017 (r327366) +++ head/sys/arm/xilinx/std.zynq7 Sat Dec 30 00:20:49 2017 (r327367) @@ -9,8 +9,5 @@ makeoptions CONF_CFLAGS="-march=armv7a" files "../xilinx/files.zynq7" -options KERNVIRTADDR=0xc0100000 # Used in ldscript.arm -makeoptions KERNVIRTADDR=0xc0100000 - options IPI_IRQ_START=0 options IPI_IRQ_END=15 Modified: head/sys/conf/Makefile.arm ============================================================================== --- head/sys/conf/Makefile.arm Fri Dec 29 23:58:05 2017 (r327366) +++ head/sys/conf/Makefile.arm Sat Dec 30 00:20:49 2017 (r327367) @@ -53,6 +53,11 @@ CFLAGS += -mllvm -arm-enable-ehabi .endif .endif +# "makeoptions KERNVIRTADDR=" is now optional, supply the default value. +.if empty(KERNVIRTADDR) +KERNVIRTADDR= 0xc0000000 +.endif + # hack because genassym.c includes sys/bus.h which includes these. genassym.o: bus_if.h device_if.h From owner-svn-src-all@freebsd.org Sat Dec 30 00:22:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 844CDE8576A; Sat, 30 Dec 2017 00:22:48 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4EBFC6384F; Sat, 30 Dec 2017 00:22:48 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBU0MlWs009459; Sat, 30 Dec 2017 00:22:47 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBU0MlwL009457; Sat, 30 Dec 2017 00:22:47 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201712300022.vBU0MlwL009457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 30 Dec 2017 00:22:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327368 - head/sbin/ccdconfig X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sbin/ccdconfig X-SVN-Commit-Revision: 327368 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 00:22:48 -0000 Author: pfg Date: Sat Dec 30 00:22:47 2017 New Revision: 327368 URL: https://svnweb.freebsd.org/changeset/base/327368 Log: ccdconfig: Update licensing terms to match NetBSD. The code originated in NetBSD which has since removed Clauses 3 and 4. Approved by: phk (concerning his own copyright) Obtained from: NetBSD (CVS ccdconfig.c 1.47, ccdconfig.8 1.24) Modified: head/sbin/ccdconfig/ccdconfig.8 head/sbin/ccdconfig/ccdconfig.c Modified: head/sbin/ccdconfig/ccdconfig.8 ============================================================================== --- head/sbin/ccdconfig/ccdconfig.8 Sat Dec 30 00:20:49 2017 (r327367) +++ head/sbin/ccdconfig/ccdconfig.8 Sat Dec 30 00:22:47 2017 (r327368) @@ -14,13 +14,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. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the NetBSD -.\" Foundation, Inc. and its contributors. -.\" 4. Neither the name of The NetBSD Foundation nor the names of its -.\" contributors may be used to endorse or promote products derived -.\" from this software without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES Modified: head/sbin/ccdconfig/ccdconfig.c ============================================================================== --- head/sbin/ccdconfig/ccdconfig.c Sat Dec 30 00:20:49 2017 (r327367) +++ head/sbin/ccdconfig/ccdconfig.c Sat Dec 30 00:22:47 2017 (r327368) @@ -18,13 +18,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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED From owner-svn-src-all@freebsd.org Sat Dec 30 00:24:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0E9CE85916; Sat, 30 Dec 2017 00:24:54 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6BD2363A25; Sat, 30 Dec 2017 00:24:54 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBU0Or4l009566; Sat, 30 Dec 2017 00:24:53 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBU0Or79009565; Sat, 30 Dec 2017 00:24:53 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201712300024.vBU0Or79009565@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 30 Dec 2017 00:24:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327369 - head/sys/net80211 X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/net80211 X-SVN-Commit-Revision: 327369 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 00:24:54 -0000 Author: avos Date: Sat Dec 30 00:24:53 2017 New Revision: 327369 URL: https://svnweb.freebsd.org/changeset/base/327369 Log: net80211: handle VHT nodes in ieee80211_node_setuptxparms() Select proper mode when node can do VHT. Currently there are no drivers with VHT support in the tree, so this should be noop. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D9806 Modified: head/sys/net80211/ieee80211_node.c Modified: head/sys/net80211/ieee80211_node.c ============================================================================== --- head/sys/net80211/ieee80211_node.c Sat Dec 30 00:22:47 2017 (r327368) +++ head/sys/net80211/ieee80211_node.c Sat Dec 30 00:24:53 2017 (r327369) @@ -243,7 +243,12 @@ ieee80211_node_setuptxparms(struct ieee80211_node *ni) struct ieee80211vap *vap = ni->ni_vap; enum ieee80211_phymode mode; - if (ni->ni_flags & IEEE80211_NODE_HT) { + if (ni->ni_flags & IEEE80211_NODE_VHT) { + if (IEEE80211_IS_CHAN_5GHZ(ni->ni_chan)) + mode = IEEE80211_MODE_VHT_5GHZ; + else + mode = IEEE80211_MODE_VHT_2GHZ; + } else if (ni->ni_flags & IEEE80211_NODE_HT) { if (IEEE80211_IS_CHAN_5GHZ(ni->ni_chan)) mode = IEEE80211_MODE_11NA; else From owner-svn-src-all@freebsd.org Sat Dec 30 00:26:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 993B4E85B1C; Sat, 30 Dec 2017 00:26:44 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 440F963BE6; Sat, 30 Dec 2017 00:26:44 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBU0QhiH009675; Sat, 30 Dec 2017 00:26:43 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBU0QhXr009672; Sat, 30 Dec 2017 00:26:43 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201712300026.vBU0QhXr009672@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 30 Dec 2017 00:26:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327370 - head/sbin/ccdconfig X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sbin/ccdconfig X-SVN-Commit-Revision: 327370 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 00:26:44 -0000 Author: pfg Date: Sat Dec 30 00:26:42 2017 New Revision: 327370 URL: https://svnweb.freebsd.org/changeset/base/327370 Log: ccdconfig: Move VCS tags to be more consistent with our style. Update a now-bogus SPDX tag while here. Modified: head/sbin/ccdconfig/ccdconfig.8 head/sbin/ccdconfig/ccdconfig.c head/sbin/ccdconfig/pathnames.h Modified: head/sbin/ccdconfig/ccdconfig.8 ============================================================================== --- head/sbin/ccdconfig/ccdconfig.8 Sat Dec 30 00:24:53 2017 (r327369) +++ head/sbin/ccdconfig/ccdconfig.8 Sat Dec 30 00:26:42 2017 (r327370) @@ -1,5 +1,3 @@ -.\" $NetBSD: ccdconfig.8,v 1.4 1996/02/28 01:01:17 thorpej Exp $ -.\" .\" Copyright (c) 1996 The NetBSD Foundation, Inc. .\" All rights reserved. .\" @@ -27,6 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" +.\" $NetBSD: ccdconfig.8,v 1.4 1996/02/28 01:01:17 thorpej Exp $ .\" $FreeBSD$ .\" .Dd October 3, 2016 Modified: head/sbin/ccdconfig/ccdconfig.c ============================================================================== --- head/sbin/ccdconfig/ccdconfig.c Sat Dec 30 00:24:53 2017 (r327369) +++ head/sbin/ccdconfig/ccdconfig.c Sat Dec 30 00:26:42 2017 (r327370) @@ -1,7 +1,5 @@ -/* $NetBSD: ccdconfig.c,v 1.6 1996/05/16 07:11:18 thorpej Exp $ */ - /*- - * SPDX-License-Identifier: BSD-4-Clause + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2003 Poul-Henning Kamp * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -30,6 +28,8 @@ * 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. + * + * NetBSD: ccdconfig.c,v 1.6 1996/05/16 07:11:18 thorpej Exp $ */ #include Modified: head/sbin/ccdconfig/pathnames.h ============================================================================== --- head/sbin/ccdconfig/pathnames.h Sat Dec 30 00:24:53 2017 (r327369) +++ head/sbin/ccdconfig/pathnames.h Sat Dec 30 00:26:42 2017 (r327370) @@ -1,5 +1,3 @@ -/* $NetBSD: pathnames.h,v 1.4 2008/04/28 20:23:07 martin Exp $ */ - /*- * SPDX-License-Identifier: BSD-2-Clause-NetBSD * @@ -30,6 +28,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * + * $NetBSD: pathnames.h,v 1.4 2008/04/28 20:23:07 martin Exp $ * $FreeBSD$ */ From owner-svn-src-all@freebsd.org Sat Dec 30 00:40:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A76C9E86401; Sat, 30 Dec 2017 00:40:35 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7EDA364143; Sat, 30 Dec 2017 00:40:35 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBU0eYFZ014137; Sat, 30 Dec 2017 00:40:34 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBU0eYjf014136; Sat, 30 Dec 2017 00:40:34 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201712300040.vBU0eYjf014136@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 30 Dec 2017 00:40:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327371 - head/sys/net80211 X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/net80211 X-SVN-Commit-Revision: 327371 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 00:40:35 -0000 Author: avos Date: Sat Dec 30 00:40:34 2017 New Revision: 327371 URL: https://svnweb.freebsd.org/changeset/base/327371 Log: net80211: sanitize input for ieee80211_output() - Add some basic checks for i_fc* bits (ToDS, FromDS, MoreFrag, Protected); those are used / checked across various places in Tx path. - Mark injected 802.11 frame as encapsulated (just as it should be). - Classify 802.11 frame in a proper way (extract ether_type from LLC header for Data frames, use AC_BE queue for others (NoData / Management / Control). - Subtract header length from tx_bytes statistics (so it will correspond to the comment). Was checked with RTL8188EU (AP) + Intel 6205 (STA). Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D13161 Modified: head/sys/net80211/ieee80211_output.c Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Sat Dec 30 00:26:42 2017 (r327370) +++ head/sys/net80211/ieee80211_output.c Sat Dec 30 00:40:34 2017 (r327371) @@ -551,6 +551,59 @@ ieee80211_raw_output(struct ieee80211vap *vap, struct return (error); } +static int +ieee80211_validate_frame(struct mbuf *m, + const struct ieee80211_bpf_params *params) +{ + struct ieee80211_frame *wh; + int type; + + if (m->m_pkthdr.len < sizeof(struct ieee80211_frame_ack)) + return (EINVAL); + + wh = mtod(m, struct ieee80211_frame *); + if ((wh->i_fc[0] & IEEE80211_FC0_VERSION_MASK) != + IEEE80211_FC0_VERSION_0) + return (EINVAL); + + type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; + if (type != IEEE80211_FC0_TYPE_DATA) { + if ((wh->i_fc[1] & IEEE80211_FC1_DIR_MASK) != + IEEE80211_FC1_DIR_NODS) + return (EINVAL); + + if (type != IEEE80211_FC0_TYPE_MGT && + (wh->i_fc[1] & IEEE80211_FC1_MORE_FRAG) != 0) + return (EINVAL); + + /* XXX skip other field checks? */ + } + + if ((params && (params->ibp_flags & IEEE80211_BPF_CRYPTO) != 0) || + (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) != 0) { + int subtype; + + subtype = wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK; + + /* + * See IEEE Std 802.11-2012, + * 8.2.4.1.9 'Protected Frame field' + */ + /* XXX no support for robust management frames yet. */ + if (!(type == IEEE80211_FC0_TYPE_DATA || + (type == IEEE80211_FC0_TYPE_MGT && + subtype == IEEE80211_FC0_SUBTYPE_AUTH))) + return (EINVAL); + + wh->i_fc[1] |= IEEE80211_FC1_PROTECTED; + } + + if (m->m_pkthdr.len < ieee80211_anyhdrsize(wh)) + return (EINVAL); + + return (0); +} + /* * 802.11 output routine. This is (currently) used only to * connect bpf write calls to the 802.11 layer for injecting @@ -561,6 +614,7 @@ ieee80211_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, struct route *ro) { #define senderr(e) do { error = (e); goto bad;} while (0) + const struct ieee80211_bpf_params *params = NULL; struct ieee80211_node *ni = NULL; struct ieee80211vap *vap; struct ieee80211_frame *wh; @@ -606,14 +660,20 @@ ieee80211_output(struct ifnet *ifp, struct mbuf *m, senderr(EIO); /* XXX bypass bridge, pfil, carp, etc. */ - if (m->m_pkthdr.len < sizeof(struct ieee80211_frame_ack)) - senderr(EIO); /* XXX */ + /* + * NB: DLT_IEEE802_11_RADIO identifies the parameters are + * present by setting the sa_len field of the sockaddr (yes, + * this is a hack). + * NB: we assume sa_data is suitably aligned to cast. + */ + if (dst->sa_len != 0) + params = (const struct ieee80211_bpf_params *)dst->sa_data; + + error = ieee80211_validate_frame(m, params); + if (error != 0) + senderr(error); + wh = mtod(m, struct ieee80211_frame *); - if ((wh->i_fc[0] & IEEE80211_FC0_VERSION_MASK) != - IEEE80211_FC0_VERSION_0) - senderr(EIO); /* XXX */ - if (m->m_pkthdr.len < ieee80211_anyhdrsize(wh)) - senderr(EIO); /* XXX */ /* locate destination node */ switch (wh->i_fc[1] & IEEE80211_FC1_DIR_MASK) { @@ -626,7 +686,7 @@ ieee80211_output(struct ifnet *ifp, struct mbuf *m, ni = ieee80211_find_txnode(vap, wh->i_addr3); break; default: - senderr(EIO); /* XXX */ + senderr(EDOOFUS); } if (ni == NULL) { /* @@ -645,32 +705,28 @@ ieee80211_output(struct ifnet *ifp, struct mbuf *m, * it marks EAPOL in frames with M_EAPOL. */ m->m_flags &= ~M_80211_TX; + m->m_flags |= M_ENCAP; /* mark encapsulated */ - /* calculate priority so drivers can find the tx queue */ - /* XXX assumes an 802.3 frame */ - if (ieee80211_classify(ni, m)) - senderr(EIO); /* XXX */ + if (IEEE80211_IS_DATA(wh)) { + /* calculate priority so drivers can find the tx queue */ + if (ieee80211_classify(ni, m)) + senderr(EIO); /* XXX */ + /* NB: ieee80211_encap does not include 802.11 header */ + IEEE80211_NODE_STAT_ADD(ni, tx_bytes, + m->m_pkthdr.len - ieee80211_hdrsize(wh)); + } else + M_WME_SETAC(m, WME_AC_BE); + IEEE80211_NODE_STAT(ni, tx_data); if (IEEE80211_IS_MULTICAST(wh->i_addr1)) { IEEE80211_NODE_STAT(ni, tx_mcast); m->m_flags |= M_MCAST; } else IEEE80211_NODE_STAT(ni, tx_ucast); - /* NB: ieee80211_encap does not include 802.11 header */ - IEEE80211_NODE_STAT_ADD(ni, tx_bytes, m->m_pkthdr.len); IEEE80211_TX_LOCK(ic); - - /* - * NB: DLT_IEEE802_11_RADIO identifies the parameters are - * present by setting the sa_len field of the sockaddr (yes, - * this is a hack). - * NB: we assume sa_data is suitably aligned to cast. - */ - ret = ieee80211_raw_output(vap, ni, m, - (const struct ieee80211_bpf_params *)(dst->sa_len ? - dst->sa_data : NULL)); + ret = ieee80211_raw_output(vap, ni, m, params); IEEE80211_TX_UNLOCK(ic); return (ret); bad: @@ -1006,13 +1062,44 @@ ieee80211_send_nulldata(struct ieee80211_node *ni) int ieee80211_classify(struct ieee80211_node *ni, struct mbuf *m) { - const struct ether_header *eh = mtod(m, struct ether_header *); + const struct ether_header *eh = NULL; + uint16_t ether_type; int v_wme_ac, d_wme_ac, ac; + if (__predict_false(m->m_flags & M_ENCAP)) { + struct ieee80211_frame *wh = mtod(m, struct ieee80211_frame *); + struct llc *llc; + int hdrlen, subtype; + + subtype = wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK; + if (subtype & IEEE80211_FC0_SUBTYPE_NODATA) { + ac = WME_AC_BE; + goto done; + } + + hdrlen = ieee80211_hdrsize(wh); + if (m->m_pkthdr.len < hdrlen + sizeof(*llc)) + return 1; + + llc = (struct llc *)mtodo(m, hdrlen); + if (llc->llc_dsap != LLC_SNAP_LSAP || + llc->llc_ssap != LLC_SNAP_LSAP || + llc->llc_control != LLC_UI || + llc->llc_snap.org_code[0] != 0 || + llc->llc_snap.org_code[1] != 0 || + llc->llc_snap.org_code[2] != 0) + return 1; + + ether_type = llc->llc_snap.ether_type; + } else { + eh = mtod(m, struct ether_header *); + ether_type = eh->ether_type; + } + /* * Always promote PAE/EAPOL frames to high priority. */ - if (eh->ether_type == htons(ETHERTYPE_PAE)) { + if (ether_type == htons(ETHERTYPE_PAE)) { /* NB: mark so others don't need to check header */ m->m_flags |= M_EAPOL; ac = WME_AC_VO; @@ -1047,7 +1134,7 @@ ieee80211_classify(struct ieee80211_node *ni, struct m /* XXX m_copydata may be too slow for fast path */ #ifdef INET - if (eh->ether_type == htons(ETHERTYPE_IP)) { + if (eh && eh->ether_type == htons(ETHERTYPE_IP)) { uint8_t tos; /* * IP frame, map the DSCP bits from the TOS field. @@ -1060,7 +1147,7 @@ ieee80211_classify(struct ieee80211_node *ni, struct m } else { #endif /* INET */ #ifdef INET6 - if (eh->ether_type == htons(ETHERTYPE_IPV6)) { + if (eh && eh->ether_type == htons(ETHERTYPE_IPV6)) { uint32_t flow; uint8_t tos; /* From owner-svn-src-all@freebsd.org Sat Dec 30 02:07:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C87A2E9E1F4; Sat, 30 Dec 2017 02:07:19 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9FAB26773E; Sat, 30 Dec 2017 02:07:19 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBU27IGT051048; Sat, 30 Dec 2017 02:07:18 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBU27IIh051047; Sat, 30 Dec 2017 02:07:18 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201712300207.vBU27IIh051047@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 30 Dec 2017 02:07:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327373 - head/sys/geom X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/geom X-SVN-Commit-Revision: 327373 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 02:07:19 -0000 Author: pfg Date: Sat Dec 30 02:07:18 2017 New Revision: 327373 URL: https://svnweb.freebsd.org/changeset/base/327373 Log: geom_ccd.c: Fix the licenses properly The license merging in r109471 didn't take into account that licensing could change. Just removing the 3rd clause obviates the copyright assignment to the NetBSD Foundation. We do have plenty of files that have two or more licensing as in this case, so fix this properly by splitting back the licenses as they are upstream. Obtained from: NetBSD Modified: head/sys/geom/geom_ccd.c Modified: head/sys/geom/geom_ccd.c ============================================================================== --- head/sys/geom/geom_ccd.c Sat Dec 30 01:37:08 2017 (r327372) +++ head/sys/geom/geom_ccd.c Sat Dec 30 02:07:18 2017 (r327373) @@ -1,12 +1,41 @@ /*- - * SPDX-License-Identifier: BSD-3-Clause + * SPDX-License-Identifier: (BSD-2-Clause-NetBSD AND BSD-3-Clause) * * Copyright (c) 2003 Poul-Henning Kamp. - * Copyright (c) 1995 Jason R. Thorpe. - * Copyright (c) 1990, 1993 - * The Regents of the University of California. All rights reserved. + * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc. * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Jason R. Thorpe. + * + * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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. + * + * $NetBSD: ccd.c,v 1.22 1995/12/08 19:13:26 thorpej Exp $ + */ + +/*- * Copyright (c) 1988 University of Utah. + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * the Systems Programming Group of the University of Utah Computer @@ -20,31 +49,34 @@ * 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. The names of the authors may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE 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 + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * + * from: Utah $Hdr: cd.c 1.6 90/11/28$ + * + * @(#)cd.c 8.2 (Berkeley) 11/16/93 + */ + +/* * Dynamic configuration and disklabel support by: * Jason R. Thorpe * Numerical Aerodynamic Simulation Facility * Mail Stop 258-6 * NASA Ames Research Center * Moffett Field, CA 94035 - * - * from: Utah $Hdr: cd.c 1.6 90/11/28$ - * @(#)cd.c 8.2 (Berkeley) 11/16/93 - * $NetBSD: ccd.c,v 1.22 1995/12/08 19:13:26 thorpej Exp $ */ #include From owner-svn-src-all@freebsd.org Sat Dec 30 01:37:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0BCD9E89D10; Sat, 30 Dec 2017 01:37:10 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B241366311; Sat, 30 Dec 2017 01:37:09 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBU1b8eL038581; Sat, 30 Dec 2017 01:37:08 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBU1b8fR038580; Sat, 30 Dec 2017 01:37:08 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201712300137.vBU1b8fR038580@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 30 Dec 2017 01:37:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327372 - head/sys/geom X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/geom X-SVN-Commit-Revision: 327372 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 01:37:10 -0000 Author: pfg Date: Sat Dec 30 01:37:08 2017 New Revision: 327372 URL: https://svnweb.freebsd.org/changeset/base/327372 Log: geom_ccd.c: Update the license with changes from upstream. Part of this file originated in NetBSD, with the original file carrying two versions of 4-clause BSD licenses. r109471 attempted to simplify the situation by putting both licenses together. Meanwhile, NetBSD dropped Clauses 3 and 4 from their own license, and eventually NetBSD got permission from the University of Utah to drop the 3rd clause. Keep the license "simple" by dropping the third clause since both TNF, Utah/Berkeley and phk agree in principle that it can be dropped. Obtained from: NetBSD (ccd.c CVS 1.128, 1.138) Modified: head/sys/geom/geom_ccd.c Modified: head/sys/geom/geom_ccd.c ============================================================================== --- head/sys/geom/geom_ccd.c Sat Dec 30 00:40:34 2017 (r327371) +++ head/sys/geom/geom_ccd.c Sat Dec 30 01:37:08 2017 (r327372) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-4-Clause + * SPDX-License-Identifier: BSD-3-Clause * * Copyright (c) 2003 Poul-Henning Kamp. * Copyright (c) 1995 Jason R. Thorpe. @@ -20,11 +20,7 @@ * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed for the NetBSD Project - * by Jason R. Thorpe. - * 4. The names of the authors may not be used to endorse or promote products + * 3. The names of the authors may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR From owner-svn-src-all@freebsd.org Sat Dec 30 04:03:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC91FEA65EF; Sat, 30 Dec 2017 04:03:54 +0000 (UTC) (envelope-from bryanv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A5FCC6C402; Sat, 30 Dec 2017 04:03:54 +0000 (UTC) (envelope-from bryanv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBU43reG001475; Sat, 30 Dec 2017 04:03:53 GMT (envelope-from bryanv@FreeBSD.org) Received: (from bryanv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBU43rio001472; Sat, 30 Dec 2017 04:03:53 GMT (envelope-from bryanv@FreeBSD.org) Message-Id: <201712300403.vBU43rio001472@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bryanv set sender to bryanv@FreeBSD.org using -f From: Bryan Venteicher Date: Sat, 30 Dec 2017 04:03:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327375 - in head: sbin/ifconfig sys/net X-SVN-Group: head X-SVN-Commit-Author: bryanv X-SVN-Commit-Paths: in head: sbin/ifconfig sys/net X-SVN-Commit-Revision: 327375 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 04:03:55 -0000 Author: bryanv Date: Sat Dec 30 04:03:53 2017 New Revision: 327375 URL: https://svnweb.freebsd.org/changeset/base/327375 Log: Add support for IPv6 scoped addresses to vxlan MFC after: 2 weeks Modified: head/sbin/ifconfig/ifvxlan.c head/sys/net/if_vxlan.c head/sys/net/if_vxlan.h Modified: head/sbin/ifconfig/ifvxlan.c ============================================================================== --- head/sbin/ifconfig/ifvxlan.c Sat Dec 30 03:08:49 2017 (r327374) +++ head/sbin/ifconfig/ifvxlan.c Sat Dec 30 04:03:53 2017 (r327375) @@ -236,25 +236,23 @@ DECL_CMD_FUNC(setvxlan_local, addr, d) switch (ai->ai_family) { #ifdef INET case AF_INET: { - struct in_addr addr = ((struct sockaddr_in *) sa)->sin_addr; + struct sockaddr_in *sin = (struct sockaddr_in *)sa; - if (IN_MULTICAST(ntohl(addr.s_addr))) + if (IN_MULTICAST(ntohl(sin->sin_addr.s_addr))) errx(1, "local address cannot be multicast"); - cmd.vxlcmd_sa.in4.sin_family = AF_INET; - cmd.vxlcmd_sa.in4.sin_addr = addr; + cmd.vxlcmd_sa.in4 = *sin; break; } #endif #ifdef INET6 case AF_INET6: { - struct in6_addr *addr = &((struct sockaddr_in6 *)sa)->sin6_addr; + struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa; - if (IN6_IS_ADDR_MULTICAST(addr)) + if (IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr)) errx(1, "local address cannot be multicast"); - cmd.vxlcmd_sa.in6.sin6_family = AF_INET6; - cmd.vxlcmd_sa.in6.sin6_addr = *addr; + cmd.vxlcmd_sa.in6 = *sin6; break; } #endif @@ -267,10 +265,10 @@ DECL_CMD_FUNC(setvxlan_local, addr, d) if (!vxlan_exists(s)) { if (cmd.vxlcmd_sa.sa.sa_family == AF_INET) { params.vxlp_with |= VXLAN_PARAM_WITH_LOCAL_ADDR4; - params.vxlp_local_in4 = cmd.vxlcmd_sa.in4.sin_addr; + params.vxlp_local_sa.in4 = cmd.vxlcmd_sa.in4; } else { params.vxlp_with |= VXLAN_PARAM_WITH_LOCAL_ADDR6; - params.vxlp_local_in6 = cmd.vxlcmd_sa.in6.sin6_addr; + params.vxlp_local_sa.in6 = cmd.vxlcmd_sa.in6; } return; } @@ -298,25 +296,23 @@ DECL_CMD_FUNC(setvxlan_remote, addr, d) switch (ai->ai_family) { #ifdef INET case AF_INET: { - struct in_addr addr = ((struct sockaddr_in *)sa)->sin_addr; + struct sockaddr_in *sin = (struct sockaddr_in *)sa; - if (IN_MULTICAST(ntohl(addr.s_addr))) + if (IN_MULTICAST(ntohl(sin->sin_addr.s_addr))) errx(1, "remote address cannot be multicast"); - cmd.vxlcmd_sa.in4.sin_family = AF_INET; - cmd.vxlcmd_sa.in4.sin_addr = addr; + cmd.vxlcmd_sa.in4 = *sin; break; } #endif #ifdef INET6 case AF_INET6: { - struct in6_addr *addr = &((struct sockaddr_in6 *)sa)->sin6_addr; + struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa; - if (IN6_IS_ADDR_MULTICAST(addr)) + if (IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr)) errx(1, "remote address cannot be multicast"); - cmd.vxlcmd_sa.in6.sin6_family = AF_INET6; - cmd.vxlcmd_sa.in6.sin6_addr = *addr; + cmd.vxlcmd_sa.in6 = *sin6; break; } #endif @@ -329,10 +325,10 @@ DECL_CMD_FUNC(setvxlan_remote, addr, d) if (!vxlan_exists(s)) { if (cmd.vxlcmd_sa.sa.sa_family == AF_INET) { params.vxlp_with |= VXLAN_PARAM_WITH_REMOTE_ADDR4; - params.vxlp_remote_in4 = cmd.vxlcmd_sa.in4.sin_addr; + params.vxlp_remote_sa.in4 = cmd.vxlcmd_sa.in4; } else { params.vxlp_with |= VXLAN_PARAM_WITH_REMOTE_ADDR6; - params.vxlp_remote_in6 = cmd.vxlcmd_sa.in6.sin6_addr; + params.vxlp_remote_sa.in6 = cmd.vxlcmd_sa.in6; } return; } @@ -360,25 +356,23 @@ DECL_CMD_FUNC(setvxlan_group, addr, d) switch (ai->ai_family) { #ifdef INET case AF_INET: { - struct in_addr addr = ((struct sockaddr_in *)sa)->sin_addr; + struct sockaddr_in *sin = (struct sockaddr_in *)sa; - if (!IN_MULTICAST(ntohl(addr.s_addr))) + if (!IN_MULTICAST(ntohl(sin->sin_addr.s_addr))) errx(1, "group address must be multicast"); - cmd.vxlcmd_sa.in4.sin_family = AF_INET; - cmd.vxlcmd_sa.in4.sin_addr = addr; + cmd.vxlcmd_sa.in4 = *sin; break; } #endif #ifdef INET6 case AF_INET6: { - struct in6_addr *addr = &((struct sockaddr_in6 *)sa)->sin6_addr; + struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa; - if (!IN6_IS_ADDR_MULTICAST(addr)) + if (!IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr)) errx(1, "group address must be multicast"); - cmd.vxlcmd_sa.in6.sin6_family = AF_INET6; - cmd.vxlcmd_sa.in6.sin6_addr = *addr; + cmd.vxlcmd_sa.in6 = *sin6; break; } #endif @@ -391,10 +385,10 @@ DECL_CMD_FUNC(setvxlan_group, addr, d) if (!vxlan_exists(s)) { if (cmd.vxlcmd_sa.sa.sa_family == AF_INET) { params.vxlp_with |= VXLAN_PARAM_WITH_REMOTE_ADDR4; - params.vxlp_remote_in4 = cmd.vxlcmd_sa.in4.sin_addr; + params.vxlp_remote_sa.in4 = cmd.vxlcmd_sa.in4; } else { params.vxlp_with |= VXLAN_PARAM_WITH_REMOTE_ADDR6; - params.vxlp_remote_in6 = cmd.vxlcmd_sa.in6.sin6_addr; + params.vxlp_remote_sa.in6 = cmd.vxlcmd_sa.in6; } return; } Modified: head/sys/net/if_vxlan.c ============================================================================== --- head/sys/net/if_vxlan.c Sat Dec 30 03:08:49 2017 (r327374) +++ head/sys/net/if_vxlan.c Sat Dec 30 04:03:53 2017 (r327375) @@ -68,10 +68,12 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include +#include +#include + struct vxlan_softc; LIST_HEAD(vxlan_softc_head, vxlan_softc); @@ -215,9 +217,9 @@ static void vxlan_ftable_fini(struct vxlan_softc *); static void vxlan_ftable_flush(struct vxlan_softc *, int); static void vxlan_ftable_expire(struct vxlan_softc *); static int vxlan_ftable_update_locked(struct vxlan_softc *, - const struct sockaddr *, const uint8_t *, + const union vxlan_sockaddr *, const uint8_t *, struct rm_priotracker *); -static int vxlan_ftable_update(struct vxlan_softc *, +static int vxlan_ftable_learn(struct vxlan_softc *, const struct sockaddr *, const uint8_t *); static int vxlan_ftable_sysctl_dump(SYSCTL_HANDLER_ARGS); @@ -358,6 +360,7 @@ static void vxlan_sockaddr_in_copy(union vxlan_sockadd static int vxlan_sockaddr_supported(const union vxlan_sockaddr *, int); static int vxlan_sockaddr_in_any(const union vxlan_sockaddr *); static int vxlan_sockaddr_in_multicast(const union vxlan_sockaddr *); +static int vxlan_sockaddr_in6_embedscope(union vxlan_sockaddr *); static int vxlan_can_change_config(struct vxlan_softc *); static int vxlan_check_vni(uint32_t); @@ -576,10 +579,10 @@ vxlan_ftable_expire(struct vxlan_softc *sc) } static int -vxlan_ftable_update_locked(struct vxlan_softc *sc, const struct sockaddr *sa, - const uint8_t *mac, struct rm_priotracker *tracker) +vxlan_ftable_update_locked(struct vxlan_softc *sc, + const union vxlan_sockaddr *vxlsa, const uint8_t *mac, + struct rm_priotracker *tracker) { - union vxlan_sockaddr vxlsa; struct vxlan_ftable_entry *fe; int error; @@ -596,7 +599,7 @@ again: fe->vxlfe_expire = time_uptime + sc->vxl_ftable_timeout; if (!VXLAN_FE_IS_DYNAMIC(fe) || - vxlan_sockaddr_in_equal(&fe->vxlfe_raddr, sa)) + vxlan_sockaddr_in_equal(&fe->vxlfe_raddr, &vxlsa->sa)) return (0); if (!VXLAN_LOCK_WOWNED(sc)) { VXLAN_RUNLOCK(sc, tracker); @@ -604,7 +607,7 @@ again: sc->vxl_stats.ftable_lock_upgrade_failed++; goto again; } - vxlan_sockaddr_in_copy(&fe->vxlfe_raddr, sa); + vxlan_sockaddr_in_copy(&fe->vxlfe_raddr, &vxlsa->sa); return (0); } @@ -624,16 +627,8 @@ again: if (fe == NULL) return (ENOMEM); - /* - * The source port may be randomly select by the remove host, so - * use the port of the default destination address. - */ - vxlan_sockaddr_copy(&vxlsa, sa); - vxlsa.in4.sin_port = sc->vxl_dst_addr.in4.sin_port; + vxlan_ftable_entry_init(sc, fe, mac, &vxlsa->sa, VXLAN_FE_FLAG_DYNAMIC); - vxlan_ftable_entry_init(sc, fe, mac, &vxlsa.sa, - VXLAN_FE_FLAG_DYNAMIC); - /* The prior lookup failed, so the insert should not. */ error = vxlan_ftable_entry_insert(sc, fe); MPASS(error == 0); @@ -642,14 +637,28 @@ again: } static int -vxlan_ftable_update(struct vxlan_softc *sc, const struct sockaddr *sa, +vxlan_ftable_learn(struct vxlan_softc *sc, const struct sockaddr *sa, const uint8_t *mac) { struct rm_priotracker tracker; + union vxlan_sockaddr vxlsa; int error; + /* + * The source port may be randomly selected by the remote host, so + * use the port of the default destination address. + */ + vxlan_sockaddr_copy(&vxlsa, sa); + vxlsa.in4.sin_port = sc->vxl_dst_addr.in4.sin_port; + + if (VXLAN_SOCKADDR_IS_IPV6(&vxlsa)) { + error = vxlan_sockaddr_in6_embedscope(&vxlsa); + if (error) + return (error); + } + VXLAN_RLOCK(sc, &tracker); - error = vxlan_ftable_update_locked(sc, sa, mac, &tracker); + error = vxlan_ftable_update_locked(sc, &vxlsa, mac, &tracker); VXLAN_UNLOCK(sc, &tracker); return (error); @@ -1051,8 +1060,8 @@ vxlan_socket_ifdetach(struct vxlan_socket *vso, struct static struct vxlan_socket * vxlan_socket_mc_lookup(const union vxlan_sockaddr *vxlsa) { - struct vxlan_socket *vso; union vxlan_sockaddr laddr; + struct vxlan_socket *vso; laddr = *vxlsa; @@ -1406,7 +1415,7 @@ vxlan_setup_multicast_interface(struct vxlan_softc *sc ifp = ifunit_ref(sc->vxl_mc_ifname); if (ifp == NULL) { - if_printf(sc->vxl_ifp, "multicast interfaces %s does " + if_printf(sc->vxl_ifp, "multicast interface %s does " "not exist\n", sc->vxl_mc_ifname); return (ENOENT); } @@ -1830,6 +1839,13 @@ vxlan_ctrl_get_config(struct vxlan_softc *sc, void *ar cfg->vxlc_ttl = sc->vxl_ttl; VXLAN_RUNLOCK(sc, &tracker); +#ifdef INET6 + if (VXLAN_SOCKADDR_IS_IPV6(&cfg->vxlc_local_sa)) + sa6_recoverscope(&cfg->vxlc_local_sa.in6); + if (VXLAN_SOCKADDR_IS_IPV6(&cfg->vxlc_remote_sa)) + sa6_recoverscope(&cfg->vxlc_remote_sa.in6); +#endif + return (0); } @@ -1869,6 +1885,11 @@ vxlan_ctrl_set_local_addr(struct vxlan_softc *sc, void return (EINVAL); if (vxlan_sockaddr_in_multicast(vxlsa) != 0) return (EINVAL); + if (VXLAN_SOCKADDR_IS_IPV6(vxlsa)) { + error = vxlan_sockaddr_in6_embedscope(vxlsa); + if (error) + return (error); + } VXLAN_WLOCK(sc); if (vxlan_can_change_config(sc)) { @@ -1893,6 +1914,11 @@ vxlan_ctrl_set_remote_addr(struct vxlan_softc *sc, voi if (!VXLAN_SOCKADDR_IS_IPV46(vxlsa)) return (EINVAL); + if (VXLAN_SOCKADDR_IS_IPV6(vxlsa)) { + error = vxlan_sockaddr_in6_embedscope(vxlsa); + if (error) + return (error); + } VXLAN_WLOCK(sc); if (vxlan_can_change_config(sc)) { @@ -2093,6 +2119,12 @@ vxlan_ctrl_ftable_entry_add(struct vxlan_softc *sc, vo if (vxlsa.sa.sa_family != sc->vxl_dst_addr.sa.sa_family) return (EAFNOSUPPORT); + if (VXLAN_SOCKADDR_IS_IPV6(&vxlsa)) { + error = vxlan_sockaddr_in6_embedscope(&vxlsa); + if (error) + return (error); + } + fe = vxlan_ftable_entry_alloc(); if (fe == NULL) return (ENOMEM); @@ -2248,7 +2280,6 @@ vxlan_pick_source_port(struct vxlan_softc *sc, struct range = sc->vxl_max_port - sc->vxl_min_port + 1; - /* check if flowid is set and not opaque */ if (M_HASHTYPE_ISHASH(m)) hash = m->m_pkthdr.flowid; else @@ -2536,7 +2567,7 @@ vxlan_input(struct vxlan_socket *vso, uint32_t vni, st } if (sc->vxl_flags & VXLAN_FLAG_LEARN) - vxlan_ftable_update(sc, sa, eh->ether_shost); + vxlan_ftable_learn(sc, sa, eh->ether_shost); m_clrprotoflags(m); m->m_pkthdr.rcvif = ifp; @@ -2588,6 +2619,18 @@ vxlan_set_user_config(struct vxlan_softc *sc, struct i if (vxlp->vxlp_with & (VXLAN_PARAM_WITH_LOCAL_ADDR6 | VXLAN_PARAM_WITH_REMOTE_ADDR6)) return (EAFNOSUPPORT); +#else + if (vxlp->vxlp_with & VXLAN_PARAM_WITH_LOCAL_ADDR6) { + int error = vxlan_sockaddr_in6_embedscope(&vxlp->vxlp_local_sa); + if (error) + return (error); + } + if (vxlp->vxlp_with & VXLAN_PARAM_WITH_REMOTE_ADDR6) { + int error = vxlan_sockaddr_in6_embedscope( + &vxlp->vxlp_remote_sa); + if (error) + return (error); + } #endif if (vxlp->vxlp_with & VXLAN_PARAM_WITH_VNI) { @@ -2598,21 +2641,25 @@ vxlan_set_user_config(struct vxlan_softc *sc, struct i if (vxlp->vxlp_with & VXLAN_PARAM_WITH_LOCAL_ADDR4) { sc->vxl_src_addr.in4.sin_len = sizeof(struct sockaddr_in); sc->vxl_src_addr.in4.sin_family = AF_INET; - sc->vxl_src_addr.in4.sin_addr = vxlp->vxlp_local_in4; + sc->vxl_src_addr.in4.sin_addr = + vxlp->vxlp_local_sa.in4.sin_addr; } else if (vxlp->vxlp_with & VXLAN_PARAM_WITH_LOCAL_ADDR6) { sc->vxl_src_addr.in6.sin6_len = sizeof(struct sockaddr_in6); sc->vxl_src_addr.in6.sin6_family = AF_INET6; - sc->vxl_src_addr.in6.sin6_addr = vxlp->vxlp_local_in6; + sc->vxl_src_addr.in6.sin6_addr = + vxlp->vxlp_local_sa.in6.sin6_addr; } if (vxlp->vxlp_with & VXLAN_PARAM_WITH_REMOTE_ADDR4) { sc->vxl_dst_addr.in4.sin_len = sizeof(struct sockaddr_in); sc->vxl_dst_addr.in4.sin_family = AF_INET; - sc->vxl_dst_addr.in4.sin_addr = vxlp->vxlp_remote_in4; + sc->vxl_dst_addr.in4.sin_addr = + vxlp->vxlp_remote_sa.in4.sin_addr; } else if (vxlp->vxlp_with & VXLAN_PARAM_WITH_REMOTE_ADDR6) { sc->vxl_dst_addr.in6.sin6_len = sizeof(struct sockaddr_in6); sc->vxl_dst_addr.in6.sin6_family = AF_INET6; - sc->vxl_dst_addr.in6.sin6_addr = vxlp->vxlp_remote_in6; + sc->vxl_dst_addr.in6.sin6_addr = + vxlp->vxlp_remote_sa.in6.sin6_addr; } if (vxlp->vxlp_with & VXLAN_PARAM_WITH_LOCAL_PORT) @@ -2928,6 +2975,21 @@ vxlan_sockaddr_in_multicast(const union vxlan_sockaddr mc = -1; return (mc); +} + +static int +vxlan_sockaddr_in6_embedscope(union vxlan_sockaddr *vxladdr) +{ + int error; + + MPASS(VXLAN_SOCKADDR_IS_IPV6(vxladdr)); +#ifdef INET6 + error = sa6_embedscope(&vxladdr->in6, V_ip6_use_defzone); +#else + error = EAFNOSUPPORT; +#endif + + return (error); } static int Modified: head/sys/net/if_vxlan.h ============================================================================== --- head/sys/net/if_vxlan.h Sat Dec 30 03:08:49 2017 (r327374) +++ head/sys/net/if_vxlan.h Sat Dec 30 04:03:53 2017 (r327375) @@ -54,6 +54,12 @@ struct vxlan_header { #define VXLAN_PORT 4789 #define VXLAN_LEGACY_PORT 8472 +union vxlan_sockaddr { + struct sockaddr sa; + struct sockaddr_in in4; + struct sockaddr_in6 in6; +}; + struct ifvxlanparam { uint64_t vxlp_with; @@ -72,10 +78,8 @@ struct ifvxlanparam { #define VXLAN_PARAM_WITH_LEARN 0x1000 uint32_t vxlp_vni; - struct in_addr vxlp_local_in4; - struct in6_addr vxlp_local_in6; - struct in_addr vxlp_remote_in4; - struct in6_addr vxlp_remote_in6; + union vxlan_sockaddr vxlp_local_sa; + union vxlan_sockaddr vxlp_remote_sa; uint16_t vxlp_local_port; uint16_t vxlp_remote_port; uint16_t vxlp_min_port; @@ -85,12 +89,6 @@ struct ifvxlanparam { uint32_t vxlp_ftable_max; uint8_t vxlp_ttl; uint8_t vxlp_learn; -}; - -union vxlan_sockaddr { - struct sockaddr sa; - struct sockaddr_in in4; - struct sockaddr_in6 in6; }; #define VXLAN_SOCKADDR_IS_IPV4(_vxsin) ((_vxsin)->sa.sa_family == AF_INET) From owner-svn-src-all@freebsd.org Sat Dec 30 03:08:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59B5DEA300C; Sat, 30 Dec 2017 03:08:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 247696A253; Sat, 30 Dec 2017 03:08:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBU38nmU076382; Sat, 30 Dec 2017 03:08:49 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBU38nvY076381; Sat, 30 Dec 2017 03:08:49 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201712300308.vBU38nvY076381@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 30 Dec 2017 03:08:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327374 - head/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/opencrypto X-SVN-Commit-Revision: 327374 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 03:08:50 -0000 Author: jhb Date: Sat Dec 30 03:08:49 2017 New Revision: 327374 URL: https://svnweb.freebsd.org/changeset/base/327374 Log: Remove a redunant check. Modified: head/sys/opencrypto/cryptosoft.c Modified: head/sys/opencrypto/cryptosoft.c ============================================================================== --- head/sys/opencrypto/cryptosoft.c Sat Dec 30 02:07:18 2017 (r327373) +++ head/sys/opencrypto/cryptosoft.c Sat Dec 30 03:08:49 2017 (r327374) @@ -607,9 +607,7 @@ swcr_authenc(struct cryptop *crp) bzero(blk, blksz); crypto_copydata(crp->crp_flags, buf, crde->crd_skip + i, len, blk); - if (!(crde->crd_flags & CRD_F_ENCRYPT)) { - exf->decrypt(swe->sw_kschedule, blk); - } + exf->decrypt(swe->sw_kschedule, blk); crypto_copyback(crp->crp_flags, buf, crde->crd_skip + i, len, blk); } From owner-svn-src-all@freebsd.org Sat Dec 30 06:53:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2976AEAD7C9; Sat, 30 Dec 2017 06:53:29 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E6E28716E4; Sat, 30 Dec 2017 06:53:28 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBU6rRLv073521; Sat, 30 Dec 2017 06:53:27 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBU6rRta073520; Sat, 30 Dec 2017 06:53:27 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201712300653.vBU6rRta073520@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 30 Dec 2017 06:53:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327376 - head/stand/fdt X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/fdt X-SVN-Commit-Revision: 327376 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 06:53:29 -0000 Author: kevans Date: Sat Dec 30 06:53:27 2017 New Revision: 327376 URL: https://svnweb.freebsd.org/changeset/base/327376 Log: stand/fdt: Swap libfdt include order libfdt.h should be included before fdt.h, as hinted at by all of libfdt/; standard include order being libfdt.h, libfdt_env.h, fdt.h. The current include order also causes problems when libfdt gets updated, as fdt.h requires some definitions from libfdt.h. Differential Revision: https://reviews.freebsd.org/D13688 Modified: head/stand/fdt/fdt_loader_cmd.c Modified: head/stand/fdt/fdt_loader_cmd.c ============================================================================== --- head/stand/fdt/fdt_loader_cmd.c Sat Dec 30 04:03:53 2017 (r327375) +++ head/stand/fdt/fdt_loader_cmd.c Sat Dec 30 06:53:27 2017 (r327376) @@ -31,8 +31,8 @@ __FBSDID("$FreeBSD$"); #include -#include #include +#include #include #include #include From owner-svn-src-all@freebsd.org Sat Dec 30 07:03:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92D1BEADDED; Sat, 30 Dec 2017 07:03:53 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5CE2F71C9D; Sat, 30 Dec 2017 07:03:53 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBU73qnU077896; Sat, 30 Dec 2017 07:03:52 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBU73qda077895; Sat, 30 Dec 2017 07:03:52 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201712300703.vBU73qda077895@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 30 Dec 2017 07:03:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327377 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 327377 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 07:03:53 -0000 Author: kevans Date: Sat Dec 30 07:03:52 2017 New Revision: 327377 URL: https://svnweb.freebsd.org/changeset/base/327377 Log: libsa: Pull in strnlen from libc strnlen is not used at the moment, but it will be when libfdt gets updated. Prepare for the not-so-distant future by pulling in strnlen. Noticed because: segfault in ld.bfd due to strnlen missing Modified: head/stand/libsa/Makefile Modified: head/stand/libsa/Makefile ============================================================================== --- head/stand/libsa/Makefile Sat Dec 30 06:53:27 2017 (r327376) +++ head/stand/libsa/Makefile Sat Dec 30 07:03:52 2017 (r327377) @@ -36,7 +36,7 @@ SRCS+= bcmp.c bcopy.c bzero.c ffs.c fls.c \ memccpy.c memchr.c memcmp.c memcpy.c memmove.c memset.c \ qdivrem.c strcat.c strchr.c strcmp.c strcpy.c stpcpy.c stpncpy.c \ strcspn.c strlcat.c strlcpy.c strlen.c strncat.c strncmp.c strncpy.c \ - strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c + strnlen.c strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c .if ${MACHINE_CPUARCH} == "arm" .PATH: ${LIBC_SRC}/arm/gen From owner-svn-src-all@freebsd.org Sat Dec 30 07:59:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 454FEEAFF36; Sat, 30 Dec 2017 07:59:34 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 100387343B; Sat, 30 Dec 2017 07:59:33 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBU7xXvg098832; Sat, 30 Dec 2017 07:59:33 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBU7xWZn098830; Sat, 30 Dec 2017 07:59:32 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712300759.vBU7xWZn098830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 30 Dec 2017 07:59:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327378 - head/sys/i386/conf X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/i386/conf X-SVN-Commit-Revision: 327378 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 07:59:34 -0000 Author: imp Date: Sat Dec 30 07:59:32 2017 New Revision: 327378 URL: https://svnweb.freebsd.org/changeset/base/327378 Log: Remove two stray references to wl driver, removed some time ago. Modified: head/sys/i386/conf/GENERIC head/sys/i386/conf/NOTES Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Sat Dec 30 07:03:52 2017 (r327377) +++ head/sys/i386/conf/GENERIC Sat Dec 30 07:59:32 2017 (r327378) @@ -312,7 +312,6 @@ device malo # Marvell Libertas wireless NICs. device mwl # Marvell 88W8363 802.11n wireless NICs. device ral # Ralink Technology RT2500 wireless NICs. device wi # WaveLAN/Intersil/Symbol 802.11 wireless NICs. -#device wl # Older non 802.11 Wavelan wireless NIC. device wpi # Intel 3945ABG wireless NICs. # Pseudo devices. Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Sat Dec 30 07:03:52 2017 (r327377) +++ head/sys/i386/conf/NOTES Sat Dec 30 07:59:32 2017 (r327378) @@ -539,7 +539,6 @@ hint.mse.0.irq="5" # nfe: nVidia nForce MCP on-board Ethernet Networking (BSD open source) # sbni: Granch SBNI12-xx ISA and PCI adapters # vmx: VMware VMXNET3 Ethernet (BSD open source) -# wl: Lucent Wavelan (ISA card only). # wpi: Intel 3945ABG Wireless LAN controller # Requires the wpi firmware module From owner-svn-src-all@freebsd.org Sat Dec 30 08:16:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A6D8EB0CF2; Sat, 30 Dec 2017 08:16:32 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 25121740A8; Sat, 30 Dec 2017 08:16:32 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBU8GVnY007529; Sat, 30 Dec 2017 08:16:31 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBU8GVFu007528; Sat, 30 Dec 2017 08:16:31 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712300816.vBU8GVFu007528@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 30 Dec 2017 08:16:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327379 - head/sys/isa X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/isa X-SVN-Commit-Revision: 327379 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 08:16:32 -0000 Author: imp Date: Sat Dec 30 08:16:31 2017 New Revision: 327379 URL: https://svnweb.freebsd.org/changeset/base/327379 Log: On further testing on actual machines with this hardware, we should only warn for devices that are attached. Add missing \n. Modified: head/sys/isa/isa_common.c Modified: head/sys/isa/isa_common.c ============================================================================== --- head/sys/isa/isa_common.c Sat Dec 30 07:59:32 2017 (r327378) +++ head/sys/isa/isa_common.c Sat Dec 30 08:16:31 2017 (r327379) @@ -573,9 +573,10 @@ isa_probe_children(device_t dev) err = device_probe_and_attach(child); if (err == 0 && idev->id_vendorid == 0 && - strcmp(kern_ident, "GENERIC") == 0) + strcmp(kern_ident, "GENERIC") == 0 && + device_is_attached(child)) device_printf(child, - "non-PNP ISA device will be removed from GENERIC in FreeBSD 12."); + "non-PNP ISA device will be removed from GENERIC in FreeBSD 12.\n"); } /* From owner-svn-src-all@freebsd.org Sat Dec 30 11:33:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2ED18EB75BC; Sat, 30 Dec 2017 11:33:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D3414796EC; Sat, 30 Dec 2017 11:33:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBUBX4YB091253; Sat, 30 Dec 2017 11:33:04 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBUBX4M1091251; Sat, 30 Dec 2017 11:33:04 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201712301133.vBUBX4M1091251@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 30 Dec 2017 11:33:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327380 - in head/sys: conf i386/i386 i386/isa X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: conf i386/i386 i386/isa X-SVN-Commit-Revision: 327380 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 11:33:06 -0000 Author: kib Date: Sat Dec 30 11:33:04 2017 New Revision: 327380 URL: https://svnweb.freebsd.org/changeset/base/327380 Log: Move i386/isa/npx.c to i386i386/npx.c. The i386 FPU (AKA npx) code does not depend on ISA devices at all, after the support for IRQ13 FPU exceptions was removed. Put the file into the expected place in the kernel source tree. Discussed with: jhb Sponsored by: The FreeBSD Foundation Added: head/sys/i386/i386/npx.c - copied unchanged from r327379, head/sys/i386/isa/npx.c Deleted: head/sys/i386/isa/npx.c Modified: head/sys/conf/files.i386 Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Sat Dec 30 08:16:31 2017 (r327379) +++ head/sys/conf/files.i386 Sat Dec 30 11:33:04 2017 (r327380) @@ -489,6 +489,7 @@ i386/i386/minidump_machdep.c standard i386/i386/mp_clock.c optional smp i386/i386/mp_machdep.c optional smp i386/i386/mpboot.s optional smp +i386/i386/npx.c standard i386/i386/perfmon.c optional perfmon i386/i386/pmap.c standard i386/i386/ptrace_machdep.c standard @@ -519,7 +520,6 @@ i386/ibcs2/ibcs2_xenix.c optional ibcs2 i386/ibcs2/ibcs2_xenix_sysent.c optional ibcs2 i386/ibcs2/imgact_coff.c optional ibcs2 i386/isa/elink.c optional ep -i386/isa/npx.c standard i386/isa/pmtimer.c optional pmtimer i386/isa/prof_machdep.c optional profiling-routine i386/linux/imgact_linux.c optional compat_linux Copied: head/sys/i386/i386/npx.c (from r327379, head/sys/i386/isa/npx.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/i386/i386/npx.c Sat Dec 30 11:33:04 2017 (r327380, copy of r327379, head/sys/i386/isa/npx.c) @@ -0,0 +1,1430 @@ +/*- + * Copyright (c) 1990 William Jolitz. + * Copyright (c) 1991 The Regents of the University of California. + * 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 University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * from: @(#)npx.c 7.2 (Berkeley) 5/12/91 + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_cpu.h" +#include "opt_isa.h" +#include "opt_npx.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef NPX_DEBUG +#include +#endif +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#ifdef DEV_ISA +#include +#endif + +/* + * 387 and 287 Numeric Coprocessor Extension (NPX) Driver. + */ + +#if defined(__GNUCLIKE_ASM) && !defined(lint) + +#define fldcw(cw) __asm __volatile("fldcw %0" : : "m" (cw)) +#define fnclex() __asm __volatile("fnclex") +#define fninit() __asm __volatile("fninit") +#define fnsave(addr) __asm __volatile("fnsave %0" : "=m" (*(addr))) +#define fnstcw(addr) __asm __volatile("fnstcw %0" : "=m" (*(addr))) +#define fnstsw(addr) __asm __volatile("fnstsw %0" : "=am" (*(addr))) +#define fp_divide_by_0() __asm __volatile( \ + "fldz; fld1; fdiv %st,%st(1); fnop") +#define frstor(addr) __asm __volatile("frstor %0" : : "m" (*(addr))) +#define fxrstor(addr) __asm __volatile("fxrstor %0" : : "m" (*(addr))) +#define fxsave(addr) __asm __volatile("fxsave %0" : "=m" (*(addr))) +#define ldmxcsr(csr) __asm __volatile("ldmxcsr %0" : : "m" (csr)) +#define stmxcsr(addr) __asm __volatile("stmxcsr %0" : : "m" (*(addr))) + +static __inline void +xrstor(char *addr, uint64_t mask) +{ + uint32_t low, hi; + + low = mask; + hi = mask >> 32; + __asm __volatile("xrstor %0" : : "m" (*addr), "a" (low), "d" (hi)); +} + +static __inline void +xsave(char *addr, uint64_t mask) +{ + uint32_t low, hi; + + low = mask; + hi = mask >> 32; + __asm __volatile("xsave %0" : "=m" (*addr) : "a" (low), "d" (hi) : + "memory"); +} + +static __inline void +xsaveopt(char *addr, uint64_t mask) +{ + uint32_t low, hi; + + low = mask; + hi = mask >> 32; + __asm __volatile("xsaveopt %0" : "=m" (*addr) : "a" (low), "d" (hi) : + "memory"); +} +#else /* !(__GNUCLIKE_ASM && !lint) */ + +void fldcw(u_short cw); +void fnclex(void); +void fninit(void); +void fnsave(caddr_t addr); +void fnstcw(caddr_t addr); +void fnstsw(caddr_t addr); +void fp_divide_by_0(void); +void frstor(caddr_t addr); +void fxsave(caddr_t addr); +void fxrstor(caddr_t addr); +void ldmxcsr(u_int csr); +void stmxcsr(u_int *csr); +void xrstor(char *addr, uint64_t mask); +void xsave(char *addr, uint64_t mask); +void xsaveopt(char *addr, uint64_t mask); + +#endif /* __GNUCLIKE_ASM && !lint */ + +#define start_emulating() load_cr0(rcr0() | CR0_TS) +#define stop_emulating() clts() + +#define GET_FPU_CW(thread) \ + (cpu_fxsr ? \ + (thread)->td_pcb->pcb_save->sv_xmm.sv_env.en_cw : \ + (thread)->td_pcb->pcb_save->sv_87.sv_env.en_cw) +#define GET_FPU_SW(thread) \ + (cpu_fxsr ? \ + (thread)->td_pcb->pcb_save->sv_xmm.sv_env.en_sw : \ + (thread)->td_pcb->pcb_save->sv_87.sv_env.en_sw) +#define SET_FPU_CW(savefpu, value) do { \ + if (cpu_fxsr) \ + (savefpu)->sv_xmm.sv_env.en_cw = (value); \ + else \ + (savefpu)->sv_87.sv_env.en_cw = (value); \ +} while (0) + +CTASSERT(sizeof(union savefpu) == 512); +CTASSERT(sizeof(struct xstate_hdr) == 64); +CTASSERT(sizeof(struct savefpu_ymm) == 832); + +/* + * This requirement is to make it easier for asm code to calculate + * offset of the fpu save area from the pcb address. FPU save area + * must be 64-byte aligned. + */ +CTASSERT(sizeof(struct pcb) % XSAVE_AREA_ALIGN == 0); + +/* + * Ensure the copy of XCR0 saved in a core is contained in the padding + * area. + */ +CTASSERT(X86_XSTATE_XCR0_OFFSET >= offsetof(struct savexmm, sv_pad) && + X86_XSTATE_XCR0_OFFSET + sizeof(uint64_t) <= sizeof(struct savexmm)); + +static void fpu_clean_state(void); + +static void fpusave(union savefpu *); +static void fpurstor(union savefpu *); + +int hw_float; + +SYSCTL_INT(_hw, HW_FLOATINGPT, floatingpoint, CTLFLAG_RD, + &hw_float, 0, "Floating point instructions executed in hardware"); + +int use_xsave; +uint64_t xsave_mask; +static uma_zone_t fpu_save_area_zone; +static union savefpu *npx_initialstate; + +struct xsave_area_elm_descr { + u_int offset; + u_int size; +} *xsave_area_desc; + +static int use_xsaveopt; + +static volatile u_int npx_traps_while_probing; + +alias_for_inthand_t probetrap; +__asm(" \n\ + .text \n\ + .p2align 2,0x90 \n\ + .type " __XSTRING(CNAME(probetrap)) ",@function \n\ +" __XSTRING(CNAME(probetrap)) ": \n\ + ss \n\ + incl " __XSTRING(CNAME(npx_traps_while_probing)) " \n\ + fnclex \n\ + iret \n\ +"); + +/* + * Determine if an FPU is present and how to use it. + */ +static int +npx_probe(void) +{ + struct gate_descriptor save_idt_npxtrap; + u_short control, status; + + /* + * Modern CPUs all have an FPU that uses the INT16 interface + * and provide a simple way to verify that, so handle the + * common case right away. + */ + if (cpu_feature & CPUID_FPU) { + hw_float = 1; + return (1); + } + + save_idt_npxtrap = idt[IDT_MF]; + setidt(IDT_MF, probetrap, SDT_SYS386TGT, SEL_KPL, + GSEL(GCODE_SEL, SEL_KPL)); + + /* + * Don't trap while we're probing. + */ + stop_emulating(); + + /* + * Finish resetting the coprocessor, if any. If there is an error + * pending, then we may get a bogus IRQ13, but npx_intr() will handle + * it OK. Bogus halts have never been observed, but we enabled + * IRQ13 and cleared the BUSY# latch early to handle them anyway. + */ + fninit(); + + /* + * Don't use fwait here because it might hang. + * Don't use fnop here because it usually hangs if there is no FPU. + */ + DELAY(1000); /* wait for any IRQ13 */ +#ifdef DIAGNOSTIC + if (npx_traps_while_probing != 0) + printf("fninit caused %u bogus npx trap(s)\n", + npx_traps_while_probing); +#endif + /* + * Check for a status of mostly zero. + */ + status = 0x5a5a; + fnstsw(&status); + if ((status & 0xb8ff) == 0) { + /* + * Good, now check for a proper control word. + */ + control = 0x5a5a; + fnstcw(&control); + if ((control & 0x1f3f) == 0x033f) { + /* + * We have an npx, now divide by 0 to see if exception + * 16 works. + */ + control &= ~(1 << 2); /* enable divide by 0 trap */ + fldcw(control); + npx_traps_while_probing = 0; + fp_divide_by_0(); + if (npx_traps_while_probing != 0) { + /* + * Good, exception 16 works. + */ + hw_float = 1; + goto cleanup; + } + printf( + "FPU does not use exception 16 for error reporting\n"); + goto cleanup; + } + } + + /* + * Probe failed. Floating point simply won't work. + * Notify user and disable FPU/MMX/SSE instruction execution. + */ + printf("WARNING: no FPU!\n"); + __asm __volatile("smsw %%ax; orb %0,%%al; lmsw %%ax" : : + "n" (CR0_EM | CR0_MP) : "ax"); + +cleanup: + idt[IDT_MF] = save_idt_npxtrap; + return (hw_float); +} + +/* + * Enable XSAVE if supported and allowed by user. + * Calculate the xsave_mask. + */ +static void +npxinit_bsp1(void) +{ + u_int cp[4]; + uint64_t xsave_mask_user; + + if (cpu_fxsr && (cpu_feature2 & CPUID2_XSAVE) != 0) { + use_xsave = 1; + TUNABLE_INT_FETCH("hw.use_xsave", &use_xsave); + } + if (!use_xsave) + return; + + cpuid_count(0xd, 0x0, cp); + xsave_mask = XFEATURE_ENABLED_X87 | XFEATURE_ENABLED_SSE; + if ((cp[0] & xsave_mask) != xsave_mask) + panic("CPU0 does not support X87 or SSE: %x", cp[0]); + xsave_mask = ((uint64_t)cp[3] << 32) | cp[0]; + xsave_mask_user = xsave_mask; + TUNABLE_QUAD_FETCH("hw.xsave_mask", &xsave_mask_user); + xsave_mask_user |= XFEATURE_ENABLED_X87 | XFEATURE_ENABLED_SSE; + xsave_mask &= xsave_mask_user; + if ((xsave_mask & XFEATURE_AVX512) != XFEATURE_AVX512) + xsave_mask &= ~XFEATURE_AVX512; + if ((xsave_mask & XFEATURE_MPX) != XFEATURE_MPX) + xsave_mask &= ~XFEATURE_MPX; + + cpuid_count(0xd, 0x1, cp); + if ((cp[0] & CPUID_EXTSTATE_XSAVEOPT) != 0) + use_xsaveopt = 1; +} + +/* + + * Calculate the fpu save area size. + */ +static void +npxinit_bsp2(void) +{ + u_int cp[4]; + + if (use_xsave) { + cpuid_count(0xd, 0x0, cp); + cpu_max_ext_state_size = cp[1]; + + /* + * Reload the cpu_feature2, since we enabled OSXSAVE. + */ + do_cpuid(1, cp); + cpu_feature2 = cp[2]; + } else + cpu_max_ext_state_size = sizeof(union savefpu); +} + +/* + * Initialize floating point unit. + */ +void +npxinit(bool bsp) +{ + static union savefpu dummy; + register_t saveintr; + u_int mxcsr; + u_short control; + + if (bsp) { + if (!npx_probe()) + return; + npxinit_bsp1(); + } + + if (use_xsave) { + load_cr4(rcr4() | CR4_XSAVE); + load_xcr(XCR0, xsave_mask); + } + + /* + * XCR0 shall be set up before CPU can report the save area size. + */ + if (bsp) + npxinit_bsp2(); + + /* + * fninit has the same h/w bugs as fnsave. Use the detoxified + * fnsave to throw away any junk in the fpu. fpusave() initializes + * the fpu. + * + * It is too early for critical_enter() to work on AP. + */ + saveintr = intr_disable(); + stop_emulating(); + if (cpu_fxsr) + fninit(); + else + fnsave(&dummy); + control = __INITIAL_NPXCW__; + fldcw(control); + if (cpu_fxsr) { + mxcsr = __INITIAL_MXCSR__; + ldmxcsr(mxcsr); + } + start_emulating(); + intr_restore(saveintr); +} + +/* + * On the boot CPU we generate a clean state that is used to + * initialize the floating point unit when it is first used by a + * process. + */ +static void +npxinitstate(void *arg __unused) +{ + register_t saveintr; + int cp[4], i, max_ext_n; + + if (!hw_float) + return; + + npx_initialstate = malloc(cpu_max_ext_state_size, M_DEVBUF, + M_WAITOK | M_ZERO); + saveintr = intr_disable(); + stop_emulating(); + + fpusave(npx_initialstate); + if (cpu_fxsr) { + if (npx_initialstate->sv_xmm.sv_env.en_mxcsr_mask) + cpu_mxcsr_mask = + npx_initialstate->sv_xmm.sv_env.en_mxcsr_mask; + else + cpu_mxcsr_mask = 0xFFBF; + + /* + * The fninit instruction does not modify XMM + * registers or x87 registers (MM/ST). The fpusave + * call dumped the garbage contained in the registers + * after reset to the initial state saved. Clear XMM + * and x87 registers file image to make the startup + * program state and signal handler XMM/x87 register + * content predictable. + */ + bzero(npx_initialstate->sv_xmm.sv_fp, + sizeof(npx_initialstate->sv_xmm.sv_fp)); + bzero(npx_initialstate->sv_xmm.sv_xmm, + sizeof(npx_initialstate->sv_xmm.sv_xmm)); + } else + bzero(npx_initialstate->sv_87.sv_ac, + sizeof(npx_initialstate->sv_87.sv_ac)); + + /* + * Create a table describing the layout of the CPU Extended + * Save Area. + */ + if (use_xsave) { + if (xsave_mask >> 32 != 0) + max_ext_n = fls(xsave_mask >> 32) + 32; + else + max_ext_n = fls(xsave_mask); + xsave_area_desc = malloc(max_ext_n * sizeof(struct + xsave_area_elm_descr), M_DEVBUF, M_WAITOK | M_ZERO); + /* x87 state */ + xsave_area_desc[0].offset = 0; + xsave_area_desc[0].size = 160; + /* XMM */ + xsave_area_desc[1].offset = 160; + xsave_area_desc[1].size = 288 - 160; + + for (i = 2; i < max_ext_n; i++) { + cpuid_count(0xd, i, cp); + xsave_area_desc[i].offset = cp[1]; + xsave_area_desc[i].size = cp[0]; + } + } + + fpu_save_area_zone = uma_zcreate("FPU_save_area", + cpu_max_ext_state_size, NULL, NULL, NULL, NULL, + XSAVE_AREA_ALIGN - 1, 0); + + start_emulating(); + intr_restore(saveintr); +} +SYSINIT(npxinitstate, SI_SUB_DRIVERS, SI_ORDER_ANY, npxinitstate, NULL); + +/* + * Free coprocessor (if we have it). + */ +void +npxexit(struct thread *td) +{ + + critical_enter(); + if (curthread == PCPU_GET(fpcurthread)) { + stop_emulating(); + fpusave(curpcb->pcb_save); + start_emulating(); + PCPU_SET(fpcurthread, NULL); + } + critical_exit(); +#ifdef NPX_DEBUG + if (hw_float) { + u_int masked_exceptions; + + masked_exceptions = GET_FPU_CW(td) & GET_FPU_SW(td) & 0x7f; + /* + * Log exceptions that would have trapped with the old + * control word (overflow, divide by 0, and invalid operand). + */ + if (masked_exceptions & 0x0d) + log(LOG_ERR, + "pid %d (%s) exited with masked floating point exceptions 0x%02x\n", + td->td_proc->p_pid, td->td_proc->p_comm, + masked_exceptions); + } +#endif +} + +int +npxformat(void) +{ + + if (!hw_float) + return (_MC_FPFMT_NODEV); + if (cpu_fxsr) + return (_MC_FPFMT_XMM); + return (_MC_FPFMT_387); +} + +/* + * The following mechanism is used to ensure that the FPE_... value + * that is passed as a trapcode to the signal handler of the user + * process does not have more than one bit set. + * + * Multiple bits may be set if the user process modifies the control + * word while a status word bit is already set. While this is a sign + * of bad coding, we have no choise than to narrow them down to one + * bit, since we must not send a trapcode that is not exactly one of + * the FPE_ macros. + * + * The mechanism has a static table with 127 entries. Each combination + * of the 7 FPU status word exception bits directly translates to a + * position in this table, where a single FPE_... value is stored. + * This FPE_... value stored there is considered the "most important" + * of the exception bits and will be sent as the signal code. The + * precedence of the bits is based upon Intel Document "Numerical + * Applications", Chapter "Special Computational Situations". + * + * The macro to choose one of these values does these steps: 1) Throw + * away status word bits that cannot be masked. 2) Throw away the bits + * currently masked in the control word, assuming the user isn't + * interested in them anymore. 3) Reinsert status word bit 7 (stack + * fault) if it is set, which cannot be masked but must be presered. + * 4) Use the remaining bits to point into the trapcode table. + * + * The 6 maskable bits in order of their preference, as stated in the + * above referenced Intel manual: + * 1 Invalid operation (FP_X_INV) + * 1a Stack underflow + * 1b Stack overflow + * 1c Operand of unsupported format + * 1d SNaN operand. + * 2 QNaN operand (not an exception, irrelavant here) + * 3 Any other invalid-operation not mentioned above or zero divide + * (FP_X_INV, FP_X_DZ) + * 4 Denormal operand (FP_X_DNML) + * 5 Numeric over/underflow (FP_X_OFL, FP_X_UFL) + * 6 Inexact result (FP_X_IMP) + */ +static char fpetable[128] = { + 0, + FPE_FLTINV, /* 1 - INV */ + FPE_FLTUND, /* 2 - DNML */ + FPE_FLTINV, /* 3 - INV | DNML */ + FPE_FLTDIV, /* 4 - DZ */ + FPE_FLTINV, /* 5 - INV | DZ */ + FPE_FLTDIV, /* 6 - DNML | DZ */ + FPE_FLTINV, /* 7 - INV | DNML | DZ */ + FPE_FLTOVF, /* 8 - OFL */ + FPE_FLTINV, /* 9 - INV | OFL */ + FPE_FLTUND, /* A - DNML | OFL */ + FPE_FLTINV, /* B - INV | DNML | OFL */ + FPE_FLTDIV, /* C - DZ | OFL */ + FPE_FLTINV, /* D - INV | DZ | OFL */ + FPE_FLTDIV, /* E - DNML | DZ | OFL */ + FPE_FLTINV, /* F - INV | DNML | DZ | OFL */ + FPE_FLTUND, /* 10 - UFL */ + FPE_FLTINV, /* 11 - INV | UFL */ + FPE_FLTUND, /* 12 - DNML | UFL */ + FPE_FLTINV, /* 13 - INV | DNML | UFL */ + FPE_FLTDIV, /* 14 - DZ | UFL */ + FPE_FLTINV, /* 15 - INV | DZ | UFL */ + FPE_FLTDIV, /* 16 - DNML | DZ | UFL */ + FPE_FLTINV, /* 17 - INV | DNML | DZ | UFL */ + FPE_FLTOVF, /* 18 - OFL | UFL */ + FPE_FLTINV, /* 19 - INV | OFL | UFL */ + FPE_FLTUND, /* 1A - DNML | OFL | UFL */ + FPE_FLTINV, /* 1B - INV | DNML | OFL | UFL */ + FPE_FLTDIV, /* 1C - DZ | OFL | UFL */ + FPE_FLTINV, /* 1D - INV | DZ | OFL | UFL */ + FPE_FLTDIV, /* 1E - DNML | DZ | OFL | UFL */ + FPE_FLTINV, /* 1F - INV | DNML | DZ | OFL | UFL */ + FPE_FLTRES, /* 20 - IMP */ + FPE_FLTINV, /* 21 - INV | IMP */ + FPE_FLTUND, /* 22 - DNML | IMP */ + FPE_FLTINV, /* 23 - INV | DNML | IMP */ + FPE_FLTDIV, /* 24 - DZ | IMP */ + FPE_FLTINV, /* 25 - INV | DZ | IMP */ + FPE_FLTDIV, /* 26 - DNML | DZ | IMP */ + FPE_FLTINV, /* 27 - INV | DNML | DZ | IMP */ + FPE_FLTOVF, /* 28 - OFL | IMP */ + FPE_FLTINV, /* 29 - INV | OFL | IMP */ + FPE_FLTUND, /* 2A - DNML | OFL | IMP */ + FPE_FLTINV, /* 2B - INV | DNML | OFL | IMP */ + FPE_FLTDIV, /* 2C - DZ | OFL | IMP */ + FPE_FLTINV, /* 2D - INV | DZ | OFL | IMP */ + FPE_FLTDIV, /* 2E - DNML | DZ | OFL | IMP */ + FPE_FLTINV, /* 2F - INV | DNML | DZ | OFL | IMP */ + FPE_FLTUND, /* 30 - UFL | IMP */ + FPE_FLTINV, /* 31 - INV | UFL | IMP */ + FPE_FLTUND, /* 32 - DNML | UFL | IMP */ + FPE_FLTINV, /* 33 - INV | DNML | UFL | IMP */ + FPE_FLTDIV, /* 34 - DZ | UFL | IMP */ + FPE_FLTINV, /* 35 - INV | DZ | UFL | IMP */ + FPE_FLTDIV, /* 36 - DNML | DZ | UFL | IMP */ + FPE_FLTINV, /* 37 - INV | DNML | DZ | UFL | IMP */ + FPE_FLTOVF, /* 38 - OFL | UFL | IMP */ + FPE_FLTINV, /* 39 - INV | OFL | UFL | IMP */ + FPE_FLTUND, /* 3A - DNML | OFL | UFL | IMP */ + FPE_FLTINV, /* 3B - INV | DNML | OFL | UFL | IMP */ + FPE_FLTDIV, /* 3C - DZ | OFL | UFL | IMP */ + FPE_FLTINV, /* 3D - INV | DZ | OFL | UFL | IMP */ + FPE_FLTDIV, /* 3E - DNML | DZ | OFL | UFL | IMP */ + FPE_FLTINV, /* 3F - INV | DNML | DZ | OFL | UFL | IMP */ + FPE_FLTSUB, /* 40 - STK */ + FPE_FLTSUB, /* 41 - INV | STK */ + FPE_FLTUND, /* 42 - DNML | STK */ + FPE_FLTSUB, /* 43 - INV | DNML | STK */ + FPE_FLTDIV, /* 44 - DZ | STK */ + FPE_FLTSUB, /* 45 - INV | DZ | STK */ + FPE_FLTDIV, /* 46 - DNML | DZ | STK */ + FPE_FLTSUB, /* 47 - INV | DNML | DZ | STK */ + FPE_FLTOVF, /* 48 - OFL | STK */ + FPE_FLTSUB, /* 49 - INV | OFL | STK */ + FPE_FLTUND, /* 4A - DNML | OFL | STK */ + FPE_FLTSUB, /* 4B - INV | DNML | OFL | STK */ + FPE_FLTDIV, /* 4C - DZ | OFL | STK */ + FPE_FLTSUB, /* 4D - INV | DZ | OFL | STK */ + FPE_FLTDIV, /* 4E - DNML | DZ | OFL | STK */ + FPE_FLTSUB, /* 4F - INV | DNML | DZ | OFL | STK */ + FPE_FLTUND, /* 50 - UFL | STK */ + FPE_FLTSUB, /* 51 - INV | UFL | STK */ + FPE_FLTUND, /* 52 - DNML | UFL | STK */ + FPE_FLTSUB, /* 53 - INV | DNML | UFL | STK */ + FPE_FLTDIV, /* 54 - DZ | UFL | STK */ + FPE_FLTSUB, /* 55 - INV | DZ | UFL | STK */ + FPE_FLTDIV, /* 56 - DNML | DZ | UFL | STK */ + FPE_FLTSUB, /* 57 - INV | DNML | DZ | UFL | STK */ + FPE_FLTOVF, /* 58 - OFL | UFL | STK */ + FPE_FLTSUB, /* 59 - INV | OFL | UFL | STK */ + FPE_FLTUND, /* 5A - DNML | OFL | UFL | STK */ + FPE_FLTSUB, /* 5B - INV | DNML | OFL | UFL | STK */ + FPE_FLTDIV, /* 5C - DZ | OFL | UFL | STK */ + FPE_FLTSUB, /* 5D - INV | DZ | OFL | UFL | STK */ + FPE_FLTDIV, /* 5E - DNML | DZ | OFL | UFL | STK */ + FPE_FLTSUB, /* 5F - INV | DNML | DZ | OFL | UFL | STK */ + FPE_FLTRES, /* 60 - IMP | STK */ + FPE_FLTSUB, /* 61 - INV | IMP | STK */ + FPE_FLTUND, /* 62 - DNML | IMP | STK */ + FPE_FLTSUB, /* 63 - INV | DNML | IMP | STK */ + FPE_FLTDIV, /* 64 - DZ | IMP | STK */ + FPE_FLTSUB, /* 65 - INV | DZ | IMP | STK */ + FPE_FLTDIV, /* 66 - DNML | DZ | IMP | STK */ + FPE_FLTSUB, /* 67 - INV | DNML | DZ | IMP | STK */ + FPE_FLTOVF, /* 68 - OFL | IMP | STK */ + FPE_FLTSUB, /* 69 - INV | OFL | IMP | STK */ + FPE_FLTUND, /* 6A - DNML | OFL | IMP | STK */ + FPE_FLTSUB, /* 6B - INV | DNML | OFL | IMP | STK */ + FPE_FLTDIV, /* 6C - DZ | OFL | IMP | STK */ + FPE_FLTSUB, /* 6D - INV | DZ | OFL | IMP | STK */ + FPE_FLTDIV, /* 6E - DNML | DZ | OFL | IMP | STK */ + FPE_FLTSUB, /* 6F - INV | DNML | DZ | OFL | IMP | STK */ + FPE_FLTUND, /* 70 - UFL | IMP | STK */ + FPE_FLTSUB, /* 71 - INV | UFL | IMP | STK */ + FPE_FLTUND, /* 72 - DNML | UFL | IMP | STK */ + FPE_FLTSUB, /* 73 - INV | DNML | UFL | IMP | STK */ + FPE_FLTDIV, /* 74 - DZ | UFL | IMP | STK */ + FPE_FLTSUB, /* 75 - INV | DZ | UFL | IMP | STK */ + FPE_FLTDIV, /* 76 - DNML | DZ | UFL | IMP | STK */ + FPE_FLTSUB, /* 77 - INV | DNML | DZ | UFL | IMP | STK */ + FPE_FLTOVF, /* 78 - OFL | UFL | IMP | STK */ + FPE_FLTSUB, /* 79 - INV | OFL | UFL | IMP | STK */ + FPE_FLTUND, /* 7A - DNML | OFL | UFL | IMP | STK */ + FPE_FLTSUB, /* 7B - INV | DNML | OFL | UFL | IMP | STK */ + FPE_FLTDIV, /* 7C - DZ | OFL | UFL | IMP | STK */ + FPE_FLTSUB, /* 7D - INV | DZ | OFL | UFL | IMP | STK */ + FPE_FLTDIV, /* 7E - DNML | DZ | OFL | UFL | IMP | STK */ + FPE_FLTSUB, /* 7F - INV | DNML | DZ | OFL | UFL | IMP | STK */ +}; + +/* + * Read the FP status and control words, then generate si_code value + * for SIGFPE. The error code chosen will be one of the + * FPE_... macros. It will be sent as the second argument to old + * BSD-style signal handlers and as "siginfo_t->si_code" (second + * argument) to SA_SIGINFO signal handlers. + * + * Some time ago, we cleared the x87 exceptions with FNCLEX there. + * Clearing exceptions was necessary mainly to avoid IRQ13 bugs. The + * usermode code which understands the FPU hardware enough to enable + * the exceptions, can also handle clearing the exception state in the + * handler. The only consequence of not clearing the exception is the + * rethrow of the SIGFPE on return from the signal handler and + * reexecution of the corresponding instruction. + * + * For XMM traps, the exceptions were never cleared. + */ +int +npxtrap_x87(void) +{ + u_short control, status; + + if (!hw_float) { + printf( + "npxtrap_x87: fpcurthread = %p, curthread = %p, hw_float = %d\n", + PCPU_GET(fpcurthread), curthread, hw_float); + panic("npxtrap from nowhere"); + } + critical_enter(); + + /* + * Interrupt handling (for another interrupt) may have pushed the + * state to memory. Fetch the relevant parts of the state from + * wherever they are. + */ + if (PCPU_GET(fpcurthread) != curthread) { + control = GET_FPU_CW(curthread); + status = GET_FPU_SW(curthread); + } else { + fnstcw(&control); + fnstsw(&status); + } + critical_exit(); + return (fpetable[status & ((~control & 0x3f) | 0x40)]); +} + +int +npxtrap_sse(void) +{ + u_int mxcsr; + + if (!hw_float) { + printf( + "npxtrap_sse: fpcurthread = %p, curthread = %p, hw_float = %d\n", + PCPU_GET(fpcurthread), curthread, hw_float); + panic("npxtrap from nowhere"); + } + critical_enter(); + if (PCPU_GET(fpcurthread) != curthread) + mxcsr = curthread->td_pcb->pcb_save->sv_xmm.sv_env.en_mxcsr; + else + stmxcsr(&mxcsr); + critical_exit(); + return (fpetable[(mxcsr & (~mxcsr >> 7)) & 0x3f]); +} + +/* + * Implement device not available (DNA) exception + * + * It would be better to switch FP context here (if curthread != fpcurthread) + * and not necessarily for every context switch, but it is too hard to + * access foreign pcb's. + */ + +static int err_count = 0; + +int +npxdna(void) +{ + + if (!hw_float) + return (0); + critical_enter(); + if (PCPU_GET(fpcurthread) == curthread) { + printf("npxdna: fpcurthread == curthread %d times\n", + ++err_count); + stop_emulating(); + critical_exit(); + return (1); + } + if (PCPU_GET(fpcurthread) != NULL) { + printf("npxdna: fpcurthread = %p (%d), curthread = %p (%d)\n", + PCPU_GET(fpcurthread), + PCPU_GET(fpcurthread)->td_proc->p_pid, + curthread, curthread->td_proc->p_pid); + panic("npxdna"); + } + stop_emulating(); + /* + * Record new context early in case frstor causes a trap. + */ + PCPU_SET(fpcurthread, curthread); + + if (cpu_fxsr) + fpu_clean_state(); + + if ((curpcb->pcb_flags & PCB_NPXINITDONE) == 0) { + /* + * This is the first time this thread has used the FPU or + * the PCB doesn't contain a clean FPU state. Explicitly + * load an initial state. + * + * We prefer to restore the state from the actual save + * area in PCB instead of directly loading from + * npx_initialstate, to ignite the XSAVEOPT + * tracking engine. + */ + bcopy(npx_initialstate, curpcb->pcb_save, cpu_max_ext_state_size); + fpurstor(curpcb->pcb_save); + if (curpcb->pcb_initial_npxcw != __INITIAL_NPXCW__) + fldcw(curpcb->pcb_initial_npxcw); + curpcb->pcb_flags |= PCB_NPXINITDONE; + if (PCB_USER_FPU(curpcb)) + curpcb->pcb_flags |= PCB_NPXUSERINITDONE; + } else { + fpurstor(curpcb->pcb_save); + } + critical_exit(); + + return (1); +} + +/* + * Wrapper for fpusave() called from context switch routines. + * + * npxsave() must be called with interrupts disabled, so that it clears + * fpcurthread atomically with saving the state. We require callers to do the + * disabling, since most callers need to disable interrupts anyway to call + * npxsave() atomically with checking fpcurthread. + */ +void +npxsave(addr) + union savefpu *addr; +{ + + stop_emulating(); + if (use_xsaveopt) + xsaveopt((char *)addr, xsave_mask); + else + fpusave(addr); + start_emulating(); + PCPU_SET(fpcurthread, NULL); +} + +/* + * Unconditionally save the current co-processor state across suspend and + * resume. + */ +void +npxsuspend(union savefpu *addr) +{ + register_t cr0; + + if (!hw_float) + return; + if (PCPU_GET(fpcurthread) == NULL) { + bcopy(npx_initialstate, addr, cpu_max_ext_state_size); + return; + } + cr0 = rcr0(); + stop_emulating(); + fpusave(addr); + load_cr0(cr0); +} + +void +npxresume(union savefpu *addr) +{ + register_t cr0; + + if (!hw_float) + return; + + cr0 = rcr0(); + npxinit(false); + stop_emulating(); + fpurstor(addr); + load_cr0(cr0); +} + +void +npxdrop(void) +{ + struct thread *td; + + /* + * Discard pending exceptions in the !cpu_fxsr case so that unmasked + * ones don't cause a panic on the next frstor. + */ + if (!cpu_fxsr) + fnclex(); + + td = PCPU_GET(fpcurthread); + KASSERT(td == curthread, ("fpudrop: fpcurthread != curthread")); + CRITICAL_ASSERT(td); + PCPU_SET(fpcurthread, NULL); + td->td_pcb->pcb_flags &= ~PCB_NPXINITDONE; + start_emulating(); +} + +/* + * Get the user state of the FPU into pcb->pcb_user_save without + * dropping ownership (if possible). It returns the FPU ownership + * status. + */ +int +npxgetregs(struct thread *td) +{ + struct pcb *pcb; + uint64_t *xstate_bv, bit; + char *sa; + int max_ext_n, i; + int owned; + + if (!hw_float) + return (_MC_FPOWNED_NONE); + + pcb = td->td_pcb; + if ((pcb->pcb_flags & PCB_NPXINITDONE) == 0) { + bcopy(npx_initialstate, get_pcb_user_save_pcb(pcb), + cpu_max_ext_state_size); + SET_FPU_CW(get_pcb_user_save_pcb(pcb), pcb->pcb_initial_npxcw); + npxuserinited(td); + return (_MC_FPOWNED_PCB); + } + critical_enter(); + if (td == PCPU_GET(fpcurthread)) { + fpusave(get_pcb_user_save_pcb(pcb)); + if (!cpu_fxsr) + /* + * fnsave initializes the FPU and destroys whatever + * context it contains. Make sure the FPU owner + * starts with a clean state next time. + */ + npxdrop(); + owned = _MC_FPOWNED_FPU; + } else { + owned = _MC_FPOWNED_PCB; + } + critical_exit(); + if (use_xsave) { + /* + * Handle partially saved state. + */ + sa = (char *)get_pcb_user_save_pcb(pcb); + xstate_bv = (uint64_t *)(sa + sizeof(union savefpu) + + offsetof(struct xstate_hdr, xstate_bv)); + if (xsave_mask >> 32 != 0) + max_ext_n = fls(xsave_mask >> 32) + 32; + else + max_ext_n = fls(xsave_mask); + for (i = 0; i < max_ext_n; i++) { + bit = 1ULL << i; + if ((xsave_mask & bit) == 0 || (*xstate_bv & bit) != 0) + continue; + bcopy((char *)npx_initialstate + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Dec 30 11:42:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63D76EB7B5A; Sat, 30 Dec 2017 11:42:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B84479C1E; Sat, 30 Dec 2017 11:42:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBUBgon1095233; Sat, 30 Dec 2017 11:42:50 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBUBgnXl095227; Sat, 30 Dec 2017 11:42:49 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201712301142.vBUBgnXl095227@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 30 Dec 2017 11:42:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327381 - in head/sys: conf dev/ep i386/isa modules modules/elink modules/ep X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: conf dev/ep i386/isa modules modules/elink modules/ep X-SVN-Commit-Revision: 327381 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 11:42:51 -0000 Author: kib Date: Sat Dec 30 11:42:49 2017 New Revision: 327381 URL: https://svnweb.freebsd.org/changeset/base/327381 Log: Move i386/isa/elink.[hc] to dev/ep. The ep(4) driver is the only consumer of the two functions from elink.c. I removed the standalone module as well, and most likely, the module metadata is not needed anywhere, but this is for later cleanup. Discussed with: imp, jhb Sponsored by: The FreeBSD Foundation Added: head/sys/dev/ep/elink.c - copied, changed from r327380, head/sys/i386/isa/elink.c head/sys/dev/ep/elink.h - copied unchanged from r327380, head/sys/i386/isa/elink.h Deleted: head/sys/i386/isa/elink.c head/sys/i386/isa/elink.h head/sys/modules/elink/ Modified: head/sys/conf/files.i386 head/sys/dev/ep/if_ep_isa.c head/sys/modules/Makefile head/sys/modules/ep/Makefile Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Sat Dec 30 11:33:04 2017 (r327380) +++ head/sys/conf/files.i386 Sat Dec 30 11:42:49 2017 (r327381) @@ -201,6 +201,7 @@ dev/ed/if_ed_isa.c optional ed isa dev/ed/if_ed_wd80x3.c optional ed isa dev/ed/if_ed_hpp.c optional ed isa ed_hpp dev/ed/if_ed_sic.c optional ed isa ed_sic +dev/ep/elink.c optional ep dev/fb/fb.c optional fb | vga dev/fb/s3_pci.c optional s3pci dev/fb/vesa.c optional vga vesa @@ -519,7 +520,6 @@ i386/ibcs2/ibcs2_util.c optional ibcs2 i386/ibcs2/ibcs2_xenix.c optional ibcs2 i386/ibcs2/ibcs2_xenix_sysent.c optional ibcs2 i386/ibcs2/imgact_coff.c optional ibcs2 -i386/isa/elink.c optional ep i386/isa/pmtimer.c optional pmtimer i386/isa/prof_machdep.c optional profiling-routine i386/linux/imgact_linux.c optional compat_linux Copied and modified: head/sys/dev/ep/elink.c (from r327380, head/sys/i386/isa/elink.c) ============================================================================== --- head/sys/i386/isa/elink.c Sat Dec 30 11:33:04 2017 (r327380, copy source) +++ head/sys/dev/ep/elink.c Sat Dec 30 11:42:49 2017 (r327381) @@ -45,7 +45,7 @@ __FBSDID("$FreeBSD$"); #include -#include +#include /* * Issue a `global reset' to all cards, and reset the ID state machines. We Copied: head/sys/dev/ep/elink.h (from r327380, head/sys/i386/isa/elink.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ep/elink.h Sat Dec 30 11:42:49 2017 (r327381, copy of r327380, head/sys/i386/isa/elink.h) @@ -0,0 +1,44 @@ +/* $NetBSD: elink.h,v 1.3 1994/10/27 04:17:11 cgd Exp $ */ + +/*- + * SPDX-License-Identifier: BSD-4-Clause + * + * Copyright (c) 1994 Charles Hannum. 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. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Charles Hannum. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * 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. + * + * $FreeBSD$ + */ + +#define ELINK_ID_PORT 0x100 +#define ELINK_RESET 0xc0 + +#define ELINK_507_POLY 0xe7 +#define ELINK_509_POLY 0xcf +#define TLINK_619_POLY 0x63 + +void elink_reset(void); +void elink_idseq(u_char p); Modified: head/sys/dev/ep/if_ep_isa.c ============================================================================== --- head/sys/dev/ep/if_ep_isa.c Sat Dec 30 11:33:04 2017 (r327380) +++ head/sys/dev/ep/if_ep_isa.c Sat Dec 30 11:42:49 2017 (r327381) @@ -54,7 +54,7 @@ __FBSDID("$FreeBSD$"); #include #ifdef __i386__ -#include +#include #endif #ifdef __i386__ Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Sat Dec 30 11:33:04 2017 (r327380) +++ head/sys/modules/Makefile Sat Dec 30 11:42:49 2017 (r327381) @@ -115,7 +115,6 @@ SUBDIR= \ dummynet \ ${_ed} \ ${_efirt} \ - ${_elink} \ ${_em} \ ${_ena} \ ${_ep} \ @@ -742,7 +741,6 @@ _coff= coff .if ${MK_SOURCELESS_UCODE} != "no" _cp= cp .endif -_elink= elink _glxiic= glxiic _glxsb= glxsb #_ibcs2= ibcs2 Modified: head/sys/modules/ep/Makefile ============================================================================== --- head/sys/modules/ep/Makefile Sat Dec 30 11:33:04 2017 (r327380) +++ head/sys/modules/ep/Makefile Sat Dec 30 11:42:49 2017 (r327381) @@ -7,6 +7,9 @@ SYSDIR?=${SRCTOP}/sys KMOD= if_ep SRCS= if_ep.c +.if ${MACHINE_CPUARCH} == "i386" +SRCS+= elink.c +.endif SRCS+= if_ep_pccard.c pccarddevs.h card_if.h SRCS+= if_ep_isa.c isa_if.h SRCS+= bus_if.h device_if.h From owner-svn-src-all@freebsd.org Sat Dec 30 12:56:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE076E8415C; Sat, 30 Dec 2017 12:56:51 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 97E6E7BA97; Sat, 30 Dec 2017 12:56:51 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBUCuo17024305; Sat, 30 Dec 2017 12:56:50 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBUCuofZ024304; Sat, 30 Dec 2017 12:56:50 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201712301256.vBUCuofZ024304@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 30 Dec 2017 12:56:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327382 - head/usr.sbin/usbconfig X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/usr.sbin/usbconfig X-SVN-Commit-Revision: 327382 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 12:56:51 -0000 Author: trasz Date: Sat Dec 30 12:56:50 2017 New Revision: 327382 URL: https://svnweb.freebsd.org/changeset/base/327382 Log: Improve usbconfig(8) manual page by adding descriptions for subcommands. Reviewed by: hselasky MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D13445 Modified: head/usr.sbin/usbconfig/usbconfig.8 Modified: head/usr.sbin/usbconfig/usbconfig.8 ============================================================================== --- head/usr.sbin/usbconfig/usbconfig.8 Sat Dec 30 11:42:49 2017 (r327381) +++ head/usr.sbin/usbconfig/usbconfig.8 Sat Dec 30 12:56:50 2017 (r327382) @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 6, 2010 +.Dd December 30, 2017 .Dt USBCONFIG 8 .Os .Sh NAME @@ -56,45 +56,124 @@ The unit and address coordinates may be prefixed by th Show help and available commands. .El .Pp -When called without options, +The following commands may be used with +.Nm : +.Bl -tag -width indent +.It Cm set_config Ar cfg_index +Choose the configuration for the USB device. +Valid values range from zero to the number reported as the +.Ar bNumConfigurations +in +.Cm dump_device_desc +output. +The special value of 255 unconfigures the device, detaching +the interface drivers and reducing the power consumption to minimum, +but without going into power saving mode or detaching from the bus. +In some cases, it prevents the device from charging. +.It Cm set_alt Ar alt_index +Choose the alternate interface for the USB device. +Alternative settings for the current configuration are available as the +.Ar bAlternateSetting +in +.Cm dump_curr_config_desc +output. +Usually there is no need to adjust this setting. +.It Cm set_template Ar template +Set the global USB device side template. +See +.Xr usb_template 4 +for more information. +.It Cm get_template +Get the current USB device side template. +.It Cm add_dev_quirk_vplh Ar vid Ar pid Ar lo_rev Ar hi_rev Ar quirk_name +Add a quirk by specifying the Vendor ID, Product ID, low and high +revision numbers, and the quirk name. +See +.Xr usb_quirk 4 +for more information. +.It Cm remove_dev_quirk_vplh Ar vid Ar pid Ar lo_rev Ar hi_rev Ar quirk_name +Remove a quirk. +.It Cm add_quirk Ar quirk_name +Add quirk for the currently selected USB device. +.It Cm remove_quirk Ar quirk_name +Remove a quirk for the currently selected USB device. +.It Cm dump_quirk_names +Display the list of supported quirk names. +.It Cm dump_device_quirks +Display the list of current device quirks. +.It Cm dump_device_desc +Display the device descriptor. +.It Cm dump_curr_config_desc +Display current configuration descriptor. +.It Cm dump_all_config_desc +Display all the configuration descriptors. +.It Cm dump_string Ar index +Display string descriptor at selected index. +.It Cm dump_info +Display summary information about the device. +.It Cm show_ifdrv +Display the list of interface drivers (such as +.Xr ukbd 4 +or +.Xr u3g 4 ) +currently attached to the device. +.It Cm suspend +Force the device to suspend. +.It Cm resume +Force the device to resume. +.It Cm power_off +Turn the device off. +.It Cm power_save +Turn the automatic suspend and resume on. +This is the default for USB hubs. +.It Cm power_on +Turn the device on and disable automatic suspend and resume. +This is the default for non-hub devices. +.It Cm reset +Reset the device. +This forces the USB stack to reenumerate the bus. +.It Cm list +List all available USB devices. +This is the default if .Nm -prints a list of all available USB devices. +is called without specifying a command. +.It Cm do_request Ar bmReqTyp Ar bReq Ar wVal Ar wIdx Ar wLen Ar data... +Perform a synchronous control request on the specified device. +See +.Xr libusb20_dev_request_sync 3 +for more information. +.El .Sh EXAMPLES +.Pp Show information about the device on USB bus 1 at address 2: .Pp -.Dl usbconfig -u 1 -a 2 dump_info +.Dl usbconfig -d ugen1.2 dump_info .Pp Dump HID descriptor for device on USB bus 1 at address 2: .Pp -.Dl usbconfig -u 1 -a 2 do_request 0x81 0x06 0x2200 0 0x100 +.Dl usbconfig -d ugen1.2 do_request 0x81 0x06 0x2200 0 0x100 .Pp Dump string descriptor at index Z for device on USB bus 1 at address 2: .Pp -.Dl usbconfig -u 1 -a 2 dump_string Z +.Dl usbconfig -d ugen1.2 dump_string Z .Pp Dump current configuration descriptor for device on USB bus 1 at address 2: .Pp -.Dl usbconfig -u 1 -a 2 dump_curr_config_desc +.Dl usbconfig -d ugen1.2 dump_curr_config_desc .Pp Dump device descriptor for device on USB bus 1 at address 2: .Pp -.Dl usbconfig -u 1 -a 2 dump_device_desc +.Dl usbconfig -d ugen1.2 dump_device_desc .Pp Program the device on USB bus 1 at address 2 to suspend, resume, power off, go into power save, or power on: .Pp -.Dl usbconfig -u 1 -a 2 suspend -.Dl usbconfig -u 1 -a 2 resume -.Dl usbconfig -u 1 -a 2 power_off -.Dl usbconfig -u 1 -a 2 power_save -.Dl usbconfig -u 1 -a 2 power_on +.Dl usbconfig -d ugen1.2 suspend +.Dl usbconfig -d ugen1.2 resume +.Dl usbconfig -d ugen1.2 power_off +.Dl usbconfig -d ugen1.2 power_save +.Dl usbconfig -d ugen1.2 power_on .Pp -Display a list of available quirk names: -.Pp -.Dl usbconfig dump_quirk_names -.Pp -See -.Xr usb_quirk 4 -for more information on quirks. .Sh SEE ALSO .Xr usb 4 , -.Xr usb_quirk 4 +.Xr usb_quirk 4 , +.Xr usb_template 4 From owner-svn-src-all@freebsd.org Sat Dec 30 15:01:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43602E895F7; Sat, 30 Dec 2017 15:01:51 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 794567F066; Sat, 30 Dec 2017 15:01:50 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id vBUF1nXu076234; Sat, 30 Dec 2017 07:01:49 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id vBUF1ncc076233; Sat, 30 Dec 2017 07:01:49 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201712301501.vBUF1ncc076233@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r327365 - head/targets/pseudo/userland In-Reply-To: <201712292356.vBTNu6dV094373@repo.freebsd.org> To: Eitan Adler Date: Sat, 30 Dec 2017 07:01:49 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 15:01:51 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: eadler > Date: Fri Dec 29 23:56:06 2017 > New Revision: 327365 > URL: https://svnweb.freebsd.org/changeset/base/327365 > > Log: > Remove a reference to burncd > > I'm unclear of the purpose of this pseudo-target > but while its here keep it up to date As an FYI: HISTORY The burncd utility appeared in FreeBSD 4.0. I am not sure when it was removed though. And if your unclear as to what something is you should probably ask before you make a commit to it. The Makefile.depend I believe are "maintained" by bdrewery and probably best to ping him with any changes. > Modified: > head/targets/pseudo/userland/Makefile.depend > > Modified: head/targets/pseudo/userland/Makefile.depend > ============================================================================== > --- head/targets/pseudo/userland/Makefile.depend Fri Dec 29 22:24:41 2017 (r327364) > +++ head/targets/pseudo/userland/Makefile.depend Fri Dec 29 23:56:06 2017 (r327365) > @@ -528,7 +528,6 @@ DIRDEPS+= \ > usr.sbin/bsnmpd/modules/snmp_wlan \ > usr.sbin/bsnmpd/tools/bsnmptools \ > usr.sbin/bsnmpd/tools/libbsnmptools \ > - usr.sbin/burncd \ > usr.sbin/cdcontrol \ > usr.sbin/chkgrp \ > usr.sbin/chown \ > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat Dec 30 15:11:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9A23E89DBF; Sat, 30 Dec 2017 15:11:34 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A37A97F5E9; Sat, 30 Dec 2017 15:11:34 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id vBUFBU0A076273; Sat, 30 Dec 2017 07:11:30 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id vBUFBTM8076272; Sat, 30 Dec 2017 07:11:29 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201712301511.vBUFBTM8076272@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r327368 - head/sbin/ccdconfig In-Reply-To: <201712300022.vBU0MlwL009457@repo.freebsd.org> To: "Pedro F. Giffuni" Date: Sat, 30 Dec 2017 07:11:29 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 15:11:34 -0000 > Author: pfg > Date: Sat Dec 30 00:22:47 2017 > New Revision: 327368 > URL: https://svnweb.freebsd.org/changeset/base/327368 > > Log: > ccdconfig: Update licensing terms to match NetBSD. > > The code originated in NetBSD which has since removed Clauses 3 and 4. > > Approved by: phk (concerning his own copyright) > Obtained from: NetBSD (CVS ccdconfig.c 1.47, ccdconfig.8 1.24) I am a bit on edge about these "license" changes that are occuring, before what you had been doing was adding "SPDX" tags which are just an advisory item, now your actually changing the text of licenses and doing so without second or third eyes and in a way that for me is a bit questionable. Part of the problem comes that if you go back and pull a licence change from NetBSD that was done in 2000 and apply it to our code because it was dervied from there your ignoring the fact that someone else may of made changes between 2000 and today, and technically those changes fall under the licence that was inplace when they made those changes. Also the NetBSD license change may of been athorized directly, as in this case here where you got direct permission from phk, and I have not seen any notes about that in your prior commits. Also note that if someone authorized NetBSD to make a license change, that authorization is NOT global in nature, it is for NetBSD to make that change, not *BSD. > Modified: > head/sbin/ccdconfig/ccdconfig.8 > head/sbin/ccdconfig/ccdconfig.c > > Modified: head/sbin/ccdconfig/ccdconfig.8 > ============================================================================== > --- head/sbin/ccdconfig/ccdconfig.8 Sat Dec 30 00:20:49 2017 (r327367) > +++ head/sbin/ccdconfig/ccdconfig.8 Sat Dec 30 00:22:47 2017 (r327368) > @@ -14,13 +14,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. All advertising materials mentioning features or use of this software > -.\" must display the following acknowledgement: > -.\" This product includes software developed by the NetBSD > -.\" Foundation, Inc. and its contributors. > -.\" 4. Neither the name of The NetBSD Foundation nor the names of its > -.\" contributors may be used to endorse or promote products derived > -.\" from this software without specific prior written permission. > .\" > .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR > .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES > > Modified: head/sbin/ccdconfig/ccdconfig.c > ============================================================================== > --- head/sbin/ccdconfig/ccdconfig.c Sat Dec 30 00:20:49 2017 (r327367) > +++ head/sbin/ccdconfig/ccdconfig.c Sat Dec 30 00:22:47 2017 (r327368) > @@ -18,13 +18,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. All advertising materials mentioning features or use of this software > - * must display the following acknowledgement: > - * This product includes software developed by the NetBSD > - * Foundation, Inc. and its contributors. > - * 4. Neither the name of The NetBSD Foundation nor the names of its > - * contributors may be used to endorse or promote products derived > - * from this software without specific prior written permission. > * > * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS > * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat Dec 30 15:12:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB8D8E89F1F for ; Sat, 30 Dec 2017 15:12:27 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-yb0-x236.google.com (mail-yb0-x236.google.com [IPv6:2607:f8b0:4002:c09::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 764737F90B for ; Sat, 30 Dec 2017 15:12:27 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: by mail-yb0-x236.google.com with SMTP id q3so12769994ybg.9 for ; Sat, 30 Dec 2017 07:12:27 -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; bh=HktoJD9LL/74YINj8b1Km44JPUWScCzetaA0E4NmZgM=; b=GsG+EDe2PqfOf8TXB59Eittv3m1it+rQEmYanWeBtcIHx/IJT9jmy+zMnEW1elySkU Np8iAh383a//hX/8LwycrEP5HVz0JO9qxtx5X/EEHNmF4T8IFdpZB1mtduvV8p3hy5WD kzGPh2vanzT/UePICk0sKPRCtAmFQLadh113Y= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=HktoJD9LL/74YINj8b1Km44JPUWScCzetaA0E4NmZgM=; b=vEL29XAjk5VjXn/Qbrh8VgDfCwaLolX8NVwPyBBRRU0nn5HjN10hTknhNhc5PcOEmP w6bm5MTizoXrXr5fIVbg5W1B2vQwbN6ghdEJPrQbdp+w52mRKXkkS97hya/vDjfvfGKV gfFYlGsxtZ4Yto7YmsB6aK2cXZrHQZJ8j5QgpJ0eViYae1yxatCBhnc13STRGPqcfclS MEmcyu7gZepdYgRdUfr2GNw5F4T6eJYJU9sq8fMMtI/9xutZL8ocidwPvG0ljCQnvcFb wwb+4/ACBzRCyVX3CnzxbmwvBw/8H1WzL70fZXRxjBJ+4MMBgl3D8IW6netQfEVSTCdH UMig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=HktoJD9LL/74YINj8b1Km44JPUWScCzetaA0E4NmZgM=; b=KiTbHGw72II6wew3Wp+jN0fDlfTRIemjl2mu3VshQfy9n29CjIsWH3DvLkdLvl0sFU nfQQ96x5gtwx6rWa0AFAM51sklArI/5whbmftCFhyElHEBn2wj2oNKSvbbF3EFN6Bx9U G4ztnN84KGoglMg2k22Mzp+ZllEjGcjdogmkYdQumi0SyVCnG6q3lfpXQ1XJHSf9F2Sb EFE551xd15MeRA34ec/NDCMJpKQPfPYNo63uVy+0swbGShP+wKnRP52C/kd9FlYPAcnP 76ILUuUmW033s+OZ6OLlLyHCTNBeumlUBefIggQBD8DgkvwjKMb6lwmOdRMJJwOzhYaa 3JTQ== X-Gm-Message-State: AKGB3mLt9Q6wSdtUMEtzhbuqcs6Iz/672zOvAZRt2YQ0j5lo9s5KKrAU fSspkuFplrF/pFmgt4kLXIRwgS58abW2/HRgoqQvrg== X-Google-Smtp-Source: ACJfBovrpyeDPmFb/UT05aYM/4dF6YRCJYOPVzhk0qUQMiVKQqj+c5cqaRpFXD8PaEdc4gvGrT9vDk5ztZ/rwBr1nSM= X-Received: by 10.37.210.216 with SMTP id j207mr18769690ybg.517.1514646746466; Sat, 30 Dec 2017 07:12:26 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.37.217.21 with HTTP; Sat, 30 Dec 2017 07:11:55 -0800 (PST) In-Reply-To: <201712301501.vBUF1ncc076233@pdx.rh.CN85.dnsmgr.net> References: <201712292356.vBTNu6dV094373@repo.freebsd.org> <201712301501.vBUF1ncc076233@pdx.rh.CN85.dnsmgr.net> From: Eitan Adler Date: Sat, 30 Dec 2017 07:11:55 -0800 X-Google-Sender-Auth: Q6whaMXAvPScKShXPgFNSplQGKE Message-ID: Subject: Re: svn commit: r327365 - head/targets/pseudo/userland To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 15:12:27 -0000 On 30 December 2017 at 07:01, Rodney W. Grimes wrote: > [ Charset UTF-8 unsupported, converting... ] >> Author: eadler >> Date: Fri Dec 29 23:56:06 2017 >> New Revision: 327365 >> URL: https://svnweb.freebsd.org/changeset/base/327365 >> >> Log: >> Remove a reference to burncd >> >> I'm unclear of the purpose of this pseudo-target >> but while its here keep it up to date > > As an FYI: > > HISTORY > The burncd utility appeared in FreeBSD 4.0. > > I am not sure when it was removed though. It was removed in 9.x along with the old ATA stack. > And if your unclear as to what something is you should probably ask > before you make a commit to it. I did ask before r325353 (my first commit to it). Also some things are pretty clear: removing references to things that no longer exist. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@freebsd.org Sat Dec 30 15:13:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDF6CE8A152; Sat, 30 Dec 2017 15:13:34 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 86FAD7FA85; Sat, 30 Dec 2017 15:13:34 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBUFDXJU082296; Sat, 30 Dec 2017 15:13:33 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBUFDXKj082294; Sat, 30 Dec 2017 15:13:33 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201712301513.vBUFDXKj082294@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 30 Dec 2017 15:13:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327383 - head/sys/dev/ep X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/dev/ep X-SVN-Commit-Revision: 327383 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 15:13:34 -0000 Author: pfg Date: Sat Dec 30 15:13:33 2017 New Revision: 327383 URL: https://svnweb.freebsd.org/changeset/base/327383 Log: elink.[ch]: Move historic VCS tags after the license. This matches better our common practices and style. Modified: head/sys/dev/ep/elink.c head/sys/dev/ep/elink.h Modified: head/sys/dev/ep/elink.c ============================================================================== --- head/sys/dev/ep/elink.c Sat Dec 30 12:56:50 2017 (r327382) +++ head/sys/dev/ep/elink.c Sat Dec 30 15:13:33 2017 (r327383) @@ -1,5 +1,3 @@ -/* $NetBSD: elink.c,v 1.6 1995/01/07 21:37:54 mycroft Exp $ */ - /*- * SPDX-License-Identifier: BSD-4-Clause * @@ -29,6 +27,8 @@ * 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. + * +/* $NetBSD: elink.c,v 1.6 1995/01/07 21:37:54 mycroft Exp $ */ #include Modified: head/sys/dev/ep/elink.h ============================================================================== --- head/sys/dev/ep/elink.h Sat Dec 30 12:56:50 2017 (r327382) +++ head/sys/dev/ep/elink.h Sat Dec 30 15:13:33 2017 (r327383) @@ -1,5 +1,3 @@ -/* $NetBSD: elink.h,v 1.3 1994/10/27 04:17:11 cgd Exp $ */ - /*- * SPDX-License-Identifier: BSD-4-Clause * @@ -30,6 +28,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * $NetBSD: elink.h,v 1.3 1994/10/27 04:17:11 cgd Exp $ * $FreeBSD$ */ From owner-svn-src-all@freebsd.org Sat Dec 30 15:14:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 251DBE8A23F; Sat, 30 Dec 2017 15:14:58 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F070D7FBF3; Sat, 30 Dec 2017 15:14:57 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id vBUFEuNl076297; Sat, 30 Dec 2017 07:14:56 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id vBUFEubp076296; Sat, 30 Dec 2017 07:14:56 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201712301514.vBUFEubp076296@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r327370 - head/sbin/ccdconfig In-Reply-To: <201712300026.vBU0QhXr009672@repo.freebsd.org> To: "Pedro F. Giffuni" Date: Sat, 30 Dec 2017 07:14:56 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 15:14:58 -0000 > Author: pfg > Date: Sat Dec 30 00:26:42 2017 > New Revision: 327370 > URL: https://svnweb.freebsd.org/changeset/base/327370 > > Log: > ccdconfig: Move VCS tags to be more consistent with our style. > > Update a now-bogus SPDX tag while here. > > Modified: > head/sbin/ccdconfig/ccdconfig.8 > head/sbin/ccdconfig/ccdconfig.c > head/sbin/ccdconfig/pathnames.h > > Modified: head/sbin/ccdconfig/ccdconfig.8 > ============================================================================== > --- head/sbin/ccdconfig/ccdconfig.8 Sat Dec 30 00:24:53 2017 (r327369) > +++ head/sbin/ccdconfig/ccdconfig.8 Sat Dec 30 00:26:42 2017 (r327370) > @@ -1,5 +1,3 @@ > -.\" $NetBSD: ccdconfig.8,v 1.4 1996/02/28 01:01:17 thorpej Exp $ > -.\" > .\" Copyright (c) 1996 The NetBSD Foundation, Inc. > .\" All rights reserved. > .\" > @@ -27,6 +25,7 @@ > .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > .\" SUCH DAMAGE. > .\" > +.\" $NetBSD: ccdconfig.8,v 1.4 1996/02/28 01:01:17 thorpej Exp $ Obtained from: NetBSD (CVS ccdconfig.c 1.47, ccdconfig.8 1.24) So now this confuses me, you just claimed to have pulled in ccdconfig 1.24 changes yet our NetBSD tag is still 1.4??? > .\" $FreeBSD$ > .\" > .Dd October 3, 2016 > > Modified: head/sbin/ccdconfig/ccdconfig.c > ============================================================================== > --- head/sbin/ccdconfig/ccdconfig.c Sat Dec 30 00:24:53 2017 (r327369) > +++ head/sbin/ccdconfig/ccdconfig.c Sat Dec 30 00:26:42 2017 (r327370) > @@ -1,7 +1,5 @@ > -/* $NetBSD: ccdconfig.c,v 1.6 1996/05/16 07:11:18 thorpej Exp $ */ > - > /*- > - * SPDX-License-Identifier: BSD-4-Clause > + * SPDX-License-Identifier: BSD-2-Clause > * > * Copyright (c) 2003 Poul-Henning Kamp > * Copyright (c) 1996 The NetBSD Foundation, Inc. > @@ -30,6 +28,8 @@ > * 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. > + * > + * NetBSD: ccdconfig.c,v 1.6 1996/05/16 07:11:18 thorpej Exp $ Obtained from: NetBSD (CVS ccdconfig.c 1.47, ccdconfig.8 1.24) Ditto on 1.6 vs 1.47 > */ > > #include > > Modified: head/sbin/ccdconfig/pathnames.h > ============================================================================== > --- head/sbin/ccdconfig/pathnames.h Sat Dec 30 00:24:53 2017 (r327369) > +++ head/sbin/ccdconfig/pathnames.h Sat Dec 30 00:26:42 2017 (r327370) > @@ -1,5 +1,3 @@ > -/* $NetBSD: pathnames.h,v 1.4 2008/04/28 20:23:07 martin Exp $ */ > - > /*- > * SPDX-License-Identifier: BSD-2-Clause-NetBSD > * > @@ -30,6 +28,7 @@ > * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE > * POSSIBILITY OF SUCH DAMAGE. > * > + * $NetBSD: pathnames.h,v 1.4 2008/04/28 20:23:07 martin Exp $ > * $FreeBSD$ > */ > > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat Dec 30 15:28:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76C95E8ACAB; Sat, 30 Dec 2017 15:28:01 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 543B580413; Sat, 30 Dec 2017 15:28:00 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id vBUFRxaA076352; Sat, 30 Dec 2017 07:27:59 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id vBUFRxtr076351; Sat, 30 Dec 2017 07:27:59 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201712301527.vBUFRxtr076351@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r327379 - head/sys/isa In-Reply-To: <201712300816.vBU8GVFu007528@repo.freebsd.org> To: Warner Losh Date: Sat, 30 Dec 2017 07:27:59 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 15:28:01 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: imp > Date: Sat Dec 30 08:16:31 2017 > New Revision: 327379 > URL: https://svnweb.freebsd.org/changeset/base/327379 > > Log: > On further testing on actual machines with this hardware, we should > only warn for devices that are attached. Add missing \n. > > Modified: > head/sys/isa/isa_common.c > > Modified: head/sys/isa/isa_common.c > ============================================================================== > --- head/sys/isa/isa_common.c Sat Dec 30 07:59:32 2017 (r327378) > +++ head/sys/isa/isa_common.c Sat Dec 30 08:16:31 2017 (r327379) > @@ -573,9 +573,10 @@ isa_probe_children(device_t dev) > > err = device_probe_and_attach(child); > if (err == 0 && idev->id_vendorid == 0 && > - strcmp(kern_ident, "GENERIC") == 0) > + strcmp(kern_ident, "GENERIC") == 0 && > + device_is_attached(child)) > device_printf(child, > - "non-PNP ISA device will be removed from GENERIC in FreeBSD 12."); > + "non-PNP ISA device will be removed from GENERIC in FreeBSD 12.\n"); Hat: RE Do you plan to give this notice in 11.x? (Technically a bit late, it should of been in 11.0). As giving it in 12.0 wont happen if you remove it in 12. Ie, as you have stated you want to remove this before we branch 12.0, if you do that this notice well never be seen by the users. Or well, they might get the notice, but the drivers well have already been removed. Or do you want to give notice in 12.* that it is being removed in 13.0. And that is not supporting these for 10 years, as 12.x should be EOL in a bit over 5 years from now if we cut in early 2018 which I believe to be the current target. > } > > /* > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat Dec 30 15:55:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 250A5E9F005 for ; Sat, 30 Dec 2017 15:55:20 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic309-34.consmr.mail.ne1.yahoo.com (sonic309-34.consmr.mail.ne1.yahoo.com [66.163.184.160]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ECC1A114A for ; Sat, 30 Dec 2017 15:55:19 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1514649319; bh=w7rQ4HSQ1eodt/y1fm/Rk7OD1wS+t5yhYVuzpASAkbw=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=DcB16v+9RhR7ShuS52ArXZ9rn/CuVm3IbC0PReOOxxjWogOKC/AYy8QhDB+OysbUsGp3EIHno2PQZy2XL956mg66VtE45XE0VClv+VAlx/iS/6JGjcxpOrwOK2KYj1yHuHVoD2DkECHHZ4ns93lVwZCn0XpYX7uUxJyFyqShwbf0wM+8ecZvBb+WqjCzvjmZYJz/J919LEe9dL0Fg6v4VPnVtQDbkp74NX4GBDXQx3ndtFrqi3fYMr+R7cxjQfIQEMojhxfn9uT+dEMpDLOU6vKAn6K3o1atbWyvy1LB83NNtkuCE3tcs0HCccIttNp2RTk9STBCa9sD2tkX7FxT7A== X-YMail-OSG: PVpG6XAVM1n0x2tc3NtT3T2dVmkAvOPElrK5ckdJr1Yjni6lU5WHk5X6XejjvJs bxMY4Otsq8.e653q5E2KHtpjHbO1U_oLprB1AdrL4N4yZ6V6G2_Dh1EGRJ8o0r2upXNr8NkKoMZV 8ui_31HYmPGwgrnqH1OMHAj6Y0PVEiSylUqUt.hQYSjn8tIlYTF44v8daMWp2O2C6hCT.HN_LNXo gD_llJT79HVS7uTZhRrhC5MVSPy2nUZHxHRFo60Xyyx6FciCApfe3GvKswEaKWbfbdx2EehL4YHb d3jy1NZ6vTMVKplR6vlpDmVYemu7wnzUMIVx.IE6XMn63C_JTdiU..6PLObh3pDNjiVL.UOitH0I mN2YjwaCuq7Lh.J0bu5s6HeCQexI2P3ZjyCPoxIssgxRu..QOigZFTotL6y.SrSp6g6aVFzgyU8g u7vDcVhGiIGZHcJOTShjYUQmq0Bu9U46sJJN7IJkcPD4iBsKLGxS5pswLkz6xNK1YUu3wxq43 Received: from sonic.gate.mail.ne1.yahoo.com by sonic309.consmr.mail.ne1.yahoo.com with HTTP; Sat, 30 Dec 2017 15:55:19 +0000 Received: from smtpgate103.mail.ne1.yahoo.com (EHLO [192.168.0.6]) ([216.155.193.162]) by smtp410.mail.ne1.yahoo.com (JAMES SMTP Server ) with ESMTPA ID e49af0816748731c493fa52bd47013e9; Sat, 30 Dec 2017 15:35:05 +0000 (UTC) Subject: Re: svn commit: r327370 - head/sbin/ccdconfig To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201712301514.vBUFEubp076296@pdx.rh.CN85.dnsmgr.net> From: Pedro Giffuni Message-ID: <6c95d594-83ff-0b35-55d9-69293362cb29@FreeBSD.org> Date: Sat, 30 Dec 2017 10:35:07 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <201712301514.vBUFEubp076296@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 15:55:20 -0000 On 12/30/17 10:14, Rodney W. Grimes wrote: >> Author: pfg >> Date: Sat Dec 30 00:26:42 2017 >> New Revision: 327370 >> URL: https://svnweb.freebsd.org/changeset/base/327370 >> >> Log: >> ccdconfig: Move VCS tags to be more consistent with our style. >> >> Update a now-bogus SPDX tag while here. >> >> Modified: >> head/sbin/ccdconfig/ccdconfig.8 >> head/sbin/ccdconfig/ccdconfig.c >> head/sbin/ccdconfig/pathnames.h >> >> Modified: head/sbin/ccdconfig/ccdconfig.8 >> ============================================================================== >> --- head/sbin/ccdconfig/ccdconfig.8 Sat Dec 30 00:24:53 2017 (r327369) >> +++ head/sbin/ccdconfig/ccdconfig.8 Sat Dec 30 00:26:42 2017 (r327370) >> @@ -1,5 +1,3 @@ >> -.\" $NetBSD: ccdconfig.8,v 1.4 1996/02/28 01:01:17 thorpej Exp $ >> -.\" >> .\" Copyright (c) 1996 The NetBSD Foundation, Inc. >> .\" All rights reserved. >> .\" >> @@ -27,6 +25,7 @@ >> .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF >> .\" SUCH DAMAGE. >> .\" >> +.\" $NetBSD: ccdconfig.8,v 1.4 1996/02/28 01:01:17 thorpej Exp $ > Obtained from: NetBSD (CVS ccdconfig.c 1.47, ccdconfig.8 1.24) > > So now this confuses me, you just claimed to have pulled in ccdconfig 1.24 > changes yet our NetBSD tag is still 1.4??? Yes, this is tricky ... see below. > >> .\" $FreeBSD$ >> .\" >> .Dd October 3, 2016 >> >> Modified: head/sbin/ccdconfig/ccdconfig.c >> ============================================================================== >> --- head/sbin/ccdconfig/ccdconfig.c Sat Dec 30 00:24:53 2017 (r327369) >> +++ head/sbin/ccdconfig/ccdconfig.c Sat Dec 30 00:26:42 2017 (r327370) >> @@ -1,7 +1, >>> */ >>> >>> #include >>> >>> Modified: head/sbin/ccdconfig/pathnames.h >>> ============================================================================== >>> --- head/sbin/ccdconfig/pathnames.h Sat Dec 30 00:24:53 2017 (r327369) >>> +++ head/sbin/ccdconfig/pathnames.h Sat Dec 30 00:26:42 2017 (r327370) >>> @@ -1,5 +1,3 @@ >>> -/* $NetBSD: pathnames.h,v 1.4 2008/04/28 20:23:07 martin Exp $ */ >>> - >>> /*- >>> * SPDX-License-Identifier: BSD-2-Clause-NetBSD >>> * >>> @@ -30,6 +28,7 @@ >>> * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE >>> * POSSIBILITY OF SUCH DAMAGE. >>> * >>> + * $NetBSD: pathnames.h,v 1.4 2008/04/28 20:23:07 martin Exp $ >>> * $FreeBSD$ >>> */ >>> >>> >>> >> 5 @@ >> -/* $NetBSD: ccdconfig.c,v 1.6 1996/05/16 07:11:18 thorpej Exp $ */ >> - >> /*- >> - * SPDX-License-Identifier: BSD-4-Clause >> + * SPDX-License-Identifier: BSD-2-Clause >> * >> * Copyright (c) 2003 Poul-Henning Kamp >> * Copyright (c) 1996 The NetBSD Foundation, Inc. >> @@ -30,6 +28,8 @@ >> * 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. >> + * >> + * NetBSD: ccdconfig.c,v 1.6 1996/05/16 07:11:18 thorpej Exp $ > Obtained from: NetBSD (CVS ccdconfig.c 1.47, ccdconfig.8 1.24) > > Ditto on 1.6 vs 1.47 > We regularly only update the VCS tags when the code matches both OSs. It is basically an indicator of when our code started diverging. This doesn't really stop us from bringing to the tree other changes/fixes that may be relevant even if that means skipping unrelated changes. In the case of these files, NetBSD made many changes that are not relevant to us (changed the bus API, for example) so bumping the versions of these files would be misguiding. If, for example, someone wants to merge the API changes in a future, it is still important to know where the divergence started. For relicensing, one has to be careful that the relicensed code covers the existing code in our files. Ichecked that none of the changes between the last merged version and the TNF copyright assignment is relevant to us. Pedro. From owner-svn-src-all@freebsd.org Sat Dec 30 16:04:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CDB4E9F695 for ; Sat, 30 Dec 2017 16:04:08 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic312-36.consmr.mail.ne1.yahoo.com (sonic312-36.consmr.mail.ne1.yahoo.com [66.163.191.217]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E532616BA for ; Sat, 30 Dec 2017 16:04:07 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1514649841; bh=fR3yQ3vX3zqPxW4btIg1aAKnEkiccNW9F1lrZPqLkEQ=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=VKUxgSQSRuImP5Q5O7kI7khJ9xwU6WVG/YJ1sB46XspKMYp3VNz5Ap4JvLgU5NlFO7XOHuK+6/HnZyzTFHlaJpSTTeJY2dg+U6nDO97dmqOOJMLNCvPQ9A20rQK0eBpVN2mcHg1vDJbpsHdnw3lDVLInTysqDMMXxq3MIPFpZKRU5qCRiLdj3cJs7oP1FAtKZdzutm7fV4SLFkJhzzdNB/GFjZ0xgyzfceUzntJAr2tnGlBZ8/KJU4qgzjRKzVk0xsmdCylLdyOINPqEsYRxd6zOLaQrDG2A2AJ9wBXkz3zSyFqfB6BN7mMR15zfbnJWed7bEZODgnW10eViEqfz5A== X-YMail-OSG: dijbf90VM1lZeuPMw4fPIS6SsEMSvv.iO30l2SawINabZ66rnROhZ7KgkuaxYVg CFMQC8lajLsobBa9QVvZifO9nwZEb.seNz0mvMRzHhc0B1ajXFTX6Hx_4XEalGpiZ9DvIw6yzShx QrZ6HTVRTsqx8HZYvDnDQwHKaTi0BWOTwFNOIddU8VTIDHY2RV.49dW2DVONh4irlVoxDTJQTBH5 WXB0pTOLvC5cRXMwB959LAKCjwu9MAwKF33zFAwStIBs7ovlLLtOQzIP7FuOk92hNug57clYLMAm BpYdIS0htI.HggkBwUS6jKkFZ3qYO846Wrm_hkGLdw9dz7LG3EbWwvOBWTQJUwQoZNHGpIoEFRgp 3efH11iTLrFy8qaX9HozKCjiUGAt_pPBh8kGC0cNiH7HNk.XZO4ye2PMBPOeLFvVYdUF0ca9pP.z 525sFnpVjcAzavrKdF.ORKunPi2RtIgeIrPpzIi75C3UrIxHGGLbJS1pfLNrp6P.OQIZPWqFb Received: from sonic.gate.mail.ne1.yahoo.com by sonic312.consmr.mail.ne1.yahoo.com with HTTP; Sat, 30 Dec 2017 16:04:01 +0000 Received: from smtp235.mail.ne1.yahoo.com (EHLO [192.168.0.6]) ([10.218.253.206]) by smtp409.mail.ne1.yahoo.com (JAMES SMTP Server ) with ESMTPA ID 4a761faf319ca71a8dd802b6b1079339; Sat, 30 Dec 2017 16:03:56 +0000 (UTC) Subject: Re: svn commit: r327368 - head/sbin/ccdconfig To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201712301511.vBUFBTM8076272@pdx.rh.CN85.dnsmgr.net> From: Pedro Giffuni Message-ID: <13e7d603-dc2f-2f74-90db-d0bf5059fabe@FreeBSD.org> Date: Sat, 30 Dec 2017 11:03:57 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <201712301511.vBUFBTM8076272@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 16:04:08 -0000 On 12/30/17 10:11, Rodney W. Grimes wrote: >> Author: pfg >> Date: Sat Dec 30 00:22:47 2017 >> New Revision: 327368 >> URL: https://svnweb.freebsd.org/changeset/base/327368 >> >> Log: >> ccdconfig: Update licensing terms to match NetBSD. >> >> The code originated in NetBSD which has since removed Clauses 3 and 4. >> >> Approved by: phk (concerning his own copyright) >> Obtained from: NetBSD (CVS ccdconfig.c 1.47, ccdconfig.8 1.24) > I am a bit on edge about these "license" changes that are occuring, > before what you had been doing was adding "SPDX" tags which are just > an advisory item, now your actually changing the text of licenses > and doing so without second or third eyes and in a way that for me > is a bit questionable. That is correct. I will be glad to move to "code review" mode from now on. I agree it is important to have more eyes on such changes. It just happens that even copyright owners sometimes don't want to look at these changes. > Part of the problem comes that if you go back and pull a licence change > from NetBSD that was done in 2000 and apply it to our code because it > was dervied from there your ignoring the fact that someone else may > of made changes between 2000 and today, and technically those changes > fall under the licence that was inplace when they made those changes. It is not as simple as that, I did check the changes that are relevant for us in NetBSD before the license changes. I might have missed something though, so yes I agree on having more eyes. > Also the NetBSD license change may of been athorized directly, as in > this case here where you got direct permission from phk, and I have not > seen any notes about that in your prior commits. Also note that if > someone authorized NetBSD to make a license change, that authorization > is NOT global in nature, it is for NetBSD to make that change, not > *BSD. Authorization from NetBSD would be necessary if we were including code from NetBSD that was not meant to be covered by the license change. I didn't find any evidence of that, but feel free to point out any such case so that we can take it to the NetBSD guys. Pedro. From owner-svn-src-all@freebsd.org Sat Dec 30 16:10:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 354E8E9FB5D; Sat, 30 Dec 2017 16:10:51 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B62231B9E; Sat, 30 Dec 2017 16:10:50 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id vBUGAmSU076575; Sat, 30 Dec 2017 08:10:48 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id vBUGAmg0076574; Sat, 30 Dec 2017 08:10:48 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201712301610.vBUGAmg0076574@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r327368 - head/sbin/ccdconfig In-Reply-To: <13e7d603-dc2f-2f74-90db-d0bf5059fabe@FreeBSD.org> To: Pedro Giffuni Date: Sat, 30 Dec 2017 08:10:48 -0800 (PST) CC: rgrimes@FreeBSD.org, src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Reply-To: rgrimes@FreeBSD.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 16:10:51 -0000 [ Charset UTF-8 unsupported, converting... ] > > > On 12/30/17 10:11, Rodney W. Grimes wrote: > >> Author: pfg > >> Date: Sat Dec 30 00:22:47 2017 > >> New Revision: 327368 > >> URL: https://svnweb.freebsd.org/changeset/base/327368 > >> > >> Log: > >> ccdconfig: Update licensing terms to match NetBSD. > >> > >> The code originated in NetBSD which has since removed Clauses 3 and 4. > >> > >> Approved by: phk (concerning his own copyright) > >> Obtained from: NetBSD (CVS ccdconfig.c 1.47, ccdconfig.8 1.24) > > I am a bit on edge about these "license" changes that are occuring, > > before what you had been doing was adding "SPDX" tags which are just > > an advisory item, now your actually changing the text of licenses > > and doing so without second or third eyes and in a way that for me > > is a bit questionable. > > That is correct. > > I will be glad to move to "code review" mode from now on. I agree it is > important to have more eyes on such changes. It just happens that even > copyright owners sometimes don't want to look at these changes. True that copyright holders often dont want to change the terms and/or copyright that they have already applied. Its just extra work they probably see as an unnecessary time consumer. > > Part of the problem comes that if you go back and pull a licence change > > from NetBSD that was done in 2000 and apply it to our code because it > > was dervied from there your ignoring the fact that someone else may > > of made changes between 2000 and today, and technically those changes > > fall under the licence that was inplace when they made those changes. > > It is not as simple as that, I did check the changes that are relevant > for us in NetBSD before the license changes. I might have missed > something though, so yes I agree on having more eyes. It is not just the changes in NetBSD, the problem I am trying to bring out is any changes made to OUR files are being done under an N clause licence, your now removing those clauses without permission from any of the people who made those changes to our code independent of what happened in NetBSD. > > Also the NetBSD license change may of been athorized directly, as in > > this case here where you got direct permission from phk, and I have not > > seen any notes about that in your prior commits. Also note that if > > someone authorized NetBSD to make a license change, that authorization > > is NOT global in nature, it is for NetBSD to make that change, not > > *BSD. > > Authorization from NetBSD would be necessary if we were including code > from NetBSD that was not meant to be covered by the license change. I > didn't find any evidence of that, but feel free to point out any such > case so that we can take it to the NetBSD guys. And authorization from FreeBSD commiter(s) is needed to change the license on those files. Understand that they made those changes to that file under the terms of that license, they may not want the other clauses removed (unlikely, but possilbe). > Pedro. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat Dec 30 16:14:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7225E9FFA4; Sat, 30 Dec 2017 16:14:23 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (hz.grosbein.net [78.47.246.247]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C4F71E97; Sat, 30 Dec 2017 16:14:23 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (root@eg.sd.rdtc.ru [62.231.161.221] (may be forged)) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id vBUGEFfm048979 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 30 Dec 2017 17:14:16 +0100 (CET) (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: rgrimes@freebsd.org Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id vBUGEBuE034918 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Sat, 30 Dec 2017 23:14:11 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: svn commit: r327365 - head/targets/pseudo/userland To: rgrimes@freebsd.org, Eitan Adler References: <201712301501.vBUF1ncc076233@pdx.rh.CN85.dnsmgr.net> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Eugene Grosbein Message-ID: <5A47BB50.5070700@grosbein.net> Date: Sat, 30 Dec 2017 23:14:08 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <201712301501.vBUF1ncc076233@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=2.2 required=5.0 tests=BAYES_00, LOCAL_FROM, RDNS_NONE autolearn=no autolearn_force=no version=3.4.1 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 1.9 RDNS_NONE Delivered to internal network by a host with no rDNS * 2.6 LOCAL_FROM From my domains X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on hz.grosbein.net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 16:14:23 -0000 30.12.2017 22:01, Rodney W. Grimes пишет: > [ Charset UTF-8 unsupported, converting... ] >> Author: eadler >> Date: Fri Dec 29 23:56:06 2017 >> New Revision: 327365 >> URL: https://svnweb.freebsd.org/changeset/base/327365 >> >> Log: >> Remove a reference to burncd >> >> I'm unclear of the purpose of this pseudo-target >> but while its here keep it up to date > > As an FYI: > > HISTORY > The burncd utility appeared in FreeBSD 4.0. > > I am not sure when it was removed though. burncd was ad(4)-specific and became non-functional with switch to CAM-enabled ada(4) driver. burncd has been removed some time after that switch. From owner-svn-src-all@freebsd.org Sat Dec 30 16:25:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B6A5EA09C7 for ; Sat, 30 Dec 2017 16:25:28 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic312-36.consmr.mail.ne1.yahoo.com (sonic312-36.consmr.mail.ne1.yahoo.com [66.163.191.217]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F76625A7 for ; Sat, 30 Dec 2017 16:25:28 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1514651127; bh=cEkEmlATfIyMhN2jF0e5n0OJcY8eZlYxVweIaGhuqJU=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=aML9NUyU7IkChSiOC2nC9dp6Wh91TeoAnaw/QsdbEgNmRU+a0kqgVMqywrTyPi09s+lobKOO9IvT7A9gBqgg5Nl1pAu6Mj5wIS5ywA5fh3qOPOY52/5vPARZnUFquJOJIN/hH2lMzsKN0RSba6pEzRgCwFLfguGQ6eOZqU0TfAakeqHuIwcL6UaS+gMK0qFkq3/p7If5vsvFzdXtMogJKi+ShZ8s80VDy0+hoiVuTL8sQAfl1J+uUCkoSC/Nu3E3S0/l4uIYLGQ558JsJ8JolqKwy9VhqbA9y350dVga1fCgfZGmoCedeX9mpAEBax1SLZNa8jc4rzDzIGkD/5ArVA== X-YMail-OSG: nIaZ.sUVM1kkJ42JimxVWA1Sd0t22f9QTqifEFOD2hDMaJGsuh61tuzjG0jyQ7q _eE8DLr1CJBG_XnjKhO6zRjnmdURoFKLwIavkganC68vaOF5MuKsE5W.LOE7xwVdyf3vHodZxyYl gvt5a21aQrwdjQKleAfNM2Pgg4Bhsm3GwxhKpATJf51mnVR8zyuVBsHvDSevMpLAmTU27RKTPzca 0kOO3Ylc2MuD.YznseoAwbeaTzOVApDc24Dwd84YvYEBMo_u7BiBW1IyywT9z0o69YjKjbnC5gWe U3CyJT2GPgqRL8X0QzvE8GUdp28M1ZbHUOWvUhVKjtMjgfX9cJQswrV.fln8DZhl0nK68dVq0F_C 7m1BYlL3ikFFf0gdqGA2jKgM0d8ZbIJzC6C8vOlY.L6O5Q8rN2xyPs6_vl0yWq5yiwKjzfyjuJht 9MEE0eXPNaKr11jdXp2QXq7QR72IYZESZD0tieVC4T9ckcyHNqisKK0NGjhW2.YxwY9FlSa1G Received: from sonic.gate.mail.ne1.yahoo.com by sonic312.consmr.mail.ne1.yahoo.com with HTTP; Sat, 30 Dec 2017 16:25:27 +0000 Received: from smtp226.mail.ne1.yahoo.com (EHLO [192.168.0.6]) ([10.218.253.215]) by smtp406.mail.ne1.yahoo.com (JAMES SMTP Server ) with ESMTPA ID db5b6f980b0766508c7f24f08cf82a4f; Sat, 30 Dec 2017 16:25:24 +0000 (UTC) Subject: Re: svn commit: r327368 - head/sbin/ccdconfig To: rgrimes@FreeBSD.org Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201712301610.vBUGAmg0076574@pdx.rh.CN85.dnsmgr.net> From: Pedro Giffuni Message-ID: <2f1978cc-302a-72fa-9030-ab94ba9f2912@FreeBSD.org> Date: Sat, 30 Dec 2017 11:25:26 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <201712301610.vBUGAmg0076574@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 16:25:28 -0000 On 12/30/17 11:10, Rodney W. Grimes wrote: > [ Charset UTF-8 unsupported, converting... ] >> >> On 12/30/17 10:11, Rodney W. Grimes wrote: >>>> Author: pfg >>>> Date: Sat Dec 30 00:22:47 2017 >>>> New Revision: 327368 >>>> URL: https://svnweb.freebsd.org/changeset/base/327368 >>>> >>>> Log: >>>> ccdconfig: Update licensing terms to match NetBSD. >>>> >>>> The code originated in NetBSD which has since removed Clauses 3 and 4. >>>> >>>> Approved by: phk (concerning his own copyright) >>>> Obtained from: NetBSD (CVS ccdconfig.c 1.47, ccdconfig.8 1.24) >>> I am a bit on edge about these "license" changes that are occuring, >>> before what you had been doing was adding "SPDX" tags which are just >>> an advisory item, now your actually changing the text of licenses >>> and doing so without second or third eyes and in a way that for me >>> is a bit questionable. >> That is correct. >> >> I will be glad to move to "code review" mode from now on. I agree it is >> important to have more eyes on such changes. It just happens that even >> copyright owners sometimes don't want to look at these changes. > True that copyright holders often dont want to change the terms > and/or copyright that they have already applied. Its just extra > work they probably see as an unnecessary time consumer. > > >>> Part of the problem comes that if you go back and pull a licence change >>> from NetBSD that was done in 2000 and apply it to our code because it >>> was dervied from there your ignoring the fact that someone else may >>> of made changes between 2000 and today, and technically those changes >>> fall under the licence that was inplace when they made those changes. >> It is not as simple as that, I did check the changes that are relevant >> for us in NetBSD before the license changes. I might have missed >> something though, so yes I agree on having more eyes. > It is not just the changes in NetBSD, the problem I am trying to > bring out is any changes made to OUR files are being done under > an N clause licence, your now removing those clauses without > permission from any of the people who made those changes to our > code independent of what happened in NetBSD. > Well, phk was the only author that added his copyright to the file in question. He approved the change and made a further blank statement CC'd to core. Other people have made changes to the file and from my reading of the Berne convention they have authorship rights over the file, how much of that is copyrightable is uncertain but they can certainly add their own copyright if they feel strongly. >>> Also the NetBSD license change may of been athorized directly, as in >>> this case here where you got direct permission from phk, and I have not >>> seen any notes about that in your prior commits. Also note that if >>> someone authorized NetBSD to make a license change, that authorization >>> is NOT global in nature, it is for NetBSD to make that change, not >>> *BSD. >> Authorization from NetBSD would be necessary if we were including code >> from NetBSD that was not meant to be covered by the license change. I >> didn't find any evidence of that, but feel free to point out any such >> case so that we can take it to the NetBSD guys. > And authorization from FreeBSD commiter(s) is needed to change the license > on those files. Understand that they made those changes to that file > under the terms of that license, they may not want the other clauses > removed (unlikely, but possilbe). Aha.. interesting point but irrelevant to this case. We are removing copyright clauses that are specific to NetBSD:       * 3. All advertising materials mentioning features or use of this software       *    must display the following acknowledgement:       *        This product includes software developed by the NetBSD       *        Foundation, Inc. and its contributors.       * 4. Neither the name of The NetBSD Foundation nor the names of its       *    contributors may be used to endorse or promote products derived       *    from this software without specific prior written permission. If TNF doesn't want their name to be included anymore,  other copyright owners cannot force such condition. Pedro. From owner-svn-src-all@freebsd.org Sat Dec 30 16:29:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 050B9EA0CA7 for ; Sat, 30 Dec 2017 16:29:49 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x229.google.com (mail-io0-x229.google.com [IPv6:2607:f8b0:4001:c06::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BEC3527A5 for ; Sat, 30 Dec 2017 16:29:48 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x229.google.com with SMTP id v30so11956176iov.7 for ; Sat, 30 Dec 2017 08:29:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=zYjALrSRsBEoljzr8TYURULMyNUSeN1Leer+twJ1kAg=; b=dRUS4xDzbWX1+RNrDi7Cl2uSn4VITo5Iug6DCEPijzjdz39KYdxkGPBnO+7mQ/7NMK q/il0kWF0/CQvNPOviSwrgxHN25ta8ajK/EbfnWvz+kxIVnsfTps3snWUmHiU4oZTob7 qWUNHc1mRZgW5rbDyZWrCEjAJG4dRvqYndSR04iaKUCm+gFVXbumKdSlSxOYYNSFR990 SOudg7Nkph7Qxc6tX3lF9ajqC009hmTV12oOsY3Fz7siKlVAMG8LrfSQZ2JvxvnAsfWc Ta5NnKO4hvjLHzmGLweoEaIY6JexNs3O/xsoV9J27y07ahegPm9F/0iwkj2uPTHlZwvs R+hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=zYjALrSRsBEoljzr8TYURULMyNUSeN1Leer+twJ1kAg=; b=VidecayEkvLJzEPae2y9G5Z0dHsdFekY0m1h93Jg5ZDWxwIhZc/Gs6ZBtvLzw6eGR7 ZaWcnY03QsKRW9DhyoXRaAqLjvJPtEpkq/0PKX+v1iK7RVaLUkR3MHl/slFqNOvd29nz iZG9co860V6U+rnxqn2FT8AgToarI455CgzXbVXOUP//G3tHunU9R6DtSkT3abWrHwgw Evwl3+SHG4P/hMlzhJ7aUsixJKHfp/aGFxVEWqOrXOyiXSxpSh0JxXNAndXe9/cpkwdz fU15GZpasLPUrG05ksD8butsSSSmOei0OXnlUTAlGrrSqSAUlthuQDYlWQsrijF2rPSd e/3Q== X-Gm-Message-State: AKGB3mJqqa06B0fazi9LGi4AfHcVQ7WowGWh6vfbzM2mF8eQ7oR9Z35T Ke6zJ440PlvExlyX8VGiMwZrzarQPREeLfwkmHoPXw== X-Google-Smtp-Source: ACJfBouatO9OoFgjdZyNB/qeZnqCvvhzv+trmmXS/6tbyn8QnGx2JWwVHFDcamdGuVI6rlELHMSz3EHq6szCxWi7Gk0= X-Received: by 10.107.13.67 with SMTP id 64mr5259136ion.301.1514651387887; Sat, 30 Dec 2017 08:29:47 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.108.204 with HTTP; Sat, 30 Dec 2017 08:29:47 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: <201712301527.vBUFRxtr076351@pdx.rh.CN85.dnsmgr.net> References: <201712300816.vBU8GVFu007528@repo.freebsd.org> <201712301527.vBUFRxtr076351@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Sat, 30 Dec 2017 09:29:47 -0700 X-Google-Sender-Auth: XNMfdJuU_f3tOOlcNOLTkf1g4D4 Message-ID: Subject: Re: svn commit: r327379 - head/sys/isa To: "Rodney W. Grimes" Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 16:29:49 -0000 On Sat, Dec 30, 2017 at 8:27 AM, Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > [ Charset UTF-8 unsupported, converting... ] > > Author: imp > > Date: Sat Dec 30 08:16:31 2017 > > New Revision: 327379 > > URL: https://svnweb.freebsd.org/changeset/base/327379 > > > > Log: > > On further testing on actual machines with this hardware, we should > > only warn for devices that are attached. Add missing \n. > > > > Modified: > > head/sys/isa/isa_common.c > > > > Modified: head/sys/isa/isa_common.c > > ============================================================ > ================== > > --- head/sys/isa/isa_common.c Sat Dec 30 07:59:32 2017 (r327378) > > +++ head/sys/isa/isa_common.c Sat Dec 30 08:16:31 2017 (r327379) > > @@ -573,9 +573,10 @@ isa_probe_children(device_t dev) > > > > err = device_probe_and_attach(child); > > if (err == 0 && idev->id_vendorid == 0 && > > - strcmp(kern_ident, "GENERIC") == 0) > > + strcmp(kern_ident, "GENERIC") == 0 && > > + device_is_attached(child)) > > device_printf(child, > > - "non-PNP ISA device will be removed from > GENERIC in FreeBSD 12."); > > + "non-PNP ISA device will be removed from > GENERIC in FreeBSD 12.\n"); > > Hat: RE > > Do you plan to give this notice in 11.x? (Technically a bit late, > it should of been in 11.0). > Yes. It will be MFC'd soon. Of course it should have happened in 11.0, but it didn't. But this notice is just about things in GENERIC. Not their actual removal (though most of them will be removed). The notice is here because GENERIC is going to be cut to the bone once the PNP stuff I'm working on makes it viable to have all drivers (well, most) kld loaded. The only ones that will affect users, though, are the ones that are for hinted devices which will have no autoloading. Hence this warning. > As giving it in 12.0 wont happen if you remove it in 12. Ie, as you > have stated you want to remove this before we branch 12.0, if you do > that this notice well never be seen by the users. Or well, they might > get the notice, but the drivers well have already been removed. > > Or do you want to give notice in 12.* that it is being removed in 13.0. > And that is not supporting these for 10 years, as 12.x should be EOL > in a bit over 5 years from now if we cut in early 2018 which I believe > to be the current target. > No. All non-PNP ISA devices will be removed from GENERIC in 12. That is, if they are still in the tree. A number will simply be gone, however. I'll be putting warnings in those drivers soon. It would have been ideal had we done so earlier, but we didn't. Simple lack of notice, however, isn't going to keep things in the tree. The following drivers will be removed in 12: aha, adv, adw, bt, aic, ct, dpt, ncv, nsp, stg, mse, joy, cm and likely cx and rx. arcnet too will be removed. Still need to check on dangling references old TTY code as well that hasn't built in FreeBSD 8. This list has circulated before, and I'll be codifying a run-time warning into all these drivers on attach, plus getting a head-start on what to remove in 13. FreeBSD has grown large. While you can still boot it on that old 32MB machine, you really want 128MB or more to do anything useful. You need at least 2GB or a heck of a lot of swap to self-host. We should simply be removing the really old stuff that wouldn't be on a machine that size. Expect more announcements like this to be coming soon from the people that have been taking are of and feeding this old stuff for too long. If we cut with the 128MB criteria, the list would be much, much longer, and the cuts much deeper. Warner > > } > > > > /* > > > > > > -- > Rod Grimes > rgrimes@freebsd.org > From owner-svn-src-all@freebsd.org Sat Dec 30 16:58:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4ED1CEA20EE; Sat, 30 Dec 2017 16:58:28 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 263753582; Sat, 30 Dec 2017 16:58:27 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id vBUGwOVY076781; Sat, 30 Dec 2017 08:58:24 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id vBUGwOvo076780; Sat, 30 Dec 2017 08:58:24 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201712301658.vBUGwOvo076780@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r327368 - head/sbin/ccdconfig In-Reply-To: <2f1978cc-302a-72fa-9030-ab94ba9f2912@FreeBSD.org> To: Pedro Giffuni Date: Sat, 30 Dec 2017 08:58:24 -0800 (PST) CC: rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 16:58:28 -0000 > > > On 12/30/17 11:10, Rodney W. Grimes wrote: > > [ Charset UTF-8 unsupported, converting... ] > >> > >> On 12/30/17 10:11, Rodney W. Grimes wrote: > >>>> Author: pfg > >>>> Date: Sat Dec 30 00:22:47 2017 > >>>> New Revision: 327368 > >>>> URL: https://svnweb.freebsd.org/changeset/base/327368 > >>>> > >>>> Log: > >>>> ccdconfig: Update licensing terms to match NetBSD. > >>>> > >>>> The code originated in NetBSD which has since removed Clauses 3 and 4. > >>>> > >>>> Approved by: phk (concerning his own copyright) > >>>> Obtained from: NetBSD (CVS ccdconfig.c 1.47, ccdconfig.8 1.24) > >>> I am a bit on edge about these "license" changes that are occuring, > >>> before what you had been doing was adding "SPDX" tags which are just > >>> an advisory item, now your actually changing the text of licenses > >>> and doing so without second or third eyes and in a way that for me > >>> is a bit questionable. > >> That is correct. > >> > >> I will be glad to move to "code review" mode from now on. I agree it is > >> important to have more eyes on such changes. It just happens that even > >> copyright owners sometimes don't want to look at these changes. > > True that copyright holders often dont want to change the terms > > and/or copyright that they have already applied. Its just extra > > work they probably see as an unnecessary time consumer. > > > > > >>> Part of the problem comes that if you go back and pull a licence change > >>> from NetBSD that was done in 2000 and apply it to our code because it > >>> was dervied from there your ignoring the fact that someone else may > >>> of made changes between 2000 and today, and technically those changes > >>> fall under the licence that was inplace when they made those changes. > >> It is not as simple as that, I did check the changes that are relevant > >> for us in NetBSD before the license changes. I might have missed > >> something though, so yes I agree on having more eyes. > > It is not just the changes in NetBSD, the problem I am trying to > > bring out is any changes made to OUR files are being done under > > an N clause licence, your now removing those clauses without > > permission from any of the people who made those changes to our > > code independent of what happened in NetBSD. > > > Well, phk was the only author that added his copyright to the file in > question. He approved the change and made a further blank statement CC'd > to core. > > Other people have made changes to the file and from my reading of the > Berne convention they have authorship rights over the file, how much of > that is copyrightable is uncertain but they can certainly add their own > copyright if they feel strongly. Copyright != License, there is both a copyright and a license here, you can not apply the Berne convention to the license, its not a copyright. > >>> Also the NetBSD license change may of been athorized directly, as in > >>> this case here where you got direct permission from phk, and I have not > >>> seen any notes about that in your prior commits. Also note that if > >>> someone authorized NetBSD to make a license change, that authorization > >>> is NOT global in nature, it is for NetBSD to make that change, not > >>> *BSD. > >> Authorization from NetBSD would be necessary if we were including code > >> from NetBSD that was not meant to be covered by the license change. I > >> didn't find any evidence of that, but feel free to point out any such > >> case so that we can take it to the NetBSD guys. > > And authorization from FreeBSD commiter(s) is needed to change the license > > on those files. Understand that they made those changes to that file > > under the terms of that license, they may not want the other clauses > > removed (unlikely, but possilbe). > > Aha.. interesting point but irrelevant to this case. > We are removing copyright clauses that are specific to NetBSD: No, your altering the license clauses not the copyright, you must seperate the two as different laws apply. > ??? ? * 3. All advertising materials mentioning features or use of this > software > ??? ? *??? must display the following acknowledgement: > ??? ? *??????? This product includes software developed by the NetBSD > ??? ? *??????? Foundation, Inc. and its contributors. > ??? ? * 4. Neither the name of The NetBSD Foundation nor the names of its > ??? ? *??? contributors may be used to endorse or promote products derived > ??? ? *??? from this software without specific prior written permission. > > > If TNF doesn't want their name to be included anymore,? other copyright > owners cannot force such condition. Again, your trying to mix 2 different sets of law. And actually I would have to defer to an attorny on if it is safe to alter this license without due consideration, independent of what NetBSD did to there file, not sure that NetBSD can assert a request to alter a license that has been adopted by another person by inclusing on top of thier work. They can give permission to alter there "licensed file", but not sure how that carries forward to a derived work. > Pedro. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat Dec 30 17:09:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 724A7EA2BAB; Sat, 30 Dec 2017 17:09:55 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 482043E36; Sat, 30 Dec 2017 17:09:54 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id vBUH9pPP076834; Sat, 30 Dec 2017 09:09:51 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id vBUH9pZF076833; Sat, 30 Dec 2017 09:09:51 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201712301709.vBUH9pZF076833@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r327379 - head/sys/isa In-Reply-To: To: Warner Losh Date: Sat, 30 Dec 2017 09:09:51 -0800 (PST) CC: "Rodney W. Grimes" , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 17:09:55 -0000 [ Charset UTF-8 unsupported, converting... ] > On Sat, Dec 30, 2017 at 8:27 AM, Rodney W. Grimes < > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > [ Charset UTF-8 unsupported, converting... ] > > > Author: imp > > > Date: Sat Dec 30 08:16:31 2017 > > > New Revision: 327379 > > > URL: https://svnweb.freebsd.org/changeset/base/327379 > > > > > > Log: > > > On further testing on actual machines with this hardware, we should > > > only warn for devices that are attached. Add missing \n. > > > > > > Modified: > > > head/sys/isa/isa_common.c > > > > > > Modified: head/sys/isa/isa_common.c > > > ============================================================ > > ================== > > > --- head/sys/isa/isa_common.c Sat Dec 30 07:59:32 2017 (r327378) > > > +++ head/sys/isa/isa_common.c Sat Dec 30 08:16:31 2017 (r327379) > > > @@ -573,9 +573,10 @@ isa_probe_children(device_t dev) > > > > > > err = device_probe_and_attach(child); > > > if (err == 0 && idev->id_vendorid == 0 && > > > - strcmp(kern_ident, "GENERIC") == 0) > > > + strcmp(kern_ident, "GENERIC") == 0 && > > > + device_is_attached(child)) > > > device_printf(child, > > > - "non-PNP ISA device will be removed from > > GENERIC in FreeBSD 12."); > > > + "non-PNP ISA device will be removed from > > GENERIC in FreeBSD 12.\n"); > > > > Hat: RE > > > > Do you plan to give this notice in 11.x? (Technically a bit late, > > it should of been in 11.0). > > > > Yes. It will be MFC'd soon. Of course it should have happened in 11.0, but > it didn't. But this notice is just about things in GENERIC. Not their > actual removal (though most of them will be removed). The notice is here > because GENERIC is going to be cut to the bone once the PNP stuff I'm > working on makes it viable to have all drivers (well, most) kld loaded. The > only ones that will affect users, though, are the ones that are for hinted > devices which will have no autoloading. Hence this warning. Thanks for claifying. > > > As giving it in 12.0 wont happen if you remove it in 12. Ie, as you > > have stated you want to remove this before we branch 12.0, if you do > > that this notice well never be seen by the users. Or well, they might > > get the notice, but the drivers well have already been removed. > > > > Or do you want to give notice in 12.* that it is being removed in 13.0. > > And that is not supporting these for 10 years, as 12.x should be EOL > > in a bit over 5 years from now if we cut in early 2018 which I believe > > to be the current target. > > > > No. All non-PNP ISA devices will be removed from GENERIC in 12. That is, if > they are still in the tree. A number will simply be gone, however. I'll be > putting warnings in those drivers soon. It would have been ideal had we > done so earlier, but we didn't. Simple lack of notice, however, isn't going > to keep things in the tree. The following drivers will be removed in 12: > aha, adv, adw, bt, aic, ct, dpt, ncv, nsp, stg, mse, joy, cm and likely cx > and rx. arcnet too will be removed. Still need to check on dangling > references old TTY code as well that hasn't built in FreeBSD 8. This list > has circulated before, and I'll be codifying a run-time warning into all > these drivers on attach, plus getting a head-start on what to remove in 13. Many of those listed devices, though they have an ISA device, they also support pci variants. I didnt check all of them, but I know from usage that the bt and dpt drivers support PCI pnp cards just fine. So is this more than just ISA axeing? > FreeBSD has grown large. While you can still boot it on that old 32MB > machine, you really want 128MB or more to do anything useful. You need at > least 2GB or a heck of a lot of swap to self-host. We should simply be > removing the really old stuff that wouldn't be on a machine that size. > Expect more announcements like this to be coming soon from the people that > have been taking are of and feeding this old stuff for too long. If we cut > with the 128MB criteria, the list would be much, much longer, and the cuts > much deeper. I have a large pile of VM's running in 64MB, and only have to bump to 128MB when I load a GENERIC, which that only became an issue with 11.x. These 64MB vm's are running with out swap and 12MB of free memory. We get really fun failures trying to boot GENERIC on a 12 snapshot with even 128MB due to the WITNESS/DEBUG bloat. PLEASE again, do not dismiss "32MB" as old machines, this is a VERY real and ideal situation for those deploying mass VM instances. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat Dec 30 17:24:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6511AEA38B9 for ; Sat, 30 Dec 2017 17:24:31 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x235.google.com (mail-it0-x235.google.com [IPv6:2607:f8b0:4001:c0b::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2836863B35 for ; Sat, 30 Dec 2017 17:24:31 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x235.google.com with SMTP id m11so6249105iti.1 for ; Sat, 30 Dec 2017 09:24:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=K1QF6WWSNvH448XWAZQ5ryFnQomh1EX77holQZ6kg0w=; b=H8q64gSDAYa1tNZ/g2+P17jGgAtUFUg7OiJ7EfbzSRNie0bhWL6cDrQFmgnC+CM1Sg 98RgJeqRpopm0m4gpbRehgxGVbO1Cw6+O48/4H4iZNdJwwyI7/mt6J1MdcwVfVjiy6Mx yBGqwh9e2CCrVRXXbIbkQHqvvjdrgmWM/+0DPy2eREusDim1hQ3cDL2sdcX9MTAT8PZa dapZkM/QW6ayPuTeBl6CJTnYTB0qPq2z00I4cU2SK85s/Zgq++XuD9kTe7pg6YQqwAYz j1oy1p5shDgvH4gCba5Hs5KCu8qyQBPQYF9fwie1+PZOpfpqEQx/NzjjyF2w08puEvzc 9pUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=K1QF6WWSNvH448XWAZQ5ryFnQomh1EX77holQZ6kg0w=; b=sbhx3XJLK0qJ3lkgq14cWiHAU4CiZcEYqqnOo4p1+VgpTTBTNLsnQNhhV7Sj+tt/uS tKcaSrZaCipU/SBaTZDtBDcFJKlPrVnFj1QAS6JdoV3N12NYOTg5XqXlNpLmfC2FnVlB Ak5+OUBl18IMCfvCtZwjk8P1/pCUefPSkKJWaVXbJHPuv5qaJhs2cnCTwQRL3ElqVnot /rnG56+8sjJG5wfU7/ugJf6rX/duHPjoQSUdhuK6XvxaYQx0LmyHIllbJvkB/5qio92i I5imu/yagOXsG/pa13zptL38NPbYBXfajOEzlofxEyuu80MlsbldHel5LyJ0XfGjtXEu LbGQ== X-Gm-Message-State: AKGB3mIXjFIQaGIiwVvuMr0CA32d31TiybuVUDDHL1S858D5T6lI5Ycv eky+8GYGbctroOPh5vob/Ztj2SEeYFabk91wjAE4cw== X-Google-Smtp-Source: ACJfBotpcAE4+AbwRfew00eKY7664wUFPGc3OX2l3z0Uz14dm5PWlBNWx5uy5QKq+0UwnjWaAJY5vSRvExaqTWAxNQk= X-Received: by 10.36.131.200 with SMTP id d191mr49755085ite.97.1514654670220; Sat, 30 Dec 2017 09:24:30 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.108.204 with HTTP; Sat, 30 Dec 2017 09:24:29 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <201712301709.vBUH9pZF076833@pdx.rh.CN85.dnsmgr.net> References: <201712301709.vBUH9pZF076833@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Sat, 30 Dec 2017 10:24:29 -0700 X-Google-Sender-Auth: Y7wyuE6q1FnJohCi5Br5f43OpwE Message-ID: Subject: Re: svn commit: r327379 - head/sys/isa To: "Rodney W. Grimes" Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 17:24:31 -0000 On Sat, Dec 30, 2017 at 10:09 AM, Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > [ Charset UTF-8 unsupported, converting... ] > > On Sat, Dec 30, 2017 at 8:27 AM, Rodney W. Grimes < > > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > > [ Charset UTF-8 unsupported, converting... ] > > > > Author: imp > > > > Date: Sat Dec 30 08:16:31 2017 > > > > New Revision: 327379 > > > > URL: https://svnweb.freebsd.org/changeset/base/327379 > > > > > > > > Log: > > > > On further testing on actual machines with this hardware, we should > > > > only warn for devices that are attached. Add missing \n. > > > > > > > > Modified: > > > > head/sys/isa/isa_common.c > > > > > > > > Modified: head/sys/isa/isa_common.c > > > > ============================================================ > > > ================== > > > > --- head/sys/isa/isa_common.c Sat Dec 30 07:59:32 2017 > (r327378) > > > > +++ head/sys/isa/isa_common.c Sat Dec 30 08:16:31 2017 > (r327379) > > > > @@ -573,9 +573,10 @@ isa_probe_children(device_t dev) > > > > > > > > err = device_probe_and_attach(child); > > > > if (err == 0 && idev->id_vendorid == 0 && > > > > - strcmp(kern_ident, "GENERIC") == 0) > > > > + strcmp(kern_ident, "GENERIC") == 0 && > > > > + device_is_attached(child)) > > > > device_printf(child, > > > > - "non-PNP ISA device will be removed from > > > GENERIC in FreeBSD 12."); > > > > + "non-PNP ISA device will be removed from > > > GENERIC in FreeBSD 12.\n"); > > > > > > Hat: RE > > > > > > Do you plan to give this notice in 11.x? (Technically a bit late, > > > it should of been in 11.0). > > > > > > > Yes. It will be MFC'd soon. Of course it should have happened in 11.0, > but > > it didn't. But this notice is just about things in GENERIC. Not their > > actual removal (though most of them will be removed). The notice is here > > because GENERIC is going to be cut to the bone once the PNP stuff I'm > > working on makes it viable to have all drivers (well, most) kld loaded. > The > > only ones that will affect users, though, are the ones that are for > hinted > > devices which will have no autoloading. Hence this warning. > > Thanks for claifying. > > > > > > As giving it in 12.0 wont happen if you remove it in 12. Ie, as you > > > have stated you want to remove this before we branch 12.0, if you do > > > that this notice well never be seen by the users. Or well, they might > > > get the notice, but the drivers well have already been removed. > > > > > > Or do you want to give notice in 12.* that it is being removed in 13.0. > > > And that is not supporting these for 10 years, as 12.x should be EOL > > > in a bit over 5 years from now if we cut in early 2018 which I believe > > > to be the current target. > > > > > > > No. All non-PNP ISA devices will be removed from GENERIC in 12. That is, > if > > they are still in the tree. A number will simply be gone, however. I'll > be > > putting warnings in those drivers soon. It would have been ideal had we > > done so earlier, but we didn't. Simple lack of notice, however, isn't > going > > to keep things in the tree. The following drivers will be removed in 12: > > aha, adv, adw, bt, aic, ct, dpt, ncv, nsp, stg, mse, joy, cm and likely > cx > > and rx. arcnet too will be removed. Still need to check on dangling > > references old TTY code as well that hasn't built in FreeBSD 8. This list > > has circulated before, and I'll be codifying a run-time warning into all > > these drivers on attach, plus getting a head-start on what to remove in > 13. > > Many of those listed devices, though they have an ISA device, they also > support pci variants. I didnt check all of them, but I know from usage > that the bt and dpt drivers support PCI pnp cards just fine. > So is this more than just ISA axeing? adv, adw, bt, ncv and stg did have PCI variants. They are all old parallel scsi cards that are no longer relevant. All but adw only supported SCSI 1 speeds and an 8-bit width. adw did support wide SCSI (aka 16-bit), but it's still a fairly low-level device, but was an unpopular card back in the day. This was the list that jhb circulated about a year ago. I'm just trying to formalize it in case something that's on it that shouldn't be. > FreeBSD has grown large. While you can still boot it on that old 32MB > > machine, you really want 128MB or more to do anything useful. You need at > > least 2GB or a heck of a lot of swap to self-host. We should simply be > > removing the really old stuff that wouldn't be on a machine that size. > > Expect more announcements like this to be coming soon from the people > that > > have been taking are of and feeding this old stuff for too long. If we > cut > > with the 128MB criteria, the list would be much, much longer, and the > cuts > > much deeper. > > I have a large pile of VM's running in 64MB, and only have to bump to 128MB > when I load a GENERIC, which that only became an issue with 11.x. These > 64MB vm's are running with out swap and 12MB of free memory. > > We get really fun failures trying to boot GENERIC on a 12 snapshot with > even 128MB due to the WITNESS/DEBUG bloat. > And a bazillion drivers you don't need taking up 20MB in GENERIC! PLEASE again, do not dismiss "32MB" as old machines, this is a VERY real > and ideal situation for those deploying mass VM instances. 32MB is a very different experience than 64MB. Even with a kernel that's stripped to the bone, you're doing good to have 18MB free in single user and I've not been able to make it to a login prompt yet.... But a VM is quite different than actual hardware.... Please don't get the two confused. Warner From owner-svn-src-all@freebsd.org Sat Dec 30 19:27:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7BADEA880A; Sat, 30 Dec 2017 19:27:23 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B25E668AC5; Sat, 30 Dec 2017 19:27:23 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBUJRMgR090505; Sat, 30 Dec 2017 19:27:22 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBUJRMLk090504; Sat, 30 Dec 2017 19:27:22 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201712301927.vBUJRMLk090504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 30 Dec 2017 19:27:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327384 - head/sys/dev/ep X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/dev/ep X-SVN-Commit-Revision: 327384 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 19:27:24 -0000 Author: cy Date: Sat Dec 30 19:27:22 2017 New Revision: 327384 URL: https://svnweb.freebsd.org/changeset/base/327384 Log: Fix r327383: .../sys/dev/ep/elink.c:31:1: error: '/*' within block comment [-Werror,-Wcomment] /* $NetBSD: elink.c,v 1.6 1995/01/07 21:37:54 mycroft Exp $ ^ Modified: head/sys/dev/ep/elink.c Modified: head/sys/dev/ep/elink.c ============================================================================== --- head/sys/dev/ep/elink.c Sat Dec 30 15:13:33 2017 (r327383) +++ head/sys/dev/ep/elink.c Sat Dec 30 19:27:22 2017 (r327384) @@ -28,7 +28,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * -/* $NetBSD: elink.c,v 1.6 1995/01/07 21:37:54 mycroft Exp $ + * $NetBSD: elink.c,v 1.6 1995/01/07 21:37:54 mycroft Exp $ */ #include From owner-svn-src-all@freebsd.org Sat Dec 30 19:29:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05A8EEA8960; Sat, 30 Dec 2017 19:29:21 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id AC0FA68C4F; Sat, 30 Dec 2017 19:29:20 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with ESMTPA id VMmHe2TBFb3YIVMmIePw88; Sat, 30 Dec 2017 12:26:43 -0700 X-Authority-Analysis: v=2.2 cv=J/va1EvS c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=ocR9PWop10UA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=uJPH1WpERpn9X_kr0MMA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id E4609990; Sat, 30 Dec 2017 11:26:40 -0800 (PST) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id vBUJQeHA085903; Sat, 30 Dec 2017 11:26:40 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id vBUJQe7H085892; Sat, 30 Dec 2017 11:26:40 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201712301926.vBUJQe7H085892@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: "Pedro F. Giffuni" cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327383 - head/sys/dev/ep In-Reply-To: Message from "Pedro F. Giffuni" of "Sat, 30 Dec 2017 15:13:33 +0000." <201712301513.vBUFDXKj082294@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 30 Dec 2017 11:26:40 -0800 X-CMAE-Envelope: MS4wfNNzDUJH0nGm6b/HgyyBXM6HELFvlaeSHuy0ZFk4VvH9VwTR9CVxGcBRjF685xa9/ueB9Hrek3zT5jZ7//vHP4vjd9gZqz8MeCdgUEiB0A/+wwoqxTVu +4uFvjwRSFbwegspfimELzgmSjT23ac735Zid8/mPyGKHuuTAdai8hB8PBM7w1kYG2d6w7PRLM+Lvt4AkIeH5gdlXkp7tKFps1q/9IJpG4GET2Eiy57JuPSj OswKq/2SxNM4F4GSp9x5InqRchWuXASLA+NIEaiI/9QHGg8VkeRoFe0yyMeQmmfJ X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 19:29:21 -0000 In message <201712301513.vBUFDXKj082294@repo.freebsd.org>, "Pedro F. Giffuni" w rites: > Author: pfg > Date: Sat Dec 30 15:13:33 2017 > New Revision: 327383 > URL: https://svnweb.freebsd.org/changeset/base/327383 > > Log: > elink.[ch]: Move historic VCS tags after the license. > > This matches better our common practices and style. > > Modified: > head/sys/dev/ep/elink.c > head/sys/dev/ep/elink.h > > Modified: head/sys/dev/ep/elink.c > ============================================================================= > = > --- head/sys/dev/ep/elink.c Sat Dec 30 12:56:50 2017 (r327382) > +++ head/sys/dev/ep/elink.c Sat Dec 30 15:13:33 2017 (r327383) > @@ -1,5 +1,3 @@ > -/* $NetBSD: elink.c,v 1.6 1995/01/07 21:37:54 mycroft Exp $ */ > - > /*- > * SPDX-License-Identifier: BSD-4-Clause > * > @@ -29,6 +27,8 @@ > * 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. > + * > +/* $NetBSD: elink.c,v 1.6 1995/01/07 21:37:54 mycroft Exp $ > */ > Hi Pedro, I got this: /opt/src/svn-current/sys/dev/ep/elink.c:31:1: error: '/*' within block comment [-Werror,-Wcomment] /* $NetBSD: elink.c,v 1.6 1995/01/07 21:37:54 mycroft Exp $ ^ I'll go ahead and fix this for us. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Sat Dec 30 19:35:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02119EA8CA4; Sat, 30 Dec 2017 19:35:14 +0000 (UTC) (envelope-from bryanv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C0D2F690A4; Sat, 30 Dec 2017 19:35:13 +0000 (UTC) (envelope-from bryanv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBUJZCiN094579; Sat, 30 Dec 2017 19:35:12 GMT (envelope-from bryanv@FreeBSD.org) Received: (from bryanv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBUJZCTL094578; Sat, 30 Dec 2017 19:35:12 GMT (envelope-from bryanv@FreeBSD.org) Message-Id: <201712301935.vBUJZCTL094578@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bryanv set sender to bryanv@FreeBSD.org using -f From: Bryan Venteicher Date: Sat, 30 Dec 2017 19:35:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327385 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: bryanv X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 327385 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 19:35:14 -0000 Author: bryanv Date: Sat Dec 30 19:35:12 2017 New Revision: 327385 URL: https://svnweb.freebsd.org/changeset/base/327385 Log: Advertise IFCAP_LINKSTAT after r326480 added link status support MFC after: 2 weeks Modified: head/sys/net/if_vxlan.c Modified: head/sys/net/if_vxlan.c ============================================================================== --- head/sys/net/if_vxlan.c Sat Dec 30 19:27:22 2017 (r327384) +++ head/sys/net/if_vxlan.c Sat Dec 30 19:35:12 2017 (r327385) @@ -2743,6 +2743,8 @@ vxlan_clone_create(struct if_clone *ifc, int unit, cad ifp->if_ioctl = vxlan_ioctl; ifp->if_transmit = vxlan_transmit; ifp->if_qflush = vxlan_qflush; + ifp->if_capabilities |= IFCAP_LINKSTATE; + ifp->if_capenable |= IFCAP_LINKSTATE; ifmedia_init(&sc->vxl_media, 0, vxlan_media_change, vxlan_media_status); ifmedia_add(&sc->vxl_media, IFM_ETHER | IFM_AUTO, 0, NULL); From owner-svn-src-all@freebsd.org Sat Dec 30 19:39:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 356A7EA8EEB for ; Sat, 30 Dec 2017 19:39:46 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic307-17.consmr.mail.bf2.yahoo.com (sonic307-17.consmr.mail.bf2.yahoo.com [74.6.134.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EDCEC69479 for ; Sat, 30 Dec 2017 19:39:45 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1514662779; bh=Fq6xzoDZ5d2SeMe83lLk5Nfq+s8oHvm5CuGZk7Bx1rw=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=JefT0cRNXpUouczlPYCTiiPrdnzABbMp9Wezm+M/XI0KNBOsFuQ5VftVR1htbn5Te+VJZ4dtFdcvxDT4/ljAIlPMn15PD3tVR/NpZZbWovhMQebc59/t0mYQBNRVtb+gRaNQHWGwQZyhZ/QDFZUCmfuq9bmD2uNQi5Z4o/remJ+vujZTtyc2zRSY/6QOs9puaqcPZAN4AwlZ1OScXZnm1MCWk79Zn5MYZcJe/WXvDR1aNnkfTvlBOtmyWRn8mGqGY2Fc6owOAUPmbEuavd82vX1pI5PtPVW0s8PbKGo8XxeAhxFCSFp13sdatyirm5nAApNgxHD4R8UwU5LSSHheGg== X-YMail-OSG: soQ7JjkVM1mH83Ko4gV2ryre_hk9Gu5XNa7f_VrI04LAAhGNWZFmosIeZVUmOON KO1lqoltTFiN9STJoh9mLmuJmy8NU0XhZYK5p.umBzCWbZjJ2wYO.YexA00.YSzNnZAa7uM.5vLB N.YHX8D9niM4leFYu0AjiMHCQ96I.OdXpLMXxtRJ1f6qhBSAAffAv_9V.08j6mBozgp1TEjQKf4f l0mgZwmcN8kl076VdKl6LL.Fg1.bvowN.wBp15s5URnD69ewqGe8pXdfGzf3H4TSX1_aGUkxb6O_ mgqPZS.Am.Y5tO.BM1lxS467P0zMtm5Xj3ERZjfvDAhgfaT.6aNlpqpcVoQ896VA8LkqxJFCOdkj hGklErhm2M8P9N3MIpLC6ypnr3ayruG8.teVbdijSIAGsvOx0fguicUf3gSX0265iar8MJ8SDy.7 HiyV9P70cJH6Ko.jlBhsL2AkhdyjvfplzSYHqW_Bprvi7_N0UfUm27e1uY6s6ZuoeI.FdV5QS Received: from sonic.gate.mail.ne1.yahoo.com by sonic307.consmr.mail.bf2.yahoo.com with HTTP; Sat, 30 Dec 2017 19:39:39 +0000 Received: from smtp107.rhel.mail.bf1.yahoo.com (EHLO [192.168.0.6]) ([98.139.231.44]) by smtp403.mail.bf1.yahoo.com (JAMES SMTP Server ) with ESMTPA ID bf548b05616178347a0c8e7adf30506d; Sat, 30 Dec 2017 19:39:37 +0000 (UTC) Subject: Re: svn commit: r327368 - head/sbin/ccdconfig To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201712301658.vBUGwOvo076780@pdx.rh.CN85.dnsmgr.net> From: Pedro Giffuni Organization: FreeBSD Project Message-ID: <51e405b5-c406-f57f-83bc-29209f35171b@FreeBSD.org> Date: Sat, 30 Dec 2017 14:39:39 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <201712301658.vBUGwOvo076780@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 19:39:46 -0000 On 30/12/2017 11:58, Rodney W. Grimes wrote: >> >> On 12/30/17 11:10, Rodney W. Grimes wrote: >>> [ Charset UTF-8 unsupported, converting... ] >>>> On 12/30/17 10:11, Rodney W. Grimes wrote: >>>>>> Author: pfg >>>>>> Date: Sat Dec 30 00:22:47 2017 >>>>>> New Revision: 327368 >>>>>> URL: https://svnweb.freebsd.org/changeset/base/327368 >>>>>> >>>>>> Log: >>>>>> ccdconfig: Update licensing terms to match NetBSD. >>>>>> >>>>>> The code originated in NetBSD which has since removed Clauses 3 and 4. >>>>>> >>>>>> Approved by: phk (concerning his own copyright) >>>>>> Obtained from: NetBSD (CVS ccdconfig.c 1.47, ccdconfig.8 1.24) >>>>> I am a bit on edge about these "license" changes that are occuring, >>>>> before what you had been doing was adding "SPDX" tags which are just >>>>> an advisory item, now your actually changing the text of licenses >>>>> and doing so without second or third eyes and in a way that for me >>>>> is a bit questionable. >>>> That is correct. >>>> >>>> I will be glad to move to "code review" mode from now on. I agree it is >>>> important to have more eyes on such changes. It just happens that even >>>> copyright owners sometimes don't want to look at these changes. >>> True that copyright holders often dont want to change the terms >>> and/or copyright that they have already applied. Its just extra >>> work they probably see as an unnecessary time consumer. >>> >>> >>>>> Part of the problem comes that if you go back and pull a licence change >>>>> from NetBSD that was done in 2000 and apply it to our code because it >>>>> was dervied from there your ignoring the fact that someone else may >>>>> of made changes between 2000 and today, and technically those changes >>>>> fall under the licence that was inplace when they made those changes. >>>> It is not as simple as that, I did check the changes that are relevant >>>> for us in NetBSD before the license changes. I might have missed >>>> something though, so yes I agree on having more eyes. >>> It is not just the changes in NetBSD, the problem I am trying to >>> bring out is any changes made to OUR files are being done under >>> an N clause licence, your now removing those clauses without >>> permission from any of the people who made those changes to our >>> code independent of what happened in NetBSD. >>> >> Well, phk was the only author that added his copyright to the file in >> question. He approved the change and made a further blank statement CC'd >> to core. >> >> Other people have made changes to the file and from my reading of the >> Berne convention they have authorship rights over the file, how much of >> that is copyrightable is uncertain but they can certainly add their own >> copyright if they feel strongly. > Copyright != License, there is both a copyright and a license here, > you can not apply the Berne convention to the license, its not a > copyright. Both are closely related: if you are not an author you have no say on the license. >>>>> Also the NetBSD license change may of been athorized directly, as in >>>>> this case here where you got direct permission from phk, and I have not >>>>> seen any notes about that in your prior commits. Also note that if >>>>> someone authorized NetBSD to make a license change, that authorization >>>>> is NOT global in nature, it is for NetBSD to make that change, not >>>>> *BSD. >>>> Authorization from NetBSD would be necessary if we were including code >>>> from NetBSD that was not meant to be covered by the license change. I >>>> didn't find any evidence of that, but feel free to point out any such >>>> case so that we can take it to the NetBSD guys. >>> And authorization from FreeBSD commiter(s) is needed to change the license >>> on those files. Understand that they made those changes to that file >>> under the terms of that license, they may not want the other clauses >>> removed (unlikely, but possilbe). >> Aha.. interesting point but irrelevant to this case. >> We are removing copyright clauses that are specific to NetBSD: > No, your altering the license clauses not the copyright, you must > seperate the two as different laws apply. No, you just don't want to lose the argument for whatever reason. >> ??? ? * 3. All advertising materials mentioning features or use of this >> software >> ??? ? *??? must display the following acknowledgement: >> ??? ? *??????? This product includes software developed by the NetBSD >> ??? ? *??????? Foundation, Inc. and its contributors. >> ??? ? * 4. Neither the name of The NetBSD Foundation nor the names of its >> ??? ? *??? contributors may be used to endorse or promote products derived >> ??? ? *??? from this software without specific prior written permission. >> >> >> If TNF doesn't want their name to be included anymore,? other copyright >> owners cannot force such condition. > Again, your trying to mix 2 different sets of law. And actually I would > have to defer to an attorny on if it is safe to alter this license without > due consideration, independent of what NetBSD did to there file, not sure > that NetBSD can assert a request to alter a license that has been adopted > by another person by inclusing on top of thier work. They can give permission > to alter there "licensed file", but not sure how that carries forward to > a derived work. It is basically not possible to contact all copyright holders and one has to apply some common sense: Asami, for example, is not available anymore but he upstreamed his changes to the NetBSD guys so it is reasonable to assume we don't have to contact him again. It is also not reasonable to contact someone just because he fixed some compilation error. We have to draw a line somewhere and then, as you are proving, common sense is the least common of senses. Committers fixing bugs on FreeBSD are not looking into the license for the code they are fixing and hoping to add more restrictions. The fact that the mayor contributors to the code are willing to remove some restrictions is something positive for both projects: it means whenever we want to submit or take changes to/from upstream we can both share changes without concerns. If your concern is that FreeBSD may eventually become free from the so called "advertisement" clause, then fear no more: we have more than 650 files still covered and there is no chance we will be able to change most of them, including some critical ones. Pedro. From owner-svn-src-all@freebsd.org Sat Dec 30 19:49:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A3F0EA9597; Sat, 30 Dec 2017 19:49:42 +0000 (UTC) (envelope-from bryanv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C8A4269B7E; Sat, 30 Dec 2017 19:49:41 +0000 (UTC) (envelope-from bryanv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBUJnemB099422; Sat, 30 Dec 2017 19:49:40 GMT (envelope-from bryanv@FreeBSD.org) Received: (from bryanv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBUJnecg099421; Sat, 30 Dec 2017 19:49:40 GMT (envelope-from bryanv@FreeBSD.org) Message-Id: <201712301949.vBUJnecg099421@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bryanv set sender to bryanv@FreeBSD.org using -f From: Bryan Venteicher Date: Sat, 30 Dec 2017 19:49:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327386 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: bryanv X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 327386 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 19:49:42 -0000 Author: bryanv Date: Sat Dec 30 19:49:40 2017 New Revision: 327386 URL: https://svnweb.freebsd.org/changeset/base/327386 Log: Add macro for vxlan list mutex lock and unlock This will simplify some later VNET support. Submitted by: hrs MFC after: 2 weeks Modified: head/sys/net/if_vxlan.c Modified: head/sys/net/if_vxlan.c ============================================================================== --- head/sys/net/if_vxlan.c Sat Dec 30 19:35:12 2017 (r327385) +++ head/sys/net/if_vxlan.c Sat Dec 30 19:49:40 2017 (r327386) @@ -381,7 +381,11 @@ static const char vxlan_name[] = "vxlan"; static MALLOC_DEFINE(M_VXLAN, vxlan_name, "Virtual eXtensible LAN Interface"); static struct if_clone *vxlan_cloner; + static struct mtx vxlan_list_mtx; +#define VXLAN_LIST_LOCK() mtx_lock(&vxlan_list_mtx) +#define VXLAN_LIST_UNLOCK() mtx_unlock(&vxlan_list_mtx) + static LIST_HEAD(, vxlan_socket) vxlan_socket_list; static eventhandler_tag vxlan_ifdetach_event_tag; @@ -890,11 +894,11 @@ vxlan_socket_release(struct vxlan_socket *vso) { int destroy; - mtx_lock(&vxlan_list_mtx); + VXLAN_LIST_LOCK(); destroy = VXLAN_SO_RELEASE(vso); if (destroy != 0) LIST_REMOVE(vso, vxlso_entry); - mtx_unlock(&vxlan_list_mtx); + VXLAN_LIST_UNLOCK(); if (destroy != 0) vxlan_socket_destroy(vso); @@ -905,14 +909,14 @@ vxlan_socket_lookup(union vxlan_sockaddr *vxlsa) { struct vxlan_socket *vso; - mtx_lock(&vxlan_list_mtx); + VXLAN_LIST_LOCK(); LIST_FOREACH(vso, &vxlan_socket_list, vxlso_entry) { if (vxlan_sockaddr_cmp(&vso->vxlso_laddr, &vxlsa->sa) == 0) { VXLAN_SO_ACQUIRE(vso); break; } } - mtx_unlock(&vxlan_list_mtx); + VXLAN_LIST_UNLOCK(); return (vso); } @@ -921,10 +925,10 @@ static void vxlan_socket_insert(struct vxlan_socket *vso) { - mtx_lock(&vxlan_list_mtx); + VXLAN_LIST_LOCK(); VXLAN_SO_ACQUIRE(vso); LIST_INSERT_HEAD(&vxlan_socket_list, vso, vxlso_entry); - mtx_unlock(&vxlan_list_mtx); + VXLAN_LIST_UNLOCK(); } static int @@ -3116,10 +3120,10 @@ vxlan_ifdetach_event(void *arg __unused, struct ifnet if ((ifp->if_flags & IFF_MULTICAST) == 0) return; - mtx_lock(&vxlan_list_mtx); + VXLAN_LIST_LOCK(); LIST_FOREACH(vso, &vxlan_socket_list, vxlso_entry) vxlan_socket_ifdetach(vso, ifp, &list); - mtx_unlock(&vxlan_list_mtx); + VXLAN_LIST_UNLOCK(); LIST_FOREACH_SAFE(sc, &list, vxl_ifdetach_list, tsc) { LIST_REMOVE(sc, vxl_ifdetach_list); From owner-svn-src-all@freebsd.org Sat Dec 30 20:23:15 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C75DEAAA34; Sat, 30 Dec 2017 20:23:15 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 665E56AEEC; Sat, 30 Dec 2017 20:23:15 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBUKNEEW016150; Sat, 30 Dec 2017 20:23:14 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBUKNEOp016149; Sat, 30 Dec 2017 20:23:14 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201712302023.vBUKNEOp016149@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sat, 30 Dec 2017 20:23:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327387 - head/sys/dev/vt/hw/ofwfb X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: head/sys/dev/vt/hw/ofwfb X-SVN-Commit-Revision: 327387 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 20:23:15 -0000 Author: nwhitehorn Date: Sat Dec 30 20:23:14 2017 New Revision: 327387 URL: https://svnweb.freebsd.org/changeset/base/327387 Log: Check more aggressively for whether the desired properties actually exist. If they don't, the code would look up some random part of the device tree and seize the console inappropriately. MFC after: 2 weeks Modified: head/sys/dev/vt/hw/ofwfb/ofwfb.c Modified: head/sys/dev/vt/hw/ofwfb/ofwfb.c ============================================================================== --- head/sys/dev/vt/hw/ofwfb/ofwfb.c Sat Dec 30 19:49:40 2017 (r327386) +++ head/sys/dev/vt/hw/ofwfb/ofwfb.c Sat Dec 30 20:23:14 2017 (r327387) @@ -94,8 +94,13 @@ ofwfb_probe(struct vt_device *vd) char type[64]; chosen = OF_finddevice("/chosen"); - OF_getprop(chosen, "stdout", &stdout, sizeof(stdout)); - node = OF_instance_to_package(stdout); + if (chosen == -1) + return (CN_DEAD); + + node = -1; + if (OF_getprop(chosen, "stdout", &stdout, sizeof(stdout)) == + sizeof(stdout)) + node = OF_instance_to_package(stdout); if (node == -1) { /* * The "/chosen/stdout" does not exist try From owner-svn-src-all@freebsd.org Sat Dec 30 20:24:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE1FEEAAB48; Sat, 30 Dec 2017 20:24:34 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B81216B165; Sat, 30 Dec 2017 20:24:34 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBUKOX9p016237; Sat, 30 Dec 2017 20:24:33 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBUKOX5U016236; Sat, 30 Dec 2017 20:24:33 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201712302024.vBUKOX5U016236@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sat, 30 Dec 2017 20:24:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327388 - head/sys/powerpc/ps3 X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: head/sys/powerpc/ps3 X-SVN-Commit-Revision: 327388 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 20:24:35 -0000 Author: nwhitehorn Date: Sat Dec 30 20:24:33 2017 New Revision: 327388 URL: https://svnweb.freebsd.org/changeset/base/327388 Log: Change the way SMP startup works to match the new multi-AP features in locore64.S introduced in r327358. MFC after: 3 weeks Modified: head/sys/powerpc/ps3/platform_ps3.c Modified: head/sys/powerpc/ps3/platform_ps3.c ============================================================================== --- head/sys/powerpc/ps3/platform_ps3.c Sat Dec 30 20:23:14 2017 (r327387) +++ head/sys/powerpc/ps3/platform_ps3.c Sat Dec 30 20:24:33 2017 (r327388) @@ -103,6 +103,8 @@ static platform_def_t ps3_platform = { PLATFORM_DEF(ps3_platform); +static int ps3_boot_pir = 0; + static int ps3_probe(platform_t plat) { @@ -129,6 +131,9 @@ ps3_attach(platform_t plat) /* Set a breakpoint to make NULL an invalid address */ lv1_set_dabr(0x7 /* read and write, MMU on */, 2 /* kernel accesses */); + /* Record our PIR at boot for later */ + ps3_boot_pir = mfspr(SPR_PIR); + return (0); } @@ -189,7 +194,7 @@ ps3_smp_first_cpu(platform_t plat, struct cpuref *cpur { cpuref->cr_cpuid = 0; - cpuref->cr_hwref = cpuref->cr_cpuid; + cpuref->cr_hwref = ps3_boot_pir; return (0); } @@ -202,7 +207,7 @@ ps3_smp_next_cpu(platform_t plat, struct cpuref *cpure return (ENOENT); cpuref->cr_cpuid++; - cpuref->cr_hwref = cpuref->cr_cpuid; + cpuref->cr_hwref = !ps3_boot_pir; return (0); } @@ -212,7 +217,7 @@ ps3_smp_get_bsp(platform_t plat, struct cpuref *cpuref { cpuref->cr_cpuid = 0; - cpuref->cr_hwref = cpuref->cr_cpuid; + cpuref->cr_hwref = ps3_boot_pir; return (0); } @@ -220,21 +225,21 @@ ps3_smp_get_bsp(platform_t plat, struct cpuref *cpuref static int ps3_smp_start_cpu(platform_t plat, struct pcpu *pc) { - /* loader(8) is spinning on 0x40 == 0 right now */ - uint32_t *secondary_spin_sem = (uint32_t *)(0x40); + /* kernel is spinning on 0x40 == -1 right now */ + volatile uint32_t *secondary_spin_sem = (uint32_t *)(0x40); + int remote_pir = pc->pc_hwref; int timeout; - if (pc->pc_hwref != 1) - return (ENXIO); - ap_pcpu = pc; - *secondary_spin_sem = 1; - powerpc_sync(); - DELAY(1); + /* Try both PIR values, looping a few times: the HV likes moving us */ timeout = 10000; - while (!pc->pc_awake && timeout--) + while (!pc->pc_awake && timeout--) { + *secondary_spin_sem = remote_pir; + powerpc_sync(); DELAY(100); + remote_pir = !remote_pir; + } return ((pc->pc_awake) ? 0 : EBUSY); } From owner-svn-src-all@freebsd.org Sat Dec 30 20:25:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0FB0EAAC32; Sat, 30 Dec 2017 20:25:34 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9BA426B2E3; Sat, 30 Dec 2017 20:25:34 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBUKPXDE016326; Sat, 30 Dec 2017 20:25:33 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBUKPXlc016325; Sat, 30 Dec 2017 20:25:33 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201712302025.vBUKPXlc016325@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sat, 30 Dec 2017 20:25:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327389 - head/sys/powerpc/ps3 X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: head/sys/powerpc/ps3 X-SVN-Commit-Revision: 327389 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 20:25:34 -0000 Author: nwhitehorn Date: Sat Dec 30 20:25:33 2017 New Revision: 327389 URL: https://svnweb.freebsd.org/changeset/base/327389 Log: Remove logic for early console with loader.ps3 now that loader.ps3 is dead. Modified: head/sys/powerpc/ps3/mmu_ps3.c Modified: head/sys/powerpc/ps3/mmu_ps3.c ============================================================================== --- head/sys/powerpc/ps3/mmu_ps3.c Sat Dec 30 20:24:33 2017 (r327388) +++ head/sys/powerpc/ps3/mmu_ps3.c Sat Dec 30 20:25:33 2017 (r327389) @@ -100,12 +100,18 @@ mps3_bootstrap(mmu_t mmup, vm_offset_t kernelstart, vm moea64_early_bootstrap(mmup, kernelstart, kernelend); + /* In case we had a page table already */ + lv1_destruct_virtual_address_space(0); + + /* Allocate new hardware page table */ lv1_construct_virtual_address_space( 20 /* log_2(moea64_pteg_count) */, 2 /* n page sizes */, (24UL << 56) | (16UL << 48) /* page sizes 16 MB + 64 KB */, &mps3_vas_id, &final_pteg_count ); + lv1_select_virtual_address_space(mps3_vas_id); + moea64_pteg_count = final_pteg_count / sizeof(struct lpteg); moea64_mid_bootstrap(mmup, kernelstart, kernelend); @@ -122,14 +128,9 @@ mps3_cpu_bootstrap(mmu_t mmup, int ap) mtmsr(mfmsr() & ~PSL_DR & ~PSL_IR); /* - * Destroy the loader's address space if we are coming up for - * the first time, and redo the FB mapping so we can continue - * having a console. + * Select the page table we configured above and set up the FB mapping + * so we can have a console. */ - - if (!ap) - lv1_destruct_virtual_address_space(0); - lv1_select_virtual_address_space(mps3_vas_id); if (!ap) From owner-svn-src-all@freebsd.org Sat Dec 30 20:27:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75DC6EAAE30; Sat, 30 Dec 2017 20:27:14 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B7D66B559; Sat, 30 Dec 2017 20:27:14 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBUKRDi6016419; Sat, 30 Dec 2017 20:27:13 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBUKRDEv016418; Sat, 30 Dec 2017 20:27:13 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201712302027.vBUKRDEv016418@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sat, 30 Dec 2017 20:27:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327390 - head/stand/powerpc/ps3 X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: head/stand/powerpc/ps3 X-SVN-Commit-Revision: 327390 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 20:27:14 -0000 Author: nwhitehorn Date: Sat Dec 30 20:27:13 2017 New Revision: 327390 URL: https://svnweb.freebsd.org/changeset/base/327390 Log: Garbage-collect loader.ps3. It is currently disconnected from the build and is superseded by either direct loading of the kernel by petitboot (soon to become the installer default) or loader.kboot. Deleted: head/stand/powerpc/ps3/ From owner-svn-src-all@freebsd.org Sat Dec 30 20:28:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 234ECEAAF55; Sat, 30 Dec 2017 20:28:31 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E1D916B6D8; Sat, 30 Dec 2017 20:28:30 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBUKST3s016505; Sat, 30 Dec 2017 20:28:29 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBUKST12016504; Sat, 30 Dec 2017 20:28:29 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201712302028.vBUKST12016504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sat, 30 Dec 2017 20:28:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327391 - head/sys/dev/ofw X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: head/sys/dev/ofw X-SVN-Commit-Revision: 327391 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 20:28:31 -0000 Author: nwhitehorn Date: Sat Dec 30 20:28:29 2017 New Revision: 327391 URL: https://svnweb.freebsd.org/changeset/base/327391 Log: Avoid use of the fdt_get_property_*() API, which is intrinsically incompatible with FDT versions < 16. This also simplifies the code a bit. MFC after: 1 month Modified: head/sys/dev/ofw/ofw_fdt.c Modified: head/sys/dev/ofw/ofw_fdt.c ============================================================================== --- head/sys/dev/ofw/ofw_fdt.c Sat Dec 30 20:27:13 2017 (r327390) +++ head/sys/dev/ofw/ofw_fdt.c Sat Dec 30 20:28:29 2017 (r327391) @@ -248,7 +248,7 @@ ofw_fdt_instance_to_package(ofw_t ofw, ihandle_t insta static ssize_t ofw_fdt_getproplen(ofw_t ofw, phandle_t package, const char *propname) { - const struct fdt_property *prop; + const void *prop; int offset, len; offset = fdt_phandle_offset(package); @@ -256,7 +256,7 @@ ofw_fdt_getproplen(ofw_t ofw, phandle_t package, const return (-1); len = -1; - prop = fdt_get_property(fdtp, offset, propname, &len); + prop = fdt_getprop(fdtp, offset, propname, &len); if (prop == NULL && strcmp(propname, "name") == 0) { /* Emulate the 'name' property */ @@ -333,7 +333,7 @@ static int ofw_fdt_nextprop(ofw_t ofw, phandle_t package, const char *previous, char *buf, size_t size) { - const struct fdt_property *prop; + const void *prop; const char *name; int offset; @@ -348,7 +348,7 @@ ofw_fdt_nextprop(ofw_t ofw, phandle_t package, const c if (previous != NULL) { while (offset >= 0) { - prop = fdt_get_property_by_offset(fdtp, offset, NULL); + prop = fdt_getprop_by_offset(fdtp, offset, &name, NULL); if (prop == NULL) return (-1); /* Internal error */ @@ -357,17 +357,16 @@ ofw_fdt_nextprop(ofw_t ofw, phandle_t package, const c return (0); /* No more properties */ /* Check if the last one was the one we wanted */ - name = fdt_string(fdtp, fdt32_to_cpu(prop->nameoff)); if (strcmp(name, previous) == 0) break; } } - prop = fdt_get_property_by_offset(fdtp, offset, &offset); + prop = fdt_getprop_by_offset(fdtp, offset, &name, &offset); if (prop == NULL) return (-1); /* Internal error */ - strncpy(buf, fdt_string(fdtp, fdt32_to_cpu(prop->nameoff)), size); + strncpy(buf, name, size); return (1); } From owner-svn-src-all@freebsd.org Sat Dec 30 20:46:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 944D3EABA52 for ; Sat, 30 Dec 2017 20:46:27 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic302-18.consmr.mail.bf2.yahoo.com (sonic302-18.consmr.mail.bf2.yahoo.com [74.6.135.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B8D46C1C9 for ; Sat, 30 Dec 2017 20:46:26 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1514666779; bh=3vQ3zUfA2UTSnR3zwKgHxK/qGRRlj0fOEU0/NLED56g=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject; b=AvcpEpUt0CmULJYBrFSHlOqNivRh6oSLmvnKXG1NlQlSNNabd7O6cIMirhQFqvQZJLwVq3WH+H3SUzxAJA3A9msFPlRTf3IHmrv+DOdfj1UMI6ECs2C6qP8rcfQHvtuvgvw9Q5z2USiIUpMwNzGLVJC4DJyDJcjheep3qHX05NM9gIBg8G8a7Uo1mS84Jq/OUQvTjJCVdSLyrSnIxidWMM3BVTg5/HFPko/hZv2zR259aSw5h4bqdrilD0ap4e9U/o75wXDXGY+nJfihseIC2FlPje56EoPwG889usaW8hQQz9iZScsn7GdW21RsWXc7kJGIyEevfZr+APr/U1Gg1A== X-YMail-OSG: nB5Ih80VM1kuyAQMkUPfkrFn2GCxQfECAluWg5sRXgdXOOJV2aFyh1QhC90BzMr COdHmwAiU4tlfyRM6dfSTbRQZdw7xBhKpy9KeQG4rZHZ2.j_eq89ztHpRtDmgrbWQEvmgZOQMY.H clcTjvPTXxtLVQTPT_Us5lCRBDPGOUKur8xixF6IBa6Ps9mVdxEqvYUzF6OjIPnTr3qLScBhdNa1 FL3D1SOlOXiO86dxFrVHgeBo1P..C.XwVn.J0BJvYY8JxZRZ7UWUparbumILfG0eD7BT_x6A_kw8 aUpaIwse7ciOLK0TxQZh5a0nfudDE4_qoBRuJmA7HOCzEqYY5CeSAbrVbB8S3qiNle3PGZECmxrm GW8PzJNIr96.Upzcg89c8Zn7uuoMQfWTgPz5bR03M67I.lw1VQnw2GrPMmvnOB2IoGK79ZILUTED DkoePwpc2Z5QtB1.5xh2sigrkALUiVWWBmqaHM.2qL0iRcBf2WEX349djCoGhFpQL0YGgsrlf Received: from sonic.gate.mail.ne1.yahoo.com by sonic302.consmr.mail.bf2.yahoo.com with HTTP; Sat, 30 Dec 2017 20:46:19 +0000 Received: from smtpgate101.mail.bf1.yahoo.com (EHLO [192.168.0.6]) ([72.30.28.45]) by smtp402.mail.bf1.yahoo.com (JAMES SMTP Server ) with ESMTPA ID cf3843be2eb0a67d8fe74efa64c853b8; Sat, 30 Dec 2017 20:46:19 +0000 (UTC) Subject: Re: svn commit: r327384 - head/sys/dev/ep To: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201712301927.vBUJRMLk090504@repo.freebsd.org> From: Pedro Giffuni Organization: FreeBSD Project Message-ID: <37c6dd5a-ef90-4c62-9139-35df00cd05fc@FreeBSD.org> Date: Sat, 30 Dec 2017 15:46:17 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <201712301927.vBUJRMLk090504@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 20:46:27 -0000 Oops ... On 30/12/2017 14:27, Cy Schubert wrote: > Author: cy > Date: Sat Dec 30 19:27:22 2017 > New Revision: 327384 > URL: https://svnweb.freebsd.org/changeset/base/327384 > > Log: > Fix r327383: > > .../sys/dev/ep/elink.c:31:1: error: '/*' within block comment > [-Werror,-Wcomment] > /* $NetBSD: elink.c,v 1.6 1995/01/07 21:37:54 mycroft Exp $ > ^ > > Modified: > head/sys/dev/ep/elink.c > > Modified: head/sys/dev/ep/elink.c > ============================================================================== > --- head/sys/dev/ep/elink.c Sat Dec 30 15:13:33 2017 (r327383) > +++ head/sys/dev/ep/elink.c Sat Dec 30 19:27:22 2017 (r327384) > @@ -28,7 +28,7 @@ > * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF > * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > * > -/* $NetBSD: elink.c,v 1.6 1995/01/07 21:37:54 mycroft Exp $ > + * $NetBSD: elink.c,v 1.6 1995/01/07 21:37:54 mycroft Exp $ > */ Thanks, the change was too simple and I didn't bother to test it. Preparing for a a new year with the pointyhat on ;). Pedro. From owner-svn-src-all@freebsd.org Sat Dec 30 20:55:11 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B86FEAC2EC; Sat, 30 Dec 2017 20:55:11 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 063ED6CA17; Sat, 30 Dec 2017 20:55:10 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with ESMTPA id VO9leaOU5Yy1iVO9meF5LT; Sat, 30 Dec 2017 13:55:03 -0700 X-Authority-Analysis: v=2.2 cv=f8g4PK6M c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=ocR9PWop10UA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=3OSu72LSDQTSpnBPLuoA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 513FE134; Sat, 30 Dec 2017 12:55:01 -0800 (PST) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id vBUKt0bh065953; Sat, 30 Dec 2017 12:55:00 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id vBUKt0G2065834; Sat, 30 Dec 2017 12:55:00 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201712302055.vBUKt0G2065834@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Pedro Giffuni cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327384 - head/sys/dev/ep In-Reply-To: Message from Pedro Giffuni of "Sat, 30 Dec 2017 15:46:17 -0500." <37c6dd5a-ef90-4c62-9139-35df00cd05fc@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 30 Dec 2017 12:54:59 -0800 X-CMAE-Envelope: MS4wfHynOXXwzq2KiGX/hJpJi++xDMnjsCCiXxTa8YO2DNQYfr4LBfPsdBojJwiVXLcsFdXGeP1rj/lKZyHrlOAWUX3fT/8gZpMio56iXMe0JsXe/HMS70GR 8+vTfsM84pn2syvFlXHKxfYg+nL0l2aIv7+NnaBWHc/ysMiL759bO8qjJ3Skg8GpjnpOhFVAfZJcSxhdo+oefS9JG3WW2fYecYrob2nRaLDFqazugBM6zzks /4YLW/0X18iu46INFZoA2NZeaO8VqbDQZF1+MhVQm2Lc4L6ASVwid+UR0PmzILvfQfMyxggogJbqu/xOg1N7LMQ8YXoB0uNLMj6kgT5GEAM= X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 20:55:11 -0000 In message <37c6dd5a-ef90-4c62-9139-35df00cd05fc@FreeBSD.org>, Pedro Giffuni wr ites: > Oops ... > > > On 30/12/2017 14:27, Cy Schubert wrote: > > Author: cy > > Date: Sat Dec 30 19:27:22 2017 > > New Revision: 327384 > > URL: https://svnweb.freebsd.org/changeset/base/327384 > > > > Log: > > Fix r327383: > > > > .../sys/dev/ep/elink.c:31:1: error: '/*' within block comment > > [-Werror,-Wcomment] > > /* $NetBSD: elink.c,v 1.6 1995/01/07 21:37:54 mycroft Exp $ > > ^ > > > > Modified: > > head/sys/dev/ep/elink.c > > > > Modified: head/sys/dev/ep/elink.c > > =========================================================================== > === > > --- head/sys/dev/ep/elink.c Sat Dec 30 15:13:33 2017 (r327383) > > +++ head/sys/dev/ep/elink.c Sat Dec 30 19:27:22 2017 (r327384) > > @@ -28,7 +28,7 @@ > > * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE > OF > > * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > > * > > -/* $NetBSD: elink.c,v 1.6 1995/01/07 21:37:54 mycroft Exp $ > > + * $NetBSD: elink.c,v 1.6 1995/01/07 21:37:54 mycroft Exp $ > > */ > > Thanks, the change was too simple and I didn't bother to test it. > > Preparing for a a new year with the pointyhat on ;). No problem. Been there done that too. ;) -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Sat Dec 30 20:56:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D72A1EAC43F; Sat, 30 Dec 2017 20:56:30 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B52476CB8A; Sat, 30 Dec 2017 20:56:30 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id vBUKuRp4077620; Sat, 30 Dec 2017 12:56:27 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id vBUKuR5L077619; Sat, 30 Dec 2017 12:56:27 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201712302056.vBUKuR5L077619@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r327379 - head/sys/isa In-Reply-To: To: Warner Losh Date: Sat, 30 Dec 2017 12:56:27 -0800 (PST) CC: "Rodney W. Grimes" , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 20:56:30 -0000 > On Sat, Dec 30, 2017 at 10:09 AM, Rodney W. Grimes < > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > [ Charset UTF-8 unsupported, converting... ] > > > On Sat, Dec 30, 2017 at 8:27 AM, Rodney W. Grimes < > > > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > > > > [ Charset UTF-8 unsupported, converting... ] > > > > > Author: imp > > > > > Date: Sat Dec 30 08:16:31 2017 > > > > > New Revision: 327379 > > > > > URL: https://svnweb.freebsd.org/changeset/base/327379 > > > > > > > > > > Log: > > > > > On further testing on actual machines with this hardware, we should > > > > > only warn for devices that are attached. Add missing \n. > > > > > > > > > > Modified: > > > > > head/sys/isa/isa_common.c > > > > > > > > > > Modified: head/sys/isa/isa_common.c > > > > > ============================================================ > > > > ================== > > > > > --- head/sys/isa/isa_common.c Sat Dec 30 07:59:32 2017 > > (r327378) > > > > > +++ head/sys/isa/isa_common.c Sat Dec 30 08:16:31 2017 > > (r327379) > > > > > @@ -573,9 +573,10 @@ isa_probe_children(device_t dev) > > > > > > > > > > err = device_probe_and_attach(child); > > > > > if (err == 0 && idev->id_vendorid == 0 && > > > > > - strcmp(kern_ident, "GENERIC") == 0) > > > > > + strcmp(kern_ident, "GENERIC") == 0 && > > > > > + device_is_attached(child)) > > > > > device_printf(child, > > > > > - "non-PNP ISA device will be removed from > > > > GENERIC in FreeBSD 12."); > > > > > + "non-PNP ISA device will be removed from > > > > GENERIC in FreeBSD 12.\n"); > > > > > > > > Hat: RE > > > > > > > > Do you plan to give this notice in 11.x? (Technically a bit late, > > > > it should of been in 11.0). > > > > > > > > > > Yes. It will be MFC'd soon. Of course it should have happened in 11.0, > > but > > > it didn't. But this notice is just about things in GENERIC. Not their > > > actual removal (though most of them will be removed). The notice is here > > > because GENERIC is going to be cut to the bone once the PNP stuff I'm > > > working on makes it viable to have all drivers (well, most) kld loaded. > > The > > > only ones that will affect users, though, are the ones that are for > > hinted > > > devices which will have no autoloading. Hence this warning. > > > > Thanks for claifying. > > > > > > > > > As giving it in 12.0 wont happen if you remove it in 12. Ie, as you > > > > have stated you want to remove this before we branch 12.0, if you do > > > > that this notice well never be seen by the users. Or well, they might > > > > get the notice, but the drivers well have already been removed. > > > > > > > > Or do you want to give notice in 12.* that it is being removed in 13.0. > > > > And that is not supporting these for 10 years, as 12.x should be EOL > > > > in a bit over 5 years from now if we cut in early 2018 which I believe > > > > to be the current target. > > > > > > > > > > No. All non-PNP ISA devices will be removed from GENERIC in 12. That is, > > if > > > they are still in the tree. A number will simply be gone, however. I'll > > be > > > putting warnings in those drivers soon. It would have been ideal had we > > > done so earlier, but we didn't. Simple lack of notice, however, isn't > > going > > > to keep things in the tree. The following drivers will be removed in 12: > > > aha, adv, adw, bt, aic, ct, dpt, ncv, nsp, stg, mse, joy, cm and likely > > cx > > > and rx. arcnet too will be removed. Still need to check on dangling > > > references old TTY code as well that hasn't built in FreeBSD 8. This list > > > has circulated before, and I'll be codifying a run-time warning into all > > > these drivers on attach, plus getting a head-start on what to remove in > > 13. > > > > Many of those listed devices, though they have an ISA device, they also > > support pci variants. I didnt check all of them, but I know from usage > > that the bt and dpt drivers support PCI pnp cards just fine. > > So is this more than just ISA axeing? > > > adv, adw, bt, ncv and stg did have PCI variants. They are all old parallel ^^^ do? > scsi cards that are no longer relevant. All but adw only supported SCSI 1 > speeds and an 8-bit width. adw did support wide SCSI (aka 16-bit), but it's > still a fairly low-level device, but was an unpopular card back in the day. Um, this is what bothers me when this stuff comes up, claims that are simply false are often made: Adapter Bus Commands Description BT-948 PCI 192 Ultra SCSI-3 BT-958 PCI 192 Wide Ultra SCSI-3 BT-958D PCI 192 Wide Differential Ultra SCSI-3 I am almost certain that the dpt family also has similiar capabitlites. > > This was the list that jhb circulated about a year ago. I'm just trying to > formalize it in case something that's on it that shouldn't be. I am fine with axeing the ISA portions of these drivers, but for at least the bt and dpt famility I believe that the PCI pnp driver should continue to live. > > > FreeBSD has grown large. While you can still boot it on that old 32MB > > > machine, you really want 128MB or more to do anything useful. You need at > > > least 2GB or a heck of a lot of swap to self-host. We should simply be > > > removing the really old stuff that wouldn't be on a machine that size. > > > Expect more announcements like this to be coming soon from the people > > that > > > have been taking are of and feeding this old stuff for too long. If we > > cut > > > with the 128MB criteria, the list would be much, much longer, and the > > cuts > > > much deeper. > > > > I have a large pile of VM's running in 64MB, and only have to bump to 128MB > > when I load a GENERIC, which that only became an issue with 11.x. These > > 64MB vm's are running with out swap and 12MB of free memory. > > > > We get really fun failures trying to boot GENERIC on a 12 snapshot with > > even 128MB due to the WITNESS/DEBUG bloat. > > > > And a bazillion drivers you don't need taking up 20MB in GENERIC! Yes, I really do like your devmatch thing that allows us to remove many of these from GENERIC and just load them. And I think more is loadable than some realize. Technically since loader can load a device driver and a filesystem that code doesnt need to be there either. As a case in point the default ZFS install does not have ZFS in the kernel, it is loaded at boot time. The same -could- be done with UFS. > PLEASE again, do not dismiss "32MB" as old machines, this is a VERY real > > and ideal situation for those deploying mass VM instances. > > > 32MB is a very different experience than 64MB. Even with a kernel that's > stripped to the bone, you're doing good to have 18MB free in single user > and I've not been able to make it to a login prompt yet.... But a VM is > quite different than actual hardware.... Please don't get the two confused. -r-xr-xr-x 1 root wheel 6148944 Nov 10 02:01 /boot/kernel/kernel # uname -a FreeBSD ns1.rh.CN85.dnsmgr.net 11.0-RELEASE-p1 FreeBSD 11.0-RELEASE-p1 #0: Fri Nov 10 02:01:56 UTC 2017 root@bld-11.0-p1-i386.dnsmgr.net:/A/src/sys/i386/compile/CUSTOMVB i386 And this is just stripped, not stripped to the bone. Hypervisor: Origin = "bhyve bhyve " real memory = 67108864 (64 MB) avail memory = 55230464 (52 MB) Event timer "LAPIC" quality 600 And up multiuser it still has 15MB of free memory, let me boot single user.... Mem: 1156K Active, 2948K Inact, 6964K Wired, 530K Buf, 43M Free So, um, 64 - 43M == 21MB need to come up with that kernel single user, mount ufs file systems, and exec top. > Warner -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat Dec 30 21:02:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B14DEAC919 for ; Sat, 30 Dec 2017 21:02:47 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic302-18.consmr.mail.bf2.yahoo.com (sonic302-18.consmr.mail.bf2.yahoo.com [74.6.135.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 222676D0F5 for ; Sat, 30 Dec 2017 21:02:46 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1514667765; bh=sP0pjNPDXPnVgAl4YPQBIzNHLdah/JYlHe4MbWmTeFI=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject; b=M7DM3tZSEU3JfaAN2zGoFuemxL5zFzEyYd203OzPOc6miVqn9n+JFyEl7gyev6XQ+DOivC+WVPZ/q6Pkm0+6yS7vAeAxuV0jO/8NkU1jctzartOY3iEBkrZTznUPsIDbtFhs+iAMhxSQqs06r3hgwi7Vhv8bYi2SgwNnPWJf7JWtckzY9KMR8HJa4zEYOYw6XnCm6DOxHkwTHPRgAlrzMtjN8ExYvYpTiV8SaMo5qtKuO3YcLPW1F07fIYOMIwMunKXv8qhX1QI3WJaTLx5RP/8PvjZaudAHH+uogaXMvyukhhuiURe41GHgueYqu2YtK3WeC+vaIAtB55TkXsa2UA== X-YMail-OSG: WpsnCk0VM1mWML.M6918jENEAC88JZvgYTc4GMnBw7duXwPe5FlpAw.MEhSHZnm 3q_.VwScxTIEAjt8HGz.eTiKRADLuWlV1zCbfM.Fgo0Z1CqkrTmK27zYV6MI3vuvGu6X0TuB43F3 yZBj0VZDdsQeybBFa9Et2Ip7Cwk6HQxXHnB163.v5eIr.p2vIyiyyVqGzIT3Ns3NTCh58l06L2H9 1WsF8th4geb4L1oExfIStLP75DhsLBSmbMbehp6XeVxv9wjDPZtZo0eAzC5FJkbE94QvbF.tTdeK cs4buzDPuA5udE3wHSpXnsIdU8TkByigr3AImKdpgurSlbYbTYM5_v_O8GlOxGpSTT3wonUPcRf. _Tj75TyQxQ9MWXM33H0iUu_pS2y5B1p30WimJIsWzILP6p5PACRsio32_IpaueT4w907zK7GOaTj uktPH8F8flEt6C9ZJ0l7cmgT6dQCBlnOtCnDpo2x0rMxWOdZm9x96i3ufinMYTCgowCqinMpl Received: from sonic.gate.mail.ne1.yahoo.com by sonic302.consmr.mail.bf2.yahoo.com with HTTP; Sat, 30 Dec 2017 21:02:45 +0000 Received: from smtp106.rhel.mail.bf1.yahoo.com (EHLO [192.168.0.6]) ([98.139.231.40]) by smtp412.mail.bf1.yahoo.com (JAMES SMTP Server ) with ESMTPA ID d125e02be41f05ad3de6d562475ba2c0; Sat, 30 Dec 2017 21:02:41 +0000 (UTC) Subject: Re: svn commit: r327381 - in head/sys: conf dev/ep i386/isa modules modules/elink modules/ep To: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201712301142.vBUBgnXl095227@repo.freebsd.org> From: Pedro Giffuni Organization: FreeBSD Project Message-ID: Date: Sat, 30 Dec 2017 16:02:39 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <201712301142.vBUBgnXl095227@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 21:02:47 -0000 Hi; On 30/12/2017 06:42, Konstantin Belousov wrote: > Author: kib > Date: Sat Dec 30 11:42:49 2017 > New Revision: 327381 > URL: https://svnweb.freebsd.org/changeset/base/327381 > > Log: > Move i386/isa/elink.[hc] to dev/ep. > > The ep(4) driver is the only consumer of the two functions from > elink.c. I removed the standalone module as well, and most likely, > the module metadata is not needed anywhere, but this is for later > cleanup. > > Discussed with: imp, jhb > Sponsored by: The FreeBSD Foundation For the record, I find this change very cool. It makes the code more modular and the license for those two files also matches the license in the ep driver. Thanks! Pedro. From owner-svn-src-all@freebsd.org Sat Dec 30 21:14:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DEB36EAD21A; Sat, 30 Dec 2017 21:14:37 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5BFE66DB16; Sat, 30 Dec 2017 21:14:37 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id vBULESjT041190 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 30 Dec 2017 23:14:32 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua vBULESjT041190 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id vBULESRi041189; Sat, 30 Dec 2017 23:14:28 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 30 Dec 2017 23:14:28 +0200 From: Konstantin Belousov To: Pedro Giffuni Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327381 - in head/sys: conf dev/ep i386/isa modules modules/elink modules/ep Message-ID: <20171230211428.GU1684@kib.kiev.ua> References: <201712301142.vBUBgnXl095227@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 21:14:38 -0000 On Sat, Dec 30, 2017 at 04:02:39PM -0500, Pedro Giffuni wrote: > Hi; > > On 30/12/2017 06:42, Konstantin Belousov wrote: > > Author: kib > > Date: Sat Dec 30 11:42:49 2017 > > New Revision: 327381 > > URL: https://svnweb.freebsd.org/changeset/base/327381 > > > > Log: > > Move i386/isa/elink.[hc] to dev/ep. > > > > The ep(4) driver is the only consumer of the two functions from > > elink.c. I removed the standalone module as well, and most likely, > > the module metadata is not needed anywhere, but this is for later > > cleanup. > > > > Discussed with: imp, jhb > > Sponsored by: The FreeBSD Foundation > For the record, I find this change very cool. > > It makes the code more modular and the license for those two files also > matches the license in the ep driver. The idea of this change and r327380 is to clean up i386/isa. There are three more files to go. From owner-svn-src-all@freebsd.org Sat Dec 30 21:27:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11E3FEAD934 for ; Sat, 30 Dec 2017 21:27:43 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22b.google.com (mail-io0-x22b.google.com [IPv6:2607:f8b0:4001:c06::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C7F4B6E48B for ; Sat, 30 Dec 2017 21:27:42 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22b.google.com with SMTP id 14so37615001iou.2 for ; Sat, 30 Dec 2017 13:27:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=UsEauzpnF0xTbyTQmFmA3cve/0Nfa/HUrBhmQjSAj0Q=; b=YgEuoi71SqdeMh9zwF3/klGGgJQ8tpngYc18Cqt8tlepl5+dBUhbBGnBJra73nOuLm sMjDm+TY+b86SNwu5o/sNBJ/8c3eTco/vTlpagyti+NqsFn9MPnNbo01qWaH14Qx6rJW bxVD/HuYxVReA0W5woJdBm0TLoVEp/QYqMqYmenRxOuuebE9Oug1o5ZWEqUVVzHKlilG +Q1VkoPxe/ZGrflr0IF/V14/8ekQyqO8eyD6ERtVXVfo6T3fCC40TnH9yd/OZ/OUr0Jl 1hE2z5ZtkjM4KEskmQ9ism0w+aBhlU+wxApIWg7x3P8VcaDovP0tZDgus5negUO/AHxu 8fRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=UsEauzpnF0xTbyTQmFmA3cve/0Nfa/HUrBhmQjSAj0Q=; b=N8wwRAQP+xaNEC2J5ZK2HB7SS+QbuG6rttMezWSzM3Xu96CvAjtze+81o+npcfFzzh 2U0rOsQhybueAqH5WYmr/Wr/lSIKJhbIK8WbHhLwOYZGVIrRq2kv0ZVJvohI6/JQuKak KZYoZ/km26y597vZ+M6Aj/+SBpXNLCai4kNYJHh/cBkZ+kEPHyTVfni0MdsJHhLmKPDf H0KLdwB9BeJy6TVdgkkP1QWuedQfYT6kynpUCTaO4/LDWwqV/FbHI+qzJ+TP8nrq5t0S 5Z9qhdcf7rSgWVlFBhjKdxsfvbimhIa8SHxmc4YE7S8Ttk38T63oViEdIMEKZFWw2JNu ZveQ== X-Gm-Message-State: AKGB3mJx+1P1sLww58iNIa/yMbkQLT/eKs7Sy8z9a++e8l7CrKTsketR /u3I40YyvtRGoYd/XvBrtMaYnkFrMVbC+UWYfSLtaw== X-Google-Smtp-Source: ACJfBov4nlghbxV+5A44eV74oO2LLYDp+9T2LVr7/vl0I6u4oCJiJbtYPHrPnkl/nItYTNrc2kBP+/BYXmZYS04OyXI= X-Received: by 10.107.175.234 with SMTP id p103mr22569621ioo.63.1514669261955; Sat, 30 Dec 2017 13:27:41 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.108.204 with HTTP; Sat, 30 Dec 2017 13:27:41 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <201712302056.vBUKuR5L077619@pdx.rh.CN85.dnsmgr.net> References: <201712302056.vBUKuR5L077619@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Sat, 30 Dec 2017 14:27:41 -0700 X-Google-Sender-Auth: 7a3YxOxH62yirBAiDMREwXFs2t4 Message-ID: Subject: Re: svn commit: r327379 - head/sys/isa To: "Rodney W. Grimes" Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 21:27:43 -0000 On Sat, Dec 30, 2017 at 1:56 PM, Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > On Sat, Dec 30, 2017 at 10:09 AM, Rodney W. Grimes < > > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > > [ Charset UTF-8 unsupported, converting... ] > > > > On Sat, Dec 30, 2017 at 8:27 AM, Rodney W. Grimes < > > > > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > > > > > > [ Charset UTF-8 unsupported, converting... ] > > > > > > Author: imp > > > > > > Date: Sat Dec 30 08:16:31 2017 > > > > > > New Revision: 327379 > > > > > > URL: https://svnweb.freebsd.org/changeset/base/327379 > > > > > > > > > > > > Log: > > > > > > On further testing on actual machines with this hardware, we > should > > > > > > only warn for devices that are attached. Add missing \n. > > > > > > > > > > > > Modified: > > > > > > head/sys/isa/isa_common.c > > > > > > > > > > > > Modified: head/sys/isa/isa_common.c > > > > > > ============================================================ > > > > > ================== > > > > > > --- head/sys/isa/isa_common.c Sat Dec 30 07:59:32 2017 > > > (r327378) > > > > > > +++ head/sys/isa/isa_common.c Sat Dec 30 08:16:31 2017 > > > (r327379) > > > > > > @@ -573,9 +573,10 @@ isa_probe_children(device_t dev) > > > > > > > > > > > > err = device_probe_and_attach(child); > > > > > > if (err == 0 && idev->id_vendorid == 0 && > > > > > > - strcmp(kern_ident, "GENERIC") == 0) > > > > > > + strcmp(kern_ident, "GENERIC") == 0 && > > > > > > + device_is_attached(child)) > > > > > > device_printf(child, > > > > > > - "non-PNP ISA device will be removed > from > > > > > GENERIC in FreeBSD 12."); > > > > > > + "non-PNP ISA device will be removed > from > > > > > GENERIC in FreeBSD 12.\n"); > > > > > > > > > > Hat: RE > > > > > > > > > > Do you plan to give this notice in 11.x? (Technically a bit late, > > > > > it should of been in 11.0). > > > > > > > > > > > > > Yes. It will be MFC'd soon. Of course it should have happened in > 11.0, > > > but > > > > it didn't. But this notice is just about things in GENERIC. Not their > > > > actual removal (though most of them will be removed). The notice is > here > > > > because GENERIC is going to be cut to the bone once the PNP stuff I'm > > > > working on makes it viable to have all drivers (well, most) kld > loaded. > > > The > > > > only ones that will affect users, though, are the ones that are for > > > hinted > > > > devices which will have no autoloading. Hence this warning. > > > > > > Thanks for claifying. > > > > > > > > > > > > As giving it in 12.0 wont happen if you remove it in 12. Ie, as > you > > > > > have stated you want to remove this before we branch 12.0, if you > do > > > > > that this notice well never be seen by the users. Or well, they > might > > > > > get the notice, but the drivers well have already been removed. > > > > > > > > > > Or do you want to give notice in 12.* that it is being removed in > 13.0. > > > > > And that is not supporting these for 10 years, as 12.x should be > EOL > > > > > in a bit over 5 years from now if we cut in early 2018 which I > believe > > > > > to be the current target. > > > > > > > > > > > > > No. All non-PNP ISA devices will be removed from GENERIC in 12. That > is, > > > if > > > > they are still in the tree. A number will simply be gone, however. > I'll > > > be > > > > putting warnings in those drivers soon. It would have been ideal had > we > > > > done so earlier, but we didn't. Simple lack of notice, however, isn't > > > going > > > > to keep things in the tree. The following drivers will be removed in > 12: > > > > aha, adv, adw, bt, aic, ct, dpt, ncv, nsp, stg, mse, joy, cm and > likely > > > cx > > > > and rx. arcnet too will be removed. Still need to check on dangling > > > > references old TTY code as well that hasn't built in FreeBSD 8. This > list > > > > has circulated before, and I'll be codifying a run-time warning into > all > > > > these drivers on attach, plus getting a head-start on what to remove > in > > > 13. > > > > > > Many of those listed devices, though they have an ISA device, they also > > > support pci variants. I didnt check all of them, but I know from usage > > > that the bt and dpt drivers support PCI pnp cards just fine. > > > So is this more than just ISA axeing? > > > > > > adv, adw, bt, ncv and stg did have PCI variants. They are all old > parallel > ^^^ do? > > > scsi cards that are no longer relevant. All but adw only supported SCSI 1 > > speeds and an 8-bit width. adw did support wide SCSI (aka 16-bit), but > it's > > still a fairly low-level device, but was an unpopular card back in the > day. > > Um, this is what bothers me when this stuff comes up, claims that are > simply false are often made: > Adapter Bus Commands Description > BT-948 PCI 192 Ultra SCSI-3 > BT-958 PCI 192 Wide Ultra SCSI-3 > BT-958D PCI 192 Wide Differential Ultra SCSI-3 > > I am almost certain that the dpt family also has similiar > capabitlites. I stand corrected. I know I cloned the buslogic driver to make the aha driver, which is definitely isa only. I just wonder how many of these units we have actually deployed still... > This was the list that jhb circulated about a year ago. I'm just trying to > > formalize it in case something that's on it that shouldn't be. > > I am fine with axeing the ISA portions of these drivers, but for at > least the bt and dpt famility I believe that the PCI pnp driver should > continue to live. Fair enough, I guess. I'll remove them from the list to make it go down more easily. > > FreeBSD has grown large. While you can still boot it on that old 32MB > > > > machine, you really want 128MB or more to do anything useful. You > need at > > > > least 2GB or a heck of a lot of swap to self-host. We should simply > be > > > > removing the really old stuff that wouldn't be on a machine that > size. > > > > Expect more announcements like this to be coming soon from the people > > > that > > > > have been taking are of and feeding this old stuff for too long. If > we > > > cut > > > > with the 128MB criteria, the list would be much, much longer, and the > > > cuts > > > > much deeper. > > > > > > I have a large pile of VM's running in 64MB, and only have to bump to > 128MB > > > when I load a GENERIC, which that only became an issue with 11.x. > These > > > 64MB vm's are running with out swap and 12MB of free memory. > > > > > > We get really fun failures trying to boot GENERIC on a 12 snapshot with > > > even 128MB due to the WITNESS/DEBUG bloat. > > > > > > > And a bazillion drivers you don't need taking up 20MB in GENERIC! > Yes, I really do like your devmatch thing that allows us to remove > many of these from GENERIC and just load them. And I think more is > loadable than some realize. Technically since loader can load a > device driver and a filesystem that code doesnt need to be there > either. As a case in point the default ZFS install does not have > ZFS in the kernel, it is loaded at boot time. The same -could- > be done with UFS. > > > PLEASE again, do not dismiss "32MB" as old machines, this is a VERY real > > > and ideal situation for those deploying mass VM instances. > > > > > > 32MB is a very different experience than 64MB. Even with a kernel that's > > stripped to the bone, you're doing good to have 18MB free in single user > > and I've not been able to make it to a login prompt yet.... But a VM is > > quite different than actual hardware.... Please don't get the two > confused. > > -r-xr-xr-x 1 root wheel 6148944 Nov 10 02:01 /boot/kernel/kernel > # uname -a > FreeBSD ns1.rh.CN85.dnsmgr.net 11.0-RELEASE-p1 FreeBSD 11.0-RELEASE-p1 > #0: Fri Nov 10 02:01:56 UTC 2017 root@bld-11.0-p1-i386.dnsmgr. > net:/A/src/sys/i386/compile/CUSTOMVB i386 > And this is just stripped, not stripped to the bone. > Right. I have similar (size says 5.6MB), and have 18MB free on my real P150 hardware with 32MB. > Hypervisor: Origin = "bhyve bhyve " > real memory = 67108864 (64 MB) > avail memory = 55230464 (52 MB) > Event timer "LAPIC" quality 600 > > And up multiuser it still has 15MB of free memory, let me boot single > user.... > So that's similar to what I'm seeing. But this is for a 64MB machine. 15 - 32 is a very small number. > Mem: 1156K Active, 2948K Inact, 6964K Wired, 530K Buf, 43M Free > > So, um, 64 - 43M == 21MB need to come up with that kernel single user, > mount ufs file systems, and exec top. > Right. Again, my point: 32M is possible with lots of work. 64MB is possible with some work. 128MB isn't too bad. 256MB is easy. Unless you want to self host, then you need 1-2GB or a boatload of swap and a lot of patience. When I say 128MB is a good 'minimum' I guess it's more a guideline. What machines, as in actual, physical hardware, are out there that can support at least 128MB of RAM. Now what machines don't. Is there a subset of those machines that we can easily trim from the system. Like certain older MIPS boards that can't do more than 32MB or 64MB. Or support for really old ISA cards that only made sense in systems that maxed out at 32MB or 64MB. Or some of the old armv4/5 hardware that can physically only address 64MB. I'm not saying we can't run in less than that, but that our target for 12 should generally be systems that support at least 128MB. For 13, we should double that again to 256MB (or maybe even 512MB): that would leave all the embedded 486 elan class out (since they maxed out at 128MB), would leave more armv4/5 boards out, if not all, more mips designs, etc. But that's not for another 2-3 years (hopefully not 5, that's too long between major releases). Again, when I say 128MB, I'm using it as a design parameter, not trying to take away your 64MB VMs, if they still work for you. I'm trying to narrow the scope of what we have in the base in recognition that support for that stuff buys us nothing, has a cost and is effectively maintainerless. Warner From owner-svn-src-all@freebsd.org Sat Dec 30 21:42:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C23BEEAE1A4 for ; Sat, 30 Dec 2017 21:42:29 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22f.google.com (mail-it0-x22f.google.com [IPv6:2607:f8b0:4001:c0b::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8839A6EE2E for ; Sat, 30 Dec 2017 21:42:29 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22f.google.com with SMTP id c16so9855451itc.5 for ; Sat, 30 Dec 2017 13:42:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=ZnUWSlBEV+cgTb83wpTLafvhPkg1vMXp17+v9QLN8Is=; b=Ke114vm4Fy8B6XY/UtZXls+V7NluiyZp0QLG5pjr/mwg/l4Q+3W0q7L5W5ZLRZpavr 6n6maXBiNhwqmyinXUYLjZ5ckCsXw1Pr69gUO4M/jWS4fpZ+Sgc7GF2MVMckkwcxKOo9 bRGWn3BAF6wj19a3mWrsJSwtaknPx2wYg+MVwbY8jwT0qenBXMihPqn3Hcy9a/IOHW4B Yqgvfe/yb2YENKjGVJsHmS9XCerRI14X6fZ25Tnc+eXAm34nxDbZij+b6hBcE4GxMvmK RdoQEyjdsWbWWuz0HvbXx2gN3kW2ASb9XWoRMAPrNPA5pj2h+aNabUsFYDBlWBXXDyRL Y9mA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=ZnUWSlBEV+cgTb83wpTLafvhPkg1vMXp17+v9QLN8Is=; b=WMIMb2+13AVdNUS2Dl+hwPZ/5CRO0pixv8l97mO0zQxjxuoCzPKKPpwxS0KklmM0n6 zgzXCO4f+AXCmiqB3VLMt7TmzTgFa8EiRUcF5s/ZvlkyfKCI6ZF76xhH8OyD+WtGVWLK AC+vkVwbAJ4HVA9kfLy/zXE60pgwQ4RkJCUPjBJc99COgC426qWg3ywVcrb71HA+bhWx /XbXyWM/vbZ+an4m+wv35wYs7sbaEpAy3XF3/27prBsjyEldYehSfmIkxGGpsSW9TqD6 zfK9CI3Vfja2G/mFNp7hEPmZ7qTMQAAy/u7itFt1Pr0F5SUh/0ayyxD2Y++PJDZOHx6E DnZg== X-Gm-Message-State: AKGB3mJLTFpzEfxhihmO7hy85qsltAh9otKKuF4FTt4PxoRoUGHF5DS1 crJJsdnJ7EMf6xvBVb9KsJKzDsbXstE+2sIXLB5/hw== X-Google-Smtp-Source: ACJfBovYqnkPfMU8O/IRjQVkYTD5WGGb2da/2IfAw2t6De1zBxI014zw4hBCUdaXOXlHVumAbIkZzp0v/9jzqVA9Fzw= X-Received: by 10.36.133.135 with SMTP id r129mr53905833itd.69.1514670148812; Sat, 30 Dec 2017 13:42:28 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.108.204 with HTTP; Sat, 30 Dec 2017 13:42:28 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <20171230211428.GU1684@kib.kiev.ua> References: <201712301142.vBUBgnXl095227@repo.freebsd.org> <20171230211428.GU1684@kib.kiev.ua> From: Warner Losh Date: Sat, 30 Dec 2017 14:42:28 -0700 X-Google-Sender-Auth: tdVvO2qampxYEy6KXjfDMDM2a10 Message-ID: Subject: Re: svn commit: r327381 - in head/sys: conf dev/ep i386/isa modules modules/elink modules/ep To: Konstantin Belousov Cc: Pedro Giffuni , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 21:42:29 -0000 On Sat, Dec 30, 2017 at 2:14 PM, Konstantin Belousov wrote: > On Sat, Dec 30, 2017 at 04:02:39PM -0500, Pedro Giffuni wrote: > > Hi; > > > > On 30/12/2017 06:42, Konstantin Belousov wrote: > > > Author: kib > > > Date: Sat Dec 30 11:42:49 2017 > > > New Revision: 327381 > > > URL: https://svnweb.freebsd.org/changeset/base/327381 > > > > > > Log: > > > Move i386/isa/elink.[hc] to dev/ep. > > > > > > The ep(4) driver is the only consumer of the two functions from > > > elink.c. I removed the standalone module as well, and most likely, > > > the module metadata is not needed anywhere, but this is for later > > > cleanup. > > > > > > Discussed with: imp, jhb > > > Sponsored by: The FreeBSD Foundation > > For the record, I find this change very cool. > > > > It makes the code more modular and the license for those two files also > > matches the license in the ep driver. > > The idea of this change and r327380 is to clean up i386/isa. There are > three more files to go > Originally, the ie driver and the ep driver shared the elink code since there were two different drivers, but the same pre-PNP discovery method for these cards. It makes sense to do what was just done now that ie is gone. Warner From owner-svn-src-all@freebsd.org Sat Dec 30 22:01:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 267EAEAEC8A; Sat, 30 Dec 2017 22:01:19 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD2376F9E2; Sat, 30 Dec 2017 22:01:18 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBUM1IhD055481; Sat, 30 Dec 2017 22:01:18 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBUM1Hqx055472; Sat, 30 Dec 2017 22:01:17 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201712302201.vBUM1Hqx055472@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 30 Dec 2017 22:01:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327392 - in head/sys: arm/altera/socfpga arm/rockchip arm/samsung/exynos dev/mmc/host X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: arm/altera/socfpga arm/rockchip arm/samsung/exynos dev/mmc/host X-SVN-Commit-Revision: 327392 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2017 22:01:19 -0000 Author: manu Date: Sat Dec 30 22:01:17 2017 New Revision: 327392 URL: https://svnweb.freebsd.org/changeset/base/327392 Log: dwmmc: Fully subclass driver Fully subclass the dwmmc driver and split every driver into multiple files. There is still a few quirks in the dwmmc driver that will need some work. Tested On: Pine64 Rock64 Differential Revision: https://reviews.freebsd.org/D13615 Added: head/sys/dev/mmc/host/dwmmc_altera.c - copied, changed from r327391, head/sys/dev/mmc/host/dwmmc_hisi.c head/sys/dev/mmc/host/dwmmc_rockchip.c - copied, changed from r327391, head/sys/dev/mmc/host/dwmmc_hisi.c head/sys/dev/mmc/host/dwmmc_samsung.c (contents, props changed) Modified: head/sys/arm/altera/socfpga/files.socfpga head/sys/arm/rockchip/files.rk30xx head/sys/arm/samsung/exynos/files.exynos5 head/sys/dev/mmc/host/dwmmc.c head/sys/dev/mmc/host/dwmmc_hisi.c head/sys/dev/mmc/host/dwmmc_var.h Modified: head/sys/arm/altera/socfpga/files.socfpga ============================================================================== --- head/sys/arm/altera/socfpga/files.socfpga Sat Dec 30 20:28:29 2017 (r327391) +++ head/sys/arm/altera/socfpga/files.socfpga Sat Dec 30 22:01:17 2017 (r327392) @@ -10,6 +10,7 @@ arm/altera/socfpga/socfpga_mp.c optional smp arm/altera/socfpga/socfpga_gpio.c optional gpio dev/mmc/host/dwmmc.c optional dwmmc +dev/mmc/host/dwmmc_altera.c optional dwmmc # Arria 10 arm/altera/socfpga/socfpga_a10_manager.c standard Modified: head/sys/arm/rockchip/files.rk30xx ============================================================================== --- head/sys/arm/rockchip/files.rk30xx Sat Dec 30 20:28:29 2017 (r327391) +++ head/sys/arm/rockchip/files.rk30xx Sat Dec 30 22:01:17 2017 (r327392) @@ -9,3 +9,4 @@ arm/rockchip/rk30xx_gpio.c optional gpio arm/rockchip/rk30xx_mp.c optional smp dev/mmc/host/dwmmc.c optional dwmmc +dev/mmc/host/dwmmc_rockchip.c optional dwmmc Modified: head/sys/arm/samsung/exynos/files.exynos5 ============================================================================== --- head/sys/arm/samsung/exynos/files.exynos5 Sat Dec 30 20:28:29 2017 (r327391) +++ head/sys/arm/samsung/exynos/files.exynos5 Sat Dec 30 22:01:17 2017 (r327392) @@ -22,3 +22,4 @@ arm/samsung/exynos/chrome_ec_spi.c optional chrome_ec arm/samsung/exynos/chrome_kb.c optional chrome_kb dev/mmc/host/dwmmc.c optional dwmmc +dev/mmc/host/dwmmc_samsung.c optional dwmmc Modified: head/sys/dev/mmc/host/dwmmc.c ============================================================================== --- head/sys/dev/mmc/host/dwmmc.c Sat Dec 30 20:28:29 2017 (r327391) +++ head/sys/dev/mmc/host/dwmmc.c Sat Dec 30 22:01:17 2017 (r327392) @@ -131,13 +131,6 @@ static struct resource_spec dwmmc_spec[] = { #define HWTYPE_MASK (0x0000ffff) #define HWFLAG_MASK (0xffff << 16) -static struct ofw_compat_data compat_data[] = { - {"altr,socfpga-dw-mshc", HWTYPE_ALTERA}, - {"samsung,exynos5420-dw-mshc", HWTYPE_EXYNOS}, - {"rockchip,rk2928-dw-mshc", HWTYPE_ROCKCHIP}, - {NULL, HWTYPE_NONE}, -}; - static void dwmmc_get1paddr(void *arg, bus_dma_segment_t *segs, int nsegs, int error) { @@ -448,52 +441,9 @@ parse_fdt(struct dwmmc_softc *sc) sc->bus_hz = dts_value[0]; } - /* - * Platform-specific stuff - * XXX: Move to separate file - */ - - if ((sc->hwtype & HWTYPE_MASK) != HWTYPE_EXYNOS) - return (0); - - if ((len = OF_getproplen(node, "samsung,dw-mshc-ciu-div")) <= 0) - return (ENXIO); - OF_getencprop(node, "samsung,dw-mshc-ciu-div", dts_value, len); - sc->sdr_timing = (dts_value[0] << SDMMC_CLKSEL_DIVIDER_SHIFT); - sc->ddr_timing = (dts_value[0] << SDMMC_CLKSEL_DIVIDER_SHIFT); - - if ((len = OF_getproplen(node, "samsung,dw-mshc-sdr-timing")) <= 0) - return (ENXIO); - OF_getencprop(node, "samsung,dw-mshc-sdr-timing", dts_value, len); - sc->sdr_timing |= ((dts_value[0] << SDMMC_CLKSEL_SAMPLE_SHIFT) | - (dts_value[1] << SDMMC_CLKSEL_DRIVE_SHIFT)); - - if ((len = OF_getproplen(node, "samsung,dw-mshc-ddr-timing")) <= 0) - return (ENXIO); - OF_getencprop(node, "samsung,dw-mshc-ddr-timing", dts_value, len); - sc->ddr_timing |= ((dts_value[0] << SDMMC_CLKSEL_SAMPLE_SHIFT) | - (dts_value[1] << SDMMC_CLKSEL_DRIVE_SHIFT)); - return (0); } -static int -dwmmc_probe(device_t dev) -{ - uintptr_t hwtype; - - if (!ofw_bus_status_okay(dev)) - return (ENXIO); - - hwtype = ofw_bus_search_compatible(dev, compat_data)->ocd_data; - if (hwtype == HWTYPE_NONE) - return (ENXIO); - - device_set_desc(dev, "Synopsys DesignWare Mobile " - "Storage Host Controller"); - return (BUS_PROBE_DEFAULT); -} - int dwmmc_attach(device_t dev) { @@ -504,10 +454,6 @@ dwmmc_attach(device_t dev) sc = device_get_softc(dev); sc->dev = dev; - if (sc->hwtype == HWTYPE_NONE) { - sc->hwtype = - ofw_bus_search_compatible(dev, compat_data)->ocd_data; - } /* Why not to use Auto Stop? It save a hundred of irq per second */ sc->use_auto_stop = 1; @@ -539,19 +485,6 @@ dwmmc_attach(device_t dev) if (sc->desc_count == 0) sc->desc_count = DESC_MAX; - if ((sc->hwtype & HWTYPE_MASK) == HWTYPE_ROCKCHIP) { - sc->use_pio = 1; - sc->pwren_inverted = 1; - } else if ((sc->hwtype & HWTYPE_MASK) == HWTYPE_EXYNOS) { - WRITE4(sc, EMMCP_MPSBEGIN0, 0); - WRITE4(sc, EMMCP_SEND0, 0); - WRITE4(sc, EMMCP_CTRL0, (MPSCTRL_SECURE_READ_BIT | - MPSCTRL_SECURE_WRITE_BIT | - MPSCTRL_NON_SECURE_READ_BIT | - MPSCTRL_NON_SECURE_WRITE_BIT | - MPSCTRL_VALID)); - } - /* XXX: we support operation for slot index 0 only */ slot = 0; if (sc->pwren_inverted) { @@ -1154,9 +1087,6 @@ dwmmc_write_ivar(device_t bus, device_t child, int whi } static device_method_t dwmmc_methods[] = { - DEVMETHOD(device_probe, dwmmc_probe), - DEVMETHOD(device_attach, dwmmc_attach), - /* Bus interface */ DEVMETHOD(bus_read_ivar, dwmmc_read_ivar), DEVMETHOD(bus_write_ivar, dwmmc_write_ivar), @@ -1171,16 +1101,5 @@ static device_method_t dwmmc_methods[] = { DEVMETHOD_END }; -driver_t dwmmc_driver = { - "dwmmc", - dwmmc_methods, - sizeof(struct dwmmc_softc), -}; - -static devclass_t dwmmc_devclass; - -DRIVER_MODULE(dwmmc, simplebus, dwmmc_driver, dwmmc_devclass, NULL, NULL); -DRIVER_MODULE(dwmmc, ofwbus, dwmmc_driver, dwmmc_devclass, NULL, NULL); -#ifndef MMCCAM -MMC_DECLARE_BRIDGE(dwmmc); -#endif +DEFINE_CLASS_0(dwmmc, dwmmc_driver, dwmmc_methods, + sizeof(struct dwmmc_softc)); Copied and modified: head/sys/dev/mmc/host/dwmmc_altera.c (from r327391, head/sys/dev/mmc/host/dwmmc_hisi.c) ============================================================================== --- head/sys/dev/mmc/host/dwmmc_hisi.c Sat Dec 30 20:28:29 2017 (r327391, copy source) +++ head/sys/dev/mmc/host/dwmmc_altera.c Sat Dec 30 22:01:17 2017 (r327392) @@ -1,5 +1,5 @@ /* - * Copyright 2015 Andrew Turner. + * Copyright 2017 Emmanuel Vadot * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,56 +41,55 @@ __FBSDID("$FreeBSD$"); #include -static device_probe_t hisi_dwmmc_probe; -static device_attach_t hisi_dwmmc_attach; +static struct ofw_compat_data compat_data[] = { + {"altr,socfpga-dw-mshc", 1}, + {NULL, 0}, +}; static int -hisi_dwmmc_probe(device_t dev) +altera_dwmmc_probe(device_t dev) { if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (!ofw_bus_is_compatible(dev, "hisilicon,hi6220-dw-mshc")) + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) return (ENXIO); device_set_desc(dev, "Synopsys DesignWare Mobile " - "Storage Host Controller (HiSilicon)"); + "Storage Host Controller (Altera)"); return (BUS_PROBE_VENDOR); } static int -hisi_dwmmc_attach(device_t dev) +altera_dwmmc_attach(device_t dev) { struct dwmmc_softc *sc; sc = device_get_softc(dev); - sc->hwtype = HWTYPE_HISILICON; - /* TODO: Calculate this from a clock driver */ - sc->bus_hz = 24000000; /* 24MHz */ + sc->hwtype = HWTYPE_ALTERA; - /* - * ARM64TODO: This is likely because we lack support for - * DMA when the controller is not cache-coherent on arm64. - */ - sc->use_pio = 1; - sc->desc_count = 1; - return (dwmmc_attach(dev)); } -static device_method_t hisi_dwmmc_methods[] = { +static device_method_t altera_dwmmc_methods[] = { /* bus interface */ - DEVMETHOD(device_probe, hisi_dwmmc_probe), - DEVMETHOD(device_attach, hisi_dwmmc_attach), + DEVMETHOD(device_probe, altera_dwmmc_probe), + DEVMETHOD(device_attach, altera_dwmmc_attach), DEVMETHOD_END }; -static devclass_t hisi_dwmmc_devclass; +static devclass_t altera_dwmmc_devclass; -DEFINE_CLASS_1(hisi_dwmmc, hisi_dwmmc_driver, hisi_dwmmc_methods, +DEFINE_CLASS_1(altera_dwmmc, altera_dwmmc_driver, altera_dwmmc_methods, sizeof(struct dwmmc_softc), dwmmc_driver); -DRIVER_MODULE(hisi_dwmmc, simplebus, hisi_dwmmc_driver, - hisi_dwmmc_devclass, 0, 0); + +DRIVER_MODULE(altera_dwmmc, simplebus, altera_dwmmc_driver, + altera_dwmmc_devclass, 0, 0); +DRIVER_MODULE(altera_dwmmc, ofwbus, altera_dwmmc_driver, altera_dwmmc_devclass + , NULL, NULL); +#ifndef MMCCAM +MMC_DECLARE_BRIDGE(altera_dwmmc); +#endif Modified: head/sys/dev/mmc/host/dwmmc_hisi.c ============================================================================== --- head/sys/dev/mmc/host/dwmmc_hisi.c Sat Dec 30 20:28:29 2017 (r327391) +++ head/sys/dev/mmc/host/dwmmc_hisi.c Sat Dec 30 22:01:17 2017 (r327392) @@ -92,5 +92,11 @@ static devclass_t hisi_dwmmc_devclass; DEFINE_CLASS_1(hisi_dwmmc, hisi_dwmmc_driver, hisi_dwmmc_methods, sizeof(struct dwmmc_softc), dwmmc_driver); + DRIVER_MODULE(hisi_dwmmc, simplebus, hisi_dwmmc_driver, hisi_dwmmc_devclass, 0, 0); +DRIVER_MODULE(hisi_dwmmc, ofwbus, hisi_dwmmc_driver, hisi_dwmmc_devclass + , NULL, NULL); +#ifndef MMCCAM +MMC_DECLARE_BRIDGE(hisi_dwmmc); +#endif Copied and modified: head/sys/dev/mmc/host/dwmmc_rockchip.c (from r327391, head/sys/dev/mmc/host/dwmmc_hisi.c) ============================================================================== --- head/sys/dev/mmc/host/dwmmc_hisi.c Sat Dec 30 20:28:29 2017 (r327391, copy source) +++ head/sys/dev/mmc/host/dwmmc_rockchip.c Sat Dec 30 22:01:17 2017 (r327392) @@ -1,5 +1,5 @@ /* - * Copyright 2015 Andrew Turner. + * Copyright 2017 Emmanuel Vadot * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,56 +41,58 @@ __FBSDID("$FreeBSD$"); #include -static device_probe_t hisi_dwmmc_probe; -static device_attach_t hisi_dwmmc_attach; +static struct ofw_compat_data compat_data[] = { + {"rockchip,rk2928-dw-mshc", 1}, + {NULL, 0}, +}; static int -hisi_dwmmc_probe(device_t dev) +rockchip_dwmmc_probe(device_t dev) { if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (!ofw_bus_is_compatible(dev, "hisilicon,hi6220-dw-mshc")) + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) return (ENXIO); device_set_desc(dev, "Synopsys DesignWare Mobile " - "Storage Host Controller (HiSilicon)"); + "Storage Host Controller (RockChip)"); return (BUS_PROBE_VENDOR); } static int -hisi_dwmmc_attach(device_t dev) +rockchip_dwmmc_attach(device_t dev) { struct dwmmc_softc *sc; sc = device_get_softc(dev); - sc->hwtype = HWTYPE_HISILICON; - /* TODO: Calculate this from a clock driver */ - sc->bus_hz = 24000000; /* 24MHz */ + sc->hwtype = HWTYPE_ROCKCHIP; - /* - * ARM64TODO: This is likely because we lack support for - * DMA when the controller is not cache-coherent on arm64. - */ sc->use_pio = 1; - sc->desc_count = 1; + sc->pwren_inverted = 1; return (dwmmc_attach(dev)); } -static device_method_t hisi_dwmmc_methods[] = { +static device_method_t rockchip_dwmmc_methods[] = { /* bus interface */ - DEVMETHOD(device_probe, hisi_dwmmc_probe), - DEVMETHOD(device_attach, hisi_dwmmc_attach), + DEVMETHOD(device_probe, rockchip_dwmmc_probe), + DEVMETHOD(device_attach, rockchip_dwmmc_attach), DEVMETHOD_END }; -static devclass_t hisi_dwmmc_devclass; +static devclass_t rockchip_dwmmc_devclass; -DEFINE_CLASS_1(hisi_dwmmc, hisi_dwmmc_driver, hisi_dwmmc_methods, +DEFINE_CLASS_1(rockchip_dwmmc, rockchip_dwmmc_driver, rockchip_dwmmc_methods, sizeof(struct dwmmc_softc), dwmmc_driver); -DRIVER_MODULE(hisi_dwmmc, simplebus, hisi_dwmmc_driver, - hisi_dwmmc_devclass, 0, 0); + +DRIVER_MODULE(rockchip_dwmmc, simplebus, rockchip_dwmmc_driver, + rockchip_dwmmc_devclass, 0, 0); +DRIVER_MODULE(rockchip_dwmmc, ofwbus, rockchip_dwmmc_driver, + rockchip_dwmmc_devclass, NULL, NULL); +#ifndef MMCCAM +MMC_DECLARE_BRIDGE(rockchip_dwmmc); +#endif Added: head/sys/dev/mmc/host/dwmmc_samsung.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mmc/host/dwmmc_samsung.c Sat Dec 30 22:01:17 2017 (r327392) @@ -0,0 +1,132 @@ +/* + * Copyright 2017 Emmanuel Vadot + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include + +#include + +#include +#include + +#include +#include + +#define WRITE4(_sc, _reg, _val) \ + bus_write_4((_sc)->res[0], _reg, _val) + +static struct ofw_compat_data compat_data[] = { + {"samsung,exynos5420-dw-mshc", 1}, + {NULL, 0}, +}; + +static int +samsung_dwmmc_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + device_set_desc(dev, "Synopsys DesignWare Mobile " + "Storage Host Controller (Samsung)"); + + return (BUS_PROBE_VENDOR); +} + +static int +samsung_dwmmc_attach(device_t dev) +{ + struct dwmmc_softc *sc; + pcell_t dts_value[3]; + phandle_t node; + int len; + + sc = device_get_softc(dev); + sc->hwtype = HWTYPE_EXYNOS; + + if ((node = ofw_bus_get_node(sc->dev)) == -1) + return (ENXIO); + + if ((len = OF_getproplen(node, "samsung,dw-mshc-ciu-div")) <= 0) + return (ENXIO); + OF_getencprop(node, "samsung,dw-mshc-ciu-div", dts_value, len); + sc->sdr_timing = (dts_value[0] << SDMMC_CLKSEL_DIVIDER_SHIFT); + sc->ddr_timing = (dts_value[0] << SDMMC_CLKSEL_DIVIDER_SHIFT); + + if ((len = OF_getproplen(node, "samsung,dw-mshc-sdr-timing")) <= 0) + return (ENXIO); + OF_getencprop(node, "samsung,dw-mshc-sdr-timing", dts_value, len); + sc->sdr_timing |= ((dts_value[0] << SDMMC_CLKSEL_SAMPLE_SHIFT) | + (dts_value[1] << SDMMC_CLKSEL_DRIVE_SHIFT)); + + if ((len = OF_getproplen(node, "samsung,dw-mshc-ddr-timing")) <= 0) + return (ENXIO); + OF_getencprop(node, "samsung,dw-mshc-ddr-timing", dts_value, len); + sc->ddr_timing |= ((dts_value[0] << SDMMC_CLKSEL_SAMPLE_SHIFT) | + (dts_value[1] << SDMMC_CLKSEL_DRIVE_SHIFT)); + + WRITE4(sc, EMMCP_MPSBEGIN0, 0); + WRITE4(sc, EMMCP_SEND0, 0); + WRITE4(sc, EMMCP_CTRL0, (MPSCTRL_SECURE_READ_BIT | + MPSCTRL_SECURE_WRITE_BIT | + MPSCTRL_NON_SECURE_READ_BIT | + MPSCTRL_NON_SECURE_WRITE_BIT | + MPSCTRL_VALID)); + + return (dwmmc_attach(dev)); +} + +static device_method_t samsung_dwmmc_methods[] = { + /* bus interface */ + DEVMETHOD(device_probe, samsung_dwmmc_probe), + DEVMETHOD(device_attach, samsung_dwmmc_attach), + + DEVMETHOD_END +}; + +static devclass_t samsung_dwmmc_devclass; + +DEFINE_CLASS_1(samsung_dwmmc, samsung_dwmmc_driver, samsung_dwmmc_methods, + sizeof(struct dwmmc_softc), dwmmc_driver); + +DRIVER_MODULE(samsung_dwmmc, simplebus, samsung_dwmmc_driver, + samsung_dwmmc_devclass, 0, 0); +DRIVER_MODULE(samsung_dwmmc, ofwbus, samsung_dwmmc_driver, samsung_dwmmc_devclass + , NULL, NULL); +#ifndef MMCCAM +MMC_DECLARE_BRIDGE(samsung_dwmmc); +#endif Modified: head/sys/dev/mmc/host/dwmmc_var.h ============================================================================== --- head/sys/dev/mmc/host/dwmmc_var.h Sat Dec 30 20:28:29 2017 (r327391) +++ head/sys/dev/mmc/host/dwmmc_var.h Sat Dec 30 22:01:17 2017 (r327392) @@ -74,7 +74,7 @@ struct dwmmc_softc { uint32_t ddr_timing; }; -extern driver_t dwmmc_driver; +DECLARE_CLASS(dwmmc_driver); int dwmmc_attach(device_t);