From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 3443F941284 for ; Tue, 19 Sep 2023 08:17:27 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=E8OYDJMRsswpYW8BvKDXE45kYGSe5DWJZ7XJaTgQdTs=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1695111445; v=1; b=N/IB6UsxWT4v8EdPGeNiUREB4RW4491cHkuKplzVU/bmXJ76qYCG7Vfn7uiZIl+Mzlvv/OC/ miNucLRFpw1GFda36s0hxyE7jWoPGbFeTN9eOS5ZUuGAD5gs2P266my5MJrYjf1Jnwc6iuTquJB Ts+AP5ujVDUrODqAa6nKYf2E= X-Received: by 127.0.0.2 with SMTP id z3eIYY7687511xos9YOwdps6; Tue, 19 Sep 2023 01:17:25 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web11.3199.1695111444809770719 for ; Tue, 19 Sep 2023 01:17:25 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10837"; a="377193317" X-IronPort-AV: E=Sophos;i="6.02,159,1688454000"; d="scan'208";a="377193317" X-Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Sep 2023 01:17:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10837"; a="919774161" X-IronPort-AV: E=Sophos;i="6.02,159,1688454000"; d="scan'208";a="919774161" X-Received: from awarkent-desk.amr.corp.intel.com ([10.212.118.183]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Sep 2023 01:17:06 -0700 From: "Andrei Warkentin" To: devel@edk2.groups.io Cc: Andrei Warkentin , Yong Li , Sunil V L , Tuan Phan , Daniel Schaefer Subject: [edk2-devel] [PATCH v2 1/1] RISCV: Fix InternalLongJump to return correct value Date: Tue, 19 Sep 2023 03:16:59 -0500 Message-Id: <20230919081659.27086-2-andrei.warkentin@intel.com> In-Reply-To: <20230919081659.27086-1-andrei.warkentin@intel.com> References: <20230919081659.27086-1-andrei.warkentin@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,andrei.warkentin@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: lbm84c088gX7WGoSbbHZ9JgQx7686176AA= Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b="N/IB6Usx"; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io InternalLongJump was not returning the 2nd parameter passed to LongJmp (Value) as the return value from SetJmp. Seen with code compiled with -Os, where an LongJmp (Buffer, -1) somehow translated to SetJmp returning 0... Cc: Yong Li Cc: Sunil V L Cc: Tuan Phan Cc: Daniel Schaefer Signed-off-by: Andrei Warkentin --- MdePkg/Library/BaseLib/RiscV64/RiscVSetJumpLongJump.S | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/MdePkg/Library/BaseLib/RiscV64/RiscVSetJumpLongJump.S b/MdePkg/Library/BaseLib/RiscV64/RiscVSetJumpLongJump.S index 34486eabba4c..e97a7d0727b8 100644 --- a/MdePkg/Library/BaseLib/RiscV64/RiscVSetJumpLongJump.S +++ b/MdePkg/Library/BaseLib/RiscV64/RiscVSetJumpLongJump.S @@ -3,6 +3,7 @@ // Set/Long jump for RISC-V // // Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.
+// Copyright (c) 2023, Intel Corporation. All rights reserved.
// // SPDX-License-Identifier: BSD-2-Clause-Patent // @@ -47,9 +48,5 @@ InternalLongJump: REG_L s10, 11*SZREG(a0) REG_L s11, 12*SZREG(a0) REG_L sp, 13*SZREG(a0) - - add a0, s0, 0 - add a1, s1, 0 - add a2, s2, 0 - add a3, s3, 0 + mv a0, a1 ret -- 2.34.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#108821): https://edk2.groups.io/g/devel/message/108821 Mute This Topic: https://groups.io/mt/101452205/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-