From nobody Wed Feb 11 00:36:48 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=1650998369; cv=none; d=zohomail.com; s=zohoarc; b=Ih6Btt//oOnrj2kPmB/h+QTLBq84Di1Ofkf3XzUoWAVKrhEyeCK9FL0Miu0selR5y0jrPcFUmkpRXLFgPlReCxjIyzSdqa3hY/K6f8qiUcdtOjCqcxuAEYIIDcrU9VPlpYqr6aHgrTK08GnGA1I4DvfRvI1wjb5Q5m9f4fDUzM0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650998369; 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=gXZ1m0NoBHvPM/hvMOsJEn+yfFqyTVSHDw8j82wviMLNyfFY8TCdVMpHZQe8SwQJAlyl6hfHuCx+41LzoZzuiOeoRdq0/lrmYbqQ/LHdHR8AgBrCSaY62lQ+6L5WLtCCT2HlAbMLqUs7zCOc53OGuZ/deR7+h4N9GViNh+lKiUM= 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 1650998369971703.4005502102649; Tue, 26 Apr 2022 11:39:29 -0700 (PDT) Received: from localhost ([::1]:58852 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1njQ5x-0007tu-0Q for importer@patchew.org; Tue, 26 Apr 2022 14:39:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44086) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1njPmb-0002ci-Fe for qemu-devel@nongnu.org; Tue, 26 Apr 2022 14:19:30 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]:46853) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1njPmZ-0004Pz-Uy for qemu-devel@nongnu.org; Tue, 26 Apr 2022 14:19:29 -0400 Received: by mail-pf1-x436.google.com with SMTP id j6so16380692pfe.13 for ; Tue, 26 Apr 2022 11:19:27 -0700 (PDT) Received: from stoup.. (174-21-142-130.tukw.qwest.net. [174.21.142.130]) by smtp.gmail.com with ESMTPSA id j7-20020a056a00130700b004b9f7cd94a4sm16482827pfu.56.2022.04.26.11.19.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Apr 2022 11:19:26 -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=TD+T1mZ4hjt2wuHTYsr8xHo7bG18IAWwTl4YNmoEKB5g+eRwGjp7kbJi1XTjaC2m32 JRcj0WafA66XWt7XJsKJmuEkBTRl39DAj3QimHAp4s1CCgxNVD+NFe8skpya0QCGjMMd AmU3u7OHoLQfNrUpq/FW6043hxR3fLmbjHrEpUn0DrZhEsaweZXOV1Lo/zjth5jWcZRf 5bmE7CgN+5wayGtQrvMYD5oh4xLGllDNczie9bRMioAGYdXlU9EmOwTZolCLXROPZNTW QgeycLacvnNeQS3vSmeqN230X/kjAdblr3R52xal3Cm+Hz6JsZtmblGU9jc0j+uLK5QH LQBA== 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=EpMDWNDFEHM8LAyp1OCD2wAjGYkC65HGCha84YrhgYCfc6G4p9hANBzVAb/FX9WMsu e68XNj/f0Y1a62l8FSG8GE7UTHEifFX20HU7wlbMjJrg0rREcTSFHkzLQGNyslliUTtg mt1lAhozO9PZirHACzdkgheo+mFRlA87/SMNNTsfSVWzyax7y0KHOCpgGljShDO00WAb yuQnszm2EcHOek/ucXUWImCdFXw7UOQ+/y1Hp0CppJaboNeEA0PFrJYI6YAQMhiNYTFg GfWABBAcCYlxaEfLCbReboKpiDUqgO6qZqqt4dHXHN7LP5Q/DWl94kM0cTfiZI973r7o OGSw== X-Gm-Message-State: AOAM533efvUnF23FN0t/xxj1J6i4rCgzjxT9EvmeaGQijKngOYr9s/TD qxRWWwwb84quJ2yG1+C9RGULm6jmlsHkWA== X-Google-Smtp-Source: ABdhPJy95I4USoGF2lAWUUg8Y+9YJPyiYXlxke2hoVWuUSsEP+6eNA6owiUjQck+bP8RL7ma7BXtcA== X-Received: by 2002:a05:6a00:1943:b0:4cb:79c9:fa48 with SMTP id s3-20020a056a00194300b004cb79c9fa48mr25628813pfk.47.1650997166606; Tue, 26 Apr 2022 11:19:26 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 20/68] linux-user/nios2: Only initialize SP and PC in target_cpu_copy_regs Date: Tue, 26 Apr 2022 11:18:19 -0700 Message-Id: <20220426181907.103691-21-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220426181907.103691-1-richard.henderson@linaro.org> References: <20220426181907.103691-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::436; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x436.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: 1650998370193100001 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