From owner-svn-src-vendor@freebsd.org Tue Sep 15 18:55:41 2020 Return-Path: Delivered-To: svn-src-vendor@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 319253DCA9F; Tue, 15 Sep 2020 18:55:41 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BrXVj0mlDz4Th7; Tue, 15 Sep 2020 18:55: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 ED743CE8F; Tue, 15 Sep 2020 18:55: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 08FIteAO040542; Tue, 15 Sep 2020 18:55:40 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08FItcHO040527; Tue, 15 Sep 2020 18:55:38 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009151855.08FItcHO040527@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 15 Sep 2020 18:55:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r365757 - in vendor/llvm-project/release-11.x: clang/include/clang/AST clang/include/clang/Basic clang/lib/AST clang/lib/Basic clang/lib/CodeGen clang/lib/Driver/ToolChains clang/lib/Dr... X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/llvm-project/release-11.x: clang/include/clang/AST clang/include/clang/Basic clang/lib/AST clang/lib/Basic clang/lib/CodeGen clang/lib/Driver/ToolChains clang/lib/Driver/ToolChains/Arch clan... X-SVN-Commit-Revision: 365757 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 18:55:41 -0000 Author: dim Date: Tue Sep 15 18:55:37 2020 New Revision: 365757 URL: https://svnweb.freebsd.org/changeset/base/365757 Log: Vendor import of llvm-project branch release/11.x llvmorg-11.0.0-rc2-91-g6e042866c30. Modified: vendor/llvm-project/release-11.x/clang/include/clang/AST/ASTContext.h vendor/llvm-project/release-11.x/clang/include/clang/Basic/DiagnosticSemaKinds.td vendor/llvm-project/release-11.x/clang/lib/AST/ASTContext.cpp vendor/llvm-project/release-11.x/clang/lib/AST/DeclBase.cpp vendor/llvm-project/release-11.x/clang/lib/AST/ItaniumMangle.cpp vendor/llvm-project/release-11.x/clang/lib/Basic/Targets.cpp vendor/llvm-project/release-11.x/clang/lib/CodeGen/CGDebugInfo.cpp vendor/llvm-project/release-11.x/clang/lib/CodeGen/CGOpenMPRuntime.cpp vendor/llvm-project/release-11.x/clang/lib/CodeGen/CGOpenMPRuntime.h vendor/llvm-project/release-11.x/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp vendor/llvm-project/release-11.x/clang/lib/CodeGen/CodeGenTypes.cpp vendor/llvm-project/release-11.x/clang/lib/Driver/ToolChains/Arch/Sparc.cpp vendor/llvm-project/release-11.x/clang/lib/Driver/ToolChains/Clang.cpp vendor/llvm-project/release-11.x/clang/lib/Driver/ToolChains/OpenBSD.cpp vendor/llvm-project/release-11.x/clang/lib/Driver/ToolChains/OpenBSD.h vendor/llvm-project/release-11.x/clang/lib/Format/TokenAnnotator.cpp vendor/llvm-project/release-11.x/clang/lib/Frontend/InitHeaderSearch.cpp vendor/llvm-project/release-11.x/clang/lib/Headers/altivec.h vendor/llvm-project/release-11.x/clang/lib/Sema/SemaChecking.cpp vendor/llvm-project/release-11.x/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp vendor/llvm-project/release-11.x/clang/lib/Sema/SemaType.cpp vendor/llvm-project/release-11.x/clang/lib/Serialization/ASTReaderDecl.cpp vendor/llvm-project/release-11.x/clang/lib/StaticAnalyzer/Checkers/CastValueChecker.cpp vendor/llvm-project/release-11.x/clang/lib/StaticAnalyzer/Core/DynamicType.cpp vendor/llvm-project/release-11.x/compiler-rt/lib/builtins/clear_cache.c vendor/llvm-project/release-11.x/compiler-rt/lib/builtins/cpu_model.c vendor/llvm-project/release-11.x/compiler-rt/lib/profile/GCDAProfiling.c vendor/llvm-project/release-11.x/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.h vendor/llvm-project/release-11.x/libunwind/src/AddressSpace.hpp vendor/llvm-project/release-11.x/lld/COFF/Writer.cpp vendor/llvm-project/release-11.x/lld/ELF/DWARF.cpp vendor/llvm-project/release-11.x/lld/ELF/DWARF.h vendor/llvm-project/release-11.x/lld/ELF/LinkerScript.cpp vendor/llvm-project/release-11.x/lld/ELF/LinkerScript.h vendor/llvm-project/release-11.x/lld/ELF/OutputSections.cpp vendor/llvm-project/release-11.x/lld/ELF/SyntheticSections.cpp vendor/llvm-project/release-11.x/lld/docs/ELF/linker_script.rst vendor/llvm-project/release-11.x/lld/docs/ReleaseNotes.rst vendor/llvm-project/release-11.x/lldb/source/Target/Target.cpp vendor/llvm-project/release-11.x/llvm/include/llvm/ADT/CoalescingBitVector.h vendor/llvm-project/release-11.x/llvm/include/llvm/Analysis/InstructionSimplify.h vendor/llvm-project/release-11.x/llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h vendor/llvm-project/release-11.x/llvm/include/llvm/IR/IRBuilder.h vendor/llvm-project/release-11.x/llvm/lib/Analysis/InstructionSimplify.cpp vendor/llvm-project/release-11.x/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp vendor/llvm-project/release-11.x/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp vendor/llvm-project/release-11.x/llvm/lib/CodeGen/MachineCopyPropagation.cpp vendor/llvm-project/release-11.x/llvm/lib/CodeGen/RegAllocFast.cpp vendor/llvm-project/release-11.x/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp vendor/llvm-project/release-11.x/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp vendor/llvm-project/release-11.x/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp vendor/llvm-project/release-11.x/llvm/lib/CodeGen/TargetLoweringBase.cpp vendor/llvm-project/release-11.x/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp vendor/llvm-project/release-11.x/llvm/lib/IR/IRBuilder.cpp vendor/llvm-project/release-11.x/llvm/lib/IR/LegacyPassManager.cpp vendor/llvm-project/release-11.x/llvm/lib/Support/X86TargetParser.cpp vendor/llvm-project/release-11.x/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp vendor/llvm-project/release-11.x/llvm/lib/Target/AArch64/SVEInstrFormats.td vendor/llvm-project/release-11.x/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp vendor/llvm-project/release-11.x/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp vendor/llvm-project/release-11.x/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h vendor/llvm-project/release-11.x/llvm/lib/Target/PowerPC/PPCBoolRetToInt.cpp vendor/llvm-project/release-11.x/llvm/lib/Target/PowerPC/PPCISelLowering.cpp vendor/llvm-project/release-11.x/llvm/lib/Target/PowerPC/PPCInstr64Bit.td vendor/llvm-project/release-11.x/llvm/lib/Target/PowerPC/PPCMIPeephole.cpp vendor/llvm-project/release-11.x/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp vendor/llvm-project/release-11.x/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp Modified: vendor/llvm-project/release-11.x/clang/include/clang/AST/ASTContext.h ============================================================================== --- vendor/llvm-project/release-11.x/clang/include/clang/AST/ASTContext.h Tue Sep 15 17:13:29 2020 (r365756) +++ vendor/llvm-project/release-11.x/clang/include/clang/AST/ASTContext.h Tue Sep 15 18:55:37 2020 (r365757) @@ -60,6 +60,7 @@ #include "llvm/Support/Allocator.h" #include "llvm/Support/Casting.h" #include "llvm/Support/Compiler.h" +#include "llvm/Support/TypeSize.h" #include #include #include @@ -1296,6 +1297,21 @@ class ASTContext : public RefCountedBase { /// Returns a vla type where known sizes are replaced with [*]. QualType getVariableArrayDecayedType(QualType Ty) const; + + // Convenience struct to return information about a builtin vector type. + struct BuiltinVectorTypeInfo { + QualType ElementType; + llvm::ElementCount EC; + unsigned NumVectors; + BuiltinVectorTypeInfo(QualType ElementType, llvm::ElementCount EC, + unsigned NumVectors) + : ElementType(ElementType), EC(EC), NumVectors(NumVectors) {} + }; + + /// Returns the element type, element count and number of vectors + /// (in case of tuple) for a builtin vector type. + BuiltinVectorTypeInfo + getBuiltinVectorTypeInfo(const BuiltinType *VecTy) const; /// Return the unique reference to a scalable vector type of the specified /// element type and scalable number of elements. Modified: vendor/llvm-project/release-11.x/clang/include/clang/Basic/DiagnosticSemaKinds.td ============================================================================== --- vendor/llvm-project/release-11.x/clang/include/clang/Basic/DiagnosticSemaKinds.td Tue Sep 15 17:13:29 2020 (r365756) +++ vendor/llvm-project/release-11.x/clang/include/clang/Basic/DiagnosticSemaKinds.td Tue Sep 15 18:55:37 2020 (r365757) @@ -6021,9 +6021,8 @@ def err_func_def_incomplete_result : Error< def err_atomic_specifier_bad_type : Error<"_Atomic cannot be applied to " "%select{incomplete |array |function |reference |atomic |qualified " - "|sizeless ||integer |integer }0type " - "%1 %select{|||||||which is not trivially copyable|with less than " - "1 byte of precision|with a non power of 2 precision}0">; + "|sizeless ||integer }0type " + "%1 %select{|||||||which is not trivially copyable|}0">; // Expressions. def ext_sizeof_alignof_function_type : Extension< @@ -7941,6 +7940,8 @@ def err_atomic_exclusive_builtin_pointer_size : Error< " 1,2,4 or 8 byte type (%0 invalid)">; def err_atomic_builtin_ext_int_size : Error< "Atomic memory operand must have a power-of-two size">; +def err_atomic_builtin_ext_int_prohibit : Error< + "argument to atomic builtin of type '_ExtInt' is not supported">; def err_atomic_op_needs_atomic : Error< "address argument to atomic operation must be a pointer to _Atomic " "type (%0 invalid)">; Modified: vendor/llvm-project/release-11.x/clang/lib/AST/ASTContext.cpp ============================================================================== --- vendor/llvm-project/release-11.x/clang/lib/AST/ASTContext.cpp Tue Sep 15 17:13:29 2020 (r365756) +++ vendor/llvm-project/release-11.x/clang/lib/AST/ASTContext.cpp Tue Sep 15 18:55:37 2020 (r365757) @@ -3634,6 +3634,119 @@ QualType ASTContext::getIncompleteArrayType(QualType e return QualType(newType, 0); } +ASTContext::BuiltinVectorTypeInfo +ASTContext::getBuiltinVectorTypeInfo(const BuiltinType *Ty) const { +#define SVE_INT_ELTTY(BITS, ELTS, SIGNED, NUMVECTORS) \ + {getIntTypeForBitwidth(BITS, SIGNED), llvm::ElementCount(ELTS, true), \ + NUMVECTORS}; + +#define SVE_ELTTY(ELTTY, ELTS, NUMVECTORS) \ + {ELTTY, llvm::ElementCount(ELTS, true), NUMVECTORS}; + + switch (Ty->getKind()) { + default: + llvm_unreachable("Unsupported builtin vector type"); + case BuiltinType::SveInt8: + return SVE_INT_ELTTY(8, 16, true, 1); + case BuiltinType::SveUint8: + return SVE_INT_ELTTY(8, 16, false, 1); + case BuiltinType::SveInt8x2: + return SVE_INT_ELTTY(8, 16, true, 2); + case BuiltinType::SveUint8x2: + return SVE_INT_ELTTY(8, 16, false, 2); + case BuiltinType::SveInt8x3: + return SVE_INT_ELTTY(8, 16, true, 3); + case BuiltinType::SveUint8x3: + return SVE_INT_ELTTY(8, 16, false, 3); + case BuiltinType::SveInt8x4: + return SVE_INT_ELTTY(8, 16, true, 4); + case BuiltinType::SveUint8x4: + return SVE_INT_ELTTY(8, 16, false, 4); + case BuiltinType::SveInt16: + return SVE_INT_ELTTY(16, 8, true, 1); + case BuiltinType::SveUint16: + return SVE_INT_ELTTY(16, 8, false, 1); + case BuiltinType::SveInt16x2: + return SVE_INT_ELTTY(16, 8, true, 2); + case BuiltinType::SveUint16x2: + return SVE_INT_ELTTY(16, 8, false, 2); + case BuiltinType::SveInt16x3: + return SVE_INT_ELTTY(16, 8, true, 3); + case BuiltinType::SveUint16x3: + return SVE_INT_ELTTY(16, 8, false, 3); + case BuiltinType::SveInt16x4: + return SVE_INT_ELTTY(16, 8, true, 4); + case BuiltinType::SveUint16x4: + return SVE_INT_ELTTY(16, 8, false, 4); + case BuiltinType::SveInt32: + return SVE_INT_ELTTY(32, 4, true, 1); + case BuiltinType::SveUint32: + return SVE_INT_ELTTY(32, 4, false, 1); + case BuiltinType::SveInt32x2: + return SVE_INT_ELTTY(32, 4, true, 2); + case BuiltinType::SveUint32x2: + return SVE_INT_ELTTY(32, 4, false, 2); + case BuiltinType::SveInt32x3: + return SVE_INT_ELTTY(32, 4, true, 3); + case BuiltinType::SveUint32x3: + return SVE_INT_ELTTY(32, 4, false, 3); + case BuiltinType::SveInt32x4: + return SVE_INT_ELTTY(32, 4, true, 4); + case BuiltinType::SveUint32x4: + return SVE_INT_ELTTY(32, 4, false, 4); + case BuiltinType::SveInt64: + return SVE_INT_ELTTY(64, 2, true, 1); + case BuiltinType::SveUint64: + return SVE_INT_ELTTY(64, 2, false, 1); + case BuiltinType::SveInt64x2: + return SVE_INT_ELTTY(64, 2, true, 2); + case BuiltinType::SveUint64x2: + return SVE_INT_ELTTY(64, 2, false, 2); + case BuiltinType::SveInt64x3: + return SVE_INT_ELTTY(64, 2, true, 3); + case BuiltinType::SveUint64x3: + return SVE_INT_ELTTY(64, 2, false, 3); + case BuiltinType::SveInt64x4: + return SVE_INT_ELTTY(64, 2, true, 4); + case BuiltinType::SveUint64x4: + return SVE_INT_ELTTY(64, 2, false, 4); + case BuiltinType::SveBool: + return SVE_ELTTY(BoolTy, 16, 1); + case BuiltinType::SveFloat16: + return SVE_ELTTY(HalfTy, 8, 1); + case BuiltinType::SveFloat16x2: + return SVE_ELTTY(HalfTy, 8, 2); + case BuiltinType::SveFloat16x3: + return SVE_ELTTY(HalfTy, 8, 3); + case BuiltinType::SveFloat16x4: + return SVE_ELTTY(HalfTy, 8, 4); + case BuiltinType::SveFloat32: + return SVE_ELTTY(FloatTy, 4, 1); + case BuiltinType::SveFloat32x2: + return SVE_ELTTY(FloatTy, 4, 2); + case BuiltinType::SveFloat32x3: + return SVE_ELTTY(FloatTy, 4, 3); + case BuiltinType::SveFloat32x4: + return SVE_ELTTY(FloatTy, 4, 4); + case BuiltinType::SveFloat64: + return SVE_ELTTY(DoubleTy, 2, 1); + case BuiltinType::SveFloat64x2: + return SVE_ELTTY(DoubleTy, 2, 2); + case BuiltinType::SveFloat64x3: + return SVE_ELTTY(DoubleTy, 2, 3); + case BuiltinType::SveFloat64x4: + return SVE_ELTTY(DoubleTy, 2, 4); + case BuiltinType::SveBFloat16: + return SVE_ELTTY(BFloat16Ty, 8, 1); + case BuiltinType::SveBFloat16x2: + return SVE_ELTTY(BFloat16Ty, 8, 2); + case BuiltinType::SveBFloat16x3: + return SVE_ELTTY(BFloat16Ty, 8, 3); + case BuiltinType::SveBFloat16x4: + return SVE_ELTTY(BFloat16Ty, 8, 4); + } +} + /// getScalableVectorType - Return the unique reference to a scalable vector /// type of the specified element type and size. VectorType must be a built-in /// type. Modified: vendor/llvm-project/release-11.x/clang/lib/AST/DeclBase.cpp ============================================================================== --- vendor/llvm-project/release-11.x/clang/lib/AST/DeclBase.cpp Tue Sep 15 17:13:29 2020 (r365756) +++ vendor/llvm-project/release-11.x/clang/lib/AST/DeclBase.cpp Tue Sep 15 18:55:37 2020 (r365757) @@ -1487,6 +1487,13 @@ static bool shouldBeHidden(NamedDecl *D) { if (FD->isFunctionTemplateSpecialization()) return true; + // Hide destructors that are invalid. There should always be one destructor, + // but if it is an invalid decl, another one is created. We need to hide the + // invalid one from places that expect exactly one destructor, like the + // serialization code. + if (isa(D) && D->isInvalidDecl()) + return true; + return false; } Modified: vendor/llvm-project/release-11.x/clang/lib/AST/ItaniumMangle.cpp ============================================================================== --- vendor/llvm-project/release-11.x/clang/lib/AST/ItaniumMangle.cpp Tue Sep 15 17:13:29 2020 (r365756) +++ vendor/llvm-project/release-11.x/clang/lib/AST/ItaniumMangle.cpp Tue Sep 15 18:55:37 2020 (r365757) @@ -3248,7 +3248,7 @@ static StringRef mangleAArch64VectorBase(const Builtin case BuiltinType::Double: return "Float64"; case BuiltinType::BFloat16: - return "BFloat16"; + return "Bfloat16"; default: llvm_unreachable("Unexpected vector element base type"); } Modified: vendor/llvm-project/release-11.x/clang/lib/Basic/Targets.cpp ============================================================================== --- vendor/llvm-project/release-11.x/clang/lib/Basic/Targets.cpp Tue Sep 15 17:13:29 2020 (r365756) +++ vendor/llvm-project/release-11.x/clang/lib/Basic/Targets.cpp Tue Sep 15 18:55:37 2020 (r365757) @@ -409,8 +409,6 @@ TargetInfo *AllocateTarget(const llvm::Triple &Triple, return new SolarisTargetInfo(Triple, Opts); case llvm::Triple::NetBSD: return new NetBSDTargetInfo(Triple, Opts); - case llvm::Triple::OpenBSD: - return new OpenBSDTargetInfo(Triple, Opts); case llvm::Triple::RTEMS: return new RTEMSTargetInfo(Triple, Opts); default: @@ -424,8 +422,6 @@ TargetInfo *AllocateTarget(const llvm::Triple &Triple, return new LinuxTargetInfo(Triple, Opts); case llvm::Triple::NetBSD: return new NetBSDTargetInfo(Triple, Opts); - case llvm::Triple::OpenBSD: - return new OpenBSDTargetInfo(Triple, Opts); case llvm::Triple::RTEMS: return new RTEMSTargetInfo(Triple, Opts); default: Modified: vendor/llvm-project/release-11.x/clang/lib/CodeGen/CGDebugInfo.cpp ============================================================================== --- vendor/llvm-project/release-11.x/clang/lib/CodeGen/CGDebugInfo.cpp Tue Sep 15 17:13:29 2020 (r365756) +++ vendor/llvm-project/release-11.x/clang/lib/CodeGen/CGDebugInfo.cpp Tue Sep 15 18:55:37 2020 (r365757) @@ -719,23 +719,39 @@ llvm::DIType *CGDebugInfo::CreateType(const BuiltinTyp case BuiltinType::Id: \ return getOrCreateStructPtrType("opencl_" #ExtType, Id##Ty); #include "clang/Basic/OpenCLExtensionTypes.def" - // TODO: real support for SVE types requires more infrastructure - // to be added first. The types have a variable length and are - // represented in debug info as types whose length depends on a - // target-specific pseudo register. -#define SVE_TYPE(Name, Id, SingletonId) \ - case BuiltinType::Id: + +#define SVE_TYPE(Name, Id, SingletonId) case BuiltinType::Id: #include "clang/Basic/AArch64SVEACLETypes.def" - { - unsigned DiagID = CGM.getDiags().getCustomDiagID( - DiagnosticsEngine::Error, - "cannot yet generate debug info for SVE type '%0'"); - auto Name = BT->getName(CGM.getContext().getPrintingPolicy()); - CGM.getDiags().Report(DiagID) << Name; - // Return something safe. - return CreateType(cast(CGM.getContext().IntTy)); - } + { + ASTContext::BuiltinVectorTypeInfo Info = + CGM.getContext().getBuiltinVectorTypeInfo(BT); + unsigned NumElemsPerVG = (Info.EC.Min * Info.NumVectors) / 2; + // Debuggers can't extract 1bit from a vector, so will display a + // bitpattern for svbool_t instead. + if (Info.ElementType == CGM.getContext().BoolTy) { + NumElemsPerVG /= 8; + Info.ElementType = CGM.getContext().UnsignedCharTy; + } + + auto *LowerBound = + llvm::ConstantAsMetadata::get(llvm::ConstantInt::getSigned( + llvm::Type::getInt64Ty(CGM.getLLVMContext()), 0)); + SmallVector Expr( + {llvm::dwarf::DW_OP_constu, NumElemsPerVG, llvm::dwarf::DW_OP_bregx, + /* AArch64::VG */ 46, 0, llvm::dwarf::DW_OP_mul, + llvm::dwarf::DW_OP_constu, 1, llvm::dwarf::DW_OP_minus}); + auto *UpperBound = DBuilder.createExpression(Expr); + + llvm::Metadata *Subscript = DBuilder.getOrCreateSubrange( + /*count*/ nullptr, LowerBound, UpperBound, /*stride*/ nullptr); + llvm::DINodeArray SubscriptArray = DBuilder.getOrCreateArray(Subscript); + llvm::DIType *ElemTy = + getOrCreateType(Info.ElementType, TheCU->getFile()); + auto Align = getTypeAlignIfRequired(BT, CGM.getContext()); + return DBuilder.createVectorType(/*Size*/ 0, Align, ElemTy, + SubscriptArray); + } case BuiltinType::UChar: case BuiltinType::Char_U: Encoding = llvm::dwarf::DW_ATE_unsigned_char; Modified: vendor/llvm-project/release-11.x/clang/lib/CodeGen/CGOpenMPRuntime.cpp ============================================================================== --- vendor/llvm-project/release-11.x/clang/lib/CodeGen/CGOpenMPRuntime.cpp Tue Sep 15 17:13:29 2020 (r365756) +++ vendor/llvm-project/release-11.x/clang/lib/CodeGen/CGOpenMPRuntime.cpp Tue Sep 15 18:55:37 2020 (r365757) @@ -29,7 +29,6 @@ #include "llvm/ADT/SetOperations.h" #include "llvm/ADT/StringExtras.h" #include "llvm/Bitcode/BitcodeReader.h" -#include "llvm/Frontend/OpenMP/OMPIRBuilder.h" #include "llvm/IR/Constants.h" #include "llvm/IR/DerivedTypes.h" #include "llvm/IR/GlobalValue.h" @@ -1064,23 +1063,6 @@ CGOpenMPRuntime::CGOpenMPRuntime(CodeGenModule &CGM, S StringRef Separator) : CGM(CGM), FirstSeparator(FirstSeparator), Separator(Separator), OMPBuilder(CGM.getModule()), OffloadEntriesInfoManager(CGM) { - ASTContext &C = CGM.getContext(); - RecordDecl *RD = C.buildImplicitRecord("ident_t"); - QualType KmpInt32Ty = C.getIntTypeForBitwidth(/*DestWidth=*/32, /*Signed=*/1); - RD->startDefinition(); - // reserved_1 - addFieldToRecordDecl(C, RD, KmpInt32Ty); - // flags - addFieldToRecordDecl(C, RD, KmpInt32Ty); - // reserved_2 - addFieldToRecordDecl(C, RD, KmpInt32Ty); - // reserved_3 - addFieldToRecordDecl(C, RD, KmpInt32Ty); - // psource - addFieldToRecordDecl(C, RD, C.VoidPtrTy); - RD->completeDefinition(); - IdentQTy = C.getRecordType(RD); - IdentTy = CGM.getTypes().ConvertRecordDeclType(RD); KmpCriticalNameTy = llvm::ArrayType::get(CGM.Int32Ty, /*NumElements*/ 8); // Initialize Types used in OpenMPIRBuilder from OMPKinds.def @@ -1397,39 +1379,6 @@ createConstantGlobalStructAndAddToParent(CodeGenModule Fields.finishAndAddTo(Parent); } -Address CGOpenMPRuntime::getOrCreateDefaultLocation(unsigned Flags) { - CharUnits Align = CGM.getContext().getTypeAlignInChars(IdentQTy); - unsigned Reserved2Flags = getDefaultLocationReserved2Flags(); - FlagsTy FlagsKey(Flags, Reserved2Flags); - llvm::Value *Entry = OpenMPDefaultLocMap.lookup(FlagsKey); - if (!Entry) { - if (!DefaultOpenMPPSource) { - // Initialize default location for psource field of ident_t structure of - // all ident_t objects. Format is ";file;function;line;column;;". - // Taken from - // https://github.com/llvm/llvm-project/blob/master/openmp/runtime/src/kmp_str.cpp - DefaultOpenMPPSource = - CGM.GetAddrOfConstantCString(";unknown;unknown;0;0;;").getPointer(); - DefaultOpenMPPSource = - llvm::ConstantExpr::getBitCast(DefaultOpenMPPSource, CGM.Int8PtrTy); - } - - llvm::Constant *Data[] = { - llvm::ConstantInt::getNullValue(CGM.Int32Ty), - llvm::ConstantInt::get(CGM.Int32Ty, Flags), - llvm::ConstantInt::get(CGM.Int32Ty, Reserved2Flags), - llvm::ConstantInt::getNullValue(CGM.Int32Ty), DefaultOpenMPPSource}; - llvm::GlobalValue *DefaultOpenMPLocation = - createGlobalStruct(CGM, IdentQTy, isDefaultLocationConstant(), Data, "", - llvm::GlobalValue::PrivateLinkage); - DefaultOpenMPLocation->setUnnamedAddr( - llvm::GlobalValue::UnnamedAddr::Global); - - OpenMPDefaultLocMap[FlagsKey] = Entry = DefaultOpenMPLocation; - } - return Address(Entry, Align); -} - void CGOpenMPRuntime::setLocThreadIdInsertPt(CodeGenFunction &CGF, bool AtCurrentPoint) { auto &Elem = OpenMPLocThreadIDMap.FindAndConstruct(CGF.CurFn); @@ -1458,62 +1407,24 @@ void CGOpenMPRuntime::clearLocThreadIdInsertPt(CodeGen llvm::Value *CGOpenMPRuntime::emitUpdateLocation(CodeGenFunction &CGF, SourceLocation Loc, unsigned Flags) { - Flags |= OMP_IDENT_KMPC; - // If no debug info is generated - return global default location. + llvm::Constant *SrcLocStr; if (CGM.getCodeGenOpts().getDebugInfo() == codegenoptions::NoDebugInfo || - Loc.isInvalid()) - return getOrCreateDefaultLocation(Flags).getPointer(); - - assert(CGF.CurFn && "No function in current CodeGenFunction."); - - CharUnits Align = CGM.getContext().getTypeAlignInChars(IdentQTy); - Address LocValue = Address::invalid(); - auto I = OpenMPLocThreadIDMap.find(CGF.CurFn); - if (I != OpenMPLocThreadIDMap.end()) - LocValue = Address(I->second.DebugLoc, Align); - - // OpenMPLocThreadIDMap may have null DebugLoc and non-null ThreadID, if - // GetOpenMPThreadID was called before this routine. - if (!LocValue.isValid()) { - // Generate "ident_t .kmpc_loc.addr;" - Address AI = CGF.CreateMemTemp(IdentQTy, ".kmpc_loc.addr"); - auto &Elem = OpenMPLocThreadIDMap.FindAndConstruct(CGF.CurFn); - Elem.second.DebugLoc = AI.getPointer(); - LocValue = AI; - - if (!Elem.second.ServiceInsertPt) - setLocThreadIdInsertPt(CGF); - CGBuilderTy::InsertPointGuard IPG(CGF.Builder); - CGF.Builder.SetInsertPoint(Elem.second.ServiceInsertPt); - CGF.Builder.CreateMemCpy(LocValue, getOrCreateDefaultLocation(Flags), - CGF.getTypeSize(IdentQTy)); - } - - // char **psource = &.kmpc_loc_.addr.psource; - LValue Base = CGF.MakeAddrLValue(LocValue, IdentQTy); - auto Fields = cast(IdentQTy->getAsTagDecl())->field_begin(); - LValue PSource = - CGF.EmitLValueForField(Base, *std::next(Fields, IdentField_PSource)); - - llvm::Value *OMPDebugLoc = OpenMPDebugLocMap.lookup(Loc.getRawEncoding()); - if (OMPDebugLoc == nullptr) { - SmallString<128> Buffer2; - llvm::raw_svector_ostream OS2(Buffer2); - // Build debug location - PresumedLoc PLoc = CGF.getContext().getSourceManager().getPresumedLoc(Loc); - OS2 << ";" << PLoc.getFilename() << ";"; + Loc.isInvalid()) { + SrcLocStr = OMPBuilder.getOrCreateDefaultSrcLocStr(); + } else { + std::string FunctionName = ""; if (const auto *FD = dyn_cast_or_null(CGF.CurFuncDecl)) - OS2 << FD->getQualifiedNameAsString(); - OS2 << ";" << PLoc.getLine() << ";" << PLoc.getColumn() << ";;"; - OMPDebugLoc = CGF.Builder.CreateGlobalStringPtr(OS2.str()); - OpenMPDebugLocMap[Loc.getRawEncoding()] = OMPDebugLoc; + FunctionName = FD->getQualifiedNameAsString(); + PresumedLoc PLoc = CGF.getContext().getSourceManager().getPresumedLoc(Loc); + const char *FileName = PLoc.getFilename(); + unsigned Line = PLoc.getLine(); + unsigned Column = PLoc.getColumn(); + SrcLocStr = OMPBuilder.getOrCreateSrcLocStr(FunctionName.c_str(), FileName, + Line, Column); } - // *psource = ";;;;;;"; - CGF.EmitStoreOfScalar(OMPDebugLoc, PSource); - - // Our callers always pass this to a runtime function, so for - // convenience, go ahead and return a naked pointer. - return LocValue.getPointer(); + unsigned Reserved2Flags = getDefaultLocationReserved2Flags(); + return OMPBuilder.getOrCreateIdent(SrcLocStr, llvm::omp::IdentFlag(Flags), + Reserved2Flags); } llvm::Value *CGOpenMPRuntime::getThreadID(CodeGenFunction &CGF, @@ -1595,7 +1506,7 @@ void CGOpenMPRuntime::functionFinished(CodeGenFunction } llvm::Type *CGOpenMPRuntime::getIdentTyPointerTy() { - return IdentTy->getPointerTo(); + return OMPBuilder.IdentPtr; } llvm::Type *CGOpenMPRuntime::getKmpc_MicroPointerTy() { @@ -7354,6 +7265,8 @@ class MappableExprsHandler { (private) // &p, &p, sizeof(float*), TARGET_PARAM | TO | FROM // // map(p[1:24]) + // &p, &p[1], 24*sizeof(float), TARGET_PARAM | TO | FROM | PTR_AND_OBJ + // in unified shared memory mode or for local pointers // p, &p[1], 24*sizeof(float), TARGET_PARAM | TO | FROM // // map(s) @@ -7489,6 +7402,7 @@ class MappableExprsHandler { (private) // Track if the map information being generated is the first for a list of // components. bool IsExpressionFirstInfo = true; + bool FirstPointerInComplexData = false; Address BP = Address::invalid(); const Expr *AssocExpr = I->getAssociatedExpression(); const auto *AE = dyn_cast(AssocExpr); @@ -7531,10 +7445,15 @@ class MappableExprsHandler { (private) QualType Ty = I->getAssociatedDeclaration()->getType().getNonReferenceType(); if (Ty->isAnyPointerType() && std::next(I) != CE) { - BP = CGF.EmitLoadOfPointer(BP, Ty->castAs()); - - // We do not need to generate individual map information for the - // pointer, it can be associated with the combined storage. + // No need to generate individual map information for the pointer, it + // can be associated with the combined storage if shared memory mode is + // active or the base declaration is not global variable. + const auto *VD = dyn_cast(I->getAssociatedDeclaration()); + if (CGF.CGM.getOpenMPRuntime().hasRequiresUnifiedSharedMemory() || + !VD || VD->hasLocalStorage()) + BP = CGF.EmitLoadOfPointer(BP, Ty->castAs()); + else + FirstPointerInComplexData = IsCaptureFirstInfo; ++I; } } @@ -7570,8 +7489,19 @@ class MappableExprsHandler { (private) EncounteredME = dyn_cast(I->getAssociatedExpression()); // If we encounter a PTR_AND_OBJ entry from now on it should be marked // as MEMBER_OF the parent struct. - if (EncounteredME) + if (EncounteredME) { ShouldBeMemberOf = true; + // Do not emit as complex pointer if this is actually not array-like + // expression. + if (FirstPointerInComplexData) { + QualType Ty = std::prev(I) + ->getAssociatedDeclaration() + ->getType() + .getNonReferenceType(); + BP = CGF.EmitLoadOfPointer(BP, Ty->castAs()); + FirstPointerInComplexData = false; + } + } } auto Next = std::next(I); @@ -7704,10 +7634,11 @@ class MappableExprsHandler { (private) // same expression except for the first one. We also need to signal // this map is the first one that relates with the current capture // (there is a set of entries for each capture). - OpenMPOffloadMappingFlags Flags = getMapTypeBits( - MapType, MapModifiers, IsImplicit, - !IsExpressionFirstInfo || RequiresReference, - IsCaptureFirstInfo && !RequiresReference); + OpenMPOffloadMappingFlags Flags = + getMapTypeBits(MapType, MapModifiers, IsImplicit, + !IsExpressionFirstInfo || RequiresReference || + FirstPointerInComplexData, + IsCaptureFirstInfo && !RequiresReference); if (!IsExpressionFirstInfo) { // If we have a PTR_AND_OBJ pair where the OBJ is a pointer as well, @@ -7765,6 +7696,7 @@ class MappableExprsHandler { (private) IsExpressionFirstInfo = false; IsCaptureFirstInfo = false; + FirstPointerInComplexData = false; } } } @@ -7995,6 +7927,10 @@ class MappableExprsHandler { (private) // emission of that entry until the whole struct has been processed. llvm::MapVector> DeferredInfo; + MapBaseValuesArrayTy UseDevicePtrBasePointers; + MapValuesArrayTy UseDevicePtrPointers; + MapValuesArrayTy UseDevicePtrSizes; + MapFlagsArrayTy UseDevicePtrTypes; for (const auto *C : CurExecDir->getClausesOfKind()) { @@ -8011,15 +7947,27 @@ class MappableExprsHandler { (private) // We potentially have map information for this declaration already. // Look for the first set of components that refer to it. if (It != Info.end()) { - auto CI = std::find_if( - It->second.begin(), It->second.end(), [VD](const MapInfo &MI) { - return MI.Components.back().getAssociatedDeclaration() == VD; - }); + auto *CI = llvm::find_if(It->second, [VD](const MapInfo &MI) { + return MI.Components.back().getAssociatedDeclaration() == VD; + }); // If we found a map entry, signal that the pointer has to be returned // and move on to the next declaration. + // Exclude cases where the base pointer is mapped as array subscript, + // array section or array shaping. The base address is passed as a + // pointer to base in this case and cannot be used as a base for + // use_device_ptr list item. if (CI != It->second.end()) { - CI->ReturnDevicePointer = true; - continue; + auto PrevCI = std::next(CI->Components.rbegin()); + const auto *VarD = dyn_cast(VD); + if (CGF.CGM.getOpenMPRuntime().hasRequiresUnifiedSharedMemory() || + isa(IE) || + !VD->getType().getNonReferenceType()->isPointerType() || + PrevCI == CI->Components.rend() || + isa(PrevCI->getAssociatedExpression()) || !VarD || + VarD->hasLocalStorage()) { + CI->ReturnDevicePointer = true; + continue; + } } } @@ -8040,10 +7988,12 @@ class MappableExprsHandler { (private) } else { llvm::Value *Ptr = CGF.EmitLoadOfScalar(CGF.EmitLValue(IE), IE->getExprLoc()); - BasePointers.emplace_back(Ptr, VD); - Pointers.push_back(Ptr); - Sizes.push_back(llvm::Constant::getNullValue(CGF.Int64Ty)); - Types.push_back(OMP_MAP_RETURN_PARAM | OMP_MAP_TARGET_PARAM); + UseDevicePtrBasePointers.emplace_back(Ptr, VD); + UseDevicePtrPointers.push_back(Ptr); + UseDevicePtrSizes.push_back( + llvm::Constant::getNullValue(CGF.Int64Ty)); + UseDevicePtrTypes.push_back(OMP_MAP_RETURN_PARAM | + OMP_MAP_TARGET_PARAM); } } } @@ -8104,10 +8054,12 @@ class MappableExprsHandler { (private) Ptr = CGF.EmitLValue(IE).getPointer(CGF); else Ptr = CGF.EmitScalarExpr(IE); - BasePointers.emplace_back(Ptr, VD); - Pointers.push_back(Ptr); - Sizes.push_back(llvm::Constant::getNullValue(CGF.Int64Ty)); - Types.push_back(OMP_MAP_RETURN_PARAM | OMP_MAP_TARGET_PARAM); + UseDevicePtrBasePointers.emplace_back(Ptr, VD); + UseDevicePtrPointers.push_back(Ptr); + UseDevicePtrSizes.push_back( + llvm::Constant::getNullValue(CGF.Int64Ty)); + UseDevicePtrTypes.push_back(OMP_MAP_RETURN_PARAM | + OMP_MAP_TARGET_PARAM); } } } @@ -8197,6 +8149,12 @@ class MappableExprsHandler { (private) Sizes.append(CurSizes.begin(), CurSizes.end()); Types.append(CurTypes.begin(), CurTypes.end()); } + // Append data for use_device_ptr clauses. + BasePointers.append(UseDevicePtrBasePointers.begin(), + UseDevicePtrBasePointers.end()); + Pointers.append(UseDevicePtrPointers.begin(), UseDevicePtrPointers.end()); + Sizes.append(UseDevicePtrSizes.begin(), UseDevicePtrSizes.end()); + Types.append(UseDevicePtrTypes.begin(), UseDevicePtrTypes.end()); } /// Generate all the base pointers, section pointers, sizes and map types for Modified: vendor/llvm-project/release-11.x/clang/lib/CodeGen/CGOpenMPRuntime.h ============================================================================== --- vendor/llvm-project/release-11.x/clang/lib/CodeGen/CGOpenMPRuntime.h Tue Sep 15 17:13:29 2020 (r365756) +++ vendor/llvm-project/release-11.x/clang/lib/CodeGen/CGOpenMPRuntime.h Tue Sep 15 18:55:37 2020 (r365757) @@ -374,17 +374,7 @@ class CGOpenMPRuntime { (protected) private: /// An OpenMP-IR-Builder instance. llvm::OpenMPIRBuilder OMPBuilder; - /// Default const ident_t object used for initialization of all other - /// ident_t objects. - llvm::Constant *DefaultOpenMPPSource = nullptr; - using FlagsTy = std::pair; - /// Map of flags and corresponding default locations. - using OpenMPDefaultLocMapTy = llvm::DenseMap; - OpenMPDefaultLocMapTy OpenMPDefaultLocMap; - Address getOrCreateDefaultLocation(unsigned Flags); - QualType IdentQTy; - llvm::StructType *IdentTy = nullptr; /// Map for SourceLocation and OpenMP runtime library debug locations. typedef llvm::DenseMap OpenMPDebugLocMapTy; OpenMPDebugLocMapTy OpenMPDebugLocMap; Modified: vendor/llvm-project/release-11.x/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp ============================================================================== --- vendor/llvm-project/release-11.x/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp Tue Sep 15 17:13:29 2020 (r365756) +++ vendor/llvm-project/release-11.x/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp Tue Sep 15 18:55:37 2020 (r365757) @@ -2857,8 +2857,12 @@ static llvm::Value *castValueToType(CodeGenFunction &C Address CastItem = CGF.CreateMemTemp(CastTy); Address ValCastItem = CGF.Builder.CreatePointerBitCastOrAddrSpaceCast( CastItem, Val->getType()->getPointerTo(CastItem.getAddressSpace())); - CGF.EmitStoreOfScalar(Val, ValCastItem, /*Volatile=*/false, ValTy); - return CGF.EmitLoadOfScalar(CastItem, /*Volatile=*/false, CastTy, Loc); + CGF.EmitStoreOfScalar(Val, ValCastItem, /*Volatile=*/false, ValTy, + LValueBaseInfo(AlignmentSource::Type), + TBAAAccessInfo()); + return CGF.EmitLoadOfScalar(CastItem, /*Volatile=*/false, CastTy, Loc, + LValueBaseInfo(AlignmentSource::Type), + TBAAAccessInfo()); } /// This function creates calls to one of two shuffle functions to copy @@ -2945,9 +2949,14 @@ static void shuffleAndStore(CodeGenFunction &CGF, Addr ThenBB, ExitBB); CGF.EmitBlock(ThenBB); llvm::Value *Res = createRuntimeShuffleFunction( - CGF, CGF.EmitLoadOfScalar(Ptr, /*Volatile=*/false, IntType, Loc), + CGF, + CGF.EmitLoadOfScalar(Ptr, /*Volatile=*/false, IntType, Loc, + LValueBaseInfo(AlignmentSource::Type), + TBAAAccessInfo()), IntType, Offset, Loc); - CGF.EmitStoreOfScalar(Res, ElemPtr, /*Volatile=*/false, IntType); + CGF.EmitStoreOfScalar(Res, ElemPtr, /*Volatile=*/false, IntType, + LValueBaseInfo(AlignmentSource::Type), + TBAAAccessInfo()); Address LocalPtr = Bld.CreateConstGEP(Ptr, 1); Address LocalElemPtr = Bld.CreateConstGEP(ElemPtr, 1); PhiSrc->addIncoming(LocalPtr.getPointer(), ThenBB); @@ -2956,9 +2965,14 @@ static void shuffleAndStore(CodeGenFunction &CGF, Addr CGF.EmitBlock(ExitBB); } else { llvm::Value *Res = createRuntimeShuffleFunction( - CGF, CGF.EmitLoadOfScalar(Ptr, /*Volatile=*/false, IntType, Loc), + CGF, + CGF.EmitLoadOfScalar(Ptr, /*Volatile=*/false, IntType, Loc, + LValueBaseInfo(AlignmentSource::Type), + TBAAAccessInfo()), IntType, Offset, Loc); - CGF.EmitStoreOfScalar(Res, ElemPtr, /*Volatile=*/false, IntType); + CGF.EmitStoreOfScalar(Res, ElemPtr, /*Volatile=*/false, IntType, + LValueBaseInfo(AlignmentSource::Type), + TBAAAccessInfo()); Ptr = Bld.CreateConstGEP(Ptr, 1); ElemPtr = Bld.CreateConstGEP(ElemPtr, 1); } @@ -3112,12 +3126,14 @@ static void emitReductionListCopy( } else { switch (CGF.getEvaluationKind(Private->getType())) { case TEK_Scalar: { - llvm::Value *Elem = - CGF.EmitLoadOfScalar(SrcElementAddr, /*Volatile=*/false, - Private->getType(), Private->getExprLoc()); + llvm::Value *Elem = CGF.EmitLoadOfScalar( + SrcElementAddr, /*Volatile=*/false, Private->getType(), + Private->getExprLoc(), LValueBaseInfo(AlignmentSource::Type), + TBAAAccessInfo()); // Store the source element value to the dest element address. - CGF.EmitStoreOfScalar(Elem, DestElementAddr, /*Volatile=*/false, - Private->getType()); + CGF.EmitStoreOfScalar( + Elem, DestElementAddr, /*Volatile=*/false, Private->getType(), + LValueBaseInfo(AlignmentSource::Type), TBAAAccessInfo()); break; } case TEK_Complex: { @@ -3260,8 +3276,9 @@ static llvm::Value *emitInterWarpCopyFunction(CodeGenM Address AddrReduceListArg = CGF.GetAddrOfLocalVar(&ReduceListArg); Address LocalReduceList( Bld.CreatePointerBitCastOrAddrSpaceCast( - CGF.EmitLoadOfScalar(AddrReduceListArg, /*Volatile=*/false, - C.VoidPtrTy, Loc), + CGF.EmitLoadOfScalar( + AddrReduceListArg, /*Volatile=*/false, C.VoidPtrTy, Loc, + LValueBaseInfo(AlignmentSource::Type), TBAAAccessInfo()), CGF.ConvertTypeForMem(ReductionArrayTy)->getPointerTo()), CGF.getPointerAlign()); @@ -3339,10 +3356,13 @@ static llvm::Value *emitInterWarpCopyFunction(CodeGenM // elem = *elemptr //*MediumPtr = elem - llvm::Value *Elem = - CGF.EmitLoadOfScalar(ElemPtr, /*Volatile=*/false, CType, Loc); + llvm::Value *Elem = CGF.EmitLoadOfScalar( + ElemPtr, /*Volatile=*/false, CType, Loc, + LValueBaseInfo(AlignmentSource::Type), TBAAAccessInfo()); // Store the source element value to the dest element address. - CGF.EmitStoreOfScalar(Elem, MediumPtr, /*Volatile=*/true, CType); + CGF.EmitStoreOfScalar(Elem, MediumPtr, /*Volatile=*/true, CType, + LValueBaseInfo(AlignmentSource::Type), + TBAAAccessInfo()); Bld.CreateBr(MergeBB); @@ -3722,8 +3742,9 @@ static llvm::Value *emitListToGlobalCopyFunction( GlobLVal.setAddress(Address(BufferPtr, GlobLVal.getAlignment())); switch (CGF.getEvaluationKind(Private->getType())) { case TEK_Scalar: { - llvm::Value *V = CGF.EmitLoadOfScalar(ElemPtr, /*Volatile=*/false, - Private->getType(), Loc); + llvm::Value *V = CGF.EmitLoadOfScalar( + ElemPtr, /*Volatile=*/false, Private->getType(), Loc, + LValueBaseInfo(AlignmentSource::Type), TBAAAccessInfo()); CGF.EmitStoreOfScalar(V, GlobLVal); break; } @@ -3926,7 +3947,9 @@ static llvm::Value *emitGlobalToListCopyFunction( switch (CGF.getEvaluationKind(Private->getType())) { case TEK_Scalar: { llvm::Value *V = CGF.EmitLoadOfScalar(GlobLVal, Loc); - CGF.EmitStoreOfScalar(V, ElemPtr, /*Volatile=*/false, Private->getType()); + CGF.EmitStoreOfScalar(V, ElemPtr, /*Volatile=*/false, Private->getType(), + LValueBaseInfo(AlignmentSource::Type), + TBAAAccessInfo()); break; } case TEK_Complex: { Modified: vendor/llvm-project/release-11.x/clang/lib/CodeGen/CodeGenTypes.cpp ============================================================================== --- vendor/llvm-project/release-11.x/clang/lib/CodeGen/CodeGenTypes.cpp Tue Sep 15 17:13:29 2020 (r365756) +++ vendor/llvm-project/release-11.x/clang/lib/CodeGen/CodeGenTypes.cpp Tue Sep 15 18:55:37 2020 (r365757) @@ -533,99 +533,60 @@ llvm::Type *CodeGenTypes::ConvertType(QualType T) { case BuiltinType::OCLReserveID: ResultType = CGM.getOpenCLRuntime().convertOpenCLSpecificType(Ty); break; -#define GET_SVE_INT_VEC(BITS, ELTS) \ - llvm::ScalableVectorType::get( \ - llvm::IntegerType::get(getLLVMContext(), BITS), ELTS); case BuiltinType::SveInt8: case BuiltinType::SveUint8: - return GET_SVE_INT_VEC(8, 16); case BuiltinType::SveInt8x2: case BuiltinType::SveUint8x2: - return GET_SVE_INT_VEC(8, 32); case BuiltinType::SveInt8x3: case BuiltinType::SveUint8x3: - return GET_SVE_INT_VEC(8, 48); case BuiltinType::SveInt8x4: case BuiltinType::SveUint8x4: - return GET_SVE_INT_VEC(8, 64); case BuiltinType::SveInt16: case BuiltinType::SveUint16: - return GET_SVE_INT_VEC(16, 8); case BuiltinType::SveInt16x2: case BuiltinType::SveUint16x2: - return GET_SVE_INT_VEC(16, 16); case BuiltinType::SveInt16x3: case BuiltinType::SveUint16x3: - return GET_SVE_INT_VEC(16, 24); case BuiltinType::SveInt16x4: case BuiltinType::SveUint16x4: - return GET_SVE_INT_VEC(16, 32); case BuiltinType::SveInt32: case BuiltinType::SveUint32: - return GET_SVE_INT_VEC(32, 4); case BuiltinType::SveInt32x2: case BuiltinType::SveUint32x2: - return GET_SVE_INT_VEC(32, 8); case BuiltinType::SveInt32x3: case BuiltinType::SveUint32x3: - return GET_SVE_INT_VEC(32, 12); case BuiltinType::SveInt32x4: case BuiltinType::SveUint32x4: - return GET_SVE_INT_VEC(32, 16); case BuiltinType::SveInt64: case BuiltinType::SveUint64: - return GET_SVE_INT_VEC(64, 2); case BuiltinType::SveInt64x2: case BuiltinType::SveUint64x2: - return GET_SVE_INT_VEC(64, 4); case BuiltinType::SveInt64x3: case BuiltinType::SveUint64x3: - return GET_SVE_INT_VEC(64, 6); case BuiltinType::SveInt64x4: case BuiltinType::SveUint64x4: - return GET_SVE_INT_VEC(64, 8); case BuiltinType::SveBool: - return GET_SVE_INT_VEC(1, 16); -#undef GET_SVE_INT_VEC -#define GET_SVE_FP_VEC(TY, ISFP16, ELTS) \ - llvm::ScalableVectorType::get( \ - getTypeForFormat(getLLVMContext(), \ - Context.getFloatTypeSemantics(Context.TY), \ - /* UseNativeHalf = */ ISFP16), \ - ELTS); case BuiltinType::SveFloat16: - return GET_SVE_FP_VEC(HalfTy, true, 8); case BuiltinType::SveFloat16x2: - return GET_SVE_FP_VEC(HalfTy, true, 16); case BuiltinType::SveFloat16x3: - return GET_SVE_FP_VEC(HalfTy, true, 24); case BuiltinType::SveFloat16x4: - return GET_SVE_FP_VEC(HalfTy, true, 32); case BuiltinType::SveFloat32: - return GET_SVE_FP_VEC(FloatTy, false, 4); case BuiltinType::SveFloat32x2: - return GET_SVE_FP_VEC(FloatTy, false, 8); case BuiltinType::SveFloat32x3: - return GET_SVE_FP_VEC(FloatTy, false, 12); case BuiltinType::SveFloat32x4: - return GET_SVE_FP_VEC(FloatTy, false, 16); case BuiltinType::SveFloat64: - return GET_SVE_FP_VEC(DoubleTy, false, 2); case BuiltinType::SveFloat64x2: - return GET_SVE_FP_VEC(DoubleTy, false, 4); case BuiltinType::SveFloat64x3: - return GET_SVE_FP_VEC(DoubleTy, false, 6); case BuiltinType::SveFloat64x4: - return GET_SVE_FP_VEC(DoubleTy, false, 8); case BuiltinType::SveBFloat16: - return GET_SVE_FP_VEC(BFloat16Ty, false, 8); case BuiltinType::SveBFloat16x2: - return GET_SVE_FP_VEC(BFloat16Ty, false, 16); case BuiltinType::SveBFloat16x3: - return GET_SVE_FP_VEC(BFloat16Ty, false, 24); - case BuiltinType::SveBFloat16x4: - return GET_SVE_FP_VEC(BFloat16Ty, false, 32); -#undef GET_SVE_FP_VEC + case BuiltinType::SveBFloat16x4: { + ASTContext::BuiltinVectorTypeInfo Info = + Context.getBuiltinVectorTypeInfo(cast(Ty)); + return llvm::ScalableVectorType::get(ConvertType(Info.ElementType), + Info.EC.Min * Info.NumVectors); + } case BuiltinType::Dependent: #define BUILTIN_TYPE(Id, SingletonId) #define PLACEHOLDER_TYPE(Id, SingletonId) \ Modified: vendor/llvm-project/release-11.x/clang/lib/Driver/ToolChains/Arch/Sparc.cpp ============================================================================== --- vendor/llvm-project/release-11.x/clang/lib/Driver/ToolChains/Arch/Sparc.cpp Tue Sep 15 17:13:29 2020 (r365756) +++ vendor/llvm-project/release-11.x/clang/lib/Driver/ToolChains/Arch/Sparc.cpp Tue Sep 15 18:55:37 2020 (r365757) @@ -21,12 +21,19 @@ using namespace llvm::opt; const char *sparc::getSparcAsmModeForCPU(StringRef Name, const llvm::Triple &Triple) { if (Triple.getArch() == llvm::Triple::sparcv9) { + const char *DefV9CPU; + + if (Triple.isOSLinux() || Triple.isOSFreeBSD() || Triple.isOSOpenBSD()) + DefV9CPU = "-Av9a"; + else + DefV9CPU = "-Av9"; + return llvm::StringSwitch(Name) .Case("niagara", "-Av9b") .Case("niagara2", "-Av9b") .Case("niagara3", "-Av9d") .Case("niagara4", "-Av9d") - .Default("-Av9"); + .Default(DefV9CPU); } else { return llvm::StringSwitch(Name) .Case("v8", "-Av8") Modified: vendor/llvm-project/release-11.x/clang/lib/Driver/ToolChains/Clang.cpp ============================================================================== --- vendor/llvm-project/release-11.x/clang/lib/Driver/ToolChains/Clang.cpp Tue Sep 15 17:13:29 2020 (r365756) +++ vendor/llvm-project/release-11.x/clang/lib/Driver/ToolChains/Clang.cpp Tue Sep 15 18:55:37 2020 (r365757) @@ -498,7 +498,7 @@ static codegenoptions::DebugInfoKind DebugLevelToInfoK return codegenoptions::DebugLineTablesOnly; if (A.getOption().matches(options::OPT_gline_directives_only)) return codegenoptions::DebugDirectivesOnly; - return codegenoptions::DebugInfoConstructor; + return codegenoptions::LimitedDebugInfo; } static bool mustUseNonLeafFramePointerForTarget(const llvm::Triple &Triple) { @@ -2380,7 +2380,7 @@ static void CollectArgsForIntegratedAssembler(Compilat CmdArgs.push_back(Value.data()); } else { RenderDebugEnablingArgs(Args, CmdArgs, - codegenoptions::DebugInfoConstructor, + codegenoptions::LimitedDebugInfo, DwarfVersion, llvm::DebuggerKind::Default); } } else if (Value.startswith("-mcpu") || Value.startswith("-mfpu") || @@ -3653,7 +3653,7 @@ static void RenderDebugOptions(const ToolChain &TC, co if (const Arg *A = Args.getLastArg(options::OPT_g_Group, options::OPT_gsplit_dwarf, options::OPT_gsplit_dwarf_EQ)) { - DebugInfoKind = codegenoptions::DebugInfoConstructor; + DebugInfoKind = codegenoptions::LimitedDebugInfo; // If the last option explicitly specified a debug-info level, use it. if (checkDebugInfoOption(A, Args, D, TC) && @@ -3758,7 +3758,7 @@ static void RenderDebugOptions(const ToolChain &TC, co if (checkDebugInfoOption(A, Args, D, TC)) { if (DebugInfoKind != codegenoptions::DebugLineTablesOnly && DebugInfoKind != codegenoptions::DebugDirectivesOnly) { - DebugInfoKind = codegenoptions::DebugInfoConstructor; + DebugInfoKind = codegenoptions::LimitedDebugInfo; CmdArgs.push_back("-dwarf-ext-refs"); CmdArgs.push_back("-fmodule-format=obj"); } @@ -3778,9 +3778,7 @@ static void RenderDebugOptions(const ToolChain &TC, co TC.GetDefaultStandaloneDebug()); if (const Arg *A = Args.getLastArg(options::OPT_fstandalone_debug)) (void)checkDebugInfoOption(A, Args, D, TC); - if ((DebugInfoKind == codegenoptions::LimitedDebugInfo || - DebugInfoKind == codegenoptions::DebugInfoConstructor) && - NeedFullDebug) + if (DebugInfoKind == codegenoptions::LimitedDebugInfo && NeedFullDebug) DebugInfoKind = codegenoptions::FullDebugInfo; if (Args.hasFlag(options::OPT_gembed_source, options::OPT_gno_embed_source, @@ -6566,7 +6564,7 @@ void Clang::AddClangCLArgs(const ArgList &Args, types: options::OPT_gline_tables_only)) { *EmitCodeView = true; if (DebugInfoArg->getOption().matches(options::OPT__SLASH_Z7)) - *DebugInfoKind = codegenoptions::DebugInfoConstructor; + *DebugInfoKind = codegenoptions::LimitedDebugInfo; else *DebugInfoKind = codegenoptions::DebugLineTablesOnly; } else { @@ -6863,7 +6861,7 @@ void ClangAs::ConstructJob(Compilation &C, const JobAc // the guard for source type, however there is a test which asserts // that some assembler invocation receives no -debug-info-kind, // and it's not clear whether that test is just overly restrictive. - DebugInfoKind = (WantDebug ? codegenoptions::DebugInfoConstructor + DebugInfoKind = (WantDebug ? codegenoptions::LimitedDebugInfo : codegenoptions::NoDebugInfo); // Add the -fdebug-compilation-dir flag if needed. addDebugCompDirArg(Args, CmdArgs, C.getDriver().getVFS()); Modified: vendor/llvm-project/release-11.x/clang/lib/Driver/ToolChains/OpenBSD.cpp ============================================================================== --- vendor/llvm-project/release-11.x/clang/lib/Driver/ToolChains/OpenBSD.cpp Tue Sep 15 17:13:29 2020 (r365756) +++ vendor/llvm-project/release-11.x/clang/lib/Driver/ToolChains/OpenBSD.cpp Tue Sep 15 18:55:37 2020 (r365757) @@ -10,10 +10,12 @@ #include "Arch/Mips.h" #include "Arch/Sparc.h" #include "CommonArgs.h" +#include "clang/Config/config.h" #include "clang/Driver/Compilation.h" #include "clang/Driver/Options.h" #include "clang/Driver/SanitizerArgs.h" #include "llvm/Option/ArgList.h" +#include "llvm/Support/Path.h" using namespace clang::driver; using namespace clang::driver::tools; @@ -41,15 +43,6 @@ void openbsd::Assembler::ConstructJob(Compilation &C, CmdArgs.push_back("-many"); break; - case llvm::Triple::sparc: - case llvm::Triple::sparcel: { - CmdArgs.push_back("-32"); - std::string CPU = getCPUName(Args, getToolChain().getTriple()); - CmdArgs.push_back(sparc::getSparcAsmModeForCPU(CPU, getToolChain().getTriple())); - AddAssemblerKPIC(getToolChain(), Args, CmdArgs); - break; - } - case llvm::Triple::sparcv9: { CmdArgs.push_back("-64"); std::string CPU = getCPUName(Args, getToolChain().getTriple()); @@ -256,6 +249,45 @@ OpenBSD::OpenBSD(const Driver &D, const llvm::Triple & getFilePaths().push_back(getDriver().SysRoot + "/usr/lib"); } +void OpenBSD::AddClangSystemIncludeArgs( + const llvm::opt::ArgList &DriverArgs, + llvm::opt::ArgStringList &CC1Args) const { + const Driver &D = getDriver(); + + if (DriverArgs.hasArg(clang::driver::options::OPT_nostdinc)) + return; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@freebsd.org Tue Sep 15 18:56:15 2020 Return-Path: Delivered-To: svn-src-vendor@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 541B73DCD8B; Tue, 15 Sep 2020 18:56:15 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BrXWM1ZyVz4V11; Tue, 15 Sep 2020 18:56:15 +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 F3C27CF75; Tue, 15 Sep 2020 18:56:14 +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 08FIuECa040729; Tue, 15 Sep 2020 18:56:14 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08FIuEn4040728; Tue, 15 Sep 2020 18:56:14 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009151856.08FIuEn4040728@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 15 Sep 2020 18:56:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r365758 - vendor/llvm-project/llvmorg-11.0.0-rc2-91-g6e042866c30 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/llvm-project/llvmorg-11.0.0-rc2-91-g6e042866c30 X-SVN-Commit-Revision: 365758 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 18:56:15 -0000 Author: dim Date: Tue Sep 15 18:56:14 2020 New Revision: 365758 URL: https://svnweb.freebsd.org/changeset/base/365758 Log: Tag llvm-project branch release/11.x llvmorg-11.0.0-rc2-91-g6e042866c30. Added: vendor/llvm-project/llvmorg-11.0.0-rc2-91-g6e042866c30/ - copied from r365757, vendor/llvm-project/release-11.x/ From owner-svn-src-vendor@freebsd.org Fri Sep 18 22:55:14 2020 Return-Path: Delivered-To: svn-src-vendor@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 095ED3F2D26; Fri, 18 Sep 2020 22:55:14 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BtTgj6ks7z4Gnv; Fri, 18 Sep 2020 22:55:13 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 CAC6122796; Fri, 18 Sep 2020 22:55:13 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08IMtDLm059032; Fri, 18 Sep 2020 22:55:13 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08IMt5uB058991; Fri, 18 Sep 2020 22:55:05 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <202009182255.08IMt5uB058991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Fri, 18 Sep 2020 22:55:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r365892 - in vendor-sys/openzfs/dist: . cmd/mount_zfs cmd/zdb cmd/zfs cmd/zgenhostid cmd/zpool config contrib/dracut/90zfs include include/os/freebsd/spl/sys include/os/freebsd/zfs/sys ... X-SVN-Group: vendor-sys X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in vendor-sys/openzfs/dist: . cmd/mount_zfs cmd/zdb cmd/zfs cmd/zgenhostid cmd/zpool config contrib/dracut/90zfs include include/os/freebsd/spl/sys include/os/freebsd/zfs/sys include/os/linux/kernel/l... X-SVN-Commit-Revision: 365892 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2020 22:55:14 -0000 Author: mmacy Date: Fri Sep 18 22:55:05 2020 New Revision: 365892 URL: https://svnweb.freebsd.org/changeset/base/365892 Log: Update openzfs to 2.0.0-rc2-g4ce06f Added: vendor-sys/openzfs/dist/cmd/zgenhostid/.gitignore vendor-sys/openzfs/dist/cmd/zgenhostid/zgenhostid.c (contents, props changed) vendor-sys/openzfs/dist/include/libzfsbootenv.h (contents, props changed) vendor-sys/openzfs/dist/include/os/freebsd/zfs/sys/zfs_bootenv_os.h (contents, props changed) vendor-sys/openzfs/dist/include/os/linux/zfs/sys/zfs_bootenv_os.h (contents, props changed) vendor-sys/openzfs/dist/include/sys/zfs_bootenv.h (contents, props changed) vendor-sys/openzfs/dist/lib/libzfsbootenv/ vendor-sys/openzfs/dist/lib/libzfsbootenv/.gitignore vendor-sys/openzfs/dist/lib/libzfsbootenv/Makefile.am (contents, props changed) vendor-sys/openzfs/dist/lib/libzfsbootenv/libzfsbootenv.pc.in (contents, props changed) vendor-sys/openzfs/dist/lib/libzfsbootenv/lzbe_device.c (contents, props changed) vendor-sys/openzfs/dist/lib/libzfsbootenv/lzbe_pair.c (contents, props changed) vendor-sys/openzfs/dist/lib/libzfsbootenv/lzbe_util.c (contents, props changed) vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/cli_root/zpool_events/.gitignore vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/cli_root/zpool_events/ereports.c (contents, props changed) vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_duplicates.ksh Deleted: vendor-sys/openzfs/dist/cmd/zgenhostid/zgenhostid Modified: vendor-sys/openzfs/dist/META vendor-sys/openzfs/dist/cmd/mount_zfs/mount_zfs.c vendor-sys/openzfs/dist/cmd/zdb/zdb.c vendor-sys/openzfs/dist/cmd/zfs/zfs_main.c vendor-sys/openzfs/dist/cmd/zgenhostid/Makefile.am vendor-sys/openzfs/dist/cmd/zpool/zpool_main.c vendor-sys/openzfs/dist/config/deb.am vendor-sys/openzfs/dist/config/find_system_library.m4 vendor-sys/openzfs/dist/config/rpm.am vendor-sys/openzfs/dist/config/zfs-build.m4 vendor-sys/openzfs/dist/configure.ac vendor-sys/openzfs/dist/contrib/dracut/90zfs/module-setup.sh.in vendor-sys/openzfs/dist/contrib/dracut/90zfs/parse-zfs.sh.in vendor-sys/openzfs/dist/include/Makefile.am vendor-sys/openzfs/dist/include/libzfs.h vendor-sys/openzfs/dist/include/libzfs_core.h vendor-sys/openzfs/dist/include/os/freebsd/spl/sys/ccompile.h vendor-sys/openzfs/dist/include/os/freebsd/spl/sys/condvar.h vendor-sys/openzfs/dist/include/os/freebsd/zfs/sys/Makefile.am vendor-sys/openzfs/dist/include/os/freebsd/zfs/sys/zfs_context_os.h vendor-sys/openzfs/dist/include/os/freebsd/zfs/sys/zfs_vfsops_os.h vendor-sys/openzfs/dist/include/os/linux/kernel/linux/mod_compat.h vendor-sys/openzfs/dist/include/os/linux/spl/sys/condvar.h vendor-sys/openzfs/dist/include/os/linux/zfs/sys/Makefile.am vendor-sys/openzfs/dist/include/sys/Makefile.am vendor-sys/openzfs/dist/include/sys/dsl_synctask.h vendor-sys/openzfs/dist/include/sys/fm/fs/zfs.h vendor-sys/openzfs/dist/include/sys/fm/util.h vendor-sys/openzfs/dist/include/sys/fs/zfs.h vendor-sys/openzfs/dist/include/sys/spa.h vendor-sys/openzfs/dist/include/sys/vdev.h vendor-sys/openzfs/dist/include/sys/vdev_impl.h vendor-sys/openzfs/dist/include/sys/zfs_context.h vendor-sys/openzfs/dist/include/sys/zfs_ioctl.h vendor-sys/openzfs/dist/include/sys/zio.h vendor-sys/openzfs/dist/lib/Makefile.am vendor-sys/openzfs/dist/lib/libefi/rdwr_efi.c vendor-sys/openzfs/dist/lib/libshare/os/linux/nfs.c vendor-sys/openzfs/dist/lib/libspl/include/os/freebsd/sys/stat.h vendor-sys/openzfs/dist/lib/libzfs/libzfs.pc.in vendor-sys/openzfs/dist/lib/libzfs/libzfs_dataset.c vendor-sys/openzfs/dist/lib/libzfs/libzfs_pool.c vendor-sys/openzfs/dist/lib/libzfs/libzfs_sendrecv.c vendor-sys/openzfs/dist/lib/libzfs/libzfs_util.c vendor-sys/openzfs/dist/lib/libzfs/os/linux/libzfs_pool_os.c vendor-sys/openzfs/dist/lib/libzfs_core/libzfs_core.c vendor-sys/openzfs/dist/lib/libzfs_core/libzfs_core.pc.in vendor-sys/openzfs/dist/lib/libzpool/Makefile.am vendor-sys/openzfs/dist/lib/libzutil/Makefile.am vendor-sys/openzfs/dist/man/man5/zfs-module-parameters.5 vendor-sys/openzfs/dist/man/man8/zfs-rename.8 vendor-sys/openzfs/dist/man/man8/zfsprops.8 vendor-sys/openzfs/dist/man/man8/zgenhostid.8 vendor-sys/openzfs/dist/man/man8/zpoolprops.8 vendor-sys/openzfs/dist/module/os/freebsd/zfs/kmod_core.c vendor-sys/openzfs/dist/module/os/freebsd/zfs/sysctl_os.c vendor-sys/openzfs/dist/module/os/freebsd/zfs/vdev_file.c vendor-sys/openzfs/dist/module/os/freebsd/zfs/zfs_file_os.c vendor-sys/openzfs/dist/module/os/freebsd/zfs/zfs_vfsops.c vendor-sys/openzfs/dist/module/os/freebsd/zfs/zfs_vnops.c vendor-sys/openzfs/dist/module/os/freebsd/zfs/zfs_znode.c vendor-sys/openzfs/dist/module/os/linux/spl/spl-condvar.c vendor-sys/openzfs/dist/module/os/linux/zfs/vdev_disk.c vendor-sys/openzfs/dist/module/os/linux/zfs/vdev_file.c vendor-sys/openzfs/dist/module/os/linux/zfs/zfs_acl.c vendor-sys/openzfs/dist/module/os/linux/zfs/zfs_vfsops.c vendor-sys/openzfs/dist/module/os/linux/zfs/zpl_super.c vendor-sys/openzfs/dist/module/os/linux/zfs/zpl_xattr.c vendor-sys/openzfs/dist/module/zcommon/zfs_prop.c vendor-sys/openzfs/dist/module/zfs/arc.c vendor-sys/openzfs/dist/module/zfs/dbuf.c vendor-sys/openzfs/dist/module/zfs/dmu_redact.c vendor-sys/openzfs/dist/module/zfs/dnode.c vendor-sys/openzfs/dist/module/zfs/dsl_scan.c vendor-sys/openzfs/dist/module/zfs/dsl_synctask.c vendor-sys/openzfs/dist/module/zfs/fm.c vendor-sys/openzfs/dist/module/zfs/metaslab.c vendor-sys/openzfs/dist/module/zfs/mmp.c vendor-sys/openzfs/dist/module/zfs/range_tree.c vendor-sys/openzfs/dist/module/zfs/spa.c vendor-sys/openzfs/dist/module/zfs/spa_config.c vendor-sys/openzfs/dist/module/zfs/spa_history.c vendor-sys/openzfs/dist/module/zfs/txg.c vendor-sys/openzfs/dist/module/zfs/vdev.c vendor-sys/openzfs/dist/module/zfs/vdev_indirect.c vendor-sys/openzfs/dist/module/zfs/vdev_initialize.c vendor-sys/openzfs/dist/module/zfs/vdev_label.c vendor-sys/openzfs/dist/module/zfs/vdev_mirror.c vendor-sys/openzfs/dist/module/zfs/vdev_raidz.c vendor-sys/openzfs/dist/module/zfs/vdev_rebuild.c vendor-sys/openzfs/dist/module/zfs/vdev_removal.c vendor-sys/openzfs/dist/module/zfs/vdev_trim.c vendor-sys/openzfs/dist/module/zfs/zfs_fm.c vendor-sys/openzfs/dist/module/zfs/zfs_ioctl.c vendor-sys/openzfs/dist/module/zfs/zio.c vendor-sys/openzfs/dist/module/zfs/zthr.c vendor-sys/openzfs/dist/rpm/generic/zfs.spec.in vendor-sys/openzfs/dist/scripts/zfs-tests.sh vendor-sys/openzfs/dist/tests/runfiles/common.run vendor-sys/openzfs/dist/tests/zfs-tests/cmd/libzfs_input_check/Makefile.am vendor-sys/openzfs/dist/tests/zfs-tests/cmd/libzfs_input_check/libzfs_input_check.c vendor-sys/openzfs/dist/tests/zfs-tests/include/commands.cfg vendor-sys/openzfs/dist/tests/zfs-tests/include/tunables.cfg vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/acl/posix/posix_001_pos.ksh vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/acl/posix/posix_002_pos.ksh vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/acl/posix/setup.ksh vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/cli_root/zpool_add/add-o_ashift.ksh vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/cli_root/zpool_add/add_prop_ashift.ksh vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/cli_root/zpool_attach/attach-o_ashift.ksh vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_021_pos.ksh vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_022_pos.ksh vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/cli_root/zpool_events/Makefile.am vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/cli_root/zpool_replace/replace-o_ashift.ksh vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/cli_root/zpool_replace/replace_prop_ashift.ksh vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/cli_root/zpool_set/zpool_set_ashift.ksh vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/cli_user/misc/misc.cfg vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/history/history_002_pos.ksh vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/rsend/rsend_012_pos.ksh Modified: vendor-sys/openzfs/dist/META ============================================================================== --- vendor-sys/openzfs/dist/META Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/META Fri Sep 18 22:55:05 2020 (r365892) @@ -2,7 +2,7 @@ Meta: 1 Name: zfs Branch: 1.0 Version: 2.0.0 -Release: rc1 +Release: rc2 Release-Tags: relext License: CDDL Author: OpenZFS Modified: vendor-sys/openzfs/dist/cmd/mount_zfs/mount_zfs.c ============================================================================== --- vendor-sys/openzfs/dist/cmd/mount_zfs/mount_zfs.c Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/cmd/mount_zfs/mount_zfs.c Fri Sep 18 22:55:05 2020 (r365892) @@ -182,6 +182,7 @@ main(int argc, char **argv) int error, c; (void) setlocale(LC_ALL, ""); + (void) setlocale(LC_NUMERIC, "C"); (void) textdomain(TEXT_DOMAIN); opterr = 0; Modified: vendor-sys/openzfs/dist/cmd/zdb/zdb.c ============================================================================== --- vendor-sys/openzfs/dist/cmd/zdb/zdb.c Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/cmd/zdb/zdb.c Fri Sep 18 22:55:05 2020 (r365892) @@ -5340,11 +5340,6 @@ load_unflushed_svr_segs_cb(spa_t *spa, space_map_entry if (txg < metaslab_unflushed_txg(ms)) return (0); - vdev_indirect_mapping_t *vim = vd->vdev_indirect_mapping; - ASSERT(vim != NULL); - if (offset >= vdev_indirect_mapping_max_offset(vim)) - return (0); - if (sme->sme_type == SM_ALLOC) range_tree_add(svr->svr_allocd_segs, offset, size); else @@ -5406,9 +5401,6 @@ zdb_claim_removing(spa_t *spa, zdb_cb_t *zcb) range_tree_t *allocs = range_tree_create(NULL, RANGE_SEG64, NULL, 0, 0); for (uint64_t msi = 0; msi < vd->vdev_ms_count; msi++) { metaslab_t *msp = vd->vdev_ms[msi]; - - if (msp->ms_start >= vdev_indirect_mapping_max_offset(vim)) - break; ASSERT0(range_tree_space(allocs)); if (msp->ms_sm != NULL) Modified: vendor-sys/openzfs/dist/cmd/zfs/zfs_main.c ============================================================================== --- vendor-sys/openzfs/dist/cmd/zfs/zfs_main.c Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/cmd/zfs/zfs_main.c Fri Sep 18 22:55:05 2020 (r365892) @@ -8468,6 +8468,7 @@ main(int argc, char **argv) char **newargv; (void) setlocale(LC_ALL, ""); + (void) setlocale(LC_NUMERIC, "C"); (void) textdomain(TEXT_DOMAIN); opterr = 0; Added: vendor-sys/openzfs/dist/cmd/zgenhostid/.gitignore ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/openzfs/dist/cmd/zgenhostid/.gitignore Fri Sep 18 22:55:05 2020 (r365892) @@ -0,0 +1 @@ +/zgenhostid Modified: vendor-sys/openzfs/dist/cmd/zgenhostid/Makefile.am ============================================================================== --- vendor-sys/openzfs/dist/cmd/zgenhostid/Makefile.am Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/cmd/zgenhostid/Makefile.am Fri Sep 18 22:55:05 2020 (r365892) @@ -1 +1,5 @@ -dist_bin_SCRIPTS = zgenhostid +include $(top_srcdir)/config/Rules.am + +bin_PROGRAMS = zgenhostid + +zgenhostid_SOURCES = zgenhostid.c Added: vendor-sys/openzfs/dist/cmd/zgenhostid/zgenhostid.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/openzfs/dist/cmd/zgenhostid/zgenhostid.c Fri Sep 18 22:55:05 2020 (r365892) @@ -0,0 +1,152 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2020, Georgy Yakovlev. All rights reserved. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static void usage(void); + +static void +usage(void) +{ + (void) fprintf(stderr, + "usage: zgenhostid [-fh] [-o path] [value]\n\n" + " -f\t\t force hostid file write\n" + " -h\t\t print this usage and exit\n" + " -o \t write hostid to this file\n\n" + "If hostid file is not present, store a hostid in it.\n" + "The optional value must be an 8-digit hex number between" + "1 and 2^32-1.\n" + "If no value is provided, a random one will" + "be generated.\n" + "The value must be unique among your systems.\n"); + exit(EXIT_FAILURE); + /* NOTREACHED */ +} + +int +main(int argc, char **argv) +{ + /* default file path, can be optionally set by user */ + char path[PATH_MAX] = "/etc/hostid"; + /* holds converted user input or lrand48() generated value */ + unsigned long input_i = 0; + + int opt; + int pathlen; + int force_fwrite = 0; + while ((opt = getopt_long(argc, argv, "fo:h?", 0, 0)) != -1) { + switch (opt) { + case 'f': + force_fwrite = 1; + break; + case 'o': + pathlen = snprintf(path, sizeof (path), "%s", optarg); + if (pathlen >= sizeof (path)) { + fprintf(stderr, "%s\n", strerror(EOVERFLOW)); + exit(EXIT_FAILURE); + } else if (pathlen < 1) { + fprintf(stderr, "%s\n", strerror(EINVAL)); + exit(EXIT_FAILURE); + } + break; + case 'h': + case '?': + usage(); + } + } + + char *in_s = argv[optind]; + if (in_s != NULL) { + /* increment pointer by 2 if string is 0x prefixed */ + if (strncasecmp("0x", in_s, 2) == 0) { + in_s += 2; + } + + /* need to be exactly 8 characters */ + const char *hex = "0123456789abcdefABCDEF"; + if (strlen(in_s) != 8 || strspn(in_s, hex) != 8) { + fprintf(stderr, "%s\n", strerror(ERANGE)); + usage(); + } + + input_i = strtoul(in_s, NULL, 16); + if (errno != 0) { + perror("strtoul"); + exit(EXIT_FAILURE); + } + + if (input_i < 0x1 || input_i > UINT32_MAX) { + fprintf(stderr, "%s\n", strerror(ERANGE)); + usage(); + } + } + + struct stat fstat; + if (force_fwrite == 0 && stat(path, &fstat) == 0 && + S_ISREG(fstat.st_mode)) { + fprintf(stderr, "%s: %s\n", path, strerror(EEXIST)); + exit(EXIT_FAILURE); + } + + /* + * generate if not provided by user + * also handle unlikely zero return from lrand48() + */ + while (input_i == 0) { + srand48(getpid() ^ time(NULL)); + input_i = lrand48(); + } + + FILE *fp = fopen(path, "wb"); + if (!fp) { + perror("fopen"); + exit(EXIT_FAILURE); + } + + /* + * we need just 4 bytes in native endianess + * not using sethostid() because it may be missing or just a stub + */ + uint32_t hostid = input_i; + int written = fwrite(&hostid, 1, 4, fp); + if (written != 4) { + perror("fwrite"); + exit(EXIT_FAILURE); + } + + fclose(fp); + exit(EXIT_SUCCESS); +} Modified: vendor-sys/openzfs/dist/cmd/zpool/zpool_main.c ============================================================================== --- vendor-sys/openzfs/dist/cmd/zpool/zpool_main.c Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/cmd/zpool/zpool_main.c Fri Sep 18 22:55:05 2020 (r365892) @@ -2654,6 +2654,13 @@ show_import(nvlist_t *config) errata); break; + case ZPOOL_STATUS_NON_NATIVE_ASHIFT: + printf_color(ANSI_BOLD, gettext("status: ")); + printf_color(ANSI_YELLOW, gettext("One or more devices are " + "configured to use a non-native block size.\n" + "\tExpect reduced performance.\n")); + break; + default: /* * No other status can be seen when importing pools. @@ -10229,6 +10236,7 @@ main(int argc, char **argv) char **newargv; (void) setlocale(LC_ALL, ""); + (void) setlocale(LC_NUMERIC, "C"); (void) textdomain(TEXT_DOMAIN); srand(time(NULL)); Modified: vendor-sys/openzfs/dist/config/deb.am ============================================================================== --- vendor-sys/openzfs/dist/config/deb.am Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/config/deb.am Fri Sep 18 22:55:05 2020 (r365892) @@ -35,7 +35,7 @@ deb-dkms: deb-local rpm-dkms fakeroot $(ALIEN) --bump=0 --scripts --to-deb --target=$$debarch $$pkg1 || exit 1; \ $(RM) $$pkg1 -deb-utils: deb-local rpm-utils +deb-utils: deb-local rpm-utils-initramfs name=${PACKAGE}; \ version=${VERSION}-${RELEASE}; \ arch=`$(RPM) -qp $${name}-$${version}.src.rpm --qf %{arch} | tail -1`; \ Modified: vendor-sys/openzfs/dist/config/find_system_library.m4 ============================================================================== --- vendor-sys/openzfs/dist/config/find_system_library.m4 Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/config/find_system_library.m4 Fri Sep 18 22:55:05 2020 (r365892) @@ -11,10 +11,12 @@ AC_DEFUN([ZFS_AC_FIND_SYSTEM_LIBRARY], [ _header_found= _library_found= + _pc_found= AS_IF([test -n "$2"], [PKG_CHECK_MODULES([$1], [$2], [ _header_found=1 _library_found=1 + _pc_found=1 ], [:])]) # set _header_found/_library_found if the user passed in CFLAGS/LIBS @@ -82,6 +84,9 @@ AC_DEFUN([ZFS_AC_FIND_SYSTEM_LIBRARY], [ AS_IF([test "x$_header_found" = "x1" && test "x$_library_found" = "x1"], [ AC_SUBST([$1]_CFLAGS) AC_SUBST([$1]_LIBS) + AS_IF([test "x$_pc_found" = "x1"], [ + AC_SUBST([$1]_PC, [$2]) + ]) AC_DEFINE([HAVE_][$1], [1], [Define if you have [$5]]) $7 ],[dnl ELSE Modified: vendor-sys/openzfs/dist/config/rpm.am ============================================================================== --- vendor-sys/openzfs/dist/config/rpm.am Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/config/rpm.am Fri Sep 18 22:55:05 2020 (r365892) @@ -7,7 +7,7 @@ ############################################################################### PHONY += srpm srpms srpm-kmod srpm-dkms srpm-utils -PHONY += rpm rpms rpm-kmod rpm-dkms rpm-utils +PHONY += rpm rpms rpm-kmod rpm-dkms rpm-utils rpm-utils-initramfs PHONY += srpm-common rpm-common rpm-local srpm-kmod srpm-dkms srpm-utils: dist @@ -35,9 +35,21 @@ rpm-dkms: srpm-dkms $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-dkms" \ def='${RPM_DEFINE_COMMON} ${RPM_DEFINE_DKMS}' rpm-common +# The rpm-utils and rpm-utils-initramfs targets are identical except for the +# zfs-initramfs package: rpm-utils never includes it, rpm-utils-initramfs +# includes it if detected at configure time. The zfs-initramfs package does +# not work on any known RPM-based distribution and the resulting RPM is only +# used to create a Debian package. The rpm-utils-initramfs target is not +# intended to be specified by the user directly, it is provided as a +# dependency of the deb-utils target. + rpm-utils: srpm-utils $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}" \ def='${RPM_DEFINE_COMMON} ${RPM_DEFINE_UTIL}' rpm-common + +rpm-utils-initramfs: srpm-utils + $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}" \ + def='${RPM_DEFINE_COMMON} ${RPM_DEFINE_UTIL} ${RPM_DEFINE_INITRAMFS}' rpm-common rpm: rpm-kmod rpm-dkms rpm-utils rpms: rpm-kmod rpm-dkms rpm-utils Modified: vendor-sys/openzfs/dist/config/zfs-build.m4 ============================================================================== --- vendor-sys/openzfs/dist/config/zfs-build.m4 Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/config/zfs-build.m4 Fri Sep 18 22:55:05 2020 (r365892) @@ -282,7 +282,6 @@ AC_DEFUN([ZFS_AC_RPM], [ AS_IF([test -n "$udevruledir" ], [ RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' --define "_udevruledir $(udevruledir)"' ]) - RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' $(DEFINE_INITRAMFS)' RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' $(DEFINE_SYSTEMD)' RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' $(DEFINE_PYZFS)' RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' $(DEFINE_PAM)' @@ -542,13 +541,13 @@ AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [ AC_MSG_CHECKING([whether initramfs-tools is available]) if test -d /usr/share/initramfs-tools ; then - DEFINE_INITRAMFS='--define "_initramfs 1"' + RPM_DEFINE_INITRAMFS='--define "_initramfs 1"' AC_MSG_RESULT([yes]) else - DEFINE_INITRAMFS='' + RPM_DEFINE_INITRAMFS='' AC_MSG_RESULT([no]) fi - AC_SUBST(DEFINE_INITRAMFS) + AC_SUBST(RPM_DEFINE_INITRAMFS) ]) dnl # Modified: vendor-sys/openzfs/dist/configure.ac ============================================================================== --- vendor-sys/openzfs/dist/configure.ac Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/configure.ac Fri Sep 18 22:55:05 2020 (r365892) @@ -161,6 +161,8 @@ AC_CONFIG_FILES([ lib/libuutil/Makefile lib/libzfs/Makefile lib/libzfs/libzfs.pc + lib/libzfsbootenv/Makefile + lib/libzfsbootenv/libzfsbootenv.pc lib/libzfs_core/Makefile lib/libzfs_core/libzfs_core.pc lib/libzpool/Makefile Modified: vendor-sys/openzfs/dist/contrib/dracut/90zfs/module-setup.sh.in ============================================================================== --- vendor-sys/openzfs/dist/contrib/dracut/90zfs/module-setup.sh.in Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/contrib/dracut/90zfs/module-setup.sh.in Fri Sep 18 22:55:05 2020 (r365892) @@ -5,7 +5,7 @@ check() { [ "${1}" = "-d" ] && return 0 # Verify the zfs tool chain - for tool in "@sbindir@/zpool" "@sbindir@/zfs" "@mounthelperdir@/mount.zfs" ; do + for tool in "@bindir@/zgenhostid" "@sbindir@/zpool" "@sbindir@/zfs" "@mounthelperdir@/mount.zfs" ; do test -x "$tool" || return 1 done # Verify grep exists @@ -38,6 +38,7 @@ install() { inst_rules @udevruledir@/60-zvol.rules dracut_install hostid dracut_install grep + dracut_install @bindir@/zgenhostid dracut_install @sbindir@/zfs dracut_install @sbindir@/zpool # Workaround for zfsonlinux/zfs#4749 by ensuring libgcc_s.so(.1) is included @@ -83,11 +84,7 @@ install() { fi # Synchronize initramfs and system hostid - AA=`hostid | cut -b 1,2` - BB=`hostid | cut -b 3,4` - CC=`hostid | cut -b 5,6` - DD=`hostid | cut -b 7,8` - echo -ne "\\x${DD}\\x${CC}\\x${BB}\\x${AA}" > "${initdir}/etc/hostid" + zgenhostid -o "${initdir}/etc/hostid" "$(hostid)" if dracut_module_included "systemd"; then mkdir -p "${initdir}/$systemdsystemunitdir/zfs-import.target.wants" Modified: vendor-sys/openzfs/dist/contrib/dracut/90zfs/parse-zfs.sh.in ============================================================================== --- vendor-sys/openzfs/dist/contrib/dracut/90zfs/parse-zfs.sh.in Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/contrib/dracut/90zfs/parse-zfs.sh.in Fri Sep 18 22:55:05 2020 (r365892) @@ -6,11 +6,7 @@ spl_hostid=$(getarg spl_hostid=) if [ -n "${spl_hostid}" ] ; then info "ZFS: Using hostid from command line: ${spl_hostid}" - AA=$(echo "${spl_hostid}" | cut -b 1,2) - BB=$(echo "${spl_hostid}" | cut -b 3,4) - CC=$(echo "${spl_hostid}" | cut -b 5,6) - DD=$(echo "${spl_hostid}" | cut -b 7,8) - echo -ne "\\x${DD}\\x${CC}\\x${BB}\\x${AA}" >/etc/hostid + zgenhostid -f "${spl_hostid}" elif [ -f "/etc/hostid" ] ; then info "ZFS: Using hostid from /etc/hostid: $(hostid)" else Modified: vendor-sys/openzfs/dist/include/Makefile.am ============================================================================== --- vendor-sys/openzfs/dist/include/Makefile.am Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/include/Makefile.am Fri Sep 18 22:55:05 2020 (r365892) @@ -15,6 +15,7 @@ USER_H = \ libuutil.h \ libuutil_impl.h \ libzfs.h \ + libzfsbootenv.h \ libzfs_core.h \ libzfs_impl.h \ libzutil.h \ Modified: vendor-sys/openzfs/dist/include/libzfs.h ============================================================================== --- vendor-sys/openzfs/dist/include/libzfs.h Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/include/libzfs.h Fri Sep 18 22:55:05 2020 (r365892) @@ -892,8 +892,8 @@ extern int zpool_in_use(libzfs_handle_t *, int, pool_s * Label manipulation. */ extern int zpool_clear_label(int); -extern int zpool_set_bootenv(zpool_handle_t *, const char *); -extern int zpool_get_bootenv(zpool_handle_t *, char *, size_t, off_t); +extern int zpool_set_bootenv(zpool_handle_t *, const nvlist_t *); +extern int zpool_get_bootenv(zpool_handle_t *, nvlist_t **); /* * Management interfaces for SMB ACL files Modified: vendor-sys/openzfs/dist/include/libzfs_core.h ============================================================================== --- vendor-sys/openzfs/dist/include/libzfs_core.h Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/include/libzfs_core.h Fri Sep 18 22:55:05 2020 (r365892) @@ -135,7 +135,7 @@ int lzc_wait(const char *, zpool_wait_activity_t, bool int lzc_wait_tag(const char *, zpool_wait_activity_t, uint64_t, boolean_t *); int lzc_wait_fs(const char *, zfs_wait_activity_t, boolean_t *); -int lzc_set_bootenv(const char *, const char *); +int lzc_set_bootenv(const char *, const nvlist_t *); int lzc_get_bootenv(const char *, nvlist_t **); #ifdef __cplusplus } Added: vendor-sys/openzfs/dist/include/libzfsbootenv.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/openzfs/dist/include/libzfsbootenv.h Fri Sep 18 22:55:05 2020 (r365892) @@ -0,0 +1,41 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright 2020 Toomas Soome + */ + +#ifndef _LIBZFSBOOTENV_H +#define _LIBZFSBOOTENV_H + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum lzbe_flags { + lzbe_add, /* add data to existing nvlist */ + lzbe_replace /* replace current nvlist */ +} lzbe_flags_t; + +extern int lzbe_nvlist_get(const char *, const char *, void **); +extern int lzbe_nvlist_set(const char *, const char *, void *); +extern void lzbe_nvlist_free(void *); +extern int lzbe_add_pair(void *, const char *, const char *, void *, size_t); +extern int lzbe_remove_pair(void *, const char *); +extern int lzbe_set_boot_device(const char *, lzbe_flags_t, const char *); +extern int lzbe_get_boot_device(const char *, char **); +extern int lzbe_bootenv_print(const char *, const char *, FILE *); + +#ifdef __cplusplus +} +#endif + +#endif /* _LIBZFSBOOTENV_H */ Modified: vendor-sys/openzfs/dist/include/os/freebsd/spl/sys/ccompile.h ============================================================================== --- vendor-sys/openzfs/dist/include/os/freebsd/spl/sys/ccompile.h Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/include/os/freebsd/spl/sys/ccompile.h Fri Sep 18 22:55:05 2020 (r365892) @@ -206,8 +206,10 @@ typedef int enum_t; #define __XSI_VISIBLE 1000 #endif #define ARRAY_SIZE(a) (sizeof (a) / sizeof (a[0])) -#define open64 open #define mmap64 mmap +/* Note: this file can be used on linux/macOS when bootstrapping tools. */ +#if defined(__FreeBSD__) +#define open64 open #define pwrite64 pwrite #define ftruncate64 ftruncate #define lseek64 lseek @@ -217,6 +219,7 @@ typedef int enum_t; #define statfs64 statfs #define readdir64 readdir #define dirent64 dirent +#endif #define P2ALIGN(x, align) ((x) & -(align)) #define P2CROSS(x, y, align) (((x) ^ (y)) > (align) - 1) #define P2ROUNDUP(x, align) ((((x) - 1) | ((align) - 1)) + 1) Modified: vendor-sys/openzfs/dist/include/os/freebsd/spl/sys/condvar.h ============================================================================== --- vendor-sys/openzfs/dist/include/os/freebsd/spl/sys/condvar.h Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/include/os/freebsd/spl/sys/condvar.h Fri Sep 18 22:55:05 2020 (r365892) @@ -142,8 +142,14 @@ cv_timedwait_sig(kcondvar_t *cvp, kmutex_t *mp, clock_ return (1); } -#define cv_timedwait_io cv_timedwait -#define cv_timedwait_sig_io cv_timedwait_sig +#define cv_timedwait_io cv_timedwait +#define cv_timedwait_idle cv_timedwait +#define cv_timedwait_sig_io cv_timedwait_sig +#define cv_wait_io cv_wait +#define cv_wait_io_sig cv_wait_sig +#define cv_wait_idle cv_wait +#define cv_timedwait_io_hires cv_timedwait_hires +#define cv_timedwait_idle_hires cv_timedwait_hires static inline int cv_timedwait_hires(kcondvar_t *cvp, kmutex_t *mp, hrtime_t tim, hrtime_t res, Modified: vendor-sys/openzfs/dist/include/os/freebsd/zfs/sys/Makefile.am ============================================================================== --- vendor-sys/openzfs/dist/include/os/freebsd/zfs/sys/Makefile.am Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/include/os/freebsd/zfs/sys/Makefile.am Fri Sep 18 22:55:05 2020 (r365892) @@ -2,6 +2,7 @@ KERNEL_H = \ freebsd_crypto.h \ sha2.h \ vdev_os.h \ + zfs_bootenv_os.h \ zfs_context_os.h \ zfs_ctldir.h \ zfs_dir.h \ Added: vendor-sys/openzfs/dist/include/os/freebsd/zfs/sys/zfs_bootenv_os.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/openzfs/dist/include/os/freebsd/zfs/sys/zfs_bootenv_os.h Fri Sep 18 22:55:05 2020 (r365892) @@ -0,0 +1,29 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright 2020 Toomas Soome + */ + +#ifndef _ZFS_BOOTENV_OS_H +#define _ZFS_BOOTENV_OS_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define BOOTENV_OS BE_FREEBSD_VENDOR + +#ifdef __cplusplus +} +#endif + +#endif /* _ZFS_BOOTENV_OS_H */ Modified: vendor-sys/openzfs/dist/include/os/freebsd/zfs/sys/zfs_context_os.h ============================================================================== --- vendor-sys/openzfs/dist/include/os/freebsd/zfs/sys/zfs_context_os.h Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/include/os/freebsd/zfs/sys/zfs_context_os.h Fri Sep 18 22:55:05 2020 (r365892) @@ -41,9 +41,6 @@ #include #include -#define cv_wait_io(cv, mp) cv_wait(cv, mp) -#define cv_wait_io_sig(cv, mp) cv_wait_sig(cv, mp) - #define cond_resched() kern_yield(PRI_USER) #define taskq_create_sysdc(a, b, d, e, p, dc, f) \ @@ -75,7 +72,7 @@ extern struct mtx zfs_debug_mtx; } \ } while (0) -#define MSEC_TO_TICK(msec) ((msec) / (MILLISEC / hz)) +#define MSEC_TO_TICK(msec) (howmany((hrtime_t)(msec) * hz, MILLISEC)) extern int hz; extern int tick; typedef int fstrans_cookie_t; @@ -84,7 +81,6 @@ typedef int fstrans_cookie_t; #define signal_pending(x) SIGPENDING(x) #define current curthread #define thread_join(x) -#define cv_wait_io(cv, mp) cv_wait(cv, mp) typedef struct opensolaris_utsname utsname_t; extern utsname_t *utsname(void); extern int spa_import_rootpool(const char *name, bool checkpointrewind); Modified: vendor-sys/openzfs/dist/include/os/freebsd/zfs/sys/zfs_vfsops_os.h ============================================================================== --- vendor-sys/openzfs/dist/include/os/freebsd/zfs/sys/zfs_vfsops_os.h Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/include/os/freebsd/zfs/sys/zfs_vfsops_os.h Fri Sep 18 22:55:05 2020 (r365892) @@ -27,18 +27,31 @@ #ifndef _SYS_FS_ZFS_VFSOPS_H #define _SYS_FS_ZFS_VFSOPS_H +#if __FreeBSD_version >= 1300109 +#define TEARDOWN_INACTIVE_RMS +#endif + #include #include #include #include #include #include +#ifdef TEARDOWN_INACTIVE_RMS +#include +#endif #include #ifdef __cplusplus extern "C" { #endif +#ifdef TEARDOWN_INACTIVE_RMS +typedef struct rmslock zfs_teardown_lock_t; +#else +#define zfs_teardown_lock_t krwlock_t +#endif + typedef struct zfsvfs zfsvfs_t; struct znode; @@ -67,7 +80,7 @@ struct zfsvfs { boolean_t z_atime; /* enable atimes mount option */ boolean_t z_unmounted; /* unmounted */ rrmlock_t z_teardown_lock; - krwlock_t z_teardown_inactive_lock; + zfs_teardown_lock_t z_teardown_inactive_lock; list_t z_all_znodes; /* all vnodes in the fs */ uint64_t z_nr_znodes; /* number of znodes in the fs */ kmutex_t z_znodes_lock; /* lock for z_all_znodes */ @@ -97,6 +110,56 @@ struct zfsvfs { kmutex_t z_hold_mtx[ZFS_OBJ_MTX_SZ]; /* znode hold locks */ struct task z_unlinked_drain_task; }; + +#ifdef TEARDOWN_INACTIVE_RMS +#define ZFS_INIT_TEARDOWN_INACTIVE(zfsvfs) \ + rms_init(&(zfsvfs)->z_teardown_inactive_lock, "zfs teardown inactive") + +#define ZFS_DESTROY_TEARDOWN_INACTIVE(zfsvfs) \ + rms_destroy(&(zfsvfs)->z_teardown_inactive_lock) + +#define ZFS_TRYRLOCK_TEARDOWN_INACTIVE(zfsvfs) \ + rms_try_rlock(&(zfsvfs)->z_teardown_inactive_lock) + +#define ZFS_RLOCK_TEARDOWN_INACTIVE(zfsvfs) \ + rms_rlock(&(zfsvfs)->z_teardown_inactive_lock) + +#define ZFS_RUNLOCK_TEARDOWN_INACTIVE(zfsvfs) \ + rms_runlock(&(zfsvfs)->z_teardown_inactive_lock) + +#define ZFS_WLOCK_TEARDOWN_INACTIVE(zfsvfs) \ + rms_wlock(&(zfsvfs)->z_teardown_inactive_lock) + +#define ZFS_WUNLOCK_TEARDOWN_INACTIVE(zfsvfs) \ + rms_wunlock(&(zfsvfs)->z_teardown_inactive_lock) + +#define ZFS_TEARDOWN_INACTIVE_WLOCKED(zfsvfs) \ + rms_wowned(&(zfsvfs)->z_teardown_inactive_lock) +#else +#define ZFS_INIT_TEARDOWN_INACTIVE(zfsvfs) \ + rw_init(&(zfsvfs)->z_teardown_inactive_lock, NULL, RW_DEFAULT, NULL) + +#define ZFS_DESTROY_TEARDOWN_INACTIVE(zfsvfs) \ + rw_destroy(&(zfsvfs)->z_teardown_inactive_lock) + +#define ZFS_TRYRLOCK_TEARDOWN_INACTIVE(zfsvfs) \ + rw_tryenter(&(zfsvfs)->z_teardown_inactive_lock, RW_READER) + +#define ZFS_RLOCK_TEARDOWN_INACTIVE(zfsvfs) \ + rw_enter(&(zfsvfs)->z_teardown_inactive_lock, RW_READER) + +#define ZFS_RUNLOCK_TEARDOWN_INACTIVE(zfsvfs) \ + rw_exit(&(zfsvfs)->z_teardown_inactive_lock) + +#define ZFS_WLOCK_TEARDOWN_INACTIVE(zfsvfs) \ + rw_enter(&(zfsvfs)->z_teardown_inactive_lock, RW_WRITER) + +#define ZFS_WUNLOCK_TEARDOWN_INACTIVE(zfsvfs) \ + rw_exit(&(zfsvfs)->z_teardown_inactive_lock) + +#define ZFS_TEARDOWN_INACTIVE_WLOCKED(zfsvfs) \ + RW_WRITE_HELD(&(zfsvfs)->z_teardown_inactive_lock) +#endif #define ZSB_XATTR 0x0001 /* Enable user xattrs */ /* Modified: vendor-sys/openzfs/dist/include/os/linux/kernel/linux/mod_compat.h ============================================================================== --- vendor-sys/openzfs/dist/include/os/linux/kernel/linux/mod_compat.h Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/include/os/linux/kernel/linux/mod_compat.h Fri Sep 18 22:55:05 2020 (r365892) @@ -21,6 +21,7 @@ /* * Copyright (C) 2016 Gvozden Neskovic . + * Copyright (c) 2020 by Delphix. All rights reserved. */ #ifndef _MOD_COMPAT_H @@ -71,6 +72,7 @@ enum scope_prefix_types { zfs_txg, zfs_vdev, zfs_vdev_cache, + zfs_vdev_file, zfs_vdev_mirror, zfs_zevent, zfs_zio, Modified: vendor-sys/openzfs/dist/include/os/linux/spl/sys/condvar.h ============================================================================== --- vendor-sys/openzfs/dist/include/os/linux/spl/sys/condvar.h Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/include/os/linux/spl/sys/condvar.h Fri Sep 18 22:55:05 2020 (r365892) @@ -80,15 +80,19 @@ extern void __cv_init(kcondvar_t *, char *, kcv_type_t extern void __cv_destroy(kcondvar_t *); extern void __cv_wait(kcondvar_t *, kmutex_t *); extern void __cv_wait_io(kcondvar_t *, kmutex_t *); +extern void __cv_wait_idle(kcondvar_t *, kmutex_t *); extern int __cv_wait_io_sig(kcondvar_t *, kmutex_t *); extern int __cv_wait_sig(kcondvar_t *, kmutex_t *); extern int __cv_timedwait(kcondvar_t *, kmutex_t *, clock_t); extern int __cv_timedwait_io(kcondvar_t *, kmutex_t *, clock_t); extern int __cv_timedwait_sig(kcondvar_t *, kmutex_t *, clock_t); +extern int __cv_timedwait_idle(kcondvar_t *, kmutex_t *, clock_t); extern int cv_timedwait_hires(kcondvar_t *, kmutex_t *, hrtime_t, hrtime_t res, int flag); extern int cv_timedwait_sig_hires(kcondvar_t *, kmutex_t *, hrtime_t, hrtime_t res, int flag); +extern int cv_timedwait_idle_hires(kcondvar_t *, kmutex_t *, hrtime_t, + hrtime_t res, int flag); extern void __cv_signal(kcondvar_t *); extern void __cv_broadcast(kcondvar_t *c); @@ -96,6 +100,7 @@ extern void __cv_broadcast(kcondvar_t *c); #define cv_destroy(cvp) __cv_destroy(cvp) #define cv_wait(cvp, mp) __cv_wait(cvp, mp) #define cv_wait_io(cvp, mp) __cv_wait_io(cvp, mp) +#define cv_wait_idle(cvp, mp) __cv_wait_idle(cvp, mp) #define cv_wait_io_sig(cvp, mp) __cv_wait_io_sig(cvp, mp) #define cv_wait_sig(cvp, mp) __cv_wait_sig(cvp, mp) #define cv_signal(cvp) __cv_signal(cvp) @@ -109,5 +114,7 @@ extern void __cv_broadcast(kcondvar_t *c); #define cv_timedwait(cvp, mp, t) __cv_timedwait(cvp, mp, t) #define cv_timedwait_io(cvp, mp, t) __cv_timedwait_io(cvp, mp, t) #define cv_timedwait_sig(cvp, mp, t) __cv_timedwait_sig(cvp, mp, t) +#define cv_timedwait_idle(cvp, mp, t) __cv_timedwait_idle(cvp, mp, t) + #endif /* _SPL_CONDVAR_H */ Modified: vendor-sys/openzfs/dist/include/os/linux/zfs/sys/Makefile.am ============================================================================== --- vendor-sys/openzfs/dist/include/os/linux/zfs/sys/Makefile.am Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/include/os/linux/zfs/sys/Makefile.am Fri Sep 18 22:55:05 2020 (r365892) @@ -16,6 +16,7 @@ KERNEL_H = \ trace_zil.h \ trace_zio.h \ trace_zrlock.h \ + zfs_bootenv_os.h \ zfs_context_os.h \ zfs_ctldir.h \ zfs_dir.h \ Added: vendor-sys/openzfs/dist/include/os/linux/zfs/sys/zfs_bootenv_os.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/openzfs/dist/include/os/linux/zfs/sys/zfs_bootenv_os.h Fri Sep 18 22:55:05 2020 (r365892) @@ -0,0 +1,29 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright 2020 Toomas Soome + */ + +#ifndef _ZFS_BOOTENV_OS_H +#define _ZFS_BOOTENV_OS_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define BOOTENV_OS BE_LINUX_VENDOR + +#ifdef __cplusplus +} +#endif + +#endif /* _ZFS_BOOTENV_OS_H */ Modified: vendor-sys/openzfs/dist/include/sys/Makefile.am ============================================================================== --- vendor-sys/openzfs/dist/include/sys/Makefile.am Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/include/sys/Makefile.am Fri Sep 18 22:55:05 2020 (r365892) @@ -102,6 +102,7 @@ COMMON_H = \ zcp_set.h \ zfeature.h \ zfs_acl.h \ + zfs_bootenv.h \ zfs_context.h \ zfs_debug.h \ zfs_delay.h \ Modified: vendor-sys/openzfs/dist/include/sys/dsl_synctask.h ============================================================================== --- vendor-sys/openzfs/dist/include/sys/dsl_synctask.h Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/include/sys/dsl_synctask.h Fri Sep 18 22:55:05 2020 (r365892) @@ -112,11 +112,11 @@ void dsl_sync_task_sync(dsl_sync_task_t *, dmu_tx_t *) int dsl_sync_task(const char *, dsl_checkfunc_t *, dsl_syncfunc_t *, void *, int, zfs_space_check_t); void dsl_sync_task_nowait(struct dsl_pool *, dsl_syncfunc_t *, - void *, int, zfs_space_check_t, dmu_tx_t *); + void *, dmu_tx_t *); int dsl_early_sync_task(const char *, dsl_checkfunc_t *, dsl_syncfunc_t *, void *, int, zfs_space_check_t); void dsl_early_sync_task_nowait(struct dsl_pool *, dsl_syncfunc_t *, - void *, int, zfs_space_check_t, dmu_tx_t *); + void *, dmu_tx_t *); int dsl_sync_task_sig(const char *, dsl_checkfunc_t *, dsl_syncfunc_t *, dsl_sigfunc_t *, void *, int, zfs_space_check_t); Modified: vendor-sys/openzfs/dist/include/sys/fm/fs/zfs.h ============================================================================== --- vendor-sys/openzfs/dist/include/sys/fm/fs/zfs.h Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/include/sys/fm/fs/zfs.h Fri Sep 18 22:55:05 2020 (r365892) @@ -23,6 +23,10 @@ * Use is subject to license terms. */ +/* + * Copyright (c) 2020 by Delphix. All rights reserved. + */ + #ifndef _SYS_FM_FS_ZFS_H #define _SYS_FM_FS_ZFS_H @@ -88,6 +92,7 @@ extern "C" { #define FM_EREPORT_PAYLOAD_ZFS_ZIO_SIZE "zio_size" #define FM_EREPORT_PAYLOAD_ZFS_ZIO_FLAGS "zio_flags" #define FM_EREPORT_PAYLOAD_ZFS_ZIO_STAGE "zio_stage" +#define FM_EREPORT_PAYLOAD_ZFS_ZIO_PRIORITY "zio_priority" #define FM_EREPORT_PAYLOAD_ZFS_ZIO_PIPELINE "zio_pipeline" #define FM_EREPORT_PAYLOAD_ZFS_ZIO_DELAY "zio_delay" #define FM_EREPORT_PAYLOAD_ZFS_ZIO_TIMESTAMP "zio_timestamp" Modified: vendor-sys/openzfs/dist/include/sys/fm/util.h ============================================================================== --- vendor-sys/openzfs/dist/include/sys/fm/util.h Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/include/sys/fm/util.h Fri Sep 18 22:55:05 2020 (r365892) @@ -104,6 +104,9 @@ extern int zfs_zevent_seek(zfs_zevent_t *, uint64_t); extern void zfs_zevent_init(zfs_zevent_t **); extern void zfs_zevent_destroy(zfs_zevent_t *); +extern void zfs_zevent_track_duplicate(void); +extern void zfs_ereport_init(void); +extern void zfs_ereport_fini(void); #else static inline void fm_init(void) { } Modified: vendor-sys/openzfs/dist/include/sys/fs/zfs.h ============================================================================== --- vendor-sys/openzfs/dist/include/sys/fs/zfs.h Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/include/sys/fs/zfs.h Fri Sep 18 22:55:05 2020 (r365892) @@ -1336,8 +1336,8 @@ typedef enum zfs_ioc { ZFS_IOC_NEXTBOOT, /* 0x84 (FreeBSD) */ ZFS_IOC_JAIL, /* 0x85 (FreeBSD) */ ZFS_IOC_UNJAIL, /* 0x86 (FreeBSD) */ - ZFS_IOC_SET_BOOTENV, /* 0x87 (Linux) */ - ZFS_IOC_GET_BOOTENV, /* 0x88 (Linux) */ + ZFS_IOC_SET_BOOTENV, /* 0x87 */ + ZFS_IOC_GET_BOOTENV, /* 0x88 */ ZFS_IOC_LAST } zfs_ioc_t; Modified: vendor-sys/openzfs/dist/include/sys/spa.h ============================================================================== --- vendor-sys/openzfs/dist/include/sys/spa.h Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/include/sys/spa.h Fri Sep 18 22:55:05 2020 (r365892) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2019 by Delphix. All rights reserved. + * Copyright (c) 2011, 2020 by Delphix. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. * Copyright 2013 Saso Kiselkov. All rights reserved. @@ -1145,10 +1145,10 @@ extern const char *spa_state_to_name(spa_t *spa); struct zbookmark_phys; extern void spa_log_error(spa_t *spa, const zbookmark_phys_t *zb); extern int zfs_ereport_post(const char *clazz, spa_t *spa, vdev_t *vd, - const zbookmark_phys_t *zb, zio_t *zio, uint64_t stateoroffset, - uint64_t length); + const zbookmark_phys_t *zb, zio_t *zio, uint64_t state); extern boolean_t zfs_ereport_is_valid(const char *clazz, spa_t *spa, vdev_t *vd, zio_t *zio); +extern void zfs_ereport_taskq_fini(void); extern nvlist_t *zfs_event_create(spa_t *spa, vdev_t *vd, const char *type, const char *name, nvlist_t *aux); extern void zfs_post_remove(spa_t *spa, vdev_t *vd); Modified: vendor-sys/openzfs/dist/include/sys/vdev.h ============================================================================== --- vendor-sys/openzfs/dist/include/sys/vdev.h Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/include/sys/vdev.h Fri Sep 18 22:55:05 2020 (r365892) @@ -94,7 +94,6 @@ extern void vdev_rele(vdev_t *); extern int vdev_metaslab_init(vdev_t *vd, uint64_t txg); extern void vdev_metaslab_fini(vdev_t *vd); extern void vdev_metaslab_set_size(vdev_t *); -extern void vdev_ashift_optimize(vdev_t *); extern void vdev_expand(vdev_t *vd, uint64_t txg); extern void vdev_split(vdev_t *vd); extern void vdev_deadman(vdev_t *vd, char *tag); @@ -181,7 +180,7 @@ extern void vdev_config_generate_stats(vdev_t *vd, nvl extern void vdev_label_write(zio_t *zio, vdev_t *vd, int l, abd_t *buf, uint64_t offset, uint64_t size, zio_done_func_t *done, void *priv, int flags); extern int vdev_label_read_bootenv(vdev_t *, nvlist_t *); -extern int vdev_label_write_bootenv(vdev_t *, char *); +extern int vdev_label_write_bootenv(vdev_t *, nvlist_t *); typedef enum { VDEV_LABEL_CREATE, /* create/add a new device */ Modified: vendor-sys/openzfs/dist/include/sys/vdev_impl.h ============================================================================== --- vendor-sys/openzfs/dist/include/sys/vdev_impl.h Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/include/sys/vdev_impl.h Fri Sep 18 22:55:05 2020 (r365892) @@ -476,7 +476,16 @@ typedef struct vdev_phys { } vdev_phys_t; typedef enum vbe_vers { - /* The bootenv file is stored as ascii text in the envblock */ + /* + * The bootenv file is stored as ascii text in the envblock. + * It is used by the GRUB bootloader used on Linux to store the + * contents of the grubenv file. The file is stored as raw ASCII, + * and is protected by an embedded checksum. By default, GRUB will + * check if the boot filesystem supports storing the environment data + * in a special location, and if so, will invoke filesystem specific + * logic to retrieve it. This can be overriden by a variable, should + * the user so desire. + */ VB_RAW = 0, /* Added: vendor-sys/openzfs/dist/include/sys/zfs_bootenv.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/openzfs/dist/include/sys/zfs_bootenv.h Fri Sep 18 22:55:05 2020 (r365892) @@ -0,0 +1,53 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright 2020 Toomas Soome + */ + +#ifndef _ZFS_BOOTENV_H +#define _ZFS_BOOTENV_H + +/* + * Define macros for label bootenv nvlist pair keys. + */ + +#ifdef __cplusplus +extern "C" { +#endif + +#define BOOTENV_VERSION "version" + +#define BE_ILLUMOS_VENDOR "illumos" +#define BE_FREEBSD_VENDOR "freebsd" +#define BE_GRUB_VENDOR "grub" +#define BE_LINUX_VENDOR "linux" + +#include + +#define GRUB_ENVMAP BE_GRUB_VENDOR ":" "envmap" + +#define FREEBSD_BOOTONCE BE_FREEBSD_VENDOR ":" "bootonce" +#define FREEBSD_BOOTONCE_USED BE_FREEBSD_VENDOR ":" "bootonce-used" +#define FREEBSD_NVSTORE BE_FREEBSD_VENDOR ":" "nvstore" +#define ILLUMOS_BOOTONCE BE_ILLUMOS_VENDOR ":" "bootonce" +#define ILLUMOS_BOOTONCE_USED BE_ILLUMOS_VENDOR ":" "bootonce-used" +#define ILLUMOS_NVSTORE BE_ILLUMOS_VENDOR ":" "nvstore" + +#define OS_BOOTONCE BOOTENV_OS ":" "bootonce" +#define OS_BOOTONCE_USED BOOTENV_OS ":" "bootonce-used" +#define OS_NVSTORE BOOTENV_OS ":" "nvstore" + +#ifdef __cplusplus +} +#endif + +#endif /* _ZFS_BOOTENV_H */ Modified: vendor-sys/openzfs/dist/include/sys/zfs_context.h ============================================================================== --- vendor-sys/openzfs/dist/include/sys/zfs_context.h Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/include/sys/zfs_context.h Fri Sep 18 22:55:05 2020 (r365892) @@ -325,11 +325,15 @@ extern void cv_signal(kcondvar_t *cv); extern void cv_broadcast(kcondvar_t *cv); #define cv_timedwait_io(cv, mp, at) cv_timedwait(cv, mp, at) +#define cv_timedwait_idle(cv, mp, at) cv_timedwait(cv, mp, at) #define cv_timedwait_sig(cv, mp, at) cv_timedwait(cv, mp, at) #define cv_wait_io(cv, mp) cv_wait(cv, mp) +#define cv_wait_idle(cv, mp) cv_wait(cv, mp) #define cv_wait_io_sig(cv, mp) cv_wait_sig(cv, mp) #define cv_timedwait_sig_hires(cv, mp, t, r, f) \ cv_timedwait_hires(cv, mp, t, r, f) +#define cv_timedwait_idle_hires(cv, mp, t, r, f) \ + cv_timedwait_hires(cv, mp, t, r, f) /* * Thread-specific data @@ -598,9 +602,9 @@ typedef struct vsecattr { extern void delay(clock_t ticks); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@freebsd.org Fri Sep 18 22:59:45 2020 Return-Path: Delivered-To: svn-src-vendor@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7ED833F2F4E; Fri, 18 Sep 2020 22:59:45 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BtTmx2nBSz4H9h; Fri, 18 Sep 2020 22:59:45 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 285D722626; Fri, 18 Sep 2020 22:59:45 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08IMxjOX059296; Fri, 18 Sep 2020 22:59:45 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08IMxjLe059295; Fri, 18 Sep 2020 22:59:45 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <202009182259.08IMxjLe059295@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Fri, 18 Sep 2020 22:59:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r365893 - vendor-sys/openzfs/2.0-rc2-g4ce06f X-SVN-Group: vendor-sys X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: vendor-sys/openzfs/2.0-rc2-g4ce06f X-SVN-Commit-Revision: 365893 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2020 22:59:45 -0000 Author: mmacy Date: Fri Sep 18 22:59:44 2020 New Revision: 365893 URL: https://svnweb.freebsd.org/changeset/base/365893 Log: Checkpoint 2.0-rc2-g4ce06f Added: vendor-sys/openzfs/2.0-rc2-g4ce06f/ - copied from r365892, vendor-sys/openzfs/dist/