From nobody Thu Nov 10 21:48:06 2022 X-Original-To: dev-commits-src-all@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 4N7b6v1mkQz4XMkM; Thu, 10 Nov 2022 21:48:07 +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 4N7b6v10kfz4J8b; Thu, 10 Nov 2022 21:48:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668116887; 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=fHNpofjuAKIVoNPtpMZwYLoManjeca9GRhSaZOeBrYo=; b=vi+ifFom2udQbeRdwnt7QpQKmqjniORIO0/452YmsLr81s/IJilPI5X1R2IzfZpdiOYYsf Rtoplaty1/Mj9GWW0iH9rM0rrZe3GqMAcH57M0Av36tHGYphG1fqfFXgLScnVnleq8nVXo rlrAWDj/gDJeqvl3cFbNwi+xysyMxcm/rS9y0xkINyxkqHc67oJwEMdX+cqjYfhrVFK/pN IYXdOuflb1aC5YLzdPfrFlUQQnoU/N+PjEWxhp93K7nOToTGDvHKS+RH/wnh4t7IYgtkBv 3maCi0NycFsBkvDEkRV3Uf4S8M3vPdHYNATyHoLN6i6OO7qovh1CPjZDhDI1MA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668116887; 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=fHNpofjuAKIVoNPtpMZwYLoManjeca9GRhSaZOeBrYo=; b=be+o3kZSemmb5KaFH0oSnEMR0+szYl4/lOsuUtc3mJx6WPVim390kVLM+ICo6t692VNxyW oexOwxuF4LMLOpxPUL7l+h3HaY+2ewOSjo/s6aOwKQKW9mOoDU7LDMo//pcIpT+Tye6dFr Wmx1aPynVWnxtfG9kt4P2ZciCDsIKP+ncCwv0iiFG25UUK5CjadslxFWE69VEj2XhYgUhg 3unaGy/u72hqAv5834PHiQOyhkg2RpKPdl/edBowSEqISsblstt2G3/rgrO2RMw8XBtdzV haZY5jV3LV7HSwiw7q53KSnoDDfWy2JoBnDYMBszuTarwx695BR4tnhmxG56/Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1668116887; a=rsa-sha256; cv=none; b=YyCiOPcVdktZycFtETgV0XQnu2ODk8Ix0JRNwotukvcZIzqKnFSBoCErN+21fLogqUVdRH BPMDngyR/asdM6e2tzMhamxUH1+86XyvXs2AqokaT/4e5Xnd55YDNzps4d55psK8d4o+iL kJsFUlDhwat340sUWndssiuMI6NQb6lxO9mPcADrNSvfjo+KRVX2b9q+ced32evK8CflGF fT+D5+ZNsKxlnwOSLzPw7+aK3C+fsq/+Ht3ceCqRCGFHNTK/R+P4VhR65dNy8rEW8KB7J/ CdPnUoDKjOfofS16skveTPGP11yRqdN7nfzU7j/P8hcnLLd7yZ121Oim5DvmzQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4N7b6t6wH2zHfx; Thu, 10 Nov 2022 21:48:06 +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 2AALm6iT014048; Thu, 10 Nov 2022 21:48:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2AALm6pP014047; Thu, 10 Nov 2022 21:48:06 GMT (envelope-from git) Date: Thu, 10 Nov 2022 21:48:06 GMT Message-Id: <202211102148.2AALm6pP014047@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: b0da3d887c4b - stable/13 - Clang: Add Diags for targets pre to i686 for -fcf-protection List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/stable/13 X-Git-Reftype: branch X-Git-Commit: b0da3d887c4b3e9e1b35f4c0e9696fa6d339e82f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=b0da3d887c4b3e9e1b35f4c0e9696fa6d339e82f commit b0da3d887c4b3e9e1b35f4c0e9696fa6d339e82f Author: Ed Maste AuthorDate: 2022-11-04 15:59:49 +0000 Commit: Ed Maste CommitDate: 2022-11-10 21:47:48 +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, 267401 Reviewed by: dim MFC after: 1 week Obtained from: LLVM commit 52516782972730ff065a34123a9d8876da08c254 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D37268 (cherry picked from commit 9c231325e77b1989c006daf083a3e9bd143c3d07) --- 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,