From patchwork Tue Feb 8 07:12:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 540751 Delivered-To: patch@linaro.org Received: by 2002:ad5:420f:0:0:0:0:0 with SMTP id e15csp319874imo; Tue, 8 Feb 2022 00:47:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJyZWSaUW9mMxTLAtTeIdvfp8ECo7VpXM9l8vyjeEv3opPvpmTE7wlX8TChw5WMT5TqWi7N0 X-Received: by 2002:a05:6214:5195:: with SMTP id kl21mr2264957qvb.69.1644310033237; Tue, 08 Feb 2022 00:47:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644310033; cv=none; d=google.com; s=arc-20160816; b=Izy5rz+hUVSCm/FEHwtmsjfRXqpHgJLsvkhjBufHGkgQJgAYbDTCQzk2CC6FVc02IF 3sjm11ZDgLTBSMt1qKz1F3R4wmwgsRrVCJ6ZE3TDmwtpud5DWhATXupHiQs+3aO5FaW6 HGvcq4JzM6Y295Qd/Shx2/zEPSDC2eY0clRU3MG3Xckiapz4L8iRpBnG7TfoMoqsQNGK VTKV7VSq47t48XYIhvOcdjxV1MKA7uADb+eAEM5h1uA2q47dSEHWOPXMBnzlk4xT4ZlN iLfmg3yK+y582R/GZyvxMEjOYt2dWLmU8Vf4H9TTayULFvwznP+gyeJwbU7vN/LBf0Hx +DvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=Uh058XUts6HPkXe97baHsy8/Ac7JrSk6cgbCWbIo3VY=; b=GhP0KiTq2x6rydir9rhn0zCfOIkbUBrhiKqND19X590djG5BGtcrS5+lfPk2BLcj08 HYvzKolF80C7mVqtxFv1pcoKjMlCvkis6BtLAO1CEYykqId9TD75FG8WgDqZRyuDAWs+ kXXpqiGfeyo3aLEeR7KONu5jZByCHahWRFDVYjXRERUQfqw5ucGtVsK6JMMDfZTJNgRY FXW9fWUS8lBSSGRpFfXv81oy3PggcfuAbT8AmLCbOAuvXn+HwSYEce2l+WFlbsqdm6IN +ADzvqSOqpu+jiHat1hV6nC8lHmM2YAHV7H9Xa2PLiOQ5yHuBqNejsrvgEIC8dIZR/+Y HA9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=znbDpHVW; 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 b23si2702081qkg.95.2022.02.08.00.47.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 08 Feb 2022 00:47:13 -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=znbDpHVW; 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]:51232 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nHM9Y-0003Zz-IB for patch@linaro.org; Tue, 08 Feb 2022 03:47:12 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52024) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHKgD-00079d-6J for qemu-devel@nongnu.org; Tue, 08 Feb 2022 02:12:49 -0500 Received: from [2607:f8b0:4864:20::102b] (port=42522 helo=mail-pj1-x102b.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nHKg9-0000RK-Rz for qemu-devel@nongnu.org; Tue, 08 Feb 2022 02:12:47 -0500 Received: by mail-pj1-x102b.google.com with SMTP id my12-20020a17090b4c8c00b001b528ba1cd7so1784104pjb.1 for ; Mon, 07 Feb 2022 23:12:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Uh058XUts6HPkXe97baHsy8/Ac7JrSk6cgbCWbIo3VY=; b=znbDpHVWPdPeOFwQq63atb1VJMFLiq6Njizswlg8axXVYQLQiNuF2D6I33hRhZm0u4 AgWLKR0vHpq+HS3oqcakBvnl8ig4aThIjkhUetzqKKeKR7JWejK27LE3Oj8BR8B6woAD B77OfgJuYEG8Xkh9DEW80tQvxsYpajsdbLqKALNXXFBuqyl3WJMxxVaI5XqnlJh9acap EcjNKDrhUZr7OaSGCxwKPsi2Vg0Ug+a6Jeow10tCJZH6GWl9ySF2bTCaGru6WNtOvYSH 91TA5EM7IMA22WEcufSNsT/bd5yR+rv1r4DW68S5MjUvSPEU7qlCRic7TXPrUuHFINed Gowg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Uh058XUts6HPkXe97baHsy8/Ac7JrSk6cgbCWbIo3VY=; b=6qihhCiUBVNBuC0Q314KPZJGqSRRb5Q5UWGMSMzCkz0ryGzinXRT+dVh8N0p9BC+3K dIIHpGoriCkCb5BnnGXHBH0Mw3Yv4cRLvRFK1bGVqzW5kv8nIz10jING/QfcHqv8aMOq GSZy0wsdCA8JGbeP5CNYFWnN89iKR2F7V7UsRF3OEn/vkfABulCWzpOkWvOHE4oDMNOn q+PE8qRmGaItjCZBMckOngSiWiknGMIBommnJuUUAk+AebHsQE4EpVk1ofTD1ZegKlqE BRhcOVcxxCLBaocaLlwGrDEpvQYL3YvySBKO9R4F+A8yDMHOHlOKWXA4f4DeqAHj+jBq TWew== X-Gm-Message-State: AOAM530e8A108vffGHnzkKVYDG3GOpvERHXJnTSnG+BR6JHxyyy1bPEw TvVR5vuWht2Ejs0LmHqbOKF6axLLwz4gEA== X-Received: by 2002:a17:90a:d343:: with SMTP id i3mr2961862pjx.104.1644304364242; Mon, 07 Feb 2022 23:12:44 -0800 (PST) Received: from localhost.localdomain (121-45-127-8.tpgi.com.au. [121.45.127.8]) by smtp.gmail.com with ESMTPSA id b12sm13908088pfm.154.2022.02.07.23.12.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Feb 2022 23:12:43 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 1/5] common-user/host/sparc64: Fix safe_syscall_base Date: Tue, 8 Feb 2022 18:12:33 +1100 Message-Id: <20220208071237.319844-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220208071237.319844-1-richard.henderson@linaro.org> References: <20220208071237.319844-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::102b (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::102b; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102b.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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: , Cc: laurent@vivier.eu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Use the "retl" instead of "ret" instruction alias, since we do not allocate a register window in this function. Fix the offset to the first stacked parameter, which lies beyond the register window save area. Fixes: 95c021dac835 ("linux-user/host/sparc64: Add safe-syscall.inc.S") Signed-off-by: Richard Henderson --- common-user/host/sparc64/safe-syscall.inc.S | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common-user/host/sparc64/safe-syscall.inc.S b/common-user/host/sparc64/safe-syscall.inc.S index a2f2b9c967..c7be8f2d25 100644 --- a/common-user/host/sparc64/safe-syscall.inc.S +++ b/common-user/host/sparc64/safe-syscall.inc.S @@ -24,7 +24,8 @@ .type safe_syscall_end, @function #define STACK_BIAS 2047 -#define PARAM(N) STACK_BIAS + N*8 +#define WINDOW_SIZE 16 * 8 +#define PARAM(N) STACK_BIAS + WINDOW_SIZE + N * 8 /* * This is the entry point for making a system call. The calling @@ -74,7 +75,7 @@ safe_syscall_end: /* code path for having successfully executed the syscall */ bcs,pn %xcc, 1f nop - ret + retl nop /* code path when we didn't execute the syscall */