From patchwork Mon Apr 23 12:10:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 902909 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-476717-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=intel.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="tNMd85Co"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40V5146szVz9rx7 for ; Mon, 23 Apr 2018 22:11:52 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:reply-to:mime-version :content-type; q=dns; s=default; b=iX8qx8WnbLQuuJscNmvJoQ8u83WBZ ZIbH0f+YLR0jyJ2ohnfswhkUpJZFbP1oZkB3k5IVXQRt7ohafk5vVTKNyeFNG6LC td6oYfu7G/es0EULxmNnZlJjqClnEW2AWkkCzyCyh0xzB91Kn8Z5C+XI5h7ESl2o eFKhMC5Rw7KpjM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:reply-to:mime-version :content-type; s=default; bh=0tRBQb+rvTYpWaH1/PYvoGT+4lw=; b=tNM d85CogVnAUYnOenfpz3zlKcVb9/Qvrlbi9Ypg5TbchVeY9wL4/pevLtErxhHO0Or PQcKZ9ZFJQScRqkkBBa/Ccf4FDnmr3yO7LvwSgTcIHBF601ppPF6Vuym29B7X4FL BttN8o/x1yh9zddU7MllXp3I+0d1tmvOnlqyzros= Received: (qmail 76834 invoked by alias); 23 Apr 2018 12:11:45 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 76715 invoked by uid 89); 23 Apr 2018 12:11:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, NO_DNS_FOR_FROM autolearn=ham version=3.3.2 spammy=Hx-languages-length:1119 X-HELO: mga11.intel.com Received: from mga11.intel.com (HELO mga11.intel.com) (192.55.52.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 23 Apr 2018 12:11:22 +0000 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Apr 2018 05:10:50 -0700 X-ExtLoop1: 1 Received: from gnu-skx-1.sc.intel.com ([172.25.70.206]) by fmsmga007.fm.intel.com with ESMTP; 23 Apr 2018 05:10:50 -0700 Received: by gnu-skx-1.sc.intel.com (Postfix, from userid 1000) id 358F4E00CA; Mon, 23 Apr 2018 05:10:50 -0700 (PDT) Date: Mon, 23 Apr 2018 05:10:50 -0700 From: "H.J. Lu" To: gcc-patches@gcc.gnu.org Cc: Igor Tsimbalist , Uros Bizjak Subject: [PATCH] x86/cet: Use unsigned integer to unwind shadow stack Message-ID: <20180423121050.GA63877@intel.com> Reply-To: "H.J. Lu" MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.9.2 (2017-12-15) Use unsigned integer to unwind shadow stack by replacing jle with jbe and jg with ja. OK for trunk? H.J. --- PR target/85489 * config/x86/sjlj.S (GTM_longjmp): Replace jle/jg with jbe/ja. --- libitm/config/x86/sjlj.S | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libitm/config/x86/sjlj.S b/libitm/config/x86/sjlj.S index 3cac9099c9e..e5cdbab48a7 100644 --- a/libitm/config/x86/sjlj.S +++ b/libitm/config/x86/sjlj.S @@ -235,7 +235,7 @@ SYM(GTM_longjmp): /* If # of frames is greater 255 then loop and adjust. */ cmpq $255, %rcx - jle .L3 + jbe .L3 movl $255, %edi .p2align 4,,10 .p2align 3 @@ -243,7 +243,7 @@ SYM(GTM_longjmp): incsspq %rdi subq $255, %rcx cmpq $255, %rcx - jg .L4 + ja .L4 .L3: incsspq %rcx .L1: @@ -273,7 +273,7 @@ SYM(GTM_longjmp): /* If # of frames is greater 255 then loop and adjust. */ cmpl $255, %ecx - jle .L3 + jbe .L3 pushl %eax movl $255, %eax .p2align 4,,10 @@ -282,7 +282,7 @@ SYM(GTM_longjmp): incsspd %eax subl $255, %ecx cmpl $255, %ecx - jg .L4 + ja .L4 popl %eax .L3: incsspd %ecx