From patchwork Sun Mar 20 16:00:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 553171 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:1248:0:0:0:0 with SMTP id z8csp836526mag; Sun, 20 Mar 2022 09:04:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7aOXpqgN4Br1jBgoZABZORlKtM3XF8IilAnIGb9Bu1SbwPBX493KnsYuZrKaEogbamjcc X-Received: by 2002:a05:620a:4491:b0:67d:9929:ddb6 with SMTP id x17-20020a05620a449100b0067d9929ddb6mr10392171qkp.47.1647792292431; Sun, 20 Mar 2022 09:04:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647792292; cv=none; d=google.com; s=arc-20160816; b=R9V86a8P3xjTMXeZOUahnGvf4AeOiFfS8gShmIO28dBPRA2RwCl1GknHu0LbK6oxtC +yC8eUPm9hkrRyyHo9Ddhp8mdX6iTtR+RhpjnvLd59H6Iaotfna63rk+MLAGSLbYP1az wOTgO1i4CWOqHn4uUzWgc6JHz47fw7p+MrT+O6DLIiMRmDsz6Omm5JAtfoec3JQk6b6J BJWDB57o5mCmNnxP1XOn8XybE4r8iEXSc3l0zkeNoMzB5UmKC5zX2UcHsvBN5tO7/Wvw QzebtxLZt+mX/WNqIbGkkdpOdxG17wUUfUzOhyLX722Wq9sDXtFDKR7RrJ8nVtOG4bSF YEiw== 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=psn5p0gK6p7KHbN3cFd3zZ4fpGBd9MmHd4e6lUYOqhY=; b=gQc2Asv1++W97eViJ/mydcpc3j4gRxSKadXoTXVSGVKXtwRUBy7aq4SnXUmH+T74f9 Xq+kgx50T+jNfu1FT0CvIgz8b7V0udQc52ef+J/1H1Sc3BUpPoKq/Ca5JAPFdVniWDCO MRBBrAJ9ytH9q2dpG6xhIuVaJB+FtUVbH6llJIDZtUzwLjH8Oiwb9os3RYHre1PFKZa1 87mQnP7fa5JLrfqpaOmJeL2bArq6MYcPu2PJmye1mYyVg5LKjuvL9HgMeV7pvDUkS/RE imVJnmo/xrNwgjpCnbARsNNqwHLjSfk77p28n9uapSbhzv+Cs8NHY0fTmBacCYB7O8z0 9Lhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yfF5jeyi; 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 cb14-20020a05622a1f8e00b002e1fbf3c02csi1420266qtb.541.2022.03.20.09.04.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 20 Mar 2022 09:04:52 -0700 (PDT) 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=yfF5jeyi; 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]:45356 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nVy32-0006FQ-1p for patch@linaro.org; Sun, 20 Mar 2022 12:04:52 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46630) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVxyi-0005L3-RQ for qemu-devel@nongnu.org; Sun, 20 Mar 2022 12:00:33 -0400 Received: from [2607:f8b0:4864:20::1031] (port=33794 helo=mail-pj1-x1031.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nVxyf-00066F-VP for qemu-devel@nongnu.org; Sun, 20 Mar 2022 12:00:24 -0400 Received: by mail-pj1-x1031.google.com with SMTP id o68-20020a17090a0a4a00b001c686a48263so6004589pjo.1 for ; Sun, 20 Mar 2022 09:00:18 -0700 (PDT) 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=psn5p0gK6p7KHbN3cFd3zZ4fpGBd9MmHd4e6lUYOqhY=; b=yfF5jeyiGeNfNlAYAkPOMcSogvdBikfe2J6CDOXR40uYh453cNaDCE2F7p/mWbiIvi XxIIak/tfYCRq2MkF1z4zqTBDJADhOsWV4VnwU2lwld/4VogmIa85jb2Ji0JmAYHsxg5 LbslFjEffyqhHcTQqhlDQ1hmUPVhHoQKA880s7vDCqc5r/ZOFYkU6LEFj8IOyi3stMUg vC21HUhe51BXxOmAbaRcFvRFVtJyZx/qqEUE+9dnVUv5saRydAGplptxOGYfDYujjT9s kQPCvf9d3Zt8S++PzAjeu+74eeo9xcqJYxpdZpl9sVKEP1hvILvlMeBQQ2lx4Xb1eY7+ 1E2A== 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=psn5p0gK6p7KHbN3cFd3zZ4fpGBd9MmHd4e6lUYOqhY=; b=4bAmmntw9YfN7/9dHJ8wXYS6Xrcb6tQbGzr/IVwMhlUMGk8HZwTKQEwU5FHJYl6/TC 59QPKkZ027Rj5b/OpbwqP5SPU4cyfSN8SSZYdAN4kERRWcz70n1U0SyjMiQzsbx8Ljf3 7qV7YdnYpF/fO5S+KXDOkRV65TFXaCmIW5z58DlfMTXgbx05CTJtZbmXzQX/GlvqYzep hqoyMbhBOn0TeMtn5uzJ9BI+g7ICmwARPiO/Ir5L8iC4pcGoE9NDcccoCXuiLk4ZtPH/ 49SeOnwMJuw8k7VDSy8QV1uOkrPLDDnkDOAIL8tMFP4geB+z6lufKmoNkLqn4izAf32X jrrw== X-Gm-Message-State: AOAM531V8VbVYok+SUNFBwbDROgIabHuQ6KRiVXmB67XZCkXziAUSmR+ Y4yObd3fKVnMHiKD7MBkRlsFnijCNuwlxw== X-Received: by 2002:a17:902:cccc:b0:14e:e89c:c669 with SMTP id z12-20020a170902cccc00b0014ee89cc669mr9254784ple.58.1647792017023; Sun, 20 Mar 2022 09:00:17 -0700 (PDT) Received: from localhost.localdomain (174-21-142-130.tukw.qwest.net. [174.21.142.130]) by smtp.gmail.com with ESMTPSA id j23-20020a17090ae61700b001c6bb352763sm6590099pjy.52.2022.03.20.09.00.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Mar 2022 09:00:16 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 4/7] linux-user/nios2: Handle special qemu syscall return values Date: Sun, 20 Mar 2022 09:00:06 -0700 Message-Id: <20220320160009.2665152-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220320160009.2665152-1-richard.henderson@linaro.org> References: <20220320160009.2665152-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::1031 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::1031; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1031.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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.659, 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: alex.bennee@linaro.org, laurent@vivier.eu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Honor QEMU_ESIGRETURN and QEMU_ERESTARTSYS. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- linux-user/nios2/cpu_loop.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/linux-user/nios2/cpu_loop.c b/linux-user/nios2/cpu_loop.c index 2ae94f4a95..d12c3c2852 100644 --- a/linux-user/nios2/cpu_loop.c +++ b/linux-user/nios2/cpu_loop.c @@ -48,6 +48,14 @@ void cpu_loop(CPUNios2State *env) env->regs[7], env->regs[8], env->regs[9], 0, 0); + if (ret == -QEMU_ESIGRETURN) { + /* rt_sigreturn has set all state. */ + break; + } + if (ret == -QEMU_ERESTARTSYS) { + env->regs[R_PC] -= 4; + break; + } /* * See syscall_set_return_value. * Use the QEMU traditional -515 error indication in