From patchwork Sun Jan 28 17:50:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 767240 Delivered-To: patch@linaro.org Received: by 2002:adf:ee41:0:b0:33a:e5bd:fedd with SMTP id w1csp558876wro; Sun, 28 Jan 2024 09:52:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IEFPtxKY8qWFnTYCe6SU2t6CK/p52Ns+aoPHVcMB7c6ieERnS+jPQE/so5K0D3EK3FVj7EX X-Received: by 2002:a05:620a:12d1:b0:783:cdc1:9e54 with SMTP id e17-20020a05620a12d100b00783cdc19e54mr3123782qkl.6.1706464366672; Sun, 28 Jan 2024 09:52:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1706464366; cv=none; d=google.com; s=arc-20160816; b=T1KsTOGfnrNlNVuFDUu3g2zQwlDAUbONCMVqFW+OICYY8EcsZHQ3aXWwyXj/OFmg1u 1pdkegezja3tUAUah3Lmykdz2imjrRutonA7u62CWKGxXGfL6xVswTJtJypq4QqLC+kS 38xgGcDCgioynLJhYbchdZarTIZiBOUf8RqGS+mt0QAE0Fwjh+OZ7z1JrWkBvT4VysJC IforVK6ERrzHs1oPB+Sg1csxxewT/1rA6jtOm6wVm0XbYFmHbZJjEjEwvpt3zc58AdXJ YJrQdbHbumCEBfQTAfIpVEyjDkvynr/COa9trLTCfatO4+xFKjAr8hdmFYJWxu7uor4f zGOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=0DECejASNMminUJ/COxBdx86lPnNErqlex8aKAbvEvM=; fh=xKTOpfxQCxorxlvqs779c3/dW1cLbudMtw4cOaOnBdw=; b=KP8ZneDHfnWFfCyG+17dfeinU493fY0p9eWA3tzKCKlf7M2qJdyDtY5dyq+hIzzsp0 SJgFYMzUWecRlstnZh0UuGi52z6qlHLinLlfrA661AAtSZW0RPjSSz8R008wXglb96z+ +rt3HdPGX4V7QZ0fRtEW3EXQpSCzLg65kIJ55Xd/T703TH1dLjcdGGjKS9yQxLacPL/8 9a2mQFxg7/nWJg0q/V643NowQnE45bxKjvXAV2mcaAtyhK8aozxRzUOC3rhjsMz4ZCt8 jxdXH/pz8c4jEGQLVK+zRyggHysL3s88Un5iUoMEAUlz6hEtE8dyJTpWage9SDjswatS PR8g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id o10-20020a05622a008a00b00429a5f6c90asi5943514qtw.154.2024.01.28.09.52.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 28 Jan 2024 09:52:46 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rU9KB-00068j-LD; Sun, 28 Jan 2024 12:52:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rU9J3-0002z9-SC; Sun, 28 Jan 2024 12:51:00 -0500 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rU9J2-0000ov-8T; Sun, 28 Jan 2024 12:50:57 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id A0D2F4810A; Sun, 28 Jan 2024 20:51:31 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 315C26D526; Sun, 28 Jan 2024 20:50:40 +0300 (MSK) Received: (nullmailer pid 812422 invoked by uid 1000); Sun, 28 Jan 2024 17:50:35 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Richard Henderson , Vineet Gupta , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Alistair Francis , Michael Tokarev Subject: [Stable-8.2.1 61/71] linux-user/riscv: Adjust vdso signal frame cfa offsets Date: Sun, 28 Jan 2024 20:50:24 +0300 Message-Id: <20240128175035.812352-7-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson A typo in sizeof_reg put the registers at the wrong offset. Simplify the expressions to use positive addresses from the start of uc_mcontext instead of negative addresses from the end of uc_mcontext. Reported-by: Vineet Gupta Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Signed-off-by: Richard Henderson (cherry picked from commit 1b21fe27e75a59bfe2513f5abcc6a18cfc35cfc8) Signed-off-by: Michael Tokarev diff --git a/linux-user/riscv/vdso-32.so b/linux-user/riscv/vdso-32.so index 1ad1e5cbbb..c2ce2a4757 100755 Binary files a/linux-user/riscv/vdso-32.so and b/linux-user/riscv/vdso-32.so differ diff --git a/linux-user/riscv/vdso-64.so b/linux-user/riscv/vdso-64.so index 83992bebe6..ae49f5b043 100755 Binary files a/linux-user/riscv/vdso-64.so and b/linux-user/riscv/vdso-64.so differ diff --git a/linux-user/riscv/vdso.S b/linux-user/riscv/vdso.S index a86d8fc488..c37275233a 100644 --- a/linux-user/riscv/vdso.S +++ b/linux-user/riscv/vdso.S @@ -101,12 +101,12 @@ endf __vdso_flush_icache .cfi_startproc simple .cfi_signal_frame -#define sizeof_reg (__riscv_xlen / 4) +#define sizeof_reg (__riscv_xlen / 8) #define sizeof_freg 8 -#define B_GR (offsetof_uc_mcontext - sizeof_rt_sigframe) -#define B_FR (offsetof_uc_mcontext - sizeof_rt_sigframe + offsetof_freg0) +#define B_GR 0 +#define B_FR offsetof_freg0 - .cfi_def_cfa 2, sizeof_rt_sigframe + .cfi_def_cfa 2, offsetof_uc_mcontext /* Return address */ .cfi_return_column 64