From patchwork Thu Apr 21 15:16:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 564351 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:6886:0:0:0:0 with SMTP id m6csp545538map; Thu, 21 Apr 2022 08:35:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw8d4rBJigivLZP++qtAn8+KHdMafSKZO+PKBu+nzJlyq1A+evoEu7XLWpgiu9oU/xjHQHp X-Received: by 2002:a0d:ff05:0:b0:2ea:25ed:d714 with SMTP id p5-20020a0dff05000000b002ea25edd714mr242006ywf.454.1650555357663; Thu, 21 Apr 2022 08:35:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650555357; cv=none; d=google.com; s=arc-20160816; b=kf2AYbMA830UbpUiU8WmNFZomcaHgRUPi0K/3X4mbVNgj9yCioBiJ52vtymAAYBlP7 Wa5ukDma5AIrUyDnKDo1bqB0BWJYJg42iPQDXF2hD2AjHxfNScOugkmXKTE+FOJUxptz SmcxpzCmmSwM8ZQrfIq0clJY+OEEukvXb7Y1Y/kIoQD6PYBNQjYl2c7N92sgaKamB8K5 /fuKVeNwmV0Etao31Vyv7ouh0JuAjBP4GjMFlvujNFXe6BcaDd7haA9tq4eodxDd5UAE 3PI2fKj8F9PW4LjK9ntjKYaS7DOhQwPP4ahjr5c8ROsL55Cnq6aV3fyqa2UePj8e3Wp8 qTnQ== 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=HXZTY79ogdU3cuAmQiOEqFI8HiKCYgS/bxD1qQ4VBwM=; b=qlXxlezP6JU7FetC3ECeRdI8zZ4or10Muz5bYkBla5DltCaTTjIgNlR5rbzb2zj+YP ItgeIj9CK0CVIHDIkd3HwpeZvB4jhNhtXw5hw+ycfZZcIvSI563cBYDyVxaZaHbe9u+P vbE4VsqfYG/ila7BH5M3jNFcehRv75EV/VtBRmqk36uiXz2GwinHhFpmlAnwxEE54m79 ISGtWnZMF1Xd5XnMrtrggLh5QbsGNhFJds9p+vLniYtyprcszZNJmLM8IzYYFw5upTRE zA+OK09oigXto+Bv0QScfT1llfkq+vSzisr3YqEvIv5rDhP//Jjf1ZVfp8XZVA6Snjh3 KYsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="JjMjdW/U"; 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 h132-20020a25218a000000b006457689e91asi1524271ybh.449.2022.04.21.08.35.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 Apr 2022 08:35:57 -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="JjMjdW/U"; 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]:57820 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhYqb-00055d-5d for patch@linaro.org; Thu, 21 Apr 2022 11:35:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42926) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhYZT-0007S5-Qa for qemu-devel@nongnu.org; Thu, 21 Apr 2022 11:18:15 -0400 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]:37813) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nhYZO-0006Ib-Uo for qemu-devel@nongnu.org; Thu, 21 Apr 2022 11:18:15 -0400 Received: by mail-pj1-x1031.google.com with SMTP id mm4-20020a17090b358400b001cb93d8b137so8023279pjb.2 for ; Thu, 21 Apr 2022 08:18:09 -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=HXZTY79ogdU3cuAmQiOEqFI8HiKCYgS/bxD1qQ4VBwM=; b=JjMjdW/UXeVYH7d8YJ3VSVXohTIXUzi6KLoJIQHcpGEwfvZYkAT60P1gyN+kPeBzaI aBTtw4g5OmEx6kQ+U03dEjNdbepTb+94iVVjNiz4FzRE1GiUCWEZJVrQj3fzBhFD3RMo zYbbonELEYS6Wc2L0S92c15cHqZ+LBDV2mek8L6PmEu7JRAW9sG5s/LRLodbpEUgLb0X okyqK7bpj12Rpm64gmz/CtAiv05TbOFKK8dzT81/JQJNYcVIZGZKfH2iUnNuAEtPAURF 4P6uxaF54/BVLCuWqoeOqgRZPOqA4cdC5qmZrigUxQ9scs0wjjaDMzXx+FDPrDiVHKJc so3A== 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=HXZTY79ogdU3cuAmQiOEqFI8HiKCYgS/bxD1qQ4VBwM=; b=m9ZCFbRS2mTTDeTAwKMJH1FbgAUjSgD45BqBe5MWRRE38dsO2jYzqjEIsHKymcEV2C XAVWNMVneoxoWNtRUhfrpR85sSLxk8is2IKTnrc04h89x2+OaFv8wqCgkasGKtaJoErG s0dobAJrNS768f7UJr1lmLMEM6l2AGy/MB1SwriKXRPyJMo96dMmQMdmlTr/VFU902du nj4RqZLiI74GzsHdI4yNyeS2BBcgWlCxCX3NtXzQPP+oDd8kkhzC7wA6qe/0aFspcmiy /ClceY1ejhKP+DuagPj1NlifKythaBqfl+D2jBVDGCNifgTr+fkDhyjEYw2fbSZr1u/m TV6g== X-Gm-Message-State: AOAM533mshn0uUqQWAtqWp8RcSJ9ynvyQdyjvt3gIkSXki7RzVJgh4Yf 6f2LOLg3VD8lSKSyoBN4l9/w0+t7L9z5rw== X-Received: by 2002:a17:902:b906:b0:14f:76a0:ad48 with SMTP id bf6-20020a170902b90600b0014f76a0ad48mr26683471plb.79.1650554288825; Thu, 21 Apr 2022 08:18:08 -0700 (PDT) Received: from stoup.. ([2607:fb90:80c8:6cf3:a91a:4957:ba18:ac18]) by smtp.gmail.com with ESMTPSA id z16-20020a056a00241000b004f3a647ae89sm24616248pfh.174.2022.04.21.08.18.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Apr 2022 08:18:08 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v7 20/64] linux-user/nios2: Only initialize SP and PC in target_cpu_copy_regs Date: Thu, 21 Apr 2022 08:16:51 -0700 Message-Id: <20220421151735.31996-21-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220421151735.31996-1-richard.henderson@linaro.org> References: <20220421151735.31996-1-richard.henderson@linaro.org> MIME-Version: 1.0 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: -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_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_HELO_TEMPERROR=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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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 --- 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 = infop->entry; regs->sp = infop->start_stack; - regs->estatus = 0x3; } #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) void target_cpu_copy_regs(CPUArchState *env, struct target_pt_regs *regs) { - env->regs[0] = 0; - env->regs[1] = regs->r1; - env->regs[2] = regs->r2; - env->regs[3] = regs->r3; - env->regs[4] = regs->r4; - env->regs[5] = regs->r5; - env->regs[6] = regs->r6; - env->regs[7] = regs->r7; - env->regs[8] = regs->r8; - env->regs[9] = regs->r9; - env->regs[10] = regs->r10; - env->regs[11] = regs->r11; - env->regs[12] = regs->r12; - env->regs[13] = regs->r13; - env->regs[14] = regs->r14; - env->regs[15] = regs->r15; - /* TODO: unsigned long orig_r2; */ - env->regs[R_RA] = regs->ra; - env->regs[R_FP] = regs->fp; env->regs[R_SP] = regs->sp; - env->regs[R_GP] = regs->gp; - env->regs[CR_ESTATUS] = regs->estatus; env->pc = regs->ea; - /* TODO: unsigned long orig_r7; */ }