From owner-svn-src-head@freebsd.org Sun Jan 14 00:08:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9723E61FA5; Sun, 14 Jan 2018 00:08:42 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 770457F11F; Sun, 14 Jan 2018 00:08: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B69ED19FF7; Sun, 14 Jan 2018 00:08: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 w0E08eiZ023434; Sun, 14 Jan 2018 00:08:40 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0E08cDt023411; Sun, 14 Jan 2018 00:08:38 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201801140008.w0E08cDt023411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 14 Jan 2018 00:08:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327952 - in head: . contrib/compiler-rt/include/sanitizer contrib/compiler-rt/include/xray contrib/compiler-rt/lib/BlocksRuntime contrib/compiler-rt/lib/asan contrib/compiler-rt/lib/bu... X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head: . contrib/compiler-rt/include/sanitizer contrib/compiler-rt/include/xray contrib/compiler-rt/lib/BlocksRuntime contrib/compiler-rt/lib/asan contrib/compiler-rt/lib/builtins contrib/compiler-r... X-SVN-Commit-Revision: 327952 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jan 2018 00:08:43 -0000 Author: dim Date: Sun Jan 14 00:08:34 2018 New Revision: 327952 URL: https://svnweb.freebsd.org/changeset/base/327952 Log: Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to 6.0.0 (branches/release_60 r321788). Upstream has branched for the 6.0.0 release, which should be in about 6 weeks. Please report bugs and regressions, so we can get them into the release. Please note that from 3.5.0 onwards, clang, llvm and lldb require C++11 support to build; see UPDATING for more information. MFC after: 3 months Added: head/contrib/compiler-rt/include/sanitizer/hwasan_interface.h - copied unchanged from r327933, projects/clang600-import/contrib/compiler-rt/include/sanitizer/hwasan_interface.h head/contrib/compiler-rt/include/sanitizer/scudo_interface.h - copied unchanged from r327933, projects/clang600-import/contrib/compiler-rt/include/sanitizer/scudo_interface.h head/contrib/compiler-rt/lib/asan/asan_fuchsia.cc - copied unchanged from r327933, projects/clang600-import/contrib/compiler-rt/lib/asan/asan_fuchsia.cc head/contrib/compiler-rt/lib/asan/asan_interceptors_memintrinsics.cc - copied unchanged from r327933, projects/clang600-import/contrib/compiler-rt/lib/asan/asan_interceptors_memintrinsics.cc head/contrib/compiler-rt/lib/asan/asan_interceptors_memintrinsics.h - copied unchanged from r327933, projects/clang600-import/contrib/compiler-rt/lib/asan/asan_interceptors_memintrinsics.h head/contrib/compiler-rt/lib/asan/asan_premap_shadow.cc - copied unchanged from r327933, projects/clang600-import/contrib/compiler-rt/lib/asan/asan_premap_shadow.cc head/contrib/compiler-rt/lib/asan/asan_premap_shadow.h - copied unchanged from r327933, projects/clang600-import/contrib/compiler-rt/lib/asan/asan_premap_shadow.h head/contrib/compiler-rt/lib/asan/asan_shadow_setup.cc - copied unchanged from r327933, projects/clang600-import/contrib/compiler-rt/lib/asan/asan_shadow_setup.cc head/contrib/compiler-rt/lib/builtins/aarch64/ - copied from r327933, projects/clang600-import/contrib/compiler-rt/lib/builtins/aarch64/ head/contrib/compiler-rt/lib/hwasan/ - copied from r327933, projects/clang600-import/contrib/compiler-rt/lib/hwasan/ head/contrib/compiler-rt/lib/sanitizer_common/sancov_begin.S - copied unchanged from r327933, projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sancov_begin.S head/contrib/compiler-rt/lib/sanitizer_common/sancov_end.S - copied unchanged from r327933, projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sancov_end.S head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_allocator_checks.cc - copied unchanged from r327933, projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_allocator_checks.cc head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_atomic_clang_mips.h - copied unchanged from r327933, projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_atomic_clang_mips.h head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_coverage_fuchsia.cc - copied unchanged from r327933, projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_coverage_fuchsia.cc head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_file.cc - copied unchanged from r327933, projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_file.cc head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_file.h - copied unchanged from r327933, projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_file.h head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_fuchsia.cc - copied unchanged from r327933, projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_fuchsia.cc head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_fuchsia.h - copied unchanged from r327933, projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_fuchsia.h head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_getauxval.h - copied unchanged from r327933, projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_getauxval.h head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cc - copied unchanged from r327933, projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cc head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.h - copied unchanged from r327933, projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.h head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_solaris.cc - copied unchanged from r327933, projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_solaris.cc head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_solaris.h - copied unchanged from r327933, projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_solaris.h head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_solaris.cc - copied unchanged from r327933, projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_solaris.cc head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_signal_interceptors.inc - copied unchanged from r327933, projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_signal_interceptors.inc head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_solaris.cc - copied unchanged from r327933, projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_solaris.cc head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_fuchsia.cc - copied unchanged from r327933, projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_fuchsia.cc head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_syscall_linux_arm.inc - copied unchanged from r327933, projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_syscall_linux_arm.inc head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_vector.h - copied unchanged from r327933, projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_vector.h head/contrib/compiler-rt/lib/scudo/scudo_interface_internal.h - copied unchanged from r327933, projects/clang600-import/contrib/compiler-rt/lib/scudo/scudo_interface_internal.h head/contrib/compiler-rt/lib/scudo/scudo_platform.h - copied unchanged from r327933, projects/clang600-import/contrib/compiler-rt/lib/scudo/scudo_platform.h head/contrib/compiler-rt/lib/scudo/scudo_tsd.h - copied unchanged from r327933, projects/clang600-import/contrib/compiler-rt/lib/scudo/scudo_tsd.h head/contrib/compiler-rt/lib/scudo/scudo_tsd_exclusive.cpp - copied unchanged from r327933, projects/clang600-import/contrib/compiler-rt/lib/scudo/scudo_tsd_exclusive.cpp head/contrib/compiler-rt/lib/scudo/scudo_tsd_exclusive.inc - copied unchanged from r327933, projects/clang600-import/contrib/compiler-rt/lib/scudo/scudo_tsd_exclusive.inc head/contrib/compiler-rt/lib/scudo/scudo_tsd_shared.cpp - copied unchanged from r327933, projects/clang600-import/contrib/compiler-rt/lib/scudo/scudo_tsd_shared.cpp head/contrib/compiler-rt/lib/scudo/scudo_tsd_shared.inc - copied unchanged from r327933, projects/clang600-import/contrib/compiler-rt/lib/scudo/scudo_tsd_shared.inc head/contrib/compiler-rt/lib/ubsan/ubsan_signals_standalone.cc - copied unchanged from r327933, projects/clang600-import/contrib/compiler-rt/lib/ubsan/ubsan_signals_standalone.cc head/contrib/compiler-rt/lib/ubsan/ubsan_signals_standalone.h - copied unchanged from r327933, projects/clang600-import/contrib/compiler-rt/lib/ubsan/ubsan_signals_standalone.h head/contrib/compiler-rt/lib/ubsan_minimal/ - copied from r327933, projects/clang600-import/contrib/compiler-rt/lib/ubsan_minimal/ head/contrib/compiler-rt/lib/xray/weak_symbols.txt - copied unchanged from r327933, projects/clang600-import/contrib/compiler-rt/lib/xray/weak_symbols.txt head/contrib/compiler-rt/lib/xray/xray_inmemory_log.h - copied unchanged from r327933, projects/clang600-import/contrib/compiler-rt/lib/xray/xray_inmemory_log.h head/contrib/llvm/include/llvm-c/DebugInfo.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm-c/DebugInfo.h head/contrib/llvm/include/llvm/Analysis/CmpInstAnalysis.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/Analysis/CmpInstAnalysis.h head/contrib/llvm/include/llvm/Analysis/OptimizationRemarkEmitter.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/Analysis/OptimizationRemarkEmitter.h head/contrib/llvm/include/llvm/Analysis/ValueLattice.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/Analysis/ValueLattice.h head/contrib/llvm/include/llvm/Analysis/ValueLatticeUtils.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/Analysis/ValueLatticeUtils.h head/contrib/llvm/include/llvm/BinaryFormat/ELFRelocs/ARC.def - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/BinaryFormat/ELFRelocs/ARC.def head/contrib/llvm/include/llvm/BinaryFormat/WasmRelocs.def - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/BinaryFormat/WasmRelocs.def head/contrib/llvm/include/llvm/CodeGen/CommandFlags.def - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/CodeGen/CommandFlags.def head/contrib/llvm/include/llvm/CodeGen/CostTable.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/CodeGen/CostTable.h head/contrib/llvm/include/llvm/CodeGen/GlobalISel/GISelWorkList.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/CodeGen/GlobalISel/GISelWorkList.h head/contrib/llvm/include/llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h head/contrib/llvm/include/llvm/CodeGen/LiveIntervals.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/CodeGen/LiveIntervals.h head/contrib/llvm/include/llvm/CodeGen/LiveStacks.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/CodeGen/LiveStacks.h head/contrib/llvm/include/llvm/CodeGen/RuntimeLibcalls.def - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/CodeGen/RuntimeLibcalls.def head/contrib/llvm/include/llvm/CodeGen/SDNodeProperties.td - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/CodeGen/SDNodeProperties.td head/contrib/llvm/include/llvm/CodeGen/TargetCallingConv.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/CodeGen/TargetCallingConv.h head/contrib/llvm/include/llvm/CodeGen/TargetFrameLowering.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/CodeGen/TargetFrameLowering.h head/contrib/llvm/include/llvm/CodeGen/TargetInstrInfo.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/CodeGen/TargetInstrInfo.h head/contrib/llvm/include/llvm/CodeGen/TargetLowering.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/CodeGen/TargetLowering.h head/contrib/llvm/include/llvm/CodeGen/TargetLoweringObjectFile.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/CodeGen/TargetLoweringObjectFile.h head/contrib/llvm/include/llvm/CodeGen/TargetOpcodes.def - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/CodeGen/TargetOpcodes.def head/contrib/llvm/include/llvm/CodeGen/TargetOpcodes.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/CodeGen/TargetOpcodes.h head/contrib/llvm/include/llvm/CodeGen/TargetRegisterInfo.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/CodeGen/TargetRegisterInfo.h head/contrib/llvm/include/llvm/CodeGen/TargetSubtargetInfo.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/CodeGen/TargetSubtargetInfo.h head/contrib/llvm/include/llvm/DebugInfo/CodeView/AppendingTypeTableBuilder.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/DebugInfo/CodeView/AppendingTypeTableBuilder.h head/contrib/llvm/include/llvm/DebugInfo/CodeView/CodeViewRegisters.def - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/DebugInfo/CodeView/CodeViewRegisters.def head/contrib/llvm/include/llvm/DebugInfo/CodeView/ContinuationRecordBuilder.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/DebugInfo/CodeView/ContinuationRecordBuilder.h head/contrib/llvm/include/llvm/DebugInfo/CodeView/GlobalTypeTableBuilder.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/DebugInfo/CodeView/GlobalTypeTableBuilder.h head/contrib/llvm/include/llvm/DebugInfo/CodeView/MergingTypeTableBuilder.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/DebugInfo/CodeView/MergingTypeTableBuilder.h head/contrib/llvm/include/llvm/DebugInfo/CodeView/RecordName.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/DebugInfo/CodeView/RecordName.h head/contrib/llvm/include/llvm/DebugInfo/CodeView/SimpleTypeSerializer.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/DebugInfo/CodeView/SimpleTypeSerializer.h head/contrib/llvm/include/llvm/DebugInfo/CodeView/TypeHashing.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/DebugInfo/CodeView/TypeHashing.h head/contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFExpression.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFExpression.h head/contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFObject.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFObject.h head/contrib/llvm/include/llvm/DebugInfo/PDB/DIA/DIAEnumTables.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/DebugInfo/PDB/DIA/DIAEnumTables.h head/contrib/llvm/include/llvm/DebugInfo/PDB/DIA/DIATable.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/DebugInfo/PDB/DIA/DIATable.h head/contrib/llvm/include/llvm/DebugInfo/PDB/IPDBTable.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/DebugInfo/PDB/IPDBTable.h head/contrib/llvm/include/llvm/DebugInfo/PDB/Native/GSIStreamBuilder.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/DebugInfo/PDB/Native/GSIStreamBuilder.h head/contrib/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumSymbol.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumSymbol.h head/contrib/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumTypes.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumTypes.h head/contrib/llvm/include/llvm/ExecutionEngine/Orc/RemoteObjectLayer.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/ExecutionEngine/Orc/RemoteObjectLayer.h head/contrib/llvm/include/llvm/ExecutionEngine/Orc/SymbolStringPool.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/ExecutionEngine/Orc/SymbolStringPool.h head/contrib/llvm/include/llvm/FuzzMutate/ - copied from r327933, projects/clang600-import/contrib/llvm/include/llvm/FuzzMutate/ head/contrib/llvm/include/llvm/IR/DiagnosticHandler.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/IR/DiagnosticHandler.h head/contrib/llvm/include/llvm/MC/MCCodePadder.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/MC/MCCodePadder.h head/contrib/llvm/include/llvm/MC/MCTargetOptionsCommandFlags.def - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/MC/MCTargetOptionsCommandFlags.def head/contrib/llvm/include/llvm/ObjectYAML/CodeViewYAMLTypeHashing.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/ObjectYAML/CodeViewYAMLTypeHashing.h head/contrib/llvm/include/llvm/ProfileData/GCOV.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/ProfileData/GCOV.h head/contrib/llvm/include/llvm/Support/AMDGPUKernelDescriptor.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/Support/AMDGPUKernelDescriptor.h head/contrib/llvm/include/llvm/Support/AMDGPUMetadata.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/Support/AMDGPUMetadata.h head/contrib/llvm/include/llvm/Support/CodeGenCoverage.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/Support/CodeGenCoverage.h head/contrib/llvm/include/llvm/Support/X86TargetParser.def - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/Support/X86TargetParser.def head/contrib/llvm/include/llvm/Transforms/IPO/CalledValuePropagation.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/Transforms/IPO/CalledValuePropagation.h head/contrib/llvm/include/llvm/Transforms/Instrumentation/ - copied from r327933, projects/clang600-import/contrib/llvm/include/llvm/Transforms/Instrumentation/ head/contrib/llvm/include/llvm/Transforms/Scalar/CallSiteSplitting.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/Transforms/Scalar/CallSiteSplitting.h head/contrib/llvm/include/llvm/Transforms/Scalar/DivRemPairs.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/Transforms/Scalar/DivRemPairs.h head/contrib/llvm/include/llvm/Transforms/Scalar/RewriteStatepointsForGC.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/Transforms/Scalar/RewriteStatepointsForGC.h head/contrib/llvm/include/llvm/Transforms/Scalar/SpeculateAroundPHIs.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/Transforms/Scalar/SpeculateAroundPHIs.h head/contrib/llvm/include/llvm/Transforms/Utils/CallPromotionUtils.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/Transforms/Utils/CallPromotionUtils.h head/contrib/llvm/include/llvm/Transforms/Utils/EntryExitInstrumenter.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/include/llvm/Transforms/Utils/EntryExitInstrumenter.h head/contrib/llvm/include/llvm/WindowsManifest/ - copied from r327933, projects/clang600-import/contrib/llvm/include/llvm/WindowsManifest/ head/contrib/llvm/include/llvm/WindowsResource/ - copied from r327933, projects/clang600-import/contrib/llvm/include/llvm/WindowsResource/ head/contrib/llvm/lib/Analysis/CmpInstAnalysis.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Analysis/CmpInstAnalysis.cpp head/contrib/llvm/lib/Analysis/OptimizationRemarkEmitter.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Analysis/OptimizationRemarkEmitter.cpp head/contrib/llvm/lib/Analysis/ValueLattice.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Analysis/ValueLattice.cpp head/contrib/llvm/lib/Analysis/ValueLatticeUtils.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Analysis/ValueLatticeUtils.cpp head/contrib/llvm/lib/CodeGen/ExpandMemCmp.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/CodeGen/ExpandMemCmp.cpp head/contrib/llvm/lib/CodeGen/LiveIntervals.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/CodeGen/LiveIntervals.cpp head/contrib/llvm/lib/CodeGen/LiveStacks.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/CodeGen/LiveStacks.cpp head/contrib/llvm/lib/CodeGen/MIRCanonicalizerPass.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/CodeGen/MIRCanonicalizerPass.cpp head/contrib/llvm/lib/CodeGen/MachineOperand.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/CodeGen/MachineOperand.cpp head/contrib/llvm/lib/DebugInfo/CodeView/AppendingTypeTableBuilder.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/DebugInfo/CodeView/AppendingTypeTableBuilder.cpp head/contrib/llvm/lib/DebugInfo/CodeView/ContinuationRecordBuilder.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/DebugInfo/CodeView/ContinuationRecordBuilder.cpp head/contrib/llvm/lib/DebugInfo/CodeView/GlobalTypeTableBuilder.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/DebugInfo/CodeView/GlobalTypeTableBuilder.cpp head/contrib/llvm/lib/DebugInfo/CodeView/MergingTypeTableBuilder.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/DebugInfo/CodeView/MergingTypeTableBuilder.cpp head/contrib/llvm/lib/DebugInfo/CodeView/RecordName.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/DebugInfo/CodeView/RecordName.cpp head/contrib/llvm/lib/DebugInfo/CodeView/SimpleTypeSerializer.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/DebugInfo/CodeView/SimpleTypeSerializer.cpp head/contrib/llvm/lib/DebugInfo/CodeView/TypeHashing.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/DebugInfo/CodeView/TypeHashing.cpp head/contrib/llvm/lib/DebugInfo/DWARF/DWARFExpression.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/DebugInfo/DWARF/DWARFExpression.cpp head/contrib/llvm/lib/DebugInfo/PDB/DIA/DIAEnumTables.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/DebugInfo/PDB/DIA/DIAEnumTables.cpp head/contrib/llvm/lib/DebugInfo/PDB/DIA/DIATable.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/DebugInfo/PDB/DIA/DIATable.cpp head/contrib/llvm/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp head/contrib/llvm/lib/DebugInfo/PDB/Native/NativeEnumSymbol.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/DebugInfo/PDB/Native/NativeEnumSymbol.cpp head/contrib/llvm/lib/DebugInfo/PDB/Native/NativeEnumTypes.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/DebugInfo/PDB/Native/NativeEnumTypes.cpp head/contrib/llvm/lib/FuzzMutate/ - copied from r327933, projects/clang600-import/contrib/llvm/lib/FuzzMutate/ head/contrib/llvm/lib/IR/DiagnosticHandler.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/IR/DiagnosticHandler.cpp head/contrib/llvm/lib/MC/MCCodePadder.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/MC/MCCodePadder.cpp head/contrib/llvm/lib/ObjectYAML/CodeViewYAMLTypeHashing.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/ObjectYAML/CodeViewYAMLTypeHashing.cpp head/contrib/llvm/lib/ProfileData/GCOV.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/ProfileData/GCOV.cpp head/contrib/llvm/lib/Support/AMDGPUMetadata.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Support/AMDGPUMetadata.cpp head/contrib/llvm/lib/Support/CodeGenCoverage.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Support/CodeGenCoverage.cpp head/contrib/llvm/lib/Support/KnownBits.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Support/KnownBits.cpp head/contrib/llvm/lib/Target/AArch64/AArch64SIMDInstrOpt.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/AArch64/AArch64SIMDInstrOpt.cpp head/contrib/llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td head/contrib/llvm/lib/Target/AArch64/SVEInstrFormats.td - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/AArch64/SVEInstrFormats.td head/contrib/llvm/lib/Target/AMDGPU/AMDGPUArgumentUsageInfo.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/AMDGPU/AMDGPUArgumentUsageInfo.cpp head/contrib/llvm/lib/Target/AMDGPU/AMDGPUArgumentUsageInfo.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/AMDGPU/AMDGPUArgumentUsageInfo.h head/contrib/llvm/lib/Target/AMDGPU/AMDGPUInline.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/AMDGPU/AMDGPUInline.cpp head/contrib/llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp head/contrib/llvm/lib/Target/AMDGPU/AMDGPULibFunc.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/AMDGPU/AMDGPULibFunc.cpp head/contrib/llvm/lib/Target/AMDGPU/AMDGPULibFunc.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/AMDGPU/AMDGPULibFunc.h head/contrib/llvm/lib/Target/AMDGPU/AMDGPUMachineModuleInfo.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/AMDGPU/AMDGPUMachineModuleInfo.cpp head/contrib/llvm/lib/Target/AMDGPU/AMDGPUMachineModuleInfo.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/AMDGPU/AMDGPUMachineModuleInfo.h head/contrib/llvm/lib/Target/AMDGPU/AMDGPUOpenCLEnqueuedBlockLowering.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/AMDGPU/AMDGPUOpenCLEnqueuedBlockLowering.cpp head/contrib/llvm/lib/Target/AMDGPU/AMDGPURewriteOutArguments.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/AMDGPU/AMDGPURewriteOutArguments.cpp head/contrib/llvm/lib/Target/AMDGPU/GCNILPSched.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/AMDGPU/GCNILPSched.cpp head/contrib/llvm/lib/Target/AMDGPU/GCNProcessors.td - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/AMDGPU/GCNProcessors.td head/contrib/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUHSAMetadataStreamer.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUHSAMetadataStreamer.cpp head/contrib/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUHSAMetadataStreamer.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUHSAMetadataStreamer.h head/contrib/llvm/lib/Target/AMDGPU/R600Processors.td - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/AMDGPU/R600Processors.td head/contrib/llvm/lib/Target/AMDGPU/SIFixWWMLiveness.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/AMDGPU/SIFixWWMLiveness.cpp head/contrib/llvm/lib/Target/AMDGPU/SIMemoryLegalizer.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/AMDGPU/SIMemoryLegalizer.cpp head/contrib/llvm/lib/Target/AMDGPU/SIOptimizeExecMaskingPreRA.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/AMDGPU/SIOptimizeExecMaskingPreRA.cpp head/contrib/llvm/lib/Target/ARC/ - copied from r327933, projects/clang600-import/contrib/llvm/lib/Target/ARC/ head/contrib/llvm/lib/Target/ARM/ARMSystemRegister.td - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/ARM/ARMSystemRegister.td head/contrib/llvm/lib/Target/ARM/Utils/ - copied from r327933, projects/clang600-import/contrib/llvm/lib/Target/ARM/Utils/ head/contrib/llvm/lib/Target/AVR/MCTargetDesc/AVRMCELFStreamer.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/AVR/MCTargetDesc/AVRMCELFStreamer.cpp head/contrib/llvm/lib/Target/AVR/MCTargetDesc/AVRMCELFStreamer.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/AVR/MCTargetDesc/AVRMCELFStreamer.h head/contrib/llvm/lib/Target/BPF/AsmParser/ - copied from r327933, projects/clang600-import/contrib/llvm/lib/Target/BPF/AsmParser/ head/contrib/llvm/lib/Target/Hexagon/HexagonConstExtenders.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/Hexagon/HexagonConstExtenders.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonGatherPacketize.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/Hexagon/HexagonGatherPacketize.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.h head/contrib/llvm/lib/Target/Hexagon/HexagonISelDAGToDAGHVX.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/Hexagon/HexagonISelDAGToDAGHVX.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonISelLoweringHVX.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/Hexagon/HexagonISelLoweringHVX.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonInstrFormatsV65.td - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/Hexagon/HexagonInstrFormatsV65.td head/contrib/llvm/lib/Target/Hexagon/HexagonMapAsm2IntrinV65.gen.td - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/Hexagon/HexagonMapAsm2IntrinV65.gen.td head/contrib/llvm/lib/Target/Hexagon/HexagonPatternsV65.td - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/Hexagon/HexagonPatternsV65.td head/contrib/llvm/lib/Target/Hexagon/HexagonScheduleV65.td - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/Hexagon/HexagonScheduleV65.td head/contrib/llvm/lib/Target/Hexagon/HexagonVectorLoopCarriedReuse.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/Hexagon/HexagonVectorLoopCarriedReuse.cpp head/contrib/llvm/lib/Target/Nios2/InstPrinter/ - copied from r327933, projects/clang600-import/contrib/llvm/lib/Target/Nios2/InstPrinter/ head/contrib/llvm/lib/Target/Nios2/MCTargetDesc/Nios2AsmBackend.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/Nios2/MCTargetDesc/Nios2AsmBackend.cpp head/contrib/llvm/lib/Target/Nios2/MCTargetDesc/Nios2AsmBackend.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/Nios2/MCTargetDesc/Nios2AsmBackend.h head/contrib/llvm/lib/Target/Nios2/MCTargetDesc/Nios2BaseInfo.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/Nios2/MCTargetDesc/Nios2BaseInfo.h head/contrib/llvm/lib/Target/Nios2/MCTargetDesc/Nios2ELFObjectWriter.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/Nios2/MCTargetDesc/Nios2ELFObjectWriter.cpp head/contrib/llvm/lib/Target/Nios2/MCTargetDesc/Nios2FixupKinds.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/Nios2/MCTargetDesc/Nios2FixupKinds.h head/contrib/llvm/lib/Target/Nios2/MCTargetDesc/Nios2MCAsmInfo.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/Nios2/MCTargetDesc/Nios2MCAsmInfo.cpp head/contrib/llvm/lib/Target/Nios2/MCTargetDesc/Nios2MCAsmInfo.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/Nios2/MCTargetDesc/Nios2MCAsmInfo.h head/contrib/llvm/lib/Target/Nios2/MCTargetDesc/Nios2MCExpr.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/Nios2/MCTargetDesc/Nios2MCExpr.cpp head/contrib/llvm/lib/Target/Nios2/MCTargetDesc/Nios2MCExpr.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/Nios2/MCTargetDesc/Nios2MCExpr.h head/contrib/llvm/lib/Target/Nios2/MCTargetDesc/Nios2TargetStreamer.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/Nios2/MCTargetDesc/Nios2TargetStreamer.cpp head/contrib/llvm/lib/Target/Nios2/Nios2AsmPrinter.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/Nios2/Nios2AsmPrinter.cpp head/contrib/llvm/lib/Target/Nios2/Nios2CallingConv.td - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/Nios2/Nios2CallingConv.td head/contrib/llvm/lib/Target/Nios2/Nios2FrameLowering.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/Nios2/Nios2FrameLowering.cpp head/contrib/llvm/lib/Target/Nios2/Nios2FrameLowering.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/Nios2/Nios2FrameLowering.h head/contrib/llvm/lib/Target/Nios2/Nios2ISelDAGToDAG.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/Nios2/Nios2ISelDAGToDAG.cpp head/contrib/llvm/lib/Target/Nios2/Nios2ISelLowering.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/Nios2/Nios2ISelLowering.cpp head/contrib/llvm/lib/Target/Nios2/Nios2ISelLowering.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/Nios2/Nios2ISelLowering.h head/contrib/llvm/lib/Target/Nios2/Nios2InstrInfo.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/Nios2/Nios2InstrInfo.cpp head/contrib/llvm/lib/Target/Nios2/Nios2InstrInfo.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/Nios2/Nios2InstrInfo.h head/contrib/llvm/lib/Target/Nios2/Nios2MCInstLower.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/Nios2/Nios2MCInstLower.cpp head/contrib/llvm/lib/Target/Nios2/Nios2MachineFunction.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/Nios2/Nios2MachineFunction.cpp head/contrib/llvm/lib/Target/Nios2/Nios2MachineFunction.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/Nios2/Nios2MachineFunction.h head/contrib/llvm/lib/Target/Nios2/Nios2RegisterInfo.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/Nios2/Nios2RegisterInfo.cpp head/contrib/llvm/lib/Target/Nios2/Nios2RegisterInfo.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/Nios2/Nios2RegisterInfo.h head/contrib/llvm/lib/Target/Nios2/Nios2Schedule.td - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/Nios2/Nios2Schedule.td head/contrib/llvm/lib/Target/Nios2/Nios2Subtarget.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/Nios2/Nios2Subtarget.cpp head/contrib/llvm/lib/Target/Nios2/Nios2Subtarget.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/Nios2/Nios2Subtarget.h head/contrib/llvm/lib/Target/Nios2/Nios2TargetObjectFile.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/Nios2/Nios2TargetObjectFile.cpp head/contrib/llvm/lib/Target/Nios2/Nios2TargetObjectFile.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/Nios2/Nios2TargetObjectFile.h head/contrib/llvm/lib/Target/Nios2/Nios2TargetStreamer.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/Nios2/Nios2TargetStreamer.h head/contrib/llvm/lib/Target/PowerPC/PPCBranchCoalescing.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/PowerPC/PPCBranchCoalescing.cpp head/contrib/llvm/lib/Target/PowerPC/PPCMachineBasicBlockUtils.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/PowerPC/PPCMachineBasicBlockUtils.h head/contrib/llvm/lib/Target/PowerPC/PPCPreEmitPeephole.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/PowerPC/PPCPreEmitPeephole.cpp head/contrib/llvm/lib/Target/PowerPC/PPCReduceCRLogicals.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/PowerPC/PPCReduceCRLogicals.cpp head/contrib/llvm/lib/Target/RISCV/AsmParser/ - copied from r327933, projects/clang600-import/contrib/llvm/lib/Target/RISCV/AsmParser/ head/contrib/llvm/lib/Target/RISCV/Disassembler/ - copied from r327933, projects/clang600-import/contrib/llvm/lib/Target/RISCV/Disassembler/ head/contrib/llvm/lib/Target/RISCV/InstPrinter/ - copied from r327933, projects/clang600-import/contrib/llvm/lib/Target/RISCV/InstPrinter/ head/contrib/llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.h head/contrib/llvm/lib/Target/RISCV/MCTargetDesc/RISCVFixupKinds.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/RISCV/MCTargetDesc/RISCVFixupKinds.h head/contrib/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCExpr.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCExpr.cpp head/contrib/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCExpr.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCExpr.h head/contrib/llvm/lib/Target/RISCV/RISCV.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/RISCV/RISCV.h head/contrib/llvm/lib/Target/RISCV/RISCVAsmPrinter.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/RISCV/RISCVAsmPrinter.cpp head/contrib/llvm/lib/Target/RISCV/RISCVCallingConv.td - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/RISCV/RISCVCallingConv.td head/contrib/llvm/lib/Target/RISCV/RISCVFrameLowering.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/RISCV/RISCVFrameLowering.cpp head/contrib/llvm/lib/Target/RISCV/RISCVFrameLowering.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/RISCV/RISCVFrameLowering.h head/contrib/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp head/contrib/llvm/lib/Target/RISCV/RISCVISelLowering.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/RISCV/RISCVISelLowering.cpp head/contrib/llvm/lib/Target/RISCV/RISCVISelLowering.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/RISCV/RISCVISelLowering.h head/contrib/llvm/lib/Target/RISCV/RISCVInstrFormatsC.td - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/RISCV/RISCVInstrFormatsC.td head/contrib/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp head/contrib/llvm/lib/Target/RISCV/RISCVInstrInfo.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/RISCV/RISCVInstrInfo.h head/contrib/llvm/lib/Target/RISCV/RISCVInstrInfoA.td - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/RISCV/RISCVInstrInfoA.td head/contrib/llvm/lib/Target/RISCV/RISCVInstrInfoC.td - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/RISCV/RISCVInstrInfoC.td head/contrib/llvm/lib/Target/RISCV/RISCVInstrInfoD.td - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/RISCV/RISCVInstrInfoD.td head/contrib/llvm/lib/Target/RISCV/RISCVInstrInfoF.td - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/RISCV/RISCVInstrInfoF.td head/contrib/llvm/lib/Target/RISCV/RISCVInstrInfoM.td - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/RISCV/RISCVInstrInfoM.td head/contrib/llvm/lib/Target/RISCV/RISCVMCInstLower.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/RISCV/RISCVMCInstLower.cpp head/contrib/llvm/lib/Target/RISCV/RISCVRegisterInfo.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/RISCV/RISCVRegisterInfo.cpp head/contrib/llvm/lib/Target/RISCV/RISCVRegisterInfo.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/RISCV/RISCVRegisterInfo.h head/contrib/llvm/lib/Target/RISCV/RISCVSubtarget.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/RISCV/RISCVSubtarget.cpp head/contrib/llvm/lib/Target/RISCV/RISCVSubtarget.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/RISCV/RISCVSubtarget.h head/contrib/llvm/lib/Target/WebAssembly/WebAssemblyLowerGlobalDtors.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/WebAssembly/WebAssemblyLowerGlobalDtors.cpp head/contrib/llvm/lib/Target/X86/MCTargetDesc/X86TargetStreamer.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/X86/MCTargetDesc/X86TargetStreamer.h head/contrib/llvm/lib/Target/X86/MCTargetDesc/X86WinCOFFTargetStreamer.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/X86/MCTargetDesc/X86WinCOFFTargetStreamer.cpp head/contrib/llvm/lib/Target/X86/X86DomainReassignment.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/X86/X86DomainReassignment.cpp head/contrib/llvm/lib/Target/X86/X86InstrVecCompiler.td - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/X86/X86InstrVecCompiler.td head/contrib/llvm/lib/Target/X86/X86SchedBroadwell.td - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/X86/X86SchedBroadwell.td head/contrib/llvm/lib/Target/X86/X86SchedSkylakeClient.td - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/X86/X86SchedSkylakeClient.td head/contrib/llvm/lib/Target/X86/X86SchedSkylakeServer.td - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Target/X86/X86SchedSkylakeServer.td head/contrib/llvm/lib/Transforms/IPO/CalledValuePropagation.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Transforms/IPO/CalledValuePropagation.cpp head/contrib/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp head/contrib/llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp head/contrib/llvm/lib/Transforms/Scalar/DivRemPairs.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Transforms/Scalar/DivRemPairs.cpp head/contrib/llvm/lib/Transforms/Scalar/MergeICmps.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Transforms/Scalar/MergeICmps.cpp head/contrib/llvm/lib/Transforms/Scalar/SpeculateAroundPHIs.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Transforms/Scalar/SpeculateAroundPHIs.cpp head/contrib/llvm/lib/Transforms/Utils/CallPromotionUtils.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Transforms/Utils/CallPromotionUtils.cpp head/contrib/llvm/lib/Transforms/Utils/EntryExitInstrumenter.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Transforms/Utils/EntryExitInstrumenter.cpp head/contrib/llvm/lib/Transforms/Vectorize/VPlan.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Transforms/Vectorize/VPlan.cpp head/contrib/llvm/lib/Transforms/Vectorize/VPlan.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Transforms/Vectorize/VPlan.h head/contrib/llvm/lib/Transforms/Vectorize/VPlanBuilder.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Transforms/Vectorize/VPlanBuilder.h head/contrib/llvm/lib/Transforms/Vectorize/VPlanValue.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/lib/Transforms/Vectorize/VPlanValue.h head/contrib/llvm/lib/WindowsManifest/ - copied from r327933, projects/clang600-import/contrib/llvm/lib/WindowsManifest/ head/contrib/llvm/tools/clang/include/clang/AST/DataCollection.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/include/clang/AST/DataCollection.h head/contrib/llvm/tools/clang/include/clang/AST/LexicallyOrderedRecursiveASTVisitor.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/include/clang/AST/LexicallyOrderedRecursiveASTVisitor.h head/contrib/llvm/tools/clang/include/clang/AST/QualTypeNames.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/include/clang/AST/QualTypeNames.h head/contrib/llvm/tools/clang/include/clang/AST/StmtDataCollectors.td - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/include/clang/AST/StmtDataCollectors.td head/contrib/llvm/tools/clang/include/clang/Analysis/AnalysisDeclContext.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/include/clang/Analysis/AnalysisDeclContext.h head/contrib/llvm/tools/clang/include/clang/Analysis/BodyFarm.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/include/clang/Analysis/BodyFarm.h head/contrib/llvm/tools/clang/include/clang/Basic/AlignedAllocation.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/include/clang/Basic/AlignedAllocation.h head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticCrossTUKinds.td - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticCrossTUKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticError.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticError.h head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticRefactoringKinds.td - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticRefactoringKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/SanitizerSpecialCaseList.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/include/clang/Basic/SanitizerSpecialCaseList.h head/contrib/llvm/tools/clang/include/clang/Basic/SyncScope.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/include/clang/Basic/SyncScope.h head/contrib/llvm/tools/clang/include/clang/Basic/X86Target.def - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/include/clang/Basic/X86Target.def head/contrib/llvm/tools/clang/include/clang/CrossTU/ - copied from r327933, projects/clang600-import/contrib/llvm/tools/clang/include/clang/CrossTU/ head/contrib/llvm/tools/clang/include/clang/Lex/VariadicMacroSupport.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/include/clang/Lex/VariadicMacroSupport.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/LoopUnrolling.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/LoopUnrolling.h head/contrib/llvm/tools/clang/include/clang/Tooling/ASTDiff/ - copied from r327933, projects/clang600-import/contrib/llvm/tools/clang/include/clang/Tooling/ASTDiff/ head/contrib/llvm/tools/clang/include/clang/Tooling/Execution.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/include/clang/Tooling/Execution.h head/contrib/llvm/tools/clang/include/clang/Tooling/Refactoring/ASTSelection.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/include/clang/Tooling/Refactoring/ASTSelection.h head/contrib/llvm/tools/clang/include/clang/Tooling/Refactoring/Extract/ - copied from r327933, projects/clang600-import/contrib/llvm/tools/clang/include/clang/Tooling/Refactoring/Extract/ head/contrib/llvm/tools/clang/include/clang/Tooling/Refactoring/RefactoringAction.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/include/clang/Tooling/Refactoring/RefactoringAction.h head/contrib/llvm/tools/clang/include/clang/Tooling/Refactoring/RefactoringActionRule.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/include/clang/Tooling/Refactoring/RefactoringActionRule.h head/contrib/llvm/tools/clang/include/clang/Tooling/Refactoring/RefactoringActionRuleRequirements.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/include/clang/Tooling/Refactoring/RefactoringActionRuleRequirements.h head/contrib/llvm/tools/clang/include/clang/Tooling/Refactoring/RefactoringActionRules.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/include/clang/Tooling/Refactoring/RefactoringActionRules.h head/contrib/llvm/tools/clang/include/clang/Tooling/Refactoring/RefactoringActionRulesInternal.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/include/clang/Tooling/Refactoring/RefactoringActionRulesInternal.h head/contrib/llvm/tools/clang/include/clang/Tooling/Refactoring/RefactoringDiagnostic.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/include/clang/Tooling/Refactoring/RefactoringDiagnostic.h head/contrib/llvm/tools/clang/include/clang/Tooling/Refactoring/RefactoringOption.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/include/clang/Tooling/Refactoring/RefactoringOption.h head/contrib/llvm/tools/clang/include/clang/Tooling/Refactoring/RefactoringOptionVisitor.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/include/clang/Tooling/Refactoring/RefactoringOptionVisitor.h head/contrib/llvm/tools/clang/include/clang/Tooling/Refactoring/RefactoringOptions.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/include/clang/Tooling/Refactoring/RefactoringOptions.h head/contrib/llvm/tools/clang/include/clang/Tooling/Refactoring/RefactoringResultConsumer.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/include/clang/Tooling/Refactoring/RefactoringResultConsumer.h head/contrib/llvm/tools/clang/include/clang/Tooling/Refactoring/RefactoringRuleContext.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/include/clang/Tooling/Refactoring/RefactoringRuleContext.h head/contrib/llvm/tools/clang/include/clang/Tooling/Refactoring/Rename/SymbolName.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/include/clang/Tooling/Refactoring/Rename/SymbolName.h head/contrib/llvm/tools/clang/include/clang/Tooling/Refactoring/Rename/SymbolOccurrences.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/include/clang/Tooling/Refactoring/Rename/SymbolOccurrences.h head/contrib/llvm/tools/clang/include/clang/Tooling/StandaloneExecution.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/include/clang/Tooling/StandaloneExecution.h head/contrib/llvm/tools/clang/include/clang/Tooling/ToolExecutorPluginRegistry.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/include/clang/Tooling/ToolExecutorPluginRegistry.h head/contrib/llvm/tools/clang/lib/AST/DataCollection.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/lib/AST/DataCollection.cpp head/contrib/llvm/tools/clang/lib/AST/Linkage.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/lib/AST/Linkage.h head/contrib/llvm/tools/clang/lib/AST/QualTypeNames.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/lib/AST/QualTypeNames.cpp head/contrib/llvm/tools/clang/lib/Basic/SanitizerSpecialCaseList.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/lib/Basic/SanitizerSpecialCaseList.cpp head/contrib/llvm/tools/clang/lib/Basic/Targets/ - copied from r327933, projects/clang600-import/contrib/llvm/tools/clang/lib/Basic/Targets/ head/contrib/llvm/tools/clang/lib/Basic/Targets.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/lib/Basic/Targets.h head/contrib/llvm/tools/clang/lib/CodeGen/ConstantEmitter.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/lib/CodeGen/ConstantEmitter.h head/contrib/llvm/tools/clang/lib/CrossTU/ - copied from r327933, projects/clang600-import/contrib/llvm/tools/clang/lib/CrossTU/ head/contrib/llvm/tools/clang/lib/Format/FormatInternal.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/lib/Format/FormatInternal.h head/contrib/llvm/tools/clang/lib/Headers/arm64intr.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/lib/Headers/arm64intr.h head/contrib/llvm/tools/clang/lib/Headers/avx512bitalgintrin.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/lib/Headers/avx512bitalgintrin.h head/contrib/llvm/tools/clang/lib/Headers/avx512vbmi2intrin.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/lib/Headers/avx512vbmi2intrin.h head/contrib/llvm/tools/clang/lib/Headers/avx512vlbitalgintrin.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/lib/Headers/avx512vlbitalgintrin.h head/contrib/llvm/tools/clang/lib/Headers/avx512vlvbmi2intrin.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/lib/Headers/avx512vlvbmi2intrin.h head/contrib/llvm/tools/clang/lib/Headers/avx512vlvnniintrin.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/lib/Headers/avx512vlvnniintrin.h head/contrib/llvm/tools/clang/lib/Headers/avx512vnniintrin.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/lib/Headers/avx512vnniintrin.h head/contrib/llvm/tools/clang/lib/Headers/avx512vpopcntdqvlintrin.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/lib/Headers/avx512vpopcntdqvlintrin.h head/contrib/llvm/tools/clang/lib/Headers/cetintrin.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/lib/Headers/cetintrin.h head/contrib/llvm/tools/clang/lib/Headers/clwbintrin.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/lib/Headers/clwbintrin.h head/contrib/llvm/tools/clang/lib/Headers/gfniintrin.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/lib/Headers/gfniintrin.h head/contrib/llvm/tools/clang/lib/Headers/vaesintrin.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/lib/Headers/vaesintrin.h head/contrib/llvm/tools/clang/lib/Headers/vpclmulqdqintrin.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/lib/Headers/vpclmulqdqintrin.h head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/DeleteWithNonVirtualDtorChecker.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/DeleteWithNonVirtualDtorChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/NonnullGlobalConstantsChecker.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/NonnullGlobalConstantsChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/LoopUnrolling.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/LoopUnrolling.cpp head/contrib/llvm/tools/clang/lib/Tooling/ASTDiff/ - copied from r327933, projects/clang600-import/contrib/llvm/tools/clang/lib/Tooling/ASTDiff/ head/contrib/llvm/tools/clang/lib/Tooling/Execution.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/lib/Tooling/Execution.cpp head/contrib/llvm/tools/clang/lib/Tooling/Refactoring/ASTSelection.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/lib/Tooling/Refactoring/ASTSelection.cpp head/contrib/llvm/tools/clang/lib/Tooling/Refactoring/ASTSelectionRequirements.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/lib/Tooling/Refactoring/ASTSelectionRequirements.cpp head/contrib/llvm/tools/clang/lib/Tooling/Refactoring/Extract/ - copied from r327933, projects/clang600-import/contrib/llvm/tools/clang/lib/Tooling/Refactoring/Extract/ head/contrib/llvm/tools/clang/lib/Tooling/Refactoring/RefactoringActions.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/lib/Tooling/Refactoring/RefactoringActions.cpp head/contrib/llvm/tools/clang/lib/Tooling/Refactoring/Rename/SymbolOccurrences.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/lib/Tooling/Refactoring/Rename/SymbolOccurrences.cpp head/contrib/llvm/tools/clang/lib/Tooling/StandaloneExecution.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/lib/Tooling/StandaloneExecution.cpp head/contrib/llvm/tools/clang/utils/TableGen/ClangDataCollectorsEmitter.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/clang/utils/TableGen/ClangDataCollectorsEmitter.cpp head/contrib/llvm/tools/lld/COFF/MinGW.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/lld/COFF/MinGW.cpp head/contrib/llvm/tools/lld/COFF/MinGW.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/lld/COFF/MinGW.h head/contrib/llvm/tools/lld/Common/ - copied from r327933, projects/clang600-import/contrib/llvm/tools/lld/Common/ head/contrib/llvm/tools/lld/ELF/AArch64ErrataFix.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/lld/ELF/AArch64ErrataFix.cpp head/contrib/llvm/tools/lld/ELF/AArch64ErrataFix.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/lld/ELF/AArch64ErrataFix.h head/contrib/llvm/tools/lld/ELF/Bits.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/lld/ELF/Bits.h head/contrib/llvm/tools/lld/include/lld/Common/ - copied from r327933, projects/clang600-import/contrib/llvm/tools/lld/include/lld/Common/ head/contrib/llvm/tools/lldb/include/lldb/API/SBBreakpointName.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/lldb/include/lldb/API/SBBreakpointName.h head/contrib/llvm/tools/lldb/include/lldb/API/SBProcessInfo.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/lldb/include/lldb/API/SBProcessInfo.h head/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointName.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointName.h head/contrib/llvm/tools/lldb/include/lldb/Core/Architecture.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/lldb/include/lldb/Core/Architecture.h head/contrib/llvm/tools/lldb/include/lldb/Host/TaskPool.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/lldb/include/lldb/Host/TaskPool.h head/contrib/llvm/tools/lldb/include/lldb/Utility/ArchSpec.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/lldb/include/lldb/Utility/ArchSpec.h head/contrib/llvm/tools/lldb/source/API/SBBreakpointName.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/lldb/source/API/SBBreakpointName.cpp head/contrib/llvm/tools/lldb/source/API/SBBreakpointOptionCommon.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/lldb/source/API/SBBreakpointOptionCommon.cpp head/contrib/llvm/tools/lldb/source/API/SBBreakpointOptionCommon.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/lldb/source/API/SBBreakpointOptionCommon.h head/contrib/llvm/tools/lldb/source/API/SBProcessInfo.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/lldb/source/API/SBProcessInfo.cpp head/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointName.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointName.cpp head/contrib/llvm/tools/lldb/source/Host/common/TaskPool.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/lldb/source/Host/common/TaskPool.cpp head/contrib/llvm/tools/lldb/source/Plugins/Architecture/ - copied from r327933, projects/clang600-import/contrib/llvm/tools/lldb/source/Plugins/Architecture/ head/contrib/llvm/tools/lldb/source/Plugins/Language/CPlusPlus/LibCxxBitset.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/lldb/source/Plugins/Language/CPlusPlus/LibCxxBitset.cpp head/contrib/llvm/tools/lldb/source/Plugins/Language/CPlusPlus/LibCxxQueue.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/lldb/source/Plugins/Language/CPlusPlus/LibCxxQueue.cpp head/contrib/llvm/tools/lldb/source/Plugins/Language/CPlusPlus/LibCxxTuple.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/lldb/source/Plugins/Language/CPlusPlus/LibCxxTuple.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_ppc64le.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_ppc64le.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_ppc64le.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_ppc64le.h head/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_ppc64le.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_ppc64le.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_ppc64le.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_ppc64le.h head/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterInfos_ppc64le.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterInfos_ppc64le.h head/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/lldb-ppc64le-register-enums.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/lldb-ppc64le-register-enums.h head/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_ppc64le.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_ppc64le.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_ppc64le.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_ppc64le.h head/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/RegisterUtilities.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/RegisterUtilities.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/RegisterUtilities.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/RegisterUtilities.h head/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwoDwp.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwoDwp.cpp head/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwoDwp.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwoDwp.h head/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwp.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwp.cpp head/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwp.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwp.h head/contrib/llvm/tools/lldb/source/Utility/ArchSpec.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/lldb/source/Utility/ArchSpec.cpp head/contrib/llvm/tools/lldb/source/Utility/PPC64LE_DWARF_Registers.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/lldb/source/Utility/PPC64LE_DWARF_Registers.h head/contrib/llvm/tools/lldb/source/Utility/PPC64LE_ehframe_Registers.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/lldb/source/Utility/PPC64LE_ehframe_Registers.h head/contrib/llvm/tools/llvm-dwarfdump/Statistics.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/llvm-dwarfdump/Statistics.cpp head/contrib/llvm/tools/llvm-objcopy/ - copied from r327933, projects/clang600-import/contrib/llvm/tools/llvm-objcopy/ head/contrib/llvm/tools/llvm-pdbutil/InputFile.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/llvm-pdbutil/InputFile.cpp head/contrib/llvm/tools/llvm-pdbutil/InputFile.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/llvm-pdbutil/InputFile.h head/contrib/llvm/tools/llvm-readobj/WindowsResourceDumper.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/llvm-readobj/WindowsResourceDumper.cpp head/contrib/llvm/tools/llvm-readobj/WindowsResourceDumper.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/llvm-readobj/WindowsResourceDumper.h head/contrib/llvm/tools/llvm-xray/trie-node.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/llvm-xray/trie-node.h head/contrib/llvm/tools/llvm-xray/xray-stacks.cc - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/llvm-xray/xray-stacks.cc head/contrib/llvm/tools/opt/Debugify.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/tools/opt/Debugify.cpp head/contrib/llvm/utils/TableGen/CodeGenHwModes.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/utils/TableGen/CodeGenHwModes.cpp head/contrib/llvm/utils/TableGen/CodeGenHwModes.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/utils/TableGen/CodeGenHwModes.h head/contrib/llvm/utils/TableGen/InfoByHwMode.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/utils/TableGen/InfoByHwMode.cpp head/contrib/llvm/utils/TableGen/InfoByHwMode.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/utils/TableGen/InfoByHwMode.h head/contrib/llvm/utils/TableGen/InstrDocsEmitter.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/utils/TableGen/InstrDocsEmitter.cpp head/contrib/llvm/utils/TableGen/SDNodeProperties.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/utils/TableGen/SDNodeProperties.cpp head/contrib/llvm/utils/TableGen/SDNodeProperties.h - copied unchanged from r327933, projects/clang600-import/contrib/llvm/utils/TableGen/SDNodeProperties.h head/contrib/llvm/utils/TableGen/X86FoldTablesEmitter.cpp - copied unchanged from r327933, projects/clang600-import/contrib/llvm/utils/TableGen/X86FoldTablesEmitter.cpp head/lib/clang/include/lld/Common/ - copied from r327933, projects/clang600-import/lib/clang/include/lld/Common/ head/lib/libclang_rt/tsan/ - copied from r327933, projects/clang600-import/lib/libclang_rt/tsan/ head/lib/libclang_rt/tsan_cxx/ - copied from r327933, projects/clang600-import/lib/libclang_rt/tsan_cxx/ head/lib/libclang_rt/ubsan_minimal/ - copied from r327933, projects/clang600-import/lib/libclang_rt/ubsan_minimal/ head/usr.bin/clang/llvm-objcopy/ - copied from r327933, projects/clang600-import/usr.bin/clang/llvm-objcopy/ head/usr.bin/clang/llvm-pdbutil/llvm-pdbutil.1 - copied unchanged from r327933, projects/clang600-import/usr.bin/clang/llvm-pdbutil/llvm-pdbutil.1 Deleted: head/contrib/compiler-rt/lib/scudo/scudo_tls.h head/contrib/compiler-rt/lib/scudo/scudo_tls_android.cpp head/contrib/compiler-rt/lib/scudo/scudo_tls_android.inc head/contrib/compiler-rt/lib/scudo/scudo_tls_context_android.inc head/contrib/compiler-rt/lib/scudo/scudo_tls_context_linux.inc head/contrib/compiler-rt/lib/scudo/scudo_tls_linux.cpp head/contrib/compiler-rt/lib/scudo/scudo_tls_linux.inc head/contrib/compiler-rt/lib/tsan/rtl/tsan_vector.h head/contrib/llvm/include/llvm/Analysis/OptimizationDiagnosticInfo.h head/contrib/llvm/include/llvm/BinaryFormat/WasmRelocs/WebAssembly.def head/contrib/llvm/include/llvm/CodeGen/CommandFlags.h head/contrib/llvm/include/llvm/CodeGen/GlobalISel/GISelAccessor.h head/contrib/llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h head/contrib/llvm/include/llvm/CodeGen/LiveStackAnalysis.h head/contrib/llvm/include/llvm/DebugInfo/CodeView/TypeName.h head/contrib/llvm/include/llvm/DebugInfo/CodeView/TypeRecordBuilder.h head/contrib/llvm/include/llvm/DebugInfo/CodeView/TypeSerializer.h head/contrib/llvm/include/llvm/DebugInfo/CodeView/TypeTableBuilder.h head/contrib/llvm/include/llvm/DebugInfo/MSF/MSFStreamLayout.h head/contrib/llvm/include/llvm/DebugInfo/PDB/Native/PublicsStreamBuilder.h head/contrib/llvm/include/llvm/MC/MCTargetOptionsCommandFlags.h head/contrib/llvm/include/llvm/Support/AMDGPUCodeObjectMetadata.h head/contrib/llvm/include/llvm/Support/GCOV.h head/contrib/llvm/include/llvm/Target/CostTable.h head/contrib/llvm/include/llvm/Target/TargetCallingConv.h head/contrib/llvm/include/llvm/Target/TargetFrameLowering.h head/contrib/llvm/include/llvm/Target/TargetInstrInfo.h head/contrib/llvm/include/llvm/Target/TargetLowering.h head/contrib/llvm/include/llvm/Target/TargetLoweringObjectFile.h head/contrib/llvm/include/llvm/Target/TargetOpcodes.def head/contrib/llvm/include/llvm/Target/TargetOpcodes.h head/contrib/llvm/include/llvm/Target/TargetRegisterInfo.h head/contrib/llvm/include/llvm/Target/TargetSubtargetInfo.h head/contrib/llvm/include/llvm/Transforms/Utils/CmpInstAnalysis.h head/contrib/llvm/lib/Analysis/OptimizationDiagnosticInfo.cpp head/contrib/llvm/lib/Analysis/SparsePropagation.cpp head/contrib/llvm/lib/CodeGen/BranchCoalescing.cpp head/contrib/llvm/lib/CodeGen/CountingFunctionInserter.cpp head/contrib/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp head/contrib/llvm/lib/CodeGen/LiveStackAnalysis.cpp head/contrib/llvm/lib/DebugInfo/CodeView/TypeName.cpp head/contrib/llvm/lib/DebugInfo/CodeView/TypeSerializer.cpp head/contrib/llvm/lib/DebugInfo/PDB/Native/GSI.cpp head/contrib/llvm/lib/DebugInfo/PDB/Native/GSI.h head/contrib/llvm/lib/DebugInfo/PDB/Native/PublicsStreamBuilder.cpp head/contrib/llvm/lib/IR/GCOV.cpp head/contrib/llvm/lib/Support/AMDGPUCodeObjectMetadata.cpp head/contrib/llvm/lib/Support/regcclass.h head/contrib/llvm/lib/Support/regcname.h head/contrib/llvm/lib/Target/AArch64/AArch64VectorByElementOpt.cpp head/contrib/llvm/lib/Target/AMDGPU/CIInstructions.td head/contrib/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUCodeObjectMetadataStreamer.cpp head/contrib/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUCodeObjectMetadataStreamer.h head/contrib/llvm/lib/Target/AMDGPU/SIFixControlFlowLiveIntervals.cpp head/contrib/llvm/lib/Target/AVR/AVRInstrumentFunctions.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonIntrinsicsDerived.td head/contrib/llvm/lib/Target/Mips/MicroMips64r6InstrFormats.td head/contrib/llvm/lib/Target/Mips/MicroMips64r6InstrInfo.td head/contrib/llvm/lib/Target/NVPTX/NVPTXVector.td head/contrib/llvm/lib/Target/PowerPC/p9-instrs.txt head/contrib/llvm/lib/Transforms/Utils/CmpInstAnalysis.cpp head/contrib/llvm/tools/clang/include/clang/Analysis/AnalysisContext.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitor.h head/contrib/llvm/tools/clang/include/clang/Tooling/Core/QualTypeNames.h head/contrib/llvm/tools/clang/lib/Analysis/BodyFarm.h head/contrib/llvm/tools/clang/lib/Driver/ToolChains/Bitrig.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/Bitrig.h head/contrib/llvm/tools/clang/lib/Tooling/Core/QualTypeNames.cpp head/contrib/llvm/tools/lld/COFF/Error.cpp head/contrib/llvm/tools/lld/COFF/Error.h head/contrib/llvm/tools/lld/COFF/Memory.h head/contrib/llvm/tools/lld/ELF/Error.cpp head/contrib/llvm/tools/lld/ELF/Error.h head/contrib/llvm/tools/lld/ELF/Memory.h head/contrib/llvm/tools/lld/ELF/Threads.h head/contrib/llvm/tools/lld/include/lld/Config/ head/contrib/llvm/tools/lld/include/lld/Core/LLVM.h head/contrib/llvm/tools/lld/include/lld/Core/Reproduce.h head/contrib/llvm/tools/lld/include/lld/Core/TargetOptionsCommandFlags.h head/contrib/llvm/tools/lld/include/lld/Driver/ head/contrib/llvm/tools/lld/lib/Config/ head/contrib/llvm/tools/lld/lib/Core/Reproduce.cpp head/contrib/llvm/tools/lld/lib/Core/TargetOptionsCommandFlags.cpp head/contrib/llvm/tools/lld/utils/ head/contrib/llvm/tools/lldb/include/lldb/Core/ArchSpec.h head/contrib/llvm/tools/lldb/include/lldb/Utility/TaskPool.h head/contrib/llvm/tools/lldb/source/Core/ArchSpec.cpp head/contrib/llvm/tools/lldb/source/Plugins/InstrumentationRuntime/ASan/CMakeLists.txt head/contrib/llvm/tools/lldb/source/Plugins/InstrumentationRuntime/MainThreadChecker/CMakeLists.txt head/contrib/llvm/tools/lldb/source/Plugins/InstrumentationRuntime/TSan/CMakeLists.txt head/contrib/llvm/tools/lldb/source/Plugins/InstrumentationRuntime/UBSan/CMakeLists.txt head/contrib/llvm/tools/lldb/source/Plugins/Language/OCaml/CMakeLists.txt head/contrib/llvm/tools/lldb/source/Plugins/Platform/OpenBSD/CMakeLists.txt head/contrib/llvm/tools/lldb/source/Plugins/Process/NetBSD/CMakeLists.txt head/contrib/llvm/tools/lldb/source/Plugins/Process/minidump/CMakeLists.txt head/contrib/llvm/tools/lldb/source/Plugins/StructuredData/CMakeLists.txt head/contrib/llvm/tools/lldb/source/Plugins/StructuredData/DarwinLog/CMakeLists.txt head/contrib/llvm/tools/lldb/source/Utility/TaskPool.cpp head/contrib/llvm/tools/lldb/tools/intel-mpx/IntelMPXTablePlugin.cpp head/contrib/llvm/tools/llvm-xray/xray-record-yaml.h head/lib/clang/include/lld/Config/ Modified: head/ObsoleteFiles.inc head/UPDATING head/contrib/compiler-rt/include/sanitizer/allocator_interface.h head/contrib/compiler-rt/include/sanitizer/asan_interface.h head/contrib/compiler-rt/include/sanitizer/common_interface_defs.h head/contrib/compiler-rt/include/sanitizer/coverage_interface.h head/contrib/compiler-rt/include/sanitizer/esan_interface.h head/contrib/compiler-rt/include/sanitizer/lsan_interface.h head/contrib/compiler-rt/include/sanitizer/msan_interface.h head/contrib/compiler-rt/include/sanitizer/tsan_interface.h head/contrib/compiler-rt/include/xray/xray_interface.h head/contrib/compiler-rt/include/xray/xray_log_interface.h head/contrib/compiler-rt/include/xray/xray_records.h head/contrib/compiler-rt/lib/BlocksRuntime/Block.h head/contrib/compiler-rt/lib/BlocksRuntime/Block_private.h head/contrib/compiler-rt/lib/asan/asan_activation.cc head/contrib/compiler-rt/lib/asan/asan_allocator.cc head/contrib/compiler-rt/lib/asan/asan_allocator.h head/contrib/compiler-rt/lib/asan/asan_descriptions.cc head/contrib/compiler-rt/lib/asan/asan_descriptions.h head/contrib/compiler-rt/lib/asan/asan_errors.cc head/contrib/compiler-rt/lib/asan/asan_errors.h head/contrib/compiler-rt/lib/asan/asan_fake_stack.cc head/contrib/compiler-rt/lib/asan/asan_flags.cc head/contrib/compiler-rt/lib/asan/asan_flags.inc head/contrib/compiler-rt/lib/asan/asan_globals.cc head/contrib/compiler-rt/lib/asan/asan_init_version.h head/contrib/compiler-rt/lib/asan/asan_interceptors.cc head/contrib/compiler-rt/lib/asan/asan_interceptors.h head/contrib/compiler-rt/lib/asan/asan_internal.h head/contrib/compiler-rt/lib/asan/asan_linux.cc head/contrib/compiler-rt/lib/asan/asan_malloc_linux.cc head/contrib/compiler-rt/lib/asan/asan_mapping.h head/contrib/compiler-rt/lib/asan/asan_memory_profile.cc head/contrib/compiler-rt/lib/asan/asan_new_delete.cc head/contrib/compiler-rt/lib/asan/asan_poisoning.cc head/contrib/compiler-rt/lib/asan/asan_poisoning.h head/contrib/compiler-rt/lib/asan/asan_posix.cc head/contrib/compiler-rt/lib/asan/asan_report.cc head/contrib/compiler-rt/lib/asan/asan_report.h head/contrib/compiler-rt/lib/asan/asan_rtl.cc head/contrib/compiler-rt/lib/asan/asan_scariness_score.h head/contrib/compiler-rt/lib/asan/asan_stack.h head/contrib/compiler-rt/lib/asan/asan_thread.cc head/contrib/compiler-rt/lib/asan/asan_thread.h head/contrib/compiler-rt/lib/asan/asan_win.cc head/contrib/compiler-rt/lib/builtins/adddf3.c head/contrib/compiler-rt/lib/builtins/addsf3.c head/contrib/compiler-rt/lib/builtins/arm/aeabi_cdcmp.S head/contrib/compiler-rt/lib/builtins/arm/aeabi_cfcmp.S head/contrib/compiler-rt/lib/builtins/arm/aeabi_idivmod.S head/contrib/compiler-rt/lib/builtins/arm/aeabi_memcmp.S head/contrib/compiler-rt/lib/builtins/arm/aeabi_memcpy.S head/contrib/compiler-rt/lib/builtins/arm/aeabi_memmove.S head/contrib/compiler-rt/lib/builtins/arm/aeabi_memset.S head/contrib/compiler-rt/lib/builtins/arm/aeabi_uidivmod.S head/contrib/compiler-rt/lib/builtins/arm/bswapdi2.S head/contrib/compiler-rt/lib/builtins/arm/bswapsi2.S head/contrib/compiler-rt/lib/builtins/arm/clzdi2.S head/contrib/compiler-rt/lib/builtins/arm/clzsi2.S head/contrib/compiler-rt/lib/builtins/arm/comparesf2.S head/contrib/compiler-rt/lib/builtins/arm/divmodsi4.S head/contrib/compiler-rt/lib/builtins/arm/divsi3.S head/contrib/compiler-rt/lib/builtins/arm/modsi3.S head/contrib/compiler-rt/lib/builtins/arm/udivmodsi4.S head/contrib/compiler-rt/lib/builtins/arm/udivsi3.S head/contrib/compiler-rt/lib/builtins/arm/umodsi3.S head/contrib/compiler-rt/lib/builtins/ashldi3.c head/contrib/compiler-rt/lib/builtins/ashrdi3.c head/contrib/compiler-rt/lib/builtins/assembly.h head/contrib/compiler-rt/lib/builtins/clear_cache.c head/contrib/compiler-rt/lib/builtins/comparedf2.c head/contrib/compiler-rt/lib/builtins/comparesf2.c head/contrib/compiler-rt/lib/builtins/cpu_model.c head/contrib/compiler-rt/lib/builtins/divdf3.c head/contrib/compiler-rt/lib/builtins/divsf3.c head/contrib/compiler-rt/lib/builtins/divsi3.c head/contrib/compiler-rt/lib/builtins/emutls.c head/contrib/compiler-rt/lib/builtins/enable_execute_stack.c head/contrib/compiler-rt/lib/builtins/extendhfsf2.c head/contrib/compiler-rt/lib/builtins/extendsfdf2.c head/contrib/compiler-rt/lib/builtins/fixdfdi.c head/contrib/compiler-rt/lib/builtins/fixdfsi.c head/contrib/compiler-rt/lib/builtins/fixsfdi.c head/contrib/compiler-rt/lib/builtins/fixsfsi.c head/contrib/compiler-rt/lib/builtins/fixunsdfdi.c head/contrib/compiler-rt/lib/builtins/fixunsdfsi.c head/contrib/compiler-rt/lib/builtins/fixunssfdi.c head/contrib/compiler-rt/lib/builtins/fixunssfsi.c head/contrib/compiler-rt/lib/builtins/floatdidf.c head/contrib/compiler-rt/lib/builtins/floatdisf.c head/contrib/compiler-rt/lib/builtins/floatsidf.c head/contrib/compiler-rt/lib/builtins/floatsisf.c head/contrib/compiler-rt/lib/builtins/floatundidf.c head/contrib/compiler-rt/lib/builtins/floatundisf.c head/contrib/compiler-rt/lib/builtins/floatunsidf.c head/contrib/compiler-rt/lib/builtins/floatunsisf.c head/contrib/compiler-rt/lib/builtins/int_endianness.h head/contrib/compiler-rt/lib/builtins/int_lib.h head/contrib/compiler-rt/lib/builtins/lshrdi3.c head/contrib/compiler-rt/lib/builtins/muldf3.c head/contrib/compiler-rt/lib/builtins/muldi3.c head/contrib/compiler-rt/lib/builtins/mulsf3.c head/contrib/compiler-rt/lib/builtins/negdf2.c head/contrib/compiler-rt/lib/builtins/negsf2.c head/contrib/compiler-rt/lib/builtins/subdf3.c head/contrib/compiler-rt/lib/builtins/subsf3.c head/contrib/compiler-rt/lib/builtins/truncdfhf2.c head/contrib/compiler-rt/lib/builtins/truncdfsf2.c head/contrib/compiler-rt/lib/builtins/truncsfhf2.c head/contrib/compiler-rt/lib/builtins/udivsi3.c head/contrib/compiler-rt/lib/cfi/cfi.cc head/contrib/compiler-rt/lib/cfi/cfi_blacklist.txt head/contrib/compiler-rt/lib/dfsan/dfsan.cc head/contrib/compiler-rt/lib/esan/esan_sideline.h head/contrib/compiler-rt/lib/esan/esan_sideline_linux.cpp head/contrib/compiler-rt/lib/esan/working_set_posix.cpp head/contrib/compiler-rt/lib/interception/interception.h head/contrib/compiler-rt/lib/interception/interception_linux.cc head/contrib/compiler-rt/lib/interception/interception_linux.h head/contrib/compiler-rt/lib/interception/interception_mac.cc head/contrib/compiler-rt/lib/interception/interception_mac.h head/contrib/compiler-rt/lib/interception/interception_type_test.cc head/contrib/compiler-rt/lib/interception/interception_win.cc head/contrib/compiler-rt/lib/interception/interception_win.h head/contrib/compiler-rt/lib/lsan/lsan.cc head/contrib/compiler-rt/lib/lsan/lsan.h head/contrib/compiler-rt/lib/lsan/lsan_allocator.h head/contrib/compiler-rt/lib/lsan/lsan_common.cc head/contrib/compiler-rt/lib/lsan/lsan_common.h head/contrib/compiler-rt/lib/lsan/lsan_common_linux.cc head/contrib/compiler-rt/lib/lsan/lsan_common_mac.cc head/contrib/compiler-rt/lib/lsan/lsan_interceptors.cc head/contrib/compiler-rt/lib/lsan/weak_symbols.txt head/contrib/compiler-rt/lib/msan/msan.cc head/contrib/compiler-rt/lib/msan/msan.h head/contrib/compiler-rt/lib/msan/msan_allocator.cc head/contrib/compiler-rt/lib/msan/msan_interceptors.cc head/contrib/compiler-rt/lib/msan/msan_linux.cc head/contrib/compiler-rt/lib/msan/msan_new_delete.cc head/contrib/compiler-rt/lib/msan/msan_report.cc head/contrib/compiler-rt/lib/profile/GCDAProfiling.c head/contrib/compiler-rt/lib/profile/InstrProfData.inc head/contrib/compiler-rt/lib/profile/InstrProfiling.c head/contrib/compiler-rt/lib/profile/InstrProfilingFile.c head/contrib/compiler-rt/lib/profile/InstrProfilingInternal.h head/contrib/compiler-rt/lib/profile/InstrProfilingPlatformLinux.c head/contrib/compiler-rt/lib/profile/InstrProfilingPlatformOther.c head/contrib/compiler-rt/lib/profile/InstrProfilingPort.h head/contrib/compiler-rt/lib/profile/InstrProfilingUtil.c head/contrib/compiler-rt/lib/profile/InstrProfilingUtil.h head/contrib/compiler-rt/lib/profile/InstrProfilingValue.c head/contrib/compiler-rt/lib/profile/InstrProfilingWriter.c head/contrib/compiler-rt/lib/profile/WindowsMMap.c head/contrib/compiler-rt/lib/safestack/safestack.cc head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_allocator.cc head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_allocator.h head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_allocator_checks.h head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_allocator_combined.h head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_allocator_interface.h head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_allocator_local_cache.h head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_allocator_primary32.h head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_allocator_primary64.h head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_allocator_size_class_map.h head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_asm.h head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_atomic_clang.h head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_atomic_clang_other.h head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_bitvector.h head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_bvgraph.h head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_common.cc head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_common.h head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_common_interface.inc head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_common_libcdep.cc head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_coverage_interface.inc head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_coverage_libcdep_new.cc head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_errno.h head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_flag_parser.h head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_flags.inc head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_interface_internal.h head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_libignore.cc head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_linux.h head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_mac.cc head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_mac.h head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_mac_libcdep.cc head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_mutex.h head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform.h head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_posix.cc head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_posix.h head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cc head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_printf.cc head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_procmaps.h head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_common.cc head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_freebsd.cc head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_linux.cc head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_mac.cc head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_quarantine.h head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_report_decorator.h head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.h head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace_printer.cc head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_mac.cc head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_suppressions.cc head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer.cc head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer.h head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_internal.h head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_libbacktrace.cc head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_libcdep.cc head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_syscall_generic.inc head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_syscall_linux_aarch64.inc head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_syscall_linux_x86_64.inc head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_thread_registry.cc head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_thread_registry.h head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_tls_get_addr.cc head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_unwind_linux_libcdep.cc head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_win.cc head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_win_weak_interception.cc head/contrib/compiler-rt/lib/sanitizer_common/symbolizer/scripts/build_symbolizer.sh head/contrib/compiler-rt/lib/scudo/scudo_allocator.cpp head/contrib/compiler-rt/lib/scudo/scudo_allocator.h head/contrib/compiler-rt/lib/scudo/scudo_allocator_combined.h head/contrib/compiler-rt/lib/scudo/scudo_allocator_secondary.h head/contrib/compiler-rt/lib/scudo/scudo_crc32.h head/contrib/compiler-rt/lib/scudo/scudo_flags.cpp head/contrib/compiler-rt/lib/scudo/scudo_flags.inc head/contrib/compiler-rt/lib/scudo/scudo_new_delete.cpp head/contrib/compiler-rt/lib/scudo/scudo_utils.cpp head/contrib/compiler-rt/lib/scudo/scudo_utils.h head/contrib/compiler-rt/lib/stats/stats.cc head/contrib/compiler-rt/lib/tsan/rtl/tsan_fd.cc head/contrib/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc head/contrib/compiler-rt/lib/tsan/rtl/tsan_interceptors.h head/contrib/compiler-rt/lib/tsan/rtl/tsan_interceptors_mac.cc head/contrib/compiler-rt/lib/tsan/rtl/tsan_interface_ann.cc head/contrib/compiler-rt/lib/tsan/rtl/tsan_libdispatch_mac.cc head/contrib/compiler-rt/lib/tsan/rtl/tsan_malloc_mac.cc head/contrib/compiler-rt/lib/tsan/rtl/tsan_mman.cc head/contrib/compiler-rt/lib/tsan/rtl/tsan_mman.h head/contrib/compiler-rt/lib/tsan/rtl/tsan_new_delete.cc head/contrib/compiler-rt/lib/tsan/rtl/tsan_platform.h head/contrib/compiler-rt/lib/tsan/rtl/tsan_platform_linux.cc head/contrib/compiler-rt/lib/tsan/rtl/tsan_platform_mac.cc head/contrib/compiler-rt/lib/tsan/rtl/tsan_report.cc head/contrib/compiler-rt/lib/tsan/rtl/tsan_report.h head/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl.cc head/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl.h head/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl_aarch64.S head/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl_amd64.S head/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cc head/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cc head/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl_thread.cc head/contrib/compiler-rt/lib/tsan/rtl/tsan_sync.h head/contrib/compiler-rt/lib/tsan/rtl/tsan_trace.h head/contrib/compiler-rt/lib/ubsan/ubsan_checks.inc head/contrib/compiler-rt/lib/ubsan/ubsan_diag.cc head/contrib/compiler-rt/lib/ubsan/ubsan_diag.h head/contrib/compiler-rt/lib/ubsan/ubsan_diag_standalone.cc head/contrib/compiler-rt/lib/ubsan/ubsan_flags.cc head/contrib/compiler-rt/lib/ubsan/ubsan_handlers.cc head/contrib/compiler-rt/lib/ubsan/ubsan_handlers.h head/contrib/compiler-rt/lib/ubsan/ubsan_handlers_cxx.cc head/contrib/compiler-rt/lib/ubsan/ubsan_init.cc head/contrib/compiler-rt/lib/ubsan/ubsan_init_standalone.cc head/contrib/compiler-rt/lib/ubsan/ubsan_interface.inc head/contrib/compiler-rt/lib/ubsan/ubsan_platform.h head/contrib/compiler-rt/lib/xray/xray_buffer_queue.cc head/contrib/compiler-rt/lib/xray/xray_buffer_queue.h head/contrib/compiler-rt/lib/xray/xray_fdr_log_records.h head/contrib/compiler-rt/lib/xray/xray_fdr_logging.cc head/contrib/compiler-rt/lib/xray/xray_fdr_logging.h head/contrib/compiler-rt/lib/xray/xray_fdr_logging_impl.h head/contrib/compiler-rt/lib/xray/xray_flags.h head/contrib/compiler-rt/lib/xray/xray_flags.inc head/contrib/compiler-rt/lib/xray/xray_init.cc head/contrib/compiler-rt/lib/xray/xray_inmemory_log.cc head/contrib/compiler-rt/lib/xray/xray_interface.cc head/contrib/compiler-rt/lib/xray/xray_interface_internal.h head/contrib/compiler-rt/lib/xray/xray_log_interface.cc head/contrib/compiler-rt/lib/xray/xray_trampoline_x86_64.S head/contrib/compiler-rt/lib/xray/xray_utils.cc head/contrib/compiler-rt/lib/xray/xray_x86_64.cc head/contrib/libc++/CREDITS.TXT head/contrib/libc++/include/__config head/contrib/libc++/include/__functional_base head/contrib/libc++/include/__libcpp_version head/contrib/libc++/include/__locale head/contrib/libc++/include/__mutex_base head/contrib/libc++/include/__tree head/contrib/libc++/include/algorithm head/contrib/libc++/include/array head/contrib/libc++/include/bitset head/contrib/libc++/include/chrono head/contrib/libc++/include/cstddef head/contrib/libc++/include/deque head/contrib/libc++/include/exception head/contrib/libc++/include/experimental/algorithm head/contrib/libc++/include/experimental/filesystem head/contrib/libc++/include/experimental/iterator head/contrib/libc++/include/forward_list head/contrib/libc++/include/fstream head/contrib/libc++/include/functional head/contrib/libc++/include/future head/contrib/libc++/include/istream head/contrib/libc++/include/iterator head/contrib/libc++/include/list head/contrib/libc++/include/locale head/contrib/libc++/include/map head/contrib/libc++/include/memory head/contrib/libc++/include/mutex head/contrib/libc++/include/new head/contrib/libc++/include/optional head/contrib/libc++/include/ostream head/contrib/libc++/include/queue head/contrib/libc++/include/random head/contrib/libc++/include/ratio head/contrib/libc++/include/regex head/contrib/libc++/include/scoped_allocator head/contrib/libc++/include/set head/contrib/libc++/include/sstream head/contrib/libc++/include/stack head/contrib/libc++/include/streambuf head/contrib/libc++/include/string head/contrib/libc++/include/string_view head/contrib/libc++/include/system_error head/contrib/libc++/include/tuple head/contrib/libc++/include/type_traits head/contrib/libc++/include/typeinfo head/contrib/libc++/include/unordered_map head/contrib/libc++/include/unordered_set head/contrib/libc++/include/utility head/contrib/libc++/include/variant head/contrib/libc++/include/vector head/contrib/libc++/include/wchar.h head/contrib/libc++/src/exception.cpp head/contrib/libc++/src/experimental/filesystem/directory_iterator.cpp head/contrib/libc++/src/experimental/filesystem/operations.cpp head/contrib/libc++/src/include/atomic_support.h head/contrib/libc++/src/include/config_elast.h head/contrib/libc++/src/include/refstring.h head/contrib/libc++/src/iostream.cpp head/contrib/libc++/src/locale.cpp head/contrib/libc++/src/new.cpp head/contrib/libc++/src/random.cpp head/contrib/libc++/src/strstream.cpp head/contrib/libc++/src/support/runtime/exception_fallback.ipp head/contrib/libc++/src/support/runtime/exception_msvc.ipp head/contrib/libc++/src/support/runtime/exception_pointer_msvc.ipp head/contrib/libc++/src/support/runtime/new_handler_fallback.ipp head/contrib/libc++/src/system_error.cpp head/contrib/libc++/src/typeinfo.cpp head/contrib/llvm/include/llvm-c/Core.h head/contrib/llvm/include/llvm-c/OrcBindings.h head/contrib/llvm/include/llvm-c/Transforms/IPO.h head/contrib/llvm/include/llvm-c/Transforms/Scalar.h head/contrib/llvm/include/llvm-c/lto.h head/contrib/llvm/include/llvm/ADT/APFloat.h head/contrib/llvm/include/llvm/ADT/APInt.h head/contrib/llvm/include/llvm/ADT/ArrayRef.h head/contrib/llvm/include/llvm/ADT/BitVector.h head/contrib/llvm/include/llvm/ADT/DenseMap.h head/contrib/llvm/include/llvm/ADT/EquivalenceClasses.h head/contrib/llvm/include/llvm/ADT/FoldingSet.h head/contrib/llvm/include/llvm/ADT/MapVector.h head/contrib/llvm/include/llvm/ADT/Optional.h head/contrib/llvm/include/llvm/ADT/PointerEmbeddedInt.h head/contrib/llvm/include/llvm/ADT/PointerIntPair.h head/contrib/llvm/include/llvm/ADT/PointerSumType.h head/contrib/llvm/include/llvm/ADT/PointerUnion.h head/contrib/llvm/include/llvm/ADT/STLExtras.h head/contrib/llvm/include/llvm/ADT/SmallPtrSet.h head/contrib/llvm/include/llvm/ADT/SmallVector.h head/contrib/llvm/include/llvm/ADT/StringExtras.h head/contrib/llvm/include/llvm/ADT/StringMap.h head/contrib/llvm/include/llvm/ADT/TinyPtrVector.h head/contrib/llvm/include/llvm/ADT/Triple.h head/contrib/llvm/include/llvm/ADT/Twine.h head/contrib/llvm/include/llvm/ADT/iterator.h head/contrib/llvm/include/llvm/Analysis/AliasAnalysis.h head/contrib/llvm/include/llvm/Analysis/AliasAnalysisEvaluator.h head/contrib/llvm/include/llvm/Analysis/AliasSetTracker.h head/contrib/llvm/include/llvm/Analysis/AssumptionCache.h head/contrib/llvm/include/llvm/Analysis/BasicAliasAnalysis.h head/contrib/llvm/include/llvm/Analysis/BlockFrequencyInfo.h head/contrib/llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h head/contrib/llvm/include/llvm/Analysis/BranchProbabilityInfo.h head/contrib/llvm/include/llvm/Analysis/CFG.h head/contrib/llvm/include/llvm/Analysis/CFLAndersAliasAnalysis.h head/contrib/llvm/include/llvm/Analysis/CFLSteensAliasAnalysis.h head/contrib/llvm/include/llvm/Analysis/CGSCCPassManager.h head/contrib/llvm/include/llvm/Analysis/CallGraph.h head/contrib/llvm/include/llvm/Analysis/CallGraphSCCPass.h head/contrib/llvm/include/llvm/Analysis/ConstantFolding.h head/contrib/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h head/contrib/llvm/include/llvm/Analysis/DemandedBits.h head/contrib/llvm/include/llvm/Analysis/DominanceFrontier.h head/contrib/llvm/include/llvm/Analysis/DominanceFrontierImpl.h head/contrib/llvm/include/llvm/Analysis/IndirectCallPromotionAnalysis.h head/contrib/llvm/include/llvm/Analysis/IndirectCallSiteVisitor.h head/contrib/llvm/include/llvm/Analysis/InlineCost.h head/contrib/llvm/include/llvm/Analysis/InstructionSimplify.h head/contrib/llvm/include/llvm/Analysis/Interval.h head/contrib/llvm/include/llvm/Analysis/IntervalIterator.h head/contrib/llvm/include/llvm/Analysis/IntervalPartition.h head/contrib/llvm/include/llvm/Analysis/LazyCallGraph.h head/contrib/llvm/include/llvm/Analysis/LoopAccessAnalysis.h head/contrib/llvm/include/llvm/Analysis/LoopAnalysisManager.h head/contrib/llvm/include/llvm/Analysis/LoopInfo.h head/contrib/llvm/include/llvm/Analysis/LoopInfoImpl.h head/contrib/llvm/include/llvm/Analysis/LoopPass.h head/contrib/llvm/include/llvm/Analysis/MemoryBuiltins.h head/contrib/llvm/include/llvm/Analysis/MemoryDependenceAnalysis.h head/contrib/llvm/include/llvm/Analysis/MemoryLocation.h head/contrib/llvm/include/llvm/Analysis/MemorySSA.h head/contrib/llvm/include/llvm/Analysis/ModuleSummaryAnalysis.h head/contrib/llvm/include/llvm/Analysis/PostDominators.h head/contrib/llvm/include/llvm/Analysis/ProfileSummaryInfo.h head/contrib/llvm/include/llvm/Analysis/PtrUseVisitor.h head/contrib/llvm/include/llvm/Analysis/RegionInfo.h head/contrib/llvm/include/llvm/Analysis/RegionInfoImpl.h head/contrib/llvm/include/llvm/Analysis/ScalarEvolution.h head/contrib/llvm/include/llvm/Analysis/ScalarEvolutionExpander.h head/contrib/llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h head/contrib/llvm/include/llvm/Analysis/ScopedNoAliasAA.h head/contrib/llvm/include/llvm/Analysis/SparsePropagation.h head/contrib/llvm/include/llvm/Analysis/TargetLibraryInfo.def head/contrib/llvm/include/llvm/Analysis/TargetLibraryInfo.h head/contrib/llvm/include/llvm/Analysis/TargetTransformInfo.h head/contrib/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h head/contrib/llvm/include/llvm/Analysis/Trace.h head/contrib/llvm/include/llvm/Analysis/TypeBasedAliasAnalysis.h head/contrib/llvm/include/llvm/Analysis/ValueTracking.h head/contrib/llvm/include/llvm/AsmParser/Parser.h head/contrib/llvm/include/llvm/BinaryFormat/COFF.h head/contrib/llvm/include/llvm/BinaryFormat/Dwarf.def head/contrib/llvm/include/llvm/BinaryFormat/Dwarf.h head/contrib/llvm/include/llvm/BinaryFormat/ELF.h head/contrib/llvm/include/llvm/BinaryFormat/ELFRelocs/AMDGPU.def head/contrib/llvm/include/llvm/BinaryFormat/ELFRelocs/AVR.def head/contrib/llvm/include/llvm/BinaryFormat/ELFRelocs/RISCV.def head/contrib/llvm/include/llvm/BinaryFormat/MachO.h head/contrib/llvm/include/llvm/BinaryFormat/Wasm.h head/contrib/llvm/include/llvm/Bitcode/BitcodeReader.h head/contrib/llvm/include/llvm/Bitcode/BitcodeWriter.h head/contrib/llvm/include/llvm/Bitcode/BitstreamReader.h head/contrib/llvm/include/llvm/Bitcode/LLVMBitCodes.h head/contrib/llvm/include/llvm/CodeGen/AsmPrinter.h head/contrib/llvm/include/llvm/CodeGen/BasicTTIImpl.h head/contrib/llvm/include/llvm/CodeGen/CalcSpillWeights.h head/contrib/llvm/include/llvm/CodeGen/CallingConvLower.h head/contrib/llvm/include/llvm/CodeGen/DFAPacketizer.h head/contrib/llvm/include/llvm/CodeGen/FastISel.h head/contrib/llvm/include/llvm/CodeGen/FaultMaps.h head/contrib/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h head/contrib/llvm/include/llvm/CodeGen/GlobalISel/CallLowering.h head/contrib/llvm/include/llvm/CodeGen/GlobalISel/InstructionSelector.h head/contrib/llvm/include/llvm/CodeGen/GlobalISel/InstructionSelectorImpl.h head/contrib/llvm/include/llvm/CodeGen/GlobalISel/Legalizer.h head/contrib/llvm/include/llvm/CodeGen/GlobalISel/LegalizerHelper.h head/contrib/llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h head/contrib/llvm/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h head/contrib/llvm/include/llvm/CodeGen/GlobalISel/RegisterBankInfo.h head/contrib/llvm/include/llvm/CodeGen/GlobalISel/Utils.h head/contrib/llvm/include/llvm/CodeGen/ISDOpcodes.h head/contrib/llvm/include/llvm/CodeGen/IntrinsicLowering.h head/contrib/llvm/include/llvm/CodeGen/LatencyPriorityQueue.h head/contrib/llvm/include/llvm/CodeGen/LivePhysRegs.h head/contrib/llvm/include/llvm/CodeGen/LiveRangeEdit.h head/contrib/llvm/include/llvm/CodeGen/LiveRegUnits.h head/contrib/llvm/include/llvm/CodeGen/LiveVariables.h head/contrib/llvm/include/llvm/CodeGen/MIRYamlMapping.h head/contrib/llvm/include/llvm/CodeGen/MachineBasicBlock.h head/contrib/llvm/include/llvm/CodeGen/MachineBlockFrequencyInfo.h head/contrib/llvm/include/llvm/CodeGen/MachineCombinerPattern.h head/contrib/llvm/include/llvm/CodeGen/MachineDominanceFrontier.h head/contrib/llvm/include/llvm/CodeGen/MachineDominators.h head/contrib/llvm/include/llvm/CodeGen/MachineFrameInfo.h head/contrib/llvm/include/llvm/CodeGen/MachineFunction.h head/contrib/llvm/include/llvm/CodeGen/MachineInstr.h head/contrib/llvm/include/llvm/CodeGen/MachineInstrBuilder.h head/contrib/llvm/include/llvm/CodeGen/MachineInstrBundle.h head/contrib/llvm/include/llvm/CodeGen/MachineJumpTableInfo.h head/contrib/llvm/include/llvm/CodeGen/MachineLoopInfo.h head/contrib/llvm/include/llvm/CodeGen/MachineMemOperand.h head/contrib/llvm/include/llvm/CodeGen/MachineModuleInfo.h head/contrib/llvm/include/llvm/CodeGen/MachineModuleInfoImpls.h head/contrib/llvm/include/llvm/CodeGen/MachineOperand.h head/contrib/llvm/include/llvm/CodeGen/MachineOptimizationRemarkEmitter.h head/contrib/llvm/include/llvm/CodeGen/MachinePostDominators.h head/contrib/llvm/include/llvm/CodeGen/MachineRegisterInfo.h head/contrib/llvm/include/llvm/CodeGen/MachineSSAUpdater.h head/contrib/llvm/include/llvm/CodeGen/MachineScheduler.h head/contrib/llvm/include/llvm/CodeGen/MachineTraceMetrics.h head/contrib/llvm/include/llvm/CodeGen/MachineValueType.h head/contrib/llvm/include/llvm/CodeGen/PBQP/Solution.h head/contrib/llvm/include/llvm/CodeGen/Passes.h head/contrib/llvm/include/llvm/CodeGen/PreISelIntrinsicLowering.h head/contrib/llvm/include/llvm/CodeGen/PseudoSourceValue.h head/contrib/llvm/include/llvm/CodeGen/RegisterClassInfo.h head/contrib/llvm/include/llvm/CodeGen/RegisterPressure.h head/contrib/llvm/include/llvm/CodeGen/RegisterUsageInfo.h head/contrib/llvm/include/llvm/CodeGen/ResourcePriorityQueue.h head/contrib/llvm/include/llvm/CodeGen/RuntimeLibcalls.h head/contrib/llvm/include/llvm/CodeGen/ScheduleDAG.h head/contrib/llvm/include/llvm/CodeGen/ScheduleDAGInstrs.h head/contrib/llvm/include/llvm/CodeGen/SelectionDAG.h head/contrib/llvm/include/llvm/CodeGen/SelectionDAGAddressAnalysis.h head/contrib/llvm/include/llvm/CodeGen/SelectionDAGISel.h head/contrib/llvm/include/llvm/CodeGen/SelectionDAGNodes.h head/contrib/llvm/include/llvm/CodeGen/SelectionDAGTargetInfo.h head/contrib/llvm/include/llvm/CodeGen/SlotIndexes.h head/contrib/llvm/include/llvm/CodeGen/StackMaps.h head/contrib/llvm/include/llvm/CodeGen/TailDuplicator.h head/contrib/llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h head/contrib/llvm/include/llvm/CodeGen/TargetPassConfig.h head/contrib/llvm/include/llvm/CodeGen/TargetSchedule.h head/contrib/llvm/include/llvm/CodeGen/ValueTypes.td head/contrib/llvm/include/llvm/CodeGen/VirtRegMap.h head/contrib/llvm/include/llvm/DebugInfo/CodeView/CVRecord.h head/contrib/llvm/include/llvm/DebugInfo/CodeView/CodeView.h head/contrib/llvm/include/llvm/DebugInfo/CodeView/CodeViewSymbols.def head/contrib/llvm/include/llvm/DebugInfo/CodeView/CodeViewTypes.def head/contrib/llvm/include/llvm/DebugInfo/CodeView/LazyRandomTypeCollection.h head/contrib/llvm/include/llvm/DebugInfo/CodeView/StringsAndChecksums.h head/contrib/llvm/include/llvm/DebugInfo/CodeView/SymbolDeserializer.h head/contrib/llvm/include/llvm/DebugInfo/CodeView/SymbolRecord.h head/contrib/llvm/include/llvm/DebugInfo/CodeView/SymbolSerializer.h head/contrib/llvm/include/llvm/DebugInfo/CodeView/TypeCollection.h head/contrib/llvm/include/llvm/DebugInfo/CodeView/TypeDeserializer.h head/contrib/llvm/include/llvm/DebugInfo/CodeView/TypeIndex.h head/contrib/llvm/include/llvm/DebugInfo/CodeView/TypeIndexDiscovery.h head/contrib/llvm/include/llvm/DebugInfo/CodeView/TypeRecord.h head/contrib/llvm/include/llvm/DebugInfo/CodeView/TypeStreamMerger.h head/contrib/llvm/include/llvm/DebugInfo/DIContext.h head/contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFAbbreviationDeclaration.h head/contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h head/contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h head/contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFDataExtractor.h head/contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugAbbrev.h head/contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h head/contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h head/contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLoc.h head/contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugMacro.h head/contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugPubTable.h head/contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugRangeList.h head/contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFDie.h head/contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h head/contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFSection.h head/contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFTypeUnit.h head/contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h head/contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFUnitIndex.h head/contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFVerifier.h head/contrib/llvm/include/llvm/DebugInfo/MSF/MSFBuilder.h head/contrib/llvm/include/llvm/DebugInfo/MSF/MSFCommon.h head/contrib/llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h head/contrib/llvm/include/llvm/DebugInfo/PDB/DIA/DIARawSymbol.h head/contrib/llvm/include/llvm/DebugInfo/PDB/DIA/DIASession.h head/contrib/llvm/include/llvm/DebugInfo/PDB/IPDBRawSymbol.h head/contrib/llvm/include/llvm/DebugInfo/PDB/IPDBSession.h head/contrib/llvm/include/llvm/DebugInfo/PDB/Native/DbiStreamBuilder.h head/contrib/llvm/include/llvm/DebugInfo/PDB/Native/GlobalsStream.h head/contrib/llvm/include/llvm/DebugInfo/PDB/Native/ModuleDebugStream.h head/contrib/llvm/include/llvm/DebugInfo/PDB/Native/NativeRawSymbol.h head/contrib/llvm/include/llvm/DebugInfo/PDB/Native/NativeSession.h head/contrib/llvm/include/llvm/DebugInfo/PDB/Native/PDBFile.h head/contrib/llvm/include/llvm/DebugInfo/PDB/Native/PDBFileBuilder.h head/contrib/llvm/include/llvm/DebugInfo/PDB/Native/PublicsStream.h head/contrib/llvm/include/llvm/DebugInfo/PDB/Native/RawTypes.h head/contrib/llvm/include/llvm/DebugInfo/PDB/Native/SymbolStream.h head/contrib/llvm/include/llvm/DebugInfo/PDB/PDBSymbol.h head/contrib/llvm/include/llvm/DebugInfo/PDB/PDBTypes.h head/contrib/llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h head/contrib/llvm/include/llvm/ExecutionEngine/ExecutionEngine.h head/contrib/llvm/include/llvm/ExecutionEngine/JITSymbol.h head/contrib/llvm/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h head/contrib/llvm/include/llvm/ExecutionEngine/Orc/GlobalMappingLayer.h head/contrib/llvm/include/llvm/ExecutionEngine/Orc/IndirectionUtils.h head/contrib/llvm/include/llvm/ExecutionEngine/Orc/OrcError.h head/contrib/llvm/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h head/contrib/llvm/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetRPCAPI.h head/contrib/llvm/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetServer.h head/contrib/llvm/include/llvm/ExecutionEngine/Orc/RPCSerialization.h head/contrib/llvm/include/llvm/ExecutionEngine/Orc/RPCUtils.h head/contrib/llvm/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h head/contrib/llvm/include/llvm/ExecutionEngine/SectionMemoryManager.h head/contrib/llvm/include/llvm/IR/Attributes.h head/contrib/llvm/include/llvm/IR/Attributes.td head/contrib/llvm/include/llvm/IR/BasicBlock.h head/contrib/llvm/include/llvm/IR/CallSite.h head/contrib/llvm/include/llvm/IR/CallingConv.h head/contrib/llvm/include/llvm/IR/Constant.h head/contrib/llvm/include/llvm/IR/ConstantRange.h head/contrib/llvm/include/llvm/IR/DIBuilder.h head/contrib/llvm/include/llvm/IR/DataLayout.h head/contrib/llvm/include/llvm/IR/DebugInfoMetadata.h head/contrib/llvm/include/llvm/IR/DiagnosticInfo.h head/contrib/llvm/include/llvm/IR/Dominators.h head/contrib/llvm/include/llvm/IR/Function.h head/contrib/llvm/include/llvm/IR/GlobalValue.h head/contrib/llvm/include/llvm/IR/IRBuilder.h head/contrib/llvm/include/llvm/IR/InlineAsm.h head/contrib/llvm/include/llvm/IR/InstrTypes.h head/contrib/llvm/include/llvm/IR/Instruction.h head/contrib/llvm/include/llvm/IR/Instructions.h head/contrib/llvm/include/llvm/IR/IntrinsicInst.h head/contrib/llvm/include/llvm/IR/Intrinsics.td head/contrib/llvm/include/llvm/IR/IntrinsicsAArch64.td head/contrib/llvm/include/llvm/IR/IntrinsicsAMDGPU.td head/contrib/llvm/include/llvm/IR/IntrinsicsHexagon.td head/contrib/llvm/include/llvm/IR/IntrinsicsNVVM.td head/contrib/llvm/include/llvm/IR/IntrinsicsSystemZ.td head/contrib/llvm/include/llvm/IR/IntrinsicsX86.td head/contrib/llvm/include/llvm/IR/LLVMContext.h head/contrib/llvm/include/llvm/IR/LegacyPassManagers.h head/contrib/llvm/include/llvm/IR/MDBuilder.h head/contrib/llvm/include/llvm/IR/Metadata.h head/contrib/llvm/include/llvm/IR/ModuleSummaryIndex.h head/contrib/llvm/include/llvm/IR/ModuleSummaryIndexYAML.h head/contrib/llvm/include/llvm/IR/Operator.h head/contrib/llvm/include/llvm/IR/OptBisect.h head/contrib/llvm/include/llvm/IR/PassManager.h head/contrib/llvm/include/llvm/IR/PatternMatch.h head/contrib/llvm/include/llvm/IR/Type.h head/contrib/llvm/include/llvm/IR/Value.def head/contrib/llvm/include/llvm/IR/Value.h head/contrib/llvm/include/llvm/IR/Verifier.h head/contrib/llvm/include/llvm/IRReader/IRReader.h head/contrib/llvm/include/llvm/InitializePasses.h head/contrib/llvm/include/llvm/LTO/Caching.h head/contrib/llvm/include/llvm/LTO/Config.h head/contrib/llvm/include/llvm/LTO/LTO.h head/contrib/llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h head/contrib/llvm/include/llvm/LTO/legacy/ThinLTOCodeGenerator.h head/contrib/llvm/include/llvm/LinkAllIR.h head/contrib/llvm/include/llvm/LinkAllPasses.h head/contrib/llvm/include/llvm/MC/LaneBitmask.h head/contrib/llvm/include/llvm/MC/MCAsmBackend.h head/contrib/llvm/include/llvm/MC/MCAsmInfo.h head/contrib/llvm/include/llvm/MC/MCAssembler.h head/contrib/llvm/include/llvm/MC/MCCodeView.h head/contrib/llvm/include/llvm/MC/MCContext.h head/contrib/llvm/include/llvm/MC/MCDwarf.h head/contrib/llvm/include/llvm/MC/MCELFObjectWriter.h head/contrib/llvm/include/llvm/MC/MCELFStreamer.h head/contrib/llvm/include/llvm/MC/MCExpr.h head/contrib/llvm/include/llvm/MC/MCFragment.h head/contrib/llvm/include/llvm/MC/MCInst.h head/contrib/llvm/include/llvm/MC/MCInstrDesc.h head/contrib/llvm/include/llvm/MC/MCMachObjectWriter.h head/contrib/llvm/include/llvm/MC/MCObjectFileInfo.h head/contrib/llvm/include/llvm/MC/MCObjectStreamer.h head/contrib/llvm/include/llvm/MC/MCParser/MCAsmParser.h head/contrib/llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h head/contrib/llvm/include/llvm/MC/MCRegisterInfo.h head/contrib/llvm/include/llvm/MC/MCSchedule.h head/contrib/llvm/include/llvm/MC/MCSectionWasm.h head/contrib/llvm/include/llvm/MC/MCStreamer.h head/contrib/llvm/include/llvm/MC/MCSubtargetInfo.h head/contrib/llvm/include/llvm/MC/MCSymbolWasm.h head/contrib/llvm/include/llvm/MC/MCValue.h head/contrib/llvm/include/llvm/MC/MCWasmObjectWriter.h head/contrib/llvm/include/llvm/MC/MCWasmStreamer.h head/contrib/llvm/include/llvm/MC/MCWinCOFFObjectWriter.h head/contrib/llvm/include/llvm/MC/MCWinCOFFStreamer.h head/contrib/llvm/include/llvm/MC/MachineLocation.h head/contrib/llvm/include/llvm/MC/SubtargetFeature.h head/contrib/llvm/include/llvm/Object/Archive.h head/contrib/llvm/include/llvm/Object/ArchiveWriter.h head/contrib/llvm/include/llvm/Object/Binary.h head/contrib/llvm/include/llvm/Object/COFF.h head/contrib/llvm/include/llvm/Object/COFFImportFile.h head/contrib/llvm/include/llvm/Object/ELF.h head/contrib/llvm/include/llvm/Object/ELFObjectFile.h head/contrib/llvm/include/llvm/Object/ELFTypes.h head/contrib/llvm/include/llvm/Object/IRObjectFile.h head/contrib/llvm/include/llvm/Object/IRSymtab.h head/contrib/llvm/include/llvm/Object/MachO.h head/contrib/llvm/include/llvm/Object/ObjectFile.h head/contrib/llvm/include/llvm/Object/RelocVisitor.h head/contrib/llvm/include/llvm/Object/StackMapParser.h head/contrib/llvm/include/llvm/Object/Wasm.h head/contrib/llvm/include/llvm/Object/WindowsResource.h head/contrib/llvm/include/llvm/ObjectYAML/COFFYAML.h head/contrib/llvm/include/llvm/ObjectYAML/CodeViewYAMLTypes.h head/contrib/llvm/include/llvm/ObjectYAML/ELFYAML.h head/contrib/llvm/include/llvm/ObjectYAML/MachOYAML.h head/contrib/llvm/include/llvm/ObjectYAML/WasmYAML.h head/contrib/llvm/include/llvm/ObjectYAML/YAML.h head/contrib/llvm/include/llvm/Option/OptParser.td head/contrib/llvm/include/llvm/Option/OptTable.h head/contrib/llvm/include/llvm/Pass.h head/contrib/llvm/include/llvm/PassAnalysisSupport.h head/contrib/llvm/include/llvm/PassInfo.h head/contrib/llvm/include/llvm/PassRegistry.h head/contrib/llvm/include/llvm/PassSupport.h head/contrib/llvm/include/llvm/Passes/PassBuilder.h head/contrib/llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h head/contrib/llvm/include/llvm/ProfileData/Coverage/CoverageMappingReader.h head/contrib/llvm/include/llvm/ProfileData/InstrProf.h head/contrib/llvm/include/llvm/ProfileData/InstrProfData.inc head/contrib/llvm/include/llvm/ProfileData/InstrProfReader.h head/contrib/llvm/include/llvm/ProfileData/SampleProf.h head/contrib/llvm/include/llvm/ProfileData/SampleProfReader.h head/contrib/llvm/include/llvm/Support/AArch64TargetParser.def head/contrib/llvm/include/llvm/Support/ARMTargetParser.def head/contrib/llvm/include/llvm/Support/Allocator.h head/contrib/llvm/include/llvm/Support/AtomicOrdering.h head/contrib/llvm/include/llvm/Support/BinaryByteStream.h head/contrib/llvm/include/llvm/Support/BinaryItemStream.h head/contrib/llvm/include/llvm/Support/BinaryStream.h head/contrib/llvm/include/llvm/Support/BinaryStreamRef.h head/contrib/llvm/include/llvm/Support/CachePruning.h head/contrib/llvm/include/llvm/Support/Chrono.h head/contrib/llvm/include/llvm/Support/CodeGen.h head/contrib/llvm/include/llvm/Support/CodeGenCWrappers.h head/contrib/llvm/include/llvm/Support/CommandLine.h head/contrib/llvm/include/llvm/Support/ConvertUTF.h head/contrib/llvm/include/llvm/Support/DebugCounter.h head/contrib/llvm/include/llvm/Support/Error.h head/contrib/llvm/include/llvm/Support/FileOutputBuffer.h head/contrib/llvm/include/llvm/Support/FileSystem.h head/contrib/llvm/include/llvm/Support/FormatVariadic.h head/contrib/llvm/include/llvm/Support/FormatVariadicDetails.h head/contrib/llvm/include/llvm/Support/GenericDomTree.h head/contrib/llvm/include/llvm/Support/GenericDomTreeConstruction.h head/contrib/llvm/include/llvm/Support/Host.h head/contrib/llvm/include/llvm/Support/KnownBits.h head/contrib/llvm/include/llvm/Support/LEB128.h head/contrib/llvm/include/llvm/Support/LockFileManager.h head/contrib/llvm/include/llvm/Support/LowLevelTypeImpl.h head/contrib/llvm/include/llvm/Support/MathExtras.h head/contrib/llvm/include/llvm/Support/Memory.h head/contrib/llvm/include/llvm/Support/MemoryBuffer.h head/contrib/llvm/include/llvm/Support/Parallel.h head/contrib/llvm/include/llvm/Support/PointerLikeTypeTraits.h head/contrib/llvm/include/llvm/Support/Printable.h head/contrib/llvm/include/llvm/Support/Process.h head/contrib/llvm/include/llvm/Support/Program.h head/contrib/llvm/include/llvm/Support/ReverseIteration.h head/contrib/llvm/include/llvm/Support/ScaledNumber.h head/contrib/llvm/include/llvm/Support/SourceMgr.h head/contrib/llvm/include/llvm/Support/SpecialCaseList.h head/contrib/llvm/include/llvm/Support/TarWriter.h head/contrib/llvm/include/llvm/Support/TargetParser.h head/contrib/llvm/include/llvm/Support/TargetRegistry.h head/contrib/llvm/include/llvm/Support/ThreadPool.h head/contrib/llvm/include/llvm/Support/Threading.h head/contrib/llvm/include/llvm/Support/ToolOutputFile.h head/contrib/llvm/include/llvm/Support/YAMLParser.h head/contrib/llvm/include/llvm/Support/YAMLTraits.h head/contrib/llvm/include/llvm/Support/raw_ostream.h head/contrib/llvm/include/llvm/TableGen/Error.h head/contrib/llvm/include/llvm/TableGen/Record.h head/contrib/llvm/include/llvm/TableGen/StringMatcher.h head/contrib/llvm/include/llvm/Target/GenericOpcodes.td head/contrib/llvm/include/llvm/Target/GlobalISel/SelectionDAGCompat.td head/contrib/llvm/include/llvm/Target/Target.td head/contrib/llvm/include/llvm/Target/TargetMachine.h head/contrib/llvm/include/llvm/Target/TargetOptions.h head/contrib/llvm/include/llvm/Target/TargetSelectionDAG.td head/contrib/llvm/include/llvm/Testing/Support/Error.h head/contrib/llvm/include/llvm/Testing/Support/SupportHelpers.h head/contrib/llvm/include/llvm/Transforms/IPO.h head/contrib/llvm/include/llvm/Transforms/IPO/ArgumentPromotion.h head/contrib/llvm/include/llvm/Transforms/IPO/ConstantMerge.h head/contrib/llvm/include/llvm/Transforms/IPO/DeadArgumentElimination.h head/contrib/llvm/include/llvm/Transforms/IPO/ElimAvailExtern.h head/contrib/llvm/include/llvm/Transforms/IPO/FunctionAttrs.h head/contrib/llvm/include/llvm/Transforms/IPO/FunctionImport.h head/contrib/llvm/include/llvm/Transforms/IPO/GlobalDCE.h head/contrib/llvm/include/llvm/Transforms/IPO/GlobalOpt.h head/contrib/llvm/include/llvm/Transforms/IPO/GlobalSplit.h head/contrib/llvm/include/llvm/Transforms/IPO/Inliner.h head/contrib/llvm/include/llvm/Transforms/IPO/LowerTypeTests.h head/contrib/llvm/include/llvm/Transforms/IPO/PartialInlining.h head/contrib/llvm/include/llvm/Transforms/IPO/SCCP.h head/contrib/llvm/include/llvm/Transforms/Instrumentation.h head/contrib/llvm/include/llvm/Transforms/PGOInstrumentation.h head/contrib/llvm/include/llvm/Transforms/SampleProfile.h head/contrib/llvm/include/llvm/Transforms/Scalar.h head/contrib/llvm/include/llvm/Transforms/Scalar/ADCE.h head/contrib/llvm/include/llvm/Transforms/Scalar/ConstantHoisting.h head/contrib/llvm/include/llvm/Transforms/Scalar/CorrelatedValuePropagation.h head/contrib/llvm/include/llvm/Transforms/Scalar/DeadStoreElimination.h head/contrib/llvm/include/llvm/Transforms/Scalar/EarlyCSE.h head/contrib/llvm/include/llvm/Transforms/Scalar/GVN.h head/contrib/llvm/include/llvm/Transforms/Scalar/GVNExpression.h head/contrib/llvm/include/llvm/Transforms/Scalar/IndVarSimplify.h head/contrib/llvm/include/llvm/Transforms/Scalar/JumpThreading.h head/contrib/llvm/include/llvm/Transforms/Scalar/LoopDistribute.h head/contrib/llvm/include/llvm/Transforms/Scalar/LoopIdiomRecognize.h head/contrib/llvm/include/llvm/Transforms/Scalar/LoopInstSimplify.h head/contrib/llvm/include/llvm/Transforms/Scalar/LoopLoadElimination.h head/contrib/llvm/include/llvm/Transforms/Scalar/LoopPassManager.h head/contrib/llvm/include/llvm/Transforms/Scalar/LoopStrengthReduce.h head/contrib/llvm/include/llvm/Transforms/Scalar/LoopUnrollPass.h head/contrib/llvm/include/llvm/Transforms/Scalar/LowerExpectIntrinsic.h head/contrib/llvm/include/llvm/Transforms/Scalar/MemCpyOptimizer.h head/contrib/llvm/include/llvm/Transforms/Scalar/NaryReassociate.h head/contrib/llvm/include/llvm/Transforms/Scalar/NewGVN.h head/contrib/llvm/include/llvm/Transforms/Scalar/Reassociate.h head/contrib/llvm/include/llvm/Transforms/Scalar/SCCP.h head/contrib/llvm/include/llvm/Transforms/Scalar/SROA.h head/contrib/llvm/include/llvm/Transforms/Scalar/SimpleLoopUnswitch.h head/contrib/llvm/include/llvm/Transforms/Scalar/SimplifyCFG.h head/contrib/llvm/include/llvm/Transforms/Utils/AddDiscriminators.h head/contrib/llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h head/contrib/llvm/include/llvm/Transforms/Utils/BypassSlowDivision.h head/contrib/llvm/include/llvm/Transforms/Utils/Cloning.h head/contrib/llvm/include/llvm/Transforms/Utils/CodeExtractor.h head/contrib/llvm/include/llvm/Transforms/Utils/Evaluator.h head/contrib/llvm/include/llvm/Transforms/Utils/FunctionComparator.h head/contrib/llvm/include/llvm/Transforms/Utils/Local.h head/contrib/llvm/include/llvm/Transforms/Utils/LoopUtils.h head/contrib/llvm/include/llvm/Transforms/Utils/LowerMemIntrinsics.h head/contrib/llvm/include/llvm/Transforms/Utils/Mem2Reg.h head/contrib/llvm/include/llvm/Transforms/Utils/ModuleUtils.h head/contrib/llvm/include/llvm/Transforms/Utils/SSAUpdater.h head/contrib/llvm/include/llvm/Transforms/Utils/SSAUpdaterImpl.h head/contrib/llvm/include/llvm/Transforms/Utils/SimplifyIndVar.h head/contrib/llvm/include/llvm/Transforms/Utils/SimplifyLibCalls.h head/contrib/llvm/include/llvm/Transforms/Utils/SplitModule.h head/contrib/llvm/include/llvm/Transforms/Utils/SymbolRewriter.h head/contrib/llvm/include/llvm/Transforms/Utils/UnrollLoop.h head/contrib/llvm/include/llvm/Transforms/Utils/ValueMapper.h head/contrib/llvm/include/llvm/Transforms/Vectorize/LoopVectorize.h head/contrib/llvm/include/llvm/Transforms/Vectorize/SLPVectorizer.h head/contrib/llvm/include/llvm/XRay/InstrumentationMap.h head/contrib/llvm/include/llvm/XRay/XRayRecord.h head/contrib/llvm/include/llvm/XRay/YAMLXRayRecord.h head/contrib/llvm/include/llvm/module.modulemap head/contrib/llvm/include/llvm/module.modulemap.build head/contrib/llvm/lib/Analysis/AliasAnalysis.cpp head/contrib/llvm/lib/Analysis/AliasAnalysisEvaluator.cpp head/contrib/llvm/lib/Analysis/AliasSetTracker.cpp head/contrib/llvm/lib/Analysis/AssumptionCache.cpp head/contrib/llvm/lib/Analysis/BasicAliasAnalysis.cpp head/contrib/llvm/lib/Analysis/BlockFrequencyInfo.cpp head/contrib/llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp head/contrib/llvm/lib/Analysis/BranchProbabilityInfo.cpp head/contrib/llvm/lib/Analysis/CFGPrinter.cpp head/contrib/llvm/lib/Analysis/CFLAndersAliasAnalysis.cpp head/contrib/llvm/lib/Analysis/CFLGraph.h head/contrib/llvm/lib/Analysis/CFLSteensAliasAnalysis.cpp head/contrib/llvm/lib/Analysis/CGSCCPassManager.cpp head/contrib/llvm/lib/Analysis/CallGraph.cpp head/contrib/llvm/lib/Analysis/CallGraphSCCPass.cpp head/contrib/llvm/lib/Analysis/CodeMetrics.cpp head/contrib/llvm/lib/Analysis/ConstantFolding.cpp head/contrib/llvm/lib/Analysis/CostModel.cpp head/contrib/llvm/lib/Analysis/DemandedBits.cpp head/contrib/llvm/lib/Analysis/DivergenceAnalysis.cpp head/contrib/llvm/lib/Analysis/DominanceFrontier.cpp head/contrib/llvm/lib/Analysis/GlobalsModRef.cpp head/contrib/llvm/lib/Analysis/IndirectCallPromotionAnalysis.cpp head/contrib/llvm/lib/Analysis/InlineCost.cpp head/contrib/llvm/lib/Analysis/InstructionSimplify.cpp head/contrib/llvm/lib/Analysis/Interval.cpp head/contrib/llvm/lib/Analysis/IntervalPartition.cpp head/contrib/llvm/lib/Analysis/LazyCallGraph.cpp head/contrib/llvm/lib/Analysis/LazyValueInfo.cpp head/contrib/llvm/lib/Analysis/Lint.cpp head/contrib/llvm/lib/Analysis/Loads.cpp head/contrib/llvm/lib/Analysis/LoopAccessAnalysis.cpp head/contrib/llvm/lib/Analysis/LoopAnalysisManager.cpp head/contrib/llvm/lib/Analysis/LoopInfo.cpp head/contrib/llvm/lib/Analysis/LoopPass.cpp head/contrib/llvm/lib/Analysis/LoopUnrollAnalyzer.cpp head/contrib/llvm/lib/Analysis/MemDerefPrinter.cpp head/contrib/llvm/lib/Analysis/MemoryBuiltins.cpp head/contrib/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp head/contrib/llvm/lib/Analysis/MemorySSA.cpp head/contrib/llvm/lib/Analysis/MemorySSAUpdater.cpp head/contrib/llvm/lib/Analysis/ModuleDebugInfoPrinter.cpp head/contrib/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp head/contrib/llvm/lib/Analysis/ObjCARCAliasAnalysis.cpp head/contrib/llvm/lib/Analysis/ObjCARCAnalysisUtils.cpp head/contrib/llvm/lib/Analysis/PostDominators.cpp head/contrib/llvm/lib/Analysis/ProfileSummaryInfo.cpp head/contrib/llvm/lib/Analysis/PtrUseVisitor.cpp head/contrib/llvm/lib/Analysis/RegionPass.cpp head/contrib/llvm/lib/Analysis/ScalarEvolution.cpp head/contrib/llvm/lib/Analysis/ScalarEvolutionExpander.cpp head/contrib/llvm/lib/Analysis/ScopedNoAliasAA.cpp head/contrib/llvm/lib/Analysis/TargetLibraryInfo.cpp head/contrib/llvm/lib/Analysis/TargetTransformInfo.cpp head/contrib/llvm/lib/Analysis/Trace.cpp head/contrib/llvm/lib/Analysis/TypeBasedAliasAnalysis.cpp head/contrib/llvm/lib/Analysis/ValueTracking.cpp head/contrib/llvm/lib/Analysis/VectorUtils.cpp head/contrib/llvm/lib/AsmParser/LLLexer.cpp head/contrib/llvm/lib/AsmParser/LLParser.cpp head/contrib/llvm/lib/AsmParser/LLParser.h head/contrib/llvm/lib/AsmParser/LLToken.h head/contrib/llvm/lib/AsmParser/Parser.cpp head/contrib/llvm/lib/BinaryFormat/Dwarf.cpp head/contrib/llvm/lib/BinaryFormat/Magic.cpp head/contrib/llvm/lib/Bitcode/Reader/BitReader.cpp head/contrib/llvm/lib/Bitcode/Reader/BitcodeReader.cpp head/contrib/llvm/lib/Bitcode/Reader/MetadataLoader.cpp head/contrib/llvm/lib/Bitcode/Reader/ValueList.cpp head/contrib/llvm/lib/Bitcode/Reader/ValueList.h head/contrib/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp head/contrib/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp head/contrib/llvm/lib/Bitcode/Writer/ValueEnumerator.h head/contrib/llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp head/contrib/llvm/lib/CodeGen/AggressiveAntiDepBreaker.h head/contrib/llvm/lib/CodeGen/AllocationOrder.cpp head/contrib/llvm/lib/CodeGen/AllocationOrder.h head/contrib/llvm/lib/CodeGen/Analysis.cpp head/contrib/llvm/lib/CodeGen/AntiDepBreaker.h head/contrib/llvm/lib/CodeGen/AsmPrinter/ARMException.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/AddressPool.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/AddressPool.h head/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h head/contrib/llvm/lib/CodeGen/AsmPrinter/DIE.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.h head/contrib/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.h head/contrib/llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfAccelTable.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfAccelTable.h head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.h head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfFile.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfFile.h head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfStringPool.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfStringPool.h head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/EHStreamer.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/EHStreamer.h head/contrib/llvm/lib/CodeGen/AsmPrinter/ErlangGCPrinter.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/WinException.cpp head/contrib/llvm/lib/CodeGen/AtomicExpandPass.cpp head/contrib/llvm/lib/CodeGen/BasicTargetTransformInfo.cpp head/contrib/llvm/lib/CodeGen/BranchFolding.cpp head/contrib/llvm/lib/CodeGen/BranchFolding.h head/contrib/llvm/lib/CodeGen/BranchRelaxation.cpp head/contrib/llvm/lib/CodeGen/CalcSpillWeights.cpp head/contrib/llvm/lib/CodeGen/CallingConvLower.cpp head/contrib/llvm/lib/CodeGen/CodeGen.cpp head/contrib/llvm/lib/CodeGen/CodeGenPrepare.cpp head/contrib/llvm/lib/CodeGen/CriticalAntiDepBreaker.cpp head/contrib/llvm/lib/CodeGen/CriticalAntiDepBreaker.h head/contrib/llvm/lib/CodeGen/DFAPacketizer.cpp head/contrib/llvm/lib/CodeGen/DeadMachineInstructionElim.cpp head/contrib/llvm/lib/CodeGen/DetectDeadLanes.cpp head/contrib/llvm/lib/CodeGen/DwarfEHPrepare.cpp head/contrib/llvm/lib/CodeGen/EarlyIfConversion.cpp head/contrib/llvm/lib/CodeGen/EdgeBundles.cpp head/contrib/llvm/lib/CodeGen/ExecutionDepsFix.cpp head/contrib/llvm/lib/CodeGen/ExpandISelPseudos.cpp head/contrib/llvm/lib/CodeGen/ExpandPostRAPseudos.cpp head/contrib/llvm/lib/CodeGen/ExpandReductions.cpp head/contrib/llvm/lib/CodeGen/FEntryInserter.cpp head/contrib/llvm/lib/CodeGen/GCRootLowering.cpp head/contrib/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp head/contrib/llvm/lib/CodeGen/GlobalISel/GlobalISel.cpp head/contrib/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp head/contrib/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp head/contrib/llvm/lib/CodeGen/GlobalISel/InstructionSelector.cpp head/contrib/llvm/lib/CodeGen/GlobalISel/Legalizer.cpp head/contrib/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp head/contrib/llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp head/contrib/llvm/lib/CodeGen/GlobalISel/Localizer.cpp head/contrib/llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp head/contrib/llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp head/contrib/llvm/lib/CodeGen/GlobalISel/RegisterBank.cpp head/contrib/llvm/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp head/contrib/llvm/lib/CodeGen/GlobalISel/Utils.cpp head/contrib/llvm/lib/CodeGen/GlobalMerge.cpp head/contrib/llvm/lib/CodeGen/IfConversion.cpp head/contrib/llvm/lib/CodeGen/ImplicitNullChecks.cpp head/contrib/llvm/lib/CodeGen/InlineSpiller.cpp head/contrib/llvm/lib/CodeGen/InterferenceCache.cpp head/contrib/llvm/lib/CodeGen/InterferenceCache.h head/contrib/llvm/lib/CodeGen/InterleavedAccessPass.cpp head/contrib/llvm/lib/CodeGen/IntrinsicLowering.cpp head/contrib/llvm/lib/CodeGen/LLVMTargetMachine.cpp head/contrib/llvm/lib/CodeGen/LatencyPriorityQueue.cpp head/contrib/llvm/lib/CodeGen/LexicalScopes.cpp head/contrib/llvm/lib/CodeGen/LiveDebugValues.cpp head/contrib/llvm/lib/CodeGen/LiveDebugVariables.cpp head/contrib/llvm/lib/CodeGen/LiveDebugVariables.h head/contrib/llvm/lib/CodeGen/LiveInterval.cpp head/contrib/llvm/lib/CodeGen/LiveIntervalUnion.cpp head/contrib/llvm/lib/CodeGen/LivePhysRegs.cpp head/contrib/llvm/lib/CodeGen/LiveRangeCalc.cpp head/contrib/llvm/lib/CodeGen/LiveRangeCalc.h head/contrib/llvm/lib/CodeGen/LiveRangeEdit.cpp head/contrib/llvm/lib/CodeGen/LiveRangeShrink.cpp head/contrib/llvm/lib/CodeGen/LiveRegMatrix.cpp head/contrib/llvm/lib/CodeGen/LiveRegUnits.cpp head/contrib/llvm/lib/CodeGen/LiveVariables.cpp head/contrib/llvm/lib/CodeGen/LocalStackSlotAllocation.cpp head/contrib/llvm/lib/CodeGen/LowerEmuTLS.cpp head/contrib/llvm/lib/CodeGen/MIRParser/MILexer.cpp head/contrib/llvm/lib/CodeGen/MIRParser/MILexer.h head/contrib/llvm/lib/CodeGen/MIRParser/MIParser.cpp head/contrib/llvm/lib/CodeGen/MIRParser/MIRParser.cpp head/contrib/llvm/lib/CodeGen/MIRPrinter.cpp head/contrib/llvm/lib/CodeGen/MIRPrintingPass.cpp head/contrib/llvm/lib/CodeGen/MachineBasicBlock.cpp head/contrib/llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp head/contrib/llvm/lib/CodeGen/MachineBlockPlacement.cpp head/contrib/llvm/lib/CodeGen/MachineBranchProbabilityInfo.cpp head/contrib/llvm/lib/CodeGen/MachineCSE.cpp head/contrib/llvm/lib/CodeGen/MachineCombiner.cpp head/contrib/llvm/lib/CodeGen/MachineCopyPropagation.cpp head/contrib/llvm/lib/CodeGen/MachineDominators.cpp head/contrib/llvm/lib/CodeGen/MachineFrameInfo.cpp head/contrib/llvm/lib/CodeGen/MachineFunction.cpp head/contrib/llvm/lib/CodeGen/MachineInstr.cpp head/contrib/llvm/lib/CodeGen/MachineInstrBundle.cpp head/contrib/llvm/lib/CodeGen/MachineLICM.cpp head/contrib/llvm/lib/CodeGen/MachineModuleInfo.cpp head/contrib/llvm/lib/CodeGen/MachineModuleInfoImpls.cpp head/contrib/llvm/lib/CodeGen/MachineOptimizationRemarkEmitter.cpp head/contrib/llvm/lib/CodeGen/MachineOutliner.cpp head/contrib/llvm/lib/CodeGen/MachinePipeliner.cpp head/contrib/llvm/lib/CodeGen/MachineRegisterInfo.cpp head/contrib/llvm/lib/CodeGen/MachineSSAUpdater.cpp head/contrib/llvm/lib/CodeGen/MachineScheduler.cpp head/contrib/llvm/lib/CodeGen/MachineSink.cpp head/contrib/llvm/lib/CodeGen/MachineTraceMetrics.cpp head/contrib/llvm/lib/CodeGen/MachineVerifier.cpp head/contrib/llvm/lib/CodeGen/MacroFusion.cpp head/contrib/llvm/lib/CodeGen/OptimizePHIs.cpp head/contrib/llvm/lib/CodeGen/PHIElimination.cpp head/contrib/llvm/lib/CodeGen/ParallelCG.cpp head/contrib/llvm/lib/CodeGen/PatchableFunction.cpp head/contrib/llvm/lib/CodeGen/PeepholeOptimizer.cpp head/contrib/llvm/lib/CodeGen/PostRAHazardRecognizer.cpp head/contrib/llvm/lib/CodeGen/PostRASchedulerList.cpp head/contrib/llvm/lib/CodeGen/PreISelIntrinsicLowering.cpp head/contrib/llvm/lib/CodeGen/ProcessImplicitDefs.cpp head/contrib/llvm/lib/CodeGen/PrologEpilogInserter.cpp head/contrib/llvm/lib/CodeGen/PseudoSourceValue.cpp head/contrib/llvm/lib/CodeGen/RegAllocBase.cpp head/contrib/llvm/lib/CodeGen/RegAllocBase.h head/contrib/llvm/lib/CodeGen/RegAllocBasic.cpp head/contrib/llvm/lib/CodeGen/RegAllocFast.cpp head/contrib/llvm/lib/CodeGen/RegAllocGreedy.cpp head/contrib/llvm/lib/CodeGen/RegAllocPBQP.cpp head/contrib/llvm/lib/CodeGen/RegUsageInfoCollector.cpp head/contrib/llvm/lib/CodeGen/RegUsageInfoPropagate.cpp head/contrib/llvm/lib/CodeGen/RegisterClassInfo.cpp head/contrib/llvm/lib/CodeGen/RegisterCoalescer.cpp head/contrib/llvm/lib/CodeGen/RegisterCoalescer.h head/contrib/llvm/lib/CodeGen/RegisterPressure.cpp head/contrib/llvm/lib/CodeGen/RegisterScavenging.cpp head/contrib/llvm/lib/CodeGen/RegisterUsageInfo.cpp head/contrib/llvm/lib/CodeGen/RenameIndependentSubregs.cpp head/contrib/llvm/lib/CodeGen/ResetMachineFunctionPass.cpp head/contrib/llvm/lib/CodeGen/SafeStack.cpp head/contrib/llvm/lib/CodeGen/SafeStackColoring.cpp head/contrib/llvm/lib/CodeGen/SafeStackColoring.h head/contrib/llvm/lib/CodeGen/SafeStackLayout.cpp head/contrib/llvm/lib/CodeGen/SafeStackLayout.h head/contrib/llvm/lib/CodeGen/ScalarizeMaskedMemIntrin.cpp head/contrib/llvm/lib/CodeGen/ScheduleDAG.cpp head/contrib/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp head/contrib/llvm/lib/CodeGen/ScheduleDAGPrinter.cpp head/contrib/llvm/lib/CodeGen/ScoreboardHazardRecognizer.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/ResourcePriorityQueue.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/SDNodeDbgValue.h head/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGVLIW.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGTargetInfo.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.h head/contrib/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp head/contrib/llvm/lib/CodeGen/ShadowStackGCLowering.cpp head/contrib/llvm/lib/CodeGen/ShrinkWrap.cpp head/contrib/llvm/lib/CodeGen/SlotIndexes.cpp head/contrib/llvm/lib/CodeGen/SpillPlacement.cpp head/contrib/llvm/lib/CodeGen/SpillPlacement.h head/contrib/llvm/lib/CodeGen/Spiller.h head/contrib/llvm/lib/CodeGen/SplitKit.cpp head/contrib/llvm/lib/CodeGen/SplitKit.h head/contrib/llvm/lib/CodeGen/StackColoring.cpp head/contrib/llvm/lib/CodeGen/StackMapLivenessAnalysis.cpp head/contrib/llvm/lib/CodeGen/StackMaps.cpp head/contrib/llvm/lib/CodeGen/StackProtector.cpp head/contrib/llvm/lib/CodeGen/StackSlotColoring.cpp head/contrib/llvm/lib/CodeGen/TailDuplication.cpp head/contrib/llvm/lib/CodeGen/TailDuplicator.cpp head/contrib/llvm/lib/CodeGen/TargetFrameLoweringImpl.cpp head/contrib/llvm/lib/CodeGen/TargetInstrInfo.cpp head/contrib/llvm/lib/CodeGen/TargetLoweringBase.cpp head/contrib/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp head/contrib/llvm/lib/CodeGen/TargetOptionsImpl.cpp head/contrib/llvm/lib/CodeGen/TargetPassConfig.cpp head/contrib/llvm/lib/CodeGen/TargetRegisterInfo.cpp head/contrib/llvm/lib/CodeGen/TargetSchedule.cpp head/contrib/llvm/lib/CodeGen/TargetSubtargetInfo.cpp head/contrib/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp head/contrib/llvm/lib/CodeGen/UnreachableBlockElim.cpp head/contrib/llvm/lib/CodeGen/VirtRegMap.cpp head/contrib/llvm/lib/CodeGen/WinEHPrepare.cpp head/contrib/llvm/lib/CodeGen/XRayInstrumentation.cpp head/contrib/llvm/lib/DebugInfo/CodeView/CVSymbolVisitor.cpp head/contrib/llvm/lib/DebugInfo/CodeView/CVTypeVisitor.cpp head/contrib/llvm/lib/DebugInfo/CodeView/EnumTables.cpp head/contrib/llvm/lib/DebugInfo/CodeView/LazyRandomTypeCollection.cpp head/contrib/llvm/lib/DebugInfo/CodeView/RecordSerialization.cpp head/contrib/llvm/lib/DebugInfo/CodeView/StringsAndChecksums.cpp head/contrib/llvm/lib/DebugInfo/CodeView/SymbolDumper.cpp head/contrib/llvm/lib/DebugInfo/CodeView/SymbolSerializer.cpp head/contrib/llvm/lib/DebugInfo/CodeView/TypeDumpVisitor.cpp head/contrib/llvm/lib/DebugInfo/CodeView/TypeIndexDiscovery.cpp head/contrib/llvm/lib/DebugInfo/CodeView/TypeRecordMapping.cpp head/contrib/llvm/lib/DebugInfo/CodeView/TypeStreamMerger.cpp head/contrib/llvm/lib/DebugInfo/CodeView/TypeTableCollection.cpp head/contrib/llvm/lib/DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp head/contrib/llvm/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp head/contrib/llvm/lib/DebugInfo/DWARF/DWARFCompileUnit.cpp head/contrib/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp head/contrib/llvm/lib/DebugInfo/DWARF/DWARFDataExtractor.cpp head/contrib/llvm/lib/DebugInfo/DWARF/DWARFDebugAbbrev.cpp head/contrib/llvm/lib/DebugInfo/DWARF/DWARFDebugAranges.cpp head/contrib/llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp head/contrib/llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp head/contrib/llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp head/contrib/llvm/lib/DebugInfo/DWARF/DWARFDebugPubTable.cpp head/contrib/llvm/lib/DebugInfo/DWARF/DWARFDebugRangeList.cpp head/contrib/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp head/contrib/llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp head/contrib/llvm/lib/DebugInfo/DWARF/DWARFTypeUnit.cpp head/contrib/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp head/contrib/llvm/lib/DebugInfo/DWARF/DWARFUnitIndex.cpp head/contrib/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp head/contrib/llvm/lib/DebugInfo/DWARF/SyntaxHighlighting.cpp head/contrib/llvm/lib/DebugInfo/DWARF/SyntaxHighlighting.h head/contrib/llvm/lib/DebugInfo/MSF/MSFBuilder.cpp head/contrib/llvm/lib/DebugInfo/MSF/MSFCommon.cpp head/contrib/llvm/lib/DebugInfo/MSF/MappedBlockStream.cpp head/contrib/llvm/lib/DebugInfo/PDB/DIA/DIARawSymbol.cpp head/contrib/llvm/lib/DebugInfo/PDB/DIA/DIASession.cpp head/contrib/llvm/lib/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.cpp head/contrib/llvm/lib/DebugInfo/PDB/Native/DbiStream.cpp head/contrib/llvm/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp head/contrib/llvm/lib/DebugInfo/PDB/Native/GlobalsStream.cpp head/contrib/llvm/lib/DebugInfo/PDB/Native/InfoStream.cpp head/contrib/llvm/lib/DebugInfo/PDB/Native/NativeBuiltinSymbol.cpp head/contrib/llvm/lib/DebugInfo/PDB/Native/NativeExeSymbol.cpp head/contrib/llvm/lib/DebugInfo/PDB/Native/NativeRawSymbol.cpp head/contrib/llvm/lib/DebugInfo/PDB/Native/NativeSession.cpp head/contrib/llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp head/contrib/llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp head/contrib/llvm/lib/DebugInfo/PDB/Native/PDBStringTable.cpp head/contrib/llvm/lib/DebugInfo/PDB/Native/PDBStringTableBuilder.cpp head/contrib/llvm/lib/DebugInfo/PDB/Native/PublicsStream.cpp head/contrib/llvm/lib/DebugInfo/PDB/Native/SymbolStream.cpp head/contrib/llvm/lib/DebugInfo/PDB/Native/TpiStreamBuilder.cpp head/contrib/llvm/lib/DebugInfo/PDB/PDB.cpp head/contrib/llvm/lib/DebugInfo/PDB/PDBExtras.cpp head/contrib/llvm/lib/DebugInfo/PDB/PDBInterfaceAnchors.cpp head/contrib/llvm/lib/DebugInfo/PDB/PDBSymbolFunc.cpp head/contrib/llvm/lib/DebugInfo/PDB/PDBSymbolTypeArray.cpp head/contrib/llvm/lib/DebugInfo/PDB/PDBSymbolTypeEnum.cpp head/contrib/llvm/lib/DebugInfo/PDB/PDBSymbolTypeUDT.cpp head/contrib/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp head/contrib/llvm/lib/Demangle/ItaniumDemangle.cpp head/contrib/llvm/lib/ExecutionEngine/ExecutionEngine.cpp head/contrib/llvm/lib/ExecutionEngine/ExecutionEngineBindings.cpp head/contrib/llvm/lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp head/contrib/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp head/contrib/llvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp head/contrib/llvm/lib/ExecutionEngine/Orc/OrcABISupport.cpp head/contrib/llvm/lib/ExecutionEngine/Orc/OrcCBindings.cpp head/contrib/llvm/lib/ExecutionEngine/Orc/OrcCBindingsStack.h head/contrib/llvm/lib/ExecutionEngine/Orc/OrcError.cpp head/contrib/llvm/lib/ExecutionEngine/Orc/OrcMCJITReplacement.h head/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/JITSymbol.cpp head/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp head/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp head/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h head/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h head/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp head/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h head/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFI386.h head/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFThumb.h head/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldELFMips.cpp head/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOARM.h head/contrib/llvm/lib/ExecutionEngine/SectionMemoryManager.cpp head/contrib/llvm/lib/ExecutionEngine/TargetSelect.cpp head/contrib/llvm/lib/IR/AsmWriter.cpp head/contrib/llvm/lib/IR/Attributes.cpp head/contrib/llvm/lib/IR/AutoUpgrade.cpp head/contrib/llvm/lib/IR/BasicBlock.cpp head/contrib/llvm/lib/IR/ConstantFold.cpp head/contrib/llvm/lib/IR/ConstantRange.cpp head/contrib/llvm/lib/IR/Constants.cpp head/contrib/llvm/lib/IR/Core.cpp head/contrib/llvm/lib/IR/DIBuilder.cpp head/contrib/llvm/lib/IR/DataLayout.cpp head/contrib/llvm/lib/IR/DebugInfo.cpp head/contrib/llvm/lib/IR/DebugInfoMetadata.cpp head/contrib/llvm/lib/IR/DebugLoc.cpp head/contrib/llvm/lib/IR/DiagnosticInfo.cpp head/contrib/llvm/lib/IR/Dominators.cpp head/contrib/llvm/lib/IR/Function.cpp head/contrib/llvm/lib/IR/Globals.cpp head/contrib/llvm/lib/IR/IRBuilder.cpp head/contrib/llvm/lib/IR/IRPrintingPasses.cpp head/contrib/llvm/lib/IR/InlineAsm.cpp head/contrib/llvm/lib/IR/Instruction.cpp head/contrib/llvm/lib/IR/Instructions.cpp head/contrib/llvm/lib/IR/IntrinsicInst.cpp head/contrib/llvm/lib/IR/LLVMContext.cpp head/contrib/llvm/lib/IR/LLVMContextImpl.cpp head/contrib/llvm/lib/IR/LLVMContextImpl.h head/contrib/llvm/lib/IR/LegacyPassManager.cpp head/contrib/llvm/lib/IR/MDBuilder.cpp head/contrib/llvm/lib/IR/Metadata.cpp head/contrib/llvm/lib/IR/OptBisect.cpp head/contrib/llvm/lib/IR/Pass.cpp head/contrib/llvm/lib/IR/PassRegistry.cpp head/contrib/llvm/lib/IR/SafepointIRVerifier.cpp head/contrib/llvm/lib/IR/User.cpp head/contrib/llvm/lib/IR/Value.cpp head/contrib/llvm/lib/IR/ValueSymbolTable.cpp head/contrib/llvm/lib/IR/ValueTypes.cpp head/contrib/llvm/lib/IR/Verifier.cpp head/contrib/llvm/lib/IRReader/IRReader.cpp head/contrib/llvm/lib/LTO/Caching.cpp head/contrib/llvm/lib/LTO/LTO.cpp head/contrib/llvm/lib/LTO/LTOBackend.cpp head/contrib/llvm/lib/LTO/LTOCodeGenerator.cpp head/contrib/llvm/lib/LTO/LTOModule.cpp head/contrib/llvm/lib/LTO/ThinLTOCodeGenerator.cpp head/contrib/llvm/lib/LTO/UpdateCompilerUsed.cpp head/contrib/llvm/lib/MC/ELFObjectWriter.cpp head/contrib/llvm/lib/MC/MCAsmBackend.cpp head/contrib/llvm/lib/MC/MCAsmInfoWasm.cpp head/contrib/llvm/lib/MC/MCAsmStreamer.cpp head/contrib/llvm/lib/MC/MCAssembler.cpp head/contrib/llvm/lib/MC/MCCodeView.cpp head/contrib/llvm/lib/MC/MCContext.cpp head/contrib/llvm/lib/MC/MCDwarf.cpp head/contrib/llvm/lib/MC/MCELFObjectTargetWriter.cpp head/contrib/llvm/lib/MC/MCELFStreamer.cpp head/contrib/llvm/lib/MC/MCExpr.cpp head/contrib/llvm/lib/MC/MCFragment.cpp head/contrib/llvm/lib/MC/MCMachOStreamer.cpp head/contrib/llvm/lib/MC/MCNullStreamer.cpp head/contrib/llvm/lib/MC/MCObjectFileInfo.cpp head/contrib/llvm/lib/MC/MCObjectStreamer.cpp head/contrib/llvm/lib/MC/MCParser/AsmLexer.cpp head/contrib/llvm/lib/MC/MCParser/AsmParser.cpp head/contrib/llvm/lib/MC/MCParser/COFFAsmParser.cpp head/contrib/llvm/lib/MC/MCParser/DarwinAsmParser.cpp head/contrib/llvm/lib/MC/MCParser/ELFAsmParser.cpp head/contrib/llvm/lib/MC/MCParser/MCAsmParser.cpp head/contrib/llvm/lib/MC/MCParser/MCTargetAsmParser.cpp head/contrib/llvm/lib/MC/MCRegisterInfo.cpp head/contrib/llvm/lib/MC/MCSectionELF.cpp head/contrib/llvm/lib/MC/MCSectionWasm.cpp head/contrib/llvm/lib/MC/MCStreamer.cpp head/contrib/llvm/lib/MC/MCSubtargetInfo.cpp head/contrib/llvm/lib/MC/MCSymbolELF.cpp head/contrib/llvm/lib/MC/MCWasmStreamer.cpp head/contrib/llvm/lib/MC/MCWin64EH.cpp head/contrib/llvm/lib/MC/MCWinCOFFStreamer.cpp head/contrib/llvm/lib/MC/MachObjectWriter.cpp head/contrib/llvm/lib/MC/StringTableBuilder.cpp head/contrib/llvm/lib/MC/WasmObjectWriter.cpp head/contrib/llvm/lib/MC/WinCOFFObjectWriter.cpp head/contrib/llvm/lib/Object/Archive.cpp head/contrib/llvm/lib/Object/ArchiveWriter.cpp head/contrib/llvm/lib/Object/COFFImportFile.cpp head/contrib/llvm/lib/Object/COFFModuleDefinition.cpp head/contrib/llvm/lib/Object/COFFObjectFile.cpp head/contrib/llvm/lib/Object/ELF.cpp head/contrib/llvm/lib/Object/ELFObjectFile.cpp head/contrib/llvm/lib/Object/IRObjectFile.cpp head/contrib/llvm/lib/Object/IRSymtab.cpp head/contrib/llvm/lib/Object/MachOObjectFile.cpp head/contrib/llvm/lib/Object/ModuleSymbolTable.cpp head/contrib/llvm/lib/Object/ObjectFile.cpp head/contrib/llvm/lib/Object/SymbolicFile.cpp head/contrib/llvm/lib/Object/WasmObjectFile.cpp head/contrib/llvm/lib/Object/WindowsResource.cpp head/contrib/llvm/lib/ObjectYAML/COFFYAML.cpp head/contrib/llvm/lib/ObjectYAML/CodeViewYAMLDebugSections.cpp head/contrib/llvm/lib/ObjectYAML/CodeViewYAMLSymbols.cpp head/contrib/llvm/lib/ObjectYAML/CodeViewYAMLTypes.cpp head/contrib/llvm/lib/ObjectYAML/DWARFEmitter.cpp head/contrib/llvm/lib/ObjectYAML/DWARFVisitor.cpp head/contrib/llvm/lib/ObjectYAML/ELFYAML.cpp head/contrib/llvm/lib/ObjectYAML/MachOYAML.cpp head/contrib/llvm/lib/ObjectYAML/WasmYAML.cpp head/contrib/llvm/lib/Option/OptTable.cpp head/contrib/llvm/lib/Passes/PassBuilder.cpp head/contrib/llvm/lib/Passes/PassRegistry.def head/contrib/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp head/contrib/llvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp head/contrib/llvm/lib/ProfileData/Coverage/CoverageMappingWriter.cpp head/contrib/llvm/lib/ProfileData/InstrProf.cpp head/contrib/llvm/lib/ProfileData/InstrProfReader.cpp head/contrib/llvm/lib/ProfileData/ProfileSummaryBuilder.cpp head/contrib/llvm/lib/ProfileData/SampleProfReader.cpp head/contrib/llvm/lib/ProfileData/SampleProfWriter.cpp head/contrib/llvm/lib/Support/APFloat.cpp head/contrib/llvm/lib/Support/APInt.cpp head/contrib/llvm/lib/Support/ARMAttributeParser.cpp head/contrib/llvm/lib/Support/Atomic.cpp head/contrib/llvm/lib/Support/BinaryStreamRef.cpp head/contrib/llvm/lib/Support/BinaryStreamWriter.cpp head/contrib/llvm/lib/Support/BlockFrequency.cpp head/contrib/llvm/lib/Support/CachePruning.cpp head/contrib/llvm/lib/Support/Chrono.cpp head/contrib/llvm/lib/Support/CommandLine.cpp head/contrib/llvm/lib/Support/Error.cpp head/contrib/llvm/lib/Support/FileOutputBuffer.cpp head/contrib/llvm/lib/Support/FoldingSet.cpp head/contrib/llvm/lib/Support/FormatVariadic.cpp head/contrib/llvm/lib/Support/GlobPattern.cpp head/contrib/llvm/lib/Support/GraphWriter.cpp head/contrib/llvm/lib/Support/Host.cpp head/contrib/llvm/lib/Support/LockFileManager.cpp head/contrib/llvm/lib/Support/LowLevelType.cpp head/contrib/llvm/lib/Support/MD5.cpp head/contrib/llvm/lib/Support/MemoryBuffer.cpp head/contrib/llvm/lib/Support/Parallel.cpp head/contrib/llvm/lib/Support/Path.cpp head/contrib/llvm/lib/Support/Process.cpp head/contrib/llvm/lib/Support/Program.cpp head/contrib/llvm/lib/Support/RandomNumberGenerator.cpp head/contrib/llvm/lib/Support/ScopedPrinter.cpp head/contrib/llvm/lib/Support/Signals.cpp head/contrib/llvm/lib/Support/SmallPtrSet.cpp head/contrib/llvm/lib/Support/SmallVector.cpp head/contrib/llvm/lib/Support/SourceMgr.cpp head/contrib/llvm/lib/Support/SpecialCaseList.cpp head/contrib/llvm/lib/Support/Statistic.cpp head/contrib/llvm/lib/Support/StringExtras.cpp head/contrib/llvm/lib/Support/StringMap.cpp head/contrib/llvm/lib/Support/StringRef.cpp head/contrib/llvm/lib/Support/TarWriter.cpp head/contrib/llvm/lib/Support/TargetParser.cpp head/contrib/llvm/lib/Support/TargetRegistry.cpp head/contrib/llvm/lib/Support/ThreadPool.cpp head/contrib/llvm/lib/Support/Threading.cpp head/contrib/llvm/lib/Support/Timer.cpp head/contrib/llvm/lib/Support/ToolOutputFile.cpp head/contrib/llvm/lib/Support/Triple.cpp head/contrib/llvm/lib/Support/Unix/DynamicLibrary.inc head/contrib/llvm/lib/Support/Unix/Memory.inc head/contrib/llvm/lib/Support/Unix/Path.inc head/contrib/llvm/lib/Support/Unix/Process.inc head/contrib/llvm/lib/Support/Unix/Program.inc head/contrib/llvm/lib/Support/Unix/Threading.inc head/contrib/llvm/lib/Support/Windows/Memory.inc head/contrib/llvm/lib/Support/Windows/Path.inc head/contrib/llvm/lib/Support/Windows/Process.inc head/contrib/llvm/lib/Support/Windows/Program.inc head/contrib/llvm/lib/Support/Windows/Signals.inc head/contrib/llvm/lib/Support/YAMLTraits.cpp head/contrib/llvm/lib/Support/raw_ostream.cpp head/contrib/llvm/lib/Support/regcomp.c head/contrib/llvm/lib/Support/regex2.h head/contrib/llvm/lib/TableGen/Error.cpp head/contrib/llvm/lib/TableGen/Main.cpp head/contrib/llvm/lib/TableGen/Record.cpp head/contrib/llvm/lib/TableGen/StringMatcher.cpp head/contrib/llvm/lib/Target/AArch64/AArch64.h head/contrib/llvm/lib/Target/AArch64/AArch64.td head/contrib/llvm/lib/Target/AArch64/AArch64A53Fix835769.cpp head/contrib/llvm/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp head/contrib/llvm/lib/Target/AArch64/AArch64AdvSIMDScalarPass.cpp head/contrib/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp head/contrib/llvm/lib/Target/AArch64/AArch64CallLowering.cpp head/contrib/llvm/lib/Target/AArch64/AArch64CallLowering.h head/contrib/llvm/lib/Target/AArch64/AArch64CallingConvention.h head/contrib/llvm/lib/Target/AArch64/AArch64CallingConvention.td head/contrib/llvm/lib/Target/AArch64/AArch64CleanupLocalDynamicTLSPass.cpp head/contrib/llvm/lib/Target/AArch64/AArch64CollectLOH.cpp head/contrib/llvm/lib/Target/AArch64/AArch64CondBrTuning.cpp head/contrib/llvm/lib/Target/AArch64/AArch64ConditionOptimizer.cpp head/contrib/llvm/lib/Target/AArch64/AArch64ConditionalCompares.cpp head/contrib/llvm/lib/Target/AArch64/AArch64DeadRegisterDefinitionsPass.cpp head/contrib/llvm/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp head/contrib/llvm/lib/Target/AArch64/AArch64FalkorHWPFFix.cpp head/contrib/llvm/lib/Target/AArch64/AArch64FastISel.cpp head/contrib/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp head/contrib/llvm/lib/Target/AArch64/AArch64FrameLowering.h head/contrib/llvm/lib/Target/AArch64/AArch64GenRegisterBankInfo.def head/contrib/llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp head/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp head/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.h head/contrib/llvm/lib/Target/AArch64/AArch64InstrAtomics.td head/contrib/llvm/lib/Target/AArch64/AArch64InstrFormats.td head/contrib/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp head/contrib/llvm/lib/Target/AArch64/AArch64InstrInfo.h head/contrib/llvm/lib/Target/AArch64/AArch64InstrInfo.td head/contrib/llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp head/contrib/llvm/lib/Target/AArch64/AArch64LegalizerInfo.cpp head/contrib/llvm/lib/Target/AArch64/AArch64LegalizerInfo.h head/contrib/llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp head/contrib/llvm/lib/Target/AArch64/AArch64MCInstLower.cpp head/contrib/llvm/lib/Target/AArch64/AArch64MachineFunctionInfo.h head/contrib/llvm/lib/Target/AArch64/AArch64MacroFusion.cpp head/contrib/llvm/lib/Target/AArch64/AArch64PBQPRegAlloc.cpp head/contrib/llvm/lib/Target/AArch64/AArch64PromoteConstant.cpp head/contrib/llvm/lib/Target/AArch64/AArch64RedundantCopyElimination.cpp head/contrib/llvm/lib/Target/AArch64/AArch64RegisterBankInfo.cpp head/contrib/llvm/lib/Target/AArch64/AArch64RegisterBankInfo.h head/contrib/llvm/lib/Target/AArch64/AArch64RegisterBanks.td head/contrib/llvm/lib/Target/AArch64/AArch64RegisterInfo.cpp head/contrib/llvm/lib/Target/AArch64/AArch64RegisterInfo.td head/contrib/llvm/lib/Target/AArch64/AArch64SchedA53.td head/contrib/llvm/lib/Target/AArch64/AArch64SchedA57.td head/contrib/llvm/lib/Target/AArch64/AArch64SchedCyclone.td head/contrib/llvm/lib/Target/AArch64/AArch64SchedFalkor.td head/contrib/llvm/lib/Target/AArch64/AArch64SchedKryo.td head/contrib/llvm/lib/Target/AArch64/AArch64SchedM1.td head/contrib/llvm/lib/Target/AArch64/AArch64SchedThunderX.td head/contrib/llvm/lib/Target/AArch64/AArch64SchedThunderX2T99.td head/contrib/llvm/lib/Target/AArch64/AArch64SelectionDAGInfo.cpp head/contrib/llvm/lib/Target/AArch64/AArch64StorePairSuppress.cpp head/contrib/llvm/lib/Target/AArch64/AArch64Subtarget.cpp head/contrib/llvm/lib/Target/AArch64/AArch64Subtarget.h head/contrib/llvm/lib/Target/AArch64/AArch64SystemOperands.td head/contrib/llvm/lib/Target/AArch64/AArch64TargetMachine.cpp head/contrib/llvm/lib/Target/AArch64/AArch64TargetMachine.h head/contrib/llvm/lib/Target/AArch64/AArch64TargetObjectFile.h head/contrib/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp head/contrib/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h head/contrib/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp head/contrib/llvm/lib/Target/AArch64/Disassembler/AArch64Disassembler.cpp head/contrib/llvm/lib/Target/AArch64/InstPrinter/AArch64InstPrinter.cpp head/contrib/llvm/lib/Target/AArch64/InstPrinter/AArch64InstPrinter.h head/contrib/llvm/lib/Target/AArch64/MCTargetDesc/AArch64AsmBackend.cpp head/contrib/llvm/lib/Target/AArch64/MCTargetDesc/AArch64ELFObjectWriter.cpp head/contrib/llvm/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp head/contrib/llvm/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.h head/contrib/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp head/contrib/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.h head/contrib/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCExpr.cpp head/contrib/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.cpp head/contrib/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.h head/contrib/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MachObjectWriter.cpp head/contrib/llvm/lib/Target/AArch64/MCTargetDesc/AArch64WinCOFFObjectWriter.cpp head/contrib/llvm/lib/Target/AArch64/MCTargetDesc/AArch64WinCOFFStreamer.cpp head/contrib/llvm/lib/Target/AArch64/MCTargetDesc/AArch64WinCOFFStreamer.h head/contrib/llvm/lib/Target/AArch64/TargetInfo/AArch64TargetInfo.cpp head/contrib/llvm/lib/Target/AArch64/Utils/AArch64BaseInfo.h head/contrib/llvm/lib/Target/AMDGPU/AMDGPU.h head/contrib/llvm/lib/Target/AMDGPU/AMDGPU.td head/contrib/llvm/lib/Target/AMDGPU/AMDGPUAliasAnalysis.cpp head/contrib/llvm/lib/Target/AMDGPU/AMDGPUAliasAnalysis.h head/contrib/llvm/lib/Target/AMDGPU/AMDGPUAlwaysInlinePass.cpp head/contrib/llvm/lib/Target/AMDGPU/AMDGPUAnnotateKernelFeatures.cpp head/contrib/llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp head/contrib/llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.h head/contrib/llvm/lib/Target/AMDGPU/AMDGPUCallLowering.cpp head/contrib/llvm/lib/Target/AMDGPU/AMDGPUCallingConv.td head/contrib/llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp head/contrib/llvm/lib/Target/AMDGPU/AMDGPUFrameLowering.h head/contrib/llvm/lib/Target/AMDGPU/AMDGPUGenRegisterBankInfo.def head/contrib/llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp head/contrib/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp head/contrib/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.h head/contrib/llvm/lib/Target/AMDGPU/AMDGPUInstrInfo.cpp head/contrib/llvm/lib/Target/AMDGPU/AMDGPUInstrInfo.h head/contrib/llvm/lib/Target/AMDGPU/AMDGPUInstrInfo.td head/contrib/llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp head/contrib/llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.h head/contrib/llvm/lib/Target/AMDGPU/AMDGPUInstructions.td head/contrib/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp head/contrib/llvm/lib/Target/AMDGPU/AMDGPUMCInstLower.cpp head/contrib/llvm/lib/Target/AMDGPU/AMDGPUMachineCFGStructurizer.cpp head/contrib/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp head/contrib/llvm/lib/Target/AMDGPU/AMDGPUOpenCLImageTypeLoweringPass.cpp head/contrib/llvm/lib/Target/AMDGPU/AMDGPUPTNote.h head/contrib/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp head/contrib/llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp head/contrib/llvm/lib/Target/AMDGPU/AMDGPURegisterInfo.cpp head/contrib/llvm/lib/Target/AMDGPU/AMDGPURegisterInfo.td head/contrib/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp head/contrib/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.h head/contrib/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp head/contrib/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.h head/contrib/llvm/lib/Target/AMDGPU/AMDGPUTargetObjectFile.cpp head/contrib/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp head/contrib/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h head/contrib/llvm/lib/Target/AMDGPU/AMDGPUUnifyDivergentExitNodes.cpp head/contrib/llvm/lib/Target/AMDGPU/AMDGPUUnifyMetadata.cpp head/contrib/llvm/lib/Target/AMDGPU/AMDILCFGStructurizer.cpp head/contrib/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp head/contrib/llvm/lib/Target/AMDGPU/BUFInstructions.td head/contrib/llvm/lib/Target/AMDGPU/CaymanInstructions.td head/contrib/llvm/lib/Target/AMDGPU/DSInstructions.td head/contrib/llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp head/contrib/llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.h head/contrib/llvm/lib/Target/AMDGPU/EvergreenInstructions.td head/contrib/llvm/lib/Target/AMDGPU/FLATInstructions.td head/contrib/llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp head/contrib/llvm/lib/Target/AMDGPU/GCNHazardRecognizer.h head/contrib/llvm/lib/Target/AMDGPU/GCNIterativeScheduler.cpp head/contrib/llvm/lib/Target/AMDGPU/GCNIterativeScheduler.h head/contrib/llvm/lib/Target/AMDGPU/GCNMinRegStrategy.cpp head/contrib/llvm/lib/Target/AMDGPU/GCNRegPressure.cpp head/contrib/llvm/lib/Target/AMDGPU/GCNRegPressure.h head/contrib/llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp head/contrib/llvm/lib/Target/AMDGPU/InstPrinter/AMDGPUInstPrinter.cpp head/contrib/llvm/lib/Target/AMDGPU/InstPrinter/AMDGPUInstPrinter.h head/contrib/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp head/contrib/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUELFObjectWriter.cpp head/contrib/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUELFStreamer.cpp head/contrib/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUELFStreamer.h head/contrib/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCTargetDesc.cpp head/contrib/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCTargetDesc.h head/contrib/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp head/contrib/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.h head/contrib/llvm/lib/Target/AMDGPU/MCTargetDesc/SIMCCodeEmitter.cpp head/contrib/llvm/lib/Target/AMDGPU/MIMGInstructions.td head/contrib/llvm/lib/Target/AMDGPU/Processors.td head/contrib/llvm/lib/Target/AMDGPU/R600ClauseMergePass.cpp head/contrib/llvm/lib/Target/AMDGPU/R600ControlFlowFinalizer.cpp head/contrib/llvm/lib/Target/AMDGPU/R600ExpandSpecialInstrs.cpp head/contrib/llvm/lib/Target/AMDGPU/R600FrameLowering.h head/contrib/llvm/lib/Target/AMDGPU/R600ISelLowering.cpp head/contrib/llvm/lib/Target/AMDGPU/R600InstrFormats.td head/contrib/llvm/lib/Target/AMDGPU/R600InstrInfo.cpp head/contrib/llvm/lib/Target/AMDGPU/R600InstrInfo.h head/contrib/llvm/lib/Target/AMDGPU/R600Instructions.td head/contrib/llvm/lib/Target/AMDGPU/R600OptimizeVectorRegisters.cpp head/contrib/llvm/lib/Target/AMDGPU/R600Packetizer.cpp head/contrib/llvm/lib/Target/AMDGPU/R600RegisterInfo.td head/contrib/llvm/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp head/contrib/llvm/lib/Target/AMDGPU/SIDefines.h head/contrib/llvm/lib/Target/AMDGPU/SIFixSGPRCopies.cpp head/contrib/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp head/contrib/llvm/lib/Target/AMDGPU/SIFrameLowering.cpp head/contrib/llvm/lib/Target/AMDGPU/SIFrameLowering.h head/contrib/llvm/lib/Target/AMDGPU/SIISelLowering.cpp head/contrib/llvm/lib/Target/AMDGPU/SIISelLowering.h head/contrib/llvm/lib/Target/AMDGPU/SIInsertSkips.cpp head/contrib/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp head/contrib/llvm/lib/Target/AMDGPU/SIInsertWaits.cpp head/contrib/llvm/lib/Target/AMDGPU/SIInstrFormats.td head/contrib/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp head/contrib/llvm/lib/Target/AMDGPU/SIInstrInfo.h head/contrib/llvm/lib/Target/AMDGPU/SIInstrInfo.td head/contrib/llvm/lib/Target/AMDGPU/SIInstructions.td head/contrib/llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp head/contrib/llvm/lib/Target/AMDGPU/SILowerControlFlow.cpp head/contrib/llvm/lib/Target/AMDGPU/SILowerI1Copies.cpp head/contrib/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp head/contrib/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h head/contrib/llvm/lib/Target/AMDGPU/SIMachineScheduler.cpp head/contrib/llvm/lib/Target/AMDGPU/SIMachineScheduler.h head/contrib/llvm/lib/Target/AMDGPU/SIOptimizeExecMasking.cpp head/contrib/llvm/lib/Target/AMDGPU/SIPeepholeSDWA.cpp head/contrib/llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp head/contrib/llvm/lib/Target/AMDGPU/SIRegisterInfo.h head/contrib/llvm/lib/Target/AMDGPU/SIRegisterInfo.td head/contrib/llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp head/contrib/llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp head/contrib/llvm/lib/Target/AMDGPU/SMInstructions.td head/contrib/llvm/lib/Target/AMDGPU/SOPInstructions.td head/contrib/llvm/lib/Target/AMDGPU/TargetInfo/AMDGPUTargetInfo.cpp head/contrib/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp head/contrib/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h head/contrib/llvm/lib/Target/AMDGPU/Utils/AMDKernelCodeTUtils.cpp head/contrib/llvm/lib/Target/AMDGPU/Utils/AMDKernelCodeTUtils.h head/contrib/llvm/lib/Target/AMDGPU/VOP1Instructions.td head/contrib/llvm/lib/Target/AMDGPU/VOP2Instructions.td head/contrib/llvm/lib/Target/AMDGPU/VOP3Instructions.td head/contrib/llvm/lib/Target/AMDGPU/VOP3PInstructions.td head/contrib/llvm/lib/Target/AMDGPU/VOPCInstructions.td head/contrib/llvm/lib/Target/AMDGPU/VOPInstructions.td head/contrib/llvm/lib/Target/ARM/A15SDOptimizer.cpp head/contrib/llvm/lib/Target/ARM/ARM.h head/contrib/llvm/lib/Target/ARM/ARM.td head/contrib/llvm/lib/Target/ARM/ARMAsmPrinter.cpp head/contrib/llvm/lib/Target/ARM/ARMAsmPrinter.h head/contrib/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp head/contrib/llvm/lib/Target/ARM/ARMBaseInstrInfo.h head/contrib/llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp head/contrib/llvm/lib/Target/ARM/ARMBaseRegisterInfo.h head/contrib/llvm/lib/Target/ARM/ARMCallLowering.cpp head/contrib/llvm/lib/Target/ARM/ARMCallLowering.h head/contrib/llvm/lib/Target/ARM/ARMCallingConv.h head/contrib/llvm/lib/Target/ARM/ARMCallingConv.td head/contrib/llvm/lib/Target/ARM/ARMComputeBlockSize.cpp head/contrib/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp head/contrib/llvm/lib/Target/ARM/ARMConstantPoolValue.cpp head/contrib/llvm/lib/Target/ARM/ARMConstantPoolValue.h head/contrib/llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp head/contrib/llvm/lib/Target/ARM/ARMFastISel.cpp head/contrib/llvm/lib/Target/ARM/ARMFrameLowering.cpp head/contrib/llvm/lib/Target/ARM/ARMFrameLowering.h head/contrib/llvm/lib/Target/ARM/ARMHazardRecognizer.cpp head/contrib/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp head/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp head/contrib/llvm/lib/Target/ARM/ARMISelLowering.h head/contrib/llvm/lib/Target/ARM/ARMInstrFormats.td head/contrib/llvm/lib/Target/ARM/ARMInstrInfo.td head/contrib/llvm/lib/Target/ARM/ARMInstrNEON.td head/contrib/llvm/lib/Target/ARM/ARMInstrThumb.td head/contrib/llvm/lib/Target/ARM/ARMInstrThumb2.td head/contrib/llvm/lib/Target/ARM/ARMInstrVFP.td head/contrib/llvm/lib/Target/ARM/ARMInstructionSelector.cpp head/contrib/llvm/lib/Target/ARM/ARMLegalizerInfo.cpp head/contrib/llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp head/contrib/llvm/lib/Target/ARM/ARMMacroFusion.cpp head/contrib/llvm/lib/Target/ARM/ARMOptimizeBarriersPass.cpp head/contrib/llvm/lib/Target/ARM/ARMRegisterBankInfo.cpp head/contrib/llvm/lib/Target/ARM/ARMRegisterInfo.td head/contrib/llvm/lib/Target/ARM/ARMSchedule.td head/contrib/llvm/lib/Target/ARM/ARMScheduleA57.td head/contrib/llvm/lib/Target/ARM/ARMScheduleR52.td head/contrib/llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp head/contrib/llvm/lib/Target/ARM/ARMSubtarget.cpp head/contrib/llvm/lib/Target/ARM/ARMSubtarget.h head/contrib/llvm/lib/Target/ARM/ARMTargetMachine.cpp head/contrib/llvm/lib/Target/ARM/ARMTargetMachine.h head/contrib/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp head/contrib/llvm/lib/Target/ARM/ARMTargetTransformInfo.h head/contrib/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp head/contrib/llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp head/contrib/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp head/contrib/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.h head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMAddressingModes.h head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.h head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackendDarwin.h head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackendELF.h head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackendWinCOFF.h head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMBaseInfo.h head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMCAsmInfo.cpp head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMCExpr.cpp head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.h head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMachORelocationInfo.cpp head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMachObjectWriter.cpp head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMTargetStreamer.cpp head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMWinCOFFObjectWriter.cpp head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMWinCOFFStreamer.cpp head/contrib/llvm/lib/Target/ARM/MLxExpansionPass.cpp head/contrib/llvm/lib/Target/ARM/TargetInfo/ARMTargetInfo.cpp head/contrib/llvm/lib/Target/ARM/Thumb1FrameLowering.cpp head/contrib/llvm/lib/Target/ARM/Thumb1FrameLowering.h head/contrib/llvm/lib/Target/ARM/Thumb1InstrInfo.cpp head/contrib/llvm/lib/Target/ARM/Thumb2InstrInfo.cpp head/contrib/llvm/lib/Target/ARM/Thumb2SizeReduction.cpp head/contrib/llvm/lib/Target/ARM/ThumbRegisterInfo.cpp head/contrib/llvm/lib/Target/ARM/ThumbRegisterInfo.h head/contrib/llvm/lib/Target/AVR/AVR.h head/contrib/llvm/lib/Target/AVR/AVRAsmPrinter.cpp head/contrib/llvm/lib/Target/AVR/AVRExpandPseudoInsts.cpp head/contrib/llvm/lib/Target/AVR/AVRFrameLowering.cpp head/contrib/llvm/lib/Target/AVR/AVRFrameLowering.h head/contrib/llvm/lib/Target/AVR/AVRISelLowering.cpp head/contrib/llvm/lib/Target/AVR/AVRISelLowering.h head/contrib/llvm/lib/Target/AVR/AVRInstrInfo.h head/contrib/llvm/lib/Target/AVR/AVRRegisterInfo.cpp head/contrib/llvm/lib/Target/AVR/AVRRegisterInfo.h head/contrib/llvm/lib/Target/AVR/AVRRelaxMemOperations.cpp head/contrib/llvm/lib/Target/AVR/AVRSubtarget.h head/contrib/llvm/lib/Target/AVR/AVRTargetMachine.cpp head/contrib/llvm/lib/Target/AVR/AVRTargetMachine.h head/contrib/llvm/lib/Target/AVR/AsmParser/AVRAsmParser.cpp head/contrib/llvm/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.cpp head/contrib/llvm/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.h head/contrib/llvm/lib/Target/AVR/MCTargetDesc/AVRELFObjectWriter.cpp head/contrib/llvm/lib/Target/AVR/MCTargetDesc/AVRFixupKinds.h head/contrib/llvm/lib/Target/AVR/MCTargetDesc/AVRMCExpr.cpp head/contrib/llvm/lib/Target/AVR/MCTargetDesc/AVRMCExpr.h head/contrib/llvm/lib/Target/AVR/MCTargetDesc/AVRMCTargetDesc.cpp head/contrib/llvm/lib/Target/AVR/MCTargetDesc/AVRMCTargetDesc.h head/contrib/llvm/lib/Target/AVR/TargetInfo/AVRTargetInfo.cpp head/contrib/llvm/lib/Target/BPF/BPF.td head/contrib/llvm/lib/Target/BPF/BPFAsmPrinter.cpp head/contrib/llvm/lib/Target/BPF/BPFFrameLowering.h head/contrib/llvm/lib/Target/BPF/BPFISelDAGToDAG.cpp head/contrib/llvm/lib/Target/BPF/BPFISelLowering.cpp head/contrib/llvm/lib/Target/BPF/BPFISelLowering.h head/contrib/llvm/lib/Target/BPF/BPFInstrFormats.td head/contrib/llvm/lib/Target/BPF/BPFInstrInfo.h head/contrib/llvm/lib/Target/BPF/BPFInstrInfo.td head/contrib/llvm/lib/Target/BPF/BPFRegisterInfo.cpp head/contrib/llvm/lib/Target/BPF/BPFRegisterInfo.h head/contrib/llvm/lib/Target/BPF/BPFRegisterInfo.td head/contrib/llvm/lib/Target/BPF/BPFSubtarget.cpp head/contrib/llvm/lib/Target/BPF/BPFSubtarget.h head/contrib/llvm/lib/Target/BPF/BPFTargetMachine.cpp head/contrib/llvm/lib/Target/BPF/BPFTargetMachine.h head/contrib/llvm/lib/Target/BPF/Disassembler/BPFDisassembler.cpp head/contrib/llvm/lib/Target/BPF/InstPrinter/BPFInstPrinter.cpp head/contrib/llvm/lib/Target/BPF/InstPrinter/BPFInstPrinter.h head/contrib/llvm/lib/Target/BPF/MCTargetDesc/BPFAsmBackend.cpp head/contrib/llvm/lib/Target/BPF/MCTargetDesc/BPFELFObjectWriter.cpp head/contrib/llvm/lib/Target/BPF/MCTargetDesc/BPFMCCodeEmitter.cpp head/contrib/llvm/lib/Target/BPF/MCTargetDesc/BPFMCTargetDesc.cpp head/contrib/llvm/lib/Target/BPF/MCTargetDesc/BPFMCTargetDesc.h head/contrib/llvm/lib/Target/BPF/TargetInfo/BPFTargetInfo.cpp head/contrib/llvm/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp head/contrib/llvm/lib/Target/Hexagon/BitTracker.cpp head/contrib/llvm/lib/Target/Hexagon/BitTracker.h head/contrib/llvm/lib/Target/Hexagon/Disassembler/HexagonDisassembler.cpp head/contrib/llvm/lib/Target/Hexagon/Hexagon.h head/contrib/llvm/lib/Target/Hexagon/Hexagon.td head/contrib/llvm/lib/Target/Hexagon/HexagonAsmPrinter.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonAsmPrinter.h head/contrib/llvm/lib/Target/Hexagon/HexagonBitSimplify.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonBitTracker.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonBitTracker.h head/contrib/llvm/lib/Target/Hexagon/HexagonBlockRanges.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonBlockRanges.h head/contrib/llvm/lib/Target/Hexagon/HexagonCFGOptimizer.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonCommonGEP.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonConstPropagation.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonCopyToCombine.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonDepArch.h head/contrib/llvm/lib/Target/Hexagon/HexagonDepArch.td head/contrib/llvm/lib/Target/Hexagon/HexagonDepDecoders.h head/contrib/llvm/lib/Target/Hexagon/HexagonDepIICHVX.td head/contrib/llvm/lib/Target/Hexagon/HexagonDepIICScalar.td head/contrib/llvm/lib/Target/Hexagon/HexagonDepITypes.h head/contrib/llvm/lib/Target/Hexagon/HexagonDepITypes.td head/contrib/llvm/lib/Target/Hexagon/HexagonDepInstrFormats.td head/contrib/llvm/lib/Target/Hexagon/HexagonDepInstrInfo.td head/contrib/llvm/lib/Target/Hexagon/HexagonDepMappings.td head/contrib/llvm/lib/Target/Hexagon/HexagonDepOperands.td head/contrib/llvm/lib/Target/Hexagon/HexagonDepTimingClasses.h head/contrib/llvm/lib/Target/Hexagon/HexagonEarlyIfConv.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonExpandCondsets.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonFixupHwLoops.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonFrameLowering.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonFrameLowering.h head/contrib/llvm/lib/Target/Hexagon/HexagonGenExtract.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonGenInsert.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonGenMux.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonGenPredicate.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonHardwareLoops.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonIICHVX.td head/contrib/llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonISelLowering.h head/contrib/llvm/lib/Target/Hexagon/HexagonInstrFormats.td head/contrib/llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonInstrInfo.h head/contrib/llvm/lib/Target/Hexagon/HexagonIntrinsics.td head/contrib/llvm/lib/Target/Hexagon/HexagonIntrinsicsV60.td head/contrib/llvm/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonMCInstLower.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonMachineScheduler.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonMachineScheduler.h head/contrib/llvm/lib/Target/Hexagon/HexagonMapAsm2IntrinV62.gen.td head/contrib/llvm/lib/Target/Hexagon/HexagonNewValueJump.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonOperands.td head/contrib/llvm/lib/Target/Hexagon/HexagonOptAddrMode.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonPatterns.td head/contrib/llvm/lib/Target/Hexagon/HexagonPeephole.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonPseudo.td head/contrib/llvm/lib/Target/Hexagon/HexagonRDFOpt.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonRegisterInfo.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonRegisterInfo.h head/contrib/llvm/lib/Target/Hexagon/HexagonRegisterInfo.td head/contrib/llvm/lib/Target/Hexagon/HexagonSchedule.td head/contrib/llvm/lib/Target/Hexagon/HexagonSplitConst32AndConst64.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonSplitDouble.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonStoreWidening.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonSubtarget.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonSubtarget.h head/contrib/llvm/lib/Target/Hexagon/HexagonTargetMachine.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonTargetMachine.h head/contrib/llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.h head/contrib/llvm/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonVLIWPacketizer.h head/contrib/llvm/lib/Target/Hexagon/HexagonVectorPrint.cpp head/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonAsmBackend.cpp head/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonBaseInfo.h head/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonELFObjectWriter.cpp head/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCChecker.cpp head/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCChecker.h head/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCCodeEmitter.cpp head/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCCodeEmitter.h head/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCDuplexInfo.cpp head/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCELFStreamer.cpp head/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCELFStreamer.h head/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCInstrInfo.cpp head/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCInstrInfo.h head/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCShuffler.cpp head/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCShuffler.h head/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp head/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.h head/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonShuffler.cpp head/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonShuffler.h head/contrib/llvm/lib/Target/Hexagon/RDFCopy.cpp head/contrib/llvm/lib/Target/Hexagon/RDFCopy.h head/contrib/llvm/lib/Target/Hexagon/RDFDeadCode.cpp head/contrib/llvm/lib/Target/Hexagon/RDFGraph.cpp head/contrib/llvm/lib/Target/Hexagon/RDFGraph.h head/contrib/llvm/lib/Target/Hexagon/RDFLiveness.cpp head/contrib/llvm/lib/Target/Hexagon/RDFLiveness.h head/contrib/llvm/lib/Target/Hexagon/RDFRegisters.cpp head/contrib/llvm/lib/Target/Hexagon/RDFRegisters.h head/contrib/llvm/lib/Target/Hexagon/TargetInfo/HexagonTargetInfo.cpp head/contrib/llvm/lib/Target/Lanai/AsmParser/LanaiAsmParser.cpp head/contrib/llvm/lib/Target/Lanai/LanaiDelaySlotFiller.cpp head/contrib/llvm/lib/Target/Lanai/LanaiFrameLowering.h head/contrib/llvm/lib/Target/Lanai/LanaiISelLowering.cpp head/contrib/llvm/lib/Target/Lanai/LanaiISelLowering.h head/contrib/llvm/lib/Target/Lanai/LanaiInstrInfo.h head/contrib/llvm/lib/Target/Lanai/LanaiMemAluCombiner.cpp head/contrib/llvm/lib/Target/Lanai/LanaiRegisterInfo.cpp head/contrib/llvm/lib/Target/Lanai/LanaiRegisterInfo.h head/contrib/llvm/lib/Target/Lanai/LanaiSubtarget.h head/contrib/llvm/lib/Target/Lanai/LanaiTargetMachine.cpp head/contrib/llvm/lib/Target/Lanai/LanaiTargetMachine.h head/contrib/llvm/lib/Target/Lanai/LanaiTargetTransformInfo.h head/contrib/llvm/lib/Target/Lanai/MCTargetDesc/LanaiAsmBackend.cpp head/contrib/llvm/lib/Target/Lanai/MCTargetDesc/LanaiELFObjectWriter.cpp head/contrib/llvm/lib/Target/Lanai/MCTargetDesc/LanaiMCTargetDesc.cpp head/contrib/llvm/lib/Target/Lanai/MCTargetDesc/LanaiMCTargetDesc.h head/contrib/llvm/lib/Target/Lanai/TargetInfo/LanaiTargetInfo.cpp head/contrib/llvm/lib/Target/MSP430/MSP430BranchSelector.cpp head/contrib/llvm/lib/Target/MSP430/MSP430FrameLowering.cpp head/contrib/llvm/lib/Target/MSP430/MSP430FrameLowering.h head/contrib/llvm/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp head/contrib/llvm/lib/Target/MSP430/MSP430ISelLowering.cpp head/contrib/llvm/lib/Target/MSP430/MSP430ISelLowering.h head/contrib/llvm/lib/Target/MSP430/MSP430InstrInfo.h head/contrib/llvm/lib/Target/MSP430/MSP430RegisterInfo.cpp head/contrib/llvm/lib/Target/MSP430/MSP430RegisterInfo.h head/contrib/llvm/lib/Target/MSP430/MSP430Subtarget.h head/contrib/llvm/lib/Target/MSP430/MSP430TargetMachine.cpp head/contrib/llvm/lib/Target/MSP430/MSP430TargetMachine.h head/contrib/llvm/lib/Target/MSP430/TargetInfo/MSP430TargetInfo.cpp head/contrib/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp head/contrib/llvm/lib/Target/Mips/Disassembler/MipsDisassembler.cpp head/contrib/llvm/lib/Target/Mips/InstPrinter/MipsInstPrinter.cpp head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsAsmBackend.cpp head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsAsmBackend.h head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.cpp head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.h head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsMCAsmInfo.cpp head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsMCCodeEmitter.cpp head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsMCCodeEmitter.h head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsMCNaCl.h head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsMCTargetDesc.cpp head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsMCTargetDesc.h head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsNaClELFStreamer.cpp head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp head/contrib/llvm/lib/Target/Mips/MicroMips32r6InstrFormats.td head/contrib/llvm/lib/Target/Mips/MicroMips32r6InstrInfo.td head/contrib/llvm/lib/Target/Mips/MicroMipsInstrFPU.td head/contrib/llvm/lib/Target/Mips/MicroMipsInstrFormats.td head/contrib/llvm/lib/Target/Mips/MicroMipsInstrInfo.td head/contrib/llvm/lib/Target/Mips/MicroMipsSizeReduction.cpp head/contrib/llvm/lib/Target/Mips/Mips16FrameLowering.cpp head/contrib/llvm/lib/Target/Mips/Mips16FrameLowering.h head/contrib/llvm/lib/Target/Mips/Mips16HardFloat.cpp head/contrib/llvm/lib/Target/Mips/Mips16ISelLowering.cpp head/contrib/llvm/lib/Target/Mips/Mips16InstrInfo.cpp head/contrib/llvm/lib/Target/Mips/Mips16InstrInfo.h head/contrib/llvm/lib/Target/Mips/Mips16InstrInfo.td head/contrib/llvm/lib/Target/Mips/Mips16RegisterInfo.cpp head/contrib/llvm/lib/Target/Mips/Mips32r6InstrInfo.td head/contrib/llvm/lib/Target/Mips/Mips64InstrInfo.td head/contrib/llvm/lib/Target/Mips/Mips64r6InstrInfo.td head/contrib/llvm/lib/Target/Mips/MipsAnalyzeImmediate.cpp head/contrib/llvm/lib/Target/Mips/MipsAnalyzeImmediate.h head/contrib/llvm/lib/Target/Mips/MipsAsmPrinter.cpp head/contrib/llvm/lib/Target/Mips/MipsAsmPrinter.h head/contrib/llvm/lib/Target/Mips/MipsCCState.cpp head/contrib/llvm/lib/Target/Mips/MipsCondMov.td head/contrib/llvm/lib/Target/Mips/MipsConstantIslandPass.cpp head/contrib/llvm/lib/Target/Mips/MipsDSPInstrInfo.td head/contrib/llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp head/contrib/llvm/lib/Target/Mips/MipsFastISel.cpp head/contrib/llvm/lib/Target/Mips/MipsFrameLowering.h head/contrib/llvm/lib/Target/Mips/MipsHazardSchedule.cpp head/contrib/llvm/lib/Target/Mips/MipsISelLowering.cpp head/contrib/llvm/lib/Target/Mips/MipsISelLowering.h head/contrib/llvm/lib/Target/Mips/MipsInstrFPU.td head/contrib/llvm/lib/Target/Mips/MipsInstrInfo.cpp head/contrib/llvm/lib/Target/Mips/MipsInstrInfo.h head/contrib/llvm/lib/Target/Mips/MipsInstrInfo.td head/contrib/llvm/lib/Target/Mips/MipsLongBranch.cpp head/contrib/llvm/lib/Target/Mips/MipsMCInstLower.cpp head/contrib/llvm/lib/Target/Mips/MipsMCInstLower.h head/contrib/llvm/lib/Target/Mips/MipsMachineFunction.cpp head/contrib/llvm/lib/Target/Mips/MipsOptimizePICCall.cpp head/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.cpp head/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.h head/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.td head/contrib/llvm/lib/Target/Mips/MipsSEFrameLowering.cpp head/contrib/llvm/lib/Target/Mips/MipsSEFrameLowering.h head/contrib/llvm/lib/Target/Mips/MipsSEISelDAGToDAG.cpp head/contrib/llvm/lib/Target/Mips/MipsSEISelLowering.cpp head/contrib/llvm/lib/Target/Mips/MipsSEISelLowering.h head/contrib/llvm/lib/Target/Mips/MipsSEInstrInfo.cpp head/contrib/llvm/lib/Target/Mips/MipsSERegisterInfo.cpp head/contrib/llvm/lib/Target/Mips/MipsScheduleGeneric.td head/contrib/llvm/lib/Target/Mips/MipsScheduleP5600.td head/contrib/llvm/lib/Target/Mips/MipsSubtarget.cpp head/contrib/llvm/lib/Target/Mips/MipsSubtarget.h head/contrib/llvm/lib/Target/Mips/MipsTargetMachine.cpp head/contrib/llvm/lib/Target/Mips/MipsTargetMachine.h head/contrib/llvm/lib/Target/Mips/MipsTargetObjectFile.cpp head/contrib/llvm/lib/Target/Mips/MipsTargetStreamer.h head/contrib/llvm/lib/Target/Mips/Relocation.txt head/contrib/llvm/lib/Target/Mips/TargetInfo/MipsTargetInfo.cpp head/contrib/llvm/lib/Target/NVPTX/NVPTX.td head/contrib/llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp head/contrib/llvm/lib/Target/NVPTX/NVPTXAssignValidGlobalNames.cpp head/contrib/llvm/lib/Target/NVPTX/NVPTXFrameLowering.cpp head/contrib/llvm/lib/Target/NVPTX/NVPTXFrameLowering.h head/contrib/llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp head/contrib/llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.h head/contrib/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp head/contrib/llvm/lib/Target/NVPTX/NVPTXISelLowering.h head/contrib/llvm/lib/Target/NVPTX/NVPTXInstrInfo.h head/contrib/llvm/lib/Target/NVPTX/NVPTXInstrInfo.td head/contrib/llvm/lib/Target/NVPTX/NVPTXIntrinsics.td head/contrib/llvm/lib/Target/NVPTX/NVPTXLowerAggrCopies.cpp head/contrib/llvm/lib/Target/NVPTX/NVPTXMCExpr.cpp head/contrib/llvm/lib/Target/NVPTX/NVPTXPeephole.cpp head/contrib/llvm/lib/Target/NVPTX/NVPTXPrologEpilogPass.cpp head/contrib/llvm/lib/Target/NVPTX/NVPTXRegisterInfo.cpp head/contrib/llvm/lib/Target/NVPTX/NVPTXRegisterInfo.h head/contrib/llvm/lib/Target/NVPTX/NVPTXReplaceImageHandles.cpp head/contrib/llvm/lib/Target/NVPTX/NVPTXSubtarget.h head/contrib/llvm/lib/Target/NVPTX/NVPTXTargetMachine.cpp head/contrib/llvm/lib/Target/NVPTX/NVPTXTargetMachine.h head/contrib/llvm/lib/Target/NVPTX/NVPTXTargetObjectFile.h head/contrib/llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.cpp head/contrib/llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.h head/contrib/llvm/lib/Target/NVPTX/TargetInfo/NVPTXTargetInfo.cpp head/contrib/llvm/lib/Target/Nios2/MCTargetDesc/Nios2MCTargetDesc.cpp head/contrib/llvm/lib/Target/Nios2/MCTargetDesc/Nios2MCTargetDesc.h head/contrib/llvm/lib/Target/Nios2/Nios2.h head/contrib/llvm/lib/Target/Nios2/Nios2.td head/contrib/llvm/lib/Target/Nios2/Nios2InstrFormats.td head/contrib/llvm/lib/Target/Nios2/Nios2InstrInfo.td head/contrib/llvm/lib/Target/Nios2/Nios2TargetMachine.cpp head/contrib/llvm/lib/Target/Nios2/Nios2TargetMachine.h head/contrib/llvm/lib/Target/Nios2/TargetInfo/Nios2TargetInfo.cpp head/contrib/llvm/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp head/contrib/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp head/contrib/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.h head/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCAsmBackend.cpp head/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp head/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.cpp head/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp head/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.h head/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMachObjectWriter.cpp head/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCPredicates.h head/contrib/llvm/lib/Target/PowerPC/P9InstrResources.td head/contrib/llvm/lib/Target/PowerPC/PPC.h head/contrib/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp head/contrib/llvm/lib/Target/PowerPC/PPCBranchSelector.cpp head/contrib/llvm/lib/Target/PowerPC/PPCCTRLoops.cpp head/contrib/llvm/lib/Target/PowerPC/PPCEarlyReturn.cpp head/contrib/llvm/lib/Target/PowerPC/PPCExpandISEL.cpp head/contrib/llvm/lib/Target/PowerPC/PPCFastISel.cpp head/contrib/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp head/contrib/llvm/lib/Target/PowerPC/PPCFrameLowering.h head/contrib/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp head/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.cpp head/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.h head/contrib/llvm/lib/Target/PowerPC/PPCInstr64Bit.td head/contrib/llvm/lib/Target/PowerPC/PPCInstrAltivec.td head/contrib/llvm/lib/Target/PowerPC/PPCInstrFormats.td head/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp head/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.h head/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.td head/contrib/llvm/lib/Target/PowerPC/PPCInstrVSX.td head/contrib/llvm/lib/Target/PowerPC/PPCLoopPreIncPrep.cpp head/contrib/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp head/contrib/llvm/lib/Target/PowerPC/PPCMIPeephole.cpp head/contrib/llvm/lib/Target/PowerPC/PPCMachineFunctionInfo.cpp head/contrib/llvm/lib/Target/PowerPC/PPCMachineFunctionInfo.h head/contrib/llvm/lib/Target/PowerPC/PPCQPXLoadSplat.cpp head/contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp head/contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.td head/contrib/llvm/lib/Target/PowerPC/PPCScheduleP9.td head/contrib/llvm/lib/Target/PowerPC/PPCSubtarget.h head/contrib/llvm/lib/Target/PowerPC/PPCTLSDynamicCall.cpp head/contrib/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp head/contrib/llvm/lib/Target/PowerPC/PPCTargetMachine.h head/contrib/llvm/lib/Target/PowerPC/PPCTargetObjectFile.h head/contrib/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp head/contrib/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.h head/contrib/llvm/lib/Target/PowerPC/PPCVSXFMAMutate.cpp head/contrib/llvm/lib/Target/PowerPC/PPCVSXSwapRemoval.cpp head/contrib/llvm/lib/Target/PowerPC/TargetInfo/PowerPCTargetInfo.cpp head/contrib/llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp head/contrib/llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFObjectWriter.cpp head/contrib/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCCodeEmitter.cpp head/contrib/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCTargetDesc.cpp head/contrib/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCTargetDesc.h head/contrib/llvm/lib/Target/RISCV/RISCV.td head/contrib/llvm/lib/Target/RISCV/RISCVInstrFormats.td head/contrib/llvm/lib/Target/RISCV/RISCVInstrInfo.td head/contrib/llvm/lib/Target/RISCV/RISCVRegisterInfo.td head/contrib/llvm/lib/Target/RISCV/RISCVTargetMachine.cpp head/contrib/llvm/lib/Target/RISCV/RISCVTargetMachine.h head/contrib/llvm/lib/Target/RISCV/TargetInfo/RISCVTargetInfo.cpp head/contrib/llvm/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp head/contrib/llvm/lib/Target/Sparc/DelaySlotFiller.cpp head/contrib/llvm/lib/Target/Sparc/LeonFeatures.td head/contrib/llvm/lib/Target/Sparc/LeonPasses.cpp head/contrib/llvm/lib/Target/Sparc/LeonPasses.h head/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcAsmBackend.cpp head/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcELFObjectWriter.cpp head/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcMCTargetDesc.cpp head/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcMCTargetDesc.h head/contrib/llvm/lib/Target/Sparc/Sparc.td head/contrib/llvm/lib/Target/Sparc/SparcFrameLowering.cpp head/contrib/llvm/lib/Target/Sparc/SparcFrameLowering.h head/contrib/llvm/lib/Target/Sparc/SparcISelLowering.cpp head/contrib/llvm/lib/Target/Sparc/SparcISelLowering.h head/contrib/llvm/lib/Target/Sparc/SparcInstrInfo.h head/contrib/llvm/lib/Target/Sparc/SparcInstrInfo.td head/contrib/llvm/lib/Target/Sparc/SparcRegisterInfo.cpp head/contrib/llvm/lib/Target/Sparc/SparcRegisterInfo.h head/contrib/llvm/lib/Target/Sparc/SparcSubtarget.cpp head/contrib/llvm/lib/Target/Sparc/SparcSubtarget.h head/contrib/llvm/lib/Target/Sparc/SparcTargetMachine.cpp head/contrib/llvm/lib/Target/Sparc/SparcTargetMachine.h head/contrib/llvm/lib/Target/Sparc/SparcTargetObjectFile.cpp head/contrib/llvm/lib/Target/Sparc/TargetInfo/SparcTargetInfo.cpp head/contrib/llvm/lib/Target/SystemZ/AsmParser/SystemZAsmParser.cpp head/contrib/llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCAsmBackend.cpp head/contrib/llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCObjectWriter.cpp head/contrib/llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCTargetDesc.cpp head/contrib/llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCTargetDesc.h head/contrib/llvm/lib/Target/SystemZ/SystemZ.td head/contrib/llvm/lib/Target/SystemZ/SystemZElimCompare.cpp head/contrib/llvm/lib/Target/SystemZ/SystemZFrameLowering.cpp head/contrib/llvm/lib/Target/SystemZ/SystemZFrameLowering.h head/contrib/llvm/lib/Target/SystemZ/SystemZHazardRecognizer.cpp head/contrib/llvm/lib/Target/SystemZ/SystemZHazardRecognizer.h head/contrib/llvm/lib/Target/SystemZ/SystemZISelDAGToDAG.cpp head/contrib/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp head/contrib/llvm/lib/Target/SystemZ/SystemZISelLowering.h head/contrib/llvm/lib/Target/SystemZ/SystemZInstrFP.td head/contrib/llvm/lib/Target/SystemZ/SystemZInstrFormats.td head/contrib/llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp head/contrib/llvm/lib/Target/SystemZ/SystemZInstrInfo.h head/contrib/llvm/lib/Target/SystemZ/SystemZInstrInfo.td head/contrib/llvm/lib/Target/SystemZ/SystemZInstrSystem.td head/contrib/llvm/lib/Target/SystemZ/SystemZInstrVector.td head/contrib/llvm/lib/Target/SystemZ/SystemZLDCleanup.cpp head/contrib/llvm/lib/Target/SystemZ/SystemZMachineScheduler.cpp head/contrib/llvm/lib/Target/SystemZ/SystemZMachineScheduler.h head/contrib/llvm/lib/Target/SystemZ/SystemZOperators.td head/contrib/llvm/lib/Target/SystemZ/SystemZRegisterInfo.cpp head/contrib/llvm/lib/Target/SystemZ/SystemZRegisterInfo.h head/contrib/llvm/lib/Target/SystemZ/SystemZRegisterInfo.td head/contrib/llvm/lib/Target/SystemZ/SystemZShortenInst.cpp head/contrib/llvm/lib/Target/SystemZ/SystemZSubtarget.h head/contrib/llvm/lib/Target/SystemZ/SystemZTargetMachine.cpp head/contrib/llvm/lib/Target/SystemZ/SystemZTargetMachine.h head/contrib/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp head/contrib/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.h head/contrib/llvm/lib/Target/SystemZ/TargetInfo/SystemZTargetInfo.cpp head/contrib/llvm/lib/Target/TargetLoweringObjectFile.cpp head/contrib/llvm/lib/Target/TargetMachine.cpp head/contrib/llvm/lib/Target/TargetMachineC.cpp head/contrib/llvm/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.cpp head/contrib/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyAsmBackend.cpp head/contrib/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyELFObjectWriter.cpp head/contrib/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCCodeEmitter.cpp head/contrib/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.cpp head/contrib/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.h head/contrib/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyTargetStreamer.cpp head/contrib/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyTargetStreamer.h head/contrib/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyWasmObjectWriter.cpp head/contrib/llvm/lib/Target/WebAssembly/TargetInfo/WebAssemblyTargetInfo.cpp head/contrib/llvm/lib/Target/WebAssembly/WebAssembly.h head/contrib/llvm/lib/Target/WebAssembly/WebAssembly.td head/contrib/llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp head/contrib/llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.h head/contrib/llvm/lib/Target/WebAssembly/WebAssemblyCallIndirectFixup.cpp head/contrib/llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp head/contrib/llvm/lib/Target/WebAssembly/WebAssemblyFastISel.cpp head/contrib/llvm/lib/Target/WebAssembly/WebAssemblyFixFunctionBitcasts.cpp head/contrib/llvm/lib/Target/WebAssembly/WebAssemblyFixIrreducibleControlFlow.cpp head/contrib/llvm/lib/Target/WebAssembly/WebAssemblyFrameLowering.cpp head/contrib/llvm/lib/Target/WebAssembly/WebAssemblyFrameLowering.h head/contrib/llvm/lib/Target/WebAssembly/WebAssemblyISelDAGToDAG.cpp head/contrib/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp head/contrib/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.h head/contrib/llvm/lib/Target/WebAssembly/WebAssemblyInstrAtomics.td head/contrib/llvm/lib/Target/WebAssembly/WebAssemblyInstrConv.td head/contrib/llvm/lib/Target/WebAssembly/WebAssemblyInstrFormats.td head/contrib/llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.h head/contrib/llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.td head/contrib/llvm/lib/Target/WebAssembly/WebAssemblyInstrMemory.td head/contrib/llvm/lib/Target/WebAssembly/WebAssemblyLowerBrUnless.cpp head/contrib/llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp head/contrib/llvm/lib/Target/WebAssembly/WebAssemblyOptimizeLiveIntervals.cpp head/contrib/llvm/lib/Target/WebAssembly/WebAssemblyPrepareForLiveIntervals.cpp head/contrib/llvm/lib/Target/WebAssembly/WebAssemblyRegColoring.cpp head/contrib/llvm/lib/Target/WebAssembly/WebAssemblyRegStackify.cpp head/contrib/llvm/lib/Target/WebAssembly/WebAssemblyRegisterInfo.cpp head/contrib/llvm/lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp head/contrib/llvm/lib/Target/WebAssembly/WebAssemblySetP2AlignOperands.cpp head/contrib/llvm/lib/Target/WebAssembly/WebAssemblyStoreResults.cpp head/contrib/llvm/lib/Target/WebAssembly/WebAssemblySubtarget.cpp head/contrib/llvm/lib/Target/WebAssembly/WebAssemblySubtarget.h head/contrib/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp head/contrib/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.h head/contrib/llvm/lib/Target/WebAssembly/WebAssemblyTargetTransformInfo.cpp head/contrib/llvm/lib/Target/WebAssembly/known_gcc_test_failures.txt head/contrib/llvm/lib/Target/X86/AsmParser/X86AsmInstrumentation.cpp head/contrib/llvm/lib/Target/X86/AsmParser/X86AsmInstrumentation.h head/contrib/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp head/contrib/llvm/lib/Target/X86/AsmParser/X86Operand.h head/contrib/llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp head/contrib/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp head/contrib/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.h head/contrib/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoderCommon.h head/contrib/llvm/lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp head/contrib/llvm/lib/Target/X86/InstPrinter/X86InstComments.cpp head/contrib/llvm/lib/Target/X86/InstPrinter/X86InstComments.h head/contrib/llvm/lib/Target/X86/InstPrinter/X86IntelInstPrinter.cpp head/contrib/llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp head/contrib/llvm/lib/Target/X86/MCTargetDesc/X86BaseInfo.h head/contrib/llvm/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp head/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp head/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp head/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp head/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h head/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MachObjectWriter.cpp head/contrib/llvm/lib/Target/X86/MCTargetDesc/X86WinCOFFObjectWriter.cpp head/contrib/llvm/lib/Target/X86/MCTargetDesc/X86WinCOFFStreamer.cpp head/contrib/llvm/lib/Target/X86/TargetInfo/X86TargetInfo.cpp head/contrib/llvm/lib/Target/X86/X86.h head/contrib/llvm/lib/Target/X86/X86.td head/contrib/llvm/lib/Target/X86/X86AsmPrinter.cpp head/contrib/llvm/lib/Target/X86/X86AsmPrinter.h head/contrib/llvm/lib/Target/X86/X86CallFrameOptimization.cpp head/contrib/llvm/lib/Target/X86/X86CallLowering.cpp head/contrib/llvm/lib/Target/X86/X86CallLowering.h head/contrib/llvm/lib/Target/X86/X86CallingConv.td head/contrib/llvm/lib/Target/X86/X86CmovConversion.cpp head/contrib/llvm/lib/Target/X86/X86EvexToVex.cpp head/contrib/llvm/lib/Target/X86/X86ExpandPseudo.cpp head/contrib/llvm/lib/Target/X86/X86FastISel.cpp head/contrib/llvm/lib/Target/X86/X86FixupBWInsts.cpp head/contrib/llvm/lib/Target/X86/X86FixupLEAs.cpp head/contrib/llvm/lib/Target/X86/X86FloatingPoint.cpp head/contrib/llvm/lib/Target/X86/X86FrameLowering.cpp head/contrib/llvm/lib/Target/X86/X86FrameLowering.h head/contrib/llvm/lib/Target/X86/X86GenRegisterBankInfo.def head/contrib/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp head/contrib/llvm/lib/Target/X86/X86ISelLowering.h head/contrib/llvm/lib/Target/X86/X86Instr3DNow.td head/contrib/llvm/lib/Target/X86/X86InstrAVX512.td head/contrib/llvm/lib/Target/X86/X86InstrArithmetic.td head/contrib/llvm/lib/Target/X86/X86InstrCMovSetCC.td head/contrib/llvm/lib/Target/X86/X86InstrCompiler.td head/contrib/llvm/lib/Target/X86/X86InstrControl.td head/contrib/llvm/lib/Target/X86/X86InstrExtension.td head/contrib/llvm/lib/Target/X86/X86InstrFMA.td head/contrib/llvm/lib/Target/X86/X86InstrFPStack.td head/contrib/llvm/lib/Target/X86/X86InstrFormats.td head/contrib/llvm/lib/Target/X86/X86InstrFragmentsSIMD.td head/contrib/llvm/lib/Target/X86/X86InstrInfo.cpp head/contrib/llvm/lib/Target/X86/X86InstrInfo.h head/contrib/llvm/lib/Target/X86/X86InstrInfo.td head/contrib/llvm/lib/Target/X86/X86InstrMMX.td head/contrib/llvm/lib/Target/X86/X86InstrMPX.td head/contrib/llvm/lib/Target/X86/X86InstrSGX.td head/contrib/llvm/lib/Target/X86/X86InstrSSE.td head/contrib/llvm/lib/Target/X86/X86InstrSVM.td head/contrib/llvm/lib/Target/X86/X86InstrShiftRotate.td head/contrib/llvm/lib/Target/X86/X86InstrSystem.td head/contrib/llvm/lib/Target/X86/X86InstrTSX.td head/contrib/llvm/lib/Target/X86/X86InstrVMX.td head/contrib/llvm/lib/Target/X86/X86InstrXOP.td head/contrib/llvm/lib/Target/X86/X86InstructionSelector.cpp head/contrib/llvm/lib/Target/X86/X86InterleavedAccess.cpp head/contrib/llvm/lib/Target/X86/X86IntrinsicsInfo.h head/contrib/llvm/lib/Target/X86/X86LegalizerInfo.cpp head/contrib/llvm/lib/Target/X86/X86MCInstLower.cpp head/contrib/llvm/lib/Target/X86/X86MachineFunctionInfo.cpp head/contrib/llvm/lib/Target/X86/X86MacroFusion.cpp head/contrib/llvm/lib/Target/X86/X86OptimizeLEAs.cpp head/contrib/llvm/lib/Target/X86/X86PadShortFunction.cpp head/contrib/llvm/lib/Target/X86/X86RegisterBankInfo.cpp head/contrib/llvm/lib/Target/X86/X86RegisterInfo.cpp head/contrib/llvm/lib/Target/X86/X86RegisterInfo.h head/contrib/llvm/lib/Target/X86/X86RegisterInfo.td head/contrib/llvm/lib/Target/X86/X86SchedHaswell.td head/contrib/llvm/lib/Target/X86/X86SchedSandyBridge.td head/contrib/llvm/lib/Target/X86/X86Schedule.td head/contrib/llvm/lib/Target/X86/X86ScheduleAtom.td head/contrib/llvm/lib/Target/X86/X86ScheduleBtVer2.td head/contrib/llvm/lib/Target/X86/X86ScheduleSLM.td head/contrib/llvm/lib/Target/X86/X86ScheduleZnver1.td head/contrib/llvm/lib/Target/X86/X86SelectionDAGInfo.cpp head/contrib/llvm/lib/Target/X86/X86ShuffleDecodeConstantPool.cpp head/contrib/llvm/lib/Target/X86/X86Subtarget.cpp head/contrib/llvm/lib/Target/X86/X86Subtarget.h head/contrib/llvm/lib/Target/X86/X86TargetMachine.cpp head/contrib/llvm/lib/Target/X86/X86TargetMachine.h head/contrib/llvm/lib/Target/X86/X86TargetObjectFile.cpp head/contrib/llvm/lib/Target/X86/X86TargetObjectFile.h head/contrib/llvm/lib/Target/X86/X86TargetTransformInfo.cpp head/contrib/llvm/lib/Target/X86/X86TargetTransformInfo.h head/contrib/llvm/lib/Target/X86/X86VZeroUpper.cpp head/contrib/llvm/lib/Target/X86/X86WinAllocaExpander.cpp head/contrib/llvm/lib/Target/X86/X86WinEHState.cpp head/contrib/llvm/lib/Target/XCore/MCTargetDesc/XCoreMCTargetDesc.cpp head/contrib/llvm/lib/Target/XCore/TargetInfo/XCoreTargetInfo.cpp head/contrib/llvm/lib/Target/XCore/XCoreAsmPrinter.cpp head/contrib/llvm/lib/Target/XCore/XCoreFrameLowering.cpp head/contrib/llvm/lib/Target/XCore/XCoreFrameLowering.h head/contrib/llvm/lib/Target/XCore/XCoreISelDAGToDAG.cpp head/contrib/llvm/lib/Target/XCore/XCoreISelLowering.cpp head/contrib/llvm/lib/Target/XCore/XCoreISelLowering.h head/contrib/llvm/lib/Target/XCore/XCoreInstrInfo.cpp head/contrib/llvm/lib/Target/XCore/XCoreInstrInfo.h head/contrib/llvm/lib/Target/XCore/XCoreMachineFunctionInfo.cpp head/contrib/llvm/lib/Target/XCore/XCoreRegisterInfo.cpp head/contrib/llvm/lib/Target/XCore/XCoreRegisterInfo.h head/contrib/llvm/lib/Target/XCore/XCoreSubtarget.h head/contrib/llvm/lib/Target/XCore/XCoreTargetMachine.cpp head/contrib/llvm/lib/Target/XCore/XCoreTargetMachine.h head/contrib/llvm/lib/Target/XCore/XCoreTargetTransformInfo.h head/contrib/llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp head/contrib/llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp head/contrib/llvm/lib/Transforms/Coroutines/CoroFrame.cpp head/contrib/llvm/lib/Transforms/Coroutines/CoroSplit.cpp head/contrib/llvm/lib/Transforms/Coroutines/Coroutines.cpp head/contrib/llvm/lib/Transforms/IPO/AlwaysInliner.cpp head/contrib/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp head/contrib/llvm/lib/Transforms/IPO/ConstantMerge.cpp head/contrib/llvm/lib/Transforms/IPO/CrossDSOCFI.cpp head/contrib/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp head/contrib/llvm/lib/Transforms/IPO/ElimAvailExtern.cpp head/contrib/llvm/lib/Transforms/IPO/ExtractGV.cpp head/contrib/llvm/lib/Transforms/IPO/ForceFunctionAttrs.cpp head/contrib/llvm/lib/Transforms/IPO/FunctionAttrs.cpp head/contrib/llvm/lib/Transforms/IPO/FunctionImport.cpp head/contrib/llvm/lib/Transforms/IPO/GlobalDCE.cpp head/contrib/llvm/lib/Transforms/IPO/GlobalOpt.cpp head/contrib/llvm/lib/Transforms/IPO/GlobalSplit.cpp head/contrib/llvm/lib/Transforms/IPO/IPO.cpp head/contrib/llvm/lib/Transforms/IPO/InferFunctionAttrs.cpp head/contrib/llvm/lib/Transforms/IPO/InlineSimple.cpp head/contrib/llvm/lib/Transforms/IPO/Inliner.cpp head/contrib/llvm/lib/Transforms/IPO/LoopExtractor.cpp head/contrib/llvm/lib/Transforms/IPO/LowerTypeTests.cpp head/contrib/llvm/lib/Transforms/IPO/MergeFunctions.cpp head/contrib/llvm/lib/Transforms/IPO/PartialInlining.cpp head/contrib/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp head/contrib/llvm/lib/Transforms/IPO/PruneEH.cpp head/contrib/llvm/lib/Transforms/IPO/SampleProfile.cpp head/contrib/llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp head/contrib/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineInternal.h head/contrib/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp head/contrib/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp head/contrib/llvm/lib/Transforms/Instrumentation/BoundsChecking.cpp head/contrib/llvm/lib/Transforms/Instrumentation/CFGMST.h head/contrib/llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp head/contrib/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp head/contrib/llvm/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp head/contrib/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp head/contrib/llvm/lib/Transforms/Instrumentation/Instrumentation.cpp head/contrib/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp head/contrib/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp head/contrib/llvm/lib/Transforms/Instrumentation/PGOMemOPSizeOpt.cpp head/contrib/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp head/contrib/llvm/lib/Transforms/ObjCARC/ARCRuntimeEntryPoints.h head/contrib/llvm/lib/Transforms/ObjCARC/BlotMapVector.h head/contrib/llvm/lib/Transforms/ObjCARC/ObjCARC.cpp head/contrib/llvm/lib/Transforms/ObjCARC/ObjCARCContract.cpp head/contrib/llvm/lib/Transforms/ObjCARC/ObjCARCOpts.cpp head/contrib/llvm/lib/Transforms/ObjCARC/ProvenanceAnalysis.cpp head/contrib/llvm/lib/Transforms/ObjCARC/ProvenanceAnalysis.h head/contrib/llvm/lib/Transforms/ObjCARC/PtrState.cpp head/contrib/llvm/lib/Transforms/ObjCARC/PtrState.h head/contrib/llvm/lib/Transforms/Scalar/ADCE.cpp head/contrib/llvm/lib/Transforms/Scalar/BDCE.cpp head/contrib/llvm/lib/Transforms/Scalar/ConstantHoisting.cpp head/contrib/llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp head/contrib/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp head/contrib/llvm/lib/Transforms/Scalar/EarlyCSE.cpp head/contrib/llvm/lib/Transforms/Scalar/GVN.cpp head/contrib/llvm/lib/Transforms/Scalar/GVNHoist.cpp head/contrib/llvm/lib/Transforms/Scalar/GVNSink.cpp head/contrib/llvm/lib/Transforms/Scalar/GuardWidening.cpp head/contrib/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp head/contrib/llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp head/contrib/llvm/lib/Transforms/Scalar/InferAddressSpaces.cpp head/contrib/llvm/lib/Transforms/Scalar/JumpThreading.cpp head/contrib/llvm/lib/Transforms/Scalar/LICM.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopDataPrefetch.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopDeletion.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopDistribute.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopInstSimplify.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopInterchange.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopPredication.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopRerollPass.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopRotation.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopSink.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopVersioningLICM.cpp head/contrib/llvm/lib/Transforms/Scalar/LowerAtomic.cpp head/contrib/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp head/contrib/llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp head/contrib/llvm/lib/Transforms/Scalar/NaryReassociate.cpp head/contrib/llvm/lib/Transforms/Scalar/NewGVN.cpp head/contrib/llvm/lib/Transforms/Scalar/PartiallyInlineLibCalls.cpp head/contrib/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp head/contrib/llvm/lib/Transforms/Scalar/Reassociate.cpp head/contrib/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp head/contrib/llvm/lib/Transforms/Scalar/SCCP.cpp head/contrib/llvm/lib/Transforms/Scalar/SROA.cpp head/contrib/llvm/lib/Transforms/Scalar/Scalar.cpp head/contrib/llvm/lib/Transforms/Scalar/Scalarizer.cpp head/contrib/llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp head/contrib/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp head/contrib/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp head/contrib/llvm/lib/Transforms/Scalar/Sink.cpp head/contrib/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp head/contrib/llvm/lib/Transforms/Scalar/StructurizeCFG.cpp head/contrib/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp head/contrib/llvm/lib/Transforms/Utils/ASanStackFrameLayout.cpp head/contrib/llvm/lib/Transforms/Utils/AddDiscriminators.cpp head/contrib/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp head/contrib/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp head/contrib/llvm/lib/Transforms/Utils/BypassSlowDivision.cpp head/contrib/llvm/lib/Transforms/Utils/CloneFunction.cpp head/contrib/llvm/lib/Transforms/Utils/CloneModule.cpp head/contrib/llvm/lib/Transforms/Utils/CodeExtractor.cpp head/contrib/llvm/lib/Transforms/Utils/CtorUtils.cpp head/contrib/llvm/lib/Transforms/Utils/Evaluator.cpp head/contrib/llvm/lib/Transforms/Utils/FlattenCFG.cpp head/contrib/llvm/lib/Transforms/Utils/FunctionComparator.cpp head/contrib/llvm/lib/Transforms/Utils/FunctionImportUtils.cpp head/contrib/llvm/lib/Transforms/Utils/InlineFunction.cpp head/contrib/llvm/lib/Transforms/Utils/LCSSA.cpp head/contrib/llvm/lib/Transforms/Utils/Local.cpp head/contrib/llvm/lib/Transforms/Utils/LoopSimplify.cpp head/contrib/llvm/lib/Transforms/Utils/LoopUnroll.cpp head/contrib/llvm/lib/Transforms/Utils/LoopUnrollPeel.cpp head/contrib/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp head/contrib/llvm/lib/Transforms/Utils/LoopUtils.cpp head/contrib/llvm/lib/Transforms/Utils/LowerMemIntrinsics.cpp head/contrib/llvm/lib/Transforms/Utils/LowerSwitch.cpp head/contrib/llvm/lib/Transforms/Utils/Mem2Reg.cpp head/contrib/llvm/lib/Transforms/Utils/MetaRenamer.cpp head/contrib/llvm/lib/Transforms/Utils/ModuleUtils.cpp head/contrib/llvm/lib/Transforms/Utils/PredicateInfo.cpp head/contrib/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp head/contrib/llvm/lib/Transforms/Utils/SSAUpdater.cpp head/contrib/llvm/lib/Transforms/Utils/SimplifyCFG.cpp head/contrib/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp head/contrib/llvm/lib/Transforms/Utils/SimplifyInstructions.cpp head/contrib/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp head/contrib/llvm/lib/Transforms/Utils/SplitModule.cpp head/contrib/llvm/lib/Transforms/Utils/SymbolRewriter.cpp head/contrib/llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp head/contrib/llvm/lib/Transforms/Utils/ValueMapper.cpp head/contrib/llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp head/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp head/contrib/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp head/contrib/llvm/lib/Transforms/Vectorize/Vectorize.cpp head/contrib/llvm/lib/XRay/InstrumentationMap.cpp head/contrib/llvm/lib/XRay/Trace.cpp head/contrib/llvm/tools/bugpoint/BugDriver.cpp head/contrib/llvm/tools/bugpoint/BugDriver.h head/contrib/llvm/tools/bugpoint/CrashDebugger.cpp head/contrib/llvm/tools/bugpoint/ExecutionDriver.cpp head/contrib/llvm/tools/bugpoint/ExtractFunction.cpp head/contrib/llvm/tools/bugpoint/FindBugs.cpp head/contrib/llvm/tools/bugpoint/OptimizerDriver.cpp head/contrib/llvm/tools/bugpoint/ToolRunner.cpp head/contrib/llvm/tools/bugpoint/bugpoint.cpp head/contrib/llvm/tools/clang/include/clang-c/Index.h head/contrib/llvm/tools/clang/include/clang/AST/ASTContext.h head/contrib/llvm/tools/clang/include/clang/AST/ASTMutationListener.h head/contrib/llvm/tools/clang/include/clang/AST/ASTUnresolvedSet.h head/contrib/llvm/tools/clang/include/clang/AST/ASTVector.h head/contrib/llvm/tools/clang/include/clang/AST/AttrIterator.h head/contrib/llvm/tools/clang/include/clang/AST/BaseSubobject.h head/contrib/llvm/tools/clang/include/clang/AST/BuiltinTypes.def head/contrib/llvm/tools/clang/include/clang/AST/CXXInheritance.h head/contrib/llvm/tools/clang/include/clang/AST/CanonicalType.h head/contrib/llvm/tools/clang/include/clang/AST/CharUnits.h head/contrib/llvm/tools/clang/include/clang/AST/CommentVisitor.h head/contrib/llvm/tools/clang/include/clang/AST/Decl.h head/contrib/llvm/tools/clang/include/clang/AST/DeclBase.h head/contrib/llvm/tools/clang/include/clang/AST/DeclCXX.h head/contrib/llvm/tools/clang/include/clang/AST/DeclContextInternals.h head/contrib/llvm/tools/clang/include/clang/AST/DeclFriend.h head/contrib/llvm/tools/clang/include/clang/AST/DeclGroup.h head/contrib/llvm/tools/clang/include/clang/AST/DeclLookups.h head/contrib/llvm/tools/clang/include/clang/AST/DeclObjC.h head/contrib/llvm/tools/clang/include/clang/AST/DeclOpenMP.h head/contrib/llvm/tools/clang/include/clang/AST/DeclTemplate.h head/contrib/llvm/tools/clang/include/clang/AST/DeclVisitor.h head/contrib/llvm/tools/clang/include/clang/AST/DeclarationName.h head/contrib/llvm/tools/clang/include/clang/AST/DependentDiagnostic.h head/contrib/llvm/tools/clang/include/clang/AST/Expr.h head/contrib/llvm/tools/clang/include/clang/AST/ExprCXX.h head/contrib/llvm/tools/clang/include/clang/AST/ExprObjC.h head/contrib/llvm/tools/clang/include/clang/AST/ExternalASTMerger.h head/contrib/llvm/tools/clang/include/clang/AST/ExternalASTSource.h head/contrib/llvm/tools/clang/include/clang/AST/GlobalDecl.h head/contrib/llvm/tools/clang/include/clang/AST/NestedNameSpecifier.h head/contrib/llvm/tools/clang/include/clang/AST/ODRHash.h head/contrib/llvm/tools/clang/include/clang/AST/OpenMPClause.h head/contrib/llvm/tools/clang/include/clang/AST/OperationKinds.def head/contrib/llvm/tools/clang/include/clang/AST/OperationKinds.h head/contrib/llvm/tools/clang/include/clang/AST/PrettyPrinter.h head/contrib/llvm/tools/clang/include/clang/AST/RecordLayout.h head/contrib/llvm/tools/clang/include/clang/AST/RecursiveASTVisitor.h head/contrib/llvm/tools/clang/include/clang/AST/Redeclarable.h head/contrib/llvm/tools/clang/include/clang/AST/Stmt.h head/contrib/llvm/tools/clang/include/clang/AST/StmtGraphTraits.h head/contrib/llvm/tools/clang/include/clang/AST/StmtIterator.h head/contrib/llvm/tools/clang/include/clang/AST/StmtOpenMP.h head/contrib/llvm/tools/clang/include/clang/AST/StmtVisitor.h head/contrib/llvm/tools/clang/include/clang/AST/TemplateBase.h head/contrib/llvm/tools/clang/include/clang/AST/TemplateName.h head/contrib/llvm/tools/clang/include/clang/AST/Type.h head/contrib/llvm/tools/clang/include/clang/AST/TypeLoc.h head/contrib/llvm/tools/clang/include/clang/AST/TypeNodes.def head/contrib/llvm/tools/clang/include/clang/AST/UnresolvedSet.h head/contrib/llvm/tools/clang/include/clang/AST/VTTBuilder.h head/contrib/llvm/tools/clang/include/clang/ASTMatchers/ASTMatchers.h head/contrib/llvm/tools/clang/include/clang/ASTMatchers/ASTMatchersInternal.h head/contrib/llvm/tools/clang/include/clang/ASTMatchers/ASTMatchersMacros.h head/contrib/llvm/tools/clang/include/clang/ASTMatchers/Dynamic/Parser.h head/contrib/llvm/tools/clang/include/clang/ASTMatchers/Dynamic/Registry.h head/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/Consumed.h head/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/Dominators.h head/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/LiveVariables.h head/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/PostOrderCFGView.h head/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/ThreadSafety.h head/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/ThreadSafetyCommon.h head/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/ThreadSafetyTIL.h head/contrib/llvm/tools/clang/include/clang/Analysis/CFG.h head/contrib/llvm/tools/clang/include/clang/Analysis/CallGraph.h head/contrib/llvm/tools/clang/include/clang/Analysis/CloneDetection.h head/contrib/llvm/tools/clang/include/clang/Analysis/ProgramPoint.h head/contrib/llvm/tools/clang/include/clang/Analysis/Support/BumpVector.h head/contrib/llvm/tools/clang/include/clang/Basic/AddressSpaces.h head/contrib/llvm/tools/clang/include/clang/Basic/AllDiagnostics.h head/contrib/llvm/tools/clang/include/clang/Basic/Attr.td head/contrib/llvm/tools/clang/include/clang/Basic/AttrDocs.td head/contrib/llvm/tools/clang/include/clang/Basic/Attributes.h head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.h head/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsAArch64.def head/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsAMDGPU.def head/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsARM.def head/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsHexagon.def head/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsNVPTX.def head/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsX86.def head/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsX86_64.def head/contrib/llvm/tools/clang/include/clang/Basic/CharInfo.h head/contrib/llvm/tools/clang/include/clang/Basic/Cuda.h head/contrib/llvm/tools/clang/include/clang/Basic/DeclNodes.td head/contrib/llvm/tools/clang/include/clang/Basic/Diagnostic.h head/contrib/llvm/tools/clang/include/clang/Basic/Diagnostic.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticASTKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticCommonKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticDriverKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticFrontendKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticGroups.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticIDs.h head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticLexKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticOptions.h head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticParseKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSerializationKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/IdentifierTable.h head/contrib/llvm/tools/clang/include/clang/Basic/LLVM.h head/contrib/llvm/tools/clang/include/clang/Basic/LangOptions.def head/contrib/llvm/tools/clang/include/clang/Basic/LangOptions.h head/contrib/llvm/tools/clang/include/clang/Basic/Module.h head/contrib/llvm/tools/clang/include/clang/Basic/OpenCLExtensions.def head/contrib/llvm/tools/clang/include/clang/Basic/OpenMPKinds.def head/contrib/llvm/tools/clang/include/clang/Basic/OperatorKinds.def head/contrib/llvm/tools/clang/include/clang/Basic/OperatorPrecedence.h head/contrib/llvm/tools/clang/include/clang/Basic/SanitizerBlacklist.h head/contrib/llvm/tools/clang/include/clang/Basic/Sanitizers.def head/contrib/llvm/tools/clang/include/clang/Basic/Sanitizers.h head/contrib/llvm/tools/clang/include/clang/Basic/SourceLocation.h head/contrib/llvm/tools/clang/include/clang/Basic/SourceManager.h head/contrib/llvm/tools/clang/include/clang/Basic/SourceManagerInternals.h head/contrib/llvm/tools/clang/include/clang/Basic/Specifiers.h head/contrib/llvm/tools/clang/include/clang/Basic/TargetInfo.h head/contrib/llvm/tools/clang/include/clang/Basic/TargetOptions.h head/contrib/llvm/tools/clang/include/clang/Basic/TokenKinds.def head/contrib/llvm/tools/clang/include/clang/Basic/TypeTraits.h head/contrib/llvm/tools/clang/include/clang/Basic/VirtualFileSystem.h head/contrib/llvm/tools/clang/include/clang/Basic/arm_neon.td head/contrib/llvm/tools/clang/include/clang/CodeGen/CodeGenABITypes.h head/contrib/llvm/tools/clang/include/clang/CodeGen/ConstantInitFuture.h head/contrib/llvm/tools/clang/include/clang/CodeGen/ModuleBuilder.h head/contrib/llvm/tools/clang/include/clang/Driver/CC1Options.td head/contrib/llvm/tools/clang/include/clang/Driver/CLCompatOptions.td head/contrib/llvm/tools/clang/include/clang/Driver/Compilation.h head/contrib/llvm/tools/clang/include/clang/Driver/Distro.h head/contrib/llvm/tools/clang/include/clang/Driver/Driver.h head/contrib/llvm/tools/clang/include/clang/Driver/Job.h head/contrib/llvm/tools/clang/include/clang/Driver/Options.td head/contrib/llvm/tools/clang/include/clang/Driver/SanitizerArgs.h head/contrib/llvm/tools/clang/include/clang/Driver/ToolChain.h head/contrib/llvm/tools/clang/include/clang/Driver/XRayArgs.h head/contrib/llvm/tools/clang/include/clang/Format/Format.h head/contrib/llvm/tools/clang/include/clang/Frontend/ASTUnit.h head/contrib/llvm/tools/clang/include/clang/Frontend/CodeGenOptions.def head/contrib/llvm/tools/clang/include/clang/Frontend/CodeGenOptions.h head/contrib/llvm/tools/clang/include/clang/Frontend/CommandLineSourceLoc.h head/contrib/llvm/tools/clang/include/clang/Frontend/CompilerInstance.h head/contrib/llvm/tools/clang/include/clang/Frontend/FrontendActions.h head/contrib/llvm/tools/clang/include/clang/Frontend/FrontendOptions.h head/contrib/llvm/tools/clang/include/clang/Frontend/LangStandard.h head/contrib/llvm/tools/clang/include/clang/Frontend/LangStandards.def head/contrib/llvm/tools/clang/include/clang/Frontend/PrecompiledPreamble.h head/contrib/llvm/tools/clang/include/clang/Frontend/TextDiagnosticBuffer.h head/contrib/llvm/tools/clang/include/clang/Frontend/VerifyDiagnosticConsumer.h head/contrib/llvm/tools/clang/include/clang/Index/IndexDataConsumer.h head/contrib/llvm/tools/clang/include/clang/Index/IndexSymbol.h head/contrib/llvm/tools/clang/include/clang/Lex/HeaderSearch.h head/contrib/llvm/tools/clang/include/clang/Lex/HeaderSearchOptions.h head/contrib/llvm/tools/clang/include/clang/Lex/Lexer.h head/contrib/llvm/tools/clang/include/clang/Lex/LiteralSupport.h head/contrib/llvm/tools/clang/include/clang/Lex/MacroArgs.h head/contrib/llvm/tools/clang/include/clang/Lex/MacroInfo.h head/contrib/llvm/tools/clang/include/clang/Lex/ModuleLoader.h head/contrib/llvm/tools/clang/include/clang/Lex/ModuleMap.h head/contrib/llvm/tools/clang/include/clang/Lex/MultipleIncludeOpt.h head/contrib/llvm/tools/clang/include/clang/Lex/PPCallbacks.h head/contrib/llvm/tools/clang/include/clang/Lex/PTHLexer.h head/contrib/llvm/tools/clang/include/clang/Lex/PTHManager.h head/contrib/llvm/tools/clang/include/clang/Lex/Pragma.h head/contrib/llvm/tools/clang/include/clang/Lex/PreprocessingRecord.h head/contrib/llvm/tools/clang/include/clang/Lex/Preprocessor.h head/contrib/llvm/tools/clang/include/clang/Lex/PreprocessorLexer.h head/contrib/llvm/tools/clang/include/clang/Lex/PreprocessorOptions.h head/contrib/llvm/tools/clang/include/clang/Lex/TokenLexer.h head/contrib/llvm/tools/clang/include/clang/Parse/ParseAST.h head/contrib/llvm/tools/clang/include/clang/Parse/Parser.h head/contrib/llvm/tools/clang/include/clang/Parse/RAIIObjectsForParser.h head/contrib/llvm/tools/clang/include/clang/Sema/AttributeList.h head/contrib/llvm/tools/clang/include/clang/Sema/CodeCompleteConsumer.h head/contrib/llvm/tools/clang/include/clang/Sema/CodeCompleteOptions.h head/contrib/llvm/tools/clang/include/clang/Sema/DeclSpec.h head/contrib/llvm/tools/clang/include/clang/Sema/Lookup.h head/contrib/llvm/tools/clang/include/clang/Sema/Overload.h head/contrib/llvm/tools/clang/include/clang/Sema/Ownership.h head/contrib/llvm/tools/clang/include/clang/Sema/Scope.h head/contrib/llvm/tools/clang/include/clang/Sema/ScopeInfo.h head/contrib/llvm/tools/clang/include/clang/Sema/Sema.h head/contrib/llvm/tools/clang/include/clang/Sema/SemaInternal.h head/contrib/llvm/tools/clang/include/clang/Serialization/ASTBitCodes.h head/contrib/llvm/tools/clang/include/clang/Serialization/ASTReader.h head/contrib/llvm/tools/clang/include/clang/Serialization/ASTWriter.h head/contrib/llvm/tools/clang/include/clang/Serialization/ContinuousRangeMap.h head/contrib/llvm/tools/clang/include/clang/Serialization/ModuleManager.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Checkers/Checkers.td head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Checkers/ObjCRetainCount.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/Analyses.def head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/Environment.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/Store.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SymExpr.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h head/contrib/llvm/tools/clang/include/clang/Tooling/CommonOptionsParser.h head/contrib/llvm/tools/clang/include/clang/Tooling/CompilationDatabase.h head/contrib/llvm/tools/clang/include/clang/Tooling/Core/Replacement.h head/contrib/llvm/tools/clang/include/clang/Tooling/Refactoring/AtomicChange.h head/contrib/llvm/tools/clang/include/clang/Tooling/Refactoring/RecursiveSymbolVisitor.h head/contrib/llvm/tools/clang/include/clang/Tooling/Refactoring/Rename/RenamingAction.h head/contrib/llvm/tools/clang/include/clang/Tooling/Refactoring/Rename/USRFindingAction.h head/contrib/llvm/tools/clang/include/clang/Tooling/Refactoring/Rename/USRLocFinder.h head/contrib/llvm/tools/clang/include/clang/Tooling/Tooling.h head/contrib/llvm/tools/clang/include/clang/module.modulemap head/contrib/llvm/tools/clang/lib/AST/ASTContext.cpp head/contrib/llvm/tools/clang/lib/AST/ASTDumper.cpp head/contrib/llvm/tools/clang/lib/AST/ASTImporter.cpp head/contrib/llvm/tools/clang/lib/AST/ASTStructuralEquivalence.cpp head/contrib/llvm/tools/clang/lib/AST/CXXABI.h head/contrib/llvm/tools/clang/lib/AST/CXXInheritance.cpp head/contrib/llvm/tools/clang/lib/AST/CommentSema.cpp head/contrib/llvm/tools/clang/lib/AST/Decl.cpp head/contrib/llvm/tools/clang/lib/AST/DeclBase.cpp head/contrib/llvm/tools/clang/lib/AST/DeclCXX.cpp head/contrib/llvm/tools/clang/lib/AST/DeclFriend.cpp head/contrib/llvm/tools/clang/lib/AST/DeclGroup.cpp head/contrib/llvm/tools/clang/lib/AST/DeclObjC.cpp head/contrib/llvm/tools/clang/lib/AST/DeclPrinter.cpp head/contrib/llvm/tools/clang/lib/AST/DeclTemplate.cpp head/contrib/llvm/tools/clang/lib/AST/DeclarationName.cpp head/contrib/llvm/tools/clang/lib/AST/Expr.cpp head/contrib/llvm/tools/clang/lib/AST/ExprCXX.cpp head/contrib/llvm/tools/clang/lib/AST/ExprClassification.cpp head/contrib/llvm/tools/clang/lib/AST/ExprConstant.cpp head/contrib/llvm/tools/clang/lib/AST/ExprObjC.cpp head/contrib/llvm/tools/clang/lib/AST/ExternalASTMerger.cpp head/contrib/llvm/tools/clang/lib/AST/ExternalASTSource.cpp head/contrib/llvm/tools/clang/lib/AST/ItaniumCXXABI.cpp head/contrib/llvm/tools/clang/lib/AST/ItaniumMangle.cpp head/contrib/llvm/tools/clang/lib/AST/Mangle.cpp head/contrib/llvm/tools/clang/lib/AST/MicrosoftCXXABI.cpp head/contrib/llvm/tools/clang/lib/AST/MicrosoftMangle.cpp head/contrib/llvm/tools/clang/lib/AST/NSAPI.cpp head/contrib/llvm/tools/clang/lib/AST/NestedNameSpecifier.cpp head/contrib/llvm/tools/clang/lib/AST/ODRHash.cpp head/contrib/llvm/tools/clang/lib/AST/OpenMPClause.cpp head/contrib/llvm/tools/clang/lib/AST/RecordLayout.cpp head/contrib/llvm/tools/clang/lib/AST/RecordLayoutBuilder.cpp head/contrib/llvm/tools/clang/lib/AST/Stmt.cpp head/contrib/llvm/tools/clang/lib/AST/StmtIterator.cpp head/contrib/llvm/tools/clang/lib/AST/StmtOpenMP.cpp head/contrib/llvm/tools/clang/lib/AST/StmtPrinter.cpp head/contrib/llvm/tools/clang/lib/AST/StmtProfile.cpp head/contrib/llvm/tools/clang/lib/AST/TemplateBase.cpp head/contrib/llvm/tools/clang/lib/AST/TemplateName.cpp head/contrib/llvm/tools/clang/lib/AST/Type.cpp head/contrib/llvm/tools/clang/lib/AST/TypeLoc.cpp head/contrib/llvm/tools/clang/lib/AST/TypePrinter.cpp head/contrib/llvm/tools/clang/lib/AST/VTTBuilder.cpp head/contrib/llvm/tools/clang/lib/AST/VTableBuilder.cpp head/contrib/llvm/tools/clang/lib/ASTMatchers/ASTMatchFinder.cpp head/contrib/llvm/tools/clang/lib/ASTMatchers/ASTMatchersInternal.cpp head/contrib/llvm/tools/clang/lib/ASTMatchers/Dynamic/Marshallers.h head/contrib/llvm/tools/clang/lib/ASTMatchers/Dynamic/Parser.cpp head/contrib/llvm/tools/clang/lib/ASTMatchers/Dynamic/Registry.cpp head/contrib/llvm/tools/clang/lib/Analysis/AnalysisDeclContext.cpp head/contrib/llvm/tools/clang/lib/Analysis/BodyFarm.cpp head/contrib/llvm/tools/clang/lib/Analysis/CFG.cpp head/contrib/llvm/tools/clang/lib/Analysis/CallGraph.cpp head/contrib/llvm/tools/clang/lib/Analysis/CloneDetection.cpp head/contrib/llvm/tools/clang/lib/Analysis/CocoaConventions.cpp head/contrib/llvm/tools/clang/lib/Analysis/Consumed.cpp head/contrib/llvm/tools/clang/lib/Analysis/LiveVariables.cpp head/contrib/llvm/tools/clang/lib/Analysis/PrintfFormatString.cpp head/contrib/llvm/tools/clang/lib/Analysis/ReachableCode.cpp head/contrib/llvm/tools/clang/lib/Analysis/ScanfFormatString.cpp head/contrib/llvm/tools/clang/lib/Analysis/ThreadSafety.cpp head/contrib/llvm/tools/clang/lib/Analysis/ThreadSafetyCommon.cpp head/contrib/llvm/tools/clang/lib/Analysis/ThreadSafetyTIL.cpp head/contrib/llvm/tools/clang/lib/Analysis/UninitializedValues.cpp head/contrib/llvm/tools/clang/lib/Basic/Builtins.cpp head/contrib/llvm/tools/clang/lib/Basic/Cuda.cpp head/contrib/llvm/tools/clang/lib/Basic/Diagnostic.cpp head/contrib/llvm/tools/clang/lib/Basic/DiagnosticIDs.cpp head/contrib/llvm/tools/clang/lib/Basic/FileManager.cpp head/contrib/llvm/tools/clang/lib/Basic/IdentifierTable.cpp head/contrib/llvm/tools/clang/lib/Basic/Module.cpp head/contrib/llvm/tools/clang/lib/Basic/OpenMPKinds.cpp head/contrib/llvm/tools/clang/lib/Basic/OperatorPrecedence.cpp head/contrib/llvm/tools/clang/lib/Basic/SanitizerBlacklist.cpp head/contrib/llvm/tools/clang/lib/Basic/SourceManager.cpp head/contrib/llvm/tools/clang/lib/Basic/TargetInfo.cpp head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp head/contrib/llvm/tools/clang/lib/Basic/Version.cpp head/contrib/llvm/tools/clang/lib/Basic/VirtualFileSystem.cpp head/contrib/llvm/tools/clang/lib/Basic/XRayLists.cpp head/contrib/llvm/tools/clang/lib/CodeGen/BackendUtil.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGAtomic.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGBlocks.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGBuilder.h head/contrib/llvm/tools/clang/lib/CodeGen/CGBuiltin.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGCXX.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGCXXABI.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGCXXABI.h head/contrib/llvm/tools/clang/lib/CodeGen/CGCall.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGClass.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGCleanup.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGCoroutine.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.h head/contrib/llvm/tools/clang/lib/CodeGen/CGDecl.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGDeclCXX.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGException.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGExpr.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGExprAgg.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGExprCXX.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGExprComplex.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGExprConstant.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGExprScalar.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGObjC.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGObjCMac.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGObjCRuntime.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGOpenCLRuntime.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGOpenCLRuntime.h head/contrib/llvm/tools/clang/lib/CodeGen/CGOpenMPRuntime.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGOpenMPRuntime.h head/contrib/llvm/tools/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.h head/contrib/llvm/tools/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGStmt.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGStmtOpenMP.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGVTT.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGValue.h head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenABITypes.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenFunction.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenFunction.h head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.h head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenPGO.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenTBAA.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenTBAA.h head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenTypeCache.h head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenTypes.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenTypes.h head/contrib/llvm/tools/clang/lib/CodeGen/CoverageMappingGen.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CoverageMappingGen.h head/contrib/llvm/tools/clang/lib/CodeGen/ItaniumCXXABI.cpp head/contrib/llvm/tools/clang/lib/CodeGen/MicrosoftCXXABI.cpp head/contrib/llvm/tools/clang/lib/CodeGen/ModuleBuilder.cpp head/contrib/llvm/tools/clang/lib/CodeGen/SanitizerMetadata.cpp head/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp head/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.h head/contrib/llvm/tools/clang/lib/Driver/Compilation.cpp head/contrib/llvm/tools/clang/lib/Driver/Distro.cpp head/contrib/llvm/tools/clang/lib/Driver/Driver.cpp head/contrib/llvm/tools/clang/lib/Driver/DriverOptions.cpp head/contrib/llvm/tools/clang/lib/Driver/Job.cpp head/contrib/llvm/tools/clang/lib/Driver/SanitizerArgs.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChain.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/AMDGPU.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/AMDGPU.h head/contrib/llvm/tools/clang/lib/Driver/ToolChains/Ananas.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/Arch/AArch64.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/Arch/ARM.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/Arch/ARM.h head/contrib/llvm/tools/clang/lib/Driver/ToolChains/Arch/Mips.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/Arch/Mips.h head/contrib/llvm/tools/clang/lib/Driver/ToolChains/Arch/PPC.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/Arch/PPC.h head/contrib/llvm/tools/clang/lib/Driver/ToolChains/Arch/X86.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/BareMetal.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/BareMetal.h head/contrib/llvm/tools/clang/lib/Driver/ToolChains/Clang.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/Clang.h head/contrib/llvm/tools/clang/lib/Driver/ToolChains/CloudABI.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/CommonArgs.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/CommonArgs.h head/contrib/llvm/tools/clang/lib/Driver/ToolChains/CrossWindows.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/Cuda.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/Cuda.h head/contrib/llvm/tools/clang/lib/Driver/ToolChains/Darwin.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/Darwin.h head/contrib/llvm/tools/clang/lib/Driver/ToolChains/DragonFly.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/FreeBSD.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/FreeBSD.h head/contrib/llvm/tools/clang/lib/Driver/ToolChains/Fuchsia.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/Fuchsia.h head/contrib/llvm/tools/clang/lib/Driver/ToolChains/Gnu.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/Hexagon.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/Hexagon.h head/contrib/llvm/tools/clang/lib/Driver/ToolChains/Linux.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/MSVC.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/MinGW.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/MinGW.h head/contrib/llvm/tools/clang/lib/Driver/ToolChains/Minix.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/Myriad.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/NaCl.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/NetBSD.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/NetBSD.h head/contrib/llvm/tools/clang/lib/Driver/ToolChains/OpenBSD.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/PS4CPU.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/Solaris.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/WebAssembly.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/WebAssembly.h head/contrib/llvm/tools/clang/lib/Driver/XRayArgs.cpp head/contrib/llvm/tools/clang/lib/Format/BreakableToken.cpp head/contrib/llvm/tools/clang/lib/Format/BreakableToken.h head/contrib/llvm/tools/clang/lib/Format/ContinuationIndenter.cpp head/contrib/llvm/tools/clang/lib/Format/ContinuationIndenter.h head/contrib/llvm/tools/clang/lib/Format/Format.cpp head/contrib/llvm/tools/clang/lib/Format/FormatToken.cpp head/contrib/llvm/tools/clang/lib/Format/FormatToken.h head/contrib/llvm/tools/clang/lib/Format/FormatTokenLexer.cpp head/contrib/llvm/tools/clang/lib/Format/FormatTokenLexer.h head/contrib/llvm/tools/clang/lib/Format/NamespaceEndCommentsFixer.cpp head/contrib/llvm/tools/clang/lib/Format/NamespaceEndCommentsFixer.h head/contrib/llvm/tools/clang/lib/Format/SortJavaScriptImports.cpp head/contrib/llvm/tools/clang/lib/Format/TokenAnalyzer.cpp head/contrib/llvm/tools/clang/lib/Format/TokenAnalyzer.h head/contrib/llvm/tools/clang/lib/Format/TokenAnnotator.cpp head/contrib/llvm/tools/clang/lib/Format/TokenAnnotator.h head/contrib/llvm/tools/clang/lib/Format/UnwrappedLineFormatter.cpp head/contrib/llvm/tools/clang/lib/Format/UnwrappedLineFormatter.h head/contrib/llvm/tools/clang/lib/Format/UnwrappedLineParser.cpp head/contrib/llvm/tools/clang/lib/Format/UnwrappedLineParser.h head/contrib/llvm/tools/clang/lib/Format/UsingDeclarationsSorter.cpp head/contrib/llvm/tools/clang/lib/Format/UsingDeclarationsSorter.h head/contrib/llvm/tools/clang/lib/Format/WhitespaceManager.cpp head/contrib/llvm/tools/clang/lib/Format/WhitespaceManager.h head/contrib/llvm/tools/clang/lib/Frontend/ASTUnit.cpp head/contrib/llvm/tools/clang/lib/Frontend/CompilerInstance.cpp head/contrib/llvm/tools/clang/lib/Frontend/CompilerInvocation.cpp head/contrib/llvm/tools/clang/lib/Frontend/FrontendAction.cpp head/contrib/llvm/tools/clang/lib/Frontend/FrontendActions.cpp head/contrib/llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp head/contrib/llvm/tools/clang/lib/Frontend/InitPreprocessor.cpp head/contrib/llvm/tools/clang/lib/Frontend/MultiplexConsumer.cpp head/contrib/llvm/tools/clang/lib/Frontend/PrecompiledPreamble.cpp head/contrib/llvm/tools/clang/lib/Frontend/PrintPreprocessedOutput.cpp head/contrib/llvm/tools/clang/lib/Frontend/Rewrite/FrontendActions.cpp head/contrib/llvm/tools/clang/lib/Frontend/Rewrite/RewriteModernObjC.cpp head/contrib/llvm/tools/clang/lib/Frontend/Rewrite/RewriteObjC.cpp head/contrib/llvm/tools/clang/lib/Frontend/TextDiagnosticBuffer.cpp head/contrib/llvm/tools/clang/lib/Frontend/VerifyDiagnosticConsumer.cpp head/contrib/llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp head/contrib/llvm/tools/clang/lib/Headers/__clang_cuda_cmath.h head/contrib/llvm/tools/clang/lib/Headers/__clang_cuda_intrinsics.h head/contrib/llvm/tools/clang/lib/Headers/__clang_cuda_math_forward_declares.h head/contrib/llvm/tools/clang/lib/Headers/__clang_cuda_runtime_wrapper.h head/contrib/llvm/tools/clang/lib/Headers/avx2intrin.h head/contrib/llvm/tools/clang/lib/Headers/avx512bwintrin.h head/contrib/llvm/tools/clang/lib/Headers/avx512cdintrin.h head/contrib/llvm/tools/clang/lib/Headers/avx512dqintrin.h head/contrib/llvm/tools/clang/lib/Headers/avx512fintrin.h head/contrib/llvm/tools/clang/lib/Headers/avx512vlbwintrin.h head/contrib/llvm/tools/clang/lib/Headers/avx512vlcdintrin.h head/contrib/llvm/tools/clang/lib/Headers/avx512vldqintrin.h head/contrib/llvm/tools/clang/lib/Headers/avx512vlintrin.h head/contrib/llvm/tools/clang/lib/Headers/clflushoptintrin.h head/contrib/llvm/tools/clang/lib/Headers/cpuid.h head/contrib/llvm/tools/clang/lib/Headers/cuda_wrappers/algorithm head/contrib/llvm/tools/clang/lib/Headers/cuda_wrappers/new head/contrib/llvm/tools/clang/lib/Headers/emmintrin.h head/contrib/llvm/tools/clang/lib/Headers/float.h head/contrib/llvm/tools/clang/lib/Headers/fma4intrin.h head/contrib/llvm/tools/clang/lib/Headers/fmaintrin.h head/contrib/llvm/tools/clang/lib/Headers/immintrin.h head/contrib/llvm/tools/clang/lib/Headers/intrin.h head/contrib/llvm/tools/clang/lib/Headers/opencl-c.h head/contrib/llvm/tools/clang/lib/Headers/pmmintrin.h head/contrib/llvm/tools/clang/lib/Headers/smmintrin.h head/contrib/llvm/tools/clang/lib/Headers/stdbool.h head/contrib/llvm/tools/clang/lib/Headers/unwind.h head/contrib/llvm/tools/clang/lib/Headers/xmmintrin.h head/contrib/llvm/tools/clang/lib/Index/CodegenNameGenerator.cpp head/contrib/llvm/tools/clang/lib/Index/CommentToXML.cpp head/contrib/llvm/tools/clang/lib/Index/IndexBody.cpp head/contrib/llvm/tools/clang/lib/Index/IndexDecl.cpp head/contrib/llvm/tools/clang/lib/Index/IndexSymbol.cpp head/contrib/llvm/tools/clang/lib/Index/IndexTypeSourceInfo.cpp head/contrib/llvm/tools/clang/lib/Index/IndexingAction.cpp head/contrib/llvm/tools/clang/lib/Index/IndexingContext.cpp head/contrib/llvm/tools/clang/lib/Index/USRGeneration.cpp head/contrib/llvm/tools/clang/lib/Lex/HeaderSearch.cpp head/contrib/llvm/tools/clang/lib/Lex/Lexer.cpp head/contrib/llvm/tools/clang/lib/Lex/LiteralSupport.cpp head/contrib/llvm/tools/clang/lib/Lex/MacroArgs.cpp head/contrib/llvm/tools/clang/lib/Lex/MacroInfo.cpp head/contrib/llvm/tools/clang/lib/Lex/ModuleMap.cpp head/contrib/llvm/tools/clang/lib/Lex/PPDirectives.cpp head/contrib/llvm/tools/clang/lib/Lex/PPLexerChange.cpp head/contrib/llvm/tools/clang/lib/Lex/PPMacroExpansion.cpp head/contrib/llvm/tools/clang/lib/Lex/PTHLexer.cpp head/contrib/llvm/tools/clang/lib/Lex/Pragma.cpp head/contrib/llvm/tools/clang/lib/Lex/PreprocessingRecord.cpp head/contrib/llvm/tools/clang/lib/Lex/Preprocessor.cpp head/contrib/llvm/tools/clang/lib/Lex/PreprocessorLexer.cpp head/contrib/llvm/tools/clang/lib/Lex/TokenConcatenation.cpp head/contrib/llvm/tools/clang/lib/Lex/TokenLexer.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseCXXInlineMethods.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseDecl.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseExpr.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseExprCXX.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseObjc.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseOpenMP.cpp head/contrib/llvm/tools/clang/lib/Parse/ParsePragma.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseStmt.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseStmtAsm.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseTemplate.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseTentative.cpp head/contrib/llvm/tools/clang/lib/Parse/Parser.cpp head/contrib/llvm/tools/clang/lib/Rewrite/HTMLRewrite.cpp head/contrib/llvm/tools/clang/lib/Sema/AnalysisBasedWarnings.cpp head/contrib/llvm/tools/clang/lib/Sema/AttributeList.cpp head/contrib/llvm/tools/clang/lib/Sema/CodeCompleteConsumer.cpp head/contrib/llvm/tools/clang/lib/Sema/DeclSpec.cpp head/contrib/llvm/tools/clang/lib/Sema/JumpDiagnostics.cpp head/contrib/llvm/tools/clang/lib/Sema/MultiplexExternalSemaSource.cpp head/contrib/llvm/tools/clang/lib/Sema/Sema.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaAttr.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaCast.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaCodeComplete.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaCoroutine.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaDeclAttr.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaDeclCXX.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaDeclObjC.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaExceptionSpec.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaExprCXX.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaExprMember.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaExprObjC.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaLambda.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaLookup.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaObjCProperty.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaOpenMP.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaOverload.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaPseudoObject.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaStmt.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaStmtAsm.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaStmtAttr.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaTemplate.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaTemplateDeduction.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaTemplateInstantiate.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaTemplateVariadic.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaType.cpp head/contrib/llvm/tools/clang/lib/Sema/TreeTransform.h head/contrib/llvm/tools/clang/lib/Serialization/ASTCommon.cpp head/contrib/llvm/tools/clang/lib/Serialization/ASTCommon.h head/contrib/llvm/tools/clang/lib/Serialization/ASTReader.cpp head/contrib/llvm/tools/clang/lib/Serialization/ASTReaderDecl.cpp head/contrib/llvm/tools/clang/lib/Serialization/ASTReaderInternals.h head/contrib/llvm/tools/clang/lib/Serialization/ASTReaderStmt.cpp head/contrib/llvm/tools/clang/lib/Serialization/ASTWriter.cpp head/contrib/llvm/tools/clang/lib/Serialization/ASTWriterDecl.cpp head/contrib/llvm/tools/clang/lib/Serialization/ASTWriterStmt.cpp head/contrib/llvm/tools/clang/lib/Serialization/GlobalModuleIndex.cpp head/contrib/llvm/tools/clang/lib/Serialization/ModuleManager.cpp head/contrib/llvm/tools/clang/lib/Serialization/MultiOnDiskHashTable.h head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/BlockInCriticalSectionChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CStringSyntaxChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CloneChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ConversionChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/DebugCheckers.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/IdenticalExprChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/MisusedMovedObjectChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ObjCContainersASTChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ObjCSuperDeallocChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/PaddingChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/UndefinedAssignmentChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/AnalysisManager.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/BasicValueFactory.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/BugReporter.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CallEvent.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CheckerContext.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CoreEngine.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/Environment.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/IssueHash.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/MemRegion.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/PrettyStackTraceLocationContext.h head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ProgramState.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/RangedConstraintManager.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/RegionStore.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SVals.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/Store.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SymbolManager.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp head/contrib/llvm/tools/clang/lib/Tooling/ArgumentsAdjusters.cpp head/contrib/llvm/tools/clang/lib/Tooling/CommonOptionsParser.cpp head/contrib/llvm/tools/clang/lib/Tooling/CompilationDatabase.cpp head/contrib/llvm/tools/clang/lib/Tooling/Core/Replacement.cpp head/contrib/llvm/tools/clang/lib/Tooling/Refactoring/AtomicChange.cpp head/contrib/llvm/tools/clang/lib/Tooling/Refactoring/Rename/RenamingAction.cpp head/contrib/llvm/tools/clang/lib/Tooling/Refactoring/Rename/USRFindingAction.cpp head/contrib/llvm/tools/clang/lib/Tooling/Refactoring/Rename/USRLocFinder.cpp head/contrib/llvm/tools/clang/lib/Tooling/Tooling.cpp head/contrib/llvm/tools/clang/tools/clang-format/ClangFormat.cpp head/contrib/llvm/tools/clang/tools/driver/cc1as_main.cpp head/contrib/llvm/tools/clang/tools/driver/driver.cpp head/contrib/llvm/tools/clang/utils/TableGen/ClangAttrEmitter.cpp head/contrib/llvm/tools/clang/utils/TableGen/NeonEmitter.cpp head/contrib/llvm/tools/clang/utils/TableGen/TableGen.cpp head/contrib/llvm/tools/clang/utils/TableGen/TableGenBackends.h head/contrib/llvm/tools/llc/llc.cpp head/contrib/llvm/tools/lld/.arcconfig head/contrib/llvm/tools/lld/CMakeLists.txt head/contrib/llvm/tools/lld/CODE_OWNERS.TXT head/contrib/llvm/tools/lld/COFF/CMakeLists.txt head/contrib/llvm/tools/lld/COFF/Chunks.cpp head/contrib/llvm/tools/lld/COFF/Chunks.h head/contrib/llvm/tools/lld/COFF/Config.h head/contrib/llvm/tools/lld/COFF/DLL.cpp head/contrib/llvm/tools/lld/COFF/Driver.cpp head/contrib/llvm/tools/lld/COFF/Driver.h head/contrib/llvm/tools/lld/COFF/DriverUtils.cpp head/contrib/llvm/tools/lld/COFF/ICF.cpp head/contrib/llvm/tools/lld/COFF/InputFiles.cpp head/contrib/llvm/tools/lld/COFF/InputFiles.h head/contrib/llvm/tools/lld/COFF/LTO.cpp head/contrib/llvm/tools/lld/COFF/LTO.h head/contrib/llvm/tools/lld/COFF/MapFile.cpp head/contrib/llvm/tools/lld/COFF/MarkLive.cpp head/contrib/llvm/tools/lld/COFF/Options.td head/contrib/llvm/tools/lld/COFF/PDB.cpp head/contrib/llvm/tools/lld/COFF/PDB.h head/contrib/llvm/tools/lld/COFF/Strings.cpp head/contrib/llvm/tools/lld/COFF/Strings.h head/contrib/llvm/tools/lld/COFF/SymbolTable.cpp head/contrib/llvm/tools/lld/COFF/SymbolTable.h head/contrib/llvm/tools/lld/COFF/Symbols.cpp head/contrib/llvm/tools/lld/COFF/Symbols.h head/contrib/llvm/tools/lld/COFF/Writer.cpp head/contrib/llvm/tools/lld/COFF/Writer.h head/contrib/llvm/tools/lld/ELF/Arch/AArch64.cpp head/contrib/llvm/tools/lld/ELF/Arch/AMDGPU.cpp head/contrib/llvm/tools/lld/ELF/Arch/ARM.cpp head/contrib/llvm/tools/lld/ELF/Arch/AVR.cpp head/contrib/llvm/tools/lld/ELF/Arch/Mips.cpp head/contrib/llvm/tools/lld/ELF/Arch/MipsArchTree.cpp head/contrib/llvm/tools/lld/ELF/Arch/PPC.cpp head/contrib/llvm/tools/lld/ELF/Arch/PPC64.cpp head/contrib/llvm/tools/lld/ELF/Arch/SPARCV9.cpp head/contrib/llvm/tools/lld/ELF/Arch/X86.cpp head/contrib/llvm/tools/lld/ELF/Arch/X86_64.cpp head/contrib/llvm/tools/lld/ELF/CMakeLists.txt head/contrib/llvm/tools/lld/ELF/Config.h head/contrib/llvm/tools/lld/ELF/Driver.cpp head/contrib/llvm/tools/lld/ELF/Driver.h head/contrib/llvm/tools/lld/ELF/DriverUtils.cpp head/contrib/llvm/tools/lld/ELF/EhFrame.cpp head/contrib/llvm/tools/lld/ELF/EhFrame.h head/contrib/llvm/tools/lld/ELF/Filesystem.cpp head/contrib/llvm/tools/lld/ELF/Filesystem.h head/contrib/llvm/tools/lld/ELF/GdbIndex.cpp head/contrib/llvm/tools/lld/ELF/GdbIndex.h head/contrib/llvm/tools/lld/ELF/ICF.cpp head/contrib/llvm/tools/lld/ELF/InputFiles.cpp head/contrib/llvm/tools/lld/ELF/InputFiles.h head/contrib/llvm/tools/lld/ELF/InputSection.cpp head/contrib/llvm/tools/lld/ELF/InputSection.h head/contrib/llvm/tools/lld/ELF/LTO.cpp head/contrib/llvm/tools/lld/ELF/LTO.h head/contrib/llvm/tools/lld/ELF/LinkerScript.cpp head/contrib/llvm/tools/lld/ELF/LinkerScript.h head/contrib/llvm/tools/lld/ELF/MapFile.cpp head/contrib/llvm/tools/lld/ELF/MapFile.h head/contrib/llvm/tools/lld/ELF/MarkLive.cpp head/contrib/llvm/tools/lld/ELF/Options.td head/contrib/llvm/tools/lld/ELF/OutputSections.cpp head/contrib/llvm/tools/lld/ELF/OutputSections.h head/contrib/llvm/tools/lld/ELF/Relocations.cpp head/contrib/llvm/tools/lld/ELF/Relocations.h head/contrib/llvm/tools/lld/ELF/ScriptLexer.cpp head/contrib/llvm/tools/lld/ELF/ScriptLexer.h head/contrib/llvm/tools/lld/ELF/ScriptParser.cpp head/contrib/llvm/tools/lld/ELF/ScriptParser.h head/contrib/llvm/tools/lld/ELF/Strings.cpp head/contrib/llvm/tools/lld/ELF/Strings.h head/contrib/llvm/tools/lld/ELF/SymbolTable.cpp head/contrib/llvm/tools/lld/ELF/SymbolTable.h head/contrib/llvm/tools/lld/ELF/Symbols.cpp head/contrib/llvm/tools/lld/ELF/Symbols.h head/contrib/llvm/tools/lld/ELF/SyntheticSections.cpp head/contrib/llvm/tools/lld/ELF/SyntheticSections.h head/contrib/llvm/tools/lld/ELF/Target.cpp head/contrib/llvm/tools/lld/ELF/Target.h head/contrib/llvm/tools/lld/ELF/Thunks.cpp head/contrib/llvm/tools/lld/ELF/Thunks.h head/contrib/llvm/tools/lld/ELF/Writer.cpp head/contrib/llvm/tools/lld/ELF/Writer.h head/contrib/llvm/tools/lld/FREEBSD-Xlist head/contrib/llvm/tools/lld/README.md head/contrib/llvm/tools/lld/include/lld/Core/Atom.h head/contrib/llvm/tools/lld/include/lld/Core/DefinedAtom.h head/contrib/llvm/tools/lld/include/lld/Core/Error.h head/contrib/llvm/tools/lld/include/lld/Core/LinkingContext.h head/contrib/llvm/tools/lld/include/lld/Core/PassManager.h head/contrib/llvm/tools/lld/include/lld/Core/Reader.h head/contrib/llvm/tools/lld/include/lld/Core/SymbolTable.h head/contrib/llvm/tools/lld/include/lld/Core/Writer.h head/contrib/llvm/tools/lld/include/lld/ReaderWriter/YamlContext.h head/contrib/llvm/tools/lld/lib/CMakeLists.txt head/contrib/llvm/tools/lld/lib/Core/CMakeLists.txt head/contrib/llvm/tools/lld/lib/Core/Resolver.cpp head/contrib/llvm/tools/lld/lib/Core/SymbolTable.cpp head/contrib/llvm/tools/lld/lib/Driver/CMakeLists.txt head/contrib/llvm/tools/lld/lib/Driver/DarwinLdDriver.cpp head/contrib/llvm/tools/lld/lib/ReaderWriter/CMakeLists.txt head/contrib/llvm/tools/lld/lib/ReaderWriter/FileArchive.cpp head/contrib/llvm/tools/lld/lib/ReaderWriter/MachO/ArchHandler.h head/contrib/llvm/tools/lld/lib/ReaderWriter/MachO/CMakeLists.txt head/contrib/llvm/tools/lld/lib/ReaderWriter/MachO/CompactUnwindPass.cpp head/contrib/llvm/tools/lld/lib/ReaderWriter/MachO/FlatNamespaceFile.h head/contrib/llvm/tools/lld/lib/ReaderWriter/MachO/GOTPass.cpp head/contrib/llvm/tools/lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp head/contrib/llvm/tools/lld/lib/ReaderWriter/MachO/MachONormalizedFile.h head/contrib/llvm/tools/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp head/contrib/llvm/tools/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryUtils.h head/contrib/llvm/tools/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp head/contrib/llvm/tools/lld/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp head/contrib/llvm/tools/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp head/contrib/llvm/tools/lld/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp head/contrib/llvm/tools/lld/lib/ReaderWriter/MachO/ObjCPass.cpp head/contrib/llvm/tools/lld/lib/ReaderWriter/MachO/ShimPass.cpp head/contrib/llvm/tools/lld/lib/ReaderWriter/MachO/StubsPass.cpp head/contrib/llvm/tools/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp head/contrib/llvm/tools/lld/tools/lld/CMakeLists.txt head/contrib/llvm/tools/lld/tools/lld/lld.cpp head/contrib/llvm/tools/lldb/include/lldb/API/LLDB.h head/contrib/llvm/tools/lldb/include/lldb/API/SBBreakpoint.h head/contrib/llvm/tools/lldb/include/lldb/API/SBBreakpointLocation.h head/contrib/llvm/tools/lldb/include/lldb/API/SBCommandInterpreter.h head/contrib/llvm/tools/lldb/include/lldb/API/SBDebugger.h head/contrib/llvm/tools/lldb/include/lldb/API/SBDefines.h head/contrib/llvm/tools/lldb/include/lldb/API/SBError.h head/contrib/llvm/tools/lldb/include/lldb/API/SBFileSpec.h head/contrib/llvm/tools/lldb/include/lldb/API/SBProcess.h head/contrib/llvm/tools/lldb/include/lldb/API/SBStream.h head/contrib/llvm/tools/lldb/include/lldb/API/SBStringList.h head/contrib/llvm/tools/lldb/include/lldb/API/SBStructuredData.h head/contrib/llvm/tools/lldb/include/lldb/API/SBTarget.h head/contrib/llvm/tools/lldb/include/lldb/API/SBThread.h head/contrib/llvm/tools/lldb/include/lldb/Breakpoint/Breakpoint.h head/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointIDList.h head/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointList.h head/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointLocation.h head/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointOptions.h head/contrib/llvm/tools/lldb/include/lldb/Core/Disassembler.h head/contrib/llvm/tools/lldb/include/lldb/Core/EmulateInstruction.h head/contrib/llvm/tools/lldb/include/lldb/Core/IOHandler.h head/contrib/llvm/tools/lldb/include/lldb/Core/MappedHash.h head/contrib/llvm/tools/lldb/include/lldb/Core/Module.h head/contrib/llvm/tools/lldb/include/lldb/Core/ModuleSpec.h head/contrib/llvm/tools/lldb/include/lldb/Core/PluginManager.h head/contrib/llvm/tools/lldb/include/lldb/Core/RangeMap.h head/contrib/llvm/tools/lldb/include/lldb/Core/Section.h head/contrib/llvm/tools/lldb/include/lldb/Expression/DWARFExpression.h head/contrib/llvm/tools/lldb/include/lldb/Expression/ExpressionParser.h head/contrib/llvm/tools/lldb/include/lldb/Expression/IRExecutionUnit.h head/contrib/llvm/tools/lldb/include/lldb/Host/Config.h.cmake head/contrib/llvm/tools/lldb/include/lldb/Host/Host.h head/contrib/llvm/tools/lldb/include/lldb/Host/HostInfoBase.h head/contrib/llvm/tools/lldb/include/lldb/Host/MainLoop.h head/contrib/llvm/tools/lldb/include/lldb/Host/PseudoTerminal.h head/contrib/llvm/tools/lldb/include/lldb/Host/common/NativeProcessProtocol.h head/contrib/llvm/tools/lldb/include/lldb/Host/common/NativeRegisterContext.h head/contrib/llvm/tools/lldb/include/lldb/Host/common/NativeThreadProtocol.h head/contrib/llvm/tools/lldb/include/lldb/Interpreter/Args.h head/contrib/llvm/tools/lldb/include/lldb/Interpreter/CommandInterpreter.h head/contrib/llvm/tools/lldb/include/lldb/Interpreter/OptionGroupArchitecture.h head/contrib/llvm/tools/lldb/include/lldb/Interpreter/OptionValueArch.h head/contrib/llvm/tools/lldb/include/lldb/Interpreter/OptionValueFileSpec.h head/contrib/llvm/tools/lldb/include/lldb/Symbol/ArmUnwindInfo.h head/contrib/llvm/tools/lldb/include/lldb/Symbol/ClangASTContext.h head/contrib/llvm/tools/lldb/include/lldb/Symbol/CompilerType.h head/contrib/llvm/tools/lldb/include/lldb/Symbol/DeclVendor.h head/contrib/llvm/tools/lldb/include/lldb/Symbol/FuncUnwinders.h head/contrib/llvm/tools/lldb/include/lldb/Symbol/GoASTContext.h head/contrib/llvm/tools/lldb/include/lldb/Symbol/JavaASTContext.h head/contrib/llvm/tools/lldb/include/lldb/Symbol/OCamlASTContext.h head/contrib/llvm/tools/lldb/include/lldb/Symbol/ObjectFile.h head/contrib/llvm/tools/lldb/include/lldb/Symbol/TypeSystem.h head/contrib/llvm/tools/lldb/include/lldb/Target/Platform.h head/contrib/llvm/tools/lldb/include/lldb/Target/Process.h head/contrib/llvm/tools/lldb/include/lldb/Target/ProcessInfo.h head/contrib/llvm/tools/lldb/include/lldb/Target/ProcessLaunchInfo.h head/contrib/llvm/tools/lldb/include/lldb/Target/Target.h head/contrib/llvm/tools/lldb/include/lldb/Target/UnwindAssembly.h head/contrib/llvm/tools/lldb/include/lldb/Utility/DataBufferLLVM.h head/contrib/llvm/tools/lldb/include/lldb/Utility/DataExtractor.h head/contrib/llvm/tools/lldb/include/lldb/Utility/FileSpec.h head/contrib/llvm/tools/lldb/include/lldb/Utility/Log.h head/contrib/llvm/tools/lldb/include/lldb/Utility/Logging.h head/contrib/llvm/tools/lldb/include/lldb/Utility/SharingPtr.h head/contrib/llvm/tools/lldb/include/lldb/Utility/Status.h head/contrib/llvm/tools/lldb/include/lldb/Utility/StringList.h head/contrib/llvm/tools/lldb/include/lldb/Utility/UUID.h head/contrib/llvm/tools/lldb/include/lldb/lldb-enumerations.h head/contrib/llvm/tools/lldb/include/lldb/lldb-forward.h head/contrib/llvm/tools/lldb/include/lldb/lldb-private-defines.h head/contrib/llvm/tools/lldb/include/lldb/lldb-private-forward.h head/contrib/llvm/tools/lldb/source/API/SBBreakpoint.cpp head/contrib/llvm/tools/lldb/source/API/SBBreakpointLocation.cpp head/contrib/llvm/tools/lldb/source/API/SBCommandInterpreter.cpp head/contrib/llvm/tools/lldb/source/API/SBDebugger.cpp head/contrib/llvm/tools/lldb/source/API/SBInstruction.cpp head/contrib/llvm/tools/lldb/source/API/SBPlatform.cpp head/contrib/llvm/tools/lldb/source/API/SBProcess.cpp head/contrib/llvm/tools/lldb/source/API/SBTarget.cpp head/contrib/llvm/tools/lldb/source/API/SBType.cpp head/contrib/llvm/tools/lldb/source/API/SystemInitializerFull.cpp head/contrib/llvm/tools/lldb/source/Breakpoint/Breakpoint.cpp head/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointID.cpp head/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointIDList.cpp head/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointList.cpp head/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointLocation.cpp head/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointLocationList.cpp head/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointOptions.cpp head/contrib/llvm/tools/lldb/source/Commands/CommandCompletions.cpp head/contrib/llvm/tools/lldb/source/Commands/CommandObjectBreakpoint.cpp head/contrib/llvm/tools/lldb/source/Commands/CommandObjectBreakpoint.h head/contrib/llvm/tools/lldb/source/Commands/CommandObjectBreakpointCommand.cpp head/contrib/llvm/tools/lldb/source/Commands/CommandObjectDisassemble.cpp head/contrib/llvm/tools/lldb/source/Commands/CommandObjectDisassemble.h head/contrib/llvm/tools/lldb/source/Commands/CommandObjectExpression.cpp head/contrib/llvm/tools/lldb/source/Commands/CommandObjectFrame.h head/contrib/llvm/tools/lldb/source/Commands/CommandObjectPlatform.cpp head/contrib/llvm/tools/lldb/source/Commands/CommandObjectSource.cpp head/contrib/llvm/tools/lldb/source/Commands/CommandObjectTarget.cpp head/contrib/llvm/tools/lldb/source/Commands/CommandObjectTarget.h head/contrib/llvm/tools/lldb/source/Commands/CommandObjectThread.cpp head/contrib/llvm/tools/lldb/source/Core/Address.cpp head/contrib/llvm/tools/lldb/source/Core/AddressRange.cpp head/contrib/llvm/tools/lldb/source/Core/Debugger.cpp head/contrib/llvm/tools/lldb/source/Core/DumpDataExtractor.cpp head/contrib/llvm/tools/lldb/source/Core/FileSpecList.cpp head/contrib/llvm/tools/lldb/source/Core/FormatEntity.cpp head/contrib/llvm/tools/lldb/source/Core/IOHandler.cpp head/contrib/llvm/tools/lldb/source/Core/Module.cpp head/contrib/llvm/tools/lldb/source/Core/ModuleList.cpp head/contrib/llvm/tools/lldb/source/Core/PluginManager.cpp head/contrib/llvm/tools/lldb/source/Core/RegisterValue.cpp head/contrib/llvm/tools/lldb/source/Core/Section.cpp head/contrib/llvm/tools/lldb/source/Core/Value.cpp head/contrib/llvm/tools/lldb/source/Core/ValueObjectDynamicValue.cpp head/contrib/llvm/tools/lldb/source/Core/ValueObjectMemory.cpp head/contrib/llvm/tools/lldb/source/Core/ValueObjectVariable.cpp head/contrib/llvm/tools/lldb/source/Expression/DWARFExpression.cpp head/contrib/llvm/tools/lldb/source/Expression/IRExecutionUnit.cpp head/contrib/llvm/tools/lldb/source/Expression/IRInterpreter.cpp head/contrib/llvm/tools/lldb/source/Host/common/Host.cpp head/contrib/llvm/tools/lldb/source/Host/common/HostInfoBase.cpp head/contrib/llvm/tools/lldb/source/Host/common/MainLoop.cpp head/contrib/llvm/tools/lldb/source/Host/common/NativeProcessProtocol.cpp head/contrib/llvm/tools/lldb/source/Host/common/NativeRegisterContext.cpp head/contrib/llvm/tools/lldb/source/Host/common/NativeThreadProtocol.cpp head/contrib/llvm/tools/lldb/source/Host/common/PseudoTerminal.cpp head/contrib/llvm/tools/lldb/source/Host/common/Socket.cpp head/contrib/llvm/tools/lldb/source/Host/common/Symbols.cpp head/contrib/llvm/tools/lldb/source/Host/common/XML.cpp head/contrib/llvm/tools/lldb/source/Host/freebsd/Host.cpp head/contrib/llvm/tools/lldb/source/Host/posix/HostThreadPosix.cpp head/contrib/llvm/tools/lldb/source/Host/posix/ProcessLauncherPosixFork.cpp head/contrib/llvm/tools/lldb/source/Initialization/SystemInitializerCommon.cpp head/contrib/llvm/tools/lldb/source/Interpreter/Args.cpp head/contrib/llvm/tools/lldb/source/Interpreter/CommandInterpreter.cpp head/contrib/llvm/tools/lldb/source/Interpreter/CommandObject.cpp head/contrib/llvm/tools/lldb/source/Interpreter/OptionGroupArchitecture.cpp head/contrib/llvm/tools/lldb/source/Interpreter/OptionGroupFormat.cpp head/contrib/llvm/tools/lldb/source/Interpreter/OptionValueDictionary.cpp head/contrib/llvm/tools/lldb/source/Interpreter/OptionValueFileSpec.cpp head/contrib/llvm/tools/lldb/source/Interpreter/ScriptInterpreter.cpp head/contrib/llvm/tools/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp head/contrib/llvm/tools/lldb/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp head/contrib/llvm/tools/lldb/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp head/contrib/llvm/tools/lldb/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.cpp head/contrib/llvm/tools/lldb/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp head/contrib/llvm/tools/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp head/contrib/llvm/tools/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp head/contrib/llvm/tools/lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.cpp head/contrib/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp head/contrib/llvm/tools/lldb/source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.cpp head/contrib/llvm/tools/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp head/contrib/llvm/tools/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.h head/contrib/llvm/tools/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp head/contrib/llvm/tools/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h head/contrib/llvm/tools/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp head/contrib/llvm/tools/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h head/contrib/llvm/tools/lldb/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.h head/contrib/llvm/tools/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp head/contrib/llvm/tools/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.h head/contrib/llvm/tools/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp head/contrib/llvm/tools/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp head/contrib/llvm/tools/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp head/contrib/llvm/tools/lldb/source/Plugins/Instruction/ARM/EmulationStateARM.cpp head/contrib/llvm/tools/lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp head/contrib/llvm/tools/lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp head/contrib/llvm/tools/lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp head/contrib/llvm/tools/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp head/contrib/llvm/tools/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.cpp head/contrib/llvm/tools/lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp head/contrib/llvm/tools/lldb/source/Plugins/Language/CPlusPlus/LibCxx.h head/contrib/llvm/tools/lldb/source/Plugins/Language/CPlusPlus/LibCxxInitializerList.cpp head/contrib/llvm/tools/lldb/source/Plugins/Language/CPlusPlus/LibCxxList.cpp head/contrib/llvm/tools/lldb/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp head/contrib/llvm/tools/lldb/source/Plugins/Language/CPlusPlus/LibCxxUnorderedMap.cpp head/contrib/llvm/tools/lldb/source/Plugins/Language/CPlusPlus/LibCxxVector.cpp head/contrib/llvm/tools/lldb/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp head/contrib/llvm/tools/lldb/source/Plugins/Language/ObjC/NSArray.cpp head/contrib/llvm/tools/lldb/source/Plugins/Language/ObjC/NSDictionary.cpp head/contrib/llvm/tools/lldb/source/Plugins/Language/ObjC/NSSet.cpp head/contrib/llvm/tools/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp head/contrib/llvm/tools/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.h head/contrib/llvm/tools/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h head/contrib/llvm/tools/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp head/contrib/llvm/tools/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h head/contrib/llvm/tools/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp head/contrib/llvm/tools/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp head/contrib/llvm/tools/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h head/contrib/llvm/tools/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp head/contrib/llvm/tools/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h head/contrib/llvm/tools/lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp head/contrib/llvm/tools/lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.h head/contrib/llvm/tools/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp head/contrib/llvm/tools/lldb/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp head/contrib/llvm/tools/lldb/source/Plugins/Platform/OpenBSD/PlatformOpenBSD.cpp head/contrib/llvm/tools/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp head/contrib/llvm/tools/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.h head/contrib/llvm/tools/lldb/source/Plugins/Process/Darwin/DarwinProcessLauncher.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/Darwin/MachException.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/Darwin/NativeProcessDarwin.h head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIX.h head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.h head/contrib/llvm/tools/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.h head/contrib/llvm/tools/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD.h head/contrib/llvm/tools/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.h head/contrib/llvm/tools/lldb/source/Plugins/Process/NetBSD/NativeThreadNetBSD.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/NetBSD/NativeThreadNetBSD.h head/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/NativeRegisterContextRegisterInfo.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/NativeRegisterContextRegisterInfo.h head/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.h head/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterContextMach_arm.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterContextMach_i386.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterContextMach_x86_64.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.h head/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterContext_mips.h head/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterContext_x86.h head/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterInfoInterface.h head/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterInfos_i386.h head/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterInfos_x86_64.h head/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/StopInfoMachException.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/ProcessElfCore.h head/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm.h head/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm64.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm64.h head/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_mips64.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_mips64.h head/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_powerpc.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_powerpc.h head/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_s390x.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_s390x.h head/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_x86_64.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_x86_64.h head/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/ThreadElfCore.h head/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h head/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h head/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h head/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h head/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/minidump/MinidumpParser.h head/contrib/llvm/tools/lldb/source/Plugins/Process/minidump/ProcessMinidump.h head/contrib/llvm/tools/lldb/source/Plugins/Process/minidump/ThreadMinidump.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/minidump/ThreadMinidump.h head/contrib/llvm/tools/lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp head/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DIERef.cpp head/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp head/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserGo.cpp head/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp head/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h head/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp head/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp head/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.h head/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp head/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h head/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp head/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h head/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp head/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp head/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h head/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp head/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h head/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp head/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h head/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp head/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp head/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h head/contrib/llvm/tools/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp head/contrib/llvm/tools/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp head/contrib/llvm/tools/lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp head/contrib/llvm/tools/lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.h head/contrib/llvm/tools/lldb/source/Symbol/ArmUnwindInfo.cpp head/contrib/llvm/tools/lldb/source/Symbol/ClangASTContext.cpp head/contrib/llvm/tools/lldb/source/Symbol/ClangExternalASTSourceCommon.cpp head/contrib/llvm/tools/lldb/source/Symbol/CompactUnwindInfo.cpp head/contrib/llvm/tools/lldb/source/Symbol/CompilerType.cpp head/contrib/llvm/tools/lldb/source/Symbol/DWARFCallFrameInfo.cpp head/contrib/llvm/tools/lldb/source/Symbol/JavaASTContext.cpp head/contrib/llvm/tools/lldb/source/Symbol/ObjectFile.cpp head/contrib/llvm/tools/lldb/source/Symbol/Symtab.cpp head/contrib/llvm/tools/lldb/source/Symbol/Type.cpp head/contrib/llvm/tools/lldb/source/Symbol/TypeSystem.cpp head/contrib/llvm/tools/lldb/source/Symbol/Variable.cpp head/contrib/llvm/tools/lldb/source/Target/PathMappingList.cpp head/contrib/llvm/tools/lldb/source/Target/Platform.cpp head/contrib/llvm/tools/lldb/source/Target/Process.cpp head/contrib/llvm/tools/lldb/source/Target/ProcessLaunchInfo.cpp head/contrib/llvm/tools/lldb/source/Target/RegisterContext.cpp head/contrib/llvm/tools/lldb/source/Target/StackFrame.cpp head/contrib/llvm/tools/lldb/source/Target/StopInfo.cpp head/contrib/llvm/tools/lldb/source/Target/Target.cpp head/contrib/llvm/tools/lldb/source/Target/Thread.cpp head/contrib/llvm/tools/lldb/source/Target/ThreadPlanStepInRange.cpp head/contrib/llvm/tools/lldb/source/Target/ThreadPlanTracer.cpp head/contrib/llvm/tools/lldb/source/Target/UnixSignals.cpp head/contrib/llvm/tools/lldb/source/Utility/DataBufferLLVM.cpp head/contrib/llvm/tools/lldb/source/Utility/DataEncoder.cpp head/contrib/llvm/tools/lldb/source/Utility/DataExtractor.cpp head/contrib/llvm/tools/lldb/source/Utility/FileSpec.cpp head/contrib/llvm/tools/lldb/source/Utility/JSON.cpp head/contrib/llvm/tools/lldb/source/Utility/Log.cpp head/contrib/llvm/tools/lldb/source/Utility/Logging.cpp head/contrib/llvm/tools/lldb/source/Utility/SelectHelper.cpp head/contrib/llvm/tools/lldb/source/Utility/Status.cpp head/contrib/llvm/tools/lldb/source/Utility/StringExtractorGDBRemote.cpp head/contrib/llvm/tools/lldb/source/Utility/StructuredData.cpp head/contrib/llvm/tools/lldb/source/Utility/UUID.cpp head/contrib/llvm/tools/lldb/source/Utility/UriParser.cpp head/contrib/llvm/tools/lldb/source/lldb.cpp head/contrib/llvm/tools/lldb/tools/driver/Driver.cpp head/contrib/llvm/tools/lldb/tools/lldb-mi/MICmdCmdVar.cpp head/contrib/llvm/tools/lldb/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp head/contrib/llvm/tools/lldb/tools/lldb-mi/MIDriverMain.cpp head/contrib/llvm/tools/lldb/tools/lldb-mi/MIUtilString.cpp head/contrib/llvm/tools/lldb/tools/lldb-server/lldb-gdbserver.cpp head/contrib/llvm/tools/lli/OrcLazyJIT.h head/contrib/llvm/tools/lli/lli.cpp head/contrib/llvm/tools/llvm-ar/llvm-ar.cpp head/contrib/llvm/tools/llvm-as/llvm-as.cpp head/contrib/llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp head/contrib/llvm/tools/llvm-cov/CodeCoverage.cpp head/contrib/llvm/tools/llvm-cov/CoverageExporterJson.cpp head/contrib/llvm/tools/llvm-cov/CoverageFilters.cpp head/contrib/llvm/tools/llvm-cov/CoverageFilters.h head/contrib/llvm/tools/llvm-cov/CoverageReport.cpp head/contrib/llvm/tools/llvm-cov/CoverageReport.h head/contrib/llvm/tools/llvm-cov/CoverageSummaryInfo.cpp head/contrib/llvm/tools/llvm-cov/CoverageSummaryInfo.h head/contrib/llvm/tools/llvm-cov/CoverageViewOptions.h head/contrib/llvm/tools/llvm-cov/SourceCoverageView.cpp head/contrib/llvm/tools/llvm-cov/SourceCoverageView.h head/contrib/llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp head/contrib/llvm/tools/llvm-cov/SourceCoverageViewHTML.h head/contrib/llvm/tools/llvm-cov/SourceCoverageViewText.cpp head/contrib/llvm/tools/llvm-cov/SourceCoverageViewText.h head/contrib/llvm/tools/llvm-cov/gcov.cpp head/contrib/llvm/tools/llvm-cxxdump/llvm-cxxdump.cpp head/contrib/llvm/tools/llvm-cxxfilt/llvm-cxxfilt.cpp head/contrib/llvm/tools/llvm-diff/DiffConsumer.cpp head/contrib/llvm/tools/llvm-diff/DiffLog.cpp head/contrib/llvm/tools/llvm-dis/llvm-dis.cpp head/contrib/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp head/contrib/llvm/tools/llvm-extract/llvm-extract.cpp head/contrib/llvm/tools/llvm-link/llvm-link.cpp head/contrib/llvm/tools/llvm-lto/llvm-lto.cpp head/contrib/llvm/tools/llvm-lto2/llvm-lto2.cpp head/contrib/llvm/tools/llvm-mc/llvm-mc.cpp head/contrib/llvm/tools/llvm-modextract/llvm-modextract.cpp head/contrib/llvm/tools/llvm-nm/llvm-nm.cpp head/contrib/llvm/tools/llvm-objdump/COFFDump.cpp head/contrib/llvm/tools/llvm-objdump/MachODump.cpp head/contrib/llvm/tools/llvm-objdump/llvm-objdump.cpp head/contrib/llvm/tools/llvm-pdbutil/BytesOutputStyle.cpp head/contrib/llvm/tools/llvm-pdbutil/BytesOutputStyle.h head/contrib/llvm/tools/llvm-pdbutil/Diff.cpp head/contrib/llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp head/contrib/llvm/tools/llvm-pdbutil/DumpOutputStyle.h head/contrib/llvm/tools/llvm-pdbutil/FormatUtil.cpp head/contrib/llvm/tools/llvm-pdbutil/FormatUtil.h head/contrib/llvm/tools/llvm-pdbutil/LinePrinter.cpp head/contrib/llvm/tools/llvm-pdbutil/LinePrinter.h head/contrib/llvm/tools/llvm-pdbutil/MinimalSymbolDumper.cpp head/contrib/llvm/tools/llvm-pdbutil/MinimalSymbolDumper.h head/contrib/llvm/tools/llvm-pdbutil/MinimalTypeDumper.cpp head/contrib/llvm/tools/llvm-pdbutil/PdbYaml.cpp head/contrib/llvm/tools/llvm-pdbutil/PrettyBuiltinDumper.cpp head/contrib/llvm/tools/llvm-pdbutil/PrettyEnumDumper.cpp head/contrib/llvm/tools/llvm-pdbutil/PrettyFunctionDumper.cpp head/contrib/llvm/tools/llvm-pdbutil/PrettyTypedefDumper.cpp head/contrib/llvm/tools/llvm-pdbutil/StreamUtil.cpp head/contrib/llvm/tools/llvm-pdbutil/StreamUtil.h head/contrib/llvm/tools/llvm-pdbutil/YAMLOutputStyle.cpp head/contrib/llvm/tools/llvm-pdbutil/llvm-pdbutil.cpp head/contrib/llvm/tools/llvm-pdbutil/llvm-pdbutil.h head/contrib/llvm/tools/llvm-profdata/llvm-profdata.cpp head/contrib/llvm/tools/llvm-readobj/ARMEHABIPrinter.h head/contrib/llvm/tools/llvm-readobj/COFFDumper.cpp head/contrib/llvm/tools/llvm-readobj/COFFImportDumper.cpp head/contrib/llvm/tools/llvm-readobj/ELFDumper.cpp head/contrib/llvm/tools/llvm-readobj/ObjDumper.h head/contrib/llvm/tools/llvm-readobj/WasmDumper.cpp head/contrib/llvm/tools/llvm-readobj/llvm-readobj.cpp head/contrib/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp head/contrib/llvm/tools/llvm-stress/llvm-stress.cpp head/contrib/llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp head/contrib/llvm/tools/llvm-xray/llvm-xray.cc head/contrib/llvm/tools/llvm-xray/xray-account.cc head/contrib/llvm/tools/llvm-xray/xray-color-helper.cc head/contrib/llvm/tools/llvm-xray/xray-converter.cc head/contrib/llvm/tools/llvm-xray/xray-converter.h head/contrib/llvm/tools/llvm-xray/xray-extract.cc head/contrib/llvm/tools/llvm-xray/xray-graph.cc head/contrib/llvm/tools/opt/NewPMDriver.cpp head/contrib/llvm/tools/opt/NewPMDriver.h head/contrib/llvm/tools/opt/PassPrinters.cpp head/contrib/llvm/tools/opt/PassPrinters.h head/contrib/llvm/tools/opt/opt.cpp head/contrib/llvm/utils/TableGen/AsmMatcherEmitter.cpp head/contrib/llvm/utils/TableGen/AsmWriterEmitter.cpp head/contrib/llvm/utils/TableGen/Attributes.cpp head/contrib/llvm/utils/TableGen/CallingConvEmitter.cpp head/contrib/llvm/utils/TableGen/CodeGenDAGPatterns.cpp head/contrib/llvm/utils/TableGen/CodeGenDAGPatterns.h head/contrib/llvm/utils/TableGen/CodeGenInstruction.cpp head/contrib/llvm/utils/TableGen/CodeGenInstruction.h head/contrib/llvm/utils/TableGen/CodeGenIntrinsics.h head/contrib/llvm/utils/TableGen/CodeGenRegisters.cpp head/contrib/llvm/utils/TableGen/CodeGenRegisters.h head/contrib/llvm/utils/TableGen/CodeGenSchedule.cpp head/contrib/llvm/utils/TableGen/CodeGenSchedule.h head/contrib/llvm/utils/TableGen/CodeGenTarget.cpp head/contrib/llvm/utils/TableGen/CodeGenTarget.h head/contrib/llvm/utils/TableGen/DAGISelEmitter.cpp head/contrib/llvm/utils/TableGen/DAGISelMatcher.cpp head/contrib/llvm/utils/TableGen/DAGISelMatcherEmitter.cpp head/contrib/llvm/utils/TableGen/DAGISelMatcherGen.cpp head/contrib/llvm/utils/TableGen/DFAPacketizerEmitter.cpp head/contrib/llvm/utils/TableGen/FastISelEmitter.cpp head/contrib/llvm/utils/TableGen/GlobalISelEmitter.cpp head/contrib/llvm/utils/TableGen/InstrInfoEmitter.cpp head/contrib/llvm/utils/TableGen/IntrinsicEmitter.cpp head/contrib/llvm/utils/TableGen/OptParserEmitter.cpp head/contrib/llvm/utils/TableGen/RegisterBankEmitter.cpp head/contrib/llvm/utils/TableGen/RegisterInfoEmitter.cpp head/contrib/llvm/utils/TableGen/SearchableTableEmitter.cpp head/contrib/llvm/utils/TableGen/SequenceToOffsetTable.h head/contrib/llvm/utils/TableGen/SubtargetEmitter.cpp head/contrib/llvm/utils/TableGen/TableGen.cpp head/contrib/llvm/utils/TableGen/TableGenBackends.h head/contrib/llvm/utils/TableGen/X86DisassemblerTables.cpp head/contrib/llvm/utils/TableGen/X86DisassemblerTables.h head/contrib/llvm/utils/TableGen/X86EVEX2VEXTablesEmitter.cpp head/contrib/llvm/utils/TableGen/X86RecognizableInstr.cpp head/contrib/llvm/utils/TableGen/X86RecognizableInstr.h head/etc/mtree/BSD.debug.dist head/etc/mtree/BSD.usr.dist head/lib/clang/freebsd_cc_version.h head/lib/clang/headers/Makefile head/lib/clang/include/clang/Basic/Version.inc head/lib/clang/include/clang/Config/config.h head/lib/clang/include/lldb/Host/Config.h head/lib/clang/include/llvm/Config/config.h head/lib/clang/include/llvm/Config/llvm-config.h head/lib/clang/include/llvm/Support/VCSRevision.h head/lib/clang/libclang/Makefile head/lib/clang/liblldb/Makefile head/lib/clang/libllvm/Makefile head/lib/clang/libllvmminimal/Makefile head/lib/libclang_rt/Makefile head/lib/libclang_rt/Makefile.inc head/lib/libclang_rt/asan/Makefile head/lib/libclang_rt/asan_cxx/Makefile head/lib/libclang_rt/asan_dynamic/Makefile head/lib/libclang_rt/include/Makefile head/lib/libclang_rt/profile/Makefile head/lib/libclang_rt/safestack/Makefile head/lib/libclang_rt/stats/Makefile head/lib/libclang_rt/ubsan_standalone/Makefile head/lib/libclang_rt/ubsan_standalone_cxx/Makefile head/sys/crypto/via/padlock_cipher.c head/sys/sys/param.h head/tools/build/mk/OptionalObsoleteFiles.inc head/usr.bin/clang/Makefile head/usr.bin/clang/bugpoint/bugpoint.1 head/usr.bin/clang/clang-tblgen/Makefile head/usr.bin/clang/clang/clang.1 head/usr.bin/clang/llc/llc.1 head/usr.bin/clang/lld/Makefile head/usr.bin/clang/lli/lli.1 head/usr.bin/clang/llvm-ar/llvm-ar.1 head/usr.bin/clang/llvm-as/Makefile head/usr.bin/clang/llvm-as/llvm-as.1 head/usr.bin/clang/llvm-bcanalyzer/Makefile head/usr.bin/clang/llvm-bcanalyzer/llvm-bcanalyzer.1 head/usr.bin/clang/llvm-cov/llvm-cov.1 head/usr.bin/clang/llvm-cxxdump/Makefile head/usr.bin/clang/llvm-cxxfilt/Makefile head/usr.bin/clang/llvm-diff/Makefile head/usr.bin/clang/llvm-diff/llvm-diff.1 head/usr.bin/clang/llvm-dis/llvm-dis.1 head/usr.bin/clang/llvm-dwarfdump/Makefile head/usr.bin/clang/llvm-dwarfdump/llvm-dwarfdump.1 head/usr.bin/clang/llvm-extract/llvm-extract.1 head/usr.bin/clang/llvm-link/Makefile head/usr.bin/clang/llvm-link/llvm-link.1 head/usr.bin/clang/llvm-modextract/Makefile head/usr.bin/clang/llvm-nm/llvm-nm.1 head/usr.bin/clang/llvm-pdbutil/Makefile head/usr.bin/clang/llvm-profdata/llvm-profdata.1 head/usr.bin/clang/llvm-symbolizer/llvm-symbolizer.1 head/usr.bin/clang/llvm-tblgen/Makefile head/usr.bin/clang/opt/opt.1 head/usr.sbin/acpi/acpidb/Makefile Directory Properties: head/ (props changed) head/cddl/ (props changed) head/cddl/contrib/opensolaris/ (props changed) head/contrib/binutils/ (props changed) head/contrib/compiler-rt/ (props changed) head/contrib/elftoolchain/ (props changed) head/contrib/gcc/ (props changed) head/contrib/libc++/ (props changed) head/contrib/llvm/ (props changed) head/contrib/llvm/tools/clang/ (props changed) head/contrib/llvm/tools/lld/ (props changed) head/contrib/llvm/tools/lldb/ (props changed) head/contrib/subversion/ (props changed) head/lib/libedit/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) head/sys/contrib/dev/acpica/ (props changed) head/sys/contrib/ipfilter/ (props changed) head/sys/contrib/zstd/ (props changed) Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sat Jan 13 23:31:21 2018 (r327951) +++ head/ObsoleteFiles.inc Sun Jan 14 00:08:34 2018 (r327952) @@ -38,6 +38,123 @@ # xargs -n1 | sort | uniq -d; # done +# 20180114: new clang import which bumps version from 5.0.1 to 6.0.0. +OLD_FILES+=usr/lib/clang/5.0.1/include/sanitizer/allocator_interface.h +OLD_FILES+=usr/lib/clang/5.0.1/include/sanitizer/asan_interface.h +OLD_FILES+=usr/lib/clang/5.0.1/include/sanitizer/common_interface_defs.h +OLD_FILES+=usr/lib/clang/5.0.1/include/sanitizer/coverage_interface.h +OLD_FILES+=usr/lib/clang/5.0.1/include/sanitizer/dfsan_interface.h +OLD_FILES+=usr/lib/clang/5.0.1/include/sanitizer/esan_interface.h +OLD_FILES+=usr/lib/clang/5.0.1/include/sanitizer/linux_syscall_hooks.h +OLD_FILES+=usr/lib/clang/5.0.1/include/sanitizer/lsan_interface.h +OLD_FILES+=usr/lib/clang/5.0.1/include/sanitizer/msan_interface.h +OLD_FILES+=usr/lib/clang/5.0.1/include/sanitizer/tsan_interface.h +OLD_FILES+=usr/lib/clang/5.0.1/include/sanitizer/tsan_interface_atomic.h +OLD_DIRS+=usr/lib/clang/5.0.1/include/sanitizer +OLD_FILES+=usr/lib/clang/5.0.1/include/__clang_cuda_builtin_vars.h +OLD_FILES+=usr/lib/clang/5.0.1/include/__clang_cuda_cmath.h +OLD_FILES+=usr/lib/clang/5.0.1/include/__clang_cuda_complex_builtins.h +OLD_FILES+=usr/lib/clang/5.0.1/include/__clang_cuda_intrinsics.h +OLD_FILES+=usr/lib/clang/5.0.1/include/__clang_cuda_math_forward_declares.h +OLD_FILES+=usr/lib/clang/5.0.1/include/__clang_cuda_runtime_wrapper.h +OLD_FILES+=usr/lib/clang/5.0.1/include/__stddef_max_align_t.h +OLD_FILES+=usr/lib/clang/5.0.1/include/__wmmintrin_aes.h +OLD_FILES+=usr/lib/clang/5.0.1/include/__wmmintrin_pclmul.h +OLD_FILES+=usr/lib/clang/5.0.1/include/adxintrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/altivec.h +OLD_FILES+=usr/lib/clang/5.0.1/include/ammintrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/arm_acle.h +OLD_FILES+=usr/lib/clang/5.0.1/include/arm_neon.h +OLD_FILES+=usr/lib/clang/5.0.1/include/armintr.h +OLD_FILES+=usr/lib/clang/5.0.1/include/avx2intrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/avx512bwintrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/avx512cdintrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/avx512dqintrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/avx512erintrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/avx512fintrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/avx512ifmaintrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/avx512ifmavlintrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/avx512pfintrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/avx512vbmiintrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/avx512vbmivlintrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/avx512vlbwintrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/avx512vlcdintrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/avx512vldqintrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/avx512vlintrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/avx512vpopcntdqintrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/avxintrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/bmi2intrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/bmiintrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/clflushoptintrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/clzerointrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/cpuid.h +OLD_FILES+=usr/lib/clang/5.0.1/include/emmintrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/f16cintrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/fma4intrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/fmaintrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/fxsrintrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/htmintrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/htmxlintrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/ia32intrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/immintrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/lwpintrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/lzcntintrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/mm3dnow.h +OLD_FILES+=usr/lib/clang/5.0.1/include/mm_malloc.h +OLD_FILES+=usr/lib/clang/5.0.1/include/mmintrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/module.modulemap +OLD_FILES+=usr/lib/clang/5.0.1/include/msa.h +OLD_FILES+=usr/lib/clang/5.0.1/include/mwaitxintrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/nmmintrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/opencl-c.h +OLD_FILES+=usr/lib/clang/5.0.1/include/pkuintrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/pmmintrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/popcntintrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/prfchwintrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/rdseedintrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/rtmintrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/s390intrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/shaintrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/smmintrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/tbmintrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/tmmintrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/vadefs.h +OLD_FILES+=usr/lib/clang/5.0.1/include/vecintrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/wmmintrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/x86intrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/xmmintrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/xopintrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/xsavecintrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/xsaveintrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/xsaveoptintrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/xsavesintrin.h +OLD_FILES+=usr/lib/clang/5.0.1/include/xtestintrin.h +OLD_DIRS+=usr/lib/clang/5.0.1/include +OLD_FILES+=usr/lib/clang/5.0.1/lib/freebsd/libclang_rt.asan-i386.a +OLD_FILES+=usr/lib/clang/5.0.1/lib/freebsd/libclang_rt.asan-i386.so +OLD_FILES+=usr/lib/clang/5.0.1/lib/freebsd/libclang_rt.asan-preinit-i386.a +OLD_FILES+=usr/lib/clang/5.0.1/lib/freebsd/libclang_rt.asan-preinit-x86_64.a +OLD_FILES+=usr/lib/clang/5.0.1/lib/freebsd/libclang_rt.asan-x86_64.a +OLD_FILES+=usr/lib/clang/5.0.1/lib/freebsd/libclang_rt.asan-x86_64.so +OLD_FILES+=usr/lib/clang/5.0.1/lib/freebsd/libclang_rt.asan_cxx-i386.a +OLD_FILES+=usr/lib/clang/5.0.1/lib/freebsd/libclang_rt.asan_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/5.0.1/lib/freebsd/libclang_rt.profile-arm.a +OLD_FILES+=usr/lib/clang/5.0.1/lib/freebsd/libclang_rt.profile-armhf.a +OLD_FILES+=usr/lib/clang/5.0.1/lib/freebsd/libclang_rt.profile-i386.a +OLD_FILES+=usr/lib/clang/5.0.1/lib/freebsd/libclang_rt.profile-x86_64.a +OLD_FILES+=usr/lib/clang/5.0.1/lib/freebsd/libclang_rt.safestack-i386.a +OLD_FILES+=usr/lib/clang/5.0.1/lib/freebsd/libclang_rt.safestack-x86_64.a +OLD_FILES+=usr/lib/clang/5.0.1/lib/freebsd/libclang_rt.stats-i386.a +OLD_FILES+=usr/lib/clang/5.0.1/lib/freebsd/libclang_rt.stats-x86_64.a +OLD_FILES+=usr/lib/clang/5.0.1/lib/freebsd/libclang_rt.stats_client-i386.a +OLD_FILES+=usr/lib/clang/5.0.1/lib/freebsd/libclang_rt.stats_client-x86_64.a +OLD_FILES+=usr/lib/clang/5.0.1/lib/freebsd/libclang_rt.ubsan_standalone-i386.a +OLD_FILES+=usr/lib/clang/5.0.1/lib/freebsd/libclang_rt.ubsan_standalone-x86_64.a +OLD_FILES+=usr/lib/clang/5.0.1/lib/freebsd/libclang_rt.ubsan_standalone_cxx-i386.a +OLD_FILES+=usr/lib/clang/5.0.1/lib/freebsd/libclang_rt.ubsan_standalone_cxx-x86_64.a +OLD_DIRS+=usr/lib/clang/5.0.1/lib/freebsd +OLD_DIRS+=usr/lib/clang/5.0.1/lib +OLD_DIRS+=usr/lib/clang/5.0.1 # 20180109: Remove vestiges of digi(4) driver OLD_FILES+=usr/include/sys/digiio.h OLD_FILES+=usr/sbin/digictl Modified: head/UPDATING ============================================================================== --- head/UPDATING Sat Jan 13 23:31:21 2018 (r327951) +++ head/UPDATING Sun Jan 14 00:08:34 2018 (r327952) @@ -51,6 +51,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: ****************************** SPECIAL WARNING: ****************************** +20180114: + Clang, llvm, lld, lldb, compiler-rt and libc++ have been upgraded to + 6.0.0. Please see the 20141231 entry below for information about + prerequisites and upgrading, if you are not already using clang 3.5.0 + or higher. + 20180110: LLVM's lld linker is now used as the FreeBSD/amd64 bootstrap linker. This means it is used to link the kernel and userland libraries and Modified: head/contrib/compiler-rt/include/sanitizer/allocator_interface.h ============================================================================== --- head/contrib/compiler-rt/include/sanitizer/allocator_interface.h Sat Jan 13 23:31:21 2018 (r327951) +++ head/contrib/compiler-rt/include/sanitizer/allocator_interface.h Sun Jan 14 00:08:34 2018 (r327952) @@ -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 @@ -75,6 +75,13 @@ extern "C" { int __sanitizer_install_malloc_and_free_hooks( void (*malloc_hook)(const volatile void *, size_t), void (*free_hook)(const volatile void *)); + + /* Drains allocator quarantines (calling thread's and global ones), returns + freed memory back to OS and releases other non-essential internal allocator + resources in attempt to reduce process RSS. + Currently available with ASan only. + */ + void __sanitizer_purge_allocator(void); #ifdef __cplusplus } // extern "C" Modified: head/contrib/compiler-rt/include/sanitizer/asan_interface.h ============================================================================== --- head/contrib/compiler-rt/include/sanitizer/asan_interface.h Sat Jan 13 23:31:21 2018 (r327951) +++ head/contrib/compiler-rt/include/sanitizer/asan_interface.h Sun Jan 14 00:08:34 2018 (r327952) @@ -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 @@ -143,6 +143,10 @@ extern "C" { // fake_stack, but the owner thread need to be alive. void *__asan_addr_is_in_fake_stack(void *fake_stack, void *addr, void **beg, void **end); + + // Performs cleanup before a [[noreturn]] function. Must be called + // before things like _exit and execl to avoid false positives on stack. + void __asan_handle_no_return(void); #ifdef __cplusplus } // extern "C" Modified: head/contrib/compiler-rt/include/sanitizer/common_interface_defs.h ============================================================================== --- head/contrib/compiler-rt/include/sanitizer/common_interface_defs.h Sat Jan 13 23:31:21 2018 (r327951) +++ head/contrib/compiler-rt/include/sanitizer/common_interface_defs.h Sun Jan 14 00:08:34 2018 (r327952) @@ -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: head/contrib/compiler-rt/include/sanitizer/coverage_interface.h ============================================================================== --- head/contrib/compiler-rt/include/sanitizer/coverage_interface.h Sat Jan 13 23:31:21 2018 (r327951) +++ head/contrib/compiler-rt/include/sanitizer/coverage_interface.h Sun Jan 14 00:08:34 2018 (r327952) @@ -20,10 +20,13 @@ extern "C" { #endif // Record and dump coverage info. - void __sanitizer_cov_dump(); + void __sanitizer_cov_dump(void); - // Dump collected coverage info. Sorts pcs by module into individual - // .sancov files. + // Clear collected coverage info. + void __sanitizer_cov_reset(void); + + // Dump collected coverage info. Sorts pcs by module into individual .sancov + // files. void __sanitizer_dump_coverage(const uintptr_t *pcs, uintptr_t len); #ifdef __cplusplus Modified: head/contrib/compiler-rt/include/sanitizer/esan_interface.h ============================================================================== --- head/contrib/compiler-rt/include/sanitizer/esan_interface.h Sat Jan 13 23:31:21 2018 (r327951) +++ head/contrib/compiler-rt/include/sanitizer/esan_interface.h Sun Jan 14 00:08:34 2018 (r327952) @@ -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" Copied: head/contrib/compiler-rt/include/sanitizer/hwasan_interface.h (from r327933, projects/clang600-import/contrib/compiler-rt/include/sanitizer/hwasan_interface.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/compiler-rt/include/sanitizer/hwasan_interface.h Sun Jan 14 00:08:34 2018 (r327952, copy of r327933, projects/clang600-import/contrib/compiler-rt/include/sanitizer/hwasan_interface.h) @@ -0,0 +1,33 @@ +//===-- sanitizer/asan_interface.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 HWAddressSanitizer. +// +// Public interface header. +//===----------------------------------------------------------------------===// +#ifndef SANITIZER_HWASAN_INTERFACE_H +#define SANITIZER_HWASAN_INTERFACE_H + +#include + +#ifdef __cplusplus +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(void); + + void __hwasan_enable_allocator_tagging(void); + void __hwasan_disable_allocator_tagging(void); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // SANITIZER_HWASAN_INTERFACE_H Modified: head/contrib/compiler-rt/include/sanitizer/lsan_interface.h ============================================================================== --- head/contrib/compiler-rt/include/sanitizer/lsan_interface.h Sat Jan 13 23:31:21 2018 (r327951) +++ head/contrib/compiler-rt/include/sanitizer/lsan_interface.h Sun Jan 14 00:08:34 2018 (r327952) @@ -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,17 +58,23 @@ 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 // function must be defined as returning a constant value; any behavior beyond // that is unsupported. - int __lsan_is_turned_off(); + // To avoid dead stripping, you may need to define this function with + // __attribute__((used)) + 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(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: head/contrib/compiler-rt/include/sanitizer/msan_interface.h ============================================================================== --- head/contrib/compiler-rt/include/sanitizer/msan_interface.h Sat Jan 13 23:31:21 2018 (r327951) +++ head/contrib/compiler-rt/include/sanitizer/msan_interface.h Sun Jan 14 00:08:34 2018 (r327952) @@ -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)); Copied: head/contrib/compiler-rt/include/sanitizer/scudo_interface.h (from r327933, projects/clang600-import/contrib/compiler-rt/include/sanitizer/scudo_interface.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/compiler-rt/include/sanitizer/scudo_interface.h Sun Jan 14 00:08:34 2018 (r327952, copy of r327933, projects/clang600-import/contrib/compiler-rt/include/sanitizer/scudo_interface.h) @@ -0,0 +1,34 @@ +//===-- sanitizer/scudo_interface.h -----------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +/// Public Scudo interface header. +// +//===----------------------------------------------------------------------===// +#ifndef SANITIZER_SCUDO_INTERFACE_H_ +#define SANITIZER_SCUDO_INTERFACE_H_ + +#include + +#ifdef __cplusplus +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(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 + // can be removed by setting LimitMb to 0. This function's parameters should + // be fully trusted to avoid security mishaps. + void __scudo_set_rss_limit(unsigned long LimitMb, int HardLimit); +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // SANITIZER_SCUDO_INTERFACE_H_ Modified: head/contrib/compiler-rt/include/sanitizer/tsan_interface.h ============================================================================== --- head/contrib/compiler-rt/include/sanitizer/tsan_interface.h Sat Jan 13 23:31:21 2018 (r327951) +++ head/contrib/compiler-rt/include/sanitizer/tsan_interface.h Sun Jan 14 00:08:34 2018 (r327952) @@ -44,6 +44,11 @@ const unsigned __tsan_mutex_linker_init = 1 << 0; const unsigned __tsan_mutex_write_reentrant = 1 << 1; // Mutex is read reentrant. const unsigned __tsan_mutex_read_reentrant = 1 << 2; +// Mutex does not have static storage duration, and must not be used after +// its destructor runs. The opposite of __tsan_mutex_linker_init. +// If this flag is passed to __tsan_mutex_destroy, then the destruction +// is ignored unless this flag was previously set on the mutex. +const unsigned __tsan_mutex_not_static = 1 << 8; // Mutex operation flags: @@ -70,6 +75,7 @@ void __tsan_mutex_create(void *addr, unsigned flags); // Annotate destruction of a mutex. // Supported flags: // - __tsan_mutex_linker_init +// - __tsan_mutex_not_static void __tsan_mutex_destroy(void *addr, unsigned flags); // Annotate start of lock operation. Modified: head/contrib/compiler-rt/include/xray/xray_interface.h ============================================================================== --- head/contrib/compiler-rt/include/xray/xray_interface.h Sat Jan 13 23:31:21 2018 (r327951) +++ head/contrib/compiler-rt/include/xray/xray_interface.h Sun Jan 14 00:08:34 2018 (r327952) @@ -106,6 +106,14 @@ extern uintptr_t __xray_function_address(int32_t FuncI /// encounter errors (when there are no instrumented functions, etc.). extern size_t __xray_max_function_id(); +/// Initialize the required XRay data structures. This is useful in cases where +/// users want to control precisely when the XRay instrumentation data +/// structures are initialized, for example when the XRay library is built with +/// the XRAY_NO_PREINIT preprocessor definition. +/// +/// Calling __xray_init() more than once is safe across multiple threads. +extern void __xray_init(); + } // end extern "C" #endif // XRAY_XRAY_INTERFACE_H Modified: head/contrib/compiler-rt/include/xray/xray_log_interface.h ============================================================================== --- head/contrib/compiler-rt/include/xray/xray_log_interface.h Sat Jan 13 23:31:21 2018 (r327951) +++ head/contrib/compiler-rt/include/xray/xray_log_interface.h Sun Jan 14 00:08:34 2018 (r327952) @@ -128,6 +128,16 @@ enum XRayLogFlushStatus { XRAY_LOG_FLUSHED = 2, }; +/// This enum indicates the installation state of a logging implementation, when +/// associating a mode to a particular logging implementation through +/// `__xray_log_register_impl(...)` or through `__xray_log_select_mode(...`. +enum XRayLogRegisterStatus { + XRAY_REGISTRATION_OK = 0, + XRAY_DUPLICATE_MODE = 1, + XRAY_MODE_NOT_FOUND = 2, + XRAY_INCOMPLETE_IMPL = 3, +}; + /// A valid XRay logging implementation MUST provide all of the function /// pointers in XRayLogImpl when being installed through `__xray_set_log_impl`. /// To be precise, ALL the functions pointers MUST NOT be nullptr. @@ -159,6 +169,9 @@ struct XRayLogImpl { /// always have a handler for function entry and exit events. In case the /// implementation wants to support arg1 (or other future extensions to XRay /// logging) those MUST be installed by the installed 'log_init' handler. + /// + /// Because we didn't want to change the ABI of this struct, the arg1 handler + /// may be silently overwritten during initialization as well. void (*handle_arg0)(int32_t, XRayEntryType); /// The log implementation provided routine for when __xray_log_flushLog() is @@ -186,6 +199,34 @@ struct XRayLogImpl { /// called while in any other states. void __xray_set_log_impl(XRayLogImpl Impl); +/// This function registers a logging implementation against a "mode" +/// identifier. This allows multiple modes to be registered, and chosen at +/// runtime using the same mode identifier through +/// `__xray_log_select_mode(...)`. +/// +/// We treat the Mode identifier as a null-terminated byte string, as the +/// identifier used when retrieving the log impl. +/// +/// Returns: +/// - XRAY_REGISTRATION_OK on success. +/// - XRAY_DUPLICATE_MODE when an implementation is already associated with +/// the provided Mode; does not update the already-registered +/// implementation. +XRayLogRegisterStatus __xray_log_register_mode(const char *Mode, + XRayLogImpl Impl); + +/// This function selects the implementation associated with Mode that has been +/// registered through __xray_log_register_mode(...) and installs that +/// implementation (as if through calling __xray_set_log_impl(...)). The same +/// caveats apply to __xray_log_select_mode(...) as with +/// __xray_log_set_log_impl(...). +/// +/// Returns: +/// - XRAY_REGISTRATION_OK on success. +/// - XRAY_MODE_NOT_FOUND if there is no implementation associated with Mode; +/// does not update the currently installed implementation. +XRayLogRegisterStatus __xray_log_select_mode(const char *Mode); + /// This function removes the currently installed implementation. It will also /// uninstall any handlers that have been previously installed. It does NOT /// unpatch the instrumentation sleds. @@ -220,10 +261,17 @@ XRayLogFlushStatus __xray_log_flushLog(); namespace __xray { -// Options used by the LLVM XRay FDR implementation. +/// Options used by the LLVM XRay FDR logging implementation. struct FDRLoggingOptions { bool ReportErrors = false; int Fd = -1; +}; + +/// Options used by the LLVM XRay Basic (Naive) logging implementation. +struct BasicLoggingOptions { + int DurationFilterMicros = 0; + size_t MaxStackDepth = 0; + size_t ThreadBufferSize = 0; }; } // namespace __xray Modified: head/contrib/compiler-rt/include/xray/xray_records.h ============================================================================== --- head/contrib/compiler-rt/include/xray/xray_records.h Sat Jan 13 23:31:21 2018 (r327951) +++ head/contrib/compiler-rt/include/xray/xray_records.h Sun Jan 14 00:08:34 2018 (r327952) @@ -17,6 +17,8 @@ #ifndef XRAY_XRAY_RECORDS_H #define XRAY_XRAY_RECORDS_H +#include + namespace __xray { enum FileTypes { @@ -65,18 +67,23 @@ static_assert(sizeof(XRayFileHeader) == 32, "XRayFileH enum RecordTypes { NORMAL = 0, + ARG_PAYLOAD = 1, }; struct alignas(32) XRayRecord { // This is the type of the record being written. We use 16 bits to allow us to // treat this as a discriminant, and so that the first 4 bytes get packed // properly. See RecordTypes for more supported types. - uint16_t RecordType = 0; + uint16_t RecordType = RecordTypes::NORMAL; // The CPU where the thread is running. We assume number of CPUs <= 256. uint8_t CPU = 0; - // The type of the event. Usually either ENTER = 0 or EXIT = 1. + // The type of the event. One of the following: + // ENTER = 0 + // EXIT = 1 + // TAIL_EXIT = 2 + // ENTER_ARG = 3 uint8_t Type = 0; // The function ID for the record. @@ -93,6 +100,32 @@ struct alignas(32) XRayRecord { } __attribute__((packed)); static_assert(sizeof(XRayRecord) == 32, "XRayRecord != 32 bytes"); + +struct alignas(32) XRayArgPayload { + // We use the same 16 bits as a discriminant for the records in the log here + // too, and so that the first 4 bytes are packed properly. + uint16_t RecordType = RecordTypes::ARG_PAYLOAD; + + // Add a few bytes to pad. + uint8_t Padding[2] = {}; + + // The function ID for the record. + int32_t FuncId = 0; + + // The thread ID for the currently running thread. + uint32_t TId = 0; + + // Add more padding. + uint8_t Padding2[4] = {}; + + // The argument payload. + uint64_t Arg = 0; + + // The rest of this record ought to be left as padding. + uint8_t TailPadding[8] = {}; +} __attribute__((packed)); + +static_assert(sizeof(XRayArgPayload) == 32, "XRayArgPayload != 32 bytes"); } // namespace __xray Modified: head/contrib/compiler-rt/lib/BlocksRuntime/Block.h ============================================================================== --- head/contrib/compiler-rt/lib/BlocksRuntime/Block.h Sat Jan 13 23:31:21 2018 (r327951) +++ head/contrib/compiler-rt/lib/BlocksRuntime/Block.h Sun Jan 14 00:08:34 2018 (r327952) @@ -27,7 +27,7 @@ #if !defined(BLOCK_EXPORT) # if defined(__cplusplus) -# define BLOCK_EXPORT extern "C" +# define BLOCK_EXPORT extern "C" # else # define BLOCK_EXPORT extern # endif Modified: head/contrib/compiler-rt/lib/BlocksRuntime/Block_private.h ============================================================================== --- head/contrib/compiler-rt/lib/BlocksRuntime/Block_private.h Sat Jan 13 23:31:21 2018 (r327951) +++ head/contrib/compiler-rt/lib/BlocksRuntime/Block_private.h Sun Jan 14 00:08:34 2018 (r327952) @@ -27,7 +27,7 @@ #if !defined(BLOCK_EXPORT) # if defined(__cplusplus) -# define BLOCK_EXPORT extern "C" +# define BLOCK_EXPORT extern "C" # else # define BLOCK_EXPORT extern # endif Modified: head/contrib/compiler-rt/lib/asan/asan_activation.cc ============================================================================== --- head/contrib/compiler-rt/lib/asan/asan_activation.cc Sat Jan 13 23:31:21 2018 (r327951) +++ head/contrib/compiler-rt/lib/asan/asan_activation.cc Sun Jan 14 00:08:34 2018 (r327952) @@ -16,8 +16,10 @@ #include "asan_allocator.h" #include "asan_flags.h" #include "asan_internal.h" +#include "asan_mapping.h" #include "asan_poisoning.h" #include "asan_stack.h" +#include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_flags.h" namespace __asan { @@ -110,8 +112,9 @@ void AsanDeactivate() { AllocatorOptions disabled = asan_deactivated_flags.allocator_options; disabled.quarantine_size_mb = 0; disabled.thread_local_quarantine_size_kb = 0; - disabled.min_redzone = 16; // Redzone must be at least 16 bytes long. - disabled.max_redzone = 16; + // Redzone must be at least Max(16, granularity) bytes long. + disabled.min_redzone = Max(16, (int)SHADOW_GRANULARITY); + disabled.max_redzone = disabled.min_redzone; disabled.alloc_dealloc_mismatch = false; disabled.may_return_null = true; ReInitializeAllocator(disabled); Modified: head/contrib/compiler-rt/lib/asan/asan_allocator.cc ============================================================================== --- head/contrib/compiler-rt/lib/asan/asan_allocator.cc Sat Jan 13 23:31:21 2018 (r327951) +++ head/contrib/compiler-rt/lib/asan/asan_allocator.cc Sun Jan 14 00:08:34 2018 (r327952) @@ -84,7 +84,10 @@ struct ChunkHeader { // This field is used for small sizes. For large sizes it is equal to // SizeClassMap::kMaxSize and the actual size is stored in the // SecondaryAllocator's metadata. - u32 user_requested_size; + u32 user_requested_size : 29; + // align < 8 -> 0 + // else -> log2(min(align, 512)) - 2 + u32 user_requested_alignment_log : 3; u32 alloc_context_id; }; @@ -271,9 +274,9 @@ struct Allocator { atomic_store(&max_redzone, options.max_redzone, memory_order_release); } - void Initialize(const AllocatorOptions &options) { + void InitLinkerInitialized(const AllocatorOptions &options) { SetAllocatorMayReturnNull(options.may_return_null); - allocator.Init(options.release_to_os_interval_ms); + allocator.InitLinkerInitialized(options.release_to_os_interval_ms); SharedInitCode(options); } @@ -351,6 +354,20 @@ struct Allocator { return Min(Max(rz_log, RZSize2Log(min_rz)), RZSize2Log(max_rz)); } + static uptr ComputeUserRequestedAlignmentLog(uptr user_requested_alignment) { + if (user_requested_alignment < 8) + return 0; + if (user_requested_alignment > 512) + user_requested_alignment = 512; + return Log2(user_requested_alignment) - 2; + } + + static uptr ComputeUserAlignment(uptr user_requested_alignment_log) { + if (user_requested_alignment_log == 0) + return 0; + return 1LL << (user_requested_alignment_log + 2); + } + // We have an address between two chunks, and we want to report just one. AsanChunk *ChooseChunk(uptr addr, AsanChunk *left_chunk, AsanChunk *right_chunk) { @@ -385,6 +402,8 @@ struct Allocator { Flags &fl = *flags(); CHECK(stack); const uptr min_alignment = SHADOW_GRANULARITY; + const uptr user_requested_alignment_log = + ComputeUserRequestedAlignmentLog(alignment); if (alignment < min_alignment) alignment = min_alignment; if (size == 0) { @@ -472,6 +491,7 @@ struct Allocator { meta[0] = size; meta[1] = chunk_beg; } + m->user_requested_alignment_log = user_requested_alignment_log; m->alloc_context_id = StackDepotPut(*stack); @@ -573,8 +593,8 @@ struct Allocator { } } - void Deallocate(void *ptr, uptr delete_size, BufferedStackTrace *stack, - AllocType alloc_type) { + void Deallocate(void *ptr, uptr delete_size, uptr delete_alignment, + BufferedStackTrace *stack, AllocType alloc_type) { uptr p = reinterpret_cast(ptr); if (p == 0) return; @@ -601,13 +621,16 @@ struct Allocator { ReportAllocTypeMismatch((uptr)ptr, stack, (AllocType)m->alloc_type, (AllocType)alloc_type); } + } else { + if (flags()->new_delete_type_mismatch && + (alloc_type == FROM_NEW || alloc_type == FROM_NEW_BR) && + ((delete_size && delete_size != m->UsedSize()) || + ComputeUserRequestedAlignmentLog(delete_alignment) != + m->user_requested_alignment_log)) { + ReportNewDeleteTypeMismatch(p, delete_size, delete_alignment, stack); + } } - if (delete_size && flags()->new_delete_type_mismatch && - delete_size != m->UsedSize()) { - ReportNewDeleteSizeMismatch(p, delete_size, stack); - } - QuarantineChunk(m, ptr, stack); } @@ -631,7 +654,7 @@ struct Allocator { // If realloc() races with free(), we may start copying freed memory. // However, we will report racy double-free later anyway. REAL(memcpy)(new_ptr, old_ptr, memcpy_size); - Deallocate(old_ptr, 0, stack, FROM_MALLOC); + Deallocate(old_ptr, 0, 0, stack, FROM_MALLOC); } return new_ptr; } @@ -716,6 +739,22 @@ struct Allocator { return AsanChunkView(m1); } + void Purge() { + AsanThread *t = GetCurrentThread(); + if (t) { + AsanThreadLocalMallocStorage *ms = &t->malloc_storage(); + quarantine.DrainAndRecycle(GetQuarantineCache(ms), + QuarantineCallback(GetAllocatorCache(ms))); + } + { + SpinMutexLock l(&fallback_mutex); + quarantine.DrainAndRecycle(&fallback_quarantine_cache, + QuarantineCallback(&fallback_allocator_cache)); + } + + allocator.ForceReleaseToOS(); + } + void PrintStats() { allocator.PrintStats(); quarantine.PrintStats(); @@ -750,6 +789,9 @@ bool AsanChunkView::IsQuarantined() const { uptr AsanChunkView::Beg() const { return chunk_->Beg(); } uptr AsanChunkView::End() const { return Beg() + UsedSize(); } uptr AsanChunkView::UsedSize() const { return chunk_->UsedSize(); } +u32 AsanChunkView::UserRequestedAlignment() const { + return Allocator::ComputeUserAlignment(chunk_->user_requested_alignment_log); +} uptr AsanChunkView::AllocTid() const { return chunk_->alloc_tid; } uptr AsanChunkView::FreeTid() const { return chunk_->free_tid; } AllocType AsanChunkView::GetAllocType() const { @@ -775,7 +817,7 @@ StackTrace AsanChunkView::GetFreeStack() const { } void InitializeAllocator(const AllocatorOptions &options) { - instance.Initialize(options); + instance.InitLinkerInitialized(options); } void ReInitializeAllocator(const AllocatorOptions &options) { @@ -802,12 +844,12 @@ void PrintInternalAllocatorStats() { } void asan_free(void *ptr, BufferedStackTrace *stack, AllocType alloc_type) { - instance.Deallocate(ptr, 0, stack, alloc_type); + instance.Deallocate(ptr, 0, 0, stack, alloc_type); } -void asan_sized_free(void *ptr, uptr size, BufferedStackTrace *stack, - AllocType alloc_type) { - instance.Deallocate(ptr, size, stack, alloc_type); +void asan_delete(void *ptr, uptr size, uptr alignment, + BufferedStackTrace *stack, AllocType alloc_type) { + instance.Deallocate(ptr, size, alignment, stack, alloc_type); } void *asan_malloc(uptr size, BufferedStackTrace *stack) { @@ -823,7 +865,7 @@ void *asan_realloc(void *p, uptr size, BufferedStackTr return SetErrnoOnNull(instance.Allocate(size, 8, stack, FROM_MALLOC, true)); if (size == 0) { if (flags()->allocator_frees_and_returns_null_on_realloc_zero) { - instance.Deallocate(p, 0, stack, FROM_MALLOC); + instance.Deallocate(p, 0, 0, stack, FROM_MALLOC); return nullptr; } // Allocate a size of 1 if we shouldn't free() on Realloc to 0 @@ -839,6 +881,10 @@ void *asan_valloc(uptr size, BufferedStackTrace *stack void *asan_pvalloc(uptr size, BufferedStackTrace *stack) { uptr PageSize = GetPageSizeCached(); + if (UNLIKELY(CheckForPvallocOverflow(size, PageSize))) { + errno = errno_ENOMEM; + return AsanAllocator::FailureHandler::OnBadRequest(); + } // pvalloc(0) should allocate one page. size = size ? RoundUpTo(size, PageSize) : PageSize; return SetErrnoOnNull( @@ -1005,6 +1051,10 @@ uptr __sanitizer_get_allocated_size(const void *p) { ReportSanitizerGetAllocatedSizeNotOwned(ptr, &stack); } return allocated_size; +} + +void __sanitizer_purge_allocator() { + instance.Purge(); } #if !SANITIZER_SUPPORTS_WEAK_HOOKS Modified: head/contrib/compiler-rt/lib/asan/asan_allocator.h ============================================================================== --- head/contrib/compiler-rt/lib/asan/asan_allocator.h Sat Jan 13 23:31:21 2018 (r327951) +++ head/contrib/compiler-rt/lib/asan/asan_allocator.h Sun Jan 14 00:08:34 2018 (r327952) @@ -58,6 +58,7 @@ class AsanChunkView { uptr Beg() const; // First byte of user memory. uptr End() const; // Last byte of user memory. uptr UsedSize() const; // Size requested by the user. + u32 UserRequestedAlignment() const; // Originally requested alignment. uptr AllocTid() const; uptr FreeTid() const; bool Eq(const AsanChunkView &c) const { return chunk_ == c.chunk_; } @@ -119,7 +120,11 @@ struct AsanMapUnmapCallback { }; #if SANITIZER_CAN_USE_ALLOCATOR64 -# if defined(__powerpc64__) +# if SANITIZER_FUCHSIA +const uptr kAllocatorSpace = ~(uptr)0; +const uptr kAllocatorSize = 0x40000000000ULL; // 4T. +typedef DefaultSizeClassMap SizeClassMap; +# elif defined(__powerpc64__) const uptr kAllocatorSpace = 0xa0000000000ULL; const uptr kAllocatorSize = 0x20000000000ULL; // 2T. typedef DefaultSizeClassMap SizeClassMap; @@ -193,8 +198,8 @@ struct AsanThreadLocalMallocStorage { void *asan_memalign(uptr alignment, uptr size, BufferedStackTrace *stack, AllocType alloc_type); void asan_free(void *ptr, BufferedStackTrace *stack, AllocType alloc_type); -void asan_sized_free(void *ptr, uptr size, BufferedStackTrace *stack, - AllocType alloc_type); +void asan_delete(void *ptr, uptr size, uptr alignment, + BufferedStackTrace *stack, AllocType alloc_type); void *asan_malloc(uptr size, BufferedStackTrace *stack); void *asan_calloc(uptr nmemb, uptr size, BufferedStackTrace *stack); Modified: head/contrib/compiler-rt/lib/asan/asan_descriptions.cc ============================================================================== --- head/contrib/compiler-rt/lib/asan/asan_descriptions.cc Sat Jan 13 23:31:21 2018 (r327951) +++ head/contrib/compiler-rt/lib/asan/asan_descriptions.cc Sun Jan 14 00:08:34 2018 (r327952) @@ -122,6 +122,7 @@ static void GetAccessToHeapChunkInformation(ChunkAcces } descr->chunk_begin = chunk.Beg(); descr->chunk_size = chunk.UsedSize(); + descr->user_requested_alignment = chunk.UserRequestedAlignment(); descr->alloc_type = chunk.GetAllocType(); } @@ -150,7 +151,7 @@ static void PrintHeapChunkAccess(uptr addr, const Chun str.append(" %zu-byte region [%p,%p)\n", descr.chunk_size, (void *)descr.chunk_begin, (void *)(descr.chunk_begin + descr.chunk_size)); - str.append("%s", d.EndLocation()); + str.append("%s", d.Default()); Printf("%s", str.data()); } @@ -260,7 +261,7 @@ static void PrintAccessAndVarIntersection(const StackV // FIXME: we may want to also print the size of the access here, // but in case of accesses generated by memset it may be confusing. str.append("%s <== Memory access at offset %zd %s this variable%s\n", - d.Location(), addr, pos_descr, d.EndLocation()); + d.Location(), addr, pos_descr, d.Default()); } else { str.append("\n"); } @@ -295,7 +296,7 @@ static void DescribeAddressRelativeToGlobal(uptr addr, MaybeDemangleGlobalName(g.name)); PrintGlobalLocation(&str, g); str.append("' (0x%zx) of size %zu\n", g.beg, g.size); - str.append("%s", d.EndLocation()); + str.append("%s", d.Default()); PrintGlobalNameIfASCII(&str, g); Printf("%s", str.data()); } @@ -335,6 +336,26 @@ void GlobalAddressDescription::Print(const char *bug_t } } +bool GlobalAddressDescription::PointsInsideTheSameVariable( + const GlobalAddressDescription &other) const { + if (size == 0 || other.size == 0) return false; + + for (uptr i = 0; i < size; i++) { + const __asan_global &a = globals[i]; + for (uptr j = 0; j < other.size; j++) { + const __asan_global &b = other.globals[j]; + if (a.beg == b.beg && + a.beg <= addr && + b.beg <= other.addr && + (addr + access_size) < (a.beg + a.size) && + (other.addr + other.access_size) < (b.beg + b.size)) + return true; + } + } + + return false; +} + void StackAddressDescription::Print() const { Decorator d; char tname[128]; @@ -343,10 +364,10 @@ void StackAddressDescription::Print() const { ThreadNameWithParenthesis(tid, tname, sizeof(tname))); if (!frame_descr) { - Printf("%s\n", d.EndLocation()); + Printf("%s\n", d.Default()); return; } - Printf(" at offset %zu in frame%s\n", offset, d.EndLocation()); + Printf(" at offset %zu in frame%s\n", offset, d.Default()); // Now we print the frame where the alloca has happened. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sun Jan 14 00:17:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D84B8E629CC; Sun, 14 Jan 2018 00:17:26 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.12]) (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 7D4A17F78E; Sun, 14 Jan 2018 00:17:25 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with ESMTPA id aVzGeEES4Z8gBaVzHei9Fs; Sat, 13 Jan 2018 17:17:24 -0700 X-Authority-Analysis: v=2.2 cv=M/g9E24s c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=RgaUWeydRksA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=iobeIKzyZ5yR-PLec4sA:9 a=ofxHZX0y2bFOHBNL:21 a=bU5DJ2GvaiEwFHBX:21 a=4rh1IfhP2UJq8lIo:21 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 C4C3BEFCF; Sat, 13 Jan 2018 16:17:21 -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 w0E0HKKY049186; Sat, 13 Jan 2018 16:17:20 -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 w0E0HKS3049183; Sat, 13 Jan 2018 16:17:20 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201801140017.w0E0HKS3049183@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: r327949 - in head/sys/dev: aacraid advansys ath beri/virtio bnxt bwn ciss cxgbe/crypto esp fb gpio if_ndis iwi kbd liquidio liquidio/base mpr mps mpt mrsas mxge netmap nvme pst ral rp s... In-Reply-To: Message from "Pedro F. Giffuni" of "Sat, 13 Jan 2018 22:30:31 +0000." <201801132230.w0DMUVmF081985@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 13 Jan 2018 16:17:20 -0800 X-CMAE-Envelope: MS4wfNE12fHqDPXqqrKzMx1PkHg0dtQR/wgFa7i1ZTAtFGfajWcy7j2hrq/UgZbrbB8PzBNXY41Vb+5LugvLR/IOrpmKLdxJgsJwR6pdPuXBIMpAAsbTIBRL swEXl5sWUIgqJJTrJ4FPhvR4jbMqHNC+24iNdWR2CJyB0yznkSAEy/X2p5TC2xUXhn8jHd1bDoQUnrNZQzletRoPYYMGzMIp0zb3HPciu9OK8rDoC+aSJSSJ JNJPJ9Y4LHeNyWsINw9EGNsuAJnzyfYLdlBNhHvDK9PATPtuKONpxAtweIX9fkHe X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jan 2018 00:17:26 -0000 In message <201801132230.w0DMUVmF081985@repo.freebsd.org>, "Pedro F. Giffuni" w rites: > Author: pfg > Date: Sat Jan 13 22:30:30 2018 > New Revision: 327949 > URL: https://svnweb.freebsd.org/changeset/base/327949 > > Log: > dev: make some use of mallocarray(9). > > Focus on code where we are doing multiplications within malloc(9). None of > these is likely to overflow, however the change is still useful as some > static checkers can benefit from the allocation attributes we use for > mallocarray. > > This initial sweep only covers malloc(9) calls with M_NOWAIT. No good > reason but I started doing the changes before r327796 and at that time it > was convenient to make sure the sorrounding code could handle NULL values. > > Modified: > head/sys/dev/aacraid/aacraid.c > head/sys/dev/advansys/advansys.c > head/sys/dev/ath/if_ath_rx_edma.c > head/sys/dev/beri/virtio/virtio.c > head/sys/dev/bnxt/if_bnxt.c > head/sys/dev/bwn/if_bwn.c > head/sys/dev/bwn/if_bwn_phy_lp.c > head/sys/dev/ciss/ciss.c > head/sys/dev/cxgbe/crypto/t4_crypto.c > head/sys/dev/esp/ncr53c9x.c > head/sys/dev/fb/splash.c > head/sys/dev/gpio/gpiobus.c > head/sys/dev/if_ndis/if_ndis.c > head/sys/dev/iwi/if_iwi.c > head/sys/dev/kbd/kbd.c > head/sys/dev/liquidio/base/lio_request_manager.c > head/sys/dev/liquidio/lio_main.c > head/sys/dev/mpr/mpr.c > head/sys/dev/mpr/mpr_mapping.c > head/sys/dev/mps/mps.c > head/sys/dev/mps/mps_mapping.c > head/sys/dev/mpt/mpt_cam.c > head/sys/dev/mrsas/mrsas.c > head/sys/dev/mxge/if_mxge.c > head/sys/dev/netmap/if_ptnet.c > head/sys/dev/nvme/nvme_ns.c > head/sys/dev/pst/pst-iop.c > head/sys/dev/ral/rt2560.c > head/sys/dev/ral/rt2661.c > head/sys/dev/rp/rp.c > head/sys/dev/rp/rp_isa.c > head/sys/dev/rp/rp_pci.c > head/sys/dev/sound/midi/midi.c > head/sys/dev/sound/pci/hda/hdaa.c > head/sys/dev/syscons/fire/fire_saver.c > head/sys/dev/virtio/console/virtio_console.c > head/sys/dev/virtio/mmio/virtio_mmio.c > head/sys/dev/virtio/network/if_vtnet.c > head/sys/dev/virtio/pci/virtio_pci.c > head/sys/dev/vmware/vmxnet3/if_vmx.c > head/sys/dev/vnic/nicvf_queues.c > head/sys/dev/xen/blkback/blkback.c > head/sys/dev/xen/blkfront/blkfront.c > > Modified: head/sys/dev/mxge/if_mxge.c > ============================================================================= > = > --- head/sys/dev/mxge/if_mxge.c Sat Jan 13 21:39:46 2018 (r32794 > 8) > +++ head/sys/dev/mxge/if_mxge.c Sat Jan 13 22:30:30 2018 (r32794 > 9) > @@ -688,7 +688,7 @@ z_alloc(void *nil, u_int items, u_int size) > { > void *ptr; > > - ptr = malloc(items * size, M_TEMP, M_NOWAIT); > + ptr = mallocarray(items, size, M_TEMP, M_NOWAIT); > return ptr; > } > > @@ -4390,8 +4390,8 @@ mxge_alloc_slices(mxge_softc_t *sc) > sc->rx_ring_size = cmd.data0; > max_intr_slots = 2 * (sc->rx_ring_size / sizeof (mcp_dma_addr_t)); > > - bytes = sizeof (*sc->ss) * sc->num_slices; Hi Pedro, This broke the build. > - sc->ss = malloc(bytes, M_DEVBUF, M_NOWAIT | M_ZERO); > + sc->ss = mallocarray(sc->num_slices, sizeof(*sc->ss), M_DEVBUF, > + M_NOWAIT | M_ZERO); > if (sc->ss == NULL) > return (ENOMEM); > for (i = 0; i < sc->num_slices; i++) { > @@ -4563,8 +4563,8 @@ mxge_add_msix_irqs(mxge_softc_t *sc) > err = ENOSPC; > goto abort_with_msix; > } > - bytes = sizeof (*sc->msix_irq_res) * sc->num_slices; > - sc->msix_irq_res = malloc(bytes, M_DEVBUF, M_NOWAIT|M_ZERO); > + sc->msix_irq_res = mallocarray(sc->num_slices, > + sizeof(*sc->msix_irq_res), M_DEVBUF, M_NOWAIT|M_ZERO); > if (sc->msix_irq_res == NULL) { > err = ENOMEM; > goto abort_with_msix; > @@ -4583,8 +4583,8 @@ mxge_add_msix_irqs(mxge_softc_t *sc) > } > } > > - bytes = sizeof (*sc->msix_ih) * sc->num_slices; ===> mxge/mxge_rss_ethp_z8e (all) --- all_subdir_mxge/mxge --- /opt/src/svn-current/sys/dev/mxge/if_mxge.c:4538:9: error: unused variable 'bytes' [-Werror,-Wunused-variable] size_t bytes; ^ 1 error generated. *** [if_mxge.o] Error code 1 > - sc->msix_ih = malloc(bytes, M_DEVBUF, M_NOWAIT|M_ZERO); > + sc->msix_ih = mallocarray(sc->num_slices, sizeof(*sc->msix_ih), > + M_DEVBUF, M_NOWAIT|M_ZERO); > > for (i = 0; i < sc->num_slices; i++) { > err = bus_setup_intr(sc->dev, sc->msix_irq_res[i], > -- 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-head@freebsd.org Sun Jan 14 00:31:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05686E638DF; Sun, 14 Jan 2018 00:31:36 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D4BE28029F; Sun, 14 Jan 2018 00:31: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 052061A474; Sun, 14 Jan 2018 00:31:35 +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 w0E0VYwv035699; Sun, 14 Jan 2018 00:31:34 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0E0VYhR035698; Sun, 14 Jan 2018 00:31:34 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201801140031.w0E0VYhR035698@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 14 Jan 2018 00:31:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327953 - head/sys/dev/mxge X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/dev/mxge X-SVN-Commit-Revision: 327953 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jan 2018 00:31:36 -0000 Author: pfg Date: Sun Jan 14 00:31:34 2018 New Revision: 327953 URL: https://svnweb.freebsd.org/changeset/base/327953 Log: Fix build after r327949. Reported by: Cy Schubert Modified: head/sys/dev/mxge/if_mxge.c Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Sun Jan 14 00:08:34 2018 (r327952) +++ head/sys/dev/mxge/if_mxge.c Sun Jan 14 00:31:34 2018 (r327953) @@ -4535,7 +4535,6 @@ abort_with_fw: static int mxge_add_msix_irqs(mxge_softc_t *sc) { - size_t bytes; int count, err, i, rid; rid = PCIR_BAR(2); From owner-svn-src-head@freebsd.org Sun Jan 14 00:46:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B3DEE644AA for ; Sun, 14 Jan 2018 00:46:31 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic306-18.consmr.mail.bf2.yahoo.com (sonic306-18.consmr.mail.bf2.yahoo.com [74.6.132.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 1946D80948 for ; Sun, 14 Jan 2018 00:46:30 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1515890788; bh=A7OBMagWLMX748LNqW5cbjh+HzMfIWF7MLlEMTYdJD8=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=umHdPRI+s6mk3YyFF0xGjQGfwqek36jl4Z+I68DcuwqIPt6s3JaL5BsssZ8nciOgzOk0iEzdpN7lL2S+8Ul+7mVFgWsMspkIbZPqFcbAWH+9K9czKBfsK7wpTdEpj5oab4YjtbSuhc3V+aFbDspV4HHBXAmbmQYUwWygSmT+wSjO6meOkioe8jZPdQQ0OHLPtyUEJtTZJWKaY37XpGWWm273VUxi+PfKERT7OyG3RCGntnnorS+sc/stZoU2qFV3JBpGpqGk1kLvma1HA3qM4nAOgrKpjWp35hzdWWL66FEMHP/AxMns3zsuH9wpn+x2mnEXFZ5xNCPwoiko0vavGQ== X-YMail-OSG: nbclWHkVM1la7Fi0iQhrd6aUnU.tfw2TU5vVmKLcmEf.dpqbm37pO0jhl2XTpU2 _16PjrzCEXdeLStTCyu7CV0vpD943xEYuIXUIhMCR0WeBnQcfzTJB4AuXrWLygapEDTftxvNskWM 77PVqD0g98zaDR5m8oZWgpX0niBp_6ZLlqxV33cMO2.Bm9DDDQUULPj_m2AiWEsgZGpCAdls8r_2 aDlXskxJPVk6jlw_Ud_O_9o4D3gApGdkHvcFn73Em4P2iigYFOmVYWLJ0Nibe1XIR7RdIPp0pSIn LA0ZQm_M5oQzOMOcCNcULlE589VljQh2DfH2K5rKMUeqYCVCnFbSsK3DYN_Gc9tALVBwaeo.sQkt 8Ks5wZiR5eh4yZilQlv94BiEvoueTNYc.RL9EDPQm3nceHguE2M2Pu_VBKz.5rWWWyO_h7.lLwQN UgIaR9Ca45W8V2Ixo11KeMn9oZgfjVbVV3EvoSW8sxN5rn44Y_6NeWs9S_VExGm_zr3HV6t_r Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.bf2.yahoo.com with HTTP; Sun, 14 Jan 2018 00:46:28 +0000 Received: from smtp107.rhel.mail.bf1.yahoo.com (EHLO [192.168.0.8]) ([98.139.231.44]) by smtp405.mail.bf1.yahoo.com (JAMES SMTP Server ) with ESMTPA ID 759f3adf8607158a085f40da8b3e0b86; Sun, 14 Jan 2018 00:36:21 +0000 (UTC) Subject: Re: svn commit: r327949 - in head/sys/dev: aacraid advansys ath beri/virtio bnxt bwn ciss cxgbe/crypto esp fb gpio if_ndis iwi kbd liquidio liquidio/base mpr mps mpt mrsas mxge netmap nvme pst ral rp s... To: Cy Schubert Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201801140017.w0E0HKS3049183@slippy.cwsent.com> From: Pedro Giffuni Message-ID: Date: Sat, 13 Jan 2018 19:36:21 -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: <201801140017.w0E0HKS3049183@slippy.cwsent.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jan 2018 00:46:31 -0000 On 01/13/18 19:17, Cy Schubert wrote: > In message <201801132230.w0DMUVmF081985@repo.freebsd.org>, "Pedro F. > Giffuni" w > rites: >> Author: pfg >> Date: Sat Jan 13 22:30:30 2018 >> New Revision: 327949 >> URL: https://svnweb.freebsd.org/changeset/base/327949 >> >> Log: >> dev: make some use of mallocarray(9). >> >> Focus on code where we are doing multiplications within malloc(9). None of >> these is likely to overflow, however the change is still useful as some >> static checkers can benefit from the allocation attributes we use for >> mallocarray. >> >> This initial sweep only covers malloc(9) calls with M_NOWAIT. No good >> reason but I started doing the changes before r327796 and at that time it >> was convenient to make sure the sorrounding code could handle NULL values. >> >> Modified: >> head/sys/dev/aacraid/aacraid.c >> head/sys/dev/advansys/advansys.c >> head/sys/dev/ath/if_ath_rx_edma.c >> head/sys/dev/beri/virtio/virtio.c >> head/sys/dev/bnxt/if_bnxt.c >> head/sys/dev/bwn/if_bwn.c >> head/sys/dev/bwn/if_bwn_phy_lp.c >> head/sys/dev/ciss/ciss.c >> head/sys/dev/cxgbe/crypto/t4_crypto.c >> head/sys/dev/esp/ncr53c9x.c >> head/sys/dev/fb/splash.c >> head/sys/dev/gpio/gpiobus.c >> head/sys/dev/if_ndis/if_ndis.c >> head/sys/dev/iwi/if_iwi.c >> head/sys/dev/kbd/kbd.c >> head/sys/dev/liquidio/base/lio_request_manager.c >> head/sys/dev/liquidio/lio_main.c >> head/sys/dev/mpr/mpr.c >> head/sys/dev/mpr/mpr_mapping.c >> head/sys/dev/mps/mps.c >> head/sys/dev/mps/mps_mapping.c >> head/sys/dev/mpt/mpt_cam.c >> head/sys/dev/mrsas/mrsas.c >> head/sys/dev/mxge/if_mxge.c >> head/sys/dev/netmap/if_ptnet.c >> head/sys/dev/nvme/nvme_ns.c >> head/sys/dev/pst/pst-iop.c >> head/sys/dev/ral/rt2560.c >> head/sys/dev/ral/rt2661.c >> head/sys/dev/rp/rp.c >> head/sys/dev/rp/rp_isa.c >> head/sys/dev/rp/rp_pci.c >> head/sys/dev/sound/midi/midi.c >> head/sys/dev/sound/pci/hda/hdaa.c >> head/sys/dev/syscons/fire/fire_saver.c >> head/sys/dev/virtio/console/virtio_console.c >> head/sys/dev/virtio/mmio/virtio_mmio.c >> head/sys/dev/virtio/network/if_vtnet.c >> head/sys/dev/virtio/pci/virtio_pci.c >> head/sys/dev/vmware/vmxnet3/if_vmx.c >> head/sys/dev/vnic/nicvf_queues.c >> head/sys/dev/xen/blkback/blkback.c >> head/sys/dev/xen/blkfront/blkfront.c >> > >> Modified: head/sys/dev/mxge/if_mxge.c >> ============================================================================= >> = >> --- head/sys/dev/mxge/if_mxge.c Sat Jan 13 21:39:46 2018 (r32794 >> 8) >> +++ head/sys/dev/mxge/if_mxge.c Sat Jan 13 22:30:30 2018 (r32794 >> 9) >> @@ -688,7 +688,7 @@ z_alloc(void *nil, u_int items, u_int size) >> { >> void *ptr; >> >> - ptr = malloc(items * size, M_TEMP, M_NOWAIT); >> + ptr = mallocarray(items, size, M_TEMP, M_NOWAIT); >> return ptr; >> } >> >> @@ -4390,8 +4390,8 @@ mxge_alloc_slices(mxge_softc_t *sc) >> sc->rx_ring_size = cmd.data0; >> max_intr_slots = 2 * (sc->rx_ring_size / sizeof (mcp_dma_addr_t)); >> >> - bytes = sizeof (*sc->ss) * sc->num_slices; > Hi Pedro, > > This broke the build. Very sorry ... should be fixed now (r327949). Thanks! Pedro. From owner-svn-src-head@freebsd.org Sun Jan 14 03:36:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5771FE75949; Sun, 14 Jan 2018 03:36:05 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2E96763C9A; Sun, 14 Jan 2018 03:36:05 +0000 (UTC) (envelope-from jeff@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 58FBB1C4EC; Sun, 14 Jan 2018 03:36:04 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0E3a43V010739; Sun, 14 Jan 2018 03:36:04 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0E3a3xv010728; Sun, 14 Jan 2018 03:36:03 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201801140336.w0E3a3xv010728@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Sun, 14 Jan 2018 03:36:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327954 - in head/sys: amd64/conf conf dev/acpica vm x86/acpica X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: in head/sys: amd64/conf conf dev/acpica vm x86/acpica X-SVN-Commit-Revision: 327954 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jan 2018 03:36:05 -0000 Author: jeff Date: Sun Jan 14 03:36:03 2018 New Revision: 327954 URL: https://svnweb.freebsd.org/changeset/base/327954 Log: Move VM_NUMA_ALLOC and DEVICE_NUMA under the single global config option NUMA. Sponsored by: Netflix, Dell/EMC Isilon Discussed with: jhb Modified: head/sys/amd64/conf/GENERIC head/sys/amd64/conf/MINIMAL head/sys/conf/NOTES head/sys/conf/options head/sys/dev/acpica/acpi.c head/sys/vm/uma_core.c head/sys/vm/vm_domainset.c head/sys/vm/vm_pageout.c head/sys/vm/vm_phys.c head/sys/vm/vm_phys.h head/sys/x86/acpica/srat.c Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Sun Jan 14 00:31:34 2018 (r327953) +++ head/sys/amd64/conf/GENERIC Sun Jan 14 03:36:03 2018 (r327954) @@ -99,7 +99,6 @@ options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) # Make an SMP-capable kernel by default options SMP # Symmetric MultiProcessor Kernel -options DEVICE_NUMA # I/O Device Affinity options EARLY_AP_STARTUP # CPU frequency control Modified: head/sys/amd64/conf/MINIMAL ============================================================================== --- head/sys/amd64/conf/MINIMAL Sun Jan 14 00:31:34 2018 (r327953) +++ head/sys/amd64/conf/MINIMAL Sun Jan 14 03:36:03 2018 (r327954) @@ -93,7 +93,6 @@ options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) # Make an SMP-capable kernel by default options SMP # Symmetric MultiProcessor Kernel -options DEVICE_NUMA # I/O Device Affinity options EARLY_AP_STARTUP # CPU frequency control Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Sun Jan 14 00:31:34 2018 (r327953) +++ head/sys/conf/NOTES Sun Jan 14 03:36:03 2018 (r327954) @@ -231,17 +231,13 @@ options EARLY_AP_STARTUP # A default value should be already present, for every architecture. options MAXCPU=32 +# NUMA enables use of Non-Uniform Memory Access policies in various kernel +# subsystems. +options NUMA + # MAXMEMDOM defines the maximum number of memory domains that can boot in the # system. A default value should already be defined by every architecture. options MAXMEMDOM=2 - -# VM_NUMA_ALLOC enables use of memory domain-aware allocation in the VM -# system. -options VM_NUMA_ALLOC - -# DEVICE_NUMA enables reporting of domain affinity of I/O devices via -# bus_get_domain(), etc. -options DEVICE_NUMA # ADAPTIVE_MUTEXES changes the behavior of blocking mutexes to spin # if the thread that currently owns the mutex is executing on another Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Sun Jan 14 00:31:34 2018 (r327953) +++ head/sys/conf/options Sun Jan 14 03:36:03 2018 (r327954) @@ -95,7 +95,6 @@ COMPAT_LINUXKPI opt_compat.h COMPILING_LINT opt_global.h CY_PCI_FASTINTR DEADLKRES opt_watchdog.h -DEVICE_NUMA EXT_RESOURCES opt_global.h DIRECTIO FILEMON opt_dontuse.h @@ -605,7 +604,6 @@ VM_KMEM_SIZE opt_vm.h VM_KMEM_SIZE_SCALE opt_vm.h VM_KMEM_SIZE_MAX opt_vm.h VM_NRESERVLEVEL opt_vm.h -VM_NUMA_ALLOC opt_vm.h VM_LEVEL_0_ORDER opt_vm.h NO_SWAPPING opt_vm.h MALLOC_MAKE_FAILURES opt_vm.h @@ -621,6 +619,7 @@ DEBUG_REDZONE opt_vm.h # Standard SMP options EARLY_AP_STARTUP opt_global.h SMP opt_global.h +NUMA opt_global.h # Size of the kernel message buffer MSGBUF_SIZE opt_msgbuf.h Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Sun Jan 14 00:31:34 2018 (r327953) +++ head/sys/dev/acpica/acpi.c Sun Jan 14 03:36:03 2018 (r327954) @@ -31,7 +31,6 @@ __FBSDID("$FreeBSD$"); #include "opt_acpi.h" -#include "opt_device_numa.h" #include #include @@ -1089,7 +1088,7 @@ acpi_hint_device_unit(device_t acdev, device_t child, static int acpi_parse_pxm(device_t dev) { -#ifdef DEVICE_NUMA +#ifdef NUMA ACPI_HANDLE handle; ACPI_STATUS status; int pxm; Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Sun Jan 14 00:31:34 2018 (r327953) +++ head/sys/vm/uma_core.c Sun Jan 14 03:36:03 2018 (r327954) @@ -2616,7 +2616,7 @@ zone_import(uma_zone_t zone, void **bucket, int max, i bucket[i++] = slab_alloc_item(keg, slab); if (keg->uk_free <= keg->uk_reserve) break; -#if MAXMEMDOM > 1 +#ifdef NUMA /* * If the zone is striped we pick a new slab for every * N allocations. Eliminating this conditional will Modified: head/sys/vm/vm_domainset.c ============================================================================== --- head/sys/vm/vm_domainset.c Sun Jan 14 00:31:34 2018 (r327953) +++ head/sys/vm/vm_domainset.c Sun Jan 14 03:36:03 2018 (r327954) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef NUMA /* * Iterators are written such that the first nowait pass has as short a * codepath as possible to eliminate bloat from the allocator. It is @@ -241,3 +242,36 @@ vm_domainset_iter_malloc(struct vm_domainset_iter *di, return (0); } + +#else /* !NUMA */ +int +vm_domainset_iter_page(struct vm_domainset_iter *di, int *domain, int *flags) +{ + + return (EJUSTRETURN); +} + +void +vm_domainset_iter_page_init(struct vm_domainset_iter *di, + struct vm_object *obj, int *domain, int *flags) +{ + + *domain = 0; +} + +int +vm_domainset_iter_malloc(struct vm_domainset_iter *di, int *domain, int *flags) +{ + + return (EJUSTRETURN); +} + +void +vm_domainset_iter_malloc_init(struct vm_domainset_iter *di, + struct vm_object *obj, int *domain, int *flags) +{ + + *domain = 0; +} + +#endif Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Sun Jan 14 00:31:34 2018 (r327953) +++ head/sys/vm/vm_pageout.c Sun Jan 14 03:36:03 2018 (r327954) @@ -1919,16 +1919,13 @@ static void vm_pageout(void) { int error; -#ifdef VM_NUMA_ALLOC int i; -#endif swap_pager_swap_init(); error = kthread_add(vm_pageout_laundry_worker, NULL, curproc, NULL, 0, 0, "laundry: dom0"); if (error != 0) panic("starting laundry for domain 0, error %d", error); -#ifdef VM_NUMA_ALLOC for (i = 1; i < vm_ndomains; i++) { error = kthread_add(vm_pageout_worker, (void *)(uintptr_t)i, curproc, NULL, 0, 0, "dom%d", i); @@ -1937,7 +1934,6 @@ vm_pageout(void) i, error); } } -#endif error = kthread_add(uma_reclaim_worker, NULL, curproc, NULL, 0, 0, "uma"); if (error != 0) Modified: head/sys/vm/vm_phys.c ============================================================================== --- head/sys/vm/vm_phys.c Sun Jan 14 00:31:34 2018 (r327953) +++ head/sys/vm/vm_phys.c Sun Jan 14 03:36:03 2018 (r327954) @@ -71,7 +71,7 @@ __FBSDID("$FreeBSD$"); _Static_assert(sizeof(long) * NBBY >= VM_PHYSSEG_MAX, "Too many physsegs."); -#ifdef VM_NUMA_ALLOC +#ifdef NUMA struct mem_affinity *mem_affinity; int *mem_locality; #endif @@ -140,7 +140,7 @@ static int sysctl_vm_phys_segs(SYSCTL_HANDLER_ARGS); SYSCTL_OID(_vm, OID_AUTO, phys_segs, CTLTYPE_STRING | CTLFLAG_RD, NULL, 0, sysctl_vm_phys_segs, "A", "Phys Seg Info"); -#ifdef VM_NUMA_ALLOC +#ifdef NUMA static int sysctl_vm_phys_locality(SYSCTL_HANDLER_ARGS); SYSCTL_OID(_vm, OID_AUTO, phys_locality, CTLTYPE_STRING | CTLFLAG_RD, NULL, 0, sysctl_vm_phys_locality, "A", "Phys Locality Info"); @@ -201,7 +201,7 @@ vm_phys_fictitious_cmp(struct vm_phys_fictitious_seg * int vm_phys_domain_match(int prefer, vm_paddr_t low, vm_paddr_t high) { -#ifdef VM_NUMA_ALLOC +#ifdef NUMA domainset_t mask; int i; @@ -306,7 +306,7 @@ int vm_phys_mem_affinity(int f, int t) { -#ifdef VM_NUMA_ALLOC +#ifdef NUMA if (mem_locality == NULL) return (-1); if (f >= vm_ndomains || t >= vm_ndomains) @@ -317,7 +317,7 @@ vm_phys_mem_affinity(int f, int t) #endif } -#ifdef VM_NUMA_ALLOC +#ifdef NUMA /* * Outputs the VM locality table. */ @@ -393,7 +393,7 @@ _vm_phys_create_seg(vm_paddr_t start, vm_paddr_t end, static void vm_phys_create_seg(vm_paddr_t start, vm_paddr_t end) { -#ifdef VM_NUMA_ALLOC +#ifdef NUMA int i; if (mem_affinity == NULL) { Modified: head/sys/vm/vm_phys.h ============================================================================== --- head/sys/vm/vm_phys.h Sun Jan 14 00:31:34 2018 (r327953) +++ head/sys/vm/vm_phys.h Sun Jan 14 03:36:03 2018 (r327954) @@ -48,6 +48,11 @@ struct mem_affinity { vm_paddr_t end; int domain; }; +#ifdef NUMA +extern struct mem_affinity *mem_affinity; +extern int *mem_locality; +#endif +extern int vm_ndomains; struct vm_freelist { struct pglist pl; @@ -62,9 +67,6 @@ struct vm_phys_seg { struct vm_freelist (*free_queues)[VM_NFREEPOOL][VM_NFREEORDER]; }; -extern struct mem_affinity *mem_affinity; -extern int *mem_locality; -extern int vm_ndomains; extern struct vm_phys_seg vm_phys_segs[]; extern int vm_phys_nsegs; @@ -101,6 +103,7 @@ int vm_phys_mem_affinity(int f, int t); static inline int vm_phys_domidx(vm_page_t m) { +#ifdef NUMA int domn, segind; /* XXXKIB try to assert that the page is managed */ @@ -109,6 +112,9 @@ vm_phys_domidx(vm_page_t m) domn = vm_phys_segs[segind].domain; KASSERT(domn < vm_ndomains, ("domain %d m %p", domn, m)); return (domn); +#else + return (0); +#endif } /* Modified: head/sys/x86/acpica/srat.c ============================================================================== --- head/sys/x86/acpica/srat.c Sun Jan 14 00:31:34 2018 (r327953) +++ head/sys/x86/acpica/srat.c Sun Jan 14 03:36:03 2018 (r327954) @@ -153,7 +153,7 @@ parse_slit(void) acpi_unmap_table(slit); slit = NULL; -#ifdef VM_NUMA_ALLOC +#ifdef NUMA /* Tell the VM about it! */ mem_locality = vm_locality_table; #endif @@ -469,7 +469,7 @@ parse_srat(void) return (-1); } -#ifdef VM_NUMA_ALLOC +#ifdef NUMA /* Point vm_phys at our memory affinity table. */ vm_ndomains = ndomain; mem_affinity = mem_info; From owner-svn-src-head@freebsd.org Sun Jan 14 03:53:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2879EE76B76 for ; Sun, 14 Jan 2018 03:53:12 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22d.google.com (mail-io0-x22d.google.com [IPv6:2607:f8b0:4001:c06::22d]) (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 CD97C689CB for ; Sun, 14 Jan 2018 03:53:11 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22d.google.com with SMTP id c17so9889322iod.1 for ; Sat, 13 Jan 2018 19:53:11 -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=PZeVDYEyz/mORzGLIGXCNbrbxBqYmg7bYaMyKueCa0I=; b=Vzz35PJOYovOdLl6rmkwRp4Q0iDy9bWuur5CpCrvxKTaFNg6jxdTR01NKEEtSF8xpM sZ7Z3ZvYdEdPj91wUKltkBuW+AR0duw1grKh7lLS8Cj1E+wFsKAC5LazwSQP+4J2UpXX e1dikHQr01Eo3HfROe0rzVn9sn5MgFc0Pd6rURqZhwEq7ullIp6g56KM2faYo+6Wn4R5 HMcvv4JXX4Ul+eWYJPk3kIspO+WcNkWF42Ddn7GwwZfZ9wzosY+UF6YDpHB/DiP+JVvL iVwqSp4yhCNToS8qvLIG6zn3ULZ3yamWKF0+2fQiM4i6l5IM+s0GobXulxSre350c5Qc ZTqw== 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=PZeVDYEyz/mORzGLIGXCNbrbxBqYmg7bYaMyKueCa0I=; b=aECyF//esAEYdGYEO4Zdd9Cdg6ndaxyrBn9qHTB1hqrvm91w4CQgtdd1Gsnj2UwqEU G4ChvZzH+PAtFbS4lCSCNwr9bIcTp8NIrlZp6PrZT1edgIkD1eQPvXo07mVNEDaRx8mA z4QZuNhGSM8UyxTkvbAxQyazaogAhf7jYETBwIySXMN2wnV1mgTgposBdQtwwCvXxi5n I0lHBH991XWuPBHlLjGjohNSd3u2qpa4C+UW7OEZ6Xj/NK2HIpySPUL//xdOootcV6dH 9Ksja+N2FKQfk0g9mNP2P6fTTYnhRxXUgi/QyuadX67n3Va6jUnJPC/vr5nAniqgovCv IySg== X-Gm-Message-State: AKwxytdz+l5nn247hi5HUMQB9k+fim0qqLwWn62aojmdrNjFRmw93nHA 3h2C+Lpy8NN1khBvAziuZUVV0kL9hoas/Aa+P7Fq1Q== X-Google-Smtp-Source: ACJfBovGYCksThWgIJg8b/5MlhJV2o4KdchbxB9tYfy9eXJ9MVIRRb8JLaxG2beTQg7G/wbeotu8cK41aC/AwZqlv3g= X-Received: by 10.107.200.15 with SMTP id y15mr6719379iof.130.1515901990815; Sat, 13 Jan 2018 19:53:10 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.199.131 with HTTP; Sat, 13 Jan 2018 19:53:10 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:18a2:a4f7:170:8dd9] In-Reply-To: <20180113225638.Q2336@besplex.bde.org> References: <201801101725.w0AHP8Ca020379@repo.freebsd.org> <20180113225638.Q2336@besplex.bde.org> From: Warner Losh Date: Sat, 13 Jan 2018 20:53:10 -0700 X-Google-Sender-Auth: wxBQVkpe7FgW8yX39ribnA5mVe8 Message-ID: Subject: Re: svn commit: r327774 - in head: . sys/i386/bios To: Bruce Evans 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-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jan 2018 03:53:12 -0000 On Sat, Jan 13, 2018 at 6:17 AM, Bruce Evans wrote: > On Wed, 10 Jan 2018, Warner Losh wrote: > > Log: >> inittodr(0) actually sets the time, so there's no need to call >> tc_setclock(). It's redundant. Tweak UPDATING based on code review of >> past releases. >> > > No, tc_setclock() is not redundant (except for bugs). initodr(0) sets > a raw RTC time (plus a racy timezone offset). tc_setclock() is supposed to > fix this up to a less raw time using calculations done at suspend time. > The calculations are still done, so are even more bogus then when the > fixup was null under FIXME (then the FIXME a least indicated what > needed to be done). > > Modified: head/UPDATING >> ============================================================ >> ================== >> --- head/UPDATING Wed Jan 10 16:56:02 2018 (r327773) >> +++ head/UPDATING Wed Jan 10 17:25:08 2018 (r327774) >> @@ -53,8 +53,9 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: >> >> 20180110: >> On i386, pmtimer has been removed. It's functionality has been >> folded >> - into apm. It was a nop on ACPI. Users may need to remove it from >> kernel >> - config files. >> + into apm. It was a nop on ACPI in current for a while now (but >> was still >> + needed on i386 in FreeBSD 11 and earlier). Users may need to >> remove it >> + from kernel config files. >> > > It is indeed still needed in FreeBSD-11. acpci resume is still broken > there > on all arches except amd64, by bogusly ifdefing acpi_resync_clock() to do > nothing except on amd64 (and even on amd64, there is a sysctl to give the > same brokenness). > > pmtimer was made a no-op if acpi is configured in the same commit that > fixed > acpi resume. > > Modified: head/sys/i386/bios/apm.c >> ============================================================ >> ================== >> --- head/sys/i386/bios/apm.c Wed Jan 10 16:56:02 2018 (r327773) >> +++ head/sys/i386/bios/apm.c Wed Jan 10 17:25:08 2018 (r327774) >> @@ -1086,7 +1086,6 @@ apm_rtc_resume(void *arg __unused) >> { >> u_int second, minute, hour; >> struct timeval resume_time, tmp_time; >> - struct timespec ts; >> >> /* modified for adjkerntz */ >> timer_restore(); /* restore the all timers */ >> @@ -1097,14 +1096,11 @@ apm_rtc_resume(void *arg __unused) >> /* Calculate the delta time suspended */ >> timevalsub(&resume_time, &suspend_time); >> >> - second = ts.tv_sec = resume_time.tv_sec; >> - ts.tv_nsec = 0; >> - tc_setclock(&ts); >> - >> > > The carefully calculated tmp_time is no longer used. It wasn't used before > either, since ts was initialized to a wrong value. tmp_time was last used > under FIXME, but that shouldn't have compiled either since FIXME was > undefineable -- tmp_time as a write-only auto variable in all cases. > The non-use of some of the other timestamp variables is harder to detect > since they are static. > > tc_setclock() takes a delta-time as an arg. resume_time is already a > delta-time, but I think it is complete garbage. resume_time was initially > actually the resume time, but is abused to hole the suspension interval > (delta-time). inittodr(0) already advanced the timecounter by > approximately > the suspension interval, and inittodr(&ts) gives a garbage time by > advancing > by this again. > > I think the correct second advance is simply diff_time which was calculated > earlier. The dead tmp_time is + diff_time. This was > only used in the unreachable FIXME code because the "API" for that needed > an > absolute time. > > Untested fixes: > > X Index: apm.c > X =================================================================== > X --- apm.c (revision 327911) > X +++ apm.c (working copy) > X @@ -1067,17 +1067,17 @@ > X } while (apm_event != PMEV_NOEVENT); > X } > X X -static struct timeval suspend_time; > X -static struct timeval diff_time; > X +static struct timespec diff_time; > X +static struct timespec suspend_time; > X X static int > X apm_rtc_suspend(void *arg __unused) > X { > X X - microtime(&diff_time); > X - inittodr(0); > X - microtime(&suspend_time); > X - timevalsub(&diff_time, &suspend_time); > X + nanotime(&diff_time); /* not a difference yet */ > X + inittodr(0); /* set tc to raw time seen by RTC > */ > X + nanotime(&suspend_time); /* record this raw time */ > X + timespecsub(&diff_time, &suspend_time); /* diff between tc and RTC > */ > X return (0); > X } > X X @@ -1084,23 +1084,22 @@ > X static int > X apm_rtc_resume(void *arg __unused) > X { > X + struct timespec resume_time, suspend_interval; > X u_int second, minute, hour; > > This already changes too much, so I didn't fix blind truncation of tv_sec > starting in 2038 or other type botches for second/minute/hour. > I suspect this code will no longer be running in 2028, let alone 2038. > X - struct timeval resume_time, tmp_time; > X X - /* modified for adjkerntz */ > X - timer_restore(); /* restore the all timers */ > X - inittodr(0); /* adjust time to RTC */ > X - microtime(&resume_time); > X - getmicrotime(&tmp_time); > X - timevaladd(&tmp_time, &diff_time); > X + timer_restore(); > X + inittodr(0); /* set tc to new raw RTC time */ > X + nanotime(&resume_time); /* record this raw time */ > X + tc_setclock(&diff_time); /* restore old diff to tc */ > > Fixing tc_setclock() is the easiest part > tc_setclock() sets the absolute time. It's not a phase shift. > X + > X /* Calculate the delta time suspended */ > X - timevalsub(&resume_time, &suspend_time); > X + suspend_interval = resume_time; > X + timevalsub(&suspend_interval, &suspend_time); > > There are to many comments. I forgot to remove the one above after > unobfuscating resume_time. > OK. > X X -#ifdef PMTIMER_FIXUP_CALLTODO > X - /* Fixup the calltodo list with the delta time. */ > X - adjust_timeout_calltodo(&resume_time); > X -#endif /* PMTIMER_FIXUP_CALLTODO */ > X - second = resume_time.tv_sec; > X +#ifdef PMTIMER_FIXUP_CALLTODO /* XXX needed unconditionally, but never > worked */ > X + adjust_timeout_calltodo(&suspend_interval); > X +#endif > X + second = suspend_interval.tv_sec; > X hour = second / 3600; > X second %= 3600; > X minute = second / 60; > How is this then, it fixes the delta vs time setting in your version and tweaks variable names to remove banal comments.... static struct timespec suspend_time; /* Saved RTC time at suspend */ static struct timespec diff_interval; /* Delta between systime and RTC */ static int apm_rtc_suspend(void *arg __unused) { nanotime(&diff_interval); inittodr(0); /* systime = RTC */ nanotime(&suspend_time); timespecsub(&diff_interval, &suspend_time); return (0); } static int apm_rtc_resume(void *arg __unused) { struct timespec resume_time, new_time, suspend_interval; u_int second, minute, hour; timer_restore(); inittodr(0); /* Set to updated RTC time */ nanotime(&resume_time); new_time = resume_time; timespecadd(&new_time, &diff_interval); tc_setclock(&new_time); /* Pre-suspend system time + sleep time */ suspend_interval = resume_time; timespecsub(&suspend_interval, &suspend_time); second = suspend_interval.tv_sec; #ifdef FIXUP_CALLTODO /* Fixup the calltodo list with the delta time. */ adjust_timeout_calltodo(&suspend_interval); #endif /* PMTIMER_FIXUP_CALLTODO */ hour = second / 3600; second %= 3600; minute = second / 60; second %= 60; log(LOG_NOTICE, "wakeup from sleeping state (slept %02d:%02d:%02d)\n", hour, minute, second); return (0); } From owner-svn-src-head@freebsd.org Sun Jan 14 03:59:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 917A2E77209 for ; Sun, 14 Jan 2018 03:59:08 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x232.google.com (mail-it0-x232.google.com [IPv6:2607:f8b0:4001:c0b::232]) (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 52F2368F0C for ; Sun, 14 Jan 2018 03:59:08 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x232.google.com with SMTP id x42so13291414ita.4 for ; Sat, 13 Jan 2018 19:59:08 -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=IL3DS4ThE33TlnMVBf7OTODmwHMQfFf3dmQ0Ib5ZJ/4=; b=Hfmuv+ut7CYsnA5UATQprmOzrJiMMJaL0fYy3jkFOatbJ3QtCkn+AIldYVslHDJCnK nUlE9KtSkQU5MkBr0/gWjTk0KS+ur4okCqGBC8l+vIBAKrXu6BFT4tSQkA3h0qayc/nm aOa3a8ryQOg+JSvC1v6perotFoMzrPt/YCNaeJXBO0TOsJ5/apMgYkLeFhetr+P76krl Qe9HhggRLiiqb4IBdXCo6/i89cXZxSs85lI7z55/6gT9Nhp8ZF0N+uYi3u4fl37Ndwya qvgUOC96/RL9y9wgz4aOR+1pCoOCJHhQqvdSOBSPa19zwpjV8HG9s8eha7xXN5ue6Bn7 wmMw== 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=IL3DS4ThE33TlnMVBf7OTODmwHMQfFf3dmQ0Ib5ZJ/4=; b=KCNUUtGSQ0XvOKt0Db6Prh7RfR2k1Y/eemcNQyoEdd4LsxViciWu4PdNtMqW3C7MFB qdOR7Nv86Htrq5CMVkTurVEJzdpbxmBGI9fFH8JKm9/9aT2HoF9OY//9QWCajXvdZW5c zQ5q2wg0c95ylTWROHeRdu9LkewyM3skQwO9XFvzGnJ1G5rLGnWJWF46yyN1znWqpNVg MoLSWFAgpbtxJ5L8y21rUI92zUGkIXn0vG/N3QN8HyWJLrJNOxyMI4aYQRUzmm+iSUdo Pv5OPoB3PNjdSvwass8lE+w33yY/JhAH8VIqIgtOEC1PYbHAONMAHzwh6Z37B1nrTzP+ H24Q== X-Gm-Message-State: AKwxyte7iLUYKcSeR9hZ/I/VBfSKhWys6MGjl1zhB64YjHUW8btYniiy nBVurBw5YIcaaMp1F6frbKU9eT5WBaj9Kxjbijv/0w== X-Google-Smtp-Source: ACJfBou8l5r/9QFDanct38Szsg7YLa8VJZ4zlrgRieK/btCIo8brxqrOJ7hf3hhJJLVDWtxWOOjpmbSIufUHvgC8AmI= X-Received: by 10.36.91.210 with SMTP id g201mr10265388itb.50.1515902347470; Sat, 13 Jan 2018 19:59:07 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.199.131 with HTTP; Sat, 13 Jan 2018 19:59:06 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:18a2:a4f7:170:8dd9] In-Reply-To: <20180113203848.L2336@besplex.bde.org> References: <201801101459.w0AExJWM055025@repo.freebsd.org> <20180113203848.L2336@besplex.bde.org> From: Warner Losh Date: Sat, 13 Jan 2018 20:59:06 -0700 X-Google-Sender-Auth: bHXzn6qta7EPkhTZ2NSdEVRgZ9E Message-ID: Subject: Re: svn commit: r327767 - in head/sys: conf i386/bios i386/conf i386/isa To: Bruce Evans 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-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jan 2018 03:59:08 -0000 [trimmed, sorry ] On Sat, Jan 13, 2018 at 4:56 AM, Bruce Evans wrote: > On Wed, 10 Jan 2018, Warner Losh wrote: > > Log: >> Retire pmtimer driver. Move time fixing into apm driver. Move >> Iwasaki-san's copyright over. Remove FIXME code that couldn't possibly >> work. Call tc_settime() with our estimate of the delta we've been >> alseep (the one we print) to adjust the time. Not sure what to do >> about callouts, so keep the small #ifdef in place there. >> > > The FIXME code might have worked before timecounters, but never worked in > any committed version. You seem to have updated it correctly for > timecounters in this commit, but then broke it by removing it in a later > commit (see another reply). > > This commit obfuscates the fix by combining moving of the file with > changing > it. svn is also very broken -- it doesn't show history of the file under > its old name. This is more broken than usual -- since the file was merged > into a different file, svn doesn't show history of the file under its new > name either. > > The callout fixup code is more broken. It never compiled in any committed > version, since it uses data structures and logic that went away before it > was committed. The option for it (APM_FIXUP_CALLTODO) is so broken that it > is not a supported option or in LINT, so it is not normally noticed that > the code under it never compiled. > > Long callouts are especially broken. E.g., nanosleep(1 hour) at least > used to sleep for 2 hours if the system is suspended for 1 hour during > the sleep. I haven't noticed any fixes for this. Callouts mostly use > relative timeouts, and relative timeouts just don't work across > suspensions. > > Actually, I have noticed some fixes for nanosleep(). Another bug in it > was that it is specified to sleep in the time specified by the clock id > CLOCK_REALTIME, but used to sleep in the time specified by the clock id > CLOCK_MONOTONIC (the latter should be as close as possible to the former > except for leap seconds adjustments, but is quite broken -- it doesn't > count suspended time, and non-leap seconds settings of CLOCK_REALTIME > also make CLOCK_MONOTONIC useless for determining physical time > differences. > nanosleep() now sleeps on the correct clock id, and clock_nanosleep() is > now implemented. This is complicated, and I haven't checked if the fix > works. It looks to simple to work. To work, it needs to do things like > adjust timers whenever the timecounter jumps (mainly for resume and leap > seconds adjustments). APM_FIXUP_CALLTODO only tries to handle the easier > case of resume. Right, none of that is fixed. Modified: head/sys/conf/files.i386 >> ============================================================ >> ================== >> --- head/sys/conf/files.i386 Wed Jan 10 14:58:58 2018 (r327766) >> +++ head/sys/conf/files.i386 Wed Jan 10 14:59:19 2018 (r327767) >> @@ -520,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/pmtimer.c optional pmtimer >> i386/isa/prof_machdep.c optional profiling-routine >> i386/linux/imgact_linux.c optional compat_linux >> i386/linux/linux_dummy.c optional compat_linux >> > > pmtimer used to be needed all systems with acpi except amd64, because the > acpi fixup of timecounters was bogusly ifdefed for amd64 only (or was not > done by acpi in very old versions?). > > The pmtimer code for this fixup is still better tha the acpi code, except > the FIXME made it unused and the next commit dumbs it down to worse than > the acpi code (the acpi code is at least simpler). > > Modified: head/sys/i386/bios/apm.c >> ============================================================ >> ================== >> --- head/sys/i386/bios/apm.c Wed Jan 10 14:58:58 2018 (r327766) >> +++ head/sys/i386/bios/apm.c Wed Jan 10 14:59:19 2018 (r327767) >> Modified: head/sys/i386/bios/apm.c >> ============================================================ >> ================== >> --- head/sys/i386/bios/apm.c Wed Jan 10 14:58:58 2018 (r327766) >> +++ head/sys/i386/bios/apm.c Wed Jan 10 14:59:19 2018 (r327767) >> @@ -205,7 +232,7 @@ static int >> apm_driver_version(int version) >> { >> struct apm_softc *sc = &apm_softc; >> - >> + >> sc->bios.r.eax = (APM_BIOS << 8) | APM_DRVVERSION; >> sc->bios.r.ebx = 0x0; >> sc->bios.r.ecx = version; >> > > Unrelated style fixes make the important changes harder to see. This > patch was to remove trailing whitespace, but some mail program broke it > by removing the whitespace in the source lines. > > [... further mangled patches for whitespace not shown] Yea, I thought about doing two commits, but they got mixed up... > > @@ -331,12 +358,10 @@ apm_battery_low(void) >> static struct apmhook * >> apm_add_hook(struct apmhook **list, struct apmhook *ah) >> { >> - int s; >> struct apmhook *p, *prev; >> >> APM_DPRINT("Add hook \"%s\"\n", ah->ah_name); >> >> - s = splhigh(); >> if (ah == NULL) >> panic("illegal apm_hook!"); >> prev = NULL; >> @@ -351,30 +376,25 @@ apm_add_hook(struct apmhook **list, struct apmhook >> *ah >> ah->ah_next = prev->ah_next; >> prev->ah_next = ah; >> } >> - splx(s); >> return ah; >> } >> > > This commit also removes spl*() with no mention of this in the log message. > In FreeBSD-4 where spl's were not null, splhigh() was probably wrong, but > it > was much better than the splsoftclock() used in pmtimer.c. Hard clock > interrupts should be disabled, and my fixes for this change softclock to > statclock + XXX. It happens that splstatclock() == splclock() == > splhigh(), > so these splhigh()s were good enough. > > Now the locking is obscure. I think it is just Giant, and that is not > enough. The spl's should not be removed until the locking is done > properly. > The splsoftclock()'s were removed even earlier in pmtimer.c, without doing > any proper locking of course. Right, nothing calls these, except in attach, so I removed the broken locking rather than fixing it. static void >> apm_del_hook(struct apmhook **list, struct apmhook *ah) >> { >> - int s; >> struct apmhook *p, *prev; >> >> - s = splhigh(); >> prev = NULL; >> for (p = *list; p != NULL; prev = p, p = p->ah_next) >> if (p == ah) >> goto deleteit; >> panic("Tried to delete unregistered apm_hook."); >> - goto nosuchnode; >> + return; >> deleteit: >> if (prev != NULL) >> prev->ah_next = p->ah_next; >> else >> *list = p->ah_next; >> -nosuchnode: >> - splx(s); >> } >> > > Locking for device removal is especially necessary and badly done. New-bus > forces lots of Giant locking which is probably not enough. what calls that? Warner From owner-svn-src-head@freebsd.org Sun Jan 14 04:31:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5BE7E79037; Sun, 14 Jan 2018 04:31:48 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (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 A05BF6A2F2; Sun, 14 Jan 2018 04:31:48 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from comporellon.tachypleus.net (cpe-75-82-218-62.socal.res.rr.com [75.82.218.62]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id w0E4VeHx001256 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Sat, 13 Jan 2018 20:31:41 -0800 Subject: Re: svn commit: r327950 - in head/sys/powerpc: aim include powerpc ps3 From: Nathan Whitehorn To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201801132314.w0DNEra5002692@repo.freebsd.org> <20180113232441.GV1684@kib.kiev.ua> <010d0153-8931-a3c2-db21-dfcbaf848fc0@freebsd.org> Message-ID: Date: Sat, 13 Jan 2018 20:31:40 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <010d0153-8931-a3c2-db21-dfcbaf848fc0@freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Sonic-CAuth: UmFuZG9tSVa++FdYQMLOkTwAkeevxbwInjy1K2di38sKsN+vxQ/PW6iH07cfFCNYnlLj+5gegqJJ/VuCE26RcUSDbPtgmeaGwX+o10wPPl0= X-Sonic-ID: C;CP0N0eP45xGZtOBQ9eIpJw== M;zDF00eP45xGZtOBQ9eIpJw== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jan 2018 04:31:48 -0000 On 01/13/18 15:28, Nathan Whitehorn wrote: > > > On 01/13/18 15:24, Konstantin Belousov wrote: >> On Sat, Jan 13, 2018 at 11:14:53PM +0000, Nathan Whitehorn wrote: >>> +/* >>> + * We (usually) have a direct map of all physical memory. All >>> + * uses of this macro must be gated by a check on hw_direct_map! >>> + * The location of the direct map may not be 1:1 in future, so use >>> + * of the macro is recommended; it may also grow an assert that >>> hw_direct_map >>> + * is set. >>> + */ >>> +#define PHYS_TO_DMAP(x) x >>> +#define DMAP_TO_PHYS(x) x >> Take a look at the sys/vm/vm_page.c:vm_page_free_prep() function. >> > > I think the checks in there should work as designed, unless I'm > missing something. Am I? > -Nathan > Actually, wait, this is broken if hw_direct_map is not set. I can do an #ifdef __powerpc__ hack, but do you have opinions for a better MI flag for "yes, the macro is defined but, no, the direct map may not be available"? -Nathan From owner-svn-src-head@freebsd.org Sun Jan 14 04:44:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8944BE79A37; Sun, 14 Jan 2018 04:44:36 +0000 (UTC) (envelope-from melounmichal@gmail.com) 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 2FA3C6AAF3; Sun, 14 Jan 2018 04:44:36 +0000 (UTC) (envelope-from melounmichal@gmail.com) Received: by mail-wm0-x22a.google.com with SMTP id 143so18939320wma.5; Sat, 13 Jan 2018 20:44:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:reply-to:subject:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=zg2JfInObg6h+D9H8+yjvN490UmRvl+rgls3Ho/5Ud8=; b=RrYdEZRM5Ejh2AU/ddAyuMtmJIjAXqDlyn1ST9MW9NaSFDsDQGb624YBhNGyRwkceW AvcdHJ2xjBJEka1A8vBfg/G5+FEjxKto9jXaJjUjdQe8BMdTM3y1n+RQxGljZhLgR2xF jPIMmy/7aYOC5FUqO+7zLewVZWvNwDnBdAcCFh+eJJMpLOsqwwrc42mkHXc37/esQX3G XDsfD8viK1vthox0LcVDuZ0Otu/HlolwVdZ5bdwiROLzU+/St8lIv7Ih7WQqv+3wGo3N 7NlaKNpa03rv03aICHdj7JYesdYpqld42zahQ+yFwhOtRxJyt6PIVFrwcsPyGOe73emZ 5bFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:reply-to:subject:to:cc:references :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=zg2JfInObg6h+D9H8+yjvN490UmRvl+rgls3Ho/5Ud8=; b=i973ZqTCDYr+ACrY+OcERm28zTmYwzx2nAE8hHbkMR0ulHxs2zwR5jAOZcp1tDdH7m IyRuUf76bW0Wj9rWSMC6FMCR7cUC5n4z0sO2qMM367bNcTDm2LDvO3hEa3X509Xb8qAo KqqIizxYrjEOBy9OcEcq7z7kKRtBoVtxBqdXBxBn6SSre0KOY5l3vU2mjUgRm8t5T5yv 0JmQmkQlcU/nSRHH/V17MF8wB6Vp8ivK8Wc/kSTw7y0AHYjZ9TJzBPjPk1woZib0qZHd AJms7JOZWYTBQBVG2ZmLidwLuk8Q1EgNGjmOWWnSaH9Mo5nsIS5rCUX7Qk36iK1rdeXG 9OkQ== X-Gm-Message-State: AKwxytcvvK8zIRACKIOQqoCC1vewvCi8GsG1sbtfcDBDrXRcCkOYJCZq SHXGATpcPPMK2+/teOVnKLyb+ApVznA= X-Google-Smtp-Source: ACJfBotHZB3XmQ54hf8m8GchFaOFkvxlYPagC4+/+5i/tP7t9T03lWUM8pAvp0HvgUmQLg7bZxLNzg== X-Received: by 10.28.13.140 with SMTP id 134mr7190475wmn.106.1515905073754; Sat, 13 Jan 2018 20:44:33 -0800 (PST) Received: from [88.208.79.100] (halouny.humusoft.cz. [88.208.79.100]) by smtp.gmail.com with ESMTPSA id 11sm4201649wmd.33.2018.01.13.20.44.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 13 Jan 2018 20:44:33 -0800 (PST) From: Michal Meloun X-Google-Original-From: Michal Meloun Reply-To: mmel@freebsd.org Subject: Re: svn commit: r327876 - in head/sys/arm64: arm64 include To: Marcin Wojtas Cc: Warner Losh , Andrew Turner , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201801121401.w0CE1cW4058239@repo.freebsd.org> <187e75c7-343f-aea6-cb59-61c77fd64023@freebsd.org> Message-ID: <537c83c6-8e67-0861-207c-de5aebe4ef49@freebsd.org> Date: Sun, 14 Jan 2018 05:44:32 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jan 2018 04:44:36 -0000 On 14.01.2018 0:54, Marcin Wojtas wrote: > Hi Michal, > > 2018-01-12 18:15 GMT+01:00 Michal Meloun : >> >> >> On 12.01.2018 15:54, Warner Losh wrote: >>> >>> >>> >>> On Fri, Jan 12, 2018 at 7:52 AM, Andrew Turner >> > wrote: >>> >>> >>> >>>> On 12 Jan 2018, at 14:37, Warner Losh >>> > wrote: >>>> >>>> >>>> >>>> On Fri, Jan 12, 2018 at 7:15 AM, Andrew Turner >>> > wrote: >>>> >>>> >>>> >>>>> On 12 Jan 2018, at 14:10, Marcin Wojtas >>>> > wrote: >>>>> >>>>> Hi Andrew, >>>>> >>>>> >>>>> >>>>> 2018-01-12 15:01 GMT+01:00 Andrew Turner >>>> >: >>>>> >>>>>> Author: andrew >>>>>> Date: Fri Jan 12 14:01:38 2018 >>>>>> New Revision: 327876 >>>>>> URL: https://svnweb.freebsd.org/changeset/base/327876 >>>>>> >>>>>> >>>>>> Log: >>>>>> Workaround Spectre Variant 2 on arm64. >>>>>> >>>>>> We need to handle two cases: >>>>>> >>>>>> 1. One process attacking another process. >>>>>> 2. A process attacking the kernel. >>>>>> >>>>>> For the first case we clear the branch predictor state on >>>>>> context switch >>>>>> between different processes. For the second we do this when >>>>>> taking an >>>>>> instruction abort on a non-userspace address. >>>>>> >>>>>> To clear the branch predictor state a per-CPU function >>>>>> pointer has been >>>>>> added. This is set by the new cpu errata code based on if >>>>>> the CPU is >>>>>> known to be affected. >>>>>> >>>>>> On Cortex-A57, A72, A73, and A75 we call into the PSCI >>>>>> firmware as newer >>>>>> versions of this will clear the branch predictor state for us. >>>>>> >>>>>> It has been reported the ThunderX is unaffected, however >>>>>> the ThunderX2 is >>>>>> vulnerable. The Qualcomm Falkor core is also affected. As >>>>>> FreeBSD doesn't >>>>>> yet run on the ThunderX2 or Falkor no workaround is >>>>>> included for these CPUs. >>>>> >>>>> >>>>> Regardless ThunderX2 / Falkor work-arounds, do I understand >>>>> correctly >>>>> that pure CA72 machines, such as Marvell Armada 7k/8k are >>>>> immune to >>>>> Variant 2 now? >>>> >>>> >>>> It is my understanding that the A72 will be immune with this >>>> patch and an updated Arm Trusted Firmware as documented in [1]. >>>> >>>> Andrew >>>> >>>> [1] >>>> >>>> https://github.com/ARM-software/arm-trusted-firmware/wiki/ARM-Trusted-Firmware-Security-Advisory-TFV-6 >>>> >>>> >>>> >>>> >>>> Are you also working on aarch32 mitigation? >>> >>> >>> No. I think a similar technique could be used, however as aarch32 >>> has instructions to invalidate the branch predictor these can be >>> used directly. >>> >>> >>> That's my reading as well. It looks fairly easy to do it always, but I've >>> not researched it sufficiently. >>> >> >> I work on patches for armv6/7. But for aarch32, there is, unfortunately, >> much less information available about affective mitigation of variant 2. >> BPIALL while switching pmap is clear and we have it in code for years >> (well, BPIALL is effectively NOP for A15/A17, it must be explicitly >> enabled). >> But is not clear for me for which trap is branch predictor flush necessary. >> > > As for armv7, I believe the brand new patches on top of this branch > could be helpful: > https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git/log/?h=kpti > Yep, I tracking this thread from start(and I have prepared similar mitigation). My biggest problem with above patchset is that I'm unable to understand why is branch predictor mitigation applied *only* for instruction prefetch translation/permission *page* faults but not for *section* and/or for *access* faults. Moreover, please, take a look to Russel's response to this: https://www.spinics.net/lists/arm-kernel/msg628022.html Also, situation about Cortex-A15 is extremely unclear - this pachset and TFV6 advises: "Note that the BPIALL instruction is not effective in invalidating the branch predictor on Cortex-A15. For that CPU, set ACTLR[0] to 1 during early processor initialisation, and invalidate the branch predictor by performing an ICIALLU instruction." But description in Cortex-A15 TRM for ID_MMFR1 branch predictor field contains: [31:28] Branch predictor Indicates branch predictor management requirements. 0x2 Branch predictor requires flushing on: - Enabling or disabling the MMU. - Writing new data to instruction locations. - Writing new mappings to the translation tables. - Any change to the TTBR0, TTBR1, or TTBCR registers without a corresponding change to the FCSE ProcessID or ContextID. So, where is truth? Michal From owner-svn-src-head@freebsd.org Sun Jan 14 06:03:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 090F6E7D839; Sun, 14 Jan 2018 06:03:42 +0000 (UTC) (envelope-from bryanv@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D79766D76B; Sun, 14 Jan 2018 06:03:41 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A78B1DD37; Sun, 14 Jan 2018 06:03: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 w0E63eu8072240; Sun, 14 Jan 2018 06:03:40 GMT (envelope-from bryanv@FreeBSD.org) Received: (from bryanv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0E63efU072238; Sun, 14 Jan 2018 06:03:40 GMT (envelope-from bryanv@FreeBSD.org) Message-Id: <201801140603.w0E63efU072238@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bryanv set sender to bryanv@FreeBSD.org using -f From: Bryan Venteicher Date: Sun, 14 Jan 2018 06:03:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327958 - head/sys/dev/virtio X-SVN-Group: head X-SVN-Commit-Author: bryanv X-SVN-Commit-Paths: head/sys/dev/virtio X-SVN-Commit-Revision: 327958 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jan 2018 06:03:42 -0000 Author: bryanv Date: Sun Jan 14 06:03:40 2018 New Revision: 327958 URL: https://svnweb.freebsd.org/changeset/base/327958 Log: Sync VirtIO IDs with Linux Modified: head/sys/dev/virtio/virtio.c head/sys/dev/virtio/virtio_ids.h Modified: head/sys/dev/virtio/virtio.c ============================================================================== --- head/sys/dev/virtio/virtio.c Sun Jan 14 05:10:02 2018 (r327957) +++ head/sys/dev/virtio/virtio.c Sun Jan 14 06:03:40 2018 (r327958) @@ -54,14 +54,21 @@ static struct virtio_ident { uint16_t devid; const char *name; } virtio_ident_table[] = { - { VIRTIO_ID_NETWORK, "Network" }, - { VIRTIO_ID_BLOCK, "Block" }, - { VIRTIO_ID_CONSOLE, "Console" }, - { VIRTIO_ID_ENTROPY, "Entropy" }, - { VIRTIO_ID_BALLOON, "Balloon" }, - { VIRTIO_ID_IOMEMORY, "IOMemory" }, - { VIRTIO_ID_SCSI, "SCSI" }, - { VIRTIO_ID_9P, "9P Transport" }, + { VIRTIO_ID_NETWORK, "Network" }, + { VIRTIO_ID_BLOCK, "Block" }, + { VIRTIO_ID_CONSOLE, "Console" }, + { VIRTIO_ID_ENTROPY, "Entropy" }, + { VIRTIO_ID_BALLOON, "Balloon" }, + { VIRTIO_ID_IOMEMORY, "IOMemory" }, + { VIRTIO_ID_RPMSG, "Remote Processor Messaging" }, + { VIRTIO_ID_SCSI, "SCSI" }, + { VIRTIO_ID_9P, "9P Transport" }, + { VIRTIO_ID_RPROC_SERIAL, "Remote Processor Serial" }, + { VIRTIO_ID_CAIF, "CAIF" }, + { VIRTIO_ID_GPU, "GPU" }, + { VIRTIO_ID_INPUT, "Input" }, + { VIRTIO_ID_VSOCK, "VSOCK Transport" }, + { VIRTIO_ID_CRYPTO, "Crypto" }, { 0, NULL } }; Modified: head/sys/dev/virtio/virtio_ids.h ============================================================================== --- head/sys/dev/virtio/virtio_ids.h Sun Jan 14 05:10:02 2018 (r327957) +++ head/sys/dev/virtio/virtio_ids.h Sun Jan 14 06:03:40 2018 (r327958) @@ -32,13 +32,20 @@ #define _VIRTIO_IDS_H_ /* VirtIO device IDs. */ -#define VIRTIO_ID_NETWORK 0x01 -#define VIRTIO_ID_BLOCK 0x02 -#define VIRTIO_ID_CONSOLE 0x03 -#define VIRTIO_ID_ENTROPY 0x04 -#define VIRTIO_ID_BALLOON 0x05 -#define VIRTIO_ID_IOMEMORY 0x06 -#define VIRTIO_ID_SCSI 0x08 -#define VIRTIO_ID_9P 0x09 +#define VIRTIO_ID_NETWORK 1 +#define VIRTIO_ID_BLOCK 2 +#define VIRTIO_ID_CONSOLE 3 +#define VIRTIO_ID_ENTROPY 4 +#define VIRTIO_ID_BALLOON 5 +#define VIRTIO_ID_IOMEMORY 6 +#define VIRTIO_ID_RPMSG 7 +#define VIRTIO_ID_SCSI 8 +#define VIRTIO_ID_9P 9 +#define VIRTIO_ID_RPROC_SERIAL 11 +#define VIRTIO_ID_CAIF 12 +#define VIRTIO_ID_GPU 16 +#define VIRTIO_ID_INPUT 18 +#define VIRTIO_ID_VSOCK 19 +#define VIRTIO_ID_CRYPTO 20 #endif /* _VIRTIO_IDS_H_ */ From owner-svn-src-head@freebsd.org Sun Jan 14 06:44:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E37B0E7F25C; Sun, 14 Jan 2018 06:44:04 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id 4D7296EA04; Sun, 14 Jan 2018 06:44:03 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id BC951D4E96D; Sun, 14 Jan 2018 17:43:52 +1100 (AEDT) Date: Sun, 14 Jan 2018 17:43:51 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Warner Losh cc: Bruce Evans , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327767 - in head/sys: conf i386/bios i386/conf i386/isa In-Reply-To: Message-ID: <20180114153454.G1566@besplex.bde.org> References: <201801101459.w0AExJWM055025@repo.freebsd.org> <20180113203848.L2336@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=DIX/22Fb c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=8ujBOD_qxemk63mlJY8A:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jan 2018 06:44:05 -0000 On Sat, 13 Jan 2018, Warner Losh wrote: > [trimmed, sorry ] Your mail client also corrupted the formatting, especially for tabs. It sends plain text with tabs corrupted to spaces and an html attachment with full-width tabs corrupted to "=C2=A0 =C2=A0 =C2=A0 =C2=A0 ", both with charset UTF-8. The plain text is readable, but some (non-UTF-8-aware) mail clients apparently display the html and further corrupt the tab to "\xc2\xa0 \xc2\xa0 \xc2\xa0 \xc2\xa0". With my default font, 0xc2 is rendered as a line-drawing graphics character, \xa0 is rendered as a space, and " " is rendered as a space. The html is further mis-displayed by adding a large left margin. The same mail client doesn't do this for html attachments from other senders. The same mail client quotes only the plain text for replies. Other senders tend to put raw '\xa0' in the plain text after corrupting tabs to that, and this is preserved in replies. Non-UTF-8-aware vi renders '\xa0' as "\xa0" so that the errors are more obvious. >> Log: >>> Retire pmtimer driver. Move time fixing into apm driver. Move >>> Iwasaki-san's copyright over. Remove FIXME code that couldn't possibly >>> work. Call tc_settime() with our estimate of the delta we've been >>> alseep (the one we print) to adjust the time. Not sure what to do >>> about callouts, so keep the small #ifdef in place there. >>> ... At least the quoting seems to be correct (in the plain text version). >> @@ -331,12 +358,10 @@ apm_battery_low(void) >>> static struct apmhook * >>> apm_add_hook(struct apmhook **list, struct apmhook *ah) >>> { >>> - int s; >>> struct apmhook *p, *prev; >>> >>> APM_DPRINT("Add hook \"%s\"\n", ah->ah_name); >>> >>> - s = splhigh(); >>> if (ah == NULL) >>> panic("illegal apm_hook!"); >>> prev = NULL; >>> @@ -351,30 +376,25 @@ apm_add_hook(struct apmhook **list, struct apmhook >>> *ah >>> ah->ah_next = prev->ah_next; >>> prev->ah_next = ah; >>> } >>> - splx(s); >>> return ah; >>> } >>> >> >> This commit also removes spl*() with no mention of this in the log message. >> In FreeBSD-4 where spl's were not null, splhigh() was probably wrong, but >> it >> was much better than the splsoftclock() used in pmtimer.c. Hard clock >> interrupts should be disabled, and my fixes for this change softclock to >> statclock + XXX. It happens that splstatclock() == splclock() == >> splhigh(), >> so these splhigh()s were good enough. Actually, the quoting is broken by splitting long lines in a simple way -- the method seems to be to reformat to width 80 without reformatting whole paragraphs. This is only bad for source code. Reformatting "paragraphs" in source code would be worse. >> Now the locking is obscure. I think it is just Giant, and that is not >> enough. The spl's should not be removed until the locking is done >> properly. >> The splsoftclock()'s were removed even earlier in pmtimer.c, without doing >> any proper locking of course. > > Right, nothing calls these, except in attach, so I removed the broken > locking rather than fixing it. Attach also uses Giant locking, and it is not clear that this is enough. It is certainly not enough for detach. Locking hints should be kept until Giant goes away. Perhaps they could be assertions that Giant is held (with this implicitly implying that Giant is enough), but it is easier to keep using the spls. > > static void >>> apm_del_hook(struct apmhook **list, struct apmhook *ah) >>> { >>> - int s; >>> struct apmhook *p, *prev; >>> >>> - s = splhigh(); >>> prev = NULL; >>> for (p = *list; p != NULL; prev = p, p = p->ah_next) >>> if (p == ah) >>> goto deleteit; >>> panic("Tried to delete unregistered apm_hook."); >>> - goto nosuchnode; >>> + return; >>> deleteit: >>> if (prev != NULL) >>> prev->ah_next = p->ah_next; >>> else >>> *list = p->ah_next; >>> -nosuchnode: >>> - splx(s); >>> } >>> >> >> Locking for device removal is especially necessary and badly done. New-bus >> forces lots of Giant locking which is probably not enough. > > what calls that? I thought that it was for something like detach. apm_del_hook() seems to be just unused garbage. It is only called by apm_hook_disestablish(), but that is never called according to grep. Grep would have missed any magic to generate a call from a .m file. This API also has style bugs: the verbs 'del' and 'disestablish' are in different places; 'disestablish' is too verbose 'del' relatively to concise; both seem to be for destructors of the same thing so why are there 2 of them? Well, the 'del' one is just to do most of the work for the 'disestablish' one. It is only called once so not doing it directly is just an obfuscation. Further grepping shows that apm_hook_disestablish() was last used in FreeBSD-3. It was used by pccard/pccard.c then. In FreeBSD-4 and FreeBSD-8, its non-use looks just like in -current, except its implementation was duplicated for pc98. FreeBSD-3 doesn't support pc98, at least for apm hooks. Similarly for apm_del_hook(): - only for i386 in FreeBSD-3 - its implementation is duplicated for pc98 in FreeBSD-4 and FreeBSD-8, - its use in versions that have it looks just like now. Here is the use in FreeBSD-3: X /* X * pccard_remove_controller - Called when the slot X * driver is unloaded. The plan is to unload X * drivers from the slots, and then remove the X * slots from the slot list, and then finally X * remove the controller structure. Messy... X */ X void X pccard_remove_controller(struct slot_ctrl *ctrl) X { X struct slot *slt, *next, *last = 0; X struct slot_ctrl *cl; X struct pccard_devinfo *devi; X X for (slt = slot_list; slt; slt = next) { X next = slt->next; X /* X * If this slot belongs to this controller, X * remove this slot. X */ X if (slt->ctrl == ctrl) { X pccard_slots[slt->slotnum] = 0; X if (slt->insert_seq) X untimeout(inserted, (void *)slt, slt->insert_ch); X /* X * Unload the drivers attached to this slot. X */ X while (devi = slt->devices) X remove_device(devi); X /* X * Disable the slot and unlink the slot from the X * slot list. X */ X disable_slot(slt); X if (last) X last->next = next; X else X slot_list = next; X #if NAPM > 0 X apm_hook_disestablish(APM_HOOK_SUSPEND, X &s_hook[slt->slotnum]); X apm_hook_disestablish(APM_HOOK_RESUME, X &r_hook[slt->slotnum]); X #endif This is quite complicated. Apparently, any pccard can have an apm hook. pccard removal has all of the usual complications of forced device detach. and apm hook removal^Wdisestabishment too. Further grepping shows that APM_HOOK_RESUME and APM_HOOK_SUSPEND are still used. In FreeBSD-4, they are only used for apm_execute_hook() calls and it is unclear where the hooks are attached^Westablished. In -current, they are also used for apm_hook_establish() calls. These establishment calls are only done in apm_attach(). The functions are public so the might be called from out-of-tree modules, but that would be even more fragile. Detachment doesn't seem to be supported for apm (there is no apm_detach()), so disestablishment is apparently not needed except for the out-of-tree modules. apm_execute_hook() has been static in bios/apm.c since at least FreeBSD-3 so it doesn't have the problems from exporting apm_hook_establish(). apm_hook_estabish() is used by a lot of device drivers in FreeBSD-3: syscons, xe, sound, ze, zp, psm and aic6360 as well as by apm_attach() and pccard_alloc_slot(). It was just as unused as apm_hook_disestabish() in FreeBSD-4 through FreeBSD-11. Someone named imp restored its use in apm_attach() in precisely the commit in this thread (r327767). The combined commit obfuscates this especially well. apm_hook_estabish() is now used again to hook the apm_rtc_suspend() and apm_rtc_resume functions. I can't find any other use of the hooks between FreeBSD-4 and -current (assuming that they are not established by static initialization). The last previous use of them seems to have been removed in r65865. This added pmtimer as a normal device driver so its suspend and resume methods are called in a normal way and the ugly hooks were not needed. pmtimer didn't have an attach method even as a device, so it had no complications for detachment. Similarly, before r65865 and now, it needs no complications for disestablishment and the disestablishment code remains unused. The current commit doesn't undo the removals in r65865 and seems to be missing some details: apm.c r65864: X 6512 phk /* default suspend hook */ X 6512 phk sc->sc_suspend.ah_fun = apm_default_suspend; X 6512 phk sc->sc_suspend.ah_arg = sc; X 6512 phk sc->sc_suspend.ah_name = "default suspend"; X 6512 phk sc->sc_suspend.ah_order = APM_MAX_ORDER; X 3258 dg X 6512 phk /* default resume hook */ X 6512 phk sc->sc_resume.ah_fun = apm_default_resume; X 6512 phk sc->sc_resume.ah_arg = sc; X 6512 phk sc->sc_resume.ah_name = "default resume"; X 6512 phk sc->sc_resume.ah_order = APM_MIN_ORDER; X 3309 phk X 6512 phk apm_hook_establish(APM_HOOK_SUSPEND, &sc->sc_suspend); X 6512 phk apm_hook_establish(APM_HOOK_RESUME , &sc->sc_resume); X 6512 phk X 40751 msmith /* Power the system off using APM */ apm.c r327774 (current): X 40751 msmith /* Power the system off using APM */ X 327767 imp EVENTHANDLER_REGISTER(shutdown_final, apm_power_off, NULL, X 50107 msmith SHUTDOWN_PRI_LAST); X 40751 msmith X 85835 iwasaki /* Register APM again to pass the correct argument of pm_func. */ X 85835 iwasaki power_pm_register(POWER_PM_TYPE_APM, apm_pm_func, sc); X 85835 iwasaki X 6512 phk sc->initialized = 1; X 65865 iwasaki sc->suspending = 0; X 158922 imp sc->running = 0; X 6512 phk X 198707 ed make_dev(&apm_cdevsw, APMDEV_NORMAL, X 198707 ed UID_ROOT, GID_OPERATOR, 0664, "apm"); X 198707 ed make_dev(&apm_cdevsw, APMDEV_CTL, X 198707 ed UID_ROOT, GID_OPERATOR, 0660, "apmctl"); X 327767 imp X 327767 imp sc->sc_suspend.ah_fun = apm_rtc_suspend; X 327767 imp sc->sc_suspend.ah_arg = sc; X 327767 imp apm_hook_establish(APM_HOOK_SUSPEND, &sc->sc_suspend); X 327767 imp X 327767 imp sc->sc_resume.ah_fun = apm_rtc_resume; X 327767 imp sc->sc_resume.ah_arg = sc; X 327767 imp apm_hook_establish(APM_HOOK_RESUME, &sc->sc_resume); This doesn't initialize ah_name or ah_order. ah_name is only used in debugging and error code. Presumably sc_resume is initialized to all-zeros, so ah_name is NULL and the function name is printed as something like "null". ah_order defaulting to 0 presumably gives these hook precedence, but since hooks were unused before there are no other hooks and the fancy precedence code is has no effect. X 327767 imp X 3258 dg return 0; X 3258 dg } Summary: pmtimer should be turned back into a device driver to take advantage of device infrastructure and apm hooks removed. Bruce From owner-svn-src-head@freebsd.org Sun Jan 14 08:30:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0881EB3BF6; Sun, 14 Jan 2018 08:30:45 +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 19E727251D; Sun, 14 Jan 2018 08:30:44 +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 w0E8UaiA020012 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 14 Jan 2018 10:30:40 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w0E8UaiA020012 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w0E8UaAq020011; Sun, 14 Jan 2018 10:30:36 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 14 Jan 2018 10:30:36 +0200 From: Konstantin Belousov To: Nathan Whitehorn Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327950 - in head/sys/powerpc: aim include powerpc ps3 Message-ID: <20180114083036.GX1684@kib.kiev.ua> References: <201801132314.w0DNEra5002692@repo.freebsd.org> <20180113232441.GV1684@kib.kiev.ua> <010d0153-8931-a3c2-db21-dfcbaf848fc0@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-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jan 2018 08:30:45 -0000 On Sat, Jan 13, 2018 at 08:31:40PM -0800, Nathan Whitehorn wrote: > > > On 01/13/18 15:28, Nathan Whitehorn wrote: > > > > > > On 01/13/18 15:24, Konstantin Belousov wrote: > >> On Sat, Jan 13, 2018 at 11:14:53PM +0000, Nathan Whitehorn wrote: > >>> +/* > >>> + * We (usually) have a direct map of all physical memory. All > >>> + * uses of this macro must be gated by a check on hw_direct_map! > >>> + * The location of the direct map may not be 1:1 in future, so use > >>> + * of the macro is recommended; it may also grow an assert that > >>> hw_direct_map > >>> + * is set. > >>> + */ > >>> +#define PHYS_TO_DMAP(x) x > >>> +#define DMAP_TO_PHYS(x) x > >> Take a look at the sys/vm/vm_page.c:vm_page_free_prep() function. > >> > > > > I think the checks in there should work as designed, unless I'm > > missing something. Am I? > > -Nathan > > > > Actually, wait, this is broken if hw_direct_map is not set. I can do an > #ifdef __powerpc__ hack, but do you have opinions for a better MI flag > for "yes, the macro is defined but, no, the direct map may not be > available"? Exactly. You explicitly noted the need to check for the hw_direct_map in the comment, so I did not see a need to explain further. We intended that PHYS_TO_DMAP/DMAP_TO_PHYS become MI KPI. If the symbols are present, their semantic is the unconditional presence and usability of the direct map. sf bufs were rototiled with things like SFBUF_OPTIONAL_DIRECT_MAP, but I dislike it and hope that PHYS_TO_DMAP would be not damaged this way. From owner-svn-src-head@freebsd.org Sun Jan 14 09:09:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E72E9EB5836; Sun, 14 Jan 2018 09:09:57 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 7C3027384D; Sun, 14 Jan 2018 09:09:57 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 88B5542990F; Sun, 14 Jan 2018 20:09:49 +1100 (AEDT) Date: Sun, 14 Jan 2018 20:09:49 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Warner Losh cc: Bruce Evans , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327774 - in head: . sys/i386/bios In-Reply-To: Message-ID: <20180114174409.D1566@besplex.bde.org> References: <201801101725.w0AHP8Ca020379@repo.freebsd.org> <20180113225638.Q2336@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=LKgWeNe9 c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=TWway8tzzH1UduAiW4QA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jan 2018 09:09:58 -0000 On Sat, 13 Jan 2018, Warner Losh wrote: > On Sat, Jan 13, 2018 at 6:17 AM, Bruce Evans wrote: > >> On Wed, 10 Jan 2018, Warner Losh wrote: >> >> Log: >>> inittodr(0) actually sets the time, so there's no need to call >>> tc_setclock(). It's redundant. Tweak UPDATING based on code review of >>> past releases. >> >> No, tc_setclock() is not redundant (except for bugs). initodr(0) sets >> ... >> Untested fixes: >> >> X Index: apm.c >> X =================================================================== >> X --- apm.c (revision 327911) >> X +++ apm.c (working copy) >> X @@ -1067,17 +1067,17 @@ >> X } while (apm_event != PMEV_NOEVENT); >> X } >> X X -static struct timeval suspend_time; >> X -static struct timeval diff_time; >> X +static struct timespec diff_time; >> X +static struct timespec suspend_time; >> X X static int >> X apm_rtc_suspend(void *arg __unused) >> X { >> X X - microtime(&diff_time); >> X - inittodr(0); >> X - microtime(&suspend_time); >> X - timevalsub(&diff_time, &suspend_time); >> X + nanotime(&diff_time); /* not a difference yet */ >> X + inittodr(0); /* set tc to raw time seen by RTC >> */ >> X + nanotime(&suspend_time); /* record this raw time */ >> X + timespecsub(&diff_time, &suspend_time); /* diff between tc and RTC >> */ >> X return (0); >> X } >> X X @@ -1084,23 +1084,22 @@ >> X static int >> X apm_rtc_resume(void *arg __unused) >> X { >> X + struct timespec resume_time, suspend_interval; >> X u_int second, minute, hour; >> >> This already changes too much, so I didn't fix blind truncation of tv_sec >> starting in 2038 or other type botches for second/minute/hour. > > I suspect this code will no longer be running in 2028, let alone 2038. 20 years is not far away. (32-bit) u_int for seconds actually works (if time_t is >= 33 bits signed) until 2106. If time_t is 32 bits signed and tv_sec is negative, then the blind assignment to 'seconds' actually gives sign extension bugs. Excessive fixups and sanity checking probably prevent negative time_t's going near the RTC although they can still be set in software. >> X - struct timeval resume_time, tmp_time; >> X X - /* modified for adjkerntz */ >> X - timer_restore(); /* restore the all timers */ >> X - inittodr(0); /* adjust time to RTC */ >> X - microtime(&resume_time); >> X - getmicrotime(&tmp_time); >> X - timevaladd(&tmp_time, &diff_time); >> X + timer_restore(); >> X + inittodr(0); /* set tc to new raw RTC time */ >> X + nanotime(&resume_time); /* record this raw time */ >> X + tc_setclock(&diff_time); /* restore old diff to tc */ >> >> Fixing tc_setclock() is the easiest part > > tc_setclock() sets the absolute time. It's not a phase shift. Oops. > How is this then, it fixes the delta vs time setting in your version and > tweaks variable names to remove banal comments.... > > static struct timespec suspend_time; /* Saved RTC time at > suspend */ This comment is too banal. The comment is too far to the right, and the mail client highlights this by mangling the line by splitting it. The comment seems to start in column 48. Columns 32 and 40 are normal. Part of the banality is echoing 'suspend' and 'time' from the variable name in the comment. The variable names aren't very good. Shorter names like ts are better in some ways. 'time' in the variable name is no more descriptive than 't'. 'suspend_time' might be either the timestamp of the suspension event or the length of the suspension interval. The clock used to make the timestamp is delicate. It isn't just the RTC, but the RTC converted to a real time by adding a timezone offset and perhaps other magic. (Note that in normal use, inittodr() is only used once at boot time and them the timezone offset is 0. This is the only use where the real time set by inittodr() is fully described as the RTC time. > static struct timespec diff_interval; /* Delta between systime > and RTC */ A better comment, but what is the systime? (it is actually the time for the clock id CLOCK_REALTIME. I spelled this as tc (timecounter). inittodr() really does init the full tc and we then specialize to the real time using nanotime(). nanotime() obviously uses clock id CLOCK_REALTIME so no commit is needed about what this clock id is, but it is subtle that CLOCK_REALTIME is the correct (or least worst) clock id to use. > > static int > apm_rtc_suspend(void *arg __unused) > { > > nanotime(&diff_interval); 'interval' here is worse than 'time'. It is not even redundant like it would be for a difference between timestamps made using the same clock. Here it is the difference between different clocks measure at a time which is the same as possible. This difference is not of an interval. > inittodr(0); /* systime = RTC */ > nanotime(&suspend_time); > timespecsub(&diff_interval, &suspend_time); > > return (0); > } > > static int > apm_rtc_resume(void *arg __unused) > { > struct timespec resume_time, new_time, suspend_interval; new_time is unsorted. > u_int second, minute, hour; Old unsorted declarations (fix later). > > timer_restore(); > inittodr(0); /* Set to updated RTC time */ > nanotime(&resume_time); > new_time = resume_time; Perhaps name it adj_resume_time. > timespecadd(&new_time, &diff_interval); > tc_setclock(&new_time); /* Pre-suspend system time + sleep > time */ The comment is correct, but we haven't calculated the sleep time yet (and we later name it suspend_interval), and the code actually calculates (current_time + adjustment_for_difference_between_clocks_as_calculated_at_ suspend_time) > ... This can be further improved using CLOCK_GETTIME() instead of abusing inittodr(). inittodr() has unwanted side effects including setting the timecounter. CLOCK_GETTIME() really does return the RTC time. Pseudo-code for suspend: nanotime(&now); CLOCK_GETTIME(myrtc, &rtc_now); /* Try omitting utc_offset() adjustment -- see inittodr(). */ delta = now; timespecsub(&delta, &rtc_now); Pseudo-code for resume: CLOCK_GETTIME(myrtc, &rtc_now); now = rtc_now; timespecadd(&now, &delta); tc_setclock(&now); Omitting utc_offset() gives large deltas near utc_offset() instead of near 0, but makes no difference to the result provided utc_offset() doesn't change in between. More locking might be needed to prevent it changing in between. There is some locking for CLOCK_GETTIME() but this doesn't cover sysctl variables usied by utc_offset(). CLOCK_GETTIME() is over-engineered and hard to use. It is hard even for i386/isa code to find its own RTC. Note that myrtc should be same for suspend and resume. For i386 inittodr(), the RTC used to be just the isa one, but inittodr() now loops over all available RTCs and there is no guarantee that it always finds the same one. Bruce From owner-svn-src-head@freebsd.org Sun Jan 14 09:51:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E779EEB74D5; Sun, 14 Jan 2018 09:51:26 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C2BB374ED4; Sun, 14 Jan 2018 09:51:26 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E681820224; Sun, 14 Jan 2018 09:51:25 +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 w0E9pP2p066836; Sun, 14 Jan 2018 09:51:25 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0E9pPvQ066835; Sun, 14 Jan 2018 09:51:25 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201801140951.w0E9pPvQ066835@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 14 Jan 2018 09:51:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327961 - head/usr.bin/truss X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/usr.bin/truss X-SVN-Commit-Revision: 327961 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jan 2018 09:51:27 -0000 Author: tuexen Date: Sun Jan 14 09:51:25 2018 New Revision: 327961 URL: https://svnweb.freebsd.org/changeset/base/327961 Log: Mark the iovec parameters of writev() and readv() as IN and OUT. This makes truss work on readv() as expected. Modified: head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Sun Jan 14 09:33:44 2018 (r327960) +++ head/usr.bin/truss/syscalls.c Sun Jan 14 09:51:25 2018 (r327961) @@ -387,7 +387,7 @@ static struct syscall decoded_syscalls[] = { { .name = "read", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { BinString | OUT, 1 }, { Sizet, 2 } } }, { .name = "readv", .ret_type = 1, .nargs = 3, - .args = { { Int, 0 }, { Iovec, 1 }, { Int, 2 } } }, + .args = { { Int, 0 }, { Iovec | OUT, 1 }, { Int, 2 } } }, { .name = "readlink", .ret_type = 1, .nargs = 3, .args = { { Name, 0 }, { Readlinkres | OUT, 1 }, { Sizet, 2 } } }, { .name = "readlinkat", .ret_type = 1, .nargs = 4, @@ -523,7 +523,7 @@ static struct syscall decoded_syscalls[] = { { .name = "write", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { BinString | IN, 1 }, { Sizet, 2 } } }, { .name = "writev", .ret_type = 1, .nargs = 3, - .args = { { Int, 0 }, { Iovec, 1 }, { Int, 2 } } }, + .args = { { Int, 0 }, { Iovec | IN, 1 }, { Int, 2 } } }, /* Linux ABI */ { .name = "linux_access", .ret_type = 1, .nargs = 2, From owner-svn-src-head@freebsd.org Sun Jan 14 12:08:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1C27E68A36; Sun, 14 Jan 2018 12:08:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ACA7D79333; Sun, 14 Jan 2018 12:08:42 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE0C52174B; Sun, 14 Jan 2018 12:08:41 +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 w0EC8fdp022415; Sun, 14 Jan 2018 12:08:41 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0EC8fjw022410; Sun, 14 Jan 2018 12:08:41 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201801141208.w0EC8fjw022410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 14 Jan 2018 12:08:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327962 - head/lib/libsysdecode X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/lib/libsysdecode X-SVN-Commit-Revision: 327962 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jan 2018 12:08:42 -0000 Author: tuexen Date: Sun Jan 14 12:08:41 2018 New Revision: 327962 URL: https://svnweb.freebsd.org/changeset/base/327962 Log: Add suppor for the supported PR-SCTP policies. Modified: head/lib/libsysdecode/Makefile head/lib/libsysdecode/flags.c head/lib/libsysdecode/mktables head/lib/libsysdecode/sysdecode.h head/lib/libsysdecode/sysdecode_enum.3 Modified: head/lib/libsysdecode/Makefile ============================================================================== --- head/lib/libsysdecode/Makefile Sun Jan 14 09:51:25 2018 (r327961) +++ head/lib/libsysdecode/Makefile Sun Jan 14 12:08:41 2018 (r327962) @@ -50,6 +50,7 @@ MLINKS+=sysdecode_enum.3 sysdecode_acltype.3 \ sysdecode_enum.3 sysdecode_rlimit.3 \ sysdecode_enum.3 sysdecode_rtprio_function.3 \ sysdecode_enum.3 sysdecode_scheduler_policy.3 \ + sysdecode_enum.3 sysdecode_sctp_pr_policy.3 \ sysdecode_enum.3 sysdecode_semctl_cmd.3 \ sysdecode_enum.3 sysdecode_shmctl_cmd.3 \ sysdecode_enum.3 sysdecode_shutdown_how.3 \ Modified: head/lib/libsysdecode/flags.c ============================================================================== --- head/lib/libsysdecode/flags.c Sun Jan 14 09:51:25 2018 (r327961) +++ head/lib/libsysdecode/flags.c Sun Jan 14 12:08:41 2018 (r327962) @@ -1158,3 +1158,10 @@ sysdecode_cap_rights(FILE *fp, cap_rights_t *rightsp) } } } + +const char * +sysdecode_sctp_pr_policy(int policy) +{ + + return (lookup_value(sctpprpolicy, policy)); +} Modified: head/lib/libsysdecode/mktables ============================================================================== --- head/lib/libsysdecode/mktables Sun Jan 14 09:51:25 2018 (r327961) +++ head/lib/libsysdecode/mktables Sun Jan 14 12:08:41 2018 (r327962) @@ -157,6 +157,7 @@ gen_table "sigcode" "SI_[A-Z]+[[:space:]]+0(x[ gen_table "umtxcvwaitflags" "CVWAIT_[A-Z_]+[[:space:]]+0x[0-9]+" "sys/umtx.h" gen_table "umtxrwlockflags" "URWLOCK_PREFER_READER[[:space:]]+0x[0-9]+" "sys/umtx.h" gen_table "caprights" "CAP_[A-Z_]+[[:space:]]+CAPRIGHT\([0-9],[[:space:]]+0x[0-9]{16}ULL\)" "sys/capsicum.h" +gen_table "sctpprpolicy" "SCTP_PR_SCTP_[A-Z_]+" "netinet/sctp_uio.h" "SCTP_PR_SCTP_BUF|SCTP_PR_SCTP_MAX|SCTP_PR_SCTP_ALL" if [ -e "${include_dir}/x86/sysarch.h" ]; then gen_table "sysarchnum" "(AMD64|I386)_[A-Z86_]+[[:space:]]+[0-9]+" "x86/sysarch.h" else Modified: head/lib/libsysdecode/sysdecode.h ============================================================================== --- head/lib/libsysdecode/sysdecode.h Sun Jan 14 09:51:25 2018 (r327961) +++ head/lib/libsysdecode/sysdecode.h Sun Jan 14 12:08:41 2018 (r327962) @@ -90,6 +90,7 @@ bool sysdecode_rfork_flags(FILE *_fp, int _flags, int const char *sysdecode_rlimit(int _resource); const char *sysdecode_rtprio_function(int _function); const char *sysdecode_scheduler_policy(int _policy); +const char *sysdecode_sctp_pr_policy(int _policy); const char *sysdecode_semctl_cmd(int _cmd); bool sysdecode_semget_flags(FILE *_fp, int _flag, int *_rem); bool sysdecode_sendfile_flags(FILE *_fp, int _flags, int *_rem); Modified: head/lib/libsysdecode/sysdecode_enum.3 ============================================================================== --- head/lib/libsysdecode/sysdecode_enum.3 Sun Jan 14 09:51:25 2018 (r327961) +++ head/lib/libsysdecode/sysdecode_enum.3 Sun Jan 14 12:08:41 2018 (r327962) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 3, 2017 +.Dd January 14, 2018 .Dt sysdecode_enum 3 .Os .Sh NAME @@ -53,6 +53,7 @@ .Nm sysdecode_rlimit , .Nm sysdecode_rtprio_function , .Nm sysdecode_scheduler_policy , +.Nm sysdecode_sctp_pr_policy , .Nm sysdecode_semctl_cmd , .Nm sysdecode_shmctl_cmd , .Nm sysdecode_shutdown_how , @@ -126,6 +127,8 @@ .Ft const char * .Fn sysdecode_scheduler_policy "int policy" .Ft const char * +.Fn sysdecode_sctp_pr_policy "int policy" +.Ft const char * .Fn sysdecode_semctl_cmd "int cmd" .Ft const char * .Fn sysdecode_shmctl_cmd "int cmd" @@ -229,6 +232,8 @@ Other functions decode the values described below: .Bl -tag -width "Fn sysdecode_sockaddr_family" .It Fn sysdecode_ipproto An IP protocol. +.It Fn sysdecode_sctp_pr_policy +A PR-SCTP policy. .It Fn sysdecode_signal A process signal. .It Fn sysdecode_sockaddr_family From owner-svn-src-head@freebsd.org Sun Jan 14 12:33:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F986E6D029; Sun, 14 Jan 2018 12:33:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E017A79FF1; Sun, 14 Jan 2018 12: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 35A3421C15; Sun, 14 Jan 2018 12:33:06 +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 w0ECX6sM034660; Sun, 14 Jan 2018 12:33:06 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0ECX6w6034659; Sun, 14 Jan 2018 12:33:06 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201801141233.w0ECX6w6034659@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 14 Jan 2018 12:33:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327963 - head/sys/dev/cpuctl X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/dev/cpuctl X-SVN-Commit-Revision: 327963 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jan 2018 12:33:07 -0000 Author: kib Date: Sun Jan 14 12:33:05 2018 New Revision: 327963 URL: https://svnweb.freebsd.org/changeset/base/327963 Log: When re-evaluating cpu_features, also re-print CPU identification. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/dev/cpuctl/cpuctl.c Modified: head/sys/dev/cpuctl/cpuctl.c ============================================================================== --- head/sys/dev/cpuctl/cpuctl.c Sun Jan 14 12:08:41 2018 (r327962) +++ head/sys/dev/cpuctl/cpuctl.c Sun Jan 14 12:33:05 2018 (r327963) @@ -528,6 +528,7 @@ cpuctl_do_eval_cpu_features(int cpu, struct thread *td identify_cpu1(); identify_cpu2(); restore_cpu(oldcpu, is_bound, td); + printcpuinfo(); return (0); } From owner-svn-src-head@freebsd.org Sun Jan 14 12:36:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CEC78E6D2D7; Sun, 14 Jan 2018 12:36:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AAEF07A1AE; Sun, 14 Jan 2018 12:36:24 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0707D21C23; Sun, 14 Jan 2018 12:36:24 +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 w0ECaNch034815; Sun, 14 Jan 2018 12:36:23 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0ECaNxE034812; Sun, 14 Jan 2018 12:36:23 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201801141236.w0ECaNxE034812@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 14 Jan 2018 12:36:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327964 - in head/sys/x86: include x86 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys/x86: include x86 X-SVN-Commit-Revision: 327964 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jan 2018 12:36:24 -0000 Author: kib Date: Sun Jan 14 12:36:23 2018 New Revision: 327964 URL: https://svnweb.freebsd.org/changeset/base/327964 Log: Enumerate and print Intel CPU features for Speculative Execution Side Channel Mitigations. The definitions are taken from the document 336996-001. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/x86/include/specialreg.h head/sys/x86/include/x86_var.h head/sys/x86/x86/identcpu.c Modified: head/sys/x86/include/specialreg.h ============================================================================== --- head/sys/x86/include/specialreg.h Sun Jan 14 12:33:05 2018 (r327963) +++ head/sys/x86/include/specialreg.h Sun Jan 14 12:36:23 2018 (r327964) @@ -423,6 +423,17 @@ #define CPUID_STDEXT2_SGXLC 0x40000000 /* + * CPUID instruction 7 Structured Extended Features, leaf 0 edx info + */ +#define CPUID_STDEXT3_IBPB 0x04000000 +#define CPUID_STDEXT3_STIBP 0x08000000 +#define CPUID_STDEXT3_ARCH_CAP 0x20000000 + +/* MSR IA32_ARCH_CAP(ABILITIES) bits */ +#define IA32_ARCH_CAP_RDCL_NO 0x00000001 +#define IA32_ARCH_CAP_IBRS_ALL 0x00000002 + +/* * CPUID manufacturers identifiers */ #define AMD_VENDOR_ID "AuthenticAMD" @@ -450,6 +461,8 @@ #define MSR_EBL_CR_POWERON 0x02a #define MSR_TEST_CTL 0x033 #define MSR_IA32_FEATURE_CONTROL 0x03a +#define MSR_IA32_SPEC_CTRL 0x048 +#define MSR_IA32_PRED_CMD 0x049 #define MSR_BIOS_UPDT_TRIG 0x079 #define MSR_BBL_CR_D0 0x088 #define MSR_BBL_CR_D1 0x089 @@ -462,6 +475,7 @@ #define MSR_APERF 0x0e8 #define MSR_IA32_EXT_CONFIG 0x0ee /* Undocumented. Core Solo/Duo only */ #define MSR_MTRRcap 0x0fe +#define MSR_IA32_ARCH_CAP 0x10a #define MSR_BBL_CR_ADDR 0x116 #define MSR_BBL_CR_DECC 0x118 #define MSR_BBL_CR_CTL 0x119 @@ -682,6 +696,13 @@ #define IA32_MISC_EN_LIMCPUID 0x0000000000400000ULL #define IA32_MISC_EN_xTPRD 0x0000000000800000ULL #define IA32_MISC_EN_XDD 0x0000000400000000ULL + +/* MSR IA32_SPEC_CTRL */ +#define IA32_SPEC_CTRL_IBRS 0x0000000000000001ULL +#define IA32_SPEC_CTRL_STIBP 0x0000000000000002ULL + +/* MSR IA32_PRED_CMD */ +#define IA32_PRED_CMD_IBPB_BARRIER 0x0000000000000001ULL /* * PAT modes. Modified: head/sys/x86/include/x86_var.h ============================================================================== --- head/sys/x86/include/x86_var.h Sun Jan 14 12:33:05 2018 (r327963) +++ head/sys/x86/include/x86_var.h Sun Jan 14 12:36:23 2018 (r327964) @@ -52,6 +52,8 @@ extern u_int via_feature_xcrypt; extern u_int cpu_clflush_line_size; extern u_int cpu_stdext_feature; extern u_int cpu_stdext_feature2; +extern u_int cpu_stdext_feature3; +extern uint64_t cpu_ia32_arch_caps; extern u_int cpu_fxsr; extern u_int cpu_high; extern u_int cpu_id; Modified: head/sys/x86/x86/identcpu.c ============================================================================== --- head/sys/x86/x86/identcpu.c Sun Jan 14 12:33:05 2018 (r327963) +++ head/sys/x86/x86/identcpu.c Sun Jan 14 12:36:23 2018 (r327964) @@ -106,8 +106,10 @@ u_int cpu_vendor_id; /* CPU vendor ID */ u_int cpu_fxsr; /* SSE enabled */ u_int cpu_mxcsr_mask; /* Valid bits in mxcsr */ u_int cpu_clflush_line_size = 32; -u_int cpu_stdext_feature; -u_int cpu_stdext_feature2; +u_int cpu_stdext_feature; /* %ebx */ +u_int cpu_stdext_feature2; /* %ecx */ +u_int cpu_stdext_feature3; /* %edx */ +uint64_t cpu_ia32_arch_caps; u_int cpu_max_ext_state_size; u_int cpu_mon_mwait_flags; /* MONITOR/MWAIT flags (CPUID.05H.ECX) */ u_int cpu_mon_min_size; /* MONITOR minimum range size, bytes */ @@ -981,6 +983,16 @@ printcpuinfo(void) ); } + if (cpu_stdext_feature3 != 0) { + printf("\n Structured Extended Features3=0x%b", + cpu_stdext_feature3, + "\020" + "\033IBPB" + "\034STIBP" + "\036ARCH_CAP" + ); + } + if ((cpu_feature2 & CPUID2_XSAVE) != 0) { cpuid_count(0xd, 0x1, regs); if (regs[0] != 0) { @@ -994,6 +1006,15 @@ printcpuinfo(void) } } + if (cpu_ia32_arch_caps != 0) { + printf("\n IA32_ARCH_CAPS=0x%b", + (u_int)cpu_ia32_arch_caps, + "\020" + "\001RDCL_NO" + "\002IBRS_ALL" + ); + } + if (amd_extended_feature_extensions != 0) { printf("\n " "AMD Extended Feature Extensions ID EBX=" @@ -1424,6 +1445,10 @@ identify_cpu2(void) cpu_stdext_feature &= ~cpu_stdext_disable; cpu_stdext_feature2 = regs[2]; + cpu_stdext_feature3 = regs[3]; + + if ((cpu_stdext_feature3 & CPUID_STDEXT3_ARCH_CAP) != 0) + cpu_ia32_arch_caps = rdmsr(MSR_IA32_ARCH_CAP); } } From owner-svn-src-head@freebsd.org Sun Jan 14 12:39:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7A9EE6D55F; Sun, 14 Jan 2018 12:39:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7EFF07A375; Sun, 14 Jan 2018 12:39: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B2D5B21C26; Sun, 14 Jan 2018 12:39:50 +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 w0ECdoPD034957; Sun, 14 Jan 2018 12:39:50 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0ECdoFq034956; Sun, 14 Jan 2018 12:39:50 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201801141239.w0ECdoFq034956@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 14 Jan 2018 12:39:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327965 - head/sys/amd64/include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/include X-SVN-Commit-Revision: 327965 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jan 2018 12:39:51 -0000 Author: kib Date: Sun Jan 14 12:39:50 2018 New Revision: 327965 URL: https://svnweb.freebsd.org/changeset/base/327965 Log: Add STAC and CLAC instructions wrappers. Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D13838 Modified: head/sys/amd64/include/cpufunc.h Modified: head/sys/amd64/include/cpufunc.h ============================================================================== --- head/sys/amd64/include/cpufunc.h Sun Jan 14 12:36:23 2018 (r327964) +++ head/sys/amd64/include/cpufunc.h Sun Jan 14 12:39:50 2018 (r327965) @@ -836,6 +836,20 @@ intr_restore(register_t rflags) write_rflags(rflags); } +static __inline void +stac(void) +{ + + __asm __volatile("stac" : : : "cc"); +} + +static __inline void +clac(void) +{ + + __asm __volatile("clac" : : : "cc"); +} + enum { SGX_ECREATE = 0x0, SGX_EADD = 0x1, From owner-svn-src-head@freebsd.org Sun Jan 14 14:27:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 841E7E724D3; Sun, 14 Jan 2018 14:27:44 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5E15F7DDDA; Sun, 14 Jan 2018 14:27:44 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 952E022E01; Sun, 14 Jan 2018 14:27: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 w0EERhqH081674; Sun, 14 Jan 2018 14:27:43 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0EERgv2081668; Sun, 14 Jan 2018 14:27:42 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201801141427.w0EERgv2081668@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 14 Jan 2018 14:27:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327966 - head/lib/libsysdecode X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/lib/libsysdecode X-SVN-Commit-Revision: 327966 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jan 2018 14:27:44 -0000 Author: tuexen Date: Sun Jan 14 14:27:42 2018 New Revision: 327966 URL: https://svnweb.freebsd.org/changeset/base/327966 Log: Add a function is decode the sinfo_flags of struct sctp_sndrcvinfo. Added: head/lib/libsysdecode/sysdecode_sctp_sinfo_flags.3 (contents, props changed) Modified: head/lib/libsysdecode/Makefile head/lib/libsysdecode/flags.c head/lib/libsysdecode/sysdecode.3 head/lib/libsysdecode/sysdecode.h head/lib/libsysdecode/sysdecode_enum.3 Modified: head/lib/libsysdecode/Makefile ============================================================================== --- head/lib/libsysdecode/Makefile Sun Jan 14 12:39:50 2018 (r327965) +++ head/lib/libsysdecode/Makefile Sun Jan 14 14:27:42 2018 (r327966) @@ -21,6 +21,7 @@ MAN= sysdecode.3 \ sysdecode_ioctlname.3 \ sysdecode_mask.3 \ sysdecode_quotactl_cmd.3 \ + sysdecode_sctp_sinfo_flags.3 \ sysdecode_sigcode.3 \ sysdecode_sockopt_name.3 \ sysdecode_socket_protocol.3 \ Modified: head/lib/libsysdecode/flags.c ============================================================================== --- head/lib/libsysdecode/flags.c Sun Jan 14 12:39:50 2018 (r327965) +++ head/lib/libsysdecode/flags.c Sun Jan 14 14:27:42 2018 (r327966) @@ -1165,3 +1165,31 @@ sysdecode_sctp_pr_policy(int policy) return (lookup_value(sctpprpolicy, policy)); } + +static struct name_table sctpsinfoflags[] = { + X(SCTP_EOF) X(SCTP_ABORT) X(SCTP_UNORDERED) X(SCTP_ADDR_OVER) + X(SCTP_SENDALL) X(SCTP_EOR) X(SCTP_SACK_IMMEDIATELY) XEND +}; + +void +sysdecode_sctp_sinfo_flags(FILE *fp, int sinfo_flags) +{ + const char *temp; + int rem; + bool printed; + + printed = print_mask_0(fp, sctpsinfoflags, sinfo_flags, &rem); + if (rem & ~SCTP_PR_SCTP_ALL) { + fprintf(fp, "%s%#x", printed ? "|" : "", rem & ~SCTP_PR_SCTP_ALL); + printed = true; + rem &= ~SCTP_PR_SCTP_ALL; + } + if (rem != 0) { + temp = sysdecode_sctp_pr_policy(rem); + if (temp != NULL) { + fprintf(fp, "%s%s", printed ? "|" : "", temp); + } else { + fprintf(fp, "%s%#x", printed ? "|" : "", rem); + } + } +} Modified: head/lib/libsysdecode/sysdecode.3 ============================================================================== --- head/lib/libsysdecode/sysdecode.3 Sun Jan 14 12:39:50 2018 (r327965) +++ head/lib/libsysdecode/sysdecode.3 Sun Jan 14 14:27:42 2018 (r327966) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 16, 2017 +.Dd January 14, 2018 .Dt SYSDECODE 3 .Os .Sh NAME @@ -79,6 +79,7 @@ A placeholder for use when the ABI is not known. .Xr sysdecode_kevent 3 , .Xr sysdecode_mask 3 , .Xr sysdecode_quotactl_cmd 3 , +.Xr sysdecode_sctp_sinfo_flags 3 , .Xr sysdecode_sigcode 3 , .Xr sysdecode_socket_protocol 3 , .Xr sysdecode_sockopt_name 3 , Modified: head/lib/libsysdecode/sysdecode.h ============================================================================== --- head/lib/libsysdecode/sysdecode.h Sun Jan 14 12:39:50 2018 (r327965) +++ head/lib/libsysdecode/sysdecode.h Sun Jan 14 14:27:42 2018 (r327966) @@ -91,6 +91,7 @@ const char *sysdecode_rlimit(int _resource); const char *sysdecode_rtprio_function(int _function); const char *sysdecode_scheduler_policy(int _policy); const char *sysdecode_sctp_pr_policy(int _policy); +void sysdecode_sctp_sinfo_flags(FILE *_fp, int _sinfo_flags); const char *sysdecode_semctl_cmd(int _cmd); bool sysdecode_semget_flags(FILE *_fp, int _flag, int *_rem); bool sysdecode_sendfile_flags(FILE *_fp, int _flags, int *_rem); Modified: head/lib/libsysdecode/sysdecode_enum.3 ============================================================================== --- head/lib/libsysdecode/sysdecode_enum.3 Sun Jan 14 12:39:50 2018 (r327965) +++ head/lib/libsysdecode/sysdecode_enum.3 Sun Jan 14 14:27:42 2018 (r327966) @@ -54,6 +54,7 @@ .Nm sysdecode_rtprio_function , .Nm sysdecode_scheduler_policy , .Nm sysdecode_sctp_pr_policy , +.Nm sysdecode_sctp_sinfo_flags , .Nm sysdecode_semctl_cmd , .Nm sysdecode_shmctl_cmd , .Nm sysdecode_shutdown_how , Added: head/lib/libsysdecode/sysdecode_sctp_sinfo_flags.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libsysdecode/sysdecode_sctp_sinfo_flags.3 Sun Jan 14 14:27:42 2018 (r327966) @@ -0,0 +1,55 @@ +.\" +.\" Copyright (c) 2018 Michael Tuexen +.\" 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 January 14, 2018 +.Dt sysdecode_sctp_sinfo_flags 3 +.Os +.Sh NAME +.Nm sysdecode_sctp_sinfo_flags +.Nd output textual description of the sinfo_flags field of struct sctp_sndrcvinfo +.Sh LIBRARY +.Lb libsysdecode +.Sh SYNOPSIS +.In sys/types.h +.In stdbool.h +.In stdio.h +.In sysdecode.h +.Ft void +.Fn sysdecode_sctp_sinfo_flags "FILE *fp" "int sinfo_flags" +.Sh DESCRIPTION +The +.Fn sysdecode_sctp_sinfo_flags +function outputs a textual description of the +.Fa sinfo_flags +member of a +.Vt struct sctp_sndrcvinfo +to the stream +.Fa fp . +In particular, the embedded PR-SCTP policies are handled. +.Sh SEE ALSO +.Xr sysdecode 3 +.Xr sysdecode_sctp_pr_policy 3 From owner-svn-src-head@freebsd.org Sun Jan 14 14:33:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8EE1E72B07; Sun, 14 Jan 2018 14:33:23 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 880EF7E358; Sun, 14 Jan 2018 14:33:23 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BA2F222FA5; Sun, 14 Jan 2018 14:33:22 +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 w0EEXMJr085754; Sun, 14 Jan 2018 14:33:22 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0EEXMOX085752; Sun, 14 Jan 2018 14:33:22 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201801141433.w0EEXMOX085752@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 14 Jan 2018 14:33:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327967 - head/usr.bin/truss X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/usr.bin/truss X-SVN-Commit-Revision: 327967 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jan 2018 14:33:23 -0000 Author: tuexen Date: Sun Jan 14 14:33:22 2018 New Revision: 327967 URL: https://svnweb.freebsd.org/changeset/base/327967 Log: Improve support for sctp_generic_recvmsg() and sctp_generic_sendmsg() and add support for sctp_generic_sendmsg_iov(). Handle the struct iovec argument and the struct sctp_sndrcvinfo arguments. Modified: head/usr.bin/truss/syscall.h head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/syscall.h ============================================================================== --- head/usr.bin/truss/syscall.h Sun Jan 14 14:27:42 2018 (r327966) +++ head/usr.bin/truss/syscall.h Sun Jan 14 14:33:22 2018 (r327967) @@ -82,7 +82,7 @@ enum Argtype { None = 1, Hex, Octal, Int, UInt, LongHe Sockoptname, Msgflags, CapRights, PUInt, PQuadHex, Acltype, Extattrnamespace, Minherit, Mlockall, Mountflags, Msync, Priowhich, Ptraceop, Quotactlcmd, Reboothowto, Rtpriofunc, Schedpolicy, Schedparam, - PSig, Siginfo, Kevent11, Iovec, + PSig, Siginfo, Kevent11, Iovec, Sctpsndrcvinfo, CloudABIAdvice, CloudABIClockID, ClouduABIFDSFlags, CloudABIFDStat, CloudABIFileStat, CloudABIFileType, Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Sun Jan 14 14:27:42 2018 (r327966) +++ head/usr.bin/truss/syscalls.c Sun Jan 14 14:33:22 2018 (r327967) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -428,13 +429,17 @@ static struct syscall decoded_syscalls[] = { { .name = "sched_setscheduler", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { Schedpolicy, 1 }, { Schedparam, 2 } } }, { .name = "sctp_generic_recvmsg", .ret_type = 1, .nargs = 7, - .args = { { Int, 0 }, { Ptr | IN, 1 }, { Int, 2 }, - { Sockaddr | OUT, 3 }, { Ptr | OUT, 4 }, { Ptr | OUT, 5 }, - { Ptr | OUT, 6 } } }, + .args = { { Int, 0 }, { Iovec | OUT, 1 }, { Int, 2 }, + { Sockaddr | OUT, 3 }, { Ptr | OUT, 4 }, + { Sctpsndrcvinfo | OUT, 5 }, { Ptr | OUT, 6 } } }, { .name = "sctp_generic_sendmsg", .ret_type = 1, .nargs = 7, .args = { { Int, 0 }, { BinString | IN, 1 }, { Int, 2 }, - { Sockaddr | IN, 3 }, { Socklent, 4 }, { Ptr | IN, 5 }, - { Msgflags, 6 } } }, + { Sockaddr | IN, 3 }, { Socklent, 4 }, + { Sctpsndrcvinfo | IN, 5 }, { Msgflags, 6 } } }, + { .name = "sctp_generic_sendmsg_iov", .ret_type = 1, .nargs = 7, + .args = { { Int, 0 }, { Iovec | IN, 1 }, { Int, 2 }, + { Sockaddr | IN, 3 }, { Socklent, 4 }, + { Sctpsndrcvinfo | IN, 5 }, { Msgflags, 6 } } }, { .name = "select", .ret_type = 1, .nargs = 5, .args = { { Int, 0 }, { Fd_set, 1 }, { Fd_set, 2 }, { Fd_set, 3 }, { Timeval, 4 } } }, @@ -2203,6 +2208,33 @@ print_arg(struct syscall_args *sc, unsigned long *args fprintf(fp, ",%zu}", iov[i].iov_len); } fprintf(fp, "%s%s", iov_truncated ? ",..." : "", "]"); + break; + } + case Sctpsndrcvinfo: { + struct sctp_sndrcvinfo info; + + if (get_struct(pid, (void *)args[sc->offset], + &info, sizeof(struct sctp_sndrcvinfo)) == -1) { + fprintf(fp, "0x%lx", args[sc->offset]); + break; + } + fprintf(fp, "{sid=%u,", info.sinfo_stream); + if (sc->type & OUT) { + fprintf(fp, "ssn=%u,", info.sinfo_ssn); + } + fputs("flgs=", fp); + sysdecode_sctp_sinfo_flags(fp, info.sinfo_flags); + fprintf(fp, ",ppid=%u,", ntohl(info.sinfo_ppid)); + /* Can't use IN here, since IN is 0 */ + if ((sc->type & OUT) == 0) { + fprintf(fp, "ctx=%u,", info.sinfo_context); + fprintf(fp, "ttl=%u,", info.sinfo_timetolive); + } + if (sc->type & OUT) { + fprintf(fp, "tsn=%u,", info.sinfo_tsn); + fprintf(fp, "cumtsn=%u,", info.sinfo_cumtsn); + } + fprintf(fp, "id=%u}", info.sinfo_assoc_id); break; } From owner-svn-src-head@freebsd.org Sun Jan 14 15:01:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A445E74419; Sun, 14 Jan 2018 15:01:26 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2502C7F453; Sun, 14 Jan 2018 15:01:26 +0000 (UTC) (envelope-from bz@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D88F233EC; Sun, 14 Jan 2018 15:01:25 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0EF1P9K094282; Sun, 14 Jan 2018 15:01:25 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0EF1P1h094281; Sun, 14 Jan 2018 15:01:25 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201801141501.w0EF1P1h094281@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sun, 14 Jan 2018 15:01:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327968 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 327968 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jan 2018 15:01:26 -0000 Author: bz Date: Sun Jan 14 15:01:25 2018 New Revision: 327968 URL: https://svnweb.freebsd.org/changeset/base/327968 Log: Remove trailing whitespace. No functional change. Modified: head/sys/kern/kern_fork.c Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Sun Jan 14 14:33:22 2018 (r327967) +++ head/sys/kern/kern_fork.c Sun Jan 14 15:01:25 2018 (r327968) @@ -69,7 +69,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include @@ -186,7 +186,7 @@ sys_rfork(struct thread *td, struct rfork_args *uap) int nprocs = 1; /* process 0 */ int lastpid = 0; -SYSCTL_INT(_kern, OID_AUTO, lastpid, CTLFLAG_RD, &lastpid, 0, +SYSCTL_INT(_kern, OID_AUTO, lastpid, CTLFLAG_RD, &lastpid, 0, "Last used PID"); /* @@ -219,7 +219,7 @@ sysctl_kern_randompid(SYSCTL_HANDLER_ARGS) else if (pid < 0 || pid > pid_max - 100) /* out of range */ randompid = pid_max - 100; - else if (pid < 100) + else if (pid < 100) /* Make it reasonable */ randompid = 100; else @@ -461,7 +461,7 @@ do_fork(struct thread *td, struct fork_req *fr, struct fdtol->fdl_refcount++; FILEDESC_XUNLOCK(p1->p_fd); } else { - /* + /* * Shared file descriptor table, and different * process leaders. */ From owner-svn-src-head@freebsd.org Sun Jan 14 16:04:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39AACE77BC9; Sun, 14 Jan 2018 16:04:53 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 166ED8182F; Sun, 14 Jan 2018 16:04:53 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5A44423E01; Sun, 14 Jan 2018 16:04:52 +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 w0EG4qub023530; Sun, 14 Jan 2018 16:04:52 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0EG4qJd023529; Sun, 14 Jan 2018 16:04:52 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201801141604.w0EG4qJd023529@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 14 Jan 2018 16:04:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327969 - head/sys/i386/conf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/i386/conf X-SVN-Commit-Revision: 327969 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jan 2018 16:04:53 -0000 Author: emaste Date: Sun Jan 14 16:04:51 2018 New Revision: 327969 URL: https://svnweb.freebsd.org/changeset/base/327969 Log: Enable VIMAGE in i386 GENERIC (revert r327840) We've switched back to ld.bfd on i386 for now. PR: 225077 Sponsored by: The FreeBSD Foundation Modified: head/sys/i386/conf/GENERIC Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Sun Jan 14 15:01:25 2018 (r327968) +++ head/sys/i386/conf/GENERIC Sun Jan 14 16:04:51 2018 (r327969) @@ -28,7 +28,7 @@ makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption -#options VIMAGE # Subsystem virtualization, e.g. VNET +options VIMAGE # Subsystem virtualization, e.g. VNET options INET # InterNETworking options INET6 # IPv6 communications protocols options IPSEC # IP (v4/v6) security From owner-svn-src-head@freebsd.org Sun Jan 14 16:06:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60689E77DA8; Sun, 14 Jan 2018 16:06:29 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (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 2FDEA81A61; Sun, 14 Jan 2018 16:06:28 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from comporellon.tachypleus.net (cpe-75-82-218-62.socal.res.rr.com [75.82.218.62]) (authenticated bits=0) by c.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id w0EG6Ko1016236 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Sun, 14 Jan 2018 08:06:20 -0800 Subject: Re: svn commit: r327950 - in head/sys/powerpc: aim include powerpc ps3 To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201801132314.w0DNEra5002692@repo.freebsd.org> <20180113232441.GV1684@kib.kiev.ua> <010d0153-8931-a3c2-db21-dfcbaf848fc0@freebsd.org> <20180114083036.GX1684@kib.kiev.ua> From: Nathan Whitehorn Message-ID: Date: Sun, 14 Jan 2018 08:06:19 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20180114083036.GX1684@kib.kiev.ua> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Sonic-CAuth: UmFuZG9tSVbhQ86OtD+JcD2TOSEK+9UrN/xCcs0DMgLQa/hbQVm1KZDcs0Dt8nvFaPlyzKpI63yceDG/6GFZkClvIDoCNiCwVjVwCHO2tNU= X-Sonic-ID: C;3kTj20T55xGLP9zi2dYaJA== M;/EVp3ET55xGLP9zi2dYaJA== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jan 2018 16:06:29 -0000 On 01/14/18 00:30, Konstantin Belousov wrote: > On Sat, Jan 13, 2018 at 08:31:40PM -0800, Nathan Whitehorn wrote: >> >> On 01/13/18 15:28, Nathan Whitehorn wrote: >>> >>> On 01/13/18 15:24, Konstantin Belousov wrote: >>>> On Sat, Jan 13, 2018 at 11:14:53PM +0000, Nathan Whitehorn wrote: >>>>> +/* >>>>> + * We (usually) have a direct map of all physical memory. All >>>>> + * uses of this macro must be gated by a check on hw_direct_map! >>>>> + * The location of the direct map may not be 1:1 in future, so use >>>>> + * of the macro is recommended; it may also grow an assert that >>>>> hw_direct_map >>>>> + * is set. >>>>> + */ >>>>> +#define PHYS_TO_DMAP(x) x >>>>> +#define DMAP_TO_PHYS(x) x >>>> Take a look at the sys/vm/vm_page.c:vm_page_free_prep() function. >>>> >>> I think the checks in there should work as designed, unless I'm >>> missing something. Am I? >>> -Nathan >>> >> Actually, wait, this is broken if hw_direct_map is not set. I can do an >> #ifdef __powerpc__ hack, but do you have opinions for a better MI flag >> for "yes, the macro is defined but, no, the direct map may not be >> available"? > Exactly. You explicitly noted the need to check for the hw_direct_map > in the comment, so I did not see a need to explain further. > > We intended that PHYS_TO_DMAP/DMAP_TO_PHYS become MI KPI. If the symbols > are present, their semantic is the unconditional presence and usability of > the direct map. > > sf bufs were rototiled with things like SFBUF_OPTIONAL_DIRECT_MAP, but I > dislike it and hope that PHYS_TO_DMAP would be not damaged this way. > That's unfortunate. Is there any reason you need this to be certain at compile time? That seems to be quite restrictive and not to add a huge amount of performance. Given the exciting variety of MMU modes on PowerPC, there is not any way to guarantee the presence of a direct map at compile time, so the alternative is to invent a whole new kernel signalling mechanism for "direct map is almost certainly available, but might not be", which seems strictly worse, or to have a standard API that PowerPC can't use, which also seems worse. -Nathan From owner-svn-src-head@freebsd.org Sun Jan 14 16:55:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3B4BE7A362; Sun, 14 Jan 2018 16:55:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BEDFC83582; Sun, 14 Jan 2018 16:55:15 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 082EE24621; Sun, 14 Jan 2018 16:55: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 w0EGtE48044165; Sun, 14 Jan 2018 16:55:14 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0EGtEGj044164; Sun, 14 Jan 2018 16:55:14 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201801141655.w0EGtEGj044164@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 14 Jan 2018 16:55:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327970 - head/sbin/fsck_ffs X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/fsck_ffs X-SVN-Commit-Revision: 327970 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jan 2018 16:55:16 -0000 Author: imp Date: Sun Jan 14 16:55:14 2018 New Revision: 327970 URL: https://svnweb.freebsd.org/changeset/base/327970 Log: Report CG checksum mismatches. These errors are non-fatal. The previous behavior is preserved (the CG checksum is fixed). We're just noisy about it now. Reviewed by: kirk@ Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D13884 Modified: head/sbin/fsck_ffs/pass5.c Modified: head/sbin/fsck_ffs/pass5.c ============================================================================== --- head/sbin/fsck_ffs/pass5.c Sun Jan 14 16:04:51 2018 (r327969) +++ head/sbin/fsck_ffs/pass5.c Sun Jan 14 16:55:14 2018 (r327970) @@ -63,7 +63,7 @@ pass5(void) int inomapsize, blkmapsize; struct fs *fs = &sblock; ufs2_daddr_t d, dbase, dmax, start; - int rewritecg = 0; + int rewritecg = 0, cgckadd = 0; struct csum *cs; struct csum_total cstotal; struct inodesc idesc[3]; @@ -80,6 +80,7 @@ pass5(void) reply("ADD CYLINDER GROUP CHECKSUM PROTECTION") != 0) { fs->fs_metackhash |= CK_CYLGRP; rewritecg = 1; + cgckadd = 1; sbdirty(); } if (cvtlevel >= 3) { @@ -177,6 +178,16 @@ pass5(void) cg = cgbp->b_un.b_cg; if (!cg_chkmagic(cg)) pfatal("CG %d: BAD MAGIC NUMBER\n", c); + if ((fs->fs_metackhash & CK_CYLGRP) != 0 && cgckadd == 0) { + uint32_t ckhash, thishash; + + ckhash = cg->cg_ckhash; + cg->cg_ckhash = 0; + thishash = calculate_crc32c(~0L, cg, fs->fs_cgsize); + if (ckhash != thishash) + pwarn("CG %d: BAD CHECKSUM %#x vs %#x", c, ckhash, thishash); + cg->cg_ckhash = ckhash; + } newcg->cg_time = cg->cg_time; newcg->cg_old_time = cg->cg_old_time; newcg->cg_unrefs = cg->cg_unrefs; From owner-svn-src-head@freebsd.org Sun Jan 14 17:01:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 278C1E7A7B7; Sun, 14 Jan 2018 17:01:39 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 01AEC83A0B; Sun, 14 Jan 2018 17:01:39 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3F01424673; Sun, 14 Jan 2018 17:01:38 +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 w0EH1cYM047805; Sun, 14 Jan 2018 17:01:38 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0EH1cIb047803; Sun, 14 Jan 2018 17:01:38 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201801141701.w0EH1cIb047803@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 14 Jan 2018 17:01:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327971 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 327971 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jan 2018 17:01:39 -0000 Author: ian Date: Sun Jan 14 17:01:37 2018 New Revision: 327971 URL: https://svnweb.freebsd.org/changeset/base/327971 Log: Add RTC clock conversions for BCD values, with non-panic validation. RTC clock hardware frequently uses BCD numbers. Currently the low-level bcd2bin() and bin2bcd() functions will KASSERT if given out-of-range BCD values. Every RTC driver must implement its own code for validating the unreliable data coming from the hardware to avoid a potential kernel panic. This change introduces two new functions, clock_bcd_to_ts() and clock_ts_to_bcd(). The former validates its inputs and returns EINVAL if any values are out of range. The latter guarantees the returned data will be valid BCD in a known format (4-digit years, etc). A new bcd_clocktime structure is used with the new functions. It is similar to the original clocktime structure, but defines the fields holding BCD values as uint8_t (uint16_t for year), and adds a PM flag for handling hours using AM/PM mode. PR: 224813 Differential Revision: https://reviews.freebsd.org/D13730 (no reviewers) Modified: head/sys/kern/subr_clock.c head/sys/sys/clock.h Modified: head/sys/kern/subr_clock.c ============================================================================== --- head/sys/kern/subr_clock.c Sun Jan 14 16:55:14 2018 (r327970) +++ head/sys/kern/subr_clock.c Sun Jan 14 17:01:37 2018 (r327971) @@ -199,6 +199,55 @@ clock_ct_to_ts(struct clocktime *ct, struct timespec * return (0); } +int +clock_bcd_to_ts(struct bcd_clocktime *bct, struct timespec *ts, bool ampm) +{ + struct clocktime ct; + int bcent, byear; + + /* + * Year may come in as 2-digit or 4-digit BCD. Split the value into + * separate BCD century and year values for validation and conversion. + */ + bcent = bct->year >> 8; + byear = bct->year & 0xff; + + /* + * Ensure that all values are valid BCD numbers, to avoid assertions in + * the BCD-to-binary conversion routines. clock_ct_to_ts() will further + * validate the field ranges (such as 0 <= min <= 59) during conversion. + */ + if (!validbcd(bcent) || !validbcd(byear) || !validbcd(bct->mon) || + !validbcd(bct->day) || !validbcd(bct->hour) || + !validbcd(bct->min) || !validbcd(bct->sec)) { + if (ct_debug) + printf("clock_bcd_to_ts: bad BCD: " + "[%04x-%02x-%02x %02x:%02x:%02x]\n", + bct->year, bct->mon, bct->day, + bct->hour, bct->min, bct->sec); + return (EINVAL); + } + + ct.year = FROMBCD(byear) + FROMBCD(bcent) * 100; + ct.mon = FROMBCD(bct->mon); + ct.day = FROMBCD(bct->day); + ct.hour = FROMBCD(bct->hour); + ct.min = FROMBCD(bct->min); + ct.sec = FROMBCD(bct->sec); + ct.dow = bct->dow; + ct.nsec = bct->nsec; + + /* If asked to handle am/pm, convert from 12hr+pmflag to 24hr. */ + if (ampm) { + if (ct.hour == 12) + ct.hour = 0; + if (bct->ispm) + ct.hour += 12; + } + + return (clock_ct_to_ts(&ct, ts)); +} + void clock_ts_to_ct(struct timespec *ts, struct clocktime *ct) { @@ -258,6 +307,34 @@ clock_ts_to_ct(struct timespec *ts, struct clocktime * /* Not sure if this interface needs to handle leapseconds or not. */ KASSERT(ct->sec >= 0 && ct->sec <= 60, ("seconds %d not in 0-60", ct->sec)); +} + +void +clock_ts_to_bcd(struct timespec *ts, struct bcd_clocktime *bct, bool ampm) +{ + struct clocktime ct; + + clock_ts_to_ct(ts, &ct); + + /* If asked to handle am/pm, convert from 24hr to 12hr+pmflag. */ + bct->ispm = false; + if (ampm) { + if (ct.hour >= 12) { + ct.hour -= 12; + bct->ispm = true; + } + if (ct.hour == 0) + ct.hour = 12; + } + + bct->year = TOBCD(ct.year % 100) | (TOBCD(ct.year / 100) << 8); + bct->mon = TOBCD(ct.mon); + bct->day = TOBCD(ct.day); + bct->hour = TOBCD(ct.hour); + bct->min = TOBCD(ct.min); + bct->sec = TOBCD(ct.sec); + bct->dow = ct.dow; + bct->nsec = ct.nsec; } int Modified: head/sys/sys/clock.h ============================================================================== --- head/sys/sys/clock.h Sun Jan 14 16:55:14 2018 (r327970) +++ head/sys/sys/clock.h Sun Jan 14 17:01:37 2018 (r327971) @@ -60,9 +60,22 @@ extern int tz_dsttime; int utc_offset(void); /* - * Structure to hold the values typically reported by time-of-day clocks. - * This can be passed to the generic conversion functions to be converted - * to a struct timespec. + * Structure to hold the values typically reported by time-of-day clocks, + * expressed as binary integers (see below for a BCD version). This can be + * passed to the conversion functions to be converted to/from a struct timespec. + * + * On input, the year is interpreted as follows: + * 0 - 69 = 2000 - 2069 + * 70 - 99 = 1970 - 1999 + * 100 - 199 = 2000 - 2099 (Supports hardware "century bit".) + * 200 - 1969 = Invalid. + * 1970 - 9999 = Full 4-digit century+year. + * + * The dow field is ignored (not even validated) on input, but is always + * populated with day-of-week on output. + * + * clock_ct_to_ts() returns EINVAL if any values are out of range. The year + * field will always be 4-digit on output. */ struct clocktime { int year; /* year (4 digit year) */ @@ -77,6 +90,43 @@ struct clocktime { int clock_ct_to_ts(struct clocktime *, struct timespec *); void clock_ts_to_ct(struct timespec *, struct clocktime *); + +/* + * Structure to hold the values typically reported by time-of-day clocks, + * expressed as BCD. This can be passed to the conversion functions to be + * converted to/from a struct timespec. + * + * The clock_bcd_to_ts() function interprets the values in the year through sec + * fields as BCD numbers, and returns EINVAL if any BCD values are out of range. + * After conversion to binary, the values are passed to clock_ct_to_ts() and + * undergo further validation as described above. Year may be 2 or 4-digit BCD, + * interpreted as described above. The nsec field is binary. If the ampm arg + * is true, the incoming hour and ispm values are interpreted as 12-hour am/pm + * representation of the hour, otherwise hour is interpreted as 24-hour and ispm + * is ignored. + * + * The clock_ts_to_bcd() function converts the timespec to BCD values stored + * into year through sec. The value in year will be 4-digit BCD (e.g., + * 0x2017). The mon through sec values will be 2-digit BCD. The nsec field will + * be binary, and the range of dow makes its binary and BCD values identical. + * If the ampm arg is true, the hour and ispm fields are set to the 12-hour + * time plus a pm flag, otherwise the hour is set to 24-hour time and ispm is + * set to false. + */ +struct bcd_clocktime { + uint16_t year; /* year (2 or 4 digit year) */ + uint8_t mon; /* month (1 - 12) */ + uint8_t day; /* day (1 - 31) */ + uint8_t hour; /* hour (0 - 23 or 1 - 12) */ + uint8_t min; /* minute (0 - 59) */ + uint8_t sec; /* second (0 - 59) */ + uint8_t dow; /* day of week (0 - 6; 0 = Sunday) */ + long nsec; /* nanoseconds */ + bool ispm; /* true if hour represents pm time */ +}; + +int clock_bcd_to_ts(struct bcd_clocktime *, struct timespec *, bool ampm); +void clock_ts_to_bcd(struct timespec *, struct bcd_clocktime *, bool ampm); /* * Time-of-day clock functions and flags. These functions might sleep. From owner-svn-src-head@freebsd.org Sun Jan 14 17:05:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9AEEE7ACF6; Sun, 14 Jan 2018 17:05:11 +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 509A183D87; Sun, 14 Jan 2018 17:05:11 +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 w0EH52AT035314 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 14 Jan 2018 19:05:06 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w0EH52AT035314 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w0EH52nH035313; Sun, 14 Jan 2018 19:05:02 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 14 Jan 2018 19:05:02 +0200 From: Konstantin Belousov To: Nathan Whitehorn Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327950 - in head/sys/powerpc: aim include powerpc ps3 Message-ID: <20180114170502.GB1684@kib.kiev.ua> References: <201801132314.w0DNEra5002692@repo.freebsd.org> <20180113232441.GV1684@kib.kiev.ua> <010d0153-8931-a3c2-db21-dfcbaf848fc0@freebsd.org> <20180114083036.GX1684@kib.kiev.ua> 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-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jan 2018 17:05:11 -0000 On Sun, Jan 14, 2018 at 08:06:19AM -0800, Nathan Whitehorn wrote: > > > On 01/14/18 00:30, Konstantin Belousov wrote: > > On Sat, Jan 13, 2018 at 08:31:40PM -0800, Nathan Whitehorn wrote: > >> > >> On 01/13/18 15:28, Nathan Whitehorn wrote: > >>> > >>> On 01/13/18 15:24, Konstantin Belousov wrote: > >>>> On Sat, Jan 13, 2018 at 11:14:53PM +0000, Nathan Whitehorn wrote: > >>>>> +/* > >>>>> + * We (usually) have a direct map of all physical memory. All > >>>>> + * uses of this macro must be gated by a check on hw_direct_map! > >>>>> + * The location of the direct map may not be 1:1 in future, so use > >>>>> + * of the macro is recommended; it may also grow an assert that > >>>>> hw_direct_map > >>>>> + * is set. > >>>>> + */ > >>>>> +#define PHYS_TO_DMAP(x) x > >>>>> +#define DMAP_TO_PHYS(x) x > >>>> Take a look at the sys/vm/vm_page.c:vm_page_free_prep() function. > >>>> > >>> I think the checks in there should work as designed, unless I'm > >>> missing something. Am I? > >>> -Nathan > >>> > >> Actually, wait, this is broken if hw_direct_map is not set. I can do an > >> #ifdef __powerpc__ hack, but do you have opinions for a better MI flag > >> for "yes, the macro is defined but, no, the direct map may not be > >> available"? > > Exactly. You explicitly noted the need to check for the hw_direct_map > > in the comment, so I did not see a need to explain further. > > > > We intended that PHYS_TO_DMAP/DMAP_TO_PHYS become MI KPI. If the symbols > > are present, their semantic is the unconditional presence and usability of > > the direct map. > > > > sf bufs were rototiled with things like SFBUF_OPTIONAL_DIRECT_MAP, but I > > dislike it and hope that PHYS_TO_DMAP would be not damaged this way. > > > > That's unfortunate. Is there any reason you need this to be certain at > compile time? That seems to be quite restrictive and not to add a huge > amount of performance. We tend to start using PHYS_TO_DMAP in MI code. Both amd64 and arm64 do not need a qualification. > Given the exciting variety of MMU modes on > PowerPC, there is not any way to guarantee the presence of a direct map > at compile time, so the alternative is to invent a whole new kernel > signalling mechanism for "direct map is almost certainly available, but > might not be", which seems strictly worse, or to have a standard API > that PowerPC can't use, which also seems worse. Why not use a slight variation of the symbol name, to not confuse MI code ? E.g. PPC_PHYS_TO_DMAP (only as an example, it is not hard to construct a better name). From owner-svn-src-head@freebsd.org Sun Jan 14 17:13:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77E73E7B451; Sun, 14 Jan 2018 17:13:34 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pl0-x231.google.com (mail-pl0-x231.google.com [IPv6:2607:f8b0:400e:c01::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 43D89396; Sun, 14 Jan 2018 17:13:34 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-pl0-x231.google.com with SMTP id q3so2085566plr.8; Sun, 14 Jan 2018 09:13:34 -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=lXDkBDpkE5KSsMdMDAcT/wQT1VdBnE40P1S0IQFdjn4=; b=hYr+gSRPixnsjM8nUUExDPQAWSm61+o/KdbToLg4pdmj0YCsKfxEyAsCUl+i9G3Etw j2zj3vw8QmEr+L47nDslE0/BZNtUVz0FAjEj4YWv1WDo7K39QoRx7asiAC9QEomDplBU r0Ln9SCyi/Pwl9ITSXvCnfasyey2F/siG0QiZrHS8jaW07y8M+bLrC0u1ADQ8sr6TAYy z5qJwUqR5h9DwS6aUtNtES9Lm71pz2ZEJA8G1k/NpfVmQ5qweypm5o+pyNsSkDZ82XKC ZGOeIwvOeLPqKTfjh+2Hc+Go9UnVxCZhytYw70mdM7WYTetld4jAPfAybxKlsb7uw2Bk 1qnw== 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=lXDkBDpkE5KSsMdMDAcT/wQT1VdBnE40P1S0IQFdjn4=; b=meXTbLhI5szXnqrE9aAkOKQkpHM8SspwyETf/NYmesCe169IWzFpFrzWuZPqBGXyRr xqa8CJmVLb/uPS3KngIbuBd5x4zdRXnwgzmBgINyZWEl7rzQyTo4ieJEWCv99tULMARD lfNEWVb1EzsdX09CD/pU/A1i0E2wqfmhtuGDys4mR2U0n+B2EtYtbzsnAdkQ/zGtcN6k HWcHl4fLaXjuakgFY+Epkev+YJrasDBueM5biFfpcSwBXqkUVZXxDW5qlG9XdTNCgGJa 1SqmeWB5PdOx5dMRitXwKqj2xYtS7QZdv+3DZ6MJEf9eBSVgYKnZPQFgKhcnqIg8tn6B nRMw== X-Gm-Message-State: AKwxytcGVXP+/7Y184GHgs8Pzptv9dEP/N2f2Quw6BlOiVsBdm7K+MSB vCHAtOXwKqoScFV9TIBY5r8= X-Google-Smtp-Source: ACJfBovNYIX9AiVh47xy7uEUSw9zQrIipk3WE1HBjtkJLPiUA/cXILxG9zWlQ9NlIZ/J8jRhv5wc4w== X-Received: by 10.84.234.199 with SMTP id i7mr1436442plt.368.1515950013577; Sun, 14 Jan 2018 09:13:33 -0800 (PST) Received: from raichu (toroon0560w-lp140-02-70-49-169-112.dsl.bell.ca. [70.49.169.112]) by smtp.gmail.com with ESMTPSA id u79sm32284591pfg.141.2018.01.14.09.13.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Jan 2018 09:13:32 -0800 (PST) Sender: Mark Johnston Date: Sun, 14 Jan 2018 12:13:27 -0500 From: Mark Johnston To: Mateusz Guzik Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327888 - in head: cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety cddl/contrib/opensolaris/lib/libdtrace/common cddl/usr.sbin/dtrace/tests/common/safety sys/cddl/contrib/ope... Message-ID: <20180114171327.GA89171@raichu> References: <201801121959.w0CJxlaw010074@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-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jan 2018 17:13:34 -0000 On Fri, Jan 12, 2018 at 11:37:51PM +0100, Mateusz Guzik wrote: > On Fri, Jan 12, 2018 at 8:59 PM, Mark Johnston wrote: > > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c > > ============================================================ > > ================== > > --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c > > Fri Jan 12 18:44:28 2018 (r327887) > > +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c > > Fri Jan 12 19:59:46 2018 (r327888) > > @@ -3654,6 +3654,24 @@ dtrace_dif_variable(dtrace_mstate_t *mstate, > > dtrace_st > > return (dtrace_dif_varstr( > > (uintptr_t)curthread->t_procp->p_zone->zone_name, > > state, mstate)); > > +#elif defined(__FreeBSD__) > > + /* > > + * On FreeBSD, we introduce compatibility to zonename by falling > > through > > + * into jailname. > > + */ > > + case DIF_VAR_JAILNAME: > > + if (!dtrace_priv_kernel(state)) > > + return (0); > > + > > + return (dtrace_dif_varstr( > > + (uintptr_t)curthread->t_procp- > > >p_ucred->cr_prison->pr_name, > > + state, mstate)); > > + > > > > Why t_procp? It's the field name used in upstream (illumos) code, but we can just use the FreeBSD field names. > curthread->td_proc creds are what is used for permission > checking and it > rarely temporarily goes out of sync with proc's creds. However, if someone > changes creds > while this tracing is enabled this extra dereference risks accessing a > freed object. On the > other hand curthread creads are always safe to read. Thanks. I'll fix this. From owner-svn-src-head@freebsd.org Sun Jan 14 17:14:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5B71E7B570; Sun, 14 Jan 2018 17:14:53 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pl0-x230.google.com (mail-pl0-x230.google.com [IPv6:2607:f8b0:400e:c01::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 8141E782; Sun, 14 Jan 2018 17:14:53 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-pl0-x230.google.com with SMTP id d21so2087917pll.1; Sun, 14 Jan 2018 09:14:53 -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=mzmmiRTqez8Jy0dlz2V53Fb5dQPSHFbgwQ2O9IHf6os=; b=Sv31aRzbjYO/a0QuFl67anoDegXQ6S9VC0/H1UjpvyAzKgOT/q26zY0idPwTBCynw9 UiMzHBTWPlrjVQH5eBOEARBSH5E6ScvoIqdUk9VMrgmEss12ZrbTOvykFrk+QYEfGK44 u7tbYTh/T0RztN1VDJkvTpNHuRHQLfcgy33sHNhLxfYQD6OUAr0RRBHTBiY+RL2E97+o 9ULDL7G7pS9iVhtS5ITGvlQwN6fAPGhNOoxXHo82cjY/oxlOaRBjDW5DmSnIjH//GOIe Eb7VjYM0mmb3KDXmVr2VGIAQWBkivZObKZ2N1YBmLB4UET2dbO8460JL+oVddTQzJ3k8 tY1A== 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=mzmmiRTqez8Jy0dlz2V53Fb5dQPSHFbgwQ2O9IHf6os=; b=oX8A4Sj9JNIfWPma3RHtBvLdt58y59wSweoLiHEOtsMb9W0sueizP29lJTFj0DPtdI uZzh1JazgnTjhckYKMZrwn47Do14wthBC5ePxs11OGpWYLULxiFuP2xgnlHhT2dWuSwT QZcjkRRpuUgBOoIyXXzVk3rZET/QiDmsg/N90nOWTz1jmvYAsCqKMXTMVduDRwiqeXEz AsEo7LFfMlcMNh5G4gfkcUmZ4aRVs2tiE2DzNhJ5vylltPD+1nfP05Zmn27vb4aAFNUG XqJODql7haCpEwMUNFtIuqlw4B0ZjxmW583dLEZJDsmwTp/A5CM+qbITxuZ2zd7t8auX ge4Q== X-Gm-Message-State: AKwxytdWjboi3O21lCnEGccRKKFbikc319yfQ3PUACYtfAE3qOPgwlnx K9BzOAEtDyH7rvv6//kEYybV7g== X-Google-Smtp-Source: ACJfBosa1GwnxVaShJvLLiC+H+4ExvO2LsWanVSjJ5KuV2ijwTejkAXeqNq6JMKM8HsZWkG4GTW64w== X-Received: by 10.159.242.9 with SMTP id t9mr11895032plr.201.1515950092425; Sun, 14 Jan 2018 09:14:52 -0800 (PST) Received: from raichu (toroon0560w-lp140-02-70-49-169-112.dsl.bell.ca. [70.49.169.112]) by smtp.gmail.com with ESMTPSA id b3sm25923875pga.24.2018.01.14.09.14.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Jan 2018 09:14:51 -0800 (PST) Sender: Mark Johnston Date: Sun, 14 Jan 2018 12:14:48 -0500 From: Mark Johnston To: Pedro Giffuni Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327949 - in head/sys/dev: aacraid advansys ath beri/virtio bnxt bwn ciss cxgbe/crypto esp fb gpio if_ndis iwi kbd liquidio liquidio/base mpr mps mpt mrsas mxge netmap nvme pst ral rp s... Message-ID: <20180114171448.GB89171@raichu> References: <201801132230.w0DMUVmF081985@repo.freebsd.org> <7fe2a0bb-8592-75bc-6f58-cb77e2d6044c@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7fe2a0bb-8592-75bc-6f58-cb77e2d6044c@FreeBSD.org> User-Agent: Mutt/1.9.2 (2017-12-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jan 2018 17:14:53 -0000 On Sat, Jan 13, 2018 at 05:34:24PM -0500, Pedro Giffuni wrote: > > > On 01/13/18 17:30, Pedro F. Giffuni wrote: > > Author: pfg > > Date: Sat Jan 13 22:30:30 2018 > > New Revision: 327949 > > URL: https://svnweb.freebsd.org/changeset/base/327949 > > > > Log: > > dev: make some use of mallocarray(9). > > > > Focus on code where we are doing multiplications within malloc(9). None of > > these is likely to overflow, however the change is still useful as some > > static checkers can benefit from the allocation attributes we use for > > mallocarray. > > > > This initial sweep only covers malloc(9) calls with M_NOWAIT. No good > > reason but I started doing the changes before r327796 and at that time it > > was convenient to make sure the sorrounding code could handle NULL values. > > > For the record, this was part of > > https://reviews.freebsd.org/D13837 > > I didn't mention it in the commit log because I am not ready to close > the revision yet. Some developers have been using the "X-Differential revision:" tag in this case. From owner-svn-src-head@freebsd.org Sun Jan 14 17:30:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6456BE7C0AE; Sun, 14 Jan 2018 17:30:56 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (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 40DD910C5; Sun, 14 Jan 2018 17:30:55 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from comporellon.tachypleus.net (cpe-75-82-218-62.socal.res.rr.com [75.82.218.62]) (authenticated bits=0) by c.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id w0EHUsqm020420 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Sun, 14 Jan 2018 09:30:54 -0800 Subject: Re: svn commit: r327950 - in head/sys/powerpc: aim include powerpc ps3 To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201801132314.w0DNEra5002692@repo.freebsd.org> <20180113232441.GV1684@kib.kiev.ua> <010d0153-8931-a3c2-db21-dfcbaf848fc0@freebsd.org> <20180114083036.GX1684@kib.kiev.ua> <20180114170502.GB1684@kib.kiev.ua> From: Nathan Whitehorn Message-ID: <184ba3ee-a9f7-01ed-bb02-1bcba9acc041@freebsd.org> Date: Sun, 14 Jan 2018 09:30:53 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20180114170502.GB1684@kib.kiev.ua> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Sonic-CAuth: UmFuZG9tSVa7OJ2RnxCvP7vvKPXMN/TTSto2VSnSbtcHHp8xyDIJ/mDMqOItwMWbpjcEPZTQWk8ZPvxFM/GcC0c4LoiS0oJeAlLuY3CoSO4= X-Sonic-ID: C;dNA6rFD55xGWcdzi2dYaJA== M;ckuUrFD55xGWcdzi2dYaJA== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jan 2018 17:30:56 -0000 On 01/14/18 09:05, Konstantin Belousov wrote: > On Sun, Jan 14, 2018 at 08:06:19AM -0800, Nathan Whitehorn wrote: >> >> On 01/14/18 00:30, Konstantin Belousov wrote: >>> On Sat, Jan 13, 2018 at 08:31:40PM -0800, Nathan Whitehorn wrote: >>>> On 01/13/18 15:28, Nathan Whitehorn wrote: >>>>> On 01/13/18 15:24, Konstantin Belousov wrote: >>>>>> On Sat, Jan 13, 2018 at 11:14:53PM +0000, Nathan Whitehorn wrote: >>>>>>> +/* >>>>>>> + * We (usually) have a direct map of all physical memory. All >>>>>>> + * uses of this macro must be gated by a check on hw_direct_map! >>>>>>> + * The location of the direct map may not be 1:1 in future, so use >>>>>>> + * of the macro is recommended; it may also grow an assert that >>>>>>> hw_direct_map >>>>>>> + * is set. >>>>>>> + */ >>>>>>> +#define PHYS_TO_DMAP(x) x >>>>>>> +#define DMAP_TO_PHYS(x) x >>>>>> Take a look at the sys/vm/vm_page.c:vm_page_free_prep() function. >>>>>> >>>>> I think the checks in there should work as designed, unless I'm >>>>> missing something. Am I? >>>>> -Nathan >>>>> >>>> Actually, wait, this is broken if hw_direct_map is not set. I can do an >>>> #ifdef __powerpc__ hack, but do you have opinions for a better MI flag >>>> for "yes, the macro is defined but, no, the direct map may not be >>>> available"? >>> Exactly. You explicitly noted the need to check for the hw_direct_map >>> in the comment, so I did not see a need to explain further. >>> >>> We intended that PHYS_TO_DMAP/DMAP_TO_PHYS become MI KPI. If the symbols >>> are present, their semantic is the unconditional presence and usability of >>> the direct map. >>> >>> sf bufs were rototiled with things like SFBUF_OPTIONAL_DIRECT_MAP, but I >>> dislike it and hope that PHYS_TO_DMAP would be not damaged this way. >>> >> That's unfortunate. Is there any reason you need this to be certain at >> compile time? That seems to be quite restrictive and not to add a huge >> amount of performance. > We tend to start using PHYS_TO_DMAP in MI code. Both amd64 and arm64 do not > need a qualification. > > >> Given the exciting variety of MMU modes on >> PowerPC, there is not any way to guarantee the presence of a direct map >> at compile time, so the alternative is to invent a whole new kernel >> signalling mechanism for "direct map is almost certainly available, but >> might not be", which seems strictly worse, or to have a standard API >> that PowerPC can't use, which also seems worse. > Why not use a slight variation of the symbol name, to not confuse MI code ? > E.g. PPC_PHYS_TO_DMAP (only as an example, it is not hard to construct a > better name). > The immediate consequence of that is that no MI code that knows about direct maps can possibly take advantage of the direct map on this platform. Do we really want that to save some conditional logic that would get optimized out on amd64 and arm64 anyway? I really do not see the benefit here. -Nathan From owner-svn-src-head@freebsd.org Sun Jan 14 17:52:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 655BAE7D19F; Sun, 14 Jan 2018 17:52:19 +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 EB9C21F48; Sun, 14 Jan 2018 17:52:18 +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 w0EHqBp9046498 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 14 Jan 2018 19:52:14 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w0EHqBp9046498 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w0EHqBaP046497; Sun, 14 Jan 2018 19:52:11 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 14 Jan 2018 19:52:11 +0200 From: Konstantin Belousov To: Nathan Whitehorn Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327950 - in head/sys/powerpc: aim include powerpc ps3 Message-ID: <20180114175211.GD1684@kib.kiev.ua> References: <201801132314.w0DNEra5002692@repo.freebsd.org> <20180113232441.GV1684@kib.kiev.ua> <010d0153-8931-a3c2-db21-dfcbaf848fc0@freebsd.org> <20180114083036.GX1684@kib.kiev.ua> <20180114170502.GB1684@kib.kiev.ua> <184ba3ee-a9f7-01ed-bb02-1bcba9acc041@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <184ba3ee-a9f7-01ed-bb02-1bcba9acc041@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-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jan 2018 17:52:19 -0000 On Sun, Jan 14, 2018 at 09:30:53AM -0800, Nathan Whitehorn wrote: > The immediate consequence of that is that no MI code that knows about > direct maps can possibly take advantage of the direct map on this > platform. Do we really want that to save some conditional logic that > would get optimized out on amd64 and arm64 anyway? I really do not see > the benefit here. It is not clear what do you mean. Are you saying that there is no benefit of providing the conditional logic, or that it is not benefit of exclusing powerpc ? I do not object against adding the conditional, but it should not be too clumsy to use. From owner-svn-src-head@freebsd.org Sun Jan 14 17:55:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9FC0E7D37E; Sun, 14 Jan 2018 17:55:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 83223212B; Sun, 14 Jan 2018 17:55: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ABB9924FFB; Sun, 14 Jan 2018 17:55:40 +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 w0EHteBs069430; Sun, 14 Jan 2018 17:55:40 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0EHteFp069429; Sun, 14 Jan 2018 17:55:40 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201801141755.w0EHteFp069429@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 14 Jan 2018 17:55:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327972 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/dtrace X-SVN-Commit-Revision: 327972 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jan 2018 17:55:41 -0000 Author: markj Date: Sun Jan 14 17:55:40 2018 New Revision: 327972 URL: https://svnweb.freebsd.org/changeset/base/327972 Log: Use the thread's ucred struct when fetching jid or jailname. Reported by: mjg X-MFC with: r327888 Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Sun Jan 14 17:01:37 2018 (r327971) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Sun Jan 14 17:55:40 2018 (r327972) @@ -3664,14 +3664,14 @@ dtrace_dif_variable(dtrace_mstate_t *mstate, dtrace_st return (0); return (dtrace_dif_varstr( - (uintptr_t)curthread->t_procp->p_ucred->cr_prison->pr_name, + (uintptr_t)curthread->td_ucred->cr_prison->pr_name, state, mstate)); case DIF_VAR_JID: if (!dtrace_priv_kernel(state)) return (0); - return ((uint64_t)curthread->t_procp->p_ucred->cr_prison->pr_id); + return ((uint64_t)curthread->td_ucred->cr_prison->pr_id); #else return (0); #endif From owner-svn-src-head@freebsd.org Sun Jan 14 17:56:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34E5CE7D4A4; Sun, 14 Jan 2018 17:56:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 101E5241B; Sun, 14 Jan 2018 17:56:20 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 511B724FFC; Sun, 14 Jan 2018 17:56:19 +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 w0EHuJpO069496; Sun, 14 Jan 2018 17:56:19 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0EHuJ4u069495; Sun, 14 Jan 2018 17:56:19 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201801141756.w0EHuJ4u069495@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 14 Jan 2018 17:56:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327973 - head/cddl/usr.sbin/dtrace/tests/tools X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/cddl/usr.sbin/dtrace/tests/tools X-SVN-Commit-Revision: 327973 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jan 2018 17:56:20 -0000 Author: markj Date: Sun Jan 14 17:56:19 2018 New Revision: 327973 URL: https://svnweb.freebsd.org/changeset/base/327973 Log: Remove tst.zonename.d from the list of expected failures. X-MFC with: r327888 Modified: head/cddl/usr.sbin/dtrace/tests/tools/exclude.sh Modified: head/cddl/usr.sbin/dtrace/tests/tools/exclude.sh ============================================================================== --- head/cddl/usr.sbin/dtrace/tests/tools/exclude.sh Sun Jan 14 17:55:40 2018 (r327972) +++ head/cddl/usr.sbin/dtrace/tests/tools/exclude.sh Sun Jan 14 17:56:19 2018 (r327973) @@ -40,7 +40,6 @@ exclude EXFAIL common/misc/tst.include.ksh exclude EXFAIL common/safety/tst.copyin2.d exclude EXFAIL common/safety/tst.msgdsize.d exclude EXFAIL common/safety/tst.msgsize.d -exclude EXFAIL common/safety/tst.zonename.d exclude EXFAIL common/scalars/tst.misc.d exclude EXFAIL common/scalars/tst.selfarray2.d exclude EXFAIL common/sched/tst.enqueue.d From owner-svn-src-head@freebsd.org Sun Jan 14 17:57:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4B2FE7D5C4; Sun, 14 Jan 2018 17:57:16 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (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 94578258D; Sun, 14 Jan 2018 17:57:16 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from comporellon.tachypleus.net (cpe-75-82-218-62.socal.res.rr.com [75.82.218.62]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id w0EHvE89015613 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Sun, 14 Jan 2018 09:57:14 -0800 Subject: Re: svn commit: r327950 - in head/sys/powerpc: aim include powerpc ps3 To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201801132314.w0DNEra5002692@repo.freebsd.org> <20180113232441.GV1684@kib.kiev.ua> <010d0153-8931-a3c2-db21-dfcbaf848fc0@freebsd.org> <20180114083036.GX1684@kib.kiev.ua> <20180114170502.GB1684@kib.kiev.ua> <184ba3ee-a9f7-01ed-bb02-1bcba9acc041@freebsd.org> <20180114175211.GD1684@kib.kiev.ua> From: Nathan Whitehorn Message-ID: Date: Sun, 14 Jan 2018 09:57:14 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20180114175211.GD1684@kib.kiev.ua> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Sonic-CAuth: UmFuZG9tSVZc900QzpK3FaLqJap6wcXAMdg+pRBAI6FkIyvzrfQ8u9dPj1nAG9ZYzc2vZvDoQRC//54EhzrGl5V4m5albj2O0WQqXYKNFSw= X-Sonic-ID: C;EhgrWlT55xGMQuBQ9eIpJw== M;0Jx5WlT55xGMQuBQ9eIpJw== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jan 2018 17:57:16 -0000 On 01/14/18 09:52, Konstantin Belousov wrote: > On Sun, Jan 14, 2018 at 09:30:53AM -0800, Nathan Whitehorn wrote: >> The immediate consequence of that is that no MI code that knows about >> direct maps can possibly take advantage of the direct map on this >> platform. Do we really want that to save some conditional logic that >> would get optimized out on amd64 and arm64 anyway? I really do not see >> the benefit here. > It is not clear what do you mean. Are you saying that there is no benefit > of providing the conditional logic, or that it is not benefit of exclusing > powerpc ? Sorry, that was poorly stated. Let me try again: If we make a PPC_PHYS_TO_DMAP(), but there is an MI PHYS_TO_DMAP() API, consumer code in the MI parts of the kernel won't be able to benefit from the PPC direct map, which seems unfortunate. The cost from a code perspective of having an if (direct_map_available) seems low, since on systems where direct_map_available is defined to be 1, the compiler will optimize it to the same code as if gated by #ifdef. It might be more cumbersome to write the code, however. > I do not object against adding the conditional, but it should not be > too clumsy to use. > OK. Let me try to draft something in the next couple days and see how much of a pain it is in practice. -Nathan From owner-svn-src-head@freebsd.org Sun Jan 14 20:16:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A19CEB4B9D for ; Sun, 14 Jan 2018 20:16:59 +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 33FF86ADF7 for ; Sun, 14 Jan 2018 20:16:59 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22b.google.com with SMTP id l17so1175543ioc.3 for ; Sun, 14 Jan 2018 12:16:59 -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=2N+B2UYEWt3g5b85oStlTs3skNINhhulxc3TyB7TWT4=; b=T16p0CowtZ1nXZU3ni+adtKkHusIsdMmqWYqit5umelJJrZU6UM/niX4YtYXmQPX/L +8yoJo8tigtWVjezMYitoSPjZlQRPKiOJFumhY8YKzOpq9BY3EXP1b6Mj1WO3+ikiG0a XCtT0UawAnalBxPDE40mEgAd76ZMf+0TpxPFMvEqH8KAxQ88whfLmBZnutI1YanSPgbX glf35Rj46hFD3jvMmCrH48UsP19VlB9VG2Gw/NXktaYYhkAs4oqiM02EJU8Uouu89ya+ h3cu8lS3IijSCIsdGWNyBSbKJtAhEm5TQCEqqUHNFBrCsUhAhIOJ8hH1Vb0K/Lb9KPDp 42Bw== 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=2N+B2UYEWt3g5b85oStlTs3skNINhhulxc3TyB7TWT4=; b=aeA7rk+BI9Poc8Uzspb6WSuTFPTx0W37I7DNuTPTZ9cN6WIVMMxvBP+tdGrRFxduvk Aw4f5yw2V9nlYZy9oPURAZEQzPCuRY15n28UhBW5zwab0Iwn5rb+MrekemPIYu1Jabnn VzEevi8Nq8xLGd9UoXzeYNBlWVxlnGtuGbc+UXD9Ow+yaDo3YFL4G61iA9l8Ikjj+d7a ycD+TVcTFzLLTAAy4ExPvJBUJXIYWj8IUzYuMqTKN0Exi3HFzHXUPmaLOHhvN/f81wvk mrtcy+I/z0qsd0ICnqxdw5pZ/S/T2W3b3fYEvFOHk2aH7O65t/jSq/d7vFm3uagzIEmk 3cCw== X-Gm-Message-State: AKGB3mJv7NmlNjXNjhHUemR5EbYsSg68OyB7FMDuiXaXsAWyKjn+HkEq t0ZsQuvt5XSoFufo7+vWvKH53JfqiWGsV9KBm6HTXQ== X-Google-Smtp-Source: ACJfBovafMnFOVVRSS2qcT5Y3Ghue7KFJ2Ni0Uu+iXxfsrLxDEKT2AhybB3y8UyuwtvgkISjnNU6Ij2DJkGhW2H7WxM= X-Received: by 10.107.180.151 with SMTP id d145mr29425717iof.136.1515961018371; Sun, 14 Jan 2018 12:16:58 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.199.131 with HTTP; Sun, 14 Jan 2018 12:16:57 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:a98c:bd66:bb3a:60ec] Received: by 10.79.199.131 with HTTP; Sun, 14 Jan 2018 12:16:57 -0800 (PST) In-Reply-To: <20180114171448.GB89171@raichu> References: <201801132230.w0DMUVmF081985@repo.freebsd.org> <7fe2a0bb-8592-75bc-6f58-cb77e2d6044c@FreeBSD.org> <20180114171448.GB89171@raichu> From: Warner Losh Date: Sun, 14 Jan 2018 13:16:57 -0700 X-Google-Sender-Auth: e0wFI8ncdI2xFQGosv1Jouj_Mzg Message-ID: Subject: Re: svn commit: r327949 - in head/sys/dev: aacraid advansys ath beri/virtio bnxt bwn ciss cxgbe/crypto esp fb gpio if_ndis iwi kbd liquidio liquidio/base mpr mps mpt mrsas mxge netmap nvme pst ral rp s... To: Mark Johnston 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-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jan 2018 20:16:59 -0000 On Jan 14, 2018 10:15 AM, "Mark Johnston" wrote: On Sat, Jan 13, 2018 at 05:34:24PM -0500, Pedro Giffuni wrote: > > > On 01/13/18 17:30, Pedro F. Giffuni wrote: > > Author: pfg > > Date: Sat Jan 13 22:30:30 2018 > > New Revision: 327949 > > URL: https://svnweb.freebsd.org/changeset/base/327949 > > > > Log: > > dev: make some use of mallocarray(9). > > > > Focus on code where we are doing multiplications within malloc(9). None of > > these is likely to overflow, however the change is still useful as some > > static checkers can benefit from the allocation attributes we use for > > mallocarray. > > > > This initial sweep only covers malloc(9) calls with M_NOWAIT. No good > > reason but I started doing the changes before r327796 and at that time it > > was convenient to make sure the sorrounding code could handle NULL values. > > > For the record, this was part of > > https://reviews.freebsd.org/D13837 > > I didn't mention it in the commit log because I am not ready to close > the revision yet. Some developers have been using the "X-Differential revision:" tag in this case. I just list it per normal, but reopen the review if I need to. Warner From owner-svn-src-head@freebsd.org Sun Jan 14 20:31:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 215EFEB56EF; Sun, 14 Jan 2018 20:31:00 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F21056B96B; Sun, 14 Jan 2018 20:30:59 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 49D9E26876; Sun, 14 Jan 2018 20:30: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 w0EKUxFp033206; Sun, 14 Jan 2018 20:30:59 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0EKUxp6033205; Sun, 14 Jan 2018 20:30:59 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201801142030.w0EKUxp6033205@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sun, 14 Jan 2018 20:30:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327975 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 327975 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jan 2018 20:31:00 -0000 Author: eadler Date: Sun Jan 14 20:30:58 2018 New Revision: 327975 URL: https://svnweb.freebsd.org/changeset/base/327975 Log: vmm(4): add to Makefile r326281 added the vmm man page, but it needs to be installed. PR: 205705 Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Sun Jan 14 20:23:44 2018 (r327974) +++ head/share/man/man4/Makefile Sun Jan 14 20:30:58 2018 (r327975) @@ -555,6 +555,7 @@ MAN= aac.4 \ ${_virtio_scsi.4} \ vkbd.4 \ vlan.4 \ + vmm.4 \ vxlan.4 \ ${_vmx.4} \ vpo.4 \ From owner-svn-src-head@freebsd.org Sun Jan 14 20:36:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0ADE0EB5D8F; Sun, 14 Jan 2018 20:36:23 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D4FD76BF49; Sun, 14 Jan 2018 20:36:22 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B9F426A14; Sun, 14 Jan 2018 20:36:22 +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 w0EKaLlY037383; Sun, 14 Jan 2018 20:36:21 GMT (envelope-from phk@FreeBSD.org) Received: (from phk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0EKaL2S037380; Sun, 14 Jan 2018 20:36:21 GMT (envelope-from phk@FreeBSD.org) Message-Id: <201801142036.w0EKaL2S037380@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phk set sender to phk@FreeBSD.org using -f From: Poul-Henning Kamp Date: Sun, 14 Jan 2018 20:36:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327976 - in head/sys: arm/broadcom/bcm2835 dts/arm modules/rpi_pwm X-SVN-Group: head X-SVN-Commit-Author: phk X-SVN-Commit-Paths: in head/sys: arm/broadcom/bcm2835 dts/arm modules/rpi_pwm X-SVN-Commit-Revision: 327976 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jan 2018 20:36:23 -0000 Author: phk Date: Sun Jan 14 20:36:21 2018 New Revision: 327976 URL: https://svnweb.freebsd.org/changeset/base/327976 Log: Add a rudimentary PWM driver for the RaspberryPi. Control is through sysctl, only GPIO12 supported. bootverbose creates sysctls for direct mangling of relevant registers. Only tested on RPI2 Added: head/sys/arm/broadcom/bcm2835/bcm2835_pwm.c (contents, props changed) head/sys/modules/rpi_pwm/ head/sys/modules/rpi_pwm/Makefile (contents, props changed) Modified: head/sys/dts/arm/bcm2836.dtsi Added: head/sys/arm/broadcom/bcm2835/bcm2835_pwm.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/broadcom/bcm2835/bcm2835_pwm.c Sun Jan 14 20:36:21 2018 (r327976) @@ -0,0 +1,439 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * 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. + * + * 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 + +static struct ofw_compat_data compat_data[] = { + {"broadcom,bcm2835-pwm", 1}, + {"brcm,bcm2835-pwm", 1}, + {NULL, 0} +}; + +struct bcm_pwm_softc { + device_t sc_dev; + + struct resource * sc_mem_res; + bus_space_tag_t sc_m_bst; + bus_space_handle_t sc_m_bsh; + + struct resource * sc_clk_res; + bus_space_tag_t sc_c_bst; + bus_space_handle_t sc_c_bsh; + + uint32_t freq; + uint32_t period; + uint32_t ratio; + uint32_t mode; + +}; + +#define BCM_PWM_MEM_WRITE(_sc, _off, _val) \ + bus_space_write_4(_sc->sc_m_bst, _sc->sc_m_bsh, _off, _val) +#define BCM_PWM_MEM_READ(_sc, _off) \ + bus_space_read_4(_sc->sc_m_bst, _sc->sc_m_bsh, _off) +#define BCM_PWM_CLK_WRITE(_sc, _off, _val) \ + bus_space_write_4(_sc->sc_c_bst, _sc->sc_c_bsh, _off, _val) +#define BCM_PWM_CLK_READ(_sc, _off) \ + bus_space_read_4(_sc->sc_c_bst, _sc->sc_c_bsh, _off) + +#define W_CTL(_sc, _val) BCM_PWM_MEM_WRITE(_sc, 0x00, _val) +#define R_CTL(_sc) BCM_PWM_MEM_READ(_sc, 0x00) +#define W_STA(_sc, _val) BCM_PWM_MEM_WRITE(_sc, 0x04, _val) +#define R_STA(_sc) BCM_PWM_MEM_READ(_sc, 0x04) +#define W_RNG(_sc, _val) BCM_PWM_MEM_WRITE(_sc, 0x10, _val) +#define R_RNG(_sc) BCM_PWM_MEM_READ(_sc, 0x10) +#define W_DAT(_sc, _val) BCM_PWM_MEM_WRITE(_sc, 0x14, _val) +#define R_DAT(_sc) BCM_PWM_MEM_READ(_sc, 0x14) + +#define W_CMCLK(_sc, _val) BCM_PWM_CLK_WRITE(_sc, 0x00, 0x5a000000 | (_val)) +#define R_CMCLK(_sc) BCM_PWM_CLK_READ(_sc, 0x00) +#define W_CMDIV(_sc, _val) BCM_PWM_CLK_WRITE(_sc, 0x04, 0x5a000000 | (_val)) +#define R_CMDIV(_s) BCM_PWM_CLK_READ(_sc, 0x04) + +static int +bcm_pwm_reconf(struct bcm_pwm_softc *sc) +{ + int i; + uint32_t u; + device_t gpio; + + /* Disable PWM */ + W_CTL(sc, 0); + + /* Stop PWM clock */ + W_CMCLK(sc, 6); + for (i = 0; i < 10; i++) { + u = R_CMCLK(sc); + if (!(u&0x80)) + break; + DELAY(1000); + } + if (u&0x80) { + device_printf(sc->sc_dev, "Failed to stop clock\n"); + return(EIO); + } + + if (sc->mode == 0) { + // XXX: GPIO cfg ? + return (0); + } + + /* Ask GPIO0 to set ALT0 for pin 12 */ + gpio = devclass_get_device(devclass_find("gpio"), 0); + if (!gpio) { + device_printf(sc->sc_dev, "cannot find gpio0\n"); + return (ENXIO); + } + bcm_gpio_set_alternate(gpio, 12, BCM_GPIO_ALT0); + + /* Configure divider */ + u = 500000000/sc->freq; + if (u < 4) { + device_printf(sc->sc_dev, "Freq too high (max 125MHz)\n"); + return(EINVAL); + } + if (u > 0xfff) { + device_printf(sc->sc_dev, "Freq too low (min 123Hz)\n"); + return(EINVAL); + } + sc->freq = 500000000/u; + W_CMDIV(sc, u << 12); + + /* Start PWM clock */ + W_CMCLK(sc, 0x16); + for (i = 0; i < 10; i++) { + u = R_CMCLK(sc); + if ((u&0x80)) + break; + DELAY(1000); + } + if (!(u&0x80)) { + device_printf(sc->sc_dev, "Failed to start clock\n"); + return(EIO); + } + + /* Config PWM */ + W_RNG(sc, sc->period); + W_DAT(sc, sc->ratio); + + /* Start PWM */ + if (sc->mode == 1) + W_CTL(sc, 0x81); + else + W_CTL(sc, 0x1); + + return (0); +} + +static int +bcm_pwm_pwm_freq_proc(SYSCTL_HANDLER_ARGS) +{ + struct bcm_pwm_softc *sc; + uint32_t r; + int error; + + sc = (struct bcm_pwm_softc *)arg1; + if (sc->mode == 1) + r = sc->freq / sc->period; + else + r = 0; + error = sysctl_handle_int(oidp, &r, sizeof(r), req); + return (error); +} + + +static int +bcm_pwm_mode_proc(SYSCTL_HANDLER_ARGS) +{ + struct bcm_pwm_softc *sc; + uint32_t r; + int error; + + sc = (struct bcm_pwm_softc *)arg1; + r = sc->mode; + error = sysctl_handle_int(oidp, &r, sizeof(r), req); + if (error != 0 || req->newptr == NULL) + return (error); + if (r > 2) + return (EINVAL); + sc->mode = r; + return (bcm_pwm_reconf(sc)); +} + +static int +bcm_pwm_freq_proc(SYSCTL_HANDLER_ARGS) +{ + struct bcm_pwm_softc *sc; + uint32_t r; + int error; + + sc = (struct bcm_pwm_softc *)arg1; + r = sc->freq; + error = sysctl_handle_int(oidp, &r, sizeof(r), req); + if (error != 0 || req->newptr == NULL) + return (error); + if (r > 125000000) + return (EINVAL); + sc->freq = r; + return (bcm_pwm_reconf(sc)); +} + +static int +bcm_pwm_period_proc(SYSCTL_HANDLER_ARGS) +{ + struct bcm_pwm_softc *sc; + int error; + + sc = (struct bcm_pwm_softc *)arg1; + error = sysctl_handle_int(oidp, &sc->period, sizeof(sc->period), req); + if (error != 0 || req->newptr == NULL) + return (error); + return (bcm_pwm_reconf(sc)); +} + +static int +bcm_pwm_ratio_proc(SYSCTL_HANDLER_ARGS) +{ + struct bcm_pwm_softc *sc; + uint32_t r; + int error; + + sc = (struct bcm_pwm_softc *)arg1; + r = sc->ratio; + error = sysctl_handle_int(oidp, &r, sizeof(r), req); + if (error != 0 || req->newptr == NULL) + return (error); + if (r > sc->period) // XXX >= ? + return (EINVAL); + sc->ratio = r; + BCM_PWM_MEM_WRITE(sc, 0x14, sc->ratio); + return (0); +} + +static int +bcm_pwm_reg_proc(SYSCTL_HANDLER_ARGS) +{ + struct bcm_pwm_softc *sc; + uint32_t reg; + int error; + + sc = (struct bcm_pwm_softc *)arg1; + if (arg2 & 0x100) + reg = BCM_PWM_CLK_READ(sc, arg2 & 0xff); + else + reg = BCM_PWM_MEM_READ(sc, arg2 & 0xff); + + error = sysctl_handle_int(oidp, ®, sizeof(reg), req); + if (error != 0 || req->newptr == NULL) + return (error); + + if (arg2 & 0x100) + BCM_PWM_CLK_WRITE(sc, arg2 & 0xff, reg); + else + BCM_PWM_MEM_WRITE(sc, arg2, reg); + return (0); +} + +static void +bcm_pwm_sysctl_init(struct bcm_pwm_softc *sc) +{ + struct sysctl_ctx_list *ctx; + struct sysctl_oid *tree_node; + struct sysctl_oid_list *tree; + + /* + * Add system sysctl tree/handlers. + */ + ctx = device_get_sysctl_ctx(sc->sc_dev); + tree_node = device_get_sysctl_tree(sc->sc_dev); + tree = SYSCTL_CHILDREN(tree_node); + if (bootverbose) { +#define RR(x,y) \ + SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, y, \ + CTLFLAG_RW | CTLTYPE_UINT, sc, 0x##x, \ + bcm_pwm_reg_proc, "IU", "Register 0x" #x " " y); + + RR(100, "PWMCTL") + RR(104, "PWMDIV") + RR(24, "DAT2") + RR(20, "RNG2") + RR(18, "FIF1") + RR(14, "DAT1") + RR(10, "RNG1") + RR(08, "DMAC") + RR(04, "STA") + RR(00, "CTL") +#undef RR + } + + SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "pwm_freq", + CTLFLAG_RD | CTLTYPE_UINT, sc, 0, + bcm_pwm_pwm_freq_proc, "IU", "PWM frequency (Hz)"); + SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "period", + CTLFLAG_RW | CTLTYPE_UINT, sc, 0, + bcm_pwm_period_proc, "IU", "PWM period (#clocks)"); + SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "ratio", + CTLFLAG_RW | CTLTYPE_UINT, sc, 0, + bcm_pwm_ratio_proc, "IU", "PWM ratio (0...period)"); + SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "freq", + CTLFLAG_RW | CTLTYPE_UINT, sc, 0, + bcm_pwm_freq_proc, "IU", "PWM clock (Hz)"); + SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "mode", + CTLFLAG_RW | CTLTYPE_UINT, sc, 0, + bcm_pwm_mode_proc, "IU", "PWM mode (0=off, 1=pwm, 2=dither)"); +} + +static int +bcm_pwm_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, "BCM2708/2835 PWM controller"); + + return (BUS_PROBE_DEFAULT); +} + +static int +bcm_pwm_attach(device_t dev) +{ + struct bcm_pwm_softc *sc; + int rid; + + if (device_get_unit(dev) != 0) { + device_printf(dev, "only one PWM controller supported\n"); + return (ENXIO); + } + + sc = device_get_softc(dev); + sc->sc_dev = dev; + + rid = 0; + sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (!sc->sc_mem_res) { + device_printf(dev, "cannot allocate memory window\n"); + return (ENXIO); + } + + sc->sc_m_bst = rman_get_bustag(sc->sc_mem_res); + sc->sc_m_bsh = rman_get_bushandle(sc->sc_mem_res); + + rid = 1; + sc->sc_clk_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (!sc->sc_clk_res) { + device_printf(dev, "cannot allocate clock window\n"); + return (ENXIO); + } + sc->sc_c_bst = rman_get_bustag(sc->sc_clk_res); + sc->sc_c_bsh = rman_get_bushandle(sc->sc_clk_res); + + /* Add sysctl nodes. */ + bcm_pwm_sysctl_init(sc); + + sc->freq = 125000000; + sc->period = 10000; + sc->ratio = 2500; + + + return (bus_generic_attach(dev)); +} + +static int +bcm_pwm_detach(device_t dev) +{ + struct bcm_pwm_softc *sc; + + bus_generic_detach(dev); + + sc = device_get_softc(dev); + sc->mode = 0; + (void)bcm_pwm_reconf(sc); + if (sc->sc_mem_res) + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); + if (sc->sc_clk_res) + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_clk_res); + + return (0); +} + +static phandle_t +bcm_pwm_get_node(device_t bus, device_t dev) +{ + + /* We only have one child, the SPI bus, which needs our own node. */ + return (ofw_bus_get_node(bus)); +} + +static device_method_t bcm_pwm_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, bcm_pwm_probe), + DEVMETHOD(device_attach, bcm_pwm_attach), + DEVMETHOD(device_detach, bcm_pwm_detach), + + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_node, bcm_pwm_get_node), + + DEVMETHOD_END +}; + +static devclass_t bcm_pwm_devclass; + +static driver_t bcm_pwm_driver = { + "pwm", + bcm_pwm_methods, + sizeof(struct bcm_pwm_softc), +}; + +DRIVER_MODULE(bcm2835_pwm, simplebus, bcm_pwm_driver, bcm_pwm_devclass, 0, 0); Modified: head/sys/dts/arm/bcm2836.dtsi ============================================================================== --- head/sys/dts/arm/bcm2836.dtsi Sun Jan 14 20:30:58 2018 (r327975) +++ head/sys/dts/arm/bcm2836.dtsi Sun Jan 14 20:36:21 2018 (r327976) @@ -425,6 +425,11 @@ interrupt-parent = <&intc>; }; + pwm0 { + compatible = "broadcom,bcm2835-pwm"; + reg = <0x20c000 0x28>,<0x1010a0 8>; + }; + dma: dma { compatible = "broadcom,bcm2835-dma", "broadcom,bcm2708-dma"; Added: head/sys/modules/rpi_pwm/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/rpi_pwm/Makefile Sun Jan 14 20:36:21 2018 (r327976) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/arm/broadcom/bcm2835/ + +KMOD= rpi_pwm +SRCS= bcm2835_pwm.c + +SRCS+= bus_if.h device_if.h ofw_bus_if.h + +.include From owner-svn-src-head@freebsd.org Sun Jan 14 20:46:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3494EB664E; Sun, 14 Jan 2018 20:46:41 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 80EB56C5A7; Sun, 14 Jan 2018 20:46:41 +0000 (UTC) (envelope-from fsu@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A42EF26BB7; Sun, 14 Jan 2018 20:46:40 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0EKkeEG041393; Sun, 14 Jan 2018 20:46:40 GMT (envelope-from fsu@FreeBSD.org) Received: (from fsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0EKkd1C041381; Sun, 14 Jan 2018 20:46:39 GMT (envelope-from fsu@FreeBSD.org) Message-Id: <201801142046.w0EKkd1C041381@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fsu set sender to fsu@FreeBSD.org using -f From: Fedor Uporov Date: Sun, 14 Jan 2018 20:46:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327977 - head/sys/fs/ext2fs X-SVN-Group: head X-SVN-Commit-Author: fsu X-SVN-Commit-Paths: head/sys/fs/ext2fs X-SVN-Commit-Revision: 327977 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jan 2018 20:46:42 -0000 Author: fsu Date: Sun Jan 14 20:46:39 2018 New Revision: 327977 URL: https://svnweb.freebsd.org/changeset/base/327977 Log: Add metadata_csum feature support. Reviewed by: pfg (mentor) Approved by: pfg (mentor) MFC after: 6 months Differential Revision: https://reviews.freebsd.org/D13810 Modified: head/sys/fs/ext2fs/ext2_alloc.c head/sys/fs/ext2fs/ext2_csum.c head/sys/fs/ext2fs/ext2_dir.h head/sys/fs/ext2fs/ext2_extattr.c head/sys/fs/ext2fs/ext2_extattr.h head/sys/fs/ext2fs/ext2_extents.c head/sys/fs/ext2fs/ext2_extents.h head/sys/fs/ext2fs/ext2_extern.h head/sys/fs/ext2fs/ext2_inode_cnv.c head/sys/fs/ext2fs/ext2_lookup.c head/sys/fs/ext2fs/ext2_subr.c head/sys/fs/ext2fs/ext2_vfsops.c head/sys/fs/ext2fs/ext2_vnops.c head/sys/fs/ext2fs/ext2fs.h head/sys/fs/ext2fs/htree.h Modified: head/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- head/sys/fs/ext2fs/ext2_alloc.c Sun Jan 14 20:36:21 2018 (r327976) +++ head/sys/fs/ext2fs/ext2_alloc.c Sun Jan 14 20:46:39 2018 (r327977) @@ -898,14 +898,22 @@ ext2_alloccg(struct inode *ip, int cg, daddr_t bpref, EXT2_LOCK(ump); return (0); } - if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_GDT_CSUM)) { + if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_GDT_CSUM) || + EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) { error = ext2_cg_block_bitmap_init(fs, cg, bp); if (error) { brelse(bp); EXT2_LOCK(ump); return (0); } + ext2_gd_b_bitmap_csum_set(fs, cg, bp); } + error = ext2_gd_b_bitmap_csum_verify(fs, cg, bp); + if (error) { + brelse(bp); + EXT2_LOCK(ump); + return (0); + } if (e2fs_gd_get_nbfree(&fs->e2fs_gd[cg]) == 0) { /* * Another thread allocated the last block in this @@ -1008,6 +1016,7 @@ gotit: e2fs_gd_get_nbfree(&fs->e2fs_gd[cg]) - 1); fs->e2fs_fmod = 1; EXT2_UNLOCK(ump); + ext2_gd_b_bitmap_csum_set(fs, cg, bp); bdwrite(bp); return (((uint64_t)cg) * fs->e2fs->e2fs_fpg + fs->e2fs->e2fs_first_dblock + bno); } @@ -1187,11 +1196,13 @@ ext2_nodealloccg(struct inode *ip, int cg, daddr_t ipr EXT2_LOCK(ump); return (0); } - if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_GDT_CSUM)) { + if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_GDT_CSUM) || + EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) { if (fs->e2fs_gd[cg].ext4bgd_flags & EXT2_BG_INODE_UNINIT) { memset(bp->b_data, 0, fs->e2fs_bsize); fs->e2fs_gd[cg].ext4bgd_flags &= ~EXT2_BG_INODE_UNINIT; } + ext2_gd_i_bitmap_csum_set(fs, cg, bp); error = ext2_zero_inode_table(ip, cg); if (error) { brelse(bp); @@ -1199,6 +1210,12 @@ ext2_nodealloccg(struct inode *ip, int cg, daddr_t ipr return (0); } } + error = ext2_gd_i_bitmap_csum_verify(fs, cg, bp); + if (error) { + brelse(bp); + EXT2_LOCK(ump); + return (0); + } if (e2fs_gd_get_nifree(&fs->e2fs_gd[cg]) == 0) { /* * Another thread allocated the last i-node in this @@ -1234,7 +1251,8 @@ gotit: EXT2_LOCK(ump); e2fs_gd_set_nifree(&fs->e2fs_gd[cg], e2fs_gd_get_nifree(&fs->e2fs_gd[cg]) - 1); - if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_GDT_CSUM)) + if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_GDT_CSUM) || + EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) e2fs_gd_set_i_unused(&fs->e2fs_gd[cg], e2fs_gd_get_i_unused(&fs->e2fs_gd[cg]) - 1); fs->e2fs->e2fs_ficount--; @@ -1245,6 +1263,7 @@ gotit: fs->e2fs_total_dir++; } EXT2_UNLOCK(ump); + ext2_gd_i_bitmap_csum_set(fs, cg, bp); bdwrite(bp); return ((uint64_t)cg * fs->e2fs_ipg + ipref + 1); } @@ -1293,6 +1312,7 @@ ext2_blkfree(struct inode *ip, e4fs_daddr_t bno, long e2fs_gd_get_nbfree(&fs->e2fs_gd[cg]) + 1); fs->e2fs_fmod = 1; EXT2_UNLOCK(ump); + ext2_gd_b_bitmap_csum_set(fs, cg, bp); bdwrite(bp); } @@ -1338,7 +1358,8 @@ ext2_vfree(struct vnode *pvp, ino_t ino, int mode) fs->e2fs->e2fs_ficount++; e2fs_gd_set_nifree(&fs->e2fs_gd[cg], e2fs_gd_get_nifree(&fs->e2fs_gd[cg]) + 1); - if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_GDT_CSUM)) + if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_GDT_CSUM) || + EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) e2fs_gd_set_i_unused(&fs->e2fs_gd[cg], e2fs_gd_get_i_unused(&fs->e2fs_gd[cg]) + 1); if ((mode & IFMT) == IFDIR) { @@ -1348,6 +1369,7 @@ ext2_vfree(struct vnode *pvp, ino_t ino, int mode) } fs->e2fs_fmod = 1; EXT2_UNLOCK(ump); + ext2_gd_i_bitmap_csum_set(fs, cg, bp); bdwrite(bp); return (0); } Modified: head/sys/fs/ext2fs/ext2_csum.c ============================================================================== --- head/sys/fs/ext2fs/ext2_csum.c Sun Jan 14 20:36:21 2018 (r327976) +++ head/sys/fs/ext2fs/ext2_csum.c Sun Jan 14 20:46:39 2018 (r327977) @@ -43,9 +43,576 @@ #include #include +#include #include +#include +#include +#include #include +#define EXT2_BG_INODE_BITMAP_CSUM_HI_END \ + (offsetof(struct ext2_gd, ext4bgd_i_bmap_csum_hi) + \ + sizeof(uint16_t)) + +#define EXT2_INODE_CSUM_HI_EXTRA_END \ + (offsetof(struct ext2fs_dinode, e2di_chksum_hi) + sizeof(uint16_t) - \ + E2FS_REV0_INODE_SIZE) + +#define EXT2_BG_BLOCK_BITMAP_CSUM_HI_LOCATION \ + (offsetof(struct ext2_gd, ext4bgd_b_bmap_csum_hi) + \ + sizeof(uint16_t)) + +void +ext2_sb_csum_set_seed(struct m_ext2fs *fs) +{ + + if (EXT2_HAS_INCOMPAT_FEATURE(fs, EXT2F_INCOMPAT_CSUM_SEED)) + fs->e2fs_csum_seed = fs->e2fs->e4fs_chksum_seed; + else if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) { + fs->e2fs_csum_seed = calculate_crc32c(~0, fs->e2fs->e2fs_uuid, + sizeof(fs->e2fs->e2fs_uuid)); + } + else + fs->e2fs_csum_seed = 0; +} + +int +ext2_sb_csum_verify(struct m_ext2fs *fs) +{ + + if (fs->e2fs->e4fs_chksum_type != EXT4_CRC32C_CHKSUM) { + printf( +"WARNING: mount of %s denied due bad sb csum type\n", fs->e2fs_fsmnt); + return (EINVAL); + } + if (fs->e2fs->e4fs_sbchksum != + calculate_crc32c(~0, (const char *)fs->e2fs, + offsetof(struct ext2fs, e4fs_sbchksum))) { + printf( +"WARNING: mount of %s denied due bad sb csum=0x%x, expected=0x%x - run fsck\n", + fs->e2fs_fsmnt, fs->e2fs->e4fs_sbchksum, calculate_crc32c(~0, + (const char *)fs->e2fs, offsetof(struct ext2fs, e4fs_sbchksum))); + return (EINVAL); + } + + return (0); +} + +void +ext2_sb_csum_set(struct m_ext2fs *fs) +{ + + fs->e2fs->e4fs_sbchksum = calculate_crc32c(~0, (const char *)fs->e2fs, + offsetof(struct ext2fs, e4fs_sbchksum)); +} + +static uint32_t +ext2_extattr_blk_csum(struct inode *ip, uint64_t facl, + struct ext2fs_extattr_header *header) +{ + struct m_ext2fs *fs; + uint32_t crc, old_crc; + + fs = ip->i_e2fs; + + old_crc = header->h_checksum; + + header->h_checksum = 0; + crc = calculate_crc32c(fs->e2fs_csum_seed, (uint8_t *)&facl, sizeof(facl)); + crc = calculate_crc32c(crc, (uint8_t *)header, fs->e2fs_bsize); + header->h_checksum = old_crc; + + return (crc); +} + +int +ext2_extattr_blk_csum_verify(struct inode *ip, struct buf *bp) +{ + struct ext2fs_extattr_header *header; + + header = (struct ext2fs_extattr_header *)bp->b_data; + + if (EXT2_HAS_RO_COMPAT_FEATURE(ip->i_e2fs, EXT2F_ROCOMPAT_METADATA_CKSUM) && + (header->h_checksum != ext2_extattr_blk_csum(ip, ip->i_facl, header))) { + printf("WARNING: bad extattr csum detected, ip=%lu - run fsck\n", + (unsigned long)ip->i_number); + return (EIO); + } + + return (0); +} + +void +ext2_extattr_blk_csum_set(struct inode *ip, struct buf *bp) +{ + struct ext2fs_extattr_header *header; + + if (!EXT2_HAS_RO_COMPAT_FEATURE(ip->i_e2fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) + return; + + header = (struct ext2fs_extattr_header *)bp->b_data; + header->h_checksum = ext2_extattr_blk_csum(ip, ip->i_facl, header); +} + +static struct ext2fs_direct_tail * +ext2_get_dirent_tail(struct inode *ip, struct ext2fs_direct_2 *ep) +{ + struct ext2fs_direct_tail *tp; + + tp = EXT2_DIRENT_TAIL(ep, ip->i_e2fs->e2fs_bsize); + if (tp->e2dt_reserved_zero1 || + tp->e2dt_rec_len != sizeof(struct ext2fs_direct_tail) || + tp->e2dt_reserved_zero2 || + tp->e2dt_reserved_ft != EXT2_FT_DIR_CSUM) + return (NULL); + + return (tp); +} + +static uint32_t +ext2_dirent_csum(struct inode *ip, struct ext2fs_direct_2 *ep, int size) +{ + struct m_ext2fs *fs; + char *buf; + uint32_t inum, gen, crc; + + fs = ip->i_e2fs; + + buf = (char *)ep; + + inum = ip->i_number; + gen = ip->i_gen; + crc = calculate_crc32c(fs->e2fs_csum_seed, (uint8_t *)&inum, sizeof(inum)); + crc = calculate_crc32c(crc, (uint8_t *)&gen, sizeof(gen)); + crc = calculate_crc32c(crc, (uint8_t *)buf, size); + + return (crc); +} + +static int +ext2_dirent_csum_verify(struct inode *ip, struct ext2fs_direct_2 *ep) +{ + uint32_t calculated; + struct ext2fs_direct_tail *tp; + + tp = ext2_get_dirent_tail(ip, ep); + if (tp == NULL) + return (0); + + calculated = ext2_dirent_csum(ip, ep, (char *)tp - (char *)ep); + if (calculated != tp->e2dt_checksum) + return (EIO); + + return (0); +} + +static struct ext2fs_htree_count * +ext2_get_dx_count(struct inode *ip, struct ext2fs_direct_2 *ep, int *offset) +{ + struct ext2fs_direct_2 *dp; + struct ext2fs_htree_root_info *root; + int count_offset; + + if (ep->e2d_reclen == EXT2_BLOCK_SIZE(ip->i_e2fs)) + count_offset = 8; + else if (ep->e2d_reclen == 12) { + dp = (struct ext2fs_direct_2 *)(((char *)ep) + 12); + if (dp->e2d_reclen != EXT2_BLOCK_SIZE(ip->i_e2fs) - 12) + return (NULL); + + root = (struct ext2fs_htree_root_info *)(((char *)dp + 12)); + if (root->h_reserved1 || + root->h_info_len != sizeof(struct ext2fs_htree_root_info)) + return (NULL); + + count_offset = 32; + } else + return (NULL); + + if (offset) + *offset = count_offset; + + return ((struct ext2fs_htree_count *)(((char *)ep) + count_offset)); +} + +static uint32_t +ext2_dx_csum(struct inode *ip, struct ext2fs_direct_2 *ep, int count_offset, + int count, struct ext2fs_htree_tail *tp) +{ + struct m_ext2fs *fs; + char *buf; + int size; + uint32_t inum, old_csum, gen, crc; + + fs = ip->i_e2fs; + + buf = (char *)ep; + + size = count_offset + (count * sizeof(struct ext2fs_htree_entry)); + old_csum = tp->ht_checksum; + tp->ht_checksum = 0; + + inum = ip->i_number; + gen = ip->i_gen; + crc = calculate_crc32c(fs->e2fs_csum_seed, (uint8_t *)&inum, sizeof(inum)); + crc = calculate_crc32c(crc, (uint8_t *)&gen, sizeof(gen)); + crc = calculate_crc32c(crc, (uint8_t *)buf, size); + crc = calculate_crc32c(crc, (uint8_t *)tp, sizeof(struct ext2fs_htree_tail)); + tp->ht_checksum = old_csum; + + return (crc); +} + +static int +ext2_dx_csum_verify(struct inode *ip, struct ext2fs_direct_2 *ep) +{ + uint32_t calculated; + struct ext2fs_htree_count *cp; + struct ext2fs_htree_tail *tp; + int count_offset, limit, count; + + cp = ext2_get_dx_count(ip, ep, &count_offset); + if (cp == NULL) + return (0); + + limit = cp->h_entries_max; + count = cp->h_entries_num; + if (count_offset + (limit * sizeof(struct ext2fs_htree_entry)) > + ip->i_e2fs->e2fs_bsize - sizeof(struct ext2fs_htree_tail)) + return (EIO); + + tp = (struct ext2fs_htree_tail *)(((struct ext2fs_htree_entry *)cp) + limit); + calculated = ext2_dx_csum(ip, ep, count_offset, count, tp); + + if (tp->ht_checksum != calculated) + return (EIO); + + return (0); +} + +int +ext2_dir_blk_csum_verify(struct inode *ip, struct buf *bp) +{ + struct m_ext2fs *fs; + struct ext2fs_direct_2 *ep; + int error = 0; + + fs = ip->i_e2fs; + + if (!EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) + return (error); + + ep = (struct ext2fs_direct_2 *)bp->b_data; + + if (ext2_get_dirent_tail(ip, ep) != NULL) + error = ext2_dirent_csum_verify(ip, ep); + else if (ext2_get_dx_count(ip, ep, NULL) != NULL) + error = ext2_dx_csum_verify(ip, ep); + + if (error) + printf("WARNING: bad directory csum detected, ip=%lu" + " - run fsck\n", (unsigned long)ip->i_number); + + return (error); +} + +static void +ext2_dirent_csum_set(struct inode *ip, struct ext2fs_direct_2 *ep) +{ + struct ext2fs_direct_tail *tp; + + tp = ext2_get_dirent_tail(ip, ep); + if (tp == NULL) + return; + + tp->e2dt_checksum = + ext2_dirent_csum(ip, ep, (char *)tp - (char *)ep); +} + +static void +ext2_dx_csum_set(struct inode *ip, struct ext2fs_direct_2 *ep) +{ + struct ext2fs_htree_count *cp; + struct ext2fs_htree_tail *tp; + int count_offset, limit, count; + + cp = ext2_get_dx_count(ip, ep, &count_offset); + if (cp == NULL) + return; + + limit = cp->h_entries_max; + count = cp->h_entries_num; + if (count_offset + (limit * sizeof(struct ext2fs_htree_entry)) > + ip->i_e2fs->e2fs_bsize - sizeof(struct ext2fs_htree_tail)) + return; + + tp = (struct ext2fs_htree_tail *)(((struct ext2fs_htree_entry *)cp) + limit); + tp->ht_checksum = ext2_dx_csum(ip, ep, count_offset, count, tp); +} + +void +ext2_dir_blk_csum_set_mem(struct inode *ip, char *buf, int size) +{ + struct m_ext2fs *fs; + struct ext2fs_direct_2 *ep; + + fs = ip->i_e2fs; + + if (!EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) + return; + + ep = (struct ext2fs_direct_2 *)buf; + + if (ext2_htree_has_idx(ip)) { + if (ext2_get_dx_count(ip, ep, NULL) != NULL) + ext2_dx_csum_set(ip, ep); + } else { + if (ext2_get_dirent_tail(ip, ep) != NULL) + ext2_dirent_csum_set(ip, ep); + } +} + +void +ext2_dir_blk_csum_set(struct inode *ip, struct buf *bp) +{ + + ext2_dir_blk_csum_set_mem(ip, bp->b_data, bp->b_bufsize); +} + +static uint32_t +ext2_extent_blk_csum(struct inode *ip, struct ext4_extent_header *ehp) +{ + struct m_ext2fs *fs; + size_t size; + uint32_t inum, gen, crc; + + fs = ip->i_e2fs; + + size = EXT4_EXTENT_TAIL_OFFSET(ehp) + + offsetof(struct ext4_extent_tail, et_checksum); + + inum = ip->i_number; + gen = ip->i_gen; + crc = calculate_crc32c(fs->e2fs_csum_seed, (uint8_t *)&inum, sizeof(inum)); + crc = calculate_crc32c(crc, (uint8_t *)&gen, sizeof(gen)); + crc = calculate_crc32c(crc, (uint8_t *)ehp, size); + + return (crc); +} + +int +ext2_extent_blk_csum_verify(struct inode *ip, void *data) +{ + struct m_ext2fs *fs; + struct ext4_extent_header *ehp; + struct ext4_extent_tail *etp; + uint32_t provided, calculated; + + fs = ip->i_e2fs; + + if (!EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) + return (0); + + ehp = (struct ext4_extent_header *)data; + etp = (struct ext4_extent_tail *)(((char *)ehp) + + EXT4_EXTENT_TAIL_OFFSET(ehp)); + + provided = etp->et_checksum; + calculated = ext2_extent_blk_csum(ip, ehp); + + if (provided != calculated) { + printf("WARNING: bad extent csum detected, ip=%lu - run fsck\n", + (unsigned long)ip->i_number); + return (EIO); + } + + return (0); +} + +void +ext2_extent_blk_csum_set(struct inode *ip, void *data) +{ + struct m_ext2fs *fs; + struct ext4_extent_header *ehp; + struct ext4_extent_tail *etp; + + fs = ip->i_e2fs; + + if (!EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) + return; + + ehp = (struct ext4_extent_header *)data; + etp = (struct ext4_extent_tail *)(((char *)data) + + EXT4_EXTENT_TAIL_OFFSET(ehp)); + + etp->et_checksum = ext2_extent_blk_csum(ip, + (struct ext4_extent_header *)data); +} + +int +ext2_gd_i_bitmap_csum_verify(struct m_ext2fs *fs, int cg, struct buf *bp) +{ + uint32_t hi, provided, calculated; + + if (!EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) + return (0); + + provided = fs->e2fs_gd[cg].ext4bgd_i_bmap_csum; + calculated = calculate_crc32c(fs->e2fs_csum_seed, bp->b_data, + fs->e2fs->e2fs_ipg / 8); + if (fs->e2fs->e3fs_desc_size >= EXT2_BG_INODE_BITMAP_CSUM_HI_END) { + hi = fs->e2fs_gd[cg].ext4bgd_i_bmap_csum_hi; + provided |= (hi << 16); + } else + calculated &= 0xFFFF; + + if (provided != calculated) { + printf("WARNING: bad inode bitmap csum detected, " + "cg=%d - run fsck\n", cg); + return (EIO); + } + + return (0); +} + +void +ext2_gd_i_bitmap_csum_set(struct m_ext2fs *fs, int cg, struct buf *bp) +{ + uint32_t csum; + + if (!EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) + return; + + csum = calculate_crc32c(fs->e2fs_csum_seed, bp->b_data, + fs->e2fs->e2fs_ipg / 8); + fs->e2fs_gd[cg].ext4bgd_i_bmap_csum = csum & 0xFFFF; + if (fs->e2fs->e3fs_desc_size >= EXT2_BG_INODE_BITMAP_CSUM_HI_END) + fs->e2fs_gd[cg].ext4bgd_i_bmap_csum_hi = csum >> 16; +} + +int +ext2_gd_b_bitmap_csum_verify(struct m_ext2fs *fs, int cg, struct buf *bp) +{ + uint32_t hi, provided, calculated, size; + + if (!EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) + return (0); + + size = fs->e2fs_fpg / 8; + provided = fs->e2fs_gd[cg].ext4bgd_b_bmap_csum; + calculated = calculate_crc32c(fs->e2fs_csum_seed, bp->b_data, size); + if (fs->e2fs->e3fs_desc_size >= EXT2_BG_BLOCK_BITMAP_CSUM_HI_LOCATION) { + hi = fs->e2fs_gd[cg].ext4bgd_b_bmap_csum_hi; + provided |= (hi << 16); + } else + calculated &= 0xFFFF; + + if (provided != calculated) { + printf("WARNING: bad block bitmap csum detected, " + "cg=%d - run fsck\n", cg); + return (EIO); + } + + return (0); +} + +void +ext2_gd_b_bitmap_csum_set(struct m_ext2fs *fs, int cg, struct buf *bp) +{ + uint32_t csum, size; + + if (!EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) + return; + + size = fs->e2fs_fpg / 8; + csum = calculate_crc32c(fs->e2fs_csum_seed, bp->b_data, size); + fs->e2fs_gd[cg].ext4bgd_b_bmap_csum = csum & 0xFFFF; + if (fs->e2fs->e3fs_desc_size >= EXT2_BG_BLOCK_BITMAP_CSUM_HI_LOCATION) + fs->e2fs_gd[cg].ext4bgd_b_bmap_csum_hi = csum >> 16; +} + +static uint32_t +ext2_ei_csum(struct inode *ip, struct ext2fs_dinode *ei) +{ + struct m_ext2fs *fs; + uint16_t old_lo, old_hi; + uint32_t inum, gen, crc; + + fs = ip->i_e2fs; + + old_lo = ei->e2di_chksum_lo; + ei->e2di_chksum_lo = 0; + if ((EXT2_INODE_SIZE(ip->i_e2fs) > E2FS_REV0_INODE_SIZE && + ei->e2di_extra_isize >= EXT2_INODE_CSUM_HI_EXTRA_END)) { + old_hi = ei->e2di_chksum_hi; + ei->e2di_chksum_hi = 0; + } + + inum = ip->i_number; + gen = ip->i_gen; + + crc = calculate_crc32c(fs->e2fs_csum_seed, (uint8_t *)&inum, sizeof(inum)); + crc = calculate_crc32c(crc, (uint8_t *)&gen, sizeof(gen)); + crc = calculate_crc32c(crc, (uint8_t *)ei, fs->e2fs->e2fs_inode_size); + + if ((EXT2_INODE_SIZE(fs) > E2FS_REV0_INODE_SIZE && + ei->e2di_extra_isize >= EXT2_INODE_CSUM_HI_EXTRA_END)) + ei->e2di_chksum_hi = old_hi; + + return (crc); +} + +int +ext2_ei_csum_verify(struct inode *ip, struct ext2fs_dinode *ei) +{ + struct m_ext2fs *fs; + const static struct ext2fs_dinode ei_zero; + uint32_t hi, provided, calculated; + + fs = ip->i_e2fs; + + if (!EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) + return (0); + + /* Check case, when dinode was not initialized */ + if (!memcmp(ei, &ei_zero, sizeof(struct ext2fs_dinode))) + return (0); + + provided = ei->e2di_chksum_lo; + calculated = ext2_ei_csum(ip, ei); + + if ((EXT2_INODE_SIZE(fs) > E2FS_REV0_INODE_SIZE && + ei->e2di_extra_isize >= EXT2_INODE_CSUM_HI_EXTRA_END)) { + hi = ei->e2di_chksum_hi; + provided |= hi << 16; + } else + calculated &= 0xFFFF; + + if (provided != calculated) + return (EIO); + + return (0); +} + +void +ext2_ei_csum_set(struct inode *ip, struct ext2fs_dinode *ei) +{ + struct m_ext2fs *fs; + uint32_t crc; + + fs = ip->i_e2fs; + + if (!EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) + return; + + crc = ext2_ei_csum(ip, ei); + + ei->e2di_chksum_lo = crc & 0xFFFF; + if ((EXT2_INODE_SIZE(fs) > E2FS_REV0_INODE_SIZE && + ei->e2di_extra_isize >= EXT2_INODE_CSUM_HI_EXTRA_END)) + ei->e2di_chksum_hi = crc >> 16; +} + static uint16_t ext2_crc16(uint16_t crc, const void *buffer, unsigned int len) { @@ -96,11 +663,26 @@ static uint16_t ext2_gd_csum(struct m_ext2fs *fs, uint32_t block_group, struct ext2_gd *gd) { size_t offset; - uint16_t crc; + uint32_t csum32; + uint16_t crc, dummy_csum; offset = offsetof(struct ext2_gd, ext4bgd_csum); - if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_GDT_CSUM)) { + if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) { + csum32 = calculate_crc32c(fs->e2fs_csum_seed, + (uint8_t *)&block_group, sizeof(block_group)); + csum32 = calculate_crc32c(csum32, (uint8_t *)gd, offset); + dummy_csum = 0; + csum32 = calculate_crc32c(csum32, (uint8_t *)&dummy_csum, + sizeof(dummy_csum)); + offset += sizeof(dummy_csum); + if (offset < fs->e2fs->e3fs_desc_size) + csum32 = calculate_crc32c(csum32, (uint8_t *)gd + offset, + fs->e2fs->e3fs_desc_size - offset); + + crc = csum32 & 0xFFFF; + return (crc); + } else if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_GDT_CSUM)) { crc = ext2_crc16(~0, fs->e2fs->e2fs_uuid, sizeof(fs->e2fs->e2fs_uuid)); crc = ext2_crc16(crc, (uint8_t *)&block_group, @@ -130,7 +712,7 @@ ext2_gd_csum_verify(struct m_ext2fs *fs, struct cdev * "WARNING: mount of %s denied due bad gd=%d csum=0x%x, expected=0x%x - run fsck\n", devtoname(dev), i, fs->e2fs_gd[i].ext4bgd_csum, ext2_gd_csum(fs, i, &fs->e2fs_gd[i])); - error = EINVAL; + error = EIO; break; } } Modified: head/sys/fs/ext2fs/ext2_dir.h ============================================================================== --- head/sys/fs/ext2fs/ext2_dir.h Sun Jan 14 20:36:21 2018 (r327976) +++ head/sys/fs/ext2fs/ext2_dir.h Sun Jan 14 20:46:39 2018 (r327977) @@ -72,6 +72,20 @@ struct ext2fs_direct_2 { * length<=EXT2FS_MAXNAMLEN */ }; +struct ext2fs_direct_tail { + uint32_t e2dt_reserved_zero1; /* pretend to be unused */ + uint16_t e2dt_rec_len; /* 12 */ + uint8_t e2dt_reserved_zero2; /* zero name length */ + uint8_t e2dt_reserved_ft; /* 0xDE, fake file type */ + uint32_t e2dt_checksum; /* crc32c(uuid+inum+dirblock) */ +}; + +#define EXT2_FT_DIR_CSUM 0xDE + +#define EXT2_DIRENT_TAIL(data, blocksize) \ + ((struct ext2fs_direct_tail *)(((char *)(data)) + \ + (blocksize) - sizeof(struct ext2fs_direct_tail))) + /* * Maximal count of links to a file */ Modified: head/sys/fs/ext2fs/ext2_extattr.c ============================================================================== --- head/sys/fs/ext2fs/ext2_extattr.c Sun Jan 14 20:36:21 2018 (r327976) +++ head/sys/fs/ext2fs/ext2_extattr.c Sun Jan 14 20:46:39 2018 (r327977) @@ -165,6 +165,22 @@ ext2_extattr_check(struct ext2fs_extattr_entry *entry, return (0); } +static int +ext2_extattr_block_check(struct inode *ip, struct buf *bp) +{ + struct ext2fs_extattr_header *header; + int error; + + header = (struct ext2fs_extattr_header *)bp->b_data; + + error = ext2_extattr_check(EXT2_IFIRST(header), + bp->b_data + bp->b_bufsize); + if (error) + return (error); + + return (ext2_extattr_blk_csum_verify(ip, bp)); +} + int ext2_extattr_inode_list(struct inode *ip, int attrnamespace, struct uio *uio, size_t *size) @@ -267,7 +283,7 @@ ext2_extattr_block_list(struct inode *ip, int attrname return (EINVAL); } - error = ext2_extattr_check(EXT2_FIRST_ENTRY(bp), bp->b_data + bp->b_bufsize); + error = ext2_extattr_block_check(ip, bp); if (error) { brelse(bp); return (error); @@ -408,7 +424,7 @@ ext2_extattr_block_get(struct inode *ip, int attrnames return (EINVAL); } - error = ext2_extattr_check(EXT2_FIRST_ENTRY(bp), bp->b_data + bp->b_bufsize); + error = ext2_extattr_block_check(ip, bp); if (error) { brelse(bp); return (error); @@ -668,7 +684,7 @@ ext2_extattr_block_delete(struct inode *ip, int attrna return (EINVAL); } - error = ext2_extattr_check(EXT2_FIRST_ENTRY(bp), bp->b_data + bp->b_bufsize); + error = ext2_extattr_block_check(ip, bp); if (error) { brelse(bp); return (error); @@ -1061,8 +1077,7 @@ ext2_extattr_block_set(struct inode *ip, int attrnames return (EINVAL); } - error = ext2_extattr_check(EXT2_FIRST_ENTRY(bp), - bp->b_data + bp->b_bufsize); + error = ext2_extattr_block_check(ip, bp); if (error) { brelse(bp); return (error); @@ -1130,6 +1145,7 @@ ext2_extattr_block_set(struct inode *ip, int attrnames } ext2_extattr_rehash(header, entry); + ext2_extattr_blk_csum_set(ip, bp); return (bwrite(bp)); } @@ -1177,6 +1193,7 @@ ext2_extattr_block_set(struct inode *ip, int attrnames } ext2_extattr_rehash(header, entry); + ext2_extattr_blk_csum_set(ip, bp); return (bwrite(bp)); } @@ -1207,7 +1224,8 @@ int ext2_extattr_free(struct inode *ip) return (EINVAL); } - error = ext2_extattr_check(EXT2_FIRST_ENTRY(bp), bp->b_data + bp->b_bufsize); + error = ext2_extattr_check(EXT2_FIRST_ENTRY(bp), + bp->b_data + bp->b_bufsize); if (error) { brelse(bp); return (error); Modified: head/sys/fs/ext2fs/ext2_extattr.h ============================================================================== --- head/sys/fs/ext2fs/ext2_extattr.h Sun Jan 14 20:36:21 2018 (r327976) +++ head/sys/fs/ext2fs/ext2_extattr.h Sun Jan 14 20:46:39 2018 (r327977) @@ -59,7 +59,9 @@ struct ext2fs_extattr_header { int32_t h_refcount; /* reference count */ int32_t h_blocks; /* number of disk blocks used */ int32_t h_hash; /* hash value of all attributes */ - uint32_t h_reserved[4]; /* zero right now */ + int32_t h_checksum; /* crc32c(uuid+id+xattrblock) */ + /* id = inum if refcount=1, blknum otherwise */ + uint32_t h_reserved[3]; /* zero right now */ }; struct ext2fs_extattr_dinode_header { Modified: head/sys/fs/ext2fs/ext2_extents.c ============================================================================== --- head/sys/fs/ext2fs/ext2_extents.c Sun Jan 14 20:36:21 2018 (r327976) +++ head/sys/fs/ext2fs/ext2_extents.c Sun Jan 14 20:46:39 2018 (r327977) @@ -425,9 +425,11 @@ ext4_ext_find_extent(struct inode *ip, daddr_t block, bqrelse(bp); eh = ext4_ext_block_header(path[ppos].ep_data); - error = ext4_ext_check_header(ip, eh); - if (error) + if (ext4_ext_check_header(ip, eh) || + ext2_extent_blk_csum_verify(ip, path[ppos].ep_data)) { + error = EIO; goto error; + } path[ppos].ep_header = eh; @@ -622,6 +624,7 @@ ext4_ext_dirty(struct inode *ip, struct ext4_extent_pa if (!bp) return (EIO); ext4_ext_fill_path_buf(path, bp); + ext2_extent_blk_csum_set(ip, bp->b_data); error = bwrite(bp); } else { ip->i_flag |= IN_CHANGE | IN_UPDATE; @@ -791,6 +794,7 @@ ext4_ext_split(struct inode *ip, struct ext4_extent_pa neh->eh_ecount = neh->eh_ecount + m; } + ext2_extent_blk_csum_set(ip, bp->b_data); bwrite(bp); bp = NULL; @@ -838,6 +842,7 @@ ext4_ext_split(struct inode *ip, struct ext4_extent_pa neh->eh_ecount = neh->eh_ecount + m; } + ext2_extent_blk_csum_set(ip, bp->b_data); bwrite(bp); bp = NULL; @@ -905,6 +910,7 @@ ext4_ext_grow_indepth(struct inode *ip, struct ext4_ex else neh->eh_max = ext4_ext_space_block(ip); + ext2_extent_blk_csum_set(ip, bp->b_data); error = bwrite(bp); if (error) goto out; Modified: head/sys/fs/ext2fs/ext2_extents.h ============================================================================== --- head/sys/fs/ext2fs/ext2_extents.h Sun Jan 14 20:36:21 2018 (r327976) +++ head/sys/fs/ext2fs/ext2_extents.h Sun Jan 14 20:46:39 2018 (r327977) @@ -43,6 +43,13 @@ #define EXT4_EXT_CACHE_IN 2 /* + * Ext4 extent tail with csum + */ +struct ext4_extent_tail { + uint32_t et_checksum; /* crc32c(uuid+inum+extent_block) */ +}; + +/* * Ext4 file system extent on disk. */ struct ext4_extent { Modified: head/sys/fs/ext2fs/ext2_extern.h ============================================================================== --- head/sys/fs/ext2fs/ext2_extern.h Sun Jan 14 20:36:21 2018 (r327976) +++ head/sys/fs/ext2fs/ext2_extern.h Sun Jan 14 20:46:39 2018 (r327977) @@ -66,7 +66,7 @@ int ext4_bmapext(struct vnode *, int32_t, int64_t *, i void ext2_clusteracct(struct m_ext2fs *, char *, int, e4fs_daddr_t, int); void ext2_dirbad(struct inode *ip, doff_t offset, char *how); void ext2_fserr(struct m_ext2fs *, uid_t, char *); -void ext2_ei2i(struct ext2fs_dinode *, struct inode *); +int ext2_ei2i(struct ext2fs_dinode *, struct inode *); int ext2_getlbns(struct vnode *, daddr_t, struct indir *, int *); int ext2_i2ei(struct inode *, struct ext2fs_dinode *); void ext2_itimes(struct vnode *vp); @@ -103,9 +103,25 @@ int ext2_htree_lookup(struct inode *, const char *, in int ext2_search_dirblock(struct inode *, void *, int *, const char *, int, int *, doff_t *, doff_t *, doff_t *, struct ext2fs_searchslot *); uint32_t e2fs_gd_get_ndirs(struct ext2_gd *gd); -uint64_t e2fs_gd_get_i_tables(struct ext2_gd *gd); -int ext2_gd_csum_verify(struct m_ext2fs *fs, struct cdev *dev); -void ext2_gd_csum_set(struct m_ext2fs *fs); +uint64_t e2fs_gd_get_i_tables(struct ext2_gd *); +void ext2_sb_csum_set_seed(struct m_ext2fs *); +int ext2_sb_csum_verify(struct m_ext2fs *); +void ext2_sb_csum_set(struct m_ext2fs *); +int ext2_extattr_blk_csum_verify(struct inode *, struct buf *); +void ext2_extattr_blk_csum_set(struct inode *, struct buf *); +int ext2_dir_blk_csum_verify(struct inode *, struct buf *); +void ext2_dir_blk_csum_set(struct inode *, struct buf *); +void ext2_dir_blk_csum_set_mem(struct inode *, char *, int); +int ext2_extent_blk_csum_verify(struct inode *, void *); +void ext2_extent_blk_csum_set(struct inode *, void *); +int ext2_gd_i_bitmap_csum_verify(struct m_ext2fs *, int, struct buf *); +void ext2_gd_i_bitmap_csum_set(struct m_ext2fs *, int, struct buf *); +int ext2_gd_b_bitmap_csum_verify(struct m_ext2fs *, int, struct buf *); +void ext2_gd_b_bitmap_csum_set(struct m_ext2fs *, int, struct buf *); +int ext2_ei_csum_verify(struct inode *, struct ext2fs_dinode *); +void ext2_ei_csum_set(struct inode *, struct ext2fs_dinode *); +int ext2_gd_csum_verify(struct m_ext2fs *, struct cdev *); +void ext2_gd_csum_set(struct m_ext2fs *); /* Flags to low-level allocation routines. Modified: head/sys/fs/ext2fs/ext2_inode_cnv.c ============================================================================== --- head/sys/fs/ext2fs/ext2_inode_cnv.c Sun Jan 14 20:36:21 2018 (r327976) +++ head/sys/fs/ext2fs/ext2_inode_cnv.c Sun Jan 14 20:46:39 2018 (r327977) @@ -34,6 +34,7 @@ #include #include +#include #include #include #include @@ -86,9 +87,11 @@ ext2_print_inode(struct inode *in) /* * raw ext2 inode to inode */ -void +int ext2_ei2i(struct ext2fs_dinode *ei, struct inode *ip) { + const static struct ext2fs_dinode ei_zero; + ip->i_nlink = ei->e2di_nlink; /* * Godmar thinks - if the link count is zero, then the inode is @@ -131,6 +134,11 @@ ext2_ei2i(struct ext2fs_dinode *ei, struct inode *ip) ip->i_gid |= (uint32_t)ei->e2di_gid_high << 16; memcpy(ip->i_data, ei->e2di_blocks, sizeof(ei->e2di_blocks)); + + if (memcmp(ei, &ei_zero, sizeof(struct ext2fs_dinode))) + return (ext2_ei_csum_verify(ip, ei)); + + return (0); } /* @@ -190,6 +198,9 @@ ext2_i2ei(struct inode *ip, struct ext2fs_dinode *ei) ei->e2di_gid_high = ip->i_gid >> 16 & 0xffff; memcpy(ei->e2di_blocks, ip->i_data, sizeof(ei->e2di_blocks)); + + /* Set inode csum */ + ext2_ei_csum_set(ip, ei); return (0); } Modified: head/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- head/sys/fs/ext2fs/ext2_lookup.c Sun Jan 14 20:36:21 2018 (r327976) +++ head/sys/fs/ext2fs/ext2_lookup.c Sun Jan 14 20:46:39 2018 (r327977) @@ -63,6 +63,7 @@ #include *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sun Jan 14 22:05:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03480EBA684; Sun, 14 Jan 2018 22:05:31 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D381D6F5F2; Sun, 14 Jan 2018 22:05:30 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F45E278E4; Sun, 14 Jan 2018 22:05:30 +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 w0EM5Tqt075357; Sun, 14 Jan 2018 22:05:29 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0EM5TRa075355; Sun, 14 Jan 2018 22:05:29 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201801142205.w0EM5TRa075355@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sun, 14 Jan 2018 22:05:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327979 - 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: 327979 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jan 2018 22:05:31 -0000 Author: manu Date: Sun Jan 14 22:05:29 2018 New Revision: 327979 URL: https://svnweb.freebsd.org/changeset/base/327979 Log: allwinner: mmc: Multiple improvement - Add a per compatible configuration struct - Not all SoC uses the same size for DMA transfert, add this into the configuration data - Use new timing mode for some SoC (A64 mmc) - Auto calibrate clock for A64 mmc/emmc - A64 mmc controller need masking of data0 - Add support for vmmc/vqmmc regulator - Add more capabilities, r/w speed is better for eMMC - MMC_CAP_SIGNALING_180 gives weird result so do not enable it for now. - Add new register documented in H3/A64 user manual Tested-On: Pine64-LTS (A64), eMMC still doesn't work Tested-On: A64-Olinuxino (A64), sd and eMMC are working Tested-On: NanoPi Neo Plus2 (H5), sd and eMMC are working Tested-On: OrangePi PC2 (H5), sd only (no eMMC) Tested-On: OrangePi One (H3), sd only (no eMMC) Tested-On: BananaPi M2 (A31s), sd only (no eMMC) Modified: head/sys/arm/allwinner/aw_mmc.c head/sys/arm/allwinner/aw_mmc.h Modified: head/sys/arm/allwinner/aw_mmc.c ============================================================================== --- head/sys/arm/allwinner/aw_mmc.c Sun Jan 14 21:21:10 2018 (r327978) +++ head/sys/arm/allwinner/aw_mmc.c Sun Jan 14 22:05:29 2018 (r327979) @@ -50,22 +50,50 @@ __FBSDID("$FreeBSD$"); #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 +struct aw_mmc_conf { + uint32_t dma_xferlen; + bool mask_data0; + bool can_calibrate; + bool new_timing; +}; + +static const struct aw_mmc_conf a10_mmc_conf = { + .dma_xferlen = 0x2000, +}; + +static const struct aw_mmc_conf a13_mmc_conf = { + .dma_xferlen = 0x10000, +}; + +static const struct aw_mmc_conf a64_mmc_conf = { + .dma_xferlen = 0x10000, + .mask_data0 = true, + .can_calibrate = true, + .new_timing = true, +}; + +static const struct aw_mmc_conf a64_emmc_conf = { + .dma_xferlen = 0x2000, + .can_calibrate = true, +}; + 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}, + {"allwinner,sun4i-a10-mmc", (uintptr_t)&a10_mmc_conf}, + {"allwinner,sun5i-a13-mmc", (uintptr_t)&a13_mmc_conf}, + {"allwinner,sun7i-a20-mmc", (uintptr_t)&a13_mmc_conf}, + {"allwinner,sun50i-a64-mmc", (uintptr_t)&a64_mmc_conf}, + {"allwinner,sun50i-a64-emmc", (uintptr_t)&a64_emmc_conf}, {NULL, 0} }; @@ -82,9 +110,13 @@ struct aw_mmc_softc { struct mmc_request * aw_req; struct mtx aw_mtx; struct resource * aw_res[AW_MMC_RESSZ]; + struct aw_mmc_conf * aw_mmc_conf; uint32_t aw_intr; uint32_t aw_intr_wait; void * aw_intrhand; + int32_t aw_vdd; + regulator_t aw_reg_vmmc; + regulator_t aw_reg_vqmmc; /* Fields required for DMA access. */ bus_addr_t aw_dma_desc_phys; @@ -151,6 +183,9 @@ aw_mmc_attach(device_t dev) node = ofw_bus_get_node(dev); sc = device_get_softc(dev); sc->aw_dev = dev; + + sc->aw_mmc_conf = (struct aw_mmc_conf *)ofw_bus_search_compatible(dev, compat_data)->ocd_data; + 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"); @@ -230,11 +265,22 @@ aw_mmc_attach(device_t dev) if (OF_getencprop(node, "bus-width", &bus_width, sizeof(uint32_t)) <= 0) bus_width = 4; + if (regulator_get_by_ofw_property(dev, 0, "vmmc-supply", + &sc->aw_reg_vmmc) == 0 && bootverbose) + device_printf(dev, "vmmc-supply regulator found\n"); + if (regulator_get_by_ofw_property(dev, 0, "vqmmc-supply", + &sc->aw_reg_vqmmc) == 0 && bootverbose) + device_printf(dev, "vqmmc-supply regulator found\n"); + 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; + sc->aw_host.caps = MMC_CAP_HSPEED | MMC_CAP_UHS_SDR12 | + MMC_CAP_UHS_SDR25 | MMC_CAP_UHS_SDR50 | + MMC_CAP_UHS_DDR50 | MMC_CAP_MMC_DDR52; + + sc->aw_host.caps |= MMC_CAP_SIGNALING_330 /* | MMC_CAP_SIGNALING_180 */; + if (bus_width >= 4) sc->aw_host.caps |= MMC_CAP_4_BIT_DATA; if (bus_width >= 8) @@ -311,8 +357,8 @@ aw_mmc_setup_dma(struct aw_mmc_softc *sc) 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_mmc_conf->dma_xferlen * AW_MMC_DMA_SEGS, AW_MMC_DMA_SEGS, + sc->aw_mmc_conf->dma_xferlen, BUS_DMA_ALLOCNOW, NULL, NULL, &sc->aw_dma_buf_tag); if (error) return (error); @@ -366,7 +412,7 @@ aw_mmc_prepare_dma(struct aw_mmc_softc *sc) uint32_t val; cmd = sc->aw_req->cmd; - if (cmd->data->len > AW_MMC_DMA_MAX_SIZE * AW_MMC_DMA_SEGS) + if (cmd->data->len > (sc->aw_mmc_conf->dma_xferlen * 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); @@ -562,7 +608,8 @@ aw_mmc_intr(void *arg) goto end; } if (rint & AW_MMC_INT_ERR_BIT) { - device_printf(sc->aw_dev, "error rint: 0x%08X\n", rint); + if (bootverbose) + 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 @@ -704,6 +751,9 @@ aw_mmc_read_ivar(device_t bus, device_t child, int whi case MMCBR_IVAR_CAPS: *(int *)result = sc->aw_host.caps; break; + case MMCBR_IVAR_TIMING: + *(int *)result = sc->aw_host.ios.timing; + break; case MMCBR_IVAR_MAX_DATA: *(int *)result = 65535; break; @@ -746,6 +796,9 @@ aw_mmc_write_ivar(device_t bus, device_t child, int wh case MMCBR_IVAR_VDD: sc->aw_host.ios.vdd = value; break; + case MMCBR_IVAR_TIMING: + sc->aw_host.ios.timing = value; + break; /* These are read-only */ case MMCBR_IVAR_CAPS: case MMCBR_IVAR_HOST_OCR: @@ -761,42 +814,93 @@ aw_mmc_write_ivar(device_t bus, device_t child, int wh static int aw_mmc_update_clock(struct aw_mmc_softc *sc, uint32_t clkon) { - uint32_t cmdreg; + uint32_t reg; 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); + reg = AW_MMC_READ_4(sc, AW_MMC_CKCR); + reg &= ~(AW_MMC_CKCR_CCLK_ENB | AW_MMC_CKCR_CCLK_CTRL | + AW_MMC_CKCR_CCLK_MASK_DATA0); if (clkon) - ckcr |= AW_MMC_CKCR_CCLK_ENB; + reg |= AW_MMC_CKCR_CCLK_ENB; + if (sc->aw_mmc_conf->mask_data0) + reg |= AW_MMC_CKCR_CCLK_MASK_DATA0; - AW_MMC_WRITE_4(sc, AW_MMC_CKCR, ckcr); + AW_MMC_WRITE_4(sc, AW_MMC_CKCR, reg); - cmdreg = AW_MMC_CMDR_LOAD | AW_MMC_CMDR_PRG_CLK | + reg = AW_MMC_CMDR_LOAD | AW_MMC_CMDR_PRG_CLK | AW_MMC_CMDR_WAIT_PRE_OVER; - AW_MMC_WRITE_4(sc, AW_MMC_CMDR, cmdreg); + AW_MMC_WRITE_4(sc, AW_MMC_CMDR, reg); 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); - } + + while (reg & AW_MMC_CMDR_LOAD && --retry > 0) { + reg = AW_MMC_READ_4(sc, AW_MMC_CMDR); DELAY(10); } AW_MMC_WRITE_4(sc, AW_MMC_RISR, 0xffffffff); - device_printf(sc->aw_dev, "timeout updating clock\n"); - return (ETIMEDOUT); + if (reg & AW_MMC_CMDR_LOAD) { + device_printf(sc->aw_dev, "timeout updating clock\n"); + return (ETIMEDOUT); + } + + if (sc->aw_mmc_conf->mask_data0) { + reg = AW_MMC_READ_4(sc, AW_MMC_CKCR); + reg &= ~AW_MMC_CKCR_CCLK_MASK_DATA0; + AW_MMC_WRITE_4(sc, AW_MMC_CKCR, reg); + } + + return (0); } +static void +aw_mmc_set_power(struct aw_mmc_softc *sc, int32_t vdd) +{ + int min_uvolt, max_uvolt; + + sc->aw_vdd = vdd; + + if (sc->aw_reg_vmmc == NULL && sc->aw_reg_vqmmc == NULL) + return; + + switch (1 << vdd) { + case MMC_OCR_LOW_VOLTAGE: + min_uvolt = max_uvolt = 1800000; + break; + case MMC_OCR_320_330: + min_uvolt = 3200000; + max_uvolt = 3300000; + break; + case MMC_OCR_330_340: + min_uvolt = 3300000; + max_uvolt = 3400000; + break; + } + + if (sc->aw_reg_vmmc) + if (regulator_set_voltage(sc->aw_reg_vmmc, + min_uvolt, max_uvolt) != 0) + device_printf(sc->aw_dev, + "Cannot set vmmc to %d<->%d\n", + min_uvolt, + max_uvolt); + if (sc->aw_reg_vqmmc) + if (regulator_set_voltage(sc->aw_reg_vqmmc, + min_uvolt, max_uvolt) != 0) + device_printf(sc->aw_dev, + "Cannot set vqmmc to %d<->%d\n", + min_uvolt, + max_uvolt); +} + 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; + unsigned int clock; + uint32_t reg, div = 1; sc = device_get_softc(bus); @@ -815,27 +919,66 @@ aw_mmc_update_ios(device_t bus, device_t child) break; } + /* Set the voltage */ + if (ios->power_mode == power_off) { + if (bootverbose) + device_printf(sc->aw_dev, "Powering down sd/mmc\n"); + if (sc->aw_reg_vmmc) + regulator_disable(sc->aw_reg_vmmc); + if (sc->aw_reg_vqmmc) + regulator_disable(sc->aw_reg_vqmmc); + } else if (sc->aw_vdd != ios->vdd) + aw_mmc_set_power(sc, ios->vdd); + + /* Enable ddr mode if needed */ + reg = AW_MMC_READ_4(sc, AW_MMC_GCTL); + if (ios->timing == bus_timing_uhs_ddr50 || + ios->timing == bus_timing_mmc_ddr52) + reg |= AW_MMC_CTRL_DDR_MOD_SEL; + else + reg &= ~AW_MMC_CTRL_DDR_MOD_SEL; + AW_MMC_WRITE_4(sc, AW_MMC_GCTL, reg); + if (ios->clock) { + clock = ios->clock; /* Disable clock */ error = aw_mmc_update_clock(sc, 0); if (error != 0) return (error); + if (ios->timing == bus_timing_mmc_ddr52 && + (sc->aw_mmc_conf->new_timing || + ios->bus_width == bus_width_8)) { + div = 2; + clock <<= 1; + } + /* 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); + reg = AW_MMC_READ_4(sc, AW_MMC_CKCR); + reg &= ~AW_MMC_CKCR_CCLK_DIV; + reg |= div - 1; + AW_MMC_WRITE_4(sc, AW_MMC_CKCR, reg); + /* New timing mode if needed */ + if (sc->aw_mmc_conf->new_timing) { + reg = AW_MMC_READ_4(sc, AW_MMC_NTSR); + reg |= AW_MMC_NTSR_MODE_SELECT; + AW_MMC_WRITE_4(sc, AW_MMC_NTSR, reg); + } + /* Set the MMC clock. */ - error = clk_set_freq(sc->aw_clk_mmc, ios->clock, + error = clk_set_freq(sc->aw_clk_mmc, 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); + clock, error); return (error); } + + if (sc->aw_mmc_conf->can_calibrate) + AW_MMC_WRITE_4(sc, AW_MMC_SAMP_DL, AW_MMC_SAMP_DL_SW_EN); /* Enable clock. */ error = aw_mmc_update_clock(sc, 1); Modified: head/sys/arm/allwinner/aw_mmc.h ============================================================================== --- head/sys/arm/allwinner/aw_mmc.h Sun Jan 14 21:21:10 2018 (r327978) +++ head/sys/arm/allwinner/aw_mmc.h Sun Jan 14 22:05:29 2018 (r327979) @@ -47,14 +47,23 @@ #define AW_MMC_STAR 0x3C /* Status Register */ #define AW_MMC_FWLR 0x40 /* FIFO Threshold Watermark Register */ #define AW_MMC_FUNS 0x44 /* Function Select Register */ -#define AW_MMC_HWRST 0x78 /* Hardware reset (not documented) */ +#define AW_MMC_CSDC 0x54 /* CRC status detect controler register (A64 smhc2 only) */ +#define AW_MMC_A12A 0x58 /* Auto command 12 argument register */ +#define AW_MMC_NTSR 0x5C /* SD new timing register (H3, A64 smhc0/1 only) */ +#define AW_MMC_HWRST 0x78 /* Hardware reset */ #define AW_MMC_DMAC 0x80 /* IDMAC Control Register */ #define AW_MMC_DLBA 0x84 /* IDMAC Desc List Base Address Reg */ #define AW_MMC_IDST 0x88 /* IDMAC Status Register */ #define AW_MMC_IDIE 0x8C /* IDMAC Interrupt Enable Register */ -#define AW_MMC_FIFO 0x100 /* FIFO Access Address (A10/A20) */ -#define A31_MMC_FIFO 0x200 /* FIFO Access Address (A31) */ +#define AW_MMC_DDR_SBIT_DET 0x10C /* eMMC4.5 DDR Start Bit Detection control register */ +#define AW_MMC_DRV_DL 0x140 /* Drive Delay control register */ +#define AW_MMC_SAMP_DL 0x144 /* Sample Delay controle register */ +#define AW_MMC_DS_DL 0x148 /* Data strobe delay control register */ + +#define AW_MMC_FIFO 0x100 /* FIFO Access Address (A10/A20) */ +#define A31_MMC_FIFO 0x200 /* FIFO Access Address (A31) */ + /* AW_MMC_GCTL */ #define AW_MMC_CTRL_SOFT_RST (1U << 0) #define AW_MMC_CTRL_FIFO_RST (1U << 1) @@ -70,6 +79,7 @@ /* AW_MMC_CKCR */ #define AW_MMC_CKCR_CCLK_ENB (1U << 16) #define AW_MMC_CKCR_CCLK_CTRL (1U << 17) +#define AW_MMC_CKCR_CCLK_MASK_DATA0 (1U << 31) #define AW_MMC_CKCR_CCLK_DIV 0xff /* AW_MMC_TMOR */ @@ -153,6 +163,9 @@ #define AW_MMC_SEND_AUTOSTOP_CC_SD (1U << 9) #define AW_MMC_CE_ATA_DEV_INT_ENB (1U << 10) +/* AW_MMC_NTSR */ +#define AW_MMC_NTSR_MODE_SELECT (1U << 31) + /* IDMA CONTROLLER BUS MOD BIT FIELD */ #define AW_MMC_DMAC_IDMAC_SOFT_RST (1U << 0) #define AW_MMC_DMAC_IDMAC_FIX_BURST (1U << 1) @@ -183,6 +196,12 @@ AW_MMC_IDST_DES_UNAVL_INT | AW_MMC_IDST_ABN_INT_SUM) #define AW_MMC_IDST_COMPLETE \ (AW_MMC_IDST_TX_INT | AW_MMC_IDST_RX_INT) + +/* AW_MMC_DDR_SBIT_DET */ +#define AW_MMC_DDR_SBIT_HS_MD_EN (1U << 31) + +/* AW_MMC_SAMP */ +#define AW_MMC_SAMP_DL_SW_EN (1U << 7) /* The DMA descriptor table. */ struct aw_mmc_dma_desc { From owner-svn-src-head@freebsd.org Sun Jan 14 23:42:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67549E64B8C; Sun, 14 Jan 2018 23:42:59 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (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 4D87D73467; Sun, 14 Jan 2018 23:42:58 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from comporellon.tachypleus.net (cpe-75-82-218-62.socal.res.rr.com [75.82.218.62]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id w0ENgu4G026082 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Sun, 14 Jan 2018 15:42:57 -0800 Subject: Re: svn commit: r327950 - in head/sys/powerpc: aim include powerpc ps3 From: Nathan Whitehorn To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201801132314.w0DNEra5002692@repo.freebsd.org> <20180113232441.GV1684@kib.kiev.ua> <010d0153-8931-a3c2-db21-dfcbaf848fc0@freebsd.org> <20180114083036.GX1684@kib.kiev.ua> <20180114170502.GB1684@kib.kiev.ua> <184ba3ee-a9f7-01ed-bb02-1bcba9acc041@freebsd.org> <20180114175211.GD1684@kib.kiev.ua> Message-ID: Date: Sun, 14 Jan 2018 15:42:56 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------03AE6774B8597D0FB912A356" Content-Language: en-US X-Sonic-CAuth: UmFuZG9tSVaiOIH4rCAARArG/z1jaqkzQi00v/nU+Ptd97WHcAPZ0n/hjt4j1kMyQx7hf9t07rvzgl9+YQxJgFzt0MLgbhcyxxWeQDZ+sAo= X-Sonic-ID: C;RLtwpYT55xG4c+BQ9eIpJw== M;gGHZpYT55xG4c+BQ9eIpJw== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jan 2018 23:42:59 -0000 This is a multi-part message in MIME format. --------------03AE6774B8597D0FB912A356 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 01/14/18 09:57, Nathan Whitehorn wrote: > > > On 01/14/18 09:52, Konstantin Belousov wrote: >> On Sun, Jan 14, 2018 at 09:30:53AM -0800, Nathan Whitehorn wrote: >>> The immediate consequence of that is that no MI code that knows about >>> direct maps can possibly take advantage of the direct map on this >>> platform. Do we really want that to save some conditional logic that >>> would get optimized out on amd64 and arm64 anyway? I really do not see >>> the benefit here. >> It is not clear what do you mean.  Are you saying that there is no >> benefit >> of providing the conditional logic, or that it is not benefit of >> exclusing >> powerpc ? > > Sorry, that was poorly stated. Let me try again: > > If we make a PPC_PHYS_TO_DMAP(), but there is an MI PHYS_TO_DMAP() > API, consumer code in the MI parts of the kernel won't be able to > benefit from the PPC direct map, which seems unfortunate. The cost > from a code perspective of having an if (direct_map_available) seems > low, since on systems where direct_map_available is defined to be 1, > the compiler will optimize it to the same code as if gated by #ifdef. > It might be more cumbersome to write the code, however. > >> I do not object against adding the conditional, but it should not be >> too clumsy to use. >> > > OK. Let me try to draft something in the next couple days and see how > much of a pain it is in practice. > -Nathan > How about the attached? It makes PHYS_TO_DMAP() return 0 if no mapping exists. This is straightforward, does not introduce extra macros, and can pretty easily replace SFBUF_OPTIONAL_DIRECT_MAP on the assumption that PHYS_TO_DMAP() is cheap. I've modified the other MI-ish consumers in the tree accordingly; compat/linuxkpi/common/src/linux_page.c already does the right thing and needed no modifications. -Nathan --------------03AE6774B8597D0FB912A356 Content-Type: text/x-patch; name="PHYS_TO_DMAP.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="PHYS_TO_DMAP.diff" Index: powerpc/include/vmparam.h =================================================================== --- powerpc/include/vmparam.h (revision 327952) +++ powerpc/include/vmparam.h (working copy) @@ -240,13 +240,12 @@ #define SFBUF_PHYS_DMAP(x) (x) /* - * We (usually) have a direct map of all physical memory. All - * uses of this macro must be gated by a check on hw_direct_map! - * The location of the direct map may not be 1:1 in future, so use - * of the macro is recommended; it may also grow an assert that hw_direct_map - * is set. + * We (usually) have a direct map of all physical memory, so provide + * a macro to use to get the kernel VA address for a given PA. Returns + * 0 if the direct map is unavailable. The location of the direct map + * may not be 1:1 in future, so use of the macro is recommended. */ -#define PHYS_TO_DMAP(x) x -#define DMAP_TO_PHYS(x) x +#define PHYS_TO_DMAP(x) (hw_direct_map ? 0 : (x)) +#define DMAP_TO_PHYS(x) (hw_direct_map ? 0 : (x)) #endif /* _MACHINE_VMPARAM_H_ */ Index: vm/vm_page.c =================================================================== --- vm/vm_page.c (revision 327952) +++ vm/vm_page.c (working copy) @@ -2937,7 +2937,8 @@ { #if defined(DIAGNOSTIC) && defined(PHYS_TO_DMAP) - if ((m->flags & PG_ZERO) != 0) { + if ((m->flags & PG_ZERO) != 0 && + PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)) != 0) { uint64_t *p; int i; p = (uint64_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)); Index: dev/efidev/efirt.c =================================================================== --- dev/efidev/efirt.c (revision 327952) +++ dev/efidev/efirt.c (working copy) @@ -115,6 +115,11 @@ return (0); } efi_systbl = (struct efi_systbl *)PHYS_TO_DMAP(efi_systbl_phys); + if (efi_systbl == NULL) { + if (bootverbose) + printf("EFI systbl not mapped in kernel VA\n"); + return (0); + } if (efi_systbl->st_hdr.th_sig != EFI_SYSTBL_SIG) { efi_systbl = NULL; if (bootverbose) --------------03AE6774B8597D0FB912A356-- From owner-svn-src-head@freebsd.org Sun Jan 14 23:46:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8F9CE64F4E; Sun, 14 Jan 2018 23:46:41 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (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 8F85373720; Sun, 14 Jan 2018 23:46:40 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from comporellon.tachypleus.net (cpe-75-82-218-62.socal.res.rr.com [75.82.218.62]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id w0ENkdSo031452 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Sun, 14 Jan 2018 15:46:39 -0800 Subject: Re: svn commit: r327950 - in head/sys/powerpc: aim include powerpc ps3 From: Nathan Whitehorn To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201801132314.w0DNEra5002692@repo.freebsd.org> <20180113232441.GV1684@kib.kiev.ua> <010d0153-8931-a3c2-db21-dfcbaf848fc0@freebsd.org> <20180114083036.GX1684@kib.kiev.ua> <20180114170502.GB1684@kib.kiev.ua> <184ba3ee-a9f7-01ed-bb02-1bcba9acc041@freebsd.org> <20180114175211.GD1684@kib.kiev.ua> Message-ID: Date: Sun, 14 Jan 2018 15:46:38 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------20B1C31E8F5944D0AE20C3D7" Content-Language: en-US X-Sonic-CAuth: UmFuZG9tSVZMx7mXxH6Ab63gR3JMsK1ZaqE8K5CStI2A68GXhJrtxh4hf/XIsfgMXs4ytvaHhqP1+le95/6u4ysBfbx4pMfbm7SLijHj5oc= X-Sonic-ID: C;5L4VKoX55xGfVuBQ9eIpJw== M;XAJLKoX55xGfVuBQ9eIpJw== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jan 2018 23:46:41 -0000 This is a multi-part message in MIME format. --------------20B1C31E8F5944D0AE20C3D7 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 01/14/18 15:42, Nathan Whitehorn wrote: > > > On 01/14/18 09:57, Nathan Whitehorn wrote: >> >> >> On 01/14/18 09:52, Konstantin Belousov wrote: >>> On Sun, Jan 14, 2018 at 09:30:53AM -0800, Nathan Whitehorn wrote: >>>> The immediate consequence of that is that no MI code that knows about >>>> direct maps can possibly take advantage of the direct map on this >>>> platform. Do we really want that to save some conditional logic that >>>> would get optimized out on amd64 and arm64 anyway? I really do not see >>>> the benefit here. >>> It is not clear what do you mean.  Are you saying that there is no >>> benefit >>> of providing the conditional logic, or that it is not benefit of >>> exclusing >>> powerpc ? >> >> Sorry, that was poorly stated. Let me try again: >> >> If we make a PPC_PHYS_TO_DMAP(), but there is an MI PHYS_TO_DMAP() >> API, consumer code in the MI parts of the kernel won't be able to >> benefit from the PPC direct map, which seems unfortunate. The cost >> from a code perspective of having an if (direct_map_available) seems >> low, since on systems where direct_map_available is defined to be 1, >> the compiler will optimize it to the same code as if gated by #ifdef. >> It might be more cumbersome to write the code, however. >> >>> I do not object against adding the conditional, but it should not be >>> too clumsy to use. >>> >> >> OK. Let me try to draft something in the next couple days and see how >> much of a pain it is in practice. >> -Nathan >> > > How about the attached? It makes PHYS_TO_DMAP() return 0 if no mapping > exists. This is straightforward, does not introduce extra macros, and > can pretty easily replace SFBUF_OPTIONAL_DIRECT_MAP on the assumption > that PHYS_TO_DMAP() is cheap. I've modified the other MI-ish consumers > in the tree accordingly; compat/linuxkpi/common/src/linux_page.c > already does the right thing and needed no modifications. > -Nathan Sorry, this is the patch I meant to send. -Nathan --------------20B1C31E8F5944D0AE20C3D7 Content-Type: text/x-patch; name="PHYS_TO_DMAP.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="PHYS_TO_DMAP.diff" Index: powerpc/include/vmparam.h =================================================================== --- powerpc/include/vmparam.h (revision 327952) +++ powerpc/include/vmparam.h (working copy) @@ -240,13 +240,12 @@ #define SFBUF_PHYS_DMAP(x) (x) /* - * We (usually) have a direct map of all physical memory. All - * uses of this macro must be gated by a check on hw_direct_map! - * The location of the direct map may not be 1:1 in future, so use - * of the macro is recommended; it may also grow an assert that hw_direct_map - * is set. + * We (usually) have a direct map of all physical memory, so provide + * a macro to use to get the kernel VA address for a given PA. Returns + * 0 if the direct map is unavailable. The location of the direct map + * may not be 1:1 in future, so use of the macro is recommended. */ -#define PHYS_TO_DMAP(x) x -#define DMAP_TO_PHYS(x) x +#define PHYS_TO_DMAP(x) (hw_direct_map ? (x) : 0) +#define DMAP_TO_PHYS(x) (hw_direct_map ? (x) : 0) #endif /* _MACHINE_VMPARAM_H_ */ Index: vm/vm_page.c =================================================================== --- vm/vm_page.c (revision 327952) +++ vm/vm_page.c (working copy) @@ -2937,7 +2937,8 @@ { #if defined(DIAGNOSTIC) && defined(PHYS_TO_DMAP) - if ((m->flags & PG_ZERO) != 0) { + if ((m->flags & PG_ZERO) != 0 && + PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)) != 0) { uint64_t *p; int i; p = (uint64_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)); Index: dev/efidev/efirt.c =================================================================== --- dev/efidev/efirt.c (revision 327952) +++ dev/efidev/efirt.c (working copy) @@ -115,6 +115,11 @@ return (0); } efi_systbl = (struct efi_systbl *)PHYS_TO_DMAP(efi_systbl_phys); + if (efi_systbl == NULL) { + if (bootverbose) + printf("EFI systbl not mapped in kernel VA\n"); + return (0); + } if (efi_systbl->st_hdr.th_sig != EFI_SYSTBL_SIG) { efi_systbl = NULL; if (bootverbose) --------------20B1C31E8F5944D0AE20C3D7-- From owner-svn-src-head@freebsd.org Mon Jan 15 04:52:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF59BE7CA54; Mon, 15 Jan 2018 04:52:13 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C9A4C7E660; Mon, 15 Jan 2018 04:52:13 +0000 (UTC) (envelope-from grehan@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 12482431F; Mon, 15 Jan 2018 04:52:13 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0F4qCWJ047043; Mon, 15 Jan 2018 04:52:12 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0F4qCEg047042; Mon, 15 Jan 2018 04:52:12 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <201801150452.w0F4qCEg047042@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Mon, 15 Jan 2018 04:52:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327990 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: grehan X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 327990 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 04:52:14 -0000 Author: grehan Date: Mon Jan 15 04:52:12 2018 New Revision: 327990 URL: https://svnweb.freebsd.org/changeset/base/327990 Log: The vmm(4) man page is conditional on MK_BHYVE. Submitted by: kevlo Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Mon Jan 15 01:19:11 2018 (r327989) +++ head/share/man/man4/Makefile Mon Jan 15 04:52:12 2018 (r327990) @@ -555,8 +555,8 @@ MAN= aac.4 \ ${_virtio_scsi.4} \ vkbd.4 \ vlan.4 \ - vmm.4 \ vxlan.4 \ + ${_vmm.4} \ ${_vmx.4} \ vpo.4 \ vr.4 \ @@ -875,6 +875,7 @@ MLINKS+=sfxge.4 if_sfxge.4 .if ${MK_BHYVE} != "no" _bhyve.4= bhyve.4 +_vmm.4= vmm.4 .endif .endif From owner-svn-src-head@freebsd.org Mon Jan 15 05:00:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36468E7D195; Mon, 15 Jan 2018 05:00:28 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D3067E9FB; Mon, 15 Jan 2018 05:00: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 412424356; Mon, 15 Jan 2018 05:00:27 +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 w0F50Roa047397; Mon, 15 Jan 2018 05:00:27 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0F50RGV047396; Mon, 15 Jan 2018 05:00:27 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201801150500.w0F50RGV047396@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 15 Jan 2018 05:00:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327991 - head/stand/fdt X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/fdt X-SVN-Commit-Revision: 327991 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 05:00:28 -0000 Author: kevans Date: Mon Jan 15 05:00:26 2018 New Revision: 327991 URL: https://svnweb.freebsd.org/changeset/base/327991 Log: stand/fdt: don't send clobbered FDT to the kernel If fdt_overlay_apply fails at some stage to apply the overlay to the base, both the base and overlay may be in an inconsistent state (some fixups applied, some phandles adjusted, some symbols merged). These can be bad for a number of reasons, to include user frustration if some fixups applied and not others. Fail a little safer by making a clean copy of the base FDT for every overlay that we can simply discard if things go awry. This also allows us the luxury of simply discarding overlays if we hit some kind of memory limit or if they're malformed and extremely large for some reason. We'll now leave a nice error message indicating that some overlays could not be applied due to size restrictions and we apply what we can. I note that our overlay implementation has some flaws that might still leave your system in an unbootable state even if an overlay applies correctly; please exercise caution in using overlays until we can swap it out for libfdt's implementation. Tested on: BananaPi-M3 (armv7) Tested on: Pine64 (aarch64) Differential Revision: https://reviews.freebsd.org/D13709 Modified: head/stand/fdt/fdt_loader_cmd.c Modified: head/stand/fdt/fdt_loader_cmd.c ============================================================================== --- head/stand/fdt/fdt_loader_cmd.c Mon Jan 15 04:52:12 2018 (r327990) +++ head/stand/fdt/fdt_loader_cmd.c Mon Jan 15 05:00:26 2018 (r327991) @@ -340,60 +340,78 @@ void fdt_apply_overlays() { struct preloaded_file *fp; - size_t overlays_size, max_overlay_size, new_fdtp_size; + size_t max_overlay_size, next_fdtp_size; + size_t current_fdtp_size; + void *current_fdtp; void *new_fdtp; + void *next_fdtp; void *overlay; int rv; if ((fdtp == NULL) || (fdtp_size == 0)) return; - overlays_size = 0; + new_fdtp = NULL; max_overlay_size = 0; for (fp = file_findfile(NULL, "dtbo"); fp != NULL; fp = fp->f_next) { if (max_overlay_size < fp->f_size) max_overlay_size = fp->f_size; - overlays_size += fp->f_size; } /* Nothing to apply */ - if (overlays_size == 0) + if (max_overlay_size == 0) return; - /* It's actually more than enough */ - new_fdtp_size = fdtp_size + overlays_size; - new_fdtp = malloc(new_fdtp_size); - if (new_fdtp == NULL) { - printf("failed to allocate memory for DTB blob with overlays\n"); - return; - } - overlay = malloc(max_overlay_size); if (overlay == NULL) { printf("failed to allocate memory for DTB blob with overlays\n"); - free(new_fdtp); return; } - - rv = fdt_open_into(fdtp, new_fdtp, new_fdtp_size); - if (rv != 0) { - printf("failed to open DTB blob for applying overlays\n"); - free(new_fdtp); - free(overlay); - return; - } - + current_fdtp = fdtp; + current_fdtp_size = fdtp_size; for (fp = file_findfile(NULL, "dtbo"); fp != NULL; fp = fp->f_next) { printf("applying DTB overlay '%s'\n", fp->f_name); + next_fdtp_size = current_fdtp_size + fp->f_size; + next_fdtp = malloc(next_fdtp_size); + if (next_fdtp == NULL) { + /* + * Output warning, then move on to applying other + * overlays in case this one is simply too large. + */ + printf("failed to allocate memory for overlay base\n"); + continue; + } + rv = fdt_open_into(current_fdtp, next_fdtp, next_fdtp_size); + if (rv != 0) { + printf("failed to open base dtb into overlay base\n"); + continue; + } COPYOUT(fp->f_addr, overlay, fp->f_size); /* Both overlay and new_fdtp may be modified in place */ - fdt_overlay_apply(new_fdtp, overlay); + rv = fdt_overlay_apply(next_fdtp, overlay); + if (rv == 0) { + /* Rotate next -> current */ + if (current_fdtp != fdtp) + free(current_fdtp); + current_fdtp = next_fdtp; + current_fdtp_size = next_fdtp_size; + } else { + /* + * Assume here that the base we tried to apply on is + * either trashed or in an inconsistent state. Trying to + * load it might work, but it's better to discard it and + * play it safe. */ + free(next_fdtp); + printf("failed to apply overlay: %s\n", + fdt_strerror(rv)); + } } - - free(fdtp); - fdtp = new_fdtp; - fdtp_size = new_fdtp_size; - + /* We could have failed to apply all overlays; then we do nothing */ + if (current_fdtp != fdtp) { + free(fdtp); + fdtp = current_fdtp; + fdtp_size = current_fdtp_size; + } free(overlay); } From owner-svn-src-head@freebsd.org Mon Jan 15 06:37:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3F3DEB26CC for ; Mon, 15 Jan 2018 06:37:15 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-it0-f47.google.com (mail-it0-f47.google.com [209.85.214.47]) (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 C4D9C81F4F for ; Mon, 15 Jan 2018 06:37:15 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-it0-f47.google.com with SMTP id b77so15503933itd.0 for ; Sun, 14 Jan 2018 22:37:15 -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:in-reply-to:references:from:date :message-id:subject:cc; bh=oX7DUBtiLYEfkrrXGHWcWDuxqoLrGv0pEEaiBgeuvp8=; b=KyQT1a+lXES4+ct7GwXq5QbMeNbj4sJ9GOg7+BblUXBD6fDQZoHomyNVh6u2wPPmyF dTbBaJmXyMoy6WnCaNJIQxWsXiUv9uYyDkaYmxsUb9hdaB3TTW4NUOgUfYp/SB8tk7zz +XifazTH2HZi9BB1Zj72q52XKg5oPRK9nmNpjrnwp3/IRlIqbzNU2mc9QOuhhN6aO/VT v4LyC8nBpM1/saNQ6XfyKfridaHQdB/2/Wx9aIe4Pu37MAY89qkzXoimYwx36ufclDN4 qCXQGzlDpWmqOIrtNzij6/brYjY4j+sRuLuvlkn58MmtIP4h3CoFofI9lGs1yuIm6gcu ZSrw== X-Gm-Message-State: AKwxytfnNb2kcAh2k5LYpaOxwy2ryI4ViWThQ/kaTYY+8ru/pu/t9Kiu Q0HFZutAHUuu2fIiRTTpsJ8l5LIV X-Google-Smtp-Source: ACJfBovU773Ypk8riqt3p3SIx194nWnLM4UM945hKbUc7uURuRmHm2w0vUJ+3Tb5KWVkcYhUBdZg9Q== X-Received: by 10.36.208.72 with SMTP id m69mr12089333itg.73.1515996975147; Sun, 14 Jan 2018 22:16:15 -0800 (PST) Received: from mail-io0-f173.google.com (mail-io0-f173.google.com. [209.85.223.173]) by smtp.gmail.com with ESMTPSA id e20sm15363986ioe.13.2018.01.14.22.16.14 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Jan 2018 22:16:14 -0800 (PST) Received: by mail-io0-f173.google.com with SMTP id f6so11950789ioh.8 for ; Sun, 14 Jan 2018 22:16:14 -0800 (PST) X-Received: by 10.107.5.142 with SMTP id 136mt37627250iof.239.1515996974490; Sun, 14 Jan 2018 22:16:14 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.149.147 with HTTP; Sun, 14 Jan 2018 22:15:54 -0800 (PST) In-Reply-To: <201801150500.w0F50RGV047396@repo.freebsd.org> References: <201801150500.w0F50RGV047396@repo.freebsd.org> From: Kyle Evans Date: Mon, 15 Jan 2018 00:15:54 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r327991 - head/stand/fdt Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 06:37:16 -0000 On Sun, Jan 14, 2018 at 11:00 PM, Kyle Evans wrote: > Author: kevans > Date: Mon Jan 15 05:00:26 2018 > New Revision: 327991 > URL: https://svnweb.freebsd.org/changeset/base/327991 > > Log: > stand/fdt: don't send clobbered FDT to the kernel > > If fdt_overlay_apply fails at some stage to apply the overlay to the base, > both the base and overlay may be in an inconsistent state (some fixups > applied, some phandles adjusted, some symbols merged). These can be bad for > a number of reasons, to include user frustration if some fixups applied and > not others. Fail a little safer by making a clean copy of the base FDT for > every overlay that we can simply discard if things go awry. > > This also allows us the luxury of simply discarding overlays if we hit some > kind of memory limit or if they're malformed and extremely large for some > reason. We'll now leave a nice error message indicating that some overlays > could not be applied due to size restrictions and we apply what we can. > > I note that our overlay implementation has some flaws that might still leave > your system in an unbootable state even if an overlay applies correctly; > please exercise caution in using overlays until we can swap it out for > libfdt's implementation. > > Tested on: BananaPi-M3 (armv7) > Tested on: Pine64 (aarch64) > Differential Revision: https://reviews.freebsd.org/D13709 > I seem to have droppped this: MFC after: 1 week From owner-svn-src-head@freebsd.org Mon Jan 15 06:46:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7774AEB3058; Mon, 15 Jan 2018 06:46:35 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 42441826B2; Mon, 15 Jan 2018 06:46:35 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B0995578; Mon, 15 Jan 2018 06:46: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 w0F6kY3n092581; Mon, 15 Jan 2018 06:46:34 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0F6kXNa092574; Mon, 15 Jan 2018 06:46:33 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201801150646.w0F6kXNa092574@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Mon, 15 Jan 2018 06:46:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327992 - in head/sys/powerpc: aim booke include powerpc X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: in head/sys/powerpc: aim booke include powerpc X-SVN-Commit-Revision: 327992 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 06:46:35 -0000 Author: nwhitehorn Date: Mon Jan 15 06:46:33 2018 New Revision: 327992 URL: https://svnweb.freebsd.org/changeset/base/327992 Log: Move the pmap-specific code in copyinout.c that gets pointers to userland buffers into a new pmap-module function pmap_map_user_ptr() that can be implemented by the respective modules. This is required to implement non-segment-based AIM-ish MMU systems such as the radix-tree page tables introduced by POWER ISA 3.0 and present on POWER9. Reviewed by: jhibbits Modified: head/sys/powerpc/aim/mmu_oea.c head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/booke/pmap.c head/sys/powerpc/include/pmap.h head/sys/powerpc/powerpc/copyinout.c head/sys/powerpc/powerpc/mmu_if.m head/sys/powerpc/powerpc/pmap_dispatch.c Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Mon Jan 15 05:00:26 2018 (r327991) +++ head/sys/powerpc/aim/mmu_oea.c Mon Jan 15 06:46:33 2018 (r327992) @@ -320,7 +320,10 @@ void moea_dumpsys_map(mmu_t mmu, vm_paddr_t pa, size_t void moea_scan_init(mmu_t mmu); vm_offset_t moea_quick_enter_page(mmu_t mmu, vm_page_t m); void moea_quick_remove_page(mmu_t mmu, vm_offset_t addr); +static int moea_map_user_ptr(mmu_t mmu, pmap_t pm, + volatile const void *uaddr, void **kaddr, size_t ulen, size_t *klen); + static mmu_method_t moea_methods[] = { MMUMETHOD(mmu_clear_modify, moea_clear_modify), MMUMETHOD(mmu_copy_page, moea_copy_page), @@ -370,6 +373,7 @@ static mmu_method_t moea_methods[] = { MMUMETHOD(mmu_dev_direct_mapped,moea_dev_direct_mapped), MMUMETHOD(mmu_scan_init, moea_scan_init), MMUMETHOD(mmu_dumpsys_map, moea_dumpsys_map), + MMUMETHOD(mmu_map_user_ptr, moea_map_user_ptr), { 0, 0 } }; @@ -1542,6 +1546,45 @@ moea_kremove(mmu_t mmu, vm_offset_t va) { moea_remove(mmu, kernel_pmap, va, va + PAGE_SIZE); +} + +/* + * Provide a kernel pointer corresponding to a given userland pointer. + * The returned pointer is valid until the next time this function is + * called in this thread. This is used internally in copyin/copyout. + */ +int +moea_map_user_ptr(mmu_t mmu, pmap_t pm, volatile const void *uaddr, + void **kaddr, size_t ulen, size_t *klen) +{ + size_t l; + register_t vsid; + + *kaddr = (char *)USER_ADDR + ((uintptr_t)uaddr & ~SEGMENT_MASK); + l = ((char *)USER_ADDR + SEGMENT_LENGTH) - (char *)(*kaddr); + if (l > ulen) + l = ulen; + if (klen) + *klen = l; + else if (l != ulen) + return (EFAULT); + + vsid = va_to_vsid(pm, (vm_offset_t)uaddr); + + /* Mark segment no-execute */ + vsid |= SR_N; + + /* If we have already set this VSID, we can just return */ + if (curthread->td_pcb->pcb_cpu.aim.usr_vsid == vsid) + return (0); + + __asm __volatile("isync"); + curthread->td_pcb->pcb_cpu.aim.usr_segm = + (uintptr_t)uaddr >> ADDR_SR_SHFT; + curthread->td_pcb->pcb_cpu.aim.usr_vsid = vsid; + __asm __volatile("mtsr %0,%1; isync" :: "n"(USER_SR), "r"(vsid)); + + return (0); } /* Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Mon Jan 15 05:00:26 2018 (r327991) +++ head/sys/powerpc/aim/mmu_oea64.c Mon Jan 15 06:46:33 2018 (r327992) @@ -284,7 +284,10 @@ void moea64_dumpsys_map(mmu_t mmu, vm_paddr_t pa, size void moea64_scan_init(mmu_t mmu); vm_offset_t moea64_quick_enter_page(mmu_t mmu, vm_page_t m); void moea64_quick_remove_page(mmu_t mmu, vm_offset_t addr); +static int moea64_map_user_ptr(mmu_t mmu, pmap_t pm, + volatile const void *uaddr, void **kaddr, size_t ulen, size_t *klen); + static mmu_method_t moea64_methods[] = { MMUMETHOD(mmu_clear_modify, moea64_clear_modify), MMUMETHOD(mmu_copy_page, moea64_copy_page), @@ -333,6 +336,7 @@ static mmu_method_t moea64_methods[] = { MMUMETHOD(mmu_dev_direct_mapped,moea64_dev_direct_mapped), MMUMETHOD(mmu_scan_init, moea64_scan_init), MMUMETHOD(mmu_dumpsys_map, moea64_dumpsys_map), + MMUMETHOD(mmu_map_user_ptr, moea64_map_user_ptr), { 0, 0 } }; @@ -1831,6 +1835,70 @@ void moea64_kremove(mmu_t mmu, vm_offset_t va) { moea64_remove(mmu, kernel_pmap, va, va + PAGE_SIZE); +} + +/* + * Provide a kernel pointer corresponding to a given userland pointer. + * The returned pointer is valid until the next time this function is + * called in this thread. This is used internally in copyin/copyout. + */ +static int +moea64_map_user_ptr(mmu_t mmu, pmap_t pm, volatile const void *uaddr, + void **kaddr, size_t ulen, size_t *klen) +{ + size_t l; +#ifdef __powerpc64__ + struct slb *slb; +#endif + register_t slbv; + + *kaddr = (char *)USER_ADDR + ((uintptr_t)uaddr & ~SEGMENT_MASK); + l = ((char *)USER_ADDR + SEGMENT_LENGTH) - (char *)(*kaddr); + if (l > ulen) + l = ulen; + if (klen) + *klen = l; + else if (l != ulen) + return (EFAULT); + +#ifdef __powerpc64__ + /* Try lockless look-up first */ + slb = user_va_to_slb_entry(pm, (vm_offset_t)uaddr); + + if (slb == NULL) { + /* If it isn't there, we need to pre-fault the VSID */ + PMAP_LOCK(pm); + slbv = va_to_vsid(pm, (vm_offset_t)uaddr) << SLBV_VSID_SHIFT; + PMAP_UNLOCK(pm); + } else { + slbv = slb->slbv; + } + + /* Mark segment no-execute */ + slbv |= SLBV_N; +#else + slbv = va_to_vsid(pm, (vm_offset_t)uaddr); + + /* Mark segment no-execute */ + slbv |= SR_N; +#endif + + /* If we have already set this VSID, we can just return */ + if (curthread->td_pcb->pcb_cpu.aim.usr_vsid == slbv) + return (0); + + __asm __volatile("isync"); + curthread->td_pcb->pcb_cpu.aim.usr_segm = + (uintptr_t)uaddr >> ADDR_SR_SHFT; + curthread->td_pcb->pcb_cpu.aim.usr_vsid = slbv; +#ifdef __powerpc64__ + __asm __volatile ("slbie %0; slbmte %1, %2; isync" :: + "r"(USER_ADDR), "r"(slbv), "r"(USER_SLB_SLBE)); +#else + __asm __volatile("mtsr %0,%1; isync" :: "n"(USER_SR), "r"(slbv)); +#endif + + return (0); } /* Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Mon Jan 15 05:00:26 2018 (r327991) +++ head/sys/powerpc/booke/pmap.c Mon Jan 15 06:46:33 2018 (r327992) @@ -380,7 +380,10 @@ static vm_offset_t mmu_booke_quick_enter_page(mmu_t mm static void mmu_booke_quick_remove_page(mmu_t mmu, vm_offset_t addr); static int mmu_booke_change_attr(mmu_t mmu, vm_offset_t addr, vm_size_t sz, vm_memattr_t mode); +static int mmu_booke_map_user_ptr(mmu_t mmu, pmap_t pm, + volatile const void *uaddr, void **kaddr, size_t ulen, size_t *klen); + static mmu_method_t mmu_booke_methods[] = { /* pmap dispatcher interface */ MMUMETHOD(mmu_clear_modify, mmu_booke_clear_modify), @@ -432,6 +435,7 @@ static mmu_method_t mmu_booke_methods[] = { MMUMETHOD(mmu_kremove, mmu_booke_kremove), MMUMETHOD(mmu_unmapdev, mmu_booke_unmapdev), MMUMETHOD(mmu_change_attr, mmu_booke_change_attr), + MMUMETHOD(mmu_map_user_ptr, mmu_booke_map_user_ptr), /* dumpsys() support */ MMUMETHOD(mmu_dumpsys_map, mmu_booke_dumpsys_map), @@ -2265,6 +2269,26 @@ mmu_booke_kremove(mmu_t mmu, vm_offset_t va) tlb_miss_unlock(); mtx_unlock_spin(&tlbivax_mutex); +} + +/* + * Provide a kernel pointer corresponding to a given userland pointer. + * The returned pointer is valid until the next time this function is + * called in this thread. This is used internally in copyin/copyout. + */ +int +mmu_booke_map_user_ptr(mmu_t mmu, pmap_t pm, volatile const void *uaddr, + void **kaddr, size_t ulen, size_t *klen) +{ + + if ((uintptr_t)uaddr + ulen > VM_MAXUSER_ADDRESS + PAGE_SIZE) + return (EFAULT); + + *kaddr = (void *)(uintptr_t)uaddr; + if (klen) + *klen = ulen; + + return (0); } /* Modified: head/sys/powerpc/include/pmap.h ============================================================================== --- head/sys/powerpc/include/pmap.h Mon Jan 15 05:00:26 2018 (r327991) +++ head/sys/powerpc/include/pmap.h Mon Jan 15 06:46:33 2018 (r327992) @@ -260,6 +260,8 @@ void *pmap_mapdev_attr(vm_paddr_t, vm_size_t, vm_mema void pmap_unmapdev(vm_offset_t, vm_size_t); void pmap_page_set_memattr(vm_page_t, vm_memattr_t); int pmap_change_attr(vm_offset_t, vm_size_t, vm_memattr_t); +int pmap_map_user_ptr(pmap_t pm, volatile const void *uaddr, + void **kaddr, size_t ulen, size_t *klen); void pmap_deactivate(struct thread *); vm_paddr_t pmap_kextract(vm_offset_t); int pmap_dev_direct_mapped(vm_paddr_t, vm_size_t); Modified: head/sys/powerpc/powerpc/copyinout.c ============================================================================== --- head/sys/powerpc/powerpc/copyinout.c Mon Jan 15 05:00:26 2018 (r327991) +++ head/sys/powerpc/powerpc/copyinout.c Mon Jan 15 06:46:33 2018 (r327992) @@ -69,108 +69,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include -#ifdef AIM -/* - * Makes sure that the right segment of userspace is mapped in. - */ - -#ifdef __powerpc64__ -static __inline void -set_user_sr(pmap_t pm, volatile const void *addr) -{ - struct slb *slb; - register_t slbv; - - /* Try lockless look-up first */ - slb = user_va_to_slb_entry(pm, (vm_offset_t)addr); - - if (slb == NULL) { - /* If it isn't there, we need to pre-fault the VSID */ - PMAP_LOCK(pm); - slbv = va_to_vsid(pm, (vm_offset_t)addr) << SLBV_VSID_SHIFT; - PMAP_UNLOCK(pm); - } else { - slbv = slb->slbv; - } - - /* Mark segment no-execute */ - slbv |= SLBV_N; - - /* If we have already set this VSID, we can just return */ - if (curthread->td_pcb->pcb_cpu.aim.usr_vsid == slbv) - return; - - __asm __volatile("isync"); - curthread->td_pcb->pcb_cpu.aim.usr_segm = - (uintptr_t)addr >> ADDR_SR_SHFT; - curthread->td_pcb->pcb_cpu.aim.usr_vsid = slbv; - __asm __volatile ("slbie %0; slbmte %1, %2; isync" :: - "r"(USER_ADDR), "r"(slbv), "r"(USER_SLB_SLBE)); -} -#else -static __inline void -set_user_sr(pmap_t pm, volatile const void *addr) -{ - register_t vsid; - - vsid = va_to_vsid(pm, (vm_offset_t)addr); - - /* Mark segment no-execute */ - vsid |= SR_N; - - /* If we have already set this VSID, we can just return */ - if (curthread->td_pcb->pcb_cpu.aim.usr_vsid == vsid) - return; - - __asm __volatile("isync"); - curthread->td_pcb->pcb_cpu.aim.usr_segm = - (uintptr_t)addr >> ADDR_SR_SHFT; - curthread->td_pcb->pcb_cpu.aim.usr_vsid = vsid; - __asm __volatile("mtsr %0,%1; isync" :: "n"(USER_SR), "r"(vsid)); -} -#endif - -static __inline int -map_user_ptr(pmap_t pm, volatile const void *uaddr, void **kaddr, size_t ulen, - size_t *klen) -{ - size_t l; - - *kaddr = (char *)USER_ADDR + ((uintptr_t)uaddr & ~SEGMENT_MASK); - - l = ((char *)USER_ADDR + SEGMENT_LENGTH) - (char *)(*kaddr); - if (l > ulen) - l = ulen; - if (klen) - *klen = l; - else if (l != ulen) - return (EFAULT); - - set_user_sr(pm, uaddr); - - return (0); -} -#else /* Book-E uses a combined kernel/user mapping */ -static __inline int -map_user_ptr(pmap_t pm, volatile const void *uaddr, void **kaddr, size_t ulen, - size_t *klen) -{ - - if ((uintptr_t)uaddr + ulen > VM_MAXUSER_ADDRESS + PAGE_SIZE) - return (EFAULT); - - *kaddr = (void *)(uintptr_t)uaddr; - if (klen) - *klen = ulen; - - return (0); -} -#endif - int copyout(const void *kaddr, void *udaddr, size_t len) { @@ -194,7 +94,7 @@ copyout(const void *kaddr, void *udaddr, size_t len) up = udaddr; while (len > 0) { - if (map_user_ptr(pm, udaddr, (void **)&p, len, &l)) { + if (pmap_map_user_ptr(pm, udaddr, (void **)&p, len, &l)) { td->td_pcb->pcb_onfault = NULL; return (EFAULT); } @@ -233,7 +133,7 @@ copyin(const void *udaddr, void *kaddr, size_t len) up = udaddr; while (len > 0) { - if (map_user_ptr(pm, udaddr, (void **)&p, len, &l)) { + if (pmap_map_user_ptr(pm, udaddr, (void **)&p, len, &l)) { td->td_pcb->pcb_onfault = NULL; return (EFAULT); } @@ -299,7 +199,7 @@ subyte(volatile void *addr, int byte) return (-1); } - if (map_user_ptr(pm, addr, (void **)&p, sizeof(*p), NULL)) { + if (pmap_map_user_ptr(pm, addr, (void **)&p, sizeof(*p), NULL)) { td->td_pcb->pcb_onfault = NULL; return (-1); } @@ -328,7 +228,7 @@ suword32(volatile void *addr, int word) return (-1); } - if (map_user_ptr(pm, addr, (void **)&p, sizeof(*p), NULL)) { + if (pmap_map_user_ptr(pm, addr, (void **)&p, sizeof(*p), NULL)) { td->td_pcb->pcb_onfault = NULL; return (-1); } @@ -357,7 +257,7 @@ suword(volatile void *addr, long word) return (-1); } - if (map_user_ptr(pm, addr, (void **)&p, sizeof(*p), NULL)) { + if (pmap_map_user_ptr(pm, addr, (void **)&p, sizeof(*p), NULL)) { td->td_pcb->pcb_onfault = NULL; return (-1); } @@ -400,7 +300,7 @@ fubyte(volatile const void *addr) return (-1); } - if (map_user_ptr(pm, addr, (void **)&p, sizeof(*p), NULL)) { + if (pmap_map_user_ptr(pm, addr, (void **)&p, sizeof(*p), NULL)) { td->td_pcb->pcb_onfault = NULL; return (-1); } @@ -428,7 +328,7 @@ fuword16(volatile const void *addr) return (-1); } - if (map_user_ptr(pm, addr, (void **)&p, sizeof(*p), NULL)) { + if (pmap_map_user_ptr(pm, addr, (void **)&p, sizeof(*p), NULL)) { td->td_pcb->pcb_onfault = NULL; return (-1); } @@ -456,7 +356,7 @@ fueword32(volatile const void *addr, int32_t *val) return (-1); } - if (map_user_ptr(pm, addr, (void **)&p, sizeof(*p), NULL)) { + if (pmap_map_user_ptr(pm, addr, (void **)&p, sizeof(*p), NULL)) { td->td_pcb->pcb_onfault = NULL; return (-1); } @@ -485,7 +385,7 @@ fueword64(volatile const void *addr, int64_t *val) return (-1); } - if (map_user_ptr(pm, addr, (void **)&p, sizeof(*p), NULL)) { + if (pmap_map_user_ptr(pm, addr, (void **)&p, sizeof(*p), NULL)) { td->td_pcb->pcb_onfault = NULL; return (-1); } @@ -514,7 +414,7 @@ fueword(volatile const void *addr, long *val) return (-1); } - if (map_user_ptr(pm, addr, (void **)&p, sizeof(*p), NULL)) { + if (pmap_map_user_ptr(pm, addr, (void **)&p, sizeof(*p), NULL)) { td->td_pcb->pcb_onfault = NULL; return (-1); } @@ -543,8 +443,8 @@ casueword32(volatile uint32_t *addr, uint32_t old, uin return (-1); } - if (map_user_ptr(pm, (void *)(uintptr_t)addr, (void **)&p, sizeof(*p), - NULL)) { + if (pmap_map_user_ptr(pm, (void *)(uintptr_t)addr, (void **)&p, + sizeof(*p), NULL)) { td->td_pcb->pcb_onfault = NULL; return (-1); } @@ -595,8 +495,8 @@ casueword(volatile u_long *addr, u_long old, u_long *o return (-1); } - if (map_user_ptr(pm, (void *)(uintptr_t)addr, (void **)&p, sizeof(*p), - NULL)) { + if (pmap_map_user_ptr(pm, (void *)(uintptr_t)addr, (void **)&p, + sizeof(*p), NULL)) { td->td_pcb->pcb_onfault = NULL; return (-1); } Modified: head/sys/powerpc/powerpc/mmu_if.m ============================================================================== --- head/sys/powerpc/powerpc/mmu_if.m Mon Jan 15 05:00:26 2018 (r327991) +++ head/sys/powerpc/powerpc/mmu_if.m Mon Jan 15 06:46:33 2018 (r327992) @@ -817,6 +817,27 @@ METHOD void unmapdev { vm_size_t _size; }; +/** + * @brief Provide a kernel-space pointer that can be used to access the + * given userland address. The kernel accessible length returned in klen + * may be less than the requested length of the userland buffer (ulen). If + * so, retry with a higher address to get access to the later parts of the + * buffer. Returns EFAULT if no mapping can be made, else zero. + * + * @param _pm PMAP for the user pointer. + * @param _uaddr Userland address to map. + * @param _kaddr Corresponding kernel address. + * @param _ulen Length of user buffer. + * @param _klen Available subset of ulen with _kaddr. + */ +METHOD int map_user_ptr { + mmu_t _mmu; + pmap_t _pm; + volatile const void *_uaddr; + void **_kaddr; + size_t _ulen; + size_t *_klen; +}; /** * @brief Reverse-map a kernel virtual address Modified: head/sys/powerpc/powerpc/pmap_dispatch.c ============================================================================== --- head/sys/powerpc/powerpc/pmap_dispatch.c Mon Jan 15 05:00:26 2018 (r327991) +++ head/sys/powerpc/powerpc/pmap_dispatch.c Mon Jan 15 06:46:33 2018 (r327992) @@ -511,6 +511,15 @@ pmap_kremove(vm_offset_t va) return (MMU_KREMOVE(mmu_obj, va)); } +int +pmap_map_user_ptr(pmap_t pm, volatile const void *uaddr, void **kaddr, + size_t ulen, size_t *klen) +{ + + CTR2(KTR_PMAP, "%s(%p)", __func__, uaddr); + return (MMU_MAP_USER_PTR(mmu_obj, pm, uaddr, kaddr, ulen, klen)); +} + boolean_t pmap_dev_direct_mapped(vm_paddr_t pa, vm_size_t size) { From owner-svn-src-head@freebsd.org Mon Jan 15 08:32:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E0B1EB8C85; Mon, 15 Jan 2018 08:32:50 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 37ED02D5D; Mon, 15 Jan 2018 08:32:50 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 69F5F679E; Mon, 15 Jan 2018 08:32:49 +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 w0F8Wn3c038281; Mon, 15 Jan 2018 08:32:49 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0F8WnS9038280; Mon, 15 Jan 2018 08:32:49 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201801150832.w0F8WnS9038280@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 15 Jan 2018 08:32:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327994 - head/lib/libsysdecode X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/lib/libsysdecode X-SVN-Commit-Revision: 327994 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 08:32:50 -0000 Author: tuexen Date: Mon Jan 15 08:32:49 2018 New Revision: 327994 URL: https://svnweb.freebsd.org/changeset/base/327994 Log: Simplify table generation. Modified: head/lib/libsysdecode/mktables Modified: head/lib/libsysdecode/mktables ============================================================================== --- head/lib/libsysdecode/mktables Mon Jan 15 08:04:55 2018 (r327993) +++ head/lib/libsysdecode/mktables Mon Jan 15 08:32:49 2018 (r327994) @@ -157,7 +157,7 @@ gen_table "sigcode" "SI_[A-Z]+[[:space:]]+0(x[ gen_table "umtxcvwaitflags" "CVWAIT_[A-Z_]+[[:space:]]+0x[0-9]+" "sys/umtx.h" gen_table "umtxrwlockflags" "URWLOCK_PREFER_READER[[:space:]]+0x[0-9]+" "sys/umtx.h" gen_table "caprights" "CAP_[A-Z_]+[[:space:]]+CAPRIGHT\([0-9],[[:space:]]+0x[0-9]{16}ULL\)" "sys/capsicum.h" -gen_table "sctpprpolicy" "SCTP_PR_SCTP_[A-Z_]+" "netinet/sctp_uio.h" "SCTP_PR_SCTP_BUF|SCTP_PR_SCTP_MAX|SCTP_PR_SCTP_ALL" +gen_table "sctpprpolicy" "SCTP_PR_SCTP_[A-Z_]+[[:space:]]+0x[0-9]+" "netinet/sctp_uio.h" "SCTP_PR_SCTP_ALL" if [ -e "${include_dir}/x86/sysarch.h" ]; then gen_table "sysarchnum" "(AMD64|I386)_[A-Z86_]+[[:space:]]+[0-9]+" "x86/sysarch.h" else From owner-svn-src-head@freebsd.org Mon Jan 15 10:12:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5EF7AE6FFE7; Mon, 15 Jan 2018 10:12:00 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from mail-it0-x244.google.com (mail-it0-x244.google.com [IPv6:2607:f8b0:4001:c0b::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 249056B1CF; Mon, 15 Jan 2018 10:12:00 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: by mail-it0-x244.google.com with SMTP id c16so303469itc.5; Mon, 15 Jan 2018 02:12:00 -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=DlcQaQ8rHJm7pxzasAujY6G3v6NFz9NsrI/YVQImcfI=; b=t+rxsbMR7zExoW0dFYhpg0mQwRbc0MpAqvyO9fZzZhGXaX3lPidlT9mYNwnRence8I 4Q41amT4HH9vzIOWRANdp+JTlrlm3a3R3fil5rgMQXIVIGhyLkxn/9hlU7MUWd52AEtd hhWCQb1DvYj8bxBy7Ixj5HcsI9yzN8xCX+6iseoE46gR7g3Neog/i4WHcYh2eM0THzL7 KsmWx0cBrZW9HtZ5HHpozf3bcnTvfhL9eM4b7VMu8L4icj0/j8TUa8REfnmanlSC/Dsq OjWQt2UGCEpMO5mQeOYRo2sLvRVssZKR/cLNDojR6jjFOhfTQKso0foRnnTr8TI4Lh+G xSiw== 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=DlcQaQ8rHJm7pxzasAujY6G3v6NFz9NsrI/YVQImcfI=; b=Xjs9LybaqAwpJGcQpEnF01Mx0m7Nm8oJ3hSokuqhT5pQJSVTdFYOUYAdS9+fJ/Vhi9 6riqWZia0YbFcLjAsOrfol3ucvVl/9carxWffQVcDqwNgTRJdYaBta9JogKMRjSlaaFb CLsBaizGt+i9KFpz1MWEwB7mg33E+slzJEq04X2N6G60ZQBWiaDlDtePPIusgymH5HJt bY1JLP/4kQjcvfF21qCYUJ9cGzpHIpbq7mJhYqBdXcRyCy1U2yMeDyvsMEkonh8Lsxco DKYaSzHfohWk4J/mtQaRemE8zrQho0LTAa/iwIwhR7B3CQTTV8NtA3Ph0rAiVKV9Gbik UkuA== X-Gm-Message-State: AKwxyteBOcJFjjEnaGi68r97lECyS5JQRUDd9vFad0bh4Jqk+GEO4Z0F uN0Hoz1hte5CsU/x3MNrkKvIPoCoJvEYkoY+9xaJaw== X-Google-Smtp-Source: ACJfBouXLP28xi7nTKHJZA1OxJSy3Bjsa6qOpy6qwmhZWmyQNVDH1dWMN85rcnz3hPOxOC1TgIRVtSZYFcTdhiUVVwc= X-Received: by 10.36.21.140 with SMTP id 134mr5918388itq.14.1516011119327; Mon, 15 Jan 2018 02:11:59 -0800 (PST) MIME-Version: 1.0 Sender: antoine.brodin.freebsd@gmail.com Received: by 10.107.190.1 with HTTP; Mon, 15 Jan 2018 02:11:58 -0800 (PST) In-Reply-To: <201801111924.w0BJOicg089230@repo.freebsd.org> References: <201801111924.w0BJOicg089230@repo.freebsd.org> From: Antoine Brodin Date: Mon, 15 Jan 2018 11:11:58 +0100 X-Google-Sender-Auth: k-JREUOZGIitcuwU6aMUPf7llFI Message-ID: Subject: Re: svn commit: r327841 - head To: John Baldwin Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 10:12:00 -0000 On Thu, Jan 11, 2018 at 8:24 PM, John Baldwin wrote: > Author: jhb > Date: Thu Jan 11 19:24:44 2018 > New Revision: 327841 > URL: https://svnweb.freebsd.org/changeset/base/327841 > > Log: > Allow MIPS lib32 to build with clang. > > Don't try to set -march as clang doesn't permit use of the O32 ABI > with newer CPU microarchitectures like 'mips3'. In addition, clang > doesn't permit the O32 ABI with the default N64 target, so use an > explicit O32 -target for clang. > > Sponsored by: DARPA / AFRL > > Modified: > head/Makefile.libcompat Hi, This seems to break buildworld for mips/mips64 --- includes_subdir_include/rpc --- RPCGEN_CPP=cpp\ -DCOMPAT_32BIT\ -target\ mips-unknown-freebsd12.0\ -mabi=32\ \ -L/usr/obj/usr/local/poudriere/jails/head-mips64/usr/src/mips.mips64/obj-lib32/tmp/usr/lib32\ \ --sysroot=/usr/obj/usr/local/poudriere/jails/head-mips64/usr/src/mips.mips64/obj-lib32/tmp\ \ -B/usr/obj/usr/local/poudriere/jails/head-mips64/usr/src/mips.mips64/tmp/usr/bin\ -B/usr/obj/usr/local/poudriere/jails/head-mips64/usr/src/mips.mips64/obj-lib32/tmp/usr/lib32\ -isystem\ /usr/obj/usr/local/poudriere/jails/head-mips64/usr/src/mips.mips64/obj-lib32/tmp/usr/include rpcgen -C -h -DWANT_NFS3 /usr/local/poudriere/jails/head-mips64/usr/src/include/rpc/rpcb_prot.x -o rpcb_prot.h cpp: mips-unknown-freebsd12.0: No such file or directory cpp: warning: '-x c' after last input file has no effect cpp: unrecognized option '-target' cpp: No input files specified *** [rpcb_prot.h] Error code 1 Cheers, Antoine From owner-svn-src-head@freebsd.org Mon Jan 15 10:59:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F6D4E73A60; Mon, 15 Jan 2018 10:59:06 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 58A536D78B; Mon, 15 Jan 2018 10:59:06 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ABF72100B4; Mon, 15 Jan 2018 10:59: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 w0FAx5Ti097360; Mon, 15 Jan 2018 10:59:05 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0FAx4NZ097353; Mon, 15 Jan 2018 10:59:04 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201801151059.w0FAx4NZ097353@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 15 Jan 2018 10:59:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327995 - head/lib/libsysdecode X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/lib/libsysdecode X-SVN-Commit-Revision: 327995 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 10:59:06 -0000 Author: tuexen Date: Mon Jan 15 10:59:04 2018 New Revision: 327995 URL: https://svnweb.freebsd.org/changeset/base/327995 Log: Add support for decoding the type of a cmsg. Added: head/lib/libsysdecode/sysdecode_cmsg_type.3 (contents, props changed) Modified: head/lib/libsysdecode/Makefile head/lib/libsysdecode/flags.c head/lib/libsysdecode/mktables head/lib/libsysdecode/sysdecode.3 head/lib/libsysdecode/sysdecode.h Modified: head/lib/libsysdecode/Makefile ============================================================================== --- head/lib/libsysdecode/Makefile Mon Jan 15 08:32:49 2018 (r327994) +++ head/lib/libsysdecode/Makefile Mon Jan 15 10:59:04 2018 (r327995) @@ -15,6 +15,7 @@ CFLAGS+= -I${SRCTOP}/libexec/rtld-elf MAN= sysdecode.3 \ sysdecode_abi_to_freebsd_errno.3 \ sysdecode_cap_rights.3 \ + sysdecode_cmsg_type.3 \ sysdecode_enum.3 \ sysdecode_fcntl_arg.3 \ sysdecode_kevent.3 \ Modified: head/lib/libsysdecode/flags.c ============================================================================== --- head/lib/libsysdecode/flags.c Mon Jan 15 08:32:49 2018 (r327994) +++ head/lib/libsysdecode/flags.c Mon Jan 15 10:59:04 2018 (r327995) @@ -1159,6 +1159,46 @@ sysdecode_cap_rights(FILE *fp, cap_rights_t *rightsp) } } +static struct name_table cmsgtypeip[] = { + X(IP_RECVDSTADDR) X(IP_RECVTTL) X(IP_RECVOPTS) X(IP_RECVRETOPTS) + X(IP_RECVIF) X(IP_RECVTOS) X(IP_FLOWID) X(IP_FLOWTYPE) + X(IP_RSSBUCKETID) XEND +}; + +static struct name_table cmsgtypeipv6[] = { +#if 0 + /* The RFC 2292 defines are kernel space only. */ + X(IPV6_2292PKTINFO) X(IPV6_2292HOPLIMIT) X(IPV6_2292HOPOPTS) + X(IPV6_2292DSTOPTS) X(IPV6_2292RTHDR) X(IPV6_2292NEXTHOP) +#endif + X(IPV6_PKTINFO) X(IPV6_HOPLIMIT) X(IPV6_HOPOPTS) + X(IPV6_DSTOPTS) X(IPV6_RTHDR) X(IPV6_NEXTHOP) + X(IPV6_TCLASS) X(IPV6_FLOWID) X(IPV6_FLOWTYPE) X(IPV6_RSSBUCKETID) + X(IPV6_PATHMTU) X(IPV6_RTHDRDSTOPTS) X(IPV6_USE_MIN_MTU) + X(IPV6_DONTFRAG) X(IPV6_PREFER_TEMPADDR) XEND +}; + +static struct name_table cmsgtypesctp[] = { + X(SCTP_INIT) X(SCTP_SNDRCV) X(SCTP_EXTRCV) X(SCTP_SNDINFO) + X(SCTP_RCVINFO) X(SCTP_NXTINFO) X(SCTP_PRINFO) X(SCTP_AUTHINFO) + X(SCTP_DSTADDRV4) X(SCTP_DSTADDRV6) XEND +}; + +const char * +sysdecode_cmsg_type(int cmsg_level, int cmsg_type) +{ + + if (cmsg_level == SOL_SOCKET) + return (lookup_value(cmsgtypesocket, cmsg_type)); + if (cmsg_level == IPPROTO_IP) + return (lookup_value(cmsgtypeip, cmsg_type)); + if (cmsg_level == IPPROTO_IPV6) + return (lookup_value(cmsgtypeipv6, cmsg_type)); + if (cmsg_level == IPPROTO_SCTP) + return (lookup_value(cmsgtypesctp, cmsg_type)); + return (NULL); +} + const char * sysdecode_sctp_pr_policy(int policy) { Modified: head/lib/libsysdecode/mktables ============================================================================== --- head/lib/libsysdecode/mktables Mon Jan 15 08:32:49 2018 (r327994) +++ head/lib/libsysdecode/mktables Mon Jan 15 10:59:04 2018 (r327995) @@ -158,6 +158,7 @@ gen_table "umtxcvwaitflags" "CVWAIT_[A-Z_]+[[:space:]] gen_table "umtxrwlockflags" "URWLOCK_PREFER_READER[[:space:]]+0x[0-9]+" "sys/umtx.h" gen_table "caprights" "CAP_[A-Z_]+[[:space:]]+CAPRIGHT\([0-9],[[:space:]]+0x[0-9]{16}ULL\)" "sys/capsicum.h" gen_table "sctpprpolicy" "SCTP_PR_SCTP_[A-Z_]+[[:space:]]+0x[0-9]+" "netinet/sctp_uio.h" "SCTP_PR_SCTP_ALL" +gen_table "cmsgtypesocket" "SCM_[A-Z_]+[[:space:]]+0x[0-9]+" "sys/socket.h" if [ -e "${include_dir}/x86/sysarch.h" ]; then gen_table "sysarchnum" "(AMD64|I386)_[A-Z86_]+[[:space:]]+[0-9]+" "x86/sysarch.h" else Modified: head/lib/libsysdecode/sysdecode.3 ============================================================================== --- head/lib/libsysdecode/sysdecode.3 Mon Jan 15 08:32:49 2018 (r327994) +++ head/lib/libsysdecode/sysdecode.3 Mon Jan 15 10:59:04 2018 (r327995) @@ -73,6 +73,7 @@ A placeholder for use when the ABI is not known. .Sh SEE ALSO .Xr sysdecode_abi_to_freebsd_errno 3 , .Xr sysdecode_cap_rights 3 , +.Xr sysdecode_cmsg_type 3 , .Xr sysdecode_enum 3 , .Xr sysdecode_fcntl_arg 3 , .Xr sysdecode_ioctlname 3 , Modified: head/lib/libsysdecode/sysdecode.h ============================================================================== --- head/lib/libsysdecode/sysdecode.h Mon Jan 15 08:32:49 2018 (r327994) +++ head/lib/libsysdecode/sysdecode.h Mon Jan 15 10:59:04 2018 (r327995) @@ -46,6 +46,7 @@ const char *sysdecode_atfd(int _fd); bool sysdecode_atflags(FILE *_fp, int _flags, int *_rem); bool sysdecode_cap_fcntlrights(FILE *_fp, uint32_t _rights, uint32_t *_rem); void sysdecode_cap_rights(FILE *_fp, cap_rights_t *_rightsp); +const char *sysdecode_cmsg_type(int _cmsg_level, int _cmsg_type); const char *sysdecode_extattrnamespace(int _namespace); const char *sysdecode_fadvice(int _advice); void sysdecode_fcntl_arg(FILE *_fp, int _cmd, uintptr_t _arg, int _base); Added: head/lib/libsysdecode/sysdecode_cmsg_type.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libsysdecode/sysdecode_cmsg_type.3 Mon Jan 15 10:59:04 2018 (r327995) @@ -0,0 +1,54 @@ +.\" +.\" Copyright (c) 2018 Michael Tuexen +.\" 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 January 15, 2018 +.Dt sysdecode_cmsg_type 3 +.Os +.Sh NAME +.Nm sysdecode_cmsg_type +.Nd lookup name of cmsg type +.Sh LIBRARY +.Lb libsysdecode +.Sh SYNOPSIS +.In sys/types.h +.In stdbool.h +.In sysdecode.h +.Ft const char * +.Fn sysdecode_cmsg_type "int cmsg_level" "int cmsg_type" +.Sh DESCRIPTION +The +.Fn sysdecode_cmsg_type +function returns a text description of the +.Fa cmsg_type +member of a +.Vt struct cmsghdr . +.Fn sysdecode_cmsg_type +also takes the +.Fa cmsg_level +to uniquely identify the type. +.Sh SEE ALSO +.Xr sysdecode 3 From owner-svn-src-head@freebsd.org Mon Jan 15 11:18:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D0EEE75105; Mon, 15 Jan 2018 11:18: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 A56826E4FF; Mon, 15 Jan 2018 11:18:21 +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 w0FBIC2E085777 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 15 Jan 2018 13:18:15 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w0FBIC2E085777 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w0FBICFG085775; Mon, 15 Jan 2018 13:18:12 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 15 Jan 2018 13:18:12 +0200 From: Konstantin Belousov To: Nathan Whitehorn Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327950 - in head/sys/powerpc: aim include powerpc ps3 Message-ID: <20180115111812.GF1684@kib.kiev.ua> References: <010d0153-8931-a3c2-db21-dfcbaf848fc0@freebsd.org> <20180114083036.GX1684@kib.kiev.ua> <20180114170502.GB1684@kib.kiev.ua> <184ba3ee-a9f7-01ed-bb02-1bcba9acc041@freebsd.org> <20180114175211.GD1684@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: 8bit 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-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 11:18:22 -0000 On Sun, Jan 14, 2018 at 03:46:38PM -0800, Nathan Whitehorn wrote: > > > On 01/14/18 15:42, Nathan Whitehorn wrote: > > > > > > On 01/14/18 09:57, Nathan Whitehorn wrote: > >> > >> > >> On 01/14/18 09:52, Konstantin Belousov wrote: > >>> On Sun, Jan 14, 2018 at 09:30:53AM -0800, Nathan Whitehorn wrote: > >>>> The immediate consequence of that is that no MI code that knows about > >>>> direct maps can possibly take advantage of the direct map on this > >>>> platform. Do we really want that to save some conditional logic that > >>>> would get optimized out on amd64 and arm64 anyway? I really do not see > >>>> the benefit here. > >>> It is not clear what do you mean.š Are you saying that there is no > >>> benefit > >>> of providing the conditional logic, or that it is not benefit of > >>> exclusing > >>> powerpc ? > >> > >> Sorry, that was poorly stated. Let me try again: > >> > >> If we make a PPC_PHYS_TO_DMAP(), but there is an MI PHYS_TO_DMAP() > >> API, consumer code in the MI parts of the kernel won't be able to > >> benefit from the PPC direct map, which seems unfortunate. The cost > >> from a code perspective of having an if (direct_map_available) seems > >> low, since on systems where direct_map_available is defined to be 1, > >> the compiler will optimize it to the same code as if gated by #ifdef. > >> It might be more cumbersome to write the code, however. > >> > >>> I do not object against adding the conditional, but it should not be > >>> too clumsy to use. > >>> > >> > >> OK. Let me try to draft something in the next couple days and see how > >> much of a pain it is in practice. > >> -Nathan > >> > > > > How about the attached? It makes PHYS_TO_DMAP() return 0 if no mapping > > exists. This is straightforward, does not introduce extra macros, and > > can pretty easily replace SFBUF_OPTIONAL_DIRECT_MAP on the assumption > > that PHYS_TO_DMAP() is cheap. I've modified the other MI-ish consumers > > in the tree accordingly; compat/linuxkpi/common/src/linux_page.c > > already does the right thing and needed no modifications. > > -Nathan I think that this is fine from the PoV of code complexity. We now require MI (but not amd64 and arm64 MD) code to check for PHYS_TO_DMAP() return value, which is redundand for a*64. I am not sure if this is good choice from the PoV of possible microoptimizations. You promised something which is trivially detectable by compiler as an excess code. > > Sorry, this is the patch I meant to send. Do you plan to convert sf buf code on powerpc ? > -Nathan > Index: powerpc/include/vmparam.h > =================================================================== > --- powerpc/include/vmparam.h (revision 327952) > +++ powerpc/include/vmparam.h (working copy) > @@ -240,13 +240,12 @@ > #define SFBUF_PHYS_DMAP(x) (x) > > /* > - * We (usually) have a direct map of all physical memory. All > - * uses of this macro must be gated by a check on hw_direct_map! > - * The location of the direct map may not be 1:1 in future, so use > - * of the macro is recommended; it may also grow an assert that hw_direct_map > - * is set. > + * We (usually) have a direct map of all physical memory, so provide > + * a macro to use to get the kernel VA address for a given PA. Returns > + * 0 if the direct map is unavailable. The location of the direct map > + * may not be 1:1 in future, so use of the macro is recommended. > */ > -#define PHYS_TO_DMAP(x) x > -#define DMAP_TO_PHYS(x) x > +#define PHYS_TO_DMAP(x) (hw_direct_map ? (x) : 0) > +#define DMAP_TO_PHYS(x) (hw_direct_map ? (x) : 0) > > #endif /* _MACHINE_VMPARAM_H_ */ > Index: vm/vm_page.c > =================================================================== > --- vm/vm_page.c (revision 327952) > +++ vm/vm_page.c (working copy) > @@ -2937,7 +2937,8 @@ > { > > #if defined(DIAGNOSTIC) && defined(PHYS_TO_DMAP) > - if ((m->flags & PG_ZERO) != 0) { > + if ((m->flags & PG_ZERO) != 0 && > + PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)) != 0) { > uint64_t *p; > int i; > p = (uint64_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)); > Index: dev/efidev/efirt.c > =================================================================== > --- dev/efidev/efirt.c (revision 327952) > +++ dev/efidev/efirt.c (working copy) > @@ -115,6 +115,11 @@ > return (0); > } > efi_systbl = (struct efi_systbl *)PHYS_TO_DMAP(efi_systbl_phys); > + if (efi_systbl == NULL) { > + if (bootverbose) > + printf("EFI systbl not mapped in kernel VA\n"); > + return (0); > + } > if (efi_systbl->st_hdr.th_sig != EFI_SYSTBL_SIG) { > efi_systbl = NULL; > if (bootverbose) From owner-svn-src-head@freebsd.org Mon Jan 15 11:20:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 075E7E75352; Mon, 15 Jan 2018 11:20:02 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D36C16E70B; Mon, 15 Jan 2018 11:20:01 +0000 (UTC) (envelope-from avg@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F18510448; Mon, 15 Jan 2018 11:20:01 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0FBK063006164; Mon, 15 Jan 2018 11:20:00 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0FBK0Jf006161; Mon, 15 Jan 2018 11:20:00 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201801151120.w0FBK0Jf006161@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 15 Jan 2018 11:20:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327996 - in head/sys: cam/scsi geom X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in head/sys: cam/scsi geom X-SVN-Commit-Revision: 327996 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 11:20:02 -0000 Author: avg Date: Mon Jan 15 11:20:00 2018 New Revision: 327996 URL: https://svnweb.freebsd.org/changeset/base/327996 Log: geom_disk / scsi_da: deny opening write-protected disks for writing Ths change consists of two parts. geom_disk: deny opening a disk for writing if it's marked as write-protected. A new disk(9) flag is added to mark write protected disks. A possible alternative could be to add another parameter to d_open, so that the open mode could be passed to it and the disk drivers could make the decision internally, but the flag required less churn. scsi_da: add a new phase of disk probing to query the all pages mode sense page. We can determine if the disk is write protected using bit 7 of the device specific field in the mode parameter header returned by MODE SENSE. PR: 224037 Reviewed by: mav MFC after: 4 weeks Differential Revision: https://reviews.freebsd.org/D13360 Modified: head/sys/cam/scsi/scsi_da.c head/sys/geom/geom_disk.c head/sys/geom/geom_disk.h Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Mon Jan 15 10:59:04 2018 (r327995) +++ head/sys/cam/scsi/scsi_da.c Mon Jan 15 11:20:00 2018 (r327996) @@ -81,6 +81,7 @@ __FBSDID("$FreeBSD$"); * ATA -> LOGDIR -> IDDIR -> SUP -> ATA_ZONE */ typedef enum { + DA_STATE_PROBE_WP, DA_STATE_PROBE_RC, DA_STATE_PROBE_RC16, DA_STATE_PROBE_LBP, @@ -157,6 +158,7 @@ typedef enum { DA_CCB_PROBE_ATA_IDDIR = 0x0F, DA_CCB_PROBE_ATA_SUP = 0x10, DA_CCB_PROBE_ATA_ZONE = 0x11, + DA_CCB_PROBE_WP = 0x12, DA_CCB_TYPE_MASK = 0x1F, DA_CCB_RETRY_UA = 0x20 } da_ccb_state; @@ -2427,7 +2429,7 @@ daregister(struct cam_periph *periph, void *arg) } LIST_INIT(&softc->pending_ccbs); - softc->state = DA_STATE_PROBE_RC; + softc->state = DA_STATE_PROBE_WP; bioq_init(&softc->delete_run_queue); if (SID_IS_REMOVABLE(&cgd->inq_data)) softc->flags |= DA_FLAG_PACK_REMOVABLE; @@ -2526,7 +2528,6 @@ daregister(struct cam_periph *periph, void *arg) if (SID_ANSI_REV(&cgd->inq_data) >= SCSI_REV_SPC3 && (softc->quirks & DA_Q_NO_RC16) == 0) { softc->flags |= DA_FLAG_CAN_RC16; - softc->state = DA_STATE_PROBE_RC16; } /* @@ -3095,6 +3096,36 @@ out: daschedule(periph); break; } + case DA_STATE_PROBE_WP: + { + void *mode_buf; + int mode_buf_len; + + mode_buf_len = 192; + mode_buf = malloc(mode_buf_len, M_SCSIDA, M_NOWAIT); + if (mode_buf == NULL) { + xpt_print(periph->path, "Unable to send mode sense - " + "malloc failure\n"); + softc->state = DA_STATE_PROBE_RC; + goto skipstate; + } + scsi_mode_sense_len(&start_ccb->csio, + /*retries*/ da_retry_count, + /*cbfcnp*/ dadone, + /*tag_action*/ MSG_SIMPLE_Q_TAG, + /*dbd*/ FALSE, + /*pc*/ SMS_PAGE_CTRL_CURRENT, + /*page*/ SMS_ALL_PAGES_PAGE, + /*param_buf*/ mode_buf, + /*param_len*/ mode_buf_len, + /*minimum_cmd_size*/ softc->minimum_cmd_size, + /*sense_len*/ SSD_FULL_SIZE, + /*timeout*/ da_default_timeout * 1000); + start_ccb->ccb_h.ccb_bp = NULL; + start_ccb->ccb_h.ccb_state = DA_CCB_PROBE_WP; + xpt_action(start_ccb); + break; + } case DA_STATE_PROBE_RC: { struct scsi_read_capacity_data *rcap; @@ -4255,6 +4286,52 @@ dadone(struct cam_periph *periph, union ccb *done_ccb) biodone(bp); return; } + case DA_CCB_PROBE_WP: + { + struct scsi_mode_header_6 *mode_hdr6; + struct scsi_mode_header_10 *mode_hdr10; + uint8_t dev_spec; + + if (softc->minimum_cmd_size > 6) { + mode_hdr10 = (struct scsi_mode_header_10 *)csio->data_ptr; + dev_spec = mode_hdr10->dev_spec; + } else { + mode_hdr6 = (struct scsi_mode_header_6 *)csio->data_ptr; + dev_spec = mode_hdr6->dev_spec; + } + if (cam_ccb_status(done_ccb) == CAM_REQ_CMP) { + if ((dev_spec & 0x80) != 0) + softc->disk->d_flags |= DISKFLAG_WRITE_PROTECT; + else + softc->disk->d_flags &= ~DISKFLAG_WRITE_PROTECT; + } else { + int error; + + error = daerror(done_ccb, CAM_RETRY_SELTO, + SF_RETRY_UA|SF_NO_PRINT); + if (error == ERESTART) + return; + else if (error != 0) { + if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { + /* Don't wedge this device's queue */ + cam_release_devq(done_ccb->ccb_h.path, + /*relsim_flags*/0, + /*reduction*/0, + /*timeout*/0, + /*getcount_only*/0); + } + } + } + + free(csio->data_ptr, M_SCSIDA); + xpt_release_ccb(done_ccb); + if ((softc->flags & DA_FLAG_CAN_RC16) != 0) + softc->state = DA_STATE_PROBE_RC16; + else + softc->state = DA_STATE_PROBE_RC; + xpt_schedule(periph, priority); + return; + } case DA_CCB_PROBE_RC: case DA_CCB_PROBE_RC16: { @@ -5340,11 +5417,7 @@ dareprobe(struct cam_periph *periph) KASSERT(status == CAM_REQ_CMP, ("dareprobe: cam_periph_acquire failed")); - if (softc->flags & DA_FLAG_CAN_RC16) - softc->state = DA_STATE_PROBE_RC16; - else - softc->state = DA_STATE_PROBE_RC; - + softc->state = DA_STATE_PROBE_WP; xpt_schedule(periph, CAM_PRIORITY_DEV); } Modified: head/sys/geom/geom_disk.c ============================================================================== --- head/sys/geom/geom_disk.c Mon Jan 15 10:59:04 2018 (r327995) +++ head/sys/geom/geom_disk.c Mon Jan 15 11:20:00 2018 (r327996) @@ -122,14 +122,18 @@ g_disk_access(struct g_provider *pp, int r, int w, int e += pp->ace; error = 0; if ((pp->acr + pp->acw + pp->ace) == 0 && (r + w + e) > 0) { - if (dp->d_open != NULL) { + /* + * It would be better to defer this decision to d_open if + * it was able to take flags. + */ + if (w > 0 && (dp->d_flags & DISKFLAG_WRITE_PROTECT) != 0) + error = EROFS; + if (error == 0 && dp->d_open != NULL) error = dp->d_open(dp); - if (bootverbose && error != 0) - printf("Opened disk %s -> %d\n", - pp->name, error); - if (error != 0) - return (error); - } + if (bootverbose && error != 0) + printf("Opened disk %s -> %d\n", pp->name, error); + if (error != 0) + return (error); pp->sectorsize = dp->d_sectorsize; if (dp->d_maxsize == 0) { printf("WARNING: Disk drive %s%d has no d_maxsize\n", @@ -1043,7 +1047,8 @@ g_disk_sysctl_flags(SYSCTL_HANDLER_ARGS) "\4CANFLUSHCACHE" "\5UNMAPPEDBIO" "\6DIRECTCOMPLETION" - "\10CANZONE"); + "\10CANZONE" + "\11WRITEPROTECT"); sbuf_finish(sb); error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1); Modified: head/sys/geom/geom_disk.h ============================================================================== --- head/sys/geom/geom_disk.h Mon Jan 15 10:59:04 2018 (r327995) +++ head/sys/geom/geom_disk.h Mon Jan 15 11:20:00 2018 (r327996) @@ -126,13 +126,14 @@ struct disk { LIST_HEAD(,disk_alias) d_aliases; }; -#define DISKFLAG_RESERVED 0x1 /* Was NEEDSGIANT */ -#define DISKFLAG_OPEN 0x2 -#define DISKFLAG_CANDELETE 0x4 -#define DISKFLAG_CANFLUSHCACHE 0x8 -#define DISKFLAG_UNMAPPED_BIO 0x10 -#define DISKFLAG_DIRECT_COMPLETION 0x20 -#define DISKFLAG_CANZONE 0x80 +#define DISKFLAG_RESERVED 0x0001 /* Was NEEDSGIANT */ +#define DISKFLAG_OPEN 0x0002 +#define DISKFLAG_CANDELETE 0x0004 +#define DISKFLAG_CANFLUSHCACHE 0x0008 +#define DISKFLAG_UNMAPPED_BIO 0x0010 +#define DISKFLAG_DIRECT_COMPLETION 0x0020 +#define DISKFLAG_CANZONE 0x0080 +#define DISKFLAG_WRITE_PROTECT 0x0100 struct disk *disk_alloc(void); void disk_create(struct disk *disk, int version); From owner-svn-src-head@freebsd.org Mon Jan 15 12:26:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13B5CE7A068; Mon, 15 Jan 2018 12:26:11 +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 9EF247231C; Mon, 15 Jan 2018 12:26:10 +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 w0FCPuQu002647 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 15 Jan 2018 14:26:00 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w0FCPuQu002647 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w0FCPupV002645; Mon, 15 Jan 2018 14:25:56 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 15 Jan 2018 14:25:56 +0200 From: Konstantin Belousov To: Andriy Gapon Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327996 - in head/sys: cam/scsi geom Message-ID: <20180115122556.GH1684@kib.kiev.ua> References: <201801151120.w0FBK0Jf006161@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201801151120.w0FBK0Jf006161@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-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 12:26:11 -0000 On Mon, Jan 15, 2018 at 11:20:00AM +0000, Andriy Gapon wrote: > Author: avg > Date: Mon Jan 15 11:20:00 2018 > New Revision: 327996 > URL: https://svnweb.freebsd.org/changeset/base/327996 > > Log: > geom_disk / scsi_da: deny opening write-protected disks for writing > > Ths change consists of two parts. > > geom_disk: deny opening a disk for writing if it's marked as > write-protected. A new disk(9) flag is added to mark write protected > disks. A possible alternative could be to add another parameter to d_open, > so that the open mode could be passed to it and the disk drivers could > make the decision internally, but the flag required less churn. If you need the mode, use d_fdopen cdevsw method. From owner-svn-src-head@freebsd.org Mon Jan 15 13:29:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FD7BE7D267; Mon, 15 Jan 2018 13:29:24 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lf0-f48.google.com (mail-lf0-f48.google.com [209.85.215.48]) (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 04E2874BA1; Mon, 15 Jan 2018 13:29:23 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lf0-f48.google.com with SMTP id m8so13366345lfc.6; Mon, 15 Jan 2018 05:29:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=5BeuOAHkCtCvqwvVErPtymSJsQJfVkhT82lixN4KV58=; b=fuLpwgqLQ3j3YKJ/Tj0vOCjz5uEOn0HEkFTVDuhi4r6ymZ7QRniM+HOADdjRVtCxcR K/vlDDLqqCYxhKEHexI6mYEOvQAwGsti9uWL/qzKXbBugRvKFABnDrPc4UNIrcGKMsdo p1Sq8ARX4nY4YGfJriVTTI6JDy4NLbw9uXInG1Ws5V5Nmopb/XIDOMJAv87Vg3Pf0nCM yTTGaroTGtjtetCKr5GZObIIOnQru/pfSKWUjlQWVh/37HUJDP6VL1+yKd9Qc+PQAaYZ gSBO1pbendVi0ZAPMDyXbkJb8hdMJhdaZHLQdS6qtuA+lfstthMVsoId7AUDMLr13QJ6 Aw+A== X-Gm-Message-State: AKwxytfM21/jzYIV5f5W9SyNGxNNyapusjDABH3g/LEGhmODC/1rzgFe 8BFWvwimRz252xI8Wp/TXK5q4RVr X-Google-Smtp-Source: ACJfBouNHgeXmKO11Hhp4GBpSPlLAktd2KktWXmAzfGkqstGbGYB30rWhQ1AxYRSwFQV+3Y7z+g1kw== X-Received: by 10.25.147.139 with SMTP id w11mr14365524lfk.58.1516021061380; Mon, 15 Jan 2018 04:57:41 -0800 (PST) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id r26sm4841646lfd.49.2018.01.15.04.57.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jan 2018 04:57:40 -0800 (PST) Subject: Re: svn commit: r327996 - in head/sys: cam/scsi geom To: Konstantin Belousov Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201801151120.w0FBK0Jf006161@repo.freebsd.org> <20180115122556.GH1684@kib.kiev.ua> From: Andriy Gapon Message-ID: <71909368-67b8-6cfc-6e84-3750ed75e607@FreeBSD.org> Date: Mon, 15 Jan 2018 14:57:39 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <20180115122556.GH1684@kib.kiev.ua> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 13:29:24 -0000 On 15/01/2018 14:25, Konstantin Belousov wrote: > On Mon, Jan 15, 2018 at 11:20:00AM +0000, Andriy Gapon wrote: >> Author: avg >> Date: Mon Jan 15 11:20:00 2018 >> New Revision: 327996 >> URL: https://svnweb.freebsd.org/changeset/base/327996 >> >> Log: >> geom_disk / scsi_da: deny opening write-protected disks for writing >> >> Ths change consists of two parts. >> >> geom_disk: deny opening a disk for writing if it's marked as >> write-protected. A new disk(9) flag is added to mark write protected >> disks. A possible alternative could be to add another parameter to d_open, >> so that the open mode could be passed to it and the disk drivers could >> make the decision internally, but the flag required less churn. > > If you need the mode, use d_fdopen cdevsw method. Well, this is a GEOM class that does not have a cdev interface. -- Andriy Gapon From owner-svn-src-head@freebsd.org Mon Jan 15 15:33:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 955BEEB4D93; Mon, 15 Jan 2018 15:33:11 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (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 7DA4D7C681; Mon, 15 Jan 2018 15:33:11 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from comporellon.tachypleus.net (cpe-75-82-218-62.socal.res.rr.com [75.82.218.62]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id w0FFX2ri013178 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Mon, 15 Jan 2018 07:33:02 -0800 Subject: Re: svn commit: r327950 - in head/sys/powerpc: aim include powerpc ps3 To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <010d0153-8931-a3c2-db21-dfcbaf848fc0@freebsd.org> <20180114083036.GX1684@kib.kiev.ua> <20180114170502.GB1684@kib.kiev.ua> <184ba3ee-a9f7-01ed-bb02-1bcba9acc041@freebsd.org> <20180114175211.GD1684@kib.kiev.ua> <20180115111812.GF1684@kib.kiev.ua> From: Nathan Whitehorn Message-ID: Date: Mon, 15 Jan 2018 07:33:01 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20180115111812.GF1684@kib.kiev.ua> Content-Type: text/plain; charset=koi8-r; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Sonic-CAuth: UmFuZG9tSVbZgFWzCsw8Gz2MIS6AXp9ZL+t2pUkf1bX1IuYlx8zGZcAHKRsLpiqkfUhKZ8kZSI3JyaWAEexzRcESL3crDaUtY3lXtsjKS5c= X-Sonic-ID: C;AFRpXwn65xGkh+BQ9eIpJw== M;zGnXXwn65xGkh+BQ9eIpJw== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 15:33:11 -0000 On 01/15/18 03:18, Konstantin Belousov wrote: > On Sun, Jan 14, 2018 at 03:46:38PM -0800, Nathan Whitehorn wrote: >> >> On 01/14/18 15:42, Nathan Whitehorn wrote: >>> >>> On 01/14/18 09:57, Nathan Whitehorn wrote: >>>> >>>> On 01/14/18 09:52, Konstantin Belousov wrote: >>>>> On Sun, Jan 14, 2018 at 09:30:53AM -0800, Nathan Whitehorn wrote: >>>>>> The immediate consequence of that is that no MI code that knows about >>>>>> direct maps can possibly take advantage of the direct map on this >>>>>> platform. Do we really want that to save some conditional logic that >>>>>> would get optimized out on amd64 and arm64 anyway? I really do not see >>>>>> the benefit here. >>>>> It is not clear what do you mean.š Are you saying that there is no >>>>> benefit >>>>> of providing the conditional logic, or that it is not benefit of >>>>> exclusing >>>>> powerpc ? >>>> Sorry, that was poorly stated. Let me try again: >>>> >>>> If we make a PPC_PHYS_TO_DMAP(), but there is an MI PHYS_TO_DMAP() >>>> API, consumer code in the MI parts of the kernel won't be able to >>>> benefit from the PPC direct map, which seems unfortunate. The cost >>>> from a code perspective of having an if (direct_map_available) seems >>>> low, since on systems where direct_map_available is defined to be 1, >>>> the compiler will optimize it to the same code as if gated by #ifdef. >>>> It might be more cumbersome to write the code, however. >>>> >>>>> I do not object against adding the conditional, but it should not be >>>>> too clumsy to use. >>>>> >>>> OK. Let me try to draft something in the next couple days and see how >>>> much of a pain it is in practice. >>>> -Nathan >>>> >>> How about the attached? It makes PHYS_TO_DMAP() return 0 if no mapping >>> exists. This is straightforward, does not introduce extra macros, and >>> can pretty easily replace SFBUF_OPTIONAL_DIRECT_MAP on the assumption >>> that PHYS_TO_DMAP() is cheap. I've modified the other MI-ish consumers >>> in the tree accordingly; compat/linuxkpi/common/src/linux_page.c >>> already does the right thing and needed no modifications. >>> -Nathan > I think that this is fine from the PoV of code complexity. > > We now require MI (but not amd64 and arm64 MD) code to check for > PHYS_TO_DMAP() return value, which is redundand for a*64. I am not sure > if this is good choice from the PoV of possible microoptimizations. > You promised something which is trivially detectable by compiler as > an excess code. Fair enough -- the logic was that a lot of code already checks for NULL pointers (the linux_page.c for instance required no changes to do the right thing). If we want it to be fully compiler-transparent, we could also add a flag, but that would add more code complexity. Do you have a preference? I would be happy to draft that too. > >> Sorry, this is the patch I meant to send. > Do you plan to convert sf buf code on powerpc ? Yes, once this is finalized. -Nathan > >> -Nathan >> Index: powerpc/include/vmparam.h >> =================================================================== >> --- powerpc/include/vmparam.h (revision 327952) >> +++ powerpc/include/vmparam.h (working copy) >> @@ -240,13 +240,12 @@ >> #define SFBUF_PHYS_DMAP(x) (x) >> >> /* >> - * We (usually) have a direct map of all physical memory. All >> - * uses of this macro must be gated by a check on hw_direct_map! >> - * The location of the direct map may not be 1:1 in future, so use >> - * of the macro is recommended; it may also grow an assert that hw_direct_map >> - * is set. >> + * We (usually) have a direct map of all physical memory, so provide >> + * a macro to use to get the kernel VA address for a given PA. Returns >> + * 0 if the direct map is unavailable. The location of the direct map >> + * may not be 1:1 in future, so use of the macro is recommended. >> */ >> -#define PHYS_TO_DMAP(x) x >> -#define DMAP_TO_PHYS(x) x >> +#define PHYS_TO_DMAP(x) (hw_direct_map ? (x) : 0) >> +#define DMAP_TO_PHYS(x) (hw_direct_map ? (x) : 0) >> >> #endif /* _MACHINE_VMPARAM_H_ */ >> Index: vm/vm_page.c >> =================================================================== >> --- vm/vm_page.c (revision 327952) >> +++ vm/vm_page.c (working copy) >> @@ -2937,7 +2937,8 @@ >> { >> >> #if defined(DIAGNOSTIC) && defined(PHYS_TO_DMAP) >> - if ((m->flags & PG_ZERO) != 0) { >> + if ((m->flags & PG_ZERO) != 0 && >> + PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)) != 0) { >> uint64_t *p; >> int i; >> p = (uint64_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)); >> Index: dev/efidev/efirt.c >> =================================================================== >> --- dev/efidev/efirt.c (revision 327952) >> +++ dev/efidev/efirt.c (working copy) >> @@ -115,6 +115,11 @@ >> return (0); >> } >> efi_systbl = (struct efi_systbl *)PHYS_TO_DMAP(efi_systbl_phys); >> + if (efi_systbl == NULL) { >> + if (bootverbose) >> + printf("EFI systbl not mapped in kernel VA\n"); >> + return (0); >> + } >> if (efi_systbl->st_hdr.th_sig != EFI_SYSTBL_SIG) { >> efi_systbl = NULL; >> if (bootverbose) From owner-svn-src-head@freebsd.org Mon Jan 15 16:08:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E0E2EB74BF; Mon, 15 Jan 2018 16:08:36 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3538D7E6EC; Mon, 15 Jan 2018 16:08:36 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 758C11355A; Mon, 15 Jan 2018 16:08:35 +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 w0FG8ZaS031957; Mon, 15 Jan 2018 16:08:35 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0FG8Zw2031955; Mon, 15 Jan 2018 16:08:35 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201801151608.w0FG8Zw2031955@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Mon, 15 Jan 2018 16:08:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328004 - 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: 328004 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 16:08:36 -0000 Author: nwhitehorn Date: Mon Jan 15 16:08:34 2018 New Revision: 328004 URL: https://svnweb.freebsd.org/changeset/base/328004 Log: Install the SLB miss trap-handling code in the SLB-based MMU driver set up, to which it is specific, rather than in the generic AIM startup code. This will be required to support the radix-table-based MMU introduced with POWER9. Modified: head/sys/powerpc/aim/aim_machdep.c head/sys/powerpc/aim/mmu_oea64.c Modified: head/sys/powerpc/aim/aim_machdep.c ============================================================================== --- head/sys/powerpc/aim/aim_machdep.c Mon Jan 15 14:56:47 2018 (r328003) +++ head/sys/powerpc/aim/aim_machdep.c Mon Jan 15 16:08:34 2018 (r328004) @@ -150,7 +150,6 @@ extern Elf_Addr _GLOBAL_OFFSET_TABLE_[]; extern void *rstcode, *rstcodeend; extern void *trapcode, *trapcodeend; extern void *generictrap, *generictrap64; -extern void *slbtrap, *slbtrapend; extern void *alitrap, *aliend; extern void *dsitrap, *dsiend; extern void *decrint, *decrsize; @@ -332,9 +331,6 @@ aim_cpu_init(vm_offset_t toc) /* Set TOC base so that the interrupt code can get at it */ *((void **)TRAP_GENTRAP) = &generictrap; *((register_t *)TRAP_TOCBASE) = toc; - - bcopy(&slbtrap, (void *)EXC_DSE,(size_t)&slbtrapend - (size_t)&slbtrap); - bcopy(&slbtrap, (void *)EXC_ISE,(size_t)&slbtrapend - (size_t)&slbtrap); #else /* Set branch address for trap code */ if (cpu_features & PPC_FEATURE_64) Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Mon Jan 15 14:56:47 2018 (r328003) +++ head/sys/powerpc/aim/mmu_oea64.c Mon Jan 15 16:08:34 2018 (r328004) @@ -140,6 +140,8 @@ struct ofw_map { extern unsigned char _etext[]; extern unsigned char _end[]; +extern void *slbtrap, *slbtrapend; + /* * Map of physical memory regions. */ @@ -712,6 +714,12 @@ moea64_early_bootstrap(mmu_t mmup, vm_offset_t kernels hw_direct_map = 1; else hw_direct_map = 0; + + /* Install trap handlers for SLBs */ + bcopy(&slbtrap, (void *)EXC_DSE,(size_t)&slbtrapend - (size_t)&slbtrap); + bcopy(&slbtrap, (void *)EXC_ISE,(size_t)&slbtrapend - (size_t)&slbtrap); + __syncicache((void *)EXC_DSE, 0x80); + __syncicache((void *)EXC_ISE, 0x80); #endif /* Get physical memory regions from firmware */ From owner-svn-src-head@freebsd.org Mon Jan 15 16:40:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 379A4EB934D; Mon, 15 Jan 2018 16:40:45 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 141187FDE2; Mon, 15 Jan 2018 16:40:45 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 424F013A94; Mon, 15 Jan 2018 16:40:44 +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 w0FGeiHM044712; Mon, 15 Jan 2018 16:40:44 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0FGein7044711; Mon, 15 Jan 2018 16:40:44 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201801151640.w0FGein7044711@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 15 Jan 2018 16:40:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328005 - head/sys/x86/isa X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/x86/isa X-SVN-Commit-Revision: 328005 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 16:40:45 -0000 Author: ian Date: Mon Jan 15 16:40:43 2018 New Revision: 328005 URL: https://svnweb.freebsd.org/changeset/base/328005 Log: Convert the x86 RTC driver to use new validated BCD<->timespec conversions. New common routines were added to kern/subr_clock.c for converting between calendrical time expressed in BCD and struct timespec. The new functions return EINVAL on error, as expected when the clock hardware does not provide valid time. PR: 224813 Differential Revision: https://reviews.freebsd.org/D13731 (no reviewers) Modified: head/sys/x86/isa/atrtc.c Modified: head/sys/x86/isa/atrtc.c ============================================================================== --- head/sys/x86/isa/atrtc.c Mon Jan 15 16:08:34 2018 (r328004) +++ head/sys/x86/isa/atrtc.c Mon Jan 15 16:40:43 2018 (r328005) @@ -109,17 +109,6 @@ writertc(int reg, u_char val) RTC_UNLOCK; } -static __inline int -readrtc(int port) -{ - int readval; - - readval = rtcin(port); - if (readval >= 0 && (readval & 0xf) < 0xa && (readval & 0xf0) < 0xa0) - return (bcd2bin(readval)); - return (0); -} - static void atrtc_start(void) { @@ -169,25 +158,24 @@ atrtc_restore(void) static void atrtc_set(struct timespec *ts) { - struct clocktime ct; + struct bcd_clocktime ct; - clock_ts_to_ct(ts, &ct); + clock_ts_to_bcd(ts, &ct, false); mtx_lock(&atrtc_time_lock); /* Disable RTC updates and interrupts. */ writertc(RTC_STATUSB, RTCSB_HALT | RTCSB_24HR); - writertc(RTC_SEC, bin2bcd(ct.sec)); /* Write back Seconds */ - writertc(RTC_MIN, bin2bcd(ct.min)); /* Write back Minutes */ - writertc(RTC_HRS, bin2bcd(ct.hour)); /* Write back Hours */ - - writertc(RTC_WDAY, ct.dow + 1); /* Write back Weekday */ - writertc(RTC_DAY, bin2bcd(ct.day)); /* Write back Day */ - writertc(RTC_MONTH, bin2bcd(ct.mon)); /* Write back Month */ - writertc(RTC_YEAR, bin2bcd(ct.year % 100)); /* Write back Year */ + writertc(RTC_SEC, ct.sec); /* Write back Seconds */ + writertc(RTC_MIN, ct.min); /* Write back Minutes */ + writertc(RTC_HRS, ct.hour); /* Write back Hours */ + writertc(RTC_WDAY, ct.dow + 1); /* Write back Weekday */ + writertc(RTC_DAY, ct.day); /* Write back Day */ + writertc(RTC_MONTH, ct.mon); /* Write back Month */ + writertc(RTC_YEAR, ct.year & 0xff); /* Write back Year */ #ifdef USE_RTC_CENTURY - writertc(RTC_CENTURY, bin2bcd(ct.year / 100)); /* ... and Century */ + writertc(RTC_CENTURY, ct.year >> 8); /* ... and Century */ #endif /* Re-enable RTC updates and interrupts. */ @@ -351,7 +339,7 @@ atrtc_settime(device_t dev __unused, struct timespec * static int atrtc_gettime(device_t dev, struct timespec *ts) { - struct clocktime ct; + struct bcd_clocktime ct; /* Look if we have a RTC present and the time is valid */ if (!(rtcin(RTC_STATUSD) & RTCSD_PWR)) { @@ -370,24 +358,21 @@ atrtc_gettime(device_t dev, struct timespec *ts) while (rtcin(RTC_STATUSA) & RTCSA_TUP) continue; critical_enter(); - ct.nsec = 0; - ct.sec = readrtc(RTC_SEC); - ct.min = readrtc(RTC_MIN); - ct.hour = readrtc(RTC_HRS); - ct.day = readrtc(RTC_DAY); - ct.dow = readrtc(RTC_WDAY) - 1; - ct.mon = readrtc(RTC_MONTH); - ct.year = readrtc(RTC_YEAR); + ct.sec = rtcin(RTC_SEC); + ct.min = rtcin(RTC_MIN); + ct.hour = rtcin(RTC_HRS); + ct.day = rtcin(RTC_DAY); + ct.mon = rtcin(RTC_MONTH); + ct.year = rtcin(RTC_YEAR); #ifdef USE_RTC_CENTURY - ct.year += readrtc(RTC_CENTURY) * 100; -#else - ct.year += (ct.year < 80 ? 2000 : 1900); + ct.year |= rtcin(RTC_CENTURY) << 8; #endif critical_exit(); mtx_unlock(&atrtc_time_lock); - /* Set dow = -1 because some clocks don't set it correctly. */ - ct.dow = -1; - return (clock_ct_to_ts(&ct, ts)); + /* dow is unused in timespec conversion and we have no nsec info. */ + ct.dow = 0; + ct.nsec = 0; + return (clock_bcd_to_ts(&ct, ts, false)); } static device_method_t atrtc_methods[] = { From owner-svn-src-head@freebsd.org Mon Jan 15 16:58:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1F37EBA825; Mon, 15 Jan 2018 16:58:08 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A5FD810DE; Mon, 15 Jan 2018 16:58:08 +0000 (UTC) (envelope-from andrew@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D120F13DE4; Mon, 15 Jan 2018 16:58:07 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0FGw7wJ053563; Mon, 15 Jan 2018 16:58:07 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0FGw7rB053562; Mon, 15 Jan 2018 16:58:07 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201801151658.w0FGw7rB053562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 15 Jan 2018 16:58:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328007 - head/stand/efi/boot1 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/stand/efi/boot1 X-SVN-Commit-Revision: 328007 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 16:58:08 -0000 Author: andrew Date: Mon Jan 15 16:58:07 2018 New Revision: 328007 URL: https://svnweb.freebsd.org/changeset/base/328007 Log: Fix booting on some arm64 systems after r327879 by fixing the call to utf8_to_ucs2 in boot1.efi. We need to initialise the ucs2 output string so it will allocate space, and use the return value to determine if the call was successful. Reviewed by: imp Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D13915 Modified: head/stand/efi/boot1/boot1.c Modified: head/stand/efi/boot1/boot1.c ============================================================================== --- head/stand/efi/boot1/boot1.c Mon Jan 15 16:51:04 2018 (r328006) +++ head/stand/efi/boot1/boot1.c Mon Jan 15 16:58:07 2018 (r328007) @@ -89,8 +89,8 @@ efi_getenv(EFI_GUID *g, const char *v, void *data, siz UINTN dl; EFI_STATUS rv; - utf8_to_ucs2(v, &uv, &ul); - if (uv == NULL) + uv = NULL; + if (utf8_to_ucs2(v, &uv, &ul) != 0) return (EFI_OUT_OF_RESOURCES); dl = *len; rv = RS->GetVariable(uv, g, &attr, &dl, data); From owner-svn-src-head@freebsd.org Mon Jan 15 17:06:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 631E4EBB68D; Mon, 15 Jan 2018 17:06:13 +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 092E981D11; Mon, 15 Jan 2018 17:06:12 +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 w0FH6343066472 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 15 Jan 2018 19:06:06 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w0FH6343066472 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w0FH63iT066471; Mon, 15 Jan 2018 19:06:03 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 15 Jan 2018 19:06:03 +0200 From: Konstantin Belousov To: Nathan Whitehorn Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327950 - in head/sys/powerpc: aim include powerpc ps3 Message-ID: <20180115170603.GJ1684@kib.kiev.ua> References: <20180114083036.GX1684@kib.kiev.ua> <20180114170502.GB1684@kib.kiev.ua> <184ba3ee-a9f7-01ed-bb02-1bcba9acc041@freebsd.org> <20180114175211.GD1684@kib.kiev.ua> <20180115111812.GF1684@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: 8bit 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-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 17:06:13 -0000 On Mon, Jan 15, 2018 at 07:33:01AM -0800, Nathan Whitehorn wrote: > > > On 01/15/18 03:18, Konstantin Belousov wrote: > > On Sun, Jan 14, 2018 at 03:46:38PM -0800, Nathan Whitehorn wrote: > >> > >> On 01/14/18 15:42, Nathan Whitehorn wrote: > >>> > >>> On 01/14/18 09:57, Nathan Whitehorn wrote: > >>>> > >>>> On 01/14/18 09:52, Konstantin Belousov wrote: > >>>>> On Sun, Jan 14, 2018 at 09:30:53AM -0800, Nathan Whitehorn wrote: > >>>>>> The immediate consequence of that is that no MI code that knows about > >>>>>> direct maps can possibly take advantage of the direct map on this > >>>>>> platform. Do we really want that to save some conditional logic that > >>>>>> would get optimized out on amd64 and arm64 anyway? I really do not see > >>>>>> the benefit here. > >>>>> It is not clear what do you mean.š Are you saying that there is no > >>>>> benefit > >>>>> of providing the conditional logic, or that it is not benefit of > >>>>> exclusing > >>>>> powerpc ? > >>>> Sorry, that was poorly stated. Let me try again: > >>>> > >>>> If we make a PPC_PHYS_TO_DMAP(), but there is an MI PHYS_TO_DMAP() > >>>> API, consumer code in the MI parts of the kernel won't be able to > >>>> benefit from the PPC direct map, which seems unfortunate. The cost > >>>> from a code perspective of having an if (direct_map_available) seems > >>>> low, since on systems where direct_map_available is defined to be 1, > >>>> the compiler will optimize it to the same code as if gated by #ifdef. > >>>> It might be more cumbersome to write the code, however. > >>>> > >>>>> I do not object against adding the conditional, but it should not be > >>>>> too clumsy to use. > >>>>> > >>>> OK. Let me try to draft something in the next couple days and see how > >>>> much of a pain it is in practice. > >>>> -Nathan > >>>> > >>> How about the attached? It makes PHYS_TO_DMAP() return 0 if no mapping > >>> exists. This is straightforward, does not introduce extra macros, and > >>> can pretty easily replace SFBUF_OPTIONAL_DIRECT_MAP on the assumption > >>> that PHYS_TO_DMAP() is cheap. I've modified the other MI-ish consumers > >>> in the tree accordingly; compat/linuxkpi/common/src/linux_page.c > >>> already does the right thing and needed no modifications. > >>> -Nathan > > I think that this is fine from the PoV of code complexity. > > > > We now require MI (but not amd64 and arm64 MD) code to check for > > PHYS_TO_DMAP() return value, which is redundand for a*64. I am not sure > > if this is good choice from the PoV of possible microoptimizations. > > You promised something which is trivially detectable by compiler as > > an excess code. > > Fair enough -- the logic was that a lot of code already checks for NULL > pointers (the linux_page.c for instance required no changes to do the > right thing). Most likely this is an accidental feature of the linux code and not the specific decision by the freebsd emulation of it. > If we want it to be fully compiler-transparent, we could > also add a flag, but that would add more code complexity. Do you have a > preference? I would be happy to draft that too. I think I am fine with amd64 doing #define PMAP_HAS_DMAP 1 in machine/param.h. I do not insist on the name. Then ppc could define its version as a reference to the variable. I thought that might be you can create less clumsy model of propagating this to the MI VM level. > > > > >> Sorry, this is the patch I meant to send. > > Do you plan to convert sf buf code on powerpc ? > > Yes, once this is finalized. > -Nathan > > > > >> -Nathan > >> Index: powerpc/include/vmparam.h > >> =================================================================== > >> --- powerpc/include/vmparam.h (revision 327952) > >> +++ powerpc/include/vmparam.h (working copy) > >> @@ -240,13 +240,12 @@ > >> #define SFBUF_PHYS_DMAP(x) (x) > >> > >> /* > >> - * We (usually) have a direct map of all physical memory. All > >> - * uses of this macro must be gated by a check on hw_direct_map! > >> - * The location of the direct map may not be 1:1 in future, so use > >> - * of the macro is recommended; it may also grow an assert that hw_direct_map > >> - * is set. > >> + * We (usually) have a direct map of all physical memory, so provide > >> + * a macro to use to get the kernel VA address for a given PA. Returns > >> + * 0 if the direct map is unavailable. The location of the direct map > >> + * may not be 1:1 in future, so use of the macro is recommended. > >> */ > >> -#define PHYS_TO_DMAP(x) x > >> -#define DMAP_TO_PHYS(x) x > >> +#define PHYS_TO_DMAP(x) (hw_direct_map ? (x) : 0) > >> +#define DMAP_TO_PHYS(x) (hw_direct_map ? (x) : 0) > >> > >> #endif /* _MACHINE_VMPARAM_H_ */ > >> Index: vm/vm_page.c > >> =================================================================== > >> --- vm/vm_page.c (revision 327952) > >> +++ vm/vm_page.c (working copy) > >> @@ -2937,7 +2937,8 @@ > >> { > >> > >> #if defined(DIAGNOSTIC) && defined(PHYS_TO_DMAP) > >> - if ((m->flags & PG_ZERO) != 0) { > >> + if ((m->flags & PG_ZERO) != 0 && > >> + PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)) != 0) { > >> uint64_t *p; > >> int i; > >> p = (uint64_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)); > >> Index: dev/efidev/efirt.c > >> =================================================================== > >> --- dev/efidev/efirt.c (revision 327952) > >> +++ dev/efidev/efirt.c (working copy) > >> @@ -115,6 +115,11 @@ > >> return (0); > >> } > >> efi_systbl = (struct efi_systbl *)PHYS_TO_DMAP(efi_systbl_phys); > >> + if (efi_systbl == NULL) { > >> + if (bootverbose) > >> + printf("EFI systbl not mapped in kernel VA\n"); > >> + return (0); > >> + } > >> if (efi_systbl->st_hdr.th_sig != EFI_SYSTBL_SIG) { > >> efi_systbl = NULL; > >> if (bootverbose) From owner-svn-src-head@freebsd.org Mon Jan 15 17:27:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FEADEBCCF3; Mon, 15 Jan 2018 17:27:44 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7A7CF83C24; Mon, 15 Jan 2018 17:27: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C3417142FB; Mon, 15 Jan 2018 17:27: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 w0FHRhRH068524; Mon, 15 Jan 2018 17:27:43 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0FHRhpU068523; Mon, 15 Jan 2018 17:27:43 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201801151727.w0FHRhpU068523@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Mon, 15 Jan 2018 17:27:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328008 - head/usr.bin/units X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/units X-SVN-Commit-Revision: 328008 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 17:27:44 -0000 Author: eadler Date: Mon Jan 15 17:27:43 2018 New Revision: 328008 URL: https://svnweb.freebsd.org/changeset/base/328008 Log: units(1): units(1) free savescr in error condition too CID: 978392 Reviewed by: des MFC After: 1 week Modified: head/usr.bin/units/units.c Modified: head/usr.bin/units/units.c ============================================================================== --- head/usr.bin/units/units.c Mon Jan 15 16:58:07 2018 (r328007) +++ head/usr.bin/units/units.c Mon Jan 15 17:27:43 2018 (r328008) @@ -354,6 +354,7 @@ addunit(struct unittype * theunit, const char *toadd, num = atof(item); if (!num) { zeroerror(); + free(savescr); return 1; } if (doingtop ^ flip) { @@ -366,6 +367,7 @@ addunit(struct unittype * theunit, const char *toadd, num = atof(divider + 1); if (!num) { zeroerror(); + free(savescr); return 1; } if (doingtop ^ flip) { @@ -380,6 +382,7 @@ addunit(struct unittype * theunit, const char *toadd, num = atof(item); if (!num) { zeroerror(); + free(savescr); return 1; } if (doingtop ^ flip) { @@ -401,9 +404,12 @@ addunit(struct unittype * theunit, const char *toadd, repeat = item[strlen(item) - 1] - '0'; item[strlen(item) - 1] = 0; } - for (; repeat; repeat--) - if (addsubunit(doingtop ^ flip ? theunit->numerator : theunit->denominator, item)) + for (; repeat; repeat--) { + if (addsubunit(doingtop ^ flip ? theunit->numerator : theunit->denominator, item)) { + free(savescr); return 1; + } + } } item = strtok(NULL, " *\t/\n"); } From owner-svn-src-head@freebsd.org Mon Jan 15 17:32:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE650EBD28F; Mon, 15 Jan 2018 17:32:58 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (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 9563837D; Mon, 15 Jan 2018 17:32:58 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from comporellon.tachypleus.net (cpe-75-82-218-62.socal.res.rr.com [75.82.218.62]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id w0FHWuQx021754 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Mon, 15 Jan 2018 09:32:56 -0800 Subject: Re: svn commit: r327950 - in head/sys/powerpc: aim include powerpc ps3 To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <20180114083036.GX1684@kib.kiev.ua> <20180114170502.GB1684@kib.kiev.ua> <184ba3ee-a9f7-01ed-bb02-1bcba9acc041@freebsd.org> <20180114175211.GD1684@kib.kiev.ua> <20180115111812.GF1684@kib.kiev.ua> <20180115170603.GJ1684@kib.kiev.ua> From: Nathan Whitehorn Message-ID: <9e5554d7-6a0c-5910-8cb6-74f98259536f@freebsd.org> Date: Mon, 15 Jan 2018 09:32:56 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20180115170603.GJ1684@kib.kiev.ua> Content-Type: text/plain; charset=koi8-r; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Sonic-CAuth: UmFuZG9tSVZqoPTYPI1x5scS3jiKP8J4+/VDGI3ryvaQoUCBwYbwKLWNWMPrmEQcQUMP4dvpJYQJ6SZAjMW/MPDlJHk5t8MQfLJwW5DwgCg= X-Sonic-ID: C;bup6Hxr65xGEF+BQ9eIpJw== M;FtK9Hxr65xGEF+BQ9eIpJw== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 17:32:58 -0000 On 01/15/18 09:06, Konstantin Belousov wrote: > On Mon, Jan 15, 2018 at 07:33:01AM -0800, Nathan Whitehorn wrote: >> >> On 01/15/18 03:18, Konstantin Belousov wrote: >>> On Sun, Jan 14, 2018 at 03:46:38PM -0800, Nathan Whitehorn wrote: >>>> On 01/14/18 15:42, Nathan Whitehorn wrote: >>>>> On 01/14/18 09:57, Nathan Whitehorn wrote: >>>>>> On 01/14/18 09:52, Konstantin Belousov wrote: >>>>>>> On Sun, Jan 14, 2018 at 09:30:53AM -0800, Nathan Whitehorn wrote: >>>>>>>> The immediate consequence of that is that no MI code that knows about >>>>>>>> direct maps can possibly take advantage of the direct map on this >>>>>>>> platform. Do we really want that to save some conditional logic that >>>>>>>> would get optimized out on amd64 and arm64 anyway? I really do not see >>>>>>>> the benefit here. >>>>>>> It is not clear what do you mean.š Are you saying that there is no >>>>>>> benefit >>>>>>> of providing the conditional logic, or that it is not benefit of >>>>>>> exclusing >>>>>>> powerpc ? >>>>>> Sorry, that was poorly stated. Let me try again: >>>>>> >>>>>> If we make a PPC_PHYS_TO_DMAP(), but there is an MI PHYS_TO_DMAP() >>>>>> API, consumer code in the MI parts of the kernel won't be able to >>>>>> benefit from the PPC direct map, which seems unfortunate. The cost >>>>>> from a code perspective of having an if (direct_map_available) seems >>>>>> low, since on systems where direct_map_available is defined to be 1, >>>>>> the compiler will optimize it to the same code as if gated by #ifdef. >>>>>> It might be more cumbersome to write the code, however. >>>>>> >>>>>>> I do not object against adding the conditional, but it should not be >>>>>>> too clumsy to use. >>>>>>> >>>>>> OK. Let me try to draft something in the next couple days and see how >>>>>> much of a pain it is in practice. >>>>>> -Nathan >>>>>> >>>>> How about the attached? It makes PHYS_TO_DMAP() return 0 if no mapping >>>>> exists. This is straightforward, does not introduce extra macros, and >>>>> can pretty easily replace SFBUF_OPTIONAL_DIRECT_MAP on the assumption >>>>> that PHYS_TO_DMAP() is cheap. I've modified the other MI-ish consumers >>>>> in the tree accordingly; compat/linuxkpi/common/src/linux_page.c >>>>> already does the right thing and needed no modifications. >>>>> -Nathan >>> I think that this is fine from the PoV of code complexity. >>> >>> We now require MI (but not amd64 and arm64 MD) code to check for >>> PHYS_TO_DMAP() return value, which is redundand for a*64. I am not sure >>> if this is good choice from the PoV of possible microoptimizations. >>> You promised something which is trivially detectable by compiler as >>> an excess code. >> Fair enough -- the logic was that a lot of code already checks for NULL >> pointers (the linux_page.c for instance required no changes to do the >> right thing). > Most likely this is an accidental feature of the linux code and not the > specific decision by the freebsd emulation of it. > >> If we want it to be fully compiler-transparent, we could >> also add a flag, but that would add more code complexity. Do you have a >> preference? I would be happy to draft that too. > I think I am fine with amd64 doing > #define PMAP_HAS_DMAP 1 > in machine/param.h. I do not insist on the name. > > Then ppc could define its version as a reference to the variable. I thought > that might be you can create less clumsy model of propagating this to the > MI VM level. That seems fine to me. I don't think a less-clumsy way that does not involve extra indirection is possible. The PHYS_TO_DMAP() returning NULL is about the best thing I can come up with from a clumsiness standpoint since plenty of code checks for null pointers already, but doesn't cleanly handle the rarer case where you want to test for the existence of direct maps in general without testing some potemkin address. My one reservation about PMAP_HAS_DMAP or the like as a selector is that it does not encode the full shape of the problem: one could imagine having a direct map that only covers a limited range of RAM (I am not sure whether the existence of dmaplimit on amd64 implies this can happen with non-device memory in real life), for example. These cases are currently covered by an assert() in PHYS_TO_DMAP(), whereas having PHYS_TO_DMAP() return NULL allows a more flexible signalling and the potential for the calling code to do something reasonable to handle the error. A single global flag can't convey information at this kind of granularity. Is this a reasonable concern? Or am I overthinking things? -Nathan From owner-svn-src-head@freebsd.org Mon Jan 15 17:53:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BFA5EBE689; Mon, 15 Jan 2018 17:53:43 +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 E0FDC1E24; Mon, 15 Jan 2018 17:53:42 +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 w0FHrZcJ076698 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 15 Jan 2018 19:53:38 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w0FHrZcJ076698 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w0FHrZ4a076697; Mon, 15 Jan 2018 19:53:35 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 15 Jan 2018 19:53:35 +0200 From: Konstantin Belousov To: Nathan Whitehorn Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327950 - in head/sys/powerpc: aim include powerpc ps3 Message-ID: <20180115175335.GK1684@kib.kiev.ua> References: <20180114170502.GB1684@kib.kiev.ua> <184ba3ee-a9f7-01ed-bb02-1bcba9acc041@freebsd.org> <20180114175211.GD1684@kib.kiev.ua> <20180115111812.GF1684@kib.kiev.ua> <20180115170603.GJ1684@kib.kiev.ua> <9e5554d7-6a0c-5910-8cb6-74f98259536f@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9e5554d7-6a0c-5910-8cb6-74f98259536f@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-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 17:53:43 -0000 On Mon, Jan 15, 2018 at 09:32:56AM -0800, Nathan Whitehorn wrote: > That seems fine to me. I don't think a less-clumsy way that does not > involve extra indirection is possible. The PHYS_TO_DMAP() returning NULL > is about the best thing I can come up with from a clumsiness standpoint > since plenty of code checks for null pointers already, but doesn't > cleanly handle the rarer case where you want to test for the existence > of direct maps in general without testing some potemkin address. > > My one reservation about PMAP_HAS_DMAP or the like as a selector is that > it does not encode the full shape of the problem: one could imagine > having a direct map that only covers a limited range of RAM (I am not > sure whether the existence of dmaplimit on amd64 implies this can happen > with non-device memory in real life), for example. These cases are > currently covered by an assert() in PHYS_TO_DMAP(), whereas having > PHYS_TO_DMAP() return NULL allows a more flexible signalling and the > potential for the calling code to do something reasonable to handle the > error. A single global flag can't convey information at this kind of > granularity. Is this a reasonable concern? Or am I overthinking things? IMO it is overreaction. amd64 assumes that all normal memory is covered by DMAP. It must never fail. See, for instance, the implementation of the sf bufs for it. If device memory not covered by DMAP can exists, it is the driver problem. For instance, for NVDIMMs I wrote specific mapping code which establishes kernel mapping for it, when not covered by EFI memory map and correspondingly not included into DMAP. From owner-svn-src-head@freebsd.org Mon Jan 15 18:08:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5FFEE642C6; Mon, 15 Jan 2018 18:08:02 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B04E929BC; Mon, 15 Jan 2018 18:08:02 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E2406149E1; Mon, 15 Jan 2018 18:08:01 +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 w0FI81fc085687; Mon, 15 Jan 2018 18:08:01 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0FI81Lt085686; Mon, 15 Jan 2018 18:08:01 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201801151808.w0FI81Lt085686@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 15 Jan 2018 18:08:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328009 - head/stand/fdt X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/fdt X-SVN-Commit-Revision: 328009 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 18:08:02 -0000 Author: kevans Date: Mon Jan 15 18:08:01 2018 New Revision: 328009 URL: https://svnweb.freebsd.org/changeset/base/328009 Log: stand/fdt: Don't leak next_fdtp if we fail to open overlay MFC after: 1 week X-MFC-With: r327991 Modified: head/stand/fdt/fdt_loader_cmd.c Modified: head/stand/fdt/fdt_loader_cmd.c ============================================================================== --- head/stand/fdt/fdt_loader_cmd.c Mon Jan 15 17:27:43 2018 (r328008) +++ head/stand/fdt/fdt_loader_cmd.c Mon Jan 15 18:08:01 2018 (r328009) @@ -383,6 +383,7 @@ fdt_apply_overlays() } rv = fdt_open_into(current_fdtp, next_fdtp, next_fdtp_size); if (rv != 0) { + free(next_fdtp); printf("failed to open base dtb into overlay base\n"); continue; } From owner-svn-src-head@freebsd.org Mon Jan 15 18:20:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D62EE65834; Mon, 15 Jan 2018 18:20:16 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 750E43B03; Mon, 15 Jan 2018 18:20: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A67AE14BDC; Mon, 15 Jan 2018 18:20:15 +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 w0FIKFk1090255; Mon, 15 Jan 2018 18:20:15 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0FIKFCu090254; Mon, 15 Jan 2018 18:20:15 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201801151820.w0FIKFCu090254@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 15 Jan 2018 18:20:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328010 - head/contrib/llvm/lib/Transforms/Vectorize X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/contrib/llvm/lib/Transforms/Vectorize X-SVN-Commit-Revision: 328010 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 18:20:16 -0000 Author: dim Date: Mon Jan 15 18:20:15 2018 New Revision: 328010 URL: https://svnweb.freebsd.org/changeset/base/328010 Log: Pull in r322473 from upstream llvm trunk (by Andrei Elovikov): [LV] Don't call recordVectorLoopValueForInductionCast for newly-created IV from a trunc. Summary: This method is supposed to be called for IVs that have casts in their use-def chains that are completely ignored after vectorization under PSE. However, for truncates of such IVs the same InductionDescriptor is used during creation/widening of both original IV based on PHINode and new IV based on TruncInst. This leads to unintended second call to recordVectorLoopValueForInductionCast with a VectorLoopVal set to the newly created IV for a trunc and causes an assert due to attempt to store new information for already existing entry in the map. This is wrong and should not be done. Fixes PR35773. Reviewers: dorit, Ayal, mssimpso Reviewed By: dorit Subscribers: RKSimon, dim, dcaballe, hsaito, llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D41913 This should fix "Vector value already set for part" assertions when building the net/iodine and sysutils/daa2iso ports. Reported by: jbeich PR: 224867,224868 Modified: head/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp Modified: head/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp ============================================================================== --- head/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp Mon Jan 15 18:08:01 2018 (r328009) +++ head/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp Mon Jan 15 18:20:15 2018 (r328010) @@ -2630,9 +2630,12 @@ void InnerLoopVectorizer::createVectorIntOrFpInduction Instruction *LastInduction = VecInd; for (unsigned Part = 0; Part < UF; ++Part) { VectorLoopValueMap.setVectorValue(EntryVal, Part, LastInduction); - recordVectorLoopValueForInductionCast(II, LastInduction, Part); + if (isa(EntryVal)) addMetadata(LastInduction, EntryVal); + else + recordVectorLoopValueForInductionCast(II, LastInduction, Part); + LastInduction = cast(addFastMathFlag( Builder.CreateBinOp(AddOp, LastInduction, SplatVF, "step.add"))); } @@ -2754,15 +2757,17 @@ void InnerLoopVectorizer::widenIntOrFpInduction(PHINod // If we haven't yet vectorized the induction variable, splat the scalar // induction variable, and build the necessary step vectors. + // TODO: Don't do it unless the vectorized IV is really required. if (!VectorizedIV) { Value *Broadcasted = getBroadcastInstrs(ScalarIV); for (unsigned Part = 0; Part < UF; ++Part) { Value *EntryPart = getStepVector(Broadcasted, VF * Part, Step, ID.getInductionOpcode()); VectorLoopValueMap.setVectorValue(EntryVal, Part, EntryPart); - recordVectorLoopValueForInductionCast(ID, EntryPart, Part); if (Trunc) addMetadata(EntryPart, Trunc); + else + recordVectorLoopValueForInductionCast(ID, EntryPart, Part); } } From owner-svn-src-head@freebsd.org Mon Jan 15 18:37:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67C64E6CDF5; Mon, 15 Jan 2018 18:37:04 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 42E2B63E20; Mon, 15 Jan 2018 18:37:04 +0000 (UTC) (envelope-from tychon@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8ECFB14F24; Mon, 15 Jan 2018 18:37:03 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0FIb3mJ098462; Mon, 15 Jan 2018 18:37:03 GMT (envelope-from tychon@FreeBSD.org) Received: (from tychon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0FIb3R7098459; Mon, 15 Jan 2018 18:37:03 GMT (envelope-from tychon@FreeBSD.org) Message-Id: <201801151837.w0FIb3R7098459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tychon set sender to tychon@FreeBSD.org using -f From: Tycho Nightingale Date: Mon, 15 Jan 2018 18:37:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328011 - in head/sys/amd64/vmm: amd intel X-SVN-Group: head X-SVN-Commit-Author: tychon X-SVN-Commit-Paths: in head/sys/amd64/vmm: amd intel X-SVN-Commit-Revision: 328011 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 18:37:04 -0000 Author: tychon Date: Mon Jan 15 18:37:03 2018 New Revision: 328011 URL: https://svnweb.freebsd.org/changeset/base/328011 Log: Provide some mitigation against CVE-2017-5715 by clearing registers upon returning from the guest which aren't immediately clobbered by the host. This eradicates any remaining guest contents limiting their usefulness in an exploit gadget. This was inspired by this linux commit: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5b6c02f38315b720c593c6079364855d276886aa Reviewed by: grehan, rgrimes Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D13573 Modified: head/sys/amd64/vmm/amd/svm_support.S head/sys/amd64/vmm/intel/vmx_support.S Modified: head/sys/amd64/vmm/amd/svm_support.S ============================================================================== --- head/sys/amd64/vmm/amd/svm_support.S Mon Jan 15 18:20:15 2018 (r328010) +++ head/sys/amd64/vmm/amd/svm_support.S Mon Jan 15 18:37:03 2018 (r328011) @@ -124,8 +124,20 @@ ENTRY(svm_launch) pop %rdx mov %edx, %eax shr $32, %rdx - mov $MSR_GSBASE, %ecx + mov $MSR_GSBASE, %rcx wrmsr + + /* + * Clobber the remaining registers with guest contents so they + * can't be misused. + */ + xor %rbp, %rbp + xor %rdi, %rdi + xor %rsi, %rsi + xor %r8, %r8 + xor %r9, %r9 + xor %r10, %r10 + xor %r11, %r11 VLEAVE ret Modified: head/sys/amd64/vmm/intel/vmx_support.S ============================================================================== --- head/sys/amd64/vmm/intel/vmx_support.S Mon Jan 15 18:20:15 2018 (r328010) +++ head/sys/amd64/vmm/intel/vmx_support.S Mon Jan 15 18:37:03 2018 (r328011) @@ -72,6 +72,20 @@ movq VMXCTX_GUEST_RDI(%rdi),%rdi; /* restore rdi the last */ /* + * Clobber the remaining registers with guest contents so they can't + * be misused. + */ +#define VMX_GUEST_CLOBBER \ + xor %rax, %rax; \ + xor %rcx, %rcx; \ + xor %rdx, %rdx; \ + xor %rsi, %rsi; \ + xor %r8, %r8; \ + xor %r9, %r9; \ + xor %r10, %r10; \ + xor %r11, %r11; + +/* * Save and restore the host context. * * Assumes that %rdi holds a pointer to the 'vmxctx'. @@ -231,6 +245,8 @@ vmx_exit_guest: LK btrl %r10d, PM_ACTIVE(%r11) VMX_HOST_RESTORE + + VMX_GUEST_CLOBBER /* * This will return to the caller of 'vmx_enter_guest()' with a return From owner-svn-src-head@freebsd.org Mon Jan 15 18:38:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C03C2E6E04F; Mon, 15 Jan 2018 18:38:47 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (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 9CE75680C5; Mon, 15 Jan 2018 18:38:47 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (astound-66-234-199-215.ca.astound.net [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 1BC3A10A7DB; Mon, 15 Jan 2018 13:38:40 -0500 (EST) From: John Baldwin To: Antoine Brodin Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327841 - head Date: Mon, 15 Jan 2018 10:37:58 -0800 Message-ID: <3014002.O2kdJrrLOE@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: References: <201801111924.w0BJOicg089230@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 15 Jan 2018 13:38:40 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 18:38:47 -0000 On Monday, January 15, 2018 11:11:58 AM Antoine Brodin wrote: > On Thu, Jan 11, 2018 at 8:24 PM, John Baldwin wrote: > > Author: jhb > > Date: Thu Jan 11 19:24:44 2018 > > New Revision: 327841 > > URL: https://svnweb.freebsd.org/changeset/base/327841 > > > > Log: > > Allow MIPS lib32 to build with clang. > > > > Don't try to set -march as clang doesn't permit use of the O32 ABI > > with newer CPU microarchitectures like 'mips3'. In addition, clang > > doesn't permit the O32 ABI with the default N64 target, so use an > > explicit O32 -target for clang. > > > > Sponsored by: DARPA / AFRL > > > > Modified: > > head/Makefile.libcompat > > > Hi, > > This seems to break buildworld for mips/mips64 > > > --- includes_subdir_include/rpc --- > RPCGEN_CPP=cpp\ -DCOMPAT_32BIT\ -target\ mips-unknown-freebsd12.0\ > -mabi=32\ \ -L/usr/obj/usr/local/poudriere/jails/head-mips64/usr/src/mips.mips64/obj-lib32/tmp/usr/lib32\ > \ --sysroot=/usr/obj/usr/local/poudriere/jails/head-mips64/usr/src/mips.mips64/obj-lib32/tmp\ > \ -B/usr/obj/usr/local/poudriere/jails/head-mips64/usr/src/mips.mips64/tmp/usr/bin\ > -B/usr/obj/usr/local/poudriere/jails/head-mips64/usr/src/mips.mips64/obj-lib32/tmp/usr/lib32\ > -isystem\ /usr/obj/usr/local/poudriere/jails/head-mips64/usr/src/mips.mips64/obj-lib32/tmp/usr/include > rpcgen -C -h -DWANT_NFS3 > /usr/local/poudriere/jails/head-mips64/usr/src/include/rpc/rpcb_prot.x > -o rpcb_prot.h > cpp: mips-unknown-freebsd12.0: No such file or directory > cpp: warning: '-x c' after last input file has no effect > cpp: unrecognized option '-target' > cpp: No input files specified > *** [rpcb_prot.h] Error code 1 Yes, Bryan is working on a fix. The issue has to do with how to properly detect which compiler is used. If Bryan isn't able to fix it soon I'll either revert or add a clunky workaround. (If you check for GCC first rather than clang first which is what Makefile.inc1 does, then you happen to avoid the bug with X_COMPILER_TYPE being set) -- John Baldwin From owner-svn-src-head@freebsd.org Mon Jan 15 19:25:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9950E710EB; Mon, 15 Jan 2018 19:25:13 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 759436A1CB; Mon, 15 Jan 2018 19:25:13 +0000 (UTC) (envelope-from dab@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7F4B215759; Mon, 15 Jan 2018 19:25:12 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0FJPCJs019437; Mon, 15 Jan 2018 19:25:12 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0FJPCKA019434; Mon, 15 Jan 2018 19:25:12 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201801151925.w0FJPCKA019434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Mon, 15 Jan 2018 19:25:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328013 - head/sbin/fsck_ffs X-SVN-Group: head X-SVN-Commit-Author: dab X-SVN-Commit-Paths: head/sbin/fsck_ffs X-SVN-Commit-Revision: 328013 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 19:25:13 -0000 Author: dab Date: Mon Jan 15 19:25:11 2018 New Revision: 328013 URL: https://svnweb.freebsd.org/changeset/base/328013 Log: Exit fsck_ffs with non-zero status when file system is not repaired. When the fsck_ffs program cannot fully repair a file system, it will output the message PLEASE RERUN FSCK. However, it does not exit with a non-zero status in this case (contradicting the man page claim that it "exits with 0 on success, and >0 if an error occurs." The fsck rc-script (when running "fsck -y") tests the status from fsck (which passes along the exit status from fsck_ffs) and issues a "stop_boot" if the status fails. However, this is not effective since fsck_ffs can return zero even on (some) errors. Effectively, it is left to a later step in the boot process when the file systems are mounted to detect the still-unclean file system and stop the boot. This change modifies fsck_ffs so that when it cannot fully repair the file system and issues the PLEASE RERUN FSCK message it also exits with a non-zero status. While here, the fsck_ffs man page has also been updated to document the failing exit status codes used by fsck_ffs. Previously, only exit status 7 was documented. Some of these exit statuses are tested for in the fsck rc-script, so they are clearly depended upon and deserve documentation. Reviewed by: mckusick, vangyzen, jilles (manpages) MFC after: 1 week Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D13862 Modified: head/sbin/fsck_ffs/fsck.h head/sbin/fsck_ffs/fsck_ffs.8 head/sbin/fsck_ffs/main.c Modified: head/sbin/fsck_ffs/fsck.h ============================================================================== --- head/sbin/fsck_ffs/fsck.h Mon Jan 15 19:02:15 2018 (r328012) +++ head/sbin/fsck_ffs/fsck.h Mon Jan 15 19:25:11 2018 (r328013) @@ -364,6 +364,7 @@ extern struct ufs2_dinode ufs2_zino; #define FOUND 0x10 #define EEXIT 8 /* Standard error exit. */ +#define ERERUN 16 /* fsck needs to be re-run. */ #define ERESTART -1 int flushentry(void); Modified: head/sbin/fsck_ffs/fsck_ffs.8 ============================================================================== --- head/sbin/fsck_ffs/fsck_ffs.8 Mon Jan 15 19:02:15 2018 (r328012) +++ head/sbin/fsck_ffs/fsck_ffs.8 Mon Jan 15 19:25:11 2018 (r328013) @@ -29,7 +29,7 @@ .\" @(#)fsck.8 8.4 (Berkeley) 5/9/95 .\" $FreeBSD$ .\" -.Dd February 14, 2017 +.Dd January 13, 2018 .Dt FSCK_FFS 8 .Os .Sh NAME @@ -376,11 +376,43 @@ contains default list of file systems to check. .Sh EXIT STATUS .Ex -std .Pp -If the option +Specific non-zero exit status values used are: +.Bl -tag -width indent +.It 1 +Usage error (missing or invalid command arguments). +.It 2 +The +.Fl p +option was used and a +.Dv SIGQUIT +was received, indicating that the system should be returned to single +user mode after the file system check. +.It 3 +The file system superblock cannot be read. +This could indicate that the file system device does not exist or is not yet +ready. +.It 4 +A mounted file system was modified; the system should be rebooted. +.It 5 +The +.Fl B +option was used and soft updates are not enabled on the file system. +.It 6 +The +.Fl B +option was used and the kernel lacks needed support. +.It 7 +The .Fl F -is used, +option was used and the file system is clean. +.It 8 +General error exit. +.It 16 +The file system could not be completely repaired. +The file system may be able to be repaired by running .Nm -exits 7 if the file system is clean. +on the file system again. +.El .Sh DIAGNOSTICS The diagnostics produced by .Nm Modified: head/sbin/fsck_ffs/main.c ============================================================================== --- head/sbin/fsck_ffs/main.c Mon Jan 15 19:02:15 2018 (r328012) +++ head/sbin/fsck_ffs/main.c Mon Jan 15 19:25:11 2018 (r328013) @@ -82,6 +82,7 @@ main(int argc, char *argv[]) int ch; struct rlimit rlimit; struct itimerval itimerval; + int fsret; int ret = 0; sync(); @@ -196,8 +197,9 @@ main(int argc, char *argv[]) (void)setrlimit(RLIMIT_DATA, &rlimit); } while (argc > 0) { - if (checkfilesys(*argv) == ERESTART) + if ((fsret = checkfilesys(*argv)) == ERESTART) continue; + ret |= fsret; argc--; argv++; } @@ -585,7 +587,7 @@ checkfilesys(char *filesys) sync(); return (4); } - return (0); + return (rerun ? ERERUN : 0); } static int From owner-svn-src-head@freebsd.org Mon Jan 15 20:37:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2A9CE752B9; Mon, 15 Jan 2018 20:37:12 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7BF266C96B; Mon, 15 Jan 2018 20:37: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B53AF162B6; Mon, 15 Jan 2018 20:37:11 +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 w0FKbB8K048414; Mon, 15 Jan 2018 20:37:11 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0FKbBq2048410; Mon, 15 Jan 2018 20:37:11 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201801152037.w0FKbBq2048410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 15 Jan 2018 20:37:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328014 - head/lib/libsysdecode X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/lib/libsysdecode X-SVN-Commit-Revision: 328014 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 20:37:12 -0000 Author: tuexen Date: Mon Jan 15 20:37:11 2018 New Revision: 328014 URL: https://svnweb.freebsd.org/changeset/base/328014 Log: Add support for decoding the nxt_flags, rcv_flags, and snd_flags of SCTP level cmsgs. Modified: head/lib/libsysdecode/Makefile head/lib/libsysdecode/flags.c head/lib/libsysdecode/sysdecode.h head/lib/libsysdecode/sysdecode_mask.3 Modified: head/lib/libsysdecode/Makefile ============================================================================== --- head/lib/libsysdecode/Makefile Mon Jan 15 19:25:11 2018 (r328013) +++ head/lib/libsysdecode/Makefile Mon Jan 15 20:37:11 2018 (r328014) @@ -96,6 +96,9 @@ MLINKS+=sysdecode_mask.3 sysdecode_accessmode.3 \ sysdecode_mask.3 sysdecode_semget_flags.3 \ sysdecode_mask.3 sysdecode_sendfile_flags.3 \ sysdecode_mask.3 sysdecode_shmat_flags.3 \ + sysdecode_mask.3 sysdecode_sctp_nxt_flags.3 \ + sysdecode_mask.3 sysdecode_sctp_rcv_flags.3 \ + sysdecode_mask.3 sysdecode_sctp_snd_flags.3 \ sysdecode_mask.3 sysdecode_socket_type.3 \ sysdecode_mask.3 sysdecode_thr_create_flags.3 \ sysdecode_mask.3 sysdecode_umtx_cvwait_flags.3 \ Modified: head/lib/libsysdecode/flags.c ============================================================================== --- head/lib/libsysdecode/flags.c Mon Jan 15 19:25:11 2018 (r328013) +++ head/lib/libsysdecode/flags.c Mon Jan 15 20:37:11 2018 (r328014) @@ -1206,6 +1206,40 @@ sysdecode_sctp_pr_policy(int policy) return (lookup_value(sctpprpolicy, policy)); } +static struct name_table sctpsndflags[] = { + X(SCTP_EOF) X(SCTP_ABORT) X(SCTP_UNORDERED) X(SCTP_ADDR_OVER) + X(SCTP_SENDALL) X(SCTP_SACK_IMMEDIATELY) XEND +}; + +bool +sysdecode_sctp_snd_flags(FILE *fp, int flags, int *rem) +{ + + return (print_mask_int(fp, sctpsndflags, flags, rem)); +} + +static struct name_table sctprcvflags[] = { + X(SCTP_UNORDERED) XEND +}; + +bool +sysdecode_sctp_rcv_flags(FILE *fp, int flags, int *rem) +{ + + return (print_mask_int(fp, sctprcvflags, flags, rem)); +} + +static struct name_table sctpnxtflags[] = { + X(SCTP_UNORDERED) X(SCTP_COMPLETE) X(SCTP_NOTIFICATION) XEND +}; + +bool +sysdecode_sctp_nxt_flags(FILE *fp, int flags, int *rem) +{ + + return (print_mask_int(fp, sctpnxtflags, flags, rem)); +} + static struct name_table sctpsinfoflags[] = { X(SCTP_EOF) X(SCTP_ABORT) X(SCTP_UNORDERED) X(SCTP_ADDR_OVER) X(SCTP_SENDALL) X(SCTP_EOR) X(SCTP_SACK_IMMEDIATELY) XEND Modified: head/lib/libsysdecode/sysdecode.h ============================================================================== --- head/lib/libsysdecode/sysdecode.h Mon Jan 15 19:25:11 2018 (r328013) +++ head/lib/libsysdecode/sysdecode.h Mon Jan 15 20:37:11 2018 (r328014) @@ -91,8 +91,11 @@ bool sysdecode_rfork_flags(FILE *_fp, int _flags, int const char *sysdecode_rlimit(int _resource); const char *sysdecode_rtprio_function(int _function); const char *sysdecode_scheduler_policy(int _policy); +bool sysdecode_sctp_nxt_flags(FILE *_fp, int _flags, int *_rem); const char *sysdecode_sctp_pr_policy(int _policy); +bool sysdecode_sctp_rcv_flags(FILE *_fp, int _flags, int *_rem); void sysdecode_sctp_sinfo_flags(FILE *_fp, int _sinfo_flags); +bool sysdecode_sctp_snd_flags(FILE *_fp, int _flags, int *_rem); const char *sysdecode_semctl_cmd(int _cmd); bool sysdecode_semget_flags(FILE *_fp, int _flag, int *_rem); bool sysdecode_sendfile_flags(FILE *_fp, int _flags, int *_rem); Modified: head/lib/libsysdecode/sysdecode_mask.3 ============================================================================== --- head/lib/libsysdecode/sysdecode_mask.3 Mon Jan 15 19:25:11 2018 (r328013) +++ head/lib/libsysdecode/sysdecode_mask.3 Mon Jan 15 20:37:11 2018 (r328014) @@ -50,6 +50,9 @@ .Nm sysdecode_semget_flags , .Nm sysdecode_sendfile_flags , .Nm sysdecode_shmat_flags , +.Nm sysdecode_sctp_nxt_flags , +.Nm sysdecode_sctp_rcv_flags , +.Nm sysdecode_sctp_snd_flags , .Nm sysdecode_socket_type , .Nm sysdecode_thr_create_flags , .Nm sysdecode_umtx_cvwait_flags , @@ -100,6 +103,12 @@ .Ft bool .Fn sysdecode_rfork_flags "FILE *fp" "int flags" "int *rem" .Ft bool +.Fn sysdecode_sctp_nxt_flags "FILE *fp" "int flags" "int *rem" +.Ft bool +.Fn sysdecode_sctp_rcv_flags "FILE *fp" "int flags" "int *rem" +.Ft bool +.Fn sysdecode_sctp_snd_flags "FILE *fp" "int flags" "int *rem" +.Ft bool .Fn sysdecode_semget_flags "FILE *fp" "int flags" "int *rem" .Ft bool .Fn sysdecode_sendfile_flags "FILE *fp" "int flags" "int *rem" @@ -185,6 +194,21 @@ and .Dv F_SETFL .Xr fcntl 2 commands. +.It Fn sysdecode_sctp_nxt_flags +The +.Fa nxt_flags +member of a +.Vt struct sctp_nxtinfo . +.It Fn sysdecode_sctp_rcv_flags +The +.Fa rcv_flags +member of a +.Vt struct sctp_rcvinfo . +.It Fn sysdecode_sctp_snd_flags +The +.Fa snd_flags +member of a +.Vt struct sctp_sndinfo . .It Fn sysdecode_umtx_cvwait_flags The .Fa val From owner-svn-src-head@freebsd.org Mon Jan 15 20:39:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E379FE75510; Mon, 15 Jan 2018 20:39:43 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8F32A6CBD1; Mon, 15 Jan 2018 20:39: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C0C4F162BA; Mon, 15 Jan 2018 20:39:42 +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 w0FKdgSh048552; Mon, 15 Jan 2018 20:39:42 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0FKdg1F048550; Mon, 15 Jan 2018 20:39:42 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201801152039.w0FKdg1F048550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 15 Jan 2018 20:39:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328015 - head/usr.bin/truss X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/usr.bin/truss X-SVN-Commit-Revision: 328015 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 20:39:44 -0000 Author: tuexen Date: Mon Jan 15 20:39:42 2018 New Revision: 328015 URL: https://svnweb.freebsd.org/changeset/base/328015 Log: Decode msghdr argument of sendmsg() and recvmsg(). Sponsored by: Netflix, Inc. Modified: head/usr.bin/truss/syscall.h head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/syscall.h ============================================================================== --- head/usr.bin/truss/syscall.h Mon Jan 15 20:37:11 2018 (r328014) +++ head/usr.bin/truss/syscall.h Mon Jan 15 20:39:42 2018 (r328015) @@ -82,7 +82,7 @@ enum Argtype { None = 1, Hex, Octal, Int, UInt, LongHe Sockoptname, Msgflags, CapRights, PUInt, PQuadHex, Acltype, Extattrnamespace, Minherit, Mlockall, Mountflags, Msync, Priowhich, Ptraceop, Quotactlcmd, Reboothowto, Rtpriofunc, Schedpolicy, Schedparam, - PSig, Siginfo, Kevent11, Iovec, Sctpsndrcvinfo, + PSig, Siginfo, Kevent11, Iovec, Sctpsndrcvinfo, Msghdr, CloudABIAdvice, CloudABIClockID, ClouduABIFDSFlags, CloudABIFDStat, CloudABIFileStat, CloudABIFileType, Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Mon Jan 15 20:37:11 2018 (r328014) +++ head/usr.bin/truss/syscalls.c Mon Jan 15 20:39:42 2018 (r328015) @@ -401,7 +401,7 @@ static struct syscall decoded_syscalls[] = { { Msgflags, 3 }, { Sockaddr | OUT, 4 }, { Ptr | OUT, 5 } } }, { .name = "recvmsg", .ret_type = 1, .nargs = 3, - .args = { { Int, 0 }, { Ptr, 1 }, { Msgflags, 2 } } }, + .args = { { Int, 0 }, { Msghdr | OUT, 1 }, { Msgflags, 2 } } }, { .name = "rename", .ret_type = 1, .nargs = 2, .args = { { Name, 0 }, { Name, 1 } } }, { .name = "renameat", .ret_type = 1, .nargs = 4, @@ -444,7 +444,7 @@ static struct syscall decoded_syscalls[] = { .args = { { Int, 0 }, { Fd_set, 1 }, { Fd_set, 2 }, { Fd_set, 3 }, { Timeval, 4 } } }, { .name = "sendmsg", .ret_type = 1, .nargs = 3, - .args = { { Int, 0 }, { Ptr, 1 }, { Msgflags, 2 } } }, + .args = { { Int, 0 }, { Msghdr | IN, 1 }, { Msgflags, 2 } } }, { .name = "sendto", .ret_type = 1, .nargs = 6, .args = { { Int, 0 }, { BinString | IN, 1 }, { Sizet, 2 }, { Msgflags, 3 }, { Sockaddr | IN, 4 }, @@ -1159,6 +1159,378 @@ print_utrace(FILE *fp, void *utrace_addr, size_t len) fprintf(fp, " }"); } +static void +print_sockaddr(FILE *fp, struct trussinfo *trussinfo, void *arg, socklen_t len) +{ + char addr[64]; + struct sockaddr_in *lsin; + struct sockaddr_in6 *lsin6; + struct sockaddr_un *sun; + struct sockaddr *sa; + u_char *q; + pid_t pid = trussinfo->curthread->proc->pid; + + if (arg == NULL) { + fputs("NULL", fp); + return; + } + /* If the length is too small, just bail. */ + if (len < sizeof(*sa)) { + fprintf(fp, "0x%p", arg); + return; + } + + sa = calloc(1, len); + if (get_struct(pid, arg, sa, len) == -1) { + free(sa); + fprintf(fp, "0x%p", arg); + return; + } + + switch (sa->sa_family) { + case AF_INET: + if (len < sizeof(*lsin)) + goto sockaddr_short; + lsin = (struct sockaddr_in *)(void *)sa; + inet_ntop(AF_INET, &lsin->sin_addr, addr, sizeof(addr)); + fprintf(fp, "{ AF_INET %s:%d }", addr, + htons(lsin->sin_port)); + break; + case AF_INET6: + if (len < sizeof(*lsin6)) + goto sockaddr_short; + lsin6 = (struct sockaddr_in6 *)(void *)sa; + inet_ntop(AF_INET6, &lsin6->sin6_addr, addr, + sizeof(addr)); + fprintf(fp, "{ AF_INET6 [%s]:%d }", addr, + htons(lsin6->sin6_port)); + break; + case AF_UNIX: + sun = (struct sockaddr_un *)sa; + fprintf(fp, "{ AF_UNIX \"%.*s\" }", + (int)(len - offsetof(struct sockaddr_un, sun_path)), + sun->sun_path); + break; + default: + sockaddr_short: + fprintf(fp, + "{ sa_len = %d, sa_family = %d, sa_data = {", + (int)sa->sa_len, (int)sa->sa_family); + for (q = (u_char *)sa->sa_data; + q < (u_char *)sa + len; q++) + fprintf(fp, "%s 0x%02x", + q == (u_char *)sa->sa_data ? "" : ",", + *q); + fputs(" } }", fp); + } + free(sa); +} + +#define IOV_LIMIT 16 + +static void +print_iovec(FILE *fp, struct trussinfo *trussinfo, void *arg, int iovcnt) +{ + struct iovec iov[IOV_LIMIT]; + size_t max_string = trussinfo->strsize; + char tmp2[max_string + 1], *tmp3; + size_t len; + pid_t pid = trussinfo->curthread->proc->pid; + int i; + bool buf_truncated, iov_truncated; + + if (iovcnt <= 0) { + fprintf(fp, "0x%p", arg); + return; + } + if (iovcnt > IOV_LIMIT) { + iovcnt = IOV_LIMIT; + iov_truncated = true; + } else { + iov_truncated = false; + } + if (get_struct(pid, arg, &iov, iovcnt * sizeof(struct iovec)) == -1) { + fprintf(fp, "0x%p", arg); + return; + } + + fputs("[", fp); + for (i = 0; i < iovcnt; i++) { + len = iov[i].iov_len; + if (len > max_string) { + len = max_string; + buf_truncated = true; + } else { + buf_truncated = false; + } + fprintf(fp, "%s{", (i > 0) ? "," : ""); + if (len && get_struct(pid, iov[i].iov_base, &tmp2, len) != -1) { + tmp3 = malloc(len * 4 + 1); + while (len) { + if (strvisx(tmp3, tmp2, len, + VIS_CSTYLE|VIS_TAB|VIS_NL) <= + (int)max_string) + break; + len--; + buf_truncated = true; + } + fprintf(fp, "\"%s\"%s", tmp3, + buf_truncated ? "..." : ""); + free(tmp3); + } else { + fprintf(fp, "0x%p", iov[i].iov_base); + } + fprintf(fp, ",%zu}", iov[i].iov_len); + } + fprintf(fp, "%s%s", iov_truncated ? ",..." : "", "]"); +} + +static void +print_gen_cmsg(FILE *fp, struct cmsghdr *cmsghdr) +{ + u_char *q; + + fputs("{", fp); + for (q = CMSG_DATA(cmsghdr); + q < (u_char *)cmsghdr + cmsghdr->cmsg_len; q++) { + fprintf(fp, "%s0x%02x", q == CMSG_DATA(cmsghdr) ? "" : ",", *q); + } + fputs("}", fp); +} + +static void +print_sctp_initmsg(FILE *fp, struct sctp_initmsg *init) +{ + fprintf(fp, "{out=%u,", init->sinit_num_ostreams); + fprintf(fp, "in=%u,", init->sinit_max_instreams); + fprintf(fp, "max_rtx=%u,", init->sinit_max_attempts); + fprintf(fp, "max_rto=%u}", init->sinit_max_init_timeo); +} + +static void +print_sctp_sndrcvinfo(FILE *fp, bool recv, struct sctp_sndrcvinfo *info) +{ + fprintf(fp, "{sid=%u,", info->sinfo_stream); + if (recv) { + fprintf(fp, "ssn=%u,", info->sinfo_ssn); + } + fputs("flgs=", fp); + sysdecode_sctp_sinfo_flags(fp, info->sinfo_flags); + fprintf(fp, ",ppid=%u,", ntohl(info->sinfo_ppid)); + if (!recv) { + fprintf(fp, "ctx=%u,", info->sinfo_context); + fprintf(fp, "ttl=%u,", info->sinfo_timetolive); + } + if (recv) { + fprintf(fp, "tsn=%u,", info->sinfo_tsn); + fprintf(fp, "cumtsn=%u,", info->sinfo_cumtsn); + } + fprintf(fp, "id=%u}", info->sinfo_assoc_id); +} + +static void +print_sctp_sndinfo(FILE *fp, struct sctp_sndinfo *info) +{ + fprintf(fp, "{sid=%u,", info->snd_sid); + fputs("flgs=", fp); + print_mask_arg(sysdecode_sctp_snd_flags, fp, info->snd_flags); + fprintf(fp, ",ppid=%u,", ntohl(info->snd_ppid)); + fprintf(fp, "ctx=%u,", info->snd_context); + fprintf(fp, "id=%u}", info->snd_assoc_id); +} + +static void +print_sctp_rcvinfo(FILE *fp, struct sctp_rcvinfo *info) +{ + fprintf(fp, "{sid=%u,", info->rcv_sid); + fprintf(fp, "ssn=%u,", info->rcv_ssn); + fputs("flgs=", fp); + print_mask_arg(sysdecode_sctp_rcv_flags, fp, info->rcv_flags); + fprintf(fp, ",ppid=%u,", ntohl(info->rcv_ppid)); + fprintf(fp, "tsn=%u,", info->rcv_tsn); + fprintf(fp, "cumtsn=%u,", info->rcv_cumtsn); + fprintf(fp, "ctx=%u,", info->rcv_context); + fprintf(fp, "id=%u}", info->rcv_assoc_id); +} + +static void +print_sctp_nxtinfo(FILE *fp, struct sctp_nxtinfo *info) +{ + fprintf(fp, "{sid=%u,", info->nxt_sid); + fputs("flgs=", fp); + print_mask_arg(sysdecode_sctp_nxt_flags, fp, info->nxt_flags); + fprintf(fp, ",ppid=%u,", ntohl(info->nxt_ppid)); + fprintf(fp, "len=%u,", info->nxt_length); + fprintf(fp, "id=%u}", info->nxt_assoc_id); +} + +static void +print_sctp_prinfo(FILE *fp, struct sctp_prinfo *info) +{ + fputs("{pol=", fp); + print_integer_arg(sysdecode_sctp_pr_policy, fp, info->pr_policy); + fprintf(fp, ",val=%u}", info->pr_value); +} + +static void +print_sctp_authinfo(FILE *fp, struct sctp_authinfo *info) +{ + fprintf(fp, "{num=%u}", info->auth_keynumber); +} + +static void +print_sctp_ipv4_addr(FILE *fp, struct in_addr *addr) +{ + char buf[INET_ADDRSTRLEN]; + const char *s; + + s = inet_ntop(AF_INET, addr, buf, INET_ADDRSTRLEN); + if (s != NULL) + fprintf(fp, "{addr=%s}", s); + else + fputs("{addr=???}", fp); +} + +static void +print_sctp_ipv6_addr(FILE *fp, struct in6_addr *addr) +{ + char buf[INET6_ADDRSTRLEN]; + const char *s; + + s = inet_ntop(AF_INET6, addr, buf, INET6_ADDRSTRLEN); + if (s != NULL) + fprintf(fp, "{addr=%s}", s); + else + fputs("{addr=???}", fp); +} + +static void +print_sctp_cmsg(FILE *fp, bool recv, struct cmsghdr *cmsghdr) +{ + void *data; + socklen_t len; + + len = cmsghdr->cmsg_len; + data = CMSG_DATA(cmsghdr); + switch (cmsghdr->cmsg_type) { + case SCTP_INIT: + if (len == CMSG_LEN(sizeof(struct sctp_initmsg))) + print_sctp_initmsg(fp, (struct sctp_initmsg *)data); + else + print_gen_cmsg(fp, cmsghdr); + break; + case SCTP_SNDRCV: + if (len == CMSG_LEN(sizeof(struct sctp_sndrcvinfo))) + print_sctp_sndrcvinfo(fp, recv, + (struct sctp_sndrcvinfo *)data); + else + print_gen_cmsg(fp, cmsghdr); + break; +#if 0 + case SCTP_EXTRCV: + if (len == CMSG_LEN(sizeof(struct sctp_extrcvinfo))) + print_sctp_extrcvinfo(fp, + (struct sctp_extrcvinfo *)data); + else + print_gen_cmsg(fp, cmsghdr); + break; +#endif + case SCTP_SNDINFO: + if (len == CMSG_LEN(sizeof(struct sctp_sndinfo))) + print_sctp_sndinfo(fp, (struct sctp_sndinfo *)data); + else + print_gen_cmsg(fp, cmsghdr); + break; + case SCTP_RCVINFO: + if (len == CMSG_LEN(sizeof(struct sctp_rcvinfo))) + print_sctp_rcvinfo(fp, (struct sctp_rcvinfo *)data); + else + print_gen_cmsg(fp, cmsghdr); + break; + case SCTP_NXTINFO: + if (len == CMSG_LEN(sizeof(struct sctp_nxtinfo))) + print_sctp_nxtinfo(fp, (struct sctp_nxtinfo *)data); + else + print_gen_cmsg(fp, cmsghdr); + break; + case SCTP_PRINFO: + if (len == CMSG_LEN(sizeof(struct sctp_prinfo))) + print_sctp_prinfo(fp, (struct sctp_prinfo *)data); + else + print_gen_cmsg(fp, cmsghdr); + break; + case SCTP_AUTHINFO: + if (len == CMSG_LEN(sizeof(struct sctp_authinfo))) + print_sctp_authinfo(fp, (struct sctp_authinfo *)data); + else + print_gen_cmsg(fp, cmsghdr); + break; + case SCTP_DSTADDRV4: + if (len == CMSG_LEN(sizeof(struct in_addr))) + print_sctp_ipv4_addr(fp, (struct in_addr *)data); + else + print_gen_cmsg(fp, cmsghdr); + break; + case SCTP_DSTADDRV6: + if (len == CMSG_LEN(sizeof(struct in6_addr))) + print_sctp_ipv6_addr(fp, (struct in6_addr *)data); + else + print_gen_cmsg(fp, cmsghdr); + break; + default: + print_gen_cmsg(fp, cmsghdr); + } +} + +static void +print_cmsgs(FILE *fp, pid_t pid, bool recv, struct msghdr *msghdr) +{ + struct cmsghdr *cmsghdr; + char *cmsgbuf; + const char *temp; + socklen_t len; + int level, type; + bool first; + + len = msghdr->msg_controllen; + cmsgbuf = calloc(1, len); + if (get_struct(pid, msghdr->msg_control, cmsgbuf, len) == -1) { + fprintf(fp, "0x%p", msghdr); + free(cmsgbuf); + } + msghdr->msg_control = cmsgbuf; + first = true; + fputs("{", fp); + for (cmsghdr = CMSG_FIRSTHDR(msghdr); + cmsghdr != NULL; + cmsghdr = CMSG_NXTHDR(msghdr, cmsghdr)) { + level = cmsghdr->cmsg_level; + type = cmsghdr->cmsg_type; + len = cmsghdr->cmsg_len; + fprintf(fp, "%s{level=", first ? "" : ","); + print_integer_arg(sysdecode_sockopt_level, fp, level); + fputs(",type=", fp); + temp = sysdecode_cmsg_type(level, type); + if (temp) { + fputs(temp, fp); + } else { + fprintf(fp, "%d", type); + } + fputs(",data=", fp); + switch (level) { + case IPPROTO_SCTP: + print_sctp_cmsg(fp, recv, cmsghdr); + break; + default: + print_gen_cmsg(fp, cmsghdr); + break; + } + fputs("}", fp); + } + fputs("}", fp); + free(cmsgbuf); +} + /* * Converts a syscall argument into a string. Said string is * allocated via malloc(), so needs to be free()'d. sc is @@ -1613,13 +1985,7 @@ print_arg(struct syscall_args *sc, unsigned long *args print_mask_arg(sysdecode_rfork_flags, fp, args[sc->offset]); break; case Sockaddr: { - char addr[64]; - struct sockaddr_in *lsin; - struct sockaddr_in6 *lsin6; - struct sockaddr_un *sun; - struct sockaddr *sa; socklen_t len; - u_char *q; if (args[sc->offset] == 0) { fputs("NULL", fp); @@ -1641,56 +2007,7 @@ print_arg(struct syscall_args *sc, unsigned long *args } else len = args[sc->offset + 1]; - /* If the length is too small, just bail. */ - if (len < sizeof(*sa)) { - fprintf(fp, "0x%lx", args[sc->offset]); - break; - } - - sa = calloc(1, len); - if (get_struct(pid, (void *)args[sc->offset], sa, len) == -1) { - free(sa); - fprintf(fp, "0x%lx", args[sc->offset]); - break; - } - - switch (sa->sa_family) { - case AF_INET: - if (len < sizeof(*lsin)) - goto sockaddr_short; - lsin = (struct sockaddr_in *)(void *)sa; - inet_ntop(AF_INET, &lsin->sin_addr, addr, sizeof(addr)); - fprintf(fp, "{ AF_INET %s:%d }", addr, - htons(lsin->sin_port)); - break; - case AF_INET6: - if (len < sizeof(*lsin6)) - goto sockaddr_short; - lsin6 = (struct sockaddr_in6 *)(void *)sa; - inet_ntop(AF_INET6, &lsin6->sin6_addr, addr, - sizeof(addr)); - fprintf(fp, "{ AF_INET6 [%s]:%d }", addr, - htons(lsin6->sin6_port)); - break; - case AF_UNIX: - sun = (struct sockaddr_un *)sa; - fprintf(fp, "{ AF_UNIX \"%.*s\" }", - (int)(len - offsetof(struct sockaddr_un, sun_path)), - sun->sun_path); - break; - default: - sockaddr_short: - fprintf(fp, - "{ sa_len = %d, sa_family = %d, sa_data = {", - (int)sa->sa_len, (int)sa->sa_family); - for (q = (u_char *)sa->sa_data; - q < (u_char *)sa + len; q++) - fprintf(fp, "%s 0x%02x", - q == (u_char *)sa->sa_data ? "" : ",", - *q); - fputs(" } }", fp); - } - free(sa); + print_sockaddr(fp, trussinfo, (void *)args[sc->offset], len); break; } case Sigaction: { @@ -2148,93 +2465,43 @@ print_arg(struct syscall_args *sc, unsigned long *args fprintf(fp, "0x%lx", args[sc->offset]); break; } -#define IOV_LIMIT 16 - case Iovec: { + case Iovec: /* * Print argument as an array of struct iovec, where the next * syscall argument is the number of elements of the array. */ - struct iovec iov[IOV_LIMIT]; - size_t max_string = trussinfo->strsize; - char tmp2[max_string + 1], *tmp3; - size_t len; - int i, iovcnt; - bool buf_truncated, iov_truncated; - iovcnt = args[sc->offset + 1]; - if (iovcnt <= 0) { - fprintf(fp, "0x%lx", args[sc->offset]); - break; - } - if (iovcnt > IOV_LIMIT) { - iovcnt = IOV_LIMIT; - iov_truncated = true; - } else { - iov_truncated = false; - } + print_iovec(fp, trussinfo, (void *)args[sc->offset], + (int)args[sc->offset + 1]); + break; + case Sctpsndrcvinfo: { + struct sctp_sndrcvinfo info; + if (get_struct(pid, (void *)args[sc->offset], - &iov, iovcnt * sizeof(struct iovec)) == -1) { + &info, sizeof(struct sctp_sndrcvinfo)) == -1) { fprintf(fp, "0x%lx", args[sc->offset]); break; } - - fprintf(fp, "%s", "["); - for (i = 0; i < iovcnt; i++) { - len = iov[i].iov_len; - if (len > max_string) { - len = max_string; - buf_truncated = true; - } else { - buf_truncated = false; - } - fprintf(fp, "%s{", (i > 0) ? "," : ""); - if (len && get_struct(pid, iov[i].iov_base, &tmp2, len) - != -1) { - tmp3 = malloc(len * 4 + 1); - while (len) { - if (strvisx(tmp3, tmp2, len, - VIS_CSTYLE|VIS_TAB|VIS_NL) <= - (int)max_string) - break; - len--; - buf_truncated = true; - } - fprintf(fp, "\"%s\"%s", tmp3, - buf_truncated ? "..." : ""); - free(tmp3); - } else { - fprintf(fp, "0x%p", iov[i].iov_base); - } - fprintf(fp, ",%zu}", iov[i].iov_len); - } - fprintf(fp, "%s%s", iov_truncated ? ",..." : "", "]"); + print_sctp_sndrcvinfo(fp, sc->type & OUT, &info); break; } - case Sctpsndrcvinfo: { - struct sctp_sndrcvinfo info; + case Msghdr: { + struct msghdr msghdr; if (get_struct(pid, (void *)args[sc->offset], - &info, sizeof(struct sctp_sndrcvinfo)) == -1) { + &msghdr, sizeof(struct msghdr)) == -1) { fprintf(fp, "0x%lx", args[sc->offset]); break; } - fprintf(fp, "{sid=%u,", info.sinfo_stream); - if (sc->type & OUT) { - fprintf(fp, "ssn=%u,", info.sinfo_ssn); - } - fputs("flgs=", fp); - sysdecode_sctp_sinfo_flags(fp, info.sinfo_flags); - fprintf(fp, ",ppid=%u,", ntohl(info.sinfo_ppid)); - /* Can't use IN here, since IN is 0 */ - if ((sc->type & OUT) == 0) { - fprintf(fp, "ctx=%u,", info.sinfo_context); - fprintf(fp, "ttl=%u,", info.sinfo_timetolive); - } - if (sc->type & OUT) { - fprintf(fp, "tsn=%u,", info.sinfo_tsn); - fprintf(fp, "cumtsn=%u,", info.sinfo_cumtsn); - } - fprintf(fp, "id=%u}", info.sinfo_assoc_id); + fputs("{", fp); + print_sockaddr(fp, trussinfo, msghdr.msg_name, msghdr.msg_namelen); + fprintf(fp, ",%d,", msghdr.msg_namelen); + print_iovec(fp, trussinfo, msghdr.msg_iov, msghdr.msg_iovlen); + fprintf(fp, ",%d,", msghdr.msg_iovlen); + print_cmsgs(fp, pid, sc->type & OUT, &msghdr); + fprintf(fp, ",%u,", msghdr.msg_controllen); + print_mask_arg(sysdecode_msg_flags, fp, msghdr.msg_flags); + fputs("}", fp); break; } From owner-svn-src-head@freebsd.org Mon Jan 15 21:08:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 969E3E76C86; Mon, 15 Jan 2018 21:08:23 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 725AC6DE9D; Mon, 15 Jan 2018 21:08:23 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B9D0016789; Mon, 15 Jan 2018 21:08: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 w0FL8MCF061124; Mon, 15 Jan 2018 21:08:22 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0FL8M8m061120; Mon, 15 Jan 2018 21:08:22 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201801152108.w0FL8M8m061120@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 15 Jan 2018 21:08:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328016 - in head/sys: amd64/amd64 i386/i386 x86/cpufreq X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: in head/sys: amd64/amd64 i386/i386 x86/cpufreq X-SVN-Commit-Revision: 328016 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 21:08:23 -0000 Author: pfg Date: Mon Jan 15 21:08:22 2018 New Revision: 328016 URL: https://svnweb.freebsd.org/changeset/base/328016 Log: x86: make some use of mallocarray(9). Focus on code where we are doing multiplications within malloc(9). None of these ire likely to overflow, however the change is still useful as some static checkers can benefit from the allocation attributes we use for mallocarray. This initial sweep only covers malloc(9) calls with M_NOWAIT. No good reason but I started doing the changes before r327796 and at that time it was convenient to make sure the sorrounding code could handle NULL values. X-Differential revision: https://reviews.freebsd.org/D13837 Modified: head/sys/amd64/amd64/bpf_jit_machdep.c head/sys/i386/i386/bpf_jit_machdep.c head/sys/i386/i386/k6_mem.c head/sys/x86/cpufreq/est.c Modified: head/sys/amd64/amd64/bpf_jit_machdep.c ============================================================================== --- head/sys/amd64/amd64/bpf_jit_machdep.c Mon Jan 15 20:39:42 2018 (r328015) +++ head/sys/amd64/amd64/bpf_jit_machdep.c Mon Jan 15 21:08:22 2018 (r328016) @@ -186,7 +186,7 @@ bpf_jit_compile(struct bpf_insn *prog, u_int nins, siz /* Allocate the reference table for the jumps. */ if (fjmp) { #ifdef _KERNEL - stream.refs = malloc((nins + 1) * sizeof(u_int), M_BPFJIT, + stream.refs = mallocarray(nins + 1, sizeof(u_int), M_BPFJIT, M_NOWAIT | M_ZERO); #else stream.refs = calloc(nins + 1, sizeof(u_int)); Modified: head/sys/i386/i386/bpf_jit_machdep.c ============================================================================== --- head/sys/i386/i386/bpf_jit_machdep.c Mon Jan 15 20:39:42 2018 (r328015) +++ head/sys/i386/i386/bpf_jit_machdep.c Mon Jan 15 21:08:22 2018 (r328016) @@ -185,7 +185,7 @@ bpf_jit_compile(struct bpf_insn *prog, u_int nins, siz /* Allocate the reference table for the jumps. */ if (fjmp) { #ifdef _KERNEL - stream.refs = malloc((nins + 1) * sizeof(u_int), M_BPFJIT, + stream.refs = mallocarray(nins + 1, sizeof(u_int), M_BPFJIT, M_NOWAIT | M_ZERO); #else stream.refs = calloc(nins + 1, sizeof(u_int)); Modified: head/sys/i386/i386/k6_mem.c ============================================================================== --- head/sys/i386/i386/k6_mem.c Mon Jan 15 20:39:42 2018 (r328015) +++ head/sys/i386/i386/k6_mem.c Mon Jan 15 21:08:22 2018 (r328016) @@ -107,7 +107,7 @@ k6_mrinit(struct mem_range_softc *sc) sc->mr_cap = 0; sc->mr_ndesc = 2; /* XXX (BFF) For now, we only have one msr for this */ - sc->mr_desc = malloc(sc->mr_ndesc * sizeof(struct mem_range_desc), + sc->mr_desc = mallocarray(sc->mr_ndesc, sizeof(struct mem_range_desc), M_MEMDESC, M_NOWAIT | M_ZERO); if (sc->mr_desc == NULL) panic("k6_mrinit: malloc returns NULL"); Modified: head/sys/x86/cpufreq/est.c ============================================================================== --- head/sys/x86/cpufreq/est.c Mon Jan 15 20:39:42 2018 (r328015) +++ head/sys/x86/cpufreq/est.c Mon Jan 15 21:08:22 2018 (r328016) @@ -1119,7 +1119,7 @@ est_acpi_info(device_t dev, freq_info **freqs) goto out; /* Parse settings into our local table format. */ - table = malloc((count + 1) * sizeof(freq_info), M_DEVBUF, M_NOWAIT); + table = mallocarray(count + 1, sizeof(freq_info), M_DEVBUF, M_NOWAIT); if (table == NULL) { error = ENOMEM; goto out; From owner-svn-src-head@freebsd.org Mon Jan 15 21:10:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21AA1E76E44; Mon, 15 Jan 2018 21:10:00 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EFC526E04B; Mon, 15 Jan 2018 21:09:59 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 38E7A1678B; Mon, 15 Jan 2018 21:09:59 +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 w0FL9xQD061218; Mon, 15 Jan 2018 21:09:59 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0FL9wa9061216; Mon, 15 Jan 2018 21:09:58 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201801152109.w0FL9wa9061216@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 15 Jan 2018 21:09:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328017 - in head/sys: arm/xscale/ixp425 arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: in head/sys: arm/xscale/ixp425 arm64/arm64 X-SVN-Commit-Revision: 328017 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 21:10:00 -0000 Author: pfg Date: Mon Jan 15 21:09:58 2018 New Revision: 328017 URL: https://svnweb.freebsd.org/changeset/base/328017 Log: arm: make some use of mallocarray(9). Focus on code where we are doing multiplications within malloc(9). None of these ire likely to overflow, however the change is still useful as some static checkers can benefit from the allocation attributes we use for mallocarray. This initial sweep only covers malloc(9) calls with M_NOWAIT. No good reason but I started doing the changes before r327796 and at that time it was convenient to make sure the sorrounding code could handle NULL values. X-Differential revision: https://reviews.freebsd.org/D13837 Modified: head/sys/arm/xscale/ixp425/if_npe.c head/sys/arm64/arm64/busdma_bounce.c Modified: head/sys/arm/xscale/ixp425/if_npe.c ============================================================================== --- head/sys/arm/xscale/ixp425/if_npe.c Mon Jan 15 21:08:22 2018 (r328016) +++ head/sys/arm/xscale/ixp425/if_npe.c Mon Jan 15 21:09:58 2018 (r328017) @@ -515,7 +515,8 @@ npe_dma_setup(struct npe_softc *sc, struct npedma *dma return error; } /* XXX M_TEMP */ - dma->buf = malloc(nbuf * sizeof(struct npebuf), M_TEMP, M_NOWAIT | M_ZERO); + dma->buf = mallocarray(nbuf, sizeof(struct npebuf), M_TEMP, + M_NOWAIT | M_ZERO); if (dma->buf == NULL) { device_printf(sc->sc_dev, "unable to allocate memory for %s s/w buffers\n", Modified: head/sys/arm64/arm64/busdma_bounce.c ============================================================================== --- head/sys/arm64/arm64/busdma_bounce.c Mon Jan 15 21:08:22 2018 (r328016) +++ head/sys/arm64/arm64/busdma_bounce.c Mon Jan 15 21:09:58 2018 (r328017) @@ -302,8 +302,8 @@ bounce_bus_dmamap_create(bus_dma_tag_t dmat, int flags error = 0; if (dmat->segments == NULL) { - dmat->segments = (bus_dma_segment_t *)malloc( - sizeof(bus_dma_segment_t) * dmat->common.nsegments, + dmat->segments = (bus_dma_segment_t *)mallocarray( + dmat->common.nsegments, sizeof(bus_dma_segment_t), M_DEVBUF, M_NOWAIT); if (dmat->segments == NULL) { CTR3(KTR_BUSDMA, "%s: tag %p error %d", From owner-svn-src-head@freebsd.org Mon Jan 15 21:10:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4EF2E7705A; Mon, 15 Jan 2018 21:10:41 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 901266E1CB; Mon, 15 Jan 2018 21:10:41 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B3AA416799; Mon, 15 Jan 2018 21:10:40 +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 w0FLAeHu061307; Mon, 15 Jan 2018 21:10:40 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0FLAeji061306; Mon, 15 Jan 2018 21:10:40 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201801152110.w0FLAeji061306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 15 Jan 2018 21:10:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328018 - head/sys/powerpc/pseries X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/powerpc/pseries X-SVN-Commit-Revision: 328018 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 21:10:41 -0000 Author: pfg Date: Mon Jan 15 21:10:40 2018 New Revision: 328018 URL: https://svnweb.freebsd.org/changeset/base/328018 Log: powerpc: make some use of mallocarray(9). Focus on code where we are doing multiplications within malloc(9). None of these ire likely to overflow, however the change is still useful as some static checkers can benefit from the allocation attributes we use for mallocarray. This initial sweep only covers malloc(9) calls with M_NOWAIT. No good reason but I started doing the changes before r327796 and at that time it was convenient to make sure the sorrounding code could handle NULL values. X-Differential revision: https://reviews.freebsd.org/D13837 Modified: head/sys/powerpc/pseries/phyp_vscsi.c Modified: head/sys/powerpc/pseries/phyp_vscsi.c ============================================================================== --- head/sys/powerpc/pseries/phyp_vscsi.c Mon Jan 15 21:09:58 2018 (r328017) +++ head/sys/powerpc/pseries/phyp_vscsi.c Mon Jan 15 21:10:40 2018 (r328018) @@ -336,8 +336,8 @@ vscsi_attach(device_t dev) mtx_lock(&sc->io_lock); vscsi_setup_bus(sc); - sc->xfer = malloc(sizeof(sc->xfer[0])*sc->max_transactions, M_VSCSI, - M_NOWAIT); + sc->xfer = mallocarray(sc->max_transactions, sizeof(sc->xfer[0]), + M_VSCSI, M_NOWAIT); for (i = 0; i < sc->max_transactions; i++) { xp = &sc->xfer[i]; xp->sc = sc; From owner-svn-src-head@freebsd.org Mon Jan 15 21:11:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C64AFE77155; Mon, 15 Jan 2018 21:11:39 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A1B4C6E5C3; Mon, 15 Jan 2018 21:11:39 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E2AB9167EC; Mon, 15 Jan 2018 21:11: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 w0FLBcXP063188; Mon, 15 Jan 2018 21:11:38 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0FLBcSc063187; Mon, 15 Jan 2018 21:11:38 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201801152111.w0FLBcSc063187@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 15 Jan 2018 21:11:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328019 - head/sys/compat/ndis X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/compat/ndis X-SVN-Commit-Revision: 328019 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 21:11:39 -0000 Author: pfg Date: Mon Jan 15 21:11:38 2018 New Revision: 328019 URL: https://svnweb.freebsd.org/changeset/base/328019 Log: ndis: make some use of mallocarray(9). Focus on code where we are doing multiplications within malloc(9). None of these ire likely to overflow, however the change is still useful as some static checkers can benefit from the allocation attributes we use for mallocarray. This initial sweep only covers malloc(9) calls with M_NOWAIT. No good reason but I started doing the changes before r327796 and at that time it was convenient to make sure the sorrounding code could handle NULL values. X-Differential revision: https://reviews.freebsd.org/D13837 Modified: head/sys/compat/ndis/subr_ndis.c Modified: head/sys/compat/ndis/subr_ndis.c ============================================================================== --- head/sys/compat/ndis/subr_ndis.c Mon Jan 15 21:10:40 2018 (r328018) +++ head/sys/compat/ndis/subr_ndis.c Mon Jan 15 21:11:38 2018 (r328019) @@ -1351,7 +1351,7 @@ NdisMAllocateMapRegisters(ndis_handle adapter, uint32_ block = (ndis_miniport_block *)adapter; sc = device_get_softc(block->nmb_physdeviceobj->do_devext); - sc->ndis_mmaps = malloc(sizeof(bus_dmamap_t) * physmapneeded, + sc->ndis_mmaps = mallocarray(physmapneeded, sizeof(bus_dmamap_t), M_DEVBUF, M_NOWAIT|M_ZERO); if (sc->ndis_mmaps == NULL) From owner-svn-src-head@freebsd.org Mon Jan 15 21:13:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E44E7E772B0; Mon, 15 Jan 2018 21:13:31 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BE82C6E8D6; Mon, 15 Jan 2018 21:13: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 07B9516936; Mon, 15 Jan 2018 21:13: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 w0FLDUpC065785; Mon, 15 Jan 2018 21:13:30 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0FLDUUn065783; Mon, 15 Jan 2018 21:13:30 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201801152113.w0FLDUUn065783@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 15 Jan 2018 21:13:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328020 - in head/sys/mips: mips nlm/dev/sec X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: in head/sys/mips: mips nlm/dev/sec X-SVN-Commit-Revision: 328020 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 21:13:32 -0000 Author: pfg Date: Mon Jan 15 21:13:30 2018 New Revision: 328020 URL: https://svnweb.freebsd.org/changeset/base/328020 Log: mips: make some use of mallocarray(9). Focus on code where we are doing multiplications within malloc(9). None of these ire likely to overflow, however the change is still useful as some static checkers can benefit from the allocation attributes we use for mallocarray. This initial sweep only covers malloc(9) calls with M_NOWAIT. No good reason but I started doing the changes before r327796 and at that time it was convenient to make sure the sorrounding code could handle NULL values. X-Differential revision: https://reviews.freebsd.org/D13837 Modified: head/sys/mips/mips/busdma_machdep.c head/sys/mips/nlm/dev/sec/nlmrsa.c Modified: head/sys/mips/mips/busdma_machdep.c ============================================================================== --- head/sys/mips/mips/busdma_machdep.c Mon Jan 15 21:11:38 2018 (r328019) +++ head/sys/mips/mips/busdma_machdep.c Mon Jan 15 21:13:30 2018 (r328020) @@ -345,7 +345,8 @@ _busdma_alloc_dmamap(bus_dma_tag_t dmat) struct sync_list *slist; bus_dmamap_t map; - slist = malloc(sizeof(*slist) * dmat->nsegments, M_BUSDMA, M_NOWAIT); + slist = mallocarray(dmat->nsegments, sizeof(*slist), M_BUSDMA, + M_NOWAIT); if (slist == NULL) return (NULL); map = uma_zalloc_arg(dmamap_zone, dmat, M_NOWAIT); @@ -534,9 +535,8 @@ bus_dmamap_create(bus_dma_tag_t dmat, int flags, bus_d int error = 0; if (dmat->segments == NULL) { - dmat->segments = (bus_dma_segment_t *)malloc( - sizeof(bus_dma_segment_t) * dmat->nsegments, M_BUSDMA, - M_NOWAIT); + dmat->segments = (bus_dma_segment_t *)malloc(dmat->nsegments, + sizeof(bus_dma_segment_t), M_BUSDMA, M_NOWAIT); if (dmat->segments == NULL) { CTR3(KTR_BUSDMA, "%s: tag %p error %d", __func__, dmat, ENOMEM); @@ -647,9 +647,8 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddrp, in else mflags = M_WAITOK; if (dmat->segments == NULL) { - dmat->segments = (bus_dma_segment_t *)malloc( - sizeof(bus_dma_segment_t) * dmat->nsegments, M_BUSDMA, - mflags); + dmat->segments = (bus_dma_segment_t *)malloc(dmat->nsegments, + sizeof(bus_dma_segment_t), M_BUSDMA, mflags); if (dmat->segments == NULL) { CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", __func__, dmat, dmat->flags, ENOMEM); Modified: head/sys/mips/nlm/dev/sec/nlmrsa.c ============================================================================== --- head/sys/mips/nlm/dev/sec/nlmrsa.c Mon Jan 15 21:11:38 2018 (r328019) +++ head/sys/mips/nlm/dev/sec/nlmrsa.c Mon Jan 15 21:13:30 2018 (r328020) @@ -346,7 +346,7 @@ xlp_rsa_newsession(device_t dev, u_int32_t *sidp, stru if (ses == NULL) { sesn = sc->sc_nsessions; - ses = malloc((sesn + 1) * sizeof(*ses), + ses = mallocarray(sesn + 1, sizeof(*ses), M_DEVBUF, M_NOWAIT); if (ses == NULL) return (ENOMEM); @@ -528,8 +528,9 @@ xlp_rsa_kprocess(device_t dev, struct cryptkop *krp, i goto errout; } cmd->rsafn = 0; /* Mod Exp */ - cmd->rsasrc = malloc( - cmd->rsaopsize * (krp->krp_iparams + krp->krp_oparams), + cmd->rsasrc = mallocarray( + krp->krp_iparams + krp->krp_oparams, + cmd->rsaopsize, M_DEVBUF, M_NOWAIT | M_ZERO); if (cmd->rsasrc == NULL) { From owner-svn-src-head@freebsd.org Mon Jan 15 21:14:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91C0DE773D6; Mon, 15 Jan 2018 21:14:57 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6961B6EA62; Mon, 15 Jan 2018 21:14: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B06116937; Mon, 15 Jan 2018 21:14:56 +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 w0FLEuig065877; Mon, 15 Jan 2018 21:14:56 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0FLEuKv065876; Mon, 15 Jan 2018 21:14:56 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201801152114.w0FLEuKv065876@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 15 Jan 2018 21:14:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328021 - head/sys/fs/nfsclient X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/fs/nfsclient X-SVN-Commit-Revision: 328021 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 21:14:57 -0000 Author: pfg Date: Mon Jan 15 21:14:56 2018 New Revision: 328021 URL: https://svnweb.freebsd.org/changeset/base/328021 Log: nfsclient: make some use of mallocarray(9). Focus on code where we are doing multiplications within malloc(9). None of these ire likely to overflow, however the change is still useful as some static checkers can benefit from the allocation attributes we use for mallocarray. This initial sweep only covers malloc(9) calls with M_NOWAIT. No good reason but I started doing the changes before r327796 and at that time it was convenient to make sure the sorrounding code could handle NULL values. X-Differential revision: https://reviews.freebsd.org/D13837 Modified: head/sys/fs/nfsclient/nfs_clvnops.c Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Mon Jan 15 21:13:30 2018 (r328020) +++ head/sys/fs/nfsclient/nfs_clvnops.c Mon Jan 15 21:14:56 2018 (r328021) @@ -2666,7 +2666,7 @@ ncl_flush(struct vnode *vp, int waitfor, struct thread #define NFS_COMMITBVECSIZ 20 #endif struct buf *bvec_on_stack[NFS_COMMITBVECSIZ]; - int bvecsize = 0, bveccount; + u_int bvecsize = 0, bveccount; if (called_from_renewthread != 0) slptimeo = hz; From owner-svn-src-head@freebsd.org Mon Jan 15 21:15:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE728E774A7; Mon, 15 Jan 2018 21:15:26 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 882C56EBDB; Mon, 15 Jan 2018 21:15:26 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A94D716939; Mon, 15 Jan 2018 21:15:25 +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 w0FLFPnb065951; Mon, 15 Jan 2018 21:15:25 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0FLFPLp065949; Mon, 15 Jan 2018 21:15:25 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201801152115.w0FLFPLp065949@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 15 Jan 2018 21:15:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328022 - in head/sys/cam: . ctl X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: in head/sys/cam: . ctl X-SVN-Commit-Revision: 328022 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 21:15:26 -0000 Author: pfg Date: Mon Jan 15 21:15:25 2018 New Revision: 328022 URL: https://svnweb.freebsd.org/changeset/base/328022 Log: cam: make some use of mallocarray(9). Focus on code where we are doing multiplications within malloc(9). None of these ire likely to overflow, however the change is still useful as some static checkers can benefit from the allocation attributes we use for mallocarray. This initial sweep only covers malloc(9) calls with M_NOWAIT. No good reason but I started doing the changes before r327796 and at that time it was convenient to make sure the sorrounding code could handle NULL values. X-Differential revision: https://reviews.freebsd.org/D13837 Modified: head/sys/cam/cam_queue.c head/sys/cam/ctl/ctl_frontend.c Modified: head/sys/cam/cam_queue.c ============================================================================== --- head/sys/cam/cam_queue.c Mon Jan 15 21:14:56 2018 (r328021) +++ head/sys/cam/cam_queue.c Mon Jan 15 21:15:25 2018 (r328022) @@ -126,7 +126,7 @@ camq_resize(struct camq *queue, int new_size) KASSERT(new_size >= queue->entries, ("camq_resize: " "New queue size can't accommodate queued entries (%d < %d).", new_size, queue->entries)); - new_array = (cam_pinfo **)malloc(new_size * sizeof(cam_pinfo *), + new_array = (cam_pinfo **)mallocarray(new_size, sizeof(cam_pinfo *), M_CAMQ, M_NOWAIT); if (new_array == NULL) { /* Couldn't satisfy request */ Modified: head/sys/cam/ctl/ctl_frontend.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend.c Mon Jan 15 21:14:56 2018 (r328021) +++ head/sys/cam/ctl/ctl_frontend.c Mon Jan 15 21:15:25 2018 (r328022) @@ -172,8 +172,8 @@ ctl_port_register(struct ctl_port *port) * Initialize the initiator and portname mappings */ port->max_initiators = CTL_MAX_INIT_PER_PORT; - port->wwpn_iid = malloc(sizeof(*port->wwpn_iid) * port->max_initiators, - M_CTL, M_NOWAIT | M_ZERO); + port->wwpn_iid = mallocarray(port->max_initiators, + sizeof(*port->wwpn_iid), M_CTL, M_NOWAIT | M_ZERO); if (port->wwpn_iid == NULL) { retval = ENOMEM; goto error; From owner-svn-src-head@freebsd.org Mon Jan 15 21:18:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA019E776BC; Mon, 15 Jan 2018 21:18:06 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C3366EE8E; Mon, 15 Jan 2018 21:18:06 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A9D491693F; Mon, 15 Jan 2018 21:18:05 +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 w0FLI59V066203; Mon, 15 Jan 2018 21:18:05 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0FLI4Bg066196; Mon, 15 Jan 2018 21:18:04 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201801152118.w0FLI4Bg066196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 15 Jan 2018 21:18:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328023 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 328023 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 21:18:06 -0000 Author: pfg Date: Mon Jan 15 21:18:04 2018 New Revision: 328023 URL: https://svnweb.freebsd.org/changeset/base/328023 Log: kern: make some use of mallocarray(9). Focus on code where we are doing multiplications within malloc(9). None of these ire likely to overflow, however the change is still useful as some static checkers can benefit from the allocation attributes we use for mallocarray. This initial sweep only covers malloc(9) calls with M_NOWAIT. No good reason but I started doing the changes before r327796 and at that time it was convenient to make sure the sorrounding code could handle NULL values. X-Differential revision: https://reviews.freebsd.org/D13837 Modified: head/sys/kern/init_main.c head/sys/kern/kern_cpu.c head/sys/kern/kern_ctf.c head/sys/kern/kern_pmc.c head/sys/kern/subr_bus.c head/sys/kern/subr_taskqueue.c head/sys/kern/subr_vmem.c Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Mon Jan 15 21:15:25 2018 (r328022) +++ head/sys/kern/init_main.c Mon Jan 15 21:18:04 2018 (r328023) @@ -159,7 +159,7 @@ sysinit_add(struct sysinit **set, struct sysinit **set count += newsysinit_end - newsysinit; else count += sysinit_end - sysinit; - newset = malloc(count * sizeof(*sipp), M_TEMP, M_NOWAIT); + newset = mallocarray(count, sizeof(*sipp), M_TEMP, M_NOWAIT); if (newset == NULL) panic("cannot malloc for sysinit"); xipp = newset; Modified: head/sys/kern/kern_cpu.c ============================================================================== --- head/sys/kern/kern_cpu.c Mon Jan 15 21:15:25 2018 (r328022) +++ head/sys/kern/kern_cpu.c Mon Jan 15 21:18:04 2018 (r328023) @@ -444,7 +444,7 @@ cf_get_method(device_t dev, struct cf_level *level) * match of settings against each level. */ count = CF_MAX_LEVELS; - levels = malloc(count * sizeof(*levels), M_TEMP, M_NOWAIT); + levels = mallocarray(count, sizeof(*levels), M_TEMP, M_NOWAIT); if (levels == NULL) return (ENOMEM); error = CPUFREQ_LEVELS(sc->dev, levels, &count); @@ -969,7 +969,7 @@ cpufreq_settings_sysctl(SYSCTL_HANDLER_ARGS) /* Get settings from the device and generate the output string. */ set_count = MAX_SETTINGS; - sets = malloc(set_count * sizeof(*sets), M_TEMP, M_NOWAIT); + sets = mallocarray(set_count, sizeof(*sets), M_TEMP, M_NOWAIT); if (sets == NULL) { sbuf_delete(&sb); return (ENOMEM); Modified: head/sys/kern/kern_ctf.c ============================================================================== --- head/sys/kern/kern_ctf.c Mon Jan 15 21:15:25 2018 (r328022) +++ head/sys/kern/kern_ctf.c Mon Jan 15 21:18:04 2018 (r328023) @@ -45,7 +45,7 @@ z_alloc(void *nil, u_int items, u_int size) { void *ptr; - ptr = malloc(items * size, M_TEMP, M_NOWAIT); + ptr = mallocarray(items, size, M_TEMP, M_NOWAIT); return ptr; } Modified: head/sys/kern/kern_pmc.c ============================================================================== --- head/sys/kern/kern_pmc.c Mon Jan 15 21:15:25 2018 (r328022) +++ head/sys/kern/kern_pmc.c Mon Jan 15 21:18:04 2018 (r328023) @@ -338,7 +338,8 @@ init_hwpmc(void *dummy __unused) "range.\n", pmc_softevents); pmc_softevents = PMC_EV_DYN_COUNT; } - pmc_softs = malloc(pmc_softevents * sizeof(struct pmc_soft *), M_PMCHOOKS, M_NOWAIT|M_ZERO); + pmc_softs = mallocarray(pmc_softevents, sizeof(struct pmc_soft *), + M_PMCHOOKS, M_NOWAIT|M_ZERO); KASSERT(pmc_softs != NULL, ("cannot allocate soft events table")); } Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Mon Jan 15 21:15:25 2018 (r328022) +++ head/sys/kern/subr_bus.c Mon Jan 15 21:18:04 2018 (r328023) @@ -1464,7 +1464,7 @@ devclass_get_devices(devclass_t dc, device_t **devlist device_t *list; count = devclass_get_count(dc); - list = malloc(count * sizeof(device_t), M_TEMP, M_NOWAIT|M_ZERO); + list = mallocarray(count, sizeof(device_t), M_TEMP, M_NOWAIT|M_ZERO); if (!list) return (ENOMEM); @@ -1680,7 +1680,7 @@ devclass_alloc_unit(devclass_t dc, device_t dev, int * oldlist = dc->devices; newsize = roundup((unit + 1), MINALLOCSIZE / sizeof(device_t)); - newlist = malloc(sizeof(device_t) * newsize, M_BUS, M_NOWAIT); + newlist = mallocarray(newsize, sizeof(device_t), M_BUS, M_NOWAIT); if (!newlist) return (ENOMEM); if (oldlist != NULL) @@ -2300,7 +2300,7 @@ device_get_children(device_t dev, device_t **devlistp, return (0); } - list = malloc(count * sizeof(device_t), M_TEMP, M_NOWAIT|M_ZERO); + list = mallocarray(count, sizeof(device_t), M_TEMP, M_NOWAIT|M_ZERO); if (!list) return (ENOMEM); Modified: head/sys/kern/subr_taskqueue.c ============================================================================== --- head/sys/kern/subr_taskqueue.c Mon Jan 15 21:15:25 2018 (r328022) +++ head/sys/kern/subr_taskqueue.c Mon Jan 15 21:18:04 2018 (r328023) @@ -651,8 +651,8 @@ _taskqueue_start_threads(struct taskqueue **tqp, int c vsnprintf(ktname, sizeof(ktname), name, ap); tq = *tqp; - tq->tq_threads = malloc(sizeof(struct thread *) * count, M_TASKQUEUE, - M_NOWAIT | M_ZERO); + tq->tq_threads = mallocarray(count, sizeof(struct thread *), + M_TASKQUEUE, M_NOWAIT | M_ZERO); if (tq->tq_threads == NULL) { printf("%s: no memory for %s threads\n", __func__, ktname); return (ENOMEM); Modified: head/sys/kern/subr_vmem.c ============================================================================== --- head/sys/kern/subr_vmem.c Mon Jan 15 21:15:25 2018 (r328022) +++ head/sys/kern/subr_vmem.c Mon Jan 15 21:18:04 2018 (r328023) @@ -692,7 +692,7 @@ vmem_rehash(vmem_t *vm, vmem_size_t newhashsize) MPASS(newhashsize > 0); - newhashlist = malloc(sizeof(struct vmem_hashlist) * newhashsize, + newhashlist = mallocarray(newhashsize, sizeof(struct vmem_hashlist), M_VMEM, M_NOWAIT); if (newhashlist == NULL) return ENOMEM; From owner-svn-src-head@freebsd.org Mon Jan 15 21:19:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C46BE777CA; Mon, 15 Jan 2018 21:19:23 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 763CE6F019; Mon, 15 Jan 2018 21:19:23 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8EFBF16940; Mon, 15 Jan 2018 21:19: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 w0FLJMFG066287; Mon, 15 Jan 2018 21:19:22 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0FLJM6Q066284; Mon, 15 Jan 2018 21:19:22 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201801152119.w0FLJM6Q066284@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 15 Jan 2018 21:19:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328024 - head/sys/netgraph X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/netgraph X-SVN-Commit-Revision: 328024 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 21:19:23 -0000 Author: pfg Date: Mon Jan 15 21:19:21 2018 New Revision: 328024 URL: https://svnweb.freebsd.org/changeset/base/328024 Log: netgraph: make some use of mallocarray(9). Focus on code where we are doing multiplications within malloc(9). None of these ire likely to overflow, however the change is still useful as some static checkers can benefit from the allocation attributes we use for mallocarray. This initial sweep only covers malloc(9) calls with M_NOWAIT. No good reason but I started doing the changes before r327796 and at that time it was convenient to make sure the sorrounding code could handle NULL values. X-Differential revision: https://reviews.freebsd.org/D13837 Modified: head/sys/netgraph/ng_bridge.c head/sys/netgraph/ng_deflate.c head/sys/netgraph/ng_parse.c Modified: head/sys/netgraph/ng_bridge.c ============================================================================== --- head/sys/netgraph/ng_bridge.c Mon Jan 15 21:18:04 2018 (r328023) +++ head/sys/netgraph/ng_bridge.c Mon Jan 15 21:19:21 2018 (r328024) @@ -907,7 +907,7 @@ ng_bridge_rehash(priv_p priv) newMask = newNumBuckets - 1; /* Allocate and initialize new table */ - newTab = malloc(newNumBuckets * sizeof(*newTab), + newTab = mallocarray(newNumBuckets, sizeof(*newTab), M_NETGRAPH_BRIDGE, M_NOWAIT | M_ZERO); if (newTab == NULL) return; Modified: head/sys/netgraph/ng_deflate.c ============================================================================== --- head/sys/netgraph/ng_deflate.c Mon Jan 15 21:18:04 2018 (r328023) +++ head/sys/netgraph/ng_deflate.c Mon Jan 15 21:19:21 2018 (r328024) @@ -427,7 +427,7 @@ static void * z_alloc(void *notused, u_int items, u_int size) { - return (malloc(items * size, M_NETGRAPH_DEFLATE, M_NOWAIT)); + return (mallocarray(items, size, M_NETGRAPH_DEFLATE, M_NOWAIT)); } static void Modified: head/sys/netgraph/ng_parse.c ============================================================================== --- head/sys/netgraph/ng_parse.c Mon Jan 15 21:18:04 2018 (r328023) +++ head/sys/netgraph/ng_parse.c Mon Jan 15 21:19:21 2018 (r328024) @@ -1207,7 +1207,8 @@ ng_parse_composite(const struct ng_parse_type *type, c int align, len, blen, error = 0; /* Initialize */ - foff = malloc(num * sizeof(*foff), M_NETGRAPH_PARSE, M_NOWAIT | M_ZERO); + foff = mallocarray(num, sizeof(*foff), M_NETGRAPH_PARSE, + M_NOWAIT | M_ZERO); if (foff == NULL) { error = ENOMEM; goto done; From owner-svn-src-head@freebsd.org Mon Jan 15 21:21:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE3A1E77A86; Mon, 15 Jan 2018 21:21:52 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8AAFF6F559; Mon, 15 Jan 2018 21:21: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D2DC216AAA; Mon, 15 Jan 2018 21:21: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 w0FLLpR9067124; Mon, 15 Jan 2018 21:21:51 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0FLLpmc067121; Mon, 15 Jan 2018 21:21:51 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201801152121.w0FLLpmc067121@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 15 Jan 2018 21:21:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328025 - in head/sys: net netinet6 X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: in head/sys: net netinet6 X-SVN-Commit-Revision: 328025 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 21:21:52 -0000 Author: pfg Date: Mon Jan 15 21:21:51 2018 New Revision: 328025 URL: https://svnweb.freebsd.org/changeset/base/328025 Log: net*: make some use of mallocarray(9). Focus on code where we are doing multiplications within malloc(9). None of these ire likely to overflow, however the change is still useful as some static checkers can benefit from the allocation attributes we use for mallocarray. This initial sweep only covers malloc(9) calls with M_NOWAIT. No good reason but I started doing the changes before r327796 and at that time it was convenient to make sure the sorrounding code could handle NULL values. X-Differential revision: https://reviews.freebsd.org/D13837 Modified: head/sys/net/if_vlan.c head/sys/net/iflib.c head/sys/netinet6/in6_jail.c Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Mon Jan 15 21:19:21 2018 (r328024) +++ head/sys/net/if_vlan.c Mon Jan 15 21:21:51 2018 (r328025) @@ -479,7 +479,7 @@ vlan_growhash(struct ifvlantrunk *trunk, int howmuch) return; /* M_NOWAIT because we're called with trunk mutex held */ - hash2 = malloc(sizeof(struct ifvlanhead) * n2, M_VLAN, M_NOWAIT); + hash2 = mallocarray(n2, sizeof(struct ifvlanhead), M_VLAN, M_NOWAIT); if (hash2 == NULL) { printf("%s: out of memory -- hash size not changed\n", __func__); Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Mon Jan 15 21:19:21 2018 (r328024) +++ head/sys/net/iflib.c Mon Jan 15 21:21:51 2018 (r328025) @@ -1550,15 +1550,15 @@ iflib_txsd_alloc(iflib_txq_t txq) goto fail; } if (!(txq->ift_sds.ifsd_flags = - (uint8_t *) malloc(sizeof(uint8_t) * - scctx->isc_ntxd[txq->ift_br_offset], M_IFLIB, M_NOWAIT | M_ZERO))) { + (uint8_t *) mallocarray(scctx->isc_ntxd[txq->ift_br_offset], + sizeof(uint8_t), M_IFLIB, M_NOWAIT | M_ZERO))) { device_printf(dev, "Unable to allocate tx_buffer memory\n"); err = ENOMEM; goto fail; } if (!(txq->ift_sds.ifsd_m = - (struct mbuf **) malloc(sizeof(struct mbuf *) * - scctx->isc_ntxd[txq->ift_br_offset], M_IFLIB, M_NOWAIT | M_ZERO))) { + (struct mbuf **) mallocarray(scctx->isc_ntxd[txq->ift_br_offset], + sizeof(struct mbuf *), M_IFLIB, M_NOWAIT | M_ZERO))) { device_printf(dev, "Unable to allocate tx_buffer memory\n"); err = ENOMEM; goto fail; @@ -1570,7 +1570,8 @@ iflib_txsd_alloc(iflib_txq_t txq) return (0); if (!(txq->ift_sds.ifsd_map = - (bus_dmamap_t *) malloc(sizeof(bus_dmamap_t) * scctx->isc_ntxd[txq->ift_br_offset], M_IFLIB, M_NOWAIT | M_ZERO))) { + (bus_dmamap_t *) mallocarray(scctx->isc_ntxd[txq->ift_br_offset], + sizeof(bus_dmamap_t), M_IFLIB, M_NOWAIT | M_ZERO))) { device_printf(dev, "Unable to allocate tx_buffer map memory\n"); err = ENOMEM; goto fail; @@ -1726,22 +1727,22 @@ iflib_rxsd_alloc(iflib_rxq_t rxq) goto fail; } if (!(fl->ifl_sds.ifsd_flags = - (uint8_t *) malloc(sizeof(uint8_t) * - scctx->isc_nrxd[rxq->ifr_fl_offset], M_IFLIB, M_NOWAIT | M_ZERO))) { + (uint8_t *) mallocarray(scctx->isc_nrxd[rxq->ifr_fl_offset], + sizeof(uint8_t), M_IFLIB, M_NOWAIT | M_ZERO))) { device_printf(dev, "Unable to allocate tx_buffer memory\n"); err = ENOMEM; goto fail; } if (!(fl->ifl_sds.ifsd_m = - (struct mbuf **) malloc(sizeof(struct mbuf *) * - scctx->isc_nrxd[rxq->ifr_fl_offset], M_IFLIB, M_NOWAIT | M_ZERO))) { + (struct mbuf **) mallocarray(scctx->isc_nrxd[rxq->ifr_fl_offset], + sizeof(struct mbuf *), M_IFLIB, M_NOWAIT | M_ZERO))) { device_printf(dev, "Unable to allocate tx_buffer memory\n"); err = ENOMEM; goto fail; } if (!(fl->ifl_sds.ifsd_cl = - (caddr_t *) malloc(sizeof(caddr_t) * - scctx->isc_nrxd[rxq->ifr_fl_offset], M_IFLIB, M_NOWAIT | M_ZERO))) { + (caddr_t *) mallocarray(scctx->isc_nrxd[rxq->ifr_fl_offset], + sizeof(caddr_t), M_IFLIB, M_NOWAIT | M_ZERO))) { device_printf(dev, "Unable to allocate tx_buffer memory\n"); err = ENOMEM; goto fail; @@ -1753,7 +1754,8 @@ iflib_rxsd_alloc(iflib_rxq_t rxq) continue; if (!(fl->ifl_sds.ifsd_map = - (bus_dmamap_t *) malloc(sizeof(bus_dmamap_t) * scctx->isc_nrxd[rxq->ifr_fl_offset], M_IFLIB, M_NOWAIT | M_ZERO))) { + (bus_dmamap_t *) mallocarray(scctx->isc_nrxd[rxq->ifr_fl_offset], + sizeof(bus_dmamap_t), M_IFLIB, M_NOWAIT | M_ZERO))) { device_printf(dev, "Unable to allocate tx_buffer map memory\n"); err = ENOMEM; goto fail; @@ -4745,8 +4747,8 @@ iflib_queues_alloc(if_ctx_t ctx) /* Allocate the TX ring struct memory */ if (!(txq = - (iflib_txq_t) malloc(sizeof(struct iflib_txq) * - ntxqsets, M_IFLIB, M_NOWAIT | M_ZERO))) { + (iflib_txq_t) mallocarray(ntxqsets, sizeof(struct iflib_txq), + M_IFLIB, M_NOWAIT | M_ZERO))) { device_printf(dev, "Unable to allocate TX ring memory\n"); err = ENOMEM; goto fail; @@ -4754,8 +4756,8 @@ iflib_queues_alloc(if_ctx_t ctx) /* Now allocate the RX */ if (!(rxq = - (iflib_rxq_t) malloc(sizeof(struct iflib_rxq) * - nrxqsets, M_IFLIB, M_NOWAIT | M_ZERO))) { + (iflib_rxq_t) mallocarray(nrxqsets, sizeof(struct iflib_rxq), + M_IFLIB, M_NOWAIT | M_ZERO))) { device_printf(dev, "Unable to allocate RX ring memory\n"); err = ENOMEM; goto rx_fail; @@ -4849,7 +4851,8 @@ iflib_queues_alloc(if_ctx_t ctx) } rxq->ifr_nfl = nfree_lists; if (!(fl = - (iflib_fl_t) malloc(sizeof(struct iflib_fl) * nfree_lists, M_IFLIB, M_NOWAIT | M_ZERO))) { + (iflib_fl_t) mallocarray(nfree_lists, sizeof(struct iflib_fl), + M_IFLIB, M_NOWAIT | M_ZERO))) { device_printf(dev, "Unable to allocate free list memory\n"); err = ENOMEM; goto err_tx_desc; Modified: head/sys/netinet6/in6_jail.c ============================================================================== --- head/sys/netinet6/in6_jail.c Mon Jan 15 21:19:21 2018 (r328024) +++ head/sys/netinet6/in6_jail.c Mon Jan 15 21:21:51 2018 (r328025) @@ -103,8 +103,8 @@ prison_restrict_ip6(struct prison *pr, struct in6_addr */ used = 1; if (newip6 == NULL) { - newip6 = malloc(ppr->pr_ip6s * sizeof(*newip6), - M_PRISON, M_NOWAIT); + newip6 = mallocarray(ppr->pr_ip6s, + sizeof(*newip6), M_PRISON, M_NOWAIT); if (newip6 != NULL) used = 0; } From owner-svn-src-head@freebsd.org Mon Jan 15 21:23:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38A6DE77D18; Mon, 15 Jan 2018 21:23:17 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 144436F739; Mon, 15 Jan 2018 21:23:17 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D54416AD4; Mon, 15 Jan 2018 21:23:16 +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 w0FLNGu0070171; Mon, 15 Jan 2018 21:23:16 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0FLNGPh070169; Mon, 15 Jan 2018 21:23:16 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201801152123.w0FLNGPh070169@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 15 Jan 2018 21:23:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328026 - in head/sys: geom/uzip gnu/dev/bwn/phy_n X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: in head/sys: geom/uzip gnu/dev/bwn/phy_n X-SVN-Commit-Revision: 328026 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 21:23:17 -0000 Author: pfg Date: Mon Jan 15 21:23:16 2018 New Revision: 328026 URL: https://svnweb.freebsd.org/changeset/base/328026 Log: misc geom and gnu: make some use of mallocarray(9). Focus on code where we are doing multiplications within malloc(9). None of these ire likely to overflow, however the change is still useful as some static checkers can benefit from the allocation attributes we use for mallocarray. This initial sweep only covers malloc(9) calls with M_NOWAIT. No good reason but I started doing the changes before r327796 and at that time it was convenient to make sure the sorrounding code could handle NULL values. Differential revision: https://reviews.freebsd.org/D13837 Modified: head/sys/geom/uzip/g_uzip_zlib.c head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.c Modified: head/sys/geom/uzip/g_uzip_zlib.c ============================================================================== --- head/sys/geom/uzip/g_uzip_zlib.c Mon Jan 15 21:21:51 2018 (r328025) +++ head/sys/geom/uzip/g_uzip_zlib.c Mon Jan 15 21:23:16 2018 (r328026) @@ -132,7 +132,7 @@ z_alloc(void *nil, u_int type, u_int size) { void *ptr; - ptr = malloc(type * size, M_GEOM_UZIP, M_NOWAIT); + ptr = mallocarray(type, size, M_GEOM_UZIP, M_NOWAIT); return (ptr); } Modified: head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.c ============================================================================== --- head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.c Mon Jan 15 21:21:51 2018 (r328025) +++ head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.c Mon Jan 15 21:23:16 2018 (r328026) @@ -1620,7 +1620,7 @@ static int bwn_nphy_load_samples(struct bwn_mac *mac, uint16_t i; uint32_t *data; - data = malloc(len * sizeof(uint32_t), M_DEVBUF, M_NOWAIT | M_ZERO); + data = mallocarray(len, sizeof(uint32_t), M_DEVBUF, M_NOWAIT | M_ZERO); if (!data) { BWN_ERRPRINTF(mac->mac_sc, "allocation for samples loading failed\n"); return -ENOMEM; @@ -1663,7 +1663,8 @@ static uint16_t bwn_nphy_gen_load_samples(struct bwn_m len = bw << 1; } - samples = malloc(len * sizeof(struct bwn_c32), M_DEVBUF, M_NOWAIT | M_ZERO); + samples = mallocarray(len, sizeof(struct bwn_c32), M_DEVBUF, + M_NOWAIT | M_ZERO); if (!samples) { BWN_ERRPRINTF(mac->mac_sc, "allocation for samples generation failed\n"); return 0; From owner-svn-src-head@freebsd.org Mon Jan 15 21:53:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75222E79788; Mon, 15 Jan 2018 21:53:34 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5049D70A37; Mon, 15 Jan 2018 21:53:34 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 918C416FB2; Mon, 15 Jan 2018 21:53:33 +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 w0FLrXTd083255; Mon, 15 Jan 2018 21:53:33 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0FLrXaY083254; Mon, 15 Jan 2018 21:53:33 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201801152153.w0FLrXaY083254@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 15 Jan 2018 21:53:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328027 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 328027 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 21:53:34 -0000 Author: kevans Date: Mon Jan 15 21:53:33 2018 New Revision: 328027 URL: https://svnweb.freebsd.org/changeset/base/328027 Log: wsp(4): Update to reflect new sysctl from r314467 r314467 introduced hw.usb.wsp.enable_single_tap_clicks to enable/disable single-tap left click behavior. Update the man page to reflect the new sysctl. PR: 196624 MFC after: 3 days X-MFC-With: r314467 Modified: head/share/man/man4/wsp.4 Modified: head/share/man/man4/wsp.4 ============================================================================== --- head/share/man/man4/wsp.4 Mon Jan 15 21:23:16 2018 (r328026) +++ head/share/man/man4/wsp.4 Mon Jan 15 21:53:33 2018 (r328027) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 7, 2014 +.Dd January 15, 2018 .Dt WSP 4 .Os .Sh NAME @@ -63,6 +63,9 @@ through nodes under .Nm hw.usb.wsp . Pointer sensitivity can be controlled using the sysctl tunable .Nm hw.usb.wsp.scale_factor . +Tap to left-click can be controlled using the sysctl tunable +.Nm hw.usb.wsp.enable_single_tap_clicks , +set to 0 to disable single tap clicks or 1 to enable them (default). .Sh FILES .Nm creates a blocking pseudo-device file, From owner-svn-src-head@freebsd.org Mon Jan 15 21:59:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 955D9E79BD8; Mon, 15 Jan 2018 21:59:21 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7006F70D79; Mon, 15 Jan 2018 21:59:21 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C4ED516FC3; Mon, 15 Jan 2018 21:59:20 +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 w0FLxKff083787; Mon, 15 Jan 2018 21:59:20 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0FLxKYG083786; Mon, 15 Jan 2018 21:59:20 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201801152159.w0FLxKYG083786@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 15 Jan 2018 21:59:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328028 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 328028 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 21:59:21 -0000 Author: tuexen Date: Mon Jan 15 21:59:20 2018 New Revision: 328028 URL: https://svnweb.freebsd.org/changeset/base/328028 Log: Don't provide a (meaningless) cmsg when proving a notification in a recvmsg() call. MFC after: 1 week Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Mon Jan 15 21:53:33 2018 (r328027) +++ head/sys/netinet/sctputil.c Mon Jan 15 21:59:20 2018 (r328028) @@ -47,7 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include /* for sctp_deliver_data() */ +#include #include #include #include @@ -6094,7 +6094,7 @@ sctp_m_free(struct mbuf *m) return (m_free(m)); } -void +void sctp_m_freem(struct mbuf *mb) { while (mb != NULL) @@ -6164,6 +6164,7 @@ sctp_soreceive(struct socket *so, struct sockaddr *from; struct sctp_extrcvinfo sinfo; int filling_sinfo = 1; + int flags; struct sctp_inpcb *inp; inp = (struct sctp_inpcb *)so->so_pcb; @@ -6191,15 +6192,24 @@ sctp_soreceive(struct socket *so, if (filling_sinfo) { memset(&sinfo, 0, sizeof(struct sctp_extrcvinfo)); } - error = sctp_sorecvmsg(so, uio, mp0, from, fromlen, flagsp, + if (flagsp != NULL) { + flags = *flagsp; + } else { + flags = 0; + } + error = sctp_sorecvmsg(so, uio, mp0, from, fromlen, &flags, (struct sctp_sndrcvinfo *)&sinfo, filling_sinfo); + if (flagsp != NULL) { + *flagsp = flags; + } if (controlp != NULL) { /* copy back the sinfo in a CMSG format */ - if (filling_sinfo) + if (filling_sinfo && ((flags & MSG_NOTIFICATION) == 0)) { *controlp = sctp_build_ctl_nchunk(inp, (struct sctp_sndrcvinfo *)&sinfo); - else + } else { *controlp = NULL; + } } if (psa) { /* copy back the address info */ From owner-svn-src-head@freebsd.org Mon Jan 15 22:17:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20049E7ABA0; Mon, 15 Jan 2018 22:17:17 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F0A4872073; Mon, 15 Jan 2018 22:17:16 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4595B17327; Mon, 15 Jan 2018 22:17:16 +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 w0FMHGht092943; Mon, 15 Jan 2018 22:17:16 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0FMHG2x092942; Mon, 15 Jan 2018 22:17:16 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201801152217.w0FMHG2x092942@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 15 Jan 2018 22:17:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328029 - head/stand/efi/libefi X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/libefi X-SVN-Commit-Revision: 328029 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 22:17:17 -0000 Author: imp Date: Mon Jan 15 22:17:15 2018 New Revision: 328029 URL: https://svnweb.freebsd.org/changeset/base/328029 Log: When returning an error and freeing allocated memory from ucs2_to_utf8 and utf8_to_ucs2, be sure to NULL out the return pointer too, rather than return a pointer to free memory. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D13917 Modified: head/stand/efi/libefi/efichar.c Modified: head/stand/efi/libefi/efichar.c ============================================================================== --- head/stand/efi/libefi/efichar.c Mon Jan 15 21:59:20 2018 (r328028) +++ head/stand/efi/libefi/efichar.c Mon Jan 15 22:17:15 2018 (r328029) @@ -116,8 +116,10 @@ ucs2_to_utf8(const efi_char *nm, char **name) if (len >= sz) { /* Absent bugs, we'll never return EOVERFLOW */ - if (freeit) + if (freeit) { free(*name); + *name = NULL; + } return (EOVERFLOW); } *cp++ = '\0'; @@ -150,11 +152,8 @@ utf8_to_ucs2(const char *name, efi_char **nmp, size_t */ if ((c & 0xc0) != 0x80) { /* Initial characters. */ - if (bytes != 0) { - if (freeit) - free(nm); - return (EILSEQ); - } + if (bytes != 0) + goto ilseq; if ((c & 0xf8) == 0xf0) { ucs4 = c & 0x07; bytes = 3; @@ -173,29 +172,31 @@ utf8_to_ucs2(const char *name, efi_char **nmp, size_t if (bytes > 0) { ucs4 = (ucs4 << 6) + (c & 0x3f); bytes--; - } else if (bytes == 0) { - if (freeit) - free(nm); - return (EILSEQ); - } + } else if (bytes == 0) + goto ilseq; } if (bytes == 0) { - if (ucs4 > 0xffff) { - if (freeit) - free(nm); - return (EILSEQ); - } + if (ucs4 > 0xffff) + goto ilseq; *nm++ = (efi_char)ucs4; sz -= 2; } } if (sz < 2) { - if (freeit) + if (freeit) { free(nm); + *nmp = NULL; + } return (EDOOFUS); } sz -= 2; *nm = 0; *len -= sz; return (0); +ilseq: + if (freeit) { + free(nm); + *nmp = NULL; + } + return (EILSEQ); } From owner-svn-src-head@freebsd.org Mon Jan 15 22:17:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 296F3E7ABF5; Mon, 15 Jan 2018 22:17:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 05C95721BB; Mon, 15 Jan 2018 22:17: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4E9501732C; Mon, 15 Jan 2018 22:17: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 w0FMHZGT093154; Mon, 15 Jan 2018 22:17:35 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0FMHZbl093153; Mon, 15 Jan 2018 22:17:35 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201801152217.w0FMHZbl093153@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 15 Jan 2018 22:17:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328030 - head/stand/efi/boot1 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/boot1 X-SVN-Commit-Revision: 328030 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 22:17:36 -0000 Author: imp Date: Mon Jan 15 22:17:34 2018 New Revision: 328030 URL: https://svnweb.freebsd.org/changeset/base/328030 Log: Check the return value from utf8_to_ucs2 instead of whether or not uv is NULL. That's more correct and doesn't depend on the error behavior of utf8_to_ucs2. In practice, we'll never see this though since we pass utf8_to_ucs2 a well formed string. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D13918 Modified: head/stand/efi/boot1/boot1.c Modified: head/stand/efi/boot1/boot1.c ============================================================================== --- head/stand/efi/boot1/boot1.c Mon Jan 15 22:17:15 2018 (r328029) +++ head/stand/efi/boot1/boot1.c Mon Jan 15 22:17:34 2018 (r328030) @@ -106,8 +106,7 @@ efi_setenv_freebsd_wcs(const char *varname, CHAR16 *va size_t len; EFI_STATUS rv; - utf8_to_ucs2(varname, &var, &len); - if (var == NULL) + if (utf8_to_ucs2(varname, &var, &len) != 0) return (EFI_OUT_OF_RESOURCES); rv = RS->SetVariable(var, &FreeBSDBootVarGUID, EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS, From owner-svn-src-head@freebsd.org Mon Jan 15 22:17:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAC3BE7AC4A; Mon, 15 Jan 2018 22:17:40 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 83278721E0; Mon, 15 Jan 2018 22:17: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA5531732D; Mon, 15 Jan 2018 22:17: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 w0FMHdrQ093224; Mon, 15 Jan 2018 22:17:39 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0FMHdr6093223; Mon, 15 Jan 2018 22:17:39 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201801152217.w0FMHdr6093223@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 15 Jan 2018 22:17:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328031 - head/stand/efi/boot1 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/boot1 X-SVN-Commit-Revision: 328031 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 22:17:40 -0000 Author: imp Date: Mon Jan 15 22:17:39 2018 New Revision: 328031 URL: https://svnweb.freebsd.org/changeset/base/328031 Log: Need to free uv after we're done using it. Reported by: andrew@ Sponsored by: Netflix Modified: head/stand/efi/boot1/boot1.c Modified: head/stand/efi/boot1/boot1.c ============================================================================== --- head/stand/efi/boot1/boot1.c Mon Jan 15 22:17:34 2018 (r328030) +++ head/stand/efi/boot1/boot1.c Mon Jan 15 22:17:39 2018 (r328031) @@ -96,6 +96,7 @@ efi_getenv(EFI_GUID *g, const char *v, void *data, siz rv = RS->GetVariable(uv, g, &attr, &dl, data); if (rv == EFI_SUCCESS) *len = dl; + free(uv); return (rv); } From owner-svn-src-head@freebsd.org Mon Jan 15 22:24:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50858E7B2FC; Mon, 15 Jan 2018 22:24:13 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 121B872B2D; Mon, 15 Jan 2018 22:24:13 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 37323174C7; Mon, 15 Jan 2018 22:24:12 +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 w0FMOBtN097498; Mon, 15 Jan 2018 22:24:11 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0FMOBFn097496; Mon, 15 Jan 2018 22:24:11 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201801152224.w0FMOBFn097496@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 15 Jan 2018 22:24:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328032 - head/usr.sbin/service X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.sbin/service X-SVN-Commit-Revision: 328032 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 22:24:13 -0000 Author: kevans Date: Mon Jan 15 22:24:11 2018 New Revision: 328032 URL: https://svnweb.freebsd.org/changeset/base/328032 Log: service(8): Add support for interfacing with services in jails Provide a -j option that can take a jail name or id. If -j is specified, check that the jail exists and proxy the service request through to service(8) in the jail. This allows for cleaner workflows when updating services in a jail, turning the following: pkg -j dns upgrade jexec dns service named restart into: pkg -j dns upgrade service -j dns named restart PR: 223325 Submitted by: David O'Rourke (with slight changes) MFC after: 2 weeks Modified: head/usr.sbin/service/service.8 head/usr.sbin/service/service.sh Modified: head/usr.sbin/service/service.8 ============================================================================== --- head/usr.sbin/service/service.8 Mon Jan 15 22:17:39 2018 (r328031) +++ head/usr.sbin/service/service.8 Mon Jan 15 22:24:11 2018 (r328032) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 11, 2012 +.Dd January 15, 2018 .Dt SERVICE 8 .Os .Sh NAME @@ -32,13 +32,17 @@ .Nd "control (start/stop/etc.) or list system services" .Sh SYNOPSIS .Nm +.Op Fl j Ao jail name or id Ac .Fl e .Nm +.Op Fl j Ao jail name or id Ac .Fl R .Nm +.Op Fl j Ao jail name or id Ac .Op Fl v .Fl l | r .Nm +.Op Fl j Ao jail name or id Ac .Op Fl v .Ar start|stop|etc. .Sh DESCRIPTION @@ -54,6 +58,8 @@ the scripts using various criteria. .Pp The options are as follows: .Bl -tag -width F1 +.It Fl j Ao jail name or id Ac +Perform the given actions under the named jail. .It Fl e List services that are enabled. The list of scripts to check is compiled using @@ -107,6 +113,7 @@ The following are examples of typical usage of the command: .Pp .Dl "service named status" +.Dl "service -j dns named status" .Dl "service -rv" .Pp The following programmable completion entry can be use in Modified: head/usr.sbin/service/service.sh ============================================================================== --- head/usr.sbin/service/service.sh Mon Jan 15 22:17:39 2018 (r328031) +++ head/usr.sbin/service/service.sh Mon Jan 15 22:24:11 2018 (r328032) @@ -34,12 +34,13 @@ load_rc_config 'XXX' usage () { echo '' echo 'Usage:' - echo "${0##*/} -e" - echo "${0##*/} -R" - echo "${0##*/} [-v] -l | -r" - echo "${0##*/} [-v] start|stop|etc." + echo "${0##*/} [-j ] -e" + echo "${0##*/} [-j ] -R" + echo "${0##*/} [-j ] [-v] -l | -r" + echo "${0##*/} [-j ] [-v] start|stop|etc." echo "${0##*/} -h" echo '' + echo "-j Perform actions within the named jail" echo '-e Show services that are enabled' echo "-R Stop and start enabled $local_startup services" echo "-l List all scripts in /etc/rc.d and $local_startup" @@ -48,7 +49,37 @@ usage () { echo '' } -while getopts 'ehlrRv' COMMAND_LINE_ARGUMENT ; do +accepted_argstr='jehlrRv' + +# Only deal with the -j option here. If found, JAIL is set and the opt and +# arg are shifted out. OPTIND is left untouched. We strip the -j option out +# here because we'll be proxying this invocation through to the jail via +# jls(8) instead of handling it ourselves. +while getopts ${accepted_argstr} COMMAND_LINE_ARGUMENT ; do + case "${COMMAND_LINE_ARGUMENT}" in + j) JAIL="$2" ; shift ; shift ;; + esac +done + +# If -j was provided, then we pass everthing along to the jexec command +# and execute `service` within the named JAIL. Provided that the jail +# actually exists, as checked by `jls`. +# We do this so that if the jail does exist, we can then return the exit +# code of `jexec` and it should be the exit code of whatever ran in the jail. +# There is a race condition here in that the jail might exist at `jls` time +# and be gone by `jexec` time, but it shouldn't be a big deal. +if [ -n "$JAIL" ]; then + /usr/sbin/jls -j "$JAIL" 2>/dev/null >/dev/null + if [ $? -ne 0 ]; then + echo "Jail '$JAIL' does not exist." + exit 1 + fi + + /usr/sbin/jexec -l "$JAIL" /usr/sbin/service $* + exit $? +fi + +while getopts ${accepted_argstr} COMMAND_LINE_ARGUMENT ; do case "${COMMAND_LINE_ARGUMENT}" in e) ENABLED=eopt ;; h) usage ; exit 0 ;; From owner-svn-src-head@freebsd.org Mon Jan 15 22:43:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0B0EE7C4FE; Mon, 15 Jan 2018 22:43:09 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (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 9CF6B738D9; Mon, 15 Jan 2018 22:43:09 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (astound-66-234-199-215.ca.astound.net [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id D56A610A8BE; Mon, 15 Jan 2018 17:43:07 -0500 (EST) From: John Baldwin To: Michael Tuexen Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r328014 - head/lib/libsysdecode Date: Mon, 15 Jan 2018 13:26:58 -0800 Message-ID: <2726377.TCltlbGOmi@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <201801152037.w0FKbBq2048410@repo.freebsd.org> References: <201801152037.w0FKbBq2048410@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 15 Jan 2018 17:43:07 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 22:43:09 -0000 On Monday, January 15, 2018 08:37:11 PM Michael Tuexen wrote: > Author: tuexen > Date: Mon Jan 15 20:37:11 2018 > New Revision: 328014 > URL: https://svnweb.freebsd.org/changeset/base/328014 > > Log: > Add support for decoding the nxt_flags, rcv_flags, and snd_flags of > SCTP level cmsgs. > > Modified: > head/lib/libsysdecode/Makefile > head/lib/libsysdecode/flags.c > head/lib/libsysdecode/sysdecode.h > head/lib/libsysdecode/sysdecode_mask.3 I think sysdecode_mask.3 needs a .Dd bump? (Changes look fine to me otherwise) -- John Baldwin From owner-svn-src-head@freebsd.org Mon Jan 15 22:43:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45AD2E7C502; Mon, 15 Jan 2018 22:43:10 +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 2519D738DA; Mon, 15 Jan 2018 22:43:10 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (astound-66-234-199-215.ca.astound.net [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 3E44E10A8C0; Mon, 15 Jan 2018 17:43:09 -0500 (EST) From: John Baldwin To: Michael Tuexen Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327919 - head/usr.bin/truss Date: Mon, 15 Jan 2018 11:08:12 -0800 Message-ID: <2969150.hLkFiRHMD4@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <201801131359.w0DDxZur067490@repo.freebsd.org> References: <201801131359.w0DDxZur067490@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 15 Jan 2018 17:43:09 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 22:43:10 -0000 On Saturday, January 13, 2018 01:59:35 PM Michael Tuexen wrote: > Author: tuexen > Date: Sat Jan 13 13:59:35 2018 > New Revision: 327919 > URL: https://svnweb.freebsd.org/changeset/base/327919 > > Log: > Add support for readv() and writev() to truss. > > Sponsored by: Netflix, Inc. > > Modified: > head/usr.bin/truss/syscall.h > head/usr.bin/truss/syscalls.c > > Modified: head/usr.bin/truss/syscalls.c > ============================================================================== > --- head/usr.bin/truss/syscalls.c Sat Jan 13 13:53:05 2018 (r327918) > +++ head/usr.bin/truss/syscalls.c Sat Jan 13 13:59:35 2018 (r327919) > @@ -386,6 +386,8 @@ static struct syscall decoded_syscalls[] = { > .args = { { Name, 0 }, { Quotactlcmd, 1 }, { Int, 2 }, { Ptr, 3 } } }, > { .name = "read", .ret_type = 1, .nargs = 3, > .args = { { Int, 0 }, { BinString | OUT, 1 }, { Sizet, 2 } } }, > + { .name = "readv", .ret_type = 1, .nargs = 3, > + .args = { { Int, 0 }, { Iovec, 1 }, { Int, 2 } } }, > { .name = "readlink", .ret_type = 1, .nargs = 3, > .args = { { Name, 0 }, { Readlinkres | OUT, 1 }, { Sizet, 2 } } }, Please keep the array of syscall names sorted. > { .name = "readlinkat", .ret_type = 1, .nargs = 4, -- John Baldwin From owner-svn-src-head@freebsd.org Mon Jan 15 23:12:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A836BE7DE8A; Mon, 15 Jan 2018 23:12:55 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 83F4274DD5; Mon, 15 Jan 2018 23:12:55 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C934A17D21; Mon, 15 Jan 2018 23:12:54 +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 w0FNCsqa018711; Mon, 15 Jan 2018 23:12:54 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0FNCsdh018710; Mon, 15 Jan 2018 23:12:54 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201801152312.w0FNCsdh018710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 15 Jan 2018 23:12:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328033 - head/lib/libsysdecode X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/lib/libsysdecode X-SVN-Commit-Revision: 328033 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 23:12:55 -0000 Author: tuexen Date: Mon Jan 15 23:12:54 2018 New Revision: 328033 URL: https://svnweb.freebsd.org/changeset/base/328033 Log: Bump date, which I missed in r328014. Thanks to jhb@ for reporting. Modified: head/lib/libsysdecode/sysdecode_mask.3 Modified: head/lib/libsysdecode/sysdecode_mask.3 ============================================================================== --- head/lib/libsysdecode/sysdecode_mask.3 Mon Jan 15 22:24:11 2018 (r328032) +++ head/lib/libsysdecode/sysdecode_mask.3 Mon Jan 15 23:12:54 2018 (r328033) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 24, 2017 +.Dd January 16, 2018 .Dt sysdecode_mask 3 .Os .Sh NAME From owner-svn-src-head@freebsd.org Mon Jan 15 23:17:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72A34E7E1CE; Mon, 15 Jan 2018 23:17:13 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D04B75106; Mon, 15 Jan 2018 23:17:13 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9564B17D28; Mon, 15 Jan 2018 23:17: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 w0FNHCKs019126; Mon, 15 Jan 2018 23:17:12 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0FNHCIv019125; Mon, 15 Jan 2018 23:17:12 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201801152317.w0FNHCIv019125@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 15 Jan 2018 23:17:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328034 - head/usr.bin/truss X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/usr.bin/truss X-SVN-Commit-Revision: 328034 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 23:17:13 -0000 Author: tuexen Date: Mon Jan 15 23:17:12 2018 New Revision: 328034 URL: https://svnweb.freebsd.org/changeset/base/328034 Log: Keep list sorted. Thanks to jhb@ to pointing out that I put it at the wrong place in r327919. Modified: head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Mon Jan 15 23:12:54 2018 (r328033) +++ head/usr.bin/truss/syscalls.c Mon Jan 15 23:17:12 2018 (r328034) @@ -387,13 +387,13 @@ static struct syscall decoded_syscalls[] = { .args = { { Name, 0 }, { Quotactlcmd, 1 }, { Int, 2 }, { Ptr, 3 } } }, { .name = "read", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { BinString | OUT, 1 }, { Sizet, 2 } } }, - { .name = "readv", .ret_type = 1, .nargs = 3, - .args = { { Int, 0 }, { Iovec | OUT, 1 }, { Int, 2 } } }, { .name = "readlink", .ret_type = 1, .nargs = 3, .args = { { Name, 0 }, { Readlinkres | OUT, 1 }, { Sizet, 2 } } }, { .name = "readlinkat", .ret_type = 1, .nargs = 4, .args = { { Atfd, 0 }, { Name, 1 }, { Readlinkres | OUT, 2 }, { Sizet, 3 } } }, + { .name = "readv", .ret_type = 1, .nargs = 3, + .args = { { Int, 0 }, { Iovec | OUT, 1 }, { Int, 2 } } }, { .name = "reboot", .ret_type = 1, .nargs = 1, .args = { { Reboothowto, 0 } } }, { .name = "recvfrom", .ret_type = 1, .nargs = 6, From owner-svn-src-head@freebsd.org Mon Jan 15 23:17:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EDCFFE7E25D; Mon, 15 Jan 2018 23:17:41 +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 B59467526A; Mon, 15 Jan 2018 23:17:41 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from [IPv6:2003:cd:6bec:5d00:a523:448b:90dc:dc17] (p200300CD6BEC5D00A523448B90DCDC17.dip0.t-ipconnect.de [IPv6:2003:cd:6bec:5d00:a523:448b:90dc:dc17]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id 931F3721BBD35; Tue, 16 Jan 2018 00:17:38 +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: r327919 - head/usr.bin/truss From: Michael Tuexen In-Reply-To: <2969150.hLkFiRHMD4@ralph.baldwin.cx> Date: Tue, 16 Jan 2018 00:17:36 +0100 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201801131359.w0DDxZur067490@repo.freebsd.org> <2969150.hLkFiRHMD4@ralph.baldwin.cx> To: John Baldwin 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-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 23:17:42 -0000 > On 15. Jan 2018, at 20:08, John Baldwin wrote: >=20 > On Saturday, January 13, 2018 01:59:35 PM Michael Tuexen wrote: >> Author: tuexen >> Date: Sat Jan 13 13:59:35 2018 >> New Revision: 327919 >> URL: https://svnweb.freebsd.org/changeset/base/327919 >>=20 >> Log: >> Add support for readv() and writev() to truss. >>=20 >> Sponsored by: Netflix, Inc. >>=20 >> Modified: >> head/usr.bin/truss/syscall.h >> head/usr.bin/truss/syscalls.c >>=20 >> Modified: head/usr.bin/truss/syscalls.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/usr.bin/truss/syscalls.c Sat Jan 13 13:53:05 2018 = (r327918) >> +++ head/usr.bin/truss/syscalls.c Sat Jan 13 13:59:35 2018 = (r327919) >> @@ -386,6 +386,8 @@ static struct syscall decoded_syscalls[] =3D { >> .args =3D { { Name, 0 }, { Quotactlcmd, 1 }, { Int, 2 }, { = Ptr, 3 } } }, >> { .name =3D "read", .ret_type =3D 1, .nargs =3D 3, >> .args =3D { { Int, 0 }, { BinString | OUT, 1 }, { Sizet, 2 } } = }, >> + { .name =3D "readv", .ret_type =3D 1, .nargs =3D 3, >> + .args =3D { { Int, 0 }, { Iovec, 1 }, { Int, 2 } } }, >> { .name =3D "readlink", .ret_type =3D 1, .nargs =3D 3, >> .args =3D { { Name, 0 }, { Readlinkres | OUT, 1 }, { Sizet, 2 = } } }, >=20 > Please keep the array of syscall names sorted. Fixed in r328034. Thanks for reporting. Best regards Michael >=20 >> { .name =3D "readlinkat", .ret_type =3D 1, .nargs =3D 4, >=20 > --=20 > John Baldwin From owner-svn-src-head@freebsd.org Mon Jan 15 23:20:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB7D6E7E5A9; Mon, 15 Jan 2018 23:20:52 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (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 CFB9D7558C; Mon, 15 Jan 2018 23:20:52 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from comporellon.tachypleus.net (cpe-75-82-218-62.socal.res.rr.com [75.82.218.62]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id w0FNKnS1030210 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Mon, 15 Jan 2018 15:20:50 -0800 Subject: Re: svn commit: r327950 - in head/sys/powerpc: aim include powerpc ps3 To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <20180114170502.GB1684@kib.kiev.ua> <184ba3ee-a9f7-01ed-bb02-1bcba9acc041@freebsd.org> <20180114175211.GD1684@kib.kiev.ua> <20180115111812.GF1684@kib.kiev.ua> <20180115170603.GJ1684@kib.kiev.ua> <9e5554d7-6a0c-5910-8cb6-74f98259536f@freebsd.org> <20180115175335.GK1684@kib.kiev.ua> From: Nathan Whitehorn Message-ID: Date: Mon, 15 Jan 2018 15:20:49 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20180115175335.GK1684@kib.kiev.ua> Content-Type: multipart/mixed; boundary="------------082F835BD7FFED1A7DEBEEC2" Content-Language: en-US X-Sonic-CAuth: UmFuZG9tSVZ2XDhfZOW57AwbdeVJ4Ob7jjoKR4PNjDvy39XtKYrGz1a4lFzRsEFUu6AVQkywc6ZOgHOnfqXV0AfqQcKsmMCwttkiZXu1rRI= X-Sonic-ID: C;TDP9uEr65xGsu+BQ9eIpJw== M;0npNuUr65xGsu+BQ9eIpJw== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 23:20:53 -0000 This is a multi-part message in MIME format. --------------082F835BD7FFED1A7DEBEEC2 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 01/15/18 09:53, Konstantin Belousov wrote: > On Mon, Jan 15, 2018 at 09:32:56AM -0800, Nathan Whitehorn wrote: >> That seems fine to me. I don't think a less-clumsy way that does not >> involve extra indirection is possible. The PHYS_TO_DMAP() returning NULL >> is about the best thing I can come up with from a clumsiness standpoint >> since plenty of code checks for null pointers already, but doesn't >> cleanly handle the rarer case where you want to test for the existence >> of direct maps in general without testing some potemkin address. >> >> My one reservation about PMAP_HAS_DMAP or the like as a selector is that >> it does not encode the full shape of the problem: one could imagine >> having a direct map that only covers a limited range of RAM (I am not >> sure whether the existence of dmaplimit on amd64 implies this can happen >> with non-device memory in real life), for example. These cases are >> currently covered by an assert() in PHYS_TO_DMAP(), whereas having >> PHYS_TO_DMAP() return NULL allows a more flexible signalling and the >> potential for the calling code to do something reasonable to handle the >> error. A single global flag can't convey information at this kind of >> granularity. Is this a reasonable concern? Or am I overthinking things? > IMO it is overreaction. amd64 assumes that all normal memory is covered > by DMAP. It must never fail. See, for instance, the implementation > of the sf bufs for it. > > If device memory not covered by DMAP can exists, it is the driver problem. > For instance, for NVDIMMs I wrote specific mapping code which establishes > kernel mapping for it, when not covered by EFI memory map and correspondingly > not included into DMAP. > Fair enough. Here's a patch with a new flag (DIRECT_MAP_AVAILABLE). I've also retooled the sfbuf code to use this rather than its own flags that mean the same things. The sparc64 part of the patch is untested. -Nathan --------------082F835BD7FFED1A7DEBEEC2 Content-Type: text/x-patch; name="dmap_api.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="dmap_api.diff" Index: amd64/include/vmparam.h =================================================================== --- amd64/include/vmparam.h (revision 328006) +++ amd64/include/vmparam.h (working copy) @@ -190,6 +190,7 @@ * because the result is not actually accessed until later, but the early * vt fb startup needs to be reworked. */ +#define DIRECT_MAP_AVAILABLE 1 #define PHYS_TO_DMAP(x) ({ \ KASSERT(dmaplimit == 0 || (x) < dmaplimit, \ ("physical address %#jx not covered by the DMAP", \ Index: arm64/include/vmparam.h =================================================================== --- arm64/include/vmparam.h (revision 328006) +++ arm64/include/vmparam.h (working copy) @@ -176,6 +176,7 @@ #define VIRT_IN_DMAP(va) ((va) >= DMAP_MIN_ADDRESS && \ (va) < (dmap_max_addr)) +#define DIRECT_MAP_AVAILABLE #define PHYS_TO_DMAP(pa) \ ({ \ KASSERT(PHYS_IN_DMAP(pa), \ Index: dev/efidev/efirt.c =================================================================== --- dev/efidev/efirt.c (revision 328006) +++ dev/efidev/efirt.c (working copy) @@ -115,6 +115,11 @@ return (0); } efi_systbl = (struct efi_systbl *)PHYS_TO_DMAP(efi_systbl_phys); + if (efi_systbl == NULL) { + if (bootverbose) + printf("EFI systbl not mapped in kernel VA\n"); + return (0); + } if (efi_systbl->st_hdr.th_sig != EFI_SYSTBL_SIG) { efi_systbl = NULL; if (bootverbose) Index: kern/subr_sfbuf.c =================================================================== --- kern/subr_sfbuf.c (revision 328006) +++ kern/subr_sfbuf.c (working copy) @@ -88,8 +88,8 @@ vm_offset_t sf_base; int i; -#ifdef SFBUF_OPTIONAL_DIRECT_MAP - if (SFBUF_OPTIONAL_DIRECT_MAP) +#ifdef DIRECT_MAP_AVAILABLE + if (DIRECT_MAP_AVAILABLE) return; #endif @@ -119,8 +119,8 @@ struct sf_buf *sf; int error; -#ifdef SFBUF_OPTIONAL_DIRECT_MAP - if (SFBUF_OPTIONAL_DIRECT_MAP) +#ifdef DIRECT_MAP_AVAILABLE + if (DIRECT_MAP_AVAILABLE) return ((struct sf_buf *)m); #endif @@ -181,8 +181,8 @@ sf_buf_free(struct sf_buf *sf) { -#ifdef SFBUF_OPTIONAL_DIRECT_MAP - if (SFBUF_OPTIONAL_DIRECT_MAP) +#ifdef DIRECT_MAP_AVAILABLE + if (DIRECT_MAP_AVAILABLE) return; #endif @@ -205,8 +205,8 @@ sf_buf_ref(struct sf_buf *sf) { -#ifdef SFBUF_OPTIONAL_DIRECT_MAP - if (SFBUF_OPTIONAL_DIRECT_MAP) +#ifdef DIRECT_MAP_AVAILABLE + if (DIRECT_MAP_AVAILABLE) return; #endif Index: powerpc/include/vmparam.h =================================================================== --- powerpc/include/vmparam.h (revision 328006) +++ powerpc/include/vmparam.h (working copy) @@ -37,6 +37,10 @@ #ifndef _MACHINE_VMPARAM_H_ #define _MACHINE_VMPARAM_H_ +#ifndef LOCORE +#include +#endif + #define USRSTACK SHAREDPAGE #ifndef MAXTSIZ @@ -236,17 +240,21 @@ */ #define SFBUF #define SFBUF_NOMD -#define SFBUF_OPTIONAL_DIRECT_MAP hw_direct_map -#define SFBUF_PHYS_DMAP(x) (x) /* - * We (usually) have a direct map of all physical memory. All - * uses of this macro must be gated by a check on hw_direct_map! - * The location of the direct map may not be 1:1 in future, so use - * of the macro is recommended; it may also grow an assert that hw_direct_map - * is set. + * We (usually) have a direct map of all physical memory, so provide + * a macro to use to get the kernel VA address for a given PA. Returns + * 0 if the direct map is unavailable. The location of the direct map + * may not be 1:1 in future, so use of the macro is recommended. */ -#define PHYS_TO_DMAP(x) x -#define DMAP_TO_PHYS(x) x - +#ifdef __powerpc64__ +#define DMAP_ADDRESS 0x0000000000000000UL +#else +#define DMAP_ADDRESS 0x00000000UL +#endif + +#define DIRECT_MAP_AVAILABLE (hw_direct_map) +#define PHYS_TO_DMAP(x) (hw_direct_map ? (x | DMAP_ADDRESS) : 0) +#define DMAP_TO_PHYS(x) (hw_direct_map ? (x & ~DMAP_ADDRESS) : 0) + #endif /* _MACHINE_VMPARAM_H_ */ Index: sparc64/include/vmparam.h =================================================================== --- sparc64/include/vmparam.h (revision 328006) +++ sparc64/include/vmparam.h (working copy) @@ -240,10 +240,12 @@ */ #define ZERO_REGION_SIZE PAGE_SIZE +#include + #define SFBUF #define SFBUF_MAP -#define SFBUF_OPTIONAL_DIRECT_MAP dcache_color_ignore -#include -#define SFBUF_PHYS_DMAP(x) TLB_PHYS_TO_DIRECT(x) +#define DIRECT_MAP_AVAILABLE dcache_color_ignore +#define PHYS_TO_DMAP(x) (DIRECT_MAP_AVAILABLE ? (TLB_PHYS_TO_DIRECT(x) : 0) + #endif /* !_MACHINE_VMPARAM_H_ */ Index: sys/sf_buf.h =================================================================== --- sys/sf_buf.h (revision 328006) +++ sys/sf_buf.h (working copy) @@ -77,9 +77,6 @@ * that do no invalidate cache on the rest of CPUs. * SFBUF_NOMD This machine doesn't have machine/sf_buf.h * - * SFBUF_OPTIONAL_DIRECT_MAP Value of this define is used as boolean - * variable that tells whether machine is - * capable of direct map or not at runtime. * SFBUF_MAP This machine provides its own sf_buf_map() and * sf_buf_unmap(). * SFBUF_PROCESS_PAGE This machine provides sf_buf_process_page() @@ -109,9 +106,6 @@ #ifndef SFBUF_NOMD #include #endif -#ifdef SFBUF_OPTIONAL_DIRECT_MAP -#include -#endif #ifdef SFBUF struct sf_buf *sf_buf_alloc(struct vm_page *, int); @@ -121,9 +115,9 @@ static inline vm_offset_t sf_buf_kva(struct sf_buf *sf) { -#ifdef SFBUF_OPTIONAL_DIRECT_MAP - if (SFBUF_OPTIONAL_DIRECT_MAP) - return (SFBUF_PHYS_DMAP(VM_PAGE_TO_PHYS((vm_page_t)sf))); +#ifdef DIRECT_MAP_AVAILABLE + if (DIRECT_MAP_AVAILABLE) + return (PHYS_TO_DMAP(VM_PAGE_TO_PHYS((vm_page_t)sf))); #endif return (sf->kva); @@ -132,8 +126,8 @@ static inline vm_page_t sf_buf_page(struct sf_buf *sf) { -#ifdef SFBUF_OPTIONAL_DIRECT_MAP - if (SFBUF_OPTIONAL_DIRECT_MAP) +#ifdef DIRECT_MAP_AVAILABLE + if (DIRECT_MAP_AVAILABLE) return ((vm_page_t)sf); #endif Index: vm/vm_page.c =================================================================== --- vm/vm_page.c (revision 328006) +++ vm/vm_page.c (working copy) @@ -2937,7 +2937,8 @@ { #if defined(DIAGNOSTIC) && defined(PHYS_TO_DMAP) - if ((m->flags & PG_ZERO) != 0) { + if ((m->flags & PG_ZERO) != 0 && + PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)) != 0) { uint64_t *p; int i; p = (uint64_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)); --------------082F835BD7FFED1A7DEBEEC2-- From owner-svn-src-head@freebsd.org Mon Jan 15 23:42:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9E55E7F5AC; Mon, 15 Jan 2018 23:42:31 +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 804DE763FA; Mon, 15 Jan 2018 23:42:31 +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 w0FNgJgb058058 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 16 Jan 2018 01:42:22 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w0FNgJgb058058 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w0FNgICL058057; Tue, 16 Jan 2018 01:42:18 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 16 Jan 2018 01:42:18 +0200 From: Konstantin Belousov To: Nathan Whitehorn Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327950 - in head/sys/powerpc: aim include powerpc ps3 Message-ID: <20180115234218.GN1684@kib.kiev.ua> References: <20180114175211.GD1684@kib.kiev.ua> <20180115111812.GF1684@kib.kiev.ua> <20180115170603.GJ1684@kib.kiev.ua> <9e5554d7-6a0c-5910-8cb6-74f98259536f@freebsd.org> <20180115175335.GK1684@kib.kiev.ua> 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-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 23:42:32 -0000 On Mon, Jan 15, 2018 at 03:20:49PM -0800, Nathan Whitehorn wrote: > Fair enough. Here's a patch with a new flag (DIRECT_MAP_AVAILABLE). I've > also retooled the sfbuf code to use this rather than its own flags that > mean the same things. The sparc64 part of the patch is untested. > -Nathan > Index: amd64/include/vmparam.h > =================================================================== > --- amd64/include/vmparam.h (revision 328006) > +++ amd64/include/vmparam.h (working copy) > @@ -190,6 +190,7 @@ > * because the result is not actually accessed until later, but the early > * vt fb startup needs to be reworked. > */ > +#define DIRECT_MAP_AVAILABLE 1 > #define PHYS_TO_DMAP(x) ({ \ > KASSERT(dmaplimit == 0 || (x) < dmaplimit, \ > ("physical address %#jx not covered by the DMAP", \ > Index: arm64/include/vmparam.h > =================================================================== > --- arm64/include/vmparam.h (revision 328006) > +++ arm64/include/vmparam.h (working copy) > @@ -176,6 +176,7 @@ > #define VIRT_IN_DMAP(va) ((va) >= DMAP_MIN_ADDRESS && \ > (va) < (dmap_max_addr)) > > +#define DIRECT_MAP_AVAILABLE Just define, or define it to 1 ? > #define PHYS_TO_DMAP(pa) \ > ({ \ > KASSERT(PHYS_IN_DMAP(pa), \ > Index: dev/efidev/efirt.c > =================================================================== > --- dev/efidev/efirt.c (revision 328006) > +++ dev/efidev/efirt.c (working copy) > @@ -115,6 +115,11 @@ > return (0); > } > efi_systbl = (struct efi_systbl *)PHYS_TO_DMAP(efi_systbl_phys); > + if (efi_systbl == NULL) { > + if (bootverbose) > + printf("EFI systbl not mapped in kernel VA\n"); > + return (0); > + } Is this chunk still needed ? > if (efi_systbl->st_hdr.th_sig != EFI_SYSTBL_SIG) { > efi_systbl = NULL; > if (bootverbose) > Index: kern/subr_sfbuf.c > =================================================================== > --- kern/subr_sfbuf.c (revision 328006) > +++ kern/subr_sfbuf.c (working copy) > @@ -88,8 +88,8 @@ > vm_offset_t sf_base; > int i; > > -#ifdef SFBUF_OPTIONAL_DIRECT_MAP > - if (SFBUF_OPTIONAL_DIRECT_MAP) > +#ifdef DIRECT_MAP_AVAILABLE > + if (DIRECT_MAP_AVAILABLE) > return; Would it make sense to define the symbol on all other arches as 0 then, and remove #ifdef ? Returning to your initial proposal of relying on the compiler optimiing if (0) block; out. Also, just curious, why did you spelled DMAP as DIRECT_MAP ? From owner-svn-src-head@freebsd.org Tue Jan 16 00:47:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A66C5EB2340; Tue, 16 Jan 2018 00:47:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 82D7078A61; Tue, 16 Jan 2018 00:47:54 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CB5A218BD9; Tue, 16 Jan 2018 00:47:53 +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 w0G0lroW057353; Tue, 16 Jan 2018 00:47:53 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0G0lrKA057352; Tue, 16 Jan 2018 00:47:53 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201801160047.w0G0lrKA057352@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 16 Jan 2018 00:47:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328035 - head/usr.sbin/newsyslog X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/usr.sbin/newsyslog X-SVN-Commit-Revision: 328035 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jan 2018 00:47:54 -0000 Author: jhb Date: Tue Jan 16 00:47:53 2018 New Revision: 328035 URL: https://svnweb.freebsd.org/changeset/base/328035 Log: Sort the list of flags in newsyslog.conf entries. Move the 'X' and 'Y' entries into their sorted location in the list of flags just above 'Z'. Reviewed by: bcr MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D13904 Modified: head/usr.sbin/newsyslog/newsyslog.conf.5 Modified: head/usr.sbin/newsyslog/newsyslog.conf.5 ============================================================================== --- head/usr.sbin/newsyslog/newsyslog.conf.5 Mon Jan 15 23:17:12 2018 (r328034) +++ head/usr.sbin/newsyslog/newsyslog.conf.5 Tue Jan 16 00:47:53 2018 (r328035) @@ -21,7 +21,7 @@ .\" the suitability of this software for any purpose. It is .\" provided "as is" without express or implied warranty. .\" -.Dd Dec 31, 2017 +.Dd January 15, 2018 .Dt NEWSYSLOG.CONF 5 .Os .Sh NAME @@ -297,18 +297,6 @@ indicates that should attempt to save disk space by compressing the rotated log file using .Xr bzip2 1 . -.It Cm X -indicates that -.Xr newsyslog 8 -should attempt to save disk space by compressing the rotated -log file using -.Xr xz 1 . -.It Cm Y -indicates that -.Xr newsyslog 8 -should attempt to save disk space by compressing the rotated -log file using -.Xr zstd 1 . .It Cm N indicates that there is no process which needs to be signaled when this log file is rotated. @@ -332,6 +320,18 @@ indicates that the file specified by will contain the ID for a process group instead of a process. This option also requires that the first line in that file be a negative value to distinguish it from a process ID. +.It Cm X +indicates that +.Xr newsyslog 8 +should attempt to save disk space by compressing the rotated +log file using +.Xr xz 1 . +.It Cm Y +indicates that +.Xr newsyslog 8 +should attempt to save disk space by compressing the rotated +log file using +.Xr zstd 1 . .It Cm Z indicates that .Xr newsyslog 8 From owner-svn-src-head@freebsd.org Tue Jan 16 01:05:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B321EB36EE; Tue, 16 Jan 2018 01:05:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D997E799CE; Tue, 16 Jan 2018 01:05:05 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F0D4018F2A; Tue, 16 Jan 2018 01:05:04 +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 w0G1542X066317; Tue, 16 Jan 2018 01:05:04 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0G154P1066316; Tue, 16 Jan 2018 01:05:04 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201801160105.w0G154P1066316@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 16 Jan 2018 01:05:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328036 - head X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 328036 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jan 2018 01:05:06 -0000 Author: jhb Date: Tue Jan 16 01:05:04 2018 New Revision: 328036 URL: https://svnweb.freebsd.org/changeset/base/328036 Log: Check for GCC first rather than clang in the MIPS lib32 rules. This works around a bug with X_COMPILER_TYPE and permits mips64 to build again with in-tree gcc as well as clang and external gcc. Sponsored by: DARPA / AFRL Modified: head/Makefile.libcompat Modified: head/Makefile.libcompat ============================================================================== --- head/Makefile.libcompat Tue Jan 16 00:47:53 2018 (r328035) +++ head/Makefile.libcompat Tue Jan 16 01:05:04 2018 (r328036) @@ -35,18 +35,18 @@ LIB32WMAKEFLAGS= \ OBJCOPY="${XOBJCOPY}" .elif ${TARGET_ARCH:Mmips64*} != "" -.if ${WANT_COMPILER_TYPE} == clang || \ - (defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == clang) -.if ${TARGET_ARCH:Mmips64el*} != "" -LIB32CPUFLAGS= -target mipsel-unknown-freebsd12.0 -.else -LIB32CPUFLAGS= -target mips-unknown-freebsd12.0 -.endif -.else +.if ${WANT_COMPILER_TYPE} == gcc || \ + (defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc) .if empty(TARGET_CPUTYPE) LIB32CPUFLAGS= -march=mips3 .else LIB32CPUFLAGS= -march=${TARGET_CPUTYPE} +.endif +.else +.if ${TARGET_ARCH:Mmips64el*} != "" +LIB32CPUFLAGS= -target mipsel-unknown-freebsd12.0 +.else +LIB32CPUFLAGS= -target mips-unknown-freebsd12.0 .endif .endif LIB32CPUFLAGS+= -mabi=32 From owner-svn-src-head@freebsd.org Tue Jan 16 01:21:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35502EB522C; Tue, 16 Jan 2018 01:21:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E5F97AAAF; Tue, 16 Jan 2018 01:21:09 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4211A19298; Tue, 16 Jan 2018 01:21:08 +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 w0G1L8TB070628; Tue, 16 Jan 2018 01:21:08 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0G1L81G070627; Tue, 16 Jan 2018 01:21:08 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201801160121.w0G1L81G070627@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 16 Jan 2018 01:21:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328037 - head/usr.bin/truss X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/usr.bin/truss X-SVN-Commit-Revision: 328037 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jan 2018 01:21:09 -0000 Author: jhb Date: Tue Jan 16 01:21:07 2018 New Revision: 328037 URL: https://svnweb.freebsd.org/changeset/base/328037 Log: Rename 'recv' to 'receive' to appease shadow warnings from GCC. Modified: head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Tue Jan 16 01:05:04 2018 (r328036) +++ head/usr.bin/truss/syscalls.c Tue Jan 16 01:21:07 2018 (r328037) @@ -1308,20 +1308,20 @@ print_sctp_initmsg(FILE *fp, struct sctp_initmsg *init } static void -print_sctp_sndrcvinfo(FILE *fp, bool recv, struct sctp_sndrcvinfo *info) +print_sctp_sndrcvinfo(FILE *fp, bool receive, struct sctp_sndrcvinfo *info) { fprintf(fp, "{sid=%u,", info->sinfo_stream); - if (recv) { + if (receive) { fprintf(fp, "ssn=%u,", info->sinfo_ssn); } fputs("flgs=", fp); sysdecode_sctp_sinfo_flags(fp, info->sinfo_flags); fprintf(fp, ",ppid=%u,", ntohl(info->sinfo_ppid)); - if (!recv) { + if (!receive) { fprintf(fp, "ctx=%u,", info->sinfo_context); fprintf(fp, "ttl=%u,", info->sinfo_timetolive); } - if (recv) { + if (receive) { fprintf(fp, "tsn=%u,", info->sinfo_tsn); fprintf(fp, "cumtsn=%u,", info->sinfo_cumtsn); } @@ -1405,7 +1405,7 @@ print_sctp_ipv6_addr(FILE *fp, struct in6_addr *addr) } static void -print_sctp_cmsg(FILE *fp, bool recv, struct cmsghdr *cmsghdr) +print_sctp_cmsg(FILE *fp, bool receive, struct cmsghdr *cmsghdr) { void *data; socklen_t len; @@ -1421,7 +1421,7 @@ print_sctp_cmsg(FILE *fp, bool recv, struct cmsghdr *c break; case SCTP_SNDRCV: if (len == CMSG_LEN(sizeof(struct sctp_sndrcvinfo))) - print_sctp_sndrcvinfo(fp, recv, + print_sctp_sndrcvinfo(fp, receive, (struct sctp_sndrcvinfo *)data); else print_gen_cmsg(fp, cmsghdr); @@ -1483,7 +1483,7 @@ print_sctp_cmsg(FILE *fp, bool recv, struct cmsghdr *c } static void -print_cmsgs(FILE *fp, pid_t pid, bool recv, struct msghdr *msghdr) +print_cmsgs(FILE *fp, pid_t pid, bool receive, struct msghdr *msghdr) { struct cmsghdr *cmsghdr; char *cmsgbuf; @@ -1519,7 +1519,7 @@ print_cmsgs(FILE *fp, pid_t pid, bool recv, struct msg fputs(",data=", fp); switch (level) { case IPPROTO_SCTP: - print_sctp_cmsg(fp, recv, cmsghdr); + print_sctp_cmsg(fp, receive, cmsghdr); break; default: print_gen_cmsg(fp, cmsghdr); From owner-svn-src-head@freebsd.org Tue Jan 16 03:02:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45D59EBE3CB; Tue, 16 Jan 2018 03:02:42 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 200CC80432; Tue, 16 Jan 2018 03:02:42 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 68BA51A6F5; Tue, 16 Jan 2018 03:02:41 +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 w0G32fvk016740; Tue, 16 Jan 2018 03:02:41 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0G32ffX016739; Tue, 16 Jan 2018 03:02:41 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201801160302.w0G32ffX016739@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 16 Jan 2018 03:02:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328039 - head/sys/x86/isa X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/x86/isa X-SVN-Commit-Revision: 328039 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jan 2018 03:02:42 -0000 Author: ian Date: Tue Jan 16 03:02:41 2018 New Revision: 328039 URL: https://svnweb.freebsd.org/changeset/base/328039 Log: Add static inline rtcin_locked() and rtcout_locked() functions for doing a related series of operations without doing a lock/unlock for each byte. Use them when reading and writing the entire set of time registers. The original rtcin() and writertc() functions which do lock/unlock on each byte still exist, because they are public and called by outside code. Modified: head/sys/x86/isa/atrtc.c Modified: head/sys/x86/isa/atrtc.c ============================================================================== --- head/sys/x86/isa/atrtc.c Tue Jan 16 02:56:27 2018 (r328038) +++ head/sys/x86/isa/atrtc.c Tue Jan 16 03:02:41 2018 (r328039) @@ -76,28 +76,23 @@ static u_char rtc_statusb = RTCSB_24HR; * RTC support routines */ -int -rtcin(int reg) +static inline u_char +rtcin_locked(int reg) { - u_char val; - RTC_LOCK; if (rtc_reg != reg) { inb(0x84); outb(IO_RTC, reg); rtc_reg = reg; inb(0x84); } - val = inb(IO_RTC + 1); - RTC_UNLOCK; - return (val); + return (inb(IO_RTC + 1)); } -void -writertc(int reg, u_char val) +static inline void +rtcout_locked(int reg, u_char val) { - RTC_LOCK; if (rtc_reg != reg) { inb(0x84); outb(IO_RTC, reg); @@ -106,9 +101,28 @@ writertc(int reg, u_char val) } outb(IO_RTC + 1, val); inb(0x84); +} + +int +rtcin(int reg) +{ + u_char val; + + RTC_LOCK; + val = rtcin_locked(reg); RTC_UNLOCK; + return (val); } +void +writertc(int reg, u_char val) +{ + + RTC_LOCK; + rtcout_locked(reg, val); + RTC_UNLOCK; +} + static void atrtc_start(void) { @@ -163,25 +177,28 @@ atrtc_set(struct timespec *ts) clock_ts_to_bcd(ts, &ct, false); mtx_lock(&atrtc_time_lock); + RTC_LOCK; /* Disable RTC updates and interrupts. */ - writertc(RTC_STATUSB, RTCSB_HALT | RTCSB_24HR); + rtcout_locked(RTC_STATUSB, RTCSB_HALT | RTCSB_24HR); - writertc(RTC_SEC, ct.sec); /* Write back Seconds */ - writertc(RTC_MIN, ct.min); /* Write back Minutes */ - writertc(RTC_HRS, ct.hour); /* Write back Hours */ - writertc(RTC_WDAY, ct.dow + 1); /* Write back Weekday */ - writertc(RTC_DAY, ct.day); /* Write back Day */ - writertc(RTC_MONTH, ct.mon); /* Write back Month */ - writertc(RTC_YEAR, ct.year & 0xff); /* Write back Year */ + /* Write all the time registers. */ + rtcout_locked(RTC_SEC, ct.sec); + rtcout_locked(RTC_MIN, ct.min); + rtcout_locked(RTC_HRS, ct.hour); + rtcout_locked(RTC_WDAY, ct.dow + 1); + rtcout_locked(RTC_DAY, ct.day); + rtcout_locked(RTC_MONTH, ct.mon); + rtcout_locked(RTC_YEAR, ct.year & 0xff); #ifdef USE_RTC_CENTURY - writertc(RTC_CENTURY, ct.year >> 8); /* ... and Century */ + rtcout_locked(RTC_CENTURY, ct.year >> 8); #endif /* Re-enable RTC updates and interrupts. */ - writertc(RTC_STATUSB, rtc_statusb); - rtcin(RTC_INTR); + rtcout_locked(RTC_STATUSB, rtc_statusb); + rtcin_locked(RTC_INTR); + RTC_UNLOCK; mtx_unlock(&atrtc_time_lock); } @@ -358,15 +375,17 @@ atrtc_gettime(device_t dev, struct timespec *ts) while (rtcin(RTC_STATUSA) & RTCSA_TUP) continue; critical_enter(); - ct.sec = rtcin(RTC_SEC); - ct.min = rtcin(RTC_MIN); - ct.hour = rtcin(RTC_HRS); - ct.day = rtcin(RTC_DAY); - ct.mon = rtcin(RTC_MONTH); - ct.year = rtcin(RTC_YEAR); + RTC_LOCK; + ct.sec = rtcin_locked(RTC_SEC); + ct.min = rtcin_locked(RTC_MIN); + ct.hour = rtcin_locked(RTC_HRS); + ct.day = rtcin_locked(RTC_DAY); + ct.mon = rtcin_locked(RTC_MONTH); + ct.year = rtcin_locked(RTC_YEAR); #ifdef USE_RTC_CENTURY - ct.year |= rtcin(RTC_CENTURY) << 8; + ct.year |= rtcin_locked(RTC_CENTURY) << 8; #endif + RTC_UNLOCK; critical_exit(); mtx_unlock(&atrtc_time_lock); /* dow is unused in timespec conversion and we have no nsec info. */ From owner-svn-src-head@freebsd.org Tue Jan 16 02:40:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B11EEEBC69F; Tue, 16 Jan 2018 02:40:48 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (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 8F80F7EC33; Tue, 16 Jan 2018 02:40:48 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from comporellon.tachypleus.net (cpe-75-82-218-62.socal.res.rr.com [75.82.218.62]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id w0G2ekx0016323 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Mon, 15 Jan 2018 18:40:46 -0800 Subject: Re: svn commit: r327950 - in head/sys/powerpc: aim include powerpc ps3 To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <20180114175211.GD1684@kib.kiev.ua> <20180115111812.GF1684@kib.kiev.ua> <20180115170603.GJ1684@kib.kiev.ua> <9e5554d7-6a0c-5910-8cb6-74f98259536f@freebsd.org> <20180115175335.GK1684@kib.kiev.ua> <20180115234218.GN1684@kib.kiev.ua> From: Nathan Whitehorn Message-ID: Date: Mon, 15 Jan 2018 18:40:46 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20180115234218.GN1684@kib.kiev.ua> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Sonic-CAuth: UmFuZG9tSVZqbRYg/jATcwsGgnm2CQ9rzsNTlDvSqKpM2X1LYUCSJRpb/wD+x8o+e9X+lJj5yR3OTSu2AwUgX678W36m/98qilZxXiX8hvI= X-Sonic-ID: C;VqiCp2b65xGlUOBQ9eIpJw== M;BsbIp2b65xGlUOBQ9eIpJw== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jan 2018 02:40:48 -0000 On 01/15/18 15:42, Konstantin Belousov wrote: > On Mon, Jan 15, 2018 at 03:20:49PM -0800, Nathan Whitehorn wrote: >> Fair enough. Here's a patch with a new flag (DIRECT_MAP_AVAILABLE). I've >> also retooled the sfbuf code to use this rather than its own flags that >> mean the same things. The sparc64 part of the patch is untested. >> -Nathan >> Index: amd64/include/vmparam.h >> =================================================================== >> --- amd64/include/vmparam.h (revision 328006) >> +++ amd64/include/vmparam.h (working copy) >> @@ -190,6 +190,7 @@ >> * because the result is not actually accessed until later, but the early >> * vt fb startup needs to be reworked. >> */ >> +#define DIRECT_MAP_AVAILABLE 1 >> #define PHYS_TO_DMAP(x) ({ \ >> KASSERT(dmaplimit == 0 || (x) < dmaplimit, \ >> ("physical address %#jx not covered by the DMAP", \ >> Index: arm64/include/vmparam.h >> =================================================================== >> --- arm64/include/vmparam.h (revision 328006) >> +++ arm64/include/vmparam.h (working copy) >> @@ -176,6 +176,7 @@ >> #define VIRT_IN_DMAP(va) ((va) >= DMAP_MIN_ADDRESS && \ >> (va) < (dmap_max_addr)) >> >> +#define DIRECT_MAP_AVAILABLE > Just define, or define it to 1 ? Yes, sorry for typo. > >> #define PHYS_TO_DMAP(pa) \ >> ({ \ >> KASSERT(PHYS_IN_DMAP(pa), \ >> Index: dev/efidev/efirt.c >> =================================================================== >> --- dev/efidev/efirt.c (revision 328006) >> +++ dev/efidev/efirt.c (working copy) >> @@ -115,6 +115,11 @@ >> return (0); >> } >> efi_systbl = (struct efi_systbl *)PHYS_TO_DMAP(efi_systbl_phys); >> + if (efi_systbl == NULL) { >> + if (bootverbose) >> + printf("EFI systbl not mapped in kernel VA\n"); >> + return (0); >> + } > Is this chunk still needed ? The existing code is a bit of an awkward superposition of the "return NULL" idea and having the flag. Since you think there will never be intermediate cases -- which seems reasonable -- I will rip the conditional logic out and add a KASSERT matching the ones on arm64 and amd64 to the powerpc version. > >> if (efi_systbl->st_hdr.th_sig != EFI_SYSTBL_SIG) { >> efi_systbl = NULL; >> if (bootverbose) >> Index: kern/subr_sfbuf.c >> =================================================================== >> --- kern/subr_sfbuf.c (revision 328006) >> +++ kern/subr_sfbuf.c (working copy) >> @@ -88,8 +88,8 @@ >> vm_offset_t sf_base; >> int i; >> >> -#ifdef SFBUF_OPTIONAL_DIRECT_MAP >> - if (SFBUF_OPTIONAL_DIRECT_MAP) >> +#ifdef DIRECT_MAP_AVAILABLE >> + if (DIRECT_MAP_AVAILABLE) >> return; > Would it make sense to define the symbol on all other arches as 0 then, > and remove #ifdef ? Returning to your initial proposal of relying on the > compiler optimiing if (0) block; out. That is a good idea. > Also, just curious, why did you spelled DMAP as DIRECT_MAP ? > DMAP without the PHYS_TO_ seemed lacking in context and I was worried there might be a collision on DMAP. PMAP_HAS_DMAP would also work; I don't have a preference. Thanks for your patience working this out in real time with me. -Nathan From owner-svn-src-head@freebsd.org Tue Jan 16 02:56:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00D78EBD896; Tue, 16 Jan 2018 02:56:29 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C978B7F84D; Tue, 16 Jan 2018 02:56:28 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1FECE1A4CC; Tue, 16 Jan 2018 02:56:28 +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 w0G2uSXT011994; Tue, 16 Jan 2018 02:56:28 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0G2uRem011992; Tue, 16 Jan 2018 02:56:27 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201801160256.w0G2uRem011992@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 16 Jan 2018 02:56:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328038 - in head/sys: dev/random sys X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys: dev/random sys X-SVN-Commit-Revision: 328038 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jan 2018 02:56:29 -0000 Author: cem Date: Tue Jan 16 02:56:27 2018 New Revision: 328038 URL: https://svnweb.freebsd.org/changeset/base/328038 Log: random(4): Add CCP random source definitions The implementation will follow (D12723). For now, get the changes to commit-protected files out of the way. Approved by: secteam (gordon) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D13925 Modified: head/sys/dev/random/random_harvestq.c head/sys/sys/random.h Modified: head/sys/dev/random/random_harvestq.c ============================================================================== --- head/sys/dev/random/random_harvestq.c Tue Jan 16 01:21:07 2018 (r328037) +++ head/sys/dev/random/random_harvestq.c Tue Jan 16 02:56:27 2018 (r328038) @@ -304,6 +304,7 @@ static const char *random_source_descr[ENTROPYSOURCE] [RANDOM_PURE_RNDTEST] = "PURE_RNDTEST", [RANDOM_PURE_VIRTIO] = "PURE_VIRTIO", [RANDOM_PURE_BROADCOM] = "PURE_BROADCOM", + [RANDOM_PURE_CCP] = "PURE_CCP", /* "ENTROPYSOURCE" */ }; Modified: head/sys/sys/random.h ============================================================================== --- head/sys/sys/random.h Tue Jan 16 01:21:07 2018 (r328037) +++ head/sys/sys/random.h Tue Jan 16 02:56:27 2018 (r328038) @@ -94,6 +94,7 @@ enum random_entropy_source { RANDOM_PURE_RNDTEST, RANDOM_PURE_VIRTIO, RANDOM_PURE_BROADCOM, + RANDOM_PURE_CCP, ENTROPYSOURCE }; From owner-svn-src-head@freebsd.org Tue Jan 16 03:52:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 078AFE70370; Tue, 16 Jan 2018 03:52:48 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mx0a-0010f301.pphosted.com (mx0a-0010f301.pphosted.com [148.163.149.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.pphosted.com", Issuer "thawte SHA256 SSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D174C8317D; Tue, 16 Jan 2018 03:52:47 +0000 (UTC) (envelope-from alc@rice.edu) Received: from pps.filterd (m0102857.ppops.net [127.0.0.1]) by mx0b-0010f301.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w0G3q3O1030706; Tue, 16 Jan 2018 03:52:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rice.edu; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=ricemail; bh=nm9g+58qzcTF3BQrMH9UI7QIkFfWa3ta67ISMoYQqY8=; b=aP3Ajdcyv6UG34PqF42o28+xkJlh+FTbHpwe71yc1DI0zLFYKuuRNr0Kx7niTv5bGQAH ehpOWsNCTpZKJ0h7G2xsM9XF3F+wkan18AZ0ik4Ub63++vDcU28lTOotAUxTdFXVQgJ7 mlEY2Otfqt1IbN5T34tk+7ZnpegjpoHESOocWspMPF/0rrrl14ipxRHGZMkpMySuAfU+ 2umFQi/xracNGVTJfe/PGdJCqYlj2T73nBQRoLV42baf+kiqhwB2w+FwE9Hxv2+GhheR IQNPSsTfL4BFPQ0MCycIb2SMaYqvvmUSqmdB9Xz52e2l9a1bbcoWK37NY0fJv0GMWZEU 8g== Received: from mh1.mail.rice.edu (mh1.mail.rice.edu [128.42.201.20]) by mx0b-0010f301.pphosted.com with ESMTP id 2ff9jqjtu1-1; Tue, 16 Jan 2018 03:52:45 +0000 Received-X: from mh1.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh1.mail.rice.edu (Postfix) with ESMTP id 7ABE1460E47; Mon, 15 Jan 2018 21:52:45 -0600 (CST) Received-X: from mh1.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh1.mail.rice.edu (Postfix) with ESMTP id 798AA460D82; Mon, 15 Jan 2018 21:52:45 -0600 (CST) X-Virus-Scanned: by amavis-2.7.0 at mh1.mail.rice.edu, auth channel Received-X: from mh1.mail.rice.edu ([127.0.0.1]) by mh1.mail.rice.edu (mh1.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id MF0MMn2qe2zz; Mon, 15 Jan 2018 21:52:45 -0600 (CST) Received: from 108-254-203-201.lightspeed.hstntx.sbcglobal.net (108-254-203-201.lightspeed.hstntx.sbcglobal.net [108.254.203.201]) (using TLSv1 with cipher RC4-MD5 (112/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh1.mail.rice.edu (Postfix) with ESMTPSA id E89A5460D6A; Mon, 15 Jan 2018 21:52:44 -0600 (CST) Subject: Re: svn commit: r327950 - in head/sys/powerpc: aim include powerpc ps3 To: Nathan Whitehorn , Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <20180114175211.GD1684@kib.kiev.ua> <20180115111812.GF1684@kib.kiev.ua> <20180115170603.GJ1684@kib.kiev.ua> <9e5554d7-6a0c-5910-8cb6-74f98259536f@freebsd.org> <20180115175335.GK1684@kib.kiev.ua> <20180115234218.GN1684@kib.kiev.ua> From: Alan Cox Message-ID: <7ec31517-8488-dd93-fa30-3400f6a4d562@rice.edu> Date: Mon, 15 Jan 2018 21:52:44 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-01-16_02:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=3 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=896 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1801160053 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jan 2018 03:52:48 -0000 On 01/15/2018 20:40, Nathan Whitehorn wrote: > > > On 01/15/18 15:42, Konstantin Belousov wrote: >> On Mon, Jan 15, 2018 at 03:20:49PM -0800, Nathan Whitehorn wrote: >>> Fair enough. Here's a patch with a new flag (DIRECT_MAP_AVAILABLE). >>> I've >>> also retooled the sfbuf code to use this rather than its own flags that >>> mean the same things. The sparc64 part of the patch is untested. >>> -Nathan >>> Index: amd64/include/vmparam.h >>> =================================================================== >>> --- amd64/include/vmparam.h (revision 328006) >>> +++ amd64/include/vmparam.h (working copy) >>> @@ -190,6 +190,7 @@ >>> * because the result is not actually accessed until later, but >>> the early >>> * vt fb startup needs to be reworked. >>> */ >>> +#define DIRECT_MAP_AVAILABLE 1 >>> #define PHYS_TO_DMAP(x) ({ \ >>> KASSERT(dmaplimit == 0 || (x) < dmaplimit, \ >>> ("physical address %#jx not covered by the DMAP", \ >>> Index: arm64/include/vmparam.h >>> =================================================================== >>> --- arm64/include/vmparam.h (revision 328006) >>> +++ arm64/include/vmparam.h (working copy) >>> @@ -176,6 +176,7 @@ >>> #define VIRT_IN_DMAP(va) ((va) >= DMAP_MIN_ADDRESS && \ >>> (va) < (dmap_max_addr)) >>> +#define DIRECT_MAP_AVAILABLE >> Just define, or define it to 1 ? > > Yes, sorry for typo. > >> >>> #define PHYS_TO_DMAP(pa) \ >>> ({ \ >>> KASSERT(PHYS_IN_DMAP(pa), \ >>> Index: dev/efidev/efirt.c >>> =================================================================== >>> --- dev/efidev/efirt.c (revision 328006) >>> +++ dev/efidev/efirt.c (working copy) >>> @@ -115,6 +115,11 @@ >>> return (0); >>> } >>> efi_systbl = (struct efi_systbl *)PHYS_TO_DMAP(efi_systbl_phys); >>> + if (efi_systbl == NULL) { >>> + if (bootverbose) >>> + printf("EFI systbl not mapped in kernel VA\n"); >>> + return (0); >>> + } >> Is this chunk still needed ? > > The existing code is a bit of an awkward superposition of the "return > NULL" idea and having the flag. Since you think there will never be > intermediate cases -- which seems reasonable -- I will rip the > conditional logic out and add a KASSERT matching the ones on arm64 and > amd64 to the powerpc version. > >> >>> if (efi_systbl->st_hdr.th_sig != EFI_SYSTBL_SIG) { >>> efi_systbl = NULL; >>> if (bootverbose) >>> Index: kern/subr_sfbuf.c >>> =================================================================== >>> --- kern/subr_sfbuf.c (revision 328006) >>> +++ kern/subr_sfbuf.c (working copy) >>> @@ -88,8 +88,8 @@ >>> vm_offset_t sf_base; >>> int i; >>> -#ifdef SFBUF_OPTIONAL_DIRECT_MAP >>> - if (SFBUF_OPTIONAL_DIRECT_MAP) >>> +#ifdef DIRECT_MAP_AVAILABLE >>> + if (DIRECT_MAP_AVAILABLE) >>> return; >> Would it make sense to define the symbol on all other arches as 0 then, >> and remove #ifdef ? Returning to your initial proposal of relying on the >> compiler optimiing if (0) block; out. > > That is a good idea. > >> Also, just curious, why did you spelled DMAP as DIRECT_MAP ? >> > > DMAP without the PHYS_TO_ seemed lacking in context and I was worried > there might be a collision on DMAP. PMAP_HAS_DMAP would also work; I > don't have a preference. > I would suggest "ARCH_HAS_DMAP". From owner-svn-src-head@freebsd.org Tue Jan 16 04:34:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7166E73D75 for ; Tue, 16 Jan 2018 04:34:53 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-yb0-x230.google.com (mail-yb0-x230.google.com [IPv6:2607:f8b0:4002:c09::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 855A433D for ; Tue, 16 Jan 2018 04:34:53 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: by mail-yb0-x230.google.com with SMTP id y77so2676642ybe.13 for ; Mon, 15 Jan 2018 20:34:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=ShsvplN50YLlAM08Tn6yPuMBYgxk3vzuhGFdRBW5nPM=; b=MJVhzoiXxU27V4RCCg8uKRvW8YmB/bZ1a5+bWYv1hJwge5Cn/FqS7JN33lDL0yTgqy 3j3ur8FfXMC/nIf+04ZHT14cJ6VXgbtsysqUmFCg/h4IP97XRB520LfiyiSUP50Jvqpn SbRWgV455uEdANUuSDjAVe1y6RKY6ihAXM5b8= 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=ShsvplN50YLlAM08Tn6yPuMBYgxk3vzuhGFdRBW5nPM=; b=VT/Ee5CPsPOfB1GWvX1u0TYs13KBh431Tl/KJ2cgEWjomoatLnNPSurIE33IXhiKMJ l5T2O/bpZvAnxSrgUjF/I3EiV9Zc1c8ASAGj44wwsttM07l3qiItntgoIiLNRjGnzMwx nbB0H3049syD2OaciG4xJsBiLzNDlfkQlXRSDW5RRNCOIqZY8eVd83+x4ovcNOOt52tz RSpoTpZJW6weKNt/mqRkuOV9OWhDEa2LYB9/cZwQ/4TunEXwN+DDnpxpfLgQ0cppt+78 MmnL0Gguu77ol3YXKXcRgvddlRlFarcbtMtOBDelIg/L8GPlK2cMIEZJu9348o9+631Q 84Hw== X-Gm-Message-State: AKwxytfQwCCSCuVnQwmwjD5KtFQswJKdWYtV8k+YgIaP+hIjNT4s42Hn tWsVf3Zlf7iSZ6m+EPNLhfDxO0+uZ4CK5YhB+BMeqA== X-Google-Smtp-Source: ACJfBotIXeMmsVdBMLnTEI/RVuHQXKjCU5TvFXqPIpOhQ3seI4xph9siJIxS3h3gs+8fg5Ck6ZOIa2fISuExQYKSVt8= X-Received: by 10.37.107.82 with SMTP id o18mr1509478ybm.277.1516077292513; Mon, 15 Jan 2018 20:34:52 -0800 (PST) MIME-Version: 1.0 Received: by 10.37.46.79 with HTTP; Mon, 15 Jan 2018 20:34:21 -0800 (PST) In-Reply-To: References: <201801132230.w0DMUVmF081985@repo.freebsd.org> <7fe2a0bb-8592-75bc-6f58-cb77e2d6044c@FreeBSD.org> <20180114171448.GB89171@raichu> From: Eitan Adler Date: Mon, 15 Jan 2018 20:34:21 -0800 Message-ID: Subject: Re: svn commit: r327949 - in head/sys/dev: aacraid advansys ath beri/virtio bnxt bwn ciss cxgbe/crypto esp fb gpio if_ndis iwi kbd liquidio liquidio/base mpr mps mpt mrsas mxge netmap nvme pst ral rp s... To: Warner Losh Cc: Mark Johnston , svn-src-head@freebsd.org, svn-src-all@freebsd.org, Pedro Giffuni , src-committers Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jan 2018 04:34:53 -0000 On 14 January 2018 at 12:16, Warner Losh wrote: > On Jan 14, 2018 10:15 AM, "Mark Johnston" wrote: > > On Sat, Jan 13, 2018 at 05:34:24PM -0500, Pedro Giffuni wrote: > > > > > > On 01/13/18 17:30, Pedro F. Giffuni wrote: > > > Author: pfg > > > Date: Sat Jan 13 22:30:30 2018 > > > New Revision: 327949 > > > URL: https://svnweb.freebsd.org/changeset/base/327949 > > > > > > Log: > > > dev: make some use of mallocarray(9). > > > > > > Focus on code where we are doing multiplications within malloc(9). > None of > > > these is likely to overflow, however the change is still useful as > some > > > static checkers can benefit from the allocation attributes we use > for > > > mallocarray. > > > > > > This initial sweep only covers malloc(9) calls with M_NOWAIT. No > good > > > reason but I started doing the changes before r327796 and at that > time it > > > was convenient to make sure the sorrounding code could handle NULL > values. > > > > > For the record, this was part of > > > > https://reviews.freebsd.org/D13837 > > > > I didn't mention it in the commit log because I am not ready to close > > the revision yet. > > Some developers have been using the "X-Differential revision:" tag in > this case. > > > I just list it per normal, but reopen the review if I need to. > If you keep the D#### in the message, phabricator will add a connection to the commit, even if you don't include the full "Differential Revision' line. -- Eitan Adler From owner-svn-src-head@freebsd.org Tue Jan 16 04:50:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D67CE74D40; Tue, 16 Jan 2018 04:50:24 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 595ECE6D; Tue, 16 Jan 2018 04:50:24 +0000 (UTC) (envelope-from jhibbits@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B25C01B8CE; Tue, 16 Jan 2018 04:50:23 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0G4oNnU058722; Tue, 16 Jan 2018 04:50:23 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0G4oNZI058721; Tue, 16 Jan 2018 04:50:23 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201801160450.w0G4oNZI058721@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 16 Jan 2018 04:50:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328040 - head/sys/powerpc/mpc85xx X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/mpc85xx X-SVN-Commit-Revision: 328040 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jan 2018 04:50:24 -0000 Author: jhibbits Date: Tue Jan 16 04:50:23 2018 New Revision: 328040 URL: https://svnweb.freebsd.org/changeset/base/328040 Log: Make fsl_sata driver work on P1022 P1022 SATA controller may set the wrong CCR bit for a command completion. This would previously cause an interrupt storm. Solve this by marking all commands complete, and letting the end_transaction deal with the successes. Causes no problems on P5020. While here, fix a minor bug in collision detection. The Freescale SATA controller only has 16 slots, not 32. Modified: head/sys/powerpc/mpc85xx/fsl_sata.c Modified: head/sys/powerpc/mpc85xx/fsl_sata.c ============================================================================== --- head/sys/powerpc/mpc85xx/fsl_sata.c Tue Jan 16 03:02:41 2018 (r328039) +++ head/sys/powerpc/mpc85xx/fsl_sata.c Tue Jan 16 04:50:23 2018 (r328040) @@ -822,11 +822,15 @@ fsl_sata_intr_main(struct fsl_sata_channel *ch, uint32 /* Complete all successful commands. */ ok = ATA_INL(ch->r_mem, FSL_SATA_P_CCR); - if (ch->aslots == 0) + /* Mark all commands complete, to complete the interrupt. */ + ATA_OUTL(ch->r_mem, FSL_SATA_P_CCR, ok); + if (ch->aslots == 0 && ok != 0) { for (i = 0; i < FSL_SATA_MAX_SLOTS; i++) { if (((ok >> i) & 1) && ch->slot[i].ccb != NULL) - fsl_sata_end_transaction(&ch->slot[i], FSL_SATA_ERR_NONE); + fsl_sata_end_transaction(&ch->slot[i], + FSL_SATA_ERR_NONE); } + } /* Read command statuses. */ if (istatus & FSL_SATA_P_HSTS_SNTFU) sntf = ATA_INL(ch->r_mem, FSL_SATA_P_SNTF); @@ -882,8 +886,7 @@ fsl_sata_check_collision(struct fsl_sata_channel *ch, if ((ccb->ccb_h.func_code == XPT_ATA_IO) && (ccb->ataio.cmd.flags & CAM_ATAIO_FPDMA)) { /* Tagged command while we have no supported tag free. */ - if (((~ch->oslots) & (0xffffffff >> (32 - - ch->curr[t].tags))) == 0) + if (((~ch->oslots) & (0xffff >> (16 - ch->curr[t].tags))) == 0) return (1); /* Tagged command while untagged are active. */ if (ch->numrslotspd[t] != 0 && ch->numtslotspd[t] == 0) From owner-svn-src-head@freebsd.org Tue Jan 16 05:24:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89247E7740C; Tue, 16 Jan 2018 05:24:11 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from pv33p00im-asmtp003.me.com (pv33p00im-asmtp003.me.com [17.142.194.252]) (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 4DAB427CC; Tue, 16 Jan 2018 05:24:11 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from process-dkim-sign-daemon.pv33p00im-asmtp003.me.com by pv33p00im-asmtp003.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) id <0P2M00H00TZPVC00@pv33p00im-asmtp003.me.com>; Tue, 16 Jan 2018 05:23:40 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mac.com; s=04042017; t=1516080220; bh=MEAfQgITFxUhWfZjbkmRapoihQDezvK+HEdbGoXDn/g=; h=Date:Subject:From:To:Message-id:MIME-version:Content-type; b=h0fzjXEbQ/7yGBTRR8eFDAVrv53Amn3dOO+K81Hw9gx2RORqx4hU39FHuczmXMW8p EeZVlM6cIKvr98jq4TQZtO9m2p3g/2om/BfO84gmLC1Zio9nQRjQAqMJhwP3ykWLHh N8m95LlC7rmNlBykvHlzlSV9Tcf1PSCfDusnosBW+6rfT6570jwvy++oe//XjXSNTi WcBWOdvwJ5xbXiXxrD3HhCU9kncr8QrYiONOnaCgXyFIY4jmWhw3zBtUSdu5Orsuzk CSN1wN7FSMETXKWJz9BGwuIDyKStiYizjUER5zrF5PUpKAGBYdGdyhhGWoG3Js0G6J JxygYPk1p29WQ== Received: from icloud.com ([127.0.0.1]) by pv33p00im-asmtp003.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) with ESMTPSA id <0P2M00LFNUZDSP20@pv33p00im-asmtp003.me.com>; Tue, 16 Jan 2018 05:23:38 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-01-16_02:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1801160077 User-Agent: Microsoft-MacOutlook/f.29.0.171205 Date: Mon, 15 Jan 2018 21:23:36 -0800 Subject: Re: svn commit: r328020 - in head/sys/mips: mips nlm/dev/sec From: Ravi Pokala To: "Pedro F. Giffuni" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-id: <560DA44B-159E-431D-B388-4E5E8962E1CD@mac.com> Thread-topic: svn commit: r328020 - in head/sys/mips: mips nlm/dev/sec References: <201801152113.w0FLDUUn065783@repo.freebsd.org> In-reply-to: <201801152113.w0FLDUUn065783@repo.freebsd.org> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jan 2018 05:24:11 -0000 Hi Pedro, This change breaks many (most? all?) MIPS kernels (universe, no special config, -DNO_CLEAN): --- busdma_machdep.o --- cc1: warnings being treated as errors /usr/home/rpokala/freebsd/clean/base/head/sys/mips/mips/busdma_machdep.c: In function 'bus_dmamap_create': /usr/home/rpokala/freebsd/clean/base/head/sys/mips/mips/busdma_machdep.c:539: warning: passing argument 2 of 'malloc' makes pointer from integer without a cast /usr/home/rpokala/freebsd/clean/base/head/sys/mips/mips/busdma_machdep.c:539: warning: passing argument 3 of 'malloc' makes integer from pointer without a cast /usr/home/rpokala/freebsd/clean/base/head/sys/mips/mips/busdma_machdep.c:539: error: too many arguments to function 'malloc' /usr/home/rpokala/freebsd/clean/base/head/sys/mips/mips/busdma_machdep.c: In function 'bus_dmamem_alloc': /usr/home/rpokala/freebsd/clean/base/head/sys/mips/mips/busdma_machdep.c:651: warning: passing argument 2 of 'malloc' makes pointer from integer without a cast /usr/home/rpokala/freebsd/clean/base/head/sys/mips/mips/busdma_machdep.c:651: warning: passing argument 3 of 'malloc' makes integer from pointer without a cast /usr/home/rpokala/freebsd/clean/base/head/sys/mips/mips/busdma_machdep.c:651: error: too many arguments to function 'malloc' Thanks, Ravi (rpokala@) -----Original Message----- From: on behalf of "Pedro F. Giffuni" Date: 2018-01-15, Monday at 13:13 To: , , Subject: svn commit: r328020 - in head/sys/mips: mips nlm/dev/sec Author: pfg Date: Mon Jan 15 21:13:30 2018 New Revision: 328020 URL: https://svnweb.freebsd.org/changeset/base/328020 Log: mips: make some use of mallocarray(9). Focus on code where we are doing multiplications within malloc(9). None of these ire likely to overflow, however the change is still useful as some static checkers can benefit from the allocation attributes we use for mallocarray. This initial sweep only covers malloc(9) calls with M_NOWAIT. No good reason but I started doing the changes before r327796 and at that time it was convenient to make sure the sorrounding code could handle NULL values. X-Differential revision: https://reviews.freebsd.org/D13837 Modified: head/sys/mips/mips/busdma_machdep.c head/sys/mips/nlm/dev/sec/nlmrsa.c Modified: head/sys/mips/mips/busdma_machdep.c ============================================================================== --- head/sys/mips/mips/busdma_machdep.c Mon Jan 15 21:11:38 2018 (r328019) +++ head/sys/mips/mips/busdma_machdep.c Mon Jan 15 21:13:30 2018 (r328020) @@ -345,7 +345,8 @@ _busdma_alloc_dmamap(bus_dma_tag_t dmat) struct sync_list *slist; bus_dmamap_t map; - slist = malloc(sizeof(*slist) * dmat->nsegments, M_BUSDMA, M_NOWAIT); + slist = mallocarray(dmat->nsegments, sizeof(*slist), M_BUSDMA, + M_NOWAIT); if (slist == NULL) return (NULL); map = uma_zalloc_arg(dmamap_zone, dmat, M_NOWAIT); @@ -534,9 +535,8 @@ bus_dmamap_create(bus_dma_tag_t dmat, int flags, bus_d int error = 0; if (dmat->segments == NULL) { - dmat->segments = (bus_dma_segment_t *)malloc( - sizeof(bus_dma_segment_t) * dmat->nsegments, M_BUSDMA, - M_NOWAIT); + dmat->segments = (bus_dma_segment_t *)malloc(dmat->nsegments, + sizeof(bus_dma_segment_t), M_BUSDMA, M_NOWAIT); if (dmat->segments == NULL) { CTR3(KTR_BUSDMA, "%s: tag %p error %d", __func__, dmat, ENOMEM); @@ -647,9 +647,8 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddrp, in else mflags = M_WAITOK; if (dmat->segments == NULL) { - dmat->segments = (bus_dma_segment_t *)malloc( - sizeof(bus_dma_segment_t) * dmat->nsegments, M_BUSDMA, - mflags); + dmat->segments = (bus_dma_segment_t *)malloc(dmat->nsegments, + sizeof(bus_dma_segment_t), M_BUSDMA, mflags); if (dmat->segments == NULL) { CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", __func__, dmat, dmat->flags, ENOMEM); Modified: head/sys/mips/nlm/dev/sec/nlmrsa.c ============================================================================== --- head/sys/mips/nlm/dev/sec/nlmrsa.c Mon Jan 15 21:11:38 2018 (r328019) +++ head/sys/mips/nlm/dev/sec/nlmrsa.c Mon Jan 15 21:13:30 2018 (r328020) @@ -346,7 +346,7 @@ xlp_rsa_newsession(device_t dev, u_int32_t *sidp, stru if (ses == NULL) { sesn = sc->sc_nsessions; - ses = malloc((sesn + 1) * sizeof(*ses), + ses = mallocarray(sesn + 1, sizeof(*ses), M_DEVBUF, M_NOWAIT); if (ses == NULL) return (ENOMEM); @@ -528,8 +528,9 @@ xlp_rsa_kprocess(device_t dev, struct cryptkop *krp, i goto errout; } cmd->rsafn = 0; /* Mod Exp */ - cmd->rsasrc = malloc( - cmd->rsaopsize * (krp->krp_iparams + krp->krp_oparams), + cmd->rsasrc = mallocarray( + krp->krp_iparams + krp->krp_oparams, + cmd->rsaopsize, M_DEVBUF, M_NOWAIT | M_ZERO); if (cmd->rsasrc == NULL) { From owner-svn-src-head@freebsd.org Tue Jan 16 06:04:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2809FE79F79; Tue, 16 Jan 2018 06:04:41 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 037906367D; Tue, 16 Jan 2018 06:04:41 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 44A0D1C697; Tue, 16 Jan 2018 06:04:40 +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 w0G64eQE091553; Tue, 16 Jan 2018 06:04:40 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0G64eKa091552; Tue, 16 Jan 2018 06:04:40 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201801160604.w0G64eKa091552@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 16 Jan 2018 06:04:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328041 - head/sys/mips/mips X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/mips/mips X-SVN-Commit-Revision: 328041 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jan 2018 06:04:41 -0000 Author: pfg Date: Tue Jan 16 06:04:39 2018 New Revision: 328041 URL: https://svnweb.freebsd.org/changeset/base/328041 Log: Fix build after r328020. Should have noticed earlier but the build was already broken by another change. Reported by: Ravi Pokala Modified: head/sys/mips/mips/busdma_machdep.c Modified: head/sys/mips/mips/busdma_machdep.c ============================================================================== --- head/sys/mips/mips/busdma_machdep.c Tue Jan 16 04:50:23 2018 (r328040) +++ head/sys/mips/mips/busdma_machdep.c Tue Jan 16 06:04:39 2018 (r328041) @@ -535,7 +535,8 @@ bus_dmamap_create(bus_dma_tag_t dmat, int flags, bus_d int error = 0; if (dmat->segments == NULL) { - dmat->segments = (bus_dma_segment_t *)malloc(dmat->nsegments, + dmat->segments = + (bus_dma_segment_t *)mallocarray(dmat->nsegments, sizeof(bus_dma_segment_t), M_BUSDMA, M_NOWAIT); if (dmat->segments == NULL) { CTR3(KTR_BUSDMA, "%s: tag %p error %d", @@ -647,7 +648,8 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddrp, in else mflags = M_WAITOK; if (dmat->segments == NULL) { - dmat->segments = (bus_dma_segment_t *)malloc(dmat->nsegments, + dmat->segments = + (bus_dma_segment_t *)mallocarray(dmat->nsegments, sizeof(bus_dma_segment_t), M_BUSDMA, mflags); if (dmat->segments == NULL) { CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", From owner-svn-src-head@freebsd.org Tue Jan 16 06:24:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDE81E7B917; Tue, 16 Jan 2018 06:24:20 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 95A8C68736; Tue, 16 Jan 2018 06:24:20 +0000 (UTC) (envelope-from wma@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ADA761CA29; Tue, 16 Jan 2018 06:24:19 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0G6OJ9g000224; Tue, 16 Jan 2018 06:24:19 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0G6OJ59000220; Tue, 16 Jan 2018 06:24:19 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201801160624.w0G6OJ59000220@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Tue, 16 Jan 2018 06:24:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328042 - in head/sys: conf powerpc/conf powerpc/powernv powerpc/pseries X-SVN-Group: head X-SVN-Commit-Author: wma X-SVN-Commit-Paths: in head/sys: conf powerpc/conf powerpc/powernv powerpc/pseries X-SVN-Commit-Revision: 328042 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jan 2018 06:24:20 -0000 Author: wma Date: Tue Jan 16 06:24:19 2018 New Revision: 328042 URL: https://svnweb.freebsd.org/changeset/base/328042 Log: PowerNV: XICS support for PowerNV/OPAL Make XICS to be OPAL-aware. Created by: Nathan Whitehorn Submitted by: Wojciech Macek Sponsored by: FreeBSD Foundation Modified: head/sys/conf/options.powerpc head/sys/powerpc/conf/GENERIC64 head/sys/powerpc/powernv/opal.h head/sys/powerpc/pseries/xics.c Modified: head/sys/conf/options.powerpc ============================================================================== --- head/sys/conf/options.powerpc Tue Jan 16 06:04:39 2018 (r328041) +++ head/sys/conf/options.powerpc Tue Jan 16 06:24:19 2018 (r328042) @@ -23,7 +23,7 @@ MPC85XX opt_platform.h POWERMAC opt_platform.h PS3 opt_platform.h MAMBO -POWERNV +POWERNV opt_platform.h PSERIES PSIM Modified: head/sys/powerpc/conf/GENERIC64 ============================================================================== --- head/sys/powerpc/conf/GENERIC64 Tue Jan 16 06:04:39 2018 (r328041) +++ head/sys/powerpc/conf/GENERIC64 Tue Jan 16 06:24:19 2018 (r328042) @@ -31,7 +31,7 @@ options POWERMAC #NewWorld Apple PowerMacs options PS3 #Sony Playstation 3 options MAMBO #IBM Mambo Full System Simulator options PSERIES #PAPR-compliant systems (e.g. IBM p) -options POWERNV #Non-virtualized OpenPOWER systems +options POWERNV #Non-virtualized OpenPOWER systems options FDT #Flattened Device Tree options SCHED_ULE #ULE scheduler Modified: head/sys/powerpc/powernv/opal.h ============================================================================== --- head/sys/powerpc/powernv/opal.h Tue Jan 16 06:04:39 2018 (r328041) +++ head/sys/powerpc/powernv/opal.h Tue Jan 16 06:24:19 2018 (r328042) @@ -59,6 +59,8 @@ int opal_call(uint64_t token, ...); #define OPAL_PCI_SET_XIVE_PE 37 #define OPAL_PCI_RESET 49 #define OPAL_PCI_POLL 62 +#define OPAL_SET_XIVE 19 +#define OPAL_GET_XIVE 20 #define OPAL_PCI_SET_PE 31 #define OPAL_GET_MSI_32 39 #define OPAL_GET_MSI_64 40 Modified: head/sys/powerpc/pseries/xics.c ============================================================================== --- head/sys/powerpc/pseries/xics.c Tue Jan 16 06:04:39 2018 (r328041) +++ head/sys/powerpc/pseries/xics.c Tue Jan 16 06:24:19 2018 (r328042) @@ -28,6 +28,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_platform.h" + #include #include #include @@ -48,6 +50,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef POWERNV +#include +#endif + #include "phyp-hvcall.h" #include "pic_if.h" @@ -82,7 +88,7 @@ static device_method_t xicp_methods[] = { DEVMETHOD(pic_mask, xicp_mask), DEVMETHOD(pic_unmask, xicp_unmask), - { 0, 0 }, + DEVMETHOD_END }; static device_method_t xics_methods[] = { @@ -90,12 +96,15 @@ static device_method_t xics_methods[] = { DEVMETHOD(device_probe, xics_probe), DEVMETHOD(device_attach, xics_attach), - { 0, 0 }, + DEVMETHOD_END }; struct xicp_softc { struct mtx sc_mtx; + struct resource *mem[MAXCPU]; + int cpu_range[2]; + int ibm_int_on; int ibm_int_off; int ibm_get_xive; @@ -105,6 +114,7 @@ struct xicp_softc { struct { int irq; int vector; + int cpu; } intvecs[256]; int nintvecs; }; @@ -129,31 +139,43 @@ EARLY_DRIVER_MODULE(xicp, ofwbus, xicp_driver, xicp_de EARLY_DRIVER_MODULE(xics, ofwbus, xics_driver, xics_devclass, 0, 0, BUS_PASS_INTERRUPT); +#ifdef POWERNV +static struct resource * +xicp_mem_for_cpu(int cpu) +{ + device_t dev; + struct xicp_softc *sc; + int i; + + for (i = 0; (dev = devclass_get_device(xicp_devclass, i)) != NULL; i++){ + sc = device_get_softc(dev); + if (cpu >= sc->cpu_range[0] && cpu < sc->cpu_range[1]) + return (sc->mem[cpu - sc->cpu_range[0]]); + } + + return (NULL); +} +#endif + static int xicp_probe(device_t dev) { - if (ofw_bus_get_name(dev) == NULL || strcmp(ofw_bus_get_name(dev), - "interrupt-controller") != 0) - return (ENXIO); if (!ofw_bus_is_compatible(dev, "ibm,ppc-xicp")) return (ENXIO); - device_set_desc(dev, "PAPR virtual interrupt controller"); + device_set_desc(dev, "External Interrupt Presentation Controller"); return (BUS_PROBE_GENERIC); } static int xics_probe(device_t dev) { - if (ofw_bus_get_name(dev) == NULL || strcmp(ofw_bus_get_name(dev), - "interrupt-controller") != 0) - return (ENXIO); if (!ofw_bus_is_compatible(dev, "ibm,ppc-xics")) return (ENXIO); - device_set_desc(dev, "PAPR virtual interrupt source"); + device_set_desc(dev, "External Interrupt Source Controller"); return (BUS_PROBE_GENERIC); } @@ -163,14 +185,54 @@ xicp_attach(device_t dev) struct xicp_softc *sc = device_get_softc(dev); phandle_t phandle = ofw_bus_get_node(dev); + if (rtas_exists()) { + sc->ibm_int_on = rtas_token_lookup("ibm,int-on"); + sc->ibm_int_off = rtas_token_lookup("ibm,int-off"); + sc->ibm_set_xive = rtas_token_lookup("ibm,set-xive"); + sc->ibm_get_xive = rtas_token_lookup("ibm,get-xive"); +#ifdef POWERNV + } else if (opal_check() == 0) { + /* No init needed */ +#endif + } else { + device_printf(dev, "Cannot attach without RTAS or OPAL\n"); + return (ENXIO); + } + + if (OF_hasprop(phandle, "ibm,interrupt-server-ranges")) { + OF_getencprop(phandle, "ibm,interrupt-server-ranges", + sc->cpu_range, sizeof(sc->cpu_range)); + sc->cpu_range[1] += sc->cpu_range[0]; + device_printf(dev, "Handling CPUs %d-%d\n", sc->cpu_range[0], + sc->cpu_range[1]-1); + } else { + sc->cpu_range[0] = 0; + sc->cpu_range[1] = mp_ncpus; + } + +#ifdef POWERNV + if (mfmsr() & PSL_HV) { + int i; + + for (i = 0; i < sc->cpu_range[1] - sc->cpu_range[0]; i++) { + sc->mem[i] = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &i, RF_ACTIVE); + if (sc->mem[i] == NULL) { + device_printf(dev, "Could not alloc mem " + "resource %d\n", i); + return (ENXIO); + } + + /* Unmask interrupts on all cores */ + bus_write_1(sc->mem[i], 4, 0xff); + bus_write_1(sc->mem[i], 12, 0xff); + } + } +#endif + mtx_init(&sc->sc_mtx, "XICP", NULL, MTX_DEF); sc->nintvecs = 0; - sc->ibm_int_on = rtas_token_lookup("ibm,int-on"); - sc->ibm_int_off = rtas_token_lookup("ibm,int-off"); - sc->ibm_set_xive = rtas_token_lookup("ibm,set-xive"); - sc->ibm_get_xive = rtas_token_lookup("ibm,get-xive"); - powerpc_register_pic(dev, OF_xref_from_node(phandle), MAX_XICP_IRQS, 1 /* Number of IPIs */, FALSE); root_pic = dev; @@ -219,9 +281,23 @@ xicp_bind(device_t dev, u_int irq, cpuset_t cpumask) ncpus++; } + /* XXX: super inefficient */ + for (i = 0; i < sc->nintvecs; i++) { + if (sc->intvecs[i].irq == irq) { + sc->intvecs[i].cpu = cpu; + break; + } + } + KASSERT(i < sc->nintvecs, ("Binding non-configured interrupt")); - error = rtas_call_method(sc->ibm_set_xive, 3, 1, irq, cpu, - XICP_PRIORITY, &status); + if (rtas_exists()) + error = rtas_call_method(sc->ibm_set_xive, 3, 1, irq, cpu, + XICP_PRIORITY, &status); +#ifdef POWERNV + else + error = opal_call(OPAL_SET_XIVE, irq, cpu << 2, XICP_PRIORITY); +#endif + if (error < 0) panic("Cannot bind interrupt %d to CPU %d", irq, cpu); } @@ -230,23 +306,45 @@ static void xicp_dispatch(device_t dev, struct trapframe *tf) { struct xicp_softc *sc; + struct resource *regs = NULL; uint64_t xirr, junk; int i; +#ifdef POWERNV + if (mfmsr() & PSL_HV) { + regs = xicp_mem_for_cpu(PCPU_GET(cpuid)); + KASSERT(regs != NULL, + ("Can't find regs for CPU %d", PCPU_GET(cpuid))); + } +#endif + sc = device_get_softc(dev); for (;;) { /* Return value in R4, use the PFT call */ - phyp_pft_hcall(H_XIRR, 0, 0, 0, 0, &xirr, &junk, &junk); + if (regs) { + xirr = bus_read_4(regs, 4); + } else { + /* Return value in R4, use the PFT call */ + phyp_pft_hcall(H_XIRR, 0, 0, 0, 0, &xirr, &junk, &junk); + } xirr &= 0x00ffffff; if (xirr == 0) { /* No more pending interrupts? */ - phyp_hcall(H_CPPR, (uint64_t)0xff); + if (regs) + bus_write_1(regs, 4, 0xff); + else + phyp_hcall(H_CPPR, (uint64_t)0xff); break; } if (xirr == XICP_IPI) { /* Magic number for IPIs */ xirr = MAX_XICP_IRQS; /* Map to FreeBSD magic */ - phyp_hcall(H_IPI, (uint64_t)(PCPU_GET(cpuid)), - 0xff); /* Clear IPI */ + + /* Clear IPI */ + if (regs) + bus_write_1(regs, 12, 0xff); + else + phyp_hcall(H_IPI, (uint64_t)(PCPU_GET(cpuid)), + 0xff); } /* XXX: super inefficient */ @@ -271,9 +369,13 @@ xicp_enable(device_t dev, u_int irq, u_int vector) KASSERT(sc->nintvecs + 1 < nitems(sc->intvecs), ("Too many XICP interrupts")); + /* Bind to this CPU to start: distrib. ID is last entry in gserver# */ + cpu = PCPU_GET(cpuid); + mtx_lock(&sc->sc_mtx); sc->intvecs[sc->nintvecs].irq = irq; sc->intvecs[sc->nintvecs].vector = vector; + sc->intvecs[sc->nintvecs].cpu = cpu; mb(); sc->nintvecs++; mtx_unlock(&sc->sc_mtx); @@ -282,11 +384,20 @@ xicp_enable(device_t dev, u_int irq, u_int vector) if (irq == MAX_XICP_IRQS) return; - /* Bind to this CPU to start: distrib. ID is last entry in gserver# */ - cpu = PCPU_GET(cpuid); - rtas_call_method(sc->ibm_set_xive, 3, 1, irq, cpu, XICP_PRIORITY, - &status); - xicp_unmask(dev, irq); + if (rtas_exists()) { + rtas_call_method(sc->ibm_set_xive, 3, 1, irq, cpu, + XICP_PRIORITY, &status); + xicp_unmask(dev, irq); +#ifdef POWERNV + } else { + status = opal_call(OPAL_SET_XIVE, irq, cpu << 2, XICP_PRIORITY); + /* Unmask implicit for OPAL */ + + if (status != 0) + panic("OPAL_SET_XIVE IRQ %d -> cpu %d failed: %d", irq, + cpu, status); +#endif + } } static void @@ -298,14 +409,24 @@ xicp_eoi(device_t dev, u_int irq) irq = XICP_IPI; xirr = irq | (XICP_PRIORITY << 24); - phyp_hcall(H_EOI, xirr); +#ifdef POWERNV + if (mfmsr() & PSL_HV) + bus_write_4(xicp_mem_for_cpu(PCPU_GET(cpuid)), 4, xirr); + else +#endif + phyp_hcall(H_EOI, xirr); } static void xicp_ipi(device_t dev, u_int cpu) { - phyp_hcall(H_IPI, (uint64_t)cpu, XICP_PRIORITY); +#ifdef POWERNV + if (mfmsr() & PSL_HV) + bus_write_1(xicp_mem_for_cpu(cpu), 12, XICP_PRIORITY); + else +#endif + phyp_hcall(H_IPI, (uint64_t)cpu, XICP_PRIORITY); } static void @@ -317,7 +438,21 @@ xicp_mask(device_t dev, u_int irq) if (irq == MAX_XICP_IRQS) return; - rtas_call_method(sc->ibm_int_off, 1, 1, irq, &status); + if (rtas_exists()) { + rtas_call_method(sc->ibm_int_off, 1, 1, irq, &status); +#ifdef POWERNV + } else { + int i; + + for (i = 0; i < sc->nintvecs; i++) { + if (sc->intvecs[i].irq == irq) { + break; + } + } + KASSERT(i < sc->nintvecs, ("Masking unconfigured interrupt")); + opal_call(OPAL_SET_XIVE, irq, sc->intvecs[i].cpu << 2, 0xff); +#endif + } } static void @@ -329,6 +464,21 @@ xicp_unmask(device_t dev, u_int irq) if (irq == MAX_XICP_IRQS) return; - rtas_call_method(sc->ibm_int_on, 1, 1, irq, &status); + if (rtas_exists()) { + rtas_call_method(sc->ibm_int_on, 1, 1, irq, &status); +#ifdef POWERNV + } else { + int i; + + for (i = 0; i < sc->nintvecs; i++) { + if (sc->intvecs[i].irq == irq) { + break; + } + } + KASSERT(i < sc->nintvecs, ("Unmasking unconfigured interrupt")); + opal_call(OPAL_SET_XIVE, irq, sc->intvecs[i].cpu << 2, + XICP_PRIORITY); +#endif + } } From owner-svn-src-head@freebsd.org Tue Jan 16 06:26:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD168E7BBF3 for ; Tue, 16 Jan 2018 06:26:56 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic309-36.consmr.mail.ne1.yahoo.com (sonic309-36.consmr.mail.ne1.yahoo.com [66.163.184.162]) (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 90BFC68994 for ; Tue, 16 Jan 2018 06:26:56 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1516084015; bh=FQaW4aAjrUqX2Rj4LgAplJV0eNUIdQNvE9JE1hoiPY4=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject; b=rKDp11TSUV4jCZteVTFjMZw8CNG6Mz2KdF6iv89mZBDjTSJwqQYSM8nu6wjd7YtgzhMm9OIwAHzMbM3ODXU6jt/3VZgQrXRQedbspYol9yjHbCRadymkTDT4nWCp3oHE8gJLxCi0qFuW8QrlLbVBYl299ePLG3VBn6pjAuQTNy1bFO50WjGIv3TCSVqjqURSIpHskxj1jgCItZ9v+6XG2HQdYb/B00Hp7maHNVDDjXLEmMtVSKZY5enq/ID3TS1yYVFwg1HAl6TJS3zitMrMTQ7L1+qdWiq+8FuUio2d5QPZHahvT2SeT/Fg5XaTlb2KLm0xEWT9HwtnSTVZ8g8y1Q== X-YMail-OSG: W6Paa_AVM1kD.KKWAiOf6q4TT.g02BQXQ9TeS4O2xwtjKXKbar8iXEZc4nPHpgr BMt6at.xXy0R0CFD5GD4BnkNUCKZGFYb2NhCu2binJncHQkYoiNHAEJFlWT_lcoNn3F2IX.FkAeh 305NXxxmNPuskRYV0xSo_TQuoVF7KqZKjU.1PkvFefGxUyciEJTYHv.SPSwttpEim4Tq0j7VojXk v.Bi9113Zi2ucWAnzkGCcY._UXckpeoyxrMVoySwvZm_38e.OniyFP3sY5S09jHl_oSfoSFGJ_Xh MQ3DU3Vr9mPnTV_VGOAqgsVRpDliXfExp0ASPabZ98U_m2eClf76Kn35iaUUOnuHOh6Io6Vypsun 9_m.aTyUXf7piJrQtgRV7oe00l9mzv9ftOn6HDjLVIxBZw.M0Gl2lGMmoDHbAqtD3Cxn55oRHmbn akBQLTXW9Q8O8GAI32f1XiiTRKoEvrZP.T3VgVSvcouypLBkUJaH30a75QbB_XNTE40BNDsvi Received: from sonic.gate.mail.ne1.yahoo.com by sonic309.consmr.mail.ne1.yahoo.com with HTTP; Tue, 16 Jan 2018 06:26:55 +0000 Received: from smtp234.mail.ne1.yahoo.com (EHLO [192.168.0.8]) ([10.218.253.207]) by smtp404.mail.ne1.yahoo.com (JAMES SMTP Server ) with ESMTPA ID 88bc775ad51267311c75ec27191e6efd; Tue, 16 Jan 2018 06:06:40 +0000 (UTC) Subject: Re: svn commit: r328020 - in head/sys/mips: mips nlm/dev/sec To: Ravi Pokala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201801152113.w0FLDUUn065783@repo.freebsd.org> <560DA44B-159E-431D-B388-4E5E8962E1CD@mac.com> From: Pedro Giffuni Message-ID: <945535f7-119f-1da4-c64c-f7a7e99e467a@FreeBSD.org> Date: Tue, 16 Jan 2018 01:06:39 -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: <560DA44B-159E-431D-B388-4E5E8962E1CD@mac.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jan 2018 06:26:56 -0000 Thanks for the report; On 01/16/18 00:23, Ravi Pokala wrote: > Hi Pedro, > > This change breaks many (most? all?) MIPS kernels (universe, no special config, -DNO_CLEAN): Ugh, yes .. the build was broken by another change so I didn't notice  this in my builds. Sorry .. should be fixed as r328041. Pedro. > --- busdma_machdep.o --- > cc1: warnings being treated as errors > /usr/home/rpokala/freebsd/clean/base/head/sys/mips/mips/busdma_machdep.c: In function 'bus_dmamap_create': > /usr/home/rpokala/freebsd/clean/base/head/sys/mips/mips/busdma_machdep.c:539: warning: passing argument 2 of 'malloc' makes pointer from integer without a cast > /usr/home/rpokala/freebsd/clean/base/head/sys/mips/mips/busdma_machdep.c:539: warning: passing argument 3 of 'malloc' makes integer from pointer without a cast > /usr/home/rpokala/freebsd/clean/base/head/sys/mips/mips/busdma_machdep.c:539: error: too many arguments to function 'malloc' > /usr/home/rpokala/freebsd/clean/base/head/sys/mips/mips/busdma_machdep.c: In function 'bus_dmamem_alloc': > /usr/home/rpokala/freebsd/clean/base/head/sys/mips/mips/busdma_machdep.c:651: warning: passing argument 2 of 'malloc' makes pointer from integer without a cast > /usr/home/rpokala/freebsd/clean/base/head/sys/mips/mips/busdma_machdep.c:651: warning: passing argument 3 of 'malloc' makes integer from pointer without a cast > /usr/home/rpokala/freebsd/clean/base/head/sys/mips/mips/busdma_machdep.c:651: error: too many arguments to function 'malloc' > > Thanks, > > Ravi (rpokala@) > > > -----Original Message----- > From: on behalf of "Pedro F. Giffuni" > Date: 2018-01-15, Monday at 13:13 > To: , , > Subject: svn commit: r328020 - in head/sys/mips: mips nlm/dev/sec > > Author: pfg > Date: Mon Jan 15 21:13:30 2018 > New Revision: 328020 > URL: https://svnweb.freebsd.org/changeset/base/328020 > > Log: > mips: make some use of mallocarray(9). > > Focus on code where we are doing multiplications within malloc(9). None of > these ire likely to overflow, however the change is still useful as some > static checkers can benefit from the allocation attributes we use for > mallocarray. > > This initial sweep only covers malloc(9) calls with M_NOWAIT. No good > reason but I started doing the changes before r327796 and at that time it > was convenient to make sure the sorrounding code could handle NULL values. > > X-Differential revision: https://reviews.freebsd.org/D13837 > > Modified: > head/sys/mips/mips/busdma_machdep.c > head/sys/mips/nlm/dev/sec/nlmrsa.c > > Modified: head/sys/mips/mips/busdma_machdep.c > ============================================================================== > --- head/sys/mips/mips/busdma_machdep.c Mon Jan 15 21:11:38 2018 (r328019) > +++ head/sys/mips/mips/busdma_machdep.c Mon Jan 15 21:13:30 2018 (r328020) > @@ -345,7 +345,8 @@ _busdma_alloc_dmamap(bus_dma_tag_t dmat) > struct sync_list *slist; > bus_dmamap_t map; > > - slist = malloc(sizeof(*slist) * dmat->nsegments, M_BUSDMA, M_NOWAIT); > + slist = mallocarray(dmat->nsegments, sizeof(*slist), M_BUSDMA, > + M_NOWAIT); > if (slist == NULL) > return (NULL); > map = uma_zalloc_arg(dmamap_zone, dmat, M_NOWAIT); > @@ -534,9 +535,8 @@ bus_dmamap_create(bus_dma_tag_t dmat, int flags, bus_d > int error = 0; > > if (dmat->segments == NULL) { > - dmat->segments = (bus_dma_segment_t *)malloc( > - sizeof(bus_dma_segment_t) * dmat->nsegments, M_BUSDMA, > - M_NOWAIT); > + dmat->segments = (bus_dma_segment_t *)malloc(dmat->nsegments, > + sizeof(bus_dma_segment_t), M_BUSDMA, M_NOWAIT); > if (dmat->segments == NULL) { > CTR3(KTR_BUSDMA, "%s: tag %p error %d", > __func__, dmat, ENOMEM); > @@ -647,9 +647,8 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddrp, in > else > mflags = M_WAITOK; > if (dmat->segments == NULL) { > - dmat->segments = (bus_dma_segment_t *)malloc( > - sizeof(bus_dma_segment_t) * dmat->nsegments, M_BUSDMA, > - mflags); > + dmat->segments = (bus_dma_segment_t *)malloc(dmat->nsegments, > + sizeof(bus_dma_segment_t), M_BUSDMA, mflags); > if (dmat->segments == NULL) { > CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", > __func__, dmat, dmat->flags, ENOMEM); > > Modified: head/sys/mips/nlm/dev/sec/nlmrsa.c > ============================================================================== > --- head/sys/mips/nlm/dev/sec/nlmrsa.c Mon Jan 15 21:11:38 2018 (r328019) > +++ head/sys/mips/nlm/dev/sec/nlmrsa.c Mon Jan 15 21:13:30 2018 (r328020) > @@ -346,7 +346,7 @@ xlp_rsa_newsession(device_t dev, u_int32_t *sidp, stru > > if (ses == NULL) { > sesn = sc->sc_nsessions; > - ses = malloc((sesn + 1) * sizeof(*ses), > + ses = mallocarray(sesn + 1, sizeof(*ses), > M_DEVBUF, M_NOWAIT); > if (ses == NULL) > return (ENOMEM); > @@ -528,8 +528,9 @@ xlp_rsa_kprocess(device_t dev, struct cryptkop *krp, i > goto errout; > } > cmd->rsafn = 0; /* Mod Exp */ > - cmd->rsasrc = malloc( > - cmd->rsaopsize * (krp->krp_iparams + krp->krp_oparams), > + cmd->rsasrc = mallocarray( > + krp->krp_iparams + krp->krp_oparams, > + cmd->rsaopsize, > M_DEVBUF, > M_NOWAIT | M_ZERO); > if (cmd->rsasrc == NULL) { > > > > From owner-svn-src-head@freebsd.org Tue Jan 16 06:29:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0EA6E7BEC9; Tue, 16 Jan 2018 06:29:27 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from pv33p00im-asmtp001.mac.com (pv33p00im-asmtp001.me.com [17.142.194.250]) (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 A25D368BB3; Tue, 16 Jan 2018 06:29:27 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from process-dkim-sign-daemon.pv33p00im-asmtp001.me.com by pv33p00im-asmtp001.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) id <0P2M00700WW8LV00@pv33p00im-asmtp001.me.com>; Tue, 16 Jan 2018 06:29:26 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mac.com; s=04042017; t=1516084166; bh=A5SZOur6C83vgqErsJCYUh+OmNpn9YsB1yx2/ThQPRE=; h=Date:Subject:From:To:Message-id:MIME-version:Content-type; b=uPSD+zLBYaUdDq3Apa54UnYZJdXYsT6GJaw+NRtCRfpqvFHpW2GSXBcM46MjiaJ+O eqLT54xOEBGgOHJsNVAixjP0/stzYJLThiRUdUDzxoisPDDTzCIRcHDzJotrUyxpHO KVCZOSxOBA3+WdW8nupC06cjbUygvEGSKeu3GfTlW4UsK47pZ55FiN2hEsuK1nYSQC DXXi1D+3RX216yxTZqRNsmo/9JVvQP6klpPsSh2t43BAft/L0K4ZNUojcnZkCenhtM w2QwJsVjIBjwJpdQdMQ3zRPDGjAiA8aYLX4RJr6yzgip4gs6NST6jSca++6yiaBgHV 22iq41u+rwsmA== Received: from icloud.com ([127.0.0.1]) by pv33p00im-asmtp001.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) with ESMTPSA id <0P2M00DAHY0ZKA10@pv33p00im-asmtp001.me.com>; Tue, 16 Jan 2018 06:29:25 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-01-16_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1801160095 User-Agent: Microsoft-MacOutlook/f.29.0.171205 Date: Mon, 15 Jan 2018 22:29:22 -0800 Subject: Re: svn commit: r328020 - in head/sys/mips: mips nlm/dev/sec From: Ravi Pokala To: Pedro Giffuni , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-id: <7275ECDF-EF17-4027-8907-5FE0A28D06F2@mac.com> Thread-topic: svn commit: r328020 - in head/sys/mips: mips nlm/dev/sec References: <201801152113.w0FLDUUn065783@repo.freebsd.org> <560DA44B-159E-431D-B388-4E5E8962E1CD@mac.com> <945535f7-119f-1da4-c64c-f7a7e99e467a@FreeBSD.org> In-reply-to: <945535f7-119f-1da4-c64c-f7a7e99e467a@FreeBSD.org> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jan 2018 06:29:27 -0000 Thanks! -Ravi (rpokala@) -----Original Message----- From: on behalf of Pedro Giffuni Date: 2018-01-15, Monday at 22:06 To: Ravi Pokala , , , Subject: Re: svn commit: r328020 - in head/sys/mips: mips nlm/dev/sec Thanks for the report; On 01/16/18 00:23, Ravi Pokala wrote: > Hi Pedro, > > This change breaks many (most? all?) MIPS kernels (universe, no special config, -DNO_CLEAN): Ugh, yes .. the build was broken by another change so I didn't notice this in my builds. Sorry .. should be fixed as r328041. Pedro. > --- busdma_machdep.o --- > cc1: warnings being treated as errors > /usr/home/rpokala/freebsd/clean/base/head/sys/mips/mips/busdma_machdep.c: In function 'bus_dmamap_create': > /usr/home/rpokala/freebsd/clean/base/head/sys/mips/mips/busdma_machdep.c:539: warning: passing argument 2 of 'malloc' makes pointer from integer without a cast > /usr/home/rpokala/freebsd/clean/base/head/sys/mips/mips/busdma_machdep.c:539: warning: passing argument 3 of 'malloc' makes integer from pointer without a cast > /usr/home/rpokala/freebsd/clean/base/head/sys/mips/mips/busdma_machdep.c:539: error: too many arguments to function 'malloc' > /usr/home/rpokala/freebsd/clean/base/head/sys/mips/mips/busdma_machdep.c: In function 'bus_dmamem_alloc': > /usr/home/rpokala/freebsd/clean/base/head/sys/mips/mips/busdma_machdep.c:651: warning: passing argument 2 of 'malloc' makes pointer from integer without a cast > /usr/home/rpokala/freebsd/clean/base/head/sys/mips/mips/busdma_machdep.c:651: warning: passing argument 3 of 'malloc' makes integer from pointer without a cast > /usr/home/rpokala/freebsd/clean/base/head/sys/mips/mips/busdma_machdep.c:651: error: too many arguments to function 'malloc' > > Thanks, > > Ravi (rpokala@) > > > -----Original Message----- > From: on behalf of "Pedro F. Giffuni" > Date: 2018-01-15, Monday at 13:13 > To: , , > Subject: svn commit: r328020 - in head/sys/mips: mips nlm/dev/sec > > Author: pfg > Date: Mon Jan 15 21:13:30 2018 > New Revision: 328020 > URL: https://svnweb.freebsd.org/changeset/base/328020 > > Log: > mips: make some use of mallocarray(9). > > Focus on code where we are doing multiplications within malloc(9). None of > these ire likely to overflow, however the change is still useful as some > static checkers can benefit from the allocation attributes we use for > mallocarray. > > This initial sweep only covers malloc(9) calls with M_NOWAIT. No good > reason but I started doing the changes before r327796 and at that time it > was convenient to make sure the sorrounding code could handle NULL values. > > X-Differential revision: https://reviews.freebsd.org/D13837 > > Modified: > head/sys/mips/mips/busdma_machdep.c > head/sys/mips/nlm/dev/sec/nlmrsa.c > > Modified: head/sys/mips/mips/busdma_machdep.c > ============================================================================== > --- head/sys/mips/mips/busdma_machdep.c Mon Jan 15 21:11:38 2018 (r328019) > +++ head/sys/mips/mips/busdma_machdep.c Mon Jan 15 21:13:30 2018 (r328020) > @@ -345,7 +345,8 @@ _busdma_alloc_dmamap(bus_dma_tag_t dmat) > struct sync_list *slist; > bus_dmamap_t map; > > - slist = malloc(sizeof(*slist) * dmat->nsegments, M_BUSDMA, M_NOWAIT); > + slist = mallocarray(dmat->nsegments, sizeof(*slist), M_BUSDMA, > + M_NOWAIT); > if (slist == NULL) > return (NULL); > map = uma_zalloc_arg(dmamap_zone, dmat, M_NOWAIT); > @@ -534,9 +535,8 @@ bus_dmamap_create(bus_dma_tag_t dmat, int flags, bus_d > int error = 0; > > if (dmat->segments == NULL) { > - dmat->segments = (bus_dma_segment_t *)malloc( > - sizeof(bus_dma_segment_t) * dmat->nsegments, M_BUSDMA, > - M_NOWAIT); > + dmat->segments = (bus_dma_segment_t *)malloc(dmat->nsegments, > + sizeof(bus_dma_segment_t), M_BUSDMA, M_NOWAIT); > if (dmat->segments == NULL) { > CTR3(KTR_BUSDMA, "%s: tag %p error %d", > __func__, dmat, ENOMEM); > @@ -647,9 +647,8 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddrp, in > else > mflags = M_WAITOK; > if (dmat->segments == NULL) { > - dmat->segments = (bus_dma_segment_t *)malloc( > - sizeof(bus_dma_segment_t) * dmat->nsegments, M_BUSDMA, > - mflags); > + dmat->segments = (bus_dma_segment_t *)malloc(dmat->nsegments, > + sizeof(bus_dma_segment_t), M_BUSDMA, mflags); > if (dmat->segments == NULL) { > CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", > __func__, dmat, dmat->flags, ENOMEM); > > Modified: head/sys/mips/nlm/dev/sec/nlmrsa.c > ============================================================================== > --- head/sys/mips/nlm/dev/sec/nlmrsa.c Mon Jan 15 21:11:38 2018 (r328019) > +++ head/sys/mips/nlm/dev/sec/nlmrsa.c Mon Jan 15 21:13:30 2018 (r328020) > @@ -346,7 +346,7 @@ xlp_rsa_newsession(device_t dev, u_int32_t *sidp, stru > > if (ses == NULL) { > sesn = sc->sc_nsessions; > - ses = malloc((sesn + 1) * sizeof(*ses), > + ses = mallocarray(sesn + 1, sizeof(*ses), > M_DEVBUF, M_NOWAIT); > if (ses == NULL) > return (ENOMEM); > @@ -528,8 +528,9 @@ xlp_rsa_kprocess(device_t dev, struct cryptkop *krp, i > goto errout; > } > cmd->rsafn = 0; /* Mod Exp */ > - cmd->rsasrc = malloc( > - cmd->rsaopsize * (krp->krp_iparams + krp->krp_oparams), > + cmd->rsasrc = mallocarray( > + krp->krp_iparams + krp->krp_oparams, > + cmd->rsaopsize, > M_DEVBUF, > M_NOWAIT | M_ZERO); > if (cmd->rsasrc == NULL) { > > > > From owner-svn-src-head@freebsd.org Tue Jan 16 09:31:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A7A9EB7A73; Tue, 16 Jan 2018 09:31:03 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 031B970074; Tue, 16 Jan 2018 09:31:03 +0000 (UTC) (envelope-from br@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 277341E8E5; Tue, 16 Jan 2018 09:31:02 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0G9V2V7078828; Tue, 16 Jan 2018 09:31:02 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0G9V2k8078827; Tue, 16 Jan 2018 09:31:02 GMT (envelope-from br@FreeBSD.org) Message-Id: <201801160931.w0G9V2k8078827@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 16 Jan 2018 09:31:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328044 - head/lib/libpmcstat X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/lib/libpmcstat X-SVN-Commit-Revision: 328044 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jan 2018 09:31:03 -0000 Author: br Date: Tue Jan 16 09:31:01 2018 New Revision: 328044 URL: https://svnweb.freebsd.org/changeset/base/328044 Log: Fix bug: increment the value of pmcstat_npmcs instead of moving pointer to the next int position. Bug was introduced in r324959 ("Extract a set of pmcstat functions and interfaces to the new internal library -- libpmcstat.") This fixes pmcstat top mode (-T) operation. Example: pmcstat -n1 -S clock.hard -T Reported by: Peter Holm Sponsored by: DARPA, AFRL Modified: head/lib/libpmcstat/libpmcstat_logging.c Modified: head/lib/libpmcstat/libpmcstat_logging.c ============================================================================== --- head/lib/libpmcstat/libpmcstat_logging.c Tue Jan 16 08:00:07 2018 (r328043) +++ head/lib/libpmcstat/libpmcstat_logging.c Tue Jan 16 09:31:01 2018 (r328044) @@ -101,7 +101,7 @@ pmcstat_pmcid_add(pmc_id_t pmcid, pmcstat_interned_str pr->pr_pmcid = pmcid; pr->pr_pmcname = ps; - pr->pr_pmcin = *pmcstat_npmcs++; + pr->pr_pmcin = (*pmcstat_npmcs)++; pr->pr_samples = 0; pr->pr_dubious_frames = 0; pr->pr_merge = prm == NULL ? pr : prm; From owner-svn-src-head@freebsd.org Tue Jan 16 18:20:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B994AE7F5D0; Tue, 16 Jan 2018 18:20:13 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 785CF288F; Tue, 16 Jan 2018 18:20:13 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AEEDC23F90; Tue, 16 Jan 2018 18:20:12 +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 w0GIKCN4098091; Tue, 16 Jan 2018 18:20:12 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0GIKCNi098087; Tue, 16 Jan 2018 18:20:12 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201801161820.w0GIKCNi098087@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 16 Jan 2018 18:20:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328052 - head/usr.sbin/kldxref X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.sbin/kldxref X-SVN-Commit-Revision: 328052 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jan 2018 18:20:13 -0000 Author: emaste Date: Tue Jan 16 18:20:12 2018 New Revision: 328052 URL: https://svnweb.freebsd.org/changeset/base/328052 Log: kldxref: handle modules with md_cval at the end of allocated sections Attempting to retrieve an md_cval string from a kernel module with kldxref would throw a offset error for modules created using lld, since this value would be placed at the end of all allocated sections. Add an ef_read_seg_string method to the ef interface, to allow reading strings of varying size without attempting to read beyond the segment's bounds. PR: 224875 Submitted by: Mitchell Horne Reviewed by: cem, kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D13923 Modified: head/usr.sbin/kldxref/ef.c head/usr.sbin/kldxref/ef.h head/usr.sbin/kldxref/ef_obj.c head/usr.sbin/kldxref/kldxref.c Modified: head/usr.sbin/kldxref/ef.c ============================================================================== --- head/usr.sbin/kldxref/ef.c Tue Jan 16 11:25:08 2018 (r328051) +++ head/usr.sbin/kldxref/ef.c Tue Jan 16 18:20:12 2018 (r328052) @@ -90,6 +90,8 @@ static int ef_read_entry(elf_file_t ef, Elf_Off offset static int ef_seg_read(elf_file_t ef, Elf_Off offset, size_t len, void *dest); static int ef_seg_read_rel(elf_file_t ef, Elf_Off offset, size_t len, void *dest); +static int ef_seg_read_string(elf_file_t ef, Elf_Off offset, size_t len, + char *dest); static int ef_seg_read_entry(elf_file_t ef, Elf_Off offset, size_t len, void **ptr); static int ef_seg_read_entry_rel(elf_file_t ef, Elf_Off offset, size_t len, @@ -106,6 +108,7 @@ static struct elf_file_ops ef_file_ops = { ef_read_entry, ef_seg_read, ef_seg_read_rel, + ef_seg_read_string, ef_seg_read_entry, ef_seg_read_entry_rel, ef_symaddr, @@ -494,6 +497,28 @@ ef_seg_read_rel(elf_file_t ef, Elf_Off offset, size_t if (error != 0) return (error); } + return (0); +} + +static int +ef_seg_read_string(elf_file_t ef, Elf_Off offset, size_t len, char *dest) +{ + u_long ofs = ef_get_offset(ef, offset); + ssize_t r; + + if (ofs == 0 || ofs == (Elf_Off)-1) { + if (ef->ef_verbose) + warnx("ef_seg_read_string(%s): bad offset (%lx:%ld)", + ef->ef_name, (long)offset, ofs); + return (EFAULT); + } + + r = pread(ef->ef_fd, dest, len, ofs); + if (r < 0) + return (errno); + if (strnlen(dest, len) == len) + return (EFAULT); + return (0); } Modified: head/usr.sbin/kldxref/ef.h ============================================================================== --- head/usr.sbin/kldxref/ef.h Tue Jan 16 11:25:08 2018 (r328051) +++ head/usr.sbin/kldxref/ef.h Tue Jan 16 18:20:12 2018 (r328052) @@ -21,6 +21,8 @@ (ef)->ef_ops->seg_read((ef)->ef_ef, offset, len, dest) #define EF_SEG_READ_REL(ef, offset, len, dest) \ (ef)->ef_ops->seg_read_rel((ef)->ef_ef, offset, len, dest) +#define EF_SEG_READ_STRING(ef, offset, len, dest) \ + (ef)->ef_ops->seg_read_string((ef)->ef_ef, offset, len, dest) #define EF_SEG_READ_ENTRY(ef, offset, len, ptr) \ (ef)->ef_ops->seg_read_entry((ef)->kf_ef, offset, len, ptr) #define EF_SEG_READ_ENTRY_REL(ef, offset, len, ptr) \ @@ -44,6 +46,8 @@ struct elf_file_ops { int (*seg_read)(elf_file_t ef, Elf_Off offset, size_t len, void *dest); int (*seg_read_rel)(elf_file_t ef, Elf_Off offset, size_t len, void *dest); + int (*seg_read_string)(elf_file_t, Elf_Off offset, size_t len, + char *dest); int (*seg_read_entry)(elf_file_t ef, Elf_Off offset, size_t len, void**ptr); int (*seg_read_entry_rel)(elf_file_t ef, Elf_Off offset, size_t len, Modified: head/usr.sbin/kldxref/ef_obj.c ============================================================================== --- head/usr.sbin/kldxref/ef_obj.c Tue Jan 16 11:25:08 2018 (r328051) +++ head/usr.sbin/kldxref/ef_obj.c Tue Jan 16 18:20:12 2018 (r328052) @@ -110,6 +110,8 @@ static int ef_obj_seg_read(elf_file_t ef, Elf_Off offs void *dest); static int ef_obj_seg_read_rel(elf_file_t ef, Elf_Off offset, size_t len, void *dest); +static int ef_obj_seg_read_string(elf_file_t ef, Elf_Off offset, size_t len, + char *dest); static int ef_obj_seg_read_entry(elf_file_t ef, Elf_Off offset, size_t len, void **ptr); static int ef_obj_seg_read_entry_rel(elf_file_t ef, Elf_Off offset, size_t len, @@ -126,6 +128,7 @@ static struct elf_file_ops ef_obj_file_ops = { ef_obj_read_entry, ef_obj_seg_read, ef_obj_seg_read_rel, + ef_obj_seg_read_string, ef_obj_seg_read_entry, ef_obj_seg_read_entry_rel, ef_obj_symaddr, @@ -295,6 +298,27 @@ ef_obj_seg_read_rel(elf_file_t ef, Elf_Off offset, siz return (error); } } + return (0); +} + +static int +ef_obj_seg_read_string(elf_file_t ef, Elf_Off offset, size_t len, char *dest) +{ + + if (offset >= ef->size) { + if (ef->ef_verbose) + warnx("ef_obj_seg_read_string(%s): bad offset (%lx)", + ef->ef_name, (long)offset); + return (EFAULT); + } + + if (ef->size - offset < len) + len = ef->size - offset; + + if (strnlen(ef->address + offset, len) == len) + return (EFAULT); + + memcpy(dest, ef->address + offset, len); return (0); } Modified: head/usr.sbin/kldxref/kldxref.c ============================================================================== --- head/usr.sbin/kldxref/kldxref.c Tue Jan 16 11:25:08 2018 (r328051) +++ head/usr.sbin/kldxref/kldxref.c Tue Jan 16 18:20:12 2018 (r328052) @@ -571,9 +571,8 @@ read_kld(char *filename, char *kldname) check(EF_SEG_READ_REL(&ef, (Elf_Off)*p, sizeof(md), &md)); p++; - check(EF_SEG_READ(&ef, (Elf_Off)md.md_cval, + check(EF_SEG_READ_STRING(&ef, (Elf_Off)md.md_cval, sizeof(cval), cval)); - cval[MAXMODNAME] = '\0'; parse_entry(&md, cval, &ef, kldname); } if (error) From owner-svn-src-head@freebsd.org Tue Jan 16 18:36:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A1AFEA6913; Tue, 16 Jan 2018 18:36:28 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D1E5A3B04; Tue, 16 Jan 2018 18:36:27 +0000 (UTC) (envelope-from philip@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 25E6A242B6; Tue, 16 Jan 2018 18:36:27 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0GIaR1A006817; Tue, 16 Jan 2018 18:36:27 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0GIaP1N006804; Tue, 16 Jan 2018 18:36:25 GMT (envelope-from philip@FreeBSD.org) Message-Id: <201801161836.w0GIaP1N006804@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Tue, 16 Jan 2018 18:36:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328055 - head/contrib/tzdata X-SVN-Group: head X-SVN-Commit-Author: philip X-SVN-Commit-Paths: head/contrib/tzdata X-SVN-Commit-Revision: 328055 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jan 2018 18:36:28 -0000 Author: philip Date: Tue Jan 16 18:36:25 2018 New Revision: 328055 URL: https://svnweb.freebsd.org/changeset/base/328055 Log: Import tzdata 2018a Changes: https://github.com/eggert/tz/blob/2018a/NEWS MFC after: 3 days Deleted: head/contrib/tzdata/pacificnew Modified: head/contrib/tzdata/Makefile head/contrib/tzdata/NEWS head/contrib/tzdata/README head/contrib/tzdata/africa head/contrib/tzdata/asia head/contrib/tzdata/australasia head/contrib/tzdata/backzone head/contrib/tzdata/europe head/contrib/tzdata/northamerica head/contrib/tzdata/southamerica head/contrib/tzdata/theory.html head/contrib/tzdata/version head/contrib/tzdata/zishrink.awk head/contrib/tzdata/zone.tab head/contrib/tzdata/zone1970.tab Directory Properties: head/contrib/tzdata/ (props changed) Modified: head/contrib/tzdata/Makefile ============================================================================== --- head/contrib/tzdata/Makefile Tue Jan 16 18:27:26 2018 (r328054) +++ head/contrib/tzdata/Makefile Tue Jan 16 18:36:25 2018 (r328055) @@ -42,37 +42,64 @@ POSIXRULES= America/New_York # Also see TZDEFRULESTRING below, which takes effect only # if the time zone files cannot be accessed. -# Everything gets put in subdirectories of. . . -TOPDIR= /usr/local +# Installation locations. +# +# The defaults are suitable for Debian, except that if REDO is +# posix_right or right_posix then files that Debian puts under +# /usr/share/zoneinfo/posix and /usr/share/zoneinfo/right are instead +# put under /usr/share/zoneinfo-posix and /usr/share/zoneinfo-leaps, +# respectively. Problems with the Debian approach are discussed in +# the commentary for the right_posix rule (below). +# Destination directory, which can be used for staging. +# 'make DESTDIR=/stage install' installs under /stage (e.g., to +# /stage/etc/localtime instead of to /etc/localtime). Files under +# /stage are not intended to work as-is, but can be copied by hand to +# the root directory later. If DESTDIR is empty, 'make install' does +# not stage, but installs directly into production locations. +DESTDIR = + +# Everything is installed into subdirectories of TOPDIR, and used there. +# TOPDIR should be empty (meaning the root directory), +# or a directory name that does not end in "/". +# TOPDIR should be empty or an absolute name unless you're just testing. +TOPDIR = + +# The default local time zone is taken from the file TZDEFAULT. +TZDEFAULT = $(TOPDIR)/etc/localtime + +# The subdirectory containing installed program and data files, and +# likewise for installed files that can be shared among architectures. +# These should be relative file names. +USRDIR = usr +USRSHAREDIR = $(USRDIR)/share + # "Compiled" time zone information is placed in the "TZDIR" directory # (and subdirectories). -# Use an absolute path name for TZDIR unless you're just testing the software. # TZDIR_BASENAME should not contain "/" and should not be ".", ".." or empty. - TZDIR_BASENAME= zoneinfo -TZDIR= $(TOPDIR)/etc/$(TZDIR_BASENAME) +TZDIR = $(TOPDIR)/$(USRSHAREDIR)/$(TZDIR_BASENAME) -# Types to try, as an alternative to time_t. int64_t should be first. -TIME_T_ALTERNATIVES= int64_t int32_t uint32_t uint64_t +# The "tzselect" and (if you do "make INSTALL") "date" commands go in: +BINDIR = $(TOPDIR)/$(USRDIR)/bin -# The "tzselect", "zic", and "zdump" commands get installed in. . . +# The "zdump" command goes in: +ZDUMPDIR = $(BINDIR) -ETCDIR= $(TOPDIR)/etc +# The "zic" command goes in: +ZICDIR = $(TOPDIR)/$(USRDIR)/sbin -# If you "make INSTALL", the "date" command gets installed in. . . - -BINDIR= $(TOPDIR)/bin - # Manual pages go in subdirectories of. . . +MANDIR = $(TOPDIR)/$(USRSHAREDIR)/man -MANDIR= $(TOPDIR)/man - # Library functions are put in an archive in LIBDIR. +LIBDIR = $(TOPDIR)/$(USRDIR)/lib -LIBDIR= $(TOPDIR)/lib +# Types to try, as an alternative to time_t. int64_t should be first. +TIME_T_ALTERNATIVES = int64_t int32_t uint32_t uint64_t + # If you want only POSIX time, with time values interpreted as # seconds since the epoch (not counting leap seconds), use # REDO= posix_only @@ -105,11 +132,14 @@ REDO= posix_right TZDATA_TEXT= leapseconds tzdata.zi # For backward-compatibility links for old zone names, use +# BACKWARD= backward +# If you also want the link US/Pacific-New, even though it is confusing +# and is planned to be removed from the database eventually, use # BACKWARD= backward pacificnew # To omit these links, use # BACKWARD= -BACKWARD= backward pacificnew +BACKWARD= backward # If you want out-of-scope and often-wrong data from the file 'backzone', use # PACKRATDATA= backzone @@ -313,7 +343,7 @@ ZFLAGS= # How to use zic to install tz binary files. -ZIC_INSTALL= $(ZIC) -d $(DESTDIR)$(TZDIR) $(LEAPSECONDS) +ZIC_INSTALL= $(ZIC) -d '$(DESTDIR)$(TZDIR)' $(LEAPSECONDS) # The name of a Posix-compliant 'awk' on your system. AWK= awk @@ -341,8 +371,8 @@ SGML_CATALOG_FILES= \ VALIDATE = nsgmls VALIDATE_FLAGS = -s -B -wall -wno-unused-param VALIDATE_ENV = \ - SGML_CATALOG_FILES=$(SGML_CATALOG_FILES) \ - SGML_SEARCH_PATH=$(SGML_SEARCH_PATH) \ + SGML_CATALOG_FILES='$(SGML_CATALOG_FILES)' \ + SGML_SEARCH_PATH='$(SGML_SEARCH_PATH)' \ SP_CHARSET_FIXED=YES \ SP_ENCODING=UTF-8 @@ -396,7 +426,7 @@ GZIPFLAGS= -9n #MAKE= make cc= cc -CC= $(cc) -DTZDIR=\"$(TZDIR)\" +CC= $(cc) -DTZDIR='"$(TZDIR)"' AR= ar @@ -421,7 +451,7 @@ MANTXTS= newctime.3.txt newstrftime.3.txt newtzset.3.t date.1.txt COMMON= calendars CONTRIBUTING LICENSE Makefile \ NEWS README theory.html version -WEB_PAGES= tz-art.htm tz-how-to.html tz-link.htm +WEB_PAGES= tz-art.html tz-how-to.html tz-link.html DOCS= $(MANS) date.1 $(MANTXTS) $(WEB_PAGES) PRIMARY_YDATA= africa antarctica asia australasia \ europe northamerica southamerica @@ -431,7 +461,7 @@ TDATA= $(YDATA) $(NDATA) ZONETABLES= zone1970.tab zone.tab TABDATA= iso3166.tab $(TZDATA_TEXT) $(ZONETABLES) LEAP_DEPS= leapseconds.awk leap-seconds.list -TZDATA_ZI_DEPS= zishrink.awk $(TDATA) $(PACKRATDATA) +TZDATA_ZI_DEPS= zishrink.awk version $(TDATA) $(PACKRATDATA) DATA= $(YDATA) $(NDATA) backzone iso3166.tab leap-seconds.list \ leapseconds yearistype.sh $(ZONETABLES) AWK_SCRIPTS= checklinks.awk checktab.awk leapseconds.awk zishrink.awk @@ -457,7 +487,7 @@ VERSION_DEPS= \ newctime.3 newstrftime.3 newtzset.3 northamerica \ pacificnew private.h \ southamerica strftime.c systemv theory.html \ - time2posix.3 tz-art.htm tz-how-to.html tz-link.htm \ + time2posix.3 tz-art.html tz-how-to.html tz-link.html \ tzfile.5 tzfile.h tzselect.8 tzselect.ksh \ workman.sh yearistype.sh \ zdump.8 zdump.c zic.8 zic.c \ @@ -473,35 +503,41 @@ all: tzselect yearistype zic zdump libtz.a $(TABDATA) ALL: all date $(ENCHILADA) install: all $(DATA) $(REDO) $(MANS) - mkdir -p $(DESTDIR)$(ETCDIR) $(DESTDIR)$(TZDIR) \ - $(DESTDIR)$(LIBDIR) \ - $(DESTDIR)$(MANDIR)/man3 $(DESTDIR)$(MANDIR)/man5 \ - $(DESTDIR)$(MANDIR)/man8 - $(ZIC_INSTALL) -l $(LOCALTIME) -p $(POSIXRULES) - cp -f $(TABDATA) $(DESTDIR)$(TZDIR)/. - cp tzselect zic zdump $(DESTDIR)$(ETCDIR)/. - cp libtz.a $(DESTDIR)$(LIBDIR)/. - $(RANLIB) $(DESTDIR)$(LIBDIR)/libtz.a - cp -f newctime.3 newtzset.3 $(DESTDIR)$(MANDIR)/man3/. - cp -f tzfile.5 $(DESTDIR)$(MANDIR)/man5/. - cp -f tzselect.8 zdump.8 zic.8 $(DESTDIR)$(MANDIR)/man8/. + mkdir -p '$(DESTDIR)$(BINDIR)' \ + '$(DESTDIR)$(ZDUMPDIR)' '$(DESTDIR)$(ZICDIR)' \ + '$(DESTDIR)$(LIBDIR)' \ + '$(DESTDIR)$(MANDIR)/man3' '$(DESTDIR)$(MANDIR)/man5' \ + '$(DESTDIR)$(MANDIR)/man8' + $(ZIC_INSTALL) -l $(LOCALTIME) -p $(POSIXRULES) \ + -t '$(DESTDIR)$(TZDEFAULT)' + cp -f $(TABDATA) '$(DESTDIR)$(TZDIR)/.' + cp tzselect '$(DESTDIR)$(BINDIR)/.' + cp zdump '$(DESTDIR)$(ZDUMPDIR)/.' + cp zic '$(DESTDIR)$(ZICDIR)/.' + cp libtz.a '$(DESTDIR)$(LIBDIR)/.' + $(RANLIB) '$(DESTDIR)$(LIBDIR)/libtz.a' + cp -f newctime.3 newtzset.3 '$(DESTDIR)$(MANDIR)/man3/.' + cp -f tzfile.5 '$(DESTDIR)$(MANDIR)/man5/.' + cp -f tzselect.8 zdump.8 zic.8 '$(DESTDIR)$(MANDIR)/man8/.' INSTALL: ALL install date.1 - mkdir -p $(DESTDIR)$(BINDIR) $(DESTDIR)$(MANDIR)/man1 - cp date $(DESTDIR)$(BINDIR)/. - cp -f date.1 $(DESTDIR)$(MANDIR)/man1/. + mkdir -p '$(DESTDIR)$(BINDIR)' '$(DESTDIR)$(MANDIR)/man1' + cp date '$(DESTDIR)$(BINDIR)/.' + cp -f date.1 '$(DESTDIR)$(MANDIR)/man1/.' version: $(VERSION_DEPS) { (type git) >/dev/null 2>&1 && \ V=`git describe --match '[0-9][0-9][0-9][0-9][a-z]*' \ --abbrev=7 --dirty` || \ - V=$(VERSION); } && \ + V='$(VERSION)'; } && \ printf '%s\n' "$$V" >$@.out mv $@.out $@ # This file can be tailored by setting BACKWARD, PACKRATDATA, etc. tzdata.zi: $(TZDATA_ZI_DEPS) - LC_ALL=C $(AWK) -f zishrink.awk $(TDATA) $(PACKRATDATA) >$@.out + version=`sed 1q version` && \ + LC_ALL=C $(AWK) -v version="$$version" -f zishrink.awk \ + $(TDATA) $(PACKRATDATA) >$@.out mv $@.out $@ version.h: version @@ -529,12 +565,13 @@ leapseconds: $(LEAP_DEPS) # Arguments to pass to submakes of install_data. # They can be overridden by later submake arguments. INSTALLARGS = \ - BACKWARD=$(BACKWARD) \ - DESTDIR=$(DESTDIR) \ + BACKWARD='$(BACKWARD)' \ + DESTDIR='$(DESTDIR)' \ LEAPSECONDS='$(LEAPSECONDS)' \ PACKRATDATA='$(PACKRATDATA)' \ - TZDIR=$(TZDIR) \ - YEARISTYPE=$(YEARISTYPE) \ + TZDEFAULT='$(TZDEFAULT)' \ + TZDIR='$(TZDIR)' \ + YEARISTYPE='$(YEARISTYPE)' \ ZIC='$(ZIC)' # 'make install_data' installs one set of tz binary files. @@ -558,16 +595,16 @@ right_only: # You must replace all of $(TZDIR) to switch from not using leap seconds # to using them, or vice versa. right_posix: right_only - rm -fr $(DESTDIR)$(TZDIR)-leaps - ln -s $(TZDIR_BASENAME) $(DESTDIR)$(TZDIR)-leaps || \ - $(MAKE) $(INSTALLARGS) TZDIR=$(TZDIR)-leaps right_only - $(MAKE) $(INSTALLARGS) TZDIR=$(TZDIR)-posix posix_only + rm -fr '$(DESTDIR)$(TZDIR)-leaps' + ln -s '$(TZDIR_BASENAME)' '$(DESTDIR)$(TZDIR)-leaps' || \ + $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-leaps' right_only + $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-posix' posix_only posix_right: posix_only - rm -fr $(DESTDIR)$(TZDIR)-posix - ln -s $(TZDIR_BASENAME) $(DESTDIR)$(TZDIR)-posix || \ - $(MAKE) $(INSTALLARGS) TZDIR=$(TZDIR)-posix posix_only - $(MAKE) $(INSTALLARGS) TZDIR=$(TZDIR)-leaps right_only + rm -fr '$(DESTDIR)$(TZDIR)-posix' + ln -s '$(TZDIR_BASENAME)' '$(DESTDIR)$(TZDIR)-posix' || \ + $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-posix' posix_only + $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-leaps' right_only # This obsolescent rule is present for backwards compatibility with # tz releases 2014g through 2015g. It should go away eventually. @@ -764,7 +801,7 @@ set-timestamps.out: $(ENCHILADA) check_public: $(MAKE) maintainer-clean - $(MAKE) "CFLAGS=$(GCC_DEBUG_FLAGS)" ALL + $(MAKE) CFLAGS='$(GCC_DEBUG_FLAGS)' ALL mkdir -p public.dir for i in $(TDATA) tzdata.zi; do \ $(zic) -v -d public.dir $$i 2>&1 || exit; \ @@ -790,8 +827,11 @@ check_time_t_alternatives: REDO='$(REDO)' \ install && \ diff $$quiet_option -r \ - time_t.dir/int64_t/etc/zoneinfo \ - time_t.dir/$$type/etc/zoneinfo && \ + time_t.dir/int64_t/etc \ + time_t.dir/$$type/etc && \ + diff $$quiet_option -r \ + time_t.dir/int64_t/usr/share \ + time_t.dir/$$type/usr/share && \ case $$type in \ int32_t) range=-2147483648,2147483647;; \ uint32_t) range=0,4294967296;; \ @@ -800,9 +840,9 @@ check_time_t_alternatives: *) range=-10000000000,10000000000;; \ esac && \ echo checking $$type zones ... && \ - time_t.dir/int64_t/etc/zdump -V -t $$range $$zones \ + time_t.dir/int64_t/usr/bin/zdump -V -t $$range $$zones \ >time_t.dir/int64_t.out && \ - time_t.dir/$$type/etc/zdump -V -t $$range $$zones \ + time_t.dir/$$type/usr/bin/zdump -V -t $$range $$zones \ >time_t.dir/$$type.out && \ diff -u time_t.dir/int64_t.out time_t.dir/$$type.out \ || exit; \ Modified: head/contrib/tzdata/NEWS ============================================================================== --- head/contrib/tzdata/NEWS Tue Jan 16 18:27:26 2018 (r328054) +++ head/contrib/tzdata/NEWS Tue Jan 16 18:36:25 2018 (r328055) @@ -1,5 +1,101 @@ News for the tz database +Release 2018a - 2018-01-12 22:29:21 -0800 + + Briefly: + São Tomé and Príncipe switched from +00 to +01. + Brazil's DST will now start on November's first Sunday. + Ireland's standard time is now in the summer, not the winter. + Use Debian-style installation locations, instead of 4.3BSD-style. + New zic option -t. + + Changes to past and future time stamps + + São Tomé and Príncipe switched from +00 to +01 on 2018-01-01 at + 01:00. (Thanks to Steffen Thorsen and Michael Deckers.) + + Changes to future time stamps + + Starting in 2018 southern Brazil will begin DST on November's + first Sunday instead of October's third Sunday. (Thanks to + Steffen Thorsen.) + + Changes to past time stamps + + A discrepancy of 4 s in timestamps before 1931 in South Sudan has + been corrected. The 'backzone' and 'zone.tab' files did not agree + with the 'africa' and 'zone1970.tab' files. (Problem reported by + Michael Deckers.) + + The abbreviation invented for Bolivia Summer Time (1931-2) is now + BST instead of BOST, to be more consistent with the convention + used for Latvian Summer Time (1918-9) and for British Summer Time. + + Changes to tm_isdst + + Change Europe/Dublin so that it observes Irish Standard Time (UT + +01) in summer and GMT (as negative daylight-saving) in winter, + instead of observing standard time (GMT) in winter and Irish + Summer Time (UT +01) in summer. This change does not affect UT + offsets or abbreviations; it affects only whether timestamps are + considered to be standard time or daylight-saving time, as + expressed in the tm_isdst flag of C's struct tm type. + (Discrepancy noted by Derick Rethans.) + + Changes to build procedure + + The default installation locations have been changed to mostly + match Debian circa 2017, instead of being designed as an add-on to + 4.3BSD circa 1986. This affects the Makefile macros TOPDIR, + TZDIR, MANDIR, and LIBDIR. New Makefile macros TZDEFAULT, USRDIR, + USRSHAREDIR, BINDIR, ZDUMPDIR, and ZICDIR let installers tailor + locations more precisely. (This responds to suggestions from + Brian Inglis and from Steve Summit.) + + The default installation procedure no longer creates the + backward-compatibility link US/Pacific-New, which causes + confusion during user setup (e.g., see Debian bug 815200). + Use 'make BACKWARD="backward pacificnew"' to create the link + anyway, for now. Eventually we plan to remove the link entirely. + + tzdata.zi now contains a version-number comment. + (Suggested by Tom Lane.) + + The Makefile now quotes values like BACKWARD more carefully when + passing them to the shell. (Problem reported by Zefram.) + + Builders no longer need to specify -DHAVE_SNPRINTF on platforms + that have snprintf and use pre-C99 compilers. (Problem reported + by Jon Skeet.) + + Changes to code + + zic has a new option -t FILE that specifies the location of the + file that determines local time when TZ is unset. The default for + this location can be configured via the new TZDEFAULT makefile + macro, which defaults to /etc/localtime. + + Diagnostics and commentary now distinguish UT from UTC more + carefully; see theory.html for more information about UT vs UTC. + + zic has been ported to GCC 8's -Wstringop-truncation option. + (Problem reported by Martin Sebor.) + + Changes to documentation and commentary + + The zic man page now documents the longstanding behavior that + times and years can be out of the usual range, with negative times + counting backwards from midnight and with year 0 preceding year 1. + (Problem reported by Michael Deckers.) + + The theory.html file now mentions the POSIX limit of six chars + per abbreviation, and lists alphabetic abbreviations used. + + The files tz-art.htm and tz-link.htm have been renamed to + tz-art.html and tz-link.html, respectively, for consistency with + other file names and to simplify web server configuration. + + Release 2017c - 2017-10-20 14:49:34 -0700 Briefly: @@ -895,8 +991,8 @@ Release 2015f - 2015-08-10 18:06:56 -0700 (Thanks to Jon Skeet and Arthur David Olson.) Constraints on simultaneity are now documented. - The two characters '%z' in a zone format now stand for the UTC - offset, e.g., '-07' for seven hours behind UTC and '+0530' for + The two characters '%z' in a zone format now stand for the UT + offset, e.g., '-07' for seven hours behind UT and '+0530' for five hours and thirty minutes ahead. This better supports time zone abbreviations conforming to POSIX.1-2001 and later. @@ -1019,13 +1115,13 @@ Release 2015c - 2015-04-11 08:55:55 -0700 The spring 1988 transition was 1988-10-09, not 1988-10-02. The fall 1990 transition was 1990-03-11, not 1990-03-18. - Assume no UTC offset change for Pacific/Easter on 1890-01-01, + Assume no UT offset change for Pacific/Easter on 1890-01-01, and omit all transitions on Pacific/Easter from 1942 through 1946 since we have no data suggesting that they existed. One more zone has been turned into a link, as it differed from an existing zone only for older time stamps. As usual, - this change affects UTC offsets in pre-1970 time stamps only. + this change affects UT offsets in pre-1970 time stamps only. The zone's old contents have been moved to the 'backzone' file. The affected zone is America/Montreal. @@ -1055,7 +1151,7 @@ Release 2015b - 2015-03-19 23:28:11 -0700 Some more zones have been turned into links, when they differed from existing zones only for older time stamps. As usual, - these changes affect UTC offsets in pre-1970 time stamps only. + these changes affect UT offsets in pre-1970 time stamps only. Their old contents have been moved to the 'backzone' file. The affected zones are: America/Antigua, America/Cayman, Pacific/Midway, and Pacific/Saipan. @@ -1107,7 +1203,7 @@ Release 2015a - 2015-01-29 22:35:20 -0800 Some more zones have been turned into links, when they differed from existing zones only for older time stamps. As usual, - these changes affect UTC offsets in pre-1970 time stamps only. + these changes affect UT offsets in pre-1970 time stamps only. Their old contents have been moved to the 'backzone' file. The affected zones are: Asia/Aden, Asia/Bahrain, Asia/Kuwait, and Asia/Muscat. @@ -1154,7 +1250,7 @@ Release 2014j - 2014-11-10 17:37:11 -0800 Some more zones have been turned into links, when they differed from existing zones only for older time stamps. As usual, - these changes affect UTC offsets in pre-1970 time stamps only. + these changes affect UT offsets in pre-1970 time stamps only. Their old contents have been moved to the 'backzone' file. The affected zones are: Africa/Addis_Ababa, Africa/Asmara, Africa/Dar_es_Salaam, Africa/Djibouti, Africa/Kampala, @@ -1244,7 +1340,7 @@ Release 2014h - 2014-09-25 18:59:03 -0700 Some more zones have been turned into links, when they differed from existing zones only for older timestamps. As usual, - these changes affect UTC offsets in pre-1970 timestamps only. + these changes affect UT offsets in pre-1970 timestamps only. Their old contents have been moved to the 'backzone' file. The affected zones are: Africa/Blantyre, Africa/Bujumbura, Africa/Gaborone, Africa/Harare, Africa/Kigali, Africa/Lubumbashi, @@ -1329,7 +1425,7 @@ Release 2014g - 2014-08-28 12:31:23 -0700 Some more zones have been turned into links, when they differed from existing zones only for older timestamps. As usual, - these changes affect UTC offsets in pre-1970 timestamps only. + these changes affect UT offsets in pre-1970 timestamps only. Their old contents have been moved to the 'backzone' file. The affected zones are: Africa/Bangui, Africa/Brazzaville, Africa/Douala, Africa/Kinshasa, Africa/Libreville, Africa/Luanda, @@ -1479,7 +1575,7 @@ Release 2014f - 2014-08-05 17:42:36 -0700 standard and daylight saving time the abbreviations are AEST and AEDT instead of the former EST for both; similarly, ACST/ACDT, ACWST/ACWDT, and AWST/AWDT are now used instead of the former CST, CWST, and WST. - This change does not affect UTC offsets, only time zone abbreviations. + This change does not affect UT offsets, only time zone abbreviations. (Thanks to Rich Tibbett and many others.) Asia/Novokuznetsk shifts from NOVT to KRAT (remaining on UT +07) @@ -1516,8 +1612,8 @@ Release 2014f - 2014-08-05 17:42:36 -0700 Treindl sent helpful translations of two papers by Guo Qingsheng.) Some zones have been turned into links, when they differed from existing - zones only for older UTC offsets where data entries were likely invented. - These changes affect UTC offsets in pre-1970 timestamps only. This is + zones only for older UT offsets where data entries were likely invented. + These changes affect UT offsets in pre-1970 timestamps only. This is similar to the change in release 2013e, except this time for western Africa. The affected zones are: Africa/Bamako, Africa/Banjul, Africa/Conakry, Africa/Dakar, Africa/Freetown, Africa/Lome, Modified: head/contrib/tzdata/README ============================================================================== --- head/contrib/tzdata/README Tue Jan 16 18:27:26 2018 (r328054) +++ head/contrib/tzdata/README Tue Jan 16 18:36:25 2018 (r328055) @@ -11,7 +11,7 @@ changes made by political bodies to time zone boundari and daylight-saving rules. See or the -file tz-link.htm for how to acquire the code and data. Once acquired, +file tz-link.html for how to acquire the code and data. Once acquired, read the comments in the file 'Makefile' and make any changes needed to make things right for your system, especially if you are using some platform other than GNU/Linux. Then run the following commands, Modified: head/contrib/tzdata/africa ============================================================================== --- head/contrib/tzdata/africa Tue Jan 16 18:27:26 2018 (r328054) +++ head/contrib/tzdata/africa Tue Jan 16 18:36:25 2018 (r328055) @@ -158,7 +158,6 @@ Link Africa/Abidjan Africa/Freetown # Sierra Leone Link Africa/Abidjan Africa/Lome # Togo Link Africa/Abidjan Africa/Nouakchott # Mauritania Link Africa/Abidjan Africa/Ouagadougou # Burkina Faso -Link Africa/Abidjan Africa/Sao_Tome # São Tomé and Príncipe Link Africa/Abidjan Atlantic/St_Helena # St Helena # Djibouti @@ -425,7 +424,7 @@ Link Africa/Nairobi Indian/Mayotte # # The Nautical Almanac for the Year 1970, p 264, is the source for -0:44:30. # -# In 1972 Liberia was the last country to switch from a UTC offset +# In 1972 Liberia was the last country to switch from a UT offset # that was not a multiple of 15 or 20 minutes. The 1972 change was on # 1972-01-07, according to an entry dated 1972-01-04 on p 330 of: # Presidential Papers: First year of the administration of @@ -1037,6 +1036,19 @@ Zone Indian/Reunion 3:41:52 - LMT 1911 Jun # Saint-Den # Inaccessible, Nightingale: uninhabited # São Tomé and Príncipe + +# From Steffen Thorsen (2018-01-08): +# Multiple sources tell that São Tomé changed from UTC to UTC+1 as +# they entered the year 2018. +# From Michael Deckers (2018-01-08): +# the switch is from 01:00 to 02:00 ... [Decree No. 25/2017] +# http://www.mnec.gov.st/index.php/publicacoes/documentos/file/90-decreto-lei-n-25-2017 + +Zone Africa/Sao_Tome 0:26:56 - LMT 1884 + -0:36:45 - LMT 1912 # Lisbon Mean Time + 0:00 - GMT 2018 Jan 1 01:00 + 1:00 - WAT + # Senegal # See Africa/Abidjan. Modified: head/contrib/tzdata/asia ============================================================================== --- head/contrib/tzdata/asia Tue Jan 16 18:27:26 2018 (r328054) +++ head/contrib/tzdata/asia Tue Jan 16 18:36:25 2018 (r328055) @@ -50,7 +50,7 @@ # 9:00 KST KDT Korea when at +09 # 9:30 ACST Australian Central Standard Time # Otherwise, these tables typically use numeric abbreviations like +03 -# and +0330 for integer hour and minute UTC offsets. Although earlier +# and +0330 for integer hour and minute UT offsets. Although earlier # editions invented alphabetic time zone abbreviations for every # offset, this did not reflect common practice. # @@ -647,17 +647,17 @@ Zone Asia/Hong_Kong 7:36:42 - LMT 1904 Oct 30 # time", in which abolished the adoption of Western Standard Time in # western islands (listed above), which means the whole Japan # territory, including later occupations, adopt Japan Central Time -# (UTC+9). The adoption began on Oct 1, 1937. The original text can +# (UT+9). The adoption began on Oct 1, 1937. The original text can # be found on Wikisource: # https://ja.wikisource.org/wiki/明治二å八年勅令第百六å七號標準時ニ關スル件中改正ノ件 # -# That is, the time zone of Taipei switched to UTC+9 on Oct 1, 1937. +# That is, the time zone of Taipei switched to UT+9 on Oct 1, 1937. # From Yu-Cheng Chuang (2014-07-02): -# I've found more evidence about when the time zone was switched from UTC+9 -# back to UTC+8 after WW2. I believe it was on Sep 21, 1945. In a document +# I've found more evidence about when the time zone was switched from UT+9 +# back to UT+8 after WW2. I believe it was on Sep 21, 1945. In a document # during Japanese era [1] in which the officer told the staff to change time -# zone back to Western Standard Time (UTC+8) on Sep 21. And in another +# zone back to Western Standard Time (UT+8) on Sep 21. And in another # history page of National Cheng Kung University [2], on Sep 21 there is a # note "from today, switch back to Western Standard Time". From these two # materials, I believe that the time zone change happened on Sep 21. And @@ -1505,7 +1505,7 @@ Rule Japan 1950 1951 - May Sun>=1 2:00 1:00 D # # ...the Showa Emperor announced Ordinance No. 529 of Showa Year 12 ... which # means the whole Japan territory, including later occupations, adopt Japan -# Central Time (UTC+9). The adoption began on Oct 1, 1937. +# Central Time (UT+9). The adoption began on Oct 1, 1937. # https://ja.wikisource.org/wiki/明治二å八年勅令第百六å七號標準時ニ關スル件中改正ノ件 # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -2066,8 +2066,8 @@ Zone Asia/Kuching 7:21:20 - LMT 1926 Mar # Maldives # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Indian/Maldives 4:54:00 - LMT 1880 # Male - 4:54:00 - MMT 1960 # Male Mean Time +Zone Indian/Maldives 4:54:00 - LMT 1880 # Malé + 4:54:00 - MMT 1960 # Malé Mean Time 5:00 - +05 # Mongolia Modified: head/contrib/tzdata/australasia ============================================================================== --- head/contrib/tzdata/australasia Tue Jan 16 18:27:26 2018 (r328054) +++ head/contrib/tzdata/australasia Tue Jan 16 18:36:25 2018 (r328055) @@ -683,8 +683,8 @@ Zone Pacific/Guadalcanal 10:39:48 - LMT 1912 Oct # Hon # From Steffen Thorsen (2012-07-25) # ... we double checked by calling hotels and offices based in Tokelau asking # about the time there, and they all told a time that agrees with UTC+13.... -# Shanks says UTC-10 from 1901 [but] ... there is a good chance the change -# actually was to UTC-11 back then. +# Shanks says UT-10 from 1901 [but] ... there is a good chance the change +# actually was to UT-11 back then. # # From Paul Eggert (2012-07-25) # A Google Books snippet of Appendix to the Journals of the House of @@ -1450,7 +1450,7 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901 # # From Paul Eggert (2006-03-22): # The Department of Internal Affairs (DIA) maintains a brief history, -# as does Carol Squires; see tz-link.htm for the full references. +# as does Carol Squires; see tz-link.html for the full references. # Use these sources in preference to Shanks & Pottenger. # # For Chatham, IATA SSIM (1991/1999) gives the NZ rules but with Modified: head/contrib/tzdata/backzone ============================================================================== --- head/contrib/tzdata/backzone Tue Jan 16 18:27:26 2018 (r328054) +++ head/contrib/tzdata/backzone Tue Jan 16 18:36:25 2018 (r328055) @@ -145,11 +145,6 @@ Zone Africa/Gaborone 1:43:40 - LMT 1885 Zone Africa/Harare 2:04:12 - LMT 1903 Mar 2:00 - CAT -# South Sudan -Zone Africa/Juba 2:06:24 - LMT 1931 - 2:00 Sudan CA%sT 2000 Jan 15 12:00 - 3:00 - EAT - # Uganda Zone Africa/Kampala 2:09:40 - LMT 1928 Jul 3:00 - EAT 1930 @@ -241,11 +236,6 @@ Zone Africa/Ouagadougou -0:06:04 - LMT 1912 Zone Africa/Porto-Novo 0:10:28 - LMT 1912 Jan 1 0:00 - GMT 1934 Feb 26 1:00 - WAT - -# São Tomé and Príncipe -Zone Africa/Sao_Tome 0:26:56 - LMT 1884 - -0:36:32 - LMT 1912 # Lisbon Mean Time - 0:00 - GMT # Mali (northern) Zone Africa/Timbuktu -0:12:04 - LMT 1912 Modified: head/contrib/tzdata/europe ============================================================================== --- head/contrib/tzdata/europe Tue Jan 16 18:27:26 2018 (r328054) +++ head/contrib/tzdata/europe Tue Jan 16 18:36:25 2018 (r328055) @@ -68,14 +68,15 @@ # 0:00 WET WEST WEMT Western Europe # 0:19:32.13 AMT* NST* Amsterdam, Netherlands Summer (1835-1937) # 1:00 BST British Standard (1968-1971) +# 1:00 IST GMT Irish Standard (1968-) with winter DST # 1:00 CET CEST CEMT Central Europe # 1:00:14 SET Swedish (1879-1899) # 1:36:34 RMT* LST* Riga, Latvian Summer (1880-1926)* # 2:00 EET EEST Eastern Europe # 3:00 MSK MSD MDST* Moscow -# From Peter Ilieve (1994-12-04), -# The original six [EU members]: Belgium, France, (West) Germany, Italy, +# From Peter Ilieve (1994-12-04), re EEC/EC/EU members: +# The original six: Belgium, France, (West) Germany, Italy, # Luxembourg, the Netherlands. # Plus, from 1 Jan 73: Denmark, Ireland, United Kingdom. # Plus, from 1 Jan 81: Greece. @@ -278,16 +279,31 @@ # The following claim by Shanks & Pottenger is possible though doubtful; # we'll ignore it for now. # * Dublin's 1971-10-31 switch was at 02:00, even though London's was 03:00. + +# From Paul Eggert (2017-12-04): # +# Dunsink Observatory (8 km NW of Dublin's center) was to Dublin as +# Greenwich was to London. For example: # -# Whitman says Dublin Mean Time was -0:25:21, which is more precise than -# Shanks & Pottenger. -# Perhaps this was Dunsink Observatory Time, as Dunsink Observatory -# (8 km NW of Dublin's center) seemingly was to Dublin as Greenwich was -# to London. For example: -# # "Timeball on the ballast office is down. Dunsink time." # -- James Joyce, Ulysses +# +# The abbreviation DMT stood for "Dublin Mean Time" or "Dunsink Mean Time"; +# this being Ireland, opinions differed. +# +# Whitman says Dublin/Dunsink Mean Time was UT-00:25:21, which agrees +# with measurements of recent visitors to the Meridian Room of Dunsink +# Observatory; see Malone D. Dunsink and timekeeping. 2016-01-24. +# . Malone +# writes that the Nautical Almanac listed UT-00:25:22 until 1896, when +# it moved to UT-00:25:21.1 (I confirmed that the 1893 edition used +# the former and the 1896 edition used the latter). Evidently the +# news of this change propagated slowly, as Milne 1899 still lists +# UT-00:25:22 and cites the International Telegraph Bureau. As it is +# not clear that there was any practical significance to the change +# from UT-00:25:22 to UT-00:25:21.1 in civil timekeeping, omit this +# transition for now and just use the latter value, omitting its +# fraction since our format cannot represent fractions. # "Countess Markievicz ... claimed that the [1916] abolition of Dublin Mean Time # was among various actions undertaken by the 'English' government that @@ -347,12 +363,28 @@ # regulations. I spoke this morning with the Secretary of the Department of # Justice (tel +353 1 678 9711) who confirmed to me that the correct name is # "Irish Summer Time", abbreviated to "IST". +# +# From Paul Eggert (2017-12-07): +# The 1996 anonymous contributor's goal was to determine the correct +# abbreviation for summer time in Dublin and so the contributor +# focused on the "IST", not on the "Irish Summer Time". Though the +# "IST" was correct, the "Irish Summer Time" appears to have been an +# error, as Ireland's Standard Time (Amendment) Act, 1971 states that +# standard time in Ireland remains at UT +01 and is observed in +# summer, and that Greenwich mean time is observed in winter. (Thanks +# to Derick Rethans for pointing out the error.) That is, when +# Ireland amended the 1968 act that established UT +01 as Irish +# Standard Time, it left standard time unchanged and established GMT +# as a negative daylight saving time in winter. So, in this database +# IST stands for Irish Summer Time for timestamps before 1968, and for +# Irish Standard Time after that. See: +# http://www.irishstatutebook.ie/eli/1971/act/17/enacted/en/print # Michael Deckers (2017-06-01) gave the following URLs for Ireland's # Summer Time Act, 1925 and Summer Time Orders, 1926 and 1947: -# http://www.irishstatutebook.ie/eli/1925/act/8/enacted/en/print.html -# http://www.irishstatutebook.ie/eli/1926/sro/919/made/en/print.html -# http://www.irishstatutebook.ie/eli/1947/sro/71/made/en/print.html +# http://www.irishstatutebook.ie/eli/1925/act/8/enacted/en/print +# http://www.irishstatutebook.ie/eli/1926/sro/919/made/en/print +# http://www.irishstatutebook.ie/eli/1947/sro/71/made/en/print # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S # Summer Time Act, 1916 @@ -476,9 +508,20 @@ Link Europe/London Europe/Jersey Link Europe/London Europe/Guernsey Link Europe/London Europe/Isle_of_Man +# The following is like GB-Eire and EU, except with standard time in +# summer and negative daylight saving time in winter. +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Eire 1971 only - Oct 31 2:00u -1:00 GMT +Rule Eire 1972 1980 - Mar Sun>=16 2:00u 0 IST +Rule Eire 1972 1980 - Oct Sun>=23 2:00u -1:00 GMT +Rule Eire 1981 max - Mar lastSun 1:00u 0 IST +Rule Eire 1981 1989 - Oct Sun>=23 1:00u -1:00 GMT +Rule Eire 1990 1995 - Oct Sun>=22 1:00u -1:00 GMT +Rule Eire 1996 max - Oct lastSun 1:00u -1:00 GMT + # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Europe/Dublin -0:25:00 - LMT 1880 Aug 2 - -0:25:21 - DMT 1916 May 21 2:00s # Dublin MT + -0:25:21 - DMT 1916 May 21 2:00s -0:25:21 1:00 IST 1916 Oct 1 2:00s 0:00 GB-Eire %s 1921 Dec 6 # independence 0:00 GB-Eire GMT/IST 1940 Feb 25 2:00s @@ -487,16 +530,15 @@ Zone Europe/Dublin -0:25:00 - LMT 1880 Aug 2 0:00 1:00 IST 1947 Nov 2 2:00s 0:00 - GMT 1948 Apr 18 2:00s 0:00 GB-Eire GMT/IST 1968 Oct 27 - 1:00 - IST 1971 Oct 31 2:00u - 0:00 GB-Eire GMT/IST 1996 - 0:00 EU GMT/IST + 1:00 Eire IST/GMT ############################################################################### # Europe -# EU rules are for the European Union, previously known as the EC, EEC, -# Common Market, etc. +# The following rules are for the European Union and for its +# predecessor organization, the European Communities. +# For brevity they are called "EU rules" elsewhere in this file. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule EU 1977 1980 - Apr Sun>=1 1:00u 1:00 S @@ -929,7 +971,7 @@ Zone Europe/Prague 0:57:44 - LMT 1850 # The page http://www.retsinfo.dk/_GETDOCI_/ACCN/A18930008330-REGL # confirms this, and states that the law was put forth 1893-03-29. # -# The EU treaty with effect from 1973: +# The EU [actually, EEC and Euratom] treaty with effect from 1973: # http://www.retsinfo.dk/_GETDOCI_/ACCN/A19722110030-REGL # # This provoked a new law from 1974 to make possible summer time changes @@ -985,9 +1027,10 @@ Zone Atlantic/Faroe -0:27:04 - LMT 1908 Jan 11 # Tórs # East Greenland and Franz Josef Land, but we don't know their time zones. # My source for this is Wilhelm Dege's book mentioned under Svalbard. # -# From Paul Eggert (2006-03-22): -# Greenland joined the EU as part of Denmark, obtained home rule on 1979-05-01, -# and left the EU on 1985-02-01. It therefore should have been using EU +# From Paul Eggert (2017-12-10): +# Greenland joined the European Communities as part of Denmark, +# obtained home rule on 1979-05-01, and left the European Communities +# on 1985-02-01. It therefore should have been using EU # rules at least through 1984. Shanks & Pottenger say Scoresbysund and GodthÃ¥b # used C-Eur rules after 1980, but IATA SSIM (1991/1996) says they use EU # rules since at least 1991. Assume EU rules since 1980. @@ -1301,7 +1344,7 @@ Zone Europe/Paris 0:09:21 - LMT 1891 Mar 15 0:01 # From Markus Kuhn (1998-09-29): # The German time zone web site by the Physikalisch-Technische # Bundesanstalt contains DST information back to 1916. -# [See tz-link.htm for the URL.] +# [See tz-link.html for the URL.] # From Jörg Schilling (2002-10-23): # In 1945, Berlin was switched to Moscow Summer time (GMT+4) by @@ -1398,7 +1441,7 @@ Zone Europe/Athens 1:34:52 - LMT 1895 Sep 14 1:00 Greece CE%sT 1944 Apr 4 2:00 Greece EE%sT 1981 # Shanks & Pottenger say it switched to C-Eur in 1981; - # go with EU instead, since Greece joined it on Jan 1. + # go with EU rules instead, since Greece joined Jan 1. 2:00 EU EE%sT # Hungary @@ -2097,7 +2140,7 @@ Zone Europe/Warsaw 1:24:00 - LMT 1880 # IATA SSIM (1991/1992) reports that the Azores were at -1:00. # IATA SSIM (1993-02) says +0:00; later issues (through 1996-09) say -1:00. # Guess that the Azores changed to EU rules in 1992 (since that's when Portugal -# harmonized with the EU), and that they stayed +0:00 that winter. +# harmonized with EU rules), and that they stayed +0:00 that winter. # # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S # DSH writes that despite Decree 1,469 (1915), the change to the clocks was not @@ -2772,9 +2815,9 @@ Zone Asia/Omsk 4:53:30 - LMT 1919 Nov 14 # # https://regnum.ru/news/society/1957270.html # has some historical data for Altai Krai: -# before 1957: west part on UTC+6, east on UTC+7 -# after 1957: UTC+7 -# since 1995: UTC+6 +# before 1957: west part on UT+6, east on UT+7 +# after 1957: UT+7 +# since 1995: UT+6 # http://barnaul.rusplt.ru/index/pochemu_altajskij_kraj_okazalsja_v_neprivychnom_chasovom_pojase-17648.html # confirms that and provides more details including 1995-05-28 transition date. @@ -3581,6 +3624,17 @@ Zone Europe/Zurich 0:34:08 - LMT 1853 Jul 16 # See abo # From Paul Eggert (2016-09-07): # The change is permanent, so this is the new standard time in Turkey. # It takes effect today, which is not much notice. + +# From Kıvanç Yazan (2017-10-28): +# Turkey will go back to Daylight Saving Time starting 2018-10. +# http://www.resmigazete.gov.tr/eskiler/2017/10/20171028-5.pdf +# +# From Even Scharning (2017-11-08): +# ... today it was announced that the DST will become "continuous": +# http://www.hurriyet.com.tr/son-dakika-yaz-saati-uygulamasi-surekli-hale-geldi-40637482 +# From Paul Eggert (2017-11-08): +# Although Google Translate misfires on that source, it looks like +# Turkey reversed last month's decision, and so will stay at +03. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Turkey 1916 only - May 1 0:00 1:00 S Modified: head/contrib/tzdata/northamerica ============================================================================== --- head/contrib/tzdata/northamerica Tue Jan 16 18:27:26 2018 (r328054) +++ head/contrib/tzdata/northamerica Tue Jan 16 18:36:25 2018 (r328055) @@ -348,6 +348,18 @@ Zone America/New_York -4:56:02 - LMT 1883 Nov 18 12:03 # Nebraska, eastern North Dakota, Oklahoma, eastern South Dakota, # western Tennessee, most of Texas, Wisconsin +# From Paul Eggert (2018-01-07): +# In 1869 the Chicago Astronomical Society contracted with the city to keep +# time. Though delayed by the Great Fire, by 1880 a wire ran from the +# Dearborn Observatory (on the University of Chicago campus) to City Hall, +# which then sent signals to police and fire stations. However, railroads got +# their time signals from the Allegheny Observatory, the Madison Observatory, +# the Ann Arbor Observatory, etc., so their clocks did not agree with each +# other or with the city's official time. The confusion took some years to +# clear up. See: +# Moser M. How Chicago gave America its time zones. Chicago. 2018-01-04. +# http://www.chicagomag.com/city-life/January-2018/How-Chicago-Gave-America-Its-Time-Zones/ + # From Larry M. Smith (2006-04-26) re Wisconsin: # https://docs.legis.wisconsin.gov/statutes/statutes/175.pdf # is currently enforced at the 01:00 time of change. Because the local @@ -1896,7 +1908,7 @@ Zone America/Edmonton -7:33:52 - LMT 1906 Sep # manager of the Creston & District Museum. The article was written in May 2009. # http://www.ilovecreston.com/?p=articles&t=spec&ar=260 # According to the article, Creston has not changed its clocks since June 1918. -# i.e. Creston has been stuck on UTC-7 for 93 years. +# i.e. Creston has been stuck on UT-7 for 93 years. # Dawson Creek, on the other hand, changed its clocks as recently as April 1972. # Unfortunately the exact date for the time change in June 1918 remains Modified: head/contrib/tzdata/southamerica ============================================================================== --- head/contrib/tzdata/southamerica Tue Jan 16 18:27:26 2018 (r328054) +++ head/contrib/tzdata/southamerica Tue Jan 16 18:36:25 2018 (r328055) @@ -25,7 +25,7 @@ # https://www.jstor.org/stable/1774359 # # These tables use numeric abbreviations like -03 and -0330 for -# integer hour and minute UTC offsets. Although earlier editions used +# integer hour and minute UT offsets. Although earlier editions used # alphabetic time zone abbreviations, these abbreviations were # invented and did not reflect common practice. @@ -579,7 +579,7 @@ Link America/Curacao America/Aruba # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone America/La_Paz -4:32:36 - LMT 1890 -4:32:36 - CMT 1931 Oct 15 # Calamarca MT - -4:32:36 1:00 BOST 1932 Mar 21 # Bolivia ST + -4:32:36 1:00 BST 1932 Mar 21 # Bolivia ST -4:00 - -04 # Brazil @@ -908,12 +908,25 @@ Rule Brazil 2007 only - Oct Sun>=8 0:00 1:00 S # [t]he DST period in Brazil now on will be from the 3rd Oct Sunday to the # 3rd Feb Sunday. There is an exception on the return date when this is # the Carnival Sunday then the return date will be the next Sunday... -Rule Brazil 2008 max - Oct Sun>=15 0:00 1:00 S +Rule Brazil 2008 2017 - Oct Sun>=15 0:00 1:00 S Rule Brazil 2008 2011 - Feb Sun>=15 0:00 0 - +# Decree 7,584 (2011-10-13) +# added Bahia. Rule Brazil 2012 only - Feb Sun>=22 0:00 0 - +# Decree 7,826 (2012-10-15) +# removed Bahia and added Tocantins. +# Decree 8,112 (2013-09-30) +# removed Tocantins. Rule Brazil 2013 2014 - Feb Sun>=15 0:00 0 - Rule Brazil 2015 only - Feb Sun>=22 0:00 0 - Rule Brazil 2016 2022 - Feb Sun>=15 0:00 0 - +# From Steffen Thorsen (2017-12-18): +# According to many media sources, next year's DST start in Brazil will move to +# the first Sunday of November, and it will stay like that for the years after. +# ... https://www.timeanddate.com/news/time/brazil-delays-dst-2018.html +# From Steffen Thorsen (2017-12-20): +# http://www.planalto.gov.br/ccivil_03/_ato2015-2018/2017/decreto/D9242.htm +Rule Brazil 2018 max - Nov Sun>=1 0:00 1:00 S Rule Brazil 2023 only - Feb Sun>=22 0:00 0 - Rule Brazil 2024 2025 - Feb Sun>=15 0:00 0 - Rule Brazil 2026 only - Feb Sun>=22 0:00 0 - @@ -1068,7 +1081,7 @@ Zone America/Rio_Branco -4:31:12 - LMT 1914 # From Paul Eggert (2015-04-03): # Shanks & Pottenger says America/Santiago introduced standard time in -# 1890 and rounds its UTC offset to 70W40; guess that in practice this +# 1890 and rounds its UT offset to 70W40; guess that in practice this # was the same offset as in 1916-1919. It also says Pacific/Easter # standardized on 109W22 in 1890; assume this didn't change the clocks. # Modified: head/contrib/tzdata/theory.html ============================================================================== --- head/contrib/tzdata/theory.html Tue Jan 16 18:27:26 2018 (r328054) +++ head/contrib/tzdata/theory.html Tue Jan 16 18:36:25 2018 (r328055) @@ -52,6 +52,10 @@ However, the database is not designed for and does not applications requiring accurate handling of all past times everywhere, as it would take far too much effort and guesswork to record all details of pre-1970 civil timekeeping. +Athough some information outside the scope of the database is +collected in a file backzone that is distributed along +with the database proper, this file is less reliable and does not +necessarily follow database guidelines.

@@ -240,7 +244,7 @@ to name time zone rules. It is intended to be an exhaustive list of names for geographic regions as described above; this is a subset of the names in the data. Although a 'zone1970.tab' location's longitude -corresponds to its LMT offset with one hour for every 15 degrees east +corresponds to its LMT offset with one hour for every 15° east longitude, this relationship is not exact.

@@ -279,7 +283,7 @@ Here are the general rules used for choosing time zone in decreasing order of importance:
  • - Use three or more characters that are ASCII alphanumerics or + Use three to six characters that are ASCII alphanumerics or '+' or '-'. Previous editions of this database also used characters like ' ' and '?', but these @@ -297,7 +301,7 @@ in decreasing order of importance: '+' and '-' are safe in all locales. In other words, in the C locale the POSIX extended regular - expression [-+[:alnum:]]{3,} should match + expression [-+[:alnum:]]{3,6} should match the abbreviation. This guarantees that all abbreviations could have been specified by a POSIX TZ string. @@ -308,12 +312,96 @@ in decreasing order of importance: We assume that applications translate them to other languages as part of the normal localization process; for example, a French application might translate 'EST' to 'HNE'. + +

    These abbreviations (for standard/daylight/etc. time) are: +ACST/ACDT Australian Central, +AST/ADT/APT/AWT/ADDT Atlantic, +AEST/AEDT Australian Eastern, +AHST/AHDT Alaska-Hawaii, +AKST/AKDT Alaska, +AWST/AWDT Australian Western, +BST/BDT Bering, +CAT/CAST Central Africa, +CET/CEST/CEMT Central European, +ChST Chamorro, +CST/CDT/CWT/CPT/CDDT Central [North America], +CST/CDT China, +GMT/BST/IST/BDST Greenwich, +EAT East Africa, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Jan 16 19:29:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFE02EB3557; Tue, 16 Jan 2018 19:29:33 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8C86168E56; Tue, 16 Jan 2018 19:29:33 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E65FF24B2B; Tue, 16 Jan 2018 19:29:32 +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 w0GJTWHW027802; Tue, 16 Jan 2018 19:29:32 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0GJTWbN027800; Tue, 16 Jan 2018 19:29:32 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201801161929.w0GJTWbN027800@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 16 Jan 2018 19:29:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328056 - head/sys/fs/ext2fs X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/fs/ext2fs X-SVN-Commit-Revision: 328056 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jan 2018 19:29:33 -0000 Author: pfg Date: Tue Jan 16 19:29:32 2018 New Revision: 328056 URL: https://svnweb.freebsd.org/changeset/base/328056 Log: ext2fs: use mallocarray(9). Focus on code where we are doing multiplications within malloc(9). These are not likely to overflow, however the change is still useful as some static checkers can benefit from the allocation attributes we use for mallocarray. Modified: head/sys/fs/ext2fs/ext2_lookup.c head/sys/fs/ext2fs/ext2_vfsops.c Modified: head/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- head/sys/fs/ext2fs/ext2_lookup.c Tue Jan 16 18:36:25 2018 (r328055) +++ head/sys/fs/ext2fs/ext2_lookup.c Tue Jan 16 19:29:32 2018 (r328056) @@ -145,9 +145,9 @@ ext2_readdir(struct vop_readdir_args *ap) off_t offset, startoffset; size_t readcnt, skipcnt; ssize_t startresid; - int ncookies; int DIRBLKSIZ = VTOI(ap->a_vp)->i_e2fs->e2fs_bsize; int error; + u_int ncookies; if (uio->uio_offset < 0) return (EINVAL); @@ -160,7 +160,8 @@ ext2_readdir(struct vop_readdir_args *ap) ncookies = ip->i_size - uio->uio_offset; ncookies = ncookies / (offsetof(struct ext2fs_direct_2, e2d_namlen) + 4) + 1; - cookies = malloc(ncookies * sizeof(*cookies), M_TEMP, M_WAITOK); + cookies = mallocarray(ncookies, sizeof(*cookies), M_TEMP, + M_WAITOK); *ap->a_ncookies = ncookies; *ap->a_cookies = cookies; } else { Modified: head/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vfsops.c Tue Jan 16 18:36:25 2018 (r328055) +++ head/sys/fs/ext2fs/ext2_vfsops.c Tue Jan 16 19:29:32 2018 (r328056) @@ -400,9 +400,9 @@ compute_sb_data(struct vnode *devvp, struct ext2fs *es fs->e2fs_bsize / sizeof(struct ext2_gd)); } fs->e2fs_gdbcount = howmany(fs->e2fs_gcount, e2fs_descpb); - fs->e2fs_gd = malloc(e2fs_gdbcount_alloc * fs->e2fs_bsize, + fs->e2fs_gd = mallocarray(e2fs_gdbcount_alloc, fs->e2fs_bsize, M_EXT2MNT, M_WAITOK | M_ZERO); - fs->e2fs_contigdirs = malloc(fs->e2fs_gcount * + fs->e2fs_contigdirs = mallocarray(fs->e2fs_gcount, sizeof(*fs->e2fs_contigdirs), M_EXT2MNT, M_WAITOK | M_ZERO); /* @@ -683,7 +683,8 @@ ext2_mountfs(struct vnode *devvp, struct mount *mp) for (i = 0; i < ump->um_e2fs->e2fs_gcount; i++, sump++) { *lp++ = ump->um_e2fs->e2fs_contigsumsize; sump->cs_init = 0; - sump->cs_sum = malloc((ump->um_e2fs->e2fs_contigsumsize + 1) * + sump->cs_sum = mallocarray( + ump->um_e2fs->e2fs_contigsumsize + 1, sizeof(int32_t), M_EXT2MNT, M_WAITOK | M_ZERO); } } From owner-svn-src-head@freebsd.org Tue Jan 16 19:34:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF8F9EB3AC9; Tue, 16 Jan 2018 19:34:23 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "alchemy.franken.de", Issuer "alchemy.franken.de" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 74C33693CF; Tue, 16 Jan 2018 19:34:23 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.15.2/8.15.2/ALCHEMY.FRANKEN.DE) with ESMTPS id w0GJW8w9083867 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 16 Jan 2018 20:32:08 +0100 (CET) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.15.2/8.15.2/Submit) id w0GJW8lO083866; Tue, 16 Jan 2018 20:32:08 +0100 (CET) (envelope-from marius) Date: Tue, 16 Jan 2018 20:32:08 +0100 From: Marius Strobl To: Nathan Whitehorn Cc: Konstantin Belousov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r327950 - in head/sys/powerpc: aim include powerpc ps3 Message-ID: <20180116193208.GA12364@alchemy.franken.de> References: <20180114175211.GD1684@kib.kiev.ua> <20180115111812.GF1684@kib.kiev.ua> <20180115170603.GJ1684@kib.kiev.ua> <9e5554d7-6a0c-5910-8cb6-74f98259536f@freebsd.org> <20180115175335.GK1684@kib.kiev.ua> 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-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (alchemy.franken.de [0.0.0.0]); Tue, 16 Jan 2018 20:32:09 +0100 (CET) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jan 2018 19:34:23 -0000 On Mon, Jan 15, 2018 at 03:20:49PM -0800, Nathan Whitehorn wrote: > > > On 01/15/18 09:53, Konstantin Belousov wrote: > > On Mon, Jan 15, 2018 at 09:32:56AM -0800, Nathan Whitehorn wrote: > >> That seems fine to me. I don't think a less-clumsy way that does not > >> involve extra indirection is possible. The PHYS_TO_DMAP() returning NULL > >> is about the best thing I can come up with from a clumsiness standpoint > >> since plenty of code checks for null pointers already, but doesn't > >> cleanly handle the rarer case where you want to test for the existence > >> of direct maps in general without testing some potemkin address. > >> > >> My one reservation about PMAP_HAS_DMAP or the like as a selector is that > >> it does not encode the full shape of the problem: one could imagine > >> having a direct map that only covers a limited range of RAM (I am not > >> sure whether the existence of dmaplimit on amd64 implies this can happen > >> with non-device memory in real life), for example. These cases are > >> currently covered by an assert() in PHYS_TO_DMAP(), whereas having > >> PHYS_TO_DMAP() return NULL allows a more flexible signalling and the > >> potential for the calling code to do something reasonable to handle the > >> error. A single global flag can't convey information at this kind of > >> granularity. Is this a reasonable concern? Or am I overthinking things? > > IMO it is overreaction. amd64 assumes that all normal memory is covered > > by DMAP. It must never fail. See, for instance, the implementation > > of the sf bufs for it. > > > > If device memory not covered by DMAP can exists, it is the driver problem. > > For instance, for NVDIMMs I wrote specific mapping code which establishes > > kernel mapping for it, when not covered by EFI memory map and correspondingly > > not included into DMAP. > > > > Fair enough. Here's a patch with a new flag (DIRECT_MAP_AVAILABLE). I've > also retooled the sfbuf code to use this rather than its own flags that > mean the same things. The sparc64 part of the patch is untested. > -Nathan > Index: sparc64/include/vmparam.h > =================================================================== > --- sparc64/include/vmparam.h (revision 328006) > +++ sparc64/include/vmparam.h (working copy) > @@ -240,10 +240,12 @@ > */ > #define ZERO_REGION_SIZE PAGE_SIZE > > +#include > + > #define SFBUF > #define SFBUF_MAP > -#define SFBUF_OPTIONAL_DIRECT_MAP dcache_color_ignore > -#include > -#define SFBUF_PHYS_DMAP(x) TLB_PHYS_TO_DIRECT(x) > > +#define DIRECT_MAP_AVAILABLE dcache_color_ignore > +#define PHYS_TO_DMAP(x) (DIRECT_MAP_AVAILABLE ? (TLB_PHYS_TO_DIRECT(x) : 0) What dcache_color_ignore actually indicates is the presence of hardware unaliasing support, in other words the ability to enter duplicate cacheable mappings into the MMU. While a direct map is available and used by MD code on all supported CPUs down to US-I, the former feature is only implemented in the line of Fujitsu SPARC64 processors. IIRC, the sfbuf(9) code can't guarantee that there isn't already a cacheable mapping from a different VA to the same PA, which is why it employs dcache_color_ignore. Is that a general constraint of all MI PHYS_TO_DMAP users or are there consumers which can guarantee that they are the only users of a mapping to the same PA? Marius From owner-svn-src-head@freebsd.org Tue Jan 16 19:41:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69758EB40D9; Tue, 16 Jan 2018 19:41:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4675B6978C; Tue, 16 Jan 2018 19:41:19 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8EE1924D13; Tue, 16 Jan 2018 19:41:18 +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 w0GJfI02032894; Tue, 16 Jan 2018 19:41:18 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0GJfIC7032893; Tue, 16 Jan 2018 19:41:18 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201801161941.w0GJfIC7032893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 16 Jan 2018 19:41:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328057 - head/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/opencrypto X-SVN-Commit-Revision: 328057 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jan 2018 19:41:19 -0000 Author: jhb Date: Tue Jan 16 19:41:18 2018 New Revision: 328057 URL: https://svnweb.freebsd.org/changeset/base/328057 Log: Split crp_buf into a union. This adds explicit crp_mbuf and crp_uio pointers of the right type to replace casts of crp_buf. This does not sweep through changing existing code, but new code should use the correct fields instead of casts. Reviewed by: kib Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D13927 Modified: head/sys/opencrypto/cryptodev.h Modified: head/sys/opencrypto/cryptodev.h ============================================================================== --- head/sys/opencrypto/cryptodev.h Tue Jan 16 19:29:32 2018 (r328056) +++ head/sys/opencrypto/cryptodev.h Tue Jan 16 19:41:18 2018 (r328057) @@ -425,7 +425,11 @@ struct cryptop { * if CRYPTO_F_ASYNC flags is set */ - caddr_t crp_buf; /* Data to be processed */ + union { + caddr_t crp_buf; /* Data to be processed */ + struct mbuf *crp_mbuf; + struct uio *crp_uio; + }; void * crp_opaque; /* Opaque pointer, passed along */ struct cryptodesc *crp_desc; /* Linked list of processing descriptors */ @@ -538,5 +542,6 @@ extern void crypto_copydata(int flags, caddr_t buf, in caddr_t out); extern int crypto_apply(int flags, caddr_t buf, int off, int len, int (*f)(void *, void *, u_int), void *arg); + #endif /* _KERNEL */ #endif /* _CRYPTO_CRYPTO_H_ */ From owner-svn-src-head@freebsd.org Tue Jan 16 19:57:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9325EB4DB9; Tue, 16 Jan 2018 19:57:31 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B3BD66A45B; Tue, 16 Jan 2018 19:57:31 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 07BC125046; Tue, 16 Jan 2018 19:57:31 +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 w0GJvUeZ040530; Tue, 16 Jan 2018 19:57:30 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0GJvUL9040529; Tue, 16 Jan 2018 19:57:30 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201801161957.w0GJvUL9040529@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 16 Jan 2018 19:57:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328058 - head/usr.bin/truss X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/usr.bin/truss X-SVN-Commit-Revision: 328058 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jan 2018 19:57:31 -0000 Author: tuexen Date: Tue Jan 16 19:57:30 2018 New Revision: 328058 URL: https://svnweb.freebsd.org/changeset/base/328058 Log: Using %p already prints "0x", so don't do it explicitly. Modified: head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Tue Jan 16 19:41:18 2018 (r328057) +++ head/usr.bin/truss/syscalls.c Tue Jan 16 19:57:30 2018 (r328058) @@ -1176,14 +1176,14 @@ print_sockaddr(FILE *fp, struct trussinfo *trussinfo, } /* If the length is too small, just bail. */ if (len < sizeof(*sa)) { - fprintf(fp, "0x%p", arg); + fprintf(fp, "%p", arg); return; } sa = calloc(1, len); if (get_struct(pid, arg, sa, len) == -1) { free(sa); - fprintf(fp, "0x%p", arg); + fprintf(fp, "%p", arg); return; } @@ -1240,7 +1240,7 @@ print_iovec(FILE *fp, struct trussinfo *trussinfo, voi bool buf_truncated, iov_truncated; if (iovcnt <= 0) { - fprintf(fp, "0x%p", arg); + fprintf(fp, "%p", arg); return; } if (iovcnt > IOV_LIMIT) { @@ -1250,7 +1250,7 @@ print_iovec(FILE *fp, struct trussinfo *trussinfo, voi iov_truncated = false; } if (get_struct(pid, arg, &iov, iovcnt * sizeof(struct iovec)) == -1) { - fprintf(fp, "0x%p", arg); + fprintf(fp, "%p", arg); return; } @@ -1278,7 +1278,7 @@ print_iovec(FILE *fp, struct trussinfo *trussinfo, voi buf_truncated ? "..." : ""); free(tmp3); } else { - fprintf(fp, "0x%p", iov[i].iov_base); + fprintf(fp, "%p", iov[i].iov_base); } fprintf(fp, ",%zu}", iov[i].iov_len); } @@ -1495,7 +1495,7 @@ print_cmsgs(FILE *fp, pid_t pid, bool receive, struct len = msghdr->msg_controllen; cmsgbuf = calloc(1, len); if (get_struct(pid, msghdr->msg_control, cmsgbuf, len) == -1) { - fprintf(fp, "0x%p", msghdr); + fprintf(fp, "%p", msghdr->msg_control); free(cmsgbuf); } msghdr->msg_control = cmsgbuf; From owner-svn-src-head@freebsd.org Tue Jan 16 20:02:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02D63EB526E; Tue, 16 Jan 2018 20:02:09 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D26A36A8FA; Tue, 16 Jan 2018 20:02:08 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1BA0C251EC; Tue, 16 Jan 2018 20:02:08 +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 w0GK27Pw044589; Tue, 16 Jan 2018 20:02:07 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0GK27Wv044588; Tue, 16 Jan 2018 20:02:07 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201801162002.w0GK27Wv044588@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 16 Jan 2018 20:02:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328059 - head/usr.bin/truss X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/usr.bin/truss X-SVN-Commit-Revision: 328059 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jan 2018 20:02:09 -0000 Author: tuexen Date: Tue Jan 16 20:02:07 2018 New Revision: 328059 URL: https://svnweb.freebsd.org/changeset/base/328059 Log: Improve the printing of cmgs when the length is 0. Fix error handling. Modified: head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Tue Jan 16 19:57:30 2018 (r328058) +++ head/usr.bin/truss/syscalls.c Tue Jan 16 20:02:07 2018 (r328059) @@ -1493,10 +1493,15 @@ print_cmsgs(FILE *fp, pid_t pid, bool receive, struct bool first; len = msghdr->msg_controllen; + if (len == 0) { + fputs("{}", fp); + return; + } cmsgbuf = calloc(1, len); if (get_struct(pid, msghdr->msg_control, cmsgbuf, len) == -1) { fprintf(fp, "%p", msghdr->msg_control); free(cmsgbuf); + return; } msghdr->msg_control = cmsgbuf; first = true; From owner-svn-src-head@freebsd.org Tue Jan 16 20:14:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2024EB5BB8; Tue, 16 Jan 2018 20:14:32 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BC2046AFCC; Tue, 16 Jan 2018 20:14: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 04CD8253B4; Tue, 16 Jan 2018 20:14: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 w0GKEV3a048656; Tue, 16 Jan 2018 20:14:31 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0GKEVXL048655; Tue, 16 Jan 2018 20:14:31 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201801162014.w0GKEVXL048655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 16 Jan 2018 20:14:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328060 - head/usr.sbin/service X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.sbin/service X-SVN-Commit-Revision: 328060 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jan 2018 20:14:33 -0000 Author: kevans Date: Tue Jan 16 20:14:31 2018 New Revision: 328060 URL: https://svnweb.freebsd.org/changeset/base/328060 Log: service(8): Reset OPTIND properly now that we're parsing args twice r328032 introduced a second round of argument parsing to proxy the request through to a jail as needed, but failed to reset OPTIND before getting to the second round of parsing to allow other flags to be set. Reported by: Oleg Ginzburg Modified: head/usr.sbin/service/service.sh Modified: head/usr.sbin/service/service.sh ============================================================================== --- head/usr.sbin/service/service.sh Tue Jan 16 20:02:07 2018 (r328059) +++ head/usr.sbin/service/service.sh Tue Jan 16 20:14:31 2018 (r328060) @@ -79,6 +79,7 @@ if [ -n "$JAIL" ]; then exit $? fi +OPTIND=1 while getopts ${accepted_argstr} COMMAND_LINE_ARGUMENT ; do case "${COMMAND_LINE_ARGUMENT}" in e) ENABLED=eopt ;; From owner-svn-src-head@freebsd.org Tue Jan 16 20:35:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2276EB6EA9; Tue, 16 Jan 2018 20:35:55 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BA8016BD3E; Tue, 16 Jan 2018 20:35:55 +0000 (UTC) (envelope-from tsoome@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F2D00256F9; Tue, 16 Jan 2018 20:35:54 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0GKZs06056976; Tue, 16 Jan 2018 20:35:54 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0GKZsaV056975; Tue, 16 Jan 2018 20:35:54 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201801162035.w0GKZsaV056975@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Tue, 16 Jan 2018 20:35:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328061 - head/stand/efi/libefi X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/efi/libefi X-SVN-Commit-Revision: 328061 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jan 2018 20:35:56 -0000 Author: tsoome Date: Tue Jan 16 20:35:54 2018 New Revision: 328061 URL: https://svnweb.freebsd.org/changeset/base/328061 Log: utf8_to_ucs2() should check for malloc failure utf8_to_ucs2() is calling malloc() without checking the result. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D13933 Modified: head/stand/efi/libefi/efichar.c Modified: head/stand/efi/libefi/efichar.c ============================================================================== --- head/stand/efi/libefi/efichar.c Tue Jan 16 20:14:31 2018 (r328060) +++ head/stand/efi/libefi/efichar.c Tue Jan 16 20:35:54 2018 (r328061) @@ -139,6 +139,8 @@ utf8_to_ucs2(const char *name, efi_char **nmp, size_t sz = strlen(name) * 2 + 2; if (*nmp == NULL) *nmp = malloc(sz); + if (*nmp == NULL) + return (ENOMEM); nm = *nmp; *len = sz; From owner-svn-src-head@freebsd.org Tue Jan 16 21:14:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CDE1EB8A94; Tue, 16 Jan 2018 21:14:57 +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 DC4356D452; Tue, 16 Jan 2018 21:14:56 +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 CAA986A; Tue, 16 Jan 2018 22:14:53 +0100 (CET) Received: by toad2.stack.nl (Postfix, from userid 1677) id C34FD892AE; Tue, 16 Jan 2018 22:14:53 +0100 (CET) Date: Tue, 16 Jan 2018 22:14:53 +0100 From: Jilles Tjoelker To: Kyle Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r328060 - head/usr.sbin/service Message-ID: <20180116211453.GA32669@stack.nl> References: <201801162014.w0GKEVXL048655@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201801162014.w0GKEVXL048655@repo.freebsd.org> User-Agent: Mutt/1.8.0 (2017-02-23) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jan 2018 21:14:57 -0000 On Tue, Jan 16, 2018 at 08:14:31PM +0000, Kyle Evans wrote: > Author: kevans > Date: Tue Jan 16 20:14:31 2018 > New Revision: 328060 > URL: https://svnweb.freebsd.org/changeset/base/328060 > Log: > service(8): Reset OPTIND properly now that we're parsing args twice > r328032 introduced a second round of argument parsing to proxy the request > through to a jail as needed, but failed to reset OPTIND before getting to > the second round of parsing to allow other flags to be set. > Reported by: Oleg Ginzburg > Modified: > head/usr.sbin/service/service.sh > Modified: head/usr.sbin/service/service.sh > ============================================================================== > --- head/usr.sbin/service/service.sh Tue Jan 16 20:02:07 2018 (r328059) > +++ head/usr.sbin/service/service.sh Tue Jan 16 20:14:31 2018 (r328060) > @@ -79,6 +79,7 @@ if [ -n "$JAIL" ]; then > exit $? > fi > > +OPTIND=1 > while getopts ${accepted_argstr} COMMAND_LINE_ARGUMENT ; do > case "${COMMAND_LINE_ARGUMENT}" in > e) ENABLED=eopt ;; Hi, Although this solves the immediate problem of all existing options becoming no-ops, the new -j option still behaves strangely if it is not used with "-j" and the jail name as the first two arguments, since the shift commands will shift away other arguments. One way to fix this avoids depending on the exact options known by the jailed service(8) and accepts that the -j option must be first (either -j JAIL as two arguments or -jJAIL as one argument). This parsing would be open-coded and there would be only one getopts loop. Another way to fix this allows using the -j option as any other option. This would also use one getopts loop and reconstruct a command line for the jailed service(8) based on the variables like ENABLED (the values for set options can be changed to simplify this since the rest of the script only cares about non-empty or not). -- Jilles Tjoelker From owner-svn-src-head@freebsd.org Tue Jan 16 21:43:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 309F1EBA189; Tue, 16 Jan 2018 21:43:22 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0C72D6E772; Tue, 16 Jan 2018 21:43:22 +0000 (UTC) (envelope-from arichardson@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 55ECE26271; Tue, 16 Jan 2018 21:43:21 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0GLhLY7086114; Tue, 16 Jan 2018 21:43:21 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0GLhLgP086113; Tue, 16 Jan 2018 21:43:21 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <201801162143.w0GLhLgP086113@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Tue, 16 Jan 2018 21:43:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328062 - head/lib/libnetbsd X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/lib/libnetbsd X-SVN-Commit-Revision: 328062 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jan 2018 21:43:22 -0000 Author: arichardson Date: Tue Jan 16 21:43:21 2018 New Revision: 328062 URL: https://svnweb.freebsd.org/changeset/base/328062 Log: libnetbsd: Make the function declaration of efopen() match the definition In order to crossbuild FreeBSD on Mac/Linux I also need to build libnetbsd and FILE* is not equal to struct __sFILE on those platforms. Reviewed By: brooks, emaste Approved By: jhb (mentor) Differential Revision: https://reviews.freebsd.org/D13305 Modified: head/lib/libnetbsd/util.h Modified: head/lib/libnetbsd/util.h ============================================================================== --- head/lib/libnetbsd/util.h Tue Jan 16 20:35:54 2018 (r328061) +++ head/lib/libnetbsd/util.h Tue Jan 16 21:43:21 2018 (r328062) @@ -37,6 +37,7 @@ #include #include +#include void (*esetfunc(void (*)(int, const char *, ...)))(int, const char *, ...); size_t estrlcpy(char *, const char *, size_t); @@ -46,7 +47,7 @@ char *estrndup(const char *, size_t); void *emalloc(size_t); void *ecalloc(size_t, size_t); void *erealloc(void *, size_t); -struct __sFILE *efopen(const char *, const char *); +FILE *efopen(const char *, const char *); int easprintf(char ** __restrict, const char * __restrict, ...) __printflike(2, 3); int evasprintf(char ** __restrict, const char * __restrict, __va_list) From owner-svn-src-head@freebsd.org Tue Jan 16 21:43:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A10D8EBA1DD; Tue, 16 Jan 2018 21:43:37 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 724D26E8B0; Tue, 16 Jan 2018 21:43:37 +0000 (UTC) (envelope-from arichardson@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A0F0326272; Tue, 16 Jan 2018 21:43:36 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0GLhaJt086172; Tue, 16 Jan 2018 21:43:36 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0GLhaDt086171; Tue, 16 Jan 2018 21:43:36 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <201801162143.w0GLhaDt086171@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Tue, 16 Jan 2018 21:43:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328063 - head X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 328063 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jan 2018 21:43:38 -0000 Author: arichardson Date: Tue Jan 16 21:43:36 2018 New Revision: 328063 URL: https://svnweb.freebsd.org/changeset/base/328063 Log: Don't build share/syscons in build-tools stage if MK_SYSCONS == "no" Reviewed By: emaste, jhb Approved By: jhb (mentor) Differential Revision: https://reviews.freebsd.org/D12926 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Jan 16 21:43:21 2018 (r328062) +++ head/Makefile.inc1 Tue Jan 16 21:43:36 2018 (r328063) @@ -1976,7 +1976,7 @@ bootstrap-tools: ${_bt}-${_tool} # # build-tools: Build special purpose build tools # -.if !defined(NO_SHARE) +.if !defined(NO_SHARE) && ${MK_SYSCONS} != "no" _share= share/syscons/scrnmaps .endif From owner-svn-src-head@freebsd.org Tue Jan 16 21:43:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D78BEBA23F; Tue, 16 Jan 2018 21:43:51 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 530626E8C6; Tue, 16 Jan 2018 21:43:50 +0000 (UTC) (envelope-from arichardson@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1104226277; Tue, 16 Jan 2018 21:43:47 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0GLhk8T086232; Tue, 16 Jan 2018 21:43:46 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0GLhkE3086228; Tue, 16 Jan 2018 21:43:46 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <201801162143.w0GLhkE3086228@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Tue, 16 Jan 2018 21:43:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328064 - in head: usr.bin/xinstall usr.sbin/makefs X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: in head: usr.bin/xinstall usr.sbin/makefs X-SVN-Commit-Revision: 328064 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jan 2018 21:43:52 -0000 Author: arichardson Date: Tue Jan 16 21:43:46 2018 New Revision: 328064 URL: https://svnweb.freebsd.org/changeset/base/328064 Log: Allow xinstall and makefs to be crossbuilt on Linux and Mac I need these tools in order to install the crossbuilt FreeBSD and create a disk image. Linux does not have a st_flags in struct stat so unfortunately I need a bunch of ugly ifdefs. The resulting binaries allow me to sucessfully install a MIPS64 world and create a disk-image that boots. Reviewed By: brooks, bdrewery, emaste Approved By: jhb (mentor) Differential Revision: https://reviews.freebsd.org/D13307 Modified: head/usr.bin/xinstall/Makefile head/usr.bin/xinstall/xinstall.c head/usr.sbin/makefs/ffs.c head/usr.sbin/makefs/mtree.c Modified: head/usr.bin/xinstall/Makefile ============================================================================== --- head/usr.bin/xinstall/Makefile Tue Jan 16 21:43:36 2018 (r328063) +++ head/usr.bin/xinstall/Makefile Tue Jan 16 21:43:46 2018 (r328064) @@ -11,6 +11,7 @@ MAN= install.1 .PATH: ${SRCTOP}/contrib/mtree CFLAGS+= -I${SRCTOP}/contrib/mtree CFLAGS+= -I${SRCTOP}/lib/libnetbsd +CFLAGS+= -DHAVE_STRUCT_STAT_ST_FLAGS=1 LIBADD= md Modified: head/usr.bin/xinstall/xinstall.c ============================================================================== --- head/usr.bin/xinstall/xinstall.c Tue Jan 16 21:43:36 2018 (r328063) +++ head/usr.bin/xinstall/xinstall.c Tue Jan 16 21:43:46 2018 (r328064) @@ -533,9 +533,11 @@ do_link(const char *from_name, const char *to_name, unlink(tmpl); err(EX_OSERR, "%s", to_name); } +#if HAVE_STRUCT_STAT_ST_FLAGS if (target_sb->st_flags & NOCHANGEBITS) (void)chflags(to_name, target_sb->st_flags & ~NOCHANGEBITS); +#endif if (verbose) printf("install: link %s -> %s\n", from_name, to_name); @@ -579,9 +581,11 @@ do_symlink(const char *from_name, const char *to_name, (void)unlink(tmpl); err(EX_OSERR, "%s", to_name); } +#if HAVE_STRUCT_STAT_ST_FLAGS if (target_sb->st_flags & NOCHANGEBITS) (void)chflags(to_name, target_sb->st_flags & ~NOCHANGEBITS); +#endif if (verbose) printf("install: symlink %s -> %s\n", from_name, to_name); @@ -779,9 +783,11 @@ install(const char *from_name, const char *to_name, u_ if (target && !safecopy) { if (to_sb.st_mode & S_IFDIR && rmdir(to_name) == -1) err(EX_OSERR, "%s", to_name); +#if HAVE_STRUCT_STAT_ST_FLAGS if (to_sb.st_flags & NOCHANGEBITS) (void)chflags(to_name, to_sb.st_flags & ~NOCHANGEBITS); +#endif unlink(to_name); } makelink(from_name, to_name, target ? &to_sb : NULL); @@ -893,9 +899,11 @@ install(const char *from_name, const char *to_name, u_ * and the files are different (or just not compared). */ if (tempcopy && !files_match) { +#if HAVE_STRUCT_STAT_ST_FLAGS /* Try to turn off the immutable bits. */ if (to_sb.st_flags & NOCHANGEBITS) (void)chflags(to_name, to_sb.st_flags & ~NOCHANGEBITS); +#endif if (dobackup) { if ((size_t)snprintf(backup, MAXPATHLEN, "%s%s", to_name, suffix) != strlen(to_name) + strlen(suffix)) { @@ -907,8 +915,10 @@ install(const char *from_name, const char *to_name, u_ (void)printf("install: %s -> %s\n", to_name, backup); if (unlink(backup) < 0 && errno != ENOENT) { serrno = errno; +#if HAVE_STRUCT_STAT_ST_FLAGS if (to_sb.st_flags & NOCHANGEBITS) (void)chflags(to_name, to_sb.st_flags); +#endif unlink(tempfile); errno = serrno; err(EX_OSERR, "unlink: %s", backup); @@ -916,8 +926,10 @@ install(const char *from_name, const char *to_name, u_ if (link(to_name, backup) < 0) { serrno = errno; unlink(tempfile); +#if HAVE_STRUCT_STAT_ST_FLAGS if (to_sb.st_flags & NOCHANGEBITS) (void)chflags(to_name, to_sb.st_flags); +#endif errno = serrno; err(EX_OSERR, "link: %s to %s", to_name, backup); @@ -962,9 +974,11 @@ install(const char *from_name, const char *to_name, u_ if (!dounpriv && ((gid != (gid_t)-1 && gid != to_sb.st_gid) || (uid != (uid_t)-1 && uid != to_sb.st_uid) || (mode != (to_sb.st_mode & ALLPERMS)))) { +#if HAVE_STRUCT_STAT_ST_FLAGS /* Try to turn off the immutable bits. */ if (to_sb.st_flags & NOCHANGEBITS) (void)fchflags(to_fd, to_sb.st_flags & ~NOCHANGEBITS); +#endif } if (!dounpriv & @@ -986,7 +1000,7 @@ install(const char *from_name, const char *to_name, u_ err(EX_OSERR, "%s: chmod", to_name); } } - +#if HAVE_STRUCT_STAT_ST_FLAGS /* * If provided a set of flags, set them, otherwise, preserve the * flags, except for the dump flag. @@ -1009,6 +1023,7 @@ install(const char *from_name, const char *to_name, u_ } } } +#endif (void)close(to_fd); if (!devnull) @@ -1135,15 +1150,19 @@ create_newfile(const char *path, int target, struct st * off the append/immutable bits -- if we fail, go ahead, * it might work. */ +#if HAVE_STRUCT_STAT_ST_FLAGS if (sbp->st_flags & NOCHANGEBITS) (void)chflags(path, sbp->st_flags & ~NOCHANGEBITS); +#endif if (dobackup) { if ((size_t)snprintf(backup, MAXPATHLEN, "%s%s", path, suffix) != strlen(path) + strlen(suffix)) { saved_errno = errno; +#if HAVE_STRUCT_STAT_ST_FLAGS if (sbp->st_flags & NOCHANGEBITS) (void)chflags(path, sbp->st_flags); +#endif errno = saved_errno; errx(EX_OSERR, "%s: backup filename too long", path); @@ -1155,8 +1174,10 @@ create_newfile(const char *path, int target, struct st path, backup); if (rename(path, backup) < 0) { saved_errno = errno; +#if HAVE_STRUCT_STAT_ST_FLAGS if (sbp->st_flags & NOCHANGEBITS) (void)chflags(path, sbp->st_flags); +#endif errno = saved_errno; err(EX_OSERR, "rename: %s to %s", path, backup); } Modified: head/usr.sbin/makefs/ffs.c ============================================================================== --- head/usr.sbin/makefs/ffs.c Tue Jan 16 21:43:36 2018 (r328063) +++ head/usr.sbin/makefs/ffs.c Tue Jan 16 21:43:46 2018 (r328064) @@ -70,6 +70,10 @@ #include __FBSDID("$FreeBSD$"); +#if HAVE_NBTOOL_CONFIG_H +#include "nbtool_config.h" +#endif + #include #include @@ -315,7 +319,7 @@ static void ffs_validate(const char *dir, fsnode *root, fsinfo_t *fsopts) { int32_t ncg = 1; -#if notyet +#ifdef notyet int32_t spc, nspf, ncyl, fssize; #endif ffs_opt_t *ffs_opts = fsopts->fs_specific; Modified: head/usr.sbin/makefs/mtree.c ============================================================================== --- head/usr.sbin/makefs/mtree.c Tue Jan 16 21:43:36 2018 (r328063) +++ head/usr.sbin/makefs/mtree.c Tue Jan 16 21:43:46 2018 (r328064) @@ -25,6 +25,10 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#if HAVE_NBTOOL_CONFIG_H +#include "nbtool_config.h" +#endif + #include __FBSDID("$FreeBSD$"); @@ -532,11 +536,13 @@ read_mtree_keywords(FILE *fp, fsnode *node) break; } flset = flclr = 0; +#if HAVE_STRUCT_STAT_ST_FLAGS if (!strtofflags(&value, &flset, &flclr)) { st->st_flags &= ~flclr; st->st_flags |= flset; } else error = errno; +#endif } else error = ENOSYS; break; From owner-svn-src-head@freebsd.org Tue Jan 16 21:43:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6940EBA25E; Tue, 16 Jan 2018 21:43:59 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ED11E6E9AE; Tue, 16 Jan 2018 21:43:58 +0000 (UTC) (envelope-from arichardson@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C3E7E2627F; Tue, 16 Jan 2018 21:43:57 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0GLhvbV086287; Tue, 16 Jan 2018 21:43:57 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0GLhvW1086285; Tue, 16 Jan 2018 21:43:57 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <201801162143.w0GLhvW1086285@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Tue, 16 Jan 2018 21:43:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328065 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 328065 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jan 2018 21:43:59 -0000 Author: arichardson Date: Tue Jan 16 21:43:57 2018 New Revision: 328065 URL: https://svnweb.freebsd.org/changeset/base/328065 Log: Use ln -n instead of -h to allow building the kernel on Linux Both flags do the same thing but -n is more widely supported. Reviewed By: jhb, emaste Approved By: jhb (mentor) Differential Revision: https://reviews.freebsd.org/D13936 Modified: head/sys/conf/kern.post.mk head/sys/conf/kmod.mk Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Tue Jan 16 21:43:46 2018 (r328064) +++ head/sys/conf/kern.post.mk Tue Jan 16 21:43:57 2018 (r328065) @@ -300,7 +300,7 @@ ${_ILINKS}: path=${S}/${.TARGET}/include ;; \ esac ; \ ${ECHO} ${.TARGET} "->" $$path ; \ - ln -fhs $$path ${.TARGET} + ln -fns $$path ${.TARGET} # .depend needs include links so we remove them only together. kernel-cleandepend: .PHONY Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Tue Jan 16 21:43:46 2018 (r328064) +++ head/sys/conf/kmod.mk Tue Jan 16 21:43:57 2018 (r328065) @@ -292,7 +292,7 @@ ${_ILINKS}: esac ; \ path=`(cd $$path && /bin/pwd)` ; \ ${ECHO} ${.TARGET:T} "->" $$path ; \ - ln -fhs $$path ${.TARGET:T} + ln -fns $$path ${.TARGET:T} CLEANFILES+= ${PROG} ${KMOD}.kld ${OBJS} From owner-svn-src-head@freebsd.org Tue Jan 16 21:58:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8AF0BEBAF89; Tue, 16 Jan 2018 21:58:39 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 623696F334; Tue, 16 Jan 2018 21:58:39 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 96C0B26433; Tue, 16 Jan 2018 21:58:38 +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 w0GLwc8V090665; Tue, 16 Jan 2018 21:58:38 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0GLwcep090664; Tue, 16 Jan 2018 21:58:38 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201801162158.w0GLwcep090664@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 16 Jan 2018 21:58:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328066 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 328066 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jan 2018 21:58:39 -0000 Author: tuexen Date: Tue Jan 16 21:58:38 2018 New Revision: 328066 URL: https://svnweb.freebsd.org/changeset/base/328066 Log: Fix a bug related to fast retransmissions. When processing a SACK advancing the cumtsn-ack in fast recovery, increment the miss-indications for all TSN's reported as missing. Thanks to Fabian Ising for finding the bug and to Timo Voelker for provinding a fix. This fix moves also CMT related initialisation of some variables to a more appropriate place. MFC after: 1 week Modified: head/sys/netinet/sctp_indata.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Tue Jan 16 21:43:57 2018 (r328065) +++ head/sys/netinet/sctp_indata.c Tue Jan 16 21:58:38 2018 (r328066) @@ -3364,7 +3364,8 @@ sctp_strike_gap_ack_chunks(struct sctp_tcb *stcb, stru } } } - if (SCTP_TSN_GT(tp1->rec.data.tsn, asoc->this_sack_highest_gap)) { + if (SCTP_TSN_GT(tp1->rec.data.tsn, asoc->this_sack_highest_gap) && + !(accum_moved && asoc->fast_retran_loss_recovery)) { /* we are beyond the tsn in the sack */ break; } @@ -3388,8 +3389,10 @@ sctp_strike_gap_ack_chunks(struct sctp_tcb *stcb, stru * FR using this SACK. */ continue; - } else if (tp1->whoTo && SCTP_TSN_GT(tp1->rec.data.tsn, - tp1->whoTo->this_sack_highest_newack)) { + } else if (tp1->whoTo && + SCTP_TSN_GT(tp1->rec.data.tsn, + tp1->whoTo->this_sack_highest_newack) && + !(accum_moved && asoc->fast_retran_loss_recovery)) { /* * CMT: New acks were receieved for data sent to * this dest. But no new acks were seen for data @@ -3674,7 +3677,7 @@ sctp_strike_gap_ack_chunks(struct sctp_tcb *stcb, stru tp1->whoTo->find_pseudo_cumack = 1; tp1->whoTo->find_rtx_pseudo_cumack = 1; } - } else {/* CMT is OFF */ + } else { /* CMT is OFF */ #ifdef SCTP_FR_TO_ALTERNATE /* Can we find an alternate? */ @@ -4603,6 +4606,13 @@ hopeless_peer: if (stcb->asoc.cc_functions.sctp_cwnd_prepare_net_for_sack) { (*stcb->asoc.cc_functions.sctp_cwnd_prepare_net_for_sack) (stcb, net); } + /* + * CMT: SFR algo (and HTNA) - this_sack_highest_newack has + * to be greater than the cumack. Also reset saw_newack to 0 + * for all dests. + */ + net->saw_newack = 0; + net->this_sack_highest_newack = last_tsn; } /* process the new consecutive TSN first */ TAILQ_FOREACH(tp1, &asoc->sent_queue, sctp_next) { @@ -4728,16 +4738,6 @@ hopeless_peer: asoc->this_sack_highest_gap = last_tsn; if ((num_seg > 0) || (num_nr_seg > 0)) { - - /* - * CMT: SFR algo (and HTNA) - this_sack_highest_newack has - * to be greater than the cumack. Also reset saw_newack to 0 - * for all dests. - */ - TAILQ_FOREACH(net, &asoc->nets, sctp_next) { - net->saw_newack = 0; - net->this_sack_highest_newack = last_tsn; - } /* * thisSackHighestGap will increase while handling NEW From owner-svn-src-head@freebsd.org Tue Jan 16 23:08:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0238EBE82F; Tue, 16 Jan 2018 23:08:26 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8A20F719C5; Tue, 16 Jan 2018 23:08:26 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CF5E92700B; Tue, 16 Jan 2018 23:08:25 +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 w0GN8PeB020155; Tue, 16 Jan 2018 23:08:25 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0GN8PtI020154; Tue, 16 Jan 2018 23:08:25 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201801162308.w0GN8PtI020154@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 16 Jan 2018 23:08:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328067 - head/sys/cam/scsi X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/cam/scsi X-SVN-Commit-Revision: 328067 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jan 2018 23:08:26 -0000 Author: pfg Date: Tue Jan 16 23:08:25 2018 New Revision: 328067 URL: https://svnweb.freebsd.org/changeset/base/328067 Log: scsi_ch.c: Small cleanups to the comments. Move the the NetBSD tag near to the related licence. Update it to reflect better the point where we started diverging. Use grouping parenthesis for the SPDX tag. No functional change. Modified: head/sys/cam/scsi/scsi_ch.c Modified: head/sys/cam/scsi/scsi_ch.c ============================================================================== --- head/sys/cam/scsi/scsi_ch.c Tue Jan 16 21:58:38 2018 (r328066) +++ head/sys/cam/scsi/scsi_ch.c Tue Jan 16 23:08:25 2018 (r328067) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD AND BSD-4-Clause + * SPDX-License-Identifier: (BSD-2-Clause-FreeBSD AND BSD-4-Clause) * * Copyright (c) 1997 Justin T. Gibbs. * Copyright (c) 1997, 1998, 1999 Kenneth D. Merry. @@ -27,12 +27,6 @@ * SUCH DAMAGE. */ -/* - * Derived from the NetBSD SCSI changer driver. - * - * $NetBSD: ch.c,v 1.32 1998/01/12 09:49:12 thorpej Exp $ - * - */ /*- * Copyright (c) 1996, 1997 Jason R. Thorpe * All rights reserved. @@ -67,6 +61,8 @@ * 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: ch.c,v 1.34 1998/08/31 22:28:06 cgd Exp $ */ #include From owner-svn-src-head@freebsd.org Tue Jan 16 23:14:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 964E8EBEE05; Tue, 16 Jan 2018 23:14:13 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5522A71FBF; Tue, 16 Jan 2018 23:14:13 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 534422719D; Tue, 16 Jan 2018 23:14:12 +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 w0GNECvn024367; Tue, 16 Jan 2018 23:14:12 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0GNECt7024366; Tue, 16 Jan 2018 23:14:12 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201801162314.w0GNECt7024366@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 16 Jan 2018 23:14:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328068 - head/sys/x86/isa X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/x86/isa X-SVN-Commit-Revision: 328068 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jan 2018 23:14:13 -0000 Author: ian Date: Tue Jan 16 23:14:12 2018 New Revision: 328068 URL: https://svnweb.freebsd.org/changeset/base/328068 Log: Move some code around and rename a couple variables; no functional changes. The static atrtc_set() function was called only from clock_settime(), so just move its contents entirely into clock_settime() and delete atrtc_set(). Rename the struct bcd_clocktime variables from 'ct' to 'bct'. I had originally wanted to emphasize how identical the clocktime and bcd_clocktime structs were, but things evolved to the point where the structs are not at all identical anymore, so now emphasizing the difference seems better. Modified: head/sys/x86/isa/atrtc.c Modified: head/sys/x86/isa/atrtc.c ============================================================================== --- head/sys/x86/isa/atrtc.c Tue Jan 16 23:08:25 2018 (r328067) +++ head/sys/x86/isa/atrtc.c Tue Jan 16 23:14:12 2018 (r328068) @@ -169,39 +169,6 @@ atrtc_restore(void) rtcin(RTC_INTR); } -static void -atrtc_set(struct timespec *ts) -{ - struct bcd_clocktime ct; - - clock_ts_to_bcd(ts, &ct, false); - - mtx_lock(&atrtc_time_lock); - RTC_LOCK; - - /* Disable RTC updates and interrupts. */ - rtcout_locked(RTC_STATUSB, RTCSB_HALT | RTCSB_24HR); - - /* Write all the time registers. */ - rtcout_locked(RTC_SEC, ct.sec); - rtcout_locked(RTC_MIN, ct.min); - rtcout_locked(RTC_HRS, ct.hour); - rtcout_locked(RTC_WDAY, ct.dow + 1); - rtcout_locked(RTC_DAY, ct.day); - rtcout_locked(RTC_MONTH, ct.mon); - rtcout_locked(RTC_YEAR, ct.year & 0xff); -#ifdef USE_RTC_CENTURY - rtcout_locked(RTC_CENTURY, ct.year >> 8); -#endif - - /* Re-enable RTC updates and interrupts. */ - rtcout_locked(RTC_STATUSB, rtc_statusb); - rtcin_locked(RTC_INTR); - - RTC_UNLOCK; - mtx_unlock(&atrtc_time_lock); -} - /********************************************************************** * RTC driver for subr_rtc */ @@ -348,15 +315,44 @@ atrtc_resume(device_t dev) static int atrtc_settime(device_t dev __unused, struct timespec *ts) { + struct bcd_clocktime bct; - atrtc_set(ts); + clock_ts_to_bcd(ts, &bct, false); + + mtx_lock(&atrtc_time_lock); + RTC_LOCK; + + /* Disable RTC updates and interrupts. */ + rtcout_locked(RTC_STATUSB, RTCSB_HALT | RTCSB_24HR); + + /* Write all the time registers. */ + rtcout_locked(RTC_SEC, bct.sec); + rtcout_locked(RTC_MIN, bct.min); + rtcout_locked(RTC_HRS, bct.hour); + rtcout_locked(RTC_WDAY, bct.dow + 1); + rtcout_locked(RTC_DAY, bct.day); + rtcout_locked(RTC_MONTH, bct.mon); + rtcout_locked(RTC_YEAR, bct.year & 0xff); +#ifdef USE_RTC_CENTURY + rtcout_locked(RTC_CENTURY, bct.year >> 8); +#endif + + /* + * Re-enable RTC updates and interrupts. + */ + rtcout_locked(RTC_STATUSB, rtc_statusb); + rtcin_locked(RTC_INTR); + + RTC_UNLOCK; + mtx_unlock(&atrtc_time_lock); + return (0); } static int atrtc_gettime(device_t dev, struct timespec *ts) { - struct bcd_clocktime ct; + struct bcd_clocktime bct; /* Look if we have a RTC present and the time is valid */ if (!(rtcin(RTC_STATUSD) & RTCSD_PWR)) { @@ -376,22 +372,22 @@ atrtc_gettime(device_t dev, struct timespec *ts) continue; critical_enter(); RTC_LOCK; - ct.sec = rtcin_locked(RTC_SEC); - ct.min = rtcin_locked(RTC_MIN); - ct.hour = rtcin_locked(RTC_HRS); - ct.day = rtcin_locked(RTC_DAY); - ct.mon = rtcin_locked(RTC_MONTH); - ct.year = rtcin_locked(RTC_YEAR); + bct.sec = rtcin_locked(RTC_SEC); + bct.min = rtcin_locked(RTC_MIN); + bct.hour = rtcin_locked(RTC_HRS); + bct.day = rtcin_locked(RTC_DAY); + bct.mon = rtcin_locked(RTC_MONTH); + bct.year = rtcin_locked(RTC_YEAR); #ifdef USE_RTC_CENTURY - ct.year |= rtcin_locked(RTC_CENTURY) << 8; + bct.year |= rtcin_locked(RTC_CENTURY) << 8; #endif RTC_UNLOCK; critical_exit(); mtx_unlock(&atrtc_time_lock); /* dow is unused in timespec conversion and we have no nsec info. */ - ct.dow = 0; - ct.nsec = 0; - return (clock_bcd_to_ts(&ct, ts, false)); + bct.dow = 0; + bct.nsec = 0; + return (clock_bcd_to_ts(&bct, ts, false)); } static device_method_t atrtc_methods[] = { From owner-svn-src-head@freebsd.org Tue Jan 16 23:18:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 052D2EBF132; Tue, 16 Jan 2018 23:18:54 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D487A72246; Tue, 16 Jan 2018 23:18: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 18A7E271AB; Tue, 16 Jan 2018 23:18:53 +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 w0GNIqur024548; Tue, 16 Jan 2018 23:18:52 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0GNIqbl024547; Tue, 16 Jan 2018 23:18:52 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201801162318.w0GNIqbl024547@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 16 Jan 2018 23:18:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328069 - head/sys/x86/isa X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/x86/isa X-SVN-Commit-Revision: 328069 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jan 2018 23:18:54 -0000 Author: ian Date: Tue Jan 16 23:18:52 2018 New Revision: 328069 URL: https://svnweb.freebsd.org/changeset/base/328069 Log: Remove redundant critical_enter/exit() calls. The block of code delimited by these calls is now protected by a spin mutex (obscured within the RTC_LOCK/RTC_UNLOCK macros). Reported by: bde@ Modified: head/sys/x86/isa/atrtc.c Modified: head/sys/x86/isa/atrtc.c ============================================================================== --- head/sys/x86/isa/atrtc.c Tue Jan 16 23:14:12 2018 (r328068) +++ head/sys/x86/isa/atrtc.c Tue Jan 16 23:18:52 2018 (r328069) @@ -370,7 +370,6 @@ atrtc_gettime(device_t dev, struct timespec *ts) mtx_lock(&atrtc_time_lock); while (rtcin(RTC_STATUSA) & RTCSA_TUP) continue; - critical_enter(); RTC_LOCK; bct.sec = rtcin_locked(RTC_SEC); bct.min = rtcin_locked(RTC_MIN); @@ -382,7 +381,6 @@ atrtc_gettime(device_t dev, struct timespec *ts) bct.year |= rtcin_locked(RTC_CENTURY) << 8; #endif RTC_UNLOCK; - critical_exit(); mtx_unlock(&atrtc_time_lock); /* dow is unused in timespec conversion and we have no nsec info. */ bct.dow = 0; From owner-svn-src-head@freebsd.org Tue Jan 16 23:20:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47E4EEBF29C; Tue, 16 Jan 2018 23:20:00 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 20B5D723CB; Tue, 16 Jan 2018 23:20:00 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 73BD8271AD; Tue, 16 Jan 2018 23:19:59 +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 w0GNJxlK024646; Tue, 16 Jan 2018 23:19:59 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0GNJvHo024628; Tue, 16 Jan 2018 23:19:57 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201801162319.w0GNJvHo024628@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 16 Jan 2018 23:19:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328070 - in head/sys/cam: . ctl mmc nvme scsi X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: in head/sys/cam: . ctl mmc nvme scsi X-SVN-Commit-Revision: 328070 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jan 2018 23:20:00 -0000 Author: pfg Date: Tue Jan 16 23:19:57 2018 New Revision: 328070 URL: https://svnweb.freebsd.org/changeset/base/328070 Log: SPDX: finish tagging sys/cam. Modified: head/sys/cam/cam_iosched.c head/sys/cam/cam_iosched.h head/sys/cam/ctl/ctl_ha.c head/sys/cam/ctl/ctl_tpc.c head/sys/cam/ctl/ctl_tpc.h head/sys/cam/ctl/ctl_tpc_local.c head/sys/cam/mmc/mmc.h head/sys/cam/mmc/mmc_all.h head/sys/cam/mmc/mmc_da.c head/sys/cam/mmc/mmc_xpt.c head/sys/cam/nvme/nvme_all.c head/sys/cam/nvme/nvme_all.h head/sys/cam/nvme/nvme_da.c head/sys/cam/nvme/nvme_xpt.c head/sys/cam/scsi/scsi_all.c head/sys/cam/scsi/scsi_enc.h head/sys/cam/scsi/scsi_ses.h Modified: head/sys/cam/cam_iosched.c ============================================================================== --- head/sys/cam/cam_iosched.c Tue Jan 16 23:18:52 2018 (r328069) +++ head/sys/cam/cam_iosched.c Tue Jan 16 23:19:57 2018 (r328070) @@ -1,6 +1,8 @@ /*- * CAM IO Scheduler Interface * + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2015 Netflix, Inc. * All rights reserved. * Modified: head/sys/cam/cam_iosched.h ============================================================================== --- head/sys/cam/cam_iosched.h Tue Jan 16 23:18:52 2018 (r328069) +++ head/sys/cam/cam_iosched.h Tue Jan 16 23:19:57 2018 (r328070) @@ -1,6 +1,8 @@ /*- * CAM IO Scheduler Interface * + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2015 Netflix, Inc. * All rights reserved. * Modified: head/sys/cam/ctl/ctl_ha.c ============================================================================== --- head/sys/cam/ctl/ctl_ha.c Tue Jan 16 23:18:52 2018 (r328069) +++ head/sys/cam/ctl/ctl_ha.c Tue Jan 16 23:19:57 2018 (r328070) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2015 Alexander Motin * All rights reserved. * Modified: head/sys/cam/ctl/ctl_tpc.c ============================================================================== --- head/sys/cam/ctl/ctl_tpc.c Tue Jan 16 23:18:52 2018 (r328069) +++ head/sys/cam/ctl/ctl_tpc.c Tue Jan 16 23:19:57 2018 (r328070) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2014 Alexander Motin * All rights reserved. * Modified: head/sys/cam/ctl/ctl_tpc.h ============================================================================== --- head/sys/cam/ctl/ctl_tpc.h Tue Jan 16 23:18:52 2018 (r328069) +++ head/sys/cam/ctl/ctl_tpc.h Tue Jan 16 23:19:57 2018 (r328070) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2014 Alexander Motin * All rights reserved. * Modified: head/sys/cam/ctl/ctl_tpc_local.c ============================================================================== --- head/sys/cam/ctl/ctl_tpc_local.c Tue Jan 16 23:18:52 2018 (r328069) +++ head/sys/cam/ctl/ctl_tpc_local.c Tue Jan 16 23:19:57 2018 (r328070) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2014 Alexander Motin * Copyright (c) 2004, 2005 Silicon Graphics International Corp. * All rights reserved. Modified: head/sys/cam/mmc/mmc.h ============================================================================== --- head/sys/cam/mmc/mmc.h Tue Jan 16 23:18:52 2018 (r328069) +++ head/sys/cam/mmc/mmc.h Tue Jan 16 23:19:57 2018 (r328070) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2014-2016 Ilya Bakulin. All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/cam/mmc/mmc_all.h ============================================================================== --- head/sys/cam/mmc/mmc_all.h Tue Jan 16 23:18:52 2018 (r328069) +++ head/sys/cam/mmc/mmc_all.h Tue Jan 16 23:19:57 2018 (r328070) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2014-2016 Ilya Bakulin. All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/cam/mmc/mmc_da.c ============================================================================== --- head/sys/cam/mmc/mmc_da.c Tue Jan 16 23:18:52 2018 (r328069) +++ head/sys/cam/mmc/mmc_da.c Tue Jan 16 23:19:57 2018 (r328070) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2006 Bernd Walter * Copyright (c) 2006 M. Warner Losh * Copyright (c) 2009 Alexander Motin Modified: head/sys/cam/mmc/mmc_xpt.c ============================================================================== --- head/sys/cam/mmc/mmc_xpt.c Tue Jan 16 23:18:52 2018 (r328069) +++ head/sys/cam/mmc/mmc_xpt.c Tue Jan 16 23:19:57 2018 (r328070) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2013,2014 Ilya Bakulin * All rights reserved. * Modified: head/sys/cam/nvme/nvme_all.c ============================================================================== --- head/sys/cam/nvme/nvme_all.c Tue Jan 16 23:18:52 2018 (r328069) +++ head/sys/cam/nvme/nvme_all.c Tue Jan 16 23:19:57 2018 (r328070) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2015 Netflix, Inc * All rights reserved. * Modified: head/sys/cam/nvme/nvme_all.h ============================================================================== --- head/sys/cam/nvme/nvme_all.h Tue Jan 16 23:18:52 2018 (r328069) +++ head/sys/cam/nvme/nvme_all.h Tue Jan 16 23:19:57 2018 (r328070) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2015 Netflix, Inc * All rights reserved. * Modified: head/sys/cam/nvme/nvme_da.c ============================================================================== --- head/sys/cam/nvme/nvme_da.c Tue Jan 16 23:18:52 2018 (r328069) +++ head/sys/cam/nvme/nvme_da.c Tue Jan 16 23:19:57 2018 (r328070) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2015 Netflix, Inc * All rights reserved. * Modified: head/sys/cam/nvme/nvme_xpt.c ============================================================================== --- head/sys/cam/nvme/nvme_xpt.c Tue Jan 16 23:18:52 2018 (r328069) +++ head/sys/cam/nvme/nvme_xpt.c Tue Jan 16 23:19:57 2018 (r328070) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2015 Netflix, Inc. * All rights reserved. * Modified: head/sys/cam/scsi/scsi_all.c ============================================================================== --- head/sys/cam/scsi/scsi_all.c Tue Jan 16 23:18:52 2018 (r328069) +++ head/sys/cam/scsi/scsi_all.c Tue Jan 16 23:19:57 2018 (r328070) @@ -1,7 +1,7 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * * Implementation of Utility functions for all SCSI device types. + * + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 1997, 1998, 1999 Justin T. Gibbs. * Copyright (c) 1997, 1998, 2003 Kenneth D. Merry. Modified: head/sys/cam/scsi/scsi_enc.h ============================================================================== --- head/sys/cam/scsi/scsi_enc.h Tue Jan 16 23:18:52 2018 (r328069) +++ head/sys/cam/scsi/scsi_enc.h Tue Jan 16 23:19:57 2018 (r328070) @@ -1,5 +1,7 @@ /* $FreeBSD$ */ /*- + * SPDX-License-Identifier: (BSD-2-Clause-FreeBSD OR GPL-2.0) + * * Copyright (c) 2000 by Matthew Jacob * All rights reserved. * Modified: head/sys/cam/scsi/scsi_ses.h ============================================================================== --- head/sys/cam/scsi/scsi_ses.h Tue Jan 16 23:18:52 2018 (r328069) +++ head/sys/cam/scsi/scsi_ses.h Tue Jan 16 23:19:57 2018 (r328070) @@ -1,5 +1,7 @@ /* $FreeBSD$ */ /*- + * SPDX-License-Identifier: (BSD-2-Clause-FreeBSD OR GPL-2.0) + * * Copyright (c) 2000 by Matthew Jacob * All rights reserved. * From owner-svn-src-head@freebsd.org Wed Jan 17 03:34:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B1B1E76C51; Wed, 17 Jan 2018 03:34:27 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 348C479DD1; Wed, 17 Jan 2018 03:34:27 +0000 (UTC) (envelope-from landonf@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7561D1C14; Wed, 17 Jan 2018 03:34:26 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0H3YQjS032604; Wed, 17 Jan 2018 03:34:26 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0H3YQsk032602; Wed, 17 Jan 2018 03:34:26 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201801170334.w0H3YQsk032602@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Wed, 17 Jan 2018 03:34:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328071 - in head/sys/dev/bhnd: bhndb cores/pci X-SVN-Group: head X-SVN-Commit-Author: landonf X-SVN-Commit-Paths: in head/sys/dev/bhnd: bhndb cores/pci X-SVN-Commit-Revision: 328071 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jan 2018 03:34:27 -0000 Author: landonf Date: Wed Jan 17 03:34:26 2018 New Revision: 328071 URL: https://svnweb.freebsd.org/changeset/base/328071 Log: bhndb_pci(4): fix incorrect BHND_PCI_SRSH_PI workaround On a SPROM-less device, the PCI(e) bridge core will be initialized with its power-on-reset defaults; this can leave the SPROM-derived BHND_PCI_SRSH_PI value pointing to the wrong backplane address. This value is used by the PCI core when performing address translation between the static register windows in BAR0 that map the PCI core's register block, and backplane address space. Previously, bhndb_pci(4) incorrectly used the potentially invalid static BAR0 PCI register windows when attempting to correct the BHND_PCI_SRSH_PI value in the PCI core's SPROM shadow. Instead, we now read/update BHND_PCI_SRSH_PI by fetching the PCI core's backplane address from the core enumeration table, and then using a dynamic register window to explicitly map the PCI core's register block into BAR0. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/bhnd/bhndb/bhndb_pci.c head/sys/dev/bhnd/bhndb/bhndb_pcivar.h head/sys/dev/bhnd/cores/pci/bhnd_pcireg.h Modified: head/sys/dev/bhnd/bhndb/bhndb_pci.c ============================================================================== --- head/sys/dev/bhnd/bhndb/bhndb_pci.c Tue Jan 16 23:19:57 2018 (r328070) +++ head/sys/dev/bhnd/bhndb/bhndb_pci.c Wed Jan 17 03:34:26 2018 (r328071) @@ -75,13 +75,11 @@ __FBSDID("$FreeBSD$"); #include "bhndb_private.h" struct bhndb_pci_eio; +struct bhndb_pci_probe; static int bhndb_pci_alloc_msi(struct bhndb_pci_softc *sc, int *msi_count); -static int bhndb_pci_read_core_table(device_t dev, - struct bhnd_chipid *chipid, - struct bhnd_core_info **cores, u_int *ncores, - bhnd_erom_class_t **eromcls); + static int bhndb_pci_add_children(struct bhndb_pci_softc *sc); static bhnd_devclass_t bhndb_expected_pci_devclass(device_t dev); @@ -101,15 +99,30 @@ static void bhndb_pci_write_core(struct bhndb_pci_sof static uint32_t bhndb_pci_read_core(struct bhndb_pci_softc *sc, bus_size_t offset, u_int width); -static void bhndb_init_sromless_pci_config( - struct bhndb_pci_softc *sc); +static int bhndb_pci_srsh_pi_war(struct bhndb_pci_softc *sc, + struct bhndb_pci_probe *probe); static bus_addr_t bhndb_pci_sprom_addr(struct bhndb_pci_softc *sc); static bus_size_t bhndb_pci_sprom_size(struct bhndb_pci_softc *sc); -static int bhndb_pci_eio_init(struct bhndb_pci_eio *pio, - device_t dev, device_t pci_dev, - struct bhndb_host_resources *hr); +static int bhndb_pci_probe_alloc(struct bhndb_pci_probe **probe, + device_t dev, bhnd_devclass_t pci_devclass); +static void bhndb_pci_probe_free(struct bhndb_pci_probe *probe); + +static int bhndb_pci_probe_copy_core_table( + struct bhndb_pci_probe *probe, + struct bhnd_core_info **cores, u_int *ncores); +static void bhndb_pci_probe_free_core_table( + struct bhnd_core_info *cores); + +static void bhndb_pci_probe_write(struct bhndb_pci_probe *sc, + bhnd_addr_t addr, bhnd_size_t offset, + uint32_t value, u_int width); +static uint32_t bhndb_pci_probe_read(struct bhndb_pci_probe *sc, + bhnd_addr_t addr, bhnd_size_t offset, u_int width); + +static void bhndb_pci_eio_init(struct bhndb_pci_eio *eio, + struct bhndb_pci_probe *probe); static int bhndb_pci_eio_map(struct bhnd_erom_io *eio, bhnd_addr_t addr, bhnd_size_t size); static uint32_t bhndb_pci_eio_read(struct bhnd_erom_io *eio, @@ -122,26 +135,50 @@ static struct bhndb_pci_quirk bhndb_pcie_quirks[]; static struct bhndb_pci_quirk bhndb_pcie2_quirks[]; static struct bhndb_pci_core bhndb_pci_cores[] = { - BHNDB_PCI_CORE(PCI, BHND_PCI_SRSH_PI_OFFSET, bhndb_pci_quirks), - BHNDB_PCI_CORE(PCIE, BHND_PCIE_SRSH_PI_OFFSET, bhndb_pcie_quirks), - BHNDB_PCI_CORE(PCIE2, BHND_PCIE_SRSH_PI_OFFSET, bhndb_pcie2_quirks), + BHNDB_PCI_CORE(PCI, bhndb_pci_quirks), + BHNDB_PCI_CORE(PCIE, bhndb_pcie_quirks), + BHNDB_PCI_CORE(PCIE2, bhndb_pcie2_quirks), BHNDB_PCI_CORE_END }; /* bhndb_pci erom I/O instance state */ struct bhndb_pci_eio { struct bhnd_erom_io eio; - device_t dev; /**< bridge device */ - device_t pci_dev; /**< parent PCI device */ - struct bhndb_host_resources *hr; /**< borrowed reference to host resources */ - const struct bhndb_regwin *win; /**< mapped register window, or NULL */ - struct resource *res; /**< resource containing the register window, or NULL if no window mapped */ - bhnd_addr_t res_target; /**< current target address (if mapped) */ - bool mapped; /**< true if a valid mapping exists, false otherwise */ bhnd_addr_t addr; /**< mapped address */ bhnd_size_t size; /**< mapped size */ + struct bhndb_pci_probe *probe; /**< borrowed probe reference */ }; +/** + * Provides early bus access to the bridged device's cores and core enumeration + * table. + * + * May be safely used during probe or early device attach, prior to calling + * bhndb_attach(). + */ +struct bhndb_pci_probe { + device_t dev; /**< bridge device */ + device_t pci_dev; /**< parent PCI device */ + struct bhnd_chipid cid; /**< chip identification */ + struct bhnd_core_info hostb_core; /**< PCI bridge core info */ + + struct bhndb_pci_eio erom_io; /**< erom I/O instance */ + bhnd_erom_class_t *erom_class; /**< probed erom class */ + bhnd_erom_t *erom; /**< erom parser */ + struct bhnd_core_info *cores; /**< erom-owned core table */ + u_int ncores; /**< number of cores */ + + const struct bhndb_regwin *m_win; /**< mapped register window, or NULL if no mapping */ + struct resource *m_res; /**< resource containing the register window, or NULL if no window mapped */ + bhnd_addr_t m_target; /**< base address mapped by m_win */ + bhnd_addr_t m_addr; /**< mapped address */ + bhnd_size_t m_size; /**< mapped size */ + bool m_valid; /**< true if a valid mapping exists, false otherwise */ + + struct bhndb_host_resources *hr; /**< backing host resources */ +}; + + static struct bhndb_pci_quirk bhndb_pci_quirks[] = { /* Backplane interrupt flags must be routed via siba-specific * SIBA_CFG0_INTVEC configuration register; the BHNDB_PCI_INT_MASK @@ -162,12 +199,9 @@ static struct bhndb_pci_quirk bhndb_pcie_quirks[] = { }; static struct bhndb_pci_quirk bhndb_pcie2_quirks[] = { - /* All PCIe-G2 core revisions require the SRSH work-around */ - BHNDB_PCI_QUIRK(HWREV_ANY, BHNDB_PCI_QUIRK_SRSH_WAR), BHNDB_PCI_QUIRK_END }; - /** * Return the device table entry for @p ci, or NULL if none. */ @@ -227,16 +261,14 @@ bhndb_pci_get_core_quirks(struct bhnd_chipid *cid, str static int bhndb_pci_probe(device_t dev) { - struct bhnd_chipid cid; - struct bhnd_core_info *cores, hostb_core; + struct bhndb_pci_probe *probe; struct bhndb_pci_core *entry; bhnd_devclass_t hostb_devclass; - u_int ncores; device_t parent; devclass_t parent_bus, pci; int error; - cores = NULL; + probe = NULL; /* Our parent must be a PCI/PCIe device. */ pci = devclass_find("pci"); @@ -251,19 +283,12 @@ bhndb_pci_probe(device_t dev) return (error); /* Identify the chip and enumerate the bridged cores */ - error = bhndb_pci_read_core_table(dev, &cid, &cores, &ncores, NULL); - if (error) - goto cleanup; - - /* Search our core table for the host bridge core */ hostb_devclass = bhndb_expected_pci_devclass(dev); - error = bhndb_find_hostb_core(cores, ncores, hostb_devclass, - &hostb_core); - if (error) + if ((error = bhndb_pci_probe_alloc(&probe, dev, hostb_devclass))) goto cleanup; /* Look for a matching core table entry */ - if ((entry = bhndb_pci_find_core(&hostb_core)) == NULL) { + if ((entry = bhndb_pci_find_core(&probe->hostb_core)) == NULL) { error = ENXIO; goto cleanup; } @@ -274,9 +299,10 @@ bhndb_pci_probe(device_t dev) error = BUS_PROBE_DEFAULT; cleanup: + if (probe != NULL) + bhndb_pci_probe_free(probe); + bhndb_disable_pci_clocks(dev); - if (cores != NULL) - free(cores, M_BHND); return (error); } @@ -319,6 +345,7 @@ bhndb_pci_attach(device_t dev) struct bhnd_chipid cid; struct bhnd_core_info *cores, hostb_core; bhnd_erom_class_t *erom_class; + struct bhndb_pci_probe *probe; u_int ncores; int irq_rid; int error; @@ -332,11 +359,40 @@ bhndb_pci_attach(device_t dev) BHNDB_PCI_LOCK_INIT(sc); + probe = NULL; cores = NULL; /* Enable PCI bus mastering */ pci_enable_busmaster(sc->parent); + /* Enable clocks (if required by this hardware) */ + if ((error = bhndb_enable_pci_clocks(sc->dev))) + goto cleanup; + + /* Identify the chip and enumerate the bridged cores */ + error = bhndb_pci_probe_alloc(&probe, dev, sc->pci_devclass); + if (error) + goto cleanup; + + sc->pci_quirks = bhndb_pci_get_core_quirks(&probe->cid, + &probe->hostb_core); + + /* Select the appropriate register window handler */ + if (probe->cid.chip_type == BHND_CHIPTYPE_SIBA) { + sc->set_regwin = bhndb_pci_compat_setregwin; + } else { + sc->set_regwin = bhndb_pci_fast_setregwin; + } + + /* + * Fix up our PCI base address in the SPROM shadow, if necessary. + * + * This must be done prior to accessing any static register windows + * that map the PCI core. + */ + if ((error = bhndb_pci_srsh_pi_war(sc, probe))) + goto cleanup; + /* Set up PCI interrupt handling */ if (bhndb_pci_alloc_msi(sc, &sc->msi_count) == 0) { /* MSI uses resource IDs starting at 1 */ @@ -361,39 +417,31 @@ bhndb_pci_attach(device_t dev) goto cleanup; } - /* Enable clocks (if required by this hardware) */ - if ((error = bhndb_enable_pci_clocks(sc->dev))) - goto cleanup; + /* + * Copy out the probe results and then free our probe state, releasing + * its exclusive ownership of host bridge resources. + * + * This must be done prior to full configuration of the bridge via + * bhndb_attach(). + */ + cid = probe->cid; + erom_class = probe->erom_class; + hostb_core = probe->hostb_core; - /* Identify the chip and enumerate the bridged cores */ - error = bhndb_pci_read_core_table(dev, &cid, &cores, &ncores, - &erom_class); - if (error) + error = bhndb_pci_probe_copy_core_table(probe, &cores, &ncores); + if (error) { + cores = NULL; goto cleanup; - - /* Select the appropriate register window handler */ - if (cid.chip_type == BHND_CHIPTYPE_SIBA) { - sc->set_regwin = bhndb_pci_compat_setregwin; - } else { - sc->set_regwin = bhndb_pci_fast_setregwin; } - /* Determine our host bridge core and populate our quirk flags */ - error = bhndb_find_hostb_core(cores, ncores, sc->pci_devclass, - &hostb_core); - if (error) - goto cleanup; + bhndb_pci_probe_free(probe); + probe = NULL; - sc->pci_quirks = bhndb_pci_get_core_quirks(&cid, &hostb_core); - /* Perform bridge attach */ error = bhndb_attach(dev, &cid, cores, ncores, &hostb_core, erom_class); if (error) goto cleanup; - /* Fix-up power on defaults for SROM-less devices. */ - bhndb_init_sromless_pci_config(sc); - /* Add any additional child devices */ if ((error = bhndb_pci_add_children(sc))) goto cleanup; @@ -402,13 +450,12 @@ bhndb_pci_attach(device_t dev) if ((error = bus_generic_attach(dev))) goto cleanup; - free(cores, M_BHND); + bhndb_pci_probe_free_core_table(cores); return (0); cleanup: device_delete_children(dev); - bhndb_disable_pci_clocks(sc->dev); if (sc->isrc != NULL) bhndb_free_intr_isrc(sc->isrc); @@ -417,8 +464,13 @@ cleanup: pci_release_msi(sc->parent); if (cores != NULL) - free(cores, M_BHND); + bhndb_pci_probe_free_core_table(cores); + if (probe != NULL) + bhndb_pci_probe_free(probe); + + bhndb_disable_pci_clocks(sc->dev); + pci_disable_busmaster(sc->parent); BHNDB_PCI_LOCK_DESTROY(sc); @@ -461,125 +513,7 @@ bhndb_pci_detach(device_t dev) return (0); } -/** - * Use the generic PCI bridge hardware configuration to enumerate the bridged - * bhnd(4) bus' core table. - * - * @note This function may be safely called prior to device attach, (e.g. - * from DEVICE_PROBE). - * @note This function requires exclusive ownership over allocating and - * configuring host bridge resources, and should only be called prior to - * completion of device attach and full configuration of the bridge. - * - * @param dev The bhndb_pci bridge device. - * @param[out] chipid On success, the parsed chip identification. - * @param[out] cores On success, the enumerated core table. The - * caller is responsible for freeing this table via - * bhndb_pci_free_core_table(). - * @param[out] ncores On success, the number of cores found in - * @p cores. - * @param[out] eromcls On success, a pointer to the erom class used to - * parse the device enumeration table. This - * argument may be NULL if the class is not - * desired. - * - * @retval 0 success - * @retval non-zero if enumerating the bridged bhnd(4) bus fails, a regular - * unix error code will be returned. - */ static int -bhndb_pci_read_core_table(device_t dev, struct bhnd_chipid *chipid, - struct bhnd_core_info **cores, u_int *ncores, - bhnd_erom_class_t **eromcls) -{ - const struct bhndb_hwcfg *cfg; - struct bhndb_host_resources *hr; - struct bhndb_pci_eio pio; - struct bhnd_core_info *erom_cores; - const struct bhnd_chipid *hint; - struct bhnd_chipid cid; - bhnd_erom_class_t *erom_class; - bhnd_erom_t *erom; - device_t parent_dev; - u_int erom_ncores; - int error; - - parent_dev = device_get_parent(dev); - erom = NULL; - erom_cores = NULL; - - /* Fetch our chipid hint (if any) and generic hardware configuration */ - cfg = BHNDB_BUS_GET_GENERIC_HWCFG(parent_dev, dev); - hint = BHNDB_BUS_GET_CHIPID(parent_dev, dev); - - /* Allocate our host resources */ - if ((error = bhndb_alloc_host_resources(&hr, dev, parent_dev, cfg))) - return (error); - - /* Initialize our erom I/O state */ - if ((error = bhndb_pci_eio_init(&pio, dev, parent_dev, hr))) - goto failed; - - /* Map the first bus core from our bridged bhnd(4) bus */ - error = bhndb_pci_eio_map(&pio.eio, BHND_DEFAULT_CHIPC_ADDR, - BHND_DEFAULT_CORE_SIZE); - if (error) - goto failed; - - /* Probe for a usable EROM class, and read the chip identifier */ - erom_class = bhnd_erom_probe_driver_classes(device_get_devclass(dev), - &pio.eio, hint, &cid); - if (erom_class == NULL) { - device_printf(dev, "device enumeration unsupported; no " - "compatible driver found\n"); - - error = ENXIO; - goto failed; - } - - /* Allocate EROM parser */ - if ((erom = bhnd_erom_alloc(erom_class, &cid, &pio.eio)) == NULL) { - device_printf(dev, "failed to allocate device enumeration " - "table parser\n"); - error = ENXIO; - goto failed; - } - - /* Read the full core table */ - error = bhnd_erom_get_core_table(erom, &erom_cores, &erom_ncores); - if (error) { - device_printf(dev, "error fetching core table: %d\n", error); - goto failed; - } - - /* Provide the results to our caller */ - *cores = malloc(sizeof(erom_cores[0]) * erom_ncores, M_BHND, M_WAITOK); - memcpy(*cores, erom_cores, sizeof(erom_cores[0]) * erom_ncores); - *ncores = erom_ncores; - - *chipid = cid; - if (eromcls != NULL) - *eromcls = erom_class; - - /* Clean up */ - bhnd_erom_free_core_table(erom, erom_cores); - bhnd_erom_free(erom); - bhndb_release_host_resources(hr); - - return (0); - -failed: - if (erom_cores != NULL) - bhnd_erom_free_core_table(erom, erom_cores); - - if (erom != NULL) - bhnd_erom_free(erom); - - bhndb_release_host_resources(hr); - return (error); -} - -static int bhndb_pci_add_children(struct bhndb_pci_softc *sc) { bus_size_t nv_sz; @@ -822,45 +756,82 @@ bhndb_pci_read_core(struct bhndb_pci_softc *sc, bus_si } } -/* - * On devices without a SROM, the PCI(e) cores will be initialized with - * their Power-on-Reset defaults; this can leave two of the BAR0 PCI windows - * mapped to the wrong core. +/** + * Fix-up power on defaults for SPROM-less devices. + * + * On SPROM-less devices, the PCI(e) cores will be initialized with their their + * Power-on-Reset defaults; this can leave the BHND_PCI_SRSH_PI value pointing + * to the wrong backplane address. This value is used by the PCI core when + * performing address translation between static register windows in BAR0 that + * map the PCI core's register block, and backplane address space. + * + * When translating accesses via these BAR0 regions, the PCI bridge determines + * the base address of the PCI core by concatenating: + * + * [bits] [source] + * 31:16 bits [31:16] of the enumeration space address (e.g. 0x18000000) + * 15:12 value of BHND_PCI_SRSH_PI from the PCI core's SPROM shadow + * 11:0 bits [11:0] of the PCI bus address + * + * For example, on a PCI_V0 device, the following PCI core register offsets are + * mapped into BAR0: + * + * [BAR0 offset] [description] [PCI core offset] + * 0x1000-0x17FF sprom shadow 0x800-0xFFF + * 0x1800-0x1DFF device registers 0x000-0x5FF + * 0x1E00+0x1FFF siba config registers 0xE00-0xFFF + * + * This function checks -- and if necessary, corrects -- the BHND_PCI_SRSH_PI + * value in the SPROM shadow. + * + * This workaround must applied prior to accessing any static register windows + * that map the PCI core. * - * This function updates the SROM shadow to point the BAR0 windows at the - * current PCI core. - * - * Applies to all PCI/PCIe revisions. + * Applies to all PCI and PCIe-G1 core revisions. */ -static void -bhndb_init_sromless_pci_config(struct bhndb_pci_softc *sc) +static int +bhndb_pci_srsh_pi_war(struct bhndb_pci_softc *sc, + struct bhndb_pci_probe *probe) { - const struct bhndb_pci_core *pci_core; - bus_size_t srsh_offset; - u_int pci_cidx, sprom_cidx; - uint16_t val; + struct bhnd_core_match md; + bhnd_addr_t pci_addr; + bhnd_size_t pci_size; + bus_size_t srsh_offset; + uint16_t srsh_val, pci_val; + uint16_t val; + int error; if ((sc->pci_quirks & BHNDB_PCI_QUIRK_SRSH_WAR) == 0) - return; + return (0); - /* Determine the correct register offset for our PCI core */ - pci_core = bhndb_pci_find_core(&sc->bhndb.bridge_core); - KASSERT(pci_core != NULL, ("missing core table entry")); + /* Use an equality match descriptor to look up our PCI core's base + * address in the EROM */ + md = bhnd_core_get_match_desc(&probe->hostb_core); + error = bhnd_erom_lookup_core_addr(probe->erom, &md, BHND_PORT_DEVICE, + 0, 0, NULL, &pci_addr, &pci_size); + if (error) { + device_printf(sc->dev, "no base address found for the PCI host " + "bridge core: %d\n", error); + return (error); + } - srsh_offset = pci_core->srsh_offset; + /* Fetch the SPROM SRSH_PI value */ + srsh_offset = BHND_PCI_SPROM_SHADOW + BHND_PCI_SRSH_PI_OFFSET; + val = bhndb_pci_probe_read(probe, pci_addr, srsh_offset, sizeof(val)); + srsh_val = (val & BHND_PCI_SRSH_PI_MASK) >> BHND_PCI_SRSH_PI_SHIFT; - /* Fetch the SPROM's configured core index */ - val = bhndb_pci_read_core(sc, srsh_offset, sizeof(val)); - sprom_cidx = (val & BHND_PCI_SRSH_PI_MASK) >> BHND_PCI_SRSH_PI_SHIFT; - - /* If it doesn't match host bridge's core index, update the index - * value */ - pci_cidx = sc->bhndb.bridge_core.core_idx; - if (sprom_cidx != pci_cidx) { + /* If it doesn't match PCI core's base address, update the SPROM + * shadow */ + pci_val = (pci_addr & BHND_PCI_SRSH_PI_ADDR_MASK) >> + BHND_PCI_SRSH_PI_ADDR_SHIFT; + if (srsh_val != pci_val) { val &= ~BHND_PCI_SRSH_PI_MASK; - val |= (pci_cidx << BHND_PCI_SRSH_PI_SHIFT); - bhndb_pci_write_core(sc, srsh_offset, val, sizeof(val)); + val |= (pci_val << BHND_PCI_SRSH_PI_SHIFT); + bhndb_pci_probe_write(probe, pci_addr, srsh_offset, val, + sizeof(val)); } + + return (0); } static int @@ -1283,188 +1254,449 @@ bhndb_pci_route_interrupts(device_t dev, device_t chil } /** - * Initialize a new bhndb PCI bridge EROM I/O instance. This EROM I/O - * implementation supports mapping of the device enumeration table via the - * @p hr host resources. + * Using the generic PCI bridge hardware configuration, allocate, initialize + * and return a new bhndb_pci probe state instance. * - * @param pio The instance to be initialized. - * @param dev The bridge device. - * @param pci_dev The bridge's parent PCI device. - * @param hr The host resources to be used to map the device - * enumeration table. + * On success, the caller assumes ownership of the returned probe instance, and + * is responsible for releasing this reference using bhndb_pci_probe_free(). + * + * @param[out] probe On success, the newly allocated probe instance. + * @param dev The bhndb_pci bridge device. + * @param hostb_devclass The expected device class of the bridge core. + * + * @retval 0 success + * @retval non-zero if allocating the probe state fails, a regular + * unix error code will be returned. + * + * @note This function requires exclusive ownership over allocating and + * configuring host bridge resources, and should only be called prior to + * completion of device attach and full configuration of the bridge. */ static int -bhndb_pci_eio_init(struct bhndb_pci_eio *pio, device_t dev, device_t pci_dev, - struct bhndb_host_resources *hr) +bhndb_pci_probe_alloc(struct bhndb_pci_probe **probe, device_t dev, + bhnd_devclass_t hostb_devclass) { - memset(&pio->eio, 0, sizeof(pio->eio)); - pio->eio.map = bhndb_pci_eio_map; - pio->eio.read = bhndb_pci_eio_read; - pio->eio.fini = NULL; + struct bhndb_pci_probe *p; + struct bhnd_erom_io *eio; + const struct bhndb_hwcfg *hwcfg; + const struct bhnd_chipid *hint; + device_t parent_dev; + int error; - pio->dev = dev; - pio->pci_dev = pci_dev; - pio->hr = hr; - pio->win = NULL; - pio->res = NULL; + parent_dev = device_get_parent(dev); + eio = NULL; + p = malloc(sizeof(*p), M_BHND, M_ZERO|M_WAITOK); + p->dev = dev; + p->pci_dev = parent_dev; + + /* Our register window mapping state must be initialized at this point, + * as bhndb_pci_eio will begin making calls into + * bhndb_pci_probe_(read|write|get_mapping) */ + p->m_win = NULL; + p->m_res = NULL; + p->m_valid = false; + + bhndb_pci_eio_init(&p->erom_io, p); + eio = &p->erom_io.eio; + + /* Fetch our chipid hint (if any) and generic hardware configuration */ + hwcfg = BHNDB_BUS_GET_GENERIC_HWCFG(parent_dev, dev); + hint = BHNDB_BUS_GET_CHIPID(parent_dev, dev); + + /* Allocate our host resources */ + error = bhndb_alloc_host_resources(&p->hr, dev, parent_dev, hwcfg); + if (error) { + p->hr = NULL; + goto failed; + } + + /* Map the first bus core from our bridged bhnd(4) bus */ + error = bhnd_erom_io_map(eio, BHND_DEFAULT_CHIPC_ADDR, + BHND_DEFAULT_CORE_SIZE); + if (error) + goto failed; + + /* Probe for a usable EROM class, and read the chip identifier */ + p->erom_class = bhnd_erom_probe_driver_classes( + device_get_devclass(dev), eio, hint, &p->cid); + if (p->erom_class == NULL) { + device_printf(dev, "device enumeration unsupported; no " + "compatible driver found\n"); + + error = ENXIO; + goto failed; + } + + /* Allocate EROM parser */ + p->erom = bhnd_erom_alloc(p->erom_class, &p->cid, eio); + if (p->erom == NULL) { + device_printf(dev, "failed to allocate device enumeration " + "table parser\n"); + error = ENXIO; + goto failed; + } + + /* The EROM I/O instance is now owned by our EROM parser */ + eio = NULL; + + /* Read the full core table */ + error = bhnd_erom_get_core_table(p->erom, &p->cores, &p->ncores); + if (error) { + device_printf(p->dev, "error fetching core table: %d\n", + error); + + p->cores = NULL; + goto failed; + } + + /* Identify the host bridge core */ + error = bhndb_find_hostb_core(p->cores, p->ncores, hostb_devclass, + &p->hostb_core); + if (error) { + device_printf(dev, "failed to identify the host bridge " + "core: %d\n", error); + + goto failed; + } + + *probe = p; return (0); + +failed: + if (eio != NULL) { + KASSERT(p->erom == NULL, ("I/O instance will be freed by " + "its owning parser")); + + bhnd_erom_io_fini(eio); + } + + if (p->erom != NULL) { + if (p->cores != NULL) + bhnd_erom_free_core_table(p->erom, p->cores); + + bhnd_erom_free(p->erom); + } else { + KASSERT(p->cores == NULL, ("cannot free erom-owned core table " + "without erom reference")); + } + + if (p->hr != NULL) + bhndb_release_host_resources(p->hr); + + free(p, M_BHND); + + return (error); } /** - * Attempt to adjust the dynamic register window backing @p pio to permit - * reading @p size bytes at @p addr. + * Free the given @p probe instance and any associated host bridge resources. + */ +static void +bhndb_pci_probe_free(struct bhndb_pci_probe *probe) +{ + bhnd_erom_free_core_table(probe->erom, probe->cores); + bhnd_erom_free(probe->erom); + bhndb_release_host_resources(probe->hr); + free(probe, M_BHND); +} + +/** + * Return a copy of probed core table from @p probe. * - * If @p addr or @p size fall outside the existing mapped range, or if - * @p pio is not backed by a dynamic register window, ENXIO will be returned. + * @param probe The probe instance. + * @param[out] cores On success, a copy of the probed core table. The + * caller is responsible for freeing this table + * bhndb_pci_probe_free_core_table(). + * @param[out] ncores On success, the number of cores found in + * @p cores. * - * @param pio The bhndb PCI erom I/O state to be modified. - * @param addr The address to be include + * @retval 0 success + * @retval non-zero if enumerating the bridged bhnd(4) bus fails, a regular + * unix error code will be returned. */ static int -bhndb_pci_eio_adjust_mapping(struct bhndb_pci_eio *pio, bhnd_addr_t addr, - bhnd_size_t size) +bhndb_pci_probe_copy_core_table(struct bhndb_pci_probe *probe, + struct bhnd_core_info **cores, u_int *ncores) { - bhnd_addr_t target; - bhnd_size_t offset; - int error; + size_t len = sizeof(**cores) * probe->ncores; + *cores = malloc(len, M_BHND, M_WAITOK); + memcpy(*cores, probe->cores, len); - KASSERT(pio->win != NULL, ("missing register window")); - KASSERT(pio->res != NULL, ("missing regwin resource")); - KASSERT(pio->win->win_type == BHNDB_REGWIN_T_DYN, - ("unexpected window type %d", pio->win->win_type)); + *ncores = probe->ncores; - /* The requested subrange must fall within the total mapped range */ - if (addr < pio->addr || (addr - pio->addr) > pio->size || - size > pio->size || (addr - pio->addr) - pio->size < size) - { - return (ENXIO); - } + return (0); +} - /* Do we already have a useable mapping? */ - if (addr >= pio->res_target && - addr <= pio->res_target + pio->win->win_size && - (pio->res_target + pio->win->win_size) - addr >= size) - { - return (0); - } +/** + * Free a core table previously returned by bhndb_pci_probe_copy_core_table(). + * + * @param cores The core table to be freed. + */ +static void +bhndb_pci_probe_free_core_table(struct bhnd_core_info *cores) +{ + free(cores, M_BHND); +} - /* Page-align the target address */ - offset = addr % pio->win->win_size; - target = addr - offset; +/** + * Return true if @p addr and @p size are mapped by the dynamic register window + * backing @p probe. + */ +static bool +bhndb_pci_probe_has_mapping(struct bhndb_pci_probe *probe, bhnd_addr_t addr, + bhnd_size_t size) +{ + if (!probe->m_valid) + return (false); - /* Configure the register window */ - error = bhndb_pci_compat_setregwin(pio->dev, pio->pci_dev, pio->win, - target); - if (error) { - device_printf(pio->dev, "failed to configure dynamic register " - "window: %d\n", error); - return (error); - } + KASSERT(probe->m_win != NULL, ("missing register window")); + KASSERT(probe->m_res != NULL, ("missing regwin resource")); + KASSERT(probe->m_win->win_type == BHNDB_REGWIN_T_DYN, + ("unexpected window type %d", probe->m_win->win_type)); - pio->res_target = target; - return (0); + if (addr < probe->m_target) + return (false); + + if (addr >= probe->m_target + probe->m_win->win_size) + return (false); + + if ((probe->m_target + probe->m_win->win_size) - addr < size) + return (false); + + return (true); } -/* bhnd_erom_io_map() implementation */ +/** + * Attempt to adjust the dynamic register window backing @p probe to permit + * accessing @p size bytes at @p addr. + * + * @param probe The bhndb_pci probe state to be modified. + * @param addr The address at which @p size bytes will mapped. + * @param size The number of bytes to be mapped. + * @param[out] res On success, will be set to the host resource + * mapping @p size bytes at @p addr. + * @param[out] res_offset On success, will be set to the offset of @addr + * within @p res. + * + * @retval 0 success + * @retval non-zero if an error occurs adjusting the backing dynamic + * register window. + */ static int -bhndb_pci_eio_map(struct bhnd_erom_io *eio, bhnd_addr_t addr, - bhnd_size_t size) +bhndb_pci_probe_map(struct bhndb_pci_probe *probe, bhnd_addr_t addr, + bhnd_size_t offset, bhnd_size_t size, struct resource **res, + bus_size_t *res_offset) { - struct bhndb_pci_eio *pio; - const struct bhndb_regwin *regwin; - struct resource *r; + const struct bhndb_regwin *regwin, *regwin_table; + struct resource *regwin_res; bhnd_addr_t target; - bhnd_size_t offset; int error; - pio = (struct bhndb_pci_eio *)eio; + /* Determine the absolute address */ + if (BHND_SIZE_MAX - offset < addr) { + device_printf(probe->dev, "invalid offset %#jx+%#jx\n", addr, + offset); + return (ENXIO); + } + addr += offset; + + /* Can we use the existing mapping? */ + if (bhndb_pci_probe_has_mapping(probe, addr, size)) { + *res = probe->m_res; + *res_offset = (addr - probe->m_target) + + probe->m_win->win_offset; + + return (0); + } + /* Locate a useable dynamic register window */ - regwin = bhndb_regwin_find_type(pio->hr->cfg->register_windows, - BHNDB_REGWIN_T_DYN, MIN(size, BHND_DEFAULT_CORE_SIZE)); + regwin_table = probe->hr->cfg->register_windows; + regwin = bhndb_regwin_find_type(regwin_table, + BHNDB_REGWIN_T_DYN, size); if (regwin == NULL) { - device_printf(pio->dev, "unable to map %#jx+%#jx; no " - "usable dynamic register window found\n", addr, size); + device_printf(probe->dev, "unable to map %#jx+%#jx; no " + "usable dynamic register window found\n", addr, + size); return (ENXIO); } /* Locate the host resource mapping our register window */ - if ((r = bhndb_host_resource_for_regwin(pio->hr, regwin)) == NULL) { - device_printf(pio->dev, "unable to map %#jx+%#jx; no " + regwin_res = bhndb_host_resource_for_regwin(probe->hr, regwin); + if (regwin_res == NULL) { + device_printf(probe->dev, "unable to map %#jx+%#jx; no " "usable register resource found\n", addr, size); return (ENXIO); } /* Page-align the target address */ - offset = addr % regwin->win_size; - target = addr - offset; + target = addr - (addr % regwin->win_size); /* Configure the register window */ - error = bhndb_pci_compat_setregwin(pio->dev, pio->pci_dev, regwin, - target); + error = bhndb_pci_compat_setregwin(probe->dev, probe->pci_dev, + regwin, target); if (error) { - device_printf(pio->dev, "failed to configure dynamic register " - "window: %d\n", error); + device_printf(probe->dev, "failed to configure dynamic " + "register window: %d\n", error); return (error); } /* Update our mapping state */ - pio->win = regwin; - pio->res = r; - pio->addr = addr; - pio->size = size; - pio->res_target = target; + probe->m_win = regwin; + probe->m_res = regwin_res; + probe->m_addr = addr; + probe->m_size = size; + probe->m_target = target; + probe->m_valid = true; + *res = regwin_res; + *res_offset = (addr - target) + regwin->win_offset; + return (0); } -/* bhnd_erom_io_read() implementation */ -static uint32_t -bhndb_pci_eio_read(struct bhnd_erom_io *eio, bhnd_size_t offset, u_int width) +/** + * Write a data item to the bridged address space at the given @p offset from + * @p addr. + * + * A dynamic register window will be used to map @p addr. + * + * @param probe The bhndb_pci probe state to be used to perform the + * write. + * @param addr The base address. + * @param offset The offset from @p addr at which @p value will be + * written. + * @param value The data item to be written. + * @param width The data item width (1, 2, or 4 bytes). + */ +static void +bhndb_pci_probe_write(struct bhndb_pci_probe *probe, bhnd_addr_t addr, + bhnd_size_t offset, uint32_t value, u_int width) { - struct bhndb_pci_eio *pio; - bhnd_addr_t addr; - bus_size_t res_offset; - int error; + struct resource *r; + bus_size_t res_offset; + int error; - pio = (struct bhndb_pci_eio *)eio; + /* Map the target address */ + error = bhndb_pci_probe_map(probe, addr, offset, width, &r, + &res_offset); + if (error) { + device_printf(probe->dev, "error mapping %#jx+%#jx for " + "writing: %d\n", addr, offset, error); + return; + } - /* Calculate absolute address */ - if (BHND_SIZE_MAX - offset < pio->addr) { - device_printf(pio->dev, "invalid offset %#jx+%#jx\n", pio->addr, - offset); - return (UINT32_MAX); + /* Perform write */ + switch (width) { + case 1: + return (bus_write_1(r, res_offset, value)); + case 2: + return (bus_write_2(r, res_offset, value)); + case 4: + return (bus_write_4(r, res_offset, value)); + default: + panic("unsupported width: %u", width); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Jan 17 05:30:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDCD4E7C477; Wed, 17 Jan 2018 05:30:39 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (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 9C18A7D418; Wed, 17 Jan 2018 05:30:39 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from comporellon.tachypleus.net (cpe-75-82-218-62.socal.res.rr.com [75.82.218.62]) (authenticated bits=0) by c.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id w0H5UUGY005788 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Tue, 16 Jan 2018 21:30:31 -0800 Subject: Re: svn commit: r327950 - in head/sys/powerpc: aim include powerpc ps3 To: Marius Strobl Cc: Konstantin Belousov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org References: <20180114175211.GD1684@kib.kiev.ua> <20180115111812.GF1684@kib.kiev.ua> <20180115170603.GJ1684@kib.kiev.ua> <9e5554d7-6a0c-5910-8cb6-74f98259536f@freebsd.org> <20180115175335.GK1684@kib.kiev.ua> <20180116193208.GA12364@alchemy.franken.de> From: Nathan Whitehorn Message-ID: <11a7fdd6-cfd6-26c1-ae3c-7d8a63924d5a@freebsd.org> Date: Tue, 16 Jan 2018 21:30:29 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20180116193208.GA12364@alchemy.franken.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Sonic-CAuth: UmFuZG9tSVaVwOwKMg9/LXT+QiLNI7NNYESoK1LTULNj/VKZfJGgF5gZoiOLLRewYwzGpawXoNrUhZ83yHmN/uvixbLK076gLCY8sXjW6Hw= X-Sonic-ID: C;Mj0xiEf75xGX4tzi2dYaJA== M;OuKhiEf75xGX4tzi2dYaJA== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jan 2018 05:30:39 -0000 On 01/16/18 11:32, Marius Strobl wrote: > On Mon, Jan 15, 2018 at 03:20:49PM -0800, Nathan Whitehorn wrote: >> >> On 01/15/18 09:53, Konstantin Belousov wrote: >>> On Mon, Jan 15, 2018 at 09:32:56AM -0800, Nathan Whitehorn wrote: >>>> That seems fine to me. I don't think a less-clumsy way that does not >>>> involve extra indirection is possible. The PHYS_TO_DMAP() returning NULL >>>> is about the best thing I can come up with from a clumsiness standpoint >>>> since plenty of code checks for null pointers already, but doesn't >>>> cleanly handle the rarer case where you want to test for the existence >>>> of direct maps in general without testing some potemkin address. >>>> >>>> My one reservation about PMAP_HAS_DMAP or the like as a selector is that >>>> it does not encode the full shape of the problem: one could imagine >>>> having a direct map that only covers a limited range of RAM (I am not >>>> sure whether the existence of dmaplimit on amd64 implies this can happen >>>> with non-device memory in real life), for example. These cases are >>>> currently covered by an assert() in PHYS_TO_DMAP(), whereas having >>>> PHYS_TO_DMAP() return NULL allows a more flexible signalling and the >>>> potential for the calling code to do something reasonable to handle the >>>> error. A single global flag can't convey information at this kind of >>>> granularity. Is this a reasonable concern? Or am I overthinking things? >>> IMO it is overreaction. amd64 assumes that all normal memory is covered >>> by DMAP. It must never fail. See, for instance, the implementation >>> of the sf bufs for it. >>> >>> If device memory not covered by DMAP can exists, it is the driver problem. >>> For instance, for NVDIMMs I wrote specific mapping code which establishes >>> kernel mapping for it, when not covered by EFI memory map and correspondingly >>> not included into DMAP. >>> >> Fair enough. Here's a patch with a new flag (DIRECT_MAP_AVAILABLE). I've >> also retooled the sfbuf code to use this rather than its own flags that >> mean the same things. The sparc64 part of the patch is untested. >> -Nathan >> Index: sparc64/include/vmparam.h >> =================================================================== >> --- sparc64/include/vmparam.h (revision 328006) >> +++ sparc64/include/vmparam.h (working copy) >> @@ -240,10 +240,12 @@ >> */ >> #define ZERO_REGION_SIZE PAGE_SIZE >> >> +#include >> + >> #define SFBUF >> #define SFBUF_MAP >> -#define SFBUF_OPTIONAL_DIRECT_MAP dcache_color_ignore >> -#include >> -#define SFBUF_PHYS_DMAP(x) TLB_PHYS_TO_DIRECT(x) >> >> +#define DIRECT_MAP_AVAILABLE dcache_color_ignore >> +#define PHYS_TO_DMAP(x) (DIRECT_MAP_AVAILABLE ? (TLB_PHYS_TO_DIRECT(x) : 0) > What dcache_color_ignore actually indicates is the presence of > hardware unaliasing support, in other words the ability to enter > duplicate cacheable mappings into the MMU. While a direct map is > available and used by MD code on all supported CPUs down to US-I, > the former feature is only implemented in the line of Fujitsu SPARC64 > processors. IIRC, the sfbuf(9) code can't guarantee that there isn't > already a cacheable mapping from a different VA to the same PA, > which is why it employs dcache_color_ignore. Is that a general > constraint of all MI PHYS_TO_DMAP users or are there consumers > which can guarantee that they are the only users of a mapping > to the same PA? > > Marius > With the patch, there are four uses of this in the kernel: the sfbuf code, a diagnostic check on page zeroing, part of the EFI runtime code, and part of the Linux KBI compat. The second looks safe from this perspective and at least some of the others (EFI runtime) are irrelevant on sparc64. But I really have no idea what was intended for the semantics of this API -- I didn't even know it *was* an MI API until this commit. Maybe kib can comment? If this is outside the semantics of PHYS_TO_DMAP, then we need to keep the existing sfbuf code. -Nathan From owner-svn-src-head@freebsd.org Wed Jan 17 06:31:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CBA7E7F361; Wed, 17 Jan 2018 06:31:23 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 18A957F3BC; Wed, 17 Jan 2018 06:31:23 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 61C6A3D3B; Wed, 17 Jan 2018 06:31:22 +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 w0H6VM8Z005430; Wed, 17 Jan 2018 06:31:22 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0H6VLBP005425; Wed, 17 Jan 2018 06:31:21 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201801170631.w0H6VLBP005425@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Wed, 17 Jan 2018 06:31:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328075 - head/sbin/fsck_ffs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sbin/fsck_ffs X-SVN-Commit-Revision: 328075 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jan 2018 06:31:23 -0000 Author: mckusick Date: Wed Jan 17 06:31:21 2018 New Revision: 328075 URL: https://svnweb.freebsd.org/changeset/base/328075 Log: Rename cgget => cglookup to clear name space for new libufs function cgget. No functional change. Modified: head/sbin/fsck_ffs/fsck.h head/sbin/fsck_ffs/fsutil.c head/sbin/fsck_ffs/inode.c head/sbin/fsck_ffs/pass1.c head/sbin/fsck_ffs/pass5.c Modified: head/sbin/fsck_ffs/fsck.h ============================================================================== --- head/sbin/fsck_ffs/fsck.h Wed Jan 17 06:22:10 2018 (r328074) +++ head/sbin/fsck_ffs/fsck.h Wed Jan 17 06:31:21 2018 (r328075) @@ -437,7 +437,7 @@ void freeinodebuf(void); void fsutilinit(void); int ftypeok(union dinode *dp); void getblk(struct bufarea *bp, ufs2_daddr_t blk, long size); -struct bufarea *cgget(int cg); +struct bufarea *cglookup(int cg); struct bufarea *getdatablk(ufs2_daddr_t blkno, long size, int type); struct inoinfo *getinoinfo(ino_t inumber); union dinode *getnextinode(ino_t inumber, int rebuildcg); Modified: head/sbin/fsck_ffs/fsutil.c ============================================================================== --- head/sbin/fsck_ffs/fsutil.c Wed Jan 17 06:22:10 2018 (r328074) +++ head/sbin/fsck_ffs/fsutil.c Wed Jan 17 06:31:21 2018 (r328075) @@ -222,7 +222,7 @@ static struct bufarea *cgbufs; /* header for cylinder static int flushtries; /* number of tries to reclaim memory */ struct bufarea * -cgget(int cg) +cglookup(int cg) { struct bufarea *cgbp; struct cg *cgp; @@ -791,7 +791,7 @@ allocblk(long frags) continue; } cg = dtog(&sblock, i + j); - cgbp = cgget(cg); + cgbp = cglookup(cg); cgp = cgbp->b_un.b_cg; if (!check_cgmagic(cg, cgbp)) return (0); Modified: head/sbin/fsck_ffs/inode.c ============================================================================== --- head/sbin/fsck_ffs/inode.c Wed Jan 17 06:22:10 2018 (r328074) +++ head/sbin/fsck_ffs/inode.c Wed Jan 17 06:31:21 2018 (r328075) @@ -673,7 +673,7 @@ allocino(ino_t request, int type) if (ino == maxino) return (0); cg = ino_to_cg(&sblock, ino); - cgbp = cgget(cg); + cgbp = cglookup(cg); cgp = cgbp->b_un.b_cg; if (!check_cgmagic(cg, cgbp)) return (0); Modified: head/sbin/fsck_ffs/pass1.c ============================================================================== --- head/sbin/fsck_ffs/pass1.c Wed Jan 17 06:22:10 2018 (r328074) +++ head/sbin/fsck_ffs/pass1.c Wed Jan 17 06:31:21 2018 (r328075) @@ -98,7 +98,7 @@ pass1(void) for (c = 0; c < sblock.fs_ncg; c++) { inumber = c * sblock.fs_ipg; setinodebuf(inumber); - cgbp = cgget(c); + cgbp = cglookup(c); cgp = cgbp->b_un.b_cg; rebuildcg = 0; if (!check_cgmagic(c, cgbp)) Modified: head/sbin/fsck_ffs/pass5.c ============================================================================== --- head/sbin/fsck_ffs/pass5.c Wed Jan 17 06:22:10 2018 (r328074) +++ head/sbin/fsck_ffs/pass5.c Wed Jan 17 06:31:21 2018 (r328075) @@ -174,7 +174,7 @@ pass5(void) c * 100 / sblock.fs_ncg); got_sigalarm = 0; } - cgbp = cgget(c); + cgbp = cglookup(c); cg = cgbp->b_un.b_cg; if (!cg_chkmagic(cg)) pfatal("CG %d: BAD MAGIC NUMBER\n", c); From owner-svn-src-head@freebsd.org Wed Jan 17 07:39:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57360EB3174; Wed, 17 Jan 2018 07:39:13 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1810781796; Wed, 17 Jan 2018 07:39:13 +0000 (UTC) (envelope-from wma@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 58A7E477A; Wed, 17 Jan 2018 07:39:12 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0H7dCBX033552; Wed, 17 Jan 2018 07:39:12 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0H7dCKw033550; Wed, 17 Jan 2018 07:39:12 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201801170739.w0H7dCKw033550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Wed, 17 Jan 2018 07:39:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328076 - head/sys/powerpc/powernv X-SVN-Group: head X-SVN-Commit-Author: wma X-SVN-Commit-Paths: head/sys/powerpc/powernv X-SVN-Commit-Revision: 328076 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jan 2018 07:39:13 -0000 Author: wma Date: Wed Jan 17 07:39:11 2018 New Revision: 328076 URL: https://svnweb.freebsd.org/changeset/base/328076 Log: PowerNV: make PowerNV PCIe working on a real hardware Fixes: - map all devices to PE0 - use 1:1 TCE mapping - provide the same TCE mapping for all PEs (not only PE0) - add TCE reset and alignment (required by OPAL) Created by: Wojciech Macek Obtained from: Semihalf Sponsored by: QCM Technologies Modified: head/sys/powerpc/powernv/opal.h head/sys/powerpc/powernv/opal_pci.c Modified: head/sys/powerpc/powernv/opal.h ============================================================================== --- head/sys/powerpc/powernv/opal.h Wed Jan 17 06:31:21 2018 (r328075) +++ head/sys/powerpc/powernv/opal.h Wed Jan 17 07:39:11 2018 (r328076) @@ -65,10 +65,13 @@ int opal_call(uint64_t token, ...); #define OPAL_GET_MSI_32 39 #define OPAL_GET_MSI_64 40 #define OPAL_PCI_MSI_EOI 63 +#define OPAL_PCI_GET_PHB_DIAG_DATA2 64 #define OPAL_START_CPU 41 +#define OPAL_PCI_MAP_PE_DMA_WINDOW 44 #define OPAL_PCI_MAP_PE_DMA_WINDOW_REAL 45 #define OPAL_RETURN_CPU 69 #define OPAL_REINIT_CPUS 70 +#define OPAL_PCI_TCE_KILL 126 /* For OPAL_PCI_SET_PE */ #define OPAL_UNMAP_PE 0 Modified: head/sys/powerpc/powernv/opal_pci.c ============================================================================== --- head/sys/powerpc/powernv/opal_pci.c Wed Jan 17 06:31:21 2018 (r328075) +++ head/sys/powerpc/powernv/opal_pci.c Wed Jan 17 07:39:11 2018 (r328076) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2015-2016 Nathan Whitehorn + * Copyright (c) 2017-2018 Semihalf * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -58,6 +59,12 @@ __FBSDID("$FreeBSD$"); #include "iommu_if.h" #include "opal.h" +#define OPAL_PCI_TCE_MAX_ENTRIES (1024*1024UL) +#define OPAL_PCI_TCE_SEG_SIZE (16*1024*1024UL) +#define OPAL_PCI_TCE_R (1UL << 0) +#define OPAL_PCI_TCE_W (1UL << 1) +#define PHB3_TCE_KILL_INVAL_ALL (1UL << 63) + /* * Device interface. */ @@ -148,6 +155,8 @@ struct opalpci_softc { vmem_t *msi_vmem; int msi_base; /* Base XIVE number */ int base_msi_irq; /* Base IRQ assigned by FreeBSD to this PIC */ + uint64_t *tce; /* TCE table for 1:1 mapping */ + struct resource *r_reg; }; static devclass_t opalpci_devclass; @@ -177,12 +186,24 @@ opalpci_probe(device_t dev) return (BUS_PROBE_GENERIC); } +static void +pci_phb3_tce_invalidate_entire(struct opalpci_softc *sc) +{ + + mb(); + bus_write_8(sc->r_reg, 0x210, PHB3_TCE_KILL_INVAL_ALL); + mb(); +} + static int opalpci_attach(device_t dev) { struct opalpci_softc *sc; cell_t id[2], m64window[6], npe; int i, err; + uint64_t maxmem; + uint64_t entries; + int rid; sc = device_get_softc(dev); @@ -204,6 +225,15 @@ opalpci_attach(device_t dev) if (bootverbose) device_printf(dev, "OPAL ID %#lx\n", sc->phb_id); + rid = 0; + sc->r_reg = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &rid, RF_ACTIVE | RF_SHAREABLE); + if (sc->r_reg == NULL) { + device_printf(dev, "Failed to allocate PHB[%jd] registers\n", + (uintmax_t)sc->phb_id); + return (ENXIO); + } + /* * Reset PCI IODA table */ @@ -214,47 +244,12 @@ opalpci_attach(device_t dev) return (ENXIO); } while ((err = opal_call(OPAL_PCI_POLL, sc->phb_id)) > 0) - DELAY(1000*err); /* Returns expected delay in ms */ + DELAY(1000*(err + 1)); /* Returns expected delay in ms */ if (err < 0) { - device_printf(dev, "PHB IODA reset poll failed: %d\n", err); - return (ENXIO); + device_printf(dev, "WARNING: PHB IODA reset poll failed: %d\n", err); } /* - * Reset everything. Especially important if we have inherited the - * system from Linux by kexec() - */ -#ifdef NOTYET - if (bootverbose) - device_printf(dev, "Resetting PCI bus\n"); - err = opal_call(OPAL_PCI_RESET, sc->phb_id, OPAL_RESET_PHB_COMPLETE, 1); - if (err < 0) { - device_printf(dev, "PHB reset failed: %d\n", err); - return (ENXIO); - } - while ((err = opal_call(OPAL_PCI_POLL, sc->phb_id)) > 0) - DELAY(1000*err); /* Returns expected delay in ms */ - if (err < 0) { - device_printf(dev, "PHB reset poll failed: %d\n", err); - return (ENXIO); - } - DELAY(10000); - err = opal_call(OPAL_PCI_RESET, sc->phb_id, OPAL_RESET_PHB_COMPLETE, 0); - if (err < 0) { - device_printf(dev, "PHB reset completion failed: %d\n", err); - return (ENXIO); - } - while ((err = opal_call(OPAL_PCI_POLL, sc->phb_id)) > 0) - DELAY(1000*err); /* Returns expected delay in ms */ - if (err < 0) { - device_printf(dev, "PHB reset completion poll failed: %d\n", - err); - return (ENXIO); - } - DELAY(10000); -#endif - - /* * Map all devices on the bus to partitionable endpoint one until * such time as we start wanting to do things like bhyve. */ @@ -282,6 +277,8 @@ opalpci_attach(device_t dev) /* XXX: multiple M64 windows? */ if (OF_getencprop(ofw_bus_get_node(dev), "ibm,opal-m64-window", m64window, sizeof(m64window)) == sizeof(m64window)) { + opal_call(OPAL_PCI_PHB_MMIO_ENABLE, sc->phb_id, + OPAL_M64_WINDOW_TYPE, 0, 0); opal_call(OPAL_PCI_SET_PHB_MEM_WINDOW, sc->phb_id, OPAL_M64_WINDOW_TYPE, 0 /* index */, ((uint64_t)m64window[2] << 32) | m64window[3], 0, @@ -294,21 +291,54 @@ opalpci_attach(device_t dev) } /* - * Also disable the IOMMU for the time being for PE 1 (everything) + * Enable IOMMU for PE1 - map everything 1:1 using + * segments of OPAL_PCI_TCE_SEG_SIZE size */ + maxmem = roundup2(powerpc_ptob(Maxmem), OPAL_PCI_TCE_SEG_SIZE); + entries = maxmem / OPAL_PCI_TCE_SEG_SIZE; + if (entries > OPAL_PCI_TCE_MAX_ENTRIES) + panic("POWERNV supports only %jdGB of memory space\n", + (uintmax_t)((OPAL_PCI_TCE_MAX_ENTRIES * OPAL_PCI_TCE_SEG_SIZE) >> 30)); if (bootverbose) - device_printf(dev, "Mapping 0-%#lx for DMA\n", - roundup2(powerpc_ptob(Maxmem), 16*1024*1024)); - err = opal_call(OPAL_PCI_MAP_PE_DMA_WINDOW_REAL, sc->phb_id, - OPAL_PCI_DEFAULT_PE, OPAL_PCI_DEFAULT_PE << 1, - 0 /* start address */, roundup2(powerpc_ptob(Maxmem), - 16*1024*1024)/* all RAM */); - if (err != 0) { - device_printf(dev, "DMA mapping failed: %d\n", err); - return (ENXIO); + device_printf(dev, "Mapping 0-%#jx for DMA\n", (uintmax_t)maxmem); + sc->tce = contigmalloc(OPAL_PCI_TCE_MAX_ENTRIES * sizeof(uint64_t), + M_DEVBUF, M_NOWAIT | M_ZERO, 0, + BUS_SPACE_MAXADDR_32BIT, OPAL_PCI_TCE_SEG_SIZE, 0); + if (sc->tce == NULL) + panic("Failed to allocate TCE memory for PHB %jd\n", + (uintmax_t)sc->phb_id); + + for (i = 0; i < entries; i++) + sc->tce[i] = (i * OPAL_PCI_TCE_SEG_SIZE) | OPAL_PCI_TCE_R | OPAL_PCI_TCE_W; + + /* Map TCE for every PE. It seems necessary for Power8 */ + for (i = 0; i < npe; i++) { + err = opal_call(OPAL_PCI_MAP_PE_DMA_WINDOW, sc->phb_id, + i, (i << 1), + 1, pmap_kextract((uint64_t)&sc->tce[0]), + OPAL_PCI_TCE_MAX_ENTRIES * sizeof(uint64_t), OPAL_PCI_TCE_SEG_SIZE); + if (err != 0) { + device_printf(dev, "DMA IOMMU mapping failed: %d\n", err); + return (ENXIO); + } + + err = opal_call(OPAL_PCI_MAP_PE_DMA_WINDOW_REAL, sc->phb_id, + i, (i << 1) + 1, + (1UL << 59), maxmem); + if (err != 0) { + device_printf(dev, "DMA 64b bypass mapping failed: %d\n", err); + return (ENXIO); + } } /* + * Invalidate all previous TCE entries. + * + * TODO: add support for other PHBs than PHB3 + */ + pci_phb3_tce_invalidate_entire(sc); + + /* * Get MSI properties */ sc->msi_vmem = NULL; @@ -457,6 +487,7 @@ opalpci_write_config(device_t dev, u_int bus, u_int sl static int opalpci_route_interrupt(device_t bus, device_t dev, int pin) { + return (pin); } From owner-svn-src-head@freebsd.org Wed Jan 17 08:01:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48635EB4682; Wed, 17 Jan 2018 08:01:52 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 24DFE82517; Wed, 17 Jan 2018 08:01:52 +0000 (UTC) (envelope-from wma@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 53D774C17; Wed, 17 Jan 2018 08:01:51 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0H81pIJ044094; Wed, 17 Jan 2018 08:01:51 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0H81pJR044093; Wed, 17 Jan 2018 08:01:51 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201801170801.w0H81pJR044093@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Wed, 17 Jan 2018 08:01:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328077 - head/sys/powerpc/powernv X-SVN-Group: head X-SVN-Commit-Author: wma X-SVN-Commit-Paths: head/sys/powerpc/powernv X-SVN-Commit-Revision: 328077 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jan 2018 08:01:52 -0000 Author: wma Date: Wed Jan 17 08:01:51 2018 New Revision: 328077 URL: https://svnweb.freebsd.org/changeset/base/328077 Log: PowerNV: workaround console on OPAL 5.4 FreeBSD prints text char-by-char, which is not what OPAL is designed to. Poll events more frequently to avoid buffer overflow and loosing data. Created by: Wojciech Macek Obtained from: Semihalf Sponsored by: QCM Technologies Modified: head/sys/powerpc/powernv/opal_console.c Modified: head/sys/powerpc/powernv/opal_console.c ============================================================================== --- head/sys/powerpc/powernv/opal_console.c Wed Jan 17 07:39:11 2018 (r328076) +++ head/sys/powerpc/powernv/opal_console.c Wed Jan 17 08:01:51 2018 (r328077) @@ -435,11 +435,15 @@ uart_opal_cngetc(struct consdev *cp) static void uart_opal_cnputc(struct consdev *cp, int c) { - static uint64_t events; unsigned char ch = c; + int a; - if (cold) - opal_call(OPAL_POLL_EVENTS, &events); /* Clear FIFO if needed */ + if (1) { + /* Clear FIFO if needed. Must be repeated few times. */ + for (a = 0; a < 20; a++) { + opal_call(OPAL_POLL_EVENTS, NULL); + } + } uart_opal_put(console_sc, &ch, 1); } @@ -461,7 +465,7 @@ uart_opal_ttyoutwakeup(struct tty *tp) int len; sc = tty_softc(tp); - + while ((len = ttydisc_getc(tp, buffer, sizeof(buffer))) != 0) uart_opal_put(sc, buffer, len); } @@ -479,6 +483,8 @@ uart_opal_intr(void *v) ttydisc_rint(tp, c, 0); ttydisc_rint_done(tp); tty_unlock(tp); + + opal_call(OPAL_POLL_EVENTS, NULL); if (sc->irqres == NULL) callout_reset(&sc->callout, sc->polltime, uart_opal_intr, sc); From owner-svn-src-head@freebsd.org Wed Jan 17 08:24:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8438FEB587B; Wed, 17 Jan 2018 08:24:34 +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 0781D833E0; Wed, 17 Jan 2018 08:24:33 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from freyja.zeit4.iv.bundesimmobilien.de ([87.138.105.249]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0M5tU1-1emfM81rnl-00xw9Q; Wed, 17 Jan 2018 09:24:25 +0100 Date: Wed, 17 Jan 2018 09:24:18 +0100 From: "O. Hartmann" To: Kirk McKusick Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r328075 - head/sbin/fsck_ffs Message-ID: <20180117092418.2d823f60@freyja.zeit4.iv.bundesimmobilien.de> In-Reply-To: <201801170631.w0H6VLBP005425@repo.freebsd.org> References: <201801170631.w0H6VLBP005425@repo.freebsd.org> Organization: Walstatt MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:JxzyXiPwqUl5KFdS5LVGg4dpkl014Ls+gvzQXmjIQu/r7IninqX q3/lhhCXqAFtC08lfVfPJh4Oaibp2nbnMKA6OBfOY4HCrxT/DP1kRZjCLqAB/coAzKEW+4+ XzN3ngKuoq22+Lg9Vp1rDaq++MpoaVEBP9MbjISWkC6mYeRT6qXpu/rm2No+gmXlqQq3DcO c43GNI1JdI+SajDJgD0mg== X-UI-Out-Filterresults: notjunk:1;V01:K0:4dxCAViSw/A=:GL57mT/i6EvTiku9b1J41n ffOW2kqmobm2bP0hf7n2fVc2+ZrDmqqReo4IhtB41b/U2YYM0lzpivHZ3EBnz6ntuPns42EC8 KruBgR+zlISej+AeexYL9l1+t94ThXIocNcZusy/LAKGm6PzQS4rmaBn4ol284VJjuPL5tBDs uJZTfSM/hxgQgmDKONI7I3O6m4a8SZ5XyIFNMG4cMhmaJc1TenuIsvgDuikqPo0tUnoh0D5/1 NvLZ1WHScaV9bB+bD+AqgizCW1qvAO8/TYCCeivLtljJvhaieIFvl5BH1L5a8pVW7fiesZxdZ P0JrT+miiZYcfTB/jMZb6MbOztasvYfiaj3+QuiCvmx3UxLHQ+zvh2xUOj9eoEVKxYiD4sU6V jRCuUprHxFoUGBR1+yEaZBYXeweVQjpDFJPtcmXs7dKmvO0Q+M1PCcZW0ZkaAOmkB4G7VxO7+ OcRDEM2Pa7g5fj4HKVcuK9tpHlWkCwbTKKVE+c/HJPLSykt2xxjvlzLihIKh5I0SKkjg41ssd DyDBhD0+1YBovoaoqYtB23zhXCgOZpAxRIni3+0uXssyvlPOi5GC9wMaiCfo3OwZW5iM/5CEU XF2OK/pRMNGFUSEEBl6AodT2F97PuParSSLL8tKZh5FU4oPJbNilZH0U3kif9rVbo7D9/sQgo egNds4rPChMuKpMdyS6AQTswhHlSiNErwaioZeV0qVk6tDlW1xBkG9CtnIiOwT/BEpZ8QApnY rhHPn+TJuNkpXpa/C04k1iLR2ZeEBiDX6h2sB/j7CsVFmjncISS52DUhpb0hqoY+BY/AFc+QC 3AtW5TN614/YzaPyyhoPLVZDa8kTg+0yIIs2jS//CggKgPXfNo= X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jan 2018 08:24:34 -0000 On Wed, 17 Jan 2018 06:31:21 +0000 (UTC) Kirk McKusick wrote: > Author: mckusick > Date: Wed Jan 17 06:31:21 2018 > New Revision: 328075 > URL: https://svnweb.freebsd.org/changeset/base/328075 > > Log: > Rename cgget => cglookup to clear name space for new libufs function cgget. > No functional change. > > Modified: > head/sbin/fsck_ffs/fsck.h > head/sbin/fsck_ffs/fsutil.c > head/sbin/fsck_ffs/inode.c > head/sbin/fsck_ffs/pass1.c > head/sbin/fsck_ffs/pass5.c > > Modified: head/sbin/fsck_ffs/fsck.h > ============================================================================== > --- head/sbin/fsck_ffs/fsck.h Wed Jan 17 06:22:10 2018 (r328074) > +++ head/sbin/fsck_ffs/fsck.h Wed Jan 17 06:31:21 2018 (r328075) > @@ -437,7 +437,7 @@ void freeinodebuf(void); > void fsutilinit(void); > int ftypeok(union dinode *dp); > void getblk(struct bufarea *bp, ufs2_daddr_t blk, long size); > -struct bufarea *cgget(int cg); > +struct bufarea *cglookup(int cg); > struct bufarea *getdatablk(ufs2_daddr_t blkno, long size, int type); > struct inoinfo *getinoinfo(ino_t inumber); > union dinode *getnextinode(ino_t inumber, int rebuildcg); > > Modified: head/sbin/fsck_ffs/fsutil.c > ============================================================================== > --- head/sbin/fsck_ffs/fsutil.c Wed Jan 17 06:22:10 2018 > (r328074) +++ head/sbin/fsck_ffs/fsutil.c Wed Jan 17 06:31:21 > 2018 (r328075) @@ -222,7 +222,7 @@ static struct bufarea > *cgbufs; /* header for cylinder static int > flushtries; /* number of tries to reclaim memory */ > struct bufarea * > -cgget(int cg) > +cglookup(int cg) > { > struct bufarea *cgbp; > struct cg *cgp; > @@ -791,7 +791,7 @@ allocblk(long frags) > continue; > } > cg = dtog(&sblock, i + j); > - cgbp = cgget(cg); > + cgbp = cglookup(cg); > cgp = cgbp->b_un.b_cg; > if (!check_cgmagic(cg, cgbp)) > return (0); > > Modified: head/sbin/fsck_ffs/inode.c > ============================================================================== > --- head/sbin/fsck_ffs/inode.c Wed Jan 17 06:22:10 2018 > (r328074) +++ head/sbin/fsck_ffs/inode.c Wed Jan 17 06:31:21 > 2018 (r328075) @@ -673,7 +673,7 @@ allocino(ino_t request, int type) > if (ino == maxino) > return (0); > cg = ino_to_cg(&sblock, ino); > - cgbp = cgget(cg); > + cgbp = cglookup(cg); > cgp = cgbp->b_un.b_cg; > if (!check_cgmagic(cg, cgbp)) > return (0); > > Modified: head/sbin/fsck_ffs/pass1.c > ============================================================================== > --- head/sbin/fsck_ffs/pass1.c Wed Jan 17 06:22:10 2018 > (r328074) +++ head/sbin/fsck_ffs/pass1.c Wed Jan 17 06:31:21 > 2018 (r328075) @@ -98,7 +98,7 @@ pass1(void) > for (c = 0; c < sblock.fs_ncg; c++) { > inumber = c * sblock.fs_ipg; > setinodebuf(inumber); > - cgbp = cgget(c); > + cgbp = cglookup(c); > cgp = cgbp->b_un.b_cg; > rebuildcg = 0; > if (!check_cgmagic(c, cgbp)) > > Modified: head/sbin/fsck_ffs/pass5.c > ============================================================================== > --- head/sbin/fsck_ffs/pass5.c Wed Jan 17 06:22:10 2018 > (r328074) +++ head/sbin/fsck_ffs/pass5.c Wed Jan 17 06:31:21 > 2018 (r328075) @@ -174,7 +174,7 @@ pass5(void) > c * 100 / sblock.fs_ncg); > got_sigalarm = 0; > } > - cgbp = cgget(c); > + cgbp = cglookup(c); > cg = cgbp->b_un.b_cg; > if (!cg_chkmagic(cg)) > pfatal("CG %d: BAD MAGIC NUMBER\n", c); > _______________________________________________ > 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" This breaks buildworld for me: [...] ===> sbin/fsdb (all) --- all_subdir_rescue --- `pkill.o' is up to date. --- ps_make --- (cd /usr/src/rescue/rescue/../../bin/ps && make -DRESCUE CRUNCH_CFLAGS=-DRESCUE MK_AUTO_OBJ=yes DIRPRFX=rescue/rescue/ps/ fmt.o keyword.o nlist.o print.o ps.o) --- all_subdir_sbin --- Building /usr/obj/usr/src/amd64.amd64/sbin/fsdb/fsdb --- fsdb --- /usr/obj/usr/src/amd64.amd64/tmp/usr/bin/ld: error: undefined symbol: cgget >>> referenced by fsdb.c >>> fsdb.o:(findblk) cc: error: linker command failed with exit code 1 (use -v to see invocation) *** [fsdb] Error code 1 From owner-svn-src-head@freebsd.org Wed Jan 17 09:33:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EAECCEB8C69; Wed, 17 Jan 2018 09:33:17 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C68D020C0; Wed, 17 Jan 2018 09:33:17 +0000 (UTC) (envelope-from wma@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 259B75AD0; Wed, 17 Jan 2018 09:33:17 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0H9XHfs085820; Wed, 17 Jan 2018 09:33:17 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0H9XHu1085819; Wed, 17 Jan 2018 09:33:17 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201801170933.w0H9XHu1085819@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Wed, 17 Jan 2018 09:33:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328078 - head/sys/powerpc/conf X-SVN-Group: head X-SVN-Commit-Author: wma X-SVN-Commit-Paths: head/sys/powerpc/conf X-SVN-Commit-Revision: 328078 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jan 2018 09:33:18 -0000 Author: wma Date: Wed Jan 17 09:33:16 2018 New Revision: 328078 URL: https://svnweb.freebsd.org/changeset/base/328078 Log: PPC64: add CXGBE and remove AHCI from GENERIC64 Add CXGBE driver which is required for PowerNV system. Also, remove AHCI which does not work in BigEndian. Created by: Wojciech Macek Obtained from: Semihalf Sponsored by: QCM Technologies Modified: head/sys/powerpc/conf/GENERIC64 Modified: head/sys/powerpc/conf/GENERIC64 ============================================================================== --- head/sys/powerpc/conf/GENERIC64 Wed Jan 17 08:01:51 2018 (r328077) +++ head/sys/powerpc/conf/GENERIC64 Wed Jan 17 09:33:16 2018 (r328078) @@ -107,7 +107,7 @@ options PCI_HP # PCI-Express native HotPlug device agp # ATA controllers -device ahci # AHCI-compatible SATA controllers +#device ahci # AHCI-compatible SATA controllers device ata # Legacy ATA/SATA controllers device mvs # Marvell 88SX50XX/88SX60XX/88SX70XX/SoC SATA device siis # SiliconImage SiI3124/SiI3132/SiI3531 SATA @@ -143,6 +143,7 @@ device ix # Intel PRO/10GbE PCIE PF Ethernet Family device ixv # Intel PRO/10GbE PCIE VF Ethernet Family device glc # Sony Playstation 3 Ethernet device llan # IBM pSeries Virtual Ethernet +device cxgbe # Chelsio 10/25G NIC # PCI Ethernet NICs that use the common MII bus controller code. device miibus # MII bus support From owner-svn-src-head@freebsd.org Wed Jan 17 09:36:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04522EB8EDA; Wed, 17 Jan 2018 09:36:50 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D474F2453; Wed, 17 Jan 2018 09:36:49 +0000 (UTC) (envelope-from wma@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 03CD75AD7; Wed, 17 Jan 2018 09:36:49 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0H9amcT086003; Wed, 17 Jan 2018 09:36:48 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0H9amI3086002; Wed, 17 Jan 2018 09:36:48 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201801170936.w0H9amI3086002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Wed, 17 Jan 2018 09:36:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328079 - head/sys/powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: wma X-SVN-Commit-Paths: head/sys/powerpc/powerpc X-SVN-Commit-Revision: 328079 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jan 2018 09:36:50 -0000 Author: wma Date: Wed Jan 17 09:36:48 2018 New Revision: 328079 URL: https://svnweb.freebsd.org/changeset/base/328079 Log: PPC64: fix copyinout ranges Use current userspace address for segment mapping. Previously, there was a bug which made the funciton constantly using the userspace base address which could cause data integrity issues. Created by: Wojciech Macek Obtained from: Semihalf Sponsored by: QCM Technologies Modified: head/sys/powerpc/powerpc/copyinout.c Modified: head/sys/powerpc/powerpc/copyinout.c ============================================================================== --- head/sys/powerpc/powerpc/copyinout.c Wed Jan 17 09:33:16 2018 (r328078) +++ head/sys/powerpc/powerpc/copyinout.c Wed Jan 17 09:36:48 2018 (r328079) @@ -94,7 +94,7 @@ copyout(const void *kaddr, void *udaddr, size_t len) up = udaddr; while (len > 0) { - if (pmap_map_user_ptr(pm, udaddr, (void **)&p, len, &l)) { + if (pmap_map_user_ptr(pm, up, (void **)&p, len, &l)) { td->td_pcb->pcb_onfault = NULL; return (EFAULT); } @@ -133,7 +133,7 @@ copyin(const void *udaddr, void *kaddr, size_t len) up = udaddr; while (len > 0) { - if (pmap_map_user_ptr(pm, udaddr, (void **)&p, len, &l)) { + if (pmap_map_user_ptr(pm, up, (void **)&p, len, &l)) { td->td_pcb->pcb_onfault = NULL; return (EFAULT); } From owner-svn-src-head@freebsd.org Wed Jan 17 09:44:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 261D9EB9421; Wed, 17 Jan 2018 09:44:26 +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 C0DB8296D; Wed, 17 Jan 2018 09:44:25 +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 w0H9iDLY017554 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 17 Jan 2018 11:44:16 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w0H9iDLY017554 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w0H9iDFg017553; Wed, 17 Jan 2018 11:44:13 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 17 Jan 2018 11:44:13 +0200 From: Konstantin Belousov To: Nathan Whitehorn Cc: Marius Strobl , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r327950 - in head/sys/powerpc: aim include powerpc ps3 Message-ID: <20180117094413.GF55707@kib.kiev.ua> References: <20180115111812.GF1684@kib.kiev.ua> <20180115170603.GJ1684@kib.kiev.ua> <9e5554d7-6a0c-5910-8cb6-74f98259536f@freebsd.org> <20180115175335.GK1684@kib.kiev.ua> <20180116193208.GA12364@alchemy.franken.de> <11a7fdd6-cfd6-26c1-ae3c-7d8a63924d5a@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <11a7fdd6-cfd6-26c1-ae3c-7d8a63924d5a@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-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jan 2018 09:44:26 -0000 On Tue, Jan 16, 2018 at 09:30:29PM -0800, Nathan Whitehorn wrote: > > > On 01/16/18 11:32, Marius Strobl wrote: > > On Mon, Jan 15, 2018 at 03:20:49PM -0800, Nathan Whitehorn wrote: > >> > >> On 01/15/18 09:53, Konstantin Belousov wrote: > >>> On Mon, Jan 15, 2018 at 09:32:56AM -0800, Nathan Whitehorn wrote: > >>>> That seems fine to me. I don't think a less-clumsy way that does not > >>>> involve extra indirection is possible. The PHYS_TO_DMAP() returning NULL > >>>> is about the best thing I can come up with from a clumsiness standpoint > >>>> since plenty of code checks for null pointers already, but doesn't > >>>> cleanly handle the rarer case where you want to test for the existence > >>>> of direct maps in general without testing some potemkin address. > >>>> > >>>> My one reservation about PMAP_HAS_DMAP or the like as a selector is that > >>>> it does not encode the full shape of the problem: one could imagine > >>>> having a direct map that only covers a limited range of RAM (I am not > >>>> sure whether the existence of dmaplimit on amd64 implies this can happen > >>>> with non-device memory in real life), for example. These cases are > >>>> currently covered by an assert() in PHYS_TO_DMAP(), whereas having > >>>> PHYS_TO_DMAP() return NULL allows a more flexible signalling and the > >>>> potential for the calling code to do something reasonable to handle the > >>>> error. A single global flag can't convey information at this kind of > >>>> granularity. Is this a reasonable concern? Or am I overthinking things? > >>> IMO it is overreaction. amd64 assumes that all normal memory is covered > >>> by DMAP. It must never fail. See, for instance, the implementation > >>> of the sf bufs for it. > >>> > >>> If device memory not covered by DMAP can exists, it is the driver problem. > >>> For instance, for NVDIMMs I wrote specific mapping code which establishes > >>> kernel mapping for it, when not covered by EFI memory map and correspondingly > >>> not included into DMAP. > >>> > >> Fair enough. Here's a patch with a new flag (DIRECT_MAP_AVAILABLE). I've > >> also retooled the sfbuf code to use this rather than its own flags that > >> mean the same things. The sparc64 part of the patch is untested. > >> -Nathan > >> Index: sparc64/include/vmparam.h > >> =================================================================== > >> --- sparc64/include/vmparam.h (revision 328006) > >> +++ sparc64/include/vmparam.h (working copy) > >> @@ -240,10 +240,12 @@ > >> */ > >> #define ZERO_REGION_SIZE PAGE_SIZE > >> > >> +#include > >> + > >> #define SFBUF > >> #define SFBUF_MAP > >> -#define SFBUF_OPTIONAL_DIRECT_MAP dcache_color_ignore > >> -#include > >> -#define SFBUF_PHYS_DMAP(x) TLB_PHYS_TO_DIRECT(x) > >> > >> +#define DIRECT_MAP_AVAILABLE dcache_color_ignore > >> +#define PHYS_TO_DMAP(x) (DIRECT_MAP_AVAILABLE ? (TLB_PHYS_TO_DIRECT(x) : 0) > > What dcache_color_ignore actually indicates is the presence of > > hardware unaliasing support, in other words the ability to enter > > duplicate cacheable mappings into the MMU. While a direct map is > > available and used by MD code on all supported CPUs down to US-I, > > the former feature is only implemented in the line of Fujitsu SPARC64 > > processors. IIRC, the sfbuf(9) code can't guarantee that there isn't > > already a cacheable mapping from a different VA to the same PA, > > which is why it employs dcache_color_ignore. Is that a general > > constraint of all MI PHYS_TO_DMAP users or are there consumers > > which can guarantee that they are the only users of a mapping > > to the same PA? > > > > Marius > > > > With the patch, there are four uses of this in the kernel: the sfbuf > code, a diagnostic check on page zeroing, part of the EFI runtime code, > and part of the Linux KBI compat. The second looks safe from this > perspective and at least some of the others (EFI runtime) are irrelevant > on sparc64. But I really have no idea what was intended for the > semantics of this API -- I didn't even know it *was* an MI API until > this commit. Maybe kib can comment? If this is outside the semantics of > PHYS_TO_DMAP, then we need to keep the existing sfbuf code. sfbufs cannot guarantee that there is no other mapping of the page when the sfbuf is created. For instance, one of the use of sfbufs is to map the image page 0 to read ELF headers when doing the image activation. The image might be mapped by other processes, and we do not control the address at which it mapped. So the direct map accesses must work regardless of the presence of other page mappings, and the check for dcache_color_ignore is needed to allow MI code to take advantage of DMAP. From owner-svn-src-head@freebsd.org Wed Jan 17 09:45:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC3F0EB94EE; Wed, 17 Jan 2018 09:45:19 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C6EFC2AD2; Wed, 17 Jan 2018 09:45:19 +0000 (UTC) (envelope-from wma@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0667E5C7B; Wed, 17 Jan 2018 09:45:19 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0H9jIxQ090023; Wed, 17 Jan 2018 09:45:18 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0H9jIP5090022; Wed, 17 Jan 2018 09:45:18 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201801170945.w0H9jIP5090022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Wed, 17 Jan 2018 09:45:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328080 - head/sys/powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: wma X-SVN-Commit-Paths: head/sys/powerpc/powerpc X-SVN-Commit-Revision: 328080 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jan 2018 09:45:20 -0000 Author: wma Date: Wed Jan 17 09:45:18 2018 New Revision: 328080 URL: https://svnweb.freebsd.org/changeset/base/328080 Log: PPC64: implement missing busdma ops Add missing little-endian 64-bit read and write. Since there is no direct ASM opcode for this, perform byte swap if necessary. Created by: Wojciech Macek Obtained from: Semihalf Sponsored by: QCM Technologies Modified: head/sys/powerpc/powerpc/bus_machdep.c Modified: head/sys/powerpc/powerpc/bus_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/bus_machdep.c Wed Jan 17 09:36:48 2018 (r328079) +++ head/sys/powerpc/powerpc/bus_machdep.c Wed Jan 17 09:45:18 2018 (r328080) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -333,6 +334,7 @@ bs_be_ws_8(bus_space_handle_t bsh, bus_size_t ofs, uin addr = __ppc_ba(bsh, ofs); *addr = val; powerpc_iomb(); + CTR4(KTR_BE_IO, "%s(bsh=%#x, ofs=%#x, val=%#x)", __func__, bsh, ofs, val); } static void @@ -532,7 +534,14 @@ bs_le_rs_4(bus_space_handle_t bsh, bus_size_t ofs) static uint64_t bs_le_rs_8(bus_space_handle_t bsh, bus_size_t ofs) { - TODO; + volatile uint64_t *addr; + uint64_t res; + + addr = __ppc_ba(bsh, ofs); + res = le64toh(*addr); + powerpc_iomb(); + CTR4(KTR_LE_IO, "%s(bsh=%#x, ofs=%#x) = %#x", __func__, bsh, ofs, res); + return (res); } static void @@ -631,7 +640,12 @@ bs_le_ws_4(bus_space_handle_t bsh, bus_size_t ofs, uin static void bs_le_ws_8(bus_space_handle_t bsh, bus_size_t ofs, uint64_t val) { - TODO; + volatile uint64_t *addr; + + addr = __ppc_ba(bsh, ofs); + *addr = htole64(val); + powerpc_iomb(); + CTR4(KTR_LE_IO, "%s(bsh=%#x, ofs=%#x, val=%#x)", __func__, bsh, ofs, val); } static void From owner-svn-src-head@freebsd.org Wed Jan 17 10:30:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 881C5EBBAD4; Wed, 17 Jan 2018 10:30:50 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6498A6372E; Wed, 17 Jan 2018 10:30:50 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AEA0662FF; Wed, 17 Jan 2018 10:30:49 +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 w0HAUn5i009575; Wed, 17 Jan 2018 10:30:49 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0HAUnQx009574; Wed, 17 Jan 2018 10:30:49 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201801171030.w0HAUnQx009574@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 17 Jan 2018 10:30:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328081 - head/usr.bin/truss X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/usr.bin/truss X-SVN-Commit-Revision: 328081 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jan 2018 10:30:50 -0000 Author: tuexen Date: Wed Jan 17 10:30:49 2018 New Revision: 328081 URL: https://svnweb.freebsd.org/changeset/base/328081 Log: Add missing assignment to make sure non-first cmsgs are handled as such. Modified: head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Wed Jan 17 09:45:18 2018 (r328080) +++ head/usr.bin/truss/syscalls.c Wed Jan 17 10:30:49 2018 (r328081) @@ -1531,6 +1531,7 @@ print_cmsgs(FILE *fp, pid_t pid, bool receive, struct break; } fputs("}", fp); + first = false; } fputs("}", fp); free(cmsgbuf); From owner-svn-src-head@freebsd.org Wed Jan 17 11:21:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A6E7EBE3A8; Wed, 17 Jan 2018 11:21:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 257986955D; Wed, 17 Jan 2018 11:21:05 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 664AB6B21; Wed, 17 Jan 2018 11:21:04 +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 w0HBL4S5031163; Wed, 17 Jan 2018 11:21:04 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0HBL4Nm031161; Wed, 17 Jan 2018 11:21:04 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201801171121.w0HBL4Nm031161@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 17 Jan 2018 11:21:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328082 - in head/sys/amd64: amd64 include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys/amd64: amd64 include X-SVN-Commit-Revision: 328082 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jan 2018 11:21:05 -0000 Author: kib Date: Wed Jan 17 11:21:03 2018 New Revision: 328082 URL: https://svnweb.freebsd.org/changeset/base/328082 Log: Amd64 user_ldt_deref() is not used outside sys_machdep.c. Mark it as static. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/sys_machdep.c head/sys/amd64/include/proc.h Modified: head/sys/amd64/amd64/sys_machdep.c ============================================================================== --- head/sys/amd64/amd64/sys_machdep.c Wed Jan 17 10:30:49 2018 (r328081) +++ head/sys/amd64/amd64/sys_machdep.c Wed Jan 17 11:21:03 2018 (r328082) @@ -65,6 +65,9 @@ __FBSDID("$FreeBSD$"); #include +static void user_ldt_deref(struct proc_ldt *pldt); +static void user_ldt_derefl(struct proc_ldt *pldt); + #define MAX_LD 8192 int max_ldt_segment = 512; @@ -83,8 +86,6 @@ max_ldt_segment_init(void *arg __unused) } SYSINIT(maxldt, SI_SUB_VM_CONF, SI_ORDER_ANY, max_ldt_segment_init, NULL); -static void user_ldt_derefl(struct proc_ldt *pldt); - #ifndef _SYS_SYSPROTO_H_ struct sysarch_args { int op; @@ -529,7 +530,7 @@ user_ldt_derefl(struct proc_ldt *pldt) } } -void +static void user_ldt_deref(struct proc_ldt *pldt) { Modified: head/sys/amd64/include/proc.h ============================================================================== --- head/sys/amd64/include/proc.h Wed Jan 17 10:30:49 2018 (r328081) +++ head/sys/amd64/include/proc.h Wed Jan 17 11:21:03 2018 (r328082) @@ -92,7 +92,6 @@ struct syscall_args { struct proc_ldt *user_ldt_alloc(struct proc *, int); void user_ldt_free(struct thread *); -void user_ldt_deref(struct proc_ldt *); struct sysarch_args; int sysarch_ldt(struct thread *td, struct sysarch_args *uap, int uap_space); int amd64_set_ldt_data(struct thread *td, int start, int num, From owner-svn-src-head@freebsd.org Wed Jan 17 11:44:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70DADEBF2C2; Wed, 17 Jan 2018 11:44:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E9956A4F4; Wed, 17 Jan 2018 11:44: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4C0516FD7; Wed, 17 Jan 2018 11:44: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 w0HBiM2S043140; Wed, 17 Jan 2018 11:44:22 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0HBiLrY043134; Wed, 17 Jan 2018 11:44:21 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201801171144.w0HBiLrY043134@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 17 Jan 2018 11:44:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328083 - in head/sys: amd64/amd64 amd64/ia32 amd64/include amd64/vmm amd64/vmm/intel dev/hyperv/vmbus dev/hyperv/vmbus/amd64 dev/hyperv/vmbus/i386 i386/i386 x86/include x86/isa x86/x86 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/amd64 amd64/ia32 amd64/include amd64/vmm amd64/vmm/intel dev/hyperv/vmbus dev/hyperv/vmbus/amd64 dev/hyperv/vmbus/i386 i386/i386 x86/include x86/isa x86/x86 X-SVN-Commit-Revision: 328083 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jan 2018 11:44:23 -0000 Author: kib Date: Wed Jan 17 11:44:21 2018 New Revision: 328083 URL: https://svnweb.freebsd.org/changeset/base/328083 Log: PTI for amd64. The implementation of the Kernel Page Table Isolation (KPTI) for amd64, first version. It provides a workaround for the 'meltdown' vulnerability. PTI is turned off by default for now, enable with the loader tunable vm.pmap.pti=1. The pmap page table is split into kernel-mode table and user-mode table. Kernel-mode table is identical to the non-PTI table, while usermode table is obtained from kernel table by leaving userspace mappings intact, but only leaving the following parts of the kernel mapped: kernel text (but not modules text) PCPU GDT/IDT/user LDT/task structures IST stacks for NMI and doublefault handlers. Kernel switches to user page table before returning to usermode, and restores full kernel page table on the entry. Initial kernel-mode stack for PTI trampoline is allocated in PCPU, it is only 16 qwords. Kernel entry trampoline switches page tables. then the hardware trap frame is copied to the normal kstack, and execution continues. IST stacks are kept mapped and no trampoline is needed for NMI/doublefault, but of course page table switch is performed. On return to usermode, the trampoline is used again, iret frame is copied to the trampoline stack, page tables are switched and iretq is executed. The case of iretq faulting due to the invalid usermode context is tricky, since the frame for fault is appended to the trampoline frame. Besides copying the fault frame and original (corrupted) frame to kstack, the fault frame must be patched to make it look as if the fault occured on the kstack, see the comment in doret_iret detection code in trap(). Currently kernel pages which are mapped during trampoline operation are identical for all pmaps. They are registered using pmap_pti_add_kva(). Besides initial registrations done during boot, LDT and non-common TSS segments are registered if user requested their use. In principle, they can be installed into kernel page table per pmap with some work. Similarly, PCPU can be hidden from userspace mapping using trampoline PCPU page, but again I do not see much benefits besides complexity. PDPE pages for the kernel half of the user page tables are pre-allocated during boot because we need to know pml4 entries which are copied to the top-level paging structure page, in advance on a new pmap creation. I enforce this to avoid iterating over the all existing pmaps if a new PDPE page is needed for PTI kernel mappings. The iteration is a known problematic operation on i386. The need to flush hidden kernel translations on the switch to user mode make global tables (PG_G) meaningless and even harming, so PG_G use is disabled for PTI case. Our existing use of PCID is incompatible with PTI and is automatically disabled if PTI is enabled. PCID can be forced on only for developer's benefit. MCE is known to be broken, it requires IST stack to operate completely correctly even for non-PTI case, and absolutely needs dedicated IST stack because MCE delivery while trampoline did not switched from PTI stack is fatal. The fix is pending. Reviewed by: markj (partially) Tested by: pho (previous version) Discussed with: jeff, jhb Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/amd64/amd64/apic_vector.S head/sys/amd64/amd64/atpic_vector.S head/sys/amd64/amd64/cpu_switch.S head/sys/amd64/amd64/exception.S head/sys/amd64/amd64/genassym.c head/sys/amd64/amd64/machdep.c head/sys/amd64/amd64/mp_machdep.c head/sys/amd64/amd64/pmap.c head/sys/amd64/amd64/sys_machdep.c head/sys/amd64/amd64/trap.c head/sys/amd64/amd64/vm_machdep.c head/sys/amd64/ia32/ia32_exception.S head/sys/amd64/ia32/ia32_syscall.c head/sys/amd64/include/asmacros.h head/sys/amd64/include/frame.h head/sys/amd64/include/pcpu.h head/sys/amd64/include/pmap.h head/sys/amd64/include/smp.h head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/vmm.c head/sys/dev/hyperv/vmbus/amd64/vmbus_vector.S head/sys/dev/hyperv/vmbus/i386/vmbus_vector.S head/sys/dev/hyperv/vmbus/vmbus.c head/sys/i386/i386/apic_vector.s head/sys/i386/i386/atpic_vector.s head/sys/i386/i386/exception.s head/sys/i386/i386/pmap.c head/sys/x86/include/apicvar.h head/sys/x86/include/x86_var.h head/sys/x86/isa/atpic.c head/sys/x86/x86/local_apic.c Modified: head/sys/amd64/amd64/apic_vector.S ============================================================================== --- head/sys/amd64/amd64/apic_vector.S Wed Jan 17 11:21:03 2018 (r328082) +++ head/sys/amd64/amd64/apic_vector.S Wed Jan 17 11:44:21 2018 (r328083) @@ -2,7 +2,13 @@ * Copyright (c) 1989, 1990 William F. Jolitz. * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. + * Copyright (c) 2014-2018 The FreeBSD Foundation + * All rights reserved. * + * Portions of this software were 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: @@ -38,12 +44,12 @@ #include "opt_smp.h" +#include "assym.s" + #include #include #include -#include "assym.s" - #ifdef SMP #define LK lock ; #else @@ -73,30 +79,28 @@ as_lapic_eoi: * translates that into a vector, and passes the vector to the * lapic_handle_intr() function. */ -#define ISR_VEC(index, vec_name) \ - .text ; \ - SUPERALIGN_TEXT ; \ -IDTVEC(vec_name) ; \ - PUSH_FRAME ; \ - FAKE_MCOUNT(TF_RIP(%rsp)) ; \ - cmpl $0,x2apic_mode ; \ - je 1f ; \ - movl $(MSR_APIC_ISR0 + index),%ecx ; \ - rdmsr ; \ - jmp 2f ; \ -1: ; \ - movq lapic_map, %rdx ; /* pointer to local APIC */ \ - movl LA_ISR + 16 * (index)(%rdx), %eax ; /* load ISR */ \ -2: ; \ - bsrl %eax, %eax ; /* index of highest set bit in ISR */ \ - jz 3f ; \ - addl $(32 * index),%eax ; \ - movq %rsp, %rsi ; \ - movl %eax, %edi ; /* pass the IRQ */ \ - call lapic_handle_intr ; \ -3: ; \ - MEXITCOUNT ; \ + .macro ISR_VEC index, vec_name + INTR_HANDLER \vec_name + FAKE_MCOUNT(TF_RIP(%rsp)) + cmpl $0,x2apic_mode + je 1f + movl $(MSR_APIC_ISR0 + \index),%ecx + rdmsr + jmp 2f +1: + movq lapic_map, %rdx /* pointer to local APIC */ + movl LA_ISR + 16 * (\index)(%rdx), %eax /* load ISR */ +2: + bsrl %eax, %eax /* index of highest set bit in ISR */ + jz 3f + addl $(32 * \index),%eax + movq %rsp, %rsi + movl %eax, %edi /* pass the IRQ */ + call lapic_handle_intr +3: + MEXITCOUNT jmp doreti + .endm /* * Handle "spurious INTerrupts". @@ -108,26 +112,21 @@ IDTVEC(vec_name) ; \ .text SUPERALIGN_TEXT IDTVEC(spuriousint) - /* No EOI cycle used here */ - jmp doreti_iret - ISR_VEC(1, apic_isr1) - ISR_VEC(2, apic_isr2) - ISR_VEC(3, apic_isr3) - ISR_VEC(4, apic_isr4) - ISR_VEC(5, apic_isr5) - ISR_VEC(6, apic_isr6) - ISR_VEC(7, apic_isr7) + ISR_VEC 1, apic_isr1 + ISR_VEC 2, apic_isr2 + ISR_VEC 3, apic_isr3 + ISR_VEC 4, apic_isr4 + ISR_VEC 5, apic_isr5 + ISR_VEC 6, apic_isr6 + ISR_VEC 7, apic_isr7 /* * Local APIC periodic timer handler. */ - .text - SUPERALIGN_TEXT -IDTVEC(timerint) - PUSH_FRAME + INTR_HANDLER timerint FAKE_MCOUNT(TF_RIP(%rsp)) movq %rsp, %rdi call lapic_handle_timer @@ -137,10 +136,7 @@ IDTVEC(timerint) /* * Local APIC CMCI handler. */ - .text - SUPERALIGN_TEXT -IDTVEC(cmcint) - PUSH_FRAME + INTR_HANDLER cmcint FAKE_MCOUNT(TF_RIP(%rsp)) call lapic_handle_cmc MEXITCOUNT @@ -149,10 +145,7 @@ IDTVEC(cmcint) /* * Local APIC error interrupt handler. */ - .text - SUPERALIGN_TEXT -IDTVEC(errorint) - PUSH_FRAME + INTR_HANDLER errorint FAKE_MCOUNT(TF_RIP(%rsp)) call lapic_handle_error MEXITCOUNT @@ -163,10 +156,7 @@ IDTVEC(errorint) * Xen event channel upcall interrupt handler. * Only used when the hypervisor supports direct vector callbacks. */ - .text - SUPERALIGN_TEXT -IDTVEC(xen_intr_upcall) - PUSH_FRAME + INTR_HANDLER xen_intr_upcall FAKE_MCOUNT(TF_RIP(%rsp)) movq %rsp, %rdi call xen_intr_handle_upcall @@ -183,74 +173,48 @@ IDTVEC(xen_intr_upcall) SUPERALIGN_TEXT invltlb_ret: call as_lapic_eoi - POP_FRAME - jmp doreti_iret + jmp ld_regs SUPERALIGN_TEXT -IDTVEC(invltlb) - PUSH_FRAME - + INTR_HANDLER invltlb call invltlb_handler jmp invltlb_ret -IDTVEC(invltlb_pcid) - PUSH_FRAME - + INTR_HANDLER invltlb_pcid call invltlb_pcid_handler jmp invltlb_ret -IDTVEC(invltlb_invpcid) - PUSH_FRAME - + INTR_HANDLER invltlb_invpcid call invltlb_invpcid_handler jmp invltlb_ret /* * Single page TLB shootdown */ - .text - - SUPERALIGN_TEXT -IDTVEC(invlpg) - PUSH_FRAME - + INTR_HANDLER invlpg call invlpg_handler jmp invltlb_ret /* * Page range TLB shootdown. */ - .text - SUPERALIGN_TEXT -IDTVEC(invlrng) - PUSH_FRAME - + INTR_HANDLER invlrng call invlrng_handler jmp invltlb_ret /* * Invalidate cache. */ - .text - SUPERALIGN_TEXT -IDTVEC(invlcache) - PUSH_FRAME - + INTR_HANDLER invlcache call invlcache_handler jmp invltlb_ret /* * Handler for IPIs sent via the per-cpu IPI bitmap. */ - .text - SUPERALIGN_TEXT -IDTVEC(ipi_intr_bitmap_handler) - PUSH_FRAME - + INTR_HANDLER ipi_intr_bitmap_handler call as_lapic_eoi - FAKE_MCOUNT(TF_RIP(%rsp)) - call ipi_bitmap_handler MEXITCOUNT jmp doreti @@ -258,24 +222,15 @@ IDTVEC(ipi_intr_bitmap_handler) /* * Executed by a CPU when it receives an IPI_STOP from another CPU. */ - .text - SUPERALIGN_TEXT -IDTVEC(cpustop) - PUSH_FRAME - + INTR_HANDLER cpustop call as_lapic_eoi - call cpustop_handler jmp doreti /* * Executed by a CPU when it receives an IPI_SUSPEND from another CPU. */ - .text - SUPERALIGN_TEXT -IDTVEC(cpususpend) - PUSH_FRAME - + INTR_HANDLER cpususpend call cpususpend_handler call as_lapic_eoi jmp doreti @@ -285,10 +240,7 @@ IDTVEC(cpususpend) * * - Calls the generic rendezvous action function. */ - .text - SUPERALIGN_TEXT -IDTVEC(rendezvous) - PUSH_FRAME + INTR_HANDLER rendezvous #ifdef COUNT_IPIS movl PCPU(CPUID), %eax movq ipi_rendezvous_counts(,%rax,8), %rax @@ -327,5 +279,9 @@ IDTVEC(justreturn) popq %rcx popq %rax jmp doreti_iret + + INTR_HANDLER justreturn1 + call as_lapic_eoi + jmp doreti #endif /* SMP */ Modified: head/sys/amd64/amd64/atpic_vector.S ============================================================================== --- head/sys/amd64/amd64/atpic_vector.S Wed Jan 17 11:21:03 2018 (r328082) +++ head/sys/amd64/amd64/atpic_vector.S Wed Jan 17 11:44:21 2018 (r328083) @@ -36,38 +36,35 @@ * master and slave interrupt controllers. */ +#include "assym.s" #include -#include "assym.s" - /* * Macros for interrupt entry, call to handler, and exit. */ -#define INTR(irq_num, vec_name) \ - .text ; \ - SUPERALIGN_TEXT ; \ -IDTVEC(vec_name) ; \ - PUSH_FRAME ; \ - FAKE_MCOUNT(TF_RIP(%rsp)) ; \ - movq %rsp, %rsi ; \ - movl $irq_num, %edi; /* pass the IRQ */ \ - call atpic_handle_intr ; \ - MEXITCOUNT ; \ + .macro INTR irq_num, vec_name + INTR_HANDLER \vec_name + FAKE_MCOUNT(TF_RIP(%rsp)) + movq %rsp, %rsi + movl $\irq_num, %edi /* pass the IRQ */ + call atpic_handle_intr + MEXITCOUNT jmp doreti + .endm - INTR(0, atpic_intr0) - INTR(1, atpic_intr1) - INTR(2, atpic_intr2) - INTR(3, atpic_intr3) - INTR(4, atpic_intr4) - INTR(5, atpic_intr5) - INTR(6, atpic_intr6) - INTR(7, atpic_intr7) - INTR(8, atpic_intr8) - INTR(9, atpic_intr9) - INTR(10, atpic_intr10) - INTR(11, atpic_intr11) - INTR(12, atpic_intr12) - INTR(13, atpic_intr13) - INTR(14, atpic_intr14) - INTR(15, atpic_intr15) + INTR 0, atpic_intr0 + INTR 1, atpic_intr1 + INTR 2, atpic_intr2 + INTR 3, atpic_intr3 + INTR 4, atpic_intr4 + INTR 5, atpic_intr5 + INTR 6, atpic_intr6 + INTR 7, atpic_intr7 + INTR 8, atpic_intr8 + INTR 9, atpic_intr9 + INTR 10, atpic_intr10 + INTR 11, atpic_intr11 + INTR 12, atpic_intr12 + INTR 13, atpic_intr13 + INTR 14, atpic_intr14 + INTR 15, atpic_intr15 Modified: head/sys/amd64/amd64/cpu_switch.S ============================================================================== --- head/sys/amd64/amd64/cpu_switch.S Wed Jan 17 11:21:03 2018 (r328082) +++ head/sys/amd64/amd64/cpu_switch.S Wed Jan 17 11:44:21 2018 (r328083) @@ -215,8 +215,10 @@ done_tss: movq %r8,PCPU(RSP0) movq %r8,PCPU(CURPCB) /* Update the TSS_RSP0 pointer for the next interrupt */ + cmpb $0,pti(%rip) + jne 1f movq %r8,TSS_RSP0(%rdx) - movq %r12,PCPU(CURTHREAD) /* into next thread */ +1: movq %r12,PCPU(CURTHREAD) /* into next thread */ /* Test if debug registers should be restored. */ testl $PCB_DBREGS,PCB_FLAGS(%r8) @@ -293,7 +295,12 @@ do_tss: movq %rdx,PCPU(TSSP) shrq $8,%rcx movl %ecx,8(%rax) movb $0x89,5(%rax) /* unset busy */ - movl $TSSSEL,%eax + cmpb $0,pti(%rip) + je 1f + movq PCPU(PRVSPACE),%rax + addq $PC_PTI_STACK+PC_PTI_STACK_SZ*8,%rax + movq %rax,TSS_RSP0(%rdx) +1: movl $TSSSEL,%eax ltr %ax jmp done_tss Modified: head/sys/amd64/amd64/exception.S ============================================================================== --- head/sys/amd64/amd64/exception.S Wed Jan 17 11:21:03 2018 (r328082) +++ head/sys/amd64/amd64/exception.S Wed Jan 17 11:44:21 2018 (r328083) @@ -1,12 +1,16 @@ /*- * Copyright (c) 1989, 1990 William F. Jolitz. * Copyright (c) 1990 The Regents of the University of California. - * Copyright (c) 2007 The FreeBSD Foundation + * Copyright (c) 2007-2018 The FreeBSD Foundation * All rights reserved. * * Portions of this software were developed by A. Joseph Koshy under * sponsorship from the FreeBSD Foundation and Google, Inc. * + * Portions of this software were 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: @@ -38,13 +42,13 @@ #include "opt_compat.h" #include "opt_hwpmc_hooks.h" +#include "assym.s" + #include #include #include #include -#include "assym.s" - #ifdef KDTRACE_HOOKS .bss .globl dtrace_invop_jump_addr @@ -100,69 +104,63 @@ dtrace_invop_calltrap_addr: MCOUNT_LABEL(user) MCOUNT_LABEL(btrap) -/* Traps that we leave interrupts disabled for.. */ -#define TRAP_NOEN(a) \ - subq $TF_RIP,%rsp; \ - movl $(a),TF_TRAPNO(%rsp) ; \ - movq $0,TF_ADDR(%rsp) ; \ - movq $0,TF_ERR(%rsp) ; \ +/* Traps that we leave interrupts disabled for. */ + .macro TRAP_NOEN l, trapno + PTI_ENTRY \l,X\l + .globl X\l + .type X\l,@function +X\l: subq $TF_RIP,%rsp + movl $\trapno,TF_TRAPNO(%rsp) + movq $0,TF_ADDR(%rsp) + movq $0,TF_ERR(%rsp) jmp alltraps_noen -IDTVEC(dbg) - TRAP_NOEN(T_TRCTRAP) -IDTVEC(bpt) - TRAP_NOEN(T_BPTFLT) + .endm + + TRAP_NOEN dbg, T_TRCTRAP + TRAP_NOEN bpt, T_BPTFLT #ifdef KDTRACE_HOOKS -IDTVEC(dtrace_ret) - TRAP_NOEN(T_DTRACE_RET) + TRAP_NOEN dtrace_ret, T_DTRACE_RET #endif /* Regular traps; The cpu does not supply tf_err for these. */ -#define TRAP(a) \ - subq $TF_RIP,%rsp; \ - movl $(a),TF_TRAPNO(%rsp) ; \ - movq $0,TF_ADDR(%rsp) ; \ - movq $0,TF_ERR(%rsp) ; \ + .macro TRAP l, trapno + PTI_ENTRY \l,X\l + .globl X\l + .type X\l,@function +X\l: + subq $TF_RIP,%rsp + movl $\trapno,TF_TRAPNO(%rsp) + movq $0,TF_ADDR(%rsp) + movq $0,TF_ERR(%rsp) jmp alltraps -IDTVEC(div) - TRAP(T_DIVIDE) -IDTVEC(ofl) - TRAP(T_OFLOW) -IDTVEC(bnd) - TRAP(T_BOUND) -IDTVEC(ill) - TRAP(T_PRIVINFLT) -IDTVEC(dna) - TRAP(T_DNA) -IDTVEC(fpusegm) - TRAP(T_FPOPFLT) -IDTVEC(mchk) - TRAP(T_MCHK) -IDTVEC(rsvd) - TRAP(T_RESERVED) -IDTVEC(fpu) - TRAP(T_ARITHTRAP) -IDTVEC(xmm) - TRAP(T_XMMFLT) + .endm -/* This group of traps have tf_err already pushed by the cpu */ -#define TRAP_ERR(a) \ - subq $TF_ERR,%rsp; \ - movl $(a),TF_TRAPNO(%rsp) ; \ - movq $0,TF_ADDR(%rsp) ; \ + TRAP div, T_DIVIDE + TRAP ofl, T_OFLOW + TRAP bnd, T_BOUND + TRAP ill, T_PRIVINFLT + TRAP dna, T_DNA + TRAP fpusegm, T_FPOPFLT + TRAP mchk, T_MCHK + TRAP rsvd, T_RESERVED + TRAP fpu, T_ARITHTRAP + TRAP xmm, T_XMMFLT + +/* This group of traps have tf_err already pushed by the cpu. */ + .macro TRAP_ERR l, trapno + PTI_ENTRY \l,X\l,has_err=1 + .globl X\l + .type X\l,@function +X\l: + subq $TF_ERR,%rsp + movl $\trapno,TF_TRAPNO(%rsp) + movq $0,TF_ADDR(%rsp) jmp alltraps -IDTVEC(tss) - TRAP_ERR(T_TSSFLT) -IDTVEC(missing) - subq $TF_ERR,%rsp - movl $T_SEGNPFLT,TF_TRAPNO(%rsp) - jmp prot_addrf -IDTVEC(stk) - subq $TF_ERR,%rsp - movl $T_STKFLT,TF_TRAPNO(%rsp) - jmp prot_addrf -IDTVEC(align) - TRAP_ERR(T_ALIGNFLT) + .endm + TRAP_ERR tss, T_TSSFLT + TRAP_ERR align, T_ALIGNFLT + /* * alltraps entry point. Use swapgs if this is the first time in the * kernel from userland. Reenable interrupts if they were enabled @@ -174,15 +172,12 @@ IDTVEC(align) alltraps: movq %rdi,TF_RDI(%rsp) testb $SEL_RPL_MASK,TF_CS(%rsp) /* Did we come from kernel? */ - jz alltraps_testi /* already running with kernel GS.base */ + jz alltraps_segs /* already running with kernel GS.base */ swapgs movq PCPU(CURPCB),%rdi andl $~PCB_FULL_IRET,PCB_FLAGS(%rdi) - movw %fs,TF_FS(%rsp) - movw %gs,TF_GS(%rsp) - movw %es,TF_ES(%rsp) - movw %ds,TF_DS(%rsp) -alltraps_testi: +alltraps_segs: + SAVE_SEGS testl $PSL_I,TF_RFLAGS(%rsp) jz alltraps_pushregs_no_rdi sti @@ -249,14 +244,12 @@ calltrap: alltraps_noen: movq %rdi,TF_RDI(%rsp) testb $SEL_RPL_MASK,TF_CS(%rsp) /* Did we come from kernel? */ - jz 1f /* already running with kernel GS.base */ + jz alltraps_noen_segs /* already running with kernel GS.base */ swapgs movq PCPU(CURPCB),%rdi andl $~PCB_FULL_IRET,PCB_FLAGS(%rdi) -1: movw %fs,TF_FS(%rsp) - movw %gs,TF_GS(%rsp) - movw %es,TF_ES(%rsp) - movw %ds,TF_DS(%rsp) +alltraps_noen_segs: + SAVE_SEGS jmp alltraps_pushregs_no_rdi IDTVEC(dblfault) @@ -279,37 +272,36 @@ IDTVEC(dblfault) movq %r13,TF_R13(%rsp) movq %r14,TF_R14(%rsp) movq %r15,TF_R15(%rsp) - movw %fs,TF_FS(%rsp) - movw %gs,TF_GS(%rsp) - movw %es,TF_ES(%rsp) - movw %ds,TF_DS(%rsp) + SAVE_SEGS movl $TF_HASSEGS,TF_FLAGS(%rsp) cld testb $SEL_RPL_MASK,TF_CS(%rsp) /* Did we come from kernel? */ jz 1f /* already running with kernel GS.base */ swapgs 1: - movq %rsp,%rdi + movq PCPU(KCR3),%rax + cmpq $~0,%rax + je 2f + movq %rax,%cr3 +2: movq %rsp,%rdi call dblfault_handler -2: - hlt - jmp 2b +3: hlt + jmp 3b + PTI_ENTRY page, Xpage, has_err=1 IDTVEC(page) subq $TF_ERR,%rsp - movl $T_PAGEFLT,TF_TRAPNO(%rsp) movq %rdi,TF_RDI(%rsp) /* free up a GP register */ testb $SEL_RPL_MASK,TF_CS(%rsp) /* Did we come from kernel? */ - jz 1f /* already running with kernel GS.base */ + jz page_cr2 /* already running with kernel GS.base */ swapgs movq PCPU(CURPCB),%rdi andl $~PCB_FULL_IRET,PCB_FLAGS(%rdi) -1: movq %cr2,%rdi /* preserve %cr2 before .. */ +page_cr2: + movq %cr2,%rdi /* preserve %cr2 before .. */ movq %rdi,TF_ADDR(%rsp) /* enabling interrupts. */ - movw %fs,TF_FS(%rsp) - movw %gs,TF_GS(%rsp) - movw %es,TF_ES(%rsp) - movw %ds,TF_DS(%rsp) + SAVE_SEGS + movl $T_PAGEFLT,TF_TRAPNO(%rsp) testl $PSL_I,TF_RFLAGS(%rsp) jz alltraps_pushregs_no_rdi sti @@ -320,10 +312,43 @@ IDTVEC(page) * the iretq stage, we'll reenter with the wrong gs state. We'll have * to do a special the swapgs in this case even coming from the kernel. * XXX linux has a trap handler for their equivalent of load_gs(). + * + * On the stack, we have the hardware interrupt frame to return + * to usermode (faulted) and another frame with error code, for + * fault. For PTI, copy both frames to the main thread stack. */ -IDTVEC(prot) + .macro PROTF_ENTRY name,trapno +\name\()_pti_doreti: + pushq %rax + pushq %rdx + swapgs + movq PCPU(KCR3),%rax + movq %rax,%cr3 + movq PCPU(RSP0),%rax + subq $2*PTI_SIZE-3*8,%rax + MOVE_STACKS (PTI_SIZE / 4 - 3) + movq %rax,%rsp + popq %rdx + popq %rax + swapgs + jmp X\name +IDTVEC(\name\()_pti) + cmpq $doreti_iret,PTI_RIP-2*8(%rsp) + je \name\()_pti_doreti + testb $SEL_RPL_MASK,PTI_CS-2*8(%rsp) /* %rax, %rdx not yet pushed */ + jz X\name + PTI_UENTRY has_err=1 + swapgs +IDTVEC(\name) subq $TF_ERR,%rsp - movl $T_PROTFLT,TF_TRAPNO(%rsp) + movl $\trapno,TF_TRAPNO(%rsp) + jmp prot_addrf + .endm + + PROTF_ENTRY missing, T_SEGNPFLT + PROTF_ENTRY stk, T_STKFLT + PROTF_ENTRY prot, T_PROTFLT + prot_addrf: movq $0,TF_ADDR(%rsp) movq %rdi,TF_RDI(%rsp) /* free up a GP register */ @@ -375,8 +400,18 @@ prot_addrf: * We do not support invoking this from a custom segment registers, * esp. %cs, %ss, %fs, %gs, e.g. using entries from an LDT. */ + SUPERALIGN_TEXT +IDTVEC(fast_syscall_pti) + swapgs + movq %rax,PCPU(SCRATCH_RAX) + movq PCPU(KCR3),%rax + movq %rax,%cr3 + jmp fast_syscall_common + SUPERALIGN_TEXT IDTVEC(fast_syscall) swapgs + movq %rax,PCPU(SCRATCH_RAX) +fast_syscall_common: movq %rsp,PCPU(SCRATCH_RSP) movq PCPU(RSP0),%rsp /* Now emulate a trapframe. Make the 8 byte alignment odd for call. */ @@ -386,10 +421,9 @@ IDTVEC(fast_syscall) movq %rcx,TF_RIP(%rsp) /* %rcx original value is in %r10 */ movq PCPU(SCRATCH_RSP),%r11 /* %r11 already saved */ movq %r11,TF_RSP(%rsp) /* user stack pointer */ - movw %fs,TF_FS(%rsp) - movw %gs,TF_GS(%rsp) - movw %es,TF_ES(%rsp) - movw %ds,TF_DS(%rsp) + movq PCPU(SCRATCH_RAX),%rax + movq %rax,TF_RAX(%rsp) /* syscall number */ + SAVE_SEGS movq PCPU(CURPCB),%r11 andl $~PCB_FULL_IRET,PCB_FLAGS(%r11) sti @@ -402,7 +436,6 @@ IDTVEC(fast_syscall) movq %r10,TF_RCX(%rsp) /* arg 4 */ movq %r8,TF_R8(%rsp) /* arg 5 */ movq %r9,TF_R9(%rsp) /* arg 6 */ - movq %rax,TF_RAX(%rsp) /* syscall number */ movq %rbx,TF_RBX(%rsp) /* C preserved */ movq %rbp,TF_RBP(%rsp) /* C preserved */ movq %r12,TF_R12(%rsp) /* C preserved */ @@ -420,11 +453,11 @@ IDTVEC(fast_syscall) /* Disable interrupts before testing PCB_FULL_IRET. */ cli testl $PCB_FULL_IRET,PCB_FLAGS(%rax) - jnz 3f + jnz 4f /* Check for and handle AST's on return to userland. */ movq PCPU(CURTHREAD),%rax testl $TDF_ASTPENDING | TDF_NEEDRESCHED,TD_FLAGS(%rax) - jne 2f + jne 3f /* Restore preserved registers. */ MEXITCOUNT movq TF_RDI(%rsp),%rdi /* bonus; preserve arg 1 */ @@ -434,16 +467,21 @@ IDTVEC(fast_syscall) movq TF_RFLAGS(%rsp),%r11 /* original %rflags */ movq TF_RIP(%rsp),%rcx /* original %rip */ movq TF_RSP(%rsp),%rsp /* user stack pointer */ - swapgs + cmpb $0,pti + je 2f + movq PCPU(UCR3),%r9 + movq %r9,%cr3 + xorl %r9d,%r9d +2: swapgs sysretq -2: /* AST scheduled. */ +3: /* AST scheduled. */ sti movq %rsp,%rdi call ast jmp 1b -3: /* Requested full context restore, use doreti for that. */ +4: /* Requested full context restore, use doreti for that. */ MEXITCOUNT jmp doreti @@ -499,17 +537,15 @@ IDTVEC(nmi) movq %r13,TF_R13(%rsp) movq %r14,TF_R14(%rsp) movq %r15,TF_R15(%rsp) - movw %fs,TF_FS(%rsp) - movw %gs,TF_GS(%rsp) - movw %es,TF_ES(%rsp) - movw %ds,TF_DS(%rsp) + SAVE_SEGS movl $TF_HASSEGS,TF_FLAGS(%rsp) cld xorl %ebx,%ebx testb $SEL_RPL_MASK,TF_CS(%rsp) jnz nmi_fromuserspace /* - * We've interrupted the kernel. Preserve GS.base in %r12. + * We've interrupted the kernel. Preserve GS.base in %r12 + * and %cr3 in %r13. */ movl $MSR_GSBASE,%ecx rdmsr @@ -521,27 +557,38 @@ IDTVEC(nmi) movl %edx,%eax shrq $32,%rdx wrmsr + movq %cr3,%r13 + movq PCPU(KCR3),%rax + cmpq $~0,%rax + je nmi_calltrap + movq %rax,%cr3 jmp nmi_calltrap nmi_fromuserspace: incl %ebx swapgs - testb $CPUID_STDEXT_FSGSBASE,cpu_stdext_feature(%rip) - jz 2f + movq %cr3,%r13 + movq PCPU(KCR3),%rax + cmpq $~0,%rax + je 1f + movq %rax,%cr3 movq PCPU(CURPCB),%rdi testq %rdi,%rdi - jz 2f + jz 3f + orl $PCB_FULL_IRET,PCB_FLAGS(%rdi) +1: testb $CPUID_STDEXT_FSGSBASE,cpu_stdext_feature(%rip) + jz 3f cmpw $KUF32SEL,TF_FS(%rsp) - jne 1f + jne 2f rdfsbase %rax movq %rax,PCB_FSBASE(%rdi) -1: cmpw $KUG32SEL,TF_GS(%rsp) - jne 2f +2: cmpw $KUG32SEL,TF_GS(%rsp) + jne 3f movl $MSR_KGSBASE,%ecx rdmsr shlq $32,%rdx orq %rdx,%rax movq %rax,PCB_GSBASE(%rdi) -2: +3: /* Note: this label is also used by ddb and gdb: */ nmi_calltrap: FAKE_MCOUNT(TF_RIP(%rsp)) @@ -564,26 +611,29 @@ nmi_calltrap: movq PCPU(CURTHREAD),%rax orq %rax,%rax /* curthread present? */ jz nocallchain - testl $TDP_CALLCHAIN,TD_PFLAGS(%rax) /* flagged for capture? */ - jz nocallchain /* - * A user callchain is to be captured, so: - * - Move execution to the regular kernel stack, to allow for - * nested NMI interrupts. - * - Take the processor out of "NMI" mode by faking an "iret". - * - Enable interrupts, so that copyin() can work. + * Move execution to the regular kernel stack, because we + * committed to return through doreti. */ movq %rsp,%rsi /* source stack pointer */ movq $TF_SIZE,%rcx movq PCPU(RSP0),%rdx subq %rcx,%rdx movq %rdx,%rdi /* destination stack pointer */ - shrq $3,%rcx /* trap frame size in long words */ cld rep movsq /* copy trapframe */ + movq %rdx,%rsp /* we are on the regular kstack */ + testl $TDP_CALLCHAIN,TD_PFLAGS(%rax) /* flagged for capture? */ + jz nocallchain + /* + * A user callchain is to be captured, so: + * - Take the processor out of "NMI" mode by faking an "iret", + * to allow for nested NMI interrupts. + * - Enable interrupts, so that copyin() can work. + */ movl %ss,%eax pushq %rax /* tf_ss */ pushq %rdx /* tf_rsp (on kernel stack) */ @@ -624,22 +674,9 @@ nmi_kernelexit: movl %edx,%eax shrq $32,%rdx wrmsr + movq %r13,%cr3 nmi_restoreregs: - movq TF_RDI(%rsp),%rdi - movq TF_RSI(%rsp),%rsi - movq TF_RDX(%rsp),%rdx - movq TF_RCX(%rsp),%rcx - movq TF_R8(%rsp),%r8 - movq TF_R9(%rsp),%r9 - movq TF_RAX(%rsp),%rax - movq TF_RBX(%rsp),%rbx - movq TF_RBP(%rsp),%rbp - movq TF_R10(%rsp),%r10 - movq TF_R11(%rsp),%r11 - movq TF_R12(%rsp),%r12 - movq TF_R13(%rsp),%r13 - movq TF_R14(%rsp),%r14 - movq TF_R15(%rsp),%r15 + RESTORE_REGS addq $TF_RIP,%rsp jmp doreti_iret @@ -807,27 +844,38 @@ ld_es: ld_ds: movw TF_DS(%rsp),%ds ld_regs: - movq TF_RDI(%rsp),%rdi - movq TF_RSI(%rsp),%rsi - movq TF_RDX(%rsp),%rdx - movq TF_RCX(%rsp),%rcx - movq TF_R8(%rsp),%r8 - movq TF_R9(%rsp),%r9 - movq TF_RAX(%rsp),%rax - movq TF_RBX(%rsp),%rbx - movq TF_RBP(%rsp),%rbp - movq TF_R10(%rsp),%r10 - movq TF_R11(%rsp),%r11 - movq TF_R12(%rsp),%r12 - movq TF_R13(%rsp),%r13 - movq TF_R14(%rsp),%r14 - movq TF_R15(%rsp),%r15 + RESTORE_REGS testb $SEL_RPL_MASK,TF_CS(%rsp) /* Did we come from kernel? */ - jz 1f /* keep running with kernel GS.base */ + jz 2f /* keep running with kernel GS.base */ cli + cmpb $0,pti + je 1f + pushq %rdx + movq PCPU(PRVSPACE),%rdx + addq $PC_PTI_STACK+PC_PTI_STACK_SZ*8-PTI_SIZE,%rdx + movq %rax,PTI_RAX(%rdx) + popq %rax + movq %rax,PTI_RDX(%rdx) + movq TF_RIP(%rsp),%rax + movq %rax,PTI_RIP(%rdx) + movq TF_CS(%rsp),%rax + movq %rax,PTI_CS(%rdx) + movq TF_RFLAGS(%rsp),%rax + movq %rax,PTI_RFLAGS(%rdx) + movq TF_RSP(%rsp),%rax + movq %rax,PTI_RSP(%rdx) + movq TF_SS(%rsp),%rax + movq %rax,PTI_SS(%rdx) + movq PCPU(UCR3),%rax swapgs -1: - addq $TF_RIP,%rsp /* skip over tf_err, tf_trapno */ + movq %rdx,%rsp + movq %rax,%cr3 + popq %rdx + popq %rax + addq $8,%rsp + jmp doreti_iret +1: swapgs +2: addq $TF_RIP,%rsp .globl doreti_iret doreti_iret: iretq @@ -851,14 +899,11 @@ set_segs: .globl doreti_iret_fault doreti_iret_fault: subq $TF_RIP,%rsp /* space including tf_err, tf_trapno */ - testl $PSL_I,TF_RFLAGS(%rsp) + testb $SEL_RPL_MASK,TF_CS(%rsp) jz 1f sti 1: - movw %fs,TF_FS(%rsp) - movw %gs,TF_GS(%rsp) - movw %es,TF_ES(%rsp) - movw %ds,TF_DS(%rsp) + SAVE_SEGS movl $TF_HASSEGS,TF_FLAGS(%rsp) movq %rdi,TF_RDI(%rsp) movq %rsi,TF_RSI(%rsp) @@ -885,7 +930,7 @@ doreti_iret_fault: .globl ds_load_fault ds_load_fault: movl $T_PROTFLT,TF_TRAPNO(%rsp) - testl $PSL_I,TF_RFLAGS(%rsp) + testb $SEL_RPL_MASK,TF_CS(%rsp) jz 1f sti 1: Modified: head/sys/amd64/amd64/genassym.c ============================================================================== --- head/sys/amd64/amd64/genassym.c Wed Jan 17 11:21:03 2018 (r328082) +++ head/sys/amd64/amd64/genassym.c Wed Jan 17 11:44:21 2018 (r328083) @@ -186,6 +186,16 @@ ASSYM(TF_FLAGS, offsetof(struct trapframe, tf_flags)); ASSYM(TF_SIZE, sizeof(struct trapframe)); ASSYM(TF_HASSEGS, TF_HASSEGS); +ASSYM(PTI_RDX, offsetof(struct pti_frame, pti_rdx)); +ASSYM(PTI_RAX, offsetof(struct pti_frame, pti_rax)); +ASSYM(PTI_ERR, offsetof(struct pti_frame, pti_err)); +ASSYM(PTI_RIP, offsetof(struct pti_frame, pti_rip)); +ASSYM(PTI_CS, offsetof(struct pti_frame, pti_cs)); +ASSYM(PTI_RFLAGS, offsetof(struct pti_frame, pti_rflags)); +ASSYM(PTI_RSP, offsetof(struct pti_frame, pti_rsp)); +ASSYM(PTI_SS, offsetof(struct pti_frame, pti_ss)); +ASSYM(PTI_SIZE, sizeof(struct pti_frame)); + ASSYM(SIGF_HANDLER, offsetof(struct sigframe, sf_ahu.sf_handler)); ASSYM(SIGF_UC, offsetof(struct sigframe, sf_uc)); ASSYM(UC_EFLAGS, offsetof(ucontext_t, uc_mcontext.mc_rflags)); @@ -202,6 +212,7 @@ ASSYM(PC_IDLETHREAD, offsetof(struct pcpu, pc_idlethre ASSYM(PC_CURPCB, offsetof(struct pcpu, pc_curpcb)); ASSYM(PC_CPUID, offsetof(struct pcpu, pc_cpuid)); ASSYM(PC_SCRATCH_RSP, offsetof(struct pcpu, pc_scratch_rsp)); +ASSYM(PC_SCRATCH_RAX, offsetof(struct pcpu, pc_scratch_rax)); ASSYM(PC_CURPMAP, offsetof(struct pcpu, pc_curpmap)); ASSYM(PC_TSSP, offsetof(struct pcpu, pc_tssp)); ASSYM(PC_RSP0, offsetof(struct pcpu, pc_rsp0)); @@ -211,6 +222,10 @@ ASSYM(PC_LDT, offsetof(struct pcpu, pc_ldt)); ASSYM(PC_COMMONTSSP, offsetof(struct pcpu, pc_commontssp)); ASSYM(PC_TSS, offsetof(struct pcpu, pc_tss)); ASSYM(PC_PM_SAVE_CNT, offsetof(struct pcpu, pc_pm_save_cnt)); +ASSYM(PC_KCR3, offsetof(struct pcpu, pc_kcr3)); +ASSYM(PC_UCR3, offsetof(struct pcpu, pc_ucr3)); +ASSYM(PC_PTI_STACK, offsetof(struct pcpu, pc_pti_stack)); +ASSYM(PC_PTI_STACK_SZ, PC_PTI_STACK_SZ); ASSYM(LA_EOI, LAPIC_EOI * LAPIC_MEM_MUL); ASSYM(LA_ISR, LAPIC_ISR0 * LAPIC_MEM_MUL); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Jan 17 13:19:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C832EC4960; Wed, 17 Jan 2018 13:19:39 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 164B66E6AE; Wed, 17 Jan 2018 13:19:39 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 402357E4F; Wed, 17 Jan 2018 13:19:38 +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 w0HDJcGR081480; Wed, 17 Jan 2018 13:19:38 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0HDJcEL081479; Wed, 17 Jan 2018 13:19:38 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201801171319.w0HDJcEL081479@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 17 Jan 2018 13:19:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328084 - head/sbin/fsdb X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/sbin/fsdb X-SVN-Commit-Revision: 328084 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jan 2018 13:19:39 -0000 Author: dim Date: Wed Jan 17 13:19:37 2018 New Revision: 328084 URL: https://svnweb.freebsd.org/changeset/base/328084 Log: Fix buildworld after r328075, by also renaming cgget to cglookup in fsdb. Reported by: ohartmann@walstatt.org,david@catwhisker.org Pointy hat to: mckusick Modified: head/sbin/fsdb/fsdb.c Modified: head/sbin/fsdb/fsdb.c ============================================================================== --- head/sbin/fsdb/fsdb.c Wed Jan 17 11:44:21 2018 (r328083) +++ head/sbin/fsdb/fsdb.c Wed Jan 17 13:19:37 2018 (r328084) @@ -476,7 +476,7 @@ CMDFUNCSTART(findblk) */ inum = c * sblock.fs_ipg; /* Read cylinder group. */ - cgbp = cgget(c); + cgbp = cglookup(c); cgp = cgbp->b_un.b_cg; /* * Get a highest used inode number for a given cylinder group. From owner-svn-src-head@freebsd.org Wed Jan 17 13:22:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0223EC4CD5; Wed, 17 Jan 2018 13:22:06 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B9596EB50; Wed, 17 Jan 2018 13:22:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from coleburn.avinity.tv (unknown [77.95.97.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id B2FD05FC5; Wed, 17 Jan 2018 14:22:03 +0100 (CET) From: Dimitry Andric Message-Id: Content-Type: multipart/signed; boundary="Apple-Mail=_80ACAA30-EAC0-42D0-A2D2-B5437633CA4B"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r328075 - head/sbin/fsck_ffs Date: Wed, 17 Jan 2018 14:22:04 +0100 In-Reply-To: <20180117092418.2d823f60@freyja.zeit4.iv.bundesimmobilien.de> Cc: Kirk McKusick , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org To: "O. Hartmann" References: <201801170631.w0H6VLBP005425@repo.freebsd.org> <20180117092418.2d823f60@freyja.zeit4.iv.bundesimmobilien.de> X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jan 2018 13:22:07 -0000 --Apple-Mail=_80ACAA30-EAC0-42D0-A2D2-B5437633CA4B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 17 Jan 2018, at 09:24, O. Hartmann wrote: >=20 > On Wed, 17 Jan 2018 06:31:21 +0000 (UTC) > Kirk McKusick wrote: >=20 >> Author: mckusick >> Date: Wed Jan 17 06:31:21 2018 >> New Revision: 328075 >> URL: https://svnweb.freebsd.org/changeset/base/328075 >>=20 >> Log: >> Rename cgget =3D> cglookup to clear name space for new libufs = function cgget. >> No functional change. ... > Building /usr/obj/usr/src/amd64.amd64/sbin/fsdb/fsdb --- fsdb --- > /usr/obj/usr/src/amd64.amd64/tmp/usr/bin/ld: error: undefined symbol: = cgget >>>> referenced by fsdb.c >>>> fsdb.o:(findblk) This should now be fixed by r328084. -Dimitry --Apple-Mail=_80ACAA30-EAC0-42D0-A2D2-B5437633CA4B Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCWl9N/AAKCRCwXqMKLiCW o89IAKDQbzj+4qeC+xWfiyGNOuOYOtuE+gCfRker/L5W9CtDnZuLqWQ9rrcTDtU= =9THE -----END PGP SIGNATURE----- --Apple-Mail=_80ACAA30-EAC0-42D0-A2D2-B5437633CA4B-- From owner-svn-src-head@freebsd.org Wed Jan 17 13:25:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DBEBBE700CC; Wed, 17 Jan 2018 13:25:42 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7E1516ED90; Wed, 17 Jan 2018 13:25:42 +0000 (UTC) (envelope-from bapt@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AC1D27FDF; Wed, 17 Jan 2018 13:25:41 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0HDPfgm085370; Wed, 17 Jan 2018 13:25:41 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0HDPfXF085369; Wed, 17 Jan 2018 13:25:41 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201801171325.w0HDPfXF085369@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 17 Jan 2018 13:25:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328085 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 328085 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jan 2018 13:25:43 -0000 Author: bapt Date: Wed Jan 17 13:25:41 2018 New Revision: 328085 URL: https://svnweb.freebsd.org/changeset/base/328085 Log: Update pciids to 2018.01.14 MFC after: 3 days Modified: head/share/misc/pci_vendors Modified: head/share/misc/pci_vendors ============================================================================== --- head/share/misc/pci_vendors Wed Jan 17 13:19:37 2018 (r328084) +++ head/share/misc/pci_vendors Wed Jan 17 13:25:41 2018 (r328085) @@ -3,8 +3,8 @@ # # List of PCI ID's # -# Version: 2017.12.20 -# Date: 2017-12-20 03:15:01 +# Version: 2018.01.14 +# Date: 2018-01-14 03:15:02 # # Maintained by Albert Pool, Martin Mares, and other volunteers from # the PCI ID Project at http://pci-ids.ucw.cz/. @@ -44,6 +44,7 @@ # nee nCipher 0100 Thales e-Security 0123 General Dynamics +0128 Dell (wrong ID) # 018a is not LevelOne but there is a board misprogrammed 018a LevelOne 0106 FPC-0106TX misprogrammed [RTL81xx] @@ -752,7 +753,8 @@ 131b Kaveri [Radeon R4 Graphics] 131c Kaveri [Radeon R7 Graphics] 131d Kaveri [Radeon R6 Graphics] - 15dd Radeon Vega 8 Mobile + 15dd Vega [Radeon Vega 8 Mobile] + 15ff Vega [Radeon Vega 28 Mobile] 1714 BeaverCreek HDMI Audio [Radeon HD 6500D and 6400G-6600G series] 103c 168b ProBook 4535s 3150 RV380/M24 [Mobility Radeon X600] @@ -2270,6 +2272,7 @@ 67b9 Vesuvius [Radeon R9 295X2] 67be Hawaii LE 67c0 Ellesmere [Radeon Pro WX 7100] + 67c2 Ellesmere [Radeon Pro V7300X / V7350x2] 67c4 Ellesmere [Radeon Pro WX 7100] 1002 0336 Radeon Pro Duo 1002 1336 Radeon Pro Duo @@ -2277,6 +2280,7 @@ 67ca Ellesmere [Polaris10] 67cc Ellesmere [Polaris10] 67cf Ellesmere [Polaris10] + 67d0 Ellesmere [Radeon Pro V7300X / V7350x2] 67df Ellesmere [Radeon RX 470/480/570/580] 1002 0b37 Radeon RX 480 1043 04a8 Radeon RX 480 @@ -2296,13 +2300,13 @@ 1787 a470 Radeon RX 470 1787 a480 Radeon RX 480 1da2 e353 Sapphire Radeon RX 580 Pulse 8GB - 1da2 e366 Radeon RX 570 + 1da2 e366 Nitro+ Radeon RX 580 4GB 67e0 Baffin [Polaris11] 67e1 Baffin [Polaris11] 67e3 Baffin [Radeon Pro WX 4100] 67e8 Baffin [Polaris11] 67e9 Baffin [Polaris11] - 67eb Baffin [Polaris11] + 67eb Baffin [Radeon Pro V5300X] 67ef Baffin [Radeon RX 460/560D / Pro 450/455/460/560] 106b 0160 Radeon Pro 460 106b 0166 Radeon Pro 455 @@ -2346,6 +2350,7 @@ 1002 0b05 Radeon HD 8870 OEM 174b 8b04 Radeon HD 8860 6819 Pitcairn PRO [Radeon HD 7850 / R7 265 / R9 270 1024SP] + 1043 042c Radeon HD 7850 1682 7269 Radeon R9 270 1024SP 1682 9278 Radeon R9 270 1024SP 174b a008 Radeon R9 270 1024SP @@ -2508,9 +2513,14 @@ 144d c0c7 Radeon HD 7550M 6842 Thames LE [Radeon HD 7000M Series] 6843 Thames [Radeon HD 7670M] + 6860 Vega 10 [Radeon Instinct MI25] 6861 Vega 10 XT [Radeon PRO WX 9100] 6862 Vega 10 XT [Radeon PRO SSG] 6863 Vega 10 XTX [Radeon Vega Frontier Edition] + 6864 Vega + 6867 Vega + 6868 Vega + 686c Vega 10 [Radeon Instinct MI25 MxGPU] 687f Vega 10 XT [Radeon RX Vega 64] 6888 Cypress XT [FirePro V8800] 6889 Cypress PRO [FirePro V7800] @@ -3019,11 +3029,12 @@ 148c 9380 Radeon R9 380 # Make naming scheme consistent 174b e308 Radeon R9 380 Nitro 4G D5 + 694c Vega [Radeon RX Vega M] 6980 Polaris12 6981 Polaris12 6985 Lexa XT [Radeon PRO WX 3100] 6986 Polaris12 - 6987 Polaris12 + 6987 Lexa [Radeon E9171 MCM] 6995 Lexa XT [Radeon PRO WX 2100] 699f Lexa PRO [Radeon RX 550] 148c 2380 Lexa XL [Radeon RX 550] @@ -5448,10 +5459,11 @@ 1028 014e PCI7410,7510,7610 OHCI-Lynx Controller (Latitude D800) 802e PCI7x20 1394a-2000 OHCI Two-Port PHY/Link-Layer Controller 1028 018d Inspiron 700m/710m - 8031 PCIxx21/x515 Cardbus Controller + 8031 PCIxx21/PCIxx11/PCIx515 PC Card Controller 1025 0064 Extensa 3000 series laptop 1025 0080 Aspire 5024WLMi 103c 0934 Compaq nw8240/nx8220 + 103c 0944 Compaq nc6220 Notebook PC 103c 099c NX6110/NC6120 103c 308b MX6125 8032 OHCI Compliant IEEE 1394 Host Controller @@ -5460,19 +5472,22 @@ 103c 0934 Compaq nw8240/nx8220 103c 099c NX6110/NC6120 103c 308b MX6125 - 8033 PCIxx21 Integrated FlashMedia Controller + 8033 PCIxx21/PCIxx11 Flash Media Controller 1025 0064 Extensa 3000 series laptop 1025 0080 Aspire 5024WLMi 103c 0934 Compaq nw8240/nx8220 + 103c 0944 Compaq nc6220 Notebook PC 103c 099c NX6110/NC6120 103c 308b MX6125 - 8034 PCI6411/6421/6611/6621/7411/7421/7611/7621 Secure Digital Controller + 8034 PCIxx21/PCIxx11 SD Host Controller 1025 0080 Aspire 5024WLMi 103c 0934 Compaq nw8240/nx8220 + 103c 0944 Compaq nc6220 Notebook PC 103c 099c NX6110/NC6120 103c 308b MX6125 - 8035 PCI6411/6421/6611/6621/7411/7421/7611/7621 Smart Card Controller + 8035 PCIxx21/PCIxx11 Smart Card Controller 103c 0934 Compaq nw8240/nx8220 + 103c 0944 Compaq nc6220 Notebook PC 103c 099c NX6110/NC6120 8036 PCI6515 Cardbus Controller 8038 PCI6515 SmartCard Controller @@ -5486,7 +5501,7 @@ 103c 30a1 NC2400 103c 30a3 Compaq nw8440 104d 902d VAIO VGN-NR120E - 803b 5-in-1 Multimedia Card Reader (SD/MMC/MS/MS PRO/xD) + 803b PCIxx12 Flash Media Controller 103c 309f nx9420 103c 30a3 Compaq nw8440 104d 8212 VAIO VGN-N21E @@ -6255,6 +6270,10 @@ 8070 FastLinQ QL41000 Series 10/25/40/50GbE Controller 1077 0001 10GE 2P QL41162HxRJ-DE Adapter 1077 0002 10GE 2P QL41112HxCU-DE Adapter + 1077 0005 QLogic 4x10GE QL41164HMRJ CNA + 1077 0006 QLogic 4x10GE QL41164HMCU CNA + 1077 0007 QLogic 2x1GE+2x10GE QL41264HMCU CNA + 1077 0009 QLogic 2x1GE+2x10GE QL41162HMRJ CNA 1077 000b 25GE 2P QL41262HxCU-DE Adapter 1077 0011 FastLinQ QL41212H 25GbE Adapter 1077 0012 FastLinQ QL41112H 10GbE Adapter @@ -6265,19 +6284,34 @@ 8080 FastLinQ QL41000 Series 10/25/40/50GbE Controller (FCoE) 1077 0001 10GE 2P QL41162HxRJ-DE Adapter 1077 0002 10GE 2P QL41112HxCU-DE Adapter + 1077 0005 QLogic 4x10GE QL41164HMRJ CNA + 1077 0006 QLogic 4x10GE QL41164HMCU CNA + 1077 0007 QLogic 2x1GE+2x10GE QL41264HMCU CNA + 1077 0009 QLogic 2x1GE+2x10GE QL41162HMRJ CNA 1077 000b 25GE 2P QL41262HxCU-DE Adapter + 1077 000c QLogic 2x25GE QL41262HMCU CNA 1077 000d FastLinQ QL41262H 25GbE FCoE Adapter 1077 000e FastLinQ QL41162H 10GbE FCoE Adapter 8084 FastLinQ QL41000 Series 10/25/40/50GbE Controller (iSCSI) 1077 0001 10GE 2P QL41162HxRJ-DE Adapter 1077 0002 10GE 2P QL41112HxCU-DE Adapter + 1077 0005 QLogic 4x10GE QL41164HMRJ CNA + 1077 0006 QLogic 4x10GE QL41164HMCU CNA + 1077 0007 QLogic 2x25GE QL41262HMCU CNA + 1077 0009 QLogic 2x1GE+2x10GE QL41162HMRJ CNA 1077 000b 25GE 2P QL41262HxCU-DE Adapter + 1077 000c QLogic 2x25GE QL41262HMCU CNA 1077 000d FastLinQ QL41262H 25GbE iSCSI Adapter 1077 000e FastLinQ QL41162H 10GbE iSCSI Adapter 8090 FastLinQ QL41000 Series Gigabit Ethernet Controller (SR-IOV VF) 1077 0001 25GE 2P QL41262HxCU-DE Adapter 1077 0002 10GE 2P QL41112HxCU-DE Adapter + 1077 0005 QLogic 4x10GE QL41164HMRJ CNA + 1077 0006 QLogic 4x10GE QL41164HMCU CNA + 1077 0007 QLogic 2x1GE+2x10GE QL41264HMCU CNA + 1077 0009 QLogic 2x1GE+2x10GE QL41162HMRJ CNA 1077 000b 25GE 2P QL41262HxCU-DE Adapter + 1077 000c QLogic 2x25GE QL41262HMCU CNA 1077 000d FastLinQ QL41262H 25GbE FCoE Adapter (SR-IOV VF) 1077 000e FastLinQ QL41162H 10GbE iSCSI Adapter (SR-IOV VF) 1077 0011 FastLinQ QL41212H 25GbE Adapter (SR-IOV VF) @@ -10928,6 +10962,7 @@ 1bb7 GP104GLM [Quadro P4000 Mobile] 1462 11e9 Quadro P4000 Max-Q 1bb8 GP104GLM [Quadro P3000 Mobile] + 1bc7 GP104 [P104-101] 1be0 GP104M [GeForce GTX 1080 Mobile] 1028 07c0 GeForce GTX 1080 Max-Q 1458 355b GeForce GTX 1080 Max-Q @@ -10936,6 +10971,8 @@ 1c01 GP106 1c02 GP106 [GeForce GTX 1060 3GB] 1c03 GP106 [GeForce GTX 1060 6GB] + 1c04 GP106 [GeForce GTX 1060 5GB] + 1c06 GP106 [GeForce GTX 1060 6GB Rev. 2] 1c07 GP106 [P106-100] 1c09 GP106 [P106-090] 1c20 GP106M [GeForce GTX 1060 Mobile] @@ -10963,6 +11000,7 @@ 1cb3 GP107GL [Quadro P400] 1d01 GP108 [GeForce GT 1030] 1d10 GP108M [GeForce MX150] + 1d33 GP108GL [Quadro P500] 1d81 GV100 [TITAN V] 1db1 GV100 [Tesla V100 SXM2] 1db4 GV100 [Tesla V100 PCIe] @@ -10991,6 +11029,7 @@ e180 Proteus-X: LightPulse IOV Fibre Channel Host Adapter e200 LightPulse LPe16002 1014 03f1 PCIe2 16 Gb 2-port Fibre Channel Adapter (FC EL5B; CCIN 577F) + 10df e282 Flex System FC5054 4-port 16Gb FC Adapter e208 LightPulse 16Gb Fibre Channel Host Adapter (Lancer-VF) e220 OneConnect NIC (Lancer) 17aa 1054 ThinkServer LPm16002B-M6-L AnyFabric @@ -11165,13 +11204,14 @@ 8129 RTL-8129 10ec 8129 RT8129 Fast Ethernet Adapter 11ec 8129 RTL8111/8168 PCIe Gigabit Ethernet (misconfigured) - 8136 RTL8101/2/6E PCI Express Fast Ethernet controller + 8136 RTL810xE PCI Express Fast Ethernet controller 103c 1985 RTL8106E on Pavilion 17-e163sg Notebook PC 103c 2a8c Compaq 500B Microtower 103c 2ab1 Pavilion p6774 103c 30cc Pavilion dv6700 1179 ff64 RTL8102E PCI-E Fast Ethernet NIC 17c0 1053 RTL8101e Medion WIM 2210 Notebook PC [MD96850] + 8137 RTL8104E PCIe Fast Ethernet Controller 8138 RT8139 (B/C) Cardbus Fast Ethernet Adapter 10ec 8138 RT8139 (B/C) Fast Ethernet Adapter 8139 RTL-8100/8101L/8139 PCI Fast Ethernet Adapter @@ -14092,20 +14132,49 @@ 0043 RocketPort Infinity 16port, External Interface 0044 RocketPort Infinity Quad, 4port, DB 0045 RocketPort Infinity Octa, 8port, DB + 0046 RocketPort INFINITY 4-port w/external I/F 0047 RocketPort Infinity 4port, RJ45 + 0048 RocketPort INFINITY 4J (4-port) w/RJ45 connectors + 004a RocketPort INFINITY Plus 4-port + 004b RocketPort INFINITY Plus 8-port + 004c RocketModem INFINITY III 8-port + 004d RocketModem INFINITY III 4-port + 004e RocketPort INFINITY Plus 2-port 004f RocketPort Infinity 2port, SMPTE + 0050 RocketPort INFINITY Plus 4-port RJ45 + 0051 RocketPort INFINITY Plus 8-port RJ11 0052 RocketPort Infinity Octa, 8port, SMPTE - 0801 RocketPort UPCI 32 port w/external I/F - 0802 RocketPort UPCI 8 port w/external I/F - 0803 RocketPort UPCI 16 port w/external I/F - 0805 RocketPort UPCI 8 port w/octa cable - 080c RocketModem III 8 port - 080d RocketModem III 4 port - 0810 RocketPort UPCI Plus 4 port RS232 - 0811 RocketPort UPCI Plus 8 port RS232 - 0812 RocketPort UPCI Plus 8 port RS422 + 0060 RocketPort EXPRESS 8-port w/Octa Cable + 0061 RocketPort EXPRESS 32-port w/external I/F + 0062 RocketPort EXPRESS 8-Port w/external I/F + 0063 RocketPort EXPRESS 16-port w/external I/F + 0064 RocketPort EXPRESS 4-port w/Quad Cable + 0065 RocketPort EXPRESS 8-port w/Octa Cable + 0066 RocketPort EXPRESS 4-port w/external I/F + 0067 RocketPort EXPRESS 4J (4-port) w/RJ45 connectors + 0068 RocketPort EXPRESS 8J (8-port) w/RJ11 connectors + 006f RocketPort EXPRESS SMPTE 2-port + 0072 RocketPort EXPRESS SMPTE 8-port w/external I/F + 0801 RocketPort uPCI 32-port w/external I/F + 0802 RocketPort uPCI 8-port w/external I/F + 0803 RocketPort uPCI 16-port w/external I/F + 0805 RocketPort uPCI 8-port w/Octa Cable + 080b RocketPort Plus uPCI 8-port w/Octa Cable + 080c RocketModem III 8-port + 080d RcoketModem III 4-port + 080e RocketPort uPCI 2-port RS232 w/DB9 connectors + 080f RocketPort uPCI SMPTE 2-port + 0810 RocketPort Plus uPCI 4J (4-port) w/RJ45 connectors + 0811 RocketPort Plus uPCI 8J (8-port) w/RJ11 connectors + 0812 RocketPort Plus uPCI 422 8-port + 0813 RocketModem IV uPCI 8-port + 0814 RocketModem IV uPCI 4-port 0903 RocketPort Compact PCI 16 port w/external I/F - 8015 RocketPort 4-port UART 16954 +# 16954 UART + 8015 RocketPort 550 4-port + 8805 RocketPort uPCI 4-port w/Quad Cable + 880b RocketPort Plus uPCI 4-port w/Quad Cable + 8812 RocketPort Plus uPCI 4-port RS422 w/Quad Cable 11ff Scion Corporation 0003 AG-5 1200 CSS Corporation @@ -16329,6 +16398,7 @@ 50a9 T580-50A9 Unified Wire Ethernet Controller 50aa T580-50AA Unified Wire Ethernet Controller 50ab T520-50AB Unified Wire Ethernet Controller + 50ac T540-50AC Unified Wire Ethernet Controller 5401 T520-CR Unified Wire Ethernet Controller 5402 T522-CR Unified Wire Ethernet Controller 5403 T540-CR Unified Wire Ethernet Controller @@ -16391,6 +16461,7 @@ 54a9 T580-50A9 Unified Wire Ethernet Controller 54aa T580-50AA Unified Wire Ethernet Controller 54ab T520-50AB Unified Wire Ethernet Controller + 54ac T540-50AC Unified Wire Ethernet Controller 5501 T520-CR Unified Wire Storage Controller 5502 T522-CR Unified Wire Storage Controller 5503 T540-CR Unified Wire Storage Controller @@ -16451,6 +16522,9 @@ 55a7 T580-50A7 Unified Wire Storage Controller 55a8 T580-50A8 Unified Wire Storage Controller 55a9 T580-50A9 Unified Wire Storage Controller + 55aa T580-50AA Unified Wire Storage Controller + 55ab T520-50AB Unified Wire Storage Controller + 55ac T540-50AC Unified Wire Storage Controller 5601 T520-CR Unified Wire Storage Controller 5602 T522-CR Unified Wire Storage Controller 5603 T540-CR Unified Wire Storage Controller @@ -16513,6 +16587,7 @@ 56a9 T580-50A9 Unified Wire Storage Controller 56aa T580-50AA Unified Wire Storage Controller 56ab T520-50AB Unified Wire Storage Controller + 56ac T540-50AC Unified Wire Storage Controller 5701 T520-CR Unified Wire Ethernet Controller 5702 T522-CR Unified Wire Ethernet Controller 5703 T540-CR Unified Wire Ethernet Controller @@ -16614,6 +16689,7 @@ 58a9 T580-50A9 Unified Wire Ethernet Controller [VF] 58aa T580-50AA Unified Wire Ethernet Controller [VF] 58ab T520-50AB Unified Wire Ethernet Controller [VF] + 58ac T540-50AC Unified Wire Ethernet Controller [VF] 6001 T6225-CR Unified Wire Ethernet Controller 6002 T6225-SO-CR Unified Wire Ethernet Controller 6003 T6425-CR Unified Wire Ethernet Controller @@ -16634,6 +16710,7 @@ 6084 T64100-6084 Unified Wire Ethernet Controller 6085 T6240-6085 Unified Wire Ethernet Controller 6086 T6225-6086 Unified Wire Ethernet Controller + 6087 T6225-6087 Unified Wire Ethernet Controller 6401 T6225-CR Unified Wire Ethernet Controller 6402 T6225-SO-CR Unified Wire Ethernet Controller 6403 T6425-CR Unified Wire Ethernet Controller @@ -16654,6 +16731,7 @@ 6484 T64100-6084 Unified Wire Ethernet Controller 6485 T6240-6085 Unified Wire Ethernet Controller 6486 T6225-6086 Unified Wire Ethernet Controller + 6487 T6225-6087 Unified Wire Ethernet Controller 6501 T6225-CR Unified Wire Storage Controller 6502 T6225-SO-CR Unified Wire Storage Controller 6503 T6425-CR Unified Wire Storage Controller @@ -16674,6 +16752,7 @@ 6584 T64100-6084 Unified Wire Storage Controller 6585 T6240-6085 Unified Wire Storage Controller 6586 T6225-6086 Unified Wire Storage Controller + 6587 T6225-6087 Unified Wire Storage Controller 6601 T6225-CR Unified Wire Storage Controller 6602 T6225-SO-CR Unified Wire Storage Controller 6603 T6425-CR Unified Wire Storage Controller @@ -16694,6 +16773,7 @@ 6684 T64100-6084 Unified Wire Storage Controller 6685 T6240-6085 Unified Wire Storage Controller 6686 T6225-6086 Unified Wire Storage Controller + 6687 T6225-6087 Unified Wire Storage Controller 6801 T6225-CR Unified Wire Ethernet Controller [VF] 6802 T6225-SO-CR Unified Wire Ethernet Controller [VF] 6803 T6425-CR Unified Wire Ethernet Controller [VF] @@ -16714,6 +16794,7 @@ 6884 T64100-6084 Unified Wire Ethernet Controller [VF] 6885 T6240-6085 Unified Wire Ethernet Controller [VF] 6886 T6225-6086 Unified Wire Ethernet Controller [VF] + 6887 T6225-6087 Unified Wire Ethernet Controller [VF] a000 PE10K Unified Wire Ethernet Controller 1426 Storage Technology Corp. 1427 Better On-Line Solutions @@ -17225,6 +17306,7 @@ 103c 169d Ethernet 1Gb 4-port 331FLR Adapter 103c 22be Ethernet 1Gb 4-port 331i Adapter 103c 3383 Ethernet 1Gb 4-port 331T Adapter + 14e4 1904 4-port 1Gb Ethernet Adapter 1659 NetXtreme BCM5721 Gigabit Ethernet PCI Express 1014 02c6 eServer xSeries server mainboard 1028 01e6 PowerEdge 860 @@ -17296,6 +17378,7 @@ 1014 0577 ThinkPad X41 / Z60t 103c 0934 nx8220 103c 0940 Compaq nw8240 Mobile Workstation + 103c 0944 Compaq nc6220 Notebook PC 17aa 2081 ThinkPad R60e 167e NetXtreme BCM5751F Fast Ethernet PCI Express 167f NetLink BCM5787F Fast Ethernet PCI Express @@ -18445,9 +18528,11 @@ 024f MT53100 [Spectrum-2, Flash recovery mode] 0262 MT27710 [ConnectX-4 Lx Programmable] EN 0263 MT27710 [ConnectX-4 Lx Programmable Virtual Function] EN + 0264 Innova-2 Flex Burn image 0281 NPS-600 Flash Recovery 1002 MT25400 Family [ConnectX-2 Virtual Function] 1003 MT27500 Family [ConnectX-3] + 1014 04b5 PCIe3 40GbE RoCE Converged Host Bus Adapter for Power 103c 1777 InfiniBand FDR/EN 10/40Gb Dual Port 544FLR-QSFP Adapter (Rev Cx) 103c 17c9 Infiniband QDR/Ethernet 10Gb 2-port 544i Adapter 103c 18ce InfiniBand QDR/EN 10Gb Dual Port 544M Adapter @@ -18493,6 +18578,7 @@ 1011 MT27600 [Connect-IB] 1012 MT27600 Family [Connect-IB Virtual Function] 1013 MT27700 Family [ConnectX-4] + 1014 04f7 PCIe3 2-port 100 GbE (NIC and RoCE) QSFP28 Adapter for Power 15b3 0003 Mellanox Technologies ConnectX-4 Stand-up single-port 40GbE MCX413A-BCAT 15b3 0005 Mellanox Technologies ConnectX-4 Stand-up single-port 40GbE MCX415A-BCAT 15b3 0006 MCX416A-BCAT, ConnectX-4 EN, 40/56GbE 2P, PCIe3.0 x16 @@ -18538,6 +18624,7 @@ 6372 MT25408 [ConnectX EN 10GigE 10GBaseT, PCIe 2.0 2.5GT/s] 6732 MT26418 [ConnectX VPI PCIe 2.0 5GT/s - IB DDR / 10GigE] 673c MT26428 [ConnectX VPI PCIe 2.0 5GT/s - IB QDR / 10GigE] + 1014 0415 PCIe2 2-port 4X InfiniBand QDR Adapter for Power 1014 0487 GX++ 1-port 4X IB QDR Adapter for Power 795 103c 1782 4X QDR InfiniBand Mezzanine HCA for c-Class BladeSystem 15b3 0021 HP InfiniBand 4X QDR CX-2 PCI-e G2 Dual Port HCA @@ -18560,7 +18647,7 @@ 7121 NPS-600 configuration and management interface 7122 NPS-600 network interface PF 7123 NPS-600 network interface VF - 8200 Innova-2 FPGA + 8200 Innova-2 Flex Shell Logic a2d0 MT416842 BlueField SoC Crypto enabled a2d1 MT416842 BlueField SoC Crypto disabled a2d2 MT416842 BlueField integrated ConnectX-5 network controller @@ -19057,6 +19144,7 @@ 0777 4005 SR71-15 802.11an Mini PCI Adapter 1186 3a7a DWA-552 802.11n Xtreme N Desktop Adapter (rev A2) 1186 3a7d DWA-552 802.11n Xtreme N Desktop Adapter (rev A3) + 168c 0029 AR922X Wireless Network Adapter 168c 2096 Compex WLM200NX / Wistron DNMA-92 002a AR928X Wireless Network Adapter (PCI-Express) 0777 4f05 SR71-X 802.11abgn Wireless ExpressCard Adapter [AR9280] @@ -19241,17 +19329,23 @@ 7012 AP440-2: 32-Channel Isolated Digital Input Module 7013 AP440-3: 32-Channel Isolated Digital Input Module 7014 AP445: 32-Channel Isolated Digital Output Module + 7015 AP471 48-Channel TTL Level Digital Input/Output Module 7016 AP470 48-Channel TTL Level Digital Input/Output Module 7017 AP323 16-bit, 20 or 40 Channel Analog Input Module 7018 AP408: 32-Channel Digital I/O Module 7019 AP341 14-bit, 16-Channel Simultaneous Conversion Analog Input Module 701a AP220-16 12-Bit, 16-Channel Analog Output Module 701b AP231-16 16-Bit, 16-Channel Analog Output Module + 701c AP225 12-Bit, 16-Channel Analog Output Module with Waveform Memory + 701d AP235 16-Bit, 16-Channel Analog Output Module with Waveform Memory 7021 APA7-201 Reconfigurable Artix-7 FPGA module 48 TTL channels 7022 APA7-202 Reconfigurable Artix-7 FPGA module 24 RS485 channels 7023 APA7-203 Reconfigurable Artix-7 FPGA module 24 TTL & 12 RS485 channels 7024 APA7-204 Reconfigurable Artix-7 FPGA module 24 LVDS channels 7027 AP418 16-Channel High Voltage Digital Input/Output Module + 7029 AP342 14-bit, 12-Channel Isolated Simultaneous Conversion Analog Input Module + 702a AP226 12-Bit, 8-Channel Isolated Analog Output Module + 702b AP236 16-Bit, 8-Channel Isolated Analog Output Module 7042 AP482 Counter Timer Module with TTL Level Input/Output 7043 AP483 Counter Timer Module with TTL Level and RS422 Input/Output 7044 AP484 Counter Timer Module with RS422 Input/Output @@ -20137,6 +20231,7 @@ 000c Qualcomm MSM6275 UMTS chip 1932 DiBcom 193c MAXIM Integrated Products +193d Hangzhou H3C Technologies Co., Ltd. 193f AHA Products Group 0001 AHA36x-PCIX 0360 AHA360-PCIe @@ -20779,6 +20874,8 @@ 1bbf Maxeler Technologies Ltd. 0003 MAX3 0004 MAX4 +1bcf NEC Corporation + 001c Vector Engine 1.0 1bd0 Astronics Corporation 1001 Mx5 PMC/XMC Databus Interface Card 1002 PM1553-5 (PC/104+ MIL-STD-1553 Interface Card) @@ -20962,7 +21059,13 @@ 1d65 Imagine Communications Corp. 04de Taurus/McKinley 1d6a Aquantia Corp. + 07b1 AQC107 NBase-T/IEEE 802.3bz Ethernet Controller [AQtion] + 08b1 AQC108 NBase-T/IEEE 802.3bz Ethernet Controller [AQtion] + 11b1 AQC111 NBase-T/IEEE 802.3bz Ethernet Controller [AQtion] + 12b1 AQC112 NBase-T/IEEE 802.3bz Ethernet Controller [AQtion] + 87b1 AQC107 NBase-T/IEEE 802.3bz Ethernet Controller [AQtion] d107 AQC107 NBase-T/IEEE 802.3bz Ethernet Controller [AQtion] + d108 AQC108 NBase-T/IEEE 802.3bz Ethernet Controller [AQtion] 1d6c Atomic Rules LLC 1001 A5PL-E1 1002 A5PL-E7 @@ -20986,6 +21089,35 @@ 1d87 Fuzhou Rockchip Electronics Co., Ltd 1d8f Enyx 1d94 Chengdu Higon IC Design Co.Ltd + 1450 Root Complex + 1451 I/O Memory Management Unit + 1452 PCIe Dummy Host Bridge + 1453 PCIE GPP Bridge + 1454 Internal PCIe GPP Bridge 0 to Bus B + 1455 PCIe Dummy Function + 1456 PSPCCP Command DMA Processor + 1458 10 Gb Ethernet Controller Port 0/Port1 + 1459 10 Gb Ethernet Controller Port 2/Port3 + 145a PCIe Dummy Function + 145b PCIE Non-Transparent Bridge + 145c USB3 XHCI + 145d Switch upstream in PCIe + 145e Switch downstream in PCIe + 145f USB 3.0 Host controller + 1460 Data Fabric: Device 18h; Function 0 + 1461 Data Fabric: Device 18h; Function 1 + 1462 Data Fabric: Device 18h; Function 2 + 1463 Data Fabric: Device 18h; Function 3 + 1464 Data Fabric: Device 18h; Function 4 + 1465 Data Fabric: Device 18h; Function 5 + 1466 Data Fabric: Device 18h; Function 6 + 1467 Data Fabric: Device 18h; Function 7 + 1468 NTBCCP + 7901 FCH SATA Controller [AHCI mode] + 7904 FCH SATA Controller [AHCI mode] + 7906 FCH SD Flash Controller + 790b FCH SMBus Controller + 790e FCH LPC Bridge 1d95 Graphcore Ltd 1da1 Teko Telecom S.r.l. 1da2 Sapphire Technology Limited @@ -20997,6 +21129,16 @@ 1de5 Eideticom, Inc 1000 IO Memory Controller 2000 NoLoad Hardware Development Kit +1def Ampere Computing, LLC + e005 Skylark PCI Express Root Port 0 [X-Gene 3] + e006 Skylark PCI Express Root Port 1 [X-Gene 3] + e007 Skylark PCI Express Root Port 2 [X-Gene 3] + e008 Skylark PCI Express Root Port 3 [X-Gene 3] + e009 Skylark PCI Express Root Port 4 [X-Gene 3] + e00a Skylark PCI Express Root Port 5 [X-Gene 3] + e00b Skylark PCI Express Root Port 6 [X-Gene 3] + e00c Skylark PCI Express Root Port 7 [X-Gene 3] +1df7 opencpi.org # nee Tumsan Oy 1fc0 Ascom (Finland) Oy 0300 E2200 Dual E1/Rawpipe Card @@ -21711,6 +21853,8 @@ 3000 HD-3000 5500 HD5500 HDTV 7284 HT OMEGA Inc. +7357 IOxOS Technologies SA + 7910 7910 [Althea] 7401 EndRun Technologies e100 PTP3100 PCIe PTP Slave Clock 7470 TP-LINK Technologies Co., Ltd. @@ -24473,6 +24617,7 @@ 1028 040a Latitude E6410 1028 040b Latitude E6510 103c 0934 Compaq nw8240 Mobile Workstation + 103c 0944 Compaq nc6220 Notebook PC 103c 099c NX6110/NC6120 103c 309f Compaq nx9420 Notebook 103c 30a3 Compaq nw8440 @@ -25140,6 +25285,7 @@ 1014 0575 ThinkPad X41 / Z60t 1028 0182 Latitude C610 103c 0934 Compaq nw8240/nx8220 + 103c 0944 Compaq nc6220 Notebook PC 103c 099c NX6110/NC6120 104d 81b7 Vaio VGN-S3XP a304 81b7 Vaio VGN-S3XP @@ -25324,6 +25470,7 @@ 2641 82801FBM (ICH6M) LPC Interface Bridge 1014 0568 ThinkPad X41 103c 0934 Compaq nw8240/nx8220 + 103c 0944 Compaq nc6220 Notebook PC 103c 099c NX6110/NC6120 2642 82801FW/FRW (ICH6W/ICH6RW) LPC Interface Bridge 2651 82801FB/FW (ICH6/ICH6W) SATA Controller @@ -25344,6 +25491,7 @@ 1028 0177 Dimension 8400 1028 0179 Optiplex GX280 103c 0934 Compaq nw8240/nx8220 + 103c 0944 Compaq nc6220 Notebook PC 103c 099c NX6110/NC6120 1043 80a6 P5GD1-VW Mainboard 1458 2558 GA-8I915ME-G Mainboard @@ -25357,6 +25505,7 @@ 1028 0177 Dimension 8400 1028 0179 Optiplex GX280 103c 0934 Compaq nw8240/nx8220 + 103c 0944 Compaq nc6220 Notebook PC 103c 099c NX6110/NC6120 1043 80a6 P5GD1-VW Mainboard 1458 2659 GA-8I915ME-G Mainboard @@ -25370,6 +25519,7 @@ 1028 0177 Dimension 8400 1028 0179 Optiplex GX280 103c 0934 Compaq nw8240/nx8220 + 103c 0944 Compaq nc6220 Notebook PC 103c 099c NX6110/NC6120 1043 80a6 P5GD1-VW Mainboard 1458 265a GA-8I915ME-G Mainboard @@ -25395,6 +25545,7 @@ 1028 0177 Dimension 8400 1028 0179 Optiplex GX280 103c 0934 Compaq nw8240/nx8220 + 103c 0944 Compaq nc6220 Notebook PC 103c 099c NX6110/NC6120 1043 80a6 P5GD1-VW Mainboard 1458 5006 GA-8I915ME-G Mainboard @@ -25406,12 +25557,14 @@ e4bf 58b1 XB1 2660 82801FB/FBM/FR/FW/FRW (ICH6 Family) PCI Express Port 1 103c 0934 Compaq nw8240 Mobile Workstation + 103c 0944 Compaq nc6220 Notebook PC 103c 099c NX6110/NC6120 e4bf 0ccd CCD-CALYPSO e4bf 0cd3 CD3-JIVE e4bf 58b1 XB1 2662 82801FB/FBM/FR/FW/FRW (ICH6 Family) PCI Express Port 2 103c 0934 Compaq nw8240 Mobile Workstation + 103c 0944 Compaq nc6220 Notebook PC e4bf 0ccd CCD-CALYPSO e4bf 0cd3 CD3-JIVE e4bf 58b1 XB1 @@ -25465,6 +25618,7 @@ 266f 82801FB/FBM/FR/FW/FRW (ICH6 Family) IDE Controller 1028 0177 Dimension 8400 103c 0934 Compaq nw8240/nx8220 + 103c 0944 Compaq nc6220 Notebook PC 103c 099c NX6110/NC6120 1043 80a6 P5GD1-VW Mainboard 1458 266f GA-8I915ME-G Mainboard @@ -25573,6 +25727,7 @@ 2792 Mobile 915GM/GMS/910GML Express Graphics Controller 1014 0582 ThinkPad X41 103c 099c NX6110/NC6120 + 103c 308a Compaq nc6220 Notebook PC 1043 1881 GMA 900 915GM Integrated Graphics e4bf 0ccd CCD-CALYPSO e4bf 0cd3 CD3-JIVE @@ -27603,7 +27758,7 @@ 4117 Atom Processor E6xx PCI Host Bridge #4 4220 PRO/Wireless 2200BG [Calexico2] Network Connection 103c 0934 Compaq nw8240/nx8220 - 103c 12f6 nc6120/nx8220/nw8240 + 103c 12f6 nc6120/nc6220/nw8240/nx8220 8086 2701 WM3B2200BG Mini-PCI Card 8086 2712 IBM ThinkPad R50e 8086 2721 Dell B130 laptop integrated WLAN @@ -27751,9 +27906,11 @@ 590f Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM Registers 5910 Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM Registers 5912 HD Graphics 630 + 5914 Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM Registers 5916 HD Graphics 620 17aa 2248 ThinkPad T570 17aa 224f ThinkPad X1 Carbon 5th Gen + 5917 UHD Graphics 620 591d HD Graphics P630 591f Intel Kaby Lake Host Bridge 5a84 Celeron N3350/Pentium N4200/Atom E3900 Series Integrated Graphics Controller @@ -28170,6 +28327,8 @@ 8c26 8 Series/C220 Series Chipset Family USB EHCI #1 103c 1909 ZBook 15 17aa 220e ThinkPad T440p + 17aa 2210 ThinkPad T540p + 2210 17aa ThinkPad T540p 8c2d 8 Series/C220 Series Chipset Family USB EHCI #2 103c 1909 ZBook 15 17aa 220e ThinkPad T440p @@ -29284,8 +29443,8 @@ bdbd Blackmagic Design a124 Intensity Extreme a126 Intensity Shuttle a127 UltraStudio Express - a129 UltraStudio Mini Monitor - a12a UltraStudio Mini Recorder + a129 UltraStudio Mini Recorder + a12a UltraStudio Mini Monitor a12d UltraStudio 4K a12e DeckLink 4K Extreme a12f DeckLink Mini Monitor @@ -29300,6 +29459,11 @@ bdbd Blackmagic Design a13e UltraStudio 4K Extreme a13f DeckLink Quad 2 a140 DeckLink Duo 2 + a141 UltraStudio 4K Extreme 3 + a142 UltraStudio HD Mini + a143 DeckLink Mini Recorder 4K + a144 DeckLink Mini Monitor 4K + a14b DeckLink 8K Pro c001 TSI Telsys c0a9 Micron/Crucial Technology c0de Motorola From owner-svn-src-head@freebsd.org Wed Jan 17 15:12:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10222E76125; Wed, 17 Jan 2018 15:12:22 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (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 E98CC73935; Wed, 17 Jan 2018 15:12:21 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from comporellon.tachypleus.net (cpe-75-82-218-62.socal.res.rr.com [75.82.218.62]) (authenticated bits=0) by c.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id w0HFCIfm023900 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Wed, 17 Jan 2018 07:12:19 -0800 Subject: Re: svn commit: r328078 - head/sys/powerpc/conf To: Wojciech Macek , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201801170933.w0H9XHu1085819@repo.freebsd.org> From: Nathan Whitehorn Message-ID: Date: Wed, 17 Jan 2018 07:12:18 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <201801170933.w0H9XHu1085819@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Sonic-CAuth: UmFuZG9tSVZiPdUDf452z4PyoskJ+a0231ZGgh4gRMRUqV6msMYKiX9QuddbXZEe0uvENDelc4e3lxCDS6BJMphHxzP0dnSzSM4pcE4oQSo= X-Sonic-ID: C;cKU9z5j75xGv5dzi2dYaJA== M;XO6Zz5j75xGv5dzi2dYaJA== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jan 2018 15:12:22 -0000 Please revert the AHCI removal. It works just fine on big-endian hardware and has for a long time -- I think the problem may be limited to you specific hardware. -Nathan On 01/17/18 01:33, Wojciech Macek wrote: > Author: wma > Date: Wed Jan 17 09:33:16 2018 > New Revision: 328078 > URL: https://svnweb.freebsd.org/changeset/base/328078 > > Log: > PPC64: add CXGBE and remove AHCI from GENERIC64 > > Add CXGBE driver which is required for PowerNV system. > Also, remove AHCI which does not work in BigEndian. > > Created by: Wojciech Macek > Obtained from: Semihalf > Sponsored by: QCM Technologies > > Modified: > head/sys/powerpc/conf/GENERIC64 > > Modified: head/sys/powerpc/conf/GENERIC64 > ============================================================================== > --- head/sys/powerpc/conf/GENERIC64 Wed Jan 17 08:01:51 2018 (r328077) > +++ head/sys/powerpc/conf/GENERIC64 Wed Jan 17 09:33:16 2018 (r328078) > @@ -107,7 +107,7 @@ options PCI_HP # PCI-Express native HotPlug > device agp > > # ATA controllers > -device ahci # AHCI-compatible SATA controllers > +#device ahci # AHCI-compatible SATA controllers > device ata # Legacy ATA/SATA controllers > device mvs # Marvell 88SX50XX/88SX60XX/88SX70XX/SoC SATA > device siis # SiliconImage SiI3124/SiI3132/SiI3531 SATA > @@ -143,6 +143,7 @@ device ix # Intel PRO/10GbE PCIE PF Ethernet Family > device ixv # Intel PRO/10GbE PCIE VF Ethernet Family > device glc # Sony Playstation 3 Ethernet > device llan # IBM pSeries Virtual Ethernet > +device cxgbe # Chelsio 10/25G NIC > > # PCI Ethernet NICs that use the common MII bus controller code. > device miibus # MII bus support > From owner-svn-src-head@freebsd.org Wed Jan 17 15:41:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48729E777A8; Wed, 17 Jan 2018 15:41:42 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-pg0-x231.google.com (mail-pg0-x231.google.com [IPv6:2607:f8b0:400e:c05::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 14A8974BC3; Wed, 17 Jan 2018 15:41:42 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: by mail-pg0-x231.google.com with SMTP id s9so9633146pgq.13; Wed, 17 Jan 2018 07:41:42 -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:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=C+/ZBvdOSSHJE9Vby+SeSlrI5oUhNkBaHwOvxOHuZhY=; b=ITWZDeQzT/ra+xNrkhYecbeCmqm1G/XoIp408r8IylWLCpws3u6KrtTQmQEEjXxORO nGgOhjhkswZHQZ37jCGjbYq8NrXp8lPbvJTEsMNenyNupzIToMh3Mi0Jk4thAQMbiHRa C6qC8XZ6KtzUGt/EDrU3fvXHqNOa43/C0781CY3zYNaQ8N3T6Na6DaouR7l2EgxoY9NM 4uhZ5KWrLOwXRn3K9oxlMq6+aZTGoOlxO3WHkc6cdF+BggnsKqgXOI2Roat/IHwLu0ZZ x5Gtia1DSYvwj2p/lAOa6snOJkwl1jn/pSxRpdjW6prRTM6xMCgUoGdv6lPPVjiGXNST yIUQ== 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 :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=C+/ZBvdOSSHJE9Vby+SeSlrI5oUhNkBaHwOvxOHuZhY=; b=sXmdBW/GYPzL64q22Pok8erMBJ1wMq83rbMUDjewB/nUfMY45evNvCury0cI/ZA4Ct nMZ2dsQeF0FfGm8RiVpj08Bz7OeVpHKUXx8Wl2hjPODeYEh2/AnyL5pZMK17LNpeGL47 VYTYx/D5ieWNNFEcJbjmbpINkBZ3oA+eHM1pjg467cp3hWD3mRugn26yUk41EpSIptGU +uftXuWQFuYiGO8FHoaHNYiALih0+SxV9Ld75mnQheHZss58GJaNbtVrztQkJF7Jq8JH Oo9lsgM8VDCGDpMsh/HFfGno+qbA/pR7woKpJ4A3DARjVat5O6eAxSJ7AOJSAdlIwnll k5sQ== X-Gm-Message-State: AKGB3mLIBSREj5qSUjVhrfCHF3Jp8fZtSiyyRrQcLH9zmQvYm6bEMyZg bDxKqeU2xggySzTCA3RoXHSiSQ== X-Google-Smtp-Source: ACJfBoueYLiwXfnDe7IE8B4GN2JSeaW2oDKtPinkuxCfJKtrpTEm9V8X2yW8+XhcHGUV8ovvavS+eQ== X-Received: by 10.99.185.70 with SMTP id v6mr34154872pgo.112.1516203701402; Wed, 17 Jan 2018 07:41:41 -0800 (PST) Received: from ox ([2601:641:c000:b800:29e6:295f:b8e0:a35f]) by smtp.gmail.com with ESMTPSA id g6sm8049163pgr.60.2018.01.17.07.41.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Jan 2018 07:41:40 -0800 (PST) Sender: Navdeep Parhar Date: Wed, 17 Jan 2018 07:41:35 -0800 From: Navdeep Parhar To: Wojciech Macek Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r328078 - head/sys/powerpc/conf Message-ID: <20180117154135.GA30476@ox> Mail-Followup-To: Wojciech Macek , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201801170933.w0H9XHu1085819@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201801170933.w0H9XHu1085819@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jan 2018 15:41:42 -0000 On Wed, Jan 17, 2018 at 09:33:17AM +0000, Wojciech Macek wrote: > Author: wma > Date: Wed Jan 17 09:33:16 2018 > New Revision: 328078 > URL: https://svnweb.freebsd.org/changeset/base/328078 > > Log: > PPC64: add CXGBE and remove AHCI from GENERIC64 > > Add CXGBE driver which is required for PowerNV system. I wonder why this is required. Are there any problems in building and using it as a loadable module? Regards, Navdeep > Also, remove AHCI which does not work in BigEndian. > > Created by: Wojciech Macek > Obtained from: Semihalf > Sponsored by: QCM Technologies > > Modified: > head/sys/powerpc/conf/GENERIC64 > > Modified: head/sys/powerpc/conf/GENERIC64 > ============================================================================== > --- head/sys/powerpc/conf/GENERIC64 Wed Jan 17 08:01:51 2018 (r328077) > +++ head/sys/powerpc/conf/GENERIC64 Wed Jan 17 09:33:16 2018 (r328078) > @@ -107,7 +107,7 @@ options PCI_HP # PCI-Express native HotPlug > device agp > > # ATA controllers > -device ahci # AHCI-compatible SATA controllers > +#device ahci # AHCI-compatible SATA controllers > device ata # Legacy ATA/SATA controllers > device mvs # Marvell 88SX50XX/88SX60XX/88SX70XX/SoC SATA > device siis # SiliconImage SiI3124/SiI3132/SiI3531 SATA > @@ -143,6 +143,7 @@ device ix # Intel PRO/10GbE PCIE PF Ethernet Family > device ixv # Intel PRO/10GbE PCIE VF Ethernet Family > device glc # Sony Playstation 3 Ethernet > device llan # IBM pSeries Virtual Ethernet > +device cxgbe # Chelsio 10/25G NIC > > # PCI Ethernet NICs that use the common MII bus controller code. > device miibus # MII bus support > From owner-svn-src-head@freebsd.org Wed Jan 17 16:41:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE225E7A438; Wed, 17 Jan 2018 16:41:23 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 98ACE76EE3; Wed, 17 Jan 2018 16:41:23 +0000 (UTC) (envelope-from fabient@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E8D7811F31; Wed, 17 Jan 2018 16:41:22 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0HGfMVH068528; Wed, 17 Jan 2018 16:41:22 GMT (envelope-from fabient@FreeBSD.org) Received: (from fabient@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0HGfMhH068525; Wed, 17 Jan 2018 16:41:22 GMT (envelope-from fabient@FreeBSD.org) Message-Id: <201801171641.w0HGfMhH068525@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fabient set sender to fabient@FreeBSD.org using -f From: Fabien Thomas Date: Wed, 17 Jan 2018 16:41:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328087 - in head: lib/libpmc sys/dev/hwpmc X-SVN-Group: head X-SVN-Commit-Author: fabient X-SVN-Commit-Paths: in head: lib/libpmc sys/dev/hwpmc X-SVN-Commit-Revision: 328087 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jan 2018 16:41:23 -0000 Author: fabient Date: Wed Jan 17 16:41:22 2018 New Revision: 328087 URL: https://svnweb.freebsd.org/changeset/base/328087 Log: Fix pmcstat exit from kernel introduced by r325275. pmcstat request for close will generate a close event. This event will be in turn received by pmcstat to close the file. Reviewed by: kib Tested by: pho MFC after: 1 week Sponsored by: Stormshield Modified: head/lib/libpmc/pmclog.c head/sys/dev/hwpmc/hwpmc_logging.c head/sys/dev/hwpmc/hwpmc_mod.c Modified: head/lib/libpmc/pmclog.c ============================================================================== --- head/lib/libpmc/pmclog.c Wed Jan 17 15:12:52 2018 (r328086) +++ head/lib/libpmc/pmclog.c Wed Jan 17 16:41:22 2018 (r328087) @@ -335,6 +335,8 @@ pmclog_get_event(void *cookie, char **data, ssize_t *l ev->pl_u.pl_cc.pl_pc[npc] = (uintfptr_t) 0; break; case PMCLOG_TYPE_CLOSELOG: + ev->pl_state = PMCLOG_EOF; + return (-1); case PMCLOG_TYPE_DROPNOTIFY: /* nothing to do */ break; Modified: head/sys/dev/hwpmc/hwpmc_logging.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_logging.c Wed Jan 17 15:12:52 2018 (r328086) +++ head/sys/dev/hwpmc/hwpmc_logging.c Wed Jan 17 16:41:22 2018 (r328087) @@ -799,6 +799,8 @@ pmclog_close(struct pmc_owner *po) PMCDBG1(LOG,CLO,1, "po=%p", po); + pmclog_process_closelog(po); + mtx_lock(&pmc_kthread_mtx); /* Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Wed Jan 17 15:12:52 2018 (r328086) +++ head/sys/dev/hwpmc/hwpmc_mod.c Wed Jan 17 16:41:22 2018 (r328087) @@ -2928,7 +2928,6 @@ pmc_syscall_handler(struct thread *td, void *syscall_a po : NULL); } else if (po->po_flags & PMC_PO_OWNS_LOGFILE) { pmclog_proc_ignite(pmclog_proc_handle, NULL); - pmclog_process_closelog(po); error = pmclog_close(po); if (error == 0) { LIST_FOREACH(pm, &po->po_pmcs, pm_next) From owner-svn-src-head@freebsd.org Wed Jan 17 16:55:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50D12E7AE78; Wed, 17 Jan 2018 16:55:37 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2BF2277A33; Wed, 17 Jan 2018 16:55:37 +0000 (UTC) (envelope-from fabient@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 612D112224; Wed, 17 Jan 2018 16:55:36 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0HGtaAv075278; Wed, 17 Jan 2018 16:55:36 GMT (envelope-from fabient@FreeBSD.org) Received: (from fabient@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0HGtaeN075277; Wed, 17 Jan 2018 16:55:36 GMT (envelope-from fabient@FreeBSD.org) Message-Id: <201801171655.w0HGtaeN075277@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fabient set sender to fabient@FreeBSD.org using -f From: Fabien Thomas Date: Wed, 17 Jan 2018 16:55:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328088 - head/usr.sbin/pmcstat X-SVN-Group: head X-SVN-Commit-Author: fabient X-SVN-Commit-Paths: head/usr.sbin/pmcstat X-SVN-Commit-Revision: 328088 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jan 2018 16:55:37 -0000 Author: fabient Date: Wed Jan 17 16:55:35 2018 New Revision: 328088 URL: https://svnweb.freebsd.org/changeset/base/328088 Log: Only call flush in pipe mode. It fixes a crash with a socket in top mode. Ex: # pmcstat -R 127.0.0.1:8080 -T -w1 then # pmcstat -n1 -Sclock.prof -Slock.failed -O 127.0.0.1:8080 MFC after: 1 week Sponsored by: Stormshield Modified: head/usr.sbin/pmcstat/pmcstat.c Modified: head/usr.sbin/pmcstat/pmcstat.c ============================================================================== --- head/usr.sbin/pmcstat/pmcstat.c Wed Jan 17 16:41:22 2018 (r328087) +++ head/usr.sbin/pmcstat/pmcstat.c Wed Jan 17 16:55:35 2018 (r328088) @@ -1350,6 +1350,7 @@ main(int argc, char **argv) } /* print out counting PMCs */ if ((args.pa_flags & FLAG_DO_TOP) && + (args.pa_flags & FLAG_HAS_PIPE) && pmc_flush_logfile() == 0) do_read = 1; do_print = 1; From owner-svn-src-head@freebsd.org Wed Jan 17 17:08:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31547E7B6A2; Wed, 17 Jan 2018 17:08:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0DB927816B; Wed, 17 Jan 2018 17:08: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 46AC6123B3; Wed, 17 Jan 2018 17:08:27 +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 w0HH8Qmg079614; Wed, 17 Jan 2018 17:08:26 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0HH8Qfv079613; Wed, 17 Jan 2018 17:08:26 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201801171708.w0HH8Qfv079613@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 17 Jan 2018 17:08:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328089 - head/sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/nvme X-SVN-Commit-Revision: 328089 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jan 2018 17:08:28 -0000 Author: imp Date: Wed Jan 17 17:08:26 2018 New Revision: 328089 URL: https://svnweb.freebsd.org/changeset/base/328089 Log: Move setting of CAM_SIM_QUEUED to before we actually submit it to the hardware. Setting it after is racy, and we can lose the race on a heavily loaded system. Reviewed by: scottl@, gallatin@ Sponsored by: Netflix Modified: head/sys/dev/nvme/nvme_sim.c Modified: head/sys/dev/nvme/nvme_sim.c ============================================================================== --- head/sys/dev/nvme/nvme_sim.c Wed Jan 17 16:55:35 2018 (r328088) +++ head/sys/dev/nvme/nvme_sim.c Wed Jan 17 17:08:26 2018 (r328089) @@ -76,6 +76,7 @@ nvme_sim_nvmeio_done(void *ccb_arg, const struct nvme_ * it means. Make our best guess, though for the status code. */ memcpy(&ccb->nvmeio.cpl, cpl, sizeof(*cpl)); + ccb->ccb_h.status &= ~CAM_SIM_QUEUED; if (nvme_completion_is_error(cpl)) { ccb->ccb_h.status = CAM_REQ_CMP_ERR; xpt_done(ccb); @@ -114,6 +115,7 @@ nvme_sim_nvmeio(struct cam_sim *sim, union ccb *ccb) xpt_done(ccb); return; } + ccb->ccb_h.status |= CAM_SIM_QUEUED; memcpy(&req->cmd, &ccb->nvmeio.cmd, sizeof(ccb->nvmeio.cmd)); @@ -121,8 +123,6 @@ nvme_sim_nvmeio(struct cam_sim *sim, union ccb *ccb) nvme_ctrlr_submit_io_request(ctrlr, req); else nvme_ctrlr_submit_admin_request(ctrlr, req); - - ccb->ccb_h.status |= CAM_SIM_QUEUED; } static uint32_t From owner-svn-src-head@freebsd.org Wed Jan 17 17:11:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76C78E7B880; Wed, 17 Jan 2018 17:11:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 51A8778542; Wed, 17 Jan 2018 17:11: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 96B2C12528; Wed, 17 Jan 2018 17:11: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 w0HHBt2L082735; Wed, 17 Jan 2018 17:11:55 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0HHBtGP082733; Wed, 17 Jan 2018 17:11:55 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201801171711.w0HHBtGP082733@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 17 Jan 2018 17:11:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328090 - in head: contrib/llvm/lib/Target/X86/AsmParser lib/clang X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head: contrib/llvm/lib/Target/X86/AsmParser lib/clang X-SVN-Commit-Revision: 328090 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jan 2018 17:11:56 -0000 Author: dim Date: Wed Jan 17 17:11:55 2018 New Revision: 328090 URL: https://svnweb.freebsd.org/changeset/base/328090 Log: Pull in r322623 from upstream llvm trunk (by Andrew V. Tischenko): Allow usage of X86-prefixes as separate instrs. Differential Revision: https://reviews.llvm.org/D42102 This should fix parse errors when x86 prefixes (such as 'lock' and 'rep') are followed by various non-mnemonic tokens, e.g. comments, .byte directives and labels. PR: 224669,225054 Modified: head/contrib/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp head/lib/clang/freebsd_cc_version.h Modified: head/contrib/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp ============================================================================== --- head/contrib/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp Wed Jan 17 17:08:26 2018 (r328089) +++ head/contrib/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp Wed Jan 17 17:11:55 2018 (r328090) @@ -2375,6 +2375,13 @@ bool X86AsmParser::ParseInstruction(ParseInstructionIn .Cases("repne", "repnz", X86::IP_HAS_REPEAT_NE) .Default(X86::IP_NO_PREFIX); // Invalid prefix (impossible) Flags |= Prefix; + if (getLexer().is(AsmToken::EndOfStatement)) { + // We don't have real instr with the given prefix + // let's use the prefix as the instr. + // TODO: there could be several prefixes one after another + Flags = X86::IP_NO_PREFIX; + break; + } Name = Parser.getTok().getString(); Parser.Lex(); // eat the prefix // Hack: we could have something like "rep # some comment" or Modified: head/lib/clang/freebsd_cc_version.h ============================================================================== --- head/lib/clang/freebsd_cc_version.h Wed Jan 17 17:08:26 2018 (r328089) +++ head/lib/clang/freebsd_cc_version.h Wed Jan 17 17:11:55 2018 (r328090) @@ -1,3 +1,3 @@ /* $FreeBSD$ */ -#define FREEBSD_CC_VERSION 1200008 +#define FREEBSD_CC_VERSION 1200009 From owner-svn-src-head@freebsd.org Wed Jan 17 17:14:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B093EE7BB6E; Wed, 17 Jan 2018 17:14:20 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8C631787A8; Wed, 17 Jan 2018 17:14:20 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C519A1255A; Wed, 17 Jan 2018 17:14:19 +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 w0HHEJRk083802; Wed, 17 Jan 2018 17:14:19 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0HHEJng083801; Wed, 17 Jan 2018 17:14:19 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201801171714.w0HHEJng083801@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 17 Jan 2018 17:14:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328091 - head/sys/crypto/via X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/sys/crypto/via X-SVN-Commit-Revision: 328091 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jan 2018 17:14:20 -0000 Author: dim Date: Wed Jan 17 17:14:19 2018 New Revision: 328091 URL: https://svnweb.freebsd.org/changeset/base/328091 Log: Revert r327340, as the workaround for rep prefixes followed by .byte directives is no longer needed after r328090. Modified: head/sys/crypto/via/padlock_cipher.c Directory Properties: head/ (props changed) Modified: head/sys/crypto/via/padlock_cipher.c ============================================================================== --- head/sys/crypto/via/padlock_cipher.c Wed Jan 17 17:11:55 2018 (r328090) +++ head/sys/crypto/via/padlock_cipher.c Wed Jan 17 17:14:19 2018 (r328091) @@ -88,7 +88,7 @@ padlock_cbc(void *in, void *out, size_t count, void *k __asm __volatile( "pushf \n\t" "popf \n\t" - ".byte 0xf3 \n\t" + "rep \n\t" ".byte 0x0f, 0xa7, 0xd0" : "+a" (iv), "+c" (count), "+D" (out), "+S" (in) : "b" (key), "d" (cw) From owner-svn-src-head@freebsd.org Wed Jan 17 17:58:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46B8BE7DCFB; Wed, 17 Jan 2018 17:58:26 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 214567A36E; Wed, 17 Jan 2018 17:58:26 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6BD6812BB1; Wed, 17 Jan 2018 17:58:25 +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 w0HHwPml000832; Wed, 17 Jan 2018 17:58:25 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0HHwO42000825; Wed, 17 Jan 2018 17:58:24 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201801171758.w0HHwO42000825@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Wed, 17 Jan 2018 17:58:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328092 - in head: lib/libufs sbin/fsck_ffs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: in head: lib/libufs sbin/fsck_ffs X-SVN-Commit-Revision: 328092 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jan 2018 17:58:26 -0000 Author: mckusick Date: Wed Jan 17 17:58:24 2018 New Revision: 328092 URL: https://svnweb.freebsd.org/changeset/base/328092 Log: Correct fsck journal-recovery code to update a cylinder-group check-hash after making changes to the cylinder group. The problem was that the journal-recovery code was calling the libufs bwrite() function instead of the cgput() function. The cgput() function updates the cylinder-group check-hash before writing the cylinder group. This change required the additions of the cgget() and cgput() functions to the libufs API to avoid a gratuitous bcopy of every cylinder group to be read or written. These new functions have been added to the libufs manual pages. This was the first opportunity that I have had to use and document the use of the EDOOFUS error code. Reviewed by: kib Reported by: emaste and others Modified: head/lib/libufs/Makefile head/lib/libufs/cgread.3 head/lib/libufs/cgroup.c head/lib/libufs/libufs.3 head/lib/libufs/libufs.h head/sbin/fsck_ffs/gjournal.c head/sbin/fsck_ffs/suj.c Modified: head/lib/libufs/Makefile ============================================================================== --- head/lib/libufs/Makefile Wed Jan 17 17:14:19 2018 (r328091) +++ head/lib/libufs/Makefile Wed Jan 17 17:58:24 2018 (r328092) @@ -12,7 +12,10 @@ MAN= bread.3 cgread.3 libufs.3 sbread.3 ufs_disk_close MLINKS+= bread.3 bwrite.3 MLINKS+= bread.3 berase.3 MLINKS+= cgread.3 cgread1.3 +MLINKS+= cgread.3 cgget.3 +MLINKS+= cgread.3 cgwrite.3 MLINKS+= cgread.3 cgwrite1.3 +MLINKS+= cgread.3 cgput.3 MLINKS+= sbread.3 sbwrite.3 MLINKS+= ufs_disk_close.3 ufs_disk_fillout.3 MLINKS+= ufs_disk_close.3 ufs_disk_fillout_blank.3 Modified: head/lib/libufs/cgread.3 ============================================================================== --- head/lib/libufs/cgread.3 Wed Jan 17 17:14:19 2018 (r328091) +++ head/lib/libufs/cgread.3 Wed Jan 17 17:58:24 2018 (r328092) @@ -2,19 +2,22 @@ .\" Date: June 04, 2003 .\" Description: .\" Manual page for libufs functions: +.\" cgget(3) +.\" cgput(3) .\" cgread(3) .\" cgread1(3) +.\" cgwrite(3) .\" cgwrite1(3) .\" .\" This file is in the public domain. .\" .\" $FreeBSD$ .\" -.Dd June 4, 2003 +.Dd January 19, 2018 .Dt CGREAD 3 .Os .Sh NAME -.Nm cgread , cgread1, cgwrite1 +.Nm cgget , cgput , cgread , cgread1 , cgwrite , cgwrite1 .Nd read/write cylinder groups of UFS disks .Sh LIBRARY .Lb libufs @@ -26,30 +29,72 @@ .In ufs/ffs/fs.h .In libufs.h .Ft int +.Fn cgget "struct uufsd *disk" "int cg" "struct cg *cgp" +.Ft int +.Fn cgput "struct uufsd *disk" "struct cg *cgp" +.Ft int .Fn cgread "struct uufsd *disk" .Ft int -.Fn cgread1 "struct uufsd *disk" "int c" +.Fn cgread1 "struct uufsd *disk" "int cg" .Ft int -.Fn cgwrite1 "struct uufsd *disk" "int c" +.Fn cgwrite "struct uufsd *disk" +.Ft int +.Fn cgwrite1 "struct uufsd *disk" "int cg" .Sh DESCRIPTION The -.Fn cgread +.Fn cgget , +.Fn cgread , and .Fn cgread1 functions provide cylinder group reads for .Xr libufs 3 consumers. The +.Fn cgput , +.Fn cgwrite , +and +.Fn cgwrite1 +functions provide cylinder group writes for +.Xr libufs 3 +consumers. +.Pp +The +.Fn cgget +function reads the cylinder group specified by +.Fa cg +into the buffer pointed to by +.Fa cgp +from the disk referenced by the user-land UFS-disk structure. +The +.Fn cgget +function is the only cylinder group read function that is safe to use +in threaded applications. +.Pp +The +.Fn cgput +function writes the cylinder group specified by +.Va cgp +to the disk referenced by the user-land UFS-disk structure. +The +.Fn cgput +function is the only cylinder group write function that is safe to use +in threaded applications. +Note that the +.Fn cgput +function needs to be called only if the cylinder group has been +modified and the on-disk copy needs to be updated. +.Pp +The .Fn cgread1 -function reads from one cylinder group, specified by -.Fa c +function reads from the cylinder group specified by +.Fa cg into the .Va d_cg -field of a userland UFS disk structure. +cylinder-group structure in a user-land UFS-disk structure. It sets the .Va d_lcg field to the cylinder group number -.Fa c . +.Fa cg . .Pp The .Fn cgread @@ -65,34 +110,57 @@ field, and then incrementing the field. .Pp The -.Fn cgwrite1 -function stores cylinder group specified by -.Fa c -from +.Fn cgwrite +function stores on disk the cylinder group held in the .Va d_cg -field of a userland UFS disk structure on disk. +cylinder-group structure in a user-land UFS-disk structure. +.Pp +The +.Fn cgwrite1 +function provides no additional functionality over the +.Fn cgwrite +function as there is only one place that a given cylinder group +can correctly be written. +If the caller gets the +.Fa cg +parameter wrong, the function fails with the error +.Er EDOOFUS . +This function remains only to provide backward compatibility. .Sh RETURN VALUES -Both functions return 0 if there are no more cylinder groups to read, +The +.Fn cgread +function returns 0 if there are no more cylinder groups to read, 1 if there are more cylinder groups, and \-1 on error. +The +.Fn cgread1 +function returns 1 on success and \-1 on error. +The other functions return 0 on success and \-1 on error; .Sh ERRORS -The function -.Fn cgread -may fail and set +The +.Fn cgget , +.Fn cgread , +and +.Fn cgread1 +functions may fail and set .Va errno for any of the errors specified for the library function .Xr bread 3 . .Pp -The function -.Fn cgread1 -has semantically identical failure conditions to those of -.Fn cgread . -.Pp -The function +The +.Fn cgput , +.Fn cgwrite , +and .Fn cgwrite1 -may fail and set +functions may fail and set .Va errno for any of the errors specified for the library function .Xr bwrite 3 . +Additionally the +.Fn cgwrite1 +will return the +.Er EDOOFUS +error if the cylinder group specified does not match the +cylinder group that it is requesting to write. .Sh SEE ALSO .Xr bread 3 , .Xr bwrite 3 , Modified: head/lib/libufs/cgroup.c ============================================================================== --- head/lib/libufs/cgroup.c Wed Jan 17 17:14:19 2018 (r328091) +++ head/lib/libufs/cgroup.c Wed Jan 17 17:58:24 2018 (r328092) @@ -182,47 +182,85 @@ gotit: int cgread(struct uufsd *disk) { + + if (disk->d_ccg >= disk->d_fs.fs_ncg) + return (0); return (cgread1(disk, disk->d_ccg++)); } int cgread1(struct uufsd *disk, int c) { + + if ((cgget(disk, c, &disk->d_cg)) == 0) + return (1); + return (-1); +} + +int +cgget(struct uufsd *disk, int cg, struct cg *cgp) +{ struct fs *fs; + uint32_t cghash, calchash; fs = &disk->d_fs; - - if ((unsigned)c >= fs->fs_ncg) { - return (0); - } - if (bread(disk, fsbtodb(fs, cgtod(fs, c)), disk->d_cgunion.d_buf, - fs->fs_bsize) == -1) { + if (bread(disk, fsbtodb(fs, cgtod(fs, cg)), (void *)cgp, + fs->fs_cgsize) == -1) { ERROR(disk, "unable to read cylinder group"); return (-1); } - disk->d_lcg = c; - return (1); + calchash = cgp->cg_ckhash; + if ((fs->fs_metackhash & CK_CYLGRP) != 0) { + cghash = cgp->cg_ckhash; + cgp->cg_ckhash = 0; + calchash = calculate_crc32c(~0L, (void *)cgp, fs->fs_cgsize); + cgp->cg_ckhash = cghash; + } + if (cgp->cg_ckhash != calchash || !cg_chkmagic(cgp) || + cgp->cg_cgx != cg) { + ERROR(disk, "cylinder group checks failed"); + errno = EIO; + return (-1); + } + disk->d_lcg = cg; + return (0); } int cgwrite(struct uufsd *disk) { - return (cgwrite1(disk, disk->d_lcg)); + + return (cgput(disk, &disk->d_cg)); } int -cgwrite1(struct uufsd *disk, int c) +cgwrite1(struct uufsd *disk, int cg) { + static char errmsg[BUFSIZ]; + + if (cg == disk->d_cg.cg_cgx) + return (cgput(disk, &disk->d_cg)); + snprintf(errmsg, BUFSIZ, "Cylinder group %d in buffer does not match " + "the cylinder group %d that cgwrite1 requested", + disk->d_cg.cg_cgx, cg); + ERROR(disk, errmsg); + errno = EDOOFUS; + return (-1); +} + +int +cgput(struct uufsd *disk, struct cg *cgp) +{ struct fs *fs; fs = &disk->d_fs; if ((fs->fs_metackhash & CK_CYLGRP) != 0) { - disk->d_cg.cg_ckhash = 0; - disk->d_cg.cg_ckhash = - calculate_crc32c(~0L, (void *)&disk->d_cg, fs->fs_cgsize); + cgp->cg_ckhash = 0; + cgp->cg_ckhash = + calculate_crc32c(~0L, (void *)cgp, fs->fs_cgsize); } - if (bwrite(disk, fsbtodb(fs, cgtod(fs, c)), - disk->d_cgunion.d_buf, fs->fs_bsize) == -1) { + if (bwrite(disk, fsbtodb(fs, cgtod(fs, cgp->cg_cgx)), cgp, + fs->fs_cgsize) == -1) { ERROR(disk, "unable to write cylinder group"); return (-1); } Modified: head/lib/libufs/libufs.3 ============================================================================== --- head/lib/libufs/libufs.3 Wed Jan 17 17:14:19 2018 (r328091) +++ head/lib/libufs/libufs.3 Wed Jan 17 17:58:24 2018 (r328092) @@ -7,7 +7,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 4, 2003 +.Dd January 19, 2018 .Dt LIBUFS 3 .Os .Sh NAME @@ -55,8 +55,11 @@ to a string describing the error. .Sh SEE ALSO .Xr bread 3 , .Xr bwrite 3 , +.Xr cgget 3 , +.Xr cgput 3 , .Xr cgread 3 , .Xr cgread1 3 , +.Xr cgwrite 3 , .Xr cgwrite1 3 , .Xr sbread 3 , .Xr sbwrite 3 , Modified: head/lib/libufs/libufs.h ============================================================================== --- head/lib/libufs/libufs.h Wed Jan 17 17:14:19 2018 (r328091) +++ head/lib/libufs/libufs.h Wed Jan 17 17:58:24 2018 (r328092) @@ -111,6 +111,8 @@ int berase(struct uufsd *, ufs2_daddr_t, ufs2_daddr_t) ufs2_daddr_t cgballoc(struct uufsd *); int cgbfree(struct uufsd *, ufs2_daddr_t, long); ino_t cgialloc(struct uufsd *); +int cgget(struct uufsd *, int, struct cg *); +int cgput(struct uufsd *, struct cg *); int cgread(struct uufsd *); int cgread1(struct uufsd *, int); int cgwrite(struct uufsd *); Modified: head/sbin/fsck_ffs/gjournal.c ============================================================================== --- head/sbin/fsck_ffs/gjournal.c Wed Jan 17 17:14:19 2018 (r328091) +++ head/sbin/fsck_ffs/gjournal.c Wed Jan 17 17:58:24 2018 (r328092) @@ -134,9 +134,8 @@ getcg(int cg) if (cgc == NULL) err(1, "malloc(%zu)", sizeof(*cgc)); } - if (cgread1(disk, cg) == -1) - err(1, "cgread1(%d)", cg); - bcopy(&disk->d_cg, &cgc->cgc_cg, sizeof(cgc->cgc_union)); + if (cgget(disk, cg, &cgc->cgc_cg) == -1) + err(1, "cgget(%d)", cg); cgc->cgc_busy = 0; cgc->cgc_dirty = 0; LIST_INSERT_HEAD(&cglist, cgc, cgc_next); @@ -191,10 +190,8 @@ putcgs(void) LIST_REMOVE(cgc, cgc_next); ncgs--; if (cgc->cgc_dirty) { - bcopy(&cgc->cgc_cg, &disk->d_cg, - sizeof(cgc->cgc_union)); - if (cgwrite1(disk, cgc->cgc_cg.cg_cgx) == -1) - err(1, "cgwrite1(%d)", cgc->cgc_cg.cg_cgx); + if (cgput(disk, &cgc->cgc_cg) == -1) + err(1, "cgput(%d)", cgc->cgc_cg.cg_cgx); //printf("%s: Wrote cg=%d\n", __func__, // cgc->cgc_cg.cg_cgx); } Modified: head/sbin/fsck_ffs/suj.c ============================================================================== --- head/sbin/fsck_ffs/suj.c Wed Jan 17 17:14:19 2018 (r328091) +++ head/sbin/fsck_ffs/suj.c Wed Jan 17 17:58:24 2018 (r328092) @@ -1892,8 +1892,7 @@ cg_write(struct suj_cg *sc) * before writing the block. */ fs->fs_cs(fs, sc->sc_cgx) = cgp->cg_cs; - if (bwrite(disk, fsbtodb(fs, cgtod(fs, sc->sc_cgx)), sc->sc_cgbuf, - fs->fs_bsize) == -1) + if (cgput(disk, cgp) == -1) err_suj("Unable to write cylinder group %d\n", sc->sc_cgx); } From owner-svn-src-head@freebsd.org Wed Jan 17 18:18:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED185E7EE0B; Wed, 17 Jan 2018 18:18:34 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C98F67B0C4; Wed, 17 Jan 2018 18:18: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1DDA112EF6; Wed, 17 Jan 2018 18:18: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 w0HIIXS7009280; Wed, 17 Jan 2018 18:18:33 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0HIIXhv009277; Wed, 17 Jan 2018 18:18:33 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201801171818.w0HIIXhv009277@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 17 Jan 2018 18:18:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328093 - 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: 328093 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jan 2018 18:18:35 -0000 Author: pfg Date: Wed Jan 17 18:18:33 2018 New Revision: 328093 URL: https://svnweb.freebsd.org/changeset/base/328093 Log: ufs: use mallocarray(9). Basic use of mallocarray to prevent overflows: static analyzers are also likely to perform additional checks. Since mallocarray expects unsigned parameters, unsign some related variables to minimize sign conversions. Reviewed by: mckusick Modified: head/sys/ufs/ffs/ffs_snapshot.c head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- head/sys/ufs/ffs/ffs_snapshot.c Wed Jan 17 17:58:24 2018 (r328092) +++ head/sys/ufs/ffs/ffs_snapshot.c Wed Jan 17 18:18:33 2018 (r328093) @@ -648,7 +648,7 @@ loop: * keep us out of deadlock until the full one is ready. */ if (xp == NULL) { - snapblklist = malloc(snaplistsize * sizeof(daddr_t), + snapblklist = mallocarray(snaplistsize, sizeof(daddr_t), M_UFSMNT, M_WAITOK); blkp = &snapblklist[1]; *blkp++ = lblkno(fs, fs->fs_sblockloc); @@ -729,7 +729,7 @@ out1: /* * Allocate space for the full list of preallocated snapshot blocks. */ - snapblklist = malloc(snaplistsize * sizeof(daddr_t), + snapblklist = mallocarray(snaplistsize, sizeof(daddr_t), M_UFSMNT, M_WAITOK); ip->i_snapblklist = &snapblklist[1]; /* Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Wed Jan 17 17:58:24 2018 (r328092) +++ head/sys/ufs/ffs/ffs_softdep.c Wed Jan 17 18:18:33 2018 (r328093) @@ -2466,7 +2466,8 @@ softdep_mount(devvp, mp, fs, cred) struct ufsmount *ump; struct cg *cgp; struct buf *bp; - int i, error, cyl; + u_int cyl, i; + int error; sdp = malloc(sizeof(struct mount_softdeps), M_MOUNTDATA, M_WAITOK | M_ZERO); @@ -2500,7 +2501,7 @@ softdep_mount(devvp, mp, fs, cred) ump->bmsafemap_hashtbl = hashinit(1024, M_BMSAFEMAP, &ump->bmsafemap_hash_size); i = 1 << (ffs(desiredvnodes / 10) - 1); - ump->indir_hashtbl = malloc(i * sizeof(struct indir_hashhead), + ump->indir_hashtbl = mallocarray(i, sizeof(struct indir_hashhead), M_FREEWORK, M_WAITOK); ump->indir_hash_size = i - 1; for (i = 0; i <= ump->indir_hash_size; i++) @@ -2627,8 +2628,8 @@ jblocks_create(void) jblocks = malloc(sizeof(*jblocks), M_JBLOCKS, M_WAITOK | M_ZERO); TAILQ_INIT(&jblocks->jb_segs); jblocks->jb_avail = 10; - jblocks->jb_extent = malloc(sizeof(struct jextent) * jblocks->jb_avail, - M_JBLOCKS, M_WAITOK | M_ZERO); + jblocks->jb_extent = mallocarray(jblocks->jb_avail, + sizeof(struct jextent), M_JBLOCKS, M_WAITOK | M_ZERO); return (jblocks); } @@ -2713,7 +2714,7 @@ jblocks_add(jblocks, daddr, blocks) /* Adding a new extent. */ if (++jblocks->jb_used == jblocks->jb_avail) { jblocks->jb_avail *= 2; - jext = malloc(sizeof(struct jextent) * jblocks->jb_avail, + jext = mallocarray(jblocks->jb_avail, sizeof(struct jextent), M_JBLOCKS, M_WAITOK | M_ZERO); memcpy(jext, jblocks->jb_extent, sizeof(struct jextent) * jblocks->jb_used); Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Wed Jan 17 17:58:24 2018 (r328092) +++ head/sys/ufs/ufs/ufs_vnops.c Wed Jan 17 18:18:33 2018 (r328093) @@ -2170,7 +2170,7 @@ ufs_readdir(ap) off_t offset, startoffset; size_t readcnt, skipcnt; ssize_t startresid; - int ncookies; + u_int ncookies; int error; if (uio->uio_offset < 0) @@ -2185,7 +2185,8 @@ ufs_readdir(ap) else if (ip->i_size - uio->uio_offset < ncookies) ncookies = ip->i_size - uio->uio_offset; ncookies = ncookies / (offsetof(struct direct, d_name) + 4) + 1; - cookies = malloc(ncookies * sizeof(*cookies), M_TEMP, M_WAITOK); + cookies = mallocarray(ncookies, sizeof(*cookies), M_TEMP, + M_WAITOK); *ap->a_ncookies = ncookies; *ap->a_cookies = cookies; } else { From owner-svn-src-head@freebsd.org Wed Jan 17 19:59:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B115EB3F67; Wed, 17 Jan 2018 19:59:45 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 127977F4C6; Wed, 17 Jan 2018 19:59:45 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4FA4113FBE; Wed, 17 Jan 2018 19:59:44 +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 w0HJxihp051467; Wed, 17 Jan 2018 19:59:44 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0HJxhi3051461; Wed, 17 Jan 2018 19:59:43 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201801171959.w0HJxhi3051461@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 17 Jan 2018 19:59:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328094 - head/usr.sbin/kldxref X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.sbin/kldxref X-SVN-Commit-Revision: 328094 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jan 2018 19:59:45 -0000 Author: emaste Date: Wed Jan 17 19:59:43 2018 New Revision: 328094 URL: https://svnweb.freebsd.org/changeset/base/328094 Log: kldxref: improve style(9) Address style issues including some previously raised in D13923. - Use designated initializers for structs - Always use bracketed return style - No initialization in declarations - Align function prototype names - Remove old commented code/unused includes Submitted by: Mitchell Horne Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D13943 Modified: head/usr.sbin/kldxref/ef.c head/usr.sbin/kldxref/ef_aarch64.c head/usr.sbin/kldxref/ef_obj.c head/usr.sbin/kldxref/ef_powerpc.c head/usr.sbin/kldxref/kldxref.c Modified: head/usr.sbin/kldxref/ef.c ============================================================================== --- head/usr.sbin/kldxref/ef.c Wed Jan 17 18:18:33 2018 (r328093) +++ head/usr.sbin/kldxref/ef.c Wed Jan 17 19:59:43 2018 (r328094) @@ -36,84 +36,89 @@ #include #include -#include + +#include +#include +#include #include #include +#include #include -#include -#include #include #define FREEBSD_ELF -#include - #include "ef.h" #define MAXSEGS 3 struct ef_file { - char* ef_name; + char *ef_name; struct elf_file *ef_efile; - Elf_Phdr * ef_ph; + Elf_Phdr *ef_ph; int ef_fd; int ef_type; Elf_Ehdr ef_hdr; - void* ef_fpage; /* First block of the file */ + void *ef_fpage; /* First block of the file */ int ef_fplen; /* length of first block */ - Elf_Dyn* ef_dyn; /* Symbol table etc. */ + Elf_Dyn *ef_dyn; /* Symbol table etc. */ Elf_Hashelt ef_nbuckets; Elf_Hashelt ef_nchains; - Elf_Hashelt* ef_buckets; - Elf_Hashelt* ef_chains; - Elf_Hashelt* ef_hashtab; + Elf_Hashelt *ef_buckets; + Elf_Hashelt *ef_chains; + Elf_Hashelt *ef_hashtab; Elf_Off ef_stroff; caddr_t ef_strtab; int ef_strsz; Elf_Off ef_symoff; - Elf_Sym* ef_symtab; + Elf_Sym *ef_symtab; int ef_nsegs; - Elf_Phdr * ef_segs[MAXSEGS]; + Elf_Phdr *ef_segs[MAXSEGS]; int ef_verbose; - Elf_Rel * ef_rel; /* relocation table */ + Elf_Rel *ef_rel; /* relocation table */ int ef_relsz; /* number of entries */ - Elf_Rela * ef_rela; /* relocation table */ + Elf_Rela *ef_rela; /* relocation table */ int ef_relasz; /* number of entries */ }; -static void ef_print_phdr(Elf_Phdr *); -static u_long ef_get_offset(elf_file_t, Elf_Off); -static int ef_parse_dynamic(elf_file_t); +static void ef_print_phdr(Elf_Phdr *); +static u_long ef_get_offset(elf_file_t, Elf_Off); +static int ef_parse_dynamic(elf_file_t); -static int ef_get_type(elf_file_t ef); -static int ef_close(elf_file_t ef); -static int ef_read(elf_file_t ef, Elf_Off offset, size_t len, void* dest); -static int ef_read_entry(elf_file_t ef, Elf_Off offset, size_t len, void **ptr); -static int ef_seg_read(elf_file_t ef, Elf_Off offset, size_t len, void *dest); -static int ef_seg_read_rel(elf_file_t ef, Elf_Off offset, size_t len, - void *dest); -static int ef_seg_read_string(elf_file_t ef, Elf_Off offset, size_t len, - char *dest); -static int ef_seg_read_entry(elf_file_t ef, Elf_Off offset, size_t len, - void **ptr); -static int ef_seg_read_entry_rel(elf_file_t ef, Elf_Off offset, size_t len, - void **ptr); -static Elf_Addr ef_symaddr(elf_file_t ef, Elf_Size symidx); -static int ef_lookup_set(elf_file_t ef, const char *name, long *startp, - long *stopp, long *countp); -static int ef_lookup_symbol(elf_file_t ef, const char* name, Elf_Sym** sym); +static int ef_get_type(elf_file_t ef); +static int ef_close(elf_file_t ef); +static int ef_read(elf_file_t ef, Elf_Off offset, size_t len, void* dest); +static int ef_read_entry(elf_file_t ef, Elf_Off offset, size_t len, + void **ptr); +static int ef_seg_read(elf_file_t ef, Elf_Off offset, size_t len, + void *dest); +static int ef_seg_read_rel(elf_file_t ef, Elf_Off offset, size_t len, + void *dest); +static int ef_seg_read_string(elf_file_t ef, Elf_Off offset, size_t len, + char *dest); +static int ef_seg_read_entry(elf_file_t ef, Elf_Off offset, size_t len, + void **ptr); +static int ef_seg_read_entry_rel(elf_file_t ef, Elf_Off offset, size_t len, + void **ptr); + +static Elf_Addr ef_symaddr(elf_file_t ef, Elf_Size symidx); +static int ef_lookup_set(elf_file_t ef, const char *name, long *startp, + long *stopp, long *countp); +static int ef_lookup_symbol(elf_file_t ef, const char* name, + Elf_Sym** sym); + static struct elf_file_ops ef_file_ops = { - ef_get_type, - ef_close, - ef_read, - ef_read_entry, - ef_seg_read, - ef_seg_read_rel, - ef_seg_read_string, - ef_seg_read_entry, - ef_seg_read_entry_rel, - ef_symaddr, - ef_lookup_set, - ef_lookup_symbol + .get_type = ef_get_type, + .close = ef_close, + .read = ef_read, + .read_entry = ef_read_entry, + .seg_read = ef_seg_read, + .seg_read_rel = ef_seg_read_rel, + .seg_read_string = ef_seg_read_string, + .seg_read_entry = ef_seg_read_entry, + .seg_read_entry_rel = ef_seg_read_entry_rel, + .symaddr = ef_symaddr, + .lookup_set = ef_lookup_set, + .lookup_symbol = ef_lookup_symbol }; static void @@ -139,10 +144,10 @@ ef_get_offset(elf_file_t ef, Elf_Off off) for (i = 0; i < ef->ef_nsegs; i++) { ph = ef->ef_segs[i]; if (off >= ph->p_vaddr && off < ph->p_vaddr + ph->p_memsz) { - return ph->p_offset + (off - ph->p_vaddr); + return (ph->p_offset + (off - ph->p_vaddr)); } } - return 0; + return (0); } static int @@ -158,26 +163,26 @@ ef_get_type(elf_file_t ef) static unsigned long elf_hash(const char *name) { - const unsigned char *p = (const unsigned char *) name; - unsigned long h = 0; - unsigned long g; + unsigned long h, g; + const unsigned char *p; + h = 0; + p = (const unsigned char *)name; while (*p != '\0') { h = (h << 4) + *p++; if ((g = h & 0xf0000000) != 0) h ^= g >> 24; h &= ~g; } - return h; + return (h); } static int ef_lookup_symbol(elf_file_t ef, const char* name, Elf_Sym** sym) { - unsigned long symnum; - Elf_Sym* symp; + unsigned long hash, symnum; + Elf_Sym *symp; char *strp; - unsigned long hash; /* First, search hashed global symbols */ hash = elf_hash(name); @@ -187,14 +192,14 @@ ef_lookup_symbol(elf_file_t ef, const char* name, Elf_ if (symnum >= ef->ef_nchains) { warnx("ef_lookup_symbol: file %s have corrupted symbol table\n", ef->ef_name); - return ENOENT; + return (ENOENT); } symp = ef->ef_symtab + symnum; if (symp->st_name == 0) { warnx("ef_lookup_symbol: file %s have corrupted symbol table\n", ef->ef_name); - return ENOENT; + return (ENOENT); } strp = ef->ef_strtab + symp->st_name; @@ -204,15 +209,15 @@ ef_lookup_symbol(elf_file_t ef, const char* name, Elf_ (symp->st_value != 0 && ELF_ST_TYPE(symp->st_info) == STT_FUNC)) { *sym = symp; - return 0; + return (0); } else - return ENOENT; + return (ENOENT); } symnum = ef->ef_chains[symnum]; } - return ENOENT; + return (ENOENT); } static int @@ -226,19 +231,19 @@ ef_lookup_set(elf_file_t ef, const char *name, long *s len = strlen(name) + sizeof("__start_set_"); /* sizeof includes \0 */ setsym = malloc(len); if (setsym == NULL) - return (ENOMEM); + return (errno); /* get address of first entry */ snprintf(setsym, len, "%s%s", "__start_set_", name); error = ef_lookup_symbol(ef, setsym, &sym); - if (error) + if (error != 0) goto out; *startp = sym->st_value; /* get address of last entry */ snprintf(setsym, len, "%s%s", "__stop_set_", name); error = ef_lookup_symbol(ef, setsym, &sym); - if (error) + if (error != 0) goto out; *stopp = sym->st_value; @@ -270,7 +275,6 @@ ef_parse_dynamic(elf_file_t ef) { Elf_Dyn *dp; Elf_Hashelt hashhdr[2]; -/* int plttype = DT_REL;*/ int error; Elf_Off rel_off; Elf_Off rela_off; @@ -287,19 +291,19 @@ ef_parse_dynamic(elf_file_t ef) case DT_HASH: error = ef_read(ef, ef_get_offset(ef, dp->d_un.d_ptr), sizeof(hashhdr), hashhdr); - if (error) { + if (error != 0) { warnx("can't read hash header (%lx)", ef_get_offset(ef, dp->d_un.d_ptr)); - return error; + return (error); } ef->ef_nbuckets = hashhdr[0]; ef->ef_nchains = hashhdr[1]; error = ef_read_entry(ef, -1, (hashhdr[0] + hashhdr[1]) * sizeof(Elf_Hashelt), (void**)&ef->ef_hashtab); - if (error) { + if (error != 0) { warnx("can't read hash table"); - return error; + return (error); } ef->ef_buckets = ef->ef_hashtab; ef->ef_chains = ef->ef_buckets + ef->ef_nbuckets; @@ -315,7 +319,7 @@ ef_parse_dynamic(elf_file_t ef) break; case DT_SYMENT: if (dp->d_un.d_val != sizeof(Elf_Sym)) - return EFTYPE; + return (EFTYPE); break; case DT_REL: if (rel_off != 0) @@ -351,11 +355,11 @@ ef_parse_dynamic(elf_file_t ef) } if (ef->ef_symoff == 0) { warnx("%s: no .dynsym section found\n", ef->ef_name); - return EFTYPE; + return (EFTYPE); } if (ef->ef_stroff == 0) { warnx("%s: no .dynstr section found\n", ef->ef_name); - return EFTYPE; + return (EFTYPE); } if (ef_read_entry(ef, ef_get_offset(ef, ef->ef_symoff), ef->ef_nchains * sizeof(Elf_Sym), @@ -363,12 +367,12 @@ ef_parse_dynamic(elf_file_t ef) if (ef->ef_verbose) warnx("%s: can't load .dynsym section (0x%lx)", ef->ef_name, (long)ef->ef_symoff); - return EIO; + return (EIO); } if (ef_read_entry(ef, ef_get_offset(ef, ef->ef_stroff), ef->ef_strsz, (void**)&ef->ef_strtab) != 0) { warnx("can't load .dynstr section"); - return EIO; + return (EIO); } if (rel_off != 0) { if (rel_entry == 0) { @@ -420,7 +424,7 @@ ef_parse_dynamic(elf_file_t ef) warnx("%s: %d RELA entries", ef->ef_name, ef->ef_relasz); } - return 0; + return (0); } static int @@ -430,14 +434,14 @@ ef_read(elf_file_t ef, Elf_Off offset, size_t len, voi if (offset != (Elf_Off)-1) { if (lseek(ef->ef_fd, offset, SEEK_SET) == -1) - return EIO; + return (EIO); } r = read(ef->ef_fd, dest, len); if (r != -1 && (size_t)r == len) - return 0; + return (0); else - return EIO; + return (EIO); } static int @@ -447,23 +451,24 @@ ef_read_entry(elf_file_t ef, Elf_Off offset, size_t le *ptr = malloc(len); if (*ptr == NULL) - return ENOMEM; + return (errno); error = ef_read(ef, offset, len, *ptr); - if (error) + if (error != 0) free(*ptr); - return error; + return (error); } static int ef_seg_read(elf_file_t ef, Elf_Off offset, size_t len, void*dest) { - u_long ofs = ef_get_offset(ef, offset); + u_long ofs; + ofs = ef_get_offset(ef, offset); if (ofs == 0) { if (ef->ef_verbose) warnx("ef_seg_read(%s): zero offset (%lx:%ld)", ef->ef_name, (long)offset, ofs); - return EFAULT; + return (EFAULT); } return ef_read(ef, ofs, len, dest); } @@ -471,16 +476,17 @@ ef_seg_read(elf_file_t ef, Elf_Off offset, size_t len, static int ef_seg_read_rel(elf_file_t ef, Elf_Off offset, size_t len, void*dest) { - u_long ofs = ef_get_offset(ef, offset); + u_long ofs; const Elf_Rela *a; const Elf_Rel *r; int error; + ofs = ef_get_offset(ef, offset); if (ofs == 0) { if (ef->ef_verbose) warnx("ef_seg_read_rel(%s): zero offset (%lx:%ld)", ef->ef_name, (long)offset, ofs); - return EFAULT; + return (EFAULT); } if ((error = ef_read(ef, ofs, len, dest)) != 0) return (error); @@ -503,9 +509,10 @@ ef_seg_read_rel(elf_file_t ef, Elf_Off offset, size_t static int ef_seg_read_string(elf_file_t ef, Elf_Off offset, size_t len, char *dest) { - u_long ofs = ef_get_offset(ef, offset); + u_long ofs; ssize_t r; + ofs = ef_get_offset(ef, offset); if (ofs == 0 || ofs == (Elf_Off)-1) { if (ef->ef_verbose) warnx("ef_seg_read_string(%s): bad offset (%lx:%ld)", @@ -529,11 +536,11 @@ ef_seg_read_entry(elf_file_t ef, Elf_Off offset, size_ *ptr = malloc(len); if (*ptr == NULL) - return ENOMEM; + return (errno); error = ef_seg_read(ef, offset, len, *ptr); - if (error) + if (error != 0) free(*ptr); - return error; + return (error); } static int @@ -543,11 +550,11 @@ ef_seg_read_entry_rel(elf_file_t ef, Elf_Off offset, s *ptr = malloc(len); if (*ptr == NULL) - return ENOMEM; + return (errno); error = ef_seg_read_rel(ef, offset, len, *ptr); - if (error) + if (error != 0) free(*ptr); - return error; + return (error); } int @@ -562,14 +569,14 @@ ef_open(const char *filename, struct elf_file *efile, Elf_Phdr *phdr, *phdyn, *phlimit; if (filename == NULL) - return EFTYPE; + return (EINVAL); if ((fd = open(filename, O_RDONLY)) == -1) - return errno; + return (errno); ef = malloc(sizeof(*ef)); if (ef == NULL) { close(fd); - return (ENOMEM); + return (errno); } efile->ef_ef = ef; @@ -637,38 +644,31 @@ ef_open(const char *filename, struct elf_file *efile, break; } error = ef_parse_dynamic(ef); - if (error) + if (error != 0) break; if (hdr->e_type == ET_DYN) { ef->ef_type = EFT_KLD; -/* pad = (u_int)dest & PAGE_MASK; - if (pad) - dest += PAGE_SIZE - pad;*/ error = 0; } else if (hdr->e_type == ET_EXEC) { -/* dest = hdr->e_entry; - if (dest == 0) - break;*/ ef->ef_type = EFT_KERNEL; error = 0; } else break; } while(0); - if (error) + if (error != 0) ef_close(ef); - return error; + return (error); } static int ef_close(elf_file_t ef) { + close(ef->ef_fd); -/* if (ef->ef_fpage) - free(ef->ef_fpage);*/ if (ef->ef_name) free(ef->ef_name); ef->ef_efile->ef_ops = NULL; ef->ef_efile->ef_ef = NULL; free(ef); - return 0; + return (0); } Modified: head/usr.sbin/kldxref/ef_aarch64.c ============================================================================== --- head/usr.sbin/kldxref/ef_aarch64.c Wed Jan 17 18:18:33 2018 (r328093) +++ head/usr.sbin/kldxref/ef_aarch64.c Wed Jan 17 19:59:43 2018 (r328094) @@ -36,8 +36,6 @@ #include "ef.h" -#include - /* * Apply relocations to the values obtained from the file. `relbase' is the * target relocation address of the section, and `dataoff/len' is the region @@ -47,9 +45,9 @@ int ef_reloc(struct elf_file *ef, const void *reldata, int reltype, Elf_Off relbase, Elf_Off dataoff, size_t len, void *dest) { - Elf_Addr *where, addend; - Elf_Size rtype, symidx; - const Elf_Rela *rela; + Elf_Addr *where, addend; + Elf_Size rtype; + const Elf_Rela *rela; if (reltype != EF_RELOC_RELA) return (EINVAL); @@ -58,10 +56,9 @@ ef_reloc(struct elf_file *ef, const void *reldata, int where = (Elf_Addr *) ((Elf_Off)dest - dataoff + rela->r_offset); addend = rela->r_addend; rtype = ELF_R_TYPE(rela->r_info); - symidx = ELF_R_SYM(rela->r_info); if ((char *)where < (char *)dest || (char *)where >= (char *)dest + len) - return (0); + return (0); switch(rtype) { case R_AARCH64_RELATIVE: Modified: head/usr.sbin/kldxref/ef_obj.c ============================================================================== --- head/usr.sbin/kldxref/ef_obj.c Wed Jan 17 18:18:33 2018 (r328093) +++ head/usr.sbin/kldxref/ef_obj.c Wed Jan 17 19:59:43 2018 (r328094) @@ -38,17 +38,17 @@ #include #include -#include + +#include +#include +#include #include #include +#include #include -#include -#include #include #define FREEBSD_ELF -#include - #include "ef.h" typedef struct { @@ -101,39 +101,41 @@ struct ef_file { int ef_verbose; }; -static int ef_obj_get_type(elf_file_t ef); -static int ef_obj_close(elf_file_t ef); -static int ef_obj_read(elf_file_t ef, Elf_Off offset, size_t len, void* dest); -static int ef_obj_read_entry(elf_file_t ef, Elf_Off offset, size_t len, - void **ptr); -static int ef_obj_seg_read(elf_file_t ef, Elf_Off offset, size_t len, - void *dest); -static int ef_obj_seg_read_rel(elf_file_t ef, Elf_Off offset, size_t len, - void *dest); -static int ef_obj_seg_read_string(elf_file_t ef, Elf_Off offset, size_t len, - char *dest); -static int ef_obj_seg_read_entry(elf_file_t ef, Elf_Off offset, size_t len, - void **ptr); -static int ef_obj_seg_read_entry_rel(elf_file_t ef, Elf_Off offset, size_t len, - void **ptr); -static Elf_Addr ef_obj_symaddr(elf_file_t ef, Elf_Size symidx); -static int ef_obj_lookup_set(elf_file_t ef, const char *name, long *startp, - long *stopp, long *countp); -static int ef_obj_lookup_symbol(elf_file_t ef, const char* name, Elf_Sym** sym); +static int ef_obj_get_type(elf_file_t ef); +static int ef_obj_close(elf_file_t ef); +static int ef_obj_read(elf_file_t ef, Elf_Off offset, size_t len, + void* dest); +static int ef_obj_read_entry(elf_file_t ef, Elf_Off offset, size_t len, + void **ptr); +static int ef_obj_seg_read(elf_file_t ef, Elf_Off offset, size_t len, + void *dest); +static int ef_obj_seg_read_rel(elf_file_t ef, Elf_Off offset, size_t len, + void *dest); +static int ef_obj_seg_read_string(elf_file_t ef, Elf_Off offset, + size_t len, char *dest); +static int ef_obj_seg_read_entry(elf_file_t ef, Elf_Off offset, size_t len, + void **ptr); +static int ef_obj_seg_read_entry_rel(elf_file_t ef, Elf_Off offset, + size_t len, void **ptr); +static Elf_Addr ef_obj_symaddr(elf_file_t ef, Elf_Size symidx); +static int ef_obj_lookup_set(elf_file_t ef, const char *name, long *startp, + long *stopp, long *countp); +static int ef_obj_lookup_symbol(elf_file_t ef, const char* name, + Elf_Sym** sym); static struct elf_file_ops ef_obj_file_ops = { - ef_obj_get_type, - ef_obj_close, - ef_obj_read, - ef_obj_read_entry, - ef_obj_seg_read, - ef_obj_seg_read_rel, - ef_obj_seg_read_string, - ef_obj_seg_read_entry, - ef_obj_seg_read_entry_rel, - ef_obj_symaddr, - ef_obj_lookup_set, - ef_obj_lookup_symbol + .get_type = ef_obj_get_type, + .close = ef_obj_close, + .read = ef_obj_read, + .read_entry = ef_obj_read_entry, + .seg_read = ef_obj_seg_read, + .seg_read_rel = ef_obj_seg_read_rel, + .seg_read_string = ef_obj_seg_read_string, + .seg_read_entry = ef_obj_seg_read_entry, + .seg_read_entry_rel = ef_obj_seg_read_entry_rel, + .symaddr = ef_obj_symaddr, + .lookup_set = ef_obj_lookup_set, + .lookup_symbol = ef_obj_lookup_symbol }; static int @@ -154,10 +156,10 @@ ef_obj_lookup_symbol(elf_file_t ef, const char* name, strp = ef->ddbstrtab + symp->st_name; if (symp->st_shndx != SHN_UNDEF && strcmp(name, strp) == 0) { *sym = symp; - return 0; + return (0); } } - return ENOENT; + return (ENOENT); } static int @@ -200,14 +202,14 @@ ef_obj_read(elf_file_t ef, Elf_Off offset, size_t len, if (offset != (Elf_Off)-1) { if (lseek(ef->ef_fd, offset, SEEK_SET) == -1) - return EIO; + return (EIO); } r = read(ef->ef_fd, dest, len); if (r != -1 && (size_t)r == len) - return 0; + return (0); else - return EIO; + return (EIO); } static int @@ -217,11 +219,11 @@ ef_obj_read_entry(elf_file_t ef, Elf_Off offset, size_ *ptr = malloc(len); if (*ptr == NULL) - return ENOMEM; + return (errno); error = ef_obj_read(ef, offset, len, *ptr); - if (error) + if (error != 0) free(*ptr); - return error; + return (error); } static int @@ -329,11 +331,11 @@ ef_obj_seg_read_entry(elf_file_t ef, Elf_Off offset, s *ptr = malloc(len); if (*ptr == NULL) - return ENOMEM; + return (errno); error = ef_obj_seg_read(ef, offset, len, *ptr); - if (error) + if (error != 0) free(*ptr); - return error; + return (error); } static int @@ -344,11 +346,11 @@ ef_obj_seg_read_entry_rel(elf_file_t ef, Elf_Off offse *ptr = malloc(len); if (*ptr == NULL) - return ENOMEM; + return (errno); error = ef_obj_seg_read_rel(ef, offset, len, *ptr); - if (error) + if (error != 0) free(*ptr); - return error; + return (error); } int @@ -365,14 +367,14 @@ ef_obj_open(const char *filename, struct elf_file *efi int i, j, nbytes, nsym, shstrindex, symstrindex, symtabindex; if (filename == NULL) - return EFTYPE; + return (EINVAL); if ((fd = open(filename, O_RDONLY)) == -1) - return errno; + return (errno); ef = calloc(1, sizeof(*ef)); if (ef == NULL) { close(fd); - return (ENOMEM); + return (errno); } efile->ef_ef = ef; @@ -587,9 +589,9 @@ ef_obj_open(const char *filename, struct elf_file *efi } error = 0; out: - if (error) + if (error != 0) ef_obj_close(ef); - return error; + return (error); } static int @@ -628,5 +630,5 @@ ef_obj_close(elf_file_t ef) ef->ef_efile->ef_ef = NULL; free(ef); - return 0; + return (0); } Modified: head/usr.sbin/kldxref/ef_powerpc.c ============================================================================== --- head/usr.sbin/kldxref/ef_powerpc.c Wed Jan 17 18:18:33 2018 (r328093) +++ head/usr.sbin/kldxref/ef_powerpc.c Wed Jan 17 19:59:43 2018 (r328094) @@ -38,8 +38,6 @@ #include "ef.h" -#include - /* * Apply relocations to the values obtained from the file. `relbase' is the * target relocation address of the section, and `dataoff/len' is the region @@ -49,9 +47,9 @@ int ef_reloc(struct elf_file *ef, const void *reldata, int reltype, Elf_Off relbase, Elf_Off dataoff, size_t len, void *dest) { - Elf_Addr *where, addend; - Elf_Size rtype, symidx; - const Elf_Rela *rela; + Elf_Addr *where, addend; + Elf_Size rtype; + const Elf_Rela *rela; if (reltype != EF_RELOC_RELA) return (EINVAL); @@ -60,17 +58,16 @@ ef_reloc(struct elf_file *ef, const void *reldata, int where = (Elf_Addr *) ((Elf_Off)dest - dataoff + rela->r_offset); addend = rela->r_addend; rtype = ELF_R_TYPE(rela->r_info); - symidx = ELF_R_SYM(rela->r_info); if ((char *)where < (char *)dest || (char *)where >= (char *)dest + len) - return (0); + return (0); switch(rtype) { case R_PPC_RELATIVE: /* word32 B + A */ *where = relbase + addend; break; default: - warnx("unhandled relocation type %d", rtype); + warnx("unhandled relocation type %lu", rtype); } return (0); } Modified: head/usr.sbin/kldxref/kldxref.c ============================================================================== --- head/usr.sbin/kldxref/kldxref.c Wed Jan 17 18:18:33 2018 (r328093) +++ head/usr.sbin/kldxref/kldxref.c Wed Jan 17 19:59:43 2018 (r328094) @@ -45,21 +45,23 @@ #include #include #define FREEBSD_ELF + #include +#include #include -#include -#include +#include #include #include +#include #include -#include +#include #include "ef.h" #define MAXRECSIZE (64 << 10) /* 64k */ #define check(val) if ((error = (val)) != 0) break -static int dflag; /* do not create a hint file, only write on stdout */ +static bool dflag; /* do not create a hint file, only write on stdout */ static int verbose; static FILE *fxref; /* current hints file */ @@ -76,12 +78,14 @@ static int reccnt; /* total record written to this fil static void intalign(void) { + recpos = roundup2(recpos, sizeof(int)); } static void record_start(void) { + recpos = 0; memset(recbuf, 0, MAXRECSIZE); } @@ -89,22 +93,24 @@ record_start(void) static int record_end(void) { + if (recpos == 0) - return 0; + return (0); reccnt++; intalign(); fwrite(&recpos, sizeof(recpos), 1, fxref); - return fwrite(recbuf, recpos, 1, fxref) != 1 ? errno : 0; + return (fwrite(recbuf, recpos, 1, fxref) != 1 ? errno : 0); } static int -record_buf(const void *buf, int size) +record_buf(const void *buf, size_t size) { + if (MAXRECSIZE - recpos < size) errx(1, "record buffer overflow"); memcpy(recbuf + recpos, buf, size); recpos += size; - return 0; + return (0); } /* @@ -113,8 +119,9 @@ record_buf(const void *buf, int size) static int record_int(int val) { + intalign(); - return record_buf(&val, sizeof(val)); + return (record_buf(&val, sizeof(val))); } /* @@ -123,18 +130,19 @@ record_int(int val) static int record_string(const char *str) { - int len, error; + int error; + size_t len; u_char val; if (dflag) - return 0; + return (0); val = len = strlen(str); if (len > 255) errx(1, "string %s too long", str); error = record_buf(&val, sizeof(val)); - if (error) - return error; - return record_buf(str, len); + if (error != 0) + return (error); + return (record_buf(str, len)); } /* From sys/isa/pnp.c */ @@ -155,7 +163,7 @@ pnp_eisaformat(uint32_t id) idbuf[5] = hextoascii[(data[3] >> 4)]; idbuf[6] = hextoascii[(data[3] & 0xf)]; idbuf[7] = 0; - return(idbuf); + return (idbuf); } struct pnp_elt @@ -223,13 +231,15 @@ typedef TAILQ_HEAD(pnp_head, pnp_elt) pnp_list; static int parse_pnp_list(const char *desc, char **new_desc, pnp_list *list) { - const char *walker = desc, *ep = desc + strlen(desc); + const char *walker, *ep; const char *colon, *semi; struct pnp_elt *elt; char *nd; char type[8], key[32]; int off; + walker = desc; + ep = desc + strlen(desc); off = 0; nd = *new_desc = malloc(strlen(desc) + 1); if (verbose > 1) @@ -243,7 +253,7 @@ parse_pnp_list(const char *desc, char **new_desc, pnp_ goto err; strncpy(type, walker, colon - walker); type[colon - walker] = '\0'; - if (semi) { + if (semi != NULL) { if (semi - colon >= sizeof(key)) goto err; strncpy(key, colon + 1, semi - colon - 1); @@ -358,7 +368,7 @@ parse_pnp_list(const char *desc, char **new_desc, pnp_ } } *nd++ = '\0'; - return 0; + return (0); err: errx(1, "Parse error of description string %s", desc); } @@ -371,11 +381,14 @@ parse_entry(struct mod_metadata *md, const char *cval, struct mod_version mdv; struct mod_pnp_match_info pnp; char descr[1024]; - Elf_Off data = (Elf_Off)md->md_data; - int error = 0, i, len; + Elf_Off data; + int error, i; + size_t len; char *walker; void *table; + data = (Elf_Off)md->md_data; + error = 0; record_start(); switch (md->md_type) { case MDT_DEPEND: @@ -524,7 +537,7 @@ parse_entry(struct mod_metadata *md, const char *cval, } if (!error) record_end(); - return error; + return (error); } static int @@ -533,34 +546,26 @@ read_kld(char *filename, char *kldname) struct mod_metadata md; struct elf_file ef; void **p, **orgp; - int error, eftype, nmlen; + int error, eftype; long start, finish, entries; - char kldmodname[MAXMODNAME + 1], cval[MAXMODNAME + 1], *cp; + char cval[MAXMODNAME + 1]; if (verbose || dflag) printf("%s\n", filename); error = ef_open(filename, &ef, verbose); - if (error) { + if (error != 0) { error = ef_obj_open(filename, &ef, verbose); - if (error) { + if (error != 0) { if (verbose) warnc(error, "elf_open(%s)", filename); - return error; + return (error); } } eftype = EF_GET_TYPE(&ef); if (eftype != EFT_KLD && eftype != EFT_KERNEL) { EF_CLOSE(&ef); - return 0; + return (0); } - if (!dflag) { - cp = strrchr(kldname, '.'); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Jan 17 20:43:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EAA20EB641E; Wed, 17 Jan 2018 20:43:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AD44B81523; Wed, 17 Jan 2018 20:43:31 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EEAE6147D4; Wed, 17 Jan 2018 20:43:30 +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 w0HKhUMw072433; Wed, 17 Jan 2018 20:43:30 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0HKhUZ4072432; Wed, 17 Jan 2018 20:43:30 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201801172043.w0HKhUZ4072432@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 17 Jan 2018 20:43:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328095 - head/usr.sbin/kldxref X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.sbin/kldxref X-SVN-Commit-Revision: 328095 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jan 2018 20:43:32 -0000 Author: emaste Date: Wed Jan 17 20:43:30 2018 New Revision: 328095 URL: https://svnweb.freebsd.org/changeset/base/328095 Log: kldxref: additional sytle(9) cleanup Reported by: kib (via comments in D13957) Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/kldxref/ef.c Modified: head/usr.sbin/kldxref/ef.c ============================================================================== --- head/usr.sbin/kldxref/ef.c Wed Jan 17 19:59:43 2018 (r328094) +++ head/usr.sbin/kldxref/ef.c Wed Jan 17 20:43:30 2018 (r328095) @@ -85,7 +85,7 @@ static int ef_parse_dynamic(elf_file_t); static int ef_get_type(elf_file_t ef); static int ef_close(elf_file_t ef); -static int ef_read(elf_file_t ef, Elf_Off offset, size_t len, void* dest); +static int ef_read(elf_file_t ef, Elf_Off offset, size_t len, void *dest); static int ef_read_entry(elf_file_t ef, Elf_Off offset, size_t len, void **ptr); @@ -103,8 +103,8 @@ static int ef_seg_read_entry_rel(elf_file_t ef, Elf_Of static Elf_Addr ef_symaddr(elf_file_t ef, Elf_Size symidx); static int ef_lookup_set(elf_file_t ef, const char *name, long *startp, long *stopp, long *countp); -static int ef_lookup_symbol(elf_file_t ef, const char* name, - Elf_Sym** sym); +static int ef_lookup_symbol(elf_file_t ef, const char *name, + Elf_Sym **sym); static struct elf_file_ops ef_file_ops = { .get_type = ef_get_type, @@ -178,7 +178,7 @@ elf_hash(const char *name) } static int -ef_lookup_symbol(elf_file_t ef, const char* name, Elf_Sym** sym) +ef_lookup_symbol(elf_file_t ef, const char *name, Elf_Sym **sym) { unsigned long hash, symnum; Elf_Sym *symp; @@ -300,7 +300,7 @@ ef_parse_dynamic(elf_file_t ef) ef->ef_nchains = hashhdr[1]; error = ef_read_entry(ef, -1, (hashhdr[0] + hashhdr[1]) * sizeof(Elf_Hashelt), - (void**)&ef->ef_hashtab); + (void **)&ef->ef_hashtab); if (error != 0) { warnx("can't read hash table"); return (error); @@ -363,14 +363,14 @@ ef_parse_dynamic(elf_file_t ef) } if (ef_read_entry(ef, ef_get_offset(ef, ef->ef_symoff), ef->ef_nchains * sizeof(Elf_Sym), - (void**)&ef->ef_symtab) != 0) { + (void **)&ef->ef_symtab) != 0) { if (ef->ef_verbose) warnx("%s: can't load .dynsym section (0x%lx)", ef->ef_name, (long)ef->ef_symoff); return (EIO); } if (ef_read_entry(ef, ef_get_offset(ef, ef->ef_stroff), ef->ef_strsz, - (void**)&ef->ef_strtab) != 0) { + (void **)&ef->ef_strtab) != 0) { warnx("can't load .dynstr section"); return (EIO); } @@ -428,7 +428,7 @@ ef_parse_dynamic(elf_file_t ef) } static int -ef_read(elf_file_t ef, Elf_Off offset, size_t len, void*dest) +ef_read(elf_file_t ef, Elf_Off offset, size_t len, void *dest) { ssize_t r; @@ -445,7 +445,7 @@ ef_read(elf_file_t ef, Elf_Off offset, size_t len, voi } static int -ef_read_entry(elf_file_t ef, Elf_Off offset, size_t len, void**ptr) +ef_read_entry(elf_file_t ef, Elf_Off offset, size_t len, void **ptr) { int error; @@ -459,7 +459,7 @@ ef_read_entry(elf_file_t ef, Elf_Off offset, size_t le } static int -ef_seg_read(elf_file_t ef, Elf_Off offset, size_t len, void*dest) +ef_seg_read(elf_file_t ef, Elf_Off offset, size_t len, void *dest) { u_long ofs; @@ -470,11 +470,11 @@ ef_seg_read(elf_file_t ef, Elf_Off offset, size_t len, ef->ef_name, (long)offset, ofs); return (EFAULT); } - return ef_read(ef, ofs, len, dest); + return (ef_read(ef, ofs, len, dest)); } static int -ef_seg_read_rel(elf_file_t ef, Elf_Off offset, size_t len, void*dest) +ef_seg_read_rel(elf_file_t ef, Elf_Off offset, size_t len, void *dest) { u_long ofs; const Elf_Rela *a; @@ -530,7 +530,7 @@ ef_seg_read_string(elf_file_t ef, Elf_Off offset, size } static int -ef_seg_read_entry(elf_file_t ef, Elf_Off offset, size_t len, void**ptr) +ef_seg_read_entry(elf_file_t ef, Elf_Off offset, size_t len, void **ptr) { int error; @@ -544,7 +544,7 @@ ef_seg_read_entry(elf_file_t ef, Elf_Off offset, size_ } static int -ef_seg_read_entry_rel(elf_file_t ef, Elf_Off offset, size_t len, void**ptr) +ef_seg_read_entry_rel(elf_file_t ef, Elf_Off offset, size_t len, void **ptr) { int error; @@ -604,7 +604,7 @@ ef_open(const char *filename, struct elf_file *efile, break; phlen = hdr->e_phnum * sizeof(Elf_Phdr); if (ef_read_entry(ef, hdr->e_phoff, phlen, - (void**)&ef->ef_ph) != 0) + (void **)&ef->ef_ph) != 0) break; phdr = ef->ef_ph; phlimit = phdr + hdr->e_phnum; @@ -639,7 +639,7 @@ ef_open(const char *filename, struct elf_file *efile, } ef->ef_nsegs = nsegs; if (ef_read_entry(ef, phdyn->p_offset, - phdyn->p_filesz, (void**)&ef->ef_dyn) != 0) { + phdyn->p_filesz, (void **)&ef->ef_dyn) != 0) { printf("ef_read_entry failed\n"); break; } From owner-svn-src-head@freebsd.org Wed Jan 17 21:52:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2181DEBA056; Wed, 17 Jan 2018 21:52:14 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F0DF21D3; Wed, 17 Jan 2018 21:52:13 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3AB7E1531F; Wed, 17 Jan 2018 21:52:13 +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 w0HLqD4m000510; Wed, 17 Jan 2018 21:52:13 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0HLqD7A000508; Wed, 17 Jan 2018 21:52:13 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201801172152.w0HLqD7A000508@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 17 Jan 2018 21:52:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328096 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 328096 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jan 2018 21:52:14 -0000 Author: markj Date: Wed Jan 17 21:52:12 2018 New Revision: 328096 URL: https://svnweb.freebsd.org/changeset/base/328096 Log: Annotate a couple of changes from r328083. Reviewed by: kib X-MFC with: r328083 Modified: head/sys/amd64/amd64/exception.S head/sys/amd64/amd64/machdep.c Modified: head/sys/amd64/amd64/exception.S ============================================================================== --- head/sys/amd64/amd64/exception.S Wed Jan 17 20:43:30 2018 (r328095) +++ head/sys/amd64/amd64/exception.S Wed Jan 17 21:52:12 2018 (r328096) @@ -325,7 +325,7 @@ page_cr2: movq PCPU(KCR3),%rax movq %rax,%cr3 movq PCPU(RSP0),%rax - subq $2*PTI_SIZE-3*8,%rax + subq $2*PTI_SIZE-3*8,%rax /* no err, %rax, %rdx in faulted frame */ MOVE_STACKS (PTI_SIZE / 4 - 3) movq %rax,%rsp popq %rdx Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Wed Jan 17 20:43:30 2018 (r328095) +++ head/sys/amd64/amd64/machdep.c Wed Jan 17 21:52:12 2018 (r328096) @@ -115,6 +115,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -146,6 +147,14 @@ __FBSDID("$FreeBSD$"); /* Sanity check for __curthread() */ CTASSERT(offsetof(struct pcpu, pc_curthread) == 0); + +/* + * The PTI trampoline stack needs enough space for a hardware trapframe and a + * couple of scratch registers, as well as the trapframe left behind after an + * iret fault. + */ +CTASSERT(PC_PTI_STACK_SZ * sizeof(register_t) >= 2 * sizeof(struct pti_frame) - + offsetof(struct pti_frame, pti_rip)); extern u_int64_t hammer_time(u_int64_t, u_int64_t); From owner-svn-src-head@freebsd.org Wed Jan 17 22:33:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D428EBC550; Wed, 17 Jan 2018 22:33:21 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E006A22E1; Wed, 17 Jan 2018 22:33:20 +0000 (UTC) (envelope-from landonf@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 06B89159BC; Wed, 17 Jan 2018 22:33:20 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0HMXJVb018470; Wed, 17 Jan 2018 22:33:19 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0HMXJsM018468; Wed, 17 Jan 2018 22:33:19 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201801172233.w0HMXJsM018468@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Wed, 17 Jan 2018 22:33:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328098 - head/sys/dev/bwn X-SVN-Group: head X-SVN-Commit-Author: landonf X-SVN-Commit-Paths: head/sys/dev/bwn X-SVN-Commit-Revision: 328098 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jan 2018 22:33:21 -0000 Author: landonf Date: Wed Jan 17 22:33:19 2018 New Revision: 328098 URL: https://svnweb.freebsd.org/changeset/base/328098 Log: bwn(4): Enable, by default, the opt-in support for bhnd(4) introduced in r326454. bwn(4)/bhnd(4) has been tested with most chipsets currently supported by bwn(4), and this change should be transparent to existing bwn(4) users; please report any regressions that you do encounter. To revert to using siba_bwn(4) instead of bhnd(4), place the following lines in loader.conf(5): hw.bwn_pci.preferred="0" Once we're satisfied that the switch to bhnd(4) has seen sufficient broader testing, bwn(4) will be migrated to use the native bhnd(9) interface directly, and support for siba_bwn(4) will be dropped (see D13518). Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/bwn/if_bwn.c head/sys/dev/bwn/if_bwn_pci.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Wed Jan 17 22:10:58 2018 (r328097) +++ head/sys/dev/bwn/if_bwn.c Wed Jan 17 22:33:19 2018 (r328098) @@ -7493,6 +7493,7 @@ driver_t bwn_driver = { }; static devclass_t bwn_devclass; DRIVER_MODULE(bwn, siba_bwn, bwn_driver, bwn_devclass, 0, 0); +MODULE_DEPEND(bwn, bwn_pci, 1, 1, 1); MODULE_DEPEND(bwn, siba_bwn, 1, 1, 1); MODULE_DEPEND(bwn, gpiobus, 1, 1, 1); MODULE_DEPEND(bwn, wlan, 1, 1, 1); /* 802.11 media layer */ Modified: head/sys/dev/bwn/if_bwn_pci.c ============================================================================== --- head/sys/dev/bwn/if_bwn_pci.c Wed Jan 17 22:10:58 2018 (r328097) +++ head/sys/dev/bwn/if_bwn_pci.c Wed Jan 17 22:33:19 2018 (r328098) @@ -55,7 +55,7 @@ static int attach_untested = 0; TUNABLE_INT("hw.bwn_pci.attach_untested", &attach_untested); /* If non-zero, probe at a higher priority than the stable if_bwn driver. */ -static int prefer_new_driver = 0; +static int prefer_new_driver = 1; TUNABLE_INT("hw.bwn_pci.preferred", &prefer_new_driver); /* SIBA Devices */ @@ -300,9 +300,9 @@ DRIVER_MODULE_ORDERED(bwn_pci, pci, bwn_pci_driver, bw NULL, SI_ORDER_ANY); DRIVER_MODULE(bhndb, bwn_pci, bhndb_pci_driver, bhndb_devclass, NULL, NULL); -MODULE_DEPEND(bwn_pci, bwn, 1, 1, 1); MODULE_DEPEND(bwn_pci, bhnd, 1, 1, 1); MODULE_DEPEND(bwn_pci, bhndb, 1, 1, 1); MODULE_DEPEND(bwn_pci, bhndb_pci, 1, 1, 1); MODULE_DEPEND(bwn_pci, bcma_bhndb, 1, 1, 1); MODULE_DEPEND(bwn_pci, siba_bhndb, 1, 1, 1); +MODULE_VERSION(bwn_pci, 1); From owner-svn-src-head@freebsd.org Wed Jan 17 22:37:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09AA2EBC7DD; Wed, 17 Jan 2018 22:37:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C0A7626BB; Wed, 17 Jan 2018 22:37: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E86D0159E0; Wed, 17 Jan 2018 22:36:59 +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 w0HMaxFe018812; Wed, 17 Jan 2018 22:36:59 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0HMawpn018801; Wed, 17 Jan 2018 22:36:58 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201801172236.w0HMawpn018801@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 17 Jan 2018 22:36:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328099 - in head/sys: fs/fdescfs fs/nfs fs/nfsserver fs/smbfs fs/tmpfs i386/ibcs2 kern sys X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys: fs/fdescfs fs/nfs fs/nfsserver fs/smbfs fs/tmpfs i386/ibcs2 kern sys X-SVN-Commit-Revision: 328099 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jan 2018 22:37:01 -0000 Author: jhb Date: Wed Jan 17 22:36:58 2018 New Revision: 328099 URL: https://svnweb.freebsd.org/changeset/base/328099 Log: Use long for the last argument to VOP_PATHCONF rather than a register_t. pathconf(2) and fpathconf(2) both return a long. The kern_[f]pathconf() functions now accept a pointer to a long value rather than modifying td_retval directly. Instead, the system calls explicitly store the returned long value in td_retval[0]. Requested by: bde Reviewed by: kib Sponsored by: Chelsio Communications Modified: head/sys/fs/fdescfs/fdesc_vnops.c head/sys/fs/nfs/nfs_commonport.c head/sys/fs/nfs/nfs_var.h head/sys/fs/nfsserver/nfs_nfsdserv.c head/sys/fs/smbfs/smbfs_vnops.c head/sys/fs/tmpfs/tmpfs_vnops.c head/sys/i386/ibcs2/ibcs2_misc.c head/sys/kern/kern_descrip.c head/sys/kern/vfs_syscalls.c head/sys/kern/vnode_if.src head/sys/sys/syscallsubr.h Modified: head/sys/fs/fdescfs/fdesc_vnops.c ============================================================================== --- head/sys/fs/fdescfs/fdesc_vnops.c Wed Jan 17 22:33:19 2018 (r328098) +++ head/sys/fs/fdescfs/fdesc_vnops.c Wed Jan 17 22:36:58 2018 (r328099) @@ -418,7 +418,7 @@ fdesc_pathconf(struct vop_pathconf_args *ap) vref(vp); VOP_UNLOCK(vp, 0); error = kern_fpathconf(curthread, VTOFDESC(vp)->fd_fd, - ap->a_name); + ap->a_name, ap->a_retval); vn_lock(vp, LK_SHARED | LK_RETRY); vunref(vp); return (error); Modified: head/sys/fs/nfs/nfs_commonport.c ============================================================================== --- head/sys/fs/nfs/nfs_commonport.c Wed Jan 17 22:33:19 2018 (r328098) +++ head/sys/fs/nfs/nfs_commonport.c Wed Jan 17 22:36:58 2018 (r328099) @@ -316,7 +316,7 @@ nfsvno_getfs(struct nfsfsinfo *sip, int isdgram) * Do the pathconf vnode op. */ int -nfsvno_pathconf(struct vnode *vp, int flag, register_t *retf, +nfsvno_pathconf(struct vnode *vp, int flag, long *retf, struct ucred *cred, struct thread *p) { int error; @@ -688,7 +688,7 @@ int nfs_supportsnfsv4acls(struct vnode *vp) { int error; - register_t retval; + long retval; ASSERT_VOP_LOCKED(vp, "nfs supports nfsv4acls"); Modified: head/sys/fs/nfs/nfs_var.h ============================================================================== --- head/sys/fs/nfs/nfs_var.h Wed Jan 17 22:33:19 2018 (r328098) +++ head/sys/fs/nfs/nfs_var.h Wed Jan 17 22:36:58 2018 (r328099) @@ -371,8 +371,7 @@ struct ucred *newnfs_getcred(void); void newnfs_setroot(struct ucred *); int nfs_catnap(int, int, const char *); struct nfsreferral *nfsv4root_getreferral(vnode_t, vnode_t, u_int32_t); -int nfsvno_pathconf(vnode_t, int, register_t *, struct ucred *, - NFSPROC_T *); +int nfsvno_pathconf(vnode_t, int, long *, struct ucred *, NFSPROC_T *); int nfsrv_atroot(vnode_t, uint64_t *); void newnfs_timer(void *); int nfs_supportsnfsv4acls(vnode_t); Modified: head/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdserv.c Wed Jan 17 22:33:19 2018 (r328098) +++ head/sys/fs/nfsserver/nfs_nfsdserv.c Wed Jan 17 22:36:58 2018 (r328099) @@ -2133,7 +2133,7 @@ nfsrvd_pathconf(struct nfsrv_descript *nd, __unused in { struct nfsv3_pathconf *pc; int getret = 1; - register_t linkmax, namemax, chownres, notrunc; + long linkmax, namemax, chownres, notrunc; struct nfsvattr at; if (nd->nd_repstat) { Modified: head/sys/fs/smbfs/smbfs_vnops.c ============================================================================== --- head/sys/fs/smbfs/smbfs_vnops.c Wed Jan 17 22:33:19 2018 (r328098) +++ head/sys/fs/smbfs/smbfs_vnops.c Wed Jan 17 22:36:58 2018 (r328099) @@ -895,7 +895,7 @@ smbfs_pathconf (ap) { struct smbmount *smp = VFSTOSMBFS(VTOVFS(ap->a_vp)); struct smb_vc *vcp = SSTOVC(smp->sm_share); - register_t *retval = ap->a_retval; + long *retval = ap->a_retval; int error = 0; switch (ap->a_name) { Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Wed Jan 17 22:33:19 2018 (r328098) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Wed Jan 17 22:36:58 2018 (r328099) @@ -1343,7 +1343,7 @@ tmpfs_pathconf(struct vop_pathconf_args *v) { struct vnode *vp = v->a_vp; int name = v->a_name; - register_t *retval = v->a_retval; + long *retval = v->a_retval; int error; Modified: head/sys/i386/ibcs2/ibcs2_misc.c ============================================================================== --- head/sys/i386/ibcs2/ibcs2_misc.c Wed Jan 17 22:33:19 2018 (r328098) +++ head/sys/i386/ibcs2/ibcs2_misc.c Wed Jan 17 22:36:58 2018 (r328099) @@ -737,12 +737,16 @@ int ibcs2_pathconf(struct thread *td, struct ibcs2_pathconf_args *uap) { char *path; + long value; int error; CHECKALTEXIST(td, uap->path, &path); uap->name++; /* iBCS2 _PC_* defines are offset by one */ - error = kern_pathconf(td, path, UIO_SYSSPACE, uap->name, FOLLOW); + error = kern_pathconf(td, path, UIO_SYSSPACE, uap->name, FOLLOW, + &value); free(path, M_TEMP); + if (error == 0) + td->td_retval[0] = value; return (error); } Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Wed Jan 17 22:33:19 2018 (r328098) +++ head/sys/kern/kern_descrip.c Wed Jan 17 22:36:58 2018 (r328099) @@ -1418,12 +1418,17 @@ struct fpathconf_args { int sys_fpathconf(struct thread *td, struct fpathconf_args *uap) { + long value; + int error; - return (kern_fpathconf(td, uap->fd, uap->name)); + error = kern_fpathconf(td, uap->fd, uap->name, &value); + if (error == 0) + td->td_retval[0] = value; + return (error); } int -kern_fpathconf(struct thread *td, int fd, int name) +kern_fpathconf(struct thread *td, int fd, int name, long *valuep) { struct file *fp; struct vnode *vp; @@ -1435,19 +1440,19 @@ kern_fpathconf(struct thread *td, int fd, int name) return (error); if (name == _PC_ASYNC_IO) { - td->td_retval[0] = _POSIX_ASYNCHRONOUS_IO; + *valuep = _POSIX_ASYNCHRONOUS_IO; goto out; } vp = fp->f_vnode; if (vp != NULL) { vn_lock(vp, LK_SHARED | LK_RETRY); - error = VOP_PATHCONF(vp, name, td->td_retval); + error = VOP_PATHCONF(vp, name, valuep); VOP_UNLOCK(vp, 0); } else if (fp->f_type == DTYPE_PIPE || fp->f_type == DTYPE_SOCKET) { if (name != _PC_PIPE_BUF) { error = EINVAL; } else { - td->td_retval[0] = PIPE_BUF; + *valuep = PIPE_BUF; error = 0; } } else { Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Wed Jan 17 22:33:19 2018 (r328098) +++ head/sys/kern/vfs_syscalls.c Wed Jan 17 22:36:58 2018 (r328099) @@ -2384,8 +2384,14 @@ struct pathconf_args { int sys_pathconf(struct thread *td, struct pathconf_args *uap) { + long value; + int error; - return (kern_pathconf(td, uap->path, UIO_USERSPACE, uap->name, FOLLOW)); + error = kern_pathconf(td, uap->path, UIO_USERSPACE, uap->name, FOLLOW, + &value); + if (error == 0) + td->td_retval[0] = value; + return (error); } #ifndef _SYS_SYSPROTO_H_ @@ -2397,14 +2403,19 @@ struct lpathconf_args { int sys_lpathconf(struct thread *td, struct lpathconf_args *uap) { + long value; + int error; - return (kern_pathconf(td, uap->path, UIO_USERSPACE, uap->name, - NOFOLLOW)); + error = kern_pathconf(td, uap->path, UIO_USERSPACE, uap->name, + NOFOLLOW, &value); + if (error == 0) + td->td_retval[0] = value; + return (error); } int kern_pathconf(struct thread *td, char *path, enum uio_seg pathseg, int name, - u_long flags) + u_long flags, long *valuep) { struct nameidata nd; int error; @@ -2415,7 +2426,7 @@ kern_pathconf(struct thread *td, char *path, enum uio_ return (error); NDFREE(&nd, NDF_ONLY_PNBUF); - error = VOP_PATHCONF(nd.ni_vp, name, td->td_retval); + error = VOP_PATHCONF(nd.ni_vp, name, valuep); vput(nd.ni_vp); return (error); } Modified: head/sys/kern/vnode_if.src ============================================================================== --- head/sys/kern/vnode_if.src Wed Jan 17 22:33:19 2018 (r328098) +++ head/sys/kern/vnode_if.src Wed Jan 17 22:36:58 2018 (r328099) @@ -429,7 +429,7 @@ vop_print { vop_pathconf { IN struct vnode *vp; IN int name; - OUT register_t *retval; + OUT long *retval; }; Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Wed Jan 17 22:33:19 2018 (r328098) +++ head/sys/sys/syscallsubr.h Wed Jan 17 22:36:58 2018 (r328099) @@ -118,7 +118,7 @@ int kern_fcntl(struct thread *td, int fd, int cmd, int int kern_fcntl_freebsd(struct thread *td, int fd, int cmd, long arg); int kern_fhstat(struct thread *td, fhandle_t fh, struct stat *buf); int kern_fhstatfs(struct thread *td, fhandle_t fh, struct statfs *buf); -int kern_fpathconf(struct thread *td, int fd, int name); +int kern_fpathconf(struct thread *td, int fd, int name, long *valuep); int kern_fstat(struct thread *td, int fd, struct stat *sbp); int kern_fstatfs(struct thread *td, int fd, struct statfs *buf); int kern_fsync(struct thread *td, int fd, bool fullsync); @@ -187,7 +187,7 @@ int kern_ogetdirentries(struct thread *td, struct oget int kern_openat(struct thread *td, int fd, char *path, enum uio_seg pathseg, int flags, int mode); int kern_pathconf(struct thread *td, char *path, enum uio_seg pathseg, - int name, u_long flags); + int name, u_long flags, long *valuep); int kern_pipe(struct thread *td, int fildes[2], int flags, struct filecaps *fcaps1, struct filecaps *fcaps2); int kern_poll(struct thread *td, struct pollfd *fds, u_int nfds, From owner-svn-src-head@freebsd.org Wed Jan 17 22:47:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 369A0EBD471; Wed, 17 Jan 2018 22:47:37 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D0B2A304F; Wed, 17 Jan 2018 22:47:36 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E81BC15B81; Wed, 17 Jan 2018 22:47:35 +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 w0HMlZHC023480; Wed, 17 Jan 2018 22:47:35 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0HMlZtv023471; Wed, 17 Jan 2018 22:47:35 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201801172247.w0HMlZtv023471@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 17 Jan 2018 22:47:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328100 - head/bin/ls X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/bin/ls X-SVN-Commit-Revision: 328100 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jan 2018 22:47:37 -0000 Author: cem Date: Wed Jan 17 22:47:34 2018 New Revision: 328100 URL: https://svnweb.freebsd.org/changeset/base/328100 Log: Convert ls(1) to not use libxo(3) libxo imposes a large burden on system utilities. In the case of ls, that burden is difficult to justify -- any language that can interact with json output can use readdir(3) and stat(2). Logically, this reverts r291607, r285857, r285803, r285734, r285425, r284494, r284489, r284252, and r284198. Kyua tests continue to pass (libxo integration was entirely untested). Reported by: many Reviewed by: imp Discussed with: manu, bdrewery Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D13959 Modified: head/bin/ls/Makefile head/bin/ls/Makefile.depend head/bin/ls/extern.h head/bin/ls/ls.1 head/bin/ls/ls.c head/bin/ls/ls.h head/bin/ls/print.c head/bin/ls/util.c Modified: head/bin/ls/Makefile ============================================================================== --- head/bin/ls/Makefile Wed Jan 17 22:36:58 2018 (r328099) +++ head/bin/ls/Makefile Wed Jan 17 22:47:34 2018 (r328100) @@ -6,7 +6,7 @@ PACKAGE=runtime PROG= ls SRCS= cmp.c ls.c print.c util.c -LIBADD= xo util +LIBADD= util .if !defined(RELEASE_CRUNCH) && \ ${MK_LS_COLORS} != no Modified: head/bin/ls/Makefile.depend ============================================================================== --- head/bin/ls/Makefile.depend Wed Jan 17 22:36:58 2018 (r328099) +++ head/bin/ls/Makefile.depend Wed Jan 17 22:47:34 2018 (r328100) @@ -9,7 +9,6 @@ DIRDEPS = \ lib/libc \ lib/libcompiler_rt \ lib/libutil \ - lib/libxo \ lib/ncurses/ncursesw \ Modified: head/bin/ls/extern.h ============================================================================== --- head/bin/ls/extern.h Wed Jan 17 22:36:58 2018 (r328099) +++ head/bin/ls/extern.h Wed Jan 17 22:47:34 2018 (r328100) @@ -47,17 +47,14 @@ int revsizecmp(const FTSENT *, const FTSENT *); void printcol(const DISPLAY *); void printlong(const DISPLAY *); -int printname(const char *, const char *); +int printname(const char *); void printscol(const DISPLAY *); void printstream(const DISPLAY *); void usage(void); -int prn_normal(const char *, const char *); -char * getname(const char *); +int prn_normal(const char *); size_t len_octal(const char *, int); -int prn_octal(const char *, const char *); -char * get_octal(const char *); -int prn_printable(const char *, const char *); -char * get_printable(const char *); +int prn_octal(const char *); +int prn_printable(const char *); #ifdef COLORLS void parsecolors(const char *cs); void colorquit(int); Modified: head/bin/ls/ls.1 ============================================================================== --- head/bin/ls/ls.1 Wed Jan 17 22:36:58 2018 (r328099) +++ head/bin/ls/ls.1 Wed Jan 17 22:47:34 2018 (r328100) @@ -32,7 +32,7 @@ .\" @(#)ls.1 8.7 (Berkeley) 7/29/94 .\" $FreeBSD$ .\" -.Dd December 1, 2015 +.Dd January 17, 2018 .Dt LS 1 .Os .Sh NAME @@ -40,7 +40,6 @@ .Nd list directory contents .Sh SYNOPSIS .Nm -.Op Fl -libxo .Op Fl ABCFGHILPRSTUWZabcdfghiklmnopqrstuwxy1, .Op Fl D Ar format .Op Ar @@ -69,13 +68,6 @@ lexicographical order. .Pp The following options are available: .Bl -tag -width indent -.It Fl -libxo -Generate output via -.Xr libxo 3 -in a selection of different human and machine readable formats. -See -.Xr xo_parse_args 3 -for details on command line arguments. .It Fl A Include directory entries whose names begin with a dot @@ -805,11 +797,9 @@ specification. .Xr getfacl 1 , .Xr sort 1 , .Xr xterm 1 , -.Xr libxo 3 , .Xr localeconv 3 , .Xr strftime 3 , .Xr strmode 3 , -.Xr xo_parse_args 3 , .Xr termcap 5 , .Xr maclabel 7 , .Xr sticky 7 , Modified: head/bin/ls/ls.c ============================================================================== --- head/bin/ls/ls.c Wed Jan 17 22:36:58 2018 (r328099) +++ head/bin/ls/ls.c Wed Jan 17 22:47:34 2018 (r328100) @@ -68,7 +68,6 @@ __FBSDID("$FreeBSD$"); #include #include #endif -#include #include "ls.h" #include "extern.h" @@ -121,7 +120,7 @@ static int f_nofollow; /* don't follow symbolic link int f_nonprint; /* show unprintables as ? */ static int f_nosort; /* don't sort output */ int f_notabs; /* don't use tab-separated multi-col output */ - int f_numericonly; /* don't convert uid/gid to name */ +static int f_numericonly; /* don't convert uid/gid to name */ int f_octal; /* show unprintables as \xxx */ int f_octal_escape; /* like f_octal but use C escapes if possible */ static int f_recursive; /* ls subdirectories also */ @@ -192,13 +191,6 @@ main(int argc, char *argv[]) fts_options = FTS_PHYSICAL; if (getenv("LS_SAMESORT")) f_samesort = 1; - - argc = xo_parse_args(argc, argv); - if (argc < 0) - return (1); - xo_set_flags(NULL, XOF_COLUMNS); - xo_set_version(LS_XO_VERSION); - while ((ch = getopt(argc, argv, "1ABCD:FGHILPRSTUWXZabcdfghiklmnopqrstuwxy,")) != -1) { switch (ch) { @@ -395,7 +387,7 @@ main(int argc, char *argv[]) f_color = 1; } #else - xo_warnx("color support not compiled in"); + warnx("color support not compiled in"); #endif /*COLORLS*/ #ifdef COLORLS @@ -493,13 +485,10 @@ main(int argc, char *argv[]) else printfcn = printcol; - xo_open_container("file-information"); if (argc) traverse(argc, argv, fts_options); else traverse(1, dotav, fts_options); - xo_close_container("file-information"); - xo_finish(); exit(rval); } @@ -517,11 +506,10 @@ traverse(int argc, char *argv[], int options) FTS *ftsp; FTSENT *p, *chp; int ch_options; - int first = 1; if ((ftsp = fts_open(argv, options, f_nosort ? NULL : mastercmp)) == NULL) - xo_err(1, "fts_open"); + err(1, "fts_open"); /* * We ignore errors from fts_children here since they will be @@ -543,11 +531,11 @@ traverse(int argc, char *argv[], int options) while ((p = fts_read(ftsp)) != NULL) switch (p->fts_info) { case FTS_DC: - xo_warnx("%s: directory causes a cycle", p->fts_name); + warnx("%s: directory causes a cycle", p->fts_name); break; case FTS_DNR: case FTS_ERR: - xo_warnx("%s: %s", p->fts_path, strerror(p->fts_errno)); + warnx("%s: %s", p->fts_path, strerror(p->fts_errno)); rval = 1; break; case FTS_D: @@ -555,40 +543,31 @@ traverse(int argc, char *argv[], int options) p->fts_name[0] == '.' && !f_listdot) break; - if (first) { - first = 0; - xo_open_list("directory"); - } - xo_open_instance("directory"); - /* * If already output something, put out a newline as * a separator. If multiple arguments, precede each * directory with its name. */ if (output) { - xo_emit("\n"); - (void)printname("path", p->fts_path); - xo_emit(":\n"); + putchar('\n'); + (void)printname(p->fts_path); + puts(":"); } else if (argc > 1) { - (void)printname("path", p->fts_path); - xo_emit(":\n"); + (void)printname(p->fts_path); + puts(":"); output = 1; } chp = fts_children(ftsp, ch_options); display(p, chp, options); - xo_close_instance("directory"); if (!f_recursive && chp != NULL) (void)fts_set(ftsp, p, FTS_SKIP); break; default: break; } - if (!first) - xo_close_list("directory"); if (errno) - xo_err(1, "fts_read"); + err(1, "fts_read"); } /* @@ -635,7 +614,7 @@ display(const FTSENT *p, FTSENT *list, int options) /* Fill-in "::" as "0:0:0" for the sake of scanf. */ jinitmax = malloc(strlen(initmax) * 2 + 2); if (jinitmax == NULL) - xo_err(1, "malloc"); + err(1, "malloc"); initmax2 = jinitmax; if (*initmax == ':') strcpy(initmax2, "0:"), initmax2 += 2; @@ -706,7 +685,7 @@ display(const FTSENT *p, FTSENT *list, int options) flags = NULL; for (cur = list, entries = 0; cur; cur = cur->fts_link) { if (cur->fts_info == FTS_ERR || cur->fts_info == FTS_NS) { - xo_warnx("%s: %s", + warnx("%s: %s", cur->fts_name, strerror(cur->fts_errno)); cur->fts_number = NO_PRINT; rval = 1; @@ -772,7 +751,7 @@ display(const FTSENT *p, FTSENT *list, int options) flags = strdup("-"); } if (flags == NULL) - xo_err(1, "fflagstostr"); + err(1, "fflagstostr"); flen = strlen(flags); if (flen > (size_t)maxflags) maxflags = flen; @@ -786,7 +765,7 @@ display(const FTSENT *p, FTSENT *list, int options) error = mac_prepare_file_label(&label); if (error == -1) { - xo_warn("MAC label for %s/%s", + warn("MAC label for %s/%s", cur->fts_parent->fts_path, cur->fts_name); goto label_out; @@ -807,7 +786,7 @@ display(const FTSENT *p, FTSENT *list, int options) error = mac_get_link(name, label); if (error == -1) { - xo_warn("MAC label for %s/%s", + warn("MAC label for %s/%s", cur->fts_parent->fts_path, cur->fts_name); mac_free(label); @@ -817,7 +796,7 @@ display(const FTSENT *p, FTSENT *list, int options) error = mac_to_text(label, &labelstr); if (error == -1) { - xo_warn("MAC label for %s/%s", + warn("MAC label for %s/%s", cur->fts_parent->fts_path, cur->fts_name); mac_free(label); @@ -835,7 +814,7 @@ label_out: if ((np = malloc(sizeof(NAMES) + labelstrlen + ulen + glen + flen + 4)) == NULL) - xo_err(1, "malloc"); + err(1, "malloc"); np->user = &np->data[0]; (void)strcpy(np->user, user); Modified: head/bin/ls/ls.h ============================================================================== --- head/bin/ls/ls.h Wed Jan 17 22:36:58 2018 (r328099) +++ head/bin/ls/ls.h Wed Jan 17 22:47:34 2018 (r328100) @@ -39,8 +39,6 @@ #define HUMANVALSTR_LEN 5 -#define LS_XO_VERSION "1" - extern long blocksize; /* block size units */ extern int f_accesstime; /* use time of last access */ @@ -62,7 +60,6 @@ extern int f_statustime; /* use time of last mode chan extern int f_thousands; /* show file sizes with thousands separators */ extern char *f_timeformat; /* user-specified time format */ extern int f_notabs; /* don't use tab-separated multi-col output */ -extern int f_numericonly; /* don't convert uid/gid to name */ extern int f_type; /* add type character for non-regular files */ #ifdef COLORLS extern int f_color; /* add type in color for non-regular files */ Modified: head/bin/ls/print.c ============================================================================== --- head/bin/ls/print.c Wed Jan 17 22:36:58 2018 (r328099) +++ head/bin/ls/print.c Wed Jan 17 22:47:34 2018 (r328100) @@ -62,7 +62,6 @@ __FBSDID("$FreeBSD$"); #include #include #endif -#include #include "ls.h" #include "extern.h" @@ -70,9 +69,9 @@ __FBSDID("$FreeBSD$"); static int printaname(const FTSENT *, u_long, u_long); static void printdev(size_t, dev_t); static void printlink(const FTSENT *); -static void printtime(const char *, time_t); +static void printtime(time_t); static int printtype(u_int); -static void printsize(const char *, size_t, off_t); +static void printsize(size_t, off_t); #ifdef COLORLS static void endcolor(int); static int colortype(mode_t); @@ -117,32 +116,26 @@ printscol(const DISPLAY *dp) { FTSENT *p; - xo_open_list("entry"); for (p = dp->list; p; p = p->fts_link) { if (IS_NOPRINT(p)) continue; - xo_open_instance("entry"); (void)printaname(p, dp->s_inode, dp->s_block); - xo_close_instance("entry"); - xo_emit("\n"); + (void)putchar('\n'); } - xo_close_list("entry"); } /* * print name in current style */ int -printname(const char *field, const char *name) +printname(const char *name) { - char fmt[BUFSIZ]; - char *s = getname(name); - int rc; - - snprintf(fmt, sizeof(fmt), "{:%s/%%hs}", field); - rc = xo_emit(fmt, s); - free(s); - return rc; + if (f_octal || f_octal_escape) + return prn_octal(name); + else if (f_nonprint) + return prn_printable(name); + else + return prn_normal(name); } static const char * @@ -209,20 +202,6 @@ compute_abbreviated_month_size(void) padding_for_month[i] = month_max_size - months_width[i]; } -/* - * print name in current style - */ -char * -getname(const char *name) -{ - if (f_octal || f_octal_escape) - return get_octal(name); - else if (f_nonprint) - return get_printable(name); - else - return strdup(name); -} - void printlong(const DISPLAY *dp) { @@ -236,83 +215,46 @@ printlong(const DISPLAY *dp) if ((dp->list == NULL || dp->list->fts_level != FTS_ROOTLEVEL) && (f_longform || f_size)) { - xo_emit("{L:total} {:total-blocks/%lu}\n", - howmany(dp->btotal, blocksize)); + (void)printf("total %lu\n", howmany(dp->btotal, blocksize)); } - xo_open_list("entry"); for (p = dp->list; p; p = p->fts_link) { - char *name, *type; if (IS_NOPRINT(p)) continue; - xo_open_instance("entry"); sp = p->fts_statp; - name = getname(p->fts_name); - if (name) - xo_emit("{ke:name/%hs}", name); if (f_inode) - xo_emit("{t:inode/%*ju} ", + (void)printf("%*ju ", dp->s_inode, (uintmax_t)sp->st_ino); if (f_size) - xo_emit("{t:blocks/%*jd} ", + (void)printf("%*jd ", dp->s_block, howmany(sp->st_blocks, blocksize)); strmode(sp->st_mode, buf); aclmode(buf, p); np = p->fts_pointer; - xo_attr("value", "%03o", (int) sp->st_mode & ALLPERMS); - if (f_numericonly) { - xo_emit("{t:mode/%s}{e:mode_octal/%03o} {t:links/%*ju} {td:user/%-*s}{e:user/%ju} {td:group/%-*s}{e:group/%ju} ", - buf, (int) sp->st_mode & ALLPERMS, dp->s_nlink, (uintmax_t)sp->st_nlink, - dp->s_user, np->user, (uintmax_t)sp->st_uid, dp->s_group, np->group, (uintmax_t)sp->st_gid); - } else { - xo_emit("{t:mode/%s}{e:mode_octal/%03o} {t:links/%*ju} {t:user/%-*s} {t:group/%-*s} ", - buf, (int) sp->st_mode & ALLPERMS, dp->s_nlink, (uintmax_t)sp->st_nlink, - dp->s_user, np->user, dp->s_group, np->group); - } - if (S_ISBLK(sp->st_mode)) - asprintf(&type, "block"); - if (S_ISCHR(sp->st_mode)) - asprintf(&type, "character"); - if (S_ISDIR(sp->st_mode)) - asprintf(&type, "directory"); - if (S_ISFIFO(sp->st_mode)) - asprintf(&type, "fifo"); - if (S_ISLNK(sp->st_mode)) - asprintf(&type, "symlink"); - if (S_ISREG(sp->st_mode)) - asprintf(&type, "regular"); - if (S_ISSOCK(sp->st_mode)) - asprintf(&type, "socket"); - if (S_ISWHT(sp->st_mode)) - asprintf(&type, "whiteout"); - xo_emit("{e:type/%s}", type); - free(type); + (void)printf("%s %*ju %-*s %-*s ", buf, dp->s_nlink, + (uintmax_t)sp->st_nlink, dp->s_user, np->user, dp->s_group, + np->group); if (f_flags) - xo_emit("{:flags/%-*s} ", dp->s_flags, np->flags); + (void)printf("%-*s ", dp->s_flags, np->flags); if (f_label) - xo_emit("{t:label/%-*s} ", dp->s_label, np->label); + (void)printf("%-*s ", dp->s_label, np->label); if (S_ISCHR(sp->st_mode) || S_ISBLK(sp->st_mode)) printdev(dp->s_size, sp->st_rdev); else - printsize("size", dp->s_size, sp->st_size); + printsize(dp->s_size, sp->st_size); if (f_accesstime) - printtime("access-time", sp->st_atime); + printtime(sp->st_atime); else if (f_birthtime) - printtime("birth-time", sp->st_birthtime); + printtime(sp->st_birthtime); else if (f_statustime) - printtime("change-time", sp->st_ctime); + printtime(sp->st_ctime); else - printtime("modify-time", sp->st_mtime); + printtime(sp->st_mtime); #ifdef COLORLS if (f_color) color_printed = colortype(sp->st_mode); #endif - - if (name) { - xo_emit("{dk:name/%hs}", name); - free(name); - } - + (void)printname(p->fts_name); #ifdef COLORLS if (f_color && color_printed) endcolor(0); @@ -321,10 +263,8 @@ printlong(const DISPLAY *dp) (void)printtype(sp->st_mode); if (S_ISLNK(sp->st_mode)) printlink(p); - xo_close_instance("entry"); - xo_emit("\n"); + (void)putchar('\n'); } - xo_close_list("entry"); } void @@ -333,27 +273,23 @@ printstream(const DISPLAY *dp) FTSENT *p; int chcnt; - xo_open_list("entry"); for (p = dp->list, chcnt = 0; p; p = p->fts_link) { if (p->fts_number == NO_PRINT) continue; /* XXX strlen does not take octal escapes into account. */ if (strlen(p->fts_name) + chcnt + (p->fts_link ? 2 : 0) >= (unsigned)termwidth) { - xo_emit("\n"); + putchar('\n'); chcnt = 0; } - xo_open_instance("file"); chcnt += printaname(p, dp->s_inode, dp->s_block); - xo_close_instance("file"); if (p->fts_link) { - xo_emit(", "); + printf(", "); chcnt += 2; } } - xo_close_list("entry"); if (chcnt) - xo_emit("\n"); + putchar('\n'); } void @@ -387,6 +323,7 @@ printcol(const DISPLAY *dp) if (dp->entries > lastentries) { if ((narray = realloc(array, dp->entries * sizeof(FTSENT *))) == NULL) { + warn(NULL); printscol(dp); return; } @@ -417,21 +354,17 @@ printcol(const DISPLAY *dp) if ((dp->list == NULL || dp->list->fts_level != FTS_ROOTLEVEL) && (f_longform || f_size)) { - xo_emit("{L:total} {:total-blocks/%lu}\n", - howmany(dp->btotal, blocksize)); + (void)printf("total %lu\n", howmany(dp->btotal, blocksize)); } - xo_open_list("entry"); base = 0; for (row = 0; row < numrows; ++row) { endcol = colwidth; if (!f_sortacross) base = row; for (col = 0, chcnt = 0; col < numcols; ++col) { - xo_open_instance("entry"); chcnt += printaname(array[base], dp->s_inode, dp->s_block); - xo_close_instance("entry"); if (f_sortacross) base++; else @@ -442,14 +375,13 @@ printcol(const DISPLAY *dp) <= endcol) { if (f_sortacross && col + 1 >= numcols) break; - xo_emit(f_notabs ? " " : "\t"); + (void)putchar(f_notabs ? ' ' : '\t'); chcnt = cnt; } endcol += colwidth; } - xo_emit("\n"); + (void)putchar('\n'); } - xo_close_list("entry"); } /* @@ -468,16 +400,16 @@ printaname(const FTSENT *p, u_long inodefield, u_long sp = p->fts_statp; chcnt = 0; if (f_inode) - chcnt += xo_emit("{t:inode/%*ju} ", + chcnt += printf("%*ju ", (int)inodefield, (uintmax_t)sp->st_ino); if (f_size) - chcnt += xo_emit("{t:size/%*jd} ", + chcnt += printf("%*jd ", (int)sizefield, howmany(sp->st_blocks, blocksize)); #ifdef COLORLS if (f_color) color_printed = colortype(sp->st_mode); #endif - chcnt += printname("name", p->fts_name); + chcnt += printname(p->fts_name); #ifdef COLORLS if (f_color && color_printed) endcolor(0); @@ -493,7 +425,8 @@ printaname(const FTSENT *p, u_long inodefield, u_long static void printdev(size_t width, dev_t dev) { - xo_emit("{:device/%#*jx} ", (u_int)width, (uintmax_t)dev); + + (void)printf("%#*jx ", (u_int)width, (uintmax_t)dev); } static size_t @@ -522,10 +455,9 @@ ls_strftime(char *str, size_t len, const char *fmt, co } static void -printtime(const char *field, time_t ftime) +printtime(time_t ftime) { char longstring[80]; - char fmt[BUFSIZ]; static time_t now = 0; const char *format; static int d_first = -1; @@ -548,12 +480,8 @@ printtime(const char *field, time_t ftime) /* mmm dd yyyy || dd mmm yyyy */ format = d_first ? "%e %b %Y" : "%b %e %Y"; ls_strftime(longstring, sizeof(longstring), format, localtime(&ftime)); - - snprintf(fmt, sizeof(fmt), "{d:%s/%%hs} ", field); - xo_attr("value", "%ld", (long) ftime); - xo_emit(fmt, longstring); - snprintf(fmt, sizeof(fmt), "{en:%s/%%ld}", field); - xo_emit(fmt, (long) ftime); + fputs(longstring, stdout); + fputc(' ', stdout); } static int @@ -562,7 +490,7 @@ printtype(u_int mode) if (f_slash) { if ((mode & S_IFMT) == S_IFDIR) { - xo_emit("{D:\\/}{e:type/directory}"); + (void)putchar('/'); return (1); } return (0); @@ -570,25 +498,25 @@ printtype(u_int mode) switch (mode & S_IFMT) { case S_IFDIR: - xo_emit("{D:/\\/}{e:type/directory}"); + (void)putchar('/'); return (1); case S_IFIFO: - xo_emit("{D:|}{e:type/fifo}"); + (void)putchar('|'); return (1); case S_IFLNK: - xo_emit("{D:@}{e:type/link}"); + (void)putchar('@'); return (1); case S_IFSOCK: - xo_emit("{D:=}{e:type/socket}"); + (void)putchar('='); return (1); case S_IFWHT: - xo_emit("{D:%%}{e:type/whiteout}"); + (void)putchar('%'); return (1); default: break; } if (mode & (S_IXUSR | S_IXGRP | S_IXOTH)) { - xo_emit("{D:*}{e:executable/}"); + (void)putchar('*'); return (1); } return (0); @@ -598,7 +526,7 @@ printtype(u_int mode) static int putch(int c) { - xo_emit("{D:/%c}", c); + (void)putchar(c); return 0; } @@ -707,7 +635,7 @@ parsecolors(const char *cs) if (c[j] >= '0' && c[j] <= '7') { colors[i].num[j] = c[j] - '0'; if (!legacy_warn) { - xo_warnx("LSCOLORS should use " + warnx("LSCOLORS should use " "characters a-h instead of 0-9 (" "see the manual page)"); } @@ -720,7 +648,7 @@ parsecolors(const char *cs) } else if (tolower((unsigned char)c[j]) == 'x') colors[i].num[j] = -1; else { - xo_warnx("invalid character '%c' in LSCOLORS" + warnx("invalid character '%c' in LSCOLORS" " env var", c[j]); colors[i].num[j] = -1; } @@ -752,19 +680,18 @@ printlink(const FTSENT *p) (void)snprintf(name, sizeof(name), "%s/%s", p->fts_parent->fts_accpath, p->fts_name); if ((lnklen = readlink(name, path, sizeof(path) - 1)) == -1) { - xo_error("\nls: %s: %s\n", name, strerror(errno)); + (void)fprintf(stderr, "\nls: %s: %s\n", name, strerror(errno)); return; } path[lnklen] = '\0'; - xo_emit(" -> "); - (void)printname("target", path); + (void)printf(" -> "); + (void)printname(path); } static void -printsize(const char *field, size_t width, off_t bytes) +printsize(size_t width, off_t bytes) { - char fmt[BUFSIZ]; - + if (f_humanval) { /* * Reserve one space before the size and allocate room for @@ -774,15 +701,13 @@ printsize(const char *field, size_t width, off_t bytes humanize_number(buf, sizeof(buf), (int64_t)bytes, "", HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL); - snprintf(fmt, sizeof(fmt), "{:%s/%%%ds} ", field, (int) width); - xo_attr("value", "%jd", (intmax_t) bytes); - xo_emit(fmt, buf); - } else { /* with commas */ + (void)printf("%*s ", (u_int)width, buf); + } else if (f_thousands) { /* with commas */ /* This format assignment needed to work round gcc bug. */ - snprintf(fmt, sizeof(fmt), "{:%s/%%%dj%sd} ", - field, (int) width, f_thousands ? "'" : ""); - xo_emit(fmt, (intmax_t) bytes); - } + const char *format = "%*j'd "; + (void)printf(format, (u_int)width, bytes); + } else + (void)printf("%*jd ", (u_int)width, bytes); } /* @@ -825,7 +750,7 @@ aclmode(char *buf, const FTSENT *p) type = ACL_TYPE_NFS4; supports_acls = 1; } else if (ret < 0 && errno != EINVAL) { - xo_warn("%s", name); + warn("%s", name); return; } if (supports_acls == 0) { @@ -834,7 +759,7 @@ aclmode(char *buf, const FTSENT *p) type = ACL_TYPE_ACCESS; supports_acls = 1; } else if (ret < 0 && errno != EINVAL) { - xo_warn("%s", name); + warn("%s", name); return; } } @@ -843,12 +768,12 @@ aclmode(char *buf, const FTSENT *p) return; facl = acl_get_link_np(name, type); if (facl == NULL) { - xo_warn("%s", name); + warn("%s", name); return; } if (acl_is_trivial_np(facl, &trivial)) { acl_free(facl); - xo_warn("%s", name); + warn("%s", name); return; } if (!trivial) Modified: head/bin/ls/util.c ============================================================================== --- head/bin/ls/util.c Wed Jan 17 22:36:58 2018 (r328099) +++ head/bin/ls/util.c Wed Jan 17 22:47:34 2018 (r328100) @@ -52,19 +52,13 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include "ls.h" #include "extern.h" int -prn_normal(const char *field, const char *s) +prn_normal(const char *s) { - char fmt[_POSIX2_LINE_MAX]; - - snprintf(fmt, sizeof(fmt), "{:%s/%%hs}", field); - return xo_emit(fmt, s); -#if 0 mbstate_t mbs; wchar_t wc; int i, n; @@ -91,47 +85,43 @@ prn_normal(const char *field, const char *s) n += wcwidth(wc); } return (n); -#endif } -char * -get_printable(const char *s) +int +prn_printable(const char *s) { mbstate_t mbs; wchar_t wc; int i, n; size_t clen; - int slen = strlen(s); - char *buf = alloca(slen + 1), *bp = buf; memset(&mbs, 0, sizeof(mbs)); n = 0; while ((clen = mbrtowc(&wc, s, MB_LEN_MAX, &mbs)) != 0) { if (clen == (size_t)-1) { - *bp++ = '?'; + putchar('?'); s++; n++; memset(&mbs, 0, sizeof(mbs)); continue; } if (clen == (size_t)-2) { - *bp++ = '?'; + putchar('?'); n++; break; } if (!iswprint(wc)) { - *bp++ = '?'; + putchar('?'); s += clen; n++; continue; } for (i = 0; i < (int)clen; i++) - *bp++ = (unsigned char)s[i]; + putchar((unsigned char)s[i]); s += clen; n += wcwidth(wc); } - *bp = '\0'; - return strdup(buf); + return (n); } /* @@ -177,8 +167,8 @@ len_octal(const char *s, int len) return (r); } -char * -get_octal(const char *s) +int +prn_octal(const char *s) { static const char esc[] = "\\\\\"\"\aa\bb\ff\nn\rr\tt\vv"; const char *p; @@ -187,8 +177,6 @@ get_octal(const char *s) size_t clen; unsigned char ch; int goodchar, i, len, prtlen; - int slen = strlen(s); - char *buf = alloca(slen * 4 + 1), *bp = buf; memset(&mbs, 0, sizeof(mbs)); len = 0; @@ -196,7 +184,7 @@ get_octal(const char *s) goodchar = clen != (size_t)-1 && clen != (size_t)-2; if (goodchar && iswprint(wc) && wc != L'\"' && wc != L'\\') { for (i = 0; i < (int)clen; i++) - *bp++ = (unsigned char)s[i]; + putchar((unsigned char)s[i]); len += wcwidth(wc); } else if (goodchar && f_octal_escape && #if WCHAR_MIN < 0 @@ -204,8 +192,8 @@ get_octal(const char *s) #endif wc <= (wchar_t)UCHAR_MAX && (p = strchr(esc, (char)wc)) != NULL) { - *bp ++ = '\\'; - *bp++ = p[1]; + putchar('\\'); + putchar(p[1]); len += 2; } else { if (goodchar) @@ -216,10 +204,10 @@ get_octal(const char *s) prtlen = strlen(s); for (i = 0; i < prtlen; i++) { ch = (unsigned char)s[i]; - *bp++ = '\\'; - *bp++ = '0' + (ch >> 6); - *bp++ = '0' + ((ch >> 3) & 7); - *bp++ = '0' + (ch & 7); + putchar('\\'); + putchar('0' + (ch >> 6)); + putchar('0' + ((ch >> 3) & 7)); + putchar('0' + (ch & 7)); len += 4; } } @@ -231,15 +219,13 @@ get_octal(const char *s) } else s += clen; } - - *bp = '\0'; - return strdup(buf); + return (len); } void usage(void) { - xo_error( + (void)fprintf(stderr, #ifdef COLORLS "usage: ls [-ABCFGHILPRSTUWZabcdfghiklmnopqrstuwxy1,] [-D format]" #else From owner-svn-src-head@freebsd.org Wed Jan 17 22:52:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69191EBD970; Wed, 17 Jan 2018 22:52:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2BA4934FE; Wed, 17 Jan 2018 22:52:01 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D45215D08; Wed, 17 Jan 2018 22:52: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 w0HMq0bq024445; Wed, 17 Jan 2018 22:52:00 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0HMq02l024443; Wed, 17 Jan 2018 22:52:00 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201801172252.w0HMq02l024443@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 17 Jan 2018 22:52:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328101 - in head: stand/common sys/kern X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: stand/common sys/kern X-SVN-Commit-Revision: 328101 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jan 2018 22:52:01 -0000 Author: jhb Date: Wed Jan 17 22:51:59 2018 New Revision: 328101 URL: https://svnweb.freebsd.org/changeset/base/328101 Log: Require the SHF_ALLOC flag for program sections from kernel object modules. ELF object files can contain program sections which are not supposed to be loaded into memory (e.g. .comment). Normally the static linker uses these flags to decide which sections are allocated to loadable program segments in ELF binaries and shared objects (including kernels on all architectures and kernel modules on architectures other than amd64). Mapping ELF object files (such as amd64 kernel modules) into memory directly is a bit of a grey area. ELF object files are intended to be used as inputs to the static linker. As a result, there is not a standardized definition for what the memory layout of an ELF object should be (none of the section headers have valid virtual memory addresses for example). The kernel and loader were not checking the SHF_ALLOC flag but loading any program sections with certain types such as SHT_PROGBITS. As a result, the kernel and loader would load into RAM some sections that weren't marked with SHF_ALLOC such as .comment that are not loaded into RAM for kernel modules on other architectures (which are implemented as ELF shared objects). Aside from possibly requiring slightly more RAM to hold a kernel module this does not affect runtime correctness as the kernel relocates symbols based on the layout it uses. Debuggers such as gdb and lldb do not extract symbol tables from a running process or kernel. Instead, they replicate the memory layout of ELF executables and shared objects and use that to construct their own symbol tables. For executables and shared objects this works fine. For ELF objects the current logic in kgdb (and probably lldb based on a simple reading) assumes that only sections with SHF_ALLOC are memory resident when constructing a memory layout. If the debugger constructs a different memory layout than the kernel, then it will compute different addresses for symbols causing symbols in the debugger to appear to have the wrong values (though the kernel itself is working fine). The current port of mdb does not check SHF_ALLOC as it replicates the kernel's logic in its existing kernel support. The bfd linker sorts the sections in ELF object files such that all of the allocated sections (sections with SHF_ALLOCATED) are placed first followed by unallocated sections. As a result, when kgdb composed a memory layout using only the allocated sections, this layout happened to match the layout used by the kernel and loader. The lld linker does not sort the sections in ELF object files and mixed allocated and unallocated sections. This resulted in kgdb composing a different memory layout than the kernel and loader. We could either patch kgdb (and possibly in the future lldb) to use custom handling when generating memory layouts for kernel modules that are ELF objects, or we could change the kernel and loader to check SHF_ALLOCATED. I chose the latter as I feel we shouldn't be loading things into RAM that the module won't use. This should mostly be a NOP when linking with bfd but will allow the existing kgdb to work with amd64 kernel modules linked with lld. Note that we only require SHF_ALLOC for "program" sections for types like SHT_PROGBITS and SHT_NOBITS. Other section types such as symbol tables, string tables, and relocations must also be loaded and are not marked with SHF_ALLOC. Reported by: np Reviewed by: kib, emaste MFC after: 1 month Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D13926 Modified: head/stand/common/load_elf_obj.c head/sys/kern/link_elf_obj.c Modified: head/stand/common/load_elf_obj.c ============================================================================== --- head/stand/common/load_elf_obj.c Wed Jan 17 22:47:34 2018 (r328100) +++ head/stand/common/load_elf_obj.c Wed Jan 17 22:51:59 2018 (r328101) @@ -224,6 +224,8 @@ __elfN(obj_loadimage)(struct preloaded_file *fp, elf_f #if defined(__i386__) || defined(__amd64__) case SHT_X86_64_UNWIND: #endif + if ((shdr[i].sh_flags & SHF_ALLOC) == 0) + break; lastaddr = roundup(lastaddr, shdr[i].sh_addralign); shdr[i].sh_addr = (Elf_Addr)lastaddr; lastaddr += shdr[i].sh_size; Modified: head/sys/kern/link_elf_obj.c ============================================================================== --- head/sys/kern/link_elf_obj.c Wed Jan 17 22:47:34 2018 (r328100) +++ head/sys/kern/link_elf_obj.c Wed Jan 17 22:51:59 2018 (r328101) @@ -262,6 +262,9 @@ link_elf_link_preload(linker_class_t cls, const char * #ifdef __amd64__ case SHT_X86_64_UNWIND: #endif + /* Ignore sections not loaded by the loader. */ + if (shdr[i].sh_addr == 0) + break; ef->nprogtab++; break; case SHT_SYMTAB: @@ -335,6 +338,8 @@ link_elf_link_preload(linker_class_t cls, const char * #ifdef __amd64__ case SHT_X86_64_UNWIND: #endif + if (shdr[i].sh_addr == 0) + break; ef->progtab[pb].addr = (void *)shdr[i].sh_addr; if (shdr[i].sh_type == SHT_PROGBITS) ef->progtab[pb].name = "<>"; @@ -605,6 +610,8 @@ link_elf_load_file(linker_class_t cls, const char *fil #ifdef __amd64__ case SHT_X86_64_UNWIND: #endif + if ((shdr[i].sh_flags & SHF_ALLOC) == 0) + break; ef->nprogtab++; break; case SHT_SYMTAB: @@ -720,6 +727,8 @@ link_elf_load_file(linker_class_t cls, const char *fil #ifdef __amd64__ case SHT_X86_64_UNWIND: #endif + if ((shdr[i].sh_flags & SHF_ALLOC) == 0) + break; alignmask = shdr[i].sh_addralign - 1; mapsize += alignmask; mapsize &= ~alignmask; @@ -790,6 +799,8 @@ link_elf_load_file(linker_class_t cls, const char *fil #ifdef __amd64__ case SHT_X86_64_UNWIND: #endif + if ((shdr[i].sh_flags & SHF_ALLOC) == 0) + break; alignmask = shdr[i].sh_addralign - 1; mapbase += alignmask; mapbase &= ~alignmask; From owner-svn-src-head@freebsd.org Wed Jan 17 23:06:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78CE8EBE223; Wed, 17 Jan 2018 23:06:32 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 6003A3C25; Wed, 17 Jan 2018 23:06:31 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id w0HMetmG017143 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 17 Jan 2018 14:40:55 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id w0HMesgn017142; Wed, 17 Jan 2018 14:40:54 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 17 Jan 2018 14:40:54 -0800 From: Gleb Smirnoff To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327354 - head/sys/vm Message-ID: <20180117224054.GO8113@FreeBSD.org> References: <201712291905.vBTJ57gI072871@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201712291905.vBTJ57gI072871@repo.freebsd.org> User-Agent: Mutt/1.9.1 (2017-09-22) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jan 2018 23:06:32 -0000 On Fri, Dec 29, 2017 at 07:05:07PM +0000, Konstantin Belousov wrote: K> Author: kib K> Date: Fri Dec 29 19:05:07 2017 K> New Revision: 327354 K> URL: https://svnweb.freebsd.org/changeset/base/327354 K> K> Log: K> Style. K> K> Reviewed by: alc K> Sponsored by: The FreeBSD Foundation K> MFC after: 1 week K> Differential revision: https://reviews.freebsd.org/D13678 K> K> Modified: K> head/sys/vm/vm_swapout.c K> K> Modified: head/sys/vm/vm_swapout.c K> ============================================================================== K> --- head/sys/vm/vm_swapout.c Fri Dec 29 18:42:55 2017 (r327353) K> +++ head/sys/vm/vm_swapout.c Fri Dec 29 19:05:07 2017 (r327354) K> @@ -556,16 +556,14 @@ vm_thread_swapin(struct thread *td) K> { K> vm_object_t ksobj; K> vm_page_t ma[KSTACK_MAX_PAGES]; K> - int pages; K> + int a, count, i, j, pages, rv; K> K> pages = td->td_kstack_pages; K> ksobj = td->td_kstack_obj; K> VM_OBJECT_WLOCK(ksobj); K> (void)vm_page_grab_pages(ksobj, 0, VM_ALLOC_NORMAL | VM_ALLOC_WIRED, ma, K> pages); K> - for (int i = 0; i < pages;) { K> - int j, a, count, rv; K> - K> + for (i = 0; i < pages;) { K> vm_page_assert_xbusied(ma[i]); K> if (ma[i]->valid == VM_PAGE_BITS_ALL) { K> vm_page_xunbusy(ma[i]); Yeah, style is sacred, but is there a single person on Earth who would not agree that moving variables from smaller blocks to function block reduces readability of the code? -- Gleb Smirnoff From owner-svn-src-head@freebsd.org Wed Jan 17 23:09:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2330EBE3C7; Wed, 17 Jan 2018 23:09:03 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 3366F3E31; Wed, 17 Jan 2018 23:09:03 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id w0HN92fo017291 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 17 Jan 2018 15:09:02 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id w0HN92s7017290; Wed, 17 Jan 2018 15:09:02 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 17 Jan 2018 15:09:02 -0800 From: Gleb Smirnoff To: Colin Percival Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327423 - in head/sys: kern sys Message-ID: <20180117230902.GP8113@FreeBSD.org> References: <201712310921.vBV9L133042419@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201712310921.vBV9L133042419@repo.freebsd.org> User-Agent: Mutt/1.9.1 (2017-09-22) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jan 2018 23:09:04 -0000 Hi Colin, On Sun, Dec 31, 2017 at 09:21:01AM +0000, Colin Percival wrote: C> Author: cperciva C> Date: Sun Dec 31 09:21:01 2017 C> New Revision: 327423 C> URL: https://svnweb.freebsd.org/changeset/base/327423 C> C> Log: C> Code for recording timestamps of events, especially function entries/exits. C> This is a very primitive system, intended for use in measuring performance C> during the early system boot, before more sophisticated tools like DTrace C> or infrastructure like kernel memory allocation and mutexes are available. C> C> Because this code records pointers to strings rather than copying strings C> (in order to keep the memory usage more manageable), if a kernel module is C> unloaded after logging an event, Bad Things can happen. Users are advised C> to not do that. C> C> Since cycle counts from the early kernel boot are used as an initial entropy C> source, publishing this information to userland could result in inadequate C> entropy being kept private to the kernel RNG. Users are advised to not C> enable this on systems with untrusted users. C> C> Discussed on: freebsd-current Sorry if my question is too lame and late. Why can't you use ktr(4) tracer for that purpose? The discussion on freebsd-current also doesn't have answer. -- Gleb Smirnoff From owner-svn-src-head@freebsd.org Wed Jan 17 23:11:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6703EBE609; Wed, 17 Jan 2018 23:11:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8E1706344C; Wed, 17 Jan 2018 23:11:27 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C074316020; Wed, 17 Jan 2018 23:11:26 +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 w0HNBQI9032717; Wed, 17 Jan 2018 23:11:26 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0HNBQpW032709; Wed, 17 Jan 2018 23:11:26 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201801172311.w0HNBQpW032709@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 17 Jan 2018 23:11:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328102 - in head: sys/amd64/include sys/amd64/vmm/amd sys/amd64/vmm/intel usr.sbin/bhyvectl X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: sys/amd64/include sys/amd64/vmm/amd sys/amd64/vmm/intel usr.sbin/bhyvectl X-SVN-Commit-Revision: 328102 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jan 2018 23:11:27 -0000 Author: jhb Date: Wed Jan 17 23:11:25 2018 New Revision: 328102 URL: https://svnweb.freebsd.org/changeset/base/328102 Log: Save and restore guest debug registers. Currently most of the debug registers are not saved and restored during VM transitions allowing guest and host debug register values to leak into the opposite context. One result is that hardware watchpoints do not work reliably within a guest under VT-x. Due to differences in SVM and VT-x, slightly different approaches are used. For VT-x: - Enable debug register save/restore for VM entry/exit in the VMCS for DR7 and MSR_DEBUGCTL. - Explicitly save DR0-3,6 of the guest. - Explicitly save DR0-3,6-7, MSR_DEBUGCTL, and the trap flag from %rflags for the host. Note that because DR6 is "software" managed and not stored in the VMCS a kernel debugger which single steps through VM entry could corrupt the guest DR6 (since a single step trap taken after loading the guest DR6 could alter the DR6 register). To avoid this, explicitly disable single-stepping via the trace flag before loading the guest DR6. A determined debugger could still defeat this by setting a breakpoint after the guest DR6 was loaded and then single-stepping. For SVM: - Enable debug register caching in the VMCB for DR6/DR7. - Explicitly save DR0-3 of the guest. - Explicitly save DR0-3,6-7, and MSR_DEBUGCTL for the host. Since SVM saves the guest DR6 in the VMCB, the race with single-stepping described for VT-x does not exist. For both platforms, expose all of the guest DRx values via --get-drX and --set-drX flags to bhyvectl. Discussed with: avg, grehan Tested by: avg (SVM), myself (VT-x) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D13229 Modified: head/sys/amd64/include/vmm.h head/sys/amd64/vmm/amd/svm.c head/sys/amd64/vmm/amd/svm.h head/sys/amd64/vmm/amd/vmcb.c head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/intel/vmx.h head/usr.sbin/bhyvectl/bhyvectl.c Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Wed Jan 17 22:51:59 2018 (r328101) +++ head/sys/amd64/include/vmm.h Wed Jan 17 23:11:25 2018 (r328102) @@ -85,6 +85,11 @@ enum vm_reg_name { VM_REG_GUEST_PDPTE2, VM_REG_GUEST_PDPTE3, VM_REG_GUEST_INTR_SHADOW, + VM_REG_GUEST_DR0, + VM_REG_GUEST_DR1, + VM_REG_GUEST_DR2, + VM_REG_GUEST_DR3, + VM_REG_GUEST_DR6, VM_REG_LAST }; Modified: head/sys/amd64/vmm/amd/svm.c ============================================================================== --- head/sys/amd64/vmm/amd/svm.c Wed Jan 17 22:51:59 2018 (r328101) +++ head/sys/amd64/vmm/amd/svm.c Wed Jan 17 23:11:25 2018 (r328102) @@ -87,6 +87,7 @@ SYSCTL_NODE(_hw_vmm, OID_AUTO, svm, CTLFLAG_RW, NULL, VMCB_CACHE_TPR | \ VMCB_CACHE_CR2 | \ VMCB_CACHE_CR | \ + VMCB_CACHE_DR | \ VMCB_CACHE_DT | \ VMCB_CACHE_SEG | \ VMCB_CACHE_NP) @@ -504,6 +505,10 @@ vmcb_init(struct svm_softc *sc, int vcpu, uint64_t iop PAT_VALUE(5, PAT_WRITE_THROUGH) | PAT_VALUE(6, PAT_UNCACHED) | PAT_VALUE(7, PAT_UNCACHEABLE); + + /* Set up DR6/7 to power-on state */ + state->dr6 = 0xffff0ff0; + state->dr7 = 0x400; } /* @@ -1911,6 +1916,60 @@ enable_gintr(void) __asm __volatile("stgi"); } +static __inline void +svm_dr_enter_guest(struct svm_regctx *gctx) +{ + + /* Save host control debug registers. */ + gctx->host_dr7 = rdr7(); + gctx->host_debugctl = rdmsr(MSR_DEBUGCTLMSR); + + /* + * Disable debugging in DR7 and DEBUGCTL to avoid triggering + * exceptions in the host based on the guest DRx values. The + * guest DR6, DR7, and DEBUGCTL are saved/restored in the + * VMCB. + */ + load_dr7(0); + wrmsr(MSR_DEBUGCTLMSR, 0); + + /* Save host debug registers. */ + gctx->host_dr0 = rdr0(); + gctx->host_dr1 = rdr1(); + gctx->host_dr2 = rdr2(); + gctx->host_dr3 = rdr3(); + gctx->host_dr6 = rdr6(); + + /* Restore guest debug registers. */ + load_dr0(gctx->sctx_dr0); + load_dr1(gctx->sctx_dr1); + load_dr2(gctx->sctx_dr2); + load_dr3(gctx->sctx_dr3); +} + +static __inline void +svm_dr_leave_guest(struct svm_regctx *gctx) +{ + + /* Save guest debug registers. */ + gctx->sctx_dr0 = rdr0(); + gctx->sctx_dr1 = rdr1(); + gctx->sctx_dr2 = rdr2(); + gctx->sctx_dr3 = rdr3(); + + /* + * Restore host debug registers. Restore DR7 and DEBUGCTL + * last. + */ + load_dr0(gctx->host_dr0); + load_dr1(gctx->host_dr1); + load_dr2(gctx->host_dr2); + load_dr3(gctx->host_dr3); + load_dr6(gctx->host_dr6); + wrmsr(MSR_DEBUGCTLMSR, gctx->host_debugctl); + load_dr7(gctx->host_dr7); +} + /* * Start vcpu with specified RIP. */ @@ -2023,7 +2082,9 @@ svm_vmrun(void *arg, int vcpu, register_t rip, pmap_t /* Launch Virtual Machine. */ VCPU_CTR1(vm, vcpu, "Resume execution at %#lx", state->rip); + svm_dr_enter_guest(gctx); svm_launch(vmcb_pa, gctx, &__pcpu[curcpu]); + svm_dr_leave_guest(gctx); CPU_CLR_ATOMIC(curcpu, &pmap->pm_active); @@ -2092,6 +2153,14 @@ swctx_regptr(struct svm_regctx *regctx, int reg) return (®ctx->sctx_r14); case VM_REG_GUEST_R15: return (®ctx->sctx_r15); + case VM_REG_GUEST_DR0: + return (®ctx->sctx_dr0); + case VM_REG_GUEST_DR1: + return (®ctx->sctx_dr1); + case VM_REG_GUEST_DR2: + return (®ctx->sctx_dr2); + case VM_REG_GUEST_DR3: + return (®ctx->sctx_dr3); default: return (NULL); } Modified: head/sys/amd64/vmm/amd/svm.h ============================================================================== --- head/sys/amd64/vmm/amd/svm.h Wed Jan 17 22:51:59 2018 (r328101) +++ head/sys/amd64/vmm/amd/svm.h Wed Jan 17 23:11:25 2018 (r328102) @@ -49,6 +49,18 @@ struct svm_regctx { register_t sctx_r13; register_t sctx_r14; register_t sctx_r15; + register_t sctx_dr0; + register_t sctx_dr1; + register_t sctx_dr2; + register_t sctx_dr3; + + register_t host_dr0; + register_t host_dr1; + register_t host_dr2; + register_t host_dr3; + register_t host_dr6; + register_t host_dr7; + uint64_t host_debugctl; }; void svm_launch(uint64_t pa, struct svm_regctx *gctx, struct pcpu *pcpu); Modified: head/sys/amd64/vmm/amd/vmcb.c ============================================================================== --- head/sys/amd64/vmm/amd/vmcb.c Wed Jan 17 22:51:59 2018 (r328101) +++ head/sys/amd64/vmm/amd/vmcb.c Wed Jan 17 23:11:25 2018 (r328102) @@ -187,6 +187,10 @@ vmcb_read(struct svm_softc *sc, int vcpu, int ident, u *retval = state->cr4; break; + case VM_REG_GUEST_DR6: + *retval = state->dr6; + break; + case VM_REG_GUEST_DR7: *retval = state->dr7; break; @@ -278,8 +282,14 @@ vmcb_write(struct svm_softc *sc, int vcpu, int ident, svm_set_dirty(sc, vcpu, VMCB_CACHE_CR); break; + case VM_REG_GUEST_DR6: + state->dr6 = val; + svm_set_dirty(sc, vcpu, VMCB_CACHE_DR); + break; + case VM_REG_GUEST_DR7: state->dr7 = val; + svm_set_dirty(sc, vcpu, VMCB_CACHE_DR); break; case VM_REG_GUEST_EFER: Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Wed Jan 17 22:51:59 2018 (r328101) +++ head/sys/amd64/vmm/intel/vmx.c Wed Jan 17 23:11:25 2018 (r328102) @@ -98,18 +98,20 @@ __FBSDID("$FreeBSD$"); #define PROCBASED_CTLS2_ZERO_SETTING 0 #define VM_EXIT_CTLS_ONE_SETTING \ - (VM_EXIT_HOST_LMA | \ + (VM_EXIT_SAVE_DEBUG_CONTROLS | \ + VM_EXIT_HOST_LMA | \ VM_EXIT_SAVE_EFER | \ VM_EXIT_LOAD_EFER | \ VM_EXIT_ACKNOWLEDGE_INTERRUPT) -#define VM_EXIT_CTLS_ZERO_SETTING VM_EXIT_SAVE_DEBUG_CONTROLS +#define VM_EXIT_CTLS_ZERO_SETTING 0 -#define VM_ENTRY_CTLS_ONE_SETTING (VM_ENTRY_LOAD_EFER) +#define VM_ENTRY_CTLS_ONE_SETTING \ + (VM_ENTRY_LOAD_DEBUG_CONTROLS | \ + VM_ENTRY_LOAD_EFER) #define VM_ENTRY_CTLS_ZERO_SETTING \ - (VM_ENTRY_LOAD_DEBUG_CONTROLS | \ - VM_ENTRY_INTO_SMM | \ + (VM_ENTRY_INTO_SMM | \ VM_ENTRY_DEACTIVATE_DUAL_MONITOR) #define HANDLED 1 @@ -916,6 +918,9 @@ vmx_vminit(struct vm *vm, pmap_t pmap) exc_bitmap = 1 << IDT_MC; error += vmwrite(VMCS_EXCEPTION_BITMAP, exc_bitmap); + vmx->ctx[i].guest_dr6 = 0xffff0ff0; + error += vmwrite(VMCS_GUEST_DR7, 0x400); + if (virtual_interrupt_delivery) { error += vmwrite(VMCS_APIC_ACCESS, APIC_ACCESS_ADDRESS); error += vmwrite(VMCS_VIRTUAL_APIC, @@ -2572,6 +2577,73 @@ vmx_exit_handle_nmi(struct vmx *vmx, int vcpuid, struc } } +static __inline void +vmx_dr_enter_guest(struct vmxctx *vmxctx) +{ + register_t rflags; + + /* Save host control debug registers. */ + vmxctx->host_dr7 = rdr7(); + vmxctx->host_debugctl = rdmsr(MSR_DEBUGCTLMSR); + + /* + * Disable debugging in DR7 and DEBUGCTL to avoid triggering + * exceptions in the host based on the guest DRx values. The + * guest DR7 and DEBUGCTL are saved/restored in the VMCS. + */ + load_dr7(0); + wrmsr(MSR_DEBUGCTLMSR, 0); + + /* + * Disable single stepping the kernel to avoid corrupting the + * guest DR6. A debugger might still be able to corrupt the + * guest DR6 by setting a breakpoint after this point and then + * single stepping. + */ + rflags = read_rflags(); + vmxctx->host_tf = rflags & PSL_T; + write_rflags(rflags & ~PSL_T); + + /* Save host debug registers. */ + vmxctx->host_dr0 = rdr0(); + vmxctx->host_dr1 = rdr1(); + vmxctx->host_dr2 = rdr2(); + vmxctx->host_dr3 = rdr3(); + vmxctx->host_dr6 = rdr6(); + + /* Restore guest debug registers. */ + load_dr0(vmxctx->guest_dr0); + load_dr1(vmxctx->guest_dr1); + load_dr2(vmxctx->guest_dr2); + load_dr3(vmxctx->guest_dr3); + load_dr6(vmxctx->guest_dr6); +} + +static __inline void +vmx_dr_leave_guest(struct vmxctx *vmxctx) +{ + + /* Save guest debug registers. */ + vmxctx->guest_dr0 = rdr0(); + vmxctx->guest_dr1 = rdr1(); + vmxctx->guest_dr2 = rdr2(); + vmxctx->guest_dr3 = rdr3(); + vmxctx->guest_dr6 = rdr6(); + + /* + * Restore host debug registers. Restore DR7, DEBUGCTL, and + * PSL_T last. + */ + load_dr0(vmxctx->host_dr0); + load_dr1(vmxctx->host_dr1); + load_dr2(vmxctx->host_dr2); + load_dr3(vmxctx->host_dr3); + load_dr6(vmxctx->host_dr6); + wrmsr(MSR_DEBUGCTLMSR, vmxctx->host_debugctl); + load_dr7(vmxctx->host_dr7); + write_rflags(read_rflags() | vmxctx->host_tf); +} + static int vmx_run(void *arg, int vcpu, register_t rip, pmap_t pmap, struct vm_eventinfo *evinfo) @@ -2670,7 +2742,9 @@ vmx_run(void *arg, int vcpu, register_t rip, pmap_t pm } vmx_run_trace(vmx, vcpu); + vmx_dr_enter_guest(vmxctx); rc = vmx_enter_guest(vmxctx, vmx, launched); + vmx_dr_leave_guest(vmxctx); /* Collect some information for VM exit processing */ vmexit->rip = rip = vmcs_guest_rip(); @@ -2770,6 +2844,16 @@ vmxctx_regptr(struct vmxctx *vmxctx, int reg) return (&vmxctx->guest_r15); case VM_REG_GUEST_CR2: return (&vmxctx->guest_cr2); + case VM_REG_GUEST_DR0: + return (&vmxctx->guest_dr0); + case VM_REG_GUEST_DR1: + return (&vmxctx->guest_dr1); + case VM_REG_GUEST_DR2: + return (&vmxctx->guest_dr2); + case VM_REG_GUEST_DR3: + return (&vmxctx->guest_dr3); + case VM_REG_GUEST_DR6: + return (&vmxctx->guest_dr6); default: break; } Modified: head/sys/amd64/vmm/intel/vmx.h ============================================================================== --- head/sys/amd64/vmm/intel/vmx.h Wed Jan 17 22:51:59 2018 (r328101) +++ head/sys/amd64/vmm/intel/vmx.h Wed Jan 17 23:11:25 2018 (r328102) @@ -52,6 +52,11 @@ struct vmxctx { register_t guest_r14; register_t guest_r15; register_t guest_cr2; + register_t guest_dr0; + register_t guest_dr1; + register_t guest_dr2; + register_t guest_dr3; + register_t guest_dr6; register_t host_r15; /* Host state */ register_t host_r14; @@ -60,9 +65,14 @@ struct vmxctx { register_t host_rbp; register_t host_rsp; register_t host_rbx; - /* - * XXX todo debug registers and fpu state - */ + register_t host_dr0; + register_t host_dr1; + register_t host_dr2; + register_t host_dr3; + register_t host_dr6; + register_t host_dr7; + uint64_t host_debugctl; + int host_tf; int inst_fail_status; Modified: head/usr.sbin/bhyvectl/bhyvectl.c ============================================================================== --- head/usr.sbin/bhyvectl/bhyvectl.c Wed Jan 17 22:51:59 2018 (r328101) +++ head/usr.sbin/bhyvectl/bhyvectl.c Wed Jan 17 23:11:25 2018 (r328102) @@ -113,6 +113,16 @@ usage(bool cpu_intel) " [--get-cr3]\n" " [--set-cr4=]\n" " [--get-cr4]\n" + " [--set-dr0=]\n" + " [--get-dr0]\n" + " [--set-dr1=]\n" + " [--get-dr1]\n" + " [--set-dr2=]\n" + " [--get-dr2]\n" + " [--set-dr3=]\n" + " [--get-dr3]\n" + " [--set-dr6=]\n" + " [--get-dr6]\n" " [--set-dr7=]\n" " [--get-dr7]\n" " [--set-rsp=]\n" @@ -246,6 +256,11 @@ static int get_active_cpus, get_suspended_cpus; static uint64_t memsize; static int set_cr0, get_cr0, set_cr3, get_cr3, set_cr4, get_cr4; static int set_efer, get_efer; +static int set_dr0, get_dr0; +static int set_dr1, get_dr1; +static int set_dr2, get_dr2; +static int set_dr3, get_dr3; +static int set_dr6, get_dr6; static int set_dr7, get_dr7; static int set_rsp, get_rsp, set_rip, get_rip, set_rflags, get_rflags; static int set_rax, get_rax; @@ -538,6 +553,11 @@ enum { SET_CR0, SET_CR3, SET_CR4, + SET_DR0, + SET_DR1, + SET_DR2, + SET_DR3, + SET_DR6, SET_DR7, SET_RSP, SET_RIP, @@ -642,7 +662,8 @@ cpu_vendor_intel(void) static int get_all_registers(struct vmctx *ctx, int vcpu) { - uint64_t cr0, cr3, cr4, dr7, rsp, rip, rflags, efer; + uint64_t cr0, cr3, cr4, dr0, dr1, dr2, dr3, dr6, dr7; + uint64_t rsp, rip, rflags, efer; uint64_t rax, rbx, rcx, rdx, rsi, rdi, rbp; uint64_t r8, r9, r10, r11, r12, r13, r14, r15; int error = 0; @@ -671,6 +692,36 @@ get_all_registers(struct vmctx *ctx, int vcpu) printf("cr4[%d]\t\t0x%016lx\n", vcpu, cr4); } + if (!error && (get_dr0 || get_all)) { + error = vm_get_register(ctx, vcpu, VM_REG_GUEST_DR0, &dr0); + if (error == 0) + printf("dr0[%d]\t\t0x%016lx\n", vcpu, dr0); + } + + if (!error && (get_dr1 || get_all)) { + error = vm_get_register(ctx, vcpu, VM_REG_GUEST_DR1, &dr1); + if (error == 0) + printf("dr1[%d]\t\t0x%016lx\n", vcpu, dr1); + } + + if (!error && (get_dr2 || get_all)) { + error = vm_get_register(ctx, vcpu, VM_REG_GUEST_DR2, &dr2); + if (error == 0) + printf("dr2[%d]\t\t0x%016lx\n", vcpu, dr2); + } + + if (!error && (get_dr3 || get_all)) { + error = vm_get_register(ctx, vcpu, VM_REG_GUEST_DR3, &dr3); + if (error == 0) + printf("dr3[%d]\t\t0x%016lx\n", vcpu, dr3); + } + + if (!error && (get_dr6 || get_all)) { + error = vm_get_register(ctx, vcpu, VM_REG_GUEST_DR6, &dr6); + if (error == 0) + printf("dr6[%d]\t\t0x%016lx\n", vcpu, dr6); + } + if (!error && (get_dr7 || get_all)) { error = vm_get_register(ctx, vcpu, VM_REG_GUEST_DR7, &dr7); if (error == 0) @@ -1273,6 +1324,11 @@ setup_options(bool cpu_intel) { "set-cr0", REQ_ARG, 0, SET_CR0 }, { "set-cr3", REQ_ARG, 0, SET_CR3 }, { "set-cr4", REQ_ARG, 0, SET_CR4 }, + { "set-dr0", REQ_ARG, 0, SET_DR0 }, + { "set-dr1", REQ_ARG, 0, SET_DR1 }, + { "set-dr2", REQ_ARG, 0, SET_DR2 }, + { "set-dr3", REQ_ARG, 0, SET_DR3 }, + { "set-dr6", REQ_ARG, 0, SET_DR6 }, { "set-dr7", REQ_ARG, 0, SET_DR7 }, { "set-rsp", REQ_ARG, 0, SET_RSP }, { "set-rip", REQ_ARG, 0, SET_RIP }, @@ -1330,6 +1386,11 @@ setup_options(bool cpu_intel) { "get-cr0", NO_ARG, &get_cr0, 1 }, { "get-cr3", NO_ARG, &get_cr3, 1 }, { "get-cr4", NO_ARG, &get_cr4, 1 }, + { "get-dr0", NO_ARG, &get_dr0, 1 }, + { "get-dr1", NO_ARG, &get_dr1, 1 }, + { "get-dr2", NO_ARG, &get_dr2, 1 }, + { "get-dr3", NO_ARG, &get_dr3, 1 }, + { "get-dr6", NO_ARG, &get_dr6, 1 }, { "get-dr7", NO_ARG, &get_dr7, 1 }, { "get-rsp", NO_ARG, &get_rsp, 1 }, { "get-rip", NO_ARG, &get_rip, 1 }, @@ -1607,7 +1668,8 @@ main(int argc, char *argv[]) int error, ch, vcpu, ptenum; vm_paddr_t gpa_pmap; struct vm_exit vmexit; - uint64_t rax, cr0, cr3, cr4, dr7, rsp, rip, rflags, efer, pat; + uint64_t rax, cr0, cr3, cr4, dr0, dr1, dr2, dr3, dr6, dr7; + uint64_t rsp, rip, rflags, efer, pat; uint64_t eptp, bm, addr, u64, pteval[4], *pte, info[2]; struct vmctx *ctx; cpuset_t cpus; @@ -1654,6 +1716,26 @@ main(int argc, char *argv[]) cr4 = strtoul(optarg, NULL, 0); set_cr4 = 1; break; + case SET_DR0: + dr0 = strtoul(optarg, NULL, 0); + set_dr0 = 1; + break; + case SET_DR1: + dr1 = strtoul(optarg, NULL, 0); + set_dr1 = 1; + break; + case SET_DR2: + dr2 = strtoul(optarg, NULL, 0); + set_dr2 = 1; + break; + case SET_DR3: + dr3 = strtoul(optarg, NULL, 0); + set_dr3 = 1; + break; + case SET_DR6: + dr6 = strtoul(optarg, NULL, 0); + set_dr6 = 1; + break; case SET_DR7: dr7 = strtoul(optarg, NULL, 0); set_dr7 = 1; @@ -1794,6 +1876,21 @@ main(int argc, char *argv[]) if (!error && set_cr4) error = vm_set_register(ctx, vcpu, VM_REG_GUEST_CR4, cr4); + + if (!error && set_dr0) + error = vm_set_register(ctx, vcpu, VM_REG_GUEST_DR0, dr0); + + if (!error && set_dr1) + error = vm_set_register(ctx, vcpu, VM_REG_GUEST_DR1, dr1); + + if (!error && set_dr2) + error = vm_set_register(ctx, vcpu, VM_REG_GUEST_DR2, dr2); + + if (!error && set_dr3) + error = vm_set_register(ctx, vcpu, VM_REG_GUEST_DR3, dr3); + + if (!error && set_dr6) + error = vm_set_register(ctx, vcpu, VM_REG_GUEST_DR6, dr6); if (!error && set_dr7) error = vm_set_register(ctx, vcpu, VM_REG_GUEST_DR7, dr7); From owner-svn-src-head@freebsd.org Wed Jan 17 23:14:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E88AEBE9D2; Wed, 17 Jan 2018 23:14:39 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 11FB963817; Wed, 17 Jan 2018 23:14:38 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id w0HNEb4r017362 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 17 Jan 2018 15:14:37 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id w0HNEbG7017361; Wed, 17 Jan 2018 15:14:37 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 17 Jan 2018 15:14:37 -0800 From: Gleb Smirnoff To: John Baldwin Cc: Julian Elischer , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Colin Percival Subject: Re: svn commit: r327447 - head/sys/sys Message-ID: <20180117231437.GQ8113@FreeBSD.org> References: <201712312100.vBVL0L0a038783@repo.freebsd.org> <8492136.94UhKCrmBg@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8492136.94UhKCrmBg@ralph.baldwin.cx> User-Agent: Mutt/1.9.1 (2017-09-22) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jan 2018 23:14:39 -0000 On Tue, Jan 02, 2018 at 09:56:09AM -0800, John Baldwin wrote: J> > this is a recurring issue. Program that want to look into the J> > internals of files such as mount.h J> > and define _KERNEL to allow themselves to do so. It eventualy leads J> > to all sorts of confusion and pollution. J> > Maybe we should make a policy on how to do this. At $JOB I had to hack J> > it to define a J> > #ifdef _NOTREALLYKERNEL to split out parts we really wanted, but it J> > would be better to have specific ones for J> > various specific 'rule breakers'.. J> > e.g. J> > #if defined( _KERNEL ) || defined (WANT_TO_LOOK_AT_something) J> > J> > kdump seems ot do the right thing with: J> > J> > kdump/kdump.c:#define _WANT_KERNEL_ERRNO J> > errno.h:#if defined(_KERNEL) || defined(_WANT_KERNEL_ERRNO) J> J> The past few years we have been using _WANT_FOO when new things need to be J> exposed and that is our current pattern. However, that doesn't fix existing J> code for old things. As one who added a lot of _WANT_FOOs, I must admit that I don't consider that a final and clean solution. But this seems to be a lesser evil when dealing with old code that has multiple dependencies. New code needs to be written in a fashion that clearly separates kernel structures from user visible structures, so that no tricks with preprocessor are needed. -- Gleb Smirnoff From owner-svn-src-head@freebsd.org Wed Jan 17 23:37:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2813EBF983; Wed, 17 Jan 2018 23:37:04 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C941F68639; Wed, 17 Jan 2018 23:37:04 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id w0HNb3qJ017472 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 17 Jan 2018 15:37:03 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id w0HNb2Wr017471; Wed, 17 Jan 2018 15:37:02 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 17 Jan 2018 15:37:02 -0800 From: Gleb Smirnoff To: Konstantin Belousov Cc: Kristof Provost , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r327675 - head/sys/netpfil/pf Message-ID: <20180117233702.GR8113@FreeBSD.org> References: <201801071335.w07DZFWh069854@repo.freebsd.org> <20180107144423.GD1684@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180107144423.GD1684@kib.kiev.ua> User-Agent: Mutt/1.9.1 (2017-09-22) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jan 2018 23:37:05 -0000 On Sun, Jan 07, 2018 at 04:44:23PM +0200, Konstantin Belousov wrote: K> On Sun, Jan 07, 2018 at 01:35:15PM +0000, Kristof Provost wrote: K> > Author: kp K> > Date: Sun Jan 7 13:35:15 2018 K> > New Revision: 327675 K> > URL: https://svnweb.freebsd.org/changeset/base/327675 K> > K> > Log: K> > pf: Avoid integer overflow issues by using mallocarray() iso. malloc() K> > K> > pfioctl() handles several ioctl that takes variable length input, these K> > include: K> > - DIOCRADDTABLES K> > - DIOCRDELTABLES K> > - DIOCRGETTABLES K> > - DIOCRGETTSTATS K> > - DIOCRCLRTSTATS K> > - DIOCRSETTFLAGS K> > K> > All of them take a pfioc_table struct as input from userland. One of K> > its elements (pfrio_size) is used in a buffer length calculation. K> > The calculation contains an integer overflow which if triggered can lead K> > to out of bound reads and writes later on. K> So the size of the allocation is controlled directly from the userspace ? K> This is an easy DoS, and by itself is perhaps bigger issue than the overflow. Yes, this is one of the dirties parts of pf. The whole API to read and configure tables from the userland calls to be rewritten from scratch. Conversion from malloc to mallocarray really does nothing. Better just put a maximum value cap. -- Gleb Smirnoff From owner-svn-src-head@freebsd.org Wed Jan 17 23:47:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13C56EC01E8 for ; Wed, 17 Jan 2018 23:47:02 +0000 (UTC) (envelope-from 01000161067f4f4b-03c47956-d81c-4470-b7fb-6f1512699d36-000000@amazonses.com) Received: from a8-176.smtp-out.amazonses.com (a8-176.smtp-out.amazonses.com [54.240.8.176]) (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 CDDB768E6B for ; Wed, 17 Jan 2018 23:47:01 +0000 (UTC) (envelope-from 01000161067f4f4b-03c47956-d81c-4470-b7fb-6f1512699d36-000000@amazonses.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ae7m2yrxjw65l2cqdpjxuucyrvy564tn; d=tarsnap.com; t=1516232462; h=Subject:To:References:Cc:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=Ra/rpFnrlABKJKh2ADukoiriDZ1ZUfPBUhwpJGvf2EU=; b=GSZGS5YDaw9EyGS2hwjA42vS29w86eXeU72oVQxo7PFhW4TucdWCnBAXDU6kXQRG qRrnoTqeJGuocuto4hunqa0fOSGLii26rS5RM4ckdWpd9MMOTjA3rE7N4Fjumr06PCg P2En5HJHjiQzLySZXcaUak98fixC1Xa2jPX6mv4Y= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=224i4yxa5dv7c2xz3womw6peuasteono; d=amazonses.com; t=1516232462; h=Subject:To:References:Cc:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding:Feedback-ID; bh=Ra/rpFnrlABKJKh2ADukoiriDZ1ZUfPBUhwpJGvf2EU=; b=TszAhNE5OX8xiFZ2JhIJK3XXyQqUVwoVCdy5Bgw3yzlEuPGJLmZPZBjTai5FkcK7 k/5+feiHs9TChw2OcrfcEuGrBDlxpD+x4pYcZ66XR+WWEgvAIZ+KQNaR8qnr3wOAiCn BQMuGsKTMfcoNGBU11q6LqyAAxs4QK3mmoQRi/To= Subject: Re: svn commit: r327423 - in head/sys: kern sys To: Gleb Smirnoff References: <201712310921.vBV9L133042419@repo.freebsd.org> <20180117230902.GP8113@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Colin Percival Message-ID: <01000161067f4f4b-03c47956-d81c-4470-b7fb-6f1512699d36-000000@email.amazonses.com> Date: Wed, 17 Jan 2018 23:41:02 +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: <20180117230902.GP8113@FreeBSD.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SES-Outgoing: 2018.01.17-54.240.8.176 Feedback-ID: 1.us-east-1.Lv9FVjaNvvR5llaqfLoOVbo2VxOELl7cjN0AOyXnPlk=:AmazonSES X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jan 2018 23:47:02 -0000 On 01/17/18 15:09, Gleb Smirnoff wrote: > On Sun, Dec 31, 2017 at 09:21:01AM +0000, Colin Percival wrote: > C> Code for recording timestamps of events, especially function entries/exits. > C> This is a very primitive system, intended for use in measuring performance > C> during the early system boot, before more sophisticated tools like DTrace > C> or infrastructure like kernel memory allocation and mutexes are available. > > Sorry if my question is too lame and late. Why can't you use ktr(4) tracer > for that purpose? The discussion on freebsd-current also doesn't have answer. I considered it, but it wasn't a good fit for a couple reasons: 1. ktr uses a circular buffer, while (since I'm looking at the boot process) I want to fill a buffer and then stop recording. 2. I would have needed to hack up ktr in order to make it work early enough in the boot process. (Most obviously: When we enter hammer_time, trying to access 'curthread' is a Bad Idea.) Since the timestamp recording framework I needed was just a few lines of code -- all the other commits are to add the points where timestamps are recorded, and would have been needed even if I used ktr -- it seemed better to just add my own code rather than coercing ktr to do what I needed. -- 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-head@freebsd.org Wed Jan 17 23:47:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E699EC0281; Wed, 17 Jan 2018 23:47:39 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io0-x22f.google.com (mail-io0-x22f.google.com [IPv6:2607:f8b0:4001:c06::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 45C2C68EDA; Wed, 17 Jan 2018 23:47:39 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io0-x22f.google.com with SMTP id f89so14768417ioj.4; Wed, 17 Jan 2018 15:47:39 -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=CHVibkKVWu7tm/aXU6r3bjfXxxkbvLTZHSoObeXvTBM=; b=c1gdeScSNBDyR5NP0+L5fP3D/ZcHCuYnZES5cKpmE+YDEV/uEgXsux9mjNOqxdz7c6 9RbigD0fIf0bikhNVLFoRGavpfm6CupWkmclYex0hJJV5cjp6AEhfRhRjbESiKw9zPoS 6Ig6T8IaRJvv/PH0TfUDIGPzh7kY/fAHqSomRpvKUCkdGHL+2tW0akjOFnH027oz7Oai j6dGS0oA0leeMBvaLdA+4QNPqjM/817w2nUANSRp/+6WXwXKhZ/b6F9ny5m08PexiasC b7GzJ4jb9H3Ojf109fWzjjhoZAVuRgAkH2hRnP3RCjH32Jb22lU8HczFg/Upal+YCP2r v9gQ== 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=CHVibkKVWu7tm/aXU6r3bjfXxxkbvLTZHSoObeXvTBM=; b=aCB9Ubu8OTy1dSNMMDP96FZi6SR92nyqnhyYftD9Z/rquDJFaVx9kK7w3wAf2dxmcF pjFLKRfUsGMbr2779oMciGTdLjbe9ti1g6eXclDf2r+vLDTpaBIcc2/PxgHrspTYRmao W9eSgSD7+jNkmtDEDmut0I0sJaO43Wo9vo8nL5r0dmb+k1GD+RUbU6tUYgYrUhDm6N/d /UqiO0JSiQEDv8dscF0y5GOa/+iiUdvgFWLFjTrg5q8yt+1fsuylmKuYzBZsBEsu4KFF b2mRQxMlMVyp9TExxjjsdfeuOpT3OIGra3OOgNWvxDxG3xZzXuk15wuiqEadhR8U/O5m ozrA== X-Gm-Message-State: AKwxytf2HAChFJT6AwVCqSlGpvTOoQe27OLlT5x+nzkmd2sqNpQtMv9F JIuVzlYpj4qx6xUTGZ/gKTV+wN+DpaMA5OCHeD+3xw== X-Google-Smtp-Source: ACJfBovmHI1R9glwK599JoYfKUjYgngQ8JF84HSPVH3QRJGjPYX0kMUKAIly2Kd4hDFVAJv1tMVpVMLh+0w0kwobP20= X-Received: by 10.107.201.136 with SMTP id z130mr11184986iof.257.1516232858379; Wed, 17 Jan 2018 15:47:38 -0800 (PST) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.136.201 with HTTP; Wed, 17 Jan 2018 15:47:17 -0800 (PST) In-Reply-To: <201801172252.w0HMq02l024443@repo.freebsd.org> References: <201801172252.w0HMq02l024443@repo.freebsd.org> From: Ed Maste Date: Wed, 17 Jan 2018 18:47:17 -0500 X-Google-Sender-Auth: ZECidr48K_ivsii0EuqtxMtry1Y Message-ID: Subject: Re: svn commit: r328101 - in head: stand/common sys/kern To: John Baldwin Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jan 2018 23:47:39 -0000 On 17 January 2018 at 17:52, John Baldwin wrote: > Author: jhb > Date: Wed Jan 17 22:51:59 2018 > New Revision: 328101 > URL: https://svnweb.freebsd.org/changeset/base/328101 > > Log: > Require the SHF_ALLOC flag for program sections from kernel object modules. > > The lld linker > does not sort the sections in ELF object files and mixed allocated and > unallocated sections. Note that this applies only to the output of lld -r - i.e., producing relocatable (.o) output. As the output of ld -r is normally expected to be input to a future link invocation lld largely leaves the contents as found in the input files, including section ordering. From owner-svn-src-head@freebsd.org Thu Jan 18 00:23:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1A20EC2432; Thu, 18 Jan 2018 00:23:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9BC516A8C1; Thu, 18 Jan 2018 00:23:12 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CDAF316BA1; Thu, 18 Jan 2018 00:23:11 +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 w0I0NBPM066101; Thu, 18 Jan 2018 00:23:11 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0I0NBYa066100; Thu, 18 Jan 2018 00:23:11 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201801180023.w0I0NBYa066100@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 18 Jan 2018 00:23:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328103 - head/usr.sbin/kldxref X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/usr.sbin/kldxref X-SVN-Commit-Revision: 328103 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 00:23:12 -0000 Author: jhb Date: Thu Jan 18 00:23:11 2018 New Revision: 328103 URL: https://svnweb.freebsd.org/changeset/base/328103 Log: Tidy some whitespace. Modified: head/usr.sbin/kldxref/ef_powerpc.c Modified: head/usr.sbin/kldxref/ef_powerpc.c ============================================================================== --- head/usr.sbin/kldxref/ef_powerpc.c Wed Jan 17 23:11:25 2018 (r328102) +++ head/usr.sbin/kldxref/ef_powerpc.c Thu Jan 18 00:23:11 2018 (r328103) @@ -59,10 +59,10 @@ ef_reloc(struct elf_file *ef, const void *reldata, int addend = rela->r_addend; rtype = ELF_R_TYPE(rela->r_info); - if ((char *)where < (char *)dest || (char *)where >= (char *)dest + len) + if ((char *)where < (char *)dest || (char *)where >= (char *)dest + len) return (0); - switch(rtype) { + switch (rtype) { case R_PPC_RELATIVE: /* word32 B + A */ *where = relbase + addend; break; From owner-svn-src-head@freebsd.org Thu Jan 18 00:24:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F191EC2562; Thu, 18 Jan 2018 00:24:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DFCCC6AAB0; Thu, 18 Jan 2018 00:24:06 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3417416BA2; Thu, 18 Jan 2018 00:24:06 +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 w0I0O6iZ066176; Thu, 18 Jan 2018 00:24:06 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0I0O6R2066175; Thu, 18 Jan 2018 00:24:06 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201801180024.w0I0O6R2066175@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 18 Jan 2018 00:24:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328104 - head/usr.sbin/kldxref X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/usr.sbin/kldxref X-SVN-Commit-Revision: 328104 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 00:24:07 -0000 Author: jhb Date: Thu Jan 18 00:24:05 2018 New Revision: 328104 URL: https://svnweb.freebsd.org/changeset/base/328104 Log: Adjust format string to fix build. Modified: head/usr.sbin/kldxref/ef_powerpc.c Modified: head/usr.sbin/kldxref/ef_powerpc.c ============================================================================== --- head/usr.sbin/kldxref/ef_powerpc.c Thu Jan 18 00:23:11 2018 (r328103) +++ head/usr.sbin/kldxref/ef_powerpc.c Thu Jan 18 00:24:05 2018 (r328104) @@ -67,7 +67,7 @@ ef_reloc(struct elf_file *ef, const void *reldata, int *where = relbase + addend; break; default: - warnx("unhandled relocation type %lu", rtype); + warnx("unhandled relocation type %u", rtype); } return (0); } From owner-svn-src-head@freebsd.org Thu Jan 18 01:43:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 562F2E70834 for ; Thu, 18 Jan 2018 01:43:01 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1.freebsd.org (Postfix) with SMTP id 3C6066DF4A for ; Thu, 18 Jan 2018 01:43:00 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: (qmail 2610 invoked by uid 99); 18 Jan 2018 01:43:00 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Jan 2018 01:43:00 +0000 Received: from [192.168.0.9] (unknown [186.80.205.98]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id D9D241A00E2; Thu, 18 Jan 2018 01:42:56 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.2 \(3445.5.20\)) Subject: Re: svn commit: r327675 - head/sys/netpfil/pf From: Pedro Giffuni In-Reply-To: <20180117233702.GR8113@FreeBSD.org> Date: Wed, 17 Jan 2018 20:42:52 -0500 Cc: Konstantin Belousov , Kristof Provost , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <6872E06D-738E-42C4-8D1A-C4381C21A269@FreeBSD.org> References: <201801071335.w07DZFWh069854@repo.freebsd.org> <20180107144423.GD1684@kib.kiev.ua> <20180117233702.GR8113@FreeBSD.org> To: Gleb Smirnoff X-Mailer: Apple Mail (2.3445.5.20) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 01:43:01 -0000 > On Jan 17, 2018, at 18:37, Gleb Smirnoff wrote: >=20 > On Sun, Jan 07, 2018 at 04:44:23PM +0200, Konstantin Belousov wrote: > K> On Sun, Jan 07, 2018 at 01:35:15PM +0000, Kristof Provost wrote: > K> > Author: kp > K> > Date: Sun Jan 7 13:35:15 2018 > K> > New Revision: 327675 > K> > URL: https://svnweb.freebsd.org/changeset/base/327675 > K> >=20 > K> > Log: > K> > pf: Avoid integer overflow issues by using mallocarray() iso. = malloc() > K> > =20 > K> > pfioctl() handles several ioctl that takes variable length = input, these > K> > include: > K> > - DIOCRADDTABLES > K> > - DIOCRDELTABLES > K> > - DIOCRGETTABLES > K> > - DIOCRGETTSTATS > K> > - DIOCRCLRTSTATS > K> > - DIOCRSETTFLAGS > K> > =20 > K> > All of them take a pfioc_table struct as input from userland. = One of > K> > its elements (pfrio_size) is used in a buffer length = calculation. > K> > The calculation contains an integer overflow which if triggered = can lead > K> > to out of bound reads and writes later on. > K> So the size of the allocation is controlled directly from the = userspace ? > K> This is an easy DoS, and by itself is perhaps bigger issue than the = overflow. >=20 > Yes, this is one of the dirties parts of pf. The whole API to read and = configure > tables from the userland calls to be rewritten from scratch. = Conversion from > malloc to mallocarray really does nothing. Better just put a maximum = value > cap. >=20 FWIW, the associated NULL checks just became no-ops since overflows in = mallocarray(9) will now cause panics. Either the flags should be changed to M_NOWAIT or the NULL checks should = be removed. No idea which makes more sense. Pedro. From owner-svn-src-head@freebsd.org Thu Jan 18 03:44:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFEA8E79B3E; Thu, 18 Jan 2018 03:44:45 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f172.google.com (mail-io0-f172.google.com [209.85.223.172]) (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 BED0373C09; Thu, 18 Jan 2018 03:44:45 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f172.google.com with SMTP id t22so11102321ioa.7; Wed, 17 Jan 2018 19:44: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=Fkxwg7BOGWgMECgkHY7YVuSxfxCOefOjDgWTTkr4rzY=; b=Q1QBP2a+kF+IqsxbXOInCYC+/tHX47J/h+Soj9+5pDNadyVrwy+iEkuEXQoA4z+xOI 6MwGSMdMB6pMTN5aw5dOHIrZVyTN/a8nK89wjomJt7CGyPJaxzRQFhp6SKQ0jfNb7VRE gCyrDhVK4LWVL5OeDc35Bud2DsLqYoeQ8mwido2w/7pmTRouSrTLMW5yRt4mKvTugTOO UtNub4bgC7hkfVAhHW1zfyT6fimmGH9xs+B8pWYkQy6L5KFOix8bu+zuukHZIRlL7NqP 1aoKaIC3v/KhP3pz8MVCdH4UVvHwHvi0GWRvv1iXqCzpx03gvjCIP7+tw1WUFqNGdwod tyCw== X-Gm-Message-State: AKwxytf/G3XwA05/QEOKG++q0oRzi7Ln3qLxSDotMxm+yF8giX0Sciu0 R4ScXmpFAuifhH+m/yS6ySL8SDWc X-Google-Smtp-Source: ACJfBosDzOGC7sjU3tSYd9t8+LCaJZ3ys0FWbI95ZTOqn6n3lsPbp9KL6H9hCffiId23RcUh0IRQ2A== X-Received: by 10.107.128.232 with SMTP id k101mr12090499ioi.152.1516246684640; Wed, 17 Jan 2018 19:38:04 -0800 (PST) Received: from mail-io0-f178.google.com (mail-io0-f178.google.com. [209.85.223.178]) by smtp.gmail.com with ESMTPSA id f194sm3217765iof.44.2018.01.17.19.38.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Jan 2018 19:38:04 -0800 (PST) Received: by mail-io0-f178.google.com with SMTP id c17so23316503iod.1; Wed, 17 Jan 2018 19:38:03 -0800 (PST) X-Received: by 10.107.174.196 with SMTP id n65mr3575091ioo.256.1516246683597; Wed, 17 Jan 2018 19:38:03 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.166.21 with HTTP; Wed, 17 Jan 2018 19:38:03 -0800 (PST) In-Reply-To: <201801171144.w0HBiLrY043134@repo.freebsd.org> References: <201801171144.w0HBiLrY043134@repo.freebsd.org> From: Conrad Meyer Date: Wed, 17 Jan 2018 19:38:03 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r328083 - in head/sys: amd64/amd64 amd64/ia32 amd64/include amd64/vmm amd64/vmm/intel dev/hyperv/vmbus dev/hyperv/vmbus/amd64 dev/hyperv/vmbus/i386 i386/i386 x86/include x86/isa x86/x86 To: Konstantin Belousov Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 03:44:46 -0000 On Wed, Jan 17, 2018 at 3:44 AM, Konstantin Belousov wrote: > Author: kib > Date: Wed Jan 17 11:44:21 2018 > New Revision: 328083 > URL: https://svnweb.freebsd.org/changeset/base/328083 > > Log: > PTI for amd64. This seems to break the xtoolchain GCC build: /usr/home/conrad/src/freebsd/sys/dev/hyperv/vmbus/amd64/vmbus_vector.S: Assembler messages: /usr/home/conrad/src/freebsd/sys/dev/hyperv/vmbus/amd64/vmbus_vector.S:40: Error: too many positional arguments I'm not sure why. Repro: pkg install amd64-xtoolchain-gcc && make buildkernel KERNCONF=GENERIC CROSS_TOOLCHAIN=amd64-gcc. Best, Conrad From owner-svn-src-head@freebsd.org Thu Jan 18 04:39:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE68AE7D73B; Thu, 18 Jan 2018 04:39:10 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A46B8764F1; Thu, 18 Jan 2018 04:39:10 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E20451972E; Thu, 18 Jan 2018 04:39:09 +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 w0I4d9RC079793; Thu, 18 Jan 2018 04:39:09 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0I4d920079785; Thu, 18 Jan 2018 04:39:09 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201801180439.w0I4d920079785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 18 Jan 2018 04:39:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328106 - in head: stand/fdt sys/contrib/libfdt X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: stand/fdt sys/contrib/libfdt X-SVN-Commit-Revision: 328106 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 04:39:11 -0000 Author: kevans Date: Thu Jan 18 04:39:09 2018 New Revision: 328106 URL: https://svnweb.freebsd.org/changeset/base/328106 Log: libfdt: Update to 1.4.6, switch to using libfdt for overlay support libfdt highlights since 1.4.3: - fdt_property_placeholder added to create a property without specifying its value at creation time - stringlist helper functions added to libfdt - Improved overlay support - Various internal cleanup Also switch stand/fdt over to using libfdt for overlay support with this update. Our current overlay implementation works only for limited use cases with overlays generated only by some specific versions of our dtc(1). Swap it out for the libfdt implementation, which supports any properly generated overlay being applied to a properly generated base. This will be followed up fairly soon with an update to dtc(1) in tree to properly generate overlays. MFC note: the include this update introduces in libfdt_env.h is apparently not necessary in the context we use this in. It's not immediately clear to me the motivation for it being introduced, but it came in with overlay support. I've left it in for the sake of accuracy and because it's not harmful here on HEAD, but MFC'ing this to stable/11 will require wrapping the #include in an `#ifndef _STANDALONE` block or else it will cause build failures. Tested on: Banana Pi-M3 (ARMv7) Tested on: Pine64 (aarch64) Tested on: PowerPC [nwhitehorn] Reviewed by: manu, nwhitehorn MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D13893 Added: head/sys/contrib/libfdt/fdt_addresses.c - copied unchanged from r328071, vendor/dtc/dist/libfdt/fdt_addresses.c head/sys/contrib/libfdt/fdt_overlay.c - copied unchanged from r328071, vendor/dtc/dist/libfdt/fdt_overlay.c Deleted: head/stand/fdt/fdt_overlay.c head/stand/fdt/fdt_overlay.h Modified: head/stand/fdt/Makefile head/stand/fdt/fdt_loader_cmd.c head/sys/contrib/libfdt/fdt.c head/sys/contrib/libfdt/fdt.h head/sys/contrib/libfdt/fdt_empty_tree.c head/sys/contrib/libfdt/fdt_ro.c head/sys/contrib/libfdt/fdt_rw.c head/sys/contrib/libfdt/fdt_strerror.c head/sys/contrib/libfdt/fdt_sw.c head/sys/contrib/libfdt/fdt_wip.c head/sys/contrib/libfdt/libfdt.h head/sys/contrib/libfdt/libfdt_env.h head/sys/contrib/libfdt/libfdt_internal.h Directory Properties: head/sys/contrib/libfdt/ (props changed) Modified: head/stand/fdt/Makefile ============================================================================== --- head/stand/fdt/Makefile Thu Jan 18 03:38:09 2018 (r328105) +++ head/stand/fdt/Makefile Thu Jan 18 04:39:09 2018 (r328106) @@ -9,10 +9,10 @@ INTERNALLIB= # Vendor sources of libfdt. SRCS+= fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c \ - fdt_empty_tree.c + fdt_empty_tree.c fdt_addresses.c fdt_overlay.c # Loader's fdt commands extension sources. -SRCS+= fdt_loader_cmd.c fdt_overlay.c +SRCS+= fdt_loader_cmd.c CFLAGS+= -I${SYSDIR}/contrib/libfdt/ -I${LDRSRC} Modified: head/stand/fdt/fdt_loader_cmd.c ============================================================================== --- head/stand/fdt/fdt_loader_cmd.c Thu Jan 18 03:38:09 2018 (r328105) +++ head/stand/fdt/fdt_loader_cmd.c Thu Jan 18 04:39:09 2018 (r328106) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include "bootstrap.h" #include "fdt_platform.h" -#include "fdt_overlay.h" #ifdef DEBUG #define debugf(fmt, args...) do { printf("%s(): ", __func__); \ Modified: head/sys/contrib/libfdt/fdt.c ============================================================================== --- head/sys/contrib/libfdt/fdt.c Thu Jan 18 03:38:09 2018 (r328105) +++ head/sys/contrib/libfdt/fdt.c Thu Jan 18 04:39:09 2018 (r328106) @@ -76,23 +76,24 @@ int fdt_check_header(const void *fdt) const void *fdt_offset_ptr(const void *fdt, int offset, unsigned int len) { - const char *p; + unsigned absoffset = offset + fdt_off_dt_struct(fdt); + if ((absoffset < offset) + || ((absoffset + len) < absoffset) + || (absoffset + len) > fdt_totalsize(fdt)) + return NULL; + if (fdt_version(fdt) >= 0x11) if (((offset + len) < offset) || ((offset + len) > fdt_size_dt_struct(fdt))) return NULL; - p = _fdt_offset_ptr(fdt, offset); - - if (p + len < p) - return NULL; - return p; + return fdt_offset_ptr_(fdt, offset); } uint32_t fdt_next_tag(const void *fdt, int startoffset, int *nextoffset) { - const uint32_t *tagp, *lenp; + const fdt32_t *tagp, *lenp; uint32_t tag; int offset = startoffset; const char *p; @@ -140,7 +141,7 @@ uint32_t fdt_next_tag(const void *fdt, int startoffset return tag; } -int _fdt_check_node_offset(const void *fdt, int offset) +int fdt_check_node_offset_(const void *fdt, int offset) { if ((offset < 0) || (offset % FDT_TAGSIZE) || (fdt_next_tag(fdt, offset, &offset) != FDT_BEGIN_NODE)) @@ -149,7 +150,7 @@ int _fdt_check_node_offset(const void *fdt, int offset return offset; } -int _fdt_check_prop_offset(const void *fdt, int offset) +int fdt_check_prop_offset_(const void *fdt, int offset) { if ((offset < 0) || (offset % FDT_TAGSIZE) || (fdt_next_tag(fdt, offset, &offset) != FDT_PROP)) @@ -164,7 +165,7 @@ int fdt_next_node(const void *fdt, int offset, int *de uint32_t tag; if (offset >= 0) - if ((nextoffset = _fdt_check_node_offset(fdt, offset)) < 0) + if ((nextoffset = fdt_check_node_offset_(fdt, offset)) < 0) return nextoffset; do { @@ -198,7 +199,35 @@ int fdt_next_node(const void *fdt, int offset, int *de return offset; } -const char *_fdt_find_string(const char *strtab, int tabsize, const char *s) +int fdt_first_subnode(const void *fdt, int offset) +{ + int depth = 0; + + offset = fdt_next_node(fdt, offset, &depth); + if (offset < 0 || depth != 1) + return -FDT_ERR_NOTFOUND; + + return offset; +} + +int fdt_next_subnode(const void *fdt, int offset) +{ + int depth = 1; + + /* + * With respect to the parent, the depth of the next subnode will be + * the same as the last. + */ + do { + offset = fdt_next_node(fdt, offset, &depth); + if (offset < 0 || depth < 1) + return -FDT_ERR_NOTFOUND; + } while (depth > 1); + + return offset; +} + +const char *fdt_find_string_(const char *strtab, int tabsize, const char *s) { int len = strlen(s) + 1; const char *last = strtab + tabsize - len; Modified: head/sys/contrib/libfdt/fdt.h ============================================================================== --- head/sys/contrib/libfdt/fdt.h Thu Jan 18 03:38:09 2018 (r328105) +++ head/sys/contrib/libfdt/fdt.h Thu Jan 18 04:39:09 2018 (r328106) @@ -1,48 +1,99 @@ -#ifndef _FDT_H -#define _FDT_H +#ifndef FDT_H +#define FDT_H +/* + * libfdt - Flat Device Tree manipulation + * Copyright (C) 2006 David Gibson, IBM Corporation. + * Copyright 2012 Kim Phillips, Freescale Semiconductor. + * + * libfdt is dual licensed: you can use it either under the terms of + * the GPL, or the BSD license, at your option. + * + * a) This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + * MA 02110-1301 USA + * + * Alternatively, + * + * b) 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 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. + */ #ifndef __ASSEMBLY__ struct fdt_header { - uint32_t magic; /* magic word FDT_MAGIC */ - uint32_t totalsize; /* total size of DT block */ - uint32_t off_dt_struct; /* offset to structure */ - uint32_t off_dt_strings; /* offset to strings */ - uint32_t off_mem_rsvmap; /* offset to memory reserve map */ - uint32_t version; /* format version */ - uint32_t last_comp_version; /* last compatible version */ + fdt32_t magic; /* magic word FDT_MAGIC */ + fdt32_t totalsize; /* total size of DT block */ + fdt32_t off_dt_struct; /* offset to structure */ + fdt32_t off_dt_strings; /* offset to strings */ + fdt32_t off_mem_rsvmap; /* offset to memory reserve map */ + fdt32_t version; /* format version */ + fdt32_t last_comp_version; /* last compatible version */ /* version 2 fields below */ - uint32_t boot_cpuid_phys; /* Which physical CPU id we're + fdt32_t boot_cpuid_phys; /* Which physical CPU id we're booting on */ /* version 3 fields below */ - uint32_t size_dt_strings; /* size of the strings block */ + fdt32_t size_dt_strings; /* size of the strings block */ /* version 17 fields below */ - uint32_t size_dt_struct; /* size of the structure block */ + fdt32_t size_dt_struct; /* size of the structure block */ }; struct fdt_reserve_entry { - uint64_t address; - uint64_t size; + fdt64_t address; + fdt64_t size; }; struct fdt_node_header { - uint32_t tag; + fdt32_t tag; char name[0]; }; struct fdt_property { - uint32_t tag; - uint32_t len; - uint32_t nameoff; + fdt32_t tag; + fdt32_t len; + fdt32_t nameoff; char data[0]; }; #endif /* !__ASSEMBLY */ #define FDT_MAGIC 0xd00dfeed /* 4: version, 4: total size */ -#define FDT_TAGSIZE sizeof(uint32_t) +#define FDT_TAGSIZE sizeof(fdt32_t) #define FDT_BEGIN_NODE 0x1 /* Start node: full name */ #define FDT_END_NODE 0x2 /* End node */ @@ -51,10 +102,10 @@ struct fdt_property { #define FDT_NOP 0x4 /* nop */ #define FDT_END 0x9 -#define FDT_V1_SIZE (7*sizeof(uint32_t)) -#define FDT_V2_SIZE (FDT_V1_SIZE + sizeof(uint32_t)) -#define FDT_V3_SIZE (FDT_V2_SIZE + sizeof(uint32_t)) +#define FDT_V1_SIZE (7*sizeof(fdt32_t)) +#define FDT_V2_SIZE (FDT_V1_SIZE + sizeof(fdt32_t)) +#define FDT_V3_SIZE (FDT_V2_SIZE + sizeof(fdt32_t)) #define FDT_V16_SIZE FDT_V3_SIZE -#define FDT_V17_SIZE (FDT_V16_SIZE + sizeof(uint32_t)) +#define FDT_V17_SIZE (FDT_V16_SIZE + sizeof(fdt32_t)) -#endif /* _FDT_H */ +#endif /* FDT_H */ Copied: head/sys/contrib/libfdt/fdt_addresses.c (from r328071, vendor/dtc/dist/libfdt/fdt_addresses.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/libfdt/fdt_addresses.c Thu Jan 18 04:39:09 2018 (r328106, copy of r328071, vendor/dtc/dist/libfdt/fdt_addresses.c) @@ -0,0 +1,96 @@ +/* + * libfdt - Flat Device Tree manipulation + * Copyright (C) 2014 David Gibson + * + * libfdt is dual licensed: you can use it either under the terms of + * the GPL, or the BSD license, at your option. + * + * a) This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + * MA 02110-1301 USA + * + * Alternatively, + * + * b) 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 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. + */ +#include "libfdt_env.h" + +#include +#include + +#include "libfdt_internal.h" + +int fdt_address_cells(const void *fdt, int nodeoffset) +{ + const fdt32_t *ac; + int val; + int len; + + ac = fdt_getprop(fdt, nodeoffset, "#address-cells", &len); + if (!ac) + return 2; + + if (len != sizeof(*ac)) + return -FDT_ERR_BADNCELLS; + + val = fdt32_to_cpu(*ac); + if ((val <= 0) || (val > FDT_MAX_NCELLS)) + return -FDT_ERR_BADNCELLS; + + return val; +} + +int fdt_size_cells(const void *fdt, int nodeoffset) +{ + const fdt32_t *sc; + int val; + int len; + + sc = fdt_getprop(fdt, nodeoffset, "#size-cells", &len); + if (!sc) + return 2; + + if (len != sizeof(*sc)) + return -FDT_ERR_BADNCELLS; + + val = fdt32_to_cpu(*sc); + if ((val < 0) || (val > FDT_MAX_NCELLS)) + return -FDT_ERR_BADNCELLS; + + return val; +} Modified: head/sys/contrib/libfdt/fdt_empty_tree.c ============================================================================== --- head/sys/contrib/libfdt/fdt_empty_tree.c Thu Jan 18 03:38:09 2018 (r328105) +++ head/sys/contrib/libfdt/fdt_empty_tree.c Thu Jan 18 04:39:09 2018 (r328106) @@ -81,4 +81,3 @@ int fdt_create_empty_tree(void *buf, int bufsize) return fdt_open_into(buf, buf, bufsize); } - Copied: head/sys/contrib/libfdt/fdt_overlay.c (from r328071, vendor/dtc/dist/libfdt/fdt_overlay.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/libfdt/fdt_overlay.c Thu Jan 18 04:39:09 2018 (r328106, copy of r328071, vendor/dtc/dist/libfdt/fdt_overlay.c) @@ -0,0 +1,861 @@ +#include "libfdt_env.h" + +#include +#include + +#include "libfdt_internal.h" + +/** + * overlay_get_target_phandle - retrieves the target phandle of a fragment + * @fdto: pointer to the device tree overlay blob + * @fragment: node offset of the fragment in the overlay + * + * overlay_get_target_phandle() retrieves the target phandle of an + * overlay fragment when that fragment uses a phandle (target + * property) instead of a path (target-path property). + * + * returns: + * the phandle pointed by the target property + * 0, if the phandle was not found + * -1, if the phandle was malformed + */ +static uint32_t overlay_get_target_phandle(const void *fdto, int fragment) +{ + const fdt32_t *val; + int len; + + val = fdt_getprop(fdto, fragment, "target", &len); + if (!val) + return 0; + + if ((len != sizeof(*val)) || (fdt32_to_cpu(*val) == (uint32_t)-1)) + return (uint32_t)-1; + + return fdt32_to_cpu(*val); +} + +/** + * overlay_get_target - retrieves the offset of a fragment's target + * @fdt: Base device tree blob + * @fdto: Device tree overlay blob + * @fragment: node offset of the fragment in the overlay + * @pathp: pointer which receives the path of the target (or NULL) + * + * overlay_get_target() retrieves the target offset in the base + * device tree of a fragment, no matter how the actual targetting is + * done (through a phandle or a path) + * + * returns: + * the targetted node offset in the base device tree + * Negative error code on error + */ +static int overlay_get_target(const void *fdt, const void *fdto, + int fragment, char const **pathp) +{ + uint32_t phandle; + const char *path = NULL; + int path_len = 0, ret; + + /* Try first to do a phandle based lookup */ + phandle = overlay_get_target_phandle(fdto, fragment); + if (phandle == (uint32_t)-1) + return -FDT_ERR_BADPHANDLE; + + /* no phandle, try path */ + if (!phandle) { + /* And then a path based lookup */ + path = fdt_getprop(fdto, fragment, "target-path", &path_len); + if (path) + ret = fdt_path_offset(fdt, path); + else + ret = path_len; + } else + ret = fdt_node_offset_by_phandle(fdt, phandle); + + /* + * If we haven't found either a target or a + * target-path property in a node that contains a + * __overlay__ subnode (we wouldn't be called + * otherwise), consider it a improperly written + * overlay + */ + if (ret < 0 && path_len == -FDT_ERR_NOTFOUND) + ret = -FDT_ERR_BADOVERLAY; + + /* return on error */ + if (ret < 0) + return ret; + + /* return pointer to path (if available) */ + if (pathp) + *pathp = path ? path : NULL; + + return ret; +} + +/** + * overlay_phandle_add_offset - Increases a phandle by an offset + * @fdt: Base device tree blob + * @node: Device tree overlay blob + * @name: Name of the property to modify (phandle or linux,phandle) + * @delta: offset to apply + * + * overlay_phandle_add_offset() increments a node phandle by a given + * offset. + * + * returns: + * 0 on success. + * Negative error code on error + */ +static int overlay_phandle_add_offset(void *fdt, int node, + const char *name, uint32_t delta) +{ + const fdt32_t *val; + uint32_t adj_val; + int len; + + val = fdt_getprop(fdt, node, name, &len); + if (!val) + return len; + + if (len != sizeof(*val)) + return -FDT_ERR_BADPHANDLE; + + adj_val = fdt32_to_cpu(*val); + if ((adj_val + delta) < adj_val) + return -FDT_ERR_NOPHANDLES; + + adj_val += delta; + if (adj_val == (uint32_t)-1) + return -FDT_ERR_NOPHANDLES; + + return fdt_setprop_inplace_u32(fdt, node, name, adj_val); +} + +/** + * overlay_adjust_node_phandles - Offsets the phandles of a node + * @fdto: Device tree overlay blob + * @node: Offset of the node we want to adjust + * @delta: Offset to shift the phandles of + * + * overlay_adjust_node_phandles() adds a constant to all the phandles + * of a given node. This is mainly use as part of the overlay + * application process, when we want to update all the overlay + * phandles to not conflict with the overlays of the base device tree. + * + * returns: + * 0 on success + * Negative error code on failure + */ +static int overlay_adjust_node_phandles(void *fdto, int node, + uint32_t delta) +{ + int child; + int ret; + + ret = overlay_phandle_add_offset(fdto, node, "phandle", delta); + if (ret && ret != -FDT_ERR_NOTFOUND) + return ret; + + ret = overlay_phandle_add_offset(fdto, node, "linux,phandle", delta); + if (ret && ret != -FDT_ERR_NOTFOUND) + return ret; + + fdt_for_each_subnode(child, fdto, node) { + ret = overlay_adjust_node_phandles(fdto, child, delta); + if (ret) + return ret; + } + + return 0; +} + +/** + * overlay_adjust_local_phandles - Adjust the phandles of a whole overlay + * @fdto: Device tree overlay blob + * @delta: Offset to shift the phandles of + * + * overlay_adjust_local_phandles() adds a constant to all the + * phandles of an overlay. This is mainly use as part of the overlay + * application process, when we want to update all the overlay + * phandles to not conflict with the overlays of the base device tree. + * + * returns: + * 0 on success + * Negative error code on failure + */ +static int overlay_adjust_local_phandles(void *fdto, uint32_t delta) +{ + /* + * Start adjusting the phandles from the overlay root + */ + return overlay_adjust_node_phandles(fdto, 0, delta); +} + +/** + * overlay_update_local_node_references - Adjust the overlay references + * @fdto: Device tree overlay blob + * @tree_node: Node offset of the node to operate on + * @fixup_node: Node offset of the matching local fixups node + * @delta: Offset to shift the phandles of + * + * overlay_update_local_nodes_references() update the phandles + * pointing to a node within the device tree overlay by adding a + * constant delta. + * + * This is mainly used as part of a device tree application process, + * where you want the device tree overlays phandles to not conflict + * with the ones from the base device tree before merging them. + * + * returns: + * 0 on success + * Negative error code on failure + */ +static int overlay_update_local_node_references(void *fdto, + int tree_node, + int fixup_node, + uint32_t delta) +{ + int fixup_prop; + int fixup_child; + int ret; + + fdt_for_each_property_offset(fixup_prop, fdto, fixup_node) { + const fdt32_t *fixup_val; + const char *tree_val; + const char *name; + int fixup_len; + int tree_len; + int i; + + fixup_val = fdt_getprop_by_offset(fdto, fixup_prop, + &name, &fixup_len); + if (!fixup_val) + return fixup_len; + + if (fixup_len % sizeof(uint32_t)) + return -FDT_ERR_BADOVERLAY; + + tree_val = fdt_getprop(fdto, tree_node, name, &tree_len); + if (!tree_val) { + if (tree_len == -FDT_ERR_NOTFOUND) + return -FDT_ERR_BADOVERLAY; + + return tree_len; + } + + for (i = 0; i < (fixup_len / sizeof(uint32_t)); i++) { + fdt32_t adj_val; + uint32_t poffset; + + poffset = fdt32_to_cpu(fixup_val[i]); + + /* + * phandles to fixup can be unaligned. + * + * Use a memcpy for the architectures that do + * not support unaligned accesses. + */ + memcpy(&adj_val, tree_val + poffset, sizeof(adj_val)); + + adj_val = cpu_to_fdt32(fdt32_to_cpu(adj_val) + delta); + + ret = fdt_setprop_inplace_namelen_partial(fdto, + tree_node, + name, + strlen(name), + poffset, + &adj_val, + sizeof(adj_val)); + if (ret == -FDT_ERR_NOSPACE) + return -FDT_ERR_BADOVERLAY; + + if (ret) + return ret; + } + } + + fdt_for_each_subnode(fixup_child, fdto, fixup_node) { + const char *fixup_child_name = fdt_get_name(fdto, fixup_child, + NULL); + int tree_child; + + tree_child = fdt_subnode_offset(fdto, tree_node, + fixup_child_name); + if (tree_child == -FDT_ERR_NOTFOUND) + return -FDT_ERR_BADOVERLAY; + if (tree_child < 0) + return tree_child; + + ret = overlay_update_local_node_references(fdto, + tree_child, + fixup_child, + delta); + if (ret) + return ret; + } + + return 0; +} + +/** + * overlay_update_local_references - Adjust the overlay references + * @fdto: Device tree overlay blob + * @delta: Offset to shift the phandles of + * + * overlay_update_local_references() update all the phandles pointing + * to a node within the device tree overlay by adding a constant + * delta to not conflict with the base overlay. + * + * This is mainly used as part of a device tree application process, + * where you want the device tree overlays phandles to not conflict + * with the ones from the base device tree before merging them. + * + * returns: + * 0 on success + * Negative error code on failure + */ +static int overlay_update_local_references(void *fdto, uint32_t delta) +{ + int fixups; + + fixups = fdt_path_offset(fdto, "/__local_fixups__"); + if (fixups < 0) { + /* There's no local phandles to adjust, bail out */ + if (fixups == -FDT_ERR_NOTFOUND) + return 0; + + return fixups; + } + + /* + * Update our local references from the root of the tree + */ + return overlay_update_local_node_references(fdto, 0, fixups, + delta); +} + +/** + * overlay_fixup_one_phandle - Set an overlay phandle to the base one + * @fdt: Base Device Tree blob + * @fdto: Device tree overlay blob + * @symbols_off: Node offset of the symbols node in the base device tree + * @path: Path to a node holding a phandle in the overlay + * @path_len: number of path characters to consider + * @name: Name of the property holding the phandle reference in the overlay + * @name_len: number of name characters to consider + * @poffset: Offset within the overlay property where the phandle is stored + * @label: Label of the node referenced by the phandle + * + * overlay_fixup_one_phandle() resolves an overlay phandle pointing to + * a node in the base device tree. + * + * This is part of the device tree overlay application process, when + * you want all the phandles in the overlay to point to the actual + * base dt nodes. + * + * returns: + * 0 on success + * Negative error code on failure + */ +static int overlay_fixup_one_phandle(void *fdt, void *fdto, + int symbols_off, + const char *path, uint32_t path_len, + const char *name, uint32_t name_len, + int poffset, const char *label) +{ + const char *symbol_path; + uint32_t phandle; + fdt32_t phandle_prop; + int symbol_off, fixup_off; + int prop_len; + + if (symbols_off < 0) + return symbols_off; + + symbol_path = fdt_getprop(fdt, symbols_off, label, + &prop_len); + if (!symbol_path) + return prop_len; + + symbol_off = fdt_path_offset(fdt, symbol_path); + if (symbol_off < 0) + return symbol_off; + + phandle = fdt_get_phandle(fdt, symbol_off); + if (!phandle) + return -FDT_ERR_NOTFOUND; + + fixup_off = fdt_path_offset_namelen(fdto, path, path_len); + if (fixup_off == -FDT_ERR_NOTFOUND) + return -FDT_ERR_BADOVERLAY; + if (fixup_off < 0) + return fixup_off; + + phandle_prop = cpu_to_fdt32(phandle); + return fdt_setprop_inplace_namelen_partial(fdto, fixup_off, + name, name_len, poffset, + &phandle_prop, + sizeof(phandle_prop)); +}; + +/** + * overlay_fixup_phandle - Set an overlay phandle to the base one + * @fdt: Base Device Tree blob + * @fdto: Device tree overlay blob + * @symbols_off: Node offset of the symbols node in the base device tree + * @property: Property offset in the overlay holding the list of fixups + * + * overlay_fixup_phandle() resolves all the overlay phandles pointed + * to in a __fixups__ property, and updates them to match the phandles + * in use in the base device tree. + * + * This is part of the device tree overlay application process, when + * you want all the phandles in the overlay to point to the actual + * base dt nodes. + * + * returns: + * 0 on success + * Negative error code on failure + */ +static int overlay_fixup_phandle(void *fdt, void *fdto, int symbols_off, + int property) +{ + const char *value; + const char *label; + int len; + + value = fdt_getprop_by_offset(fdto, property, + &label, &len); + if (!value) { + if (len == -FDT_ERR_NOTFOUND) + return -FDT_ERR_INTERNAL; + + return len; + } + + do { + const char *path, *name, *fixup_end; + const char *fixup_str = value; + uint32_t path_len, name_len; + uint32_t fixup_len; + char *sep, *endptr; + int poffset, ret; + + fixup_end = memchr(value, '\0', len); + if (!fixup_end) + return -FDT_ERR_BADOVERLAY; + fixup_len = fixup_end - fixup_str; + + len -= fixup_len + 1; + value += fixup_len + 1; + + path = fixup_str; + sep = memchr(fixup_str, ':', fixup_len); + if (!sep || *sep != ':') + return -FDT_ERR_BADOVERLAY; + + path_len = sep - path; + if (path_len == (fixup_len - 1)) + return -FDT_ERR_BADOVERLAY; + + fixup_len -= path_len + 1; + name = sep + 1; + sep = memchr(name, ':', fixup_len); + if (!sep || *sep != ':') + return -FDT_ERR_BADOVERLAY; + + name_len = sep - name; + if (!name_len) + return -FDT_ERR_BADOVERLAY; + + poffset = strtoul(sep + 1, &endptr, 10); + if ((*endptr != '\0') || (endptr <= (sep + 1))) + return -FDT_ERR_BADOVERLAY; + + ret = overlay_fixup_one_phandle(fdt, fdto, symbols_off, + path, path_len, name, name_len, + poffset, label); + if (ret) + return ret; + } while (len > 0); + + return 0; +} + +/** + * overlay_fixup_phandles - Resolve the overlay phandles to the base + * device tree + * @fdt: Base Device Tree blob + * @fdto: Device tree overlay blob + * + * overlay_fixup_phandles() resolves all the overlay phandles pointing + * to nodes in the base device tree. + * + * This is one of the steps of the device tree overlay application + * process, when you want all the phandles in the overlay to point to + * the actual base dt nodes. + * + * returns: + * 0 on success + * Negative error code on failure + */ +static int overlay_fixup_phandles(void *fdt, void *fdto) +{ + int fixups_off, symbols_off; + int property; + + /* We can have overlays without any fixups */ + fixups_off = fdt_path_offset(fdto, "/__fixups__"); + if (fixups_off == -FDT_ERR_NOTFOUND) + return 0; /* nothing to do */ + if (fixups_off < 0) + return fixups_off; + + /* And base DTs without symbols */ + symbols_off = fdt_path_offset(fdt, "/__symbols__"); + if ((symbols_off < 0 && (symbols_off != -FDT_ERR_NOTFOUND))) + return symbols_off; + + fdt_for_each_property_offset(property, fdto, fixups_off) { + int ret; + + ret = overlay_fixup_phandle(fdt, fdto, symbols_off, property); + if (ret) + return ret; + } + + return 0; +} + +/** + * overlay_apply_node - Merges a node into the base device tree + * @fdt: Base Device Tree blob + * @target: Node offset in the base device tree to apply the fragment to + * @fdto: Device tree overlay blob + * @node: Node offset in the overlay holding the changes to merge + * + * overlay_apply_node() merges a node into a target base device tree + * node pointed. + * + * This is part of the final step in the device tree overlay + * application process, when all the phandles have been adjusted and + * resolved and you just have to merge overlay into the base device + * tree. + * + * returns: + * 0 on success + * Negative error code on failure + */ +static int overlay_apply_node(void *fdt, int target, + void *fdto, int node) +{ + int property; + int subnode; + + fdt_for_each_property_offset(property, fdto, node) { + const char *name; + const void *prop; + int prop_len; + int ret; + + prop = fdt_getprop_by_offset(fdto, property, &name, + &prop_len); + if (prop_len == -FDT_ERR_NOTFOUND) + return -FDT_ERR_INTERNAL; + if (prop_len < 0) + return prop_len; + + ret = fdt_setprop(fdt, target, name, prop, prop_len); + if (ret) + return ret; + } + + fdt_for_each_subnode(subnode, fdto, node) { + const char *name = fdt_get_name(fdto, subnode, NULL); + int nnode; + int ret; + + nnode = fdt_add_subnode(fdt, target, name); + if (nnode == -FDT_ERR_EXISTS) { + nnode = fdt_subnode_offset(fdt, target, name); + if (nnode == -FDT_ERR_NOTFOUND) + return -FDT_ERR_INTERNAL; + } + + if (nnode < 0) + return nnode; + + ret = overlay_apply_node(fdt, nnode, fdto, subnode); + if (ret) + return ret; + } + + return 0; +} + +/** + * overlay_merge - Merge an overlay into its base device tree + * @fdt: Base Device Tree blob + * @fdto: Device tree overlay blob + * + * overlay_merge() merges an overlay into its base device tree. + * + * This is the next to last step in the device tree overlay application + * process, when all the phandles have been adjusted and resolved and + * you just have to merge overlay into the base device tree. + * + * returns: + * 0 on success + * Negative error code on failure + */ +static int overlay_merge(void *fdt, void *fdto) +{ + int fragment; + + fdt_for_each_subnode(fragment, fdto, 0) { + int overlay; + int target; + int ret; + + /* + * Each fragments will have an __overlay__ node. If + * they don't, it's not supposed to be merged + */ + overlay = fdt_subnode_offset(fdto, fragment, "__overlay__"); + if (overlay == -FDT_ERR_NOTFOUND) + continue; + + if (overlay < 0) + return overlay; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Jan 18 04:58:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0F9DE7F368; Thu, 18 Jan 2018 04:58:56 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 61E9F77851; Thu, 18 Jan 2018 04:58:56 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C59919ABB; Thu, 18 Jan 2018 04:58:55 +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 w0I4wtgT088257; Thu, 18 Jan 2018 04:58:55 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0I4wsn9088252; Thu, 18 Jan 2018 04:58:54 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201801180458.w0I4wsn9088252@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 18 Jan 2018 04:58:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328107 - in head: etc/mtree share/man/man7 stand/arm/loader stand/forth stand/mips/uboot X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: etc/mtree share/man/man7 stand/arm/loader stand/forth stand/mips/uboot X-SVN-Commit-Revision: 328107 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 04:58:56 -0000 Author: kevans Date: Thu Jan 18 04:58:54 2018 New Revision: 328107 URL: https://svnweb.freebsd.org/changeset/base/328107 Log: stand: Add /boot/overlays to allow separation of overlays from base FDT This matches directory structure used commonly in Linux-land, and it's cleaner than mixing overlays into the existing module paths. Overlays are still mixed in by specifying fdt_overlays in loader.conf(5). Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D13922 Modified: head/etc/mtree/BSD.root.dist head/share/man/man7/hier.7 head/stand/arm/loader/loader.conf head/stand/forth/loader.conf head/stand/mips/uboot/loader.conf Modified: head/etc/mtree/BSD.root.dist ============================================================================== --- head/etc/mtree/BSD.root.dist Thu Jan 18 04:39:09 2018 (r328106) +++ head/etc/mtree/BSD.root.dist Thu Jan 18 04:58:54 2018 (r328107) @@ -18,6 +18,8 @@ .. modules .. + overlays + .. zfs .. .. Modified: head/share/man/man7/hier.7 ============================================================================== --- head/share/man/man7/hier.7 Thu Jan 18 04:39:09 2018 (r328106) +++ head/share/man/man7/hier.7 Thu Jan 18 04:58:54 2018 (r328107) @@ -28,7 +28,7 @@ .\" @(#)hier.7 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd December 3, 2017 +.Dd January 15, 2018 .Dt HIER 7 .Os .Sh NAME @@ -63,6 +63,11 @@ at boot time) and kernel modules third-party loadable kernel modules; see .Xr kldstat 8 +.It Pa overlays/ +Compiled flattened device tree (FDT) overlays; see +.Xr fdt 4 +and +.Xr dtc 1 .It Pa zfs/ .Xr zfs 8 zpool cache files Modified: head/stand/arm/loader/loader.conf ============================================================================== --- head/stand/arm/loader/loader.conf Thu Jan 18 04:39:09 2018 (r328106) +++ head/stand/arm/loader/loader.conf Thu Jan 18 04:58:54 2018 (r328107) @@ -7,7 +7,7 @@ autoboot_delay=10 bootfile="kernel" # Kernel name (possibly absolute path) kernel="kernel" # /boot sub-directory containing kernel and modules loader_conf_files="/boot/loader.conf /boot/loader.conf.local" -module_path="/boot/kernel;/boot/modules;/boot/dtb" +module_path="/boot/kernel;/boot/modules;/boot/dtb;/boot/overlays" nextboot_conf="/boot/nextboot.conf" nextboot_enable="NO" verbose_loading="NO" Modified: head/stand/forth/loader.conf ============================================================================== --- head/stand/forth/loader.conf Thu Jan 18 04:39:09 2018 (r328106) +++ head/stand/forth/loader.conf Thu Jan 18 04:58:54 2018 (r328107) @@ -97,7 +97,7 @@ bootenv_autolist="YES" # Auto populate the list of ZF #comconsole_speed="9600" # Set the current serial console speed #console="vidconsole" # A comma separated list of console(s) #currdev="disk1s1a" # Set the current device -module_path="/boot/modules;/boot/dtb" # Set the module search path +module_path="/boot/modules;/boot/dtb;/boot/overlays" # Set the module search path #prompt="\\${interpret}" # Set the command prompt #root_disk_unit="0" # Force the root disk unit number #rootdev="disk1s1a" # Set the root filesystem Modified: head/stand/mips/uboot/loader.conf ============================================================================== --- head/stand/mips/uboot/loader.conf Thu Jan 18 04:39:09 2018 (r328106) +++ head/stand/mips/uboot/loader.conf Thu Jan 18 04:58:54 2018 (r328107) @@ -7,7 +7,7 @@ autoboot_delay=10 bootfile="kernel" # Kernel name (possibly absolute path) kernel="kernel" # /boot sub-directory containing kernel and modules loader_conf_files="/boot/loader.conf /boot/loader.conf.local" -module_path="/boot/kernel;/boot/modules;/boot/dtb" +module_path="/boot/kernel;/boot/modules;/boot/dtb;/boot/overlays" nextboot_conf="/boot/nextboot.conf" nextboot_enable="NO" verbose_loading="NO" From owner-svn-src-head@freebsd.org Thu Jan 18 05:57:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 482E0EB449C; Thu, 18 Jan 2018 05:57:12 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0ABCD79D60; Thu, 18 Jan 2018 05:57: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C1981A4DD; Thu, 18 Jan 2018 05:57:11 +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 w0I5vBJv013047; Thu, 18 Jan 2018 05:57:11 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0I5vACI013042; Thu, 18 Jan 2018 05:57:10 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201801180557.w0I5vACI013042@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 18 Jan 2018 05:57:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328108 - in head: sbin/geom/class/nop sys/geom/nop tests/sys/geom/class/nop X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head: sbin/geom/class/nop sys/geom/nop tests/sys/geom/class/nop X-SVN-Commit-Revision: 328108 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 05:57:12 -0000 Author: asomers Date: Thu Jan 18 05:57:10 2018 New Revision: 328108 URL: https://svnweb.freebsd.org/changeset/base/328108 Log: gnop(8): add the ability to set a nop provider's physical path While I'm here, expand the existing tests a bit. MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D13579 Modified: head/sbin/geom/class/nop/geom_nop.c head/sbin/geom/class/nop/gnop.8 head/sys/geom/nop/g_nop.c head/sys/geom/nop/g_nop.h head/tests/sys/geom/class/nop/nop_test.sh Modified: head/sbin/geom/class/nop/geom_nop.c ============================================================================== --- head/sbin/geom/class/nop/geom_nop.c Thu Jan 18 04:58:54 2018 (r328107) +++ head/sbin/geom/class/nop/geom_nop.c Thu Jan 18 05:57:10 2018 (r328108) @@ -51,10 +51,12 @@ struct g_command class_commands[] = { { 's', "size", "0", G_TYPE_NUMBER }, { 'S', "secsize", "0", G_TYPE_NUMBER }, { 'w', "wfailprob", "-1", G_TYPE_NUMBER }, + { 'z', "physpath", G_NOP_PHYSPATH_PASSTHROUGH, G_TYPE_STRING }, G_OPT_SENTINEL }, "[-v] [-e error] [-o offset] [-p stripesize] [-P stripeoffset] " - "[-r rfailprob] [-s size] [-S secsize] [-w wfailprob] dev ..." + "[-r rfailprob] [-s size] [-S secsize] [-w wfailprob] " + "[-z physpath] dev ..." }, { "configure", G_FLAG_VERBOSE, NULL, { Modified: head/sbin/geom/class/nop/gnop.8 ============================================================================== --- head/sbin/geom/class/nop/gnop.8 Thu Jan 18 04:58:54 2018 (r328107) +++ head/sbin/geom/class/nop/gnop.8 Thu Jan 18 05:57:10 2018 (r328108) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 10, 2015 +.Dd January 17, 2018 .Dt GNOP 8 .Os .Sh NAME @@ -42,6 +42,7 @@ .Op Fl s Ar size .Op Fl S Ar secsize .Op Fl w Ar wfailprob +.Op Fl z Ar physpath .Ar dev ... .Nm .Cm configure @@ -132,6 +133,8 @@ Sector size of the transparent provider. Specifies write failure probability in percent. .It Fl v Be more verbose. +.It Fl z Ar physpath +Physical path of the transparent provider. .El .Sh SYSCTL VARIABLES The following Modified: head/sys/geom/nop/g_nop.c ============================================================================== --- head/sys/geom/nop/g_nop.c Thu Jan 18 04:58:54 2018 (r328107) +++ head/sys/geom/nop/g_nop.c Thu Jan 18 05:57:10 2018 (r328108) @@ -126,6 +126,11 @@ g_nop_start(struct bio *bp) break; case BIO_GETATTR: sc->sc_getattrs++; + if (sc->sc_physpath && + g_handleattr_str(bp, "GEOM::physpath", sc->sc_physpath)) { + mtx_unlock(&sc->sc_lock); + return; + } break; case BIO_FLUSH: sc->sc_flushes++; @@ -182,7 +187,7 @@ g_nop_access(struct g_provider *pp, int dr, int dw, in static int g_nop_create(struct gctl_req *req, struct g_class *mp, struct g_provider *pp, int ioerror, u_int rfailprob, u_int wfailprob, off_t offset, off_t size, - u_int secsize, u_int stripesize, u_int stripeoffset) + u_int secsize, u_int stripesize, u_int stripeoffset, const char *physpath) { struct g_nop_softc *sc; struct g_geom *gp; @@ -253,6 +258,10 @@ g_nop_create(struct gctl_req *req, struct g_class *mp, sc->sc_explicitsize = explicitsize; sc->sc_stripesize = stripesize; sc->sc_stripeoffset = stripeoffset; + if (physpath && strcmp(physpath, G_NOP_PHYSPATH_PASSTHROUGH)) { + sc->sc_physpath = strndup(physpath, MAXPATHLEN, M_GEOM); + } else + sc->sc_physpath = NULL; sc->sc_error = ioerror; sc->sc_rfailprob = rfailprob; sc->sc_wfailprob = wfailprob; @@ -299,6 +308,7 @@ fail: g_destroy_consumer(cp); g_destroy_provider(newpp); mtx_destroy(&sc->sc_lock); + free(sc->sc_physpath, M_GEOM); g_free(gp->softc); g_destroy_geom(gp); return (error); @@ -314,6 +324,7 @@ g_nop_destroy(struct g_geom *gp, boolean_t force) sc = gp->softc; if (sc == NULL) return (ENXIO); + free(sc->sc_physpath, M_GEOM); pp = LIST_FIRST(&gp->provider); if (pp != NULL && (pp->acr != 0 || pp->acw != 0 || pp->ace != 0)) { if (force) { @@ -348,7 +359,7 @@ g_nop_ctl_create(struct gctl_req *req, struct g_class struct g_provider *pp; intmax_t *error, *rfailprob, *wfailprob, *offset, *secsize, *size, *stripesize, *stripeoffset; - const char *name; + const char *name, *physpath; char param[16]; int i, *nargs; @@ -431,6 +442,7 @@ g_nop_ctl_create(struct gctl_req *req, struct g_class gctl_error(req, "Invalid '%s' argument", "stripeoffset"); return; } + physpath = gctl_get_asciiparam(req, "physpath"); for (i = 0; i < *nargs; i++) { snprintf(param, sizeof(param), "arg%d", i); @@ -452,7 +464,8 @@ g_nop_ctl_create(struct gctl_req *req, struct g_class *rfailprob == -1 ? 0 : (u_int)*rfailprob, *wfailprob == -1 ? 0 : (u_int)*wfailprob, (off_t)*offset, (off_t)*size, (u_int)*secsize, - (u_int)*stripesize, (u_int)*stripeoffset) != 0) { + (u_int)*stripesize, (u_int)*stripeoffset, + physpath) != 0) { return; } } Modified: head/sys/geom/nop/g_nop.h ============================================================================== --- head/sys/geom/nop/g_nop.h Thu Jan 18 04:58:54 2018 (r328107) +++ head/sys/geom/nop/g_nop.h Thu Jan 18 05:57:10 2018 (r328108) @@ -34,6 +34,11 @@ #define G_NOP_CLASS_NAME "NOP" #define G_NOP_VERSION 4 #define G_NOP_SUFFIX ".nop" +/* + * Special flag to instruct gnop to passthrough the underlying provider's + * physical path + */ +#define G_NOP_PHYSPATH_PASSTHROUGH "\255" #ifdef _KERNEL #define G_NOP_DEBUG(lvl, ...) do { \ @@ -75,6 +80,7 @@ struct g_nop_softc { uintmax_t sc_cmd2s; uintmax_t sc_readbytes; uintmax_t sc_wrotebytes; + char* sc_physpath; struct mtx sc_lock; }; #endif /* _KERNEL */ Modified: head/tests/sys/geom/class/nop/nop_test.sh ============================================================================== --- head/tests/sys/geom/class/nop/nop_test.sh Thu Jan 18 04:58:54 2018 (r328107) +++ head/tests/sys/geom/class/nop/nop_test.sh Thu Jan 18 05:57:10 2018 (r328108) @@ -27,14 +27,14 @@ MD_DEVS="md.devs" PLAINFILES=plainfiles -atf_test_case diskinfo cleanup -diskinfo_head() +atf_test_case preserve_props cleanup +preserve_props_head() { - atf_set "descr" "gnop should preserve diskinfo's basic properties" + atf_set "descr" "gnop should preserve basic GEOM properties" atf_set "require.user" "root" atf_set "timeout" 15 } -diskinfo_body() +preserve_props_body() { load_gnop us=$(alloc_md) @@ -49,11 +49,54 @@ diskinfo_body() atf_check_equal "$md_mediasize" "$nop_mediasize" atf_check_equal "$md_stripesize" "$nop_stripesize" } -diskinfo_cleanup() +preserve_props_cleanup() { common_cleanup } +atf_test_case preserve_disk_props cleanup +preserve_disk_props_head() +{ + atf_set "descr" "gnop should preserve properties for disks" + atf_set "require.user" "root" + atf_set "require.config" "disks" + atf_set "timeout" 15 +} +preserve_disk_props_body() +{ + load_gnop + disks=`atf_config_get disks` + disk=${disks%% *} + if [ -z "$disk" ]; then + atf_skip "Must define disks (see tests(7))" + fi + atf_check gnop create ${disk} + + disk_ident=$(diskinfo -s ${disk}) + disk_physpath=$(diskinfo -p ${disk}) + disk_descr=$(diskinfo -v ${disk} | awk '/Disk descr/ {print $1}') + disk_trim=$(diskinfo -v ${disk} | awk '/TRIM.UNMAP/ {print $1}') + disk_rotrate=$(diskinfo -v ${disk} | awk '/Rotation rate/ {print $1}') + disk_zonemode=$(diskinfo -v ${disk} | awk '/Zone Mode/ {print $1}') + nop_ident=$(diskinfo -s ${disk}.nop) + nop_physpath=$(diskinfo -p ${disk}.nop) + nop_descr=$(diskinfo -v ${disk}.nop | awk '/Disk descr/ {print $1}') + nop_trim=$(diskinfo -v ${disk}.nop | awk '/TRIM.UNMAP/ {print $1}') + nop_rotrate=$(diskinfo -v ${disk}.nop | awk '/Rotation/ {print $1}') + nop_zonemode=$(diskinfo -v ${disk}.nop | awk '/Zone Mode/ {print $1}') + atf_check_equal "$disk_ident" "$nop_ident" + atf_check_equal "$disk_physpath" "$nop_physpath" + atf_check_equal "$disk_descr" "$nop_descr" + atf_check_equal "$disk_trim" "$nop_trim" + atf_check_equal "$disk_rotrate" "$nop_rotrate" + atf_check_equal "$disk_zonemode" "$nop_zonemode" +} +preserve_disk_props_cleanup() +{ + disk_cleanup + common_cleanup +} + atf_test_case io cleanup io_head() { @@ -80,6 +123,54 @@ io_cleanup() common_cleanup } +atf_test_case physpath cleanup +physpath_head() +{ + atf_set "descr" "Test gnop's -z option" + atf_set "require.user" "root" + atf_set "timeout" 15 +} +physpath_body() +{ + load_gnop + us=$(alloc_md) + physpath="some/physical/path" + atf_check gnop create -z $physpath /dev/${us} + gnop_physpath=$(diskinfo -p ${us}.nop) + atf_check_equal "$physpath" "$gnop_physpath" +} +physpath_cleanup() +{ + common_cleanup +} + +atf_test_case physpath_blank cleanup +physpath_blank_head() +{ + atf_set "descr" "gnop can set physical path to the empty string" + atf_set "require.user" "root" + atf_set "require.config" "disks" + atf_set "timeout" 15 +} +physpath_blank_body() +{ + load_gnop + disks=`atf_config_get disks` + disk=${disks%% *} + if [ -z "$disk" ]; then + atf_skip "Must define disks (see tests(7))" + fi + + atf_check gnop create -z "" ${disk} + gnop_physpath=$(diskinfo -p ${disk}.nop) + atf_check_equal "" "$gnop_physpath" +} +physpath_blank_cleanup() +{ + disk_cleanup + common_cleanup +} + atf_test_case size cleanup size_head() { @@ -136,7 +227,10 @@ stripesize_cleanup() atf_init_test_cases() { atf_add_test_case io - atf_add_test_case diskinfo + atf_add_test_case physpath + atf_add_test_case physpath_blank + atf_add_test_case preserve_props + atf_add_test_case preserve_disk_props atf_add_test_case stripesize atf_add_test_case size } @@ -167,6 +261,15 @@ common_cleanup() rm ${PLAINFILES} fi true +} + +disk_cleanup() +{ + disks=`atf_config_get disks` + disk=${disks%% *} + if [ -n "$disk" ]; then + gnop destroy -f ${disk}.nop 2>/dev/null + fi } load_gnop() From owner-svn-src-head@freebsd.org Thu Jan 18 06:28:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 726BEEB63E4; Thu, 18 Jan 2018 06:28:22 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ECB77AF24; Thu, 18 Jan 2018 06:28:22 +0000 (UTC) (envelope-from wma@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 979421AA1A; Thu, 18 Jan 2018 06:28:21 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0I6SLbQ025463; Thu, 18 Jan 2018 06:28:21 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0I6SLWC025462; Thu, 18 Jan 2018 06:28:21 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201801180628.w0I6SLWC025462@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Thu, 18 Jan 2018 06:28:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328109 - head/sys/powerpc/conf X-SVN-Group: head X-SVN-Commit-Author: wma X-SVN-Commit-Paths: head/sys/powerpc/conf X-SVN-Commit-Revision: 328109 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 06:28:22 -0000 Author: wma Date: Thu Jan 18 06:28:21 2018 New Revision: 328109 URL: https://svnweb.freebsd.org/changeset/base/328109 Log: PPC64: add AHCI back to GENERIC64 > Description of fields to fill in above: 76 columns --| > PR: If a GNATS PR is affected by the change. > Submitted by: If someone else sent in the change. > Reviewed by: If someone else reviewed your modification. > Approved by: If you needed approval for this commit. > Obtained from: If the change is from a third party. > MFC after: N [day[s]|week[s]|month[s]]. Request a reminder email. > MFH: Ports tree branch name. Request approval for merge. > Relnotes: Set to 'yes' for mention in release notes. > Security: Vulnerability reference (one per line) or description. > Sponsored by: If the change was sponsored by an organization. > Differential Revision: https://reviews.freebsd.org/D### (*full* phabric URL needed). > Empty fields above will be automatically removed. M sys/powerpc/conf/GENERIC64 Modified: head/sys/powerpc/conf/GENERIC64 Modified: head/sys/powerpc/conf/GENERIC64 ============================================================================== --- head/sys/powerpc/conf/GENERIC64 Thu Jan 18 05:57:10 2018 (r328108) +++ head/sys/powerpc/conf/GENERIC64 Thu Jan 18 06:28:21 2018 (r328109) @@ -107,7 +107,7 @@ options PCI_HP # PCI-Express native HotPlug device agp # ATA controllers -#device ahci # AHCI-compatible SATA controllers +device ahci # AHCI-compatible SATA controllers device ata # Legacy ATA/SATA controllers device mvs # Marvell 88SX50XX/88SX60XX/88SX70XX/SoC SATA device siis # SiliconImage SiI3124/SiI3132/SiI3531 SATA From owner-svn-src-head@freebsd.org Thu Jan 18 06:32:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B614EEB68D3 for ; Thu, 18 Jan 2018 06:32:54 +0000 (UTC) (envelope-from wma@semihalf.com) Received: from mail-qt0-x22e.google.com (mail-qt0-x22e.google.com [IPv6:2607:f8b0:400d:c0d::22e]) (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 83EA97B40A for ; Thu, 18 Jan 2018 06:32:54 +0000 (UTC) (envelope-from wma@semihalf.com) Received: by mail-qt0-x22e.google.com with SMTP id m59so27761559qte.11 for ; Wed, 17 Jan 2018 22:32:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=eB6hjsHj4mIU6vjJOHOXXxR+y54zOELGU8YN6LsdzoE=; b=jBuQSOWcas6koRPJU1U98nuehigqT+SH3vpI0ViuOKE1b32IbOCyflUw162PNhHFRM wrKAwy0ZD8jC7c013I45ZDGPhHBZcZUsIKZCjyDukviqAtiPPu+hSm2PcXKDXaB2zNrH 69M3q5k5aKzyK90CEKixL0DG71FJ1S7dCgcuK2D4j4nXe0GWGrL9IJplh2QBwpIWpDLz 6sbXfniNkY41Qr6pC72ZQ/07KPr1wrGUYUoYZelX5xmAPpqrPsc3FxuVAzqxY2p3xBZ0 wTWRF+Q7I9KWiQ6yCROcpbEoNrLrPV8H3L0MXPihOG29D2mUAdD2LlFPeTP0k76SMTWB NqQQ== 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; bh=eB6hjsHj4mIU6vjJOHOXXxR+y54zOELGU8YN6LsdzoE=; b=lC/i2VxTQBJFFNfgZJW+v1wHRAwUh86R/rR+S/rzOuP0x8v36/0A/ikZwoPPcYgOoa iAr73KSoHBLnv9iZVexWxr34KAYlSxOxNXLDNd6tuffpYG1PKotfnOFPHs2NIt0Dc99r ph9bL1b0NKUaGecDUzSw63gTb//48uJ0DXPaIbC050s+tA5QW88yskLqvXFV2OzGKbpI /07zURnIY1NgH4/UI4v3u4CeTbBPrI/siCy5km+Bk+9UQ3U0OfVx258Sw8RKM+pk0Up3 p5WROUIoRu7C1e9nME+2OUmx/pBD+5gyuEHwOYqa0g0ezTcZq8HLgfdwBbFgfyBNjaI2 0P0A== X-Gm-Message-State: AKwxytdcuS4Nqd2WLVR5+8+AA2b2o1TJQOXmQqZMObjUr1MxKw+8Ilwi pbPPAIbEGK/pcz/0Qbg7TTN4C7GTsHeXAro+v/0z8Q== X-Google-Smtp-Source: ACJfBosbm3nRkze/vnsP6jH31J/ctwmoQ4CFo0U8JpOo6Lu9AGw9DmNLSFmnBdKBaSxhDXyprEhQVr+6WByYbKwbigA= X-Received: by 10.237.52.101 with SMTP id w92mr20376559qtd.204.1516257173626; Wed, 17 Jan 2018 22:32:53 -0800 (PST) MIME-Version: 1.0 Received: by 10.200.57.103 with HTTP; Wed, 17 Jan 2018 22:32:33 -0800 (PST) In-Reply-To: <20180117154135.GA30476@ox> References: <201801170933.w0H9XHu1085819@repo.freebsd.org> <20180117154135.GA30476@ox> From: Wojciech Macek Date: Thu, 18 Jan 2018 07:32:33 +0100 Message-ID: Subject: Re: svn commit: r328078 - head/sys/powerpc/conf To: Wojciech Macek , 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-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 06:32:54 -0000 Added AHCI back. The 821LC board (Power8) is equipped with Chelsio (25G) and Intel (1G) adapters by default. Currently, the cxgbe is the only interface working on the PPC64. Intel, after moving to iflib, has troubles with endianness and doesn't work. Also, PowerNV does not support loader thus we can't load any module along with the kernel. If then someone wants to boot the board from the network or use NFS filestytem, cxgbe must be compiled in. Regards, Wojtek 2018-01-17 16:41 GMT+01:00 Navdeep Parhar : > On Wed, Jan 17, 2018 at 09:33:17AM +0000, Wojciech Macek wrote: > > Author: wma > > Date: Wed Jan 17 09:33:16 2018 > > New Revision: 328078 > > URL: https://svnweb.freebsd.org/changeset/base/328078 > > > > Log: > > PPC64: add CXGBE and remove AHCI from GENERIC64 > > > > Add CXGBE driver which is required for PowerNV system. > > I wonder why this is required. Are there any problems in building and > using it as a loadable module? > > Regards, > Navdeep > > > Also, remove AHCI which does not work in BigEndian. > > > > Created by: Wojciech Macek > > Obtained from: Semihalf > > Sponsored by: QCM Technologies > > > > Modified: > > head/sys/powerpc/conf/GENERIC64 > > > > Modified: head/sys/powerpc/conf/GENERIC64 > > ============================================================ > ================== > > --- head/sys/powerpc/conf/GENERIC64 Wed Jan 17 08:01:51 2018 > (r328077) > > +++ head/sys/powerpc/conf/GENERIC64 Wed Jan 17 09:33:16 2018 > (r328078) > > @@ -107,7 +107,7 @@ options PCI_HP # PCI-Express > native HotPlug > > device agp > > > > # ATA controllers > > -device ahci # AHCI-compatible SATA controllers > > +#device ahci # AHCI-compatible SATA controllers > > device ata # Legacy ATA/SATA controllers > > device mvs # Marvell > 88SX50XX/88SX60XX/88SX70XX/SoC SATA > > device siis # SiliconImage > SiI3124/SiI3132/SiI3531 SATA > > @@ -143,6 +143,7 @@ device ix # Intel PRO/10GbE > PCIE PF Ethernet Family > > device ixv # Intel PRO/10GbE PCIE VF Ethernet > Family > > device glc # Sony Playstation 3 Ethernet > > device llan # IBM pSeries Virtual Ethernet > > +device cxgbe # Chelsio 10/25G NIC > > > > # PCI Ethernet NICs that use the common MII bus controller code. > > device miibus # MII bus support > > > From owner-svn-src-head@freebsd.org Thu Jan 18 07:20:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6586CEB95B7; Thu, 18 Jan 2018 07:20:12 +0000 (UTC) (envelope-from srs0=sjjv=en=freebsd.org=kp@codepro.be) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.codepro.be", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 310F67D051; Thu, 18 Jan 2018 07:20:12 +0000 (UTC) (envelope-from srs0=sjjv=en=freebsd.org=kp@codepro.be) Received: from [172.16.2.10] (vega.codepro.be [IPv6:2a01:4f8:162:1127::3]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id 98CA44664E; Thu, 18 Jan 2018 08:20:08 +0100 (CET) From: "Kristof Provost" To: "Gleb Smirnoff" Cc: "Konstantin Belousov" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r327675 - head/sys/netpfil/pf Date: Thu, 18 Jan 2018 08:20:04 +0100 X-Mailer: MailMate (2.0BETAr6103) Message-ID: In-Reply-To: <20180117233702.GR8113@FreeBSD.org> References: <201801071335.w07DZFWh069854@repo.freebsd.org> <20180107144423.GD1684@kib.kiev.ua> <20180117233702.GR8113@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed; markup=markdown Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 07:20:12 -0000 On 18 Jan 2018, at 0:37, Gleb Smirnoff wrote: > On Sun, Jan 07, 2018 at 04:44:23PM +0200, Konstantin Belousov wrote: > K> On Sun, Jan 07, 2018 at 01:35:15PM +0000, Kristof Provost wrote: > K> > Author: kp > K> > Date: Sun Jan 7 13:35:15 2018 > K> > New Revision: 327675 > K> > URL: https://svnweb.freebsd.org/changeset/base/327675 > K> > > K> > Log: > K> > pf: Avoid integer overflow issues by using mallocarray() iso. > malloc() > K> > > K> > pfioctl() handles several ioctl that takes variable length > input, these > K> > include: > K> > - DIOCRADDTABLES > K> > - DIOCRDELTABLES > K> > - DIOCRGETTABLES > K> > - DIOCRGETTSTATS > K> > - DIOCRCLRTSTATS > K> > - DIOCRSETTFLAGS > K> > > K> > All of them take a pfioc_table struct as input from userland. > One of > K> > its elements (pfrio_size) is used in a buffer length > calculation. > K> > The calculation contains an integer overflow which if triggered > can lead > K> > to out of bound reads and writes later on. > K> So the size of the allocation is controlled directly from the > userspace ? > K> This is an easy DoS, and by itself is perhaps bigger issue than the > overflow. > > Yes, this is one of the dirties parts of pf. The whole API to read and > configure > tables from the userland calls to be rewritten from scratch. > Conversion from > malloc to mallocarray really does nothing. Better just put a maximum > value > cap. > I’m working on introducing limits there. Many GET/DELETE calls we can just limit to min(user_specified_size, kernel_size) for example. Some of the others, like ADDTABLES are only used by pfctl, which only ever adds one table at a time. An arbitrary limit of 65k should be fine there. ADDADDRS is one of the hard ones, because there’s no obvious limit to how many addresses can be added to a table. We may end up with an annoying arbitrary limit there. I’m not done auditing all of them, but hopefully I’ll have something soon-ish. And yes, I’m aware that the NULL checks no longer make sense. I’ll remove them as part of this work. They’re useless but not harmful at the moment. Regards, Kristof From owner-svn-src-head@freebsd.org Thu Jan 18 07:26:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67031EB9AA6; Thu, 18 Jan 2018 07:26:12 +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 47B357D638; Thu, 18 Jan 2018 07:26:12 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 8F291DB6F; Thu, 18 Jan 2018 07:26:11 +0000 (UTC) Date: Thu, 18 Jan 2018 07:26:11 +0000 From: Alexey Dokuchaev To: Ed Maste Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327890 - head/usr.sbin/bsdinstall/partedit Message-ID: <20180118072611.GA51638@FreeBSD.org> References: <201801122025.w0CKPvVk022670@repo.freebsd.org> <20180113065347.GA26333@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180113065347.GA26333@FreeBSD.org> User-Agent: Mutt/1.9.2 (2017-12-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 07:26:12 -0000 On Sat, Jan 13, 2018 at 06:53:47AM +0000, Alexey Dokuchaev wrote: > On Fri, Jan 12, 2018 at 08:25:57PM +0000, Ed Maste wrote: > > New Revision: 327890 > > URL: https://svnweb.freebsd.org/changeset/base/327890 > > > > Log: > > bsdinstall: disable SUJ by default > > > > SUJ + cg checksums produce spurious warnings after an unclean shutdown > > (e.g. a crash). For now disable SUJ for UFS installs so installing from > > a FreeBSD 12 snapshot results in a usable filesystem, until this can be > > fixed. > > Thanks; I keep seeing it quite often. Is it safe to disable SUJ on already > populated filesystem? Can (should) it better be done on live, mounted one, > of better off the other booted instance of FreeBSD (from another media)? Ping. ./danfe From owner-svn-src-head@freebsd.org Thu Jan 18 07:38:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E49F3EBA67F; Thu, 18 Jan 2018 07:38:55 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C06FE7DF10; Thu, 18 Jan 2018 07:38:55 +0000 (UTC) (envelope-from wma@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0CFCC1B642; Thu, 18 Jan 2018 07:38:55 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0I7csUq054485; Thu, 18 Jan 2018 07:38:54 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0I7cswv054484; Thu, 18 Jan 2018 07:38:54 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201801180738.w0I7cswv054484@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Thu, 18 Jan 2018 07:38:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328110 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: wma X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 328110 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 07:38:56 -0000 Author: wma Date: Thu Jan 18 07:38:54 2018 New Revision: 328110 URL: https://svnweb.freebsd.org/changeset/base/328110 Log: KDB: restart only CPUs stopped by KDB There is a case when not all CPUs went online. In that situation, restart only APs which were operational before entering KDB. Created by: Wojciech Macek Obtained from: Semihalf Reviewed by: nwhitehorn Differential revision: https://reviews.freebsd.org/D13949 Sponsored by: QCM Technologies Modified: head/sys/kern/subr_kdb.c Modified: head/sys/kern/subr_kdb.c ============================================================================== --- head/sys/kern/subr_kdb.c Thu Jan 18 06:28:21 2018 (r328109) +++ head/sys/kern/subr_kdb.c Thu Jan 18 07:38:54 2018 (r328110) @@ -673,6 +673,7 @@ kdb_trap(int type, int code, struct trapframe *tf) #ifdef SMP if (!SCHEDULER_STOPPED()) { other_cpus = all_cpus; + CPU_NAND(&other_cpus, &stopped_cpus); CPU_CLR(PCPU_GET(cpuid), &other_cpus); stop_cpus_hard(other_cpus); did_stop_cpus = 1; @@ -707,8 +708,9 @@ kdb_trap(int type, int code, struct trapframe *tf) kdb_active--; #ifdef SMP + CPU_AND(&other_cpus, &stopped_cpus); if (did_stop_cpus) - restart_cpus(stopped_cpus); + restart_cpus(other_cpus); #endif intr_restore(intr); From owner-svn-src-head@freebsd.org Thu Jan 18 07:42:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C4C2EBABC3; Thu, 18 Jan 2018 07:42:52 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5736A7E52F; Thu, 18 Jan 2018 07:42:52 +0000 (UTC) (envelope-from wma@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 94AD61B7EE; Thu, 18 Jan 2018 07:42:51 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0I7gpPb058440; Thu, 18 Jan 2018 07:42:51 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0I7gpav058438; Thu, 18 Jan 2018 07:42:51 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201801180742.w0I7gpav058438@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Thu, 18 Jan 2018 07:42:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328112 - head/sys/powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: wma X-SVN-Commit-Paths: head/sys/powerpc/powerpc X-SVN-Commit-Revision: 328112 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 07:42:52 -0000 Author: wma Date: Thu Jan 18 07:42:51 2018 New Revision: 328112 URL: https://svnweb.freebsd.org/changeset/base/328112 Log: PPC64: fix TOC behavior on process initialization Set stack pointer to correct value after thread's stack pointer restore Restoring new thread's stack pointer caused stack corruption because restored stack pointer didn't point to callee (cpu_switch) stack frame but caller stack frame. As a result we had mysterious errors in caller function (sched_switch). Solution: simply set stack pointer to correct value Also, initialize TOC to a valid pointer once the thread is being created. Created by: Patryk Duda Submitted by: Wojciech Macek Obtained from: Semihalf Reviewed by: nwhitehorn Differential revision: https://reviews.freebsd.org/D13947 Sponsored by: QCM Technologies Modified: head/sys/powerpc/powerpc/swtch64.S head/sys/powerpc/powerpc/vm_machdep.c Modified: head/sys/powerpc/powerpc/swtch64.S ============================================================================== --- head/sys/powerpc/powerpc/swtch64.S Thu Jan 18 07:41:04 2018 (r328111) +++ head/sys/powerpc/powerpc/swtch64.S Thu Jan 18 07:42:51 2018 (r328112) @@ -160,6 +160,7 @@ blocked_loop: ld %r17,TD_PCB(%r13) /* Get new PCB */ ld %r1,PCB_SP(%r17) /* Load the stack pointer */ + addi %r1,%r1,-48 /* Remember about cpu_switch stack frame */ /* Release old thread now that we have a stack pointer set up */ cmpdi %r14,0 Modified: head/sys/powerpc/powerpc/vm_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/vm_machdep.c Thu Jan 18 07:41:04 2018 (r328111) +++ head/sys/powerpc/powerpc/vm_machdep.c Thu Jan 18 07:42:51 2018 (r328112) @@ -190,6 +190,9 @@ cpu_fork_kthread_handler(struct thread *td, void (*fun cf = (struct callframe *)td->td_pcb->pcb_sp; + #if defined(__powerpc64__) && (!defined(_CALL_ELF) || _CALL_ELF == 1) + cf->cf_toc = ((register_t *)func)[1]; + #endif cf->cf_func = (register_t)func; cf->cf_arg0 = (register_t)arg; } From owner-svn-src-head@freebsd.org Thu Jan 18 07:41:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2AB33EBAA3C; Thu, 18 Jan 2018 07:41:06 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 065397E135; Thu, 18 Jan 2018 07:41:06 +0000 (UTC) (envelope-from wma@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 47FFA1B676; Thu, 18 Jan 2018 07:41:05 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0I7f5qU055309; Thu, 18 Jan 2018 07:41:05 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0I7f5xm055308; Thu, 18 Jan 2018 07:41:05 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201801180741.w0I7f5xm055308@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Thu, 18 Jan 2018 07:41:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328111 - head/sys/powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: wma X-SVN-Commit-Paths: head/sys/powerpc/powerpc X-SVN-Commit-Revision: 328111 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 07:41:06 -0000 Author: wma Date: Thu Jan 18 07:41:04 2018 New Revision: 328111 URL: https://svnweb.freebsd.org/changeset/base/328111 Log: PPC: machdep, zero BSS always but BookE Zero BSS always. The only case when this operation is ommitted is when booting on BookE. Created by: Wojciech Macek Obtained from: Semihalf Reviewed by: imp, nwhitehorn Differential revision: https://reviews.freebsd.org/D13948 Sponsored by: QCM Technologies Modified: head/sys/powerpc/powerpc/machdep.c Modified: head/sys/powerpc/powerpc/machdep.c ============================================================================== --- head/sys/powerpc/powerpc/machdep.c Thu Jan 18 07:38:54 2018 (r328110) +++ head/sys/powerpc/powerpc/machdep.c Thu Jan 18 07:41:04 2018 (r328111) @@ -260,6 +260,15 @@ powerpc_init(vm_offset_t fdt, vm_offset_t toc, vm_offs if (mdp_cookie != 0xfb5d104d) mdp = NULL; +#if !defined(BOOKE) + /* + * On BOOKE the BSS is already cleared and some variables + * initialized. Do not wipe them out. + */ + bzero(__sbss_start, __sbss_end - __sbss_start); + bzero(__bss_start, _end - __bss_start); +#endif + #ifdef AIM /* * If running from an FDT, make sure we are in real mode to avoid @@ -293,14 +302,6 @@ powerpc_init(vm_offset_t fdt, vm_offset_t toc, vm_offs #endif } } else { -#if !defined(BOOKE) - /* - * On BOOKE the BSS is already cleared and some variables - * initialized. Do not wipe them out. - */ - bzero(__sbss_start, __sbss_end - __sbss_start); - bzero(__bss_start, _end - __bss_start); -#endif init_static_kenv(init_kenv, sizeof(init_kenv)); ofw_bootargs = true; } From owner-svn-src-head@freebsd.org Thu Jan 18 08:34:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2980EBD31D; Thu, 18 Jan 2018 08:34:21 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BBF7D802EA; Thu, 18 Jan 2018 08:34:21 +0000 (UTC) (envelope-from wma@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EA3A01C07B; Thu, 18 Jan 2018 08:34:20 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0I8YKvL079119; Thu, 18 Jan 2018 08:34:20 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0I8YKKk079118; Thu, 18 Jan 2018 08:34:20 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201801180834.w0I8YKKk079118@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Thu, 18 Jan 2018 08:34:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328113 - head/sys/powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: wma X-SVN-Commit-Paths: head/sys/powerpc/powerpc X-SVN-Commit-Revision: 328113 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 08:34:22 -0000 Author: wma Date: Thu Jan 18 08:34:20 2018 New Revision: 328113 URL: https://svnweb.freebsd.org/changeset/base/328113 Log: Call platform_smp_ap_init before decr_ap_init In platform_smp_ap_init we are doing some crucial code (eg. set LPCR register) which have influence over further execution. Practiculary in PowerNV platform we have experienced Data Storage Interrupt before we set apropriate LPCR. It caused code execution from location which was legal in bootloader (petitboot based on linux) but illegal in FreeBSD Modified: head/sys/powerpc/powerpc/mp_machdep.c Modified: head/sys/powerpc/powerpc/mp_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/mp_machdep.c Thu Jan 18 07:42:51 2018 (r328112) +++ head/sys/powerpc/powerpc/mp_machdep.c Thu Jan 18 08:34:20 2018 (r328113) @@ -81,12 +81,12 @@ machdep_ap_bootstrap(void) __asm __volatile("or 27,27,27"); __asm __volatile("or 6,6,6"); + /* Give platform code a chance to do anything necessary */ + platform_smp_ap_init(); + /* Initialize DEC and TB, sync with the BSP values */ platform_smp_timebase_sync(ap_timebase, 1); decr_ap_init(); - - /* Give platform code a chance to do anything necessary */ - platform_smp_ap_init(); /* Serialize console output and AP count increment */ mtx_lock_spin(&ap_boot_mtx); From owner-svn-src-head@freebsd.org Thu Jan 18 09:46:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0DF6EC0E44; Thu, 18 Jan 2018 09:46:30 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: from mail-wm0-x236.google.com (mail-wm0-x236.google.com [IPv6:2a00:1450:400c: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 85DC3830B5; Thu, 18 Jan 2018 09:46:30 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: by mail-wm0-x236.google.com with SMTP id b141so20771143wme.1; Thu, 18 Jan 2018 01:46:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=BQXyvGW9H5ojDiFWqh9qGU7mLd2oXSfvU2apiEmiWTM=; b=UYUJm8qbY95m83k+GqMp9JE23C8mDPJ020IxZJjB3Gq3Erhi68XEhTlKUe2mSydwLJ yE4sOyY57YcbrxE476MXeVarknrncWXd13M+5n7Z20IKQRvnS+i6CYZYD07o0ukAI9yi /aFtlI1cKWXFWunRAaejMhOXryHPtpj51A5fvuQxPfFnIa8J5V4xSLJRVWnXNs+YNmi4 QtdLxVcldUriA7ESby65KOcQpRd/XLNGATc5zTxHURE//rvd0Uwe+HkvAB4PWNfvK22U LjfMu7tQGvDnX/li3B99qgCyOIhahxhQvhGw90FFfmEmeif8RP8uz/tN/8a8Iryfnd+m YIjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=BQXyvGW9H5ojDiFWqh9qGU7mLd2oXSfvU2apiEmiWTM=; b=A3FKnNAnYtGbjmEwSP7wyaJnqVsHRQK+ebzCy+RwIFPJPeXcheY9uZLln2j261i88j WRwftdNIn8p1PLR3nGIsUNfOtjyy4HCm/etXLV8ABtCstH3uisA/rp4n5CJQjZTFqZuo r3dAHCJHmCHAxQ7ACc3NJ1WikTCugJrP76cba3D/VlC50G4aK1jn5V84rHC51oTpgmZb 2iR+WFd31QZH6Seryz+ocOclLaoZl57TZch8S837E2SGeeqa2IUFVLnuuRpQSAQGiDFW MDm2egCw2ANBPs+laYRzIC3Ty86EwLJXBflb0qyrEmYbnwpeEcw5sOKvy99ldqc1i3z1 d38Q== X-Gm-Message-State: AKwxytcHbukpgnt8VJUT/ro36YSYgXw8mT9U3g1IpwWS30JXcOG/SSxr b7lqcLR4yyBmbmbALn3IDnp+VQ== X-Google-Smtp-Source: ACJfBov0g2NAPZIxgdRYbDTjEs708M55iknHOjMc4tAP3faWnCrdRHMEEIeeAjyRxDu5BVfMLpAIfg== X-Received: by 10.28.210.197 with SMTP id j188mr954808wmg.74.1516268788685; Thu, 18 Jan 2018 01:46:28 -0800 (PST) Received: from ernst.home (p5B023419.dip0.t-ipconnect.de. [91.2.52.25]) by smtp.gmail.com with ESMTPSA id j125sm10421771wmd.19.2018.01.18.01.46.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 18 Jan 2018 01:46:27 -0800 (PST) Date: Thu, 18 Jan 2018 10:46:20 +0100 From: Gary Jennejohn To: Alexey Dokuchaev Cc: Ed Maste , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r327890 - head/usr.sbin/bsdinstall/partedit Message-ID: <20180118104620.43f3ca7b@ernst.home> In-Reply-To: <20180118072611.GA51638@FreeBSD.org> References: <201801122025.w0CKPvVk022670@repo.freebsd.org> <20180113065347.GA26333@FreeBSD.org> <20180118072611.GA51638@FreeBSD.org> Reply-To: gljennjohn@gmail.com X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.31; amd64-portbld-freebsd12.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 09:46:31 -0000 On Thu, 18 Jan 2018 07:26:11 +0000 Alexey Dokuchaev wrote: > On Sat, Jan 13, 2018 at 06:53:47AM +0000, Alexey Dokuchaev wrote: > > On Fri, Jan 12, 2018 at 08:25:57PM +0000, Ed Maste wrote: > > > New Revision: 327890 > > > URL: https://svnweb.freebsd.org/changeset/base/327890 > > > > > > Log: > > > bsdinstall: disable SUJ by default > > > > > > SUJ + cg checksums produce spurious warnings after an unclean shutdown > > > (e.g. a crash). For now disable SUJ for UFS installs so installing from > > > a FreeBSD 12 snapshot results in a usable filesystem, until this can be > > > fixed. > > > > Thanks; I keep seeing it quite often. Is it safe to disable SUJ on already > > populated filesystem? Can (should) it better be done on live, mounted one, > > of better off the other booted instance of FreeBSD (from another media)? > > Ping. > The answer to your question is in tunefs(8). Snippet: The tunefs utility is designed to change the dynamic parameters of a UFS file system which affect the layout policies. The tunefs utility cannot be run on an active file system. To change an active file system, it must be downgraded to read-only or unmounted. -- Gary Jennejohn From owner-svn-src-head@freebsd.org Thu Jan 18 09:49:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81248EC10B6; Thu, 18 Jan 2018 09:49:14 +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 608FF8331F; Thu, 18 Jan 2018 09:49:14 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id A86371065D; Thu, 18 Jan 2018 09:49:13 +0000 (UTC) Date: Thu, 18 Jan 2018 09:49:13 +0000 From: Alexey Dokuchaev To: Gary Jennejohn Cc: Ed Maste , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r327890 - head/usr.sbin/bsdinstall/partedit Message-ID: <20180118094913.GA13682@FreeBSD.org> References: <201801122025.w0CKPvVk022670@repo.freebsd.org> <20180113065347.GA26333@FreeBSD.org> <20180118072611.GA51638@FreeBSD.org> <20180118104620.43f3ca7b@ernst.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180118104620.43f3ca7b@ernst.home> User-Agent: Mutt/1.9.2 (2017-12-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 09:49:14 -0000 On Thu, Jan 18, 2018 at 10:46:20AM +0100, Gary Jennejohn wrote: > On Thu, 18 Jan 2018 07:26:11 +0000 > Alexey Dokuchaev wrote: > > > ... > > > Thanks; I keep seeing it quite often. > > > Is it safe to disable SUJ on already populated filesystem? > > > Can (should) it better be done on live, mounted one, > > > of better off the other booted instance of FreeBSD (from > > > another media)? > > ... > > The answer to your question is in tunefs(8). Thanks. OK, that answers the second question (silly one). What about the first one: Is it safe to disable SUJ on already populated filesystem? ./danfe From owner-svn-src-head@freebsd.org Thu Jan 18 10:10:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1990DEC2793; Thu, 18 Jan 2018 10:10:32 +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 ED87C9DA; Thu, 18 Jan 2018 10:10:31 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 385EB11229; Thu, 18 Jan 2018 10:10:31 +0000 (UTC) Date: Thu, 18 Jan 2018 10:10:31 +0000 From: Alexey Dokuchaev To: Jason Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r319971 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src include lib/libc/stdlib/jemalloc Message-ID: <20180118101031.GB21646@FreeBSD.org> References: <201706150715.v5F7F6aT031218@repo.freebsd.org> <20180113170430.GA52597@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180113170430.GA52597@FreeBSD.org> User-Agent: Mutt/1.9.2 (2017-12-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 10:10:32 -0000 On Sat, Jan 13, 2018 at 05:04:30PM +0000, Alexey Dokuchaev wrote: > On Thu, Jun 15, 2017 at 07:15:06AM +0000, Jason Evans wrote: > > New Revision: 319971 > > URL: https://svnweb.freebsd.org/changeset/base/319971 > > > > Log: > > Update jemalloc to 5.0.0. > > I've finally bisected the problem of `games/quake2lnx' failing to start > (hanging) in GLX mode down to this commit. Reverting it and making "all > install" under `/usr/src/lib/libc' restores correct operation. > > If I run it as ``env LD_PRELOAD=/lib/libthr.so.3 quake2 ...'' it starts > normally. Do you have any ideas what might have broken it? Is this a > problem with how the Quake2 binary is linked, or with jemalloc? > > To reproduce: > > $ cd /usr/ports/games/quake2lnx && make all install > $ quake2 +set vid_ref glx Last two comments in https://github.com/jemalloc/jemalloc/issues/907 (October 10th-ish) could be related... ./danfe From owner-svn-src-head@freebsd.org Thu Jan 18 10:52:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88BEDEC4B02; Thu, 18 Jan 2018 10:52:32 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 62E942978; Thu, 18 Jan 2018 10:52:32 +0000 (UTC) (envelope-from andrew@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B41D21D87E; Thu, 18 Jan 2018 10:52:31 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0IAqVKq037405; Thu, 18 Jan 2018 10:52:31 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0IAqVto037404; Thu, 18 Jan 2018 10:52:31 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201801181052.w0IAqVto037404@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 18 Jan 2018 10:52:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328115 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 328115 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 10:52:32 -0000 Author: andrew Date: Thu Jan 18 10:52:31 2018 New Revision: 328115 URL: https://svnweb.freebsd.org/changeset/base/328115 Log: Add a pmap invalidate that doesn't call sched_pin. When demoting DMAP pages curthread may be pointing to data within the page we are demoting. Create a new invalidate that doesn't pin and use it in the demote case. As the demote has both interrupts disabled, and is within a critical section this is safe from having the scheduler from switching to another CPU. Reported by: loos Reviewed by: loos Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D13955 Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Thu Jan 18 09:17:06 2018 (r328114) +++ head/sys/arm64/arm64/pmap.c Thu Jan 18 10:52:31 2018 (r328115) @@ -908,11 +908,10 @@ pmap_invalidate_page(pmap_t pmap, vm_offset_t va) } static __inline void -pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) +pmap_invalidate_range_nopin(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) { vm_offset_t addr; - sched_pin(); dsb(ishst); for (addr = sva; addr < eva; addr += PAGE_SIZE) { __asm __volatile( @@ -921,6 +920,14 @@ pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm __asm __volatile( "dsb ish \n" "isb \n"); +} + +static __inline void +pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) +{ + + sched_pin(); + pmap_invalidate_range_nopin(pmap, sva, eva); sched_unpin(); } @@ -2667,7 +2674,7 @@ pmap_update_entry(pmap_t pmap, pd_entry_t *pte, pd_ent /* Clear the old mapping */ pmap_load_clear(pte); - pmap_invalidate_range(pmap, va, va + size); + pmap_invalidate_range_nopin(pmap, va, va + size); /* Create the new mapping */ pmap_load_store(pte, newpte); From owner-svn-src-head@freebsd.org Thu Jan 18 11:01:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 826A6EC5279; Thu, 18 Jan 2018 11:01:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5E1022FE8; Thu, 18 Jan 2018 11:01:42 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6BEAF1D9EC; Thu, 18 Jan 2018 11:01:41 +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 w0IB1frT040771; Thu, 18 Jan 2018 11:01:41 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0IB1ff0040770; Thu, 18 Jan 2018 11:01:41 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201801181101.w0IB1ff0040770@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 18 Jan 2018 11:01:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328116 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 328116 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 11:01:42 -0000 Author: kib Date: Thu Jan 18 11:01:41 2018 New Revision: 328116 URL: https://svnweb.freebsd.org/changeset/base/328116 Log: Remove the 'last' argument from the pmap_pti_free_page(). It is in fact unused. Noted and reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 13 days Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Thu Jan 18 10:52:31 2018 (r328115) +++ head/sys/amd64/amd64/pmap.c Thu Jan 18 11:01:41 2018 (r328116) @@ -7550,17 +7550,16 @@ pmap_pti_alloc_page(void) } static bool -pmap_pti_free_page(vm_page_t m, bool last) +pmap_pti_free_page(vm_page_t m) { + KASSERT(m->wire_count > 0, ("page %p not wired", m)); m->wire_count--; - if (m->wire_count == 0 || last) { - KASSERT(m->wire_count == 0, ("page %p wired", m)); - atomic_subtract_int(&vm_cnt.v_wire_count, 1); - vm_page_free_zero(m); - return (true); - } - return (false); + if (m->wire_count != 0) + return (false); + atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_page_free_zero(m); + return (true); } extern char kernphys[], etext[]; @@ -7626,7 +7625,7 @@ pmap_pti_pdpe(vm_offset_t va) panic("pml4 alloc after finalization\n"); m = pmap_pti_alloc_page(); if (*pml4e != 0) { - pmap_pti_free_page(m, true); + pmap_pti_free_page(m); mphys = *pml4e & ~PAGE_MASK; } else { mphys = VM_PAGE_TO_PHYS(m); @@ -7658,7 +7657,7 @@ pmap_pti_unwire_pde(void *pde, bool only_ref) m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((uintptr_t)pde)); MPASS(m->wire_count > 0); MPASS(only_ref || m->wire_count > 1); - pmap_pti_free_page(m, false); + pmap_pti_free_page(m); } static void @@ -7670,7 +7669,7 @@ pmap_pti_unwire_pte(void *pte, vm_offset_t va) VM_OBJECT_ASSERT_WLOCKED(pti_obj); m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((uintptr_t)pte)); MPASS(m->wire_count > 0); - if (pmap_pti_free_page(m, false)) { + if (pmap_pti_free_page(m)) { pde = pmap_pti_pde(va); MPASS((*pde & (X86_PG_PS | X86_PG_V)) == X86_PG_V); *pde = 0; @@ -7693,7 +7692,7 @@ pmap_pti_pde(vm_offset_t va) if (*pdpe == 0) { m = pmap_pti_alloc_page(); if (*pdpe != 0) { - pmap_pti_free_page(m, true); + pmap_pti_free_page(m); MPASS((*pdpe & X86_PG_PS) == 0); mphys = *pdpe & ~PAGE_MASK; } else { @@ -7729,7 +7728,7 @@ pmap_pti_pte(vm_offset_t va, bool *unwire_pde) if (*pde == 0) { m = pmap_pti_alloc_page(); if (*pde != 0) { - pmap_pti_free_page(m, true); + pmap_pti_free_page(m); MPASS((*pde & X86_PG_PS) == 0); mphys = *pde & ~(PAGE_MASK | pg_nx); } else { From owner-svn-src-head@freebsd.org Thu Jan 18 11:19:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74486EC648E; Thu, 18 Jan 2018 11:19:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4E3123E43; Thu, 18 Jan 2018 11:19:59 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 804C61DC0E; Thu, 18 Jan 2018 11:19:58 +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 w0IBJwFC046247; Thu, 18 Jan 2018 11:19:58 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0IBJwjW046246; Thu, 18 Jan 2018 11:19:58 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201801181119.w0IBJwjW046246@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 18 Jan 2018 11:19:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328119 - head/sys/amd64/include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/include X-SVN-Commit-Revision: 328119 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 11:19:59 -0000 Author: kib Date: Thu Jan 18 11:19:58 2018 New Revision: 328119 URL: https://svnweb.freebsd.org/changeset/base/328119 Log: Fix compilation with gas. Submitted by: bde MFC after: 13 days Modified: head/sys/amd64/include/asmacros.h Modified: head/sys/amd64/include/asmacros.h ============================================================================== --- head/sys/amd64/include/asmacros.h Thu Jan 18 11:07:40 2018 (r328118) +++ head/sys/amd64/include/asmacros.h Thu Jan 18 11:19:58 2018 (r328119) @@ -191,7 +191,7 @@ movq %rax,%cr3 movq PCPU(RSP0),%rax subq $PTI_SIZE,%rax - MOVE_STACKS (PTI_SIZE / 8) - 1 + \has_err + MOVE_STACKS ((PTI_SIZE / 8) - 1 + \has_err) movq %rax,%rsp popq %rdx popq %rax From owner-svn-src-head@freebsd.org Thu Jan 18 11:21:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 771DCEC66A7; Thu, 18 Jan 2018 11:21:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 25AB063354; Thu, 18 Jan 2018 11:21:05 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 53A741DC38; Thu, 18 Jan 2018 11:21:04 +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 w0IBL4dY047040; Thu, 18 Jan 2018 11:21:04 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0IBL3M4047038; Thu, 18 Jan 2018 11:21:03 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201801181121.w0IBL3M4047038@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 18 Jan 2018 11:21:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328120 - in head/sys/amd64: amd64 include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys/amd64: amd64 include X-SVN-Commit-Revision: 328120 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 11:21:05 -0000 Author: kib Date: Thu Jan 18 11:21:03 2018 New Revision: 328120 URL: https://svnweb.freebsd.org/changeset/base/328120 Log: Fix compilation with gcc. etext is already declared in machine/cpu.h, move kernphys declaration there too. Based on the patch by: bde MFC after: 13 days Modified: head/sys/amd64/amd64/pmap.c head/sys/amd64/include/cpu.h Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Thu Jan 18 11:19:58 2018 (r328119) +++ head/sys/amd64/amd64/pmap.c Thu Jan 18 11:21:03 2018 (r328120) @@ -7562,8 +7562,6 @@ pmap_pti_free_page(vm_page_t m) return (true); } -extern char kernphys[], etext[]; - static void pmap_pti_init(void) { Modified: head/sys/amd64/include/cpu.h ============================================================================== --- head/sys/amd64/include/cpu.h Thu Jan 18 11:19:58 2018 (r328119) +++ head/sys/amd64/include/cpu.h Thu Jan 18 11:21:03 2018 (r328120) @@ -70,6 +70,7 @@ struct cpu_ops { extern struct cpu_ops cpu_ops; extern char btext[]; extern char etext[]; +extern char kernphys[]; /* Resume hook for VMM. */ extern void (*vmm_resume_p)(void); From owner-svn-src-head@freebsd.org Thu Jan 18 11:23:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B59E9EC69A2; Thu, 18 Jan 2018 11:23:56 +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 48DC6636FC; Thu, 18 Jan 2018 11:23:56 +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 w0IBNlRH066219 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 18 Jan 2018 13:23:50 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w0IBNlRH066219 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w0IBNldj066218; Thu, 18 Jan 2018 13:23:47 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 18 Jan 2018 13:23:47 +0200 From: Konstantin Belousov To: Conrad Meyer Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r328083 - in head/sys: amd64/amd64 amd64/ia32 amd64/include amd64/vmm amd64/vmm/intel dev/hyperv/vmbus dev/hyperv/vmbus/amd64 dev/hyperv/vmbus/i386 i386/i386 x86/include x86/isa x86/x86 Message-ID: <20180118112347.GP55707@kib.kiev.ua> References: <201801171144.w0HBiLrY043134@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-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 11:23:56 -0000 On Wed, Jan 17, 2018 at 07:38:03PM -0800, Conrad Meyer wrote: > On Wed, Jan 17, 2018 at 3:44 AM, Konstantin Belousov wrote: > > Author: kib > > Date: Wed Jan 17 11:44:21 2018 > > New Revision: 328083 > > URL: https://svnweb.freebsd.org/changeset/base/328083 > > > > Log: > > PTI for amd64. > > This seems to break the xtoolchain GCC build: > > /usr/home/conrad/src/freebsd/sys/dev/hyperv/vmbus/amd64/vmbus_vector.S: > Assembler messages: > /usr/home/conrad/src/freebsd/sys/dev/hyperv/vmbus/amd64/vmbus_vector.S:40: > Error: too many positional arguments > > I'm not sure why. Repro: pkg install amd64-xtoolchain-gcc && make > buildkernel KERNCONF=GENERIC CROSS_TOOLCHAIN=amd64-gcc. Try r328120. From owner-svn-src-head@freebsd.org Thu Jan 18 12:22:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C09DDE76023; Thu, 18 Jan 2018 12:22:50 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lf0-f67.google.com (mail-lf0-f67.google.com [209.85.215.67]) (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 515C96A1ED; Thu, 18 Jan 2018 12:22:50 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lf0-f67.google.com with SMTP id k19so6157105lfj.1; Thu, 18 Jan 2018 04:22:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=5Ow33m2g2+hlOWU1FtE4KcmU+n6bvbUlGL6YcIpG8xw=; b=T3LYsODCG7amyKDcuniMynTwSJ13J1hcbaV86iTMSC359JlNpvIFoWZoKFGgKBAk+i +zRZ+5PKMKuluyEYmKPpYkyeuoaMdPs67Q56qZZymPy88wbeGnnjIHgyg5E8OCqg6qWx D9jrMy1A0wQg1dqXtpmu5T5xT3LHzcebd5TnZ+2Ix0+hB7Pxns2SrqcEltDHTZVB08YL hfnzyzw+wacAVoeA79hNiPTWoHhFoAcD7rdm7wvLXH26TLMyl/kr/8IrN50cSeJf4u0W rj/uBjp/mBmTonJFfPt78QBTBebFm2pnVx6J9gmD/c/Nb1QyRnbOBsvAGsSZUMKbny53 3BDA== X-Gm-Message-State: AKwxytf1rsLqivO1OdapCm9bEfrPyM+Eqr+wK/TBwTtHib7WOrBy9a09 C3H8BrD/FzQy42WUgqwyyJwfb0Eh X-Google-Smtp-Source: ACJfBovfe1k157h7gCLGpx3si/g8CfgEw38HXBlpB5MHBmKxKASVvqeOlRPIYNbQup6OTbMr1Ly8oQ== X-Received: by 10.25.28.142 with SMTP id c136mr24351505lfc.38.1516272239380; Thu, 18 Jan 2018 02:43:59 -0800 (PST) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id k200sm1178371lfg.27.2018.01.18.02.43.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jan 2018 02:43:58 -0800 (PST) Subject: Re: svn commit: r328110 - head/sys/kern To: Wojciech Macek , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201801180738.w0I7cswv054484@repo.freebsd.org> From: Andriy Gapon Message-ID: Date: Thu, 18 Jan 2018 12:43:57 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <201801180738.w0I7cswv054484@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 12:22:50 -0000 On 18/01/2018 09:38, Wojciech Macek wrote: > Author: wma > Date: Thu Jan 18 07:38:54 2018 > New Revision: 328110 > URL: https://svnweb.freebsd.org/changeset/base/328110 > > Log: > KDB: restart only CPUs stopped by KDB > > There is a case when not all CPUs went online. In that situation, > restart only APs which were operational before entering KDB. What is the context here? I mean, what is the state of those CPUs that are not online? Also, it seems you allow for the situation where a CPU that was not online at the time of kdb_trap becomes online (and running) while kdb is active? If that's so, then it can mess up the system big time. I think that this is not a right solution. P.S. While not a recipe for a solution, these musing may be of interest to you: https://lists.freebsd.org/pipermail/freebsd-arch/2011-June/011373.html > Created by: Wojciech Macek > Obtained from: Semihalf > Reviewed by: nwhitehorn > Differential revision: https://reviews.freebsd.org/D13949 > Sponsored by: QCM Technologies > > Modified: > head/sys/kern/subr_kdb.c > > Modified: head/sys/kern/subr_kdb.c > ============================================================================== > --- head/sys/kern/subr_kdb.c Thu Jan 18 06:28:21 2018 (r328109) > +++ head/sys/kern/subr_kdb.c Thu Jan 18 07:38:54 2018 (r328110) > @@ -673,6 +673,7 @@ kdb_trap(int type, int code, struct trapframe *tf) > #ifdef SMP > if (!SCHEDULER_STOPPED()) { > other_cpus = all_cpus; > + CPU_NAND(&other_cpus, &stopped_cpus); > CPU_CLR(PCPU_GET(cpuid), &other_cpus); > stop_cpus_hard(other_cpus); > did_stop_cpus = 1; > @@ -707,8 +708,9 @@ kdb_trap(int type, int code, struct trapframe *tf) > kdb_active--; > > #ifdef SMP > + CPU_AND(&other_cpus, &stopped_cpus); > if (did_stop_cpus) > - restart_cpus(stopped_cpus); > + restart_cpus(other_cpus); > #endif > > intr_restore(intr); > -- Andriy Gapon From owner-svn-src-head@freebsd.org Thu Jan 18 12:59:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 968A2E78A7C; Thu, 18 Jan 2018 12:59:05 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7209A6BE24; Thu, 18 Jan 2018 12:59:05 +0000 (UTC) (envelope-from avg@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8CFFD1ECDD; Thu, 18 Jan 2018 12:59:04 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0ICx43c087671; Thu, 18 Jan 2018 12:59:04 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0ICx4qo087670; Thu, 18 Jan 2018 12:59:04 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201801181259.w0ICx4qo087670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 18 Jan 2018 12:59:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328126 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 328126 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 12:59:05 -0000 Author: avg Date: Thu Jan 18 12:59:04 2018 New Revision: 328126 URL: https://svnweb.freebsd.org/changeset/base/328126 Log: correct read-ahead calculations in vfs_bio_getpages Previously the calculations were done as if the requested region ended at the start of the last requested page, not its end. The problem as actually quite minor as it affected only stats and page prefaulting, not the actual page data, and only with specific parameters. Reviewed by: kib (previous version) MFC after: 2 weeks Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Thu Jan 18 12:14:24 2018 (r328125) +++ head/sys/kern/vfs_bio.c Thu Jan 18 12:59:04 2018 (r328126) @@ -4802,7 +4802,14 @@ vfs_bio_getpages(struct vnode *vp, vm_page_t *ma, int la = IDX_TO_OFF(ma[count - 1]->pindex); if (la >= object->un_pager.vnp.vnp_size) return (VM_PAGER_BAD); - lpart = la + PAGE_SIZE > object->un_pager.vnp.vnp_size; + + /* + * Change the meaning of la from where the last requested page starts + * to where it ends, because that's the end of the requested region + * and the start of the potential read-ahead region. + */ + la += PAGE_SIZE; + lpart = la > object->un_pager.vnp.vnp_size; bo_bs = get_blksize(vp, get_lblkno(vp, IDX_TO_OFF(ma[0]->pindex))); /* From owner-svn-src-head@freebsd.org Thu Jan 18 12:27:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32BC8E762EE; Thu, 18 Jan 2018 12:27:45 +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 BA8236A4A2; Thu, 18 Jan 2018 12:27:44 +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 w0ICRUKl066190 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 18 Jan 2018 13:27:31 +0100 (CET) (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: danfe@FreeBSD.org Received: from eg.sd.rdtc.ru (eugen@localhost [127.0.0.1]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTP id w0ICRRdD076157; Thu, 18 Jan 2018 19:27:27 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: svn commit: r327890 - head/usr.sbin/bsdinstall/partedit To: Alexey Dokuchaev References: <201801122025.w0CKPvVk022670@repo.freebsd.org> <20180113065347.GA26333@FreeBSD.org> <20180118072611.GA51638@FreeBSD.org> <20180118104620.43f3ca7b@ernst.home> <20180118094913.GA13682@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org From: Eugene Grosbein Message-ID: <5A6092AF.9000700@grosbein.net> Date: Thu, 18 Jan 2018 19:27:27 +0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <20180118094913.GA13682@FreeBSD.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=2.2 required=5.0 tests=BAYES_00, LOCAL_FROM, RDNS_NONE, T_DATE_IN_FUTURE_96_Q autolearn=no autolearn_force=no version=3.4.1 X-Spam-Report: * 0.0 T_DATE_IN_FUTURE_96_Q Date: is 4 days to 4 months after Received: * date * -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-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on hz.grosbein.net X-Spam-Level: ** X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 12:27:45 -0000 On 18.01.2018 16:49, Alexey Dokuchaev wrote: > OK, that answers the second question (silly one). What about the > first one: Is it safe to disable SUJ on already populated filesystem? Yes. However, this must be done before mounting. From owner-svn-src-head@freebsd.org Thu Jan 18 14:14:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1090E7CD9C for ; Thu, 18 Jan 2018 14:14:42 +0000 (UTC) (envelope-from wma@semihalf.com) Received: from mail-qt0-x229.google.com (mail-qt0-x229.google.com [IPv6:2607:f8b0:400d:c0d::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 A0A3E6EFE5 for ; Thu, 18 Jan 2018 14:14:42 +0000 (UTC) (envelope-from wma@semihalf.com) Received: by mail-qt0-x229.google.com with SMTP id o35so20361245qtj.13 for ; Thu, 18 Jan 2018 06:14:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=rL4kMKdUyDuUKfHpilCv1Bu8DvcGPl8PwEiYJ5AXQV4=; b=Z6UC612Cl3AIBGtFsarc9763UZRttWfNiFx5G0SkvMgF0wqhYuTfTSpKcNnkqvbdVd sRoTEqdMyJcXIRY56QACDoVn5geWuVeZXGhAJn0Im18CeCWOIaRWxVabk8vYM1oRTRaE qLoBrmg6EqiefqIpwEBXHzCybtOKNVQ2qMh74f+m0/C3myKbzY23Z+FRJ5JgadHANl12 5oW6iHnpD/NMxagQLcSk+fEJeeGeqfBJnZKfcvDPlKOKgTO4kAfbizo3ZxTy927wCLrL 9D4MOTO8Jn1pxzOAX9EWwp3KzAlBiyEYuhib08Xg2Oxg63kF01DqXKBn8nUnCl4Xc80Y mYeg== 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=rL4kMKdUyDuUKfHpilCv1Bu8DvcGPl8PwEiYJ5AXQV4=; b=O1R59i5kVQKLIj9FlUOLclpAAoTx+CGuwxJpm5pTqUokfmkhWTRptJ+gfxde6JW9m7 qdIIx1dgG0wdWJeYVyJAwURGZ+0/15ddPCgtf3IO7bmq/2uA0/yQLCWkcMl6Q1BDUGeB gIUD1inCjHNkWUEQqsMoQRr9f3uOol+fUoPiHelH+sJZ+KJp9uyRXO7cIJ1soaLVwwVt IAXeDEvzGtrS63+iPxNblDbmC25ffuYOesdBP/X11ukYz0NB6eH8lBAyfIcEbIJjl/Ks uXS22AHY0ApBpkozQsaQzYWYmtVzcN6pjAgZ5UnwMwvsBIFJ1e0mn8mIcG/kgSIJ6+Ii zd2A== X-Gm-Message-State: AKwxytcWPz2J50hYuFW5sR/jOEn/PpZmb5k4L+Nzm2+JKbqOMaYbxqLf 4SdOVrZL4oio1YeXy+rfweQ0Rw4dJSqyswq2Ogv3L2cK X-Google-Smtp-Source: ACJfBosY0FwZDeGPMHtA6F4BQJro0ngZ7oDZNdztPWml6NsdnuTmueyN2bDJIXNieFRhXJWMQ0DP5FeYwWAxOZ1Ta2s= X-Received: by 10.55.217.132 with SMTP id q4mr60504370qkl.236.1516284881732; Thu, 18 Jan 2018 06:14:41 -0800 (PST) MIME-Version: 1.0 Received: by 10.200.42.122 with HTTP; Thu, 18 Jan 2018 06:14:21 -0800 (PST) In-Reply-To: References: <201801180738.w0I7cswv054484@repo.freebsd.org> From: Wojciech Macek Date: Thu, 18 Jan 2018 15:14:21 +0100 Message-ID: Subject: Re: svn commit: r328110 - head/sys/kern To: Andriy Gapon , Patryk Duda Cc: Wojciech Macek , 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-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 14:14:42 -0000 Adding author wma 2018-01-18 11:43 GMT+01:00 Andriy Gapon : > On 18/01/2018 09:38, Wojciech Macek wrote: > > Author: wma > > Date: Thu Jan 18 07:38:54 2018 > > New Revision: 328110 > > URL: https://svnweb.freebsd.org/changeset/base/328110 > > > > Log: > > KDB: restart only CPUs stopped by KDB > > > > There is a case when not all CPUs went online. In that situation, > > restart only APs which were operational before entering KDB. > > What is the context here? > I mean, what is the state of those CPUs that are not online? > > Also, it seems you allow for the situation where a CPU that was not online > at > the time of kdb_trap becomes online (and running) while kdb is active? > If that's so, then it can mess up the system big time. > > I think that this is not a right solution. > > P.S. > While not a recipe for a solution, these musing may be of interest to you: > https://lists.freebsd.org/pipermail/freebsd-arch/2011-June/011373.html > > > Created by: Wojciech Macek > > Obtained from: Semihalf > > Reviewed by: nwhitehorn > > Differential revision: https://reviews.freebsd.org/D13949 > > Sponsored by: QCM Technologies > > > > Modified: > > head/sys/kern/subr_kdb.c > > > > Modified: head/sys/kern/subr_kdb.c > > ============================================================ > ================== > > --- head/sys/kern/subr_kdb.c Thu Jan 18 06:28:21 2018 (r328109) > > +++ head/sys/kern/subr_kdb.c Thu Jan 18 07:38:54 2018 (r328110) > > @@ -673,6 +673,7 @@ kdb_trap(int type, int code, struct trapframe *tf) > > #ifdef SMP > > if (!SCHEDULER_STOPPED()) { > > other_cpus = all_cpus; > > + CPU_NAND(&other_cpus, &stopped_cpus); > > CPU_CLR(PCPU_GET(cpuid), &other_cpus); > > stop_cpus_hard(other_cpus); > > did_stop_cpus = 1; > > @@ -707,8 +708,9 @@ kdb_trap(int type, int code, struct trapframe *tf) > > kdb_active--; > > > > #ifdef SMP > > + CPU_AND(&other_cpus, &stopped_cpus); > > if (did_stop_cpus) > > - restart_cpus(stopped_cpus); > > + restart_cpus(other_cpus); > > #endif > > > > intr_restore(intr); > > > > > -- > Andriy Gapon > From owner-svn-src-head@freebsd.org Thu Jan 18 14:23:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B364E7D412; Thu, 18 Jan 2018 14:23:49 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id C77AF6F57C; Thu, 18 Jan 2018 14:23:48 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 33AB4427DBC; Fri, 19 Jan 2018 01:23:41 +1100 (AEDT) Date: Fri, 19 Jan 2018 01:23:40 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andriy Gapon cc: Wojciech Macek , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r328110 - head/sys/kern In-Reply-To: Message-ID: <20180119004249.V2293@besplex.bde.org> References: <201801180738.w0I7cswv054484@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=DIX/22Fb c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=lsZ57SiuAe-1uc7pl8UA:9 a=CjuIK1q_8ugA:10 a=SRiwBZ143OQA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 14:23:49 -0000 On Thu, 18 Jan 2018, Andriy Gapon wrote: > On 18/01/2018 09:38, Wojciech Macek wrote: >> ... >> Log: >> KDB: restart only CPUs stopped by KDB >> >> There is a case when not all CPUs went online. In that situation, >> restart only APs which were operational before entering KDB. > > What is the context here? > I mean, what is the state of those CPUs that are not online? I think they are there but already stopped. The patch avoids trying to stop them again (which might cause problems) and starting them again (which does cause problems). I recently fixed x86 suspension abusing the stopped_cpus mask (only for resume IIRC). Mixtures of suspended and stopped CPUs still have no chance of working. > Also, it seems you allow for the situation where a CPU that was not online at > the time of kdb_trap becomes online (and running) while kdb is active? > If that's so, then it can mess up the system big time. > > I think that this is not a right solution. I have much larger patches in this area (mostly in subr_smp.c). It is essential for kdb_enter() and panic() to stop all CPUs and wait forever if necessary. Returning early leaves the other CPUs in an unknown state where they might clobber kdb invariants. Sometimes they are just looping, but this is only safe if they keep looping for the duration of the stopping and the looping doesn't cause overheating. CPUs in NMI handles cannot be stopped immediately, and at least on x86 there are races sending new (STOP) NMIs to them. I handle this case by stopping NMI handlers in a special loop > P.S. > While not a recipe for a solution, these musing may be of interest to you: > https://lists.freebsd.org/pipermail/freebsd-arch/2011-June/011373.html I didn't know that you had uncommitted musings on this. Most of it is too complicated for me. I implemented some of points 1 and 2. Bruce From owner-svn-src-head@freebsd.org Thu Jan 18 14:41:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B80CE7E0F7 for ; Thu, 18 Jan 2018 14:41:57 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-wm0-x232.google.com (mail-wm0-x232.google.com [IPv6:2a00:1450:400c:c09::232]) (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 C936C7009B for ; Thu, 18 Jan 2018 14:41:56 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-wm0-x232.google.com with SMTP id f3so23432670wmc.1 for ; Thu, 18 Jan 2018 06:41:56 -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=TUe4ftslOhza/y9PUwMxsS+AHxUK1TfMTHeO2QwJgrI=; b=wjTWMfeIYbMDo+sHliZSQxh5e6Pk0AJ5yrWsYWEpMUCZlvijd9k/W7GBe9uTvW1Dnb K6oirgtxr0EM1gbX0u7BRASr8E0Njs+84jkYoys37iT+zYJQLw0IoGpUVP9DcS0D+ymx Uc7+zMs19yvR+ev8dGc10z+hX133CIKX+P4ALDyX/d+SpLX2ZdpAusjz3iUBlI7HiRAB dM928lpccqMjikbPLpHnH1SNTzLahc4cRbVezjnhC5BURKwQkT0XB7ioWZ0EjmaYkQZK vC9hdslkG7VpOSuXnZfebBHsG0QLv0/MZUqHb/aX8ERevr1fY4z5szV5AkKxOpXAQDIj eOvA== 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=TUe4ftslOhza/y9PUwMxsS+AHxUK1TfMTHeO2QwJgrI=; b=G6nzoy0YKK8CmjuSFwGKR7aJ1A+MO6hl4N6zfwk6bUk2d/INbr/QqZuEC/h9xfVWsX UPMvf6AkT59HiesnN2teHHwixVdn+3MwG7noFLxe/4TTNddNeWzG8dv66hCQA2eyI+xi xdLBxsuTLUjPlZdzscjIKNd1yRAUWwQHg/k7z4KtW5o2wTALoHUXBK/krMn9OTQlUu4A +LezING6u98lrvib/0SNSFEpm4j85CO7TCGss6GWzmNju5YEQszP9Ydd14S1scM6OaXu uxY+ymmrpaxP6eKmTbQq+aCY20Al0kf5qE25UcPpavjLoZt8yFnQfVbEY0nIzwP50X5m 1hrw== X-Gm-Message-State: AKwxytd2hP2sr1dlC/FXTxIDH5DqVlh/qSHp3uj5j85Ay8GrwnUxjf32 8JVWOJdllL/+lQpuyYuttW/c7YO0MC5LwCVOg97WSw== X-Google-Smtp-Source: ACJfBos9H4BjpfvGz7KEkuVbkdxGAxs+A6JcaLztH/J1ugQSQOpSRsIV3Sb55d54+vq7CJInxvve2EZP3+Ezgxl6nGM= X-Received: by 10.80.130.2 with SMTP id 2mr8374464edf.7.1516286514510; Thu, 18 Jan 2018 06:41:54 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.80.195.12 with HTTP; Thu, 18 Jan 2018 06:41:54 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <5A6092AF.9000700@grosbein.net> References: <201801122025.w0CKPvVk022670@repo.freebsd.org> <20180113065347.GA26333@FreeBSD.org> <20180118072611.GA51638@FreeBSD.org> <20180118104620.43f3ca7b@ernst.home> <20180118094913.GA13682@FreeBSD.org> <5A6092AF.9000700@grosbein.net> From: Warner Losh Date: Thu, 18 Jan 2018 07:41:54 -0700 X-Google-Sender-Auth: I0_d0k75mwtjTYnbgjxqhbApmok Message-ID: Subject: Re: svn commit: r327890 - head/usr.sbin/bsdinstall/partedit To: Eugene Grosbein Cc: Alexey Dokuchaev , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 14:41:57 -0000 On Thu, Jan 18, 2018 at 5:27 AM, Eugene Grosbein wrote: > On 18.01.2018 16:49, Alexey Dokuchaev wrote: > > > OK, that answers the second question (silly one). What about the > > first one: Is it safe to disable SUJ on already populated filesystem? > > Yes. However, this must be done before mounting. > Also, Kirk fixed the bug in SUJ, so all should be good now. Warner From owner-svn-src-head@freebsd.org Thu Jan 18 15:15:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76553E7FD22; Thu, 18 Jan 2018 15:15:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 52CC372811; Thu, 18 Jan 2018 15:15:36 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B92D203DA; Thu, 18 Jan 2018 15:15:35 +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 w0IFFZPN048884; Thu, 18 Jan 2018 15:15:35 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0IFFZ9U048881; Thu, 18 Jan 2018 15:15:35 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201801181515.w0IFFZ9U048881@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 18 Jan 2018 15:15:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328128 - in head/sys/amd64: amd64 include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys/amd64: amd64 include X-SVN-Commit-Revision: 328128 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 15:15:36 -0000 Author: kib Date: Thu Jan 18 15:15:35 2018 New Revision: 328128 URL: https://svnweb.freebsd.org/changeset/base/328128 Log: Move the kernphys declaration to machine/md_var.h. Apparently machinde/cpu.h is supposed to contain MD implementations of MI interfaces. Also, remove kernphys declaration from machdep.c, since it is already provided by md_var.h. Requested and reviewed by: bde MFC after: 13 days Modified: head/sys/amd64/amd64/machdep.c head/sys/amd64/include/cpu.h head/sys/amd64/include/md_var.h Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Thu Jan 18 13:43:09 2018 (r328127) +++ head/sys/amd64/amd64/machdep.c Thu Jan 18 15:15:35 2018 (r328128) @@ -188,12 +188,6 @@ struct init_ops init_ops = { }; /* - * The file "conf/ldscript.amd64" defines the symbol "kernphys". Its value is - * the physical address at which the kernel is loaded. - */ -extern char kernphys[]; - -/* * Physical address of the EFI System Table. Stashed from the metadata hints * passed into the kernel and used by the EFI code to call runtime services. */ Modified: head/sys/amd64/include/cpu.h ============================================================================== --- head/sys/amd64/include/cpu.h Thu Jan 18 13:43:09 2018 (r328127) +++ head/sys/amd64/include/cpu.h Thu Jan 18 15:15:35 2018 (r328128) @@ -70,7 +70,6 @@ struct cpu_ops { extern struct cpu_ops cpu_ops; extern char btext[]; extern char etext[]; -extern char kernphys[]; /* Resume hook for VMM. */ extern void (*vmm_resume_p)(void); Modified: head/sys/amd64/include/md_var.h ============================================================================== --- head/sys/amd64/include/md_var.h Thu Jan 18 13:43:09 2018 (r328127) +++ head/sys/amd64/include/md_var.h Thu Jan 18 15:15:35 2018 (r328128) @@ -39,6 +39,12 @@ extern uint64_t *vm_page_dump; extern int hw_lower_amd64_sharedpage; +/* + * The file "conf/ldscript.amd64" defines the symbol "kernphys". Its + * value is the physical address at which the kernel is loaded. + */ +extern char kernphys[]; + struct savefpu; struct sysentvec; From owner-svn-src-head@freebsd.org Thu Jan 18 15:24:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC418EB23A7; Thu, 18 Jan 2018 15:24:20 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (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 C441372E6D; Thu, 18 Jan 2018 15:24:20 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from comporellon.tachypleus.net (cpe-75-82-218-62.socal.res.rr.com [75.82.218.62]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id w0IFOCxg017296 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Thu, 18 Jan 2018 07:24:13 -0800 Subject: Re: svn commit: r327950 - in head/sys/powerpc: aim include powerpc ps3 To: Konstantin Belousov Cc: Marius Strobl , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org References: <20180115111812.GF1684@kib.kiev.ua> <20180115170603.GJ1684@kib.kiev.ua> <9e5554d7-6a0c-5910-8cb6-74f98259536f@freebsd.org> <20180115175335.GK1684@kib.kiev.ua> <20180116193208.GA12364@alchemy.franken.de> <11a7fdd6-cfd6-26c1-ae3c-7d8a63924d5a@freebsd.org> <20180117094413.GF55707@kib.kiev.ua> From: Nathan Whitehorn Message-ID: <57f837ce-1209-1e9a-158f-7eac5ae6d59a@freebsd.org> Date: Thu, 18 Jan 2018 07:24:11 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20180117094413.GF55707@kib.kiev.ua> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Sonic-CAuth: UmFuZG9tSVbXSo0cUGAtRqnJ1uG5RlJvcuocztENOOtcBg9IxkZpt0E1QiNynlJNPxHB6FDRulVT2go42WWMFBFrkga7a9YtoRD/8p/GkzM= X-Sonic-ID: C;UhDjomP85xGFyeBQ9eIpJw== M;rDWpo2P85xGFyeBQ9eIpJw== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 15:24:21 -0000 On 01/17/18 01:44, Konstantin Belousov wrote: > On Tue, Jan 16, 2018 at 09:30:29PM -0800, Nathan Whitehorn wrote: >> >> On 01/16/18 11:32, Marius Strobl wrote: >>> On Mon, Jan 15, 2018 at 03:20:49PM -0800, Nathan Whitehorn wrote: >>>> On 01/15/18 09:53, Konstantin Belousov wrote: >>>>> On Mon, Jan 15, 2018 at 09:32:56AM -0800, Nathan Whitehorn wrote: >>>>>> That seems fine to me. I don't think a less-clumsy way that does not >>>>>> involve extra indirection is possible. The PHYS_TO_DMAP() returning NULL >>>>>> is about the best thing I can come up with from a clumsiness standpoint >>>>>> since plenty of code checks for null pointers already, but doesn't >>>>>> cleanly handle the rarer case where you want to test for the existence >>>>>> of direct maps in general without testing some potemkin address. >>>>>> >>>>>> My one reservation about PMAP_HAS_DMAP or the like as a selector is that >>>>>> it does not encode the full shape of the problem: one could imagine >>>>>> having a direct map that only covers a limited range of RAM (I am not >>>>>> sure whether the existence of dmaplimit on amd64 implies this can happen >>>>>> with non-device memory in real life), for example. These cases are >>>>>> currently covered by an assert() in PHYS_TO_DMAP(), whereas having >>>>>> PHYS_TO_DMAP() return NULL allows a more flexible signalling and the >>>>>> potential for the calling code to do something reasonable to handle the >>>>>> error. A single global flag can't convey information at this kind of >>>>>> granularity. Is this a reasonable concern? Or am I overthinking things? >>>>> IMO it is overreaction. amd64 assumes that all normal memory is covered >>>>> by DMAP. It must never fail. See, for instance, the implementation >>>>> of the sf bufs for it. >>>>> >>>>> If device memory not covered by DMAP can exists, it is the driver problem. >>>>> For instance, for NVDIMMs I wrote specific mapping code which establishes >>>>> kernel mapping for it, when not covered by EFI memory map and correspondingly >>>>> not included into DMAP. >>>>> >>>> Fair enough. Here's a patch with a new flag (DIRECT_MAP_AVAILABLE). I've >>>> also retooled the sfbuf code to use this rather than its own flags that >>>> mean the same things. The sparc64 part of the patch is untested. >>>> -Nathan >>>> Index: sparc64/include/vmparam.h >>>> =================================================================== >>>> --- sparc64/include/vmparam.h (revision 328006) >>>> +++ sparc64/include/vmparam.h (working copy) >>>> @@ -240,10 +240,12 @@ >>>> */ >>>> #define ZERO_REGION_SIZE PAGE_SIZE >>>> >>>> +#include >>>> + >>>> #define SFBUF >>>> #define SFBUF_MAP >>>> -#define SFBUF_OPTIONAL_DIRECT_MAP dcache_color_ignore >>>> -#include >>>> -#define SFBUF_PHYS_DMAP(x) TLB_PHYS_TO_DIRECT(x) >>>> >>>> +#define DIRECT_MAP_AVAILABLE dcache_color_ignore >>>> +#define PHYS_TO_DMAP(x) (DIRECT_MAP_AVAILABLE ? (TLB_PHYS_TO_DIRECT(x) : 0) >>> What dcache_color_ignore actually indicates is the presence of >>> hardware unaliasing support, in other words the ability to enter >>> duplicate cacheable mappings into the MMU. While a direct map is >>> available and used by MD code on all supported CPUs down to US-I, >>> the former feature is only implemented in the line of Fujitsu SPARC64 >>> processors. IIRC, the sfbuf(9) code can't guarantee that there isn't >>> already a cacheable mapping from a different VA to the same PA, >>> which is why it employs dcache_color_ignore. Is that a general >>> constraint of all MI PHYS_TO_DMAP users or are there consumers >>> which can guarantee that they are the only users of a mapping >>> to the same PA? >>> >>> Marius >>> >> With the patch, there are four uses of this in the kernel: the sfbuf >> code, a diagnostic check on page zeroing, part of the EFI runtime code, >> and part of the Linux KBI compat. The second looks safe from this >> perspective and at least some of the others (EFI runtime) are irrelevant >> on sparc64. But I really have no idea what was intended for the >> semantics of this API -- I didn't even know it *was* an MI API until >> this commit. Maybe kib can comment? If this is outside the semantics of >> PHYS_TO_DMAP, then we need to keep the existing sfbuf code. > sfbufs cannot guarantee that there is no other mapping of the page when > the sfbuf is created. For instance, one of the use of sfbufs is to map > the image page 0 to read ELF headers when doing the image activation. > The image might be mapped by other processes, and we do not control the > address at which it mapped. > > So the direct map accesses must work regardless of the presence of other > page mappings, and the check for dcache_color_ignore is needed to allow > MI code to take advantage of DMAP. > So: what do you want to happen with PHYS_TO_DMAP()? Do we want to claim to MI that a direct map is "available" in such circumstances, or "unavailable"? Should sfbuf retain a separate API? I have no preferences here and just want to close out this issue. -Nathan From owner-svn-src-head@freebsd.org Thu Jan 18 15:28:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B730FEB275E; Thu, 18 Jan 2018 15:28:50 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 92504730A6; Thu, 18 Jan 2018 15:28:50 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CF5992057A; Thu, 18 Jan 2018 15:28:49 +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 w0IFSn7x053536; Thu, 18 Jan 2018 15:28:49 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0IFSnWm053535; Thu, 18 Jan 2018 15:28:49 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201801181528.w0IFSnWm053535@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 18 Jan 2018 15:28:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328129 - head/sys/fs/nfsserver X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/fs/nfsserver X-SVN-Commit-Revision: 328129 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 15:28:50 -0000 Author: manu Date: Thu Jan 18 15:28:49 2018 New Revision: 328129 URL: https://svnweb.freebsd.org/changeset/base/328129 Log: nfs: Do not printf each time a lock structure is freed during module unload There can be a lot of those structures and printing a line each time we free one on module unload. MFC after: 3 days Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdstate.c Thu Jan 18 15:15:35 2018 (r328128) +++ head/sys/fs/nfsserver/nfs_nfsdstate.c Thu Jan 18 15:28:49 2018 (r328129) @@ -5799,10 +5799,8 @@ nfsrv_throwawayallstate(NFSPROC_T *p) * Also, free up any remaining lock file structures. */ for (i = 0; i < nfsrv_lockhashsize; i++) { - LIST_FOREACH_SAFE(lfp, &nfslockhash[i], lf_hash, nlfp) { - printf("nfsd unload: fnd a lock file struct\n"); + LIST_FOREACH_SAFE(lfp, &nfslockhash[i], lf_hash, nlfp) nfsrv_freenfslockfile(lfp); - } } } From owner-svn-src-head@freebsd.org Thu Jan 18 15:35:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C00FEB2D72; Thu, 18 Jan 2018 15:35:44 +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 339AC7369E; Thu, 18 Jan 2018 15:35:44 +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 w0IFZWtS023541 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 18 Jan 2018 17:35:35 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w0IFZWtS023541 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w0IFZWco023540; Thu, 18 Jan 2018 17:35:32 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 18 Jan 2018 17:35:32 +0200 From: Konstantin Belousov To: Nathan Whitehorn Cc: Marius Strobl , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r327950 - in head/sys/powerpc: aim include powerpc ps3 Message-ID: <20180118153532.GR55707@kib.kiev.ua> References: <20180115111812.GF1684@kib.kiev.ua> <20180115170603.GJ1684@kib.kiev.ua> <9e5554d7-6a0c-5910-8cb6-74f98259536f@freebsd.org> <20180115175335.GK1684@kib.kiev.ua> <20180116193208.GA12364@alchemy.franken.de> <11a7fdd6-cfd6-26c1-ae3c-7d8a63924d5a@freebsd.org> <20180117094413.GF55707@kib.kiev.ua> <57f837ce-1209-1e9a-158f-7eac5ae6d59a@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <57f837ce-1209-1e9a-158f-7eac5ae6d59a@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-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 15:35:44 -0000 On Thu, Jan 18, 2018 at 07:24:11AM -0800, Nathan Whitehorn wrote: > > > On 01/17/18 01:44, Konstantin Belousov wrote: > > On Tue, Jan 16, 2018 at 09:30:29PM -0800, Nathan Whitehorn wrote: > >> > >> On 01/16/18 11:32, Marius Strobl wrote: > >>> On Mon, Jan 15, 2018 at 03:20:49PM -0800, Nathan Whitehorn wrote: > >>>> On 01/15/18 09:53, Konstantin Belousov wrote: > >>>>> On Mon, Jan 15, 2018 at 09:32:56AM -0800, Nathan Whitehorn wrote: > >>>>>> That seems fine to me. I don't think a less-clumsy way that does not > >>>>>> involve extra indirection is possible. The PHYS_TO_DMAP() returning NULL > >>>>>> is about the best thing I can come up with from a clumsiness standpoint > >>>>>> since plenty of code checks for null pointers already, but doesn't > >>>>>> cleanly handle the rarer case where you want to test for the existence > >>>>>> of direct maps in general without testing some potemkin address. > >>>>>> > >>>>>> My one reservation about PMAP_HAS_DMAP or the like as a selector is that > >>>>>> it does not encode the full shape of the problem: one could imagine > >>>>>> having a direct map that only covers a limited range of RAM (I am not > >>>>>> sure whether the existence of dmaplimit on amd64 implies this can happen > >>>>>> with non-device memory in real life), for example. These cases are > >>>>>> currently covered by an assert() in PHYS_TO_DMAP(), whereas having > >>>>>> PHYS_TO_DMAP() return NULL allows a more flexible signalling and the > >>>>>> potential for the calling code to do something reasonable to handle the > >>>>>> error. A single global flag can't convey information at this kind of > >>>>>> granularity. Is this a reasonable concern? Or am I overthinking things? > >>>>> IMO it is overreaction. amd64 assumes that all normal memory is covered > >>>>> by DMAP. It must never fail. See, for instance, the implementation > >>>>> of the sf bufs for it. > >>>>> > >>>>> If device memory not covered by DMAP can exists, it is the driver problem. > >>>>> For instance, for NVDIMMs I wrote specific mapping code which establishes > >>>>> kernel mapping for it, when not covered by EFI memory map and correspondingly > >>>>> not included into DMAP. > >>>>> > >>>> Fair enough. Here's a patch with a new flag (DIRECT_MAP_AVAILABLE). I've > >>>> also retooled the sfbuf code to use this rather than its own flags that > >>>> mean the same things. The sparc64 part of the patch is untested. > >>>> -Nathan > >>>> Index: sparc64/include/vmparam.h > >>>> =================================================================== > >>>> --- sparc64/include/vmparam.h (revision 328006) > >>>> +++ sparc64/include/vmparam.h (working copy) > >>>> @@ -240,10 +240,12 @@ > >>>> */ > >>>> #define ZERO_REGION_SIZE PAGE_SIZE > >>>> > >>>> +#include > >>>> + > >>>> #define SFBUF > >>>> #define SFBUF_MAP > >>>> -#define SFBUF_OPTIONAL_DIRECT_MAP dcache_color_ignore > >>>> -#include > >>>> -#define SFBUF_PHYS_DMAP(x) TLB_PHYS_TO_DIRECT(x) > >>>> > >>>> +#define DIRECT_MAP_AVAILABLE dcache_color_ignore > >>>> +#define PHYS_TO_DMAP(x) (DIRECT_MAP_AVAILABLE ? (TLB_PHYS_TO_DIRECT(x) : 0) > >>> What dcache_color_ignore actually indicates is the presence of > >>> hardware unaliasing support, in other words the ability to enter > >>> duplicate cacheable mappings into the MMU. While a direct map is > >>> available and used by MD code on all supported CPUs down to US-I, > >>> the former feature is only implemented in the line of Fujitsu SPARC64 > >>> processors. IIRC, the sfbuf(9) code can't guarantee that there isn't > >>> already a cacheable mapping from a different VA to the same PA, > >>> which is why it employs dcache_color_ignore. Is that a general > >>> constraint of all MI PHYS_TO_DMAP users or are there consumers > >>> which can guarantee that they are the only users of a mapping > >>> to the same PA? > >>> > >>> Marius > >>> > >> With the patch, there are four uses of this in the kernel: the sfbuf > >> code, a diagnostic check on page zeroing, part of the EFI runtime code, > >> and part of the Linux KBI compat. The second looks safe from this > >> perspective and at least some of the others (EFI runtime) are irrelevant > >> on sparc64. But I really have no idea what was intended for the > >> semantics of this API -- I didn't even know it *was* an MI API until > >> this commit. Maybe kib can comment? If this is outside the semantics of > >> PHYS_TO_DMAP, then we need to keep the existing sfbuf code. > > sfbufs cannot guarantee that there is no other mapping of the page when > > the sfbuf is created. For instance, one of the use of sfbufs is to map > > the image page 0 to read ELF headers when doing the image activation. > > The image might be mapped by other processes, and we do not control the > > address at which it mapped. > > > > So the direct map accesses must work regardless of the presence of other > > page mappings, and the check for dcache_color_ignore is needed to allow > > MI code to take advantage of DMAP. > > > > So: what do you want to happen with PHYS_TO_DMAP()? Do we want to claim > to MI that a direct map is "available" in such circumstances, or > "unavailable"? Should sfbuf retain a separate API? I have no preferences > here and just want to close out this issue. Perhaps DMAP should be conditionally available to the MI layer, same as on powerpc ? I.e. your patch cited above looks right to me, unless I misunderstand the Marius' response. From owner-svn-src-head@freebsd.org Thu Jan 18 15:39:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7546BEB2F4C; Thu, 18 Jan 2018 15:39:05 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 5EF8F7389E; Thu, 18 Jan 2018 15:39:03 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id 0226d725; Thu, 18 Jan 2018 16:38:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=5jWsNOKtUEwjop6r5RuLQLqM7Nw=; b=P9zEXHXphizN2OZcNGO5ajGZIVrS CxY8P9t2bzttrVg74GyktKMgJ1vP7fCdSnYSROdh1Cx52fHvKogK0njRDYUOvg9s OvHUYaJL+Uq1Uy0bLxlZYbgbUcoFFufb+0V98b63WDw7Qwbn0FTOA0GIuWE0xSVo cZBuDxH5a8i6NaE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=H6aDpW22cRyjbJ4Hp+pM1fmFuE3KIFs6GfttYwK/aQ8jrx1XJKxVJB3C cuxLOy1FRRK+uQ4bFuYSrj/PFsxz+zFv0cat4wgAp5GEniE/8mA4PMI4Rs4odXQg +p9I3klZdWEyYZUe0iY12XLgn/mVkgO7Mw9Tt4/OeVz84Ydvdwg= Received: from arcadia (evadot.gandi.net [217.70.181.36]) by mail.blih.net (OpenSMTPD) with ESMTPSA id 9f75ccc1 TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Thu, 18 Jan 2018 16:38:56 +0100 (CET) Date: Thu, 18 Jan 2018 16:38:55 +0100 From: Emmanuel Vadot To: Emmanuel Vadot Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r328129 - head/sys/fs/nfsserver Message-Id: <20180118163855.b0a55427709c52d0ec2482c9@bidouilliste.com> In-Reply-To: <201801181528.w0IFSnWm053535@repo.freebsd.org> References: <201801181528.w0IFSnWm053535@repo.freebsd.org> X-Mailer: Sylpheed 3.6.0 (GTK+ 2.24.31; amd64-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 15:39:05 -0000 On Thu, 18 Jan 2018 15:28:49 +0000 (UTC) Emmanuel Vadot wrote: > Author: manu > Date: Thu Jan 18 15:28:49 2018 > New Revision: 328129 > URL: https://svnweb.freebsd.org/changeset/base/328129 > > Log: > nfs: Do not printf each time a lock structure is freed during module unload > > There can be a lot of those structures and printing a line each time we free > one on module unload. Finishing the sentence : There can be a lot of those structures and printing a line each time we free one on module unload is really time consuming, especially when you have a serial console plugged in. Sponsored by: Gandi.net > MFC after: 3 days > > Modified: > head/sys/fs/nfsserver/nfs_nfsdstate.c > > Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c > ============================================================================== > --- head/sys/fs/nfsserver/nfs_nfsdstate.c Thu Jan 18 15:15:35 2018 (r328128) > +++ head/sys/fs/nfsserver/nfs_nfsdstate.c Thu Jan 18 15:28:49 2018 (r328129) > @@ -5799,10 +5799,8 @@ nfsrv_throwawayallstate(NFSPROC_T *p) > * Also, free up any remaining lock file structures. > */ > for (i = 0; i < nfsrv_lockhashsize; i++) { > - LIST_FOREACH_SAFE(lfp, &nfslockhash[i], lf_hash, nlfp) { > - printf("nfsd unload: fnd a lock file struct\n"); > + LIST_FOREACH_SAFE(lfp, &nfslockhash[i], lf_hash, nlfp) > nfsrv_freenfslockfile(lfp); > - } > } > } > -- Emmanuel Vadot From owner-svn-src-head@freebsd.org Thu Jan 18 15:49:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4023AEB3866; Thu, 18 Jan 2018 15:49:06 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (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 2746074083; Thu, 18 Jan 2018 15:49:05 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from comporellon.tachypleus.net (cpe-75-82-218-62.socal.res.rr.com [75.82.218.62]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id w0IFn2vd013101 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Thu, 18 Jan 2018 07:49:03 -0800 Subject: Re: svn commit: r327950 - in head/sys/powerpc: aim include powerpc ps3 To: Konstantin Belousov Cc: Marius Strobl , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org References: <20180115111812.GF1684@kib.kiev.ua> <20180115170603.GJ1684@kib.kiev.ua> <9e5554d7-6a0c-5910-8cb6-74f98259536f@freebsd.org> <20180115175335.GK1684@kib.kiev.ua> <20180116193208.GA12364@alchemy.franken.de> <11a7fdd6-cfd6-26c1-ae3c-7d8a63924d5a@freebsd.org> <20180117094413.GF55707@kib.kiev.ua> <57f837ce-1209-1e9a-158f-7eac5ae6d59a@freebsd.org> <20180118153532.GR55707@kib.kiev.ua> From: Nathan Whitehorn Message-ID: Date: Thu, 18 Jan 2018 07:49:02 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20180118153532.GR55707@kib.kiev.ua> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Sonic-CAuth: UmFuZG9tSVb+g+xWy5sdKLz0cqHtorOzwzL5iDFA9uNLgqKmGXJ+7vBwn95oZ02E6hjYRqFOfTu0A6OlY6lt/k75vtZxTWdJ5/kNYSQJT7o= X-Sonic-ID: C;RH5hG2f85xGnTuBQ9eIpJw== M;6tGZG2f85xGnTuBQ9eIpJw== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 15:49:06 -0000 On 01/18/18 07:35, Konstantin Belousov wrote: > On Thu, Jan 18, 2018 at 07:24:11AM -0800, Nathan Whitehorn wrote: >> >> On 01/17/18 01:44, Konstantin Belousov wrote: >>> On Tue, Jan 16, 2018 at 09:30:29PM -0800, Nathan Whitehorn wrote: >>>> On 01/16/18 11:32, Marius Strobl wrote: >>>>> On Mon, Jan 15, 2018 at 03:20:49PM -0800, Nathan Whitehorn wrote: >>>>>> On 01/15/18 09:53, Konstantin Belousov wrote: >>>>>>> On Mon, Jan 15, 2018 at 09:32:56AM -0800, Nathan Whitehorn wrote: >>>>>>>> That seems fine to me. I don't think a less-clumsy way that does not >>>>>>>> involve extra indirection is possible. The PHYS_TO_DMAP() returning NULL >>>>>>>> is about the best thing I can come up with from a clumsiness standpoint >>>>>>>> since plenty of code checks for null pointers already, but doesn't >>>>>>>> cleanly handle the rarer case where you want to test for the existence >>>>>>>> of direct maps in general without testing some potemkin address. >>>>>>>> >>>>>>>> My one reservation about PMAP_HAS_DMAP or the like as a selector is that >>>>>>>> it does not encode the full shape of the problem: one could imagine >>>>>>>> having a direct map that only covers a limited range of RAM (I am not >>>>>>>> sure whether the existence of dmaplimit on amd64 implies this can happen >>>>>>>> with non-device memory in real life), for example. These cases are >>>>>>>> currently covered by an assert() in PHYS_TO_DMAP(), whereas having >>>>>>>> PHYS_TO_DMAP() return NULL allows a more flexible signalling and the >>>>>>>> potential for the calling code to do something reasonable to handle the >>>>>>>> error. A single global flag can't convey information at this kind of >>>>>>>> granularity. Is this a reasonable concern? Or am I overthinking things? >>>>>>> IMO it is overreaction. amd64 assumes that all normal memory is covered >>>>>>> by DMAP. It must never fail. See, for instance, the implementation >>>>>>> of the sf bufs for it. >>>>>>> >>>>>>> If device memory not covered by DMAP can exists, it is the driver problem. >>>>>>> For instance, for NVDIMMs I wrote specific mapping code which establishes >>>>>>> kernel mapping for it, when not covered by EFI memory map and correspondingly >>>>>>> not included into DMAP. >>>>>>> >>>>>> Fair enough. Here's a patch with a new flag (DIRECT_MAP_AVAILABLE). I've >>>>>> also retooled the sfbuf code to use this rather than its own flags that >>>>>> mean the same things. The sparc64 part of the patch is untested. >>>>>> -Nathan >>>>>> Index: sparc64/include/vmparam.h >>>>>> =================================================================== >>>>>> --- sparc64/include/vmparam.h (revision 328006) >>>>>> +++ sparc64/include/vmparam.h (working copy) >>>>>> @@ -240,10 +240,12 @@ >>>>>> */ >>>>>> #define ZERO_REGION_SIZE PAGE_SIZE >>>>>> >>>>>> +#include >>>>>> + >>>>>> #define SFBUF >>>>>> #define SFBUF_MAP >>>>>> -#define SFBUF_OPTIONAL_DIRECT_MAP dcache_color_ignore >>>>>> -#include >>>>>> -#define SFBUF_PHYS_DMAP(x) TLB_PHYS_TO_DIRECT(x) >>>>>> >>>>>> +#define DIRECT_MAP_AVAILABLE dcache_color_ignore >>>>>> +#define PHYS_TO_DMAP(x) (DIRECT_MAP_AVAILABLE ? (TLB_PHYS_TO_DIRECT(x) : 0) >>>>> What dcache_color_ignore actually indicates is the presence of >>>>> hardware unaliasing support, in other words the ability to enter >>>>> duplicate cacheable mappings into the MMU. While a direct map is >>>>> available and used by MD code on all supported CPUs down to US-I, >>>>> the former feature is only implemented in the line of Fujitsu SPARC64 >>>>> processors. IIRC, the sfbuf(9) code can't guarantee that there isn't >>>>> already a cacheable mapping from a different VA to the same PA, >>>>> which is why it employs dcache_color_ignore. Is that a general >>>>> constraint of all MI PHYS_TO_DMAP users or are there consumers >>>>> which can guarantee that they are the only users of a mapping >>>>> to the same PA? >>>>> >>>>> Marius >>>>> >>>> With the patch, there are four uses of this in the kernel: the sfbuf >>>> code, a diagnostic check on page zeroing, part of the EFI runtime code, >>>> and part of the Linux KBI compat. The second looks safe from this >>>> perspective and at least some of the others (EFI runtime) are irrelevant >>>> on sparc64. But I really have no idea what was intended for the >>>> semantics of this API -- I didn't even know it *was* an MI API until >>>> this commit. Maybe kib can comment? If this is outside the semantics of >>>> PHYS_TO_DMAP, then we need to keep the existing sfbuf code. >>> sfbufs cannot guarantee that there is no other mapping of the page when >>> the sfbuf is created. For instance, one of the use of sfbufs is to map >>> the image page 0 to read ELF headers when doing the image activation. >>> The image might be mapped by other processes, and we do not control the >>> address at which it mapped. >>> >>> So the direct map accesses must work regardless of the presence of other >>> page mappings, and the check for dcache_color_ignore is needed to allow >>> MI code to take advantage of DMAP. >>> >> So: what do you want to happen with PHYS_TO_DMAP()? Do we want to claim >> to MI that a direct map is "available" in such circumstances, or >> "unavailable"? Should sfbuf retain a separate API? I have no preferences >> here and just want to close out this issue. > Perhaps DMAP should be conditionally available to the MI layer, same as > on powerpc ? I.e. your patch cited above looks right to me, unless I > misunderstand the Marius' response. > OK, sounds good. I'll fix the typos and such, then send it around one last time before commit. Thanks for your patience on this (especially while doing the PTI stuff!). -Nathan From owner-svn-src-head@freebsd.org Thu Jan 18 15:55:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DC39EB3DE4; Thu, 18 Jan 2018 15:55:24 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mx0b-0010f301.pphosted.com (mx0b-0010f301.pphosted.com [148.163.153.244]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.pphosted.com", Issuer "thawte SHA256 SSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 41F567467B; Thu, 18 Jan 2018 15:55:23 +0000 (UTC) (envelope-from alc@rice.edu) Received: from pps.filterd (m0102859.ppops.net [127.0.0.1]) by mx0b-0010f301.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w0IFpCis009811; Thu, 18 Jan 2018 09:55:17 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rice.edu; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=ricemail; bh=0ShbhQOEsxxzMaFdK9u8GyXcX6UJbaq3HB2Y2qnc7yw=; b=WQ/zebanP6imsksC+J6WVfqcJ59IBvPUO18hA1K+aRLCLPQu6tjepJXrKD8qljTT8aO+ qI01FjhIyg734p9R+WfQn7r0h4atE/Nb+QrnjjV6NQkyfoa/9l6EG0zi2sndr68E7sd2 StI4UTcWRLU0GDdrcgwgsyLlDNuyziBz45e/b2/mejnxOTdtIT1snNZpa4fk13fT/vkx VEfITF0O4Dc06E0ZfNoHstX1SemaCfpjFA2nhDq4tPdy2vI9Wae88OzXYL/EIsZgXFsR hepGOyI7ubvjdcpn4VLk9NkUr0ctvDwM9kQCDEQ26L6tqlk+/SfcEF8GXWS6qBrA2YAD sA== Received: from mh1.mail.rice.edu (mh1.mail.rice.edu [128.42.201.20]) by mx0b-0010f301.pphosted.com with ESMTP id 2fjb04s881-1; Thu, 18 Jan 2018 09:55:17 -0600 Received-X: from mh1.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh1.mail.rice.edu (Postfix) with ESMTP id 59FD8460E4A; Thu, 18 Jan 2018 09:55:16 -0600 (CST) Received-X: from mh1.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh1.mail.rice.edu (Postfix) with ESMTP id 589AC46051C; Thu, 18 Jan 2018 09:55:16 -0600 (CST) X-Virus-Scanned: by amavis-2.7.0 at mh1.mail.rice.edu, auth channel Received-X: from mh1.mail.rice.edu ([127.0.0.1]) by mh1.mail.rice.edu (mh1.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id 65auO74bfMn2; Thu, 18 Jan 2018 09:55:16 -0600 (CST) Received: from 108-254-203-201.lightspeed.hstntx.sbcglobal.net (108-254-203-201.lightspeed.hstntx.sbcglobal.net [108.254.203.201]) (using TLSv1 with cipher RC4-MD5 (112/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh1.mail.rice.edu (Postfix) with ESMTPSA id E523E460AE8; Thu, 18 Jan 2018 09:55:15 -0600 (CST) Subject: Re: svn commit: r327950 - in head/sys/powerpc: aim include powerpc ps3 To: Konstantin Belousov , Nathan Whitehorn Cc: Marius Strobl , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org References: <20180115111812.GF1684@kib.kiev.ua> <20180115170603.GJ1684@kib.kiev.ua> <9e5554d7-6a0c-5910-8cb6-74f98259536f@freebsd.org> <20180115175335.GK1684@kib.kiev.ua> <20180116193208.GA12364@alchemy.franken.de> <11a7fdd6-cfd6-26c1-ae3c-7d8a63924d5a@freebsd.org> <20180117094413.GF55707@kib.kiev.ua> <57f837ce-1209-1e9a-158f-7eac5ae6d59a@freebsd.org> <20180118153532.GR55707@kib.kiev.ua> From: Alan Cox Message-ID: <2d1644f8-c056-2b07-97b1-7ac211cf8e1c@rice.edu> Date: Thu, 18 Jan 2018 09:55:15 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20180118153532.GR55707@kib.kiev.ua> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-Language: en-US X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-01-18_07:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=3 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=796 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1801180212 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 15:55:24 -0000 On 01/18/2018 09:35, Konstantin Belousov wrote: > On Thu, Jan 18, 2018 at 07:24:11AM -0800, Nathan Whitehorn wrote: >> >> On 01/17/18 01:44, Konstantin Belousov wrote: >>> On Tue, Jan 16, 2018 at 09:30:29PM -0800, Nathan Whitehorn wrote: >>>> On 01/16/18 11:32, Marius Strobl wrote: >>>>> On Mon, Jan 15, 2018 at 03:20:49PM -0800, Nathan Whitehorn wrote: >>>>>> On 01/15/18 09:53, Konstantin Belousov wrote: >>>>>>> On Mon, Jan 15, 2018 at 09:32:56AM -0800, Nathan Whitehorn wrote:= >>>>>>>> That seems fine to me. I don't think a less-clumsy way that does= not >>>>>>>> involve extra indirection is possible. The PHYS_TO_DMAP() return= ing NULL >>>>>>>> is about the best thing I can come up with from a clumsiness sta= ndpoint >>>>>>>> since plenty of code checks for null pointers already, but doesn= 't >>>>>>>> cleanly handle the rarer case where you want to test for the exi= stence >>>>>>>> of direct maps in general without testing some potemkin address.= >>>>>>>> >>>>>>>> My one reservation about PMAP_HAS_DMAP or the like as a selector= is that >>>>>>>> it does not encode the full shape of the problem: one could imag= ine >>>>>>>> having a direct map that only covers a limited range of RAM (I a= m not >>>>>>>> sure whether the existence of dmaplimit on amd64 implies this ca= n happen >>>>>>>> with non-device memory in real life), for example. These cases a= re >>>>>>>> currently covered by an assert() in PHYS_TO_DMAP(), whereas havi= ng >>>>>>>> PHYS_TO_DMAP() return NULL allows a more flexible signalling and= the >>>>>>>> potential for the calling code to do something reasonable to han= dle the >>>>>>>> error. A single global flag can't convey information at this kin= d of >>>>>>>> granularity. Is this a reasonable concern? Or am I overthinking = things? >>>>>>> IMO it is overreaction. amd64 assumes that all normal memory is = covered >>>>>>> by DMAP. It must never fail. See, for instance, the implementa= tion >>>>>>> of the sf bufs for it. >>>>>>> >>>>>>> If device memory not covered by DMAP can exists, it is the driver= problem. >>>>>>> For instance, for NVDIMMs I wrote specific mapping code which est= ablishes >>>>>>> kernel mapping for it, when not covered by EFI memory map and cor= respondingly >>>>>>> not included into DMAP. >>>>>>> >>>>>> Fair enough. Here's a patch with a new flag (DIRECT_MAP_AVAILABLE)= =2E I've >>>>>> also retooled the sfbuf code to use this rather than its own flags= that >>>>>> mean the same things. The sparc64 part of the patch is untested. >>>>>> -Nathan >>>>>> Index: sparc64/include/vmparam.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 >>>>>> --- sparc64/include/vmparam.h (revision 328006) >>>>>> +++ sparc64/include/vmparam.h (working copy) >>>>>> @@ -240,10 +240,12 @@ >>>>>> */ >>>>>> #define ZERO_REGION_SIZE PAGE_SIZE >>>>>> =20 >>>>>> +#include >>>>>> + >>>>>> #define SFBUF >>>>>> #define SFBUF_MAP >>>>>> -#define SFBUF_OPTIONAL_DIRECT_MAP dcache_color_ignore >>>>>> -#include >>>>>> -#define SFBUF_PHYS_DMAP(x) TLB_PHYS_TO_DIRECT(x) >>>>>> =20 >>>>>> +#define DIRECT_MAP_AVAILABLE dcache_color_ignore >>>>>> +#define PHYS_TO_DMAP(x) (DIRECT_MAP_AVAILABLE ? (TLB_PHYS_TO_DIRE= CT(x) : 0) >>>>> What dcache_color_ignore actually indicates is the presence of >>>>> hardware unaliasing support, in other words the ability to enter >>>>> duplicate cacheable mappings into the MMU. While a direct map is >>>>> available and used by MD code on all supported CPUs down to US-I, >>>>> the former feature is only implemented in the line of Fujitsu SPARC= 64 >>>>> processors. IIRC, the sfbuf(9) code can't guarantee that there isn'= t >>>>> already a cacheable mapping from a different VA to the same PA, >>>>> which is why it employs dcache_color_ignore. Is that a general >>>>> constraint of all MI PHYS_TO_DMAP users or are there consumers >>>>> which can guarantee that they are the only users of a mapping >>>>> to the same PA? >>>>> >>>>> Marius >>>>> >>>> With the patch, there are four uses of this in the kernel: the sfbuf= >>>> code, a diagnostic check on page zeroing, part of the EFI runtime co= de, >>>> and part of the Linux KBI compat. The second looks safe from this >>>> perspective and at least some of the others (EFI runtime) are irrele= vant >>>> on sparc64. But I really have no idea what was intended for the >>>> semantics of this API -- I didn't even know it *was* an MI API until= >>>> this commit. Maybe kib can comment? If this is outside the semantics= of >>>> PHYS_TO_DMAP, then we need to keep the existing sfbuf code. >>> sfbufs cannot guarantee that there is no other mapping of the page wh= en >>> the sfbuf is created. For instance, one of the use of sfbufs is to m= ap >>> the image page 0 to read ELF headers when doing the image activation.= >>> The image might be mapped by other processes, and we do not control t= he >>> address at which it mapped. >>> >>> So the direct map accesses must work regardless of the presence of ot= her >>> page mappings, and the check for dcache_color_ignore is needed to all= ow >>> MI code to take advantage of DMAP. >>> >> So: what do you want to happen with PHYS_TO_DMAP()? Do we want to clai= m=20 >> to MI that a direct map is "available" in such circumstances, or=20 >> "unavailable"? Should sfbuf retain a separate API? I have no preferenc= es=20 >> here and just want to close out this issue. > Perhaps DMAP should be conditionally available to the MI layer, same as= > on powerpc ? I.e. your patch cited above looks right to me, unless I > misunderstand the Marius' response. > Yes, it should. Only the sparc64 machines where dcache_color_ignore is true should attempt to use the direct map in MI code. The machine-dependent uiomove_fromphys() on sparc64 shows the hoops one has to jump through in order to correctly use the direct map on sparc64. From owner-svn-src-head@freebsd.org Thu Jan 18 16:20:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1964FEB5083; Thu, 18 Jan 2018 16:20:11 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E9236754DB; Thu, 18 Jan 2018 16:20:10 +0000 (UTC) (envelope-from br@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 47A2720DAF; Thu, 18 Jan 2018 16:20:10 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0IGKASF074898; Thu, 18 Jan 2018 16:20:10 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0IGKAW7074897; Thu, 18 Jan 2018 16:20:10 GMT (envelope-from br@FreeBSD.org) Message-Id: <201801181620.w0IGKAW7074897@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Thu, 18 Jan 2018 16:20:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328130 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 328130 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 16:20:11 -0000 Author: br Date: Thu Jan 18 16:20:09 2018 New Revision: 328130 URL: https://svnweb.freebsd.org/changeset/base/328130 Log: Set the base address of translation table 0. This fixes operation on Qualcomm Snapdragon and some other platforms. During boot time on subsystems initialization we have some amount of kernel threads created, then scheduler gives CPU time to each thread. Eventually scheduler returns CPU execution back to thread 0. In this case writing zero to ttbr0 in cpu_switch leads Qualcomm board to reboot (asynchronously, CPU continues execution). Similar to other kernel threads install a valid physical address (kernel pmap) to user page table base register ttbr0. Reviewed by: andrew Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D13536 Modified: head/sys/arm64/arm64/machdep.c Modified: head/sys/arm64/arm64/machdep.c ============================================================================== --- head/sys/arm64/arm64/machdep.c Thu Jan 18 15:28:49 2018 (r328129) +++ head/sys/arm64/arm64/machdep.c Thu Jan 18 16:20:09 2018 (r328130) @@ -715,6 +715,9 @@ init_proc0(vm_offset_t kstack) thread0.td_pcb->pcb_vfpcpu = UINT_MAX; thread0.td_frame = &proc0_tf; pcpup->pc_curpcb = thread0.td_pcb; + + /* Set the base address of translation table 0. */ + thread0.td_proc->p_md.md_l0addr = READ_SPECIALREG(ttbr0_el1); } typedef struct { From owner-svn-src-head@freebsd.org Thu Jan 18 17:43:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 247CBEB91A6; Thu, 18 Jan 2018 17:43:34 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D8F8578AA2; Thu, 18 Jan 2018 17:43:33 +0000 (UTC) (envelope-from br@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2270E21CD9; Thu, 18 Jan 2018 17:43:33 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0IHhX49012585; Thu, 18 Jan 2018 17:43:33 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0IHhWo7012583; Thu, 18 Jan 2018 17:43:32 GMT (envelope-from br@FreeBSD.org) Message-Id: <201801181743.w0IHhWo7012583@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Thu, 18 Jan 2018 17:43:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328132 - head/sys/dev/uart X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/dev/uart X-SVN-Commit-Revision: 328132 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 17:43:34 -0000 Author: br Date: Thu Jan 18 17:43:32 2018 New Revision: 328132 URL: https://svnweb.freebsd.org/changeset/base/328132 Log: Support for UART device found in Qualcomm Snapdragon 410E SoC. Tested on DragonBoard 410c. Reviewed by: andrew Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D13972 Modified: head/sys/dev/uart/uart_dev_msm.c head/sys/dev/uart/uart_dev_msm.h Modified: head/sys/dev/uart/uart_dev_msm.c ============================================================================== --- head/sys/dev/uart/uart_dev_msm.c Thu Jan 18 16:22:05 2018 (r328131) +++ head/sys/dev/uart/uart_dev_msm.c Thu Jan 18 17:43:32 2018 (r328132) @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -122,9 +121,6 @@ msm_uart_param(struct uart_bas *bas, int baudrate, int return (EINVAL); } uart_setreg(bas, UART_DM_MR2, ulcon); - - /* Set 115200 for both TX and RX. */ - uart_setreg(bas, UART_DM_CSR, UART_DM_CSR_115200); uart_barrier(bas); return (0); @@ -143,6 +139,8 @@ static int msm_probe(struct uart_bas *bas) { + bas->regiowidth = 4; + return (0); } @@ -202,8 +200,7 @@ msm_init(struct uart_bas *bas, int baudrate, int datab SETREG(bas, UART_DM_CR, UART_DM_RESET_STALE_INT); /* Enable/Disable Rx/Tx DM interfaces */ - /* Disable Data Mover for now. */ - uart_setreg(bas, UART_DM_DMEN, 0x0); + uart_setreg(bas, UART_DM_DMEN, UART_DM_DMEN_RX_SC_ENABLE); /* Enable transmitter and receiver */ uart_setreg(bas, UART_DM_CR, UART_DM_CR_RX_ENABLE); @@ -239,6 +236,7 @@ msm_putc(struct uart_bas *bas, int c) while ((uart_getreg(bas, UART_DM_ISR) & UART_DM_TX_READY) == 0 && --limit) DELAY(4); + SETREG(bas, UART_DM_CR, UART_DM_CLEAR_TX_READY); } /* FIFO is ready, write number of characters to be written */ uart_setreg(bas, UART_DM_NO_CHARS_FOR_TX, 1); @@ -324,7 +322,11 @@ static kobj_method_t msm_methods[] = { int msm_bus_probe(struct uart_softc *sc) { + struct uart_bas *bas; + bas = &sc->sc_bas; + bas->regiowidth = 4; + sc->sc_txfifosz = 64; sc->sc_rxfifosz = 64; @@ -570,7 +572,8 @@ static struct uart_class uart_msm_class = { }; static struct ofw_compat_data compat_data[] = { - {"qcom,msm-uartdm", (uintptr_t)&uart_msm_class}, - {NULL, (uintptr_t)NULL}, + {"qcom,msm-uartdm-v1.4", (uintptr_t)&uart_msm_class}, + {"qcom,msm-uartdm", (uintptr_t)&uart_msm_class}, + {NULL, (uintptr_t)NULL}, }; UART_FDT_CLASS_AND_DEVICE(compat_data); Modified: head/sys/dev/uart/uart_dev_msm.h ============================================================================== --- head/sys/dev/uart/uart_dev_msm.h Thu Jan 18 16:22:05 2018 (r328131) +++ head/sys/dev/uart/uart_dev_msm.h Thu Jan 18 17:43:32 2018 (r328132) @@ -177,6 +177,11 @@ enum UART_DM_BITS_PER_CHAR { /* UART Data Mover Enable Register */ #define UART_DM_DMEN 0x3c +/* + * Single-Character mode for RX channel (every character received + * is zero-padded into a word). + */ +#define UART_DM_DMEN_RX_SC_ENABLE (1 << 5) /* Number of characters for Transmission */ #define UART_DM_NO_CHARS_FOR_TX 0x40 From owner-svn-src-head@freebsd.org Thu Jan 18 18:19:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8D3CEBAC4D; Thu, 18 Jan 2018 18:19:32 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9464D79ED1; Thu, 18 Jan 2018 18:19:32 +0000 (UTC) (envelope-from br@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF98F221F8; Thu, 18 Jan 2018 18:19:31 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0IIJVov025197; Thu, 18 Jan 2018 18:19:31 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0IIJVZ2025196; Thu, 18 Jan 2018 18:19:31 GMT (envelope-from br@FreeBSD.org) Message-Id: <201801181819.w0IIJVZ2025196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Thu, 18 Jan 2018 18:19:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328133 - head/sys/dev/uart X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/dev/uart X-SVN-Commit-Revision: 328133 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 18:19:32 -0000 Author: br Date: Thu Jan 18 18:19:31 2018 New Revision: 328133 URL: https://svnweb.freebsd.org/changeset/base/328133 Log: UART Clock Selection Register holds a divider value for a supplied clock, not a final baud rate. The value for this register has to be calculated. Sponsored by: DARPA, AFRL Modified: head/sys/dev/uart/uart_dev_msm.h Modified: head/sys/dev/uart/uart_dev_msm.h ============================================================================== --- head/sys/dev/uart/uart_dev_msm.h Thu Jan 18 17:43:32 2018 (r328132) +++ head/sys/dev/uart/uart_dev_msm.h Thu Jan 18 18:19:31 2018 (r328133) @@ -80,22 +80,6 @@ enum UART_DM_BITS_PER_CHAR { /* UART Clock Selection Register, write only */ #define UART_DM_CSR 0x08 -#define UART_DM_CSR_115200 0xff -#define UART_DM_CSR_57600 0xee -#define UART_DM_CSR_38400 0xdd -#define UART_DM_CSR_28800 0xcc -#define UART_DM_CSR_19200 0xbb -#define UART_DM_CSR_14400 0xaa -#define UART_DM_CSR_9600 0x99 -#define UART_DM_CSR_7200 0x88 -#define UART_DM_CSR_4800 0x77 -#define UART_DM_CSR_3600 0x66 -#define UART_DM_CSR_2400 0x55 -#define UART_DM_CSR_1200 0x44 -#define UART_DM_CSR_600 0x33 -#define UART_DM_CSR_300 0x22 -#define UART_DM_CSR_150 0x11 -#define UART_DM_CSR_75 0x00 /* UART DM TX FIFO Registers - 4, write only */ #define UART_DM_TF(x) (0x70 + (4 * (x))) From owner-svn-src-head@freebsd.org Thu Jan 18 19:43:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4EC11EBF222; Thu, 18 Jan 2018 19:43:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 294D97D347; Thu, 18 Jan 2018 19:43:03 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 782CB23091; Thu, 18 Jan 2018 19:43:02 +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 w0IJh23G062833; Thu, 18 Jan 2018 19:43:02 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0IJh2ej062831; Thu, 18 Jan 2018 19:43:02 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201801181943.w0IJh2ej062831@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 18 Jan 2018 19:43:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328134 - in head: sys/sys usr.bin/vmstat X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: sys/sys usr.bin/vmstat X-SVN-Commit-Revision: 328134 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 19:43:03 -0000 Author: jhb Date: Thu Jan 18 19:43:02 2018 New Revision: 328134 URL: https://svnweb.freebsd.org/changeset/base/328134 Log: Update various statements in vmstat(8) to match reality. - The process stats are actually thread counts rather than process counts. - Simplify various descriptions to remove mention of stats that are updated every 5 seconds (all VM related stats are now "instant", only the load average is updated every 5 seconds). - Don't make any mention of special treatment for processes that have been active in the last 20 seconds. We don't track that stat. - Rework the description of active virtual memory. Call it mapped virtual memory and explicitly point out it is not the same as the active page queue (which corresponds to "Active" in top(1)), and also hint at the possible bogusness of the value (e.g. if a process maps a single page out of a multiple GB file, the entire file's size is considered mapped). - Simplify a few descriptions that implied their output was a value per interval. All of the "rate" values are per-second rates scaled across the interval. - Update a few comments for 'struct vmtotal' along similar lines. Reported by: mwlucas (indirectly) Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D13905 Modified: head/sys/sys/vmmeter.h head/usr.bin/vmstat/vmstat.8 Modified: head/sys/sys/vmmeter.h ============================================================================== --- head/sys/sys/vmmeter.h Thu Jan 18 18:19:31 2018 (r328133) +++ head/sys/sys/vmmeter.h Thu Jan 18 19:43:02 2018 (r328134) @@ -41,7 +41,6 @@ */ #define MAXSLP 20 -/* Systemwide totals computed every five seconds. */ struct vmtotal { uint64_t t_vm; /* total virtual memory */ uint64_t t_avm; /* active virtual memory */ @@ -53,12 +52,12 @@ struct vmtotal { uint64_t t_armshr; /* active shared real memory */ uint64_t t_free; /* free memory pages */ int16_t t_rq; /* length of the run queue */ - int16_t t_dw; /* jobs in ``disk wait'' (neg + int16_t t_dw; /* threads in ``disk wait'' (neg priority) */ - int16_t t_pw; /* jobs in page wait */ - int16_t t_sl; /* jobs sleeping in core */ + int16_t t_pw; /* threads in page wait */ + int16_t t_sl; /* threads sleeping in core */ int16_t t_sw; /* swapped out runnable/short - block jobs */ + block threads */ uint16_t t_pad[3]; }; Modified: head/usr.bin/vmstat/vmstat.8 ============================================================================== --- head/usr.bin/vmstat/vmstat.8 Thu Jan 18 18:19:31 2018 (r328133) +++ head/usr.bin/vmstat/vmstat.8 Thu Jan 18 19:43:02 2018 (r328134) @@ -28,7 +28,7 @@ .\" @(#)vmstat.8 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd November 19, 2015 +.Dd January 18, 2018 .Dt VMSTAT 8 .Os .Sh NAME @@ -248,31 +248,39 @@ By default, displays the following information: .Bl -tag -width indent .It procs -Information about the numbers of processes in various states. +Information about the number of threads in various states: .Pp .Bl -tag -width indent -compact .It r -in run queue +running or in run queue .It b blocked for resources (i/o, paging, etc.) .It w -runnable or short sleeper (< 20 secs) but swapped +swapped out .El .It memory Information about the usage of virtual and real memory. -Virtual pages (reported in units of 1024 bytes) are considered active if -they belong to processes which are running or have run in the last 20 -seconds. .Pp +Mapped virtual memory is a sum of all of the virtual pages belonging +to mapped virtual memory objects. +Note that the entire memory object's size is considered mapped even if +only a subset of the object's pages are currently mapped. +This statistic is not related to the active page queue which is used to track +real memory. +.Pp .Bl -tag -width indent -compact .It avm -active virtual pages +mapped virtual memory +.Po previously called active in +.Nm +output +.Pc .It fre size of the free list .El .It page Information about page faults and paging activity. -These are averaged each five seconds, and given in units per second. +These are given in units per second. .Pp .Bl -tag -width indent -compact .It flt @@ -286,11 +294,11 @@ pages paged in .It po pages paged out .It fr -pages freed per second +pages freed .\" .It de .\" anticipated short term memory shortfall .It sr -pages scanned by clock algorithm, per-second +pages scanned by page daemon .El .It disks Disk operations per second (this field is system dependent). @@ -319,15 +327,15 @@ matching pattern is specified (see above), will only display the given devices or the devices matching the pattern, and will not randomly select other devices in the system. .It faults -Trap/interrupt rate averages per second over last 5 seconds. +Trap/interrupt rates per second. .Pp .Bl -tag -width indent -compact .It in -device interrupts per interval (including clock interrupts) +device interrupts (including clock interrupts) .It sy -system calls per interval +system calls .It cs -cpu context switch rate (switches/interval) +cpu context switches .El .It cpu Breakdown of percentage usage of CPU time. @@ -336,7 +344,7 @@ Breakdown of percentage usage of CPU time. .It us user time for normal and low priority processes .It sy -system time +system and interrupt time .It id cpu idle .El @@ -352,10 +360,7 @@ default memory file The command: .Dl vmstat -w 5 will print what the system is doing every five -seconds; this is a good choice of printing interval since this is how often -some of the statistics are sampled in the system. -Others vary every second and running the output for a while will make it -apparent which are recomputed every second. +seconds. .Pp The command: .Dl vmstat -p da -p cd -w 1 From owner-svn-src-head@freebsd.org Thu Jan 18 20:02:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33BA0EC00B4; Thu, 18 Jan 2018 20:02:12 +0000 (UTC) (envelope-from eric@vangyzen.net) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [199.48.133.146]) by mx1.freebsd.org (Postfix) with ESMTP id 1C95E7DEA9; Thu, 18 Jan 2018 20:02:10 +0000 (UTC) (envelope-from eric@vangyzen.net) Received: from sweettea.beer.town (unknown [76.164.8.130]) by smtp.vangyzen.net (Postfix) with ESMTPSA id A3E625646F; Thu, 18 Jan 2018 14:02:03 -0600 (CST) Subject: Re: svn commit: r327354 - head/sys/vm To: Gleb Smirnoff , Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201712291905.vBTJ57gI072871@repo.freebsd.org> <20180117224054.GO8113@FreeBSD.org> From: Eric van Gyzen Message-ID: <601ee1a2-8f4e-518d-4c86-89871cd652af@vangyzen.net> Date: Thu, 18 Jan 2018 14:01:59 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20180117224054.GO8113@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 20:02:12 -0000 On 01/17/2018 16:40, Gleb Smirnoff wrote: > On Fri, Dec 29, 2017 at 07:05:07PM +0000, Konstantin Belousov wrote: > K> Author: kib > K> Date: Fri Dec 29 19:05:07 2017 > K> New Revision: 327354 > K> URL: https://svnweb.freebsd.org/changeset/base/327354 > K> > K> Log: > K> Style. > K> > K> Reviewed by: alc > K> Sponsored by: The FreeBSD Foundation > K> MFC after: 1 week > K> Differential revision: https://reviews.freebsd.org/D13678 > K> > K> Modified: > K> head/sys/vm/vm_swapout.c > K> > K> Modified: head/sys/vm/vm_swapout.c > K> ============================================================================== > K> --- head/sys/vm/vm_swapout.c Fri Dec 29 18:42:55 2017 (r327353) > K> +++ head/sys/vm/vm_swapout.c Fri Dec 29 19:05:07 2017 (r327354) > K> @@ -556,16 +556,14 @@ vm_thread_swapin(struct thread *td) > K> { > K> vm_object_t ksobj; > K> vm_page_t ma[KSTACK_MAX_PAGES]; > K> - int pages; > K> + int a, count, i, j, pages, rv; > K> > K> pages = td->td_kstack_pages; > K> ksobj = td->td_kstack_obj; > K> VM_OBJECT_WLOCK(ksobj); > K> (void)vm_page_grab_pages(ksobj, 0, VM_ALLOC_NORMAL | VM_ALLOC_WIRED, ma, > K> pages); > K> - for (int i = 0; i < pages;) { > K> - int j, a, count, rv; > K> - > K> + for (i = 0; i < pages;) { > K> vm_page_assert_xbusied(ma[i]); > K> if (ma[i]->valid == VM_PAGE_BITS_ALL) { > K> vm_page_xunbusy(ma[i]); > > Yeah, style is sacred, but is there a single person on Earth who would > not agree that moving variables from smaller blocks to function block > reduces readability of the code? I agree that it reduces the readability. Not only that, it also encourages real bugs by allowing access to the variable when it does not make sense. Eric From owner-svn-src-head@freebsd.org Thu Jan 18 20:12:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2AEF8EC08E1; Thu, 18 Jan 2018 20:12:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 06CA17E4C3; Thu, 18 Jan 2018 20:12:14 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 448DF2355D; Thu, 18 Jan 2018 20:12:13 +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 w0IKCDj4072432; Thu, 18 Jan 2018 20:12:13 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0IKCDkD072431; Thu, 18 Jan 2018 20:12:13 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201801182012.w0IKCDkD072431@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 18 Jan 2018 20:12:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328135 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 328135 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 20:12:14 -0000 Author: jhb Date: Thu Jan 18 20:12:12 2018 New Revision: 328135 URL: https://svnweb.freebsd.org/changeset/base/328135 Log: Adjust branch target in NMI handler for the !PTI case. In the !PTI case the NMI handler jumped past the instructions that set %rdi to point to the current PCB, but the target instructions assumed %rdi were set. Reviewed by: kib Tested by: pho Modified: head/sys/amd64/amd64/exception.S Modified: head/sys/amd64/amd64/exception.S ============================================================================== --- head/sys/amd64/amd64/exception.S Thu Jan 18 19:43:02 2018 (r328134) +++ head/sys/amd64/amd64/exception.S Thu Jan 18 20:12:12 2018 (r328135) @@ -571,11 +571,11 @@ nmi_fromuserspace: cmpq $~0,%rax je 1f movq %rax,%cr3 - movq PCPU(CURPCB),%rdi +1: movq PCPU(CURPCB),%rdi testq %rdi,%rdi jz 3f orl $PCB_FULL_IRET,PCB_FLAGS(%rdi) -1: testb $CPUID_STDEXT_FSGSBASE,cpu_stdext_feature(%rip) + testb $CPUID_STDEXT_FSGSBASE,cpu_stdext_feature(%rip) jz 3f cmpw $KUF32SEL,TF_FS(%rsp) jne 2f From owner-svn-src-head@freebsd.org Thu Jan 18 20:34:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60001EC197B; Thu, 18 Jan 2018 20:34:00 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f171.google.com (mail-io0-f171.google.com [209.85.223.171]) (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 2F4D27F544; Thu, 18 Jan 2018 20:33:59 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f171.google.com with SMTP id n7so9782219iob.0; Thu, 18 Jan 2018 12:33:59 -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=NEvlFE8Y8BGN3TJtX3wdt1OgSIquokKRcRIT0K6Ag8U=; b=hPIyfXI+gHeaUDmSZumFoeqZaNcsIp4e/qeAOPGcX/e3HKDxXNk97OKnuFsW5jMsX1 hJAwUJhocnTRQJECuP0nU+vA0EKcaSwtg+SgIwBQ8zK45YDKMFpdaYum1CkwsGvIG0/f ru2mxIpMKAokuz60R1wmRPd/orb+YuGOPsHKpvj+vT1jtv3DTQ41i8ifvOrB0K41wK2h IIPnDUAB8s+sTEhHkY3c5bjNJe6qtqtuF2QDuuMk6Aki2Soa+iLP/eEXWOhq+WngmA5L uleBH9aM/D7Hgl7d/m2vczYRLNy42W2u06IoDc7VdYT+Y7464emveEOnGvsgL9bs6IWO 4fjQ== X-Gm-Message-State: AKwxytebk3dZGB5Frs6oRnJMC51SHn99YIM2KACKJg/GhFaeW/4Et/RX WTN6cInarwwdxgh4of5eYmNJf0qr X-Google-Smtp-Source: ACJfBos+ghh0/0rq0Ka1OyoFB0sD6uIJLGSCJFCPTe6YCiGcFToXl0kuGhbSJwfx+o2G47ia8kfWNA== X-Received: by 10.107.180.70 with SMTP id d67mr29178872iof.73.1516307633130; Thu, 18 Jan 2018 12:33:53 -0800 (PST) Received: from mail-it0-f49.google.com (mail-it0-f49.google.com. [209.85.214.49]) by smtp.gmail.com with ESMTPSA id f202sm4180738itc.40.2018.01.18.12.33.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jan 2018 12:33:53 -0800 (PST) Received: by mail-it0-f49.google.com with SMTP id 68so15102009ite.4; Thu, 18 Jan 2018 12:33:53 -0800 (PST) X-Received: by 10.36.84.205 with SMTP id t196mr19089733ita.128.1516307632828; Thu, 18 Jan 2018 12:33:52 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.166.21 with HTTP; Thu, 18 Jan 2018 12:33:52 -0800 (PST) In-Reply-To: <20180118112347.GP55707@kib.kiev.ua> References: <201801171144.w0HBiLrY043134@repo.freebsd.org> <20180118112347.GP55707@kib.kiev.ua> From: Conrad Meyer Date: Thu, 18 Jan 2018 12:33:52 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r328083 - in head/sys: amd64/amd64 amd64/ia32 amd64/include amd64/vmm amd64/vmm/intel dev/hyperv/vmbus dev/hyperv/vmbus/amd64 dev/hyperv/vmbus/i386 i386/i386 x86/include x86/isa x86/x86 To: Konstantin Belousov Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 20:34:00 -0000 On Thu, Jan 18, 2018 at 3:23 AM, Konstantin Belousov wrote: > On Wed, Jan 17, 2018 at 07:38:03PM -0800, Conrad Meyer wrote: >> On Wed, Jan 17, 2018 at 3:44 AM, Konstantin Belousov wrote: >> > Author: kib >> > Date: Wed Jan 17 11:44:21 2018 >> > New Revision: 328083 >> > URL: https://svnweb.freebsd.org/changeset/base/328083 >> > >> > Log: >> > PTI for amd64. >> >> This seems to break the xtoolchain GCC build: >> >> /usr/home/conrad/src/freebsd/sys/dev/hyperv/vmbus/amd64/vmbus_vector.S: >> Assembler messages: >> /usr/home/conrad/src/freebsd/sys/dev/hyperv/vmbus/amd64/vmbus_vector.S:40: >> Error: too many positional arguments >> >> I'm not sure why. Repro: pkg install amd64-xtoolchain-gcc && make >> buildkernel KERNCONF=GENERIC CROSS_TOOLCHAIN=amd64-gcc. > > Try r328120. Thanks! Fixed as of r328135. From owner-svn-src-head@freebsd.org Thu Jan 18 20:39:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 119FAEC1C06; Thu, 18 Jan 2018 20:39:34 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f48.google.com (mail-it0-f48.google.com [209.85.214.48]) (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 D4CDD7F745; Thu, 18 Jan 2018 20:39:33 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f48.google.com with SMTP id q8so15123833itb.2; Thu, 18 Jan 2018 12:39:33 -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:content-transfer-encoding; bh=W5oZf5/0rzq/xg6ObQbN2ntjF4j7NEAu4kVJq7243BE=; b=d3onNhIPS9ErbEaiBXwhAzuDbn4tZzugjwsCvDX8s3mZHM5RRTi/epnkjsuaklhMjE 3ML0IVa2NgmAPjpUz7ixF9oMy0pk95ZhYLEY3Z5apTsU0ABkBNw8sT1tby5B6pAAirR2 xECFbBA0HL8jyKzTmfl1F5VRWpQ1XAZcckoQ9u9eLXm1F800Fdd2ce0eBfp4X5ssjLZ8 U7I5Vg28j141EjQVBi+UlT4TU2zvfPOnXhwo6jdr7tsFTKFK1Zis3EHgbm1Yp+ZvHWx/ KmaqcYn85mUBntU8l4F2wED//t5Jjd7JHvDOO86hX++/qiFWdPLp9/6C77K5xBJUcDt8 D0Dg== X-Gm-Message-State: AKwxytd30WqNq35mM3ybOQtjIamns1+GS7qoDw/XXNB1JTcyNQBlletX wUsaVpjhQlt+yziQA1u4LwWXTPUf X-Google-Smtp-Source: ACJfBouY4qvoLeGrclnKEkLSd5K+O2nG8151wKwYY0Rlg4HWd2cjMA87Vfq8tbOt2aS+R5RylP1p1w== X-Received: by 10.36.107.142 with SMTP id v136mr15273934itc.113.1516307565946; Thu, 18 Jan 2018 12:32:45 -0800 (PST) Received: from mail-io0-f173.google.com (mail-io0-f173.google.com. [209.85.223.173]) by smtp.gmail.com with ESMTPSA id b12sm4208289ioe.38.2018.01.18.12.32.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jan 2018 12:32:45 -0800 (PST) Received: by mail-io0-f173.google.com with SMTP id f34so20965646ioi.13; Thu, 18 Jan 2018 12:32:45 -0800 (PST) X-Received: by 10.107.15.89 with SMTP id x86mr8068025ioi.38.1516307564881; Thu, 18 Jan 2018 12:32:44 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.166.21 with HTTP; Thu, 18 Jan 2018 12:32:44 -0800 (PST) In-Reply-To: <601ee1a2-8f4e-518d-4c86-89871cd652af@vangyzen.net> References: <201712291905.vBTJ57gI072871@repo.freebsd.org> <20180117224054.GO8113@FreeBSD.org> <601ee1a2-8f4e-518d-4c86-89871cd652af@vangyzen.net> From: Conrad Meyer Date: Thu, 18 Jan 2018 12:32:44 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r327354 - head/sys/vm To: Eric van Gyzen Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 20:39:34 -0000 On Thu, Jan 18, 2018 at 12:01 PM, Eric van Gyzen wrote: > On 01/17/2018 16:40, Gleb Smirnoff wrote: >> Yeah, style is sacred, but is there a single person on Earth who would >> not agree that moving variables from smaller blocks to function block >> reduces readability of the code? > > I agree that it reduces the readability. Not only that, it also > encourages real bugs by allowing access to the variable when it does not > make sense. I think the right way to propose this kind of policy change is to get agreement on how style(9) should be modified =E2=80=94 not arbitrarily go against style(9) in some files. The proposed change may be somewhat contentious and it might be a good exercise to go through the FreeBSD Community Process. I might separate these two concerns: 1. Allowing local / block scoped variables 2. Allowing C99 for loop initial declarations But I could see the argument that (2) is just a boring subset of (1). Thanks, Conrad From owner-svn-src-head@freebsd.org Thu Jan 18 20:45:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF3E2EC21BA; Thu, 18 Jan 2018 20:45:42 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A73247FC8B; Thu, 18 Jan 2018 20:45:42 +0000 (UTC) (envelope-from brd@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D919923A5C; Thu, 18 Jan 2018 20:45:41 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0IKjf7K088803; Thu, 18 Jan 2018 20:45:41 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0IKjf44088801; Thu, 18 Jan 2018 20:45:41 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201801182045.w0IKjf44088801@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Thu, 18 Jan 2018 20:45:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328136 - in head/etc: defaults rc.d X-SVN-Group: head X-SVN-Commit-Author: brd X-SVN-Commit-Paths: in head/etc: defaults rc.d X-SVN-Commit-Revision: 328136 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 20:45:42 -0000 Author: brd (doc,ports committer) Date: Thu Jan 18 20:45:41 2018 New Revision: 328136 URL: https://svnweb.freebsd.org/changeset/base/328136 Log: Teach the resolv startup script to respect its enable flag. Reviewed by: will, imp Approved by: imp Modified: head/etc/defaults/rc.conf head/etc/rc.d/resolv Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Thu Jan 18 20:12:12 2018 (r328135) +++ head/etc/defaults/rc.conf Thu Jan 18 20:45:41 2018 (r328136) @@ -96,6 +96,7 @@ fsck_y_enable="NO" # Set to YES to do fsck -y if the i fsck_y_flags="-T ffs:-R -T ufs:-R" # Additional flags for fsck -y background_fsck="YES" # Attempt to run fsck in the background where possible. background_fsck_delay="60" # Time to wait (seconds) before starting the fsck. +growfs_enable="NO" # Set to YES to attempt to grow the root filesystem on boot netfs_types="nfs:NFS smbfs:SMB" # Net filesystems. extra_netfs_types="NO" # List of network extra filesystem types for delayed # mount at startup (or NO). @@ -276,6 +277,7 @@ ctld_enable="NO" # CAM Target Layer / iSCSI target da local_unbound_enable="NO" # local caching resolver blacklistd_enable="NO" # Run blacklistd daemon (YES/NO). blacklistd_flags="" # Optional flags for blacklistd(8). +resolv_enable="YES" # Enable resolv / resolvconf # # kerberos. Do not run the admin daemons on slave servers Modified: head/etc/rc.d/resolv ============================================================================== --- head/etc/rc.d/resolv Thu Jan 18 20:12:12 2018 (r328135) +++ head/etc/rc.d/resolv Thu Jan 18 20:45:41 2018 (r328136) @@ -35,6 +35,7 @@ name="resolv" desc="Create /etc/resolv.conf from kenv" +start_cmd="${name}_start" stop_cmd=':' load_rc_config $name @@ -42,17 +43,20 @@ load_rc_config $name # if the info is available via dhcp/kenv # build the resolv.conf # -if [ -n "`/bin/kenv dhcp.domain-name-servers 2> /dev/null`" ]; then - interface="`/bin/kenv boot.netif.name`" - ( - if [ -n "`/bin/kenv dhcp.domain-name 2> /dev/null`" ]; then - echo domain `/bin/kenv dhcp.domain-name` +resolv_start() +{ + if [ -n "`/bin/kenv dhcp.domain-name-servers 2> /dev/null`" ]; then + interface="`/bin/kenv boot.netif.name`" + ( + if [ -n "`/bin/kenv dhcp.domain-name 2> /dev/null`" ]; then + echo domain `/bin/kenv dhcp.domain-name` + fi + + set -- `/bin/kenv dhcp.domain-name-servers` + for ns in `IFS=','; echo $*`; do + echo nameserver $ns + done + ) | /sbin/resolvconf -a ${interface}:dhcp4 fi - - set -- `/bin/kenv dhcp.domain-name-servers` - for ns in `IFS=','; echo $*`; do - echo nameserver $ns - done - ) | /sbin/resolvconf -a ${interface}:dhcp4 -fi +} From owner-svn-src-head@freebsd.org Thu Jan 18 20:55:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78FADEC2898 for ; Thu, 18 Jan 2018 20:55:07 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: from mail-lf0-x229.google.com (mail-lf0-x229.google.com [IPv6:2a00:1450:4010:c07::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 EC337804E5 for ; Thu, 18 Jan 2018 20:55:06 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: by mail-lf0-x229.google.com with SMTP id h92so18046491lfi.7 for ; Thu, 18 Jan 2018 12:55:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=wRcV0fna5Kij+xylQXjOgkiHNxpj8e74KtLiECMMgU0=; b=auCrydKPnFRtke/gVJeAoSReA85vlfYtaQKSB09P3lEFGjwTeq5L2kXszfrnSG5tfY qDjioYhFkd/5y+938oiYHsmK3ntSbxMXEwebGKONs3L5UEFHo8jaHyIGqSwOZPUfU9k2 6hXabAFV+CLBvbfenGS3+KMb2D7aMsd4fsUgXkbrTUgycnM60uqBPSfCAON37ZAN6UVx YMVDIVF3gKZ5bftyFnuHNsZ56kjidMER7naLz80jkWgxs3DGQlkofmujI4kguH7TUyob gslyNaDd3m07nW5gq+6RjFD3Rzh9un/0Ku56fsBVYwmgOpXI4eoH8Oqyo2xrjrzlfnZA KPHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wRcV0fna5Kij+xylQXjOgkiHNxpj8e74KtLiECMMgU0=; b=bY2Xi/aAyMHb23cU1g7DM1Nv+8niNLz9HuxE6zh34TtmrxZQ7Up/AGLC1Dy5RITMEH zGihlkmafoPcTNnS6ccLUysaHje3pP/GwukzfC1xsH7nvcEEkJsn/tpU4Y9v2aWEXofb nmWbENLppo43zU45Si2Dn1tTGOrGPwSy+JD1EeMVztP/iAy5CidesoHFPhe79/hLmVGX EpYyYdwQhugsZ0pVpLgP/AWvPRhYMn8dn9NMQwM58j83xL/tcuEzAQS461tfWX7Mg/ih PSFbYHv1AyukZ2lxuV41f2XJae3jMwUj7y4HsDRT1yiQF3uqbDDNNF3b95lD2g7wV6Zg rCAg== X-Gm-Message-State: AKwxytcClGvqzw7aLGNfYpKhxevxy061a1OCoo1kdLGnmLQcRSn/Ds6e 9TVerFYjNqyNFFXNe7eVM+6xMWWmZloGNnfDSfBbu3wF X-Google-Smtp-Source: ACJfBosmCFx8zUu03E+Fe/tAzreiITB+3XyhL6DVtMWje8x/62hyVjdCYUY5yF1GCrcFBudwmIymsiFqRPYqtYzGn8I= X-Received: by 10.25.81.200 with SMTP id g69mr16120471lfl.19.1516308904232; Thu, 18 Jan 2018 12:55:04 -0800 (PST) MIME-Version: 1.0 References: <201801182045.w0IKjf44088801@repo.freebsd.org> In-Reply-To: <201801182045.w0IKjf44088801@repo.freebsd.org> From: Steven Hartland Date: Thu, 18 Jan 2018 20:54:53 +0000 Message-ID: Subject: Re: svn commit: r328136 - in head/etc: defaults rc.d To: Brad Davis Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 20:55:07 -0000 Did you intend to add the growfs option at the same time as it wasn=E2=80= =99t mentioned in the commit msg On Thu, 18 Jan 2018 at 20:46, Brad Davis wrote: > Author: brd (doc,ports committer) > Date: Thu Jan 18 20:45:41 2018 > New Revision: 328136 > URL: https://svnweb.freebsd.org/changeset/base/328136 > > Log: > Teach the resolv startup script to respect its enable flag. > > Reviewed by: will, imp > Approved by: imp > > Modified: > head/etc/defaults/rc.conf > head/etc/rc.d/resolv > > Modified: head/etc/defaults/rc.conf > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/etc/defaults/rc.conf Thu Jan 18 20:12:12 2018 (r328135) > +++ head/etc/defaults/rc.conf Thu Jan 18 20:45:41 2018 (r328136) > @@ -96,6 +96,7 @@ fsck_y_enable=3D"NO" # Set to YES to do fsck -y if t= he i > fsck_y_flags=3D"-T ffs:-R -T ufs:-R" # Additional flags for fsck -y > background_fsck=3D"YES" # Attempt to run fsck in the background where > possible. > background_fsck_delay=3D"60" # Time to wait (seconds) before starting th= e > fsck. > +growfs_enable=3D"NO" # Set to YES to attempt to grow the root > filesystem on boot > netfs_types=3D"nfs:NFS smbfs:SMB" # Net filesystems. > extra_netfs_types=3D"NO" # List of network extra filesystem types for > delayed > # mount at startup (or NO). > @@ -276,6 +277,7 @@ ctld_enable=3D"NO" # CAM Target Layer / iS= CSI > target da > local_unbound_enable=3D"NO" # local caching resolver > blacklistd_enable=3D"NO" # Run blacklistd daemon (YES/NO). > blacklistd_flags=3D"" # Optional flags for blacklistd(8). > +resolv_enable=3D"YES" # Enable resolv / resolvconf > > # > # kerberos. Do not run the admin daemons on slave servers > > Modified: head/etc/rc.d/resolv > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/etc/rc.d/resolv Thu Jan 18 20:12:12 2018 (r328135) > +++ head/etc/rc.d/resolv Thu Jan 18 20:45:41 2018 (r328136) > @@ -35,6 +35,7 @@ > > name=3D"resolv" > desc=3D"Create /etc/resolv.conf from kenv" > +start_cmd=3D"${name}_start" > stop_cmd=3D':' > > load_rc_config $name > @@ -42,17 +43,20 @@ load_rc_config $name > # if the info is available via dhcp/kenv > # build the resolv.conf > # > -if [ -n "`/bin/kenv dhcp.domain-name-servers 2> /dev/null`" ]; then > - interface=3D"`/bin/kenv boot.netif.name`" > - ( > - if [ -n "`/bin/kenv dhcp.domain-name 2> /dev/null`" ]; then > - echo domain `/bin/kenv dhcp.domain-name` > +resolv_start() > +{ > + if [ -n "`/bin/kenv dhcp.domain-name-servers 2> /dev/null`" ]; th= en > + interface=3D"`/bin/kenv boot.netif.name`" > + ( > + if [ -n "`/bin/kenv dhcp.domain-name 2> /dev/null`" ]; th= en > + echo domain `/bin/kenv dhcp.domain-name` > + fi > + > + set -- `/bin/kenv dhcp.domain-name-servers` > + for ns in `IFS=3D','; echo $*`; do > + echo nameserver $ns > + done > + ) | /sbin/resolvconf -a ${interface}:dhcp4 > fi > - > - set -- `/bin/kenv dhcp.domain-name-servers` > - for ns in `IFS=3D','; echo $*`; do > - echo nameserver $ns > - done > - ) | /sbin/resolvconf -a ${interface}:dhcp4 > -fi > +} > > > From owner-svn-src-head@freebsd.org Thu Jan 18 21:04:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2264EEC2FAD for ; Thu, 18 Jan 2018 21:04:04 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-wm0-x233.google.com (mail-wm0-x233.google.com [IPv6:2a00:1450:400c:c09::233]) (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 A668180B1E for ; Thu, 18 Jan 2018 21:04:03 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-wm0-x233.google.com with SMTP id g1so24488964wmg.2 for ; Thu, 18 Jan 2018 13:04: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=hEXcYrU5aI4w7qicdOtpQ91O+aZFdkbbAzRejRrqWwA=; b=kOT08as5/91ylUXZDuin98LLRj2rlECdQ2tKpP3v0WNO/yhfLHITKFXGWBsMZsh+GM iDdjbKiiQrmQZKoYEJ2YsAnC22bZ4M6OfClY9b8ZRxlsgQP1TF54lLpZE0GYTjQ2uM8A 2kOoYJnAjikgLtLqW7K2CZIHiP0FvoB54NPLgjKLQPhSkihJnzsfmEc7Cgqjv1abyrH+ kg2UdmtT1ecxLhipI4hVXKtP5SOB+Wg7UdR4pBN4XjzB0xr31ZchdDgmgrBCcmLK7k43 xfONG089K1UkaltIyaRUP4FKb461jD07ZxzqlTGbLiiRWB8bw8NDiPyJWtC1Y8p5b4Pk gwAw== 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=hEXcYrU5aI4w7qicdOtpQ91O+aZFdkbbAzRejRrqWwA=; b=rrB/Mb9aDQ8t1QysnH778aknNAuS6ugDiS0eR/pjxvbgOp8E+TEnWrYPlp2yJsWTTI fCCyLjNbaDh3L55X7Ecowu9EZKpji+psVvx6Wbus0hbhCw0rWEMFRlGL2iu7CjxZ+0MY 6tL3mEghy41//ncaeeREnmLTuCAbr+W32DqoughM6/eEsZrpjbND9zAZGOOI9dUegdmd wu7S0zbGzyG8uOhKWYkx5z9YXgdxHKP7sl926C5fcuHXwuHcZZclyKdItzPJ/sN1UVY0 Ecw6Cpm5BuAyfP9eJ64djZsWXCmUGaGVXW+7gXWk8iE8o8Qucsc/VeIuToDF0StMiOyp hjyw== X-Gm-Message-State: AKwxyter62d1YSGFSBmiBwh0b3mMJpiFEuddH6IFLsg4+9kX7BkKI3z7 0xd3s6YyQP8LAwkhVOkRM9zNKX/pFAFYcZiDybvcaw== X-Google-Smtp-Source: ACJfBoth+/CVsocGvB8KyoNqXHPEQ6Z+Hp3HSwZ2nYRurgaTyqvRrI1n5wRo6DOqMKy3e5GlrcbqwTpis+N3jG7AKGo= X-Received: by 10.80.147.228 with SMTP id o91mr9990716eda.206.1516309442066; Thu, 18 Jan 2018 13:04:02 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.80.195.12 with HTTP; Thu, 18 Jan 2018 13:04:01 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: References: <201712291905.vBTJ57gI072871@repo.freebsd.org> <20180117224054.GO8113@FreeBSD.org> <601ee1a2-8f4e-518d-4c86-89871cd652af@vangyzen.net> From: Warner Losh Date: Thu, 18 Jan 2018 14:04:01 -0700 X-Google-Sender-Auth: fSLXfS7ottohE3eNLxGvNK8buro Message-ID: Subject: Re: svn commit: r327354 - head/sys/vm To: "Conrad E. Meyer" Cc: Eric van Gyzen , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 21:04:04 -0000 On Thu, Jan 18, 2018 at 1:32 PM, Conrad Meyer wrote: > On Thu, Jan 18, 2018 at 12:01 PM, Eric van Gyzen > wrote: > > On 01/17/2018 16:40, Gleb Smirnoff wrote: > >> Yeah, style is sacred, but is there a single person on Earth who would > >> not agree that moving variables from smaller blocks to function block > >> reduces readability of the code? > > > > I agree that it reduces the readability. Not only that, it also > > encourages real bugs by allowing access to the variable when it does no= t > > make sense. > > I think the right way to propose this kind of policy change is to get > agreement on how style(9) should be modified =E2=80=94 not arbitrarily go > against style(9) in some files. The proposed change may be somewhat > contentious and it might be a good exercise to go through the FreeBSD > Community Process. > > I might separate these two concerns: > > 1. Allowing local / block scoped variables > 2. Allowing C99 for loop initial declarations > > But I could see the argument that (2) is just a boring subset of (1). > Tell me again where #1/#2 are disallowed? I can't seem to find that in style(9), except by a weak example of there being no examples of #1 or #2. Warner From owner-svn-src-head@freebsd.org Thu Jan 18 21:10:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2475EC3487; Thu, 18 Jan 2018 21:10:24 +0000 (UTC) (envelope-from matt.joras@gmail.com) Received: from mail-wm0-f49.google.com (mail-wm0-f49.google.com [74.125.82.49]) (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 8DEDA80FAE; Thu, 18 Jan 2018 21:10:24 +0000 (UTC) (envelope-from matt.joras@gmail.com) Received: by mail-wm0-f49.google.com with SMTP id g1so24517325wmg.2; Thu, 18 Jan 2018 13:10:24 -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:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Iy4wE/2F+vV23CHQP3fhWQNqCPg2L+mHLs2K30lzxOE=; b=hJt0/VGcEXQN2G2GD9y8SNxMLQjcVhRLCUsyz2mgQN18mIDhB8RXzl+uBxW0wEFe2b aoMzs76mh0sr4QHmeryaZVU08vjnfNHLGITFIyxdVUYUOhVd+gPHlu1rp8ArX32fqVYv Ee22Wrm/1dkhiehG7EHxo4+4Bf0PbKcYp6AvEiN3EcTlTib3NQC6DhA9cE/T4ZGAxTWn 7oTiHYlVxr5MHHBLzigb8LLZPXOgryK3pboDh+BWEE7wjR7ExiE9uLoMK7HoyyxVVaEp xcAkPnnv1c/3XVQvq4HnbzQ4g9FQ76kklD/fTEGyozED8YSxo6BhPmIdPY4nlvTzsTnl 6LPw== X-Gm-Message-State: AKwxyte9LI+UmEtTuClZDhfEUDyWuV7kunLYY9CRRwzBvPE560dutKxG Rpr6iIliS3Wz8wJ+03/00aIBDfUI X-Google-Smtp-Source: ACJfBovHgUA5v1yJPCLfvsAnroFnocnKdiB6f3KMKWDi8x7+vLvs2w3tRrsbfxHzan2kkwSY8VJe/A== X-Received: by 10.80.211.7 with SMTP id g7mr9934644edh.76.1516309816412; Thu, 18 Jan 2018 13:10:16 -0800 (PST) Received: from mail-wr0-f177.google.com (mail-wr0-f177.google.com. [209.85.128.177]) by smtp.gmail.com with ESMTPSA id r12sm4864058edk.41.2018.01.18.13.10.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jan 2018 13:10:16 -0800 (PST) Received: by mail-wr0-f177.google.com with SMTP id g38so20817660wrd.2; Thu, 18 Jan 2018 13:10:16 -0800 (PST) X-Received: by 10.223.161.29 with SMTP id o29mr7906063wro.2.1516309815746; Thu, 18 Jan 2018 13:10:15 -0800 (PST) MIME-Version: 1.0 Received: by 10.223.176.48 with HTTP; Thu, 18 Jan 2018 13:10:15 -0800 (PST) In-Reply-To: References: <201712291905.vBTJ57gI072871@repo.freebsd.org> <20180117224054.GO8113@FreeBSD.org> <601ee1a2-8f4e-518d-4c86-89871cd652af@vangyzen.net> From: Matt Joras Date: Thu, 18 Jan 2018 13:10:15 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r327354 - head/sys/vm To: Warner Losh Cc: "Conrad E. Meyer" , Eric van Gyzen , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 21:10:25 -0000 On Thu, Jan 18, 2018 at 1:04 PM, Warner Losh wrote: > >> 1. Allowing local / block scoped variables >> 2. Allowing C99 for loop initial declarations >> >> But I could see the argument that (2) is just a boring subset of (1). > > > Tell me again where #1/#2 are disallowed? I can't seem to find that in > style(9), except by a weak example of there being no examples of #1 or #2. > > Warner > It is sort of implied by the sections stating the rules for declaring variables: "When declaring variables in functions declare them sorted by size, then n alphabetical order; multiple ones per line are okay." And this: "/* Insert an empty line if the function has no local variables. */" I don't see a more explicit note about them. Matt From owner-svn-src-head@freebsd.org Thu Jan 18 21:15:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2061FEC393A for ; Thu, 18 Jan 2018 21:15:19 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-wm0-x229.google.com (mail-wm0-x229.google.com [IPv6:2a00:1450:400c:c09::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 A320B815D3 for ; Thu, 18 Jan 2018 21:15:18 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-wm0-x229.google.com with SMTP id r78so25777110wme.0 for ; Thu, 18 Jan 2018 13:15:18 -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=YWiCkPWa+LjNa8SonQfmbTtE5ZfpLXE68uQ3t8gwNmo=; b=XGK6AaWyTs0gGokTjl3Jk+NWJ8ixTXwZ0UsW0p6NZIG4k151EPGXt/ovqND5IZwRMi trGiE8tTUSmEPA/91ZdusTVoEwK2xqkeJPThKdSiKVy3oNkjFjq2KYa5v8okcmMUhnnZ kZVdOFqIVz1P6xbgb9gxVkbhYYmi6jD+FHjV7ztHNLYB4WE9XnNqOEiHN9DCqexXxJpm /6x7PJuYi0kFYtAu2jPhfN0p4u2Q3XadCl478G2nciLXpe7IojOdiJLrd9ea2srDGAcF lXhEXugUcpRBMlqhvL5389dIgQ02aY9X796r+elii3ENZwjUuZg4M73JgPkqh0S69Kyn sBvw== 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=YWiCkPWa+LjNa8SonQfmbTtE5ZfpLXE68uQ3t8gwNmo=; b=KUlwr7l0SQIkg2uY8+uabXTyU3jmVOeZabLXObkBu1oEpD/atCyyIUfnH/E/QICHFZ N7rHvCSv0YbNIda1eNs/SAh/cpi4YTPl4kIttZsV6pBFDTdwqgk1EyjnfBb5dZdmPRx7 FjC8Mk51GmsvaANxiGfD/J7knnFaYFHHuoKRtD0Xmrmow2bu8rWTE4wnT8SFyRB7aec3 P5WNqQ7ztUar0MOrsVTgMFuGK9aBE0kMKiCaWspWIRfQ/BZ/ZnJ00lmTPCpmMfu4WVuj FzKBHjKV3tvaD7S1+erx7m/yKu8VWYwj6w+Sg13pYzgEf2iMcBYOb1SlgIHIDGqJwP13 yqpw== X-Gm-Message-State: AKwxytcICZXYIrKDormYi/Y3oME3geRAXZMN0DCqpkeUYycHgQgFFY4a twIelYtiOFGiXYzI7Y/5oi53/NeEs+AKfjDHoXuaGQ== X-Google-Smtp-Source: ACJfBovtVGSHF+ldEck2N+qFbOGKXjuoN1tJlFSVh0DNAZwIoeKG71UHzgESpcgFYkpwx+pk5t7nFgWzvd7tduiEhIc= X-Received: by 10.80.179.76 with SMTP id r12mr9745701edd.118.1516310116872; Thu, 18 Jan 2018 13:15:16 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.80.195.12 with HTTP; Thu, 18 Jan 2018 13:15:16 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: References: <201712291905.vBTJ57gI072871@repo.freebsd.org> <20180117224054.GO8113@FreeBSD.org> <601ee1a2-8f4e-518d-4c86-89871cd652af@vangyzen.net> From: Warner Losh Date: Thu, 18 Jan 2018 14:15:16 -0700 X-Google-Sender-Auth: fBWsnGKFygoR3AhwgqRtotOskt8 Message-ID: Subject: Re: svn commit: r327354 - head/sys/vm To: Matt Joras Cc: "Conrad E. Meyer" , Eric van Gyzen , 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-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 21:15:19 -0000 On Thu, Jan 18, 2018 at 2:10 PM, Matt Joras wrote: > On Thu, Jan 18, 2018 at 1:04 PM, Warner Losh wrote: > > > >> 1. Allowing local / block scoped variables > >> 2. Allowing C99 for loop initial declarations > >> > >> But I could see the argument that (2) is just a boring subset of (1). > > > > > > Tell me again where #1/#2 are disallowed? I can't seem to find that in > > style(9), except by a weak example of there being no examples of #1 or > #2. > > > > Warner > > > It is sort of implied by the sections stating the rules for declaring > variables: > "When declaring variables in functions declare them sorted by size, > then n alphabetical order; multiple ones per line are okay." > And this: > "/* Insert an empty line if the function has no local variables. */" > > I don't see a more explicit note about them. > Right. It's a weak argument at best. The rule I've seen followed is more like "if the function is too big, it's OK to have scope-local variables." Numerous examples of this can be found in the tree... More of a "don't do it gratuitously, rather use it only when it makes good sense." Warner From owner-svn-src-head@freebsd.org Thu Jan 18 21:19:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5AE3DEC3C54; Thu, 18 Jan 2018 21:19:58 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 35FFD8180D; Thu, 18 Jan 2018 21:19:58 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6ABA023F11; Thu, 18 Jan 2018 21:19:57 +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 w0ILJvdx002075; Thu, 18 Jan 2018 21:19:57 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0ILJvdf002074; Thu, 18 Jan 2018 21:19:57 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201801182119.w0ILJvdf002074@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 18 Jan 2018 21:19:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328137 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 328137 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 21:19:58 -0000 Author: cem Date: Thu Jan 18 21:19:57 2018 New Revision: 328137 URL: https://svnweb.freebsd.org/changeset/base/328137 Log: Add Elf_Nhdr definition to match NetBSD, OpenBSD, Linux The mesa port started to use this type and fails to build without it. NetBSD: http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/sys/exec_elf.h.diff?r1=1.26&r2=1.27&f=h OpenBSD: http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sys/sys/exec_elf.h.diff?r1=1.21&r2=1.22&f=h PR: 225302 Reported by: Greg V Sponsored by: Dell EMC Isilon Modified: head/sys/sys/elf_common.h Modified: head/sys/sys/elf_common.h ============================================================================== --- head/sys/sys/elf_common.h Thu Jan 18 20:45:41 2018 (r328136) +++ head/sys/sys/elf_common.h Thu Jan 18 21:19:57 2018 (r328137) @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * - * Copyright (c) 2017 Dell EMC + * Copyright (c) 2017, 2018 Dell EMC * Copyright (c) 2000, 2001, 2008, 2011, David E. O'Brien * Copyright (c) 1998 John D. Polstra. * All rights reserved. @@ -51,6 +51,7 @@ typedef struct { u_int32_t n_descsz; /* Length of descriptor. */ u_int32_t n_type; /* Type of this note. */ } Elf_Note; +typedef Elf_Note Elf_Nhdr; /* * Option kinds. From owner-svn-src-head@freebsd.org Thu Jan 18 21:31:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D205FEC4710; Thu, 18 Jan 2018 21:31:31 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f42.google.com (mail-it0-f42.google.com [209.85.214.42]) (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 A037D82431; Thu, 18 Jan 2018 21:31:31 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f42.google.com with SMTP id x42so15178527ita.4; Thu, 18 Jan 2018 13:31:31 -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:content-transfer-encoding; bh=wER5/RE6+HZoIVkK4KMyjbYJNQiIBx4EdRMyB8gqA0A=; b=MjfyrlPfiZ1V+2IXpFZrl6hDeuPfwd0KSIlNekd+jg4oeORZvGAvvHCRbQ/fwU2z3l lUC3ltdA25z9QFD4ZZz2nxhLzornklkgyAu1TAKH5I2kJwcbe+g7sxHowQ+hvQQeNv40 bgYzAEyXhis25O1Vrwy2tpy49UZAqiPmzYCHP6+ps5boECjMAv1IXumSvFdvIoxSk0en iokSR45FSvlphPnmCmpm6HZuMFy0p0P4EE99qSbOtQF6Z20ZDsdy7dDMOrnD7UwPyrGQ EiG/jAR5WdlVIaE8+eb+AGKe1BdwrVaYPuLlqIghLxGS2P8YgmJAAmllrHxE/gIF8AC2 dmiw== X-Gm-Message-State: AKwxytfwpGWcg4WMq5s0r0XWfLHpOBRZt1o9HRwenjXCL+WdTEjEyEFr n/PsqdEFhJP99W/d+u4AR02uKhhI X-Google-Smtp-Source: ACJfBou8VnXBVnerJljDmo67BX6iFLF2/dQgYpGld3ValL7sA0hAUPujvK5wSR4KXz09iXhM17PPOg== X-Received: by 10.36.2.16 with SMTP id 16mr18873580itu.81.1516311085006; Thu, 18 Jan 2018 13:31:25 -0800 (PST) Received: from mail-it0-f45.google.com (mail-it0-f45.google.com. [209.85.214.45]) by smtp.gmail.com with ESMTPSA id d141sm4191741iod.29.2018.01.18.13.31.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jan 2018 13:31:24 -0800 (PST) Received: by mail-it0-f45.google.com with SMTP id p139so15196808itb.1; Thu, 18 Jan 2018 13:31:24 -0800 (PST) X-Received: by 10.36.101.2 with SMTP id u2mr21161342itb.55.1516311084734; Thu, 18 Jan 2018 13:31:24 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.166.21 with HTTP; Thu, 18 Jan 2018 13:31:24 -0800 (PST) In-Reply-To: References: <201712291905.vBTJ57gI072871@repo.freebsd.org> <20180117224054.GO8113@FreeBSD.org> <601ee1a2-8f4e-518d-4c86-89871cd652af@vangyzen.net> From: Conrad Meyer Date: Thu, 18 Jan 2018 13:31:24 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r327354 - head/sys/vm To: Warner Losh Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 21:31:31 -0000 On Thu, Jan 18, 2018 at 1:04 PM, Warner Losh wrote: > On Thu, Jan 18, 2018 at 1:32 PM, Conrad Meyer wrote: >> 1. Allowing local / block scoped variables >> 2. Allowing C99 for loop initial declarations > > Tell me again where #1/#2 are disallowed? I can't seem to find that in > style(9), except by a weak example of there being no examples of #1 or #2= . You're right =E2=80=94 I misremembered style(9). From owner-svn-src-head@freebsd.org Thu Jan 18 21:38:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BE4EEC4AD9; Thu, 18 Jan 2018 21:38:23 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 26B0682985; Thu, 18 Jan 2018 21:38:23 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6792524257; Thu, 18 Jan 2018 21:38:22 +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 w0ILcMoF010697; Thu, 18 Jan 2018 21:38:22 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0ILcMcW010694; Thu, 18 Jan 2018 21:38:22 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201801182138.w0ILcMcW010694@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 18 Jan 2018 21:38:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328141 - head/contrib/llvm/tools/lld/ELF X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/llvm/tools/lld/ELF X-SVN-Commit-Revision: 328141 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 21:38:23 -0000 Author: emaste Date: Thu Jan 18 21:38:21 2018 New Revision: 328141 URL: https://svnweb.freebsd.org/changeset/base/328141 Log: lld: Fix for ld.lld does not accept "AT" syntax for declaring LMA region AT> lma_region expression allows to specify the memory region for section load address. Should fix [upstream LLVM] PR35684. LLVM review: https://reviews.llvm.org/D41397 Obtained from: LLVM r322359 by George Rimar Modified: head/contrib/llvm/tools/lld/ELF/LinkerScript.cpp head/contrib/llvm/tools/lld/ELF/OutputSections.h head/contrib/llvm/tools/lld/ELF/ScriptParser.cpp Modified: head/contrib/llvm/tools/lld/ELF/LinkerScript.cpp ============================================================================== --- head/contrib/llvm/tools/lld/ELF/LinkerScript.cpp Thu Jan 18 21:35:18 2018 (r328140) +++ head/contrib/llvm/tools/lld/ELF/LinkerScript.cpp Thu Jan 18 21:38:21 2018 (r328141) @@ -667,6 +667,15 @@ void LinkerScript::assignOffsets(OutputSection *Sec) { Ctx->LMAOffset = [=] { return Sec->LMAExpr().getValue() - D; }; } + if (!Sec->LMARegionName.empty()) { + if (MemoryRegion *MR = MemoryRegions.lookup(Sec->LMARegionName)) { + uint64_t Offset = MR->Origin - Dot; + Ctx->LMAOffset = [=] { return Offset; }; + } else { + error("memory region '" + Sec->LMARegionName + "' not declared"); + } + } + switchTo(Sec); // The Size previously denoted how many InputSections had been added to this Modified: head/contrib/llvm/tools/lld/ELF/OutputSections.h ============================================================================== --- head/contrib/llvm/tools/lld/ELF/OutputSections.h Thu Jan 18 21:35:18 2018 (r328140) +++ head/contrib/llvm/tools/lld/ELF/OutputSections.h Thu Jan 18 21:38:21 2018 (r328141) @@ -99,6 +99,7 @@ class OutputSection final : public BaseCommand, public ConstraintKind Constraint = ConstraintKind::NoConstraint; std::string Location; std::string MemoryRegionName; + std::string LMARegionName; bool Noload = false; template void finalize(); Modified: head/contrib/llvm/tools/lld/ELF/ScriptParser.cpp ============================================================================== --- head/contrib/llvm/tools/lld/ELF/ScriptParser.cpp Thu Jan 18 21:35:18 2018 (r328140) +++ head/contrib/llvm/tools/lld/ELF/ScriptParser.cpp Thu Jan 18 21:38:21 2018 (r328141) @@ -709,6 +709,14 @@ OutputSection *ScriptParser::readOutputSectionDescript if (consume(">")) Cmd->MemoryRegionName = next(); + if (consume("AT")) { + expect(">"); + Cmd->LMARegionName = next(); + } + + if (Cmd->LMAExpr && !Cmd->LMARegionName.empty()) + error("section can't have both LMA and a load region"); + Cmd->Phdrs = readOutputSectionPhdrs(); if (consume("=")) From owner-svn-src-head@freebsd.org Thu Jan 18 21:39:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A36EEC4BEE; Thu, 18 Jan 2018 21:39:20 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7597D82C02; Thu, 18 Jan 2018 21:39:20 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B6EF324259; Thu, 18 Jan 2018 21:39:19 +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 w0ILdJFF010827; Thu, 18 Jan 2018 21:39:19 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0ILdJFG010826; Thu, 18 Jan 2018 21:39:19 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201801182139.w0ILdJFG010826@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 18 Jan 2018 21:39:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328143 - head/contrib/llvm/tools/lld/ELF X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/llvm/tools/lld/ELF X-SVN-Commit-Revision: 328143 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 21:39:20 -0000 Author: emaste Date: Thu Jan 18 21:39:19 2018 New Revision: 328143 URL: https://svnweb.freebsd.org/changeset/base/328143 Log: lld: Handle parsing AT(ADDR(.foo-bar)). The problem we had with it is that anything inside an AT is an expression, so we failed to parse the section name because of the - in it. Requested by: royger Obtained from: LLVM r322801 by Rafael Espindola Modified: head/contrib/llvm/tools/lld/ELF/ScriptParser.cpp Modified: head/contrib/llvm/tools/lld/ELF/ScriptParser.cpp ============================================================================== --- head/contrib/llvm/tools/lld/ELF/ScriptParser.cpp Thu Jan 18 21:39:03 2018 (r328142) +++ head/contrib/llvm/tools/lld/ELF/ScriptParser.cpp Thu Jan 18 21:39:19 2018 (r328143) @@ -930,7 +930,10 @@ ByteCommand *ScriptParser::readByteCommand(StringRef T StringRef ScriptParser::readParenLiteral() { expect("("); + bool Orig = InExpr; + InExpr = false; StringRef Tok = next(); + InExpr = Orig; expect(")"); return Tok; } From owner-svn-src-head@freebsd.org Thu Jan 18 21:40:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BCE8EC4CB3; Thu, 18 Jan 2018 21:40:00 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6718E82D6B; Thu, 18 Jan 2018 21:40:00 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A68CB2425A; Thu, 18 Jan 2018 21:39:59 +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 w0ILdx3B010889; Thu, 18 Jan 2018 21:39:59 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0ILdxnf010888; Thu, 18 Jan 2018 21:39:59 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201801182139.w0ILdxnf010888@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 18 Jan 2018 21:39:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328144 - head/contrib/llvm/tools/lld/ELF X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/llvm/tools/lld/ELF X-SVN-Commit-Revision: 328144 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 21:40:00 -0000 Author: emaste Date: Thu Jan 18 21:39:59 2018 New Revision: 328144 URL: https://svnweb.freebsd.org/changeset/base/328144 Log: lld: Fix incorrect physical address on self-referencing AT command. When a section placement (AT) command references the section itself, the physical address of the section in the ELF header was calculated incorrectly due to alignment happening right after the location pointer's value was captured. The problem was diagnosed and the first version of the patch written by Erick Reyes. Obtained from: LLVM r322421 by Rafael Espindola Modified: head/contrib/llvm/tools/lld/ELF/LinkerScript.cpp Modified: head/contrib/llvm/tools/lld/ELF/LinkerScript.cpp ============================================================================== --- head/contrib/llvm/tools/lld/ELF/LinkerScript.cpp Thu Jan 18 21:39:19 2018 (r328143) +++ head/contrib/llvm/tools/lld/ELF/LinkerScript.cpp Thu Jan 18 21:39:59 2018 (r328144) @@ -608,13 +608,6 @@ void LinkerScript::switchTo(OutputSection *Sec) { Ctx->OutSec = Sec; Ctx->OutSec->Addr = advance(0, Ctx->OutSec->Alignment); - - // If neither AT nor AT> is specified for an allocatable section, the linker - // will set the LMA such that the difference between VMA and LMA for the - // section is the same as the preceding output section in the same region - // https://sourceware.org/binutils/docs-2.20/ld/Output-Section-LMA.html - if (Ctx->LMAOffset) - Ctx->OutSec->LMAOffset = Ctx->LMAOffset(); } // This function searches for a memory region to place the given output @@ -662,6 +655,8 @@ void LinkerScript::assignOffsets(OutputSection *Sec) { if (Ctx->MemRegion) Dot = Ctx->MemRegionOffset[Ctx->MemRegion]; + switchTo(Sec); + if (Sec->LMAExpr) { uint64_t D = Dot; Ctx->LMAOffset = [=] { return Sec->LMAExpr().getValue() - D; }; @@ -676,7 +671,12 @@ void LinkerScript::assignOffsets(OutputSection *Sec) { } } - switchTo(Sec); + // If neither AT nor AT> is specified for an allocatable section, the linker + // will set the LMA such that the difference between VMA and LMA for the + // section is the same as the preceding output section in the same region + // https://sourceware.org/binutils/docs-2.20/ld/Output-Section-LMA.html + if (Ctx->LMAOffset) + Ctx->OutSec->LMAOffset = Ctx->LMAOffset(); // The Size previously denoted how many InputSections had been added to this // section, and was used for sorting SHF_LINK_ORDER sections. Reset it to From owner-svn-src-head@freebsd.org Thu Jan 18 21:44:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE13AEC5061; Thu, 18 Jan 2018 21:44:08 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 99752832FC; Thu, 18 Jan 2018 21:44:08 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DA821243F0; Thu, 18 Jan 2018 21:44:07 +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 w0ILi7kt014856; Thu, 18 Jan 2018 21:44:07 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0ILi7VS014855; Thu, 18 Jan 2018 21:44:07 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201801182144.w0ILi7VS014855@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 18 Jan 2018 21:44:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328145 - head/contrib/llvm/lib/Analysis X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/contrib/llvm/lib/Analysis X-SVN-Commit-Revision: 328145 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 21:44:08 -0000 Author: dim Date: Thu Jan 18 21:44:07 2018 New Revision: 328145 URL: https://svnweb.freebsd.org/changeset/base/328145 Log: Pull in r322016 from upstream llvm trunk (by Sanjay Patel): [ValueTracking] remove overzealous assert The test is derived from a failing fuzz test: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5008 Credit to @rksimon for pointing out the problem. This should fix "Bad flavor while matching min/max" errors when building the graphics/libsixel and science/kst2 ports. Reported by: jbeich PR: 225268, 225269 Modified: head/contrib/llvm/lib/Analysis/ValueTracking.cpp Modified: head/contrib/llvm/lib/Analysis/ValueTracking.cpp ============================================================================== --- head/contrib/llvm/lib/Analysis/ValueTracking.cpp Thu Jan 18 21:39:59 2018 (r328144) +++ head/contrib/llvm/lib/Analysis/ValueTracking.cpp Thu Jan 18 21:44:07 2018 (r328145) @@ -4214,7 +4214,7 @@ static SelectPatternResult matchMinMaxOfMinMax(CmpInst break; return {SPF_UNKNOWN, SPNB_NA, false}; default: - llvm_unreachable("Bad flavor while matching min/max"); + return {SPF_UNKNOWN, SPNB_NA, false}; } // a pred c ? m(a, b) : m(c, b) --> m(m(a, b), m(c, b)) From owner-svn-src-head@freebsd.org Thu Jan 18 21:46:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 180DDEC5283; Thu, 18 Jan 2018 21:46:11 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E7DC5834F0; Thu, 18 Jan 2018 21:46:10 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 461ED243FA; Thu, 18 Jan 2018 21:46:10 +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 w0ILkAe7015007; Thu, 18 Jan 2018 21:46:10 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0ILkAsa015006; Thu, 18 Jan 2018 21:46:10 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201801182146.w0ILkAsa015006@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 18 Jan 2018 21:46:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328146 - head/contrib/llvm/lib/Target/X86 X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/contrib/llvm/lib/Target/X86 X-SVN-Commit-Revision: 328146 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 21:46:11 -0000 Author: dim Date: Thu Jan 18 21:46:09 2018 New Revision: 328146 URL: https://svnweb.freebsd.org/changeset/base/328146 Log: Pull in r322106 from upstream llvm trunk (by Alexey Bataev): [COST]Fix PR35865: Fix cost model evaluation for shuffle on X86. Summary: If the vector type is transformed to non-vector single type, the compile may crash trying to get vector information about non-vector type. Reviewers: RKSimon, spatel, mkuper, hfinkel Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D41862 This should fix "Not a vector MVT!" errors when building the games/dhewm3 port. Reported by: jbeich PR: 225271 Modified: head/contrib/llvm/lib/Target/X86/X86TargetTransformInfo.cpp Modified: head/contrib/llvm/lib/Target/X86/X86TargetTransformInfo.cpp ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86TargetTransformInfo.cpp Thu Jan 18 21:44:07 2018 (r328145) +++ head/contrib/llvm/lib/Target/X86/X86TargetTransformInfo.cpp Thu Jan 18 21:46:09 2018 (r328146) @@ -754,7 +754,8 @@ int X86TTIImpl::getShuffleCost(TTI::ShuffleKind Kind, // type remains the same. if (Kind == TTI::SK_PermuteSingleSrc && LT.first != 1) { MVT LegalVT = LT.second; - if (LegalVT.getVectorElementType().getSizeInBits() == + if (LegalVT.isVector() && + LegalVT.getVectorElementType().getSizeInBits() == Tp->getVectorElementType()->getPrimitiveSizeInBits() && LegalVT.getVectorNumElements() < Tp->getVectorNumElements()) { From owner-svn-src-head@freebsd.org Thu Jan 18 22:01:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1DE3EC619F; Thu, 18 Jan 2018 22:01:31 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9CC5B1D6; Thu, 18 Jan 2018 22:01:31 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E59A5245F0; Thu, 18 Jan 2018 22:01:30 +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 w0IM1Ubb023727; Thu, 18 Jan 2018 22:01:30 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0IM1Ubo023725; Thu, 18 Jan 2018 22:01:30 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201801182201.w0IM1Ubo023725@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 18 Jan 2018 22:01:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328150 - in head: sys/crypto/ccp sys/modules sys/modules/ccp tests/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: sys/crypto/ccp sys/modules sys/modules/ccp tests/sys/opencrypto X-SVN-Commit-Revision: 328150 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 22:01:32 -0000 Author: cem Date: Thu Jan 18 22:01:30 2018 New Revision: 328150 URL: https://svnweb.freebsd.org/changeset/base/328150 Log: Add ccp(4): experimental driver for AMD Crypto Co-Processor * Registers TRNG source for random(4) * Finds available queues, LSBs; allocates static objects * Allocates a shared MSI-X for all queues. The hardware does not have separate interrupts per queue. Working interrupt mode driver. * Computes SHA hashes, HMAC. Passes cryptotest.py, cryptocheck tests. * Does AES-CBC, CTR mode, and XTS. cryptotest.py and cryptocheck pass. * Support for "authenc" (AES + HMAC). (SHA1 seems to result in "unaligned" cleartext inputs from cryptocheck -- which the engine cannot handle. SHA2 seems to work fine.) * GCM passes for block-multiple AAD, input lengths Largely based on ccr(4), part of cxgbe(4). Rough performance averages on AMD Ryzen 1950X (4kB buffer): aesni: SHA1: ~8300 Mb/s SHA256: ~8000 Mb/s ccp: ~630 Mb/s SHA256: ~660 Mb/s SHA512: ~700 Mb/s cryptosoft: ~1800 Mb/s SHA256: ~1800 Mb/s SHA512: ~2700 Mb/s As you can see, performance is poor in comparison to aesni(4) and even cryptosoft (due to high setup cost). At a larger buffer size (128kB), throughput is a little better (but still worse than aesni(4)): aesni: SHA1:~10400 Mb/s SHA256: ~9950 Mb/s ccp: ~2200 Mb/s SHA256: ~2600 Mb/s SHA512: ~3800 Mb/s cryptosoft: ~1750 Mb/s SHA256: ~1800 Mb/s SHA512: ~2700 Mb/s AES performance has a similar story: aesni: 4kB: ~11250 Mb/s 128kB: ~11250 Mb/s ccp: ~350 Mb/s 128kB: ~4600 Mb/s cryptosoft: ~1750 Mb/s 128kB: ~1700 Mb/s This driver is EXPERIMENTAL. You should verify cryptographic results on typical and corner case inputs from your application against a known- good implementation. Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12723 Added: head/sys/crypto/ccp/ head/sys/crypto/ccp/ccp.c - copied, changed from r328137, head/sys/dev/cxgbe/crypto/t4_crypto.c head/sys/crypto/ccp/ccp.h (contents, props changed) head/sys/crypto/ccp/ccp_hardware.c - copied, changed from r328137, head/sys/dev/cxgbe/crypto/t4_crypto.c head/sys/crypto/ccp/ccp_hardware.h (contents, props changed) head/sys/crypto/ccp/ccp_lsb.c (contents, props changed) head/sys/crypto/ccp/ccp_lsb.h (contents, props changed) head/sys/modules/ccp/ head/sys/modules/ccp/Makefile (contents, props changed) Modified: head/sys/modules/Makefile head/tests/sys/opencrypto/cryptotest.py Copied and modified: head/sys/crypto/ccp/ccp.c (from r328137, head/sys/dev/cxgbe/crypto/t4_crypto.c) ============================================================================== --- head/sys/dev/cxgbe/crypto/t4_crypto.c Thu Jan 18 21:19:57 2018 (r328137, copy source) +++ head/sys/crypto/ccp/ccp.c Thu Jan 18 22:01:30 2018 (r328150) @@ -1,7 +1,10 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2017 Chelsio Communications, Inc. + * Copyright (c) 2017 Conrad Meyer * All rights reserved. - * Written by: John Baldwin + * Largely borrowed from ccr(4), Written by: John Baldwin * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -28,1330 +31,88 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_ddb.h" + #include #include #include +#include #include #include #include +#include #include +#include +#ifdef DDB +#include +#endif + +#include + +#include + #include #include #include "cryptodev_if.h" -#include "common/common.h" -#include "crypto/t4_crypto.h" +#include "ccp.h" +#include "ccp_hardware.h" -/* - * Requests consist of: - * - * +-------------------------------+ - * | struct fw_crypto_lookaside_wr | - * +-------------------------------+ - * | struct ulp_txpkt | - * +-------------------------------+ - * | struct ulptx_idata | - * +-------------------------------+ - * | struct cpl_tx_sec_pdu | - * +-------------------------------+ - * | struct cpl_tls_tx_scmd_fmt | - * +-------------------------------+ - * | key context header | - * +-------------------------------+ - * | AES key | ----- For requests with AES - * +-------------------------------+ - - * | IPAD (16-byte aligned) | \ - * +-------------------------------+ +---- For requests with HMAC - * | OPAD (16-byte aligned) | / - * +-------------------------------+ - - * | GMAC H | ----- For AES-GCM - * +-------------------------------+ - - * | struct cpl_rx_phys_dsgl | \ - * +-------------------------------+ +---- Destination buffer for - * | PHYS_DSGL entries | / non-hash-only requests - * +-------------------------------+ - - * | 16 dummy bytes | ----- Only for hash-only requests - * +-------------------------------+ - * | IV | ----- If immediate IV - * +-------------------------------+ - * | Payload | ----- If immediate Payload - * +-------------------------------+ - - * | struct ulptx_sgl | \ - * +-------------------------------+ +---- If payload via SGL - * | SGL entries | / - * +-------------------------------+ - - * - * Note that the key context must be padded to ensure 16-byte alignment. - * For HMAC requests, the key consists of the partial hash of the IPAD - * followed by the partial hash of the OPAD. - * - * Replies consist of: - * - * +-------------------------------+ - * | struct cpl_fw6_pld | - * +-------------------------------+ - * | hash digest | ----- For HMAC request with - * +-------------------------------+ 'hash_size' set in work request - * - * A 32-bit big-endian error status word is supplied in the last 4 - * bytes of data[0] in the CPL_FW6_PLD message. bit 0 indicates a - * "MAC" error and bit 1 indicates a "PAD" error. - * - * The 64-bit 'cookie' field from the fw_crypto_lookaside_wr message - * in the request is returned in data[1] of the CPL_FW6_PLD message. - * - * For block cipher replies, the updated IV is supplied in data[2] and - * data[3] of the CPL_FW6_PLD message. - * - * For hash replies where the work request set 'hash_size' to request - * a copy of the hash in the reply, the hash digest is supplied - * immediately following the CPL_FW6_PLD message. - */ +MALLOC_DEFINE(M_CCP, "ccp", "AMD CCP crypto"); /* - * The documentation for CPL_RX_PHYS_DSGL claims a maximum of 32 - * SG entries. + * Need a global softc available for garbage random_source API, which lacks any + * context pointer. It's also handy for debugging. */ -#define MAX_RX_PHYS_DSGL_SGE 32 -#define DSGL_SGE_MAXLEN 65535 +struct ccp_softc *g_ccp_softc; -/* - * The adapter only supports requests with a total input or output - * length of 64k-1 or smaller. Longer requests either result in hung - * requests or incorrect results. - */ -#define MAX_REQUEST_SIZE 65535 +bool g_debug_print = false; +SYSCTL_BOOL(_hw_ccp, OID_AUTO, debug, CTLFLAG_RWTUN, &g_debug_print, 0, + "Set to enable debugging log messages"); -static MALLOC_DEFINE(M_CCR, "ccr", "Chelsio T6 crypto"); - -struct ccr_session_hmac { - struct auth_hash *auth_hash; - int hash_len; - unsigned int partial_digest_len; - unsigned int auth_mode; - unsigned int mk_size; - char ipad[CHCR_HASH_MAX_BLOCK_SIZE_128]; - char opad[CHCR_HASH_MAX_BLOCK_SIZE_128]; +static struct pciid { + uint32_t devid; + const char *desc; +} ccp_ids[] = { + { 0x14561022, "AMD CCP-5a" }, + { 0x14681022, "AMD CCP-5b" }, }; +MODULE_PNP_INFO("W32:vendor/device", pci, ccp, ccp_ids, sizeof(ccp_ids[0]), + nitems(ccp_ids)); -struct ccr_session_gmac { - int hash_len; - char ghash_h[GMAC_BLOCK_LEN]; +static struct random_source random_ccp = { + .rs_ident = "AMD CCP TRNG", + .rs_source = RANDOM_PURE_CCP, + .rs_read = random_ccp_read, }; -struct ccr_session_blkcipher { - unsigned int cipher_mode; - unsigned int key_len; - unsigned int iv_len; - __be32 key_ctx_hdr; - char enckey[CHCR_AES_MAX_KEY_LEN]; - char deckey[CHCR_AES_MAX_KEY_LEN]; -}; - -struct ccr_session { - bool active; - int pending; - enum { HMAC, BLKCIPHER, AUTHENC, GCM } mode; - union { - struct ccr_session_hmac hmac; - struct ccr_session_gmac gmac; - }; - struct ccr_session_blkcipher blkcipher; -}; - -struct ccr_softc { - struct adapter *adapter; - device_t dev; - uint32_t cid; - int tx_channel_id; - struct ccr_session *sessions; - int nsessions; - struct mtx lock; - bool detaching; - struct sge_wrq *txq; - struct sge_rxq *rxq; - - /* - * Pre-allocate S/G lists used when preparing a work request. - * 'sg_crp' contains an sglist describing the entire buffer - * for a 'struct cryptop'. 'sg_ulptx' is used to describe - * the data the engine should DMA as input via ULPTX_SGL. - * 'sg_dsgl' is used to describe the destination that cipher - * text and a tag should be written to. - */ - struct sglist *sg_crp; - struct sglist *sg_ulptx; - struct sglist *sg_dsgl; - - /* Statistics. */ - uint64_t stats_blkcipher_encrypt; - uint64_t stats_blkcipher_decrypt; - uint64_t stats_hmac; - uint64_t stats_authenc_encrypt; - uint64_t stats_authenc_decrypt; - uint64_t stats_gcm_encrypt; - uint64_t stats_gcm_decrypt; - uint64_t stats_wr_nomem; - uint64_t stats_inflight; - uint64_t stats_mac_error; - uint64_t stats_pad_error; - uint64_t stats_bad_session; - uint64_t stats_sglist_error; - uint64_t stats_process_error; -}; - /* - * Crypto requests involve two kind of scatter/gather lists. - * - * Non-hash-only requests require a PHYS_DSGL that describes the - * location to store the results of the encryption or decryption - * operation. This SGL uses a different format (PHYS_DSGL) and should - * exclude the crd_skip bytes at the start of the data as well as - * any AAD or IV. For authenticated encryption requests it should - * cover include the destination of the hash or tag. - * - * The input payload may either be supplied inline as immediate data, - * or via a standard ULP_TX SGL. This SGL should include AAD, - * ciphertext, and the hash or tag for authenticated decryption - * requests. - * - * These scatter/gather lists can describe different subsets of the - * buffer described by the crypto operation. ccr_populate_sglist() - * generates a scatter/gather list that covers the entire crypto - * operation buffer that is then used to construct the other - * scatter/gather lists. + * ccp_populate_sglist() generates a scatter/gather list that covers the entire + * crypto operation buffer. */ static int -ccr_populate_sglist(struct sglist *sg, struct cryptop *crp) +ccp_populate_sglist(struct sglist *sg, struct cryptop *crp) { int error; sglist_reset(sg); if (crp->crp_flags & CRYPTO_F_IMBUF) - error = sglist_append_mbuf(sg, (struct mbuf *)crp->crp_buf); + error = sglist_append_mbuf(sg, crp->crp_mbuf); else if (crp->crp_flags & CRYPTO_F_IOV) - error = sglist_append_uio(sg, (struct uio *)crp->crp_buf); + error = sglist_append_uio(sg, crp->crp_uio); else error = sglist_append(sg, crp->crp_buf, crp->crp_ilen); return (error); } /* - * Segments in 'sg' larger than 'maxsegsize' are counted as multiple - * segments. - */ -static int -ccr_count_sgl(struct sglist *sg, int maxsegsize) -{ - int i, nsegs; - - nsegs = 0; - for (i = 0; i < sg->sg_nseg; i++) - nsegs += howmany(sg->sg_segs[i].ss_len, maxsegsize); - return (nsegs); -} - -/* These functions deal with PHYS_DSGL for the reply buffer. */ -static inline int -ccr_phys_dsgl_len(int nsegs) -{ - int len; - - len = (nsegs / 8) * sizeof(struct phys_sge_pairs); - if ((nsegs % 8) != 0) { - len += sizeof(uint16_t) * 8; - len += roundup2(nsegs % 8, 2) * sizeof(uint64_t); - } - return (len); -} - -static void -ccr_write_phys_dsgl(struct ccr_softc *sc, void *dst, int nsegs) -{ - struct sglist *sg; - struct cpl_rx_phys_dsgl *cpl; - struct phys_sge_pairs *sgl; - vm_paddr_t paddr; - size_t seglen; - u_int i, j; - - sg = sc->sg_dsgl; - cpl = dst; - cpl->op_to_tid = htobe32(V_CPL_RX_PHYS_DSGL_OPCODE(CPL_RX_PHYS_DSGL) | - V_CPL_RX_PHYS_DSGL_ISRDMA(0)); - cpl->pcirlxorder_to_noofsgentr = htobe32( - V_CPL_RX_PHYS_DSGL_PCIRLXORDER(0) | - V_CPL_RX_PHYS_DSGL_PCINOSNOOP(0) | - V_CPL_RX_PHYS_DSGL_PCITPHNTENB(0) | V_CPL_RX_PHYS_DSGL_DCAID(0) | - V_CPL_RX_PHYS_DSGL_NOOFSGENTR(nsegs)); - cpl->rss_hdr_int.opcode = CPL_RX_PHYS_ADDR; - cpl->rss_hdr_int.qid = htobe16(sc->rxq->iq.abs_id); - cpl->rss_hdr_int.hash_val = 0; - sgl = (struct phys_sge_pairs *)(cpl + 1); - j = 0; - for (i = 0; i < sg->sg_nseg; i++) { - seglen = sg->sg_segs[i].ss_len; - paddr = sg->sg_segs[i].ss_paddr; - do { - sgl->addr[j] = htobe64(paddr); - if (seglen > DSGL_SGE_MAXLEN) { - sgl->len[j] = htobe16(DSGL_SGE_MAXLEN); - paddr += DSGL_SGE_MAXLEN; - seglen -= DSGL_SGE_MAXLEN; - } else { - sgl->len[j] = htobe16(seglen); - seglen = 0; - } - j++; - if (j == 8) { - sgl++; - j = 0; - } - } while (seglen != 0); - } - MPASS(j + 8 * (sgl - (struct phys_sge_pairs *)(cpl + 1)) == nsegs); -} - -/* These functions deal with the ULPTX_SGL for input payload. */ -static inline int -ccr_ulptx_sgl_len(int nsegs) -{ - u_int n; - - nsegs--; /* first segment is part of ulptx_sgl */ - n = sizeof(struct ulptx_sgl) + 8 * ((3 * nsegs) / 2 + (nsegs & 1)); - return (roundup2(n, 16)); -} - -static void -ccr_write_ulptx_sgl(struct ccr_softc *sc, void *dst, int nsegs) -{ - struct ulptx_sgl *usgl; - struct sglist *sg; - struct sglist_seg *ss; - int i; - - sg = sc->sg_ulptx; - MPASS(nsegs == sg->sg_nseg); - ss = &sg->sg_segs[0]; - usgl = dst; - usgl->cmd_nsge = htobe32(V_ULPTX_CMD(ULP_TX_SC_DSGL) | - V_ULPTX_NSGE(nsegs)); - usgl->len0 = htobe32(ss->ss_len); - usgl->addr0 = htobe64(ss->ss_paddr); - ss++; - for (i = 0; i < sg->sg_nseg - 1; i++) { - usgl->sge[i / 2].len[i & 1] = htobe32(ss->ss_len); - usgl->sge[i / 2].addr[i & 1] = htobe64(ss->ss_paddr); - ss++; - } - -} - -static bool -ccr_use_imm_data(u_int transhdr_len, u_int input_len) -{ - - if (input_len > CRYPTO_MAX_IMM_TX_PKT_LEN) - return (false); - if (roundup2(transhdr_len, 16) + roundup2(input_len, 16) > - SGE_MAX_WR_LEN) - return (false); - return (true); -} - -static void -ccr_populate_wreq(struct ccr_softc *sc, struct chcr_wr *crwr, u_int kctx_len, - u_int wr_len, uint32_t sid, u_int imm_len, u_int sgl_len, u_int hash_size, - u_int iv_loc, struct cryptop *crp) -{ - u_int cctx_size; - - cctx_size = sizeof(struct _key_ctx) + kctx_len; - crwr->wreq.op_to_cctx_size = htobe32( - V_FW_CRYPTO_LOOKASIDE_WR_OPCODE(FW_CRYPTO_LOOKASIDE_WR) | - V_FW_CRYPTO_LOOKASIDE_WR_COMPL(0) | - V_FW_CRYPTO_LOOKASIDE_WR_IMM_LEN(imm_len) | - V_FW_CRYPTO_LOOKASIDE_WR_CCTX_LOC(1) | - V_FW_CRYPTO_LOOKASIDE_WR_CCTX_SIZE(cctx_size >> 4)); - crwr->wreq.len16_pkd = htobe32( - V_FW_CRYPTO_LOOKASIDE_WR_LEN16(wr_len / 16)); - crwr->wreq.session_id = htobe32(sid); - crwr->wreq.rx_chid_to_rx_q_id = htobe32( - V_FW_CRYPTO_LOOKASIDE_WR_RX_CHID(sc->tx_channel_id) | - V_FW_CRYPTO_LOOKASIDE_WR_LCB(0) | - V_FW_CRYPTO_LOOKASIDE_WR_PHASH(0) | - V_FW_CRYPTO_LOOKASIDE_WR_IV(iv_loc) | - V_FW_CRYPTO_LOOKASIDE_WR_FQIDX(0) | - V_FW_CRYPTO_LOOKASIDE_WR_TX_CH(0) | - V_FW_CRYPTO_LOOKASIDE_WR_RX_Q_ID(sc->rxq->iq.abs_id)); - crwr->wreq.key_addr = 0; - crwr->wreq.pld_size_hash_size = htobe32( - V_FW_CRYPTO_LOOKASIDE_WR_PLD_SIZE(sgl_len) | - V_FW_CRYPTO_LOOKASIDE_WR_HASH_SIZE(hash_size)); - crwr->wreq.cookie = htobe64((uintptr_t)crp); - - crwr->ulptx.cmd_dest = htobe32(V_ULPTX_CMD(ULP_TX_PKT) | - V_ULP_TXPKT_DATAMODIFY(0) | - V_ULP_TXPKT_CHANNELID(sc->tx_channel_id) | V_ULP_TXPKT_DEST(0) | - V_ULP_TXPKT_FID(0) | V_ULP_TXPKT_RO(1)); - crwr->ulptx.len = htobe32( - ((wr_len - sizeof(struct fw_crypto_lookaside_wr)) / 16)); - - crwr->sc_imm.cmd_more = htobe32(V_ULPTX_CMD(ULP_TX_SC_IMM) | - V_ULP_TX_SC_MORE(imm_len != 0 ? 0 : 1)); - crwr->sc_imm.len = htobe32(wr_len - offsetof(struct chcr_wr, sec_cpl) - - sgl_len); -} - -static int -ccr_hmac(struct ccr_softc *sc, uint32_t sid, struct ccr_session *s, - struct cryptop *crp) -{ - struct chcr_wr *crwr; - struct wrqe *wr; - struct auth_hash *axf; - struct cryptodesc *crd; - char *dst; - u_int hash_size_in_response, kctx_flits, kctx_len, transhdr_len, wr_len; - u_int imm_len, iopad_size; - int error, sgl_nsegs, sgl_len; - - crd = crp->crp_desc; - - /* Reject requests with too large of an input buffer. */ - if (crd->crd_len > MAX_REQUEST_SIZE) - return (EFBIG); - - axf = s->hmac.auth_hash; - - /* PADs must be 128-bit aligned. */ - iopad_size = roundup2(s->hmac.partial_digest_len, 16); - - /* - * The 'key' part of the context includes the aligned IPAD and - * OPAD. - */ - kctx_len = iopad_size * 2; - hash_size_in_response = axf->hashsize; - transhdr_len = HASH_TRANSHDR_SIZE(kctx_len); - - if (crd->crd_len == 0) { - imm_len = axf->blocksize; - sgl_nsegs = 0; - sgl_len = 0; - } else if (ccr_use_imm_data(transhdr_len, crd->crd_len)) { - imm_len = crd->crd_len; - sgl_nsegs = 0; - sgl_len = 0; - } else { - imm_len = 0; - sglist_reset(sc->sg_ulptx); - error = sglist_append_sglist(sc->sg_ulptx, sc->sg_crp, - crd->crd_skip, crd->crd_len); - if (error) - return (error); - sgl_nsegs = sc->sg_ulptx->sg_nseg; - sgl_len = ccr_ulptx_sgl_len(sgl_nsegs); - } - - wr_len = roundup2(transhdr_len, 16) + roundup2(imm_len, 16) + sgl_len; - wr = alloc_wrqe(wr_len, sc->txq); - if (wr == NULL) { - sc->stats_wr_nomem++; - return (ENOMEM); - } - crwr = wrtod(wr); - memset(crwr, 0, wr_len); - - ccr_populate_wreq(sc, crwr, kctx_len, wr_len, sid, imm_len, sgl_len, - hash_size_in_response, IV_NOP, crp); - - /* XXX: Hardcodes SGE loopback channel of 0. */ - crwr->sec_cpl.op_ivinsrtofst = htobe32( - V_CPL_TX_SEC_PDU_OPCODE(CPL_TX_SEC_PDU) | - V_CPL_TX_SEC_PDU_RXCHID(sc->tx_channel_id) | - V_CPL_TX_SEC_PDU_ACKFOLLOWS(0) | V_CPL_TX_SEC_PDU_ULPTXLPBK(1) | - V_CPL_TX_SEC_PDU_CPLLEN(2) | V_CPL_TX_SEC_PDU_PLACEHOLDER(0) | - V_CPL_TX_SEC_PDU_IVINSRTOFST(0)); - - crwr->sec_cpl.pldlen = htobe32(crd->crd_len == 0 ? axf->blocksize : - crd->crd_len); - - crwr->sec_cpl.cipherstop_lo_authinsert = htobe32( - V_CPL_TX_SEC_PDU_AUTHSTART(1) | V_CPL_TX_SEC_PDU_AUTHSTOP(0)); - - /* These two flits are actually a CPL_TLS_TX_SCMD_FMT. */ - crwr->sec_cpl.seqno_numivs = htobe32( - V_SCMD_SEQ_NO_CTRL(0) | - V_SCMD_PROTO_VERSION(CHCR_SCMD_PROTO_VERSION_GENERIC) | - V_SCMD_CIPH_MODE(CHCR_SCMD_CIPHER_MODE_NOP) | - V_SCMD_AUTH_MODE(s->hmac.auth_mode) | - V_SCMD_HMAC_CTRL(CHCR_SCMD_HMAC_CTRL_NO_TRUNC)); - crwr->sec_cpl.ivgen_hdrlen = htobe32( - V_SCMD_LAST_FRAG(0) | - V_SCMD_MORE_FRAGS(crd->crd_len == 0 ? 1 : 0) | V_SCMD_MAC_ONLY(1)); - - memcpy(crwr->key_ctx.key, s->hmac.ipad, s->hmac.partial_digest_len); - memcpy(crwr->key_ctx.key + iopad_size, s->hmac.opad, - s->hmac.partial_digest_len); - - /* XXX: F_KEY_CONTEXT_SALT_PRESENT set, but 'salt' not set. */ - kctx_flits = (sizeof(struct _key_ctx) + kctx_len) / 16; - crwr->key_ctx.ctx_hdr = htobe32(V_KEY_CONTEXT_CTX_LEN(kctx_flits) | - V_KEY_CONTEXT_OPAD_PRESENT(1) | V_KEY_CONTEXT_SALT_PRESENT(1) | - V_KEY_CONTEXT_CK_SIZE(CHCR_KEYCTX_NO_KEY) | - V_KEY_CONTEXT_MK_SIZE(s->hmac.mk_size) | V_KEY_CONTEXT_VALID(1)); - - dst = (char *)(crwr + 1) + kctx_len + DUMMY_BYTES; - if (crd->crd_len == 0) { - dst[0] = 0x80; - *(uint64_t *)(dst + axf->blocksize - sizeof(uint64_t)) = - htobe64(axf->blocksize << 3); - } else if (imm_len != 0) - crypto_copydata(crp->crp_flags, crp->crp_buf, crd->crd_skip, - crd->crd_len, dst); - else - ccr_write_ulptx_sgl(sc, dst, sgl_nsegs); - - /* XXX: TODO backpressure */ - t4_wrq_tx(sc->adapter, wr); - - return (0); -} - -static int -ccr_hmac_done(struct ccr_softc *sc, struct ccr_session *s, struct cryptop *crp, - const struct cpl_fw6_pld *cpl, int error) -{ - struct cryptodesc *crd; - - crd = crp->crp_desc; - if (error == 0) { - crypto_copyback(crp->crp_flags, crp->crp_buf, crd->crd_inject, - s->hmac.hash_len, (c_caddr_t)(cpl + 1)); - } - - return (error); -} - -static int -ccr_blkcipher(struct ccr_softc *sc, uint32_t sid, struct ccr_session *s, - struct cryptop *crp) -{ - char iv[CHCR_MAX_CRYPTO_IV_LEN]; - struct chcr_wr *crwr; - struct wrqe *wr; - struct cryptodesc *crd; - char *dst; - u_int iv_loc, kctx_len, key_half, op_type, transhdr_len, wr_len; - u_int imm_len; - int dsgl_nsegs, dsgl_len; - int sgl_nsegs, sgl_len; - int error; - - crd = crp->crp_desc; - - if (s->blkcipher.key_len == 0 || crd->crd_len == 0) - return (EINVAL); - if (crd->crd_alg == CRYPTO_AES_CBC && - (crd->crd_len % AES_BLOCK_LEN) != 0) - return (EINVAL); - - /* Reject requests with too large of an input buffer. */ - if (crd->crd_len > MAX_REQUEST_SIZE) - return (EFBIG); - - iv_loc = IV_NOP; - if (crd->crd_flags & CRD_F_ENCRYPT) { - op_type = CHCR_ENCRYPT_OP; - if (crd->crd_flags & CRD_F_IV_EXPLICIT) - memcpy(iv, crd->crd_iv, s->blkcipher.iv_len); - else - arc4rand(iv, s->blkcipher.iv_len, 0); - iv_loc = IV_IMMEDIATE; - if ((crd->crd_flags & CRD_F_IV_PRESENT) == 0) - crypto_copyback(crp->crp_flags, crp->crp_buf, - crd->crd_inject, s->blkcipher.iv_len, iv); - } else { - op_type = CHCR_DECRYPT_OP; - if (crd->crd_flags & CRD_F_IV_EXPLICIT) { - memcpy(iv, crd->crd_iv, s->blkcipher.iv_len); - iv_loc = IV_IMMEDIATE; - } else - iv_loc = IV_DSGL; - } - - sglist_reset(sc->sg_dsgl); - error = sglist_append_sglist(sc->sg_dsgl, sc->sg_crp, crd->crd_skip, - crd->crd_len); - if (error) - return (error); - dsgl_nsegs = ccr_count_sgl(sc->sg_dsgl, DSGL_SGE_MAXLEN); - if (dsgl_nsegs > MAX_RX_PHYS_DSGL_SGE) - return (EFBIG); - dsgl_len = ccr_phys_dsgl_len(dsgl_nsegs); - - /* The 'key' must be 128-bit aligned. */ - kctx_len = roundup2(s->blkcipher.key_len, 16); - transhdr_len = CIPHER_TRANSHDR_SIZE(kctx_len, dsgl_len); - - if (ccr_use_imm_data(transhdr_len, crd->crd_len + - s->blkcipher.iv_len)) { - imm_len = crd->crd_len; - if (iv_loc == IV_DSGL) { - crypto_copydata(crp->crp_flags, crp->crp_buf, - crd->crd_inject, s->blkcipher.iv_len, iv); - iv_loc = IV_IMMEDIATE; - } - sgl_nsegs = 0; - sgl_len = 0; - } else { - imm_len = 0; - sglist_reset(sc->sg_ulptx); - if (iv_loc == IV_DSGL) { - error = sglist_append_sglist(sc->sg_ulptx, sc->sg_crp, - crd->crd_inject, s->blkcipher.iv_len); - if (error) - return (error); - } - error = sglist_append_sglist(sc->sg_ulptx, sc->sg_crp, - crd->crd_skip, crd->crd_len); - if (error) - return (error); - sgl_nsegs = sc->sg_ulptx->sg_nseg; - sgl_len = ccr_ulptx_sgl_len(sgl_nsegs); - } - - wr_len = roundup2(transhdr_len, 16) + roundup2(imm_len, 16) + sgl_len; - if (iv_loc == IV_IMMEDIATE) - wr_len += s->blkcipher.iv_len; - wr = alloc_wrqe(wr_len, sc->txq); - if (wr == NULL) { - sc->stats_wr_nomem++; - return (ENOMEM); - } - crwr = wrtod(wr); - memset(crwr, 0, wr_len); - - ccr_populate_wreq(sc, crwr, kctx_len, wr_len, sid, imm_len, sgl_len, 0, - iv_loc, crp); - - /* XXX: Hardcodes SGE loopback channel of 0. */ - crwr->sec_cpl.op_ivinsrtofst = htobe32( - V_CPL_TX_SEC_PDU_OPCODE(CPL_TX_SEC_PDU) | - V_CPL_TX_SEC_PDU_RXCHID(sc->tx_channel_id) | - V_CPL_TX_SEC_PDU_ACKFOLLOWS(0) | V_CPL_TX_SEC_PDU_ULPTXLPBK(1) | - V_CPL_TX_SEC_PDU_CPLLEN(2) | V_CPL_TX_SEC_PDU_PLACEHOLDER(0) | - V_CPL_TX_SEC_PDU_IVINSRTOFST(1)); - - crwr->sec_cpl.pldlen = htobe32(s->blkcipher.iv_len + crd->crd_len); - - crwr->sec_cpl.aadstart_cipherstop_hi = htobe32( - V_CPL_TX_SEC_PDU_CIPHERSTART(s->blkcipher.iv_len + 1) | - V_CPL_TX_SEC_PDU_CIPHERSTOP_HI(0)); - crwr->sec_cpl.cipherstop_lo_authinsert = htobe32( - V_CPL_TX_SEC_PDU_CIPHERSTOP_LO(0)); - - /* These two flits are actually a CPL_TLS_TX_SCMD_FMT. */ - crwr->sec_cpl.seqno_numivs = htobe32( - V_SCMD_SEQ_NO_CTRL(0) | - V_SCMD_PROTO_VERSION(CHCR_SCMD_PROTO_VERSION_GENERIC) | - V_SCMD_ENC_DEC_CTRL(op_type) | - V_SCMD_CIPH_MODE(s->blkcipher.cipher_mode) | - V_SCMD_AUTH_MODE(CHCR_SCMD_AUTH_MODE_NOP) | - V_SCMD_HMAC_CTRL(CHCR_SCMD_HMAC_CTRL_NOP) | - V_SCMD_IV_SIZE(s->blkcipher.iv_len / 2) | - V_SCMD_NUM_IVS(0)); - crwr->sec_cpl.ivgen_hdrlen = htobe32( - V_SCMD_IV_GEN_CTRL(0) | - V_SCMD_MORE_FRAGS(0) | V_SCMD_LAST_FRAG(0) | V_SCMD_MAC_ONLY(0) | - V_SCMD_AADIVDROP(1) | V_SCMD_HDR_LEN(dsgl_len)); - - crwr->key_ctx.ctx_hdr = s->blkcipher.key_ctx_hdr; - switch (crd->crd_alg) { - case CRYPTO_AES_CBC: - if (crd->crd_flags & CRD_F_ENCRYPT) - memcpy(crwr->key_ctx.key, s->blkcipher.enckey, - s->blkcipher.key_len); - else - memcpy(crwr->key_ctx.key, s->blkcipher.deckey, - s->blkcipher.key_len); - break; - case CRYPTO_AES_ICM: - memcpy(crwr->key_ctx.key, s->blkcipher.enckey, - s->blkcipher.key_len); - break; - case CRYPTO_AES_XTS: - key_half = s->blkcipher.key_len / 2; - memcpy(crwr->key_ctx.key, s->blkcipher.enckey + key_half, - key_half); - if (crd->crd_flags & CRD_F_ENCRYPT) - memcpy(crwr->key_ctx.key + key_half, - s->blkcipher.enckey, key_half); - else - memcpy(crwr->key_ctx.key + key_half, - s->blkcipher.deckey, key_half); - break; - } - - dst = (char *)(crwr + 1) + kctx_len; - ccr_write_phys_dsgl(sc, dst, dsgl_nsegs); - dst += sizeof(struct cpl_rx_phys_dsgl) + dsgl_len; - if (iv_loc == IV_IMMEDIATE) { - memcpy(dst, iv, s->blkcipher.iv_len); - dst += s->blkcipher.iv_len; - } - if (imm_len != 0) - crypto_copydata(crp->crp_flags, crp->crp_buf, crd->crd_skip, - crd->crd_len, dst); - else - ccr_write_ulptx_sgl(sc, dst, sgl_nsegs); - - /* XXX: TODO backpressure */ - t4_wrq_tx(sc->adapter, wr); - - return (0); -} - -static int -ccr_blkcipher_done(struct ccr_softc *sc, struct ccr_session *s, - struct cryptop *crp, const struct cpl_fw6_pld *cpl, int error) -{ - - /* - * The updated IV to permit chained requests is at - * cpl->data[2], but OCF doesn't permit chained requests. - */ - return (error); -} - -/* - * 'hashsize' is the length of a full digest. 'authsize' is the - * requested digest length for this operation which may be less - * than 'hashsize'. - */ -static int -ccr_hmac_ctrl(unsigned int hashsize, unsigned int authsize) -{ - - if (authsize == 10) - return (CHCR_SCMD_HMAC_CTRL_TRUNC_RFC4366); - if (authsize == 12) - return (CHCR_SCMD_HMAC_CTRL_IPSEC_96BIT); - if (authsize == hashsize / 2) - return (CHCR_SCMD_HMAC_CTRL_DIV2); - return (CHCR_SCMD_HMAC_CTRL_NO_TRUNC); -} - -static int -ccr_authenc(struct ccr_softc *sc, uint32_t sid, struct ccr_session *s, - struct cryptop *crp, struct cryptodesc *crda, struct cryptodesc *crde) -{ - char iv[CHCR_MAX_CRYPTO_IV_LEN]; - struct chcr_wr *crwr; - struct wrqe *wr; - struct auth_hash *axf; - char *dst; - u_int iv_loc, kctx_len, key_half, op_type, transhdr_len, wr_len; - u_int hash_size_in_response, imm_len, iopad_size; - u_int aad_start, aad_len, aad_stop; - u_int auth_start, auth_stop, auth_insert; - u_int cipher_start, cipher_stop; - u_int hmac_ctrl, input_len; - int dsgl_nsegs, dsgl_len; - int sgl_nsegs, sgl_len; - int error; - - /* - * If there is a need in the future, requests with an empty - * payload could be supported as HMAC-only requests. - */ - if (s->blkcipher.key_len == 0 || crde->crd_len == 0) - return (EINVAL); - if (crde->crd_alg == CRYPTO_AES_CBC && - (crde->crd_len % AES_BLOCK_LEN) != 0) - return (EINVAL); - - /* - * AAD is only permitted before the cipher/plain text, not - * after. - */ - if (crda->crd_len + crda->crd_skip > crde->crd_len + crde->crd_skip) - return (EINVAL); - - axf = s->hmac.auth_hash; - hash_size_in_response = s->hmac.hash_len; - - /* - * The IV is always stored at the start of the buffer even - * though it may be duplicated in the payload. The crypto - * engine doesn't work properly if the IV offset points inside - * of the AAD region, so a second copy is always required. - */ - iv_loc = IV_IMMEDIATE; - if (crde->crd_flags & CRD_F_ENCRYPT) { - op_type = CHCR_ENCRYPT_OP; - if (crde->crd_flags & CRD_F_IV_EXPLICIT) - memcpy(iv, crde->crd_iv, s->blkcipher.iv_len); - else - arc4rand(iv, s->blkcipher.iv_len, 0); - if ((crde->crd_flags & CRD_F_IV_PRESENT) == 0) - crypto_copyback(crp->crp_flags, crp->crp_buf, - crde->crd_inject, s->blkcipher.iv_len, iv); - } else { - op_type = CHCR_DECRYPT_OP; - if (crde->crd_flags & CRD_F_IV_EXPLICIT) - memcpy(iv, crde->crd_iv, s->blkcipher.iv_len); - else - crypto_copydata(crp->crp_flags, crp->crp_buf, - crde->crd_inject, s->blkcipher.iv_len, iv); - } - - /* - * The output buffer consists of the cipher text followed by - * the hash when encrypting. For decryption it only contains - * the plain text. - */ - if (op_type == CHCR_ENCRYPT_OP) { - if (crde->crd_len + hash_size_in_response > MAX_REQUEST_SIZE) - return (EFBIG); - } else { - if (crde->crd_len > MAX_REQUEST_SIZE) - return (EFBIG); - } - sglist_reset(sc->sg_dsgl); - error = sglist_append_sglist(sc->sg_dsgl, sc->sg_crp, crde->crd_skip, - crde->crd_len); - if (error) - return (error); - if (op_type == CHCR_ENCRYPT_OP) { - error = sglist_append_sglist(sc->sg_dsgl, sc->sg_crp, - crda->crd_inject, hash_size_in_response); - if (error) - return (error); - } - dsgl_nsegs = ccr_count_sgl(sc->sg_dsgl, DSGL_SGE_MAXLEN); - if (dsgl_nsegs > MAX_RX_PHYS_DSGL_SGE) - return (EFBIG); - dsgl_len = ccr_phys_dsgl_len(dsgl_nsegs); - - /* PADs must be 128-bit aligned. */ - iopad_size = roundup2(s->hmac.partial_digest_len, 16); - - /* - * The 'key' part of the key context consists of the key followed - * by the IPAD and OPAD. - */ - kctx_len = roundup2(s->blkcipher.key_len, 16) + iopad_size * 2; - transhdr_len = CIPHER_TRANSHDR_SIZE(kctx_len, dsgl_len); - - /* - * The input buffer consists of the IV, any AAD, and then the - * cipher/plain text. For decryption requests the hash is - * appended after the cipher text. - */ - if (crda->crd_skip < crde->crd_skip) { - if (crda->crd_skip + crda->crd_len > crde->crd_skip) - aad_len = (crde->crd_skip - crda->crd_skip); - else - aad_len = crda->crd_len; - } else - aad_len = 0; - input_len = aad_len + crde->crd_len; - - /* - * The firmware hangs if sent a request which is a - * bit smaller than MAX_REQUEST_SIZE. In particular, the - * firmware appears to require 512 - 16 bytes of spare room - * along with the size of the hash even if the hash isn't - * included in the input buffer. - */ - if (input_len + roundup2(axf->hashsize, 16) + (512 - 16) > - MAX_REQUEST_SIZE) - return (EFBIG); - if (op_type == CHCR_DECRYPT_OP) - input_len += hash_size_in_response; - if (ccr_use_imm_data(transhdr_len, s->blkcipher.iv_len + input_len)) { - imm_len = input_len; - sgl_nsegs = 0; - sgl_len = 0; - } else { - imm_len = 0; - sglist_reset(sc->sg_ulptx); - if (aad_len != 0) { - error = sglist_append_sglist(sc->sg_ulptx, sc->sg_crp, - crda->crd_skip, aad_len); - if (error) - return (error); - } - error = sglist_append_sglist(sc->sg_ulptx, sc->sg_crp, - crde->crd_skip, crde->crd_len); - if (error) - return (error); - if (op_type == CHCR_DECRYPT_OP) { - error = sglist_append_sglist(sc->sg_ulptx, sc->sg_crp, - crda->crd_inject, hash_size_in_response); - if (error) - return (error); - } - sgl_nsegs = sc->sg_ulptx->sg_nseg; - sgl_len = ccr_ulptx_sgl_len(sgl_nsegs); - } - - /* - * Any auth-only data before the cipher region is marked as AAD. - * Auth-data that overlaps with the cipher region is placed in - * the auth section. - */ - if (aad_len != 0) { - aad_start = s->blkcipher.iv_len + 1; - aad_stop = aad_start + aad_len - 1; - } else { - aad_start = 0; - aad_stop = 0; - } - cipher_start = s->blkcipher.iv_len + aad_len + 1; - if (op_type == CHCR_DECRYPT_OP) - cipher_stop = hash_size_in_response; - else - cipher_stop = 0; - if (aad_len == crda->crd_len) { - auth_start = 0; - auth_stop = 0; - } else { - if (aad_len != 0) - auth_start = cipher_start; - else - auth_start = s->blkcipher.iv_len + crda->crd_skip - - crde->crd_skip + 1; - auth_stop = (crde->crd_skip + crde->crd_len) - - (crda->crd_skip + crda->crd_len) + cipher_stop; - } - if (op_type == CHCR_DECRYPT_OP) - auth_insert = hash_size_in_response; - else - auth_insert = 0; - - wr_len = roundup2(transhdr_len, 16) + roundup2(imm_len, 16) + sgl_len; - if (iv_loc == IV_IMMEDIATE) - wr_len += s->blkcipher.iv_len; - wr = alloc_wrqe(wr_len, sc->txq); - if (wr == NULL) { - sc->stats_wr_nomem++; - return (ENOMEM); - } - crwr = wrtod(wr); - memset(crwr, 0, wr_len); - - ccr_populate_wreq(sc, crwr, kctx_len, wr_len, sid, imm_len, sgl_len, - op_type == CHCR_DECRYPT_OP ? hash_size_in_response : 0, iv_loc, - crp); - - /* XXX: Hardcodes SGE loopback channel of 0. */ - crwr->sec_cpl.op_ivinsrtofst = htobe32( - V_CPL_TX_SEC_PDU_OPCODE(CPL_TX_SEC_PDU) | - V_CPL_TX_SEC_PDU_RXCHID(sc->tx_channel_id) | - V_CPL_TX_SEC_PDU_ACKFOLLOWS(0) | V_CPL_TX_SEC_PDU_ULPTXLPBK(1) | - V_CPL_TX_SEC_PDU_CPLLEN(2) | V_CPL_TX_SEC_PDU_PLACEHOLDER(0) | - V_CPL_TX_SEC_PDU_IVINSRTOFST(1)); - - crwr->sec_cpl.pldlen = htobe32(s->blkcipher.iv_len + input_len); - - crwr->sec_cpl.aadstart_cipherstop_hi = htobe32( - V_CPL_TX_SEC_PDU_AADSTART(aad_start) | - V_CPL_TX_SEC_PDU_AADSTOP(aad_stop) | - V_CPL_TX_SEC_PDU_CIPHERSTART(cipher_start) | - V_CPL_TX_SEC_PDU_CIPHERSTOP_HI(cipher_stop >> 4)); - crwr->sec_cpl.cipherstop_lo_authinsert = htobe32( - V_CPL_TX_SEC_PDU_CIPHERSTOP_LO(cipher_stop & 0xf) | - V_CPL_TX_SEC_PDU_AUTHSTART(auth_start) | - V_CPL_TX_SEC_PDU_AUTHSTOP(auth_stop) | - V_CPL_TX_SEC_PDU_AUTHINSERT(auth_insert)); - *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Jan 18 22:13:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83A91EC6ACC; Thu, 18 Jan 2018 22:13:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5CB3F108B; Thu, 18 Jan 2018 22:13:54 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E544248D3; Thu, 18 Jan 2018 22:13:53 +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 w0IMDrLH028110; Thu, 18 Jan 2018 22:13:53 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0IMDrZk028109; Thu, 18 Jan 2018 22:13:53 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201801182213.w0IMDrZk028109@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 18 Jan 2018 22:13:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328153 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 328153 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 22:13:54 -0000 Author: jhb Date: Thu Jan 18 22:13:53 2018 New Revision: 328153 URL: https://svnweb.freebsd.org/changeset/base/328153 Log: Remove two no-longer-used labels from the NMI interrupt handler. Reviewed by: kib Modified: head/sys/amd64/amd64/exception.S Modified: head/sys/amd64/amd64/exception.S ============================================================================== --- head/sys/amd64/amd64/exception.S Thu Jan 18 22:13:31 2018 (r328152) +++ head/sys/amd64/amd64/exception.S Thu Jan 18 22:13:53 2018 (r328153) @@ -663,9 +663,8 @@ outofnmi: cli nocallchain: #endif - testl %ebx,%ebx + testl %ebx,%ebx /* %ebx == 0 => return to userland */ jnz doreti_exit -nmi_kernelexit: /* * Put back the preserved MSR_GSBASE value. */ @@ -675,7 +674,6 @@ nmi_kernelexit: shrq $32,%rdx wrmsr movq %r13,%cr3 -nmi_restoreregs: RESTORE_REGS addq $TF_RIP,%rsp jmp doreti_iret From owner-svn-src-head@freebsd.org Thu Jan 18 22:15:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9590EC6BD4; Thu, 18 Jan 2018 22:15:19 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from CAN01-TO1-obe.outbound.protection.outlook.com (mail-eopbgr670077.outbound.protection.outlook.com [40.107.67.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT SSL SHA2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 69B96120D; Thu, 18 Jan 2018 22:15:18 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from YTXPR0101MB2174.CANPRD01.PROD.OUTLOOK.COM (52.132.40.149) by YTXPR0101MB2173.CANPRD01.PROD.OUTLOOK.COM (52.132.40.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.407.7; Thu, 18 Jan 2018 22:15:17 +0000 Received: from YTXPR0101MB2174.CANPRD01.PROD.OUTLOOK.COM ([fe80::b85e:6c21:ea28:5f9d]) by YTXPR0101MB2174.CANPRD01.PROD.OUTLOOK.COM ([fe80::b85e:6c21:ea28:5f9d%13]) with mapi id 15.20.0407.012; Thu, 18 Jan 2018 22:15:17 +0000 From: Rick Macklem To: Emmanuel Vadot , Emmanuel Vadot CC: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r328129 - head/sys/fs/nfsserver Thread-Topic: svn commit: r328129 - head/sys/fs/nfsserver Thread-Index: AQHTkHERZLAcPGgud0iNHWvuSowXEaN5xAOAgABtS1I= Date: Thu, 18 Jan 2018 22:15:16 +0000 Message-ID: References: <201801181528.w0IFSnWm053535@repo.freebsd.org>, <20180118163855.b0a55427709c52d0ec2482c9@bidouilliste.com> In-Reply-To: <20180118163855.b0a55427709c52d0ec2482c9@bidouilliste.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=rmacklem@uoguelph.ca; x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; YTXPR0101MB2173; 7:93H3fnRL2E3JV9CJBXbb0PF6ASXe3PPBa7wbn2hMcIK4L+wm1Uiyw+DpH+ZlZvASceVK6znePm9T9kFehaG4ozIrbAA79W8rHoHnmoPi1X5PrJEQtJGDhJoUetv1XrhsXsng4CI7brQtpmSQbYX+6ZrpASQAodWZxdCVCoU1dXxLey4UGaAFNbBtQLOAiHp4f6xCasua9OqRvso+BR6iNE62wnuPGMDTB6AEa+wZ0G9tyM9M/wE4rOa/3HGa+uGT x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: 38118f6f-ff27-479f-695f-08d55ec0f46e x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(8989060)(5600026)(4604075)(3008032)(2017052603307)(7153060)(7193020); SRVR:YTXPR0101MB2173; x-ms-traffictypediagnostic: YTXPR0101MB2173: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(56005881305849)(158342451672863); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(10201501046)(93006095)(93001095)(3231023)(2400067)(944501161)(3002001)(6041268)(20161123560045)(201703131423095)(201702281529075)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123562045)(6072148)(201708071742011); SRVR:YTXPR0101MB2173; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:YTXPR0101MB2173; x-forefront-prvs: 05568D1FF7 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(396003)(376002)(366004)(39380400002)(39860400002)(189003)(199004)(8676002)(86362001)(81156014)(99286004)(68736007)(110136005)(8936002)(97736004)(105586002)(3280700002)(53936002)(2950100002)(106356001)(2906002)(25786009)(81166006)(6436002)(76176011)(74482002)(33656002)(786003)(316002)(5660300001)(4326008)(55016002)(478600001)(6506007)(305945005)(59450400001)(229853002)(5250100002)(102836004)(74316002)(14454004)(7696005)(54906003)(9686003)(6246003)(966005)(26005)(6306002)(2900100001)(3660700001); DIR:OUT; SFP:1101; SCL:1; SRVR:YTXPR0101MB2173; H:YTXPR0101MB2174.CANPRD01.PROD.OUTLOOK.COM; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: uoguelph.ca does not designate permitted sender hosts) x-microsoft-antispam-message-info: 3XjKnMVhJ5kWfhlCegswUeIjrOMoJ0BuuVvISxjajxFwWZGvo7+cWY+mDmqV8uj91l473/Y8dQl3PiDqIr55hQ== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: uoguelph.ca X-MS-Exchange-CrossTenant-Network-Message-Id: 38118f6f-ff27-479f-695f-08d55ec0f46e X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Jan 2018 22:15:17.0089 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d X-MS-Exchange-Transport-CrossTenantHeadersStamped: YTXPR0101MB2173 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 22:15:19 -0000 Emmanuel Vadot wrote: >> Author: manu >> Date: Thu Jan 18 15:28:49 2018 >> New Revision: 328129 >> URL: https://svnweb.freebsd.org/changeset/base/328129 >> >> Log: >> nfs: Do not printf each time a lock structure is freed during module u= nload >> >> There can be a lot of those structures and printing a line each time w= e free >> one on module unload. > > Finishing the sentence : > > There can be a lot of those structures and printing a line each time >we free one on module unload is really time consuming, especially when >you have a serial console plugged in. I will note that when I put a printf() like this in the code, it is becaus= e I consider it an abnormal occurrence. It might be better to at least print the message once. For this case, normally all lock structures should go away when clients unmount and unloading the nfsd module while there are active mounts is not a safe practice. (Again NFSv4 isn't like NFSv3, there is server stat= e for NFSv4.) rick From owner-svn-src-head@freebsd.org Thu Jan 18 22:20:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CDFCEC6E80; Thu, 18 Jan 2018 22:20:32 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EB52E14EF; Thu, 18 Jan 2018 22:20:31 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 20814248D7; Thu, 18 Jan 2018 22:20:31 +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 w0IMKUWZ028382; Thu, 18 Jan 2018 22:20:30 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0IMKUsa028381; Thu, 18 Jan 2018 22:20:30 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201801182220.w0IMKUsa028381@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 18 Jan 2018 22:20:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328154 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 328154 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 22:20:32 -0000 Author: imp Date: Thu Jan 18 22:20:30 2018 New Revision: 328154 URL: https://svnweb.freebsd.org/changeset/base/328154 Log: Make igor happier with this file: o Don't use contractions. o Add common after e.g. where needed Modified: head/share/man/man9/style.9 Modified: head/share/man/man9/style.9 ============================================================================== --- head/share/man/man9/style.9 Thu Jan 18 22:13:53 2018 (r328153) +++ head/share/man/man9/style.9 Thu Jan 18 22:20:30 2018 (r328154) @@ -26,7 +26,7 @@ .\" From: @(#)style 1.14 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd November 16, 2017 +.Dd January 18, 2018 .Dt STYLE 9 .Os .Sh NAME @@ -365,7 +365,7 @@ struct foo { struct foo *next; /* List of active foo. */ struct mumble amumble; /* Comment for mumble. */ int bar; /* Try to align the comments. */ - struct verylongtypename *baz; /* Won't fit in 2 tabs. */ + struct verylongtypename *baz; /* Does not fit in 2 tabs. */ }; struct foo *foohead; /* Head of global foo list. */ .Ed @@ -382,7 +382,7 @@ struct foo { LIST_ENTRY(foo) link; /* Use queue macros for foo lists. */ struct mumble amumble; /* Comment for mumble. */ int bar; /* Try to align the comments. */ - struct verylongtypename *baz; /* Won't fit in 2 tabs. */ + struct verylongtypename *baz; /* Does not fit in 2 tabs. */ }; LIST_HEAD(, foo) foohead; /* Head of global foo list. */ .Ed @@ -431,7 +431,7 @@ alphabetical unless there is a compelling reason to us ordering. .Pp Functions that are used locally in more than one module go into a -separate header file, e.g.\& +separate header file, e.g.,\& .Qq Pa extern.h . .Pp Do not use the @@ -512,7 +512,7 @@ Code which is unreachable for non-obvious reasons may .Bd -literal while ((ch = getopt(argc, argv, "abNn:")) != -1) switch (ch) { /* Indent the switch. */ - case 'a': /* Don't indent the case. */ + case 'a': /* Do not indent the case. */ aflag = 1; /* Indent case body one tab. */ /* FALLTHROUGH */ case 'b': @@ -726,7 +726,7 @@ not: .Pp Do not use .Ic \&! -for tests unless it is a boolean, e.g.\& use: +for tests unless it is a boolean, e.g.,\& use: .Bd -literal if (*p == '\e0') .Ed @@ -763,7 +763,7 @@ Old-style function declarations look like this: .Bd -literal static char * function(a1, a2, fl, a4) - int a1, a2; /* Declare ints, too, don't default them. */ + int a1, a2; /* Declare ints, too, do not default them. */ float fl; /* Beware double vs. float prototype differences. */ int a4; /* List in order declared. */ { From owner-svn-src-head@freebsd.org Thu Jan 18 22:21:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CB30EC6F71; Thu, 18 Jan 2018 22:21:29 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lf0-f42.google.com (mail-lf0-f42.google.com [209.85.215.42]) (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 19C061734; Thu, 18 Jan 2018 22:21:28 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lf0-f42.google.com with SMTP id f3so28654222lfe.4; Thu, 18 Jan 2018 14:21:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=rjcOw+UGpiSxnP61r6uS2/o1O5U9rgAjZjvMDZAc0NU=; b=iZyFNDZRTftv3VfIndv60h9Xrcj9VeBQR024Tu6kBWkEd8xRo2eMgrirN/IfFB3RZ+ 4AzXCPku34hvnj3QzeU0oGdHWow63dKpOO7KWLHOLq7wlRM0uFd4RryPCIFJAJdPyNHa PqQ0Akarz23fxBaX091rnVgjkfmMTxG07WpqyyG/Z0Aiy09mC1xH5GiJ79cV9c8LkRnq q7JQUiAokWZk9iLJSnRxrvAvuURi/shhjheRqQ+WQmrbyLysPw4Ee53R7Soj7+RJ8YRr yTX2CeTjNZSRWenMx30VsGaporzjhxIuWFdLhINalOoCxy9KTv/W8gEixVg1L9iS1TJf blxQ== X-Gm-Message-State: AKwxytdsab53a1Q4BYNBlUUe/DJzzbP7uQBCjmSPT7y691ADxmGViDEc ntRpZoWx2J/1nTaQYQKCe1tzsm4w0Y0= X-Google-Smtp-Source: ACJfBovcwsu2X2eRRkqnLRYXHVbudSaa/VpIti8eDb0YXPhEG2RcHEt8a0CMaNKDlDYpTeIOOt1exA== X-Received: by 10.25.19.220 with SMTP id 89mr16566112lft.57.1516314085710; Thu, 18 Jan 2018 14:21:25 -0800 (PST) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id j189sm1375446lfg.65.2018.01.18.14.21.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jan 2018 14:21:24 -0800 (PST) Subject: Re: svn commit: r327354 - head/sys/vm To: Matt Joras , Warner Losh Cc: "Conrad E. Meyer" , Eric van Gyzen , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201712291905.vBTJ57gI072871@repo.freebsd.org> <20180117224054.GO8113@FreeBSD.org> <601ee1a2-8f4e-518d-4c86-89871cd652af@vangyzen.net> From: Andriy Gapon Message-ID: <517c7c8c-a9a3-b8d4-10c7-81552c61784d@FreeBSD.org> Date: Fri, 19 Jan 2018 00:21:22 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 22:21:29 -0000 On 18/01/2018 23:10, Matt Joras wrote: > "/* Insert an empty line if the function has no local variables. */" And if there is a single silly rule in style(9) then it is this. Waste a line for no possible benefit at all. -- Andriy Gapon From owner-svn-src-head@freebsd.org Thu Jan 18 22:23:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8FB7EC71D3; Thu, 18 Jan 2018 22:23:17 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B27F21B00; Thu, 18 Jan 2018 22:23:17 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EFA2224A64; Thu, 18 Jan 2018 22:23:16 +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 w0IMNGIP032147; Thu, 18 Jan 2018 22:23:16 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0IMNGvu032146; Thu, 18 Jan 2018 22:23:16 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201801182223.w0IMNGvu032146@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 18 Jan 2018 22:23:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328155 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 328155 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 22:23:17 -0000 Author: imp Date: Thu Jan 18 22:23:16 2018 New Revision: 328155 URL: https://svnweb.freebsd.org/changeset/base/328155 Log: No need for the zero width space now that I put the comma in. Modified: head/share/man/man9/style.9 Modified: head/share/man/man9/style.9 ============================================================================== --- head/share/man/man9/style.9 Thu Jan 18 22:20:30 2018 (r328154) +++ head/share/man/man9/style.9 Thu Jan 18 22:23:16 2018 (r328155) @@ -431,7 +431,7 @@ alphabetical unless there is a compelling reason to us ordering. .Pp Functions that are used locally in more than one module go into a -separate header file, e.g.,\& +separate header file, e.g., .Qq Pa extern.h . .Pp Do not use the @@ -726,7 +726,7 @@ not: .Pp Do not use .Ic \&! -for tests unless it is a boolean, e.g.,\& use: +for tests unless it is a boolean, e.g., use: .Bd -literal if (*p == '\e0') .Ed From owner-svn-src-head@freebsd.org Thu Jan 18 22:27:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B716BEC743F; Thu, 18 Jan 2018 22:27:55 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8CF331D9A; Thu, 18 Jan 2018 22:27:55 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id D42C920D58; Thu, 18 Jan 2018 17:27:53 -0500 (EST) Received: from web6 ([10.202.2.216]) by compute5.internal (MEProxy); Thu, 18 Jan 2018 17:27:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=weXCdH Gg8ESYeUqkSGANS14mVFwUg9D5MoXm1BwETf4=; b=DnQz6Yz+M1SvhV/vUmyj1x DIA+u2uAMsFvSvmYt7VIgShpszSwHBfd1nB6zF738dg8uwbyJ7AKNsI/Xh9I9819 4bfCpeVN/arqbb2Ve+oqtGnGxaWUypQCb7kLQayJOejjTn/9STz/n4FlycVO1+Oo /zVWjqJlkR0CEjV3AItClkDqlp4whokE5rAbd910d20c34aihIa8JPG2MG8zXW4z BEV+i6pAPvP3uLU3rN8yeXO99h9M0VNiV/yXs7QyyxYZ4yAmWFMaVJJ3AT2SKesM XQsvRi/BDAuORFSoeMP4c9JmGtfDTKT0FB0OsxLz5RqtXcy013RzfokxFDUUqFKw == X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id B49164154; Thu, 18 Jan 2018 17:27:53 -0500 (EST) Message-Id: <1516314473.3238782.1240377240.040D0B8D@webmail.messagingengine.com> From: Brad Davis To: Steven Hartland Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-75de3051 Subject: Re: svn commit: r328136 - in head/etc: defaults rc.d In-Reply-To: References: <201801182045.w0IKjf44088801@repo.freebsd.org> Date: Thu, 18 Jan 2018 15:27:53 -0700 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 22:27:55 -0000 On Thu, Jan 18, 2018, at 1:54 PM, Steven Hartland wrote: > Did you intend to add the growfs option at the same time as it wasn=E2=80= =99t mentioned in the commit msg=C2=A0 Opps, no, I forgot about that. I had made it years ago, but never got arou= nd to submitting it. Unless anyone has any objections I will leave it. Regards, Brad Davis From owner-svn-src-head@freebsd.org Thu Jan 18 22:46:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74E4BEC81B3; Thu, 18 Jan 2018 22:46:48 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FBFD2A16; Thu, 18 Jan 2018 22:46:48 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 99A1B24D99; Thu, 18 Jan 2018 22:46:47 +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 w0IMkl0c040741; Thu, 18 Jan 2018 22:46:47 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0IMklJw040739; Thu, 18 Jan 2018 22:46:47 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201801182246.w0IMklJw040739@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 18 Jan 2018 22:46:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328156 - in head/stand: arm/uboot efi/loader/arch/arm X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/stand: arm/uboot efi/loader/arch/arm X-SVN-Commit-Revision: 328156 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 22:46:48 -0000 Author: kevans Date: Thu Jan 18 22:46:47 2018 New Revision: 328156 URL: https://svnweb.freebsd.org/changeset/base/328156 Log: stand: Move sections around to fix stand/ build with ld.lld on armv7 When building loader bits, lld fails with the following error: "ld: error: section: .dynamic is not contiguous with other relro sections" on both ubldr and EFI loader. Move .dynamic up to make ld.lld happy, adjust .got as necessary for ubldr. Tested on: OrangePi One (ld.lld, ubldr) Tested on: Banana Pi-M3 (ld.lld, ubldr) Tested on: qemu-armv7 (ld.lld, EFI) Tested on: qemu-armv7 (ld.bfd, EFI) Tested on: Raspberry Pi 2 (ld.bfd, ubldr) [manu] Tested on: Banana Pi-M2 (ld.bfd, ubldr) [manu] Reviewed by: andrew, emaste, imp Differential Revision: https://reviews.freebsd.org/D13942 Modified: head/stand/arm/uboot/ldscript.arm head/stand/efi/loader/arch/arm/ldscript.arm Modified: head/stand/arm/uboot/ldscript.arm ============================================================================== --- head/stand/arm/uboot/ldscript.arm Thu Jan 18 22:23:16 2018 (r328155) +++ head/stand/arm/uboot/ldscript.arm Thu Jan 18 22:46:47 2018 (r328156) @@ -32,6 +32,11 @@ SECTIONS .rela.got : { *(.rela.got) } .rela.got1 : { *(.rela.got1) } .rela.got2 : { *(.rela.got2) } + .dynamic : { *(.dynamic) } + PROVIDE (_GOT_START_ = .); + .got : { *(.got) } + .got.plt : { *(.got.plt) } + PROVIDE (_GOT_END_ = .); .rela.ctors : { *(.rela.ctors) } .rela.dtors : { *(.rela.dtors) } .rela.init : { *(.rela.init) } @@ -58,7 +63,6 @@ SECTIONS } .data1 : { *(.data1) } .got1 : { *(.got1) } - .dynamic : { *(.dynamic) } /* Put .ctors and .dtors next to the .got2 section, so that the pointers get relocated with -mrelocatable. Also put in the .fixup pointers. The current compiler no longer needs this, but keep it around for 2.7.2 */ @@ -74,10 +78,6 @@ SECTIONS .fixup : { *(.fixup) } PROVIDE (_FIXUP_END_ = .); PROVIDE (_GOT2_END_ = .); - PROVIDE (_GOT_START_ = .); - .got : { *(.got) } - .got.plt : { *(.got.plt) } - PROVIDE (_GOT_END_ = .); /* We want the small data sections together, so single-instruction offsets can access them all, and initialized data all before uninitialized, so we can shorten the on-disk segment size. */ Modified: head/stand/efi/loader/arch/arm/ldscript.arm ============================================================================== --- head/stand/efi/loader/arch/arm/ldscript.arm Thu Jan 18 22:23:16 2018 (r328155) +++ head/stand/efi/loader/arch/arm/ldscript.arm Thu Jan 18 22:46:47 2018 (r328156) @@ -35,6 +35,7 @@ SECTIONS . = ALIGN(4); PROVIDE (__bss_end = .); } + .dynamic : { *(.dynamic) } /* We want the small data sections together, so single-instruction offsets can access them all, and initialized data all before uninitialized, so we can shorten the on-disk segment size. */ @@ -54,7 +55,6 @@ SECTIONS } __gp = .; .plt : { *(.plt) } - .dynamic : { *(.dynamic) } .reloc : { *(.reloc) } .dynsym : { *(.dynsym) } .dynstr : { *(.dynstr) } From owner-svn-src-head@freebsd.org Thu Jan 18 23:35:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66707EB3652 for ; Thu, 18 Jan 2018 23:35:31 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EFE50637D5 for ; Thu, 18 Jan 2018 23:35:30 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 3deed409-fca8-11e7-8dac-d32f5c2d02ef X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id 3deed409-fca8-11e7-8dac-d32f5c2d02ef; Thu, 18 Jan 2018 23:35:19 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w0INZEmc009889; Thu, 18 Jan 2018 16:35:14 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1516318514.42536.30.camel@freebsd.org> Subject: Re: svn commit: r327354 - head/sys/vm From: Ian Lepore To: Andriy Gapon , Matt Joras , Warner Losh Cc: "Conrad E. Meyer" , Eric van Gyzen , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 18 Jan 2018 16:35:14 -0700 In-Reply-To: <517c7c8c-a9a3-b8d4-10c7-81552c61784d@FreeBSD.org> References: <201712291905.vBTJ57gI072871@repo.freebsd.org> <20180117224054.GO8113@FreeBSD.org> <601ee1a2-8f4e-518d-4c86-89871cd652af@vangyzen.net> <517c7c8c-a9a3-b8d4-10c7-81552c61784d@FreeBSD.org> Content-Type: text/plain; charset="ASCII" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 23:35:31 -0000 On Fri, 2018-01-19 at 00:21 +0200, Andriy Gapon wrote: > On 18/01/2018 23:10, Matt Joras wrote: > > > > "/* Insert an empty line if the function has no local variables. > > */" > And if there is a single silly rule in style(9) then it is this. > Waste a line for no possible benefit at all. > Especially when you consider how people bitch about empty lines elsewhere in functions. -- Ian From owner-svn-src-head@freebsd.org Thu Jan 18 23:50:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E889DEB42B8; Thu, 18 Jan 2018 23:50:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C46E9680EF; Thu, 18 Jan 2018 23:50:22 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 21BF42573E; Thu, 18 Jan 2018 23:50:22 +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 w0INoLB3065893; Thu, 18 Jan 2018 23:50:21 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0INoLTx065886; Thu, 18 Jan 2018 23:50:21 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201801182350.w0INoLTx065886@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 18 Jan 2018 23:50:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328157 - in head/sys/amd64: amd64 include X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys/amd64: amd64 include X-SVN-Commit-Revision: 328157 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 23:50:23 -0000 Author: jhb Date: Thu Jan 18 23:50:21 2018 New Revision: 328157 URL: https://svnweb.freebsd.org/changeset/base/328157 Log: Use a dedicated per-CPU stack for machine check exceptions. Similar to NMIs, machine check exceptions can fire at any time and are not masked by IF. This means that machine checks can fire when the kstack is too deep to hold a trap frame, or at critical sections in trap handlers when a user %gs is used with a kernel %cs. Use the same strategy used for NMIs of using a dedicated per-CPU stack configured in IST 3. Store the CPU's pcpu pointer at the stop of the stack so that the machine check handler can reliably find the proper value for %gs (also borrowed from NMIs). This should also fix a similar issue with PTI with a MC# occurring while the CPU is executing on the trampoline stack. While here, bypass trap() entirely and just call mca_intr(). This avoids a bogus call to kdb_reenter() (there's no reason to try to reenter kdb if a MC# is raised). Reviewed by: kib Tested by: avg (on AMD without PTI) Differential Revision: https://reviews.freebsd.org/D13962 Modified: head/sys/amd64/amd64/db_trace.c head/sys/amd64/amd64/exception.S head/sys/amd64/amd64/machdep.c head/sys/amd64/amd64/mp_machdep.c head/sys/amd64/amd64/pmap.c head/sys/amd64/amd64/trap.c head/sys/amd64/include/intr_machdep.h Modified: head/sys/amd64/amd64/db_trace.c ============================================================================== --- head/sys/amd64/amd64/db_trace.c Thu Jan 18 22:46:47 2018 (r328156) +++ head/sys/amd64/amd64/db_trace.c Thu Jan 18 23:50:21 2018 (r328157) @@ -200,6 +200,7 @@ db_nextframe(struct amd64_frame **fp, db_addr_t *ip, s if (name != NULL) { if (strcmp(name, "calltrap") == 0 || strcmp(name, "fork_trampoline") == 0 || + strcmp(name, "mchk_calltrap") == 0 || strcmp(name, "nmi_calltrap") == 0 || strcmp(name, "Xdblfault") == 0) frame_type = TRAP; Modified: head/sys/amd64/amd64/exception.S ============================================================================== --- head/sys/amd64/amd64/exception.S Thu Jan 18 22:46:47 2018 (r328156) +++ head/sys/amd64/amd64/exception.S Thu Jan 18 23:50:21 2018 (r328157) @@ -141,7 +141,6 @@ X\l: TRAP ill, T_PRIVINFLT TRAP dna, T_DNA TRAP fpusegm, T_FPOPFLT - TRAP mchk, T_MCHK TRAP rsvd, T_RESERVED TRAP fpu, T_ARITHTRAP TRAP xmm, T_XMMFLT @@ -663,6 +662,103 @@ outofnmi: cli nocallchain: #endif + testl %ebx,%ebx /* %ebx == 0 => return to userland */ + jnz doreti_exit + /* + * Put back the preserved MSR_GSBASE value. + */ + movl $MSR_GSBASE,%ecx + movq %r12,%rdx + movl %edx,%eax + shrq $32,%rdx + wrmsr + movq %r13,%cr3 + RESTORE_REGS + addq $TF_RIP,%rsp + jmp doreti_iret + +/* + * MC# handling is similar to NMI. + * + * As with NMIs, machine check exceptions do not respect RFLAGS.IF and + * can occur at any time with a GS.base value that does not correspond + * to the privilege level in CS. + * + * Machine checks are not unblocked by iretq, but it is best to run + * the handler with interrupts disabled since the exception may have + * interrupted a critical section. + * + * The MC# handler runs on its own stack (tss_ist3). The canonical + * GS.base value for the processor is stored just above the bottom of + * its MC# stack. For exceptions taken from kernel mode, the current + * value in the processor's GS.base is saved at entry to C-preserved + * register %r12, the canonical value for GS.base is then loaded into + * the processor, and the saved value is restored at exit time. For + * exceptions taken from user mode, the cheaper 'SWAPGS' instructions + * are used for swapping GS.base. + */ + +IDTVEC(mchk) + subq $TF_RIP,%rsp + movl $(T_MCHK),TF_TRAPNO(%rsp) + movq $0,TF_ADDR(%rsp) + movq $0,TF_ERR(%rsp) + movq %rdi,TF_RDI(%rsp) + movq %rsi,TF_RSI(%rsp) + movq %rdx,TF_RDX(%rsp) + movq %rcx,TF_RCX(%rsp) + movq %r8,TF_R8(%rsp) + movq %r9,TF_R9(%rsp) + movq %rax,TF_RAX(%rsp) + movq %rbx,TF_RBX(%rsp) + movq %rbp,TF_RBP(%rsp) + movq %r10,TF_R10(%rsp) + movq %r11,TF_R11(%rsp) + movq %r12,TF_R12(%rsp) + movq %r13,TF_R13(%rsp) + movq %r14,TF_R14(%rsp) + movq %r15,TF_R15(%rsp) + SAVE_SEGS + movl $TF_HASSEGS,TF_FLAGS(%rsp) + cld + xorl %ebx,%ebx + testb $SEL_RPL_MASK,TF_CS(%rsp) + jnz mchk_fromuserspace + /* + * We've interrupted the kernel. Preserve GS.base in %r12 + * and %cr3 in %r13. + */ + movl $MSR_GSBASE,%ecx + rdmsr + movq %rax,%r12 + shlq $32,%rdx + orq %rdx,%r12 + /* Retrieve and load the canonical value for GS.base. */ + movq TF_SIZE(%rsp),%rdx + movl %edx,%eax + shrq $32,%rdx + wrmsr + movq %cr3,%r13 + movq PCPU(KCR3),%rax + cmpq $~0,%rax + je mchk_calltrap + movq %rax,%cr3 + jmp mchk_calltrap +mchk_fromuserspace: + incl %ebx + swapgs + movq %cr3,%r13 + movq PCPU(KCR3),%rax + cmpq $~0,%rax + je 1f + movq %rax,%cr3 +1: +/* Note: this label is also used by ddb and gdb: */ +mchk_calltrap: + FAKE_MCOUNT(TF_RIP(%rsp)) + movq %rsp,%rdi + call mca_intr + MEXITCOUNT testl %ebx,%ebx /* %ebx == 0 => return to userland */ jnz doreti_exit /* Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Thu Jan 18 22:46:47 2018 (r328156) +++ head/sys/amd64/amd64/machdep.c Thu Jan 18 23:50:21 2018 (r328157) @@ -662,7 +662,7 @@ static struct gate_descriptor idt0[NIDT]; struct gate_descriptor *idt = &idt0[0]; /* interrupt descriptor table */ static char dblfault_stack[PAGE_SIZE] __aligned(16); - +static char mce0_stack[PAGE_SIZE] __aligned(16); static char nmi0_stack[PAGE_SIZE] __aligned(16); CTASSERT(sizeof(struct nmi_pcpu) == 16); @@ -819,7 +819,7 @@ extern inthand_t IDTVEC(div_pti), IDTVEC(dbg_pti), IDTVEC(bpt_pti), IDTVEC(ofl_pti), IDTVEC(bnd_pti), IDTVEC(ill_pti), IDTVEC(dna_pti), IDTVEC(fpusegm_pti), IDTVEC(tss_pti), IDTVEC(missing_pti), - IDTVEC(stk_pti), IDTVEC(prot_pti), IDTVEC(page_pti), IDTVEC(mchk_pti), + IDTVEC(stk_pti), IDTVEC(prot_pti), IDTVEC(page_pti), IDTVEC(rsvd_pti), IDTVEC(fpu_pti), IDTVEC(align_pti), IDTVEC(xmm_pti), #ifdef KDTRACE_HOOKS @@ -1658,8 +1658,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) SEL_KPL, 0); setidt(IDT_AC, pti ? &IDTVEC(align_pti) : &IDTVEC(align), SDT_SYSIGT, SEL_KPL, 0); - setidt(IDT_MC, pti ? &IDTVEC(mchk_pti) : &IDTVEC(mchk), SDT_SYSIGT, - SEL_KPL, 0); + setidt(IDT_MC, &IDTVEC(mchk), SDT_SYSIGT, SEL_KPL, 3); setidt(IDT_XF, pti ? &IDTVEC(xmm_pti) : &IDTVEC(xmm), SDT_SYSIGT, SEL_KPL, 0); #ifdef KDTRACE_HOOKS @@ -1704,6 +1703,14 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) np->np_pcpu = (register_t) pc; common_tss[0].tss_ist2 = (long) np; + /* + * MC# stack, runs on ist3. The pcpu pointer is stored just + * above the start of the ist3 stack. + */ + np = ((struct nmi_pcpu *) &mce0_stack[sizeof(mce0_stack)]) - 1; + np->np_pcpu = (register_t) pc; + common_tss[0].tss_ist3 = (long) np; + /* Set the IO permission bitmap (empty due to tss seg limit) */ common_tss[0].tss_iobase = sizeof(struct amd64tss) + IOPERM_BITMAP_SIZE; Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Thu Jan 18 22:46:47 2018 (r328156) +++ head/sys/amd64/amd64/mp_machdep.c Thu Jan 18 23:50:21 2018 (r328157) @@ -87,6 +87,7 @@ extern struct pcpu __pcpu[]; /* Temporary variables for init_secondary() */ char *doublefault_stack; +char *mce_stack; char *nmi_stack; /* @@ -212,6 +213,10 @@ init_secondary(void) np = ((struct nmi_pcpu *) &nmi_stack[PAGE_SIZE]) - 1; common_tss[cpu].tss_ist2 = (long) np; + /* The MC# stack runs on IST3. */ + np = ((struct nmi_pcpu *) &mce_stack[PAGE_SIZE]) - 1; + common_tss[cpu].tss_ist3 = (long) np; + /* Prepare private GDT */ gdt_segs[GPROC0_SEL].ssd_base = (long) &common_tss[cpu]; for (x = 0; x < NGDT; x++) { @@ -250,8 +255,13 @@ init_secondary(void) PC_PTI_STACK_SZ * sizeof(uint64_t)) & ~0xful : 0; /* Save the per-cpu pointer for use by the NMI handler. */ + np = ((struct nmi_pcpu *) &nmi_stack[PAGE_SIZE]) - 1; np->np_pcpu = (register_t) pc; + /* Save the per-cpu pointer for use by the MC# handler. */ + np = ((struct nmi_pcpu *) &mce_stack[PAGE_SIZE]) - 1; + np->np_pcpu = (register_t) pc; + wrmsr(MSR_FSBASE, 0); /* User value */ wrmsr(MSR_GSBASE, (u_int64_t)pc); wrmsr(MSR_KGSBASE, (u_int64_t)pc); /* XXX User value while we're in the kernel */ @@ -346,6 +356,8 @@ native_start_all_aps(void) kstack_pages * PAGE_SIZE, M_WAITOK | M_ZERO); doublefault_stack = (char *)kmem_malloc(kernel_arena, PAGE_SIZE, M_WAITOK | M_ZERO); + mce_stack = (char *)kmem_malloc(kernel_arena, PAGE_SIZE, + M_WAITOK | M_ZERO); nmi_stack = (char *)kmem_malloc(kernel_arena, PAGE_SIZE, M_WAITOK | M_ZERO); dpcpu = (void *)kmem_malloc(kernel_arena, DPCPU_SIZE, Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Thu Jan 18 22:46:47 2018 (r328156) +++ head/sys/amd64/amd64/pmap.c Thu Jan 18 23:50:21 2018 (r328157) @@ -7596,6 +7596,9 @@ pmap_pti_init(void) /* NMI stack IST 2 */ va = common_tss[i].tss_ist2 + sizeof(struct nmi_pcpu); pmap_pti_add_kva_locked(va - PAGE_SIZE, va, false); + /* MC# stack IST 3 */ + va = common_tss[i].tss_ist3 + sizeof(struct nmi_pcpu); + pmap_pti_add_kva_locked(va - PAGE_SIZE, va, false); } pmap_pti_add_kva_locked((vm_offset_t)kernphys + KERNBASE, (vm_offset_t)etext, true); Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Thu Jan 18 22:46:47 2018 (r328156) +++ head/sys/amd64/amd64/trap.c Thu Jan 18 23:50:21 2018 (r328157) @@ -220,11 +220,6 @@ trap(struct trapframe *frame) #endif } - if (type == T_MCHK) { - mca_intr(); - return; - } - if ((frame->tf_rflags & PSL_I) == 0) { /* * Buggy application or kernel code has disabled Modified: head/sys/amd64/include/intr_machdep.h ============================================================================== --- head/sys/amd64/include/intr_machdep.h Thu Jan 18 22:46:47 2018 (r328156) +++ head/sys/amd64/include/intr_machdep.h Thu Jan 18 23:50:21 2018 (r328157) @@ -139,7 +139,7 @@ struct trapframe; /* * The following data structure holds per-cpu data, and is placed just - * above the top of the space used for the NMI stack. + * above the top of the space used for the NMI and MC# stacks. */ struct nmi_pcpu { register_t np_pcpu; From owner-svn-src-head@freebsd.org Fri Jan 19 01:36:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CA19EB968B; Fri, 19 Jan 2018 01:36:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DAC206B524; Fri, 19 Jan 2018 01:36:26 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0FC0A268D3; Fri, 19 Jan 2018 01:36:26 +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 w0J1aPKf011388; Fri, 19 Jan 2018 01:36:25 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0J1aPKM011387; Fri, 19 Jan 2018 01:36:25 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201801190136.w0J1aPKM011387@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 19 Jan 2018 01:36:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328158 - head/gnu/usr.bin/gdb/kgdb X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/gnu/usr.bin/gdb/kgdb X-SVN-Commit-Revision: 328158 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 01:36:27 -0000 Author: jhb Date: Fri Jan 19 01:36:25 2018 New Revision: 328158 URL: https://svnweb.freebsd.org/changeset/base/328158 Log: Recognize mchk_calltrap as a trapframe generator. Should have been included in r328157. Modified: head/gnu/usr.bin/gdb/kgdb/trgt_amd64.c Modified: head/gnu/usr.bin/gdb/kgdb/trgt_amd64.c ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/trgt_amd64.c Thu Jan 18 23:50:21 2018 (r328157) +++ head/gnu/usr.bin/gdb/kgdb/trgt_amd64.c Fri Jan 19 01:36:25 2018 (r328158) @@ -189,6 +189,7 @@ kgdb_trgt_trapframe_sniffer(struct frame_info *next_fr if (pname == NULL) return (NULL); if (strcmp(pname, "calltrap") == 0 || + strcmp(pname, "mchk_calltrap") == 0 || strcmp(pname, "nmi_calltrap") == 0 || (pname[0] == 'X' && pname[1] != '_')) return (&kgdb_trgt_trapframe_unwind); From owner-svn-src-head@freebsd.org Fri Jan 19 04:14:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5179AEC0967; Fri, 19 Jan 2018 04:14:41 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id F348570466; Fri, 19 Jan 2018 04:14:39 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 8AB1B1A2EA4; Fri, 19 Jan 2018 15:14:37 +1100 (AEDT) Date: Fri, 19 Jan 2018 15:14:36 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Eric van Gyzen cc: Gleb Smirnoff , Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327354 - head/sys/vm In-Reply-To: <601ee1a2-8f4e-518d-4c86-89871cd652af@vangyzen.net> Message-ID: <20180119131452.W1088@besplex.bde.org> References: <201712291905.vBTJ57gI072871@repo.freebsd.org> <20180117224054.GO8113@FreeBSD.org> <601ee1a2-8f4e-518d-4c86-89871cd652af@vangyzen.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=LKgWeNe9 c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=2I0WkOh0JBamTqr7hv8A:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 04:14:41 -0000 On Thu, 18 Jan 2018, Eric van Gyzen wrote: > On 01/17/2018 16:40, Gleb Smirnoff wrote: >> On Fri, Dec 29, 2017 at 07:05:07PM +0000, Konstantin Belousov wrote: >> K> Author: kib >> K> Date: Fri Dec 29 19:05:07 2017 >> K> New Revision: 327354 >> K> URL: https://svnweb.freebsd.org/changeset/base/327354 >> K> >> K> Log: >> K> Style. >> K> >> K> Reviewed by: alc >> K> Sponsored by: The FreeBSD Foundation >> K> MFC after: 1 week >> K> Differential revision: https://reviews.freebsd.org/D13678 >> K> >> K> Modified: >> K> head/sys/vm/vm_swapout.c >> K> >> K> Modified: head/sys/vm/vm_swapout.c >> K> ============================================================================== >> K> --- head/sys/vm/vm_swapout.c Fri Dec 29 18:42:55 2017 (r327353) >> K> +++ head/sys/vm/vm_swapout.c Fri Dec 29 19:05:07 2017 (r327354) >> K> @@ -556,16 +556,14 @@ vm_thread_swapin(struct thread *td) >> K> { >> K> vm_object_t ksobj; >> K> vm_page_t ma[KSTACK_MAX_PAGES]; >> K> - int pages; >> K> + int a, count, i, j, pages, rv; >> K> >> K> pages = td->td_kstack_pages; >> K> ksobj = td->td_kstack_obj; >> K> VM_OBJECT_WLOCK(ksobj); >> K> (void)vm_page_grab_pages(ksobj, 0, VM_ALLOC_NORMAL | VM_ALLOC_WIRED, ma, >> K> pages); >> K> - for (int i = 0; i < pages;) { >> K> - int j, a, count, rv; >> K> - >> K> + for (i = 0; i < pages;) { >> K> vm_page_assert_xbusied(ma[i]); >> K> if (ma[i]->valid == VM_PAGE_BITS_ALL) { >> K> vm_page_xunbusy(ma[i]); >> >> Yeah, style is sacred, but is there a single person on Earth who would >> not agree that moving variables from smaller blocks to function block >> reduces readability of the code? > > I agree that it reduces the readability. Not only that, it also > encourages real bugs by allowing access to the variable when it does not > make sense. I disagree that it reduces the readability. Not only that, it also encourages real bugs by shadowing variables in outer scope, unless a limited scope is _always_ used for variables of the same name. Just the smaller code size increases the readability. The above is only 2 lines shorter, but without the C++ declaration the nested version would be much larger and require ugly indentation to declare i: /* Next line is not 1TBS. */ { /* Everything marches to the right. */ int i; for (i = 0; i < pages;) { /* Random order of next line not fixed. */ int j, a, count, rv; vm_page_assert_xbusied(ma[i]); .... } C++ also allows the larger style bug of declaring variables in the same scope (after statements). This doesn't even give the benefit of limiting the scope to the end of the block. It does limit the scope to after the declaration, but that is obvious from when the variable is initialized, except with the style bug of initializing variables in declarations. I use C++ style declarations only in temporary code since they are easier to write but harder to read. Bruce From owner-svn-src-head@freebsd.org Fri Jan 19 04:34:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6EAF6EC1817; Fri, 19 Jan 2018 04:34:07 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 492BE70E78; Fri, 19 Jan 2018 04:34:07 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7AEFC681; Fri, 19 Jan 2018 04:34:06 +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 w0J4Y6OX086678; Fri, 19 Jan 2018 04:34:06 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0J4Y6i7086677; Fri, 19 Jan 2018 04:34:06 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201801190434.w0J4Y6i7086677@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 19 Jan 2018 04:34:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328159 - head/sys/modules X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/modules X-SVN-Commit-Revision: 328159 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 04:34:07 -0000 Author: cem Date: Fri Jan 19 04:34:06 2018 New Revision: 328159 URL: https://svnweb.freebsd.org/changeset/base/328159 Log: Unbreak i386 build The logical result of a right shift >= the width of a type is zero, but our compiler decides this is a warning (and thus, error). Just remove ccp(4) from i386. Reported by: cy Sponsored by: Dell EMC Isilon Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Fri Jan 19 01:36:25 2018 (r328158) +++ head/sys/modules/Makefile Fri Jan 19 04:34:06 2018 (r328159) @@ -575,7 +575,6 @@ _bxe= bxe .endif _cardbus= cardbus _cbb= cbb -_ccp= ccp _cpuctl= cpuctl _cpufreq= cpufreq _cs= cs @@ -705,6 +704,7 @@ _x86bios= x86bios .endif .if ${MACHINE_CPUARCH} == "amd64" +_ccp= ccp _efirt= efirt _ioat= ioat _ixl= ixl From owner-svn-src-head@freebsd.org Fri Jan 19 04:38:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7699CEC1A5F; Fri, 19 Jan 2018 04:38:58 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-ot0-x241.google.com (mail-ot0-x241.google.com [IPv6:2607:f8b0:4003:c0f::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 398EC71043; Fri, 19 Jan 2018 04:38:58 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by mail-ot0-x241.google.com with SMTP id a24so418988otd.4; Thu, 18 Jan 2018 20:38:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=nwYc1j2ggL/XVWAgpfH2q4uQEhiBonj57LwYZbt7U1E=; b=Fuf7/gMZDSmMo0tX49LY7N+SsStVqv8M+sjkwsKw/kUoK2pJQwRQ4ao+C0IyvwxpcX e+FPLboViMLgy9dHvS5lnpChimEk7XpRtoVpM73RwDKj94TZX3G+YzEmko/Mgzuab+1t cB8mcY0BkHeDLStE+0DUIwA/JQtpj6VnddaGhIkG2+XwtZdbta2Dyk+6kFc/JIDe9YWQ oK40itebnF1WMaOl+nQgn8oozTNCKTAZaIHk0m9UJHKWumSUCOILIl/WSLSJe9XWnXMm w34KMJKxqEvnTog49i22fp354p1wdRFpYICqrsN5hZl2s115qB1OzAayDb5EQle0FyH4 Qk2A== 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=nwYc1j2ggL/XVWAgpfH2q4uQEhiBonj57LwYZbt7U1E=; b=rPuCdGi8jX4x3qnFJdcUGY+ZQFIyCQZyny8/wHHkuQC1qcFdiJz7Kf2BScUnFJSRWY JQgxJEpOwn/nAXOfKN5YxaJtGynPT9X64pfnBrECS31BOHktJPm1vY8G6vBTuSv3pcOD qBVHrila69hbzNqlFscikGWvZ2zW1cmGNeCngxpSDa1pvsRQM/adwxzHklaFVn55/GJV pfV48sfDVXljfxXbS+3ZpPVBv1ez6DtnEureZqnl6zxFfEdb7V3rHVBDYqs8SV+BK+w3 uYohVwsGDoi2m3VA9G8gdEE8MiakLyGe06N76ov7SZHLUeeKcbTogUnt1TcpAYmzxg8f y4Cw== X-Gm-Message-State: AKwxyteJ95W/NdsbJ5/wIzqOAh0KG7rRJ5FAY1V2MfK+qN+CP1nkKVF4 lN0xQjAekFY9/rbGkwP1tK5+eipOKVkRS+ussFk9HA== X-Google-Smtp-Source: ACJfBovdxTEjAQcbHpu99Ubm5YO21C5WtRipY62T87WYYHhtW61xFYB52H5PeqrHkUsjL0VJ/57HnUA66ChprCAiE58= X-Received: by 10.157.113.201 with SMTP id z9mr4605650otj.164.1516336737298; Thu, 18 Jan 2018 20:38:57 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.63.10 with HTTP; Thu, 18 Jan 2018 20:38:56 -0800 (PST) In-Reply-To: <201801190434.w0J4Y6i7086677@repo.freebsd.org> References: <201801190434.w0J4Y6i7086677@repo.freebsd.org> From: Benjamin Kaduk Date: Thu, 18 Jan 2018 22:38:56 -0600 Message-ID: Subject: Re: svn commit: r328159 - head/sys/modules To: Conrad Meyer Cc: 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-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 04:38:58 -0000 On Thu, Jan 18, 2018 at 10:34 PM, Conrad Meyer wrote: > Author: cem > Date: Fri Jan 19 04:34:06 2018 > New Revision: 328159 > URL: https://svnweb.freebsd.org/changeset/base/328159 > > Log: > Unbreak i386 build > > The logical result of a right shift >= the width of a type is zero, but > our > compiler decides this is a warning (and thus, error). Just remove ccp(4) > from i386. > That may seem like the logical result, but this is actually undefined behavior. Per n1256.pdf, section 6.5.7: The integer promotions are performed on each of the operands. The type of the result is that of the promoted left operand. If the value of the right operand is negative or is greater than or equal to the width of the promoted left operand, the behavior is undefined. -Ben From owner-svn-src-head@freebsd.org Fri Jan 19 04:54:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87D59EC24A4; Fri, 19 Jan 2018 04:54:57 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-ot0-x22a.google.com (mail-ot0-x22a.google.com [IPv6:2607:f8b0:4003:c0f::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 493FE71B09; Fri, 19 Jan 2018 04:54:57 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by mail-ot0-x22a.google.com with SMTP id f100so442069otf.3; Thu, 18 Jan 2018 20:54:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=FAM27n2yYwtR4fBPE45gOaoYEiA0yX4p7TDaZd9ArTM=; b=QlZa3/0HOzxl9qEgX+FymqqmeVqppm2oPb4hEr1UZTVPDyFaozhRP82RTAkem28ARW 5n1VDUJzFCvOwrKXQIBb+FQ4DMmHUlUE2E+YdNj2sLmYZbDni+lQ6pY5qSBS9xbLtTzn b9ZEM7LcrgU4jthr08GnqJ7RaasJXKCIDqDQmCc6FSLZS0XP1rpQLv5imDuaAsoiwtQh ivy9rTtpOYUJoleM93cXiBId90P7wL7yKAZEM7aI4U+/Fq8Mlfvaa1M30JsHsGg1pCcW pxpPYITeHrSTUB0F/kxtIWtZ24UK0vXuns72p0gV45c4DXLXMHsNuNpla3UhWF1X/yoK QXKw== 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=FAM27n2yYwtR4fBPE45gOaoYEiA0yX4p7TDaZd9ArTM=; b=tSLEymWEM6Q6pXiQdpX7coXRCCWE9zVrQdOXh2QRnWyVVAzM/T0SgMTQS7jqdUJMSz 22twloCxQz0fmKQmSnbhVmEVX22nmxCYw0oYKOfLS+hTdQ+VEW+ZDuBrdkNQVVjodN6w WSgyEUuRi0x/aFDB2fMp4yzMCKh7CN2oYSpGtCgRj6QBUvS63ohST7nCYClQX0to8Hr5 np94es6GjkzBE4fBDoUIPdWGkVy19mTTiCQZeYYeeLXN11LwdTa8mVvWsNUh3y1mQg8c 4/bqgxTiP7nnhTNW8ym63avxasEgfh9Ax4rxitUgfbIeLaDPYW7lka4FNT/5b9mdpQ2Z 5lQg== X-Gm-Message-State: AKwxytf5ALAyoxwdxSD65JA5gdBeO7CgVSNjBCzmqa6gfRPWQO+4Whcy hRn1Qg1uawPTKu6DLOYn02PDEbeMhqvxz1o4mlw= X-Google-Smtp-Source: ACJfBosuYqjI4g+Gn6W1PuUonjHNVuVvgUpdqUyk47pvGHe+o/iBCIIAVnSeJzRAhbDTYaED27dMf3rag9zIbjVP+js= X-Received: by 10.157.6.79 with SMTP id 73mr5042173otn.329.1516337696504; Thu, 18 Jan 2018 20:54:56 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.82.83 with HTTP; Thu, 18 Jan 2018 20:54:55 -0800 (PST) In-Reply-To: References: <201801190434.w0J4Y6i7086677@repo.freebsd.org> From: Benjamin Kaduk Date: Thu, 18 Jan 2018 22:54:55 -0600 Message-ID: Subject: Re: svn commit: r328159 - head/sys/modules To: "cem@FreeBSD.org" Cc: 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-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 04:54:57 -0000 On Thu, Jan 18, 2018 at 10:49 PM, Conrad Meyer wrote: > No. It is the only logical result of a logical right shift larger > than the left operand. The C standard may claim that is undefined, > but that does not change the only logical result (zero). > > My point is that the compiler does not arbitrarily decide that this behavior merits a warning; the compiler is thoroughly grounded in the C language specification to do so. The compiler does not adhere to our human standard of "logic"; it follows the language spec, warts and all. -Ben From owner-svn-src-head@freebsd.org Fri Jan 19 04:55:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA29CEC251A; Fri, 19 Jan 2018 04:55:14 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f50.google.com (mail-it0-f50.google.com [209.85.214.50]) (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 AA71871C53; Fri, 19 Jan 2018 04:55:14 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f50.google.com with SMTP id 196so724990iti.5; Thu, 18 Jan 2018 20:55:14 -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=nsleg3jY2ZMr5ae5PzmPlWl7i7T8iRG89kbWOencwgs=; b=aVfBS8o7lgGzgd6Gaj7R0W2IHAoLNmL23x2Z73fYVv0Hg4fH5ezUhMcA1+rrOBRjgb dBkt/jVaG6kDAneGnQz7Px3/ia/WZAbTVQW7qPAhzugnFR7pkNFBhAz/FiVo8EzQbeN9 xhoz0DeqzrDh+Fclq5h6voCcgMTLRsVSTu+tdH9uV+t464wshEPzX6HpEEXd9SOoVkQE sEi5jcmVoHFhZRyQxCnrMIDlg8/OXJiUf8g7ALiPg0LWi6GJeeLXoBAdqzxMaVVkmKDE tBFh6NAPmKLzEShekkmudirXSBkfRLNy93QuJlkWJ1S77x//nlWs2/TWqcFIj7Pf6VqJ pDjQ== X-Gm-Message-State: AKwxytemhTlTs/bWU0KLOmQyjYeF6Wv7r7+55Afh6mFgI6B8gpylqJ+J 2BT8hvXogNXqcBULQ1Bdc7xs1s9D X-Google-Smtp-Source: ACJfBostOY4NtQN79PdKbr7r9Sna7uWrdC1PTlTz+870kWvnbJxgbsh0cwywHYusZ/a7aIRLl8d3aA== X-Received: by 10.36.163.136 with SMTP id p130mr13219823ite.49.1516337383562; Thu, 18 Jan 2018 20:49:43 -0800 (PST) Received: from mail-it0-f49.google.com (mail-it0-f49.google.com. [209.85.214.49]) by smtp.gmail.com with ESMTPSA id j3sm3658133iob.14.2018.01.18.20.49.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jan 2018 20:49:43 -0800 (PST) Received: by mail-it0-f49.google.com with SMTP id p124so736370ite.1; Thu, 18 Jan 2018 20:49:43 -0800 (PST) X-Received: by 10.36.137.84 with SMTP id s81mr2976669itd.75.1516337382959; Thu, 18 Jan 2018 20:49:42 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.95.152 with HTTP; Thu, 18 Jan 2018 20:49:42 -0800 (PST) In-Reply-To: References: <201801190434.w0J4Y6i7086677@repo.freebsd.org> From: Conrad Meyer Date: Thu, 18 Jan 2018 20:49:42 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r328159 - head/sys/modules To: Benjamin Kaduk Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 04:55:15 -0000 No. It is the only logical result of a logical right shift larger than the left operand. The C standard may claim that is undefined, but that does not change the only logical result (zero). On Thu, Jan 18, 2018 at 8:38 PM, Benjamin Kaduk wrote: > On Thu, Jan 18, 2018 at 10:34 PM, Conrad Meyer wrote: >> >> Author: cem >> Date: Fri Jan 19 04:34:06 2018 >> New Revision: 328159 >> URL: https://svnweb.freebsd.org/changeset/base/328159 >> >> Log: >> Unbreak i386 build >> >> The logical result of a right shift >= the width of a type is zero, but >> our >> compiler decides this is a warning (and thus, error). Just remove >> ccp(4) >> from i386. > > > That may seem like the logical result, but this is actually undefined > behavior. Per n1256.pdf, section 6.5.7: > > The integer promotions are performed on each of the operands. The type of > the result is that of the promoted left operand. If the value of the right > operand is negative or is greater than or equal to the width of the promoted > left operand, the behavior is undefined. > > -Ben From owner-svn-src-head@freebsd.org Fri Jan 19 05:07:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35711EC2C65; Fri, 19 Jan 2018 05:07:22 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f43.google.com (mail-it0-f43.google.com [209.85.214.43]) (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 055E67229F; Fri, 19 Jan 2018 05:07:21 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f43.google.com with SMTP id w14so754411itc.3; Thu, 18 Jan 2018 21:07:21 -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=VN6QRj0P6GTKN9JUeTBjSFeJyFcJtMtRCzvOvGO9yhE=; b=iN61fbrYdEQ0wM3j0k11eQPcHSqqRO6fJa7hpQd1RdZV6OICZy094S/yx0PqmafGcQ SkL4AKS3lWsO7hYD/Z2j3CoPp8GGd4CS5mpfP0g9Z1phK7v/e91gKz5zWSYfdLrprQfp LoTlikXqBZT/pPinwn+G+/wslfd9RhdJZAEbjhHzgHZVUXx1xrJZrdksFzwociG1/1Lo INGv/4OX0xmRk927ELutL6zHGoAW9PNlwjaXpRskI+f3ged7xn7aFaVRZDmA2k+0zhMD ogklFbv8Lg+UQWfZWCp1Bv9PAPxMo1zMKME+fHRxWD1sZ30WUjHiTDSoN85N5xTb2D+j X0Bg== X-Gm-Message-State: AKwxyteho6p2+8wOqmYekLyoovg5tDyIFJfvJN6qxkZCDzhg1ynIrmDL +qIt1ws5K3DKyIYyU3YwzrWG/Ugv X-Google-Smtp-Source: ACJfBot8LRWSgOg5ogsr495N+3W5/J9uWnCDDpKicwjq/KmEDZVyLChzDt7NAXa1IhcztanJnls8Fw== X-Received: by 10.36.117.195 with SMTP id y186mr27896465itc.111.1516338440622; Thu, 18 Jan 2018 21:07:20 -0800 (PST) Received: from mail-io0-f172.google.com (mail-io0-f172.google.com. [209.85.223.172]) by smtp.gmail.com with ESMTPSA id b69sm1415090ioa.65.2018.01.18.21.07.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jan 2018 21:07:20 -0800 (PST) Received: by mail-io0-f172.google.com with SMTP id 25so896634ioj.9; Thu, 18 Jan 2018 21:07:20 -0800 (PST) X-Received: by 10.107.6.130 with SMTP id f2mr28456387ioi.117.1516338440122; Thu, 18 Jan 2018 21:07:20 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.95.152 with HTTP; Thu, 18 Jan 2018 21:07:19 -0800 (PST) In-Reply-To: References: <201801190434.w0J4Y6i7086677@repo.freebsd.org> From: Conrad Meyer Date: Thu, 18 Jan 2018 21:07:19 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r328159 - head/sys/modules To: Benjamin Kaduk Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 05:07:22 -0000 The spec says the behavior is undefined; not that the compiler has to produce a warning or error message. The compiler *does* get to arbitrarily decide what it wants to do when it encounters UB. It is wholly free to implement this particular UB with the logical result and no warning/error. On Thu, Jan 18, 2018 at 8:54 PM, Benjamin Kaduk wrote: > On Thu, Jan 18, 2018 at 10:49 PM, Conrad Meyer wrote: >> >> No. It is the only logical result of a logical right shift larger >> than the left operand. The C standard may claim that is undefined, >> but that does not change the only logical result (zero). >> > > My point is that the compiler does not arbitrarily decide that this behavior > merits > a warning; the compiler is thoroughly grounded in the C language > specification > to do so. The compiler does not adhere to our human standard of "logic"; it > follows > the language spec, warts and all. > > -Ben From owner-svn-src-head@freebsd.org Fri Jan 19 08:24:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E92EECA714; Fri, 19 Jan 2018 08:24:15 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from vps.rulingia.com (vps.rulingia.com [103.243.244.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.rulingia.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 190FD77E61; Fri, 19 Jan 2018 08:24:13 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from server.rulingia.com (ppp59-167-167-3.static.internode.on.net [59.167.167.3]) by vps.rulingia.com (8.15.2/8.15.2) with ESMTPS id w0J8NvCb057637 (version=TLSv1.2 cipher=DHE-RSA-CHACHA20-POLY1305 bits=256 verify=OK); Fri, 19 Jan 2018 19:24:03 +1100 (AEDT) (envelope-from peter@rulingia.com) X-Bogosity: Ham, spamicity=0.000000 Received: from server.rulingia.com (localhost.rulingia.com [127.0.0.1]) by server.rulingia.com (8.15.2/8.15.2) with ESMTPS id w0J8NoT1032010 (version=TLSv1.2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256 verify=NO); Fri, 19 Jan 2018 19:23:50 +1100 (AEDT) (envelope-from peter@server.rulingia.com) Received: (from peter@localhost) by server.rulingia.com (8.15.2/8.15.2/Submit) id w0J8Noik032009; Fri, 19 Jan 2018 19:23:50 +1100 (AEDT) (envelope-from peter) Date: Fri, 19 Jan 2018 19:23:50 +1100 From: Peter Jeremy To: Conrad Meyer Cc: Benjamin Kaduk , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r328159 - head/sys/modules Message-ID: <20180119082350.GF75633@server.rulingia.com> References: <201801190434.w0J4Y6i7086677@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Hf61M2y+wYpnELGG" Content-Disposition: inline In-Reply-To: X-PGP-Key: http://www.rulingia.com/keys/peter.pgp User-Agent: Mutt/1.9.1 (2017-09-22) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 08:24:15 -0000 --Hf61M2y+wYpnELGG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2018-Jan-18 21:07:19 -0800, Conrad Meyer wrote: >The spec says the behavior is undefined; not that the compiler has to >produce a warning or error message. The compiler *does* get to >arbitrarily decide what it wants to do when it encounters UB. It is >wholly free to implement this particular UB with the logical result >and no warning/error. IMO, the fact that our compiler produces a warning message when it encounters undefined behaviour is A Good Thing. Relying on implementation-specific behaviour leads to brittle code - a compiler update or reusing the code with a different compiler could completely change the behaviour. --=20 Peter Jeremy --Hf61M2y+wYpnELGG Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEE7rKYbDBnHnTmXCJ+FqWXoOSiCzQFAlphqxZfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEVF QjI5ODZDMzA2NzFFNzRFNjVDMjI3RTE2QTU5N0EwRTRBMjBCMzQACgkQFqWXoOSi CzQzWg//SDAqb4toDa12XynO/m251RJEpcHeU6E5p9GhMGWPOpJAuNsxj62i83N2 Q6FQzfgfNPWi1meBPFnbkeQfVuAlr2ROVmPy6I3qTYHJakq54UBGvd9qip9lhutq Ya7aOxX6U3kbOhDYVi1MGNbSf61Cgx4CYRZ8BG3X5Q/eUDvUt/nW+cQ6QRtk9srO ud4khjkY8adD+G1CYI5dMp89UyJ3RG2DDQfnz7Pn+qlBY4Mw64rtowIIyhj4ahT3 2BwmgBEZCtFV5R97GbQRkBatwK84aDAp5qR/1vDxd/DCg79wUB2zcHjCDa5hXtJ4 rMhovvNR0SqBZqWdYNduVsn47MZBzI0mPTWNto0A3nxKhKWKyZwVCTF57sE6whsn t/pCMU3ZBYg/WjuwwFo7CPBMOEwnfzfu387oaHVNCON3JOYFKKM35PoxMUWAsHYa em0JHxEVnDk7RPV0EOa8bSTd+4lNj6E5F+/g8DRgRoopW16MCC4BRjoA0jZf5hWD eNgOn9WRHkVi+cVzdOKMm+QDxEjc43auhUnuoQyZ5c2vfSWhnnshWnc0pKqGGKrk P3c/ZoCLtLSOaIwhepbOiQ5jSkPI0qZ0B0qhCxCzPOL+tB5hv2Gsqwu4tULojjU6 WeFAHluJ31G7/feWVoPzLkpfWIcUQ2+7iLPIK17560WJjdIK8Hc= =tiV8 -----END PGP SIGNATURE----- --Hf61M2y+wYpnELGG-- From owner-svn-src-head@freebsd.org Fri Jan 19 08:48:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96837ECB3EF; Fri, 19 Jan 2018 08:48:16 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 580C1788F2; Fri, 19 Jan 2018 08:48:16 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A148B2E4F; Fri, 19 Jan 2018 08:48:15 +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 w0J8mFEF091048; Fri, 19 Jan 2018 08:48:15 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0J8mEKg091042; Fri, 19 Jan 2018 08:48:14 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201801190848.w0J8mEKg091042@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 19 Jan 2018 08:48:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328160 - head/contrib/bsnmp/snmpd X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/contrib/bsnmp/snmpd X-SVN-Commit-Revision: 328160 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 08:48:16 -0000 Author: ae Date: Fri Jan 19 08:48:14 2018 New Revision: 328160 URL: https://svnweb.freebsd.org/changeset/base/328160 Log: Add to bsnmpd(1) ability to specify multiple community strings with different access rights. By default there are two community strings with index 1 and 2, one for read-only access and second for read-write access: begemotSnmpdCommunityString.0.1 = $(read) begemotSnmpdCommunityString.0.2 = $(write) Now it is possible to define additional community strings using different indexes: begemotSnmpdCommunityString.0.3 = "SomeString1" begemotSnmpdCommunityPermission.0.3 = 1 begemotSnmpdCommunityString.0.4 = "SomeString2" begemotSnmpdCommunityPermission.0.4 = 2 begemotSnmpdCommunityString.0.5 = "SomeString3" begemotSnmpdCommunityString.0.6 = "SomeString4" New attribute begemotSnmpdCommunityPermission can be used to specify access rights: 1 means "read-only" access, 2 means "read-write" access. If attribute is not specified for some index this means "read-only" rights. Community strings must be unique, i.e. must not be the same for different indexes. Obtained from: Yandex LLC MFC after: 2 weeks Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D13785 Modified: head/contrib/bsnmp/snmpd/BEGEMOT-SNMPD.txt head/contrib/bsnmp/snmpd/action.c head/contrib/bsnmp/snmpd/main.c head/contrib/bsnmp/snmpd/snmpd.config head/contrib/bsnmp/snmpd/snmpmod.h head/contrib/bsnmp/snmpd/tree.def Modified: head/contrib/bsnmp/snmpd/BEGEMOT-SNMPD.txt ============================================================================== --- head/contrib/bsnmp/snmpd/BEGEMOT-SNMPD.txt Fri Jan 19 04:34:06 2018 (r328159) +++ head/contrib/bsnmp/snmpd/BEGEMOT-SNMPD.txt Fri Jan 19 08:48:14 2018 (r328160) @@ -44,7 +44,7 @@ IMPORTS FROM BEGEMOT-MIB; begemotSnmpd MODULE-IDENTITY - LAST-UPDATED "200212040000Z" + LAST-UPDATED "201801190000Z" ORGANIZATION "Fraunhofer FOKUS, CATS" CONTACT-INFO " Hartmut Brandt @@ -274,7 +274,8 @@ BegemotSnmpdCommunityEntry ::= SEQUENCE { begemotSnmpdCommunityModule SectionName, begemotSnmpdCommunityIndex Unsigned32, begemotSnmpdCommunityString OCTET STRING, - begemotSnmpdCommunityDescr OCTET STRING + begemotSnmpdCommunityDescr OCTET STRING, + begemotSnmpdCommunityPermission INTEGER } begemotSnmpdCommunityModule OBJECT-TYPE @@ -309,6 +310,14 @@ begemotSnmpdCommunityDescr OBJECT-TYPE DESCRIPTION "A description what this community is good for." ::= { begemotSnmpdCommunityEntry 4 } + +begemotSnmpdCommunityPermission OBJECT-TYPE + SYNTAX INTEGER (1..4294967295) + MAX-ACCESS not-accessible + STATUS current + DESCRIPTION + "The numerical value of access rights granted to the community." + ::= { begemotSnmpdCommunityEntry 5 } -- -- Module table Modified: head/contrib/bsnmp/snmpd/action.c ============================================================================== --- head/contrib/bsnmp/snmpd/action.c Fri Jan 19 04:34:06 2018 (r328159) +++ head/contrib/bsnmp/snmpd/action.c Fri Jan 19 08:48:14 2018 (r328160) @@ -751,8 +751,9 @@ int op_community(struct snmp_context *ctx, struct snmp_value *value, u_int sub, u_int iidx __unused, enum snmp_op op) { - asn_subid_t which = value->var.subs[sub - 1]; + struct asn_oid index; struct community *c; + asn_subid_t which = value->var.subs[sub - 1]; switch (op) { @@ -770,12 +771,47 @@ op_community(struct snmp_context *ctx, struct snmp_val break; case SNMP_OP_SET: - if ((community != COMM_INITIALIZE && snmpd.comm_dis) || - (c = FIND_OBJECT_OID(&community_list, &value->var, sub)) == NULL) - return (SNMP_ERR_NO_CREATION); - if (which != LEAF_begemotSnmpdCommunityString) + if (community != COMM_INITIALIZE && snmpd.comm_dis) return (SNMP_ERR_NOT_WRITEABLE); - return (string_save(value, ctx, -1, &c->string)); + index.len = 2; + index.subs[0] = 0; + index.subs[1] = value->var.subs[value->var.len - 1]; + switch (which) { + case LEAF_begemotSnmpdCommunityString: + /* check that given string is unique */ + TAILQ_FOREACH(c, &community_list, link) { + if (!asn_compare_oid(&index, &c->index)) + continue; + if (c->string != NULL && strcmp(c->string, + value->v.octetstring.octets) == 0) + return (SNMP_ERR_WRONG_VALUE); + } + case LEAF_begemotSnmpdCommunityPermission: + break; + default: + return (SNMP_ERR_NOT_WRITEABLE); + } + if ((c = FIND_OBJECT_OID(&community_list, &value->var, + sub)) == NULL) { + /* create new community and use user sepcified index */ + c = comm_define_ordered(COMM_READ, "SNMP Custom Community", + &index, NULL, NULL); + if (c == NULL) + return (SNMP_ERR_NO_CREATION); + } + switch (which) { + case LEAF_begemotSnmpdCommunityString: + return (string_save(value, ctx, -1, &c->string)); + case LEAF_begemotSnmpdCommunityPermission: + if (value->v.integer != COMM_READ && + value->v.integer != COMM_WRITE) + return (SNMP_ERR_WRONG_VALUE); + c->private = value->v.integer; + break; + default: + return (SNMP_ERR_NOT_WRITEABLE); + } + return (SNMP_ERR_NOERROR); case SNMP_OP_ROLLBACK: if (which == LEAF_begemotSnmpdCommunityString) { @@ -786,6 +822,8 @@ op_community(struct snmp_context *ctx, struct snmp_val string_rollback(ctx, &c->string); return (SNMP_ERR_NOERROR); } + if (which == LEAF_begemotSnmpdCommunityPermission) + return (SNMP_ERR_NOERROR); abort(); case SNMP_OP_COMMIT: @@ -797,6 +835,8 @@ op_community(struct snmp_context *ctx, struct snmp_val string_commit(ctx); return (SNMP_ERR_NOERROR); } + if (which == LEAF_begemotSnmpdCommunityPermission) + return (SNMP_ERR_NOERROR); abort(); default: @@ -810,6 +850,12 @@ op_community(struct snmp_context *ctx, struct snmp_val case LEAF_begemotSnmpdCommunityDescr: return (string_get(value, c->descr, -1)); + + case LEAF_begemotSnmpdCommunityPermission: + value->v.integer = c->private; + return (SNMP_ERR_NOERROR); + default: + return (SNMP_ERR_NOT_WRITEABLE); } abort(); } Modified: head/contrib/bsnmp/snmpd/main.c ============================================================================== --- head/contrib/bsnmp/snmpd/main.c Fri Jan 19 04:34:06 2018 (r328159) +++ head/contrib/bsnmp/snmpd/main.c Fri Jan 19 08:48:14 2018 (r328160) @@ -1160,8 +1160,8 @@ snmpd_input(struct port_input *pi, struct tport *tport */ if (pdu.version < SNMP_V3 && ((pi->cred && !pi->priv && pdu.type == SNMP_PDU_SET) || - (community != COMM_WRITE && - (pdu.type == SNMP_PDU_SET || community != COMM_READ)))) { + (comm != NULL && comm->private != COMM_WRITE && + (pdu.type == SNMP_PDU_SET || comm->private != COMM_READ)))) { snmpd_stats.inBadCommunityUses++; snmp_pdu_free(&pdu); snmp_input_consume(pi); @@ -1609,8 +1609,8 @@ main(int argc, char *argv[]) /* * Get standard communities */ - (void)comm_define(1, "SNMP read", NULL, NULL); - (void)comm_define(2, "SNMP write", NULL, NULL); + comm_define(COMM_READ, "SNMP read", NULL, NULL); + comm_define(COMM_WRITE, "SNMP write", NULL, NULL); community = COMM_INITIALIZE; trap_reqid = reqid_allocate(512, NULL); @@ -2027,25 +2027,23 @@ asn_error_func(const struct asn_buf *b, const char *er /* * Create a new community */ -u_int -comm_define(u_int priv, const char *descr, struct lmodule *owner, - const char *str) +struct community* +comm_define_ordered(u_int priv, const char *descr, struct asn_oid *index, + struct lmodule *owner, const char *str) { struct community *c, *p; u_int ncomm; - /* generate an identifier */ - do { - if ((ncomm = next_community_index++) == UINT_MAX) - next_community_index = 1; - TAILQ_FOREACH(c, &community_list, link) - if (c->value == ncomm) - break; - } while (c != NULL); + ncomm = index->subs[index->len - 1]; + /* check that community doesn't already exist */ + TAILQ_FOREACH(c, &community_list, link) + if (c->value == ncomm) + return (c); + if ((c = malloc(sizeof(struct community))) == NULL) { - syslog(LOG_ERR, "comm_define: %m"); - return (0); + syslog(LOG_ERR, "%s: %m", __func__); + return (NULL); } c->owner = owner; c->value = ncomm; @@ -2056,23 +2054,14 @@ comm_define(u_int priv, const char *descr, struct lmod if (str != NULL) { if((c->string = malloc(strlen(str)+1)) == NULL) { free(c); - return (0); + return (NULL); } strcpy(c->string, str); } - - /* make index */ - if (c->owner == NULL) { - c->index.len = 1; - c->index.subs[0] = 0; - } else { - c->index = c->owner->index; - } - c->index.subs[c->index.len++] = c->private; - /* * Insert ordered */ + c->index = *index; TAILQ_FOREACH(p, &community_list, link) { if (asn_compare_oid(&p->index, &c->index) > 0) { TAILQ_INSERT_BEFORE(p, c, link); @@ -2081,6 +2070,38 @@ comm_define(u_int priv, const char *descr, struct lmod } if (p == NULL) TAILQ_INSERT_TAIL(&community_list, c, link); + return (c); +} + +u_int +comm_define(u_int priv, const char *descr, struct lmodule *owner, + const char *str) +{ + struct asn_oid index, *p; + struct community *c; + u_int ncomm; + + /* generate an identifier */ + do { + if ((ncomm = next_community_index++) == UINT_MAX) + next_community_index = 1; + TAILQ_FOREACH(c, &community_list, link) + if (c->value == ncomm) + break; + } while (c != NULL); + + /* make index */ + if (owner != NULL) + p = &owner->index; + else { + p = &index; + p->len = 1; + p->subs[0] = 0; + } + p->subs[p->len++] = ncomm; + c = comm_define_ordered(priv, descr, p, owner, str); + if (c == NULL) + return (0); return (c->value); } Modified: head/contrib/bsnmp/snmpd/snmpd.config ============================================================================== --- head/contrib/bsnmp/snmpd/snmpd.config Fri Jan 19 04:34:06 2018 (r328159) +++ head/contrib/bsnmp/snmpd/snmpd.config Fri Jan 19 08:48:14 2018 (r328160) @@ -68,6 +68,7 @@ begemotSnmpdDebugSyslogPri = 7 # begemotSnmpdCommunityString.0.1 = $(read) # begemotSnmpdCommunityString.0.2 = $(write) +# begemotSnmpdCommunityString.0.3 = "otherPublic" begemotSnmpdCommunityDisable = 1 # open standard SNMP ports Modified: head/contrib/bsnmp/snmpd/snmpmod.h ============================================================================== --- head/contrib/bsnmp/snmpd/snmpmod.h Fri Jan 19 04:34:06 2018 (r328159) +++ head/contrib/bsnmp/snmpd/snmpmod.h Fri Jan 19 08:48:14 2018 (r328160) @@ -334,6 +334,8 @@ extern struct systemg systemg; #define COMM_WRITE 2 u_int comm_define(u_int, const char *descr, struct lmodule *, const char *str); +struct community *comm_define_ordered(u_int priv, const char *descr, + struct asn_oid *index, struct lmodule *owner, const char *str); const char * comm_string(u_int); /* community for current packet */ Modified: head/contrib/bsnmp/snmpd/tree.def ============================================================================== --- head/contrib/bsnmp/snmpd/tree.def Fri Jan 19 04:34:06 2018 (r328159) +++ head/contrib/bsnmp/snmpd/tree.def Fri Jan 19 08:48:14 2018 (r328160) @@ -135,6 +135,7 @@ typedef RowStatus ENUM ( (2 begemotSnmpdCommunityIndex UNSIGNED32) (3 begemotSnmpdCommunityString OCTETSTRING GET SET) (4 begemotSnmpdCommunityDescr OCTETSTRING GET) + (5 begemotSnmpdCommunityPermission INTEGER GET SET) )) # # Module table From owner-svn-src-head@freebsd.org Fri Jan 19 10:54:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF934ECFCE3; Fri, 19 Jan 2018 10:54:18 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id CCE117C86D; Fri, 19 Jan 2018 10:54:16 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id 5c72ff73; Fri, 19 Jan 2018 11:54:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=hPpVB/dEWbp/R55OYPoVQVVkieE=; b=oxHlkbdD1EnFE3Lyxyo1bHvtmMWi KjY50VQzDV/kvQ2qD7SH0fGg/6doXivgKpWtYwgw2knQiwhOPUv81ZSh/JWlpcFM DRBCDAocjE+nsyVUY60cdcNPFyq/SQElWS11VJ/2KDORKW8zEeSatIeowiDQg+CB 1+0J/C+xBHfQQ/s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=letvaCXAvpy/dpp2CecqLdudpnCTgxk24vK/oOrsq50q20MNkSkTIBuT suostBycaun+M7t0xMM/fk84688Gq3xg4TZ4Z0tkg/werhkcn6Apmw+6x5WHqQj5 P0ZaskhxEaMqcf//pXkk4J0SKM2umZODN6oWz8lS24dYQ6fFcgE= Received: from arcadia (evadot.gandi.net [217.70.181.36]) by mail.blih.net (OpenSMTPD) with ESMTPSA id 58ed13a4 TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Fri, 19 Jan 2018 11:54:14 +0100 (CET) Date: Fri, 19 Jan 2018 11:54:08 +0100 From: Emmanuel Vadot To: Rick Macklem Cc: Emmanuel Vadot , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r328129 - head/sys/fs/nfsserver Message-Id: <20180119115408.f333d3a6ec8d762e73f1d844@bidouilliste.com> In-Reply-To: References: <201801181528.w0IFSnWm053535@repo.freebsd.org> <20180118163855.b0a55427709c52d0ec2482c9@bidouilliste.com> X-Mailer: Sylpheed 3.6.0 (GTK+ 2.24.31; amd64-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 10:54:19 -0000 On Thu, 18 Jan 2018 22:15:16 +0000 Rick Macklem wrote: > Emmanuel Vadot wrote: > >> Author: manu > >> Date: Thu Jan 18 15:28:49 2018 > >> New Revision: 328129 > >> URL: https://svnweb.freebsd.org/changeset/base/328129 > >> > >> Log: > >> nfs: Do not printf each time a lock structure is freed during module unload > >> > >> There can be a lot of those structures and printing a line each time we free > >> one on module unload. > > > > Finishing the sentence : > > > > There can be a lot of those structures and printing a line each time > >we free one on module unload is really time consuming, especially when > >you have a serial console plugged in. > > I will note that when I put a printf() like this in the code, it is because I > consider it an abnormal occurrence. It might be better to at least print > the message once. So should we warn once or maybe return EBUSY on unloading if there is still lock structures ? > For this case, normally all lock structures should go away when clients > unmount and unloading the nfsd module while there are active mounts > is not a safe practice. (Again NFSv4 isn't like NFSv3, there is server state > for NFSv4.) > > rick -- Emmanuel Vadot From owner-svn-src-head@freebsd.org Fri Jan 19 12:14:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84119ED2C11; Fri, 19 Jan 2018 12:14:39 +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 4AE337EB86; Fri, 19 Jan 2018 12:14:39 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.128.70]) (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 06A9D26009E; Fri, 19 Jan 2018 13:14:06 +0100 (CET) Subject: Re: svn commit: r327676 - head/sys/compat/linuxkpi/common/include/linux To: rgrimes@freebsd.org, Kristof Provost Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201801071907.w07J7pUF018031@pdx.rh.CN85.dnsmgr.net> From: Hans Petter Selasky Message-ID: Date: Fri, 19 Jan 2018 13:11:14 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <201801071907.w07J7pUF018031@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 12:14:39 -0000 On 01/07/18 20:07, Rodney W. Grimes wrote: >> -static inline void * >> -kcalloc(size_t n, size_t size, gfp_t flags) >> -{ >> - flags |= __GFP_ZERO; >> - return (mallocarray(n, size, M_KMALLOC, linux_check_m_flags(flags))); >> -} >> - >> static inline void * >> __vmalloc(size_t size, gfp_t flags, int other) >> { >> >> Regards, >> Kristof > > Should probably revert and go through review, > I would at least wait for comments from others. > Hi, I think the current version is fine. The compiler should take care of the inlining so that it doesn't consume additional stack. Else create a review as suggested. BTW: I need mallocarray() MFC'ed to 11-stable, but only the kernel parts. I'm handling the MFC of the LinuxKPI parts. --HPS From owner-svn-src-head@freebsd.org Fri Jan 19 12:50:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00C56ED4157; Fri, 19 Jan 2018 12:50:05 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CF12880109; Fri, 19 Jan 2018 12:50:04 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 155FB59AC; Fri, 19 Jan 2018 12:50:04 +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 w0JCo3VS091084; Fri, 19 Jan 2018 12:50:03 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0JCo3MR091081; Fri, 19 Jan 2018 12:50:03 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201801191250.w0JCo3MR091081@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 19 Jan 2018 12:50:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328161 - head/sys/netpfil/ipfw X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netpfil/ipfw X-SVN-Commit-Revision: 328161 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 12:50:05 -0000 Author: ae Date: Fri Jan 19 12:50:03 2018 New Revision: 328161 URL: https://svnweb.freebsd.org/changeset/base/328161 Log: Add UDPLite support to ipfw(4). Now it is possible to use UDPLite's port numbers in rules, create dynamic states for UDPLite packets and see "UDPLite" for matched packets in log. Obtained from: Yandex LLC MFC after: 2 weeks Sponsored by: Yandex LLC Modified: head/sys/netpfil/ipfw/ip_fw2.c head/sys/netpfil/ipfw/ip_fw_dynamic.c head/sys/netpfil/ipfw/ip_fw_log.c Modified: head/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw2.c Fri Jan 19 08:48:14 2018 (r328160) +++ head/sys/netpfil/ipfw/ip_fw2.c Fri Jan 19 12:50:03 2018 (r328161) @@ -1088,6 +1088,9 @@ check_uidgid(ipfw_insn_u32 *insn, struct ip_fw_args *a } else if (id->proto == IPPROTO_UDP) { lookupflags = INPLOOKUP_WILDCARD; pi = &V_udbinfo; + } else if (id->proto == IPPROTO_UDPLITE) { + lookupflags = INPLOOKUP_WILDCARD; + pi = &V_ulitecbinfo; } else return 0; lookupflags |= INPLOOKUP_RLOCKPCB; @@ -1458,6 +1461,7 @@ do { \ break; case IPPROTO_UDP: + case IPPROTO_UDPLITE: PULLUP_TO(hlen, ulp, struct udphdr); dst_port = UDP(ulp)->uh_dport; src_port = UDP(ulp)->uh_sport; @@ -1646,6 +1650,7 @@ do { \ break; case IPPROTO_UDP: + case IPPROTO_UDPLITE: PULLUP_TO(hlen, ulp, struct udphdr); dst_port = UDP(ulp)->uh_dport; src_port = UDP(ulp)->uh_sport; @@ -1777,7 +1782,8 @@ do { \ if (offset != 0) break; if (proto == IPPROTO_TCP || - proto == IPPROTO_UDP) + proto == IPPROTO_UDP || + proto == IPPROTO_UDPLITE) match = check_uidgid( (ipfw_insn_u32 *)cmd, args, &ucred_lookup, @@ -1916,6 +1922,7 @@ do { \ /* Skip proto without ports */ if (proto != IPPROTO_TCP && proto != IPPROTO_UDP && + proto != IPPROTO_UDPLITE && proto != IPPROTO_SCTP) break; if (vidx == 2 /* dst-port */) @@ -2072,8 +2079,10 @@ do { \ * to guarantee that we have a * packet with port info. */ - if ((proto==IPPROTO_UDP || proto==IPPROTO_TCP || - proto==IPPROTO_SCTP) && offset == 0) { + if ((proto == IPPROTO_UDP || + proto == IPPROTO_UDPLITE || + proto == IPPROTO_TCP || + proto == IPPROTO_SCTP) && offset == 0) { u_int16_t x = (cmd->opcode == O_IP_SRCPORT) ? src_port : dst_port ; @@ -2460,6 +2469,8 @@ do { \ pi = &V_tcbinfo; else if (proto == IPPROTO_UDP) pi = &V_udbinfo; + else if (proto == IPPROTO_UDPLITE) + pi = &V_ulitecbinfo; else break; Modified: head/sys/netpfil/ipfw/ip_fw_dynamic.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_dynamic.c Fri Jan 19 08:48:14 2018 (r328160) +++ head/sys/netpfil/ipfw/ip_fw_dynamic.c Fri Jan 19 12:50:03 2018 (r328161) @@ -584,7 +584,8 @@ dyn_update_proto_state(ipfw_dyn_rule *q, const struct q->expire = time_uptime + V_dyn_rst_lifetime; break; } - } else if (id->proto == IPPROTO_UDP) { + } else if (id->proto == IPPROTO_UDP || + id->proto == IPPROTO_UDPLITE) { q->expire = time_uptime + V_dyn_udp_lifetime; } else { /* other protocols */ Modified: head/sys/netpfil/ipfw/ip_fw_log.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_log.c Fri Jan 19 08:48:14 2018 (r328160) +++ head/sys/netpfil/ipfw/ip_fw_log.c Fri Jan 19 12:50:03 2018 (r328161) @@ -338,7 +338,10 @@ ipfw_log(struct ip_fw_chain *chain, struct ip_fw *f, u break; case IPPROTO_UDP: - len = snprintf(SNPARGS(proto, 0), "UDP %s", src); + case IPPROTO_UDPLITE: + len = snprintf(SNPARGS(proto, 0), "UDP%s%s", + args->f_id.proto == IPPROTO_UDP ? " ": "Lite ", + src); if (offset == 0) snprintf(SNPARGS(proto, len), ":%d %s:%d", ntohs(udp->uh_sport), From owner-svn-src-head@freebsd.org Fri Jan 19 12:59:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16FE3ED45CE; Fri, 19 Jan 2018 12:59:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CA88580734; Fri, 19 Jan 2018 12:59:15 +0000 (UTC) (envelope-from hselasky@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E40185B45; Fri, 19 Jan 2018 12:59:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0JCxEvE096223; Fri, 19 Jan 2018 12:59:14 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0JCxEfa096220; Fri, 19 Jan 2018 12:59:14 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201801191259.w0JCxEfa096220@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 19 Jan 2018 12:59:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328162 - in head/sys/dev/usb: net serial X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/usb: net serial X-SVN-Commit-Revision: 328162 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 12:59:16 -0000 Author: hselasky Date: Fri Jan 19 12:59:14 2018 New Revision: 328162 URL: https://svnweb.freebsd.org/changeset/base/328162 Log: Improve support for USB based 3G/4G/5G dongles from Huawei. PR: 192345 Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/net/if_cdce.c head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/serial/umodem.c Modified: head/sys/dev/usb/net/if_cdce.c ============================================================================== --- head/sys/dev/usb/net/if_cdce.c Fri Jan 19 12:50:03 2018 (r328161) +++ head/sys/dev/usb/net/if_cdce.c Fri Jan 19 12:59:14 2018 (r328162) @@ -286,6 +286,9 @@ static const STRUCT_USB_HOST_ID cdce_host_devs[] = { {USB_VENDOR(USB_VENDOR_HUAWEI), USB_IFACE_CLASS(UICLASS_VENDOR), USB_IFACE_SUBCLASS(0x02), USB_IFACE_PROTOCOL(0x76), USB_DRIVER_INFO(0)}, + {USB_VENDOR(USB_VENDOR_HUAWEI), USB_IFACE_CLASS(UICLASS_VENDOR), + USB_IFACE_SUBCLASS(0x03), USB_IFACE_PROTOCOL(0x16), + USB_DRIVER_INFO(0)}, }; static const STRUCT_USB_DUAL_ID cdce_dual_devs[] = { Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Fri Jan 19 12:50:03 2018 (r328161) +++ head/sys/dev/usb/serial/u3g.c Fri Jan 19 12:59:14 2018 (r328162) @@ -308,7 +308,7 @@ static const STRUCT_USB_HOST_ID u3g_devs[] = { U3G_DEV(HUAWEI, E173, 0), U3G_DEV(HUAWEI, E173_INIT, U3GINIT_HUAWEISCSI), U3G_DEV(HUAWEI, E3131, 0), - U3G_DEV(HUAWEI, E3131_INIT, U3GINIT_HUAWEISCSI), + U3G_DEV(HUAWEI, E3131_INIT, U3GINIT_HUAWEISCSI2), U3G_DEV(HUAWEI, E180V, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, E220, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, E220BIS, U3GINIT_HUAWEI), @@ -329,6 +329,8 @@ static const STRUCT_USB_HOST_ID u3g_devs[] = { U3G_DEV(HUAWEI, K4505, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, K4505_INIT, U3GINIT_HUAWEISCSI), U3G_DEV(HUAWEI, ETS2055, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E3272_INIT, U3GINIT_HUAWEISCSI2), + U3G_DEV(HUAWEI, E3272, 0), U3G_DEV(KYOCERA2, CDMA_MSM_K, 0), U3G_DEV(KYOCERA2, KPC680, 0), U3G_DEV(LONGCHEER, WM66, U3GINIT_HUAWEI), @@ -631,6 +633,45 @@ u3g_huawei_init(struct usb_device *udev) return (0); } +static int +u3g_huawei_is_cdce(uint16_t idVendor, uint8_t bInterfaceSubClass, + uint8_t bInterfaceProtocol) +{ + /* + * This function returns non-zero if the interface being + * probed is of type CDC ethernet, which the U3G driver should + * not attach to. See sys/dev/usb/net/if_cdce.c for matching + * entries. + */ + if (idVendor != USB_VENDOR_HUAWEI) + goto done; + + switch (bInterfaceSubClass) { + case 0x02: + switch (bInterfaceProtocol) { + case 0x16: + case 0x46: + case 0x76: + return (1); + default: + break; + } + break; + case 0x03: + switch (bInterfaceProtocol) { + case 0x16: + return (1); + default: + break; + } + break; + default: + break; + } +done: + return (0); +} + static void u3g_sael_m460_init(struct usb_device *udev) { @@ -844,6 +885,10 @@ u3g_probe(device_t self) if (uaa->info.bInterfaceClass != UICLASS_VENDOR) { return (ENXIO); } + if (u3g_huawei_is_cdce(uaa->info.idVendor, uaa->info.bInterfaceSubClass, + uaa->info.bInterfaceProtocol)) { + return (ENXIO); + } return (usbd_lookup_id_by_uaa(u3g_devs, sizeof(u3g_devs), uaa)); } @@ -886,6 +931,9 @@ u3g_attach(device_t dev) break; id = usbd_get_interface_descriptor(iface); if (id == NULL || id->bInterfaceClass != UICLASS_VENDOR) + continue; + if (u3g_huawei_is_cdce(uaa->info.idVendor, + id->bInterfaceSubClass, id->bInterfaceProtocol)) continue; usbd_set_parent_iface(uaa->device, i, uaa->info.bIfaceIndex); iface_valid |= (1< Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78DF2ED4C3F; Fri, 19 Jan 2018 13:06:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5529081022; Fri, 19 Jan 2018 13:06:37 +0000 (UTC) (envelope-from hselasky@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 981535CDD; Fri, 19 Jan 2018 13:06:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0JD6awE001162; Fri, 19 Jan 2018 13:06:36 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0JD6a0e001160; Fri, 19 Jan 2018 13:06:36 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201801191306.w0JD6a0e001160@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 19 Jan 2018 13:06:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328163 - in head/sys/dev/usb: . serial X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/usb: . serial X-SVN-Commit-Revision: 328163 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 13:06:37 -0000 Author: hselasky Date: Fri Jan 19 13:06:36 2018 New Revision: 328163 URL: https://svnweb.freebsd.org/changeset/base/328163 Log: Add new USB ID to U3G driver. PR: 134299 MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Fri Jan 19 12:59:14 2018 (r328162) +++ head/sys/dev/usb/serial/u3g.c Fri Jan 19 13:06:36 2018 (r328163) @@ -200,6 +200,7 @@ static driver_t u3g_driver = { static const STRUCT_USB_HOST_ID u3g_devs[] = { #define U3G_DEV(v,p,i) { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i) } + U3G_DEV(ABIT, AK_020, 0), U3G_DEV(ACERP, H10, 0), U3G_DEV(AIRPLUS, MCD650, 0), U3G_DEV(AIRPRIME, PC5220, 0), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Fri Jan 19 12:59:14 2018 (r328162) +++ head/sys/dev/usb/usbdevs Fri Jan 19 13:06:36 2018 (r328163) @@ -668,6 +668,7 @@ vendor SOUNDGRAPH 0x15c2 Soundgraph, Inc. vendor AMIT2 0x15c5 AMIT vendor TEXTECH 0x15ca Textech International Ltd. vendor SOHOWARE 0x15e8 SOHOware +vendor ABIT 0x15eb ABIT Corporation vendor UMAX 0x1606 UMAX Data Systems vendor INSIDEOUT 0x1608 Inside Out Networks vendor AMOI 0x1614 Amoi Electronics @@ -816,6 +817,9 @@ product 3COMUSR USR56K 0x3021 U.S. Robotics 56000 Voi /* Abbott Diabetics */ product ABBOTT STEREO_PLUG 0x3410 Abbott Diabetics Stereo Plug product ABBOTT STRIP_PORT 0x3420 Abbott Diabetics Strip Port + +/* ABIT products */ +product ABIT AK_020 0x7d0e 3G modem /* AboCom products */ product ABOCOM XX1 0x110c XX1 From owner-svn-src-head@freebsd.org Fri Jan 19 14:50:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40268EB64EF; Fri, 19 Jan 2018 14:50:54 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 19E7484DED; Fri, 19 Jan 2018 14:50:54 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 69AB76D46; Fri, 19 Jan 2018 14:50:53 +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 w0JEortb046788; Fri, 19 Jan 2018 14:50:53 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0JEorAI046787; Fri, 19 Jan 2018 14:50:53 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201801191450.w0JEorAI046787@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 19 Jan 2018 14:50:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328164 - head/sys/contrib/libnv X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/contrib/libnv X-SVN-Commit-Revision: 328164 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 14:50:54 -0000 Author: pfg Date: Fri Jan 19 14:50:53 2018 New Revision: 328164 URL: https://svnweb.freebsd.org/changeset/base/328164 Log: libnv: Use mallocarray(9) for the nv_calloc. Modified: head/sys/contrib/libnv/nv_impl.h Modified: head/sys/contrib/libnv/nv_impl.h ============================================================================== --- head/sys/contrib/libnv/nv_impl.h Fri Jan 19 13:06:36 2018 (r328163) +++ head/sys/contrib/libnv/nv_impl.h Fri Jan 19 14:50:53 2018 (r328164) @@ -51,7 +51,7 @@ typedef struct nvpair nvpair_t; #ifdef _KERNEL #define nv_malloc(size) malloc((size), M_NVLIST, M_WAITOK) -#define nv_calloc(n, size) malloc((n) * (size), M_NVLIST, \ +#define nv_calloc(n, size) mallocarray((n), (size), M_NVLIST, \ M_WAITOK | M_ZERO) #define nv_realloc(buf, size) realloc((buf), (size), M_NVLIST, \ M_WAITOK) From owner-svn-src-head@freebsd.org Fri Jan 19 14:57:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43AEEEB6B2A; Fri, 19 Jan 2018 14:57:04 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from theravensnest.org (xvm-110-62.dc2.ghst.net [46.226.110.62]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "theravensnest.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C1BBF677; Fri, 19 Jan 2018 14:57:02 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from c124.sec.cl.cam.ac.uk (c124.sec.cl.cam.ac.uk [128.232.18.124]) (authenticated bits=0) by theravensnest.org (8.15.2/8.15.2) with ESMTPSA id w0JEus8a002213 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 19 Jan 2018 14:56:55 GMT (envelope-from theraven@FreeBSD.org) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r328159 - head/sys/modules From: David Chisnall In-Reply-To: Date: Fri, 19 Jan 2018 14:56:54 +0000 Cc: Benjamin Kaduk , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <244014BB-C492-48A9-9F28-0A5E713DE5EB@FreeBSD.org> References: <201801190434.w0J4Y6i7086677@repo.freebsd.org> To: cem@freebsd.org X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 14:57:04 -0000 On 19 Jan 2018, at 05:07, Conrad Meyer wrote: >=20 > The spec says the behavior is undefined; not that the compiler has to > produce a warning or error message. The compiler *does* get to > arbitrarily decide what it wants to do when it encounters UB. It is > wholly free to implement this particular UB with the logical result > and no warning/error. First, you are not correct that the only logical outcome of a shift of = greater than the width of a type is 0. In C, a right-shift of a signed = type propagates the sign bit. Right shifting a negative 32-bit int by = 16 and then again by 16 is not undefined behaviour (though doing the = shift as a single operation is) and will give you a value of -1. The spec says that it is undefined, because on some architectures there = is a right-shift instructions that produces non-zero values when = instructed to shift right more than the width of the value. A shift of greater than the width of the size requires special handling = in the compiler for some architectures and is always a logic error. = This gives two cases: Either the compiler can statically prove that the = value is too large, or it is not. Because the C spec says that it is = undefined, if the compiler cannot prove that the value is too large, = then it is free to assume that it isn=E2=80=99t. This means that the = back end can always emit instructions that produce unspecified values = for larger ranges. The compiler is free to do anything it wants in the case of UB, = including make monkeys fly out of your nose. Telling you that you have = done something obviously stupid is generally considered better than just = generating wrong code. David From owner-svn-src-head@freebsd.org Fri Jan 19 15:32:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4424DEB85D0; Fri, 19 Jan 2018 15:32:29 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1C07E21A5; Fri, 19 Jan 2018 15:32:29 +0000 (UTC) (envelope-from scottl@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E86D7510; Fri, 19 Jan 2018 15:32:28 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0JFWS0s066794; Fri, 19 Jan 2018 15:32:28 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0JFWRFD066790; Fri, 19 Jan 2018 15:32:27 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201801191532.w0JFWRFD066790@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Fri, 19 Jan 2018 15:32:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328165 - in head: sbin/camcontrol sys/cam sys/cam/mmc X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: in head: sbin/camcontrol sys/cam sys/cam/mmc X-SVN-Commit-Revision: 328165 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 15:32:29 -0000 Author: scottl Date: Fri Jan 19 15:32:27 2018 New Revision: 328165 URL: https://svnweb.freebsd.org/changeset/base/328165 Log: Revert ABI breakage to CAM that came in with MMC/SD support in r320844. Make it possible to retrieve mmc parameters via the XPT_GET_ADVINFO call instead. Convert camcontrol to the new scheme. Reviewed by: imp. kibab Sponsored by: Netflix Differential Revision: D13868 Modified: head/sbin/camcontrol/camcontrol.c head/sys/cam/cam_ccb.h head/sys/cam/cam_xpt.c head/sys/cam/mmc/mmc_xpt.c Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Fri Jan 19 14:50:53 2018 (r328164) +++ head/sbin/camcontrol/camcontrol.c Fri Jan 19 15:32:27 2018 (r328165) @@ -715,14 +715,50 @@ print_dev_semb(struct device_match_result *dev_result, static int print_dev_mmcsd(struct device_match_result *dev_result, char *tmpstr) { + union ccb *ccb; + struct ccb_dev_advinfo *advi; + struct cam_device *dev; + struct mmc_params mmc_ident_data; - if (strlen(dev_result->mmc_ident_data.model) > 0) { - sprintf(tmpstr, "<%s>", dev_result->mmc_ident_data.model); + dev = cam_open_btl(dev_result->path_id, dev_result->target_id, + dev_result->target_lun, O_RDWR, NULL); + if (dev == NULL) { + warnx("%s", cam_errbuf); + return (1); + } + + ccb = cam_getccb(dev); + if (ccb == NULL) { + warnx("couldn't allocate CCB"); + cam_close_device(dev); + return (1); + } + + advi = &ccb->cdai; + advi->ccb_h.flags = CAM_DIR_IN; + advi->ccb_h.func_code = XPT_DEV_ADVINFO; + advi->flags = CDAI_FLAG_NONE; + advi->buftype = CDAI_TYPE_MMC_PARAMS; + advi->bufsiz = sizeof(struct mmc_params); + advi->buf = (uint8_t *)&mmc_ident_data; + + if (cam_send_ccb(dev, ccb) < 0) { + warn("error sending CAMIOCOMMAND ioctl"); + cam_freeccb(ccb); + cam_close_device(dev); + return (1); + } + + if (strlen(mmc_ident_data.model) > 0) { + sprintf(tmpstr, "<%s>", mmc_ident_data.model); } else { sprintf(tmpstr, "<%s card>", - dev_result->mmc_ident_data.card_features & + mmc_ident_data.card_features & CARD_FEATURE_SDIO ? "SDIO" : "unknown"); } + + cam_freeccb(ccb); + cam_close_device(dev); return (0); } Modified: head/sys/cam/cam_ccb.h ============================================================================== --- head/sys/cam/cam_ccb.h Fri Jan 19 14:50:53 2018 (r328164) +++ head/sys/cam/cam_ccb.h Fri Jan 19 15:32:27 2018 (r328165) @@ -506,7 +506,6 @@ struct device_match_result { struct scsi_inquiry_data inq_data; struct ata_params ident_data; dev_result_flags flags; - struct mmc_params mmc_ident_data; }; struct bus_match_result { @@ -1278,6 +1277,7 @@ struct ccb_dev_advinfo { #define CDAI_TYPE_EXT_INQ 5 #define CDAI_TYPE_NVME_CNTRL 6 /* NVMe Identify Controller data */ #define CDAI_TYPE_NVME_NS 7 /* NVMe Identify Namespace data */ +#define CDAI_TYPE_MMC_PARAMS 8 /* MMC/SD ident */ off_t bufsiz; /* IN: Size of external buffer */ #define CAM_SCSI_DEVID_MAXLEN 65536 /* length in buffer is an uint16_t */ off_t provsiz; /* OUT: Size required/used */ Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Fri Jan 19 14:50:53 2018 (r328164) +++ head/sys/cam/cam_xpt.c Fri Jan 19 15:32:27 2018 (r328165) @@ -1909,9 +1909,6 @@ xptedtdevicefunc(struct cam_ed *device, void *arg) bcopy(&device->ident_data, &cdm->matches[j].result.device_result.ident_data, sizeof(struct ata_params)); - bcopy(&device->mmc_ident_data, - &cdm->matches[j].result.device_result.mmc_ident_data, - sizeof(struct mmc_params)); /* Let the user know whether this device is unconfigured */ if (device->flags & CAM_DEV_UNCONFIGURED) Modified: head/sys/cam/mmc/mmc_xpt.c ============================================================================== --- head/sys/cam/mmc/mmc_xpt.c Fri Jan 19 14:50:53 2018 (r328164) +++ head/sys/cam/mmc/mmc_xpt.c Fri Jan 19 15:32:27 2018 (r328165) @@ -367,6 +367,13 @@ mmc_dev_advinfo(union ccb *start_ccb) case CDAI_TYPE_PHYS_PATH: /* pass(4) wants this */ cdai->provsiz = 0; break; + case CDAI_TYPE_MMC_PARAMS: + cdai->provsiz = device->mmc_ident_data; + if (device->mmc_ident_data == NULL) + break; + amt = MIN(cdai->provsiz, cdai->bufsiz); + memcpy(cdai->buff, device->mmc_ident_data, amt); + break; default: panic("Unknown buftype"); return; From owner-svn-src-head@freebsd.org Fri Jan 19 15:42:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F576EB8D4A; Fri, 19 Jan 2018 15:42:36 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 07F902AB3; Fri, 19 Jan 2018 15:42:36 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 397DC76B6; Fri, 19 Jan 2018 15:42: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 w0JFgYfv070922; Fri, 19 Jan 2018 15:42:34 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0JFgY1Q070919; Fri, 19 Jan 2018 15:42:34 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201801191542.w0JFgY1Q070919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 19 Jan 2018 15:42:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328166 - in head/sys: amd64/amd64 x86/include x86/x86 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/sys: amd64/amd64 x86/include x86/x86 X-SVN-Commit-Revision: 328166 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 15:42:36 -0000 Author: emaste Date: Fri Jan 19 15:42:34 2018 New Revision: 328166 URL: https://svnweb.freebsd.org/changeset/base/328166 Log: Enable KPTI by default on amd64 for non-AMD CPUs Kernel Page Table Isolation (KPTI) was introduced in r328083 as a mitigation for the 'Meltdown' vulnerability. AMD CPUs are not affected, per https://www.amd.com/en/corporate/speculative-execution: We believe AMD processors are not susceptible due to our use of privilege level protections within paging architecture and no mitigation is required. Thus default KPTI to off for AMD CPUs, and to on for others. This may be refined later as we obtain more specific information on the sets of CPUs that are and are not affected. Submitted by: Mitchell Horne Reviewed by: cem Relnotes: Yes Security: CVE-2017-5754 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D13971 Modified: head/sys/amd64/amd64/machdep.c head/sys/x86/include/x86_var.h head/sys/x86/x86/identcpu.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Fri Jan 19 15:32:27 2018 (r328165) +++ head/sys/amd64/amd64/machdep.c Fri Jan 19 15:42:34 2018 (r328166) @@ -1621,6 +1621,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) mtx_init(&dt_lock, "descriptor tables", NULL, MTX_DEF); /* exceptions */ + pti = pti_get_default(); TUNABLE_INT_FETCH("vm.pmap.pti", &pti); for (x = 0; x < NIDT; x++) Modified: head/sys/x86/include/x86_var.h ============================================================================== --- head/sys/x86/include/x86_var.h Fri Jan 19 15:32:27 2018 (r328165) +++ head/sys/x86/include/x86_var.h Fri Jan 19 15:42:34 2018 (r328166) @@ -136,6 +136,7 @@ void nmi_call_kdb_smp(u_int type, struct trapframe *fr void nmi_handle_intr(u_int type, struct trapframe *frame); void pagecopy(void *from, void *to); void printcpuinfo(void); +int pti_get_default(void); int user_dbreg_trap(void); int minidumpsys(struct dumperinfo *); struct pcb *get_pcb_td(struct thread *td); Modified: head/sys/x86/x86/identcpu.c ============================================================================== --- head/sys/x86/x86/identcpu.c Fri Jan 19 15:32:27 2018 (r328165) +++ head/sys/x86/x86/identcpu.c Fri Jan 19 15:42:34 2018 (r328166) @@ -1608,6 +1608,16 @@ finishidentcpu(void) #endif } +int +pti_get_default(void) +{ + + if (strcmp(cpu_vendor, AMD_VENDOR_ID) == 0) + return (0); + + return (1); +} + static u_int find_cpu_vendor_id(void) { From owner-svn-src-head@freebsd.org Fri Jan 19 17:05:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E376EBCFB7; Fri, 19 Jan 2018 17:05:03 +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 10CA569E2D; Fri, 19 Jan 2018 17:05:02 +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 w0JH4suV072968; Fri, 19 Jan 2018 09:04:54 -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 w0JH4rgT072967; Fri, 19 Jan 2018 09:04:53 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201801191704.w0JH4rgT072967@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r327354 - head/sys/vm In-Reply-To: <601ee1a2-8f4e-518d-4c86-89871cd652af@vangyzen.net> To: Eric van Gyzen Date: Fri, 19 Jan 2018 09:04:53 -0800 (PST) CC: Gleb Smirnoff , Konstantin Belousov , 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-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 17:05:03 -0000 > On 01/17/2018 16:40, Gleb Smirnoff wrote: > > On Fri, Dec 29, 2017 at 07:05:07PM +0000, Konstantin Belousov wrote: > > K> Author: kib > > K> Date: Fri Dec 29 19:05:07 2017 > > K> New Revision: 327354 > > K> URL: https://svnweb.freebsd.org/changeset/base/327354 > > K> > > K> Log: > > K> Style. > > K> > > K> Reviewed by: alc > > K> Sponsored by: The FreeBSD Foundation > > K> MFC after: 1 week > > K> Differential revision: https://reviews.freebsd.org/D13678 > > K> > > K> Modified: > > K> head/sys/vm/vm_swapout.c > > K> > > K> Modified: head/sys/vm/vm_swapout.c > > K> ============================================================================== > > K> --- head/sys/vm/vm_swapout.c Fri Dec 29 18:42:55 2017 (r327353) > > K> +++ head/sys/vm/vm_swapout.c Fri Dec 29 19:05:07 2017 (r327354) > > K> @@ -556,16 +556,14 @@ vm_thread_swapin(struct thread *td) > > K> { > > K> vm_object_t ksobj; > > K> vm_page_t ma[KSTACK_MAX_PAGES]; > > K> - int pages; > > K> + int a, count, i, j, pages, rv; > > K> > > K> pages = td->td_kstack_pages; > > K> ksobj = td->td_kstack_obj; > > K> VM_OBJECT_WLOCK(ksobj); > > K> (void)vm_page_grab_pages(ksobj, 0, VM_ALLOC_NORMAL | VM_ALLOC_WIRED, ma, > > K> pages); > > K> - for (int i = 0; i < pages;) { > > K> - int j, a, count, rv; > > K> - > > K> + for (i = 0; i < pages;) { > > K> vm_page_assert_xbusied(ma[i]); > > K> if (ma[i]->valid == VM_PAGE_BITS_ALL) { > > K> vm_page_xunbusy(ma[i]); > > > > Yeah, style is sacred, but is there a single person on Earth who would > > not agree that moving variables from smaller blocks to function block > > reduces readability of the code? > > I agree that it reduces the readability. Not only that, it also > encourages real bugs by allowing access to the variable when it does not > make sense. I am mixed on if it changes readability or not, in the current style case it unclutters the code of declarations scattered about, in the other case it may make it further away to find a declaration. BUT I do not believe this bit of "style" has anything to do with readability of code, and has more to do with how code runs on a processor and stack frames. If you defer the declaration of "int i" in the above code does that compiler emmit code to allocate a new stack frame, or does it just add space to the function stack frame for this? What happens if you do for (int i = 0; i < pages;) { } for (int i = 1; i < pages;) { } as 2 seperate loops, do we allocate 2 i's on the stack at function startup, or do we defer and allacte each one only when that basic block runs, or do we allocate 1 i and reuse it, I know that the compiler makes functional code but how is that functionality done? The current style leaves no doubt about how things are done from that perspective. Just my $0.05, inflation and all.... > Eric -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri Jan 19 17:24:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9D59EBDE01; Fri, 19 Jan 2018 17:24:59 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f170.google.com (mail-io0-f170.google.com [209.85.223.170]) (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 A80BB6AB8B; Fri, 19 Jan 2018 17:24:59 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f170.google.com with SMTP id c17so2927430iod.1; Fri, 19 Jan 2018 09:24:59 -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=n4n0bPVhfn9vmotAEAtRVe1/6pjap7l783ccIdWt72o=; b=b22zdDqoGJD75lQ9bFyebsCefXk2L5tPBiZt0jbk5frtls7vwyDJRMl9GJj5oXhy1S csQEMOXQFMHwOWKynY90GZlwOExzBrgHlQ5x2bK60Vl3+L0t1dXlzBn895xuUskLyo6i fEDwFrJFm6UA0PP9up6HynzIk2dnQMMpsATtVuHb5/J/qBAHX8iyj3UM3O+USDow+Hfp XE/b9P6FpB9iKxoJZpeGqgSCV+5HywG33KUtEFgzI58nlTaa0p9+ZahyamFwyoLmFhQ2 mQUwFi+nwkRUxGq+w3zBngwSrBidUTu3nlXHfY6RkHAX707yMWm/wOHw5Gj9ROxrV+At qS6A== X-Gm-Message-State: AKwxytelf7u+PBsx9wOSqznkWX0cFxXIGkIaDswJ6T2XRvvYT6P4vqxT +wPNOtXR49SE8tFrizh3XGZIPen2 X-Google-Smtp-Source: ACJfBotLrByiEkk2ojyGiHLra/4zz+gTrEj+X8kWwuK+3gLIIfnxme/yfQiPxa/QrHsL8SRvXPT7Jg== X-Received: by 10.107.69.8 with SMTP id s8mr17443417ioa.156.1516381218420; Fri, 19 Jan 2018 09:00:18 -0800 (PST) Received: from mail-io0-f181.google.com (mail-io0-f181.google.com. [209.85.223.181]) by smtp.gmail.com with ESMTPSA id 202sm5229128ioz.84.2018.01.19.09.00.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Jan 2018 09:00:18 -0800 (PST) Received: by mail-io0-f181.google.com with SMTP id t22so2835380ioa.7; Fri, 19 Jan 2018 09:00:18 -0800 (PST) X-Received: by 10.107.131.210 with SMTP id n79mr27074455ioi.215.1516381217914; Fri, 19 Jan 2018 09:00:17 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.95.152 with HTTP; Fri, 19 Jan 2018 09:00:17 -0800 (PST) In-Reply-To: <244014BB-C492-48A9-9F28-0A5E713DE5EB@FreeBSD.org> References: <201801190434.w0J4Y6i7086677@repo.freebsd.org> <244014BB-C492-48A9-9F28-0A5E713DE5EB@FreeBSD.org> From: Conrad Meyer Date: Fri, 19 Jan 2018 09:00:17 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r328159 - head/sys/modules To: 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-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 17:24:59 -0000 On Fri, Jan 19, 2018 at 6:56 AM, David Chisnall wrote: > In C, a right-shift of a signed type propagates the sign bit. Right shifting a negative 32-bit int by 16 and then again by 16 is not undefined behaviour (though doing the shift as a single operation is) and will give you a value of -1. The left hand operand under discussion is unsigned. In LLVM/assembler terms, this is a logical right shift, not an arithmetic right shift. It is by definition zero filled from the left. From owner-svn-src-head@freebsd.org Fri Jan 19 17:25:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3163EBDE9F; Fri, 19 Jan 2018 17:25:37 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f50.google.com (mail-it0-f50.google.com [209.85.214.50]) (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 72CC46ACEE; Fri, 19 Jan 2018 17:25:37 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f50.google.com with SMTP id q8so2950793itb.2; Fri, 19 Jan 2018 09:25:37 -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:content-transfer-encoding; bh=NqcTeVaRpCAwMDsQ5w0PqBfssSU+XnXlG/ahCDPDHE8=; b=Y0v2eVklV2x8tU64g8A+GfDUsddDgE+sA0N3nVyPsFjJ/PsseW5/NRbCoGXHbZTVRW 9KQ4MxcJFTd6Gqa3LmRFaNz1mzPzGHo2CUOu9/0k9uKCszV4MbAppFqqS1iMZfsCjYo1 j+kv086ON80pxc0fZhKxFnKE4BQiP2NvjF0bCZzlnwY3jHIL5JlCfS70GUQQmSHx4c29 7VQDvaqkd6Bx3eCxdMDwcPJ4rr6fjVytBkI+LX8qPZ5TzAF2eVPdY6ylkJg3DunAHVWc A4wPLs5jVWC09wSa2dqXSjWeLtXfC3+s+ZogVsxg4+YvHO2FWOByM9iab8IDeHyAKK8k Jluw== X-Gm-Message-State: AKwxytd3A245TxhV+0EAPclyqVETvFY/KFdDFjfAQzo1jweGqY6wi5p0 saCuAsRVef+FAsXR9CCr48Ebyhr+ X-Google-Smtp-Source: ACJfBovHLnZMuOdw837C2MgsJ6UefcKYAYWo2PXe7chbZwymUN4dWub9HNdPGSpiU9n89pZaN3iwJw== X-Received: by 10.36.164.6 with SMTP id z6mr31240599ite.2.1516382735830; Fri, 19 Jan 2018 09:25:35 -0800 (PST) Received: from mail-it0-f42.google.com (mail-it0-f42.google.com. [209.85.214.42]) by smtp.gmail.com with ESMTPSA id q136sm3449700ioe.34.2018.01.19.09.25.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Jan 2018 09:25:35 -0800 (PST) Received: by mail-it0-f42.google.com with SMTP id 196so2935273iti.5; Fri, 19 Jan 2018 09:25:35 -0800 (PST) X-Received: by 10.36.114.193 with SMTP id x184mr31592438itc.71.1516382735327; Fri, 19 Jan 2018 09:25:35 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.95.152 with HTTP; Fri, 19 Jan 2018 09:25:34 -0800 (PST) In-Reply-To: <201801191704.w0JH4rgT072967@pdx.rh.CN85.dnsmgr.net> References: <601ee1a2-8f4e-518d-4c86-89871cd652af@vangyzen.net> <201801191704.w0JH4rgT072967@pdx.rh.CN85.dnsmgr.net> From: Conrad Meyer Date: Fri, 19 Jan 2018 09:25:34 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r327354 - head/sys/vm To: "Rodney W. Grimes" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 17:25:37 -0000 On Fri, Jan 19, 2018 at 9:04 AM, Rodney W. Grimes wrote: > BUT I do not believe this bit of "style" has anything to do with > readability of code, and has more to do with how code runs on a > processor and stack frames. If you defer the declaration of > "int i" in the above code does that compiler emmit code to allocate > a new stack frame, or does it just add space to the function stack > frame for this? > > What happens if you do > for (int i =3D 0; i < pages;) { } > > for (int i =3D 1; i < pages;) { } > as 2 seperate loops, do we allocate 2 i's on the stack at > function startup, or do we defer and allacte each one > only when that basic block runs, or do we allocate 1 i > and reuse it, I know that the compiler makes functional > code but how is that functionality done? The current > style leaves no doubt about how things are done from > that perspective. Modern (and I'm using that word very loosely here =E2=80=94 think GCC did t= his 10+ years ago) optimizing compilers do something called liveness tracking[0] for variables to determine the scope they are used in (something like the region between last write and last read). So in that sense, optimizing compilers do not care whether you declare the variable at function scope or local scope =E2=80=94 they always determine t= he local scope the variable is alive in. (Other than for shadowing, which we strongly discourage and is considered bad style.) Liveness analysis is part of register allocation[1], which typically uses a graph coloring algorithm to determine the minimal number of distinct registers needed to hold live values. If the number of registers needed is more than the machine provides, some values must be spilled to the stack. (On modern x86 it doesn't matter too much what you spill to the stack, because the top few words of the stack region is actually quite fast, but clever compilers targeting other platforms may attempt to spill less frequently accessed values.) I think I recall Clang and other LLVM frontends do something nutty when they emit intermediary representation, like using a new register for each assignment. This relies on the register allocater to reduce that to something sane for the target machine. Best, Conrad [0]: https://en.wikipedia.org/wiki/Live_variable_analysis [1]: https://en.wikipedia.org/wiki/Register_allocation From owner-svn-src-head@freebsd.org Fri Jan 19 17:37:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74C0FEBE52F; Fri, 19 Jan 2018 17:37:24 +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 577256B3E0; Fri, 19 Jan 2018 17:37:23 +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 w0JHbMiG073098; Fri, 19 Jan 2018 09:37:22 -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 w0JHbM90073097; Fri, 19 Jan 2018 09:37:22 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201801191737.w0JHbM90073097@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r328159 - head/sys/modules In-Reply-To: To: cem@freebsd.org Date: Fri, 19 Jan 2018 09:37:22 -0800 (PST) CC: David Chisnall , 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-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 17:37:24 -0000 [ Charset UTF-8 unsupported, converting... ] > On Fri, Jan 19, 2018 at 6:56 AM, David Chisnall wrote: > > In C, a right-shift of a signed type propagates the sign bit. Right shifting a negative 32-bit int by 16 and then again by 16 is not undefined behaviour (though doing the shift as a single operation is) and will give you a value of -1. > > The left hand operand under discussion is unsigned. In LLVM/assembler > terms, this is a logical right shift, not an arithmetic right shift. > It is by definition zero filled from the left. If you think in assembler it is easy to understand why this is UB, most (all) architectures Right Logic or Arithmetic Shift only accept an operand that is a size that can hold log2(wordsize). Do you want the compiler to emmit multiple Shift instructions for your oversized operand? Do you want it to emmit a loop reducing your oversized operand by log2(wordsize) each time through the loop until your operand is < log2(wordsize)? Bite the bullet, this is bad code, and should be fixed, not simply sweep under the carpet cause it fails on i386. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri Jan 19 17:46:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0A2BEBEADA; Fri, 19 Jan 2018 17:46:33 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C8D376BA03; Fri, 19 Jan 2018 17:46:33 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1BEA310ACA; Fri, 19 Jan 2018 17:46:33 +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 w0JHkW61023995; Fri, 19 Jan 2018 17:46:32 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0JHkVcg023981; Fri, 19 Jan 2018 17:46:31 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201801191746.w0JHkVcg023981@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Fri, 19 Jan 2018 17:46:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328168 - in head/sys: amd64/include arm/include arm64/include compat/linuxkpi/common/src dev/efidev i386/include kern mips/include powerpc/include riscv/include sparc64/include sys vm X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: in head/sys: amd64/include arm/include arm64/include compat/linuxkpi/common/src dev/efidev i386/include kern mips/include powerpc/include riscv/include sparc64/include sys vm X-SVN-Commit-Revision: 328168 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 17:46:34 -0000 Author: nwhitehorn Date: Fri Jan 19 17:46:31 2018 New Revision: 328168 URL: https://svnweb.freebsd.org/changeset/base/328168 Log: Remove SFBUF_OPTIONAL_DIRECT_MAP and such hacks, replacing them across the kernel by PHYS_TO_DMAP() as previously present on amd64, arm64, riscv, and powerpc64. This introduces a new MI macro (PMAP_HAS_DMAP) that can be evaluated at runtime to determine if the architecture has a direct map; if it does not (or does) unconditionally and PMAP_HAS_DMAP is either 0 or 1, the compiler can remove the conditional logic. As part of this, implement PHYS_TO_DMAP() on sparc64 and mips64, which had similar things but spelled differently. 32-bit MIPS has a partial direct-map that maps poorly to this concept and is unchanged. Reviewed by: kib Suggestions from: marius, alc, kib Runtime tested on: amd64, powerpc64, powerpc, mips64 Modified: head/sys/amd64/include/vmparam.h head/sys/arm/include/vmparam.h head/sys/arm64/include/vmparam.h head/sys/compat/linuxkpi/common/src/linux_page.c head/sys/dev/efidev/efirt.c head/sys/i386/include/vmparam.h head/sys/kern/subr_sfbuf.c head/sys/mips/include/vmparam.h head/sys/powerpc/include/vmparam.h head/sys/riscv/include/vmparam.h head/sys/sparc64/include/vmparam.h head/sys/sys/sf_buf.h head/sys/vm/vm_page.c Modified: head/sys/amd64/include/vmparam.h ============================================================================== --- head/sys/amd64/include/vmparam.h Fri Jan 19 16:06:52 2018 (r328167) +++ head/sys/amd64/include/vmparam.h Fri Jan 19 17:46:31 2018 (r328168) @@ -190,6 +190,7 @@ * because the result is not actually accessed until later, but the early * vt fb startup needs to be reworked. */ +#define PMAP_HAS_DMAP 1 #define PHYS_TO_DMAP(x) ({ \ KASSERT(dmaplimit == 0 || (x) < dmaplimit, \ ("physical address %#jx not covered by the DMAP", \ Modified: head/sys/arm/include/vmparam.h ============================================================================== --- head/sys/arm/include/vmparam.h Fri Jan 19 16:06:52 2018 (r328167) +++ head/sys/arm/include/vmparam.h Fri Jan 19 17:46:31 2018 (r328168) @@ -187,6 +187,8 @@ extern vm_offset_t vm_max_kernel_address; #define SFBUF #define SFBUF_MAP +#define PMAP_HAS_DMAP 0 + #define DEVMAP_MAX_VADDR ARM_VECTORS_HIGH #endif /* _MACHINE_VMPARAM_H_ */ Modified: head/sys/arm64/include/vmparam.h ============================================================================== --- head/sys/arm64/include/vmparam.h Fri Jan 19 16:06:52 2018 (r328167) +++ head/sys/arm64/include/vmparam.h Fri Jan 19 17:46:31 2018 (r328168) @@ -176,6 +176,7 @@ #define VIRT_IN_DMAP(va) ((va) >= DMAP_MIN_ADDRESS && \ (va) < (dmap_max_addr)) +#define PMAP_HAS_DMAP 1 #define PHYS_TO_DMAP(pa) \ ({ \ KASSERT(PHYS_IN_DMAP(pa), \ Modified: head/sys/compat/linuxkpi/common/src/linux_page.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_page.c Fri Jan 19 16:06:52 2018 (r328167) +++ head/sys/compat/linuxkpi/common/src/linux_page.c Fri Jan 19 17:46:31 2018 (r328168) @@ -63,19 +63,14 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined(__amd64__) || defined(__aarch64__) || defined(__riscv) -#define LINUXKPI_HAVE_DMAP -#else -#undef LINUXKPI_HAVE_DMAP -#endif - void * linux_page_address(struct page *page) { if (page->object != kmem_object && page->object != kernel_object) { -#ifdef LINUXKPI_HAVE_DMAP - return ((void *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(page))); +#ifdef PHYS_TO_DMAP + return (PMAP_HAS_DMAP ? + ((void *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(page))) : NULL); #else return (NULL); #endif @@ -87,7 +82,8 @@ linux_page_address(struct page *page) vm_page_t linux_alloc_pages(gfp_t flags, unsigned int order) { -#ifdef LINUXKPI_HAVE_DMAP +#ifdef PHYS_TO_DMAP + KASSERT(PMAP_HAS_DMAP, ("Direct map unavailable")); unsigned long npages = 1UL << order; int req = (flags & M_ZERO) ? (VM_ALLOC_ZERO | VM_ALLOC_NOOBJ | VM_ALLOC_NORMAL) : (VM_ALLOC_NOOBJ | VM_ALLOC_NORMAL); @@ -145,23 +141,27 @@ retry: void linux_free_pages(vm_page_t page, unsigned int order) { -#ifdef LINUXKPI_HAVE_DMAP - unsigned long npages = 1UL << order; - unsigned long x; +#ifdef PHYS_TO_DMAP + if (PMAP_HAS_DMAP) { + unsigned long npages = 1UL << order; + unsigned long x; - for (x = 0; x != npages; x++) { - vm_page_t pgo = page + x; + for (x = 0; x != npages; x++) { + vm_page_t pgo = page + x; - vm_page_lock(pgo); - vm_page_free(pgo); - vm_page_unlock(pgo); - } -#else - vm_offset_t vaddr; + vm_page_lock(pgo); + vm_page_free(pgo); + vm_page_unlock(pgo); + } + } else { +#endif + vm_offset_t vaddr; - vaddr = (vm_offset_t)page_address(page); + vaddr = (vm_offset_t)page_address(page); - linux_free_kmem(vaddr, order); + linux_free_kmem(vaddr, order); +#ifdef PHYS_TO_DMAP + } #endif } Modified: head/sys/dev/efidev/efirt.c ============================================================================== --- head/sys/dev/efidev/efirt.c Fri Jan 19 16:06:52 2018 (r328167) +++ head/sys/dev/efidev/efirt.c Fri Jan 19 17:46:31 2018 (r328168) @@ -114,6 +114,11 @@ efi_init(void) printf("EFI systbl not available\n"); return (0); } + if (!PMAP_HAS_DMAP) { + if (bootverbose) + printf("EFI systbl requires direct map\n"); + return (0); + } efi_systbl = (struct efi_systbl *)PHYS_TO_DMAP(efi_systbl_phys); if (efi_systbl->st_hdr.th_sig != EFI_SYSTBL_SIG) { efi_systbl = NULL; Modified: head/sys/i386/include/vmparam.h ============================================================================== --- head/sys/i386/include/vmparam.h Fri Jan 19 16:06:52 2018 (r328167) +++ head/sys/i386/include/vmparam.h Fri Jan 19 17:46:31 2018 (r328168) @@ -202,4 +202,6 @@ #define SFBUF_CPUSET #define SFBUF_PROCESS_PAGE +#define PMAP_HAS_DMAP 0 + #endif /* _MACHINE_VMPARAM_H_ */ Modified: head/sys/kern/subr_sfbuf.c ============================================================================== --- head/sys/kern/subr_sfbuf.c Fri Jan 19 16:06:52 2018 (r328167) +++ head/sys/kern/subr_sfbuf.c Fri Jan 19 17:46:31 2018 (r328168) @@ -88,10 +88,8 @@ sf_buf_init(void *arg) vm_offset_t sf_base; int i; -#ifdef SFBUF_OPTIONAL_DIRECT_MAP - if (SFBUF_OPTIONAL_DIRECT_MAP) + if (PMAP_HAS_DMAP) return; -#endif nsfbufs = NSFBUFS; TUNABLE_INT_FETCH("kern.ipc.nsfbufs", &nsfbufs); @@ -119,10 +117,8 @@ sf_buf_alloc(struct vm_page *m, int flags) struct sf_buf *sf; int error; -#ifdef SFBUF_OPTIONAL_DIRECT_MAP - if (SFBUF_OPTIONAL_DIRECT_MAP) + if (PMAP_HAS_DMAP) return ((struct sf_buf *)m); -#endif KASSERT(curthread->td_pinned > 0 || (flags & SFB_CPUPRIVATE) == 0, ("sf_buf_alloc(SFB_CPUPRIVATE): curthread not pinned")); @@ -181,10 +177,8 @@ void sf_buf_free(struct sf_buf *sf) { -#ifdef SFBUF_OPTIONAL_DIRECT_MAP - if (SFBUF_OPTIONAL_DIRECT_MAP) + if (PMAP_HAS_DMAP) return; -#endif mtx_lock(&sf_buf_lock); sf->ref_count--; @@ -205,10 +199,8 @@ void sf_buf_ref(struct sf_buf *sf) { -#ifdef SFBUF_OPTIONAL_DIRECT_MAP - if (SFBUF_OPTIONAL_DIRECT_MAP) + if (PMAP_HAS_DMAP) return; -#endif mtx_lock(&sf_buf_lock); KASSERT(sf->ref_count > 0, ("%s: sf %p not allocated", __func__, sf)); Modified: head/sys/mips/include/vmparam.h ============================================================================== --- head/sys/mips/include/vmparam.h Fri Jan 19 16:06:52 2018 (r328167) +++ head/sys/mips/include/vmparam.h Fri Jan 19 17:46:31 2018 (r328168) @@ -189,6 +189,12 @@ #ifndef __mips_n64 #define SFBUF #define SFBUF_MAP +#define PMAP_HAS_DMAP 0 +#else +#define PMAP_HAS_DMAP 1 #endif + +#define PHYS_TO_DMAP(x) MIPS_PHYS_TO_DIRECT(x) +#define DMAP_TO_PHYS(x) MIPS_DIRECT_TO_PHYS(x) #endif /* !_MACHINE_VMPARAM_H_ */ Modified: head/sys/powerpc/include/vmparam.h ============================================================================== --- head/sys/powerpc/include/vmparam.h Fri Jan 19 16:06:52 2018 (r328167) +++ head/sys/powerpc/include/vmparam.h Fri Jan 19 17:46:31 2018 (r328168) @@ -37,6 +37,10 @@ #ifndef _MACHINE_VMPARAM_H_ #define _MACHINE_VMPARAM_H_ +#ifndef LOCORE +#include +#endif + #define USRSTACK SHAREDPAGE #ifndef MAXTSIZ @@ -236,17 +240,25 @@ struct pmap_physseg { */ #define SFBUF #define SFBUF_NOMD -#define SFBUF_OPTIONAL_DIRECT_MAP hw_direct_map -#define SFBUF_PHYS_DMAP(x) (x) /* - * We (usually) have a direct map of all physical memory. All - * uses of this macro must be gated by a check on hw_direct_map! - * The location of the direct map may not be 1:1 in future, so use - * of the macro is recommended; it may also grow an assert that hw_direct_map - * is set. + * We (usually) have a direct map of all physical memory, so provide + * a macro to use to get the kernel VA address for a given PA. Returns + * 0 if the direct map is unavailable. The location of the direct map + * may not be 1:1 in future, so use of the macro is recommended. */ -#define PHYS_TO_DMAP(x) x -#define DMAP_TO_PHYS(x) x - +#ifdef __powerpc64__ +#define DMAP_BASE_ADDRESS 0x0000000000000000UL +#else +#define DMAP_BASE_ADDRESS 0x00000000UL +#endif + +#define PMAP_HAS_DMAP (hw_direct_map) +#define PHYS_TO_DMAP(x) ({ \ + KASSERT(hw_direct_map, ("Direct map not provided by PMAP")); \ + (x) | DMAP_BASE_ADDRESS; }) +#define DMAP_TO_PHYS(x) ({ \ + KASSERT(hw_direct_map, ("Direct map not provided by PMAP")); \ + (x) &~ DMAP_BASE_ADDRESS; }) + #endif /* _MACHINE_VMPARAM_H_ */ Modified: head/sys/riscv/include/vmparam.h ============================================================================== --- head/sys/riscv/include/vmparam.h Fri Jan 19 16:06:52 2018 (r328167) +++ head/sys/riscv/include/vmparam.h Fri Jan 19 17:46:31 2018 (r328168) @@ -170,6 +170,7 @@ #define VIRT_IN_DMAP(va) ((va) >= DMAP_MIN_ADDRESS && \ (va) < (dmap_max_addr)) +#define PMAP_HAS_DMAP 1 #define PHYS_TO_DMAP(pa) \ ({ \ KASSERT(PHYS_IN_DMAP(pa), \ Modified: head/sys/sparc64/include/vmparam.h ============================================================================== --- head/sys/sparc64/include/vmparam.h Fri Jan 19 16:06:52 2018 (r328167) +++ head/sys/sparc64/include/vmparam.h Fri Jan 19 17:46:31 2018 (r328168) @@ -240,10 +240,12 @@ extern vm_offset_t vm_max_kernel_address; */ #define ZERO_REGION_SIZE PAGE_SIZE +#include + #define SFBUF #define SFBUF_MAP -#define SFBUF_OPTIONAL_DIRECT_MAP dcache_color_ignore -#include -#define SFBUF_PHYS_DMAP(x) TLB_PHYS_TO_DIRECT(x) + +#define PMAP_HAS_DMAP dcache_color_ignore +#define PHYS_TO_DMAP(x) (TLB_PHYS_TO_DIRECT(x)) #endif /* !_MACHINE_VMPARAM_H_ */ Modified: head/sys/sys/sf_buf.h ============================================================================== --- head/sys/sys/sf_buf.h Fri Jan 19 16:06:52 2018 (r328167) +++ head/sys/sys/sf_buf.h Fri Jan 19 17:46:31 2018 (r328168) @@ -77,9 +77,6 @@ struct sfstat { /* sendfile statistics */ * that do no invalidate cache on the rest of CPUs. * SFBUF_NOMD This machine doesn't have machine/sf_buf.h * - * SFBUF_OPTIONAL_DIRECT_MAP Value of this define is used as boolean - * variable that tells whether machine is - * capable of direct map or not at runtime. * SFBUF_MAP This machine provides its own sf_buf_map() and * sf_buf_unmap(). * SFBUF_PROCESS_PAGE This machine provides sf_buf_process_page() @@ -109,9 +106,6 @@ struct sf_buf; #ifndef SFBUF_NOMD #include #endif -#ifdef SFBUF_OPTIONAL_DIRECT_MAP -#include -#endif #ifdef SFBUF struct sf_buf *sf_buf_alloc(struct vm_page *, int); @@ -121,9 +115,9 @@ void sf_buf_ref(struct sf_buf *); static inline vm_offset_t sf_buf_kva(struct sf_buf *sf) { -#ifdef SFBUF_OPTIONAL_DIRECT_MAP - if (SFBUF_OPTIONAL_DIRECT_MAP) - return (SFBUF_PHYS_DMAP(VM_PAGE_TO_PHYS((vm_page_t)sf))); +#ifdef PMAP_HAS_DMAP + if (PMAP_HAS_DMAP) + return (PHYS_TO_DMAP(VM_PAGE_TO_PHYS((vm_page_t)sf))); #endif return (sf->kva); @@ -132,8 +126,8 @@ sf_buf_kva(struct sf_buf *sf) static inline vm_page_t sf_buf_page(struct sf_buf *sf) { -#ifdef SFBUF_OPTIONAL_DIRECT_MAP - if (SFBUF_OPTIONAL_DIRECT_MAP) +#ifdef PMAP_HAS_DMAP + if (PMAP_HAS_DMAP) return ((vm_page_t)sf); #endif Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Fri Jan 19 16:06:52 2018 (r328167) +++ head/sys/vm/vm_page.c Fri Jan 19 17:46:31 2018 (r328168) @@ -2937,7 +2937,7 @@ vm_page_free_prep(vm_page_t m, bool pagequeue_locked) { #if defined(DIAGNOSTIC) && defined(PHYS_TO_DMAP) - if ((m->flags & PG_ZERO) != 0) { + if (PMAP_HAS_DMAP && (m->flags & PG_ZERO) != 0) { uint64_t *p; int i; p = (uint64_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)); From owner-svn-src-head@freebsd.org Fri Jan 19 18:02:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEDD1EBF587; Fri, 19 Jan 2018 18:02:34 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) (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 6A8B46C348; Fri, 19 Jan 2018 18:02:33 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from thor.intern.walstatt.dynvpn.de ([77.179.214.53]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0M0QLp-1exzOm2w85-00uaqA; Fri, 19 Jan 2018 19:02:25 +0100 Date: Fri, 19 Jan 2018 19:01:51 +0100 From: "O. Hartmann" To: Scott Long Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r328165 - in head: sbin/camcontrol sys/cam sys/cam/mmc Message-ID: <20180119190218.0d656a0d@thor.intern.walstatt.dynvpn.de> In-Reply-To: <201801191532.w0JFWRFD066790@repo.freebsd.org> References: <201801191532.w0JFWRFD066790@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_/veMgRZUNGAVttPavN_81umK"; protocol="application/pgp-signature" X-Provags-ID: V03:K0:FxA9uu4otOHTW+h3E9dgqT8WLdt+nwLEGdse4J5fRcVm5Gdo3eA I4Z720vPQo8/NTRsyj5/JI3vlX0j7uXkeOWwW1b9SKaFybb5clhH+DdyOkhMR5jD49LZ4xM rxzkjBhfO9xhhNXjuMJnw6fhduOkkUREzKOn7e1LzrK1VGKEeXjYoa4GQ/tve+twwAeMz8w JsRGogt8ZDi0pHG4S0VCg== X-UI-Out-Filterresults: notjunk:1;V01:K0:law9Cw2FBeA=:2RoE5KIPtU2hC8gbtlavf6 CpT455to2B2BPr34Ed2Y1Z4a1zCKiZqirLmZHNX/MsZaUK1QghJ7PnQtyyuUSota/mFXO+zHj NMTVNVTngChdXoYAKuSnfFGi2pjRlR3/8B8aVW3DbXvgPzigr2DLw0vl3jTtO8jLzNfVMXvHs evJvGjDxExq9rAfOMPeiVKelMaeIPpb50p39NLw+HvcVyPfrmMzYnWyRuoT91emttzaO7GNhq uUr+8OSHHPVpI27+kE81ArSxyeI7YQXV9W9lU4M0C5XFeQoAxtcprWo4yt/996M31E3rH0k9l se2NoC9dalGjWUEI5qOxpEmvxLsocy9RI+CIHieNyyosV5WK6upJLD7njresokkrZWiMS4uEp k+S3OpM0LAJzToPlj7+vgm/XjhfUClcHRUAaNBxYsjnLoAMjvzEZ8Aj435tehMQvM0RJXjgma qwkE1l6yIwXOI26cGHdQqy8fhK1loSWG1GoDZ8Y+/9EGFFBeQ4plLCDahajHt1kJr+bhDxcoo 08kti2cVBrTprK5HHknVF5gGDNIR5f57VRXUq9+2wcJm6oJswZSnzYNLQmZ9rtYuhClG/D9YI mhRNR+vIcGPOGSUUK1e66Na0Qq3318NzHiGgGDxgKNKWaeMioJqeGeW0ca7iQNVhRLBwjpwXX mSI0Tp9o0YCwTLKF2ySeYbDxMGsiPMZHGAuvswKf5Upnv49WiORKqFbErC+5wRxfLo2euKeNy kGlWneMFubxGSOpXiStRKYthkzMvDf64qmY3RekW30tJ9ntlT9Q794TQYMlqJsoAlZBj8DISc sQqpmqoiB52I54DUPJ01HcDR8F7cQ== X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 18:02:35 -0000 --Sig_/veMgRZUNGAVttPavN_81umK Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Am Fri, 19 Jan 2018 15:32:27 +0000 (UTC) Scott Long schrieb: > Author: scottl > Date: Fri Jan 19 15:32:27 2018 > New Revision: 328165 > URL: https://svnweb.freebsd.org/changeset/base/328165 >=20 > Log: > Revert ABI breakage to CAM that came in with MMC/SD support in r320844. > Make it possible to retrieve mmc parameters via the XPT_GET_ADVINFO > call instead. Convert camcontrol to the new scheme. > =20 > Reviewed by: imp. kibab > Sponsored by: Netflix > Differential Revision: D13868 >=20 > Modified: > head/sbin/camcontrol/camcontrol.c > head/sys/cam/cam_ccb.h > head/sys/cam/cam_xpt.c > head/sys/cam/mmc/mmc_xpt.c >=20 > Modified: head/sbin/camcontrol/camcontrol.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/sbin/camcontrol/camcontrol.c Fri Jan 19 14:50:53 2018 (r328164) > +++ head/sbin/camcontrol/camcontrol.c Fri Jan 19 15:32:27 2018 (r328165) > @@ -715,14 +715,50 @@ print_dev_semb(struct device_match_result *dev_resu= lt, > static int > print_dev_mmcsd(struct device_match_result *dev_result, char *tmpstr) > { > + union ccb *ccb; > + struct ccb_dev_advinfo *advi; > + struct cam_device *dev; > + struct mmc_params mmc_ident_data; > =20 > - if (strlen(dev_result->mmc_ident_data.model) > 0) { > - sprintf(tmpstr, "<%s>", dev_result->mmc_ident_data.model); > + dev =3D cam_open_btl(dev_result->path_id, dev_result->target_id, > + dev_result->target_lun, O_RDWR, NULL); > + if (dev =3D=3D NULL) { > + warnx("%s", cam_errbuf); > + return (1); > + } > + > + ccb =3D cam_getccb(dev); > + if (ccb =3D=3D NULL) { > + warnx("couldn't allocate CCB"); > + cam_close_device(dev); > + return (1); > + } > + > + advi =3D &ccb->cdai; > + advi->ccb_h.flags =3D CAM_DIR_IN; > + advi->ccb_h.func_code =3D XPT_DEV_ADVINFO; > + advi->flags =3D CDAI_FLAG_NONE; > + advi->buftype =3D CDAI_TYPE_MMC_PARAMS; > + advi->bufsiz =3D sizeof(struct mmc_params); > + advi->buf =3D (uint8_t *)&mmc_ident_data; > + > + if (cam_send_ccb(dev, ccb) < 0) { > + warn("error sending CAMIOCOMMAND ioctl"); > + cam_freeccb(ccb); > + cam_close_device(dev); > + return (1); > + } > + > + if (strlen(mmc_ident_data.model) > 0) { > + sprintf(tmpstr, "<%s>", mmc_ident_data.model); > } else { > sprintf(tmpstr, "<%s card>", > - dev_result->mmc_ident_data.card_features & > + mmc_ident_data.card_features & > CARD_FEATURE_SDIO ? "SDIO" : "unknown"); > } > + > + cam_freeccb(ccb); > + cam_close_device(dev); > return (0); > } > =20 >=20 > Modified: head/sys/cam/cam_ccb.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/cam/cam_ccb.h Fri Jan 19 14:50:53 2018 (r328164) > +++ head/sys/cam/cam_ccb.h Fri Jan 19 15:32:27 2018 (r328165) > @@ -506,7 +506,6 @@ struct device_match_result { > struct scsi_inquiry_data inq_data; > struct ata_params ident_data; > dev_result_flags flags; > - struct mmc_params mmc_ident_data; > }; > =20 > struct bus_match_result { > @@ -1278,6 +1277,7 @@ struct ccb_dev_advinfo { > #define CDAI_TYPE_EXT_INQ 5 > #define CDAI_TYPE_NVME_CNTRL 6 /* NVMe Identify Controller data */ > #define CDAI_TYPE_NVME_NS 7 /* NVMe Identify Namespace data */ > +#define CDAI_TYPE_MMC_PARAMS 8 /* MMC/SD ident */ > off_t bufsiz; /* IN: Size of external buffer */ > #define CAM_SCSI_DEVID_MAXLEN 65536 /* length in buffer is an > uint16_t */ off_t provsiz; /* OUT: Size required/used */ >=20 > Modified: head/sys/cam/cam_xpt.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/cam/cam_xpt.c Fri Jan 19 14:50:53 2018 (r328164) > +++ head/sys/cam/cam_xpt.c Fri Jan 19 15:32:27 2018 (r328165) > @@ -1909,9 +1909,6 @@ xptedtdevicefunc(struct cam_ed *device, void *arg) > bcopy(&device->ident_data, > &cdm->matches[j].result.device_result.ident_data, > sizeof(struct ata_params)); > - bcopy(&device->mmc_ident_data, > - &cdm->matches[j].result.device_result.mmc_ident_data, > - sizeof(struct mmc_params)); > =20 > /* Let the user know whether this device is unconfigured */ > if (device->flags & CAM_DEV_UNCONFIGURED) >=20 > Modified: head/sys/cam/mmc/mmc_xpt.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/cam/mmc/mmc_xpt.c Fri Jan 19 14:50:53 2018 (r328164) > +++ head/sys/cam/mmc/mmc_xpt.c Fri Jan 19 15:32:27 2018 (r328165) > @@ -367,6 +367,13 @@ mmc_dev_advinfo(union ccb *start_ccb) > case CDAI_TYPE_PHYS_PATH: /* pass(4) wants this */ > cdai->provsiz =3D 0; > break; > + case CDAI_TYPE_MMC_PARAMS: > + cdai->provsiz =3D device->mmc_ident_data; > + if (device->mmc_ident_data =3D=3D NULL) > + break; > + amt =3D MIN(cdai->provsiz, cdai->bufsiz); > + memcpy(cdai->buff, device->mmc_ident_data, amt); > + break; > default: > panic("Unknown buftype"); > return; > _______________________________________________ > 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" It seems, this broke buildkernel for me (and probably others): [...] =3D=3D=3D> bhnd/cores/bhnd_pci (all) --- mmc_xpt.o --- /usr/src/sys/cam/mmc/mmc_xpt.c:371:17: error: assigning to 'off_t' (aka 'lo= ng') from incompatible type 'struct mmc_params' cdai->provsiz =3D device->mmc_ident_d= ata; ^ ~~~~~~~~~~~~~~~~~~~~~~ /usr/src/sys/cam/mmc/mmc_xpt.c:372:30: error: invalid operands to binary ex= pression ('struct mmc_params' and 'void *') if (device->mmc_ident_data =3D=3D NULL) ~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~ /usr/src/sys/cam/mmc/mmc_xpt.c:375:16: error: no member named 'buff' in 'st= ruct ccb_dev_advinfo' memcpy(cdai->buff, device->mmc_ident_data, amt); ~~~~ ^ --=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_/veMgRZUNGAVttPavN_81umK Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iLUEARMKAB0WIQQZVZMzAtwC2T/86TrS528fyFhYlAUCWmIyqgAKCRDS528fyFhY lBuiAf9Ug1bGfiD4xIQPEdc5M1fbIN1PbehraCD3mgfCudbaVCR3U0bcBd6ePaBA 3LoZo0EnBnbZ2gR2dC8744V2JusWAf9ptVodX/uyZp+P5qUOTyk0nNSmjhfLFmwg N1xuN99b8fC5LPhPpnpNvMe6UQPaGMfJ9OWXpIa+sCDspb5qsvA2 =LYzc -----END PGP SIGNATURE----- --Sig_/veMgRZUNGAVttPavN_81umK-- From owner-svn-src-head@freebsd.org Fri Jan 19 18:20:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5141EC0199; Fri, 19 Jan 2018 18:20:23 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (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 C36B26CB96; Fri, 19 Jan 2018 18:20:23 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (astound-66-234-199-215.ca.astound.net [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 8E97110A87D; Fri, 19 Jan 2018 13:20:21 -0500 (EST) From: John Baldwin To: Conrad Meyer Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r328159 - head/sys/modules Date: Fri, 19 Jan 2018 09:51:23 -0800 Message-ID: <2915608.v56yfz43Ej@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <201801190434.w0J4Y6i7086677@repo.freebsd.org> References: <201801190434.w0J4Y6i7086677@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Fri, 19 Jan 2018 13:20:21 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 18:20:24 -0000 On Friday, January 19, 2018 04:34:06 AM Conrad Meyer wrote: > Author: cem > Date: Fri Jan 19 04:34:06 2018 > New Revision: 328159 > URL: https://svnweb.freebsd.org/changeset/base/328159 > > Log: > Unbreak i386 build > > The logical result of a right shift >= the width of a type is zero, but our > compiler decides this is a warning (and thus, error). Just remove ccp(4) > from i386. You would think that. The shift instructions on x86 effectively ignore the upper bits of the count, so a 33-bit shift on i386 ends up being a 1-bit shift, etc. IIRC. -- John Baldwin From owner-svn-src-head@freebsd.org Fri Jan 19 18:20:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 946C7EC017B; Fri, 19 Jan 2018 18:20:21 +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 71ED06CB8B; Fri, 19 Jan 2018 18:20:21 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (astound-66-234-199-215.ca.astound.net [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 1685310A7DB; Fri, 19 Jan 2018 13:20:20 -0500 (EST) From: John Baldwin To: Gleb Smirnoff Cc: Julian Elischer , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Colin Percival Subject: Re: svn commit: r327447 - head/sys/sys Date: Fri, 19 Jan 2018 10:02:05 -0800 Message-ID: <8141815.ryMSfkxlDd@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <20180117231437.GQ8113@FreeBSD.org> References: <201712312100.vBVL0L0a038783@repo.freebsd.org> <8492136.94UhKCrmBg@ralph.baldwin.cx> <20180117231437.GQ8113@FreeBSD.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Fri, 19 Jan 2018 13:20:20 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 18:20:21 -0000 On Wednesday, January 17, 2018 03:14:37 PM Gleb Smirnoff wrote: > On Tue, Jan 02, 2018 at 09:56:09AM -0800, John Baldwin wrote: > J> > this is a recurring issue. Program that want to look into the > J> > internals of files such as mount.h > J> > and define _KERNEL to allow themselves to do so. It eventualy leads > J> > to all sorts of confusion and pollution. > J> > Maybe we should make a policy on how to do this. At $JOB I had to hack > J> > it to define a > J> > #ifdef _NOTREALLYKERNEL to split out parts we really wanted, but it > J> > would be better to have specific ones for > J> > various specific 'rule breakers'.. > J> > e.g. > J> > #if defined( _KERNEL ) || defined (WANT_TO_LOOK_AT_something) > J> > > J> > kdump seems ot do the right thing with: > J> > > J> > kdump/kdump.c:#define _WANT_KERNEL_ERRNO > J> > errno.h:#if defined(_KERNEL) || defined(_WANT_KERNEL_ERRNO) > J> > J> The past few years we have been using _WANT_FOO when new things need to be > J> exposed and that is our current pattern. However, that doesn't fix existing > J> code for old things. > > As one who added a lot of _WANT_FOOs, I must admit that I don't consider > that a final and clean solution. But this seems to be a lesser evil when > dealing with old code that has multiple dependencies. > > New code needs to be written in a fashion that clearly separates kernel > structures from user visible structures, so that no tricks with preprocessor > are needed. The problem is that some kernel things aren't generically useful for userland and really should be opt-in, e.g. the negative errno values _WANT_KERNEL_ERRNO protects that only the kernel uses and very few things in userland should see. We will always have some system tools that are bound to the kernel that will need to understand certain kernel internals that the vast majority of userland programs will not / should not need. -- John Baldwin From owner-svn-src-head@freebsd.org Fri Jan 19 18:25:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8E61EC0538; Fri, 19 Jan 2018 18:25:29 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8857A6D17A; Fri, 19 Jan 2018 18:25:29 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id C563D20C7F; Fri, 19 Jan 2018 13:25:26 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute6.internal (MEProxy); Fri, 19 Jan 2018 13:25:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsco.org; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=LJCjxU5NOlHLKJMj8efWAQdpeqpzN xBu4CwSWsLspgM=; b=R2ILTCSmGm/zM12ayIrwZGsPCefctAJHjA7TKDX+zOryz NVGke5RnMjqPuVTnr8j5hATsHi7EFWrguSdi6FyFgPgCkWODetFBvQqSaELNVerB g/EK/r/zhpQ91h6lJRQli+K50Qaa9GMMWmKdZsqzQ15zW4X5yg8UwtfoJBM45HpT jtgUBQypP/GG296R1AmYPrTJDfGUpfUYo4luHb9dQlheblRAYxinFF0UqaIyviT2 HBWfO97daem1nwA3ZYwM8MT1mkO7yo2GAr4O8SDYqPoLG3JQvJ2UzfW4ep2ZTSO4 eeaj++wZkjLhdOvhqyZydu3hOlMtxpIDg2gD0UBLA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=LJCjxU 5NOlHLKJMj8efWAQdpeqpzNxBu4CwSWsLspgM=; b=lqDmNZ6xOH/tCDwbHsimFv A3DbLr6IEe16Tn7I3r8hP9sbh8THC5U19I+wk8vKTS/hy3FuplQ/626yTfX39Z7s J7+S/vT73UqPeZik9huRBlVLTlTfvLIMKvnX5h786V4L1aBjtTvqq2piSj2rBqXb VrPaSa3xeiC3msr1mBnyuo49AHlK0ElGG/V0LXrX0Z1Ul4D1eKAoECWMo+NpL6u5 Na5qLdqWI99ACGtoPISOov+VUgqKmQ7ZqXgJ6qwrftVtlhandEtkj0WdyC8XYWx9 c139mJditwo+jXEzukha719Q5TSqXgeJ2UxI8qa09+Y/tuUQBMm+VduVu80wUEhg == X-ME-Sender: Received: from [192.168.0.106] (unknown [161.97.249.191]) by mail.messagingengine.com (Postfix) with ESMTPA id 3E7A67E1BE; Fri, 19 Jan 2018 13:25:26 -0500 (EST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 11.1 \(3445.4.7\)) Subject: Re: svn commit: r328165 - in head: sbin/camcontrol sys/cam sys/cam/mmc From: Scott Long In-Reply-To: <20180119190218.0d656a0d@thor.intern.walstatt.dynvpn.de> Date: Fri, 19 Jan 2018 11:25:24 -0700 Cc: Scott Long , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <3DD46EED-A460-42A8-9765-051A6DCB9FA6@samsco.org> References: <201801191532.w0JFWRFD066790@repo.freebsd.org> <20180119190218.0d656a0d@thor.intern.walstatt.dynvpn.de> To: "O. Hartmann" X-Mailer: Apple Mail (2.3445.4.7) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 18:25:29 -0000 > On Jan 19, 2018, at 11:01 AM, O. Hartmann = wrote: >=20 > It seems, this broke buildkernel for me (and probably others): >=20 > [...] > =3D=3D=3D> bhnd/cores/bhnd_pci (all) > --- mmc_xpt.o --- > /usr/src/sys/cam/mmc/mmc_xpt.c:371:17: error: assigning to 'off_t' = (aka 'long') from > incompatible type 'struct mmc_params' cdai->provsiz =3D = device->mmc_ident_data; > ^ ~~~~~~~~~~~~~~~~~~~~~~ > /usr/src/sys/cam/mmc/mmc_xpt.c:372:30: error: invalid operands to = binary expression > ('struct mmc_params' and 'void *') if (device->mmc_ident_data =3D=3D = NULL) > ~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~ > /usr/src/sys/cam/mmc/mmc_xpt.c:375:16: error: no member named 'buff' = in 'struct > ccb_dev_advinfo' memcpy(cdai->buff, device->mmc_ident_data, amt); > ~~~~ ^ >=20 >=20 I=E2=80=99m on it, sorry about that. Scott From owner-svn-src-head@freebsd.org Fri Jan 19 18:27:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97E72EC062A; Fri, 19 Jan 2018 18:27:04 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E4336D31F; Fri, 19 Jan 2018 18:27:04 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 5B4C15A9F27; Fri, 19 Jan 2018 18:18:45 +0000 (UTC) Date: Fri, 19 Jan 2018 18:18:45 +0000 From: Brooks Davis To: Conrad Meyer Cc: "Rodney W. Grimes" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327354 - head/sys/vm Message-ID: <20180119181845.GB1758@spindle.one-eyed-alien.net> References: <601ee1a2-8f4e-518d-4c86-89871cd652af@vangyzen.net> <201801191704.w0JH4rgT072967@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="h31gzZEtNLTqOjlF" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 18:27:04 -0000 --h31gzZEtNLTqOjlF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jan 19, 2018 at 09:25:34AM -0800, Conrad Meyer wrote: > On Fri, Jan 19, 2018 at 9:04 AM, Rodney W. Grimes > wrote: > > BUT I do not believe this bit of "style" has anything to do with > > readability of code, and has more to do with how code runs on a > > processor and stack frames. If you defer the declaration of > > "int i" in the above code does that compiler emmit code to allocate > > a new stack frame, or does it just add space to the function stack > > frame for this? > > > > What happens if you do > > for (int i =3D 0; i < pages;) { } > > > > for (int i =3D 1; i < pages;) { } > > as 2 seperate loops, do we allocate 2 i's on the stack at > > function startup, or do we defer and allacte each one > > only when that basic block runs, or do we allocate 1 i > > and reuse it, I know that the compiler makes functional > > code but how is that functionality done? The current > > style leaves no doubt about how things are done from > > that perspective. >=20 > Modern (and I'm using that word very loosely here ??? think GCC did this > 10+ years ago) optimizing compilers do something called liveness > tracking[0] for variables to determine the scope they are used in > (something like the region between last write and last read). So in > that sense, optimizing compilers do not care whether you declare the > variable at function scope or local scope ??? they always determine the > local scope the variable is alive in. (Other than for shadowing, > which we strongly discourage and is considered bad style.) >=20 > Liveness analysis is part of register allocation[1], which typically > uses a graph coloring algorithm to determine the minimal number of > distinct registers needed to hold live values. If the number of > registers needed is more than the machine provides, some values must > be spilled to the stack. (On modern x86 it doesn't matter too much > what you spill to the stack, because the top few words of the stack > region is actually quite fast, but clever compilers targeting other > platforms may attempt to spill less frequently accessed values.) >=20 > I think I recall Clang and other LLVM frontends do something nutty > when they emit intermediary representation, like using a new register > for each assignment. This relies on the register allocater to reduce > that to something sane for the target machine. LLVM uses static single assigment for non-memory values (which the i's above are unless someone takes a reference to them or the register allocator needs to spill them.) In SSA every assignment results in a new register in the IR. -- Brooks https://en.wikipedia.org/wiki/Static_single_assignment_form --h31gzZEtNLTqOjlF Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJaYjaEAAoJEKzQXbSebgfALDwH/R86off+LcmcbYLxMcdo/ZXc 9j9X7HhBQkuU+uQT2L5G9VTfe+3XnpUgAC5R0xj1WVfnrkHv91enL3nHqtrFh1uy j9kyIuPkLTNmHdLmoZM8A/c5iFkkIrsggxS+2fK/okBveKQw5ghskFs7KtzZniiV 6aI8bpubCkpzOykFYO/jNjMUCuZtZnIWyS24RODBI8bOqpfS0PBxqgFro26oQ9U9 YTuAzHk677S/pViyo8hX1c/a9Vei3ejrzjgJHj8zbwrqNx32hwa7TKmQYu6A+77l HR62Fz2yCNBXwhX6GhYzj17gUr2d5mhNctFa8oLRvGZHYPyOpNZpPTeGWJrfN9k= =6AJd -----END PGP SIGNATURE----- --h31gzZEtNLTqOjlF-- From owner-svn-src-head@freebsd.org Fri Jan 19 18:31:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BB4AEC0976; Fri, 19 Jan 2018 18:31:35 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f44.google.com (mail-it0-f44.google.com [209.85.214.44]) (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 E062E6D770; Fri, 19 Jan 2018 18:31:34 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f44.google.com with SMTP id 68so3173244ite.4; Fri, 19 Jan 2018 10:31:34 -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:content-transfer-encoding; bh=3cS90BKCSHaztRAJA0AtyW8eROWJ12PQpzl7fj4uNOs=; b=M1zpwcK5koRlkigKji3BzI67TK1SFSDDapqHJNMbUDTMOmzaGm3OC5ioT3yDg9rO/Q hpwhLbW3Ezhd++wzQIV09s9RP2t1qXiIHrpytPP6yX+DjIWS1D0TiaiRRuuMB0wDkTQP yj06vW8fJydpWQc532G7JlTcouXgYivl56CaizAV7NZbjyTiKNFmm7FZCkPh1hOL1Jkj WlmsXtu5OBFWbqs3ASAhk7oVVJXVmghZK/Pc1ToMM1pQFuQpyGi9M9iEodXOXwoJQEhU Jt0+aH1MUiiC8A+iUEr+P0xV39lCHQxo+3xA3nY9rS0q2kUaCm3gB+V9bqYbuc3GPE9F nRag== X-Gm-Message-State: AKwxytd2r+uxWQQeuRhRRzcgvQW3CkkhvbsrMdUY4WywBFuRsXLXX2D8 ltstjIXfXToVS0X5zuhuxiWaWdqm X-Google-Smtp-Source: ACJfBouG6TXx9etYLzAzzvk167+dPCRkBRXSCizYHW4V0GMwmn84foMDnNqpSYjEJPstuUXL0jizyA== X-Received: by 10.36.157.69 with SMTP id f66mr24609950itd.136.1516386693391; Fri, 19 Jan 2018 10:31:33 -0800 (PST) Received: from mail-io0-f181.google.com (mail-io0-f181.google.com. [209.85.223.181]) by smtp.gmail.com with ESMTPSA id h134sm1066333ith.32.2018.01.19.10.31.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Jan 2018 10:31:33 -0800 (PST) Received: by mail-io0-f181.google.com with SMTP id f34so3106124ioi.13; Fri, 19 Jan 2018 10:31:33 -0800 (PST) X-Received: by 10.107.131.210 with SMTP id n79mr27395277ioi.215.1516386692806; Fri, 19 Jan 2018 10:31:32 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.95.152 with HTTP; Fri, 19 Jan 2018 10:31:32 -0800 (PST) In-Reply-To: <2915608.v56yfz43Ej@ralph.baldwin.cx> References: <201801190434.w0J4Y6i7086677@repo.freebsd.org> <2915608.v56yfz43Ej@ralph.baldwin.cx> From: Conrad Meyer Date: Fri, 19 Jan 2018 10:31:32 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r328159 - head/sys/modules To: John Baldwin Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 18:31:35 -0000 On Fri, Jan 19, 2018 at 9:51 AM, John Baldwin wrote: > On Friday, January 19, 2018 04:34:06 AM Conrad Meyer wrote: >> The logical result of a right shift >=3D the width of a type is zero, = but our >> compiler decides this is a warning (and thus, error). Just remove ccp= (4) >> from i386. > > You would think that. The shift instructions on x86 effectively ignore t= he > upper bits of the count, so a 33-bit shift on i386 ends up being a 1-bit = shift, > etc. IIRC. This never becomes a shift instruction on x86 or any other arch =E2=80=94 i= t's a constant before it reaches machine code. From owner-svn-src-head@freebsd.org Fri Jan 19 18:35:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33BA9EC0D31; Fri, 19 Jan 2018 18:35:58 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f171.google.com (mail-io0-f171.google.com [209.85.223.171]) (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 0239F6DCF6; Fri, 19 Jan 2018 18:35:57 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f171.google.com with SMTP id f34so3119315ioi.13; Fri, 19 Jan 2018 10:35:57 -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=RIbR47JCXbrLqEc4cf9WTfW54vnQa4FncQ7XoKvlr9M=; b=r6cqV/ez4ndZeh9nK9kKeDxK/a7ibTbfFd+lk3l6NLag3Zbuqyc/+GFsxm0Bbxq8zi elPKh3t9+TJSUlNC0lmqlutf8xB0aG6SI0ipRdaHENN01bD8qEarmdsawAwVpyQ+4Xjt nTgSzVGkxtqXxQ8EJMpqL6KbsGEsIr1re08TKvGfMFofh0VyzB2PCrzOrQI4PPra9nWb zCzISRIOeKUkogSlWyfZT5/Gocghf8dTz6Xrb27itnXqbJDTMz21RNkVeWyKbDBQ7N12 fHPkpz19KXV2Cq+o4SEYUd6UanynbyRtLN0odmllWPWXARPnOPsIIuqqirzHECNpoHgK iomA== X-Gm-Message-State: AKwxytfopVW+b2Ke+0O4od3lKKo/J0yzI1UJ5EvIiZj6sxXNKxHmZss0 Q50Dh/Ql1BpSkq6DGvW8KlN2XLlr X-Google-Smtp-Source: ACJfBouzkC7WrlZSq8tkE4gO1+kk0UlpOT6gdxgCm88zu/1jIwWoNKyn1K27JlvJMAzI1qoS7dbkKA== X-Received: by 10.107.131.207 with SMTP id n76mr26162478ioi.268.1516386621931; Fri, 19 Jan 2018 10:30:21 -0800 (PST) Received: from mail-it0-f53.google.com (mail-it0-f53.google.com. [209.85.214.53]) by smtp.gmail.com with ESMTPSA id i127sm1048990ita.42.2018.01.19.10.30.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Jan 2018 10:30:21 -0800 (PST) Received: by mail-it0-f53.google.com with SMTP id c16so3156074itc.5; Fri, 19 Jan 2018 10:30:21 -0800 (PST) X-Received: by 10.36.114.193 with SMTP id x184mr31824898itc.71.1516386621287; Fri, 19 Jan 2018 10:30:21 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.95.152 with HTTP; Fri, 19 Jan 2018 10:30:20 -0800 (PST) In-Reply-To: <201801191737.w0JHbM90073097@pdx.rh.CN85.dnsmgr.net> References: <201801191737.w0JHbM90073097@pdx.rh.CN85.dnsmgr.net> From: Conrad Meyer Date: Fri, 19 Jan 2018 10:30:20 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r328159 - head/sys/modules To: "Rodney W. Grimes" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 18:35:58 -0000 On Fri, Jan 19, 2018 at 9:37 AM, Rodney W. Grimes wrote: > If you think in assembler it is easy to understand why this is UB, > most (all) architectures Right Logic or Arithmetic Shift only accept an > operand that is a size that can hold log2(wordsize). This is a logical right shift by a constant larger than the width of the left operand. As a result, it would a constant zero in any emitted machine code. It is a bug in the C standard and a concession to naive, non-optimizing compilers that this is considered UB. From owner-svn-src-head@freebsd.org Fri Jan 19 18:39:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FAE6EC108C; Fri, 19 Jan 2018 18:39:03 +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 5E5236E18F; Fri, 19 Jan 2018 18:39:02 +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 w0JIcwC5073371; Fri, 19 Jan 2018 10:38:58 -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 w0JIcwdE073370; Fri, 19 Jan 2018 10:38:58 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201801191838.w0JIcwdE073370@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r327354 - head/sys/vm In-Reply-To: To: Warner Losh Date: Fri, 19 Jan 2018 10:38:58 -0800 (PST) CC: "Conrad E. Meyer" , Eric van Gyzen , 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-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 18:39:03 -0000 [ Charset UTF-8 unsupported, converting... ] > On Thu, Jan 18, 2018 at 1:32 PM, Conrad Meyer wrote: > > > On Thu, Jan 18, 2018 at 12:01 PM, Eric van Gyzen > > wrote: > > > On 01/17/2018 16:40, Gleb Smirnoff wrote: > > >> Yeah, style is sacred, but is there a single person on Earth who would > > >> not agree that moving variables from smaller blocks to function block > > >> reduces readability of the code? > > > > > > I agree that it reduces the readability. Not only that, it also > > > encourages real bugs by allowing access to the variable when it does not > > > make sense. > > > > I think the right way to propose this kind of policy change is to get > > agreement on how style(9) should be modified ? not arbitrarily go > > against style(9) in some files. The proposed change may be somewhat > > contentious and it might be a good exercise to go through the FreeBSD > > Community Process. > > > > I might separate these two concerns: > > > > 1. Allowing local / block scoped variables > > 2. Allowing C99 for loop initial declarations > > > > But I could see the argument that (2) is just a boring subset of (1). > > > > Tell me again where #1/#2 are disallowed? I can't seem to find that in > style(9), except by a weak example of there being no examples of #1 or #2. I think everyone glossed over: Parts of a for loop may be left empty. Do not put declarations inside blocks unless the routine is unusually complicated. Perhaps that second sentence should be extracted into a paragraph of its own? This does sound very much like what you said that you do in another reply in this thread. > Warner -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri Jan 19 18:40:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E55B0EC121A; Fri, 19 Jan 2018 18:40: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 CA7B06E3C3; Fri, 19 Jan 2018 18:40:51 +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 w0JIenmn073387; Fri, 19 Jan 2018 10:40: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 w0JIenJ3073386; Fri, 19 Jan 2018 10:40:49 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201801191840.w0JIenJ3073386@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r328159 - head/sys/modules In-Reply-To: <2915608.v56yfz43Ej@ralph.baldwin.cx> To: John Baldwin Date: Fri, 19 Jan 2018 10:40:49 -0800 (PST) CC: Conrad Meyer , 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-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 18:40:52 -0000 > On Friday, January 19, 2018 04:34:06 AM Conrad Meyer wrote: > > Author: cem > > Date: Fri Jan 19 04:34:06 2018 > > New Revision: 328159 > > URL: https://svnweb.freebsd.org/changeset/base/328159 > > > > Log: > > Unbreak i386 build > > > > The logical result of a right shift >= the width of a type is zero, but our > > compiler decides this is a warning (and thus, error). Just remove ccp(4) > > from i386. > > You would think that. The shift instructions on x86 effectively ignore the > upper bits of the count, so a 33-bit shift on i386 ends up being a 1-bit shift, > etc. IIRC. I believe that is Rotate, not shift. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri Jan 19 18:41:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65A6DEC13C5; Fri, 19 Jan 2018 18:41:07 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lf0-f50.google.com (mail-lf0-f50.google.com [209.85.215.50]) (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 E8A846E54C; Fri, 19 Jan 2018 18:41:06 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lf0-f50.google.com with SMTP id f136so3204212lff.8; Fri, 19 Jan 2018 10:41:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=1GqNRBvUjpPfzjJ3vrfofGHjo6EEL08Lkb9tgp2derU=; b=CelqFqeC2jUe3uC2TEi/sper2ENpvuE/ucuouNGcdb+qNmaDa6CNaxFxJaZDi3mLi+ ZKMQkZE2/bymrVA2McAA40I9tkbMTjTwZN+asR7xmd91U8d+GYKKiewIuEsXoyJlaJcf ELr7x7Nk2q8+LIg5bFaZdekJZlkT3BSZXwmYEWMItrTPFwOLpARZhIAogM9dWATFp9kz 6ZzP/yZHrugIq1Uwy2YZ1C1tTkTqrBYnxoHM6lw5eW9+ZHXr58wgDIx/whx3kwSXNLa9 DdGu5VIqBkBo0PzaBEBLCeUjq/hZ3h2NG5ZH3cmYpD3St7DZLjEVqtD6AyTK3b+DNJTj 7X9g== X-Gm-Message-State: AKwxytd9P63iOFk+o4S1h66p0rNRaNoM1HiuclRidfr0ipkHUTagdwKU UASyHOqN1SvrG5apNKCxCHRvVLA7EM4= X-Google-Smtp-Source: AH8x226lcWau262xoP8hBr3YTkuONjXdPooSUx0TH4jlJULrvZ4ECB2V7m6bjqTmHYoA0cx+gsxbXw== X-Received: by 10.46.99.75 with SMTP id x72mr1206070ljb.136.1516387258974; Fri, 19 Jan 2018 10:40:58 -0800 (PST) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id k77sm1745679lfe.48.2018.01.19.10.40.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Jan 2018 10:40:57 -0800 (PST) Subject: Re: svn commit: r328159 - head/sys/modules To: cem@freebsd.org Cc: "Rodney W. Grimes" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201801191737.w0JHbM90073097@pdx.rh.CN85.dnsmgr.net> From: Andriy Gapon Message-ID: Date: Fri, 19 Jan 2018 20:40:56 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 18:41:07 -0000 On 19/01/2018 20:30, Conrad Meyer wrote: > On Fri, Jan 19, 2018 at 9:37 AM, Rodney W. Grimes > wrote: >> If you think in assembler it is easy to understand why this is UB, >> most (all) architectures Right Logic or Arithmetic Shift only accept an >> operand that is a size that can hold log2(wordsize). > > This is a logical right shift by a constant larger than the width of > the left operand. As a result, it would a constant zero in any > emitted machine code. It is a bug in the C standard and a concession > to naive, non-optimizing compilers that this is considered UB. > Are you sure? I seem to recall that the actual shift happens to be N % 32 for 32-bit registers (at least on some processors). [Goes to check AMD Programmer's manual] Ah, here you are: The processor masks the upper three bits of the count operand, thus restricting the count to a number between 0 and 31. When the destination is 64 bits wide, the processor masks the upper two bits of the count, providing a count in the range of 0 to 63. -- Andriy Gapon From owner-svn-src-head@freebsd.org Fri Jan 19 18:42:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E438EC1557 for ; Fri, 19 Jan 2018 18:42:34 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-wm0-x236.google.com (mail-wm0-x236.google.com [IPv6:2a00:1450:400c: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 2BA9E6E917 for ; Fri, 19 Jan 2018 18:42:34 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-wm0-x236.google.com with SMTP id t74so5250332wme.3 for ; Fri, 19 Jan 2018 10:42:34 -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=dfDsGlS26rXDEUjSkSKvrHiA+1ye5HR6e1+bS7sMKzY=; b=USsID5YjDv7cQX6Psr7MamNKxbgva0otPYB/CbbVDiZSg6/h9a9wgXCNkf/XrXXjfh WvrNMsq4ZFxFEErlp8Ont+FArGJIDnyRl4RUE49STn0dpJjsJCWkYTWiWEYCSIMwwXH8 A6jLwisL0liAW3zGZ9/zYR45BVmAcETbo4CxDSciwr62mj5+80v0ZZKMKt/UuT4Bp/Mw vXPcwOf2EpZQpCqOcQ65cRu/vEF1W4vTjMRNCVi7vT+5XUMRFaafaZ9h89uAqwgNc7b5 c2/Az41161kx1iVtv0iLgwf3QNcbS6hVHDdGP5J+GD0KOeo8jDEinE345Ih3B0pmOlOq 7cVg== 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=dfDsGlS26rXDEUjSkSKvrHiA+1ye5HR6e1+bS7sMKzY=; b=QKQWt3NfJ4lZdmUHzBApZjxkYjWyzFDdpufJJniE8O71UU0Z3WbBPVbal68TIu6/rH IoEfLFb4Wp9VytoYnUC2EYQcxduCTA4jKBg2mWUoDcIBFs/d4XkMdPiLI2vqY1rijp1O 7VF+db5jfGMyCUdsgL0wQ+FvUfxLpf5S3nx6FM1HXYgVTAP91BV8P74PQYeaqAGd1OJX z/HIUZHcETHOETpQ0jdTLvWFN2rW4UxZIsqhem+/RrefUYmY75gYh3KjI1oDG7Yjci4t h5n93hF+3NHARscaQjz1842ezqHcGi0rB+nMjjUGKFiVj9MjHnXzmQKwMUTcW6DK/FWG /MjA== X-Gm-Message-State: AKwxyte/BSKL7obI/Bgo+y+8bCCb+dMtOBmcW/Uh/cd/1id/KMdho9rg 3fnPf67S70rhvjTv+rzKZO2VYYGa1mCrUOrTbKBUiA== X-Google-Smtp-Source: ACJfBosDs7MWV+FZFrGrlLVQto8vDFSPjRtWkEShUNp4aSMYvjmSsOCRAG6WHuR5LxmCWYKcvIBTH5AuqLK4f8P8TFI= X-Received: by 10.80.151.22 with SMTP id c22mr14312091edb.225.1516387352023; Fri, 19 Jan 2018 10:42:32 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.80.133.195 with HTTP; Fri, 19 Jan 2018 10:42:31 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: References: <201801190434.w0J4Y6i7086677@repo.freebsd.org> <2915608.v56yfz43Ej@ralph.baldwin.cx> From: Warner Losh Date: Fri, 19 Jan 2018 11:42:31 -0700 X-Google-Sender-Auth: cu0m2CVAzDv32vf0yxMjGTUHI6U Message-ID: Subject: Re: svn commit: r328159 - head/sys/modules To: "Conrad E. Meyer" Cc: John Baldwin , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 18:42:34 -0000 On Fri, Jan 19, 2018 at 11:31 AM, Conrad Meyer wrote: > On Fri, Jan 19, 2018 at 9:51 AM, John Baldwin wrote: > > On Friday, January 19, 2018 04:34:06 AM Conrad Meyer wrote: > >> The logical result of a right shift >=3D the width of a type is zero= , > but our > >> compiler decides this is a warning (and thus, error). Just remove > ccp(4) > >> from i386. > > > > You would think that. The shift instructions on x86 effectively ignore > the > > upper bits of the count, so a 33-bit shift on i386 ends up being a 1-bi= t > shift, > > etc. IIRC. > > This never becomes a shift instruction on x86 or any other arch =E2=80=94= it's > a constant before it reaches machine code > I think what John is getting at is that one's notions of what a logical shift left should do should be tempered with real world experience which says they don't behave that way always... I do hope we're all in violent agreement that, no matter how crazy we think it might be, avoiding the UB zone as much as possible is generally desirable. It certainly is in this case. Warner From owner-svn-src-head@freebsd.org Fri Jan 19 18:43:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 258C5EC168F; Fri, 19 Jan 2018 18:43:52 +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 03B0A6EAA4; Fri, 19 Jan 2018 18:43:51 +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 w0JIhoAQ073409; Fri, 19 Jan 2018 10:43:50 -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 w0JIhoVS073408; Fri, 19 Jan 2018 10:43:50 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201801191843.w0JIhoVS073408@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r328159 - head/sys/modules In-Reply-To: To: cem@freebsd.org Date: Fri, 19 Jan 2018 10:43:50 -0800 (PST) CC: John Baldwin , 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-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 18:43:52 -0000 [ Charset UTF-8 unsupported, converting... ] > On Fri, Jan 19, 2018 at 9:51 AM, John Baldwin wrote: > > On Friday, January 19, 2018 04:34:06 AM Conrad Meyer wrote: > >> The logical result of a right shift >= the width of a type is zero, but our > >> compiler decides this is a warning (and thus, error). Just remove ccp(4) > >> from i386. > > > > You would think that. The shift instructions on x86 effectively ignore the > > upper bits of the count, so a 33-bit shift on i386 ends up being a 1-bit shift, > > etc. IIRC. > > This never becomes a shift instruction on x86 or any other arch ? it's > a constant before it reaches machine code. A constant that is produce by a? Shift insturction perhaps? Ok, that was pedantically over kill, but is what most likely happens. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri Jan 19 19:09:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F20E0EC2952; Fri, 19 Jan 2018 19:09:18 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CD6BD6FD2D; Fri, 19 Jan 2018 19:09:18 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1305711857; Fri, 19 Jan 2018 19:09:18 +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 w0JJ9HYq058065; Fri, 19 Jan 2018 19:09:17 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0JJ9HPp058064; Fri, 19 Jan 2018 19:09:17 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201801191909.w0JJ9HPp058064@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 19 Jan 2018 19:09:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328169 - head/stand/efi/loader/arch/i386 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/loader/arch/i386 X-SVN-Commit-Revision: 328169 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 19:09:19 -0000 Author: imp Date: Fri Jan 19 19:09:17 2018 New Revision: 328169 URL: https://svnweb.freebsd.org/changeset/base/328169 Log: Remove extra copy of bootinfo.c. It's a bit rotted copy of the one in efi/loader. Differential Review: https://reviews.freebsd.org/D13986 Deleted: head/stand/efi/loader/arch/i386/bootinfo.c From owner-svn-src-head@freebsd.org Fri Jan 19 19:18:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9249FEC2E95; Fri, 19 Jan 2018 19:18:15 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6DB7D70286; Fri, 19 Jan 2018 19:18:15 +0000 (UTC) (envelope-from scottl@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A2018119E8; Fri, 19 Jan 2018 19:18:14 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0JJIEWR062132; Fri, 19 Jan 2018 19:18:14 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0JJIEGt062131; Fri, 19 Jan 2018 19:18:14 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201801191918.w0JJIEGt062131@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Fri, 19 Jan 2018 19:18:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328170 - head/sys/cam/mmc X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: head/sys/cam/mmc X-SVN-Commit-Revision: 328170 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 19:18:15 -0000 Author: scottl Date: Fri Jan 19 19:18:14 2018 New Revision: 328170 URL: https://svnweb.freebsd.org/changeset/base/328170 Log: Fix compile errors in r328165 Reported by: O. Hartmann Sponsored by: Netflix Modified: head/sys/cam/mmc/mmc_xpt.c Modified: head/sys/cam/mmc/mmc_xpt.c ============================================================================== --- head/sys/cam/mmc/mmc_xpt.c Fri Jan 19 19:09:17 2018 (r328169) +++ head/sys/cam/mmc/mmc_xpt.c Fri Jan 19 19:18:14 2018 (r328170) @@ -368,11 +368,9 @@ mmc_dev_advinfo(union ccb *start_ccb) cdai->provsiz = 0; break; case CDAI_TYPE_MMC_PARAMS: - cdai->provsiz = device->mmc_ident_data; - if (device->mmc_ident_data == NULL) - break; + cdai->provsiz = sizeof(struct mmc_params); amt = MIN(cdai->provsiz, cdai->bufsiz); - memcpy(cdai->buff, device->mmc_ident_data, amt); + memcpy(cdai->buf, &device->mmc_ident_data, amt); break; default: panic("Unknown buftype"); From owner-svn-src-head@freebsd.org Fri Jan 19 20:16:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CD7CEC57B1 for ; Fri, 19 Jan 2018 20:16:46 +0000 (UTC) (envelope-from marklmi26-fbsd@yahoo.com) Received: from sonic302-4.consmr.mail.bf2.yahoo.com (sonic302-4.consmr.mail.bf2.yahoo.com [74.6.135.43]) (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 2D4CA727F9 for ; Fri, 19 Jan 2018 20:16:45 +0000 (UTC) (envelope-from marklmi26-fbsd@yahoo.com) X-YMail-OSG: eJ3Pp5oVM1lj_hKLM8NIxBQLFtAs5o6ygIwlC9lsSW9nK3WGvFvw_JTDkrwihMO 1yCtURxYvDtPy4wH23zB_ZWxzMNyvhfhe0s9l.fPcc5yaTK0Ovw1KUQo3DzsnE1qDxiMM6ZWKceh lBCpY3ajVdtTAULbMRcmtlaoaX86B5sV9L7qq5oyFUEfx0DlWUvS6SuyYpNHEY1M0cEwdmpzke27 kEntfjCoY3bw7o6yrR8jGYQVdlqxEAALep26z99XLMIUrPNMpEcG1EiuOTWT4D7MvJLrlMTLkLkA 2Eb_mrcEd8pyaTQ5XN9uHLNwIAW6DCeffzD6G5oKzfsiOAic26n4HlUIQ5HA6DvYAe2agFm2NuBI 6I_ByCfVU9vBqmYrSzZajGORCidawRdUfojMQxI0Psm7_WWhwK6v8eoGIYQfVKI8djGZsWVvcj95 2peaaSpMhMu3vNbGXxGDwLxte264YtGat9ygC.ShDFJ_D_hIjJDZ9dPGobQKJE7VjsaZU8Vr2P9T V0ZxX_A-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic302.consmr.mail.bf2.yahoo.com with HTTP; Fri, 19 Jan 2018 20:16:44 +0000 Received: from smtp103.rhel.mail.bf1.yahoo.com (EHLO [192.168.1.25]) ([98.139.230.213]) by smtp411.mail.bf1.yahoo.com (JAMES SMTP Server ) with ESMTPA ID c6408ab2eabbf07a2668b9a0e0629f04 for ; Fri, 19 Jan 2018 20:16:39 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r327354 - head/sys/vm Message-Id: Date: Fri, 19 Jan 2018 12:16:37 -0800 To: svn-src-head@freebsd.org X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 20:16:46 -0000 Rodney W. Grimes freebsd at pdx.rh.CN85.dnsmgr.net wrote on Fri Jan 19 18:39:03 UTC 2018 (quoting style(9)): > I think everyone glossed over: >=20 > Parts of a for loop may be left empty. Do not put declarations = inside > blocks unless the routine is unusually complicated. >=20 > Perhaps that second sentence should be extracted into a paragraph of = its own? > This does sound very much like what you said that you do in another = reply > in this thread. That is what I vaguely remember, now that I see it. I'm not so worried about code generation by compilers for the distinctions or the liveness tracking. I'm more worried about my own efforts during an analysis of the source code. When I have to analyze/study unfamiliar functions, the size of the range of source code where various variables might have been used can complicate things and increases the amount of analysis, including checking for a lack of interference by other code than turns out to be outside the "its live" scope. Closer approximation to minimizing the range of text helps with my doing a reliable analysis and lets a higher fraction of my time be spent on other aspects. In other words, it may take less for me to classify something as "unusually complicated" compared to some other folks. Overall I tend to like putting to use principles of locality when they readily apply. As for names repeated in nested scopes (the same name space), even absent a language rule disallowing such, I support being able to have all such examples reported as at least informational messages of some kind, possibly even selectable as "desired errors" in the sense of stopping compiles from generating object files despite not violating the language's criteria. =3D=3D=3D Mark Millard marklmi at yahoo.com ( markmi at dsl-only.net is going away in 2018-Feb, late) From owner-svn-src-head@freebsd.org Fri Jan 19 20:33:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5C40EC683F; Fri, 19 Jan 2018 20:33:52 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 469FD73901; Fri, 19 Jan 2018 20:33:49 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7D98C126C3; Fri, 19 Jan 2018 20:33:47 +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 w0JKXleL096645; Fri, 19 Jan 2018 20:33:47 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0JKXlFO096643; Fri, 19 Jan 2018 20:33:47 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201801192033.w0JKXlFO096643@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 19 Jan 2018 20:33:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328171 - head/contrib/bsnmp/snmpd X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/contrib/bsnmp/snmpd X-SVN-Commit-Revision: 328171 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 20:33:53 -0000 Author: ae Date: Fri Jan 19 20:33:47 2018 New Revision: 328171 URL: https://svnweb.freebsd.org/changeset/base/328171 Log: Rename "index" variable to "idx" since gcc complains that it shadows index(3) function declaration. Reported by: lwhsu MFC after: 2 weeks Modified: head/contrib/bsnmp/snmpd/action.c head/contrib/bsnmp/snmpd/main.c Modified: head/contrib/bsnmp/snmpd/action.c ============================================================================== --- head/contrib/bsnmp/snmpd/action.c Fri Jan 19 19:18:14 2018 (r328170) +++ head/contrib/bsnmp/snmpd/action.c Fri Jan 19 20:33:47 2018 (r328171) @@ -751,7 +751,7 @@ int op_community(struct snmp_context *ctx, struct snmp_value *value, u_int sub, u_int iidx __unused, enum snmp_op op) { - struct asn_oid index; + struct asn_oid idx; struct community *c; asn_subid_t which = value->var.subs[sub - 1]; @@ -773,14 +773,14 @@ op_community(struct snmp_context *ctx, struct snmp_val case SNMP_OP_SET: if (community != COMM_INITIALIZE && snmpd.comm_dis) return (SNMP_ERR_NOT_WRITEABLE); - index.len = 2; - index.subs[0] = 0; - index.subs[1] = value->var.subs[value->var.len - 1]; + idx.len = 2; + idx.subs[0] = 0; + idx.subs[1] = value->var.subs[value->var.len - 1]; switch (which) { case LEAF_begemotSnmpdCommunityString: /* check that given string is unique */ TAILQ_FOREACH(c, &community_list, link) { - if (!asn_compare_oid(&index, &c->index)) + if (!asn_compare_oid(&idx, &c->index)) continue; if (c->string != NULL && strcmp(c->string, value->v.octetstring.octets) == 0) @@ -795,7 +795,7 @@ op_community(struct snmp_context *ctx, struct snmp_val sub)) == NULL) { /* create new community and use user sepcified index */ c = comm_define_ordered(COMM_READ, "SNMP Custom Community", - &index, NULL, NULL); + &idx, NULL, NULL); if (c == NULL) return (SNMP_ERR_NO_CREATION); } Modified: head/contrib/bsnmp/snmpd/main.c ============================================================================== --- head/contrib/bsnmp/snmpd/main.c Fri Jan 19 19:18:14 2018 (r328170) +++ head/contrib/bsnmp/snmpd/main.c Fri Jan 19 20:33:47 2018 (r328171) @@ -2028,13 +2028,13 @@ asn_error_func(const struct asn_buf *b, const char *er * Create a new community */ struct community* -comm_define_ordered(u_int priv, const char *descr, struct asn_oid *index, +comm_define_ordered(u_int priv, const char *descr, struct asn_oid *idx, struct lmodule *owner, const char *str) { struct community *c, *p; u_int ncomm; - ncomm = index->subs[index->len - 1]; + ncomm = idx->subs[idx->len - 1]; /* check that community doesn't already exist */ TAILQ_FOREACH(c, &community_list, link) @@ -2061,7 +2061,7 @@ comm_define_ordered(u_int priv, const char *descr, str /* * Insert ordered */ - c->index = *index; + c->index = *idx; TAILQ_FOREACH(p, &community_list, link) { if (asn_compare_oid(&p->index, &c->index) > 0) { TAILQ_INSERT_BEFORE(p, c, link); @@ -2077,7 +2077,7 @@ u_int comm_define(u_int priv, const char *descr, struct lmodule *owner, const char *str) { - struct asn_oid index, *p; + struct asn_oid idx, *p; struct community *c; u_int ncomm; @@ -2094,7 +2094,7 @@ comm_define(u_int priv, const char *descr, struct lmod if (owner != NULL) p = &owner->index; else { - p = &index; + p = &idx; p->len = 1; p->subs[0] = 0; } From owner-svn-src-head@freebsd.org Fri Jan 19 21:16:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E720EC8E61 for ; Fri, 19 Jan 2018 21:16:45 +0000 (UTC) (envelope-from marklmi26-fbsd@yahoo.com) Received: from sonic316-9.consmr.mail.gq1.yahoo.com (sonic316-9.consmr.mail.gq1.yahoo.com [98.137.69.33]) (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 79CA675F58 for ; Fri, 19 Jan 2018 21:16:45 +0000 (UTC) (envelope-from marklmi26-fbsd@yahoo.com) X-YMail-OSG: k5Y3hyUVM1mFfQXfZDxdtJYhXpMov7HLgqurUhJzeHtaMmPhlqK26Dh200tD.3u .Ejqdck7umSo8zasav.wvhtowen8bLs6L6fSxwwELsBa7PLWR7IH5MP8n3lttNmyp9zDk2ltPT72 QHvbvkNo4JgNgrkj57MM539eXIfLiBmQvPPTGIslZiQT79iSBe51ksDWg3PjHGfW1eUk8FFD_yTo t93jBEaipGwu0S2WJWBsUbHi_LQejIdmIy1B_TIBXDRZoA7JQs4z8xcf5eDD8pquT7HqS1HEStdF vCvYkdUmhGkPkPf3ncJaagKeI7qbZs7n_hTYrjUr0u1LFszpY0h9AzBxf.FMRp.Db5LxagjRf5ZJ t0yvfeLrBYPTIjaGHcPGjvS3ZCnEubOCtCWd_SpwIeGQDxy.HAjVCU1w5onARfsNKcxzRbtUJHN0 v9If8vkMkBi_aU0VWbGXgNLtctrew8ezj.YbW1J.TEafMNGqqZkZ6zG_KwhtZUOyowpdNYFxxeBP KswpMbQ-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic316.consmr.mail.gq1.yahoo.com with HTTP; Fri, 19 Jan 2018 21:16:44 +0000 Received: from smtpgate104.mail.gq1.yahoo.com (EHLO [192.168.1.25]) ([10.215.136.172]) by smtp405.mail.gq1.yahoo.com (JAMES SMTP Server ) with ESMTPA ID 2f98a4c1431b1c279c08fa307227131f; Fri, 19 Jan 2018 20:46:23 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r328159 - head/sys/modules Message-Id: Date: Fri, 19 Jan 2018 12:46:22 -0800 To: Andriy Gapon , "Conrad E. Meyer" , svn-src-head@freebsd.org X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 21:16:45 -0000 Andriy Gapon avg at FreeBSD.org wrote on Fri Jan 19 18:41:07 UTC 2018 : > On 19/01/2018 20:30, Conrad Meyer wrote: > > On Fri, Jan 19, 2018 at 9:37 AM, Rodney W. Grimes > > wrote: > >> If you think in assembler it is easy to understand why this is UB, > >> most (all) architectures Right Logic or Arithmetic Shift only = accept an > >> operand that is a size that can hold log2(wordsize). > >=20 > > This is a logical right shift by a constant larger than the width of > > the left operand. As a result, it would a constant zero in any > > emitted machine code. It is a bug in the C standard and a = concession > > to naive, non-optimizing compilers that this is considered UB. > >=20 >=20 > Are you sure? > I seem to recall that the actual shift happens to be N % 32 for 32-bit = registers > (at least on some processors). >=20 > [Goes to check AMD Programmer's manual] >=20 > Ah, here you are: > The processor masks the upper three bits of the count operand, thus = restricting > the count to a number between 0 and 31. When the destination is 64 = bits wide, > the processor masks the upper two bits of the count, providing a = count in the > range of 0 to 63. It sounds to me that Conrad might want compile-time-constant shift distance cases to potentially produce different results than run-time-value cases for the same shift distance. Personally, I'm no fan of the same shift-distance value having a mix of having undefined behavior and well defined behavior based on if it is run-time vs. compile-time for when the value is known. C (and C++) made the choice to not require the run-time case to implicitly follow a more general rule (avoiding extra machine code) and then made compile-time-known cases the same. There may be other languages that require the run-time case to have whatever extra code is required despite the kinds of matching definitions that you quote. This too could keep run-time and compile-time uniform. Off the top of my head I do not remember running into a language that treated run-time and compile-time cases for the shift distance differently for the resultant, shifted value. But there may well be some. Mathematically, C and C++ are just not clean for the issue. But they would be even messier mathematically with the run-time versus compile-time distinction. =3D=3D=3D Mark Millard marklmi at yahoo.com ( markmi at dsl-only.net is going away in 2018-Feb, late) From owner-svn-src-head@freebsd.org Fri Jan 19 21:20:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE164EC92D5; Fri, 19 Jan 2018 21:20:26 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 780A9763E0; Fri, 19 Jan 2018 21:20:26 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B5B7512D45; Fri, 19 Jan 2018 21:20:25 +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 w0JLKPpL013940; Fri, 19 Jan 2018 21:20:25 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0JLKPY5013933; Fri, 19 Jan 2018 21:20:25 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201801192120.w0JLKPY5013933@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 19 Jan 2018 21:20:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328173 - head/usr.bin/dtc X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.bin/dtc X-SVN-Commit-Revision: 328173 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 21:20:26 -0000 Author: kevans Date: Fri Jan 19 21:20:24 2018 New Revision: 328173 URL: https://svnweb.freebsd.org/changeset/base/328173 Log: dtc(1): Update to upstream ea3c233 Highlights of this update: - /__local_fixups__ is now generated to be GPL dtc and libfdt compliant - Compiling with -@ will now cause dtc to assign phandles to all labelled nodes - /include/ and /incbin/ now handle absolute paths correctly - The manpage now has information about overlays, including how to apply them and how to generate them - Syntactic sugar for overlays is now supported, allowing an overlay DTS like: = /dts-v1/; /plugin/; &foo { foo,status = "okay"; }; = to generate a fragment targetting <&foo>. Modified: head/usr.bin/dtc/Makefile head/usr.bin/dtc/dtc.1 head/usr.bin/dtc/dtc.cc head/usr.bin/dtc/fdt.cc head/usr.bin/dtc/fdt.hh head/usr.bin/dtc/input_buffer.cc head/usr.bin/dtc/input_buffer.hh Modified: head/usr.bin/dtc/Makefile ============================================================================== --- head/usr.bin/dtc/Makefile Fri Jan 19 21:19:57 2018 (r328172) +++ head/usr.bin/dtc/Makefile Fri Jan 19 21:20:24 2018 (r328173) @@ -4,8 +4,6 @@ PROG_CXX=dtc SRCS= dtc.cc input_buffer.cc string.cc dtb.cc fdt.cc checking.cc MAN= dtc.1 -WARNS?= 3 - CXXFLAGS+= -std=c++11 -fno-rtti -fno-exceptions NO_SHARED?=NO Modified: head/usr.bin/dtc/dtc.1 ============================================================================== --- head/usr.bin/dtc/dtc.1 Fri Jan 19 21:19:57 2018 (r328172) +++ head/usr.bin/dtc/dtc.1 Fri Jan 19 21:20:24 2018 (r328173) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd January 1, 2013 +.Dd January 17, 2018 .Dt DTC 1 .Os .Sh NAME @@ -57,7 +57,7 @@ The .Nm utility converts flattened device tree (FDT) representations. - It is most commonly used to generate device tree blobs (DTB), the binary +It is most commonly used to generate device tree blobs (DTB), the binary representation of an FDT, from device tree sources (DTS), the ASCII text source representation. .Pp @@ -153,9 +153,9 @@ format for property values. These allow property value to be specified on the command line. .It Fl R Ar entries The number of empty reservation table entries to pad the table with. -This is -useful if you are generating a device tree blob for bootloader or similar that -needs to reserve some memory before passing control to the operating system. +This is useful if you are generating a device tree blob for bootloader or +similar that needs to reserve some memory before passing control to the +operating system. .It Fl S Ar bytes The minimum size in bytes of the blob. The blob will be padded after the strings table to ensure that it is the @@ -244,6 +244,54 @@ Checks that all .Va /delete-node/ statements refer to nodes that are merged. .El +.Sh OVERLAYS +The utility provides support for generating overlays, also known as plugins. +Overlays are a method of patching a base device tree that has been compiled with +the +.Fl @ +flag, with some limited support for patching device trees that were not compiled +with the +.Fl @ +flag. +.Pp +To denote that a DTS is intended to be used as an overlay, +.Va /plugin/; +should be included in the header, following any applicable +.Va /dts-v1/; +tag. +.Pp +Conventional overlays are crafted by creating +.Va fragment +nodes in a root. +Each fragment node must have either a +.Va target +property set to a label reference, or a +.Va target-path +string property set to a path. +It must then have an +.Va __overlay__ +child node, whose properties and child nodes are merged into the base device +tree when the overlay is applied. +.Pp +Much simpler syntactic sugar was later invented to simplify generating overlays. +Instead of creating targetted fragments manually, one can instead create a root +node that targets a label in the base node using the +.Va &label +syntax supported in conventional DTS. +This will indicate that a fragment should be generated for the node, with the +given +.Va label +being the target, and the properties and child nodes will be used as the +__overlay__. +.Pp +Both conventional overlays and the later-added syntactic sugar are supported. +.Pp +Overlay blobs can be applied at boot time by setting +.Va fdt_overlays +in +.Xr loader.conf 5 . +Multiple overlays may be specified, and they will be applied in the order given. +.El .Sh EXAMPLES The command: .Pp @@ -254,8 +302,7 @@ will generate a file from the device tree source .Pa device.dts and print errors if any occur during parsing or property checking. -The -resulting file can be assembled and linked into a binary. +The resulting file can be assembled and linked into a binary. .Pp The command: .Pp @@ -265,6 +312,33 @@ will write the device tree source for the device tree .Pa device.dtb to the standard output. This is useful when debugging device trees. +.Pp +The command: +.Pp +.Dl "dtc -@ -O dtb -I dts -o device.dtb device.dts" +.Pp +will generate a +.Pa device.dtb +file from the device tree source +.Pa device.dts +with a __symbols__ node included so that overlays may be applied to it. +.Pp +The command: +.Pp +.Dl "dtc -@ -O dtb -I dts -o device_overlay.dtbo device_overlay.dts" +.Pp +will generate a +.Pa device_overlay.dtbo +file, using the standard extension for a device tree overlay, from the device +tree source +.Pa device_overlay.dts . +A __symbols__ node will be included so that overlays may be applied to it. +The presence of a +.Va /plugin/; +directive in +.Pa device_overlay.dts +will indicate to the utility that it should also generate the underlying +metadata required in overlays. .Sh COMPATIBILITY This utility is intended to be compatible with the device tree compiler provided by elinux.org. Modified: head/usr.bin/dtc/dtc.cc ============================================================================== --- head/usr.bin/dtc/dtc.cc Fri Jan 19 21:19:57 2018 (r328172) +++ head/usr.bin/dtc/dtc.cc Fri Jan 19 21:20:24 2018 (r328173) @@ -49,6 +49,8 @@ using namespace dtc; using std::string; +namespace { + /** * The current major version of the tool. */ @@ -65,7 +67,7 @@ int version_minor_compatible = 4; int version_patch = 0; int version_patch_compatible = 0; -static void usage(const string &argv0) +void usage(const string &argv0) { fprintf(stderr, "Usage:\n" "\t%s\t[-fhsv@] [-b boot_cpu_id] [-d dependency_file]" @@ -80,13 +82,15 @@ static void usage(const string &argv0) /** * Prints the current version of this program.. */ -static void version(const char* progname) +void version(const char* progname) { fprintf(stdout, "Version: %s %d.%d.%d compatible with gpl dtc %d.%d.%d\n", progname, version_major, version_minor, version_patch, version_major_compatible, version_minor_compatible, version_patch_compatible); } + +} // Anonymous namespace using fdt::device_tree; Modified: head/usr.bin/dtc/fdt.cc ============================================================================== --- head/usr.bin/dtc/fdt.cc Fri Jan 19 21:19:57 2018 (r328172) +++ head/usr.bin/dtc/fdt.cc Fri Jan 19 21:20:24 2018 (r328173) @@ -497,6 +497,29 @@ property::property(text_input_buffer &input, return; case '/': { + if (input.consume("/incbin/(\"")) + { + auto loc = input.location(); + std::string filename = input.parse_to('"'); + if (!(valid = input.consume('"'))) + { + loc.report_error("Syntax error, expected '\"' to terminate /incbin/("); + return; + } + property_value v; + if (!(valid = input.read_binary_file(filename, v.byte_data))) + { + input.parse_error("Cannot open binary include file"); + return; + } + if (!(valid &= input.consume(')'))) + { + input.parse_error("Syntax error, expected ')' to terminate /incbin/("); + return; + } + values.push_back(v); + break; + } unsigned long long bits = 0; valid = input.consume("/bits/"); input.next_token(); @@ -999,7 +1022,7 @@ node::get_property(const string &key) } void -node::merge_node(node_ptr other) +node::merge_node(node_ptr &other) { for (auto &l : other->labels) { @@ -1034,7 +1057,7 @@ node::merge_node(node_ptr other) { if (i->name == c->name && i->unit_address == c->unit_address) { - i->merge_node(std::move(c)); + i->merge_node(c); found = true; break; } @@ -1207,9 +1230,68 @@ device_tree::collect_names() collect_names_recursive(root, p); } +property_ptr +device_tree::assign_phandle(node *n, uint32_t &phandle) +{ + // If there is an existing phandle, use it + property_ptr p = n->get_property("phandle"); + if (p == 0) + { + p = n->get_property("linux,phandle"); + } + if (p == 0) + { + // Otherwise insert a new phandle node + property_value v; + while (used_phandles.find(phandle) != used_phandles.end()) + { + // Note that we only don't need to + // store this phandle in the set, + // because we are monotonically + // increasing the value of phandle and + // so will only ever revisit this value + // if we have used 2^32 phandles, at + // which point our blob won't fit in + // any 32-bit system and we've done + // something badly wrong elsewhere + // already. + phandle++; + } + push_big_endian(v.byte_data, phandle++); + if (phandle_node_name == BOTH || phandle_node_name == LINUX) + { + p.reset(new property("linux,phandle")); + p->add_value(v); + n->add_property(p); + } + if (phandle_node_name == BOTH || phandle_node_name == EPAPR) + { + p.reset(new property("phandle")); + p->add_value(v); + n->add_property(p); + } + } + + return (p); +} + void -device_tree::resolve_cross_references() +device_tree::assign_phandles(node_ptr &n, uint32_t &next) { + if (!n->labels.empty()) + { + assign_phandle(n.get(), next); + } + + for (auto &c : n->child_nodes()) + { + assign_phandles(c, next); + } +} + +void +device_tree::resolve_cross_references(uint32_t &phandle) +{ for (auto *pv : cross_references) { node_path path = node_paths[pv->string_data]; @@ -1252,7 +1334,6 @@ device_tree::resolve_cross_references() }); assert(sorted_phandles.size() == fixups.size()); - uint32_t phandle = 1; for (auto &i : sorted_phandles) { string target_name = i.get().val.string_data; @@ -1334,43 +1415,7 @@ device_tree::resolve_cross_references() } } // If there is an existing phandle, use it - property_ptr p = target->get_property("phandle"); - if (p == 0) - { - p = target->get_property("linux,phandle"); - } - if (p == 0) - { - // Otherwise insert a new phandle node - property_value v; - while (used_phandles.find(phandle) != used_phandles.end()) - { - // Note that we only don't need to - // store this phandle in the set, - // because we are monotonically - // increasing the value of phandle and - // so will only ever revisit this value - // if we have used 2^32 phandles, at - // which point our blob won't fit in - // any 32-bit system and we've done - // something badly wrong elsewhere - // already. - phandle++; - } - push_big_endian(v.byte_data, phandle++); - if (phandle_node_name == BOTH || phandle_node_name == LINUX) - { - p.reset(new property("linux,phandle")); - p->add_value(v); - target->add_property(p); - } - if (phandle_node_name == BOTH || phandle_node_name == EPAPR) - { - p.reset(new property("phandle")); - p->add_value(v); - target->add_property(p); - } - } + property_ptr p = assign_phandle(target, phandle); p->begin()->push_to_buffer(i.get().val.byte_data); assert(i.get().val.byte_data.size() == 4); } @@ -1644,7 +1689,73 @@ device_tree::node_path::to_string() const return path; } +node_ptr +device_tree::create_fragment_wrapper(node_ptr &node, int &fragnum) +{ + // In a plugin, we can massage these non-/ root nodes into into a fragment + std::string fragment_address = "fragment@" + std::to_string(fragnum); + ++fragnum; + + std::vector symbols; + + // Intentionally left empty + node_ptr newroot = node::create_special_node("", symbols); + node_ptr wrapper = node::create_special_node("__overlay__", symbols); + + // Generate the fragment with target = <&name> + property_value v; + v.string_data = node->name; + v.type = property_value::PHANDLE; + auto prop = std::make_shared(std::string("target")); + prop->add_value(v); + symbols.push_back(prop); + + node_ptr fragment = node::create_special_node(fragment_address, symbols); + + wrapper->merge_node(node); + fragment->add_child(std::move(wrapper)); + newroot->add_child(std::move(fragment)); + return newroot; +} + +node_ptr +device_tree::generate_root(node_ptr &node, int &fragnum) +{ + + string name = node->name; + if (name == string()) + { + return std::move(node); + } + else if (!is_plugin) + { + return nullptr; + } + + return create_fragment_wrapper(node, fragnum); +} + void +device_tree::reassign_fragment_numbers(node_ptr &node, int &delta) +{ + + for (auto &c : node->child_nodes()) + { + if (c->name == std::string("fragment")) + { + int current_address = std::stoi(c->unit_address, nullptr, 16); + std::ostringstream new_address; + current_address += delta; + // It's possible that we hopped more than one somewhere, so just reset + // delta to the next in sequence. + delta = current_address + 1; + new_address << std::hex << current_address; + c->unit_address = new_address.str(); + } + } +} + +void device_tree::parse_dts(const string &fn, FILE *depfile) { auto in = input_buffer::buffer_for_file(fn); @@ -1665,6 +1776,7 @@ device_tree::parse_dts(const string &fn, FILE *depfile dirname(fn), depfile); bool read_header = false; + int fragnum = 0; parse_file(input, roots, read_header); switch (roots.size()) { @@ -1673,18 +1785,36 @@ device_tree::parse_dts(const string &fn, FILE *depfile input.parse_error("Failed to find root node /."); return; case 1: - root = std::move(roots[0]); + root = generate_root(roots[0], fragnum); + if (!root) + { + valid = false; + input.parse_error("Failed to find root node /."); + return; + } break; default: { - root = std::move(roots[0]); + root = generate_root(roots[0], fragnum); + if (!root) + { + valid = false; + input.parse_error("Failed to find root node /."); + return; + } for (auto i=++(roots.begin()), e=roots.end() ; i!=e ; ++i) { auto &node = *i; string name = node->name; if (name == string()) { - root->merge_node(std::move(node)); + if (is_plugin) + { + // Re-assign any fragment numbers based on a delta of + // fragnum before we merge it + reassign_fragment_numbers(node, fragnum); + } + root->merge_node(node); } else { @@ -1696,20 +1826,36 @@ device_tree::parse_dts(const string &fn, FILE *depfile } if (existing == node_names.end()) { - fprintf(stderr, "Unable to merge node: %s\n", name.c_str()); + if (is_plugin) + { + auto fragment = create_fragment_wrapper(node, fragnum); + root->merge_node(fragment); + } + else + { + fprintf(stderr, "Unable to merge node: %s\n", name.c_str()); + } } else { - existing->second->merge_node(std::move(node)); + existing->second->merge_node(node); } } } } } collect_names(); - resolve_cross_references(); + uint32_t phandle = 1; + // If we're writing symbols, go ahead and assign phandles to the entire + // tree. We'll do this before we resolve cross references, just to keep + // order semi-predictable and stable. if (write_symbols) { + assign_phandles(root, phandle); + } + resolve_cross_references(phandle); + if (write_symbols) + { std::vector symbols; // Create a symbol table. Each label in this device tree may be // referenced by other plugins, so we create a __symbols__ node inside @@ -1769,21 +1915,72 @@ device_tree::parse_dts(const string &fn, FILE *depfile } symbols.clear(); // If we have any resolved phandle references in this plugin, then - // we must leave a property in the /__local_fixups__ node whose key - // is 'fixup' and whose value is as described above. + // we must create a child in the __local_fixups__ node whose path + // matches the node path from the root and whose value contains the + // location of the reference within a property. + + // Create a local_fixups node that is initially empty. + node_ptr local_fixups = node::create_special_node("__local_fixups__", symbols); for (auto &i : fixups) { if (!i.val.is_phandle()) { continue; } - symbols.push_back(create_fixup_entry(i, "fixup")); + node *n = local_fixups.get(); + for (auto &p : i.path) + { + // Skip the implicit root + if (p.first.empty()) + { + continue; + } + bool found = false; + for (auto &c : n->child_nodes()) + { + if (c->name == p.first) + { + n = c.get(); + found = true; + break; + } + } + if (!found) + { + n->add_child(node::create_special_node(p.first, symbols)); + n = (--n->child_end())->get(); + } + } + assert(n); + property_value pv; + push_big_endian(pv.byte_data, static_cast(i.prop->offset_of_value(i.val))); + pv.type = property_value::BINARY; + auto key = i.prop->get_key(); + property_ptr prop = n->get_property(key); + // If we don't have an existing property then create one and + // use this property value + if (!prop) + { + prop = std::make_shared(std::move(key)); + n->add_property(prop); + prop->add_value(pv); + } + else + { + // If we do have an existing property value, try to append + // this value. + property_value &old_val = *(--prop->end()); + if (!old_val.try_to_merge(pv)) + { + prop->add_value(pv); + } + } } // We've iterated over all fixups, but only emit the // __local_fixups__ if we found some that were resolved internally. - if (!symbols.empty()) + if (local_fixups->child_begin() != local_fixups->child_end()) { - root->add_child(node::create_special_node("__local_fixups__", symbols)); + root->add_child(std::move(local_fixups)); } } } Modified: head/usr.bin/dtc/fdt.hh ============================================================================== --- head/usr.bin/dtc/fdt.hh Fri Jan 19 21:19:57 2018 (r328172) +++ head/usr.bin/dtc/fdt.hh Fri Jan 19 21:20:24 2018 (r328173) @@ -370,7 +370,7 @@ class property /** * Returns the key for this property. */ - inline std::string get_key() + inline const std::string &get_key() { return key; } @@ -620,7 +620,7 @@ class node * Merges a node into this one. Any properties present in both are * overridden, any properties present in only one are preserved. */ - void merge_node(node_ptr other); + void merge_node(node_ptr &other); /** * Write this node to the specified output. Although nodes do not * refer to a string table directly, their properties do. The string @@ -676,12 +676,12 @@ class device_tree /** * The format that we should use for writing phandles. */ - phandle_format phandle_node_name; + phandle_format phandle_node_name = EPAPR; /** * Flag indicating that this tree is valid. This will be set to false * on parse errors. */ - bool valid; + bool valid = true; /** * Type used for memory reservations. A reservation is two 64-bit * values indicating a base address and length in memory that the @@ -775,23 +775,23 @@ class device_tree /** * The default boot CPU, specified in the device tree header. */ - uint32_t boot_cpu; + uint32_t boot_cpu = 0; /** * The number of empty reserve map entries to generate in the blob. */ - uint32_t spare_reserve_map_entries; + uint32_t spare_reserve_map_entries = 0; /** * The minimum size in bytes of the blob. */ - uint32_t minimum_blob_size; + uint32_t minimum_blob_size = 0; /** * The number of bytes of padding to add to the end of the blob. */ - uint32_t blob_padding; + uint32_t blob_padding = 0; /** * Is this tree a plugin? */ - bool is_plugin; + bool is_plugin = false; /** * Visit all of the nodes recursively, and if they have labels then add * them to the node_paths and node_names vectors so that they can be @@ -800,6 +800,12 @@ class device_tree */ void collect_names_recursive(node_ptr &n, node_path &path); /** + * Assign a phandle property to a single node. The next parameter + * holds the phandle to be assigned, and will be incremented upon + * assignment. + */ + property_ptr assign_phandle(node *n, uint32_t &next); + /** * Assign phandle properties to all nodes that have been referenced and * require one. This method will recursively visit the tree starting at * the node that it is passed. @@ -812,9 +818,11 @@ class device_tree /** * Resolves all cross references. Any properties that refer to another * node must have their values replaced by either the node path or - * phandle value. + * phandle value. The phandle parameter holds the next phandle to be + * assigned, should the need arise. It will be incremented upon each + * assignment of a phandle. */ - void resolve_cross_references(); + void resolve_cross_references(uint32_t &phandle); /** * Parses a dts file in the given buffer and adds the roots to the parsed * set. The `read_header` argument indicates whether the header has @@ -859,15 +867,33 @@ class device_tree /** * Default constructor. Creates a valid, but empty FDT. */ - device_tree() : phandle_node_name(EPAPR), valid(true), - boot_cpu(0), spare_reserve_map_entries(0), - minimum_blob_size(0), blob_padding(0) {} + device_tree() {} /** * Constructs a device tree from the specified file name, referring to * a file that contains a device tree blob. */ void parse_dtb(const std::string &fn, FILE *depfile); /** + * Construct a fragment wrapper around node. This will assume that node's + * name may be used as the target of the fragment, and the contents are to + * be wrapped in an __overlay__ node. The fragment wrapper will be assigned + * fragnumas its fragment number, and fragment number will be incremented. + */ + node_ptr create_fragment_wrapper(node_ptr &node, int &fragnum); + /** + * Generate a root node from the node passed in. This is sensitive to + * whether we're in a plugin context or not, so that if we're in a plugin we + * can circumvent any errors that might normally arise from a non-/ root. + * fragnum will be assigned to any fragment wrapper generated as a result + * of the call, and fragnum will be incremented. + */ + node_ptr generate_root(node_ptr &node, int &fragnum); + /** + * Reassign any fragment numbers from this new node, based on the given + * delta. + */ + void reassign_fragment_numbers(node_ptr &node, int &delta); + /* * Constructs a device tree from the specified file name, referring to * a file that contains device tree source. */ @@ -906,7 +932,10 @@ class device_tree */ void sort() { - root->sort(); + if (root) + { + root->sort(); + } } /** * Adds a path to search for include files. The argument must be a Modified: head/usr.bin/dtc/input_buffer.cc ============================================================================== --- head/usr.bin/dtc/input_buffer.cc Fri Jan 19 21:19:57 2018 (r328172) +++ head/usr.bin/dtc/input_buffer.cc Fri Jan 19 21:20:24 2018 (r328173) @@ -206,9 +206,9 @@ text_input_buffer::handle_include() { next_token(); string name = parse_property_name(); - if (defines.count(name) > 0) + if (defines.count(name) == 0) { - reallyInclude = true; + reallyInclude = false; } consume('/'); } @@ -250,6 +250,48 @@ text_input_buffer::handle_include() return; } input_stack.push(std::move(include_buffer)); +} + +bool text_input_buffer::read_binary_file(const std::string &filename, byte_buffer &b) +{ + bool try_include_paths = true; + string include_file; + if (filename[0] == '/') + { + include_file = filename; + // Don't try include paths if we're given an absolute path. + // Failing is better so that we don't accidentally do the wrong thing, + // but make it seem like everything is alright. + try_include_paths = false; + } + else + { + include_file = dir + '/' + filename; + } + auto include_buffer = input_buffer::buffer_for_file(include_file, false); + if (include_buffer == 0 && try_include_paths) + { + for (auto i : include_paths) + { + include_file = i + '/' + filename; + include_buffer = input_buffer::buffer_for_file(include_file, false); + if (include_buffer != 0) + { + break; + } + } + } + if (!include_buffer) + { + return false; + } + if (depfile) + { + putc(' ', depfile); + fputs(include_file.c_str(), depfile); + } + b.insert(b.begin(), include_buffer->begin(), include_buffer->end()); + return true; } input_buffer Modified: head/usr.bin/dtc/input_buffer.hh ============================================================================== --- head/usr.bin/dtc/input_buffer.hh Fri Jan 19 21:19:57 2018 (r328172) +++ head/usr.bin/dtc/input_buffer.hh Fri Jan 19 21:20:24 2018 (r328173) @@ -166,6 +166,14 @@ class input_buffer cursor++; return *this; } + const char *begin() + { + return buffer; + } + const char *end() + { + return buffer + size; + } /** * Consumes a character. Moves the cursor one character forward if the * next character matches the argument, returning true. If the current @@ -525,6 +533,13 @@ class text_input_buffer * Prints a message indicating the location of a parse error. */ void parse_error(const char *msg); + /** + * Reads the contents of a binary file into `b`. The file name is assumed + * to be relative to one of the include paths. + * + * Returns true if the file exists and can be read, false otherwise. + */ + bool read_binary_file(const std::string &filename, byte_buffer &b); private: /** * Prints a message indicating the location of a parse error, given a From owner-svn-src-head@freebsd.org Fri Jan 19 21:36:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE43DEC9EB0; Fri, 19 Jan 2018 21:36:29 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B97FF77138; Fri, 19 Jan 2018 21:36:29 +0000 (UTC) (envelope-from landonf@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 060C01307E; Fri, 19 Jan 2018 21:36:29 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0JLaS3T022531; Fri, 19 Jan 2018 21:36:28 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0JLaSfI022530; Fri, 19 Jan 2018 21:36:28 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201801192136.w0JLaSfI022530@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Fri, 19 Jan 2018 21:36:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328174 - head/sys/dev/bhnd/cores/chipc X-SVN-Group: head X-SVN-Commit-Author: landonf X-SVN-Commit-Paths: head/sys/dev/bhnd/cores/chipc X-SVN-Commit-Revision: 328174 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 21:36:30 -0000 Author: landonf Date: Fri Jan 19 21:36:28 2018 New Revision: 328174 URL: https://svnweb.freebsd.org/changeset/base/328174 Log: bhnd_chipc(4): Fix the assignment of non-wildcard child unit numbers introduced in r326102 and r326109; all chipc children should be added with a wildcard unit (-1). Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/bhnd/cores/chipc/chipc.c Modified: head/sys/dev/bhnd/cores/chipc/chipc.c ============================================================================== --- head/sys/dev/bhnd/cores/chipc/chipc.c Fri Jan 19 21:20:24 2018 (r328173) +++ head/sys/dev/bhnd/cores/chipc/chipc.c Fri Jan 19 21:36:28 2018 (r328174) @@ -295,13 +295,13 @@ chipc_add_children(struct chipc_softc *sc) * attached directly to the bhnd(4) bus -- not chipc. */ if (sc->caps.pmu && !sc->caps.aob) { - child = BUS_ADD_CHILD(sc->dev, 0, "bhnd_pmu", 0); + child = BUS_ADD_CHILD(sc->dev, 0, "bhnd_pmu", -1); if (child == NULL) { device_printf(sc->dev, "failed to add pmu\n"); return (ENXIO); } } else if (sc->caps.pwr_ctrl) { - child = BUS_ADD_CHILD(sc->dev, 0, "bhnd_pwrctl", 0); + child = BUS_ADD_CHILD(sc->dev, 0, "bhnd_pwrctl", -1); if (child == NULL) { device_printf(sc->dev, "failed to add pwrctl\n"); return (ENXIO); @@ -309,7 +309,7 @@ chipc_add_children(struct chipc_softc *sc) } /* GPIO */ - child = BUS_ADD_CHILD(sc->dev, 0, "gpio", 0); + child = BUS_ADD_CHILD(sc->dev, 0, "gpio", -1); if (child == NULL) { device_printf(sc->dev, "failed to add gpio\n"); return (ENXIO); From owner-svn-src-head@freebsd.org Fri Jan 19 21:58:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E85F8ECADCD; Fri, 19 Jan 2018 21:58:49 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C3BE677DA7; Fri, 19 Jan 2018 21:58:49 +0000 (UTC) (envelope-from landonf@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0FFBA133A6; Fri, 19 Jan 2018 21:58:49 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0JLwmUv030946; Fri, 19 Jan 2018 21:58:48 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0JLwmgL030944; Fri, 19 Jan 2018 21:58:48 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201801192158.w0JLwmgL030944@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Fri, 19 Jan 2018 21:58:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328176 - in head/sys/dev/bhnd: cores/chipc/pwrctl siba X-SVN-Group: head X-SVN-Commit-Author: landonf X-SVN-Commit-Paths: in head/sys/dev/bhnd: cores/chipc/pwrctl siba X-SVN-Commit-Revision: 328176 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 21:58:50 -0000 Author: landonf Date: Fri Jan 19 21:58:48 2018 New Revision: 328176 URL: https://svnweb.freebsd.org/changeset/base/328176 Log: bhnd(4): fix a few bugs in pwrctl/fixed-clock device support. - Do not panic on siba(4) detach when the bhnd(4) bus calls bhnd_get_pmu_info() on a PMU-less device. - Fix bhnd_pwrctl attach/detach on fixed-clock devices: - Treat bhnd_pwrctl_updateclk() as a no-op on fixed-clock devices. - Use bhnd_pwrctl_updateclk() to perform the appropriate clock transition on detach. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/bhnd/cores/chipc/pwrctl/bhnd_pwrctl.c head/sys/dev/bhnd/siba/siba.c Modified: head/sys/dev/bhnd/cores/chipc/pwrctl/bhnd_pwrctl.c ============================================================================== --- head/sys/dev/bhnd/cores/chipc/pwrctl/bhnd_pwrctl.c Fri Jan 19 21:56:22 2018 (r328175) +++ head/sys/dev/bhnd/cores/chipc/pwrctl/bhnd_pwrctl.c Fri Jan 19 21:58:48 2018 (r328176) @@ -209,13 +209,13 @@ bhnd_pwrctl_detach(device_t dev) if ((error = bhnd_deregister_provider(dev, BHND_SERVICE_ANY))) return (error); + /* Update clock state */ PWRCTL_LOCK(sc); - - if ((error = bhnd_pwrctl_setclk(sc, BHND_CLOCK_DYN))) + error = bhnd_pwrctl_updateclk(sc, BHND_PWRCTL_WAR_DOWN); + PWRCTL_UNLOCK(sc); + if (error) return (error); - PWRCTL_UNLOCK(sc); - STAILQ_FOREACH_SAFE(clkres, &sc->clkres_list, cr_link, crnext) free(clkres, M_DEVBUF); @@ -343,6 +343,10 @@ bhnd_pwrctl_updateclk(struct bhnd_pwrctl_softc *sc, bh bhnd_clock clock; PWRCTL_LOCK_ASSERT(sc, MA_OWNED); + + /* Nothing to update on fixed clock devices */ + if (PWRCTL_QUIRK(sc, FIXED_CLK)) + return (0); /* Default clock target */ clock = BHND_CLOCK_DYN; Modified: head/sys/dev/bhnd/siba/siba.c ============================================================================== --- head/sys/dev/bhnd/siba/siba.c Fri Jan 19 21:56:22 2018 (r328175) +++ head/sys/dev/bhnd/siba/siba.c Fri Jan 19 21:58:48 2018 (r328176) @@ -170,9 +170,9 @@ siba_read_ivar(device_t dev, device_t child, int index case SIBA_PMU_PWRCTL: case SIBA_PMU_FIXED: - panic("bhnd_get_pmu_info() called with siba PMU state " - "%d", dinfo->pmu_state); - return (ENXIO); + *result = (uintptr_t)NULL; + SIBA_UNLOCK(sc); + return (0); } panic("invalid PMU state: %d", dinfo->pmu_state); From owner-svn-src-head@freebsd.org Fri Jan 19 22:10:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 808C5ECB718; Fri, 19 Jan 2018 22:10:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3E5E078693; Fri, 19 Jan 2018 22:10:31 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6215513552; Fri, 19 Jan 2018 22:10:30 +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 w0JMAUhA035029; Fri, 19 Jan 2018 22:10:30 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0JMATKl035022; Fri, 19 Jan 2018 22:10:29 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201801192210.w0JMATKl035022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 19 Jan 2018 22:10:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328177 - in head/sys/amd64: amd64 include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys/amd64: amd64 include X-SVN-Commit-Revision: 328177 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 22:10:31 -0000 Author: kib Date: Fri Jan 19 22:10:29 2018 New Revision: 328177 URL: https://svnweb.freebsd.org/changeset/base/328177 Log: PTI: Trap if we returned to userspace with kernel (full) page table still active. Map userspace portion of VA in the PTI kernel-mode page table as non-executable. This way, if we ever miss reloading ucr3 into %cr3 on the return to usermode, the process traps instead of executing in potentially vulnerable setup. Catch the condition of such trap and verify user-mode %cr3, which is saved by page fault handler. I peek this trick in some article about Linux implementation. Reviewed by: alc, markj (previous version) Sponsored by: The FreeBSD Foundation MFC after: 12 days DIfferential revision: https://reviews.freebsd.org/D13956 Modified: head/sys/amd64/amd64/exception.S head/sys/amd64/amd64/genassym.c head/sys/amd64/amd64/pmap.c head/sys/amd64/amd64/trap.c head/sys/amd64/include/asmacros.h head/sys/amd64/include/pcb.h head/sys/amd64/include/pcpu.h Modified: head/sys/amd64/amd64/exception.S ============================================================================== --- head/sys/amd64/amd64/exception.S Fri Jan 19 21:58:48 2018 (r328176) +++ head/sys/amd64/amd64/exception.S Fri Jan 19 22:10:29 2018 (r328177) @@ -287,24 +287,42 @@ IDTVEC(dblfault) 3: hlt jmp 3b - PTI_ENTRY page, Xpage, has_err=1 + ALIGN_TEXT +IDTVEC(page_pti) + testb $SEL_RPL_MASK,PTI_CS-2*8(%rsp) + jz Xpage + swapgs + pushq %rax + pushq %rdx + movq %cr3,%rax + movq %rax,PCPU(SAVED_UCR3) + PTI_UUENTRY has_err=1 + subq $TF_ERR,%rsp + movq %rdi,TF_RDI(%rsp) + movq %rax,TF_RAX(%rsp) + movq %rdx,TF_RDX(%rsp) + jmp page_u IDTVEC(page) subq $TF_ERR,%rsp - movq %rdi,TF_RDI(%rsp) /* free up a GP register */ + movq %rdi,TF_RDI(%rsp) /* free up GP registers */ + movq %rax,TF_RAX(%rsp) + movq %rdx,TF_RDX(%rsp) testb $SEL_RPL_MASK,TF_CS(%rsp) /* Did we come from kernel? */ jz page_cr2 /* already running with kernel GS.base */ swapgs - movq PCPU(CURPCB),%rdi +page_u: movq PCPU(CURPCB),%rdi andl $~PCB_FULL_IRET,PCB_FLAGS(%rdi) + movq PCPU(SAVED_UCR3),%rax + movq %rax,PCB_SAVED_UCR3(%rdi) page_cr2: movq %cr2,%rdi /* preserve %cr2 before .. */ movq %rdi,TF_ADDR(%rsp) /* enabling interrupts. */ SAVE_SEGS movl $T_PAGEFLT,TF_TRAPNO(%rsp) testl $PSL_I,TF_RFLAGS(%rsp) - jz alltraps_pushregs_no_rdi + jz alltraps_pushregs_no_rax sti - jmp alltraps_pushregs_no_rdi + jmp alltraps_pushregs_no_rax /* * We have to special-case this one. If we get a trap in doreti() at Modified: head/sys/amd64/amd64/genassym.c ============================================================================== --- head/sys/amd64/amd64/genassym.c Fri Jan 19 21:58:48 2018 (r328176) +++ head/sys/amd64/amd64/genassym.c Fri Jan 19 22:10:29 2018 (r328177) @@ -141,6 +141,7 @@ ASSYM(PCB_LDT, offsetof(struct pcb, pcb_ldt)); ASSYM(PCB_TR, offsetof(struct pcb, pcb_tr)); ASSYM(PCB_FLAGS, offsetof(struct pcb, pcb_flags)); ASSYM(PCB_ONFAULT, offsetof(struct pcb, pcb_onfault)); +ASSYM(PCB_SAVED_UCR3, offsetof(struct pcb, pcb_saved_ucr3)); ASSYM(PCB_TSSP, offsetof(struct pcb, pcb_tssp)); ASSYM(PCB_SAVEFPU, offsetof(struct pcb, pcb_save)); ASSYM(PCB_EFER, offsetof(struct pcb, pcb_efer)); @@ -224,6 +225,7 @@ ASSYM(PC_TSS, offsetof(struct pcpu, pc_tss)); ASSYM(PC_PM_SAVE_CNT, offsetof(struct pcpu, pc_pm_save_cnt)); ASSYM(PC_KCR3, offsetof(struct pcpu, pc_kcr3)); ASSYM(PC_UCR3, offsetof(struct pcpu, pc_ucr3)); +ASSYM(PC_SAVED_UCR3, offsetof(struct pcpu, pc_saved_ucr3)); ASSYM(PC_PTI_STACK, offsetof(struct pcpu, pc_pti_stack)); ASSYM(PC_PTI_STACK_SZ, PC_PTI_STACK_SZ); Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Fri Jan 19 21:58:48 2018 (r328176) +++ head/sys/amd64/amd64/pmap.c Fri Jan 19 22:10:29 2018 (r328177) @@ -2575,6 +2575,15 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t ptepindex, str pml4 = &pmap->pm_pml4[pml4index]; *pml4 = VM_PAGE_TO_PHYS(m) | PG_U | PG_RW | PG_V | PG_A | PG_M; if (pmap->pm_pml4u != NULL && pml4index < NUPML4E) { + /* + * PTI: Make all user-space mappings in the + * kernel-mode page table no-execute so that + * we detect any programming errors that leave + * the kernel-mode page table active on return + * to user space. + */ + *pml4 |= pg_nx; + pml4u = &pmap->pm_pml4u[pml4index]; *pml4u = VM_PAGE_TO_PHYS(m) | PG_U | PG_RW | PG_V | PG_A | PG_M; Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Fri Jan 19 21:58:48 2018 (r328176) +++ head/sys/amd64/amd64/trap.c Fri Jan 19 22:10:29 2018 (r328177) @@ -702,6 +702,17 @@ trap_pfault(struct trapframe *frame, int usermode) } /* + * If nx protection of the usermode portion of kernel page + * tables caused trap, panic. + */ + if (pti && usermode && pg_nx != 0 && (frame->tf_err & (PGEX_P | PGEX_W | + PGEX_U | PGEX_I)) == (PGEX_P | PGEX_U | PGEX_I) && + (curpcb->pcb_saved_ucr3 & ~(PMAP_PCID_OVERMAX - 1))== + (PCPU_GET(curpmap)->pm_cr3 & ~(PMAP_PCID_OVERMAX - 1))) + panic("PTI: pid %d comm %s tf_err %#lx\n", p->p_pid, + p->p_comm, frame->tf_err); + + /* * PGEX_I is defined only if the execute disable bit capability is * supported and enabled. */ Modified: head/sys/amd64/include/asmacros.h ============================================================================== --- head/sys/amd64/include/asmacros.h Fri Jan 19 21:58:48 2018 (r328176) +++ head/sys/amd64/include/asmacros.h Fri Jan 19 22:10:29 2018 (r328177) @@ -183,10 +183,7 @@ .endr .endm - .macro PTI_UENTRY has_err - swapgs - pushq %rax - pushq %rdx + .macro PTI_UUENTRY has_err movq PCPU(KCR3),%rax movq %rax,%cr3 movq PCPU(RSP0),%rax @@ -195,6 +192,13 @@ movq %rax,%rsp popq %rdx popq %rax + .endm + + .macro PTI_UENTRY has_err + swapgs + pushq %rax + pushq %rdx + PTI_UUENTRY \has_err .endm .macro PTI_ENTRY name, cont, has_err=0 Modified: head/sys/amd64/include/pcb.h ============================================================================== --- head/sys/amd64/include/pcb.h Fri Jan 19 21:58:48 2018 (r328176) +++ head/sys/amd64/include/pcb.h Fri Jan 19 22:10:29 2018 (r328177) @@ -92,7 +92,7 @@ struct pcb { /* copyin/out fault recovery */ caddr_t pcb_onfault; - uint64_t pcb_pad0; + uint64_t pcb_saved_ucr3; /* local tss, with i/o bitmap; NULL for common */ struct amd64tss *pcb_tssp; Modified: head/sys/amd64/include/pcpu.h ============================================================================== --- head/sys/amd64/include/pcpu.h Fri Jan 19 21:58:48 2018 (r328176) +++ head/sys/amd64/include/pcpu.h Fri Jan 19 22:10:29 2018 (r328177) @@ -51,6 +51,7 @@ struct amd64tss *pc_commontssp;/* Common TSS for the CPU */ \ uint64_t pc_kcr3; \ uint64_t pc_ucr3; \ + uint64_t pc_saved_ucr3; \ register_t pc_rsp0; \ register_t pc_scratch_rsp; /* User %rsp in syscall */ \ register_t pc_scratch_rax; \ @@ -73,7 +74,7 @@ uint32_t pc_pcid_next; \ uint32_t pc_pcid_gen; \ uint32_t pc_smp_tlb_done; /* TLB op acknowledgement */ \ - char __pad[232] /* be divisor of PAGE_SIZE \ + char __pad[224] /* be divisor of PAGE_SIZE \ after cache alignment */ #define PC_DBREG_CMD_NONE 0 From owner-svn-src-head@freebsd.org Fri Jan 19 22:17:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6DDC2ECBC32; Fri, 19 Jan 2018 22:17:15 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47C2078C39; Fri, 19 Jan 2018 22:17: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 621F8136EA; Fri, 19 Jan 2018 22:17: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 w0JMHE6T039117; Fri, 19 Jan 2018 22:17:14 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0JMHDlp039113; Fri, 19 Jan 2018 22:17:13 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201801192217.w0JMHDlp039113@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Fri, 19 Jan 2018 22:17:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328178 - in head/sys: arm/include compat/linuxkpi/common/src i386/include sys X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: in head/sys: arm/include compat/linuxkpi/common/src i386/include sys X-SVN-Commit-Revision: 328178 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 22:17:15 -0000 Author: nwhitehorn Date: Fri Jan 19 22:17:13 2018 New Revision: 328178 URL: https://svnweb.freebsd.org/changeset/base/328178 Log: Define PHYS_TO_DMAP() and DMAP_TO_PHYS() as panics on the architectures (i386 and arm) that never implement them. This allows the removal of #ifdef PHYS_TO_DMAP on code otherwise protected by a runtime check on PMAP_HAS_DMAP. It also fixes the build on ARM and i386 after I forgot an #ifdef in r328168. Reported by: Milan Obuch Pointy hat to: me Modified: head/sys/arm/include/vmparam.h head/sys/compat/linuxkpi/common/src/linux_page.c head/sys/i386/include/vmparam.h head/sys/sys/sf_buf.h Modified: head/sys/arm/include/vmparam.h ============================================================================== --- head/sys/arm/include/vmparam.h Fri Jan 19 22:10:29 2018 (r328177) +++ head/sys/arm/include/vmparam.h Fri Jan 19 22:17:13 2018 (r328178) @@ -188,6 +188,8 @@ extern vm_offset_t vm_max_kernel_address; #define SFBUF_MAP #define PMAP_HAS_DMAP 0 +#define PHYS_TO_DMAP(x) ({ panic("No direct map exists"); 0; }) +#define DMAP_TO_PHYS(x) ({ panic("No direct map exists"); 0; }) #define DEVMAP_MAX_VADDR ARM_VECTORS_HIGH Modified: head/sys/compat/linuxkpi/common/src/linux_page.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_page.c Fri Jan 19 22:10:29 2018 (r328177) +++ head/sys/compat/linuxkpi/common/src/linux_page.c Fri Jan 19 22:17:13 2018 (r328178) @@ -68,12 +68,8 @@ linux_page_address(struct page *page) { if (page->object != kmem_object && page->object != kernel_object) { -#ifdef PHYS_TO_DMAP return (PMAP_HAS_DMAP ? ((void *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(page))) : NULL); -#else - return (NULL); -#endif } return ((void *)(uintptr_t)(VM_MIN_KERNEL_ADDRESS + IDX_TO_OFF(page->pindex))); @@ -82,66 +78,65 @@ linux_page_address(struct page *page) vm_page_t linux_alloc_pages(gfp_t flags, unsigned int order) { -#ifdef PHYS_TO_DMAP - KASSERT(PMAP_HAS_DMAP, ("Direct map unavailable")); - unsigned long npages = 1UL << order; - int req = (flags & M_ZERO) ? (VM_ALLOC_ZERO | VM_ALLOC_NOOBJ | - VM_ALLOC_NORMAL) : (VM_ALLOC_NOOBJ | VM_ALLOC_NORMAL); vm_page_t page; - if (order == 0 && (flags & GFP_DMA32) == 0) { - page = vm_page_alloc(NULL, 0, req); - if (page == NULL) - return (NULL); - } else { - vm_paddr_t pmax = (flags & GFP_DMA32) ? - BUS_SPACE_MAXADDR_32BIT : BUS_SPACE_MAXADDR; -retry: - page = vm_page_alloc_contig(NULL, 0, req, - npages, 0, pmax, PAGE_SIZE, 0, VM_MEMATTR_DEFAULT); + if (PMAP_HAS_DMAP) { + unsigned long npages = 1UL << order; + int req = (flags & M_ZERO) ? (VM_ALLOC_ZERO | VM_ALLOC_NOOBJ | + VM_ALLOC_NORMAL) : (VM_ALLOC_NOOBJ | VM_ALLOC_NORMAL); - if (page == NULL) { - if (flags & M_WAITOK) { - if (!vm_page_reclaim_contig(req, - npages, 0, pmax, PAGE_SIZE, 0)) { - VM_WAIT; + if (order == 0 && (flags & GFP_DMA32) == 0) { + page = vm_page_alloc(NULL, 0, req); + if (page == NULL) + return (NULL); + } else { + vm_paddr_t pmax = (flags & GFP_DMA32) ? + BUS_SPACE_MAXADDR_32BIT : BUS_SPACE_MAXADDR; + retry: + page = vm_page_alloc_contig(NULL, 0, req, + npages, 0, pmax, PAGE_SIZE, 0, VM_MEMATTR_DEFAULT); + + if (page == NULL) { + if (flags & M_WAITOK) { + if (!vm_page_reclaim_contig(req, + npages, 0, pmax, PAGE_SIZE, 0)) { + VM_WAIT; + } + flags &= ~M_WAITOK; + goto retry; } - flags &= ~M_WAITOK; - goto retry; + return (NULL); } - return (NULL); } - } - if (flags & M_ZERO) { - unsigned long x; + if (flags & M_ZERO) { + unsigned long x; - for (x = 0; x != npages; x++) { - vm_page_t pgo = page + x; + for (x = 0; x != npages; x++) { + vm_page_t pgo = page + x; - if ((pgo->flags & PG_ZERO) == 0) - pmap_zero_page(pgo); + if ((pgo->flags & PG_ZERO) == 0) + pmap_zero_page(pgo); + } } - } -#else - vm_offset_t vaddr; - vm_page_t page; + } else { + vm_offset_t vaddr; - vaddr = linux_alloc_kmem(flags, order); - if (vaddr == 0) - return (NULL); + vaddr = linux_alloc_kmem(flags, order); + if (vaddr == 0) + return (NULL); - page = PHYS_TO_VM_PAGE(vtophys((void *)vaddr)); + page = PHYS_TO_VM_PAGE(vtophys((void *)vaddr)); - KASSERT(vaddr == (vm_offset_t)page_address(page), - ("Page address mismatch")); -#endif + KASSERT(vaddr == (vm_offset_t)page_address(page), + ("Page address mismatch")); + } + return (page); } void linux_free_pages(vm_page_t page, unsigned int order) { -#ifdef PHYS_TO_DMAP if (PMAP_HAS_DMAP) { unsigned long npages = 1UL << order; unsigned long x; @@ -154,15 +149,12 @@ linux_free_pages(vm_page_t page, unsigned int order) vm_page_unlock(pgo); } } else { -#endif vm_offset_t vaddr; vaddr = (vm_offset_t)page_address(page); linux_free_kmem(vaddr, order); -#ifdef PHYS_TO_DMAP } -#endif } vm_offset_t Modified: head/sys/i386/include/vmparam.h ============================================================================== --- head/sys/i386/include/vmparam.h Fri Jan 19 22:10:29 2018 (r328177) +++ head/sys/i386/include/vmparam.h Fri Jan 19 22:17:13 2018 (r328178) @@ -203,5 +203,7 @@ #define SFBUF_PROCESS_PAGE #define PMAP_HAS_DMAP 0 +#define PHYS_TO_DMAP(x) ({ panic("No direct map exists"); 0; }) +#define DMAP_TO_PHYS(x) ({ panic("No direct map exists"); 0; }) #endif /* _MACHINE_VMPARAM_H_ */ Modified: head/sys/sys/sf_buf.h ============================================================================== --- head/sys/sys/sf_buf.h Fri Jan 19 22:10:29 2018 (r328177) +++ head/sys/sys/sf_buf.h Fri Jan 19 22:17:13 2018 (r328178) @@ -115,10 +115,8 @@ void sf_buf_ref(struct sf_buf *); static inline vm_offset_t sf_buf_kva(struct sf_buf *sf) { -#ifdef PMAP_HAS_DMAP if (PMAP_HAS_DMAP) return (PHYS_TO_DMAP(VM_PAGE_TO_PHYS((vm_page_t)sf))); -#endif return (sf->kva); } @@ -126,10 +124,8 @@ sf_buf_kva(struct sf_buf *sf) static inline vm_page_t sf_buf_page(struct sf_buf *sf) { -#ifdef PMAP_HAS_DMAP if (PMAP_HAS_DMAP) return ((vm_page_t)sf); -#endif return (sf->m); } From owner-svn-src-head@freebsd.org Fri Jan 19 22:19:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83446ECBDAD; Fri, 19 Jan 2018 22:19:51 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5DFCB78DEC; Fri, 19 Jan 2018 22:19:51 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A78DA136EB; Fri, 19 Jan 2018 22:19:50 +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 w0JMJoUj039242; Fri, 19 Jan 2018 22:19:50 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0JMJo5a039241; Fri, 19 Jan 2018 22:19:50 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201801192219.w0JMJo5a039241@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Fri, 19 Jan 2018 22:19:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328179 - 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: 328179 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 22:19:51 -0000 Author: nwhitehorn Date: Fri Jan 19 22:19:50 2018 New Revision: 328179 URL: https://svnweb.freebsd.org/changeset/base/328179 Log: On AIM systems without a software-managed SLB, such as POWER9 systems using either hardware segment tables or radix-tree-based page tables, do not try to install SLB entries at trap boundaries. Modified: head/sys/powerpc/aim/trap_subr64.S Modified: head/sys/powerpc/aim/trap_subr64.S ============================================================================== --- head/sys/powerpc/aim/trap_subr64.S Fri Jan 19 22:17:13 2018 (r328178) +++ head/sys/powerpc/aim/trap_subr64.S Fri Jan 19 22:19:50 2018 (r328179) @@ -58,6 +58,9 @@ restore_usersrs: GET_CPUINFO(%r28) ld %r28,PC_USERSLB(%r28) + cmpdi %r28, 0 /* If user SLB pointer NULL, exit */ + beqlr + li %r29, 0 /* Set the counter to zero */ slbia @@ -83,6 +86,12 @@ restore_usersrs: restore_kernsrs: GET_CPUINFO(%r28) addi %r28,%r28,PC_KERNSLB + ld %r29,16(%r28) /* One past USER_SLB_SLOT */ + cmpdi %r28,0 + beqlr /* If first kernel entry is invalid, + * SLBs not in use, so exit early */ + + /* Otherwise, set up SLBs */ li %r29, 0 /* Set the counter to zero */ slbia From owner-svn-src-head@freebsd.org Fri Jan 19 22:22:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18A94ECC02F; Fri, 19 Jan 2018 22:22:04 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E7E0B791AE; Fri, 19 Jan 2018 22:22:03 +0000 (UTC) (envelope-from landonf@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 438CF13856; Fri, 19 Jan 2018 22:22:03 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0JMM3P3042432; Fri, 19 Jan 2018 22:22:03 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0JMM3gk042431; Fri, 19 Jan 2018 22:22:03 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201801192222.w0JMM3gk042431@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Fri, 19 Jan 2018 22:22:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328180 - head/sys/dev/bhnd/bhndb X-SVN-Group: head X-SVN-Commit-Author: landonf X-SVN-Commit-Paths: head/sys/dev/bhnd/bhndb X-SVN-Commit-Revision: 328180 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 22:22:04 -0000 Author: landonf Date: Fri Jan 19 22:22:02 2018 New Revision: 328180 URL: https://svnweb.freebsd.org/changeset/base/328180 Log: bhndb_pci(4): Implement bridge support for CardBus-attached devices. - Extend the probe method to accept devclasses that inherit from the pci devclass (e.g. cardbus). - Some BCM4306-based CardBus adapters appear to advertise 4K SPROM, but only the first 2K is mapped into BAR0. We can safely assume that the SPROM data fits within the first 2K of the SPROM, rather than rejecting the SPROM mapping as invalid. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/bhnd/bhndb/bhndb_pci.c Modified: head/sys/dev/bhnd/bhndb/bhndb_pci.c ============================================================================== --- head/sys/dev/bhnd/bhndb/bhndb_pci.c Fri Jan 19 22:19:50 2018 (r328179) +++ head/sys/dev/bhnd/bhndb/bhndb_pci.c Fri Jan 19 22:22:02 2018 (r328180) @@ -264,8 +264,8 @@ bhndb_pci_probe(device_t dev) struct bhndb_pci_probe *probe; struct bhndb_pci_core *entry; bhnd_devclass_t hostb_devclass; - device_t parent; - devclass_t parent_bus, pci; + device_t parent, parent_bus; + devclass_t pci, bus_devclass; int error; probe = NULL; @@ -273,9 +273,20 @@ bhndb_pci_probe(device_t dev) /* Our parent must be a PCI/PCIe device. */ pci = devclass_find("pci"); parent = device_get_parent(dev); - parent_bus = device_get_devclass(device_get_parent(parent)); + parent_bus = device_get_parent(parent); + if (parent_bus == NULL) + return (ENXIO); - if (parent_bus != pci) + /* The bus device class may inherit from 'pci' */ + for (bus_devclass = device_get_devclass(parent_bus); + bus_devclass != NULL; + bus_devclass = devclass_get_parent(bus_devclass)) + { + if (bus_devclass == pci) + break; + } + + if (bus_devclass != pci) return (ENXIO); /* Enable clocks */ @@ -629,12 +640,10 @@ bhndb_pci_sprom_size(struct bhndb_pci_softc *sc) return (0); } - if (sprom_sz > sprom_win->win_size) { - device_printf(sc->dev, - "PCI sprom size (0x%x) overruns defined register window\n", - sctl); - return (0); - } + /* If the device has a larger SPROM than can be addressed via our SPROM + * register window, the SPROM image data will still be located within + * the window's addressable range */ + sprom_sz = MIN(sprom_sz, sprom_win->win_size); return (sprom_sz); } From owner-svn-src-head@freebsd.org Fri Jan 19 22:33:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7D39ECC94F; Fri, 19 Jan 2018 22:33:26 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C2F6879C9C; Fri, 19 Jan 2018 22:33:26 +0000 (UTC) (envelope-from landonf@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CFEEB13A2A; Fri, 19 Jan 2018 22:33:25 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0JMXPJ7047895; Fri, 19 Jan 2018 22:33:25 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0JMXPBW047894; Fri, 19 Jan 2018 22:33:25 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201801192233.w0JMXPBW047894@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Fri, 19 Jan 2018 22:33:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328181 - head/sys/dev/bwn X-SVN-Group: head X-SVN-Commit-Author: landonf X-SVN-Commit-Paths: head/sys/dev/bwn X-SVN-Commit-Revision: 328181 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 22:33:27 -0000 Author: landonf Date: Fri Jan 19 22:33:25 2018 New Revision: 328181 URL: https://svnweb.freebsd.org/changeset/base/328181 Log: bwn(4): Fix DMA translation lookup on devices limited to 30-bit host addressing. The host addressing constraint does not apply to device address space, and shouldn't be passed to bhnd_get_dma_translation() as the maximum supported device address width. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/bwn/if_bwn_siba_compat.c Modified: head/sys/dev/bwn/if_bwn_siba_compat.c ============================================================================== --- head/sys/dev/bwn/if_bwn_siba_compat.c Fri Jan 19 22:22:02 2018 (r328180) +++ head/sys/dev/bwn/if_bwn_siba_compat.c Fri Jan 19 22:33:25 2018 (r328181) @@ -1782,15 +1782,37 @@ bhnd_compat_dma_translation(device_t dev) struct bhnd_dma_translation dt; struct bwn_softc *sc; struct bwn_mac *mac; - int bwn_dmatype, error; + u_int width; + int error; sc = device_get_softc(dev); mac = sc->sc_curmac; KASSERT(mac != NULL, ("no MAC")); + /* + * Use the DMA engine's maximum host address width to determine the + * supported device address width. + */ + switch (mac->mac_method.dma.dmatype) { + case BWN_DMA_32BIT: + case BWN_DMA_30BIT: + /* The 32-bit engine is always capable of addressing + * a full 32-bit device address */ + width = BHND_DMA_ADDR_32BIT; + break; + + case BWN_DMA_64BIT: + width = BHND_DMA_ADDR_64BIT; + break; + + default: + panic("unknown dma type %d", + mac->mac_method.dma.dmatype); + } + + /* Fetch our DMA translation */ - bwn_dmatype = mac->mac_method.dma.dmatype; - if ((error = bhnd_get_dma_translation(dev, bwn_dmatype, 0, NULL, &dt))) + if ((error = bhnd_get_dma_translation(dev, width, 0, NULL, &dt))) panic("error requesting DMA translation: %d\n", error); /* @@ -1820,16 +1842,15 @@ bhnd_compat_dma_translation(device_t dev) * However, we will need to resolve these issues in bwn(4) if DMA is to * work on new hardware (e.g. WiSoCs). */ - switch (bwn_dmatype) { - case BWN_DMA_32BIT: - case BWN_DMA_30BIT: + switch (width) { + case BHND_DMA_ADDR_32BIT: KASSERT((~dt.addr_mask & BHND_DMA_ADDR_BITMASK(32)) == SIBA_DMA_TRANSLATION_MASK, ("unexpected DMA mask: %#jx", (uintmax_t)dt.addr_mask)); return (dt.base_addr); - case BWN_DMA_64BIT: + case BHND_DMA_ADDR_64BIT: /* bwn(4) will shift this left by 32+1 bits before applying it * to the top 32-bits of the DMA address */ KASSERT((~dt.addr_mask & BHND_DMA_ADDR_BITMASK(33)) == 0, @@ -1839,7 +1860,7 @@ bhnd_compat_dma_translation(device_t dev) return (dt.base_addr >> 33); default: - panic("unknown dma type %d", bwn_dmatype); + panic("unsupported address width: %u", width); } } From owner-svn-src-head@freebsd.org Fri Jan 19 22:37:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0333ECCCB9; Fri, 19 Jan 2018 22:37:49 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CBE957A002; Fri, 19 Jan 2018 22:37:49 +0000 (UTC) (envelope-from landonf@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A7A713A42; Fri, 19 Jan 2018 22:37:49 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0JMbmBa048250; Fri, 19 Jan 2018 22:37:48 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0JMbmOL048249; Fri, 19 Jan 2018 22:37:48 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201801192237.w0JMbmOL048249@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Fri, 19 Jan 2018 22:37:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328182 - head/sys/dev/bwn X-SVN-Group: head X-SVN-Commit-Author: landonf X-SVN-Commit-Paths: head/sys/dev/bwn X-SVN-Commit-Revision: 328182 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 22:37:50 -0000 Author: landonf Date: Fri Jan 19 22:37:48 2018 New Revision: 328182 URL: https://svnweb.freebsd.org/changeset/base/328182 Log: bwn(4): Add missing BCM4306 PCI IDs. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/bwn/if_bwn_pci.c Modified: head/sys/dev/bwn/if_bwn_pci.c ============================================================================== --- head/sys/dev/bwn/if_bwn_pci.c Fri Jan 19 22:33:25 2018 (r328181) +++ head/sys/dev/bwn/if_bwn_pci.c Fri Jan 19 22:37:48 2018 (r328182) @@ -62,6 +62,9 @@ TUNABLE_INT("hw.bwn_pci.preferred", &prefer_new_driver static const struct bwn_pci_device siba_devices[] = { BWN_BCM_DEV(BCM4306_D11A, "BCM4306 802.11a", BWN_QUIRK_WLAN_DUALCORE), + BWN_BCM_DEV(BCM4306_D11G, "BCM4306 802.11b/g", 0), + BWN_BCM_DEV(BCM4306_D11G_ID2, "BCM4306 802.11b/g", 0), + BWN_BCM_DEV(BCM4306_D11DUAL, "BCM4306 802.11a/b/g", 0), BWN_BCM_DEV(BCM4307, "BCM4307 802.11b", 0), BWN_BCM_DEV(BCM4311_D11G, "BCM4311 802.11b/g", 0), From owner-svn-src-head@freebsd.org Fri Jan 19 22:43:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35B8CECD057; Fri, 19 Jan 2018 22:43:10 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 109E17A4C4; Fri, 19 Jan 2018 22:43:10 +0000 (UTC) (envelope-from landonf@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 58F5913BEB; Fri, 19 Jan 2018 22:43:09 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0JMh92n052293; Fri, 19 Jan 2018 22:43:09 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0JMh80V052287; Fri, 19 Jan 2018 22:43:08 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201801192243.w0JMh80V052287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Fri, 19 Jan 2018 22:43:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328183 - in head: share/man/man9 sys/dev/bhnd sys/dev/bwn X-SVN-Group: head X-SVN-Commit-Author: landonf X-SVN-Commit-Paths: in head: share/man/man9 sys/dev/bhnd sys/dev/bwn X-SVN-Commit-Revision: 328183 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 22:43:10 -0000 Author: landonf Date: Fri Jan 19 22:43:08 2018 New Revision: 328183 URL: https://svnweb.freebsd.org/changeset/base/328183 Log: bhnd/bwn(4): Define a bhnd(4) softmodem device class for the v.90 modem codec core, and mark the core as unpopulated on all BCM4306 bwn(4) devices. Sponsored by: The FreeBSD Foundation Modified: head/share/man/man9/bhnd.9 head/sys/dev/bhnd/bhnd_ids.h head/sys/dev/bhnd/bhnd_subr.c head/sys/dev/bhnd/bhnd_types.h head/sys/dev/bwn/if_bwn_pci.c head/sys/dev/bwn/if_bwn_pcivar.h Modified: head/share/man/man9/bhnd.9 ============================================================================== --- head/share/man/man9/bhnd.9 Fri Jan 19 22:37:48 2018 (r328182) +++ head/share/man/man9/bhnd.9 Fri Jan 19 22:43:08 2018 (r328183) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 9, 2017 +.Dd January 19, 2018 .Dt BHND 9 .Os .Sh NAME @@ -1217,6 +1217,8 @@ Interconnect Host Bridge Device Enumeration ROM .It Dv BHND_DEVCLASS_NVRAM NVRAM/Flash Controller +.It Dv BHND_DEVCLASS_SOFTMODEM +Analog/PSTN SoftModem Codec .It Dv BHND_DEVCLASS_USB_HOST USB Host Controller .It Dv BHND_DEVCLASS_USB_DEV Modified: head/sys/dev/bhnd/bhnd_ids.h ============================================================================== --- head/sys/dev/bhnd/bhnd_ids.h Fri Jan 19 22:37:48 2018 (r328182) +++ head/sys/dev/bhnd/bhnd_ids.h Fri Jan 19 22:43:08 2018 (r328183) @@ -444,7 +444,7 @@ #define BHND_COREID_PCI 0x804 /* pci core */ #define BHND_COREID_MIPS 0x805 /* mips core */ #define BHND_COREID_ENET 0x806 /* enet mac core */ -#define BHND_COREID_CODEC 0x807 /* v90 codec core */ +#define BHND_COREID_V90_CODEC 0x807 /* v90 codec core */ #define BHND_COREID_USB 0x808 /* usb 1.1 host/device core */ #define BHND_COREID_ADSL 0x809 /* ADSL core */ #define BHND_COREID_ILINE100 0x80a /* iline100 core */ Modified: head/sys/dev/bhnd/bhnd_subr.c ============================================================================== --- head/sys/dev/bhnd/bhnd_subr.c Fri Jan 19 22:37:48 2018 (r328182) +++ head/sys/dev/bhnd/bhnd_subr.c Fri Jan 19 22:43:08 2018 (r328183) @@ -85,7 +85,7 @@ static const struct bhnd_core_desc { BHND_CDESC(BCM, PCI, PCI, "PCI Bridge"), BHND_CDESC(BCM, MIPS, CPU, "BMIPS CPU"), BHND_CDESC(BCM, ENET, ENET_MAC, "Fast Ethernet MAC"), - BHND_CDESC(BCM, CODEC, OTHER, "V.90 Modem Codec"), + BHND_CDESC(BCM, V90_CODEC, SOFTMODEM, "V.90 SoftModem Codec"), BHND_CDESC(BCM, USB, USB_DUAL, "USB 1.1 Device/Host Controller"), BHND_CDESC(BCM, ADSL, OTHER, "ADSL Core"), BHND_CDESC(BCM, ILINE100, OTHER, "iLine100 HPNA"), Modified: head/sys/dev/bhnd/bhnd_types.h ============================================================================== --- head/sys/dev/bhnd/bhnd_types.h Fri Jan 19 22:37:48 2018 (r328182) +++ head/sys/dev/bhnd/bhnd_types.h Fri Jan 19 22:43:08 2018 (r328183) @@ -66,6 +66,7 @@ typedef enum { BHND_DEVCLASS_USB_HOST, /**< USB host controller */ BHND_DEVCLASS_USB_DEV, /**< USB device controller */ BHND_DEVCLASS_USB_DUAL, /**< USB host/device controller */ + BHND_DEVCLASS_SOFTMODEM, /**< analog/PSTN softmodem codec */ BHND_DEVCLASS_OTHER = 1000, /**< other / unknown */ BHND_DEVCLASS_INVALID /**< no/invalid class */ Modified: head/sys/dev/bwn/if_bwn_pci.c ============================================================================== --- head/sys/dev/bwn/if_bwn_pci.c Fri Jan 19 22:37:48 2018 (r328182) +++ head/sys/dev/bwn/if_bwn_pci.c Fri Jan 19 22:43:08 2018 (r328183) @@ -61,10 +61,13 @@ TUNABLE_INT("hw.bwn_pci.preferred", &prefer_new_driver /* SIBA Devices */ static const struct bwn_pci_device siba_devices[] = { BWN_BCM_DEV(BCM4306_D11A, "BCM4306 802.11a", - BWN_QUIRK_WLAN_DUALCORE), - BWN_BCM_DEV(BCM4306_D11G, "BCM4306 802.11b/g", 0), - BWN_BCM_DEV(BCM4306_D11G_ID2, "BCM4306 802.11b/g", 0), - BWN_BCM_DEV(BCM4306_D11DUAL, "BCM4306 802.11a/b/g", 0), + BWN_QUIRK_WLAN_DUALCORE|BWN_QUIRK_SOFTMODEM_UNPOPULATED), + BWN_BCM_DEV(BCM4306_D11G, "BCM4306 802.11b/g", + BWN_QUIRK_SOFTMODEM_UNPOPULATED), + BWN_BCM_DEV(BCM4306_D11G_ID2, "BCM4306 802.11b/g", + BWN_QUIRK_SOFTMODEM_UNPOPULATED), + BWN_BCM_DEV(BCM4306_D11DUAL, "BCM4306 802.11a/b/g", + BWN_QUIRK_SOFTMODEM_UNPOPULATED), BWN_BCM_DEV(BCM4307, "BCM4307 802.11b", 0), BWN_BCM_DEV(BCM4311_D11G, "BCM4311 802.11b/g", 0), @@ -268,6 +271,9 @@ bwn_pci_is_core_disabled(device_t dev, device_t child, case BHND_DEVCLASS_USB_HOST: return ((sc->quirks & BWN_QUIRK_USBH_UNPOPULATED) != 0); + + case BHND_DEVCLASS_SOFTMODEM: + return ((sc->quirks & BWN_QUIRK_SOFTMODEM_UNPOPULATED) != 0); default: return (false); Modified: head/sys/dev/bwn/if_bwn_pcivar.h ============================================================================== --- head/sys/dev/bwn/if_bwn_pcivar.h Fri Jan 19 22:37:48 2018 (r328182) +++ head/sys/dev/bwn/if_bwn_pcivar.h Fri Jan 19 22:43:08 2018 (r328183) @@ -74,6 +74,13 @@ enum { * unpopulated. */ BWN_QUIRK_USBH_UNPOPULATED = 1<<3, + + /** + * Some early devices (including all BCM4306 chipsets) shipped with + * floating analog softmodem codec cores; set this quirk to treat these + * cores as unpopulated. + */ + BWN_QUIRK_SOFTMODEM_UNPOPULATED = 1<<4, }; /* PCI device descriptor */ From owner-svn-src-head@freebsd.org Fri Jan 19 23:24:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E022DECF067; Fri, 19 Jan 2018 23:24:47 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from CAN01-QB1-obe.outbound.protection.outlook.com (mail-eopbgr660042.outbound.protection.outlook.com [40.107.66.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT TLS CA 4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8405C7C368; Fri, 19 Jan 2018 23:24:46 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from YTOPR0101MB2172.CANPRD01.PROD.OUTLOOK.COM (52.132.46.161) by YTOPR0101MB2171.CANPRD01.PROD.OUTLOOK.COM (52.132.46.160) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.428.17; Fri, 19 Jan 2018 23:24:45 +0000 Received: from YTOPR0101MB2172.CANPRD01.PROD.OUTLOOK.COM ([fe80::c45:e67:9188:fa40]) by YTOPR0101MB2172.CANPRD01.PROD.OUTLOOK.COM ([fe80::c45:e67:9188:fa40%13]) with mapi id 15.20.0428.014; Fri, 19 Jan 2018 23:24:45 +0000 From: Rick Macklem To: Emmanuel Vadot CC: Emmanuel Vadot , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r328129 - head/sys/fs/nfsserver Thread-Topic: svn commit: r328129 - head/sys/fs/nfsserver Thread-Index: AQHTkHERZLAcPGgud0iNHWvuSowXEaN5xAOAgABtS1KAANV4AIAAzZlZ Date: Fri, 19 Jan 2018 23:24:44 +0000 Message-ID: References: <201801181528.w0IFSnWm053535@repo.freebsd.org> <20180118163855.b0a55427709c52d0ec2482c9@bidouilliste.com> , <20180119115408.f333d3a6ec8d762e73f1d844@bidouilliste.com> In-Reply-To: <20180119115408.f333d3a6ec8d762e73f1d844@bidouilliste.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; YTOPR0101MB2171; 7:n3GfBKGEe8MizvBhRUxNKnN93b6vYAoolD75EnMukE3kvUmfSIWzTV64UoTP7ccOBIfUbm3ZIoc8UM5d1+GNIGQiERnyyQFxFrhQUuGBcuaVoQQvvBbeLsyqaRcU0CGfozoVolmK+f3RVqGMXq/l0zcaHSnKcxTgpRmbjNnrJhOJCqhiKXWEMcLa6sR2oQfVQdzhPTUP2nsMJhjJnnsqgWxwmc/YqhAQwPrMcTE+JG+NDWrzHq3d0niT5Vca91rx x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: e078e487-4bcb-4910-693c-08d55f93d326 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(8989060)(5600026)(4604075)(3008032)(2017052603307)(7153060)(7193020); SRVR:YTOPR0101MB2171; x-ms-traffictypediagnostic: YTOPR0101MB2171: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(158342451672863); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040498)(2401047)(5005006)(8121501046)(3231023)(2400081)(944501161)(93006095)(93001095)(10201501046)(3002001)(6041285)(20161123564045)(201703131423095)(201702281529075)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123560045)(6072148)(201708071742011); SRVR:YTOPR0101MB2171; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:YTOPR0101MB2171; x-forefront-prvs: 0557CBAD84 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39380400002)(366004)(376002)(39860400002)(396003)(346002)(189003)(199004)(229853002)(6246003)(6346003)(54906003)(2900100001)(305945005)(74482002)(105586002)(5250100002)(3660700001)(2906002)(8676002)(97736004)(59450400001)(99286004)(3280700002)(74316002)(5660300001)(6436002)(9686003)(25786009)(93886005)(86362001)(81166006)(33656002)(2950100002)(4326008)(106356001)(81156014)(76176011)(55016002)(7696005)(68736007)(102836004)(786003)(14454004)(53936002)(478600001)(316002)(8936002)(26005)(6916009)(6506007); DIR:OUT; SFP:1101; SCL:1; SRVR:YTOPR0101MB2171; H:YTOPR0101MB2172.CANPRD01.PROD.OUTLOOK.COM; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: uoguelph.ca does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=rmacklem@uoguelph.ca; x-microsoft-antispam-message-info: ynAyBUvyInGMD7x6OyhrYt0Rd4kwSZgOHC8IGfM/TOqSYV+WxBkv83A+ga9umEwV4MsTepkXHI0E4kXga1e4Yg== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: uoguelph.ca X-MS-Exchange-CrossTenant-Network-Message-Id: e078e487-4bcb-4910-693c-08d55f93d326 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Jan 2018 23:24:44.9665 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d X-MS-Exchange-Transport-CrossTenantHeadersStamped: YTOPR0101MB2171 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 23:24:48 -0000 Emmanuel Vadot wrote: [stuff snipped] > So should we warn once or maybe return EBUSY on unloading if there is >still lock structures ? My intent was that a module unload would clear out all data structures, so I would so no. I would also say that I envisioned an unload of nfsd.ko a= s a last resort, to free up the data structures. It should refuse to unload if the nfsd daemon is running. Isolan used to unload/load the nfsd.ko a lot, because they preferred that for testing and software updates. I, personally, have never done so (except once in a while to see if it work= s), so I'll admit I have trouble understanding why you would do so? Rebooting an NFSv4 server when clients are mounted forces the clients to do state recovery during a grace period (2 minutes+) right after boot. This isn't something that I would recommend as a routine exercise, but at least it should recover the opens/locks if it goes smoothly. (I can't recall for sure, but I don't think an unload/reload of the nfsd.ko followed by a startup of the nfsd daemon does this? If I am wrong and it does do this, then this is exactly like a reboot w.r.t. nfs service. If you look at a packet trace in wireshark just after the server restart, you would see errors like NFS4ERR_STALE_CLIENTID, NFS4ERR_STALE_STATEID, NFS4ERR_BAD_SESSION that indicates to the client that recovery of state is needed. --> If this state recovery isn't happening then your mounts will probably b= e broken, at least w.r.t. byte range locking. If the unload/reload doesn't do this, then a reboot is preferable. Because of this rather complex state recovery exercise, any reboot or unload/reload/restart of the nfsd should be done only when absolutely necessary, imho. If you can't run a server for an extended period with an unload of the nfsd.ko or a reboot, using NFSv3 mounts would be a safer bet. I wrote: > For this case, normally all lock structures should go away when clients > unmount and unloading the nfsd module while there are active mounts > is not a safe practice. (Again NFSv4 isn't like NFSv3, there is server st= ate > for NFSv4.) > > rick rick From owner-svn-src-head@freebsd.org Fri Jan 19 23:50:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFE1DECFF64; Fri, 19 Jan 2018 23:50:29 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from mx2.catspoiler.org (mx2.catspoiler.org [IPv6:2607:f740:16::d18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "amnesiac", Issuer "amnesiac" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id B49CA7D09B; Fri, 19 Jan 2018 23:50:29 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org ([76.212.85.177]) by mx2.catspoiler.org (8.15.2/8.15.2) with ESMTPS id w0JNoq5S081137 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 19 Jan 2018 23:50:53 GMT (envelope-from truckman@FreeBSD.org) Received: from mousie.catspoiler.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.15.2/8.15.2) with ESMTPS id w0JMTNqu028743 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 19 Jan 2018 15:50:22 -0800 (PST) (envelope-from truckman@FreeBSD.org) Date: Fri, 19 Jan 2018 15:50:21 -0800 (PST) From: Don Lewis Subject: Re: svn commit: r328159 - head/sys/modules To: David Chisnall cc: cem@freebsd.org, Benjamin Kaduk , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <244014BB-C492-48A9-9F28-0A5E713DE5EB@FreeBSD.org> Message-ID: References: <201801190434.w0J4Y6i7086677@repo.freebsd.org> <244014BB-C492-48A9-9F28-0A5E713DE5EB@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; CHARSET=us-ascii Content-Disposition: INLINE X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 23:50:30 -0000 On 19 Jan, David Chisnall wrote: > On 19 Jan 2018, at 05:07, Conrad Meyer wrote: >> >> The spec says the behavior is undefined; not that the compiler has to >> produce a warning or error message. The compiler *does* get to >> arbitrarily decide what it wants to do when it encounters UB. It is >> wholly free to implement this particular UB with the logical result >> and no warning/error. > > First, you are not correct that the only logical outcome of a shift of > greater than the width of a type is 0. In C, a right-shift of a > signed type propagates the sign bit. Right shifting a negative 32-bit > int by 16 and then again by 16 is not undefined behaviour (though > doing the shift as a single operation is) and will give you a value of > -1. Propagating the sign when doing a right shift is the common behaviour, but I believe this is actually implemenation defined. If the machine doesn't have arithmetic shift instructions, then a logical shift which fills in zeros on the left is also conformant. See the edit to the first answer here: https://stackoverflow.com/questions/1857928/right-shifting-negative-numbers-in-c I think powerpc falls into this category. From owner-svn-src-head@freebsd.org Fri Jan 19 23:55:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B8EAED0379; Fri, 19 Jan 2018 23:55:39 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from mx2.catspoiler.org (mx2.catspoiler.org [IPv6:2607:f740:16::d18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "amnesiac", Issuer "amnesiac" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 770357D5C6; Fri, 19 Jan 2018 23:55:39 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org ([76.212.85.177]) by mx2.catspoiler.org (8.15.2/8.15.2) with ESMTPS id w0JNu2ss081154 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 19 Jan 2018 23:56:03 GMT (envelope-from truckman@FreeBSD.org) Received: from mousie.catspoiler.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.15.2/8.15.2) with ESMTPS id w0JMTNqx028743 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 19 Jan 2018 15:55:31 -0800 (PST) (envelope-from truckman@FreeBSD.org) Date: Fri, 19 Jan 2018 15:55:31 -0800 (PST) From: Don Lewis Subject: Re: svn commit: r328159 - head/sys/modules To: cem@freebsd.org cc: "Rodney W. Grimes" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: Message-ID: References: <201801191737.w0JHbM90073097@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; CHARSET=us-ascii Content-Disposition: INLINE X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 23:55:39 -0000 On 19 Jan, Conrad Meyer wrote: > On Fri, Jan 19, 2018 at 9:37 AM, Rodney W. Grimes > wrote: >> If you think in assembler it is easy to understand why this is UB, >> most (all) architectures Right Logic or Arithmetic Shift only accept an >> operand that is a size that can hold log2(wordsize). > > This is a logical right shift by a constant larger than the width of > the left operand. As a result, it would a constant zero in any > emitted machine code. It is a bug in the C standard and a concession > to naive, non-optimizing compilers that this is considered UB. Generating one answer when compiler knows that everything is constant and can figure out the "correct" value at compile time, but generating an entirely different answer when the shift value is still constant, but passed in as a function parameter and hides that information from the compiler so the result is generated at runtime sounds like a good way to introduce bugs. From owner-svn-src-head@freebsd.org Sat Jan 20 01:11:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62CCCED3A05 for ; Sat, 20 Jan 2018 01:11:03 +0000 (UTC) (envelope-from marklmi26-fbsd@yahoo.com) Received: from sonic301-2.consmr.mail.bf2.yahoo.com (sonic301-2.consmr.mail.bf2.yahoo.com [74.6.129.41]) (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 2D9E4800CB for ; Sat, 20 Jan 2018 01:11:02 +0000 (UTC) (envelope-from marklmi26-fbsd@yahoo.com) X-YMail-OSG: d2BSD6UVM1n_bKLChx2YuqONdAeKH55pzEFuOKM8Jq7T3VDzp_a5RlJ8_rEC.xw eCnvpJqqVjnMTgCkXwSYjxn1QKNH_gsE19OUyfpTOVwAVYIQWJifNGxhgbtxeukJkr1I.3vFqb07 CBsk3r7Cw5S0Rtq3wtgaXm5VS0C3k77t5cF7uP1FZGHVtDA499CxIqPrnH_VPEd63Tte5yUhyLUu P2kYzRpjzOJktFSrLLPgHjiRGfaFuEi2FjwNVYMDgMX47epXskfUORdlObAiTcv593KI1.A4dIt3 OWtiwelojkJZgclIwNTh9qqxYNoyJcdpZ2TmQ9At6_erszjSIqraHGsXYTXxry8DKkp6kNboP3Fu pn.47vZW3ighNtTiF.5TKmvbKVatq2lJiJZk2nga2CeZbRL0WgpXdthmFCFdJmpQm1nUoq2Sr.o8 A14GsjMTeULomawI9a.cR_lm9OqBNp7Dhp8oueP6X94VRLEv2c5bUpiBeCjFO5XHBivZc Received: from sonic.gate.mail.ne1.yahoo.com by sonic301.consmr.mail.bf2.yahoo.com with HTTP; Sat, 20 Jan 2018 01:10:56 +0000 Received: from smtp109.rhel.mail.bf1.yahoo.com (EHLO [192.168.1.25]) ([98.139.233.82]) by smtp413.mail.bf1.yahoo.com (JAMES SMTP Server ) with ESMTPA ID 2d540455da77359e78b388f38159c536; Sat, 20 Jan 2018 01:10:51 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r328159 - head/sys/modules Message-Id: <837BD7D7-63C9-4C87-AFCB-DE6CC2591011@yahoo.com> Date: Fri, 19 Jan 2018 17:10:49 -0800 To: "Conrad E. Meyer" , bjkfbsd@gmail.com, svn-src-head@freebsd.org X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jan 2018 01:11:03 -0000 Conrad Meyer cem at freebsd.org wrote on Fri Jan 19 05:07:22 UTC 2018 : > The spec says the behavior is undefined; not that the compiler has to > produce a warning or error message. The compiler *does* get to > arbitrarily decide what it wants to do when it encounters UB. It is > wholly free to implement this particular UB with the logical result > and no warning/error. This is partially correct and partially probably-not, at least for C99. 6.5.7 of C99 does say the constraint and the undefined status that results for the left shift issue in question (and the right shift for that matter): "If the value of the right operand is negative or is greater than or equal to the width of the promoted left operand, the behavior is undefined." But 5.1.1.3 says about Diagnostics: "A conforming implementation shall produce at least one diagnostic message (identified in an implementation-defined manner) if a preprocessing translation unit or translation unit contains a violation of any syntax rule or constraint, even if the behavior is also explicitly specified as undefined or implementation-defined." The relevant part of 6.5.7 from what I quoted does specify a "constraint" with undefined behavior, section 3.8 defines "constraint" via: "restriction, either syntactic or semantic, by which the exposition of language elements is to be interpreted" Notes: My stated view presumes that known compile-time-constants are to be checked at compile time for constraint violations but proving absence of run-time problems is not to be done at compile time. The difference between "diagnostic" and the more specific alternatives "warning" and "error" leave some room that I ignore here. === Mark Millard marklmi at yahoo.com ( markmi at dsl-only.net is going away in 2018-Feb, late) From owner-svn-src-head@freebsd.org Sat Jan 20 01:55:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61ADCED5C0E; Sat, 20 Jan 2018 01:55:35 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3BE6F81F42; Sat, 20 Jan 2018 01:55:35 +0000 (UTC) (envelope-from landonf@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 798F515B9C; Sat, 20 Jan 2018 01:55:34 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0K1tYds034705; Sat, 20 Jan 2018 01:55:34 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0K1tYen034704; Sat, 20 Jan 2018 01:55:34 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201801200155.w0K1tYen034704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Sat, 20 Jan 2018 01:55:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328187 - head/sys/dev/bhnd/cores/chipc X-SVN-Group: head X-SVN-Commit-Author: landonf X-SVN-Commit-Paths: head/sys/dev/bhnd/cores/chipc X-SVN-Commit-Revision: 328187 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jan 2018 01:55:35 -0000 Author: landonf Date: Sat Jan 20 01:55:34 2018 New Revision: 328187 URL: https://svnweb.freebsd.org/changeset/base/328187 Log: bhnd_chipc(4): Fix leak of child device ivars by explicitly deleting any children prior to detach. With the newbus child deletion ordering changes introduced in r307518, parent devices are now detached (and their driver set to NULL) prior to detaching and deleting child devices; child-related bus methods (e.g. BUS_CHILD_DETACHED, BUS_CHILD_DELETED) are no longer be dispatched to the parent device driver after it returns 0 (success) from DEVICE_DETACH. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/bhnd/cores/chipc/chipc.c Modified: head/sys/dev/bhnd/cores/chipc/chipc.c ============================================================================== --- head/sys/dev/bhnd/cores/chipc/chipc.c Sat Jan 20 01:01:28 2018 (r328186) +++ head/sys/dev/bhnd/cores/chipc/chipc.c Sat Jan 20 01:55:34 2018 (r328187) @@ -250,6 +250,9 @@ chipc_detach(device_t dev) if ((error = bus_generic_detach(dev))) return (error); + if ((error = device_delete_children(dev))) + return (error); + if ((error = bhnd_deregister_provider(dev, BHND_SERVICE_ANY))) return (error); From owner-svn-src-head@freebsd.org Sat Jan 20 02:49:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E3FEEB4C28; Sat, 20 Jan 2018 02:49:34 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 28BC4DA; Sat, 20 Jan 2018 02:49:34 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6B36416486; Sat, 20 Jan 2018 02:49:33 +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 w0K2nXR1055417; Sat, 20 Jan 2018 02:49:33 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0K2nWlO055412; Sat, 20 Jan 2018 02:49:32 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201801200249.w0K2nWlO055412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 20 Jan 2018 02:49:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328188 - in head/usr.bin/hexdump: . tests X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/usr.bin/hexdump: . tests X-SVN-Commit-Revision: 328188 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jan 2018 02:49:34 -0000 Author: kevans Date: Sat Jan 20 02:49:32 2018 New Revision: 328188 URL: https://svnweb.freebsd.org/changeset/base/328188 Log: od(1): Fix wrong output for some corner cases in multibyte locales. Restore the original character to print if we used the look-ahead buffer, but that didn't help -- we either got an illegal sequence or still can't complete. PR: 224552 Submitted by: Yuri Pankov MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D13963 Added: head/usr.bin/hexdump/tests/d_od_cflag_a.out (contents, props changed) head/usr.bin/hexdump/tests/d_od_cflag_b.out (contents, props changed) head/usr.bin/hexdump/tests/od_test.sh (contents, props changed) Modified: head/usr.bin/hexdump/conv.c head/usr.bin/hexdump/tests/Makefile Modified: head/usr.bin/hexdump/conv.c ============================================================================== --- head/usr.bin/hexdump/conv.c Sat Jan 20 01:55:34 2018 (r328187) +++ head/usr.bin/hexdump/conv.c Sat Jan 20 02:49:32 2018 (r328188) @@ -56,6 +56,7 @@ conv_c(PR *pr, u_char *p, size_t bufsize) size_t clen, oclen; int converr, pad, width; u_char peekbuf[MB_LEN_MAX]; + u_char *op; if (pr->mbleft > 0) { str = "**"; @@ -107,6 +108,15 @@ retry: else if (clen == (size_t)-1 || (clen == (size_t)-2 && p == peekbuf)) { memset(&pr->mbstate, 0, sizeof(pr->mbstate)); + if (p == peekbuf) { + /* + * We peeked ahead, but that didn't help -- + * we either got an illegal sequence or still + * can't complete; restore original character. + */ + oclen = 0; + p = op; + } wc = *p; clen = 1; converr = 1; @@ -116,6 +126,7 @@ retry: * can complete it. */ oclen = bufsize; + op = p; bufsize = peek(p = peekbuf, MB_CUR_MAX); goto retry; } @@ -128,7 +139,7 @@ retry: if (!odmode) { *pr->cchar = 'c'; (void)printf(pr->fmt, (int)wc); - } else { + } else { *pr->cchar = 'C'; assert(strcmp(pr->fmt, "%3C") == 0); width = wcwidth(wc); Modified: head/usr.bin/hexdump/tests/Makefile ============================================================================== --- head/usr.bin/hexdump/tests/Makefile Sat Jan 20 01:55:34 2018 (r328187) +++ head/usr.bin/hexdump/tests/Makefile Sat Jan 20 02:49:32 2018 (r328188) @@ -2,7 +2,7 @@ PACKAGE= tests -ATF_TESTS_SH= hexdump_test +ATF_TESTS_SH= hexdump_test od_test ${PACKAGE}FILES+= d_hexdump_a.in ${PACKAGE}FILES+= d_hexdump_b.in @@ -27,5 +27,7 @@ ${PACKAGE}FILES+= d_hexdump_UCflag_c.out ${PACKAGE}FILES+= d_hexdump_xflag_a.out ${PACKAGE}FILES+= d_hexdump_xflag_b.out ${PACKAGE}FILES+= d_hexdump_xflag_c.out +${PACKAGE}FILES+= d_od_cflag_a.out +${PACKAGE}FILES+= d_od_cflag_b.out .include Added: head/usr.bin/hexdump/tests/d_od_cflag_a.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/hexdump/tests/d_od_cflag_a.out Sat Jan 20 02:49:32 2018 (r328188) @@ -0,0 +1,3 @@ +0000000 T e s t T e s t T e s t T e s 345 +0000020 T e s t 345 +0000025 Added: head/usr.bin/hexdump/tests/d_od_cflag_b.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/hexdump/tests/d_od_cflag_b.out Sat Jan 20 02:49:32 2018 (r328188) @@ -0,0 +1,3 @@ +0000000 T e s t T e s t T e s t T e s Ñ‚ +0000020 ** Т ** е ** Ñ ** Ñ‚ ** +0000031 Added: head/usr.bin/hexdump/tests/od_test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/hexdump/tests/od_test.sh Sat Jan 20 02:49:32 2018 (r328188) @@ -0,0 +1,94 @@ +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright 2018 (C) Yuri Pankov +# 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$ + +atf_test_case c_flag +c_flag_head() +{ + atf_set "descr" "Verify -c output (PR 224552)" +} +c_flag_body() +{ + export LC_ALL="en_US.UTF-8" + + printf 'TestTestTestTes\345Test\345' > d_od_cflag.in + atf_check -o file:"$(atf_get_srcdir)/d_od_cflag_a.out" \ + od -c d_od_cflag.in + printf 'TestTestTestTesтТеÑÑ‚' > d_od_cflag.in + atf_check -o file:"$(atf_get_srcdir)/d_od_cflag_b.out" \ + od -c d_od_cflag.in +} + +atf_init_test_cases() +{ + atf_add_test_case c_flag +} +# +# Copyright 2018 The FreeBSD Project +# +# 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$ + +atf_test_case c_flag +c_flag_head() +{ + atf_set "descr" "Verify -c output" +} +c_flag_body() +{ + printf 'TestTestTestTes\345Test\345' > d_od_cflag.in + atf_check -o file:"$(atf_get_srcdir)/d_od_cflag_a.out" \ + env LC_CTYPE="en_US.UTF-8" od -c "d_od_cflag.in" + printf 'TestTestTestTesтТеÑÑ‚' > d_od_cflag.in + atf_check -o file:"$(atf_get_srcdir)/d_od_cflag_b.out" \ + env LC_CTYPE="en_US.UTF-8" od -c "d_od_cflag.in" +} + +atf_init_test_cases() +{ + atf_add_test_case c_flag +} From owner-svn-src-head@freebsd.org Sat Jan 20 03:50:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75177EB8018; Sat, 20 Jan 2018 03:50:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4EDA03266; Sat, 20 Jan 2018 03:50:57 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A1C016FA5; Sat, 20 Jan 2018 03:50:56 +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 w0K3oufJ082133; Sat, 20 Jan 2018 03:50:56 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0K3ouaL082132; Sat, 20 Jan 2018 03:50:56 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201801200350.w0K3ouaL082132@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 20 Jan 2018 03:50:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328189 - head/usr.bin/hexdump/tests X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.bin/hexdump/tests X-SVN-Commit-Revision: 328189 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jan 2018 03:50:57 -0000 Author: kevans Date: Sat Jan 20 03:50:56 2018 New Revision: 328189 URL: https://svnweb.freebsd.org/changeset/base/328189 Log: od(1): Fix mis-patch from r328188 od_test.sh got duplicated erroneously when it was added in r328188. Dedup. Modified: head/usr.bin/hexdump/tests/od_test.sh Modified: head/usr.bin/hexdump/tests/od_test.sh ============================================================================== --- head/usr.bin/hexdump/tests/od_test.sh Sat Jan 20 02:49:32 2018 (r328188) +++ head/usr.bin/hexdump/tests/od_test.sh Sat Jan 20 03:50:56 2018 (r328189) @@ -47,48 +47,3 @@ atf_init_test_cases() { atf_add_test_case c_flag } -# -# Copyright 2018 The FreeBSD Project -# -# 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$ - -atf_test_case c_flag -c_flag_head() -{ - atf_set "descr" "Verify -c output" -} -c_flag_body() -{ - printf 'TestTestTestTes\345Test\345' > d_od_cflag.in - atf_check -o file:"$(atf_get_srcdir)/d_od_cflag_a.out" \ - env LC_CTYPE="en_US.UTF-8" od -c "d_od_cflag.in" - printf 'TestTestTestTesтТеÑÑ‚' > d_od_cflag.in - atf_check -o file:"$(atf_get_srcdir)/d_od_cflag_b.out" \ - env LC_CTYPE="en_US.UTF-8" od -c "d_od_cflag.in" -} - -atf_init_test_cases() -{ - atf_add_test_case c_flag -} From owner-svn-src-head@freebsd.org Sat Jan 20 07:17:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2731EBF76E; Sat, 20 Jan 2018 07:17:21 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 8E3696C07E; Sat, 20 Jan 2018 07:17:20 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 6DDF5429487; Sat, 20 Jan 2018 18:17:10 +1100 (AEDT) Date: Sat, 20 Jan 2018 18:17:10 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Conrad Meyer cc: "Rodney W. Grimes" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327354 - head/sys/vm In-Reply-To: Message-ID: <20180120154359.R1063@besplex.bde.org> References: <601ee1a2-8f4e-518d-4c86-89871cd652af@vangyzen.net> <201801191704.w0JH4rgT072967@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=DIX/22Fb c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=nlC_4_pT8q9DhB4Ho9EA:9 a=iKhvJSA4AAAA:8 a=agQyd4kqTVSkE4UJnTUA:9 a=1CyblWcE2CtPoiIb:21 a=sFibIJslb0rysKLk:21 a=45ClL6m2LaAA:10 a=odh9cflL3HIXMm4fY7Wr:22 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jan 2018 07:17:22 -0000 On Fri, 19 Jan 2018, Conrad Meyer wrote: > On Fri, Jan 19, 2018 at 9:04 AM, Rodney W. Grimes > wrote: >> BUT I do not believe this bit of "style" has anything to do with >> readability of code, and has more to do with how code runs on a >> processor and stack frames. If you defer the declaration of >> "int i" in the above code does that compiler emmit code to allocate >> a new stack frame, or does it just add space to the function stack >> frame for this? >> >> What happens if you do >> for (int i =3D 0; i < pages;) { } >> >> for (int i =3D 1; i < pages;) { } >> as 2 seperate loops, do we allocate 2 i's on the stack at >> function startup, or do we defer and allacte each one >> only when that basic block runs, or do we allocate 1 i >> and reuse it, I know that the compiler makes functional >> code but how is that functionality done? The current >> style leaves no doubt about how things are done from >> that perspective. > > Modern (and I'm using that word very loosely here =E2=80=94 think GCC did= this > 10+ years ago) optimizing compilers do something called liveness gcc-1 did this 25 years ago (if not 30 years ago). > tracking[0] for variables to determine the scope they are used in > (something like the region between last write and last read). So in > that sense, optimizing compilers do not care whether you declare the > variable at function scope or local scope =E2=80=94 they always determine= the > local scope the variable is alive in. (Other than for shadowing, > which we strongly discourage and is considered bad style.) gcc did this more primitively 25 years ago, but it always (except for alloca(3)) allocated space for all variables in a function on entry to the function (except for alloca(3)). -O0 doesn't do much more than allocate all variables on the stack. -O moves a few variables to registers. Debugging is also easier with all variables on the stack, allocated to fixed positions with a lifetime extending to the end of the function. gcc does many minor pessimizations, at least with -O, so that -g mostly works. clang does the opposite, so that -O -g mostly doesn't work (it tends to give "value optimized out" even for args). Debugging is another reason to declare all variables at the start of functions. If you reuse a function-scope loop variable named i, then you can't see what its value was for previous loops in the function, but you can at least write "display" and "watch" directives for it without these breaking by the variable going out of scope before the end of the function. > Liveness analysis is part of register allocation[1], which typically > uses a graph coloring algorithm to determine the minimal number of > distinct registers needed to hold live values. If the number of > registers needed is more than the machine provides, some values must > be spilled to the stack. (On modern x86 it doesn't matter too much > what you spill to the stack, because the top few words of the stack > region is actually quite fast, but clever compilers targeting other > platforms may attempt to spill less frequently accessed values.) Not usually the top. Variables that can't be kept entirely in registers are usually allocated at a fixed place in the stack which is not especially likely to be at the top. Caching works the same everywhere on the stack. Sometimes related variables end up in the same cache line so that caching works best, but doing this intentionally is much harder than register allocation. > I think I recall Clang and other LLVM frontends do something nutty > when they emit intermediary representation, like using a new register > for each assignment. This relies on the register allocater to reduce > that to something sane for the target machine. gcc also depends on the register allocator to undo initial intentionally very stupid allocation. New (physical) registers should be used whenever possible to maximize use of CPU resources. Bruce From owner-svn-src-head@freebsd.org Sat Jan 20 08:58:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8947EC3C4B; Sat, 20 Jan 2018 08:58:04 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 6F79E6F2FB; Sat, 20 Jan 2018 08:58:03 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id CB4AA1047A3A; Sat, 20 Jan 2018 19:57:55 +1100 (AEDT) Date: Sat, 20 Jan 2018 19:57:55 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Don Lewis cc: cem@freebsd.org, "Rodney W. Grimes" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r328159 - head/sys/modules In-Reply-To: Message-ID: <20180120183216.U1478@besplex.bde.org> References: <201801191737.w0JHbM90073097@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=DIX/22Fb c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=iKhvJSA4AAAA:8 a=je3P-fZqYKzYcMC0QtAA:9 a=CjuIK1q_8ugA:10 a=odh9cflL3HIXMm4fY7Wr:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jan 2018 08:58:05 -0000 On Fri, 19 Jan 2018, Don Lewis wrote: > On 19 Jan, Conrad Meyer wrote: >> On Fri, Jan 19, 2018 at 9:37 AM, Rodney W. Grimes >> wrote: >>> If you think in assembler it is easy to understand why this is UB, >>> most (all) architectures Right Logic or Arithmetic Shift only accept an >>> operand that is a size that can hold log2(wordsize). The not-unused x86 arch is one that does this. IIRC, some history of this is: - on the 8086, the shift count was taken mod 32. 16 bits was enough for anyone, and shifting left or right by 16 through 31 (but not by 32) shifted out all of the bits (in the unsigned case) to give 0. - for the 80386, someone forgot why the 8086 took the count mod 32 instead of just 16, and kept using 32. 16 bits was not enough for anyone, and shifting left or right by 32 had no effect (even in the signed case?). C was standardized at much the same time as the 80386 came out, so shifting right by 32 was not required to work. It gave undefined behaviour. Optimizing compilers took advantage of the UB to give the same do-nothing behaviour as the hardware for shift counts of 32 (or do-something-strange-and-undocumented for larger shift counts). Pessimizing compilers could have taken advantage of the UB to shift out all of the bits in the sme way at runtime as at compile time like some programmers expect. This would pessimize the usual case (extra code would be needed when the produce 0 at runtime when the shift count is >= 32). - binary compatibility prevented anyone fixing this on 32-bit x86's - modulo 32 is no good for 64-bit mode. Either someone forgot about the 8086 again, or there is some binary compatibility problem that inhibited expanding 32 to 128 or "infinity". (It certainly can't be "infinity" because even INT16_MAX is unreachable due to the shift count being limited to 256 by the old mistake^Woptimization of keeping it in %cl.) - binary compatibilty prevented fixing this on 64-bit x86's in 32-bit mode. >> This is a logical right shift by a constant larger than the width of >> the left operand. As a result, it would a constant zero in any >> emitted machine code. It is a bug in the C standard and a concession >> to naive, non-optimizing compilers that this is considered UB. This isn't a logical right shift, but it is what the hardware does. It is a feature in the C standard and a concession to smart, optimizing compilers that this is UB. UB allows the compiler to do anything, including optimizing to do what the hardware does or pessimizing to give logical shifts. It is interesting that the behaviour is undefined even for unsigned left operands. UB is not strictly required. The behaviour could also be implementation defined or perhaps unspecified. This makes little difference in practice. It is unclear if the implementation can define the behaviour as back to undefined. > Generating one answer when compiler knows that everything is constant > and can figure out the "correct" value at compile time, but generating > an entirely different answer when the shift value is still constant, but > passed in as a function parameter and hides that information from the > compiler so the result is generated at runtime sounds like a good way to > introduce bugs. My pre-C90 compiler does this for integer division. C99 requires incorrect rounding (round towards 0 instead of towards -infinity for positive divisors), but my compiler does correct rounding for divisions done at compile time and in software and whatever the hardware does (usually incorrect) otherwise. In C90, the rounding is implementation- defined, so it can even be correct, but in practice it cannot be trusted. Bruce From owner-svn-src-head@freebsd.org Sat Jan 20 11:02:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CBDFEC9D33; Sat, 20 Jan 2018 11:02:20 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 07F1773E40; Sat, 20 Jan 2018 11:02:20 +0000 (UTC) (envelope-from dumbbell@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 495F01B81B; Sat, 20 Jan 2018 11:02:19 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0KB2JCb063308; Sat, 20 Jan 2018 11:02:19 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0KB2JVk063307; Sat, 20 Jan 2018 11:02:19 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201801201102.w0KB2JVk063307@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= Date: Sat, 20 Jan 2018 11:02:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328190 - head/sys/dev/atkbdc X-SVN-Group: head X-SVN-Commit-Author: dumbbell X-SVN-Commit-Paths: head/sys/dev/atkbdc X-SVN-Commit-Revision: 328190 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jan 2018 11:02:20 -0000 Author: dumbbell Date: Sat Jan 20 11:02:18 2018 New Revision: 328190 URL: https://svnweb.freebsd.org/changeset/base/328190 Log: psm: Skip sync check when `PSM_CONFIG_NOCHECKSYNC` is set In psmprobe(), we set the initial `syncmask` to the vendor default value if the `PSM_CONFIG_NOCHECKSYNC` bit is unset. However, we currently only set it for the Elantech touchpad later in psmattach(), thus `syncmask` is always configured. Now, we check `PSM_CONFIG_NOCHECKSYNC` and skip sync check if it is set. This fixes Elantech touchpad support for units which have `hascrc` set. To clarify that, when we log the `syncmask` and `syncbits` fields, also mention if they are actually used. Finally, when we set `PSM_CONFIG_NOCHECKSYNC`, clear `PSM_NEED_SYNCBITS` flag. PR: 225338 MFC after: 1 week Modified: head/sys/dev/atkbdc/psm.c Modified: head/sys/dev/atkbdc/psm.c ============================================================================== --- head/sys/dev/atkbdc/psm.c Sat Jan 20 03:50:56 2018 (r328189) +++ head/sys/dev/atkbdc/psm.c Sat Jan 20 11:02:18 2018 (r328190) @@ -1947,8 +1947,10 @@ psmattach(device_t dev) /* Elantech trackpad`s sync bit differs from touchpad`s one */ if (sc->hw.model == MOUSE_MODEL_ELANTECH && - (sc->elanhw.hascrc || sc->elanhw.hastrackpoint)) + (sc->elanhw.hascrc || sc->elanhw.hastrackpoint)) { sc->config |= PSM_CONFIG_NOCHECKSYNC; + sc->flags &= ~PSM_NEED_SYNCBITS; + } if (!verbose) printf("psm%d: model %s, device ID %d\n", @@ -1959,8 +1961,9 @@ psmattach(device_t dev) sc->hw.hwid >> 8, sc->hw.buttons); printf("psm%d: config:%08x, flags:%08x, packet size:%d\n", unit, sc->config, sc->flags, sc->mode.packetsize); - printf("psm%d: syncmask:%02x, syncbits:%02x\n", - unit, sc->mode.syncmask[0], sc->mode.syncmask[1]); + printf("psm%d: syncmask:%02x, syncbits:%02x%s\n", + unit, sc->mode.syncmask[0], sc->mode.syncmask[1], + sc->config & PSM_CONFIG_NOCHECKSYNC ? " (sync not checked)" : ""); } if (bootverbose) @@ -2976,7 +2979,8 @@ psmintr(void *arg) VLOG(2, (LOG_DEBUG, "psmintr: Sync bytes now %04x,%04x\n", sc->mode.syncmask[0], sc->mode.syncmask[0])); - } else if ((c & sc->mode.syncmask[0]) != sc->mode.syncmask[1]) { + } else if ((sc->config & PSM_CONFIG_NOCHECKSYNC) == 0 && + (c & sc->mode.syncmask[0]) != sc->mode.syncmask[1]) { VLOG(3, (LOG_DEBUG, "psmintr: out of sync " "(%04x != %04x) %d cmds since last error.\n", c & sc->mode.syncmask[0], sc->mode.syncmask[1], From owner-svn-src-head@freebsd.org Sat Jan 20 11:06:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7C49ECA00E; Sat, 20 Jan 2018 11:06:47 +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 522D17408C; Sat, 20 Jan 2018 11:06:47 +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 w0KB6bCD017958 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 20 Jan 2018 13:06:41 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w0KB6bCD017958 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w0KB6bqo017957; Sat, 20 Jan 2018 13:06:37 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 20 Jan 2018 13:06:37 +0200 From: Konstantin Belousov To: Bruce Evans Cc: Don Lewis , cem@freebsd.org, "Rodney W. Grimes" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r328159 - head/sys/modules Message-ID: <20180120110637.GV55707@kib.kiev.ua> References: <201801191737.w0JHbM90073097@pdx.rh.CN85.dnsmgr.net> <20180120183216.U1478@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180120183216.U1478@besplex.bde.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-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jan 2018 11:06:47 -0000 On Sat, Jan 20, 2018 at 07:57:55PM +1100, Bruce Evans wrote: > The not-unused x86 arch is one that does this. IIRC, some history of this > is: > > - on the 8086, the shift count was taken mod 32. 16 bits was enough for > anyone, and shifting left or right by 16 through 31 (but not by 32) > shifted out all of the bits (in the unsigned case) to give 0. > > - for the 80386, someone forgot why the 8086 took the count mod 32 instead > of just 16, and kept using 32. 16 bits was not enough for anyone, and > shifting left or right by 32 had no effect (even in the signed case?). > SDM rev 065 states: IA-32 Architecture Compatibility The 8086 does not mask the shift count. However, all other IA-32 processors (starting with the Intel 286 processor) do mask the shift count to 5 bits, resulting in a maximum count of 31. This masking is done in all operating modes (including the virtual-8086 mode) to reduce the maximum execution time of the instructions. Then later, the same section states that <=32bit mode uses mask 0x1f, and 64bit mode uses mask 0x3f. Of course this does not make the compiler a bit more useful or provide a reasoning for its useless behaviour. From owner-svn-src-head@freebsd.org Sat Jan 20 11:19:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D97FAECA930; Sat, 20 Jan 2018 11:19:36 +0000 (UTC) (envelope-from wschnr@googlemail.com) Received: from mail-yw0-x231.google.com (mail-yw0-x231.google.com [IPv6:2607:f8b0:4002:c05::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 9A269747B1; Sat, 20 Jan 2018 11:19:36 +0000 (UTC) (envelope-from wschnr@googlemail.com) Received: by mail-yw0-x231.google.com with SMTP id x62so1606802ywg.11; Sat, 20 Jan 2018 03:19:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Sv5B4CSqdCwhD84l5HrJuF72c7PBHSlK8cDsuKc/qCo=; b=rii0KbMSNHAM8oru0v7HVNXF1/MWnd9Fklj6m2osZei4vstnyQ/uW6MBEn41bCQGrs W9e/C9G4fPB8DGhQAJK4tZBnQPw6ZhwKJKSlAXBTsBiazk5/YbKF4TWM2myIEFB9RjIx GPMZ2CUWOzhzVrcisjHknJiow3ObhH1fv0pMlBbBVP6Zdd0nubLD8l3NwNsH/0MvdohX k+PyHM66f8LjD4pg0FCvWi5Oj19kD9TqumnzBqB4arM0mbLmHHyg2LP9yY+HUT8fd1et ai6TeWzlqg5HzWQzM+/ZnqF1j5qbeH5KRqsw8T1bZaupewDd63HE2Tg4pg7qMCDBbkX/ TMMg== 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=Sv5B4CSqdCwhD84l5HrJuF72c7PBHSlK8cDsuKc/qCo=; b=XYuv0eoyOO+ht9147CFE47TuWjftRthWelcLgNNpg23AbkRxD1iukt82sY/Gohhvpo lC11MJPu7iHQ7PQT2TKzSRIKSy4ho6ZsGtpf1KoOYqT1AZmZIjQ0dKPS2ymKmjeW4OJM d+/vvVeqWWZgGuum4gY4vI7C/FRr2ekAl/gOA9tVWj4hJkfWynaQKc0VLJObPxCc+TOk 6gl3DgR/xUfD0e4vTm4XAmnE6VAlGwwI5zd+9EIt+7odfiE2DqOpiKJaUw/byi9gzHlw 6wA7R6ze7w15x2R5qlHP0ycaeM3ACcmZRT6qC6Ur8eAx2VlREa9sZW9oaHGSlqb6llbq DTgA== X-Gm-Message-State: AKwxytcyX0VIb/0QDrET02TImCQbkO350DcoU7c+NR8wMiV1dV7IqLqf xx57tGauvWOFO8A6pZfhnwUqyywVtBeNg0X2LdKQig== X-Google-Smtp-Source: AH8x226kJybbSiW6EN7OhrtiPr0BAWC87nj83hu05upewWkEIIp5iFGEGSAat6+22v0wyepBrhtO71Wkblxbecqhsks= X-Received: by 10.129.67.31 with SMTP id q31mr1396813ywa.464.1516447175560; Sat, 20 Jan 2018 03:19:35 -0800 (PST) MIME-Version: 1.0 Sender: wschnr@googlemail.com Received: by 10.37.77.87 with HTTP; Sat, 20 Jan 2018 03:19:20 -0800 (PST) In-Reply-To: <201801140017.w0E0HKS3049183@slippy.cwsent.com> References: <201801132230.w0DMUVmF081985@repo.freebsd.org> <201801140017.w0E0HKS3049183@slippy.cwsent.com> From: Wolfram Schneider Date: Sat, 20 Jan 2018 12:19:20 +0100 X-Google-Sender-Auth: q5fsAyk3gKOKYA50BAoe8CkPvV4 Message-ID: Subject: Re: svn commit: r327949 - in head/sys/dev: aacraid advansys ath beri/virtio bnxt bwn ciss cxgbe/crypto esp fb gpio if_ndis iwi kbd liquidio liquidio/base mpr mps mpt mrsas mxge netmap nvme pst ral rp s... To: Cy Schubert Cc: "Pedro F. Giffuni" , 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-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jan 2018 11:19:37 -0000 On 14 January 2018 at 01:17, Cy Schubert wrote: > In message <201801132230.w0DMUVmF081985@repo.freebsd.org>, "Pedro F. > Giffuni" w > rites: >> Author: pfg >> Date: Sat Jan 13 22:30:30 2018 >> New Revision: 327949 >> URL: https://svnweb.freebsd.org/changeset/base/327949 >> >> Log: >> dev: make some use of mallocarray(9). >> >> Focus on code where we are doing multiplications within malloc(9). None of >> these is likely to overflow, however the change is still useful as some >> static checkers can benefit from the allocation attributes we use for >> mallocarray. >> >> This initial sweep only covers malloc(9) calls with M_NOWAIT. No good >> reason but I started doing the changes before r327796 and at that time it >> was convenient to make sure the sorrounding code could handle NULL values. >> >> Modified: >> head/sys/dev/aacraid/aacraid.c >> head/sys/dev/advansys/advansys.c >> head/sys/dev/ath/if_ath_rx_edma.c >> head/sys/dev/beri/virtio/virtio.c >> head/sys/dev/bnxt/if_bnxt.c >> head/sys/dev/bwn/if_bwn.c >> head/sys/dev/bwn/if_bwn_phy_lp.c >> head/sys/dev/ciss/ciss.c >> head/sys/dev/cxgbe/crypto/t4_crypto.c >> head/sys/dev/esp/ncr53c9x.c >> head/sys/dev/fb/splash.c >> head/sys/dev/gpio/gpiobus.c >> head/sys/dev/if_ndis/if_ndis.c >> head/sys/dev/iwi/if_iwi.c >> head/sys/dev/kbd/kbd.c >> head/sys/dev/liquidio/base/lio_request_manager.c >> head/sys/dev/liquidio/lio_main.c >> head/sys/dev/mpr/mpr.c >> head/sys/dev/mpr/mpr_mapping.c >> head/sys/dev/mps/mps.c >> head/sys/dev/mps/mps_mapping.c >> head/sys/dev/mpt/mpt_cam.c >> head/sys/dev/mrsas/mrsas.c >> head/sys/dev/mxge/if_mxge.c >> head/sys/dev/netmap/if_ptnet.c >> head/sys/dev/nvme/nvme_ns.c >> head/sys/dev/pst/pst-iop.c >> head/sys/dev/ral/rt2560.c >> head/sys/dev/ral/rt2661.c >> head/sys/dev/rp/rp.c >> head/sys/dev/rp/rp_isa.c >> head/sys/dev/rp/rp_pci.c >> head/sys/dev/sound/midi/midi.c >> head/sys/dev/sound/pci/hda/hdaa.c >> head/sys/dev/syscons/fire/fire_saver.c >> head/sys/dev/virtio/console/virtio_console.c >> head/sys/dev/virtio/mmio/virtio_mmio.c >> head/sys/dev/virtio/network/if_vtnet.c >> head/sys/dev/virtio/pci/virtio_pci.c >> head/sys/dev/vmware/vmxnet3/if_vmx.c >> head/sys/dev/vnic/nicvf_queues.c >> head/sys/dev/xen/blkback/blkback.c >> head/sys/dev/xen/blkfront/blkfront.c >> > > >> Modified: head/sys/dev/mxge/if_mxge.c >> ============================================================================= >> = >> --- head/sys/dev/mxge/if_mxge.c Sat Jan 13 21:39:46 2018 (r32794 >> 8) >> +++ head/sys/dev/mxge/if_mxge.c Sat Jan 13 22:30:30 2018 (r32794 >> 9) >> @@ -688,7 +688,7 @@ z_alloc(void *nil, u_int items, u_int size) >> { >> void *ptr; >> >> - ptr = malloc(items * size, M_TEMP, M_NOWAIT); >> + ptr = mallocarray(items, size, M_TEMP, M_NOWAIT); >> return ptr; >> } >> >> @@ -4390,8 +4390,8 @@ mxge_alloc_slices(mxge_softc_t *sc) >> sc->rx_ring_size = cmd.data0; >> max_intr_slots = 2 * (sc->rx_ring_size / sizeof (mcp_dma_addr_t)); >> >> - bytes = sizeof (*sc->ss) * sc->num_slices; > > Hi Pedro, > > This broke the build. it also crashed my machine due out of swap space, see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=225197 -Wolfram >> - sc->ss = malloc(bytes, M_DEVBUF, M_NOWAIT | M_ZERO); >> + sc->ss = mallocarray(sc->num_slices, sizeof(*sc->ss), M_DEVBUF, >> + M_NOWAIT | M_ZERO); >> if (sc->ss == NULL) >> return (ENOMEM); >> for (i = 0; i < sc->num_slices; i++) { >> @@ -4563,8 +4563,8 @@ mxge_add_msix_irqs(mxge_softc_t *sc) >> err = ENOSPC; >> goto abort_with_msix; >> } >> - bytes = sizeof (*sc->msix_irq_res) * sc->num_slices; >> - sc->msix_irq_res = malloc(bytes, M_DEVBUF, M_NOWAIT|M_ZERO); >> + sc->msix_irq_res = mallocarray(sc->num_slices, >> + sizeof(*sc->msix_irq_res), M_DEVBUF, M_NOWAIT|M_ZERO); >> if (sc->msix_irq_res == NULL) { >> err = ENOMEM; >> goto abort_with_msix; >> @@ -4583,8 +4583,8 @@ mxge_add_msix_irqs(mxge_softc_t *sc) >> } >> } >> >> - bytes = sizeof (*sc->msix_ih) * sc->num_slices; > > ===> mxge/mxge_rss_ethp_z8e (all) > --- all_subdir_mxge/mxge --- > /opt/src/svn-current/sys/dev/mxge/if_mxge.c:4538:9: error: unused variable > 'bytes' [-Werror,-Wunused-variable] > size_t bytes; > ^ > 1 error generated. > *** [if_mxge.o] Error code 1 > >> - sc->msix_ih = malloc(bytes, M_DEVBUF, M_NOWAIT|M_ZERO); >> + sc->msix_ih = mallocarray(sc->num_slices, sizeof(*sc->msix_ih), >> + M_DEVBUF, M_NOWAIT|M_ZERO); >> >> for (i = 0; i < sc->num_slices; i++) { >> err = bus_setup_intr(sc->dev, sc->msix_irq_res[i], >> > > > > -- > Cheers, > Cy Schubert > FreeBSD UNIX: Web: http://www.FreeBSD.org > > The need of the many outweighs the greed of the few. > > > -- Wolfram Schneider https://wolfram.schneider.org From owner-svn-src-head@freebsd.org Sat Jan 20 11:21:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64019ECACD2; Sat, 20 Jan 2018 11:21:24 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 343E274AF8; Sat, 20 Jan 2018 11:21:24 +0000 (UTC) (envelope-from dumbbell@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6233A1BA2C; Sat, 20 Jan 2018 11:21:23 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0KBLNC3071471; Sat, 20 Jan 2018 11:21:23 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0KBLN9F071470; Sat, 20 Jan 2018 11:21:23 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201801201121.w0KBLN9F071470@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= Date: Sat, 20 Jan 2018 11:21:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328191 - head/sys/dev/atkbdc X-SVN-Group: head X-SVN-Commit-Author: dumbbell X-SVN-Commit-Paths: head/sys/dev/atkbdc X-SVN-Commit-Revision: 328191 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jan 2018 11:21:24 -0000 Author: dumbbell Date: Sat Jan 20 11:21:22 2018 New Revision: 328191 URL: https://svnweb.freebsd.org/changeset/base/328191 Log: psm: Don't try to detect trackpoint packets if the Elantech device has none This fixes a panic when `EVDEV_SUPPORT` is enabled: if a trackpoint packet was detected but there was no trackpoint, we still tried to emit an evdev event even though the associated relative evdev device (`evdev_r`) was not initialized. PR: 225339 MFC after: 1 week Modified: head/sys/dev/atkbdc/psm.c Modified: head/sys/dev/atkbdc/psm.c ============================================================================== --- head/sys/dev/atkbdc/psm.c Sat Jan 20 11:02:18 2018 (r328190) +++ head/sys/dev/atkbdc/psm.c Sat Jan 20 11:21:22 2018 (r328191) @@ -4187,7 +4187,7 @@ proc_elantech(struct psm_softc *sc, packetbuf_t *pb, m /* Determine packet format and do a sanity check for out of sync packets. */ if (ELANTECH_PKT_IS_DEBOUNCE(pb, sc->elanhw.hwversion)) pkt = ELANTECH_PKT_NOP; - else if (ELANTECH_PKT_IS_TRACKPOINT(pb)) + else if (sc->elanhw.hastrackpoint && ELANTECH_PKT_IS_TRACKPOINT(pb)) pkt = ELANTECH_PKT_TRACKPOINT; else switch (sc->elanhw.hwversion) { From owner-svn-src-head@freebsd.org Sat Jan 20 12:19:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2626ECDE0E; Sat, 20 Jan 2018 12:19:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B667B76BAA; Sat, 20 Jan 2018 12:19:03 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0ABC71C38A; Sat, 20 Jan 2018 12:19:03 +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 w0KCJ210093326; Sat, 20 Jan 2018 12:19:02 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0KCJ2mE093323; Sat, 20 Jan 2018 12:19:02 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201801201219.w0KCJ2mE093323@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 20 Jan 2018 12:19:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328192 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 328192 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jan 2018 12:19:04 -0000 Author: kib Date: Sat Jan 20 12:19:02 2018 New Revision: 328192 URL: https://svnweb.freebsd.org/changeset/base/328192 Log: Assign map->header values to avoid boundary checks. In several places, entry start and end field are checked, after excluding the possibility that the entry is map->header. By assigning max and min values to the start and end fields of map->header in vm_map_init, the explicit map->header checks become unnecessary. Submitted by: Doug Moore Reviewed by: alc, kib, markj (previous version) Tested by: pho (previous version) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D13735 Modified: head/sys/vm/vm_map.c head/sys/vm/vm_map.h head/sys/vm/vm_mmap.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Sat Jan 20 11:21:22 2018 (r328191) +++ head/sys/vm/vm_map.c Sat Jan 20 12:19:02 2018 (r328192) @@ -1003,12 +1003,10 @@ vm_map_entry_link(vm_map_t map, "vm_map_entry_link: map %p, nentries %d, entry %p, after %p", map, map->nentries, entry, after_where); VM_MAP_ASSERT_LOCKED(map); - KASSERT(after_where == &map->header || - after_where->end <= entry->start, + KASSERT(after_where->end <= entry->start, ("vm_map_entry_link: prev end %jx new start %jx overlap", (uintmax_t)after_where->end, (uintmax_t)entry->start)); - KASSERT(after_where->next == &map->header || - entry->end <= after_where->next->start, + KASSERT(entry->end <= after_where->next->start, ("vm_map_entry_link: new end %jx next start %jx overlap", (uintmax_t)entry->end, (uintmax_t)after_where->next->start)); @@ -1030,8 +1028,7 @@ vm_map_entry_link(vm_map_t map, entry->right = map->root; entry->left = NULL; } - entry->adj_free = (entry->next == &map->header ? map->max_offset : - entry->next->start) - entry->end; + entry->adj_free = entry->next->start - entry->end; vm_map_entry_set_max_free(entry); map->root = entry; } @@ -1050,8 +1047,7 @@ vm_map_entry_unlink(vm_map_t map, else { root = vm_map_entry_splay(entry->start, entry->left); root->right = entry->right; - root->adj_free = (entry->next == &map->header ? map->max_offset : - entry->next->start) - root->end; + root->adj_free = entry->next->start - root->end; vm_map_entry_set_max_free(root); } map->root = root; @@ -1087,8 +1083,7 @@ vm_map_entry_resize_free(vm_map_t map, vm_map_entry_t if (entry != map->root) map->root = vm_map_entry_splay(entry->start, map->root); - entry->adj_free = (entry->next == &map->header ? map->max_offset : - entry->next->start) - entry->end; + entry->adj_free = entry->next->start - entry->end; vm_map_entry_set_max_free(entry); } @@ -1218,7 +1213,7 @@ vm_map_insert(vm_map_t map, vm_object_t object, vm_oof /* * Assert that the next entry doesn't overlap the end point. */ - if (prev_entry->next != &map->header && prev_entry->next->start < end) + if (prev_entry->next->start < end) return (KERN_NO_SPACE); if ((cow & MAP_CREATE_GUARD) != 0 && (object != NULL || @@ -2090,8 +2085,7 @@ vm_map_protect(vm_map_t map, vm_offset_t start, vm_off /* * Make a first pass to check for protection violations. */ - for (current = entry; current != &map->header && current->start < end; - current = current->next) { + for (current = entry; current->start < end; current = current->next) { if ((current->eflags & MAP_ENTRY_GUARD) != 0) continue; if (current->eflags & MAP_ENTRY_IS_SUB_MAP) { @@ -2109,8 +2103,7 @@ vm_map_protect(vm_map_t map, vm_offset_t start, vm_off * now will do cow due to allowed write (e.g. debugger sets * breakpoint on text segment) */ - for (current = entry; current != &map->header && current->start < end; - current = current->next) { + for (current = entry; current->start < end; current = current->next) { vm_map_clip_end(map, current, end); @@ -2164,8 +2157,7 @@ vm_map_protect(vm_map_t map, vm_offset_t start, vm_off * Go back and fix up protections. [Note that clipping is not * necessary the second time.] */ - for (current = entry; current != &map->header && current->start < end; - current = current->next) { + for (current = entry; current->start < end; current = current->next) { if ((current->eflags & MAP_ENTRY_GUARD) != 0) continue; @@ -2274,10 +2266,8 @@ vm_map_madvise( * We clip the vm_map_entry so that behavioral changes are * limited to the specified address range. */ - for (current = entry; - (current != &map->header) && (current->start < end); - current = current->next - ) { + for (current = entry; current->start < end; + current = current->next) { if (current->eflags & MAP_ENTRY_IS_SUB_MAP) continue; @@ -2321,10 +2311,8 @@ vm_map_madvise( * Since we don't clip the vm_map_entry, we have to clip * the vm_object pindex and count. */ - for (current = entry; - (current != &map->header) && (current->start < end); - current = current->next - ) { + for (current = entry; current->start < end; + current = current->next) { vm_offset_t useEnd, useStart; if (current->eflags & MAP_ENTRY_IS_SUB_MAP) @@ -2420,7 +2408,7 @@ vm_map_inherit(vm_map_t map, vm_offset_t start, vm_off vm_map_clip_start(map, entry, start); } else entry = temp_entry->next; - while ((entry != &map->header) && (entry->start < end)) { + while (entry->start < end) { vm_map_clip_end(map, entry, end); if ((entry->eflags & MAP_ENTRY_GUARD) == 0 || new_inheritance != VM_INHERIT_ZERO) @@ -2462,7 +2450,7 @@ vm_map_unwire(vm_map_t map, vm_offset_t start, vm_offs } last_timestamp = map->timestamp; entry = first_entry; - while (entry != &map->header && entry->start < end) { + while (entry->start < end) { if (entry->eflags & MAP_ENTRY_IN_TRANSITION) { /* * We have not yet clipped the entry. @@ -2525,8 +2513,7 @@ vm_map_unwire(vm_map_t map, vm_offset_t start, vm_offs * If VM_MAP_WIRE_HOLESOK was specified, skip this check. */ if (((flags & VM_MAP_WIRE_HOLESOK) == 0) && - (entry->end < end && (entry->next == &map->header || - entry->next->start > entry->end))) { + (entry->end < end && entry->next->start > entry->end)) { end = entry->end; rv = KERN_INVALID_ADDRESS; goto done; @@ -2552,8 +2539,7 @@ done: else KASSERT(result, ("vm_map_unwire: lookup failed")); } - for (entry = first_entry; entry != &map->header && entry->start < end; - entry = entry->next) { + for (entry = first_entry; entry->start < end; entry = entry->next) { /* * If VM_MAP_WIRE_HOLESOK was specified, an empty * space in the unwired region could have been mapped @@ -2667,7 +2653,7 @@ vm_map_wire(vm_map_t map, vm_offset_t start, vm_offset } last_timestamp = map->timestamp; entry = first_entry; - while (entry != &map->header && entry->start < end) { + while (entry->start < end) { if (entry->eflags & MAP_ENTRY_IN_TRANSITION) { /* * We have not yet clipped the entry. @@ -2804,8 +2790,7 @@ vm_map_wire(vm_map_t map, vm_offset_t start, vm_offset */ next_entry: if ((flags & VM_MAP_WIRE_HOLESOK) == 0 && - entry->end < end && (entry->next == &map->header || - entry->next->start > entry->end)) { + entry->end < end && entry->next->start > entry->end) { end = entry->end; rv = KERN_INVALID_ADDRESS; goto done; @@ -2822,8 +2807,7 @@ done: else KASSERT(result, ("vm_map_wire: lookup failed")); } - for (entry = first_entry; entry != &map->header && entry->start < end; - entry = entry->next) { + for (entry = first_entry; entry->start < end; entry = entry->next) { /* * If VM_MAP_WIRE_HOLESOK was specified, an empty * space in the unwired region could have been mapped @@ -2927,15 +2911,13 @@ vm_map_sync( /* * Make a first pass to check for user-wired memory and holes. */ - for (current = entry; current != &map->header && current->start < end; - current = current->next) { + for (current = entry; current->start < end; current = current->next) { if (invalidate && (current->eflags & MAP_ENTRY_USER_WIRED)) { vm_map_unlock_read(map); return (KERN_INVALID_ARGUMENT); } if (end > current->end && - (current->next == &map->header || - current->end != current->next->start)) { + current->end != current->next->start) { vm_map_unlock_read(map); return (KERN_INVALID_ADDRESS); } @@ -2949,7 +2931,7 @@ vm_map_sync( * Make a second pass, cleaning/uncaching pages from the indicated * objects as we go. */ - for (current = entry; current != &map->header && current->start < end;) { + for (current = entry; current->start < end;) { offset = current->offset + (start - current->start); size = (end <= current->end ? end : current->end) - start; if (current->eflags & MAP_ENTRY_IS_SUB_MAP) { @@ -3126,7 +3108,7 @@ vm_map_delete(vm_map_t map, vm_offset_t start, vm_offs /* * Step through all entries in this region */ - while ((entry != &map->header) && (entry->start < end)) { + while (entry->start < end) { vm_map_entry_t next; /* @@ -3234,8 +3216,6 @@ vm_map_check_protection(vm_map_t map, vm_offset_t star entry = tmp_entry; while (start < end) { - if (entry == &map->header) - return (FALSE); /* * No holes allowed! */ @@ -3699,8 +3679,7 @@ vm_map_stack_locked(vm_map_t map, vm_offset_t addrbos, /* * If we can't accommodate max_ssize in the current mapping, no go. */ - if ((prev_entry->next != &map->header) && - (prev_entry->next->start < addrbos + max_ssize)) + if (prev_entry->next->start < addrbos + max_ssize) return (KERN_NO_SPACE); /* Modified: head/sys/vm/vm_map.h ============================================================================== --- head/sys/vm/vm_map.h Sat Jan 20 11:21:22 2018 (r328191) +++ head/sys/vm/vm_map.h Sat Jan 20 12:19:02 2018 (r328192) @@ -173,15 +173,19 @@ vm_map_entry_system_wired_count(vm_map_entry_t entry) * A map is a set of map entries. These map entries are * organized both as a binary search tree and as a doubly-linked * list. Both structures are ordered based upon the start and - * end addresses contained within each map entry. Sleator and - * Tarjan's top-down splay algorithm is employed to control - * height imbalance in the binary search tree. + * end addresses contained within each map entry. The list + * header has max start value and min end value to act as + * sentinels for sequential search of the doubly-linked list. + * Sleator and Tarjan's top-down splay algorithm is employed to + * control height imbalance in the binary search tree. * * List of locks * (c) const until freed */ struct vm_map { struct vm_map_entry header; /* List of entries */ +#define min_offset header.end /* (c) */ +#define max_offset header.start /* (c) */ struct sx lock; /* Lock for map data */ struct mtx system_mtx; int nentries; /* Number of entries */ @@ -192,8 +196,6 @@ struct vm_map { vm_flags_t flags; /* flags for this vm_map */ vm_map_entry_t root; /* Root of a binary search tree */ pmap_t pmap; /* (c) Physical map */ -#define min_offset header.start /* (c) */ -#define max_offset header.end /* (c) */ int busy; }; Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Sat Jan 20 11:21:22 2018 (r328191) +++ head/sys/vm/vm_mmap.c Sat Jan 20 12:19:02 2018 (r328192) @@ -543,8 +543,7 @@ kern_munmap(struct thread *td, uintptr_t addr0, size_t */ pkm.pm_address = (uintptr_t) NULL; if (vm_map_lookup_entry(map, addr, &entry)) { - for (; - entry != &map->header && entry->start < addr + size; + for (; entry->start < addr + size; entry = entry->next) { if (vm_map_check_protection(map, entry->start, entry->end, VM_PROT_EXECUTE) == TRUE) { @@ -770,16 +769,12 @@ RestartScan: * up the pages elsewhere. */ lastvecindex = -1; - for (current = entry; - (current != &map->header) && (current->start < end); - current = current->next) { + for (current = entry; current->start < end; current = current->next) { /* * check for contiguity */ - if (current->end < end && - (entry->next == &map->header || - current->next->start > current->end)) { + if (current->end < end && current->next->start > current->end) { vm_map_unlock_read(map); return (ENOMEM); } From owner-svn-src-head@freebsd.org Sat Jan 20 13:58:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 543C2ED27AC; Sat, 20 Jan 2018 13:58:36 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E7E047AEA3; Sat, 20 Jan 2018 13:58:35 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 352921D401; Sat, 20 Jan 2018 13:58:35 +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 w0KDwZD1036253; Sat, 20 Jan 2018 13:58:35 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0KDwYPs036245; Sat, 20 Jan 2018 13:58:34 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201801201358.w0KDwYPs036245@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 20 Jan 2018 13:58:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328194 - in head: share/man/man4 sys/dev/usb/template X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head: share/man/man4 sys/dev/usb/template X-SVN-Commit-Revision: 328194 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jan 2018 13:58:36 -0000 Author: trasz Date: Sat Jan 20 13:58:34 2018 New Revision: 328194 URL: https://svnweb.freebsd.org/changeset/base/328194 Log: Add sysctls to control device side USB identifiers. This makes it possible to change string and numeric vendor and product identifiers, as well as anything else there might be to change for a particular device side template, eg the MAC address. Reviewed by: hselasky@ MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D13920 Modified: head/share/man/man4/usb_template.4 head/sys/dev/usb/template/usb_template.c head/sys/dev/usb/template/usb_template.h head/sys/dev/usb/template/usb_template_audio.c head/sys/dev/usb/template/usb_template_cdce.c head/sys/dev/usb/template/usb_template_kbd.c head/sys/dev/usb/template/usb_template_midi.c head/sys/dev/usb/template/usb_template_modem.c head/sys/dev/usb/template/usb_template_mouse.c head/sys/dev/usb/template/usb_template_msc.c head/sys/dev/usb/template/usb_template_mtp.c head/sys/dev/usb/template/usb_template_phone.c head/sys/dev/usb/template/usb_template_serialnet.c Modified: head/share/man/man4/usb_template.4 ============================================================================== --- head/share/man/man4/usb_template.4 Sat Jan 20 12:31:21 2018 (r328193) +++ head/share/man/man4/usb_template.4 Sat Jan 20 13:58:34 2018 (r328194) @@ -61,11 +61,12 @@ descriptors. . USB templates are selected using the .Va hw.usb.template -sysctl and tunable. -. -The -.Va hw.usb.template -value can be changed at any time, but will not +sysctl and tunable, +or by using the +.Xr usbconfig 8 +.Cm set_template +subcommand. +The sysctl values can be changed at any time, but will not have any effect until the USB device has been re-enumerated. . Available templates are: @@ -83,10 +84,32 @@ Available templates are: .It Dv 9 Ta USB MIDI .El . +.Sh SYSCTL VARIABLES +The following variables are available as both +.Xr sysctl 8 +variables and +.Xr loader 8 +tunables: +.Bl -tag -width indent +.It Va hw.usb.template +Currently selected template. +.It Va hw.usb.templates.N +Configuration for template number +.Va N . +.It Va hw.usb.templates.N.vendor_id +16-bit vendor identifier (VID), usually assigned by USB-IF. +.It Va hw.usb.templates.N.product_id +16-bit product identifier (PID). +.It Va hw.usb.templates.N.manufacturer +String containing human-readable manufacturer name. +.It Va hw.usb.templates.N.product +String containing human-readable product name. +.El .Sh SEE ALSO .Xr cfumass 4 , .Xr usb 4 , -.Xr usfs 4 +.Xr usfs 4 , +.Xr usbconfig 8 .Sh STANDARDS The .Nm Modified: head/sys/dev/usb/template/usb_template.c ============================================================================== --- head/sys/dev/usb/template/usb_template.c Sat Jan 20 12:31:21 2018 (r328193) +++ head/sys/dev/usb/template/usb_template.c Sat Jan 20 13:58:34 2018 (r328194) @@ -65,6 +65,7 @@ #include #include #include +#include #define USB_DEBUG_VAR usb_debug #include @@ -75,6 +76,9 @@ #include #endif /* USB_GLOBAL_INCLUDE_FILE */ +SYSCTL_NODE(_hw_usb, OID_AUTO, templates, CTLFLAG_RW, 0, + "USB device side templates"); + MODULE_DEPEND(usb_template, usb, 1, 1, 1); MODULE_VERSION(usb_template, 1); @@ -112,6 +116,50 @@ static usb_error_t usb_temp_get_desc(struct usb_device static usb_error_t usb_temp_setup_by_index(struct usb_device *, uint16_t index); static void usb_temp_init(void *); + +/*------------------------------------------------------------------------* + * usb_decode_str_desc + * + * Helper function to decode string descriptors into a C string. + *------------------------------------------------------------------------*/ +void +usb_decode_str_desc(struct usb_string_descriptor *sd, char *buf, size_t buflen) +{ + size_t i; + + for (i = 0; i < buflen - 1 && i < sd->bLength / 2; i++) + buf[i] = UGETW(sd->bString[i]); + + buf[i] = '\0'; +} + +/*------------------------------------------------------------------------* + * usb_temp_sysctl + * + * Callback for SYSCTL_PROC(9), to set and retrieve template string + * descriptors. + *------------------------------------------------------------------------*/ +int +usb_temp_sysctl(SYSCTL_HANDLER_ARGS) +{ + char buf[128]; + struct usb_string_descriptor *sd = arg1; + size_t len, sdlen = arg2; + int error; + + usb_decode_str_desc(sd, buf, sizeof(buf)); + + error = sysctl_handle_string(oidp, buf, sizeof(buf), req); + if (error != 0 || req->newptr == NULL) + return (error); + + len = usb_make_str_desc(sd, sdlen, buf); + if (len == 0) + return (EINVAL); + + return (0); +} + /*------------------------------------------------------------------------* * usb_make_raw_desc Modified: head/sys/dev/usb/template/usb_template.h ============================================================================== --- head/sys/dev/usb/template/usb_template.h Sat Jan 20 12:31:21 2018 (r328193) +++ head/sys/dev/usb/template/usb_template.h Sat Jan 20 13:58:34 2018 (r328194) @@ -100,19 +100,25 @@ struct usb_temp_data { /* prototypes */ -extern const struct usb_temp_device_desc usb_template_audio; -extern const struct usb_temp_device_desc usb_template_cdce; -extern const struct usb_temp_device_desc usb_template_kbd; -extern const struct usb_temp_device_desc usb_template_modem; -extern const struct usb_temp_device_desc usb_template_mouse; -extern const struct usb_temp_device_desc usb_template_msc; -extern const struct usb_temp_device_desc usb_template_mtp; -extern const struct usb_temp_device_desc usb_template_phone; -extern const struct usb_temp_device_desc usb_template_serialnet; -extern const struct usb_temp_device_desc usb_template_midi; +extern struct usb_temp_device_desc usb_template_audio; +extern struct usb_temp_device_desc usb_template_cdce; +extern struct usb_temp_device_desc usb_template_kbd; +extern struct usb_temp_device_desc usb_template_modem; +extern struct usb_temp_device_desc usb_template_mouse; +extern struct usb_temp_device_desc usb_template_msc; +extern struct usb_temp_device_desc usb_template_mtp; +extern struct usb_temp_device_desc usb_template_phone; +extern struct usb_temp_device_desc usb_template_serialnet; +extern struct usb_temp_device_desc usb_template_midi; + +void usb_decode_str_desc(struct usb_string_descriptor *sd, + char *buf, size_t buflen); usb_error_t usb_temp_setup(struct usb_device *, const struct usb_temp_device_desc *); -void usb_temp_unsetup(struct usb_device *); +void usb_temp_unsetup(struct usb_device *); +int usb_temp_sysctl(SYSCTL_HANDLER_ARGS); + +SYSCTL_DECL(_hw_usb_templates); #endif /* _USB_TEMPLATE_H_ */ Modified: head/sys/dev/usb/template/usb_template_audio.c ============================================================================== --- head/sys/dev/usb/template/usb_template_audio.c Sat Jan 20 12:31:21 2018 (r328193) +++ head/sys/dev/usb/template/usb_template_audio.c Sat Jan 20 13:58:34 2018 (r328194) @@ -2,8 +2,13 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * - * Copyright (c) 2010 Hans Petter Selasky. All rights reserved. + * Copyright (c) 2010 Hans Petter Selasky + * Copyright (c) 2018 The FreeBSD Foundation + * All rights reserved. * + * Portions of this software were developed by Edward Tomasz Napierala + * 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: @@ -56,39 +61,33 @@ #include #include #include +#include +#include #include #endif /* USB_GLOBAL_INCLUDE_FILE */ enum { - INDEX_AUDIO_LANG, - INDEX_AUDIO_MIXER, - INDEX_AUDIO_RECORD, - INDEX_AUDIO_PLAYBACK, - INDEX_AUDIO_PRODUCT, - INDEX_AUDIO_MAX, + AUDIO_LANG_INDEX, + AUDIO_MIXER_INDEX, + AUDIO_RECORD_INDEX, + AUDIO_PLAYBACK_INDEX, + AUDIO_PRODUCT_INDEX, + AUDIO_MAX_INDEX, }; -#define STRING_AUDIO_PRODUCT \ - "A\0u\0d\0i\0o\0 \0T\0e\0s\0t\0 \0D\0e\0v\0i\0c\0e" +#define AUDIO_DEFAULT_PRODUCT "Audio Test Device" +#define AUDIO_DEFAULT_MIXER "Mixer interface" +#define AUDIO_DEFAULT_RECORD "Record interface" +#define AUDIO_DEFAULT_PLAYBACK "Playback interface" -#define STRING_AUDIO_MIXER \ - "M\0i\0x\0e\0r\0 \0i\0n\0t\0e\0r\0f\0a\0c\0e" +static struct usb_string_descriptor audio_mixer; +static struct usb_string_descriptor audio_record; +static struct usb_string_descriptor audio_playback; +static struct usb_string_descriptor audio_product; -#define STRING_AUDIO_RECORD \ - "R\0e\0c\0o\0r\0d\0 \0i\0n\0t\0e\0r\0f\0a\0c\0e" +static struct sysctl_ctx_list audio_ctx_list; -#define STRING_AUDIO_PLAYBACK \ - "P\0l\0a\0y\0b\0a\0c\0k\0 \0i\0n\0t\0e\0r\0f\0a\0c\0e" - - -/* make the real string descriptors */ - -USB_MAKE_STRING_DESC(STRING_AUDIO_MIXER, string_audio_mixer); -USB_MAKE_STRING_DESC(STRING_AUDIO_RECORD, string_audio_record); -USB_MAKE_STRING_DESC(STRING_AUDIO_PLAYBACK, string_audio_playback); -USB_MAKE_STRING_DESC(STRING_AUDIO_PRODUCT, string_audio_product); - /* prototypes */ /* @@ -204,7 +203,7 @@ static const struct usb_temp_interface_desc audio_ifac .bInterfaceClass = UICLASS_AUDIO, .bInterfaceSubClass = UISUBCLASS_AUDIOCONTROL, .bInterfaceProtocol = 0, - .iInterface = INDEX_AUDIO_MIXER, + .iInterface = AUDIO_MIXER_INDEX, }; static const uint8_t audio_raw_desc_20[] = { @@ -262,7 +261,7 @@ static const struct usb_temp_interface_desc audio_ifac .bInterfaceClass = UICLASS_AUDIO, .bInterfaceSubClass = UISUBCLASS_AUDIOSTREAM, .bInterfaceProtocol = 0, - .iInterface = INDEX_AUDIO_PLAYBACK, + .iInterface = AUDIO_PLAYBACK_INDEX, }; static const struct usb_temp_interface_desc audio_iface_1_alt_1 = { @@ -271,7 +270,7 @@ static const struct usb_temp_interface_desc audio_ifac .bInterfaceClass = UICLASS_AUDIO, .bInterfaceSubClass = UISUBCLASS_AUDIOSTREAM, .bInterfaceProtocol = 0, - .iInterface = INDEX_AUDIO_PLAYBACK, + .iInterface = AUDIO_PLAYBACK_INDEX, .isAltInterface = 1, /* this is an alternate setting */ }; @@ -320,7 +319,7 @@ static const struct usb_temp_interface_desc audio_ifac .bInterfaceClass = UICLASS_AUDIO, .bInterfaceSubClass = UISUBCLASS_AUDIOSTREAM, .bInterfaceProtocol = 0, - .iInterface = INDEX_AUDIO_RECORD, + .iInterface = AUDIO_RECORD_INDEX, }; static const struct usb_temp_interface_desc audio_iface_2_alt_1 = { @@ -329,7 +328,7 @@ static const struct usb_temp_interface_desc audio_ifac .bInterfaceClass = UICLASS_AUDIO, .bInterfaceSubClass = UISUBCLASS_AUDIOSTREAM, .bInterfaceProtocol = 0, - .iInterface = INDEX_AUDIO_RECORD, + .iInterface = AUDIO_RECORD_INDEX, .isAltInterface = 1, /* this is an alternate setting */ }; @@ -346,7 +345,7 @@ static const struct usb_temp_config_desc audio_config_ .ppIfaceDesc = audio_interfaces, .bmAttributes = UC_BUS_POWERED, .bMaxPower = 25, /* 50 mA */ - .iConfiguration = INDEX_AUDIO_PRODUCT, + .iConfiguration = AUDIO_PRODUCT_INDEX, }; static const struct usb_temp_config_desc *audio_configs[] = { @@ -356,7 +355,7 @@ static const struct usb_temp_config_desc *audio_config static usb_temp_get_string_desc_t audio_get_string_desc; -const struct usb_temp_device_desc usb_template_audio = { +struct usb_temp_device_desc usb_template_audio = { .getStringDesc = &audio_get_string_desc, .ppConfigDesc = audio_configs, .idVendor = USB_TEMPLATE_VENDOR, @@ -365,9 +364,7 @@ const struct usb_temp_device_desc usb_template_audio = .bDeviceClass = UDCLASS_COMM, .bDeviceSubClass = 0, .bDeviceProtocol = 0, - .iManufacturer = 0, - .iProduct = INDEX_AUDIO_PRODUCT, - .iSerialNumber = 0, + .iProduct = AUDIO_PRODUCT_INDEX, }; /*------------------------------------------------------------------------* @@ -380,12 +377,12 @@ const struct usb_temp_device_desc usb_template_audio = static const void * audio_get_string_desc(uint16_t lang_id, uint8_t string_index) { - static const void *ptr[INDEX_AUDIO_MAX] = { - [INDEX_AUDIO_LANG] = &usb_string_lang_en, - [INDEX_AUDIO_MIXER] = &string_audio_mixer, - [INDEX_AUDIO_RECORD] = &string_audio_record, - [INDEX_AUDIO_PLAYBACK] = &string_audio_playback, - [INDEX_AUDIO_PRODUCT] = &string_audio_product, + static const void *ptr[AUDIO_MAX_INDEX] = { + [AUDIO_LANG_INDEX] = &usb_string_lang_en, + [AUDIO_MIXER_INDEX] = &audio_mixer, + [AUDIO_RECORD_INDEX] = &audio_record, + [AUDIO_PLAYBACK_INDEX] = &audio_playback, + [AUDIO_PRODUCT_INDEX] = &audio_product, }; if (string_index == 0) { @@ -394,8 +391,66 @@ audio_get_string_desc(uint16_t lang_id, uint8_t string if (lang_id != 0x0409) { return (NULL); } - if (string_index < INDEX_AUDIO_MAX) { + if (string_index < AUDIO_MAX_INDEX) { return (ptr[string_index]); } return (NULL); } + +static void +audio_init(void *arg __unused) +{ + struct sysctl_oid *parent; + char parent_name[3]; + + usb_make_str_desc(&audio_mixer, sizeof(audio_mixer), + AUDIO_DEFAULT_MIXER); + usb_make_str_desc(&audio_record, sizeof(audio_record), + AUDIO_DEFAULT_RECORD); + usb_make_str_desc(&audio_playback, sizeof(audio_playback), + AUDIO_DEFAULT_PLAYBACK); + usb_make_str_desc(&audio_product, sizeof(audio_product), + AUDIO_DEFAULT_PRODUCT); + + snprintf(parent_name, sizeof(parent_name), "%d", USB_TEMP_AUDIO); + sysctl_ctx_init(&audio_ctx_list); + + parent = SYSCTL_ADD_NODE(&audio_ctx_list, + SYSCTL_STATIC_CHILDREN(_hw_usb_templates), OID_AUTO, + parent_name, CTLFLAG_RW, + 0, "USB Audio Interface device side template"); + SYSCTL_ADD_U16(&audio_ctx_list, SYSCTL_CHILDREN(parent), OID_AUTO, + "vendor_id", CTLFLAG_RWTUN, &usb_template_audio.idVendor, + 1, "Vendor identifier"); + SYSCTL_ADD_U16(&audio_ctx_list, SYSCTL_CHILDREN(parent), OID_AUTO, + "product_id", CTLFLAG_RWTUN, &usb_template_audio.idProduct, + 1, "Product identifier"); +#if 0 + SYSCTL_ADD_PROC(&audio_ctx_list, SYSCTL_CHILDREN(parent), OID_AUTO, + "mixer", CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, + &audio_mixer, sizeof(audio_mixer), usb_temp_sysctl, + "A", "Mixer interface string"); + SYSCTL_ADD_PROC(&audio_ctx_list, SYSCTL_CHILDREN(parent), OID_AUTO, + "record", CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, + &audio_record, sizeof(audio_record), usb_temp_sysctl, + "A", "Record interface string"); + SYSCTL_ADD_PROC(&audio_ctx_list, SYSCTL_CHILDREN(parent), OID_AUTO, + "playback", CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, + &audio_playback, sizeof(audio_playback), usb_temp_sysctl, + "A", "Playback interface string"); +#endif + SYSCTL_ADD_PROC(&audio_ctx_list, SYSCTL_CHILDREN(parent), OID_AUTO, + "product", CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, + &audio_product, sizeof(audio_product), usb_temp_sysctl, + "A", "Product string"); +} + +static void +audio_uninit(void *arg __unused) +{ + + sysctl_ctx_free(&audio_ctx_list); +} + +SYSINIT(audio_init, SI_SUB_LOCK, SI_ORDER_FIRST, audio_init, NULL); +SYSUNINIT(audio_init, SI_SUB_LOCK, SI_ORDER_FIRST, audio_uninit, NULL); Modified: head/sys/dev/usb/template/usb_template_cdce.c ============================================================================== --- head/sys/dev/usb/template/usb_template_cdce.c Sat Jan 20 12:31:21 2018 (r328193) +++ head/sys/dev/usb/template/usb_template_cdce.c Sat Jan 20 13:58:34 2018 (r328194) @@ -3,8 +3,12 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2007 Hans Petter Selasky + * Copyright (c) 2018 The FreeBSD Foundation * All rights reserved. * + * Portions of this software were developed by Edward Tomasz Napierala + * 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: @@ -57,55 +61,42 @@ #include #include #include +#include +#include #include #endif /* USB_GLOBAL_INCLUDE_FILE */ enum { - STRING_LANG_INDEX, - STRING_MAC_INDEX, - STRING_ETH_CONTROL_INDEX, - STRING_ETH_DATA_INDEX, - STRING_ETH_CONFIG_INDEX, - STRING_ETH_VENDOR_INDEX, - STRING_ETH_PRODUCT_INDEX, - STRING_ETH_SERIAL_INDEX, - STRING_ETH_MAX, + ETH_LANG_INDEX, + ETH_MAC_INDEX, + ETH_CONTROL_INDEX, + ETH_DATA_INDEX, + ETH_CONFIGURATION_INDEX, + ETH_MANUFACTURER_INDEX, + ETH_PRODUCT_INDEX, + ETH_SERIAL_NUMBER_INDEX, + ETH_MAX_INDEX, }; -#define STRING_MAC \ - "2\0A\0002\0003\0004\0005\0006\0007\08\09\0A\0B" +#define ETH_DEFAULT_MAC "2A02030405060789AB" +#define ETH_DEFAULT_CONTROL "USB Ethernet Comm Interface" +#define ETH_DEFAULT_DATA "USB Ethernet Data Interface" +#define ETH_DEFAULT_CONFIG "Default Config" +#define ETH_DEFAULT_MANUFACTURER "FreeBSD foundation" +#define ETH_DEFAULT_PRODUCT "USB Ethernet Adapter" +#define ETH_DEFAULT_SERIAL_NUMBER "December 2007" -#define STRING_ETH_CONTROL \ - "U\0S\0B\0 \0E\0t\0h\0e\0r\0n\0e\0t\0 " \ - "\0C\0o\0m\0m\0 \0I\0n\0t\0e\0r\0f\0a\0c\0e" +static struct usb_string_descriptor eth_mac; +static struct usb_string_descriptor eth_control; +static struct usb_string_descriptor eth_data; +static struct usb_string_descriptor eth_configuration; +static struct usb_string_descriptor eth_manufacturer; +static struct usb_string_descriptor eth_product; +static struct usb_string_descriptor eth_serial_number; -#define STRING_ETH_DATA \ - "U\0S\0B\0 \0E\0t\0h\0e\0r\0n\0e\0t\0 \0D\0a\0t\0a\0 " \ - "\0I\0n\0t\0e\0r\0f\0a\0c\0e" +static struct sysctl_ctx_list eth_ctx_list; -#define STRING_ETH_CONFIG \ - "D\0e\0f\0a\0u\0l\0t\0 \0c\0o\0n\0f\0i\0g" - -#define STRING_ETH_VENDOR \ - "F\0r\0e\0e\0B\0S\0D\0 \0f\0o\0u\0n\0d\0a\0t\0i\0o\0n" - -#define STRING_ETH_PRODUCT \ - "U\0S\0B\0 \0E\0t\0h\0e\0r\0n\0e\0t\0 \0A\0d\0a\0p\0t\0e\0r" - -#define STRING_ETH_SERIAL \ - "D\0e\0c\0e\0m\0b\0e\0r\0 \0002\0000\0000\0007" - -/* make the real string descriptors */ - -USB_MAKE_STRING_DESC(STRING_MAC, string_mac); -USB_MAKE_STRING_DESC(STRING_ETH_CONTROL, string_eth_control); -USB_MAKE_STRING_DESC(STRING_ETH_DATA, string_eth_data); -USB_MAKE_STRING_DESC(STRING_ETH_CONFIG, string_eth_config); -USB_MAKE_STRING_DESC(STRING_ETH_VENDOR, string_eth_vendor); -USB_MAKE_STRING_DESC(STRING_ETH_PRODUCT, string_eth_product); -USB_MAKE_STRING_DESC(STRING_ETH_SERIAL, string_eth_serial); - /* prototypes */ static usb_temp_get_string_desc_t eth_get_string_desc; @@ -130,7 +121,7 @@ static const struct usb_cdc_ethernet_descriptor eth_en .bLength = sizeof(eth_enf_desc), .bDescriptorType = UDESC_CS_INTERFACE, .bDescriptorSubtype = UDESCSUB_CDC_ENF, - .iMacAddress = STRING_MAC_INDEX, + .iMacAddress = ETH_MAC_INDEX, .bmEthernetStatistics = {0, 0, 0, 0}, .wMaxSegmentSize = {0xEA, 0x05},/* 1514 bytes */ .wNumberMCFilters = {0, 0}, @@ -191,7 +182,7 @@ static const struct usb_temp_interface_desc eth_contro .bInterfaceClass = UICLASS_CDC, .bInterfaceSubClass = UISUBCLASS_ETHERNET_NETWORKING_CONTROL_MODEL, .bInterfaceProtocol = 0, - .iInterface = STRING_ETH_CONTROL_INDEX, + .iInterface = ETH_CONTROL_INDEX, }; static const struct usb_temp_endpoint_desc *eth_data_endpoints[] = { @@ -205,7 +196,7 @@ static const struct usb_temp_interface_desc eth_data_n .bInterfaceClass = UICLASS_CDC_DATA, .bInterfaceSubClass = 0, .bInterfaceProtocol = 0, - .iInterface = STRING_ETH_DATA_INDEX, + .iInterface = ETH_DATA_INDEX, }; static const struct usb_temp_interface_desc eth_data_interface = { @@ -213,7 +204,7 @@ static const struct usb_temp_interface_desc eth_data_i .bInterfaceClass = UICLASS_CDC_DATA, .bInterfaceSubClass = UISUBCLASS_DATA, .bInterfaceProtocol = 0, - .iInterface = STRING_ETH_DATA_INDEX, + .iInterface = ETH_DATA_INDEX, .isAltInterface = 1, /* this is an alternate setting */ }; @@ -228,7 +219,7 @@ static const struct usb_temp_config_desc eth_config_de .ppIfaceDesc = eth_interfaces, .bmAttributes = UC_BUS_POWERED, .bMaxPower = 25, /* 50 mA */ - .iConfiguration = STRING_ETH_CONFIG_INDEX, + .iConfiguration = ETH_CONFIGURATION_INDEX, }; static const struct usb_temp_config_desc *eth_configs[] = { @@ -236,7 +227,7 @@ static const struct usb_temp_config_desc *eth_configs[ NULL, }; -const struct usb_temp_device_desc usb_template_cdce = { +struct usb_temp_device_desc usb_template_cdce = { .getStringDesc = ð_get_string_desc, .ppConfigDesc = eth_configs, .idVendor = USB_TEMPLATE_VENDOR, @@ -245,9 +236,9 @@ const struct usb_temp_device_desc usb_template_cdce = .bDeviceClass = UDCLASS_COMM, .bDeviceSubClass = 0, .bDeviceProtocol = 0, - .iManufacturer = STRING_ETH_VENDOR_INDEX, - .iProduct = STRING_ETH_PRODUCT_INDEX, - .iSerialNumber = STRING_ETH_SERIAL_INDEX, + .iManufacturer = ETH_MANUFACTURER_INDEX, + .iProduct = ETH_PRODUCT_INDEX, + .iSerialNumber = ETH_SERIAL_NUMBER_INDEX, }; /*------------------------------------------------------------------------* @@ -260,15 +251,15 @@ const struct usb_temp_device_desc usb_template_cdce = static const void * eth_get_string_desc(uint16_t lang_id, uint8_t string_index) { - static const void *ptr[STRING_ETH_MAX] = { - [STRING_LANG_INDEX] = &usb_string_lang_en, - [STRING_MAC_INDEX] = &string_mac, - [STRING_ETH_CONTROL_INDEX] = &string_eth_control, - [STRING_ETH_DATA_INDEX] = &string_eth_data, - [STRING_ETH_CONFIG_INDEX] = &string_eth_config, - [STRING_ETH_VENDOR_INDEX] = &string_eth_vendor, - [STRING_ETH_PRODUCT_INDEX] = &string_eth_product, - [STRING_ETH_SERIAL_INDEX] = &string_eth_serial, + static const void *ptr[ETH_MAX_INDEX] = { + [ETH_LANG_INDEX] = &usb_string_lang_en, + [ETH_MAC_INDEX] = ð_mac, + [ETH_CONTROL_INDEX] = ð_control, + [ETH_DATA_INDEX] = ð_data, + [ETH_CONFIGURATION_INDEX] = ð_configuration, + [ETH_MANUFACTURER_INDEX] = ð_manufacturer, + [ETH_PRODUCT_INDEX] = ð_product, + [ETH_SERIAL_NUMBER_INDEX] = ð_serial_number, }; if (string_index == 0) { @@ -277,8 +268,84 @@ eth_get_string_desc(uint16_t lang_id, uint8_t string_i if (lang_id != 0x0409) { return (NULL); } - if (string_index < STRING_ETH_MAX) { + if (string_index < ETH_MAX_INDEX) { return (ptr[string_index]); } return (NULL); } + +static void +eth_init(void *arg __unused) +{ + struct sysctl_oid *parent; + char parent_name[3]; + + usb_make_str_desc(ð_mac, sizeof(eth_mac), + ETH_DEFAULT_MAC); + usb_make_str_desc(ð_control, sizeof(eth_control), + ETH_DEFAULT_CONTROL); + usb_make_str_desc(ð_data, sizeof(eth_data), + ETH_DEFAULT_DATA); + usb_make_str_desc(ð_configuration, sizeof(eth_configuration), + ETH_DEFAULT_CONFIG); + usb_make_str_desc(ð_manufacturer, sizeof(eth_manufacturer), + ETH_DEFAULT_MANUFACTURER); + usb_make_str_desc(ð_product, sizeof(eth_product), + ETH_DEFAULT_PRODUCT); + usb_make_str_desc(ð_serial_number, sizeof(eth_serial_number), + ETH_DEFAULT_SERIAL_NUMBER); + + snprintf(parent_name, sizeof(parent_name), "%d", USB_TEMP_CDCE); + sysctl_ctx_init(ð_ctx_list); + + parent = SYSCTL_ADD_NODE(ð_ctx_list, + SYSCTL_STATIC_CHILDREN(_hw_usb_templates), OID_AUTO, + parent_name, CTLFLAG_RW, + 0, "USB CDC Ethernet device side template"); + SYSCTL_ADD_U16(ð_ctx_list, SYSCTL_CHILDREN(parent), OID_AUTO, + "vendor_id", CTLFLAG_RWTUN, + &usb_template_cdce.idVendor, 1, "Vendor identifier"); + SYSCTL_ADD_U16(ð_ctx_list, SYSCTL_CHILDREN(parent), OID_AUTO, + "product_id", CTLFLAG_RWTUN, + &usb_template_cdce.idProduct, 1, "Product identifier"); + SYSCTL_ADD_PROC(ð_ctx_list, SYSCTL_CHILDREN(parent), OID_AUTO, + "mac", CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, + ð_mac, sizeof(eth_mac), usb_temp_sysctl, + "A", "MAC address string"); +#if 0 + SYSCTL_ADD_PROC(ð_ctx_list, SYSCTL_CHILDREN(parent), OID_AUTO, + "control", CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, + ð_control, sizeof(eth_control), usb_temp_sysctl, + "A", "Control interface string"); + SYSCTL_ADD_PROC(ð_ctx_list, SYSCTL_CHILDREN(parent), OID_AUTO, + "data", CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, + ð_data, sizeof(eth_data), usb_temp_sysctl, + "A", "Data interface string"); + SYSCTL_ADD_PROC(ð_ctx_list, SYSCTL_CHILDREN(parent), OID_AUTO, + "configuration", CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, + ð_configuration, sizeof(eth_configuration), usb_temp_sysctl, + "A", "Configuration string"); +#endif + SYSCTL_ADD_PROC(ð_ctx_list, SYSCTL_CHILDREN(parent), OID_AUTO, + "manufacturer", CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, + ð_manufacturer, sizeof(eth_manufacturer), usb_temp_sysctl, + "A", "Manufacturer string"); + SYSCTL_ADD_PROC(ð_ctx_list, SYSCTL_CHILDREN(parent), OID_AUTO, + "product", CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, + ð_product, sizeof(eth_product), usb_temp_sysctl, + "A", "Product string"); + SYSCTL_ADD_PROC(ð_ctx_list, SYSCTL_CHILDREN(parent), OID_AUTO, + "serial_number", CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, + ð_serial_number, sizeof(eth_serial_number), usb_temp_sysctl, + "A", "Serial number string"); +} + +static void +eth_uninit(void *arg __unused) +{ + + sysctl_ctx_free(ð_ctx_list); +} + +SYSINIT(eth_init, SI_SUB_LOCK, SI_ORDER_FIRST, eth_init, NULL); +SYSUNINIT(eth_init, SI_SUB_LOCK, SI_ORDER_FIRST, eth_uninit, NULL); Modified: head/sys/dev/usb/template/usb_template_kbd.c ============================================================================== --- head/sys/dev/usb/template/usb_template_kbd.c Sat Jan 20 12:31:21 2018 (r328193) +++ head/sys/dev/usb/template/usb_template_kbd.c Sat Jan 20 13:58:34 2018 (r328194) @@ -2,8 +2,13 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * - * Copyright (c) 2010 Hans Petter Selasky. All rights reserved. + * Copyright (c) 2010 Hans Petter Selasky + * Copyright (c) 2018 The FreeBSD Foundation + * All rights reserved. * + * Portions of this software were developed by Edward Tomasz Napierala + * 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: @@ -56,28 +61,27 @@ #include #include #include +#include +#include #include #endif /* USB_GLOBAL_INCLUDE_FILE */ enum { - INDEX_LANG, - INDEX_KEYBOARD, - INDEX_PRODUCT, - INDEX_MAX, + KBD_LANG_INDEX, + KBD_INTERFACE_INDEX, + KBD_PRODUCT_INDEX, + KBD_MAX_INDEX, }; -#define STRING_PRODUCT \ - "K\0e\0y\0b\0o\0a\0r\0d\0 \0T\0e\0s\0t\0 \0D\0e\0v\0i\0c\0e" +#define KBD_DEFAULT_INTERFACE "Keyboard Interface" +#define KBD_DEFAULT_PRODUCT "Keyboard Test Device" -#define STRING_KEYBOARD \ - "K\0e\0y\0b\0o\0a\0r\0d\0 \0i\0n\0t\0e\0r\0f\0a\0c\0e" +static struct usb_string_descriptor kbd_interface; +static struct usb_string_descriptor kbd_product; -/* make the real string descriptors */ +static struct sysctl_ctx_list kbd_ctx_list; -USB_MAKE_STRING_DESC(STRING_KEYBOARD, string_keyboard); -USB_MAKE_STRING_DESC(STRING_PRODUCT, string_product); - /* prototypes */ static const struct usb_temp_packet_size keyboard_intr_mps = { @@ -135,7 +139,7 @@ static const struct usb_temp_interface_desc keyboard_i .bInterfaceClass = UICLASS_HID, .bInterfaceSubClass = UISUBCLASS_BOOT, .bInterfaceProtocol = UIPROTO_BOOT_KEYBOARD, - .iInterface = INDEX_KEYBOARD, + .iInterface = KBD_INTERFACE_INDEX, }; static const struct usb_temp_interface_desc *keyboard_interfaces[] = { @@ -147,7 +151,7 @@ static const struct usb_temp_config_desc keyboard_conf .ppIfaceDesc = keyboard_interfaces, .bmAttributes = UC_BUS_POWERED, .bMaxPower = 25, /* 50 mA */ - .iConfiguration = INDEX_PRODUCT, + .iConfiguration = KBD_PRODUCT_INDEX, }; static const struct usb_temp_config_desc *keyboard_configs[] = { @@ -158,7 +162,7 @@ static const struct usb_temp_config_desc *keyboard_con static usb_temp_get_string_desc_t keyboard_get_string_desc; static usb_temp_get_vendor_desc_t keyboard_get_vendor_desc; -const struct usb_temp_device_desc usb_template_kbd = { +struct usb_temp_device_desc usb_template_kbd = { .getStringDesc = &keyboard_get_string_desc, .getVendorDesc = &keyboard_get_vendor_desc, .ppConfigDesc = keyboard_configs, @@ -169,7 +173,7 @@ const struct usb_temp_device_desc usb_template_kbd = { .bDeviceSubClass = 0, .bDeviceProtocol = 0, .iManufacturer = 0, - .iProduct = INDEX_PRODUCT, + .iProduct = KBD_PRODUCT_INDEX, .iSerialNumber = 0, }; @@ -203,10 +207,10 @@ keyboard_get_vendor_desc(const struct usb_device_reque static const void * keyboard_get_string_desc(uint16_t lang_id, uint8_t string_index) { - static const void *ptr[INDEX_MAX] = { - [INDEX_LANG] = &usb_string_lang_en, - [INDEX_KEYBOARD] = &string_keyboard, - [INDEX_PRODUCT] = &string_product, + static const void *ptr[KBD_MAX_INDEX] = { + [KBD_LANG_INDEX] = &usb_string_lang_en, + [KBD_INTERFACE_INDEX] = &kbd_interface, + [KBD_PRODUCT_INDEX] = &kbd_product, }; if (string_index == 0) { @@ -215,8 +219,54 @@ keyboard_get_string_desc(uint16_t lang_id, uint8_t str if (lang_id != 0x0409) { return (NULL); } - if (string_index < INDEX_MAX) { + if (string_index < KBD_MAX_INDEX) { return (ptr[string_index]); } return (NULL); } + +static void +kbd_init(void *arg __unused) +{ + struct sysctl_oid *parent; + char parent_name[3]; + + usb_make_str_desc(&kbd_interface, sizeof(kbd_interface), + KBD_DEFAULT_INTERFACE); + usb_make_str_desc(&kbd_product, sizeof(kbd_product), + KBD_DEFAULT_PRODUCT); + + snprintf(parent_name, sizeof(parent_name), "%d", USB_TEMP_KBD); + sysctl_ctx_init(&kbd_ctx_list); + + parent = SYSCTL_ADD_NODE(&kbd_ctx_list, + SYSCTL_STATIC_CHILDREN(_hw_usb_templates), OID_AUTO, + parent_name, CTLFLAG_RW, + 0, "USB Keyboard device side template"); + SYSCTL_ADD_U16(&kbd_ctx_list, SYSCTL_CHILDREN(parent), OID_AUTO, + "vendor_id", CTLFLAG_RWTUN, + &usb_template_kbd.idVendor, 1, "Vendor identifier"); + SYSCTL_ADD_U16(&kbd_ctx_list, SYSCTL_CHILDREN(parent), OID_AUTO, + "product_id", CTLFLAG_RWTUN, + &usb_template_kbd.idProduct, 1, "Product identifier"); +#if 0 + SYSCTL_ADD_PROC(&kbd_ctx_list, SYSCTL_CHILDREN(parent), OID_AUTO, + "interface", CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, + &kbd_interface, sizeof(kbd_interface), usb_temp_sysctl, + "A", "Interface string"); +#endif + SYSCTL_ADD_PROC(&kbd_ctx_list, SYSCTL_CHILDREN(parent), OID_AUTO, + "product", CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, + &kbd_product, sizeof(kbd_product), usb_temp_sysctl, + "A", "Product string"); +} + +static void +kbd_uninit(void *arg __unused) +{ + + sysctl_ctx_free(&kbd_ctx_list); +} + +SYSINIT(kbd_init, SI_SUB_LOCK, SI_ORDER_FIRST, kbd_init, NULL); +SYSUNINIT(kbd_init, SI_SUB_LOCK, SI_ORDER_FIRST, kbd_uninit, NULL); Modified: head/sys/dev/usb/template/usb_template_midi.c ============================================================================== --- head/sys/dev/usb/template/usb_template_midi.c Sat Jan 20 12:31:21 2018 (r328193) +++ head/sys/dev/usb/template/usb_template_midi.c Sat Jan 20 13:58:34 2018 (r328194) @@ -1,7 +1,12 @@ /* $FreeBSD$ */ /*- - * Copyright (c) 2015 Hans Petter Selasky. All rights reserved. + * Copyright (c) 2015 Hans Petter Selasky + * Copyright (c) 2018 The FreeBSD Foundation + * All rights reserved. * + * Portions of this software were developed by Edward Tomasz Napierala + * 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: @@ -53,28 +58,27 @@ #include #include #include +#include +#include #include #endif /* USB_GLOBAL_INCLUDE_FILE */ enum { - INDEX_MIDI_LANG, - INDEX_MIDI_IF, - INDEX_MIDI_PRODUCT, - INDEX_MIDI_MAX, + MIDI_LANG_INDEX, + MIDI_INTERFACE_INDEX, + MIDI_PRODUCT_INDEX, + MIDI_MAX_INDEX, }; -#define STRING_MIDI_PRODUCT \ - "M\0I\0D\0I\0 \0T\0e\0s\0t\0 \0D\0e\0v\0i\0c\0e" +#define MIDI_DEFAULT_INTERFACE "MIDI interface" +#define MIDI_DEFAULT_PRODUCT "MIDI Test Device" -#define STRING_MIDI_IF \ - "M\0I\0D\0I\0 \0i\0n\0t\0e\0r\0f\0a\0c\0e" +static struct usb_string_descriptor midi_interface; +static struct usb_string_descriptor midi_product; -/* make the real string descriptors */ +static struct sysctl_ctx_list midi_ctx_list; -USB_MAKE_STRING_DESC(STRING_MIDI_IF, string_midi_if); -USB_MAKE_STRING_DESC(STRING_MIDI_PRODUCT, string_midi_product); - /* prototypes */ static const uint8_t midi_desc_raw_0[9] = { @@ -92,7 +96,7 @@ static const struct usb_temp_interface_desc midi_iface .bInterfaceClass = UICLASS_AUDIO, .bInterfaceSubClass = UISUBCLASS_AUDIOCONTROL, .bInterfaceProtocol = 0, - .iInterface = INDEX_MIDI_IF, + .iInterface = MIDI_INTERFACE_INDEX, }; static const struct usb_temp_packet_size midi_mps = { @@ -174,7 +178,7 @@ static const struct usb_temp_interface_desc midi_iface .bInterfaceClass = UICLASS_AUDIO, .bInterfaceSubClass = UISUBCLASS_MIDISTREAM, .bInterfaceProtocol = 0, - .iInterface = INDEX_MIDI_IF, + .iInterface = MIDI_INTERFACE_INDEX, }; static const struct usb_temp_interface_desc *midi_interfaces[] = { @@ -187,7 +191,7 @@ static const struct usb_temp_config_desc midi_config_d .ppIfaceDesc = midi_interfaces, .bmAttributes = UC_BUS_POWERED, .bMaxPower = 25, /* 50 mA */ - .iConfiguration = INDEX_MIDI_PRODUCT, + .iConfiguration = MIDI_PRODUCT_INDEX, }; static const struct usb_temp_config_desc *midi_configs[] = { @@ -197,7 +201,7 @@ static const struct usb_temp_config_desc *midi_configs static usb_temp_get_string_desc_t midi_get_string_desc; -const struct usb_temp_device_desc usb_template_midi = { +struct usb_temp_device_desc usb_template_midi = { .getStringDesc = &midi_get_string_desc, .ppConfigDesc = midi_configs, .idVendor = USB_TEMPLATE_VENDOR, @@ -207,7 +211,7 @@ const struct usb_temp_device_desc usb_template_midi = .bDeviceSubClass = 0, .bDeviceProtocol = 0, .iManufacturer = 0, - .iProduct = INDEX_MIDI_PRODUCT, + .iProduct = MIDI_PRODUCT_INDEX, .iSerialNumber = 0, }; @@ -221,10 +225,10 @@ const struct usb_temp_device_desc usb_template_midi = static const void * midi_get_string_desc(uint16_t lang_id, uint8_t string_index) { - static const void *ptr[INDEX_MIDI_MAX] = { - [INDEX_MIDI_LANG] = &usb_string_lang_en, - [INDEX_MIDI_IF] = &string_midi_if, - [INDEX_MIDI_PRODUCT] = &string_midi_product, + static const void *ptr[MIDI_MAX_INDEX] = { + [MIDI_LANG_INDEX] = &usb_string_lang_en, + [MIDI_INTERFACE_INDEX] = &midi_interface, + [MIDI_PRODUCT_INDEX] = &midi_product, }; if (string_index == 0) { @@ -233,8 +237,54 @@ midi_get_string_desc(uint16_t lang_id, uint8_t string_ if (lang_id != 0x0409) { return (NULL); } - if (string_index < INDEX_MIDI_MAX) { + if (string_index < MIDI_MAX_INDEX) { return (ptr[string_index]); } return (NULL); } + +static void +midi_init(void *arg __unused) +{ + struct sysctl_oid *parent; + char parent_name[3]; + + usb_make_str_desc(&midi_interface, sizeof(midi_interface), + MIDI_DEFAULT_INTERFACE); + usb_make_str_desc(&midi_product, sizeof(midi_product), + MIDI_DEFAULT_PRODUCT); + + snprintf(parent_name, sizeof(parent_name), "%d", USB_TEMP_MIDI); + sysctl_ctx_init(&midi_ctx_list); + + parent = SYSCTL_ADD_NODE(&midi_ctx_list, + SYSCTL_STATIC_CHILDREN(_hw_usb_templates), OID_AUTO, + parent_name, CTLFLAG_RW, + 0, "USB MIDI device side template"); + SYSCTL_ADD_U16(&midi_ctx_list, SYSCTL_CHILDREN(parent), OID_AUTO, + "vendor_id", CTLFLAG_RWTUN, + &usb_template_midi.idVendor, 1, "Vendor identifier"); + SYSCTL_ADD_U16(&midi_ctx_list, SYSCTL_CHILDREN(parent), OID_AUTO, + "product_id", CTLFLAG_RWTUN, + &usb_template_midi.idProduct, 1, "Product identifier"); +#if 0 + SYSCTL_ADD_PROC(&midi_ctx_list, SYSCTL_CHILDREN(parent), OID_AUTO, + "interface", CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, + &midi_interface, sizeof(midi_interface), usb_temp_sysctl, + "A", "Interface string"); +#endif + SYSCTL_ADD_PROC(&midi_ctx_list, SYSCTL_CHILDREN(parent), OID_AUTO, + "product", CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, + &midi_product, sizeof(midi_product), usb_temp_sysctl, + "A", "Product string"); +} *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Jan 20 14:00:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 082E5ED2960; Sat, 20 Jan 2018 14:00:09 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D759A7B0D3; Sat, 20 Jan 2018 14:00:08 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2118F1D416; Sat, 20 Jan 2018 14:00:08 +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 w0KE07TL036399; Sat, 20 Jan 2018 14:00:07 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0KE07VW036398; Sat, 20 Jan 2018 14:00:07 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201801201400.w0KE07VW036398@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 20 Jan 2018 14:00:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328195 - head/sys/arm/conf X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/arm/conf X-SVN-Commit-Revision: 328195 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jan 2018 14:00:09 -0000 Author: trasz Date: Sat Jan 20 14:00:07 2018 New Revision: 328195 URL: https://svnweb.freebsd.org/changeset/base/328195 Log: Add usb_template(4) to RPI-B kernel config. This is to support the USB OTG functionality on Raspberry Pi 0. Reviewed by: hselasky@ MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D13924 Modified: head/sys/arm/conf/RPI-B Modified: head/sys/arm/conf/RPI-B ============================================================================== --- head/sys/arm/conf/RPI-B Sat Jan 20 13:58:34 2018 (r328194) +++ head/sys/arm/conf/RPI-B Sat Jan 20 14:00:07 2018 (r328195) @@ -46,6 +46,9 @@ device pty device snp device pl011 +# Device mode support +device usb_template # Control of the gadget + # Comment following lines for boot console on serial port device vt device kbdmux From owner-svn-src-head@freebsd.org Sat Jan 20 14:03:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8E8DED2CB9; Sat, 20 Jan 2018 14:03:56 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B250C7B524; Sat, 20 Jan 2018 14:03:56 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F027E1D5BC; Sat, 20 Jan 2018 14:03:55 +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 w0KE3tYf040163; Sat, 20 Jan 2018 14:03:55 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0KE3tb7040160; Sat, 20 Jan 2018 14:03:55 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201801201403.w0KE3tb7040160@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 20 Jan 2018 14:03:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328196 - head/sys/dev/usb/template X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/dev/usb/template X-SVN-Commit-Revision: 328196 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jan 2018 14:03:56 -0000 Author: trasz Date: Sat Jan 20 14:03:55 2018 New Revision: 328196 URL: https://svnweb.freebsd.org/changeset/base/328196 Log: Add missing SPDX tags; the rest of the license text is the same as in other USB templates. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/usb/template/usb_template_midi.c head/sys/dev/usb/template/usb_template_phone.c head/sys/dev/usb/template/usb_template_serialnet.c Modified: head/sys/dev/usb/template/usb_template_midi.c ============================================================================== --- head/sys/dev/usb/template/usb_template_midi.c Sat Jan 20 14:00:07 2018 (r328195) +++ head/sys/dev/usb/template/usb_template_midi.c Sat Jan 20 14:03:55 2018 (r328196) @@ -1,5 +1,7 @@ /* $FreeBSD$ */ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2015 Hans Petter Selasky * Copyright (c) 2018 The FreeBSD Foundation * All rights reserved. Modified: head/sys/dev/usb/template/usb_template_phone.c ============================================================================== --- head/sys/dev/usb/template/usb_template_phone.c Sat Jan 20 14:00:07 2018 (r328195) +++ head/sys/dev/usb/template/usb_template_phone.c Sat Jan 20 14:03:55 2018 (r328196) @@ -1,5 +1,7 @@ /* $FreeBSD$ */ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2014 Hans Petter Selasky * Copyright (c) 2018 The FreeBSD Foundation * All rights reserved. Modified: head/sys/dev/usb/template/usb_template_serialnet.c ============================================================================== --- head/sys/dev/usb/template/usb_template_serialnet.c Sat Jan 20 14:00:07 2018 (r328195) +++ head/sys/dev/usb/template/usb_template_serialnet.c Sat Jan 20 14:03:55 2018 (r328196) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2015 Ruslan Bukin * Copyright (c) 2018 The FreeBSD Foundation * All rights reserved. From owner-svn-src-head@freebsd.org Sat Jan 20 14:05:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41255ED2E46; Sat, 20 Jan 2018 14:05:57 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 13D0C7B6D9; Sat, 20 Jan 2018 14:05:57 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5126D1D5BE; Sat, 20 Jan 2018 14:05:56 +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 w0KE5uGD040285; Sat, 20 Jan 2018 14:05:56 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0KE5uir040284; Sat, 20 Jan 2018 14:05:56 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201801201405.w0KE5uir040284@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 20 Jan 2018 14:05:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328197 - head/sys/dev/usb/template X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/dev/usb/template X-SVN-Commit-Revision: 328197 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jan 2018 14:05:57 -0000 Author: trasz Date: Sat Jan 20 14:05:55 2018 New Revision: 328197 URL: https://svnweb.freebsd.org/changeset/base/328197 Log: Remove unused index. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/usb/template/usb_template_serialnet.c Modified: head/sys/dev/usb/template/usb_template_serialnet.c ============================================================================== --- head/sys/dev/usb/template/usb_template_serialnet.c Sat Jan 20 14:03:55 2018 (r328196) +++ head/sys/dev/usb/template/usb_template_serialnet.c Sat Jan 20 14:05:55 2018 (r328197) @@ -81,7 +81,6 @@ enum { SERIALNET_ETH_MAC_INDEX, SERIALNET_ETH_CONTROL_INDEX, SERIALNET_ETH_DATA_INDEX, - SERIALNET_ETH_CONFIG_INDEX, SERIALNET_CONFIGURATION_INDEX, SERIALNET_MANUFACTURER_INDEX, SERIALNET_PRODUCT_INDEX, From owner-svn-src-head@freebsd.org Sat Jan 20 14:47:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CCC1ED466A; Sat, 20 Jan 2018 14:47:29 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D90D47C92E; Sat, 20 Jan 2018 14:47:28 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2CAA21DC27; Sat, 20 Jan 2018 14:47:28 +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 w0KElRFQ056695; Sat, 20 Jan 2018 14:47:27 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0KElRXA056693; Sat, 20 Jan 2018 14:47:27 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201801201447.w0KElRXA056693@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 20 Jan 2018 14:47:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328198 - head/sys/dev/extres/clk X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/dev/extres/clk X-SVN-Commit-Revision: 328198 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jan 2018 14:47:29 -0000 Author: manu Date: Sat Jan 20 14:47:27 2018 New Revision: 328198 URL: https://svnweb.freebsd.org/changeset/base/328198 Log: clk: Get new parent freq after set_freq During set_freq a clknode might have reparent (using a better parent that have a higher frequency for example), before refreshing the cache, re-get the parent frequency. Reviewed by: mmel Modified: head/sys/dev/extres/clk/clk.c Modified: head/sys/dev/extres/clk/clk.c ============================================================================== --- head/sys/dev/extres/clk/clk.c Sat Jan 20 14:05:55 2018 (r328197) +++ head/sys/dev/extres/clk/clk.c Sat Jan 20 14:47:27 2018 (r328198) @@ -916,6 +916,14 @@ clknode_set_freq(struct clknode *clknode, uint64_t fre /* Success - invalidate frequency cache for all children. */ if ((flags & CLK_SET_DRYRUN) == 0) { clknode->freq = freq; + /* Clock might have reparent during set_freq */ + if (clknode->parent_cnt > 0) { + rv = clknode_get_freq(clknode->parent, + &parent_freq); + if (rv != 0) { + return (rv); + } + } clknode_refresh_cache(clknode, parent_freq); } } else if (clknode->parent != NULL) { From owner-svn-src-head@freebsd.org Sat Jan 20 14:59:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4ADDCEB2141; Sat, 20 Jan 2018 14:59:38 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 242EA7D14D; Sat, 20 Jan 2018 14:59:38 +0000 (UTC) (envelope-from royger@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 738D61DDC1; Sat, 20 Jan 2018 14:59:37 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0KExbEm061172; Sat, 20 Jan 2018 14:59:37 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0KExbTC061170; Sat, 20 Jan 2018 14:59:37 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201801201459.w0KExbTC061170@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Sat, 20 Jan 2018 14:59:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328199 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head X-SVN-Commit-Author: royger X-SVN-Commit-Paths: in head/sys: amd64/amd64 i386/i386 X-SVN-Commit-Revision: 328199 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jan 2018 14:59:38 -0000 Author: royger Date: Sat Jan 20 14:59:37 2018 New Revision: 328199 URL: https://svnweb.freebsd.org/changeset/base/328199 Log: xen: fix IDT setup after PTI On amd64 the IDT handler was not set correctly when using PTI. While there also fix the selectors to SEL_KPL. Obtained from: kib MFC with: r328083 Modified: head/sys/amd64/amd64/machdep.c head/sys/i386/i386/machdep.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Sat Jan 20 14:47:27 2018 (r328198) +++ head/sys/amd64/amd64/machdep.c Sat Jan 20 14:59:37 2018 (r328199) @@ -1667,7 +1667,8 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) &IDTVEC(dtrace_ret), SDT_SYSIGT, SEL_UPL, 0); #endif #ifdef XENHVM - setidt(IDT_EVTCHN, &IDTVEC(xen_intr_upcall), SDT_SYSIGT, SEL_UPL, 0); + setidt(IDT_EVTCHN, pti ? &IDTVEC(xen_intr_upcall_pti) : + &IDTVEC(xen_intr_upcall), SDT_SYSIGT, SEL_KPL, 0); #endif r_idt.rd_limit = sizeof(idt0) - 1; r_idt.rd_base = (long) idt; Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Sat Jan 20 14:47:27 2018 (r328198) +++ head/sys/i386/i386/machdep.c Sat Jan 20 14:59:37 2018 (r328199) @@ -2268,7 +2268,7 @@ init386(int first) GSEL(GCODE_SEL, SEL_KPL)); #endif #ifdef XENHVM - setidt(IDT_EVTCHN, &IDTVEC(xen_intr_upcall), SDT_SYS386IGT, SEL_UPL, + setidt(IDT_EVTCHN, &IDTVEC(xen_intr_upcall), SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); #endif From owner-svn-src-head@freebsd.org Sat Jan 20 15:37:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7436EEB408C; Sat, 20 Jan 2018 15:37:48 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4E7667E68B; Sat, 20 Jan 2018 15:37:48 +0000 (UTC) (envelope-from lwhsu@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 723D21E43B; Sat, 20 Jan 2018 15:37:47 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0KFblKV078038; Sat, 20 Jan 2018 15:37:47 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0KFblPD078037; Sat, 20 Jan 2018 15:37:47 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201801201537.w0KFblPD078037@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Sat, 20 Jan 2018 15:37:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328200 - head/usr.bin/hexdump X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/usr.bin/hexdump X-SVN-Commit-Revision: 328200 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jan 2018 15:37:48 -0000 Author: lwhsu (ports committer) Date: Sat Jan 20 15:37:47 2018 New Revision: 328200 URL: https://svnweb.freebsd.org/changeset/base/328200 Log: Silence the gcc warning: 'op' may be used uninitialized in this function Approved by: kevans Modified: head/usr.bin/hexdump/conv.c Modified: head/usr.bin/hexdump/conv.c ============================================================================== --- head/usr.bin/hexdump/conv.c Sat Jan 20 14:59:37 2018 (r328199) +++ head/usr.bin/hexdump/conv.c Sat Jan 20 15:37:47 2018 (r328200) @@ -58,6 +58,8 @@ conv_c(PR *pr, u_char *p, size_t bufsize) u_char peekbuf[MB_LEN_MAX]; u_char *op; + op = NULL; + if (pr->mbleft > 0) { str = "**"; pr->mbleft--; From owner-svn-src-head@freebsd.org Sat Jan 20 17:02:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C70BEB94E9; Sat, 20 Jan 2018 17:02:20 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E84E681AB0; Sat, 20 Jan 2018 17:02:19 +0000 (UTC) (envelope-from mmel@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 34AD01F1A8; Sat, 20 Jan 2018 17:02:19 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0KH2J74014890; Sat, 20 Jan 2018 17:02:19 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0KH2I4U014878; Sat, 20 Jan 2018 17:02:18 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201801201702.w0KH2I4U014878@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sat, 20 Jan 2018 17:02:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328201 - in head/sys: arm/allwinner arm/nvidia arm/nvidia/tegra124 conf dev/extres/phy dev/usb/controller X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: in head/sys: arm/allwinner arm/nvidia arm/nvidia/tegra124 conf dev/extres/phy dev/usb/controller X-SVN-Commit-Revision: 328201 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jan 2018 17:02:20 -0000 Author: mmel Date: Sat Jan 20 17:02:17 2018 New Revision: 328201 URL: https://svnweb.freebsd.org/changeset/base/328201 Log: Convert extres/phy to kobj model. Similarly as other extres pseudo-drivers, implement phy by using kobj model. This detaches it from provider device, so single device driver can export multiple different phys. Additionally, this allows phy to be subclassed to more specialized drivers, like is USB OTG phy, or PCIe phy with hot-plug capability. Tested by: manu (previous version, on Allwinner board) MFC after: 1 month Added: head/sys/dev/extres/phy/phydev_if.m (contents, props changed) head/sys/dev/extres/phy/phynode_if.m - copied, changed from r328200, head/sys/dev/extres/phy/phy_if.m Deleted: head/sys/dev/extres/phy/phy_if.m Modified: head/sys/arm/allwinner/a10_ehci.c head/sys/arm/allwinner/aw_usbphy.c head/sys/arm/nvidia/tegra124/tegra124_xusbpadctl.c head/sys/arm/nvidia/tegra_ahci.c head/sys/arm/nvidia/tegra_ehci.c head/sys/arm/nvidia/tegra_pcie.c head/sys/arm/nvidia/tegra_usbphy.c head/sys/arm/nvidia/tegra_xhci.c head/sys/conf/files head/sys/dev/extres/phy/phy.c head/sys/dev/extres/phy/phy.h head/sys/dev/usb/controller/generic_ohci.c Modified: head/sys/arm/allwinner/a10_ehci.c ============================================================================== --- head/sys/arm/allwinner/a10_ehci.c Sat Jan 20 15:37:47 2018 (r328200) +++ head/sys/arm/allwinner/a10_ehci.c Sat Jan 20 17:02:17 2018 (r328201) @@ -242,7 +242,7 @@ a10_ehci_attach(device_t self) /* Enable USB PHY */ if (phy_get_by_ofw_name(self, 0, "usb", &aw_sc->phy) == 0) { - err = phy_enable(self, aw_sc->phy); + err = phy_enable(aw_sc->phy); if (err != 0) { device_printf(self, "Could not enable phy\n"); goto error; Modified: head/sys/arm/allwinner/aw_usbphy.c ============================================================================== --- head/sys/arm/allwinner/aw_usbphy.c Sat Jan 20 15:37:47 2018 (r328200) +++ head/sys/arm/allwinner/aw_usbphy.c Sat Jan 20 17:02:17 2018 (r328201) @@ -51,7 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include "phy_if.h" +#include "phynode_if.h" enum awusbphy_type { AWUSBPHY_TYPE_A10 = 1, @@ -141,6 +141,16 @@ struct awusbphy_softc { struct aw_usbphy_conf *phy_conf; }; + /* Phy class and methods. */ +static int awusbphy_phy_enable(struct phynode *phy, bool enable); +static phynode_method_t awusbphy_phynode_methods[] = { + PHYNODEMETHOD(phynode_enable, awusbphy_phy_enable), + + PHYNODEMETHOD_END +}; +DEFINE_CLASS_1(awusbphy_phynode, awusbphy_phynode_class, awusbphy_phynode_methods, + 0, phynode_class); + #define RD4(res, o) bus_read_4(res, (o)) #define WR4(res, o, v) bus_write_4(res, (o), (v)) #define CLR4(res, o, m) WR4(res, o, RD4(res, o) & ~(m)) @@ -282,12 +292,16 @@ awusbphy_vbus_detect(device_t dev, int *val) } static int -awusbphy_phy_enable(device_t dev, intptr_t phy, bool enable) +awusbphy_phy_enable(struct phynode *phynode, bool enable) { + device_t dev; + intptr_t phy; struct awusbphy_softc *sc; regulator_t reg; int error, vbus_det; + dev = phynode_get_device(phynode); + phy = phynode_get_id(phynode); sc = device_get_softc(dev); if (phy < 0 || phy >= sc->phy_conf->num_phys) @@ -356,7 +370,12 @@ static int awusbphy_attach(device_t dev) { int error; + struct phynode *phynode; + struct phynode_init_def phy_init; + struct awusbphy_softc *sc; + int i; + sc = device_get_softc(dev); error = awusbphy_init(dev); if (error) { device_printf(dev, "failed to initialize USB PHY, error %d\n", @@ -364,7 +383,22 @@ awusbphy_attach(device_t dev) return (error); } - phy_register_provider(dev); + /* Create and register phys. */ + for (i = 0; i < sc->phy_conf->num_phys; i++) { + bzero(&phy_init, sizeof(phy_init)); + phy_init.id = i; + phy_init.ofw_node = ofw_bus_get_node(dev); + phynode = phynode_create(dev, &awusbphy_phynode_class, + &phy_init); + if (phynode == NULL) { + device_printf(dev, "failed to create USB PHY\n"); + return (ENXIO); + } + if (phynode_register(phynode) == NULL) { + device_printf(dev, "failed to create USB PHY\n"); + return (ENXIO); + } + } return (error); } @@ -373,9 +407,6 @@ static device_method_t awusbphy_methods[] = { /* Device interface */ DEVMETHOD(device_probe, awusbphy_probe), DEVMETHOD(device_attach, awusbphy_attach), - - /* PHY interface */ - DEVMETHOD(phy_enable, awusbphy_phy_enable), DEVMETHOD_END }; Modified: head/sys/arm/nvidia/tegra124/tegra124_xusbpadctl.c ============================================================================== --- head/sys/arm/nvidia/tegra124/tegra124_xusbpadctl.c Sat Jan 20 15:37:47 2018 (r328200) +++ head/sys/arm/nvidia/tegra124/tegra124_xusbpadctl.c Sat Jan 20 17:02:17 2018 (r328201) @@ -22,10 +22,11 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ +#include +__FBSDID("$FreeBSD$"); + #include #include #include @@ -50,7 +51,7 @@ #include -#include "phy_if.h" +#include "phydev_if.h" /* FUSE calibration data. */ #define FUSE_XUSB_CALIB 0x0F0 @@ -216,7 +217,6 @@ struct padctl_port { struct padctl_port *port); /* Runtime data. */ - phandle_t xref; bool enabled; regulator_t supply_vbus; /* USB2, USB3 */ bool internal; /* ULPI, USB2, USB3 */ @@ -303,7 +303,6 @@ struct padctl_lane { int nmux; /* Runtime data. */ bool enabled; - phandle_t xref; struct padctl_pad *pad; struct padctl_port *port; int mux_idx; @@ -353,6 +352,16 @@ static struct padctl_lane_map lane_map_tbl[] = { LANE_MAP(1, PADCTL_PAD_SATA, 0), /* port USB3-1 -> lane SATA-0 */ }; + /* Phy class and methods. */ +static int xusbpadctl_phy_enable(struct phynode *phy, bool enable); +static phynode_method_t xusbpadctl_phynode_methods[] = { + PHYNODEMETHOD(phynode_enable, xusbpadctl_phy_enable), + PHYNODEMETHOD_END + +}; +DEFINE_CLASS_1(xusbpadctl_phynode, xusbpadctl_phynode_class, + xusbpadctl_phynode_methods, 0, phynode_class); + static struct padctl_port *search_lane_port(struct padctl_softc *sc, struct padctl_lane *lane); /* ------------------------------------------------------------------------- @@ -683,13 +692,17 @@ phy_powerdown(struct padctl_softc *sc) } static int -xusbpadctl_phy_enable(device_t dev, intptr_t id, bool enable) +xusbpadctl_phy_enable(struct phynode *phy, bool enable) { + device_t dev; + intptr_t id; struct padctl_softc *sc; struct padctl_lane *lane; struct padctl_pad *pad; int rv; + dev = phynode_get_device(phy); + id = phynode_get_id(phy); sc = device_get_softc(dev); if (id < 0 || id >= nitems(lanes_tbl)) { @@ -731,24 +744,6 @@ xusbpadctl_phy_enable(device_t dev, intptr_t id, bool return (0); } -static int -xusbpadctl_phy_map(device_t provider, phandle_t xref, int ncells, - pcell_t *cells, intptr_t *id) -{ - int i; - - if (ncells != 0) - return (ERANGE); - - for (i = 0; i < nitems(lanes_tbl); i++) { - if (lanes_tbl[i].xref == xref) { - *id = i; - return (0); - } - } - return (ENXIO); -} - /* ------------------------------------------------------------------------- * * FDT processing @@ -871,6 +866,8 @@ static int process_lane(struct padctl_softc *sc, phandle_t node, struct padctl_pad *pad) { struct padctl_lane *lane; + struct phynode *phynode; + struct phynode_init_def phy_init; char *name; char *function; int rv; @@ -913,10 +910,25 @@ process_lane(struct padctl_softc *sc, phandle_t node, rv = ENXIO; goto end; } - lane->xref = OF_xref_from_node(node); lane->pad = pad; lane->enabled = true; pad->lanes[pad->nlanes++] = lane; + + /* Create and register phy. */ + bzero(&phy_init, sizeof(phy_init)); + phy_init.id = lane - lanes_tbl; + phy_init.ofw_node = node; + phynode = phynode_create(sc->dev, &xusbpadctl_phynode_class, &phy_init); + if (phynode == NULL) { + device_printf(sc->dev, "Cannot create phy\n"); + rv = ENXIO; + goto end; + } + if (phynode_register(phynode) == NULL) { + device_printf(sc->dev, "Cannot create phy\n"); + return (ENXIO); + } + rv = 0; end: @@ -930,7 +942,6 @@ end: static int process_pad(struct padctl_softc *sc, phandle_t node) { - phandle_t xref; struct padctl_pad *pad; char *name; int rv; @@ -963,9 +974,6 @@ process_pad(struct padctl_softc *sc, phandle_t node) rv = process_lane(sc, node, pad); if (rv != 0) goto end; - - xref = OF_xref_from_node(node); - OF_device_register_xref(xref, sc->dev); } pad->enabled = true; rv = 0; @@ -1193,10 +1201,6 @@ static device_method_t tegra_xusbpadctl_methods[] = { DEVMETHOD(device_probe, xusbpadctl_probe), DEVMETHOD(device_attach, xusbpadctl_attach), DEVMETHOD(device_detach, xusbpadctl_detach), - - /* phy interface */ - DEVMETHOD(phy_enable, xusbpadctl_phy_enable), - DEVMETHOD(phy_map, xusbpadctl_phy_map), DEVMETHOD_END }; Modified: head/sys/arm/nvidia/tegra_ahci.c ============================================================================== --- head/sys/arm/nvidia/tegra_ahci.c Sat Jan 20 15:37:47 2018 (r328200) +++ head/sys/arm/nvidia/tegra_ahci.c Sat Jan 20 17:02:17 2018 (r328201) @@ -371,7 +371,7 @@ enable_fdt_resources(struct tegra_ahci_sc *sc) return (rv); } - rv = phy_enable(sc->dev, sc->phy); + rv = phy_enable(sc->phy); if (rv != 0) { device_printf(sc->dev, "Cannot enable SATA phy\n"); return (rv); Modified: head/sys/arm/nvidia/tegra_ehci.c ============================================================================== --- head/sys/arm/nvidia/tegra_ehci.c Sat Jan 20 15:37:47 2018 (r328200) +++ head/sys/arm/nvidia/tegra_ehci.c Sat Jan 20 17:02:17 2018 (r328201) @@ -214,7 +214,7 @@ tegra_ehci_attach(device_t dev) goto out; } - rv = phy_enable(sc->dev, sc->phy); + rv = phy_enable(sc->phy); if (rv != 0) { device_printf(dev, "Cannot enable phy: %d\n", rv); goto out; Modified: head/sys/arm/nvidia/tegra_pcie.c ============================================================================== --- head/sys/arm/nvidia/tegra_pcie.c Sat Jan 20 15:37:47 2018 (r328200) +++ head/sys/arm/nvidia/tegra_pcie.c Sat Jan 20 17:02:17 2018 (r328201) @@ -1309,7 +1309,7 @@ tegra_pcib_enable(struct tegra_pcib_softc *sc) for (i = 0; i < TEGRA_PCIB_MAX_PORTS; i++) { if (sc->ports[i] != NULL) { - rv = phy_enable(sc->dev, sc->ports[i]->phy); + rv = phy_enable(sc->ports[i]->phy); if (rv != 0) { device_printf(sc->dev, "Cannot enable phy for port %d\n", Modified: head/sys/arm/nvidia/tegra_usbphy.c ============================================================================== --- head/sys/arm/nvidia/tegra_usbphy.c Sat Jan 20 15:37:47 2018 (r328200) +++ head/sys/arm/nvidia/tegra_usbphy.c Sat Jan 20 17:02:17 2018 (r328201) @@ -51,7 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include "phy_if.h" +#include "phynode_if.h" #define CTRL_ICUSB_CTRL 0x15c #define ICUSB_CTR_IC_ENB1 (1 << 3) @@ -299,6 +299,16 @@ static struct ofw_compat_data compat_data[] = { {NULL, 0}, }; + /* Phy controller class and methods. */ +static int usbphy_phy_enable(struct phynode *phy, bool enable); +static phynode_method_t usbphy_phynode_methods[] = { + PHYNODEMETHOD(phynode_enable, usbphy_phy_enable), + + PHYNODEMETHOD_END +}; +DEFINE_CLASS_1(usbphy_phynode, usbphy_phynode_class, usbphy_phynode_methods, + 0, phynode_class); + #define RD4(sc, offs) \ bus_read_4(sc->mem_res, offs) @@ -554,11 +564,13 @@ usbphy_utmi_disable(struct usbphy_softc *sc) } static int -usbphy_phy_enable(device_t dev, int id, bool enable) +usbphy_phy_enable(struct phynode *phy, bool enable) { + device_t dev; struct usbphy_softc *sc; int rv = 0; + dev = phynode_get_device(phy); sc = device_get_softc(dev); if (sc->ifc_type != USB_IFC_TYPE_UTMI) { @@ -700,9 +712,11 @@ usbphy_probe(device_t dev) static int usbphy_attach(device_t dev) { - struct usbphy_softc * sc; + struct usbphy_softc *sc; int rid, rv; phandle_t node; + struct phynode *phynode; + struct phynode_init_def phy_init; sc = device_get_softc(dev); sc->dev = dev; @@ -802,7 +816,20 @@ usbphy_attach(device_t dev) } } - phy_register_provider(dev); + /* Create and register phy. */ + bzero(&phy_init, sizeof(phy_init)); + phy_init.id = 1; + phy_init.ofw_node = node; + phynode = phynode_create(dev, &usbphy_phynode_class, &phy_init); + if (phynode == NULL) { + device_printf(sc->dev, "Cannot create phy\n"); + return (ENXIO); + } + if (phynode_register(phynode) == NULL) { + device_printf(sc->dev, "Cannot create phy\n"); + return (ENXIO); + } + return (0); } @@ -819,9 +846,6 @@ static device_method_t tegra_usbphy_methods[] = { DEVMETHOD(device_probe, usbphy_probe), DEVMETHOD(device_attach, usbphy_attach), DEVMETHOD(device_detach, usbphy_detach), - - /* phy interface */ - DEVMETHOD(phy_enable, usbphy_phy_enable), DEVMETHOD_END }; Modified: head/sys/arm/nvidia/tegra_xhci.c ============================================================================== --- head/sys/arm/nvidia/tegra_xhci.c Sat Jan 20 15:37:47 2018 (r328200) +++ head/sys/arm/nvidia/tegra_xhci.c Sat Jan 20 17:02:17 2018 (r328201) @@ -583,22 +583,22 @@ enable_fdt_resources(struct tegra_xhci_softc *sc) return (rv); } - rv = phy_enable(sc->dev, sc->phy_usb2_0); + rv = phy_enable(sc->phy_usb2_0); if (rv != 0) { device_printf(sc->dev, "Cannot enable USB2_0 phy\n"); return (rv); } - rv = phy_enable(sc->dev, sc->phy_usb2_1); + rv = phy_enable(sc->phy_usb2_1); if (rv != 0) { device_printf(sc->dev, "Cannot enable USB2_1 phy\n"); return (rv); } - rv = phy_enable(sc->dev, sc->phy_usb2_2); + rv = phy_enable(sc->phy_usb2_2); if (rv != 0) { device_printf(sc->dev, "Cannot enable USB2_2 phy\n"); return (rv); } - rv = phy_enable(sc->dev, sc->phy_usb3_0); + rv = phy_enable(sc->phy_usb3_0); if (rv != 0) { device_printf(sc->dev, "Cannot enable USB3_0 phy\n"); return (rv); Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Jan 20 15:37:47 2018 (r328200) +++ head/sys/conf/files Sat Jan 20 17:02:17 2018 (r328201) @@ -1732,7 +1732,8 @@ dev/extres/clk/clk_fixed.c optional ext_resources clk dev/extres/clk/clk_gate.c optional ext_resources clk fdt dev/extres/clk/clk_mux.c optional ext_resources clk fdt dev/extres/phy/phy.c optional ext_resources phy fdt -dev/extres/phy/phy_if.m optional ext_resources phy fdt +dev/extres/phy/phydev_if.m optional ext_resources phy fdt +dev/extres/phy/phynode_if.m optional ext_resources phy fdt dev/extres/hwreset/hwreset.c optional ext_resources hwreset fdt dev/extres/hwreset/hwreset_if.m optional ext_resources hwreset fdt dev/extres/regulator/regdev_if.m optional ext_resources regulator fdt Modified: head/sys/dev/extres/phy/phy.c ============================================================================== --- head/sys/dev/extres/phy/phy.c Sat Jan 20 15:37:47 2018 (r328200) +++ head/sys/dev/extres/phy/phy.c Sat Jan 20 17:02:17 2018 (r328201) @@ -22,15 +22,20 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ + + #include +__FBSDID("$FreeBSD$"); + #include "opt_platform.h" -#include #include #include +#include +#include #include +#include #include +#include #ifdef FDT #include @@ -39,88 +44,452 @@ #include -#include "phy_if.h" +#include "phydev_if.h" +MALLOC_DEFINE(M_PHY, "phy", "Phy framework"); + +/* Forward declarations. */ +struct phy; +struct phynode; + +typedef TAILQ_HEAD(phynode_list, phynode) phynode_list_t; +typedef TAILQ_HEAD(phy_list, phy) phy_list_t; + +/* Default phy methods. */ +static int phynode_method_init(struct phynode *phynode); +static int phynode_method_enable(struct phynode *phynode, bool disable); +static int phynode_method_status(struct phynode *phynode, int *status); + + +/* + * Phy controller methods. + */ +static phynode_method_t phynode_methods[] = { + PHYNODEMETHOD(phynode_init, phynode_method_init), + PHYNODEMETHOD(phynode_enable, phynode_method_enable), + PHYNODEMETHOD(phynode_status, phynode_method_status), + + PHYNODEMETHOD_END +}; +DEFINE_CLASS_0(phynode, phynode_class, phynode_methods, 0); + +/* + * Phy node + */ +struct phynode { + KOBJ_FIELDS; + + TAILQ_ENTRY(phynode) phylist_link; /* Global list entry */ + phy_list_t consumers_list; /* Consumers list */ + + + /* Details of this device. */ + const char *name; /* Globally unique name */ + + device_t pdev; /* Producer device_t */ + void *softc; /* Producer softc */ + intptr_t id; /* Per producer unique id */ +#ifdef FDT + phandle_t ofw_node; /* OFW node of phy */ +#endif + struct sx lock; /* Lock for this phy */ + int ref_cnt; /* Reference counter */ + int enable_cnt; /* Enabled counter */ +}; + struct phy { - device_t consumer_dev; /* consumer device*/ - device_t provider_dev; /* provider device*/ - uintptr_t phy_id; /* phy id */ + device_t cdev; /* consumer device*/ + struct phynode *phynode; + TAILQ_ENTRY(phy) link; /* Consumers list entry */ + + int enable_cnt; }; -MALLOC_DEFINE(M_PHY, "phy", "Phy framework"); +static phynode_list_t phynode_list = TAILQ_HEAD_INITIALIZER(phynode_list); +static struct sx phynode_topo_lock; +SX_SYSINIT(phy_topology, &phynode_topo_lock, "Phy topology lock"); + +#define PHY_TOPO_SLOCK() sx_slock(&phynode_topo_lock) +#define PHY_TOPO_XLOCK() sx_xlock(&phynode_topo_lock) +#define PHY_TOPO_UNLOCK() sx_unlock(&phynode_topo_lock) +#define PHY_TOPO_ASSERT() sx_assert(&phynode_topo_lock, SA_LOCKED) +#define PHY_TOPO_XASSERT() sx_assert(&phynode_topo_lock, SA_XLOCKED) + +#define PHYNODE_SLOCK(_sc) sx_slock(&((_sc)->lock)) +#define PHYNODE_XLOCK(_sc) sx_xlock(&((_sc)->lock)) +#define PHYNODE_UNLOCK(_sc) sx_unlock(&((_sc)->lock)) + +/* ---------------------------------------------------------------------------- + * + * Default phy methods for base class. + * + */ + +static int +phynode_method_init(struct phynode *phynode) +{ + + return (0); +} + +static int +phynode_method_enable(struct phynode *phynode, bool enable) +{ + + if (!enable) + return (ENXIO); + + return (0); +} + +static int +phynode_method_status(struct phynode *phynode, int *status) +{ + *status = PHY_STATUS_ENABLED; + return (0); +} + +/* ---------------------------------------------------------------------------- + * + * Internal functions. + * + */ +/* + * Create and initialize phy object, but do not register it. + */ +struct phynode * +phynode_create(device_t pdev, phynode_class_t phynode_class, + struct phynode_init_def *def) +{ + struct phynode *phynode; + + + /* Create object and initialize it. */ + phynode = malloc(sizeof(struct phynode), M_PHY, M_WAITOK | M_ZERO); + kobj_init((kobj_t)phynode, (kobj_class_t)phynode_class); + sx_init(&phynode->lock, "Phy node lock"); + + /* Allocate softc if required. */ + if (phynode_class->size > 0) { + phynode->softc = malloc(phynode_class->size, M_PHY, + M_WAITOK | M_ZERO); + } + + /* Rest of init. */ + TAILQ_INIT(&phynode->consumers_list); + phynode->id = def->id; + phynode->pdev = pdev; +#ifdef FDT + phynode->ofw_node = def->ofw_node; +#endif + + return (phynode); +} + +/* Register phy object. */ +struct phynode * +phynode_register(struct phynode *phynode) +{ + int rv; + +#ifdef FDT + if (phynode->ofw_node <= 0) + phynode->ofw_node = ofw_bus_get_node(phynode->pdev); + if (phynode->ofw_node <= 0) + return (NULL); +#endif + + rv = PHYNODE_INIT(phynode); + if (rv != 0) { + printf("PHYNODE_INIT failed: %d\n", rv); + return (NULL); + } + + PHY_TOPO_XLOCK(); + TAILQ_INSERT_TAIL(&phynode_list, phynode, phylist_link); + PHY_TOPO_UNLOCK(); +#ifdef FDT + OF_device_register_xref(OF_xref_from_node(phynode->ofw_node), + phynode->pdev); +#endif + return (phynode); +} + +static struct phynode * +phynode_find_by_id(device_t dev, intptr_t id) +{ + struct phynode *entry; + + PHY_TOPO_ASSERT(); + + TAILQ_FOREACH(entry, &phynode_list, phylist_link) { + if ((entry->pdev == dev) && (entry->id == id)) + return (entry); + } + + return (NULL); +} + +/* -------------------------------------------------------------------------- + * + * Phy providers interface + * + */ + +void * +phynode_get_softc(struct phynode *phynode) +{ + + return (phynode->softc); +} + +device_t +phynode_get_device(struct phynode *phynode) +{ + + return (phynode->pdev); +} + +intptr_t phynode_get_id(struct phynode *phynode) +{ + + return (phynode->id); +} + +#ifdef FDT +phandle_t +phynode_get_ofw_node(struct phynode *phynode) +{ + + return (phynode->ofw_node); +} +#endif + +/* -------------------------------------------------------------------------- + * + * Real consumers executive + * + */ + +/* + * Enable phy. + */ int -phy_init(device_t consumer, phy_t phy) +phynode_enable(struct phynode *phynode) { + int rv; - return (PHY_INIT(phy->provider_dev, phy->phy_id, true)); + PHY_TOPO_ASSERT(); + + PHYNODE_XLOCK(phynode); + if (phynode->enable_cnt == 0) { + rv = PHYNODE_ENABLE(phynode, true); + if (rv != 0) { + PHYNODE_UNLOCK(phynode); + return (rv); + } + } + phynode->enable_cnt++; + PHYNODE_UNLOCK(phynode); + return (0); } +/* + * Disable phy. + */ int -phy_deinit(device_t consumer, phy_t phy) +phynode_disable(struct phynode *phynode) { + int rv; - return (PHY_INIT(phy->provider_dev, phy->phy_id, false)); + PHY_TOPO_ASSERT(); + + PHYNODE_XLOCK(phynode); + if (phynode->enable_cnt == 1) { + rv = PHYNODE_ENABLE(phynode, false); + if (rv != 0) { + PHYNODE_UNLOCK(phynode); + return (rv); + } + } + phynode->enable_cnt--; + PHYNODE_UNLOCK(phynode); + return (0); } +/* + * Get phy status. (PHY_STATUS_*) + */ int -phy_enable(device_t consumer, phy_t phy) +phynode_status(struct phynode *phynode, int *status) { + int rv; - return (PHY_ENABLE(phy->provider_dev, phy->phy_id, true)); + PHY_TOPO_ASSERT(); + + PHYNODE_XLOCK(phynode); + rv = PHYNODE_STATUS(phynode, status); + PHYNODE_UNLOCK(phynode); + return (rv); } + /* -------------------------------------------------------------------------- + * + * Phy consumers interface. + * + */ + +/* Helper function for phy_get*() */ +static phy_t +phy_create(struct phynode *phynode, device_t cdev) +{ + struct phy *phy; + + PHY_TOPO_ASSERT(); + + phy = malloc(sizeof(struct phy), M_PHY, M_WAITOK | M_ZERO); + phy->cdev = cdev; + phy->phynode = phynode; + phy->enable_cnt = 0; + + PHYNODE_XLOCK(phynode); + phynode->ref_cnt++; + TAILQ_INSERT_TAIL(&phynode->consumers_list, phy, link); + PHYNODE_UNLOCK(phynode); + + return (phy); +} + int -phy_disable(device_t consumer, phy_t phy) +phy_enable(phy_t phy) { + int rv; + struct phynode *phynode; - return (PHY_ENABLE(phy->provider_dev, phy->phy_id, false)); + phynode = phy->phynode; + KASSERT(phynode->ref_cnt > 0, + ("Attempt to access unreferenced phy.\n")); + + PHY_TOPO_SLOCK(); + rv = phynode_enable(phynode); + if (rv == 0) + phy->enable_cnt++; + PHY_TOPO_UNLOCK(); + return (rv); } int -phy_status(device_t consumer, phy_t phy, int *value) +phy_disable(phy_t phy) { + int rv; + struct phynode *phynode; - return (PHY_STATUS(phy->provider_dev, phy->phy_id, value)); + phynode = phy->phynode; + KASSERT(phynode->ref_cnt > 0, + ("Attempt to access unreferenced phy.\n")); + KASSERT(phy->enable_cnt > 0, + ("Attempt to disable already disabled phy.\n")); + + PHY_TOPO_SLOCK(); + rv = phynode_disable(phynode); + if (rv == 0) + phy->enable_cnt--; + PHY_TOPO_UNLOCK(); + return (rv); } int +phy_status(phy_t phy, int *status) +{ + int rv; + struct phynode *phynode; + + phynode = phy->phynode; + KASSERT(phynode->ref_cnt > 0, + ("Attempt to access unreferenced phy.\n")); + + PHY_TOPO_SLOCK(); + rv = phynode_status(phynode, status); + PHY_TOPO_UNLOCK(); + return (rv); +} + +int phy_get_by_id(device_t consumer_dev, device_t provider_dev, intptr_t id, - phy_t *phy_out) + phy_t *phy) { - phy_t phy; + struct phynode *phynode; - /* Create handle */ - phy = malloc(sizeof(struct phy), M_PHY, - M_WAITOK | M_ZERO); - phy->consumer_dev = consumer_dev; - phy->provider_dev = provider_dev; - phy->phy_id = id; - *phy_out = phy; + PHY_TOPO_SLOCK(); + + phynode = phynode_find_by_id(provider_dev, id); + if (phynode == NULL) { + PHY_TOPO_UNLOCK(); + return (ENODEV); + } + *phy = phy_create(phynode, consumer_dev); + PHY_TOPO_UNLOCK(); + return (0); } void phy_release(phy_t phy) { + struct phynode *phynode; + + phynode = phy->phynode; + KASSERT(phynode->ref_cnt > 0, + ("Attempt to access unreferenced phy.\n")); + + PHY_TOPO_SLOCK(); + while (phy->enable_cnt > 0) { + phynode_disable(phynode); + phy->enable_cnt--; + } + PHYNODE_XLOCK(phynode); + TAILQ_REMOVE(&phynode->consumers_list, phy, link); + phynode->ref_cnt--; + PHYNODE_UNLOCK(phynode); + PHY_TOPO_UNLOCK(); + free(phy, M_PHY); } - #ifdef FDT -int phy_default_map(device_t provider, phandle_t xref, int ncells, +int phydev_default_ofw_map(device_t provider, phandle_t xref, int ncells, pcell_t *cells, intptr_t *id) { + struct phynode *entry; + phandle_t node; - if (ncells == 0) - *id = 1; - else if (ncells == 1) + /* Single device can register multiple subnodes. */ + if (ncells == 0) { + + node = OF_node_from_xref(xref); + PHY_TOPO_XLOCK(); + TAILQ_FOREACH(entry, &phynode_list, phylist_link) { + if ((entry->pdev == provider) && + (entry->ofw_node == node)) { + *id = entry->id; + PHY_TOPO_UNLOCK(); + return (0); + } + } + PHY_TOPO_UNLOCK(); + return (ERANGE); + } + + /* First cell is ID. */ + if (ncells == 1) { *id = cells[0]; - else - return (ERANGE); + return (0); + } - return (0); + /* No default way how to get ID, custom mapper is required. */ + return (ERANGE); } int @@ -151,7 +520,7 @@ phy_get_by_ofw_idx(device_t consumer_dev, phandle_t cn return (ENODEV); } /* Map phy to number. */ - rv = PHY_MAP(phydev, xnode, ncells, cells, &id); + rv = PHYDEV_MAP(phydev, xnode, ncells, cells, &id); OF_prop_free(cells); if (rv != 0) return (rv); @@ -206,33 +575,11 @@ phy_get_by_ofw_property(device_t consumer_dev, phandle return (ENODEV); } /* Map phy to number. */ - rv = PHY_MAP(phydev, cells[0], ncells - 1 , cells + 1, &id); + rv = PHYDEV_MAP(phydev, cells[0], ncells - 1 , cells + 1, &id); OF_prop_free(cells); if (rv != 0) return (rv); return (phy_get_by_id(consumer_dev, phydev, id, phy)); -} - -void -phy_register_provider(device_t provider_dev) -{ - phandle_t xref, node; - - node = ofw_bus_get_node(provider_dev); - if (node <= 0) - panic("%s called on not ofw based device.\n", __func__); - - xref = OF_xref_from_node(node); - OF_device_register_xref(xref, provider_dev); -} - -void -phy_unregister_provider(device_t provider_dev) -{ - phandle_t xref; - - xref = OF_xref_from_device(provider_dev); - OF_device_register_xref(xref, NULL); } #endif Modified: head/sys/dev/extres/phy/phy.h ============================================================================== --- head/sys/dev/extres/phy/phy.h Sat Jan 20 15:37:47 2018 (r328200) +++ head/sys/dev/extres/phy/phy.h Sat Jan 20 17:02:17 2018 (r328201) @@ -27,21 +27,49 @@ #ifndef DEV_EXTRES_PHY_H #define DEV_EXTRES_PHY_H - #include "opt_platform.h" -#include + +#include #ifdef FDT *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Jan 20 17:46:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4112EBC07C; Sat, 20 Jan 2018 17:46:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9FF268355E; Sat, 20 Jan 2018 17:46:10 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F236D1F92B; Sat, 20 Jan 2018 17:46:09 +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 w0KHk9pi032222; Sat, 20 Jan 2018 17:46:09 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0KHk9x8032221; Sat, 20 Jan 2018 17:46:09 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201801201746.w0KHk9x8032221@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 20 Jan 2018 17:46:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328202 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 328202 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jan 2018 17:46:10 -0000 Author: kib Date: Sat Jan 20 17:46:09 2018 New Revision: 328202 URL: https://svnweb.freebsd.org/changeset/base/328202 Log: Use predefined symbol for the CR3.PCID mask. Sponsored by: The FreeBSD Foundation MFC after: 11 days Modified: head/sys/amd64/amd64/trap.c Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Sat Jan 20 17:02:17 2018 (r328201) +++ head/sys/amd64/amd64/trap.c Sat Jan 20 17:46:09 2018 (r328202) @@ -707,8 +707,8 @@ trap_pfault(struct trapframe *frame, int usermode) */ if (pti && usermode && pg_nx != 0 && (frame->tf_err & (PGEX_P | PGEX_W | PGEX_U | PGEX_I)) == (PGEX_P | PGEX_U | PGEX_I) && - (curpcb->pcb_saved_ucr3 & ~(PMAP_PCID_OVERMAX - 1))== - (PCPU_GET(curpmap)->pm_cr3 & ~(PMAP_PCID_OVERMAX - 1))) + (curpcb->pcb_saved_ucr3 & ~PMAP_PCID_MASK)== + (PCPU_GET(curpmap)->pm_cr3 & ~PMAP_PCID_MASK)) panic("PTI: pid %d comm %s tf_err %#lx\n", p->p_pid, p->p_comm, frame->tf_err); From owner-svn-src-head@freebsd.org Sat Jan 20 17:50:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0880EBC559; Sat, 20 Jan 2018 17:50:49 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) (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 42C7E83C96; Sat, 20 Jan 2018 17:50:48 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from thor.intern.walstatt.dynvpn.de ([92.227.32.169]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0Ln8Tl-1fJTAp1RHR-00hPCw; Sat, 20 Jan 2018 18:50:46 +0100 Date: Sat, 20 Jan 2018 18:50:09 +0100 From: "O. Hartmann" To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r328202 - head/sys/amd64/amd64 Message-ID: <20180120185036.56380a83@thor.intern.walstatt.dynvpn.de> In-Reply-To: <201801201746.w0KHk9x8032221@repo.freebsd.org> References: <201801201746.w0KHk9x8032221@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_/QW4TPOqUrhxtd=WE+5Ydlo2"; protocol="application/pgp-signature" X-Provags-ID: V03:K0:dNzK7enb5c342MSJynlWgXP3ZMhhqKX1ai5kKZx8tD/yTk3TUc2 NUT0NV4+PBPJZCvKALEiiaatPwxAatchC4n3+VHretqA/4+/3valnYeXgrfDAQvDbek771d m12sdIjWo83sUhQtjBbIFD1DnnRuVnJ/JxYUkRjbj2osHYJWsUn+tRCU1YbwFZFnOJlygR0 vFD/fZMY+TUZ3tAJVqm3Q== X-UI-Out-Filterresults: notjunk:1;V01:K0:EslQgLzn7sY=:VAcn76gms/dQz3PILOWgj/ RiJpzPd+ufdLH33BoQgKzDP5q/IFwc0mcZFRQYPr++A0zChKAZ3yI78+sTmnjOrFZgMtmDDT4 dk5k00Mq48KUCRPJ27mc+Q47x/zLFTZ6y26QP2CSEliNEuELzQZBSYuCCp8ssx38knGoDNnUE wg9n8KyZ9aDZoxGwPaNJ4HcTXQ/mrUKUu84yK+VABSLsoiQAgMDW6gYUVINAzkTFdknKAI06O /yNbhPx/JG1zTZRwfGy7Yh0QEtmep4SKp3R6o9HN6jeeuijG5mIeERj/ekkORFO+dIPW5RFst MfNjtzF793B+Zlzx9itxYxeGS6dLGp9eb+d3zmTlQ+DYbrcaYBNvK86k1LhX/Bk4P8OqR5ODp C4c2aXBIm5d7wu4apDtNlO0B3YHCBYR0iq0pYh2E4AxUqxWbl/UtdLOXU02AjNJZPLxXz2WB9 MyRdHA5AtqPN2C/T9edGSkXAOdqcQOS/isRY35J5nZKIqiG6OW2+NlHiz/C5ZSkv2wtVoq8nt XC3QPj9Y6jf0TpoEuzBb1zKje3hGwwj0wUTwCDnl9WEhcltR2OVqiaM8npPdV8l8iSisQT+Sz E8iwNcGAXL+jyKFu75hDZ+aEoHHijBUADQ0QAYnwlnT+tOrWoTfKGDlDSEtYARz0tPUHPqgfd Ba5hHewh6q6KmTbPgnGvSfyscD0T9PXz2OUyQSFKFOaxSAC+F5+2NmvfVqUyrEQ4uPpkFPeF+ ZGt+b/soz/p1iQk89Hxq84NFbjvRLrrlRN/vwdWNXMnnKla7mrmfAPeIA6fevphUhsXbFfpyi tYCbNogusEARZPH0LFvPdYhJTQAGQ== X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jan 2018 17:50:49 -0000 --Sig_/QW4TPOqUrhxtd=WE+5Ydlo2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Am Sat, 20 Jan 2018 17:46:09 +0000 (UTC) Konstantin Belousov schrieb: > Author: kib > Date: Sat Jan 20 17:46:09 2018 > New Revision: 328202 > URL: https://svnweb.freebsd.org/changeset/base/328202 >=20 > Log: > Use predefined symbol for the CR3.PCID mask. > =20 > Sponsored by: The FreeBSD Foundation > MFC after: 11 days >=20 > Modified: > head/sys/amd64/amd64/trap.c >=20 > Modified: head/sys/amd64/amd64/trap.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/amd64/amd64/trap.c Sat Jan 20 17:02:17 2018 (r328201) > +++ head/sys/amd64/amd64/trap.c Sat Jan 20 17:46:09 2018 (r328202) > @@ -707,8 +707,8 @@ trap_pfault(struct trapframe *frame, int usermode) > */ > if (pti && usermode && pg_nx !=3D 0 && (frame->tf_err & (PGEX_P | PGEX_= W | > PGEX_U | PGEX_I)) =3D=3D (PGEX_P | PGEX_U | PGEX_I) && > - (curpcb->pcb_saved_ucr3 & ~(PMAP_PCID_OVERMAX - 1))=3D=3D > - (PCPU_GET(curpmap)->pm_cr3 & ~(PMAP_PCID_OVERMAX - 1))) > + (curpcb->pcb_saved_ucr3 & ~PMAP_PCID_MASK)=3D=3D > + (PCPU_GET(curpmap)->pm_cr3 & ~PMAP_PCID_MASK)) > panic("PTI: pid %d comm %s tf_err %#lx\n", p->p_pid, > p->p_comm, frame->tf_err); > =20 > _______________________________________________ > 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" This commit breaks buildkernel: [...] /usr/src/sys/amd64/amd64/trap.c:710:33: error: use of undeclared identifier 'PMAP_PCID_MASK' (curpcb->pcb_saved_ucr3 & ~PMAP_PCID_MASK)=3D=3D ^ /usr/src/sys/amd64/amd64/trap.c:711:36: error: use of undeclared identifier 'PMAP_PCID_MASK' (PCPU_GET(curpmap)->pm_cr3 & ~PMAP_PCID_MASK)) ^ 2 errors generated. --- modules-all --- --- all_subdir_ath_rate --- =3D=3D=3D> ath_rate (all) --- all_subdir_ata --- --- all_subdir_ata/atapci/chipsets/atanational --- =3D=3D=3D> ata/atapci/chipsets/atanational (all) --- trap.o --- *** [trap.o] Error code 1 --=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_/QW4TPOqUrhxtd=WE+5Ydlo2 Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iLUEARMKAB0WIQQZVZMzAtwC2T/86TrS528fyFhYlAUCWmOBbAAKCRDS528fyFhY lGKjAfwPO9zksOKvaT16wlRNfAEKpq/ak/ofnS2o4wfjDrP6w7DMWk2fhS9m8+DU NlTa5oAzW7NhbAFYQzTSOr2CN/8DAgCIbAapS4wlPgM8upgucv7TYu5Pe2dxB+Nn A7PoJlBkWWL1qqrIr/ckrbbu7fF5rlduvo6zXvnhvVjEHOyMtSu1 =+gKF -----END PGP SIGNATURE----- --Sig_/QW4TPOqUrhxtd=WE+5Ydlo2-- From owner-svn-src-head@freebsd.org Sat Jan 20 18:05:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5461CEBD21F; Sat, 20 Jan 2018 18:05:15 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2DB96D14; Sat, 20 Jan 2018 18:05:15 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 72EC31FC7B; Sat, 20 Jan 2018 18:05: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 w0KI5EIi041306; Sat, 20 Jan 2018 18:05:14 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0KI5EL2041305; Sat, 20 Jan 2018 18:05:14 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201801201805.w0KI5EL2041305@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 20 Jan 2018 18:05:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328205 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 328205 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jan 2018 18:05:15 -0000 Author: kib Date: Sat Jan 20 18:05:14 2018 New Revision: 328205 URL: https://svnweb.freebsd.org/changeset/base/328205 Log: Use correct symbol name in r328202. Sponsored by: The FreeBSD Foundation MFC after: 11 days Modified: head/sys/amd64/amd64/trap.c Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Sat Jan 20 18:04:08 2018 (r328204) +++ head/sys/amd64/amd64/trap.c Sat Jan 20 18:05:14 2018 (r328205) @@ -707,8 +707,8 @@ trap_pfault(struct trapframe *frame, int usermode) */ if (pti && usermode && pg_nx != 0 && (frame->tf_err & (PGEX_P | PGEX_W | PGEX_U | PGEX_I)) == (PGEX_P | PGEX_U | PGEX_I) && - (curpcb->pcb_saved_ucr3 & ~PMAP_PCID_MASK)== - (PCPU_GET(curpmap)->pm_cr3 & ~PMAP_PCID_MASK)) + (curpcb->pcb_saved_ucr3 & ~CR3_PCID_MASK)== + (PCPU_GET(curpmap)->pm_cr3 & ~CR3_PCID_MASK)) panic("PTI: pid %d comm %s tf_err %#lx\n", p->p_pid, p->p_comm, frame->tf_err); From owner-svn-src-head@freebsd.org Sat Jan 20 18:06:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80949EBD308; Sat, 20 Jan 2018 18:06:03 +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 15CCCE9D; Sat, 20 Jan 2018 18:06:02 +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 w0KI5sTB031936 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 20 Jan 2018 20:05:58 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w0KI5sTB031936 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w0KI5sqr031935; Sat, 20 Jan 2018 20:05:54 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 20 Jan 2018 20:05:54 +0200 From: Konstantin Belousov To: "O. Hartmann" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r328202 - head/sys/amd64/amd64 Message-ID: <20180120180554.GW55707@kib.kiev.ua> References: <201801201746.w0KHk9x8032221@repo.freebsd.org> <20180120185036.56380a83@thor.intern.walstatt.dynvpn.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180120185036.56380a83@thor.intern.walstatt.dynvpn.de> 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-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jan 2018 18:06:03 -0000 On Sat, Jan 20, 2018 at 06:50:09PM +0100, O. Hartmann wrote: > This commit breaks buildkernel: > > > [...] > /usr/src/sys/amd64/amd64/trap.c:710:33: error: use of undeclared identifier > 'PMAP_PCID_MASK' (curpcb->pcb_saved_ucr3 & ~PMAP_PCID_MASK)== This should be fixed by r328205. From owner-svn-src-head@freebsd.org Sat Jan 20 18:27:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D00C1EBE971; Sat, 20 Jan 2018 18:27:01 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AAA1E1EF9; Sat, 20 Jan 2018 18:27: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0562F1FFB0; Sat, 20 Jan 2018 18:27:01 +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 w0KIR0MI049588; Sat, 20 Jan 2018 18:27:00 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0KIR0Li049587; Sat, 20 Jan 2018 18:27:00 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201801201827.w0KIR0Li049587@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 20 Jan 2018 18:27:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328206 - head/usr.bin/limits X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/limits X-SVN-Commit-Revision: 328206 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jan 2018 18:27:01 -0000 Author: eadler Date: Sat Jan 20 18:27:00 2018 New Revision: 328206 URL: https://svnweb.freebsd.org/changeset/base/328206 Log: limits(1): add missing break Reported by: swildner@DragonFlyBSD.org MFC After: 1 week Modified: head/usr.bin/limits/limits.c Modified: head/usr.bin/limits/limits.c ============================================================================== --- head/usr.bin/limits/limits.c Sat Jan 20 18:05:14 2018 (r328205) +++ head/usr.bin/limits/limits.c Sat Jan 20 18:27:00 2018 (r328206) @@ -608,6 +608,7 @@ resource_num(int which, int ch, const char *str) break; case 'w': case 'W': /* weeks */ tim *= (60L * 60L * 24L * 7L); + break; case 'y': case 'Y': /* Years */ tim *= (60L * 60L * 24L * 365L); } From owner-svn-src-head@freebsd.org Sat Jan 20 19:04:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20BF8EC0989; Sat, 20 Jan 2018 19:04:23 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F0AA83752; Sat, 20 Jan 2018 19:04:22 +0000 (UTC) (envelope-from dumbbell@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 44C5420641; Sat, 20 Jan 2018 19:04:22 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0KJ4MQD066061; Sat, 20 Jan 2018 19:04:22 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0KJ4MGe066060; Sat, 20 Jan 2018 19:04:22 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201801201904.w0KJ4MGe066060@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= Date: Sat, 20 Jan 2018 19:04:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328208 - head/sys/dev/atkbdc X-SVN-Group: head X-SVN-Commit-Author: dumbbell X-SVN-Commit-Paths: head/sys/dev/atkbdc X-SVN-Commit-Revision: 328208 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jan 2018 19:04:23 -0000 Author: dumbbell Date: Sat Jan 20 19:04:21 2018 New Revision: 328208 URL: https://svnweb.freebsd.org/changeset/base/328208 Log: psm: Log syncmask[1], not syncmask[0] twice MFC after: 1 week Modified: head/sys/dev/atkbdc/psm.c Modified: head/sys/dev/atkbdc/psm.c ============================================================================== --- head/sys/dev/atkbdc/psm.c Sat Jan 20 18:44:20 2018 (r328207) +++ head/sys/dev/atkbdc/psm.c Sat Jan 20 19:04:21 2018 (r328208) @@ -2978,7 +2978,7 @@ psmintr(void *arg) sc->flags &= ~PSM_NEED_SYNCBITS; VLOG(2, (LOG_DEBUG, "psmintr: Sync bytes now %04x,%04x\n", - sc->mode.syncmask[0], sc->mode.syncmask[0])); + sc->mode.syncmask[0], sc->mode.syncmask[1])); } else if ((sc->config & PSM_CONFIG_NOCHECKSYNC) == 0 && (c & sc->mode.syncmask[0]) != sc->mode.syncmask[1]) { VLOG(3, (LOG_DEBUG, "psmintr: out of sync " From owner-svn-src-head@freebsd.org Sat Jan 20 22:24:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5AED1ECA1B4; Sat, 20 Jan 2018 22:24:47 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 336476DC43; Sat, 20 Jan 2018 22:24: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3B2FF227CA; Sat, 20 Jan 2018 22:24:46 +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 w0KMOkPI050298; Sat, 20 Jan 2018 22:24:46 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0KMOkZf050297; Sat, 20 Jan 2018 22:24:46 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201801202224.w0KMOkZf050297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 20 Jan 2018 22:24:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328209 - head/share/termcap X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/share/termcap X-SVN-Commit-Revision: 328209 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jan 2018 22:24:47 -0000 Author: eadler Date: Sat Jan 20 22:24:45 2018 New Revision: 328209 URL: https://svnweb.freebsd.org/changeset/base/328209 Log: termcap: add xterm-termite Obtained from: DragonFly MFC After: 1 week Modified: head/share/termcap/termcap Modified: head/share/termcap/termcap ============================================================================== --- head/share/termcap/termcap Sat Jan 20 19:04:21 2018 (r328208) +++ head/share/termcap/termcap Sat Jan 20 22:24:45 2018 (r328209) @@ -4662,6 +4662,27 @@ Eterm|Eterm Terminal Emulator (X11 Window System):\ :us=\E[4m:vb=\E[?5h\E[?5l:ve=\E[?25h:vi=\E[?25l:\ :ac=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~: +# Termcap for xterm-termite +xterm-termite|VTE-based terminal:\ + :NP:am:hs:mi:ms:ut:xn:\ + :Co#256:co#80:it#8:li#24:pa#32767:\ + :@7=\EOF:@8=\EOM:AB=\E[48;5;%dm:AF=\E[38;5;%dm:AL=\E[%dL:\ + :DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:F1=\E[23~:F2=\E[24~:\ + :IC=\E[%d@:K2=\EOE:Km=\E[M:LE=\E[%dD:RA=\E[?7l:RI=\E[%dC:\ + :SA=\E[?7h:SF=\E[%dS:SR=\E[%dT:UP=\E[%dA:ZH=\E[3m:\ + :ZR=\E[23m:al=\E[L:bl=^G:bt=\E[Z:cb=\E[1K:cd=\E[J:ce=\E[K:\ + :ch=\E[%i%dG:cl=\E[H\E[J:cm=\E[%i%d;%dH:cr=^M:\ + :cs=\E[%i%d;%dr:cv=\E[%i%dd:dc=\E[P:dl=\E[M:do=^J:\ + :ds=\E]2;\007:ec=\E[%dX:ei=\E[4l:fs=^G:ho=\E[H:im=\E[4h:\ + :k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:k5=\E[15~:k6=\E[17~:\ + :k7=\E[18~:k8=\E[19~:k9=\E[20~:k;=\E[21~:kB=\E[Z:kD=\E[3~:\ + :kI=\E[2~:kN=\E[6~:kP=\E[5~:kb=\177:kd=\EOB:ke=\E[?1l:\ + :kh=\EOH:kl=\EOD:kr=\EOC:ks=\E[?1h:ku=\EOA:le=^H:md=\E[1m:\ + :me=\E[m:mr=\E[7m:nd=\E[C:op=\E[39;49m:r1=\Ec:rc=\E8:\ + :sc=\E7:se=\E[27m:sf=^J:so=\E[7m:sr=\EM:ta=^I:te=\E[?1049l:\ + :ti=\E[?1049h:ts=\E]2;:u6=\E[%i%d;%dR:u7=\E[6n:ue=\E[24m:\ + :up=\E[A:us=\E[4m:ve=\E[?25h:vi=\E[?25l: + # # END OF TERMCAP # ------------------------