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 EFC5AD80410 for ; Tue, 19 Sep 2023 11:42:18 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=eJ/uEImQwkDOhcgygGyWwcgvvDoVtR2DEdcn6NwX2r4=; c=relaxed/simple; d=groups.io; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Disposition; s=20140610; t=1695123737; v=1; b=vjnPeXLZB92bNoo+k+n/Sxf2dLCcio9xp30WRAy/G66OxpHvUCwi9VKEv4Vcga9dD1hqoqo4 e5VZMoMDHvZ+bUnMxpQe77o/s7CioOXjTv3utZNRDlBW4ODJvEQHuVUzl8dRHOzkDLwz8416gyZ yitp6JCmjKapsbANIvKgSCbM= X-Received: by 127.0.0.2 with SMTP id VN1sYY7687511xBx09Cqx5o5; Tue, 19 Sep 2023 04:42:17 -0700 X-Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) by mx.groups.io with SMTP id smtpd.web10.6209.1695123736382842456 for ; Tue, 19 Sep 2023 04:42:16 -0700 X-Received: by mail-pf1-f177.google.com with SMTP id d2e1a72fcca58-68fdcc37827so4627643b3a.0 for ; Tue, 19 Sep 2023 04:42:16 -0700 (PDT) X-Gm-Message-State: kpTqFAeRUEz2t975dosCp8Xbx7686176AA= X-Google-Smtp-Source: AGHT+IHA3V7GuHD+QplGDUrKfsbpFdwVzL74i406wn+NTcvFNqzNi7sJfURfkLka1442tlsSBdvQeg== X-Received: by 2002:a05:6a21:338e:b0:14e:2208:d62f with SMTP id yy14-20020a056a21338e00b0014e2208d62fmr3167037pzb.22.1695123735702; Tue, 19 Sep 2023 04:42:15 -0700 (PDT) X-Received: from sunil-laptop ([106.51.185.220]) by smtp.gmail.com with ESMTPSA id q13-20020a62e10d000000b0068fb43a72c3sm8506281pfh.20.2023.09.19.04.42.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 04:42:15 -0700 (PDT) Date: Tue, 19 Sep 2023 17:12:09 +0530 From: "Sunil V L" To: Andrei Warkentin Cc: devel@edk2.groups.io, Yong Li , Tuan Phan , Daniel Schaefer Subject: Re: [edk2-devel] [PATCH v2 1/1] RISCV: Fix InternalLongJump to return correct value Message-ID: References: <20230919081659.27086-1-andrei.warkentin@intel.com> <20230919081659.27086-2-andrei.warkentin@intel.com> MIME-Version: 1.0 In-Reply-To: <20230919081659.27086-2-andrei.warkentin@intel.com> 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,sunilvl@ventanamicro.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=vjnPeXLZ; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=none On Tue, Sep 19, 2023 at 03:16:59AM -0500, Andrei Warkentin wrote: > 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 Thanks!, Andrei for finding and fixing this issue. Reviewed-by: Sunil V L -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#108826): https://edk2.groups.io/g/devel/message/108826 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] -=-=-=-=-=-=-=-=-=-=-=-