From nobody Sat Nov 05 00:43:28 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4N3zJ04qQpz4hCLD; Sat, 5 Nov 2022 00:43:28 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4N3zJ03vdDz3Nxh; Sat, 5 Nov 2022 00:43:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667609008; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0tZxAi7Bp50PehCRrZQxTA8pQWGLmg0SIy9oeOhbhEw=; b=LQZTy3chHaJNcDAKkWOym8b16FsNP6mhpD7ijhYIvsr/sQD72oOxmx2VQ26d4BlAM+CNCx jZqRjQZVsMi0Y4G5L5iJtaAPQV7ln8GZ56FVh2CkE1gfLZnJZk7gBV0i/2dgnTqGJ4Ta0l gi6HfG5JeT9JR3sMIvrwyHoTmLtgMI/B4eEAsrm/W6fYfJ2cz7cC6W2AXlQf3yEnxC2YBw 0ak4wSfUGJ6MmnoUHkkjfUDX1A30oIBUcTQWBIJUaMfAurrpQoxIpAHxAoTkhNjWnM8nDn jHjnoQXZWLhqr5y0lYG3F2MD4NjxRc4YVJ5IpCj7rP1WjBd81J0Vrga8LjVePg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4N3zJ02yZrzMVq; Sat, 5 Nov 2022 00:43:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2A50hSgC088605; Sat, 5 Nov 2022 00:43:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2A50hSIx088604; Sat, 5 Nov 2022 00:43:28 GMT (envelope-from git) Date: Sat, 5 Nov 2022 00:43:28 GMT Message-Id: <202211050043.2A50hSIx088604@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 9c231325e77b - main - Clang: Add Diags for targets pre to i686 for -fcf-protection List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9c231325e77b1989c006daf083a3e9bd143c3d07 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667609008; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0tZxAi7Bp50PehCRrZQxTA8pQWGLmg0SIy9oeOhbhEw=; b=bn7MzOd5Q7E2LmBkWwtnEDiZ5YWr18VDVBWQI4AjGSQLBk0goHj3Qj4OlaXBZXBJt05MCG NNDL6IxJ7BevmIIJVmBe1u8pLDxiAebbE9T5h+99mdcY2SBv0AiqpX4RT4CNUhbWwAi9E9 lKD7PCMsS0jGvm0rwKfpf3WrYD4ANkqBdM++LJ+ZN+G9bcsYXyHASbl38NjQ5ppN/h+Gah lLXYSzHjoGEmRgFhwdo9WrBR9RwTm87nAyaWxEITKCSW9QOToBy5cgq4i0Q89AySX94tL1 X/5MUN3TKKIzzKKgopIib43H38tJhU1N7yJ/3A19aBq8emTGLdLFUouxmORlaA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1667609008; a=rsa-sha256; cv=none; b=uPvIAAF62CUz3Ldn95Ox+hABQeWgZLwbwgQNcCs14uc+uAeGwat1dUBdNhZQgebpdFruWv lxAWJLrP7549rY3i+rFiPTdyHbNj1TpgJuhQYsWqlXDSiQhIcdqD258kq8OvWVPrtFYO6+ +1JJspziXQZe5lxMNo2yQRjdvc4UXlsDP/R87gk8J9Lg3++BUyWkKVfi9eUaeY6ccZQmpP Ijzl+YZ9xd04BFw5yMRtWsN+RgtlBCi5A2k9DvryyYsAdl6r6JZRhSebuaMlY+5LTkZtnP APTEavuXha9AorUaObLLSjj/4LZB8sVFblpbVBJ1U684J9fyGeUmoUsHwsmDPw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=9c231325e77b1989c006daf083a3e9bd143c3d07 commit 9c231325e77b1989c006daf083a3e9bd143c3d07 Author: Ed Maste AuthorDate: 2022-11-04 15:59:49 +0000 Commit: Ed Maste CommitDate: 2022-11-05 00:42:26 +0000 Clang: Add Diags for targets pre to i686 for -fcf-protection Intel Control-flow Enforcement Technology (CET) provides new instructions `endbr32/64` for the indirect branch control. They are NOPs on i686 and new targets. We need to check for that in case it crashes on older targets. PR: 264497 Reviewed by: dim MFC after: 1 week Obtained from: LLVM commit 52516782972730ff065a34123a9d8876da08c254 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D37268 --- contrib/llvm-project/clang/lib/Basic/Targets/X86.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/contrib/llvm-project/clang/lib/Basic/Targets/X86.h b/contrib/llvm-project/clang/lib/Basic/Targets/X86.h index d1b66432e38b..b34a16bb5f5b 100644 --- a/contrib/llvm-project/clang/lib/Basic/Targets/X86.h +++ b/contrib/llvm-project/clang/lib/Basic/Targets/X86.h @@ -223,12 +223,16 @@ public: virtual bool checkCFProtectionReturnSupported(DiagnosticsEngine &Diags) const override { - return true; + if (CPU == llvm::X86::CK_None || CPU >= llvm::X86::CK_PentiumPro) + return true; + return TargetInfo::checkCFProtectionReturnSupported(Diags); }; virtual bool checkCFProtectionBranchSupported(DiagnosticsEngine &Diags) const override { - return true; + if (CPU == llvm::X86::CK_None || CPU >= llvm::X86::CK_PentiumPro) + return true; + return TargetInfo::checkCFProtectionBranchSupported(Diags); }; virtual bool validateOperandSize(const llvm::StringMap &FeatureMap,