From patchwork Sun Jan 21 00:20:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 764468 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:10c4:b0:337:62d3:c6d5 with SMTP id b4csp530411wrx; Sat, 20 Jan 2024 16:22:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IE6AzzZgEbhpD4tkfMGSdePGc4WZ6liR7r6EKMZoKWqx8QHjYfzUv3vukQzWiUn+WnQYfMm X-Received: by 2002:ac8:5705:0:b0:42a:3355:8e9 with SMTP id 5-20020ac85705000000b0042a335508e9mr1416316qtw.10.1705796565159; Sat, 20 Jan 2024 16:22:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705796565; cv=none; d=google.com; s=arc-20160816; b=owh9vyw1h1d3Lt0aH0WAvDbuGXiwBH7Bwsq13YEzeRFgjnfKMlBnR21s2cIKlqT6OP +hywsslPrI2y2GK92Tb7jXgvfBgopooUMwv/ui2xc+e8lFWfMy58Frb2unffP1GJYeIs m2mci+Z9hItJQZ76i6P/eQT+7aT1mh1kdJwmEo2k8umskpEGhMMH2JG7jcvaJDReITtj rJpXht5quC1WC3ITJVdZ4AlGODoFio1cfWvRniqpYa3OWpgzdJ5QatPMUIKBIxMCLOdL MfpVnYVGfqmCAzQMuaHoQUN1UICTQZTwC/llr+spDGb0z7PbhJgPeYzD9+oWIlzQBpRh S8Qw== 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=9Xu/nq6hQa8ZLXYCRSmO5dgODT19xrskc9XyMf3C3fg=; fh=rygklo3k8rDrOxbqyqXzMeN1qJGr+RWlL94hCpxMPcs=; b=NqA3LGN1gtJFR8DiSCiRMz0EBCIIkeyci8csx0tArgZ4c8rNm7J134EpoEwVw9/eHQ 6vSCmv7T71xQlzP9hsLa2mOhqqRyFO45/2x5w5ZpxjRQdC3cE2ZICMT83lzIfntHmTzD +9zkk0+PThH7lOCpnK35l1aKX3biSl+GK+5zIgvn/nOyUWBYpRU3PY8x4JWk7pjYdsqS KhCraLZaQgzWRTBCyd44cveGsOePKQc3a6atG4vPCmYu3oPNkEMqP3HtzBdI+3ltP26J /zmqH45++6S0esZJBpS0LrBSPZ5xEwQ4ZVhfAbKhTpzWKNIzelje2tN7s4mugPPcVZPS 5Hmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Lh/EN2ES"; 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 pc47-20020a05620a842f00b00781a14c43besi2502223qkn.674.2024.01.20.16.22.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 20 Jan 2024 16:22:45 -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="Lh/EN2ES"; 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 1rRLaO-0002YT-QF; Sat, 20 Jan 2024 19:21:16 -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 1rRLaM-0002Xu-IV for qemu-devel@nongnu.org; Sat, 20 Jan 2024 19:21:15 -0500 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rRLaK-0007QS-Lc for qemu-devel@nongnu.org; Sat, 20 Jan 2024 19:21:14 -0500 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1d70c3c2212so13633335ad.1 for ; Sat, 20 Jan 2024 16:21:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705796471; x=1706401271; 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=9Xu/nq6hQa8ZLXYCRSmO5dgODT19xrskc9XyMf3C3fg=; b=Lh/EN2ESLax+74ILHQBcm1S3B7ftNg9aSWElRluOvgCpPyL0jmSSkr0uZtSzc01GnM dh1aOdgFEZ2JFWjalR0ZmknGa2HdhByJe1L2kEoU2Nl4VW9a4VBAB+EhOmOd3Nlp0s+3 5W37GqMe19udQ3/6v6nXCHms1pZMOAjTcXnb4F7tNxxWlkh7yLUvt9dT9YEHm5iXfz1k GA1yC8smVNHSRODsvjLzP85QSybcUbZCqpGbIFvAICkisymd96kXmiPknOi6jnoTELs0 EbOPpLwM+QdxIhIJijpO+64BCfzswFbtw+czPPVqX7RAGwAf48d4wTND4sWhm5xxG9AH J0jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705796471; x=1706401271; 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=9Xu/nq6hQa8ZLXYCRSmO5dgODT19xrskc9XyMf3C3fg=; b=OsT2Xw0zaa4v8oelyYwH/eTL1GqYXvUUl/irgutLhSUCNFzmxzVgkmbjFZvlCQOwfG C3wFMXnN5HN8M6/sDF17b8aaUmkZJe+4nbnQODczqI/+pUJWpqz7XU0EaqIJWsGRcLtl MIqthVA/bPvoPpONFK+wSHyTRaKfcO3w/0/Bo0tDjYnBvAyY9BOqnH/fxn5yqa0t7GAG 0lMazKZ7mMc/j4tps4jV6ewJKmc3zZFmnG01HSAFx/lidT+d+6eGaQ3mF9BC/wIyW8YM uBMSPGKjey4dTxNK2GUySZepRU/tsxYnaUvsARu+twTTAthO0A4I23MfKDKkcMAvK6t4 cUtA== X-Gm-Message-State: AOJu0Yw8Dzhqfb8kVoy8dF7r24+1UVtCArfOhsy3s62rWyJLVBRX/hip m7whCbhbIVVfw17lmMI7G78VYa1BXF0UnnjWETfhUQvSqnhjr+vzC4a29RU1txBDXWQoKbZTkf9 FTzc= X-Received: by 2002:a17:903:2306:b0:1d3:f344:6b01 with SMTP id d6-20020a170903230600b001d3f3446b01mr2831284plh.3.1705796471153; Sat, 20 Jan 2024 16:21:11 -0800 (PST) Received: from stoup.net ([2001:8004:5170:1e39:1361:3840:4873:7990]) by smtp.gmail.com with ESMTPSA id j4-20020a17090276c400b001d5af7fbda0sm5023546plt.122.2024.01.20.16.21.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Jan 2024 16:21:10 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Vineet Gupta Subject: [PULL 6/8] linux-user/riscv: Adjust vdso signal frame cfa offsets Date: Sun, 21 Jan 2024 11:20:45 +1100 Message-Id: <20240121002047.89234-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240121002047.89234-1-richard.henderson@linaro.org> References: <20240121002047.89234-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.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 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&LN$yL<+mtroa4HJ zZMB#&#N4vYgN#$Ed?)jGwn>u^j$uL6%5;@6#JIs26v~>`CEXn6`%uX09<>tLIBejZ zFY)AcUK{^`w8`*U60=@WX3@OR=)D9Xp?Lu9eduPPPr;Cc@g53huwxpgyD;B@WePiQ z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/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