From patchwork Tue Jan 23 10:24:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 765192 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:10c4:b0:337:62d3:c6d5 with SMTP id b4csp1528732wrx; Tue, 23 Jan 2024 02:25:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IFM4P32+XST0czwNDqdfnWxlsmUKV4IxiHdSPZ5dKaC1rp9zzt4uCTGgPWu8GFZxy1yNcBt X-Received: by 2002:ac8:5905:0:b0:42a:4662:48c8 with SMTP id 5-20020ac85905000000b0042a466248c8mr644503qty.63.1706005542533; Tue, 23 Jan 2024 02:25:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1706005542; cv=none; d=google.com; s=arc-20160816; b=XtFjoHDcBpUwsORw7xukKvDEhFCFrLInDKU68qxEGcMgyWtQRlFJRbnb5xANqlT4j8 7PtutopGIMHR8/xLc7X9hRDPmmhQTSQOp5oR6aEi32JSgHF+TLOVcF+kNNEVJQ/VwF90 qMwU5Ua4T8Lece36R8JZMGo5UdLYhtpiNPg5vYnQU6FN1q7GD9fM+Z/f2W5TlFhdFy34 0f12pUKwjUB0BVLaZiK7oNeyCCS9AajYNv2FgiczLtPkhHKeubIQ8bK4Tsl5CJe8svqN gs+gWhzofP8Fb5sYAD+KkbnC+T536EA/T4BAvDQFiuBMlR6hfmUIfkJ0mbBrAsT+0C/T YNBw== 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:dkim-signature; bh=gjWMZ9p5XTSuEC96EcRqyo4JXfEkDtPUT23udsatzbQ=; fh=rytU8pZd1+GXRXoRngAdIdeuHnaTwC55s4VPhE2/+4E=; b=UM48aVt+jVnWyXZGuqm44T7nYkBS6Xx1jDjFYkl5K/ER3n4z+h/cyqA2F5IWremp4X XskmNkp9VMtp4xCnKlG4Sp5knPQ3kWwUSKguh8czCL3K7gO8NwY9UP2PdZVOKuEI/os4 4ofRQEehKQ4xKXHq0j+e/QMALGgdq9jfV5qQ5C/A6NlLKheP71lOCI2y2x2X9/g87HPA onFMTTLtUFXIB1xnBy7QUMsbmoSylo++6UVekhOkPhzlt1A/KsulEn/Xfh0nt/KIlUlb CnHLSbQ7mQ2N/SOubEDcFRFaReOIa6q47N4nAGRYc9GEG05hlKMUI97dFFygU/TDFJ1O jSuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OCSbg8qf; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id o15-20020a05622a008f00b0042a4856f84bsi2414840qtw.556.2024.01.23.02.25.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Jan 2024 02:25:42 -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; dkim=pass header.i=@linaro.org header.s=google header.b=OCSbg8qf; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rSDxN-0000Pg-3p; Tue, 23 Jan 2024 05:24:37 -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 1rSDxL-0000PL-S9 for qemu-devel@nongnu.org; Tue, 23 Jan 2024 05:24:35 -0500 Received: from mail-oo1-xc33.google.com ([2607:f8b0:4864:20::c33]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSDxK-0004dZ-2h for qemu-devel@nongnu.org; Tue, 23 Jan 2024 05:24:35 -0500 Received: by mail-oo1-xc33.google.com with SMTP id 006d021491bc7-59883168a83so1438581eaf.2 for ; Tue, 23 Jan 2024 02:24:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706005472; x=1706610272; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gjWMZ9p5XTSuEC96EcRqyo4JXfEkDtPUT23udsatzbQ=; b=OCSbg8qf0HGuk00iTLaG6ofsvLUBr65RPSsmjcS8TAoUnxq/ftLRtfCsvKpfb91Ghd AtPjY3rro6VRviQq63uF8L/RebclLjuJPHIVXjiCYsvYEpMfuIt75XM4Hj2jkSQH/IWX Rzz1se5wZHoljFDipbEkaoprOD9L6NOS2k+rR9h6JbvdGuVHTa58adUWyy1Su1FLoAh6 c14DYdEe0iMyK07+udvrlSG6cegvYDxnNiBNqxrnWgc7AMvReDVqmEkSNSEIGA/qiLhn Ej23IFzI6NGGVoTAybkoa5bYNPrwowMxnbt03shuRUtXfXqzl68IZPtx0wKOmoZRegSB 7DBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706005472; x=1706610272; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gjWMZ9p5XTSuEC96EcRqyo4JXfEkDtPUT23udsatzbQ=; b=MB6kFjVKAWOev/WmE8/RFsOzqkKy5LVU66XJb+IFSW64tpqHbA198IzwwNuqSFOz3g 1T0MfFlua/b6hvfp6JsLqYtkFxQ2rp7JeUyDswrme236AWaJqapuFBKp7MiMu2KScpHi R0SJOL5s7Lvy7GC5tB1+/ZlWEngNm2eAH51ydu4xqTt/4Fg98r9XVoEsH3y9KCXE3EYj ZQ2MT7BAzs3kiUDFHhlpHPJlPUNglSyQqCTQ0HhDzbIGj2NiEYwS9fsMA7P9QT8vTfKM NfQu7K/rLMKYufC+HPKFI72zdVoW4qpJ4Cu7609v1rLUXN7QMAYhHwXbMdmRN9yhFp9G gDdA== X-Gm-Message-State: AOJu0YyC6EvLOLGGpGzGugKUJtuhZUwNYu9MCxWJilG4UufBe9oEtj/o eF0rdKQ4dM4gaveiUdYcWLQibpk73opM0RmsAL5UuUPU4vShNKK5Zxd3chkNDwihOBZa5Airmz1 qSC0= X-Received: by 2002:a05:6358:524b:b0:176:40e2:8909 with SMTP id c11-20020a056358524b00b0017640e28909mr1705602rwa.27.1706005472634; Tue, 23 Jan 2024 02:24:32 -0800 (PST) Received: from stoup.lan (2001-44b8-2176-c800-b8a0-0408-58be-7d2e.static.ipv6.internode.on.net. [2001:44b8:2176:c800:b8a0:408:58be:7d2e]) by smtp.gmail.com with ESMTPSA id d8-20020a62f808000000b006d9ce7d3258sm11072408pfh.204.2024.01.23.02.24.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 02:24:32 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Vineet Gupta , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Alistair Francis Subject: [PULL v2 5/8] linux-user/riscv: Adjust vdso signal frame cfa offsets Date: Tue, 23 Jan 2024 20:24:09 +1000 Message-Id: <20240123102412.4569-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240123102412.4569-1-richard.henderson@linaro.org> References: <20240123102412.4569-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::c33; envelope-from=richard.henderson@linaro.org; helo=mail-oo1-xc33.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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 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 --- linux-user/riscv/vdso-32.so | Bin 2900 -> 2980 bytes linux-user/riscv/vdso-64.so | Bin 3856 -> 3944 bytes linux-user/riscv/vdso.S | 8 ++++---- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/linux-user/riscv/vdso-32.so b/linux-user/riscv/vdso-32.so index 1ad1e5cbbbb8b1fe36b0fe4bcb6c06fab8219ecd..c2ce2a4757900a16b891bb98f7a027ac30c47a5f 100755 GIT binary patch delta 643 zcmYjPOH5Ni6ur|gwzc+9XhF0TMNp`GR6Zh~mKGzXLQ}j z)#}rFqIBkAs)(L%{#f{&3ii(}e_yh8Pgey7+LRKpj+~BYkcbM&L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aD%u^l2ig?0(-=G()wmunx#evpSj4qh<1k!|y419kyW za5-|gGn!0n6rMbX!-TP6@k;>oa*G zP}TuWFGF&2M1Z-gk@Mz*obD`4Zx|+X@#%5GYydif&z`YjawDHTFrX$M;kzXAEcnEna 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