From nobody Tue Feb 10 11:58:04 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1650647825; cv=none; d=zohomail.com; s=zohoarc; b=JtcfHCokApoSM/nIJTPF6MWnHJrd6GvqWUA2pPwYutXGnERDplEVv2aq+9TXBzA/EXb7Q5b5cu+1vE2mm21f5E8t7ZOFT+ZOVu3eQImpge4XhXdAVTn2RbqeiXVPyZCo+k1A8RT4wq20y3T5kpqXGPc1NNlyM4qYlDgdS53zf2E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650647825; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=XWBe6x9J/Z2cYvBtaKJvqh+NFZjbIgZiKhNrx43HC0o=; b=O3AlK1BMWpgicQ/bzkMLztFILEOa1HdDRuabdPjqPU++E0mC7jozuKJCRILASlFE77s+7uM83rkJDaWy8tNetWpu0HgDg60EDJNisVixkYZw9ZQYgw/grG7iKoTf7JXP1ARVk+WLARC2RiK1FalJW3U4rq0fNF6XrI5pNAJ4Y/4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16506478255521010.2770229638218; Fri, 22 Apr 2022 10:17:05 -0700 (PDT) Received: from localhost ([::1]:47006 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhwu0-0007VD-Fg for importer@patchew.org; Fri, 22 Apr 2022 13:17:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48728) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhwX3-00010O-5V for qemu-devel@nongnu.org; Fri, 22 Apr 2022 12:53:22 -0400 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]:35429) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nhwX0-0007IJ-0N for qemu-devel@nongnu.org; Fri, 22 Apr 2022 12:53:19 -0400 Received: by mail-pf1-x435.google.com with SMTP id w16so2091371pfj.2 for ; Fri, 22 Apr 2022 09:53:17 -0700 (PDT) Received: from stoup.. ([2607:fb90:27d0:b0f2:934d:3e2:9f8c:dd1]) by smtp.gmail.com with ESMTPSA id 6-20020a17090a030600b001cd4989ff5fsm6835904pje.38.2022.04.22.09.53.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 09:53:16 -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=XWBe6x9J/Z2cYvBtaKJvqh+NFZjbIgZiKhNrx43HC0o=; b=rdnmV0Va6mXmloGySB16UnCvTCrA2o8LxsFX51ERShjg7rB6JOGQzRAwtUzxREREFw 14uYo6J8vc6XbEfCABVM2+jfEHArHhlT1mVeNvbH61SBb0v2Eqrf73Kj4jdk1JM3MBfD p8ZkKyLyxgltCf95YmRsw8BfOnQNx+PUyB/jmUN0cSMhuZq2oikkpX1mu3CyAGyE5JPS kA/5NWFS2V2ov5po7/FCnWlLLM7wzanzRsMj9iz6k9CQAtqyhz67z9TPqEmNX11hzYmv beeas0IQc7GvxAV9v2HOCL71FYwiX6wjbyMpun3f0Fk1RKHeYhGFZvKQBxMVOKlIMcdQ Amow== 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=XWBe6x9J/Z2cYvBtaKJvqh+NFZjbIgZiKhNrx43HC0o=; b=wsP/Ckjuz3EcEhT+KLnk8Hho3/OXKChXxy7L4SB9yuCVT6rSUjE2MpZzhJLmldr+zt zPzz51CG2G3AP0o99OWB/6sddtuR3GXs12KaQgE5HiDXsv8QOZXXPuo/1CI8sQHyL8zm 6SAfhZZ6Wby73fgbZ+Ohzr4QdQT/6OttR81692/+KvAkj6dV4DNX8S0TNAIsjlPP19+P fJfm1H4OeGmpoBbB2eyyqjjDUZNM+5PQcrzgXQGJSV0iYakkzR3Pn5f3aZvutT/baF1h 8udxNDSmiRlbnvnuSwMpBfybcLR8H/Qf16/70rIVLMuTUcAKqJp1c7ihTrIctQZwA8i2 q8VA== X-Gm-Message-State: AOAM530R3RPgrhP1OYmL88GPlHN/2JK1/cYoWeiWRPRWBvecbrjpgtXx xyOP47LPNFJ9B5waC4buJmN2gwDk13es0vRL X-Google-Smtp-Source: ABdhPJyf4J6jbFYsGRCCJXN5mkLsN99p8j8jbr6AM+tr7iopx2O3XCkQKpAIvnFuNYtwcLHP0ktdUA== X-Received: by 2002:a62:a50b:0:b0:4f7:4457:a48a with SMTP id v11-20020a62a50b000000b004f74457a48amr5784119pfm.50.1650646396528; Fri, 22 Apr 2022 09:53:16 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v8 20/68] linux-user/nios2: Only initialize SP and PC in target_cpu_copy_regs Date: Fri, 22 Apr 2022 09:51:50 -0700 Message-Id: <20220422165238.1971496-21-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220422165238.1971496-1-richard.henderson@linaro.org> References: <20220422165238.1971496-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::435; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x435.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: , Cc: Peter Maydell Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1650647826178100001 Content-Type: text/plain; charset="utf-8" Drop the set of estatus in init_thread; it was clearly intended to be setting the value of CR_STATUS for the application, but we never actually performed that copy. However, the proper value is set in nios2_cpu_reset so we don't need to do anything here. We only initialize SP and EA in init_thread, there's no value in copying other uninitialized data into ENV. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-Id: <20220421151735.31996-21-richard.henderson@linaro.org> --- linux-user/elfload.c | 1 - linux-user/nios2/cpu_loop.c | 22 ---------------------- 2 files changed, 23 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 397dec5eb8..61063fd974 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -1096,7 +1096,6 @@ static void init_thread(struct target_pt_regs *regs, = struct image_info *infop) { regs->ea =3D infop->entry; regs->sp =3D infop->start_stack; - regs->estatus =3D 0x3; } =20 #define LO_COMMPAGE TARGET_PAGE_SIZE diff --git a/linux-user/nios2/cpu_loop.c b/linux-user/nios2/cpu_loop.c index a941f9032e..c5e68ac048 100644 --- a/linux-user/nios2/cpu_loop.c +++ b/linux-user/nios2/cpu_loop.c @@ -133,28 +133,6 @@ void cpu_loop(CPUNios2State *env) =20 void target_cpu_copy_regs(CPUArchState *env, struct target_pt_regs *regs) { - env->regs[0] =3D 0; - env->regs[1] =3D regs->r1; - env->regs[2] =3D regs->r2; - env->regs[3] =3D regs->r3; - env->regs[4] =3D regs->r4; - env->regs[5] =3D regs->r5; - env->regs[6] =3D regs->r6; - env->regs[7] =3D regs->r7; - env->regs[8] =3D regs->r8; - env->regs[9] =3D regs->r9; - env->regs[10] =3D regs->r10; - env->regs[11] =3D regs->r11; - env->regs[12] =3D regs->r12; - env->regs[13] =3D regs->r13; - env->regs[14] =3D regs->r14; - env->regs[15] =3D regs->r15; - /* TODO: unsigned long orig_r2; */ - env->regs[R_RA] =3D regs->ra; - env->regs[R_FP] =3D regs->fp; env->regs[R_SP] =3D regs->sp; - env->regs[R_GP] =3D regs->gp; - env->regs[CR_ESTATUS] =3D regs->estatus; env->pc =3D regs->ea; - /* TODO: unsigned long orig_r7; */ } --=20 2.34.1