From patchwork Mon Aug 31 16:04:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 248767 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp3445956ilg; Mon, 31 Aug 2020 09:13:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1TT6zLtxzeaxX7ImFwSB5jFq/+JUwbjasV/LQHpMoQ4O79B1BWmB8MwsQQBKhHbw2UStj X-Received: by 2002:a25:9247:: with SMTP id e7mr3514194ybo.293.1598890401870; Mon, 31 Aug 2020 09:13:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598890401; cv=none; d=google.com; s=arc-20160816; b=olnOTzboYVIhjtKVUxYCSAbg4Mr5Zsaf7Kndalz/Oj7Eysaa0CJDRwz/zVVsgYunnc vRTPZnz3ULJAskYtgPp0WhWovjFxlSVEWaDBcgAP0lLgA44GejJmvSwo7rHepQsZ12dt lTn3MdPfmZ+9qFtbkXiulflMvP8S7VjIpKa+738CCfUSkUebvc4J2urqPbyRpik5nk38 vxD4GEJ2e0aAGTkea5ugtEePBvtxK3xyb9H3rsB5z8h/ff1Ii2QEklTfiupuX+iCxLbt AAqCA1dr9qZPArQ/7yadtNse2d05vfiKAVp22e0kXYbeekLl0DOJElJHA1w/7g3WeRMJ VZJg== 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=2lk+ZBWQv/ZXsPrb8oTjpivGovxY9zx2pXrc7J4dxPM=; b=n8YgiBgAFeKdGSVkBRoaKhW4qN7AAR13rAsbGbR5t0BFHXchirpWfi3oKzEDNTWSci s2HFLmGvN7QB+cTp0SzuVj/HUuGah7LQHB7hG8pihxkBvvW+Yb9CZtsakDZozaDS25bk jWJdaw2VAVqb05VHJ9R+8iEGbEhpfojiUovZVADBMlAI7S5aQjaW6p7n1DcXDBmI6QC+ 3+KPR0KHi04LiCOoj2Ryhg4G/8i5vj9+0ntVhb699ewKG17QejvXGVKeOvKzVzWeyGXh XO0dmiMLJ49ZDBalEoxMhLXewHz+gNv6GzYI/SI9iPaI9DKIiVngMTCQoTv0EXQUHyCl FpHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=X2lRUWSf; 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=fail (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 d197si8593193ybc.65.2020.08.31.09.13.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 31 Aug 2020 09:13:21 -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=fail header.i=@linaro.org header.s=google header.b=X2lRUWSf; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:56408 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kCmQr-0000WJ-7W for patch@linaro.org; Mon, 31 Aug 2020 12:13:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33514) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kCmK5-0003ih-Sm for qemu-devel@nongnu.org; Mon, 31 Aug 2020 12:06:21 -0400 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]:38483) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kCmK3-0005wO-V1 for qemu-devel@nongnu.org; Mon, 31 Aug 2020 12:06:21 -0400 Received: by mail-pl1-x643.google.com with SMTP id t11so3245408plr.5 for ; Mon, 31 Aug 2020 09:06:19 -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=2lk+ZBWQv/ZXsPrb8oTjpivGovxY9zx2pXrc7J4dxPM=; b=X2lRUWSfLxP75aJVqWsUnA87fqiUroI4bDp2dCk9ctGSgd7fwNJ0nrQSXDDQhicmLM DN8qq9+nAZmNOlHOBNQROdqwUnyVGfD9P8IHPk2aacLpZ3AmnBVbfKCDV8wmnnmFIXeG mW9GcR35z6BmQnrEX7VAJn1hNn/Y3nR/hS4YjkxmcR35npPmJuCI6wi0AnJW9qzBS0AK /jcHlQTNeffUf7tBFz0++7f5F53D7jb+VTLNk1vwsUUJOelXX6ZUxCgXBXSmw7hc5qii M7Em6nvUAnQkhEYA8EadPs6TntAJ7J8kWTs4ANubbw3Dn9seG9/+efRmw4No8yxSrDIB 4xOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2lk+ZBWQv/ZXsPrb8oTjpivGovxY9zx2pXrc7J4dxPM=; b=hBiRE3w4t4ERTNFqiEMaOyMPnTXvNFPbZhavTmbrJ9ve/bkQIrSo20WIiHSNfmPJGB d6YaE/XsV9tuBDm9lRTbTKKIaP0fNcDDdBtWYxKd3T/vuK1+b6lBNhRbs249J4W3jcwk DpdaxiC8IamUEbneAbT5gVACgetTK8+HRgXmG76yaB7JX8TpAsKdCCYpGIlOh/2kmpEV ZJYLUpNKXDYqcIWxdQhLz5qNbXfNSMpK+bz3MdMIxE8aX1jr7IKDXkA6AfgJENnfr9Bs T2vqDB3dqluzeCngIp3BMhbujHoU1pCrhV9yiFt/L//N6QyZuF1ggDDxI6bMJEUWVeLG plkw== X-Gm-Message-State: AOAM530s2W2Hzrbes+Zx4tVhiY8uj7DMpi0ymHs50N66v6UDo5387cI3 JPX3llMF07P/ec59uKzAtaPjP3VIumvUZQ== X-Received: by 2002:a17:902:708b:: with SMTP id z11mr1577952plk.326.1598889978061; Mon, 31 Aug 2020 09:06:18 -0700 (PDT) Received: from localhost.localdomain ([71.212.141.89]) by smtp.gmail.com with ESMTPSA id gt13sm17218pjb.43.2020.08.31.09.06.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Aug 2020 09:06:17 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 10/76] target/microblaze: Split out BTR from env->sregs Date: Mon, 31 Aug 2020 09:04:55 -0700 Message-Id: <20200831160601.833692-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200831160601.833692-1-richard.henderson@linaro.org> References: <20200831160601.833692-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::643; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x643.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Edgar E . Iglesias" , peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Continue eliminating the sregs array in favor of individual members. Does not correct the width of BTR, yet. Tested-by: Edgar E. Iglesias Reviewed-by: Edgar E. Iglesias Signed-off-by: Richard Henderson --- target/microblaze/cpu.h | 1 + target/microblaze/gdbstub.c | 4 ++-- target/microblaze/helper.c | 4 ++-- target/microblaze/translate.c | 6 ++++-- 4 files changed, 9 insertions(+), 6 deletions(-) -- 2.25.1 diff --git a/target/microblaze/cpu.h b/target/microblaze/cpu.h index bcafef99b0..deddb47abb 100644 --- a/target/microblaze/cpu.h +++ b/target/microblaze/cpu.h @@ -241,6 +241,7 @@ struct CPUMBState { uint64_t ear; uint64_t esr; uint64_t fsr; + uint64_t btr; uint64_t sregs[14]; float_status fp_status; /* Stack protectors. Yes, it's a hw feature. */ diff --git a/target/microblaze/gdbstub.c b/target/microblaze/gdbstub.c index 2634ce49fc..cde8c169bf 100644 --- a/target/microblaze/gdbstub.c +++ b/target/microblaze/gdbstub.c @@ -74,7 +74,7 @@ int mb_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n) val = env->fsr; break; case GDB_BTR: - val = env->sregs[SR_BTR]; + val = env->btr; break; case GDB_PVR0 ... GDB_PVR11: /* PVR12 is intentionally skipped */ @@ -130,7 +130,7 @@ int mb_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n) env->fsr = tmp; break; case GDB_BTR: - env->sregs[SR_BTR] = tmp; + env->btr = tmp; break; case GDB_PVR0 ... GDB_PVR11: /* PVR12 is intentionally skipped */ diff --git a/target/microblaze/helper.c b/target/microblaze/helper.c index ea290be780..b240dc76f6 100644 --- a/target/microblaze/helper.c +++ b/target/microblaze/helper.c @@ -132,7 +132,7 @@ void mb_cpu_do_interrupt(CPUState *cs) /* Exception breaks branch + dslot sequence? */ if (env->iflags & D_FLAG) { env->esr |= 1 << 12 ; - env->sregs[SR_BTR] = env->btarget; + env->btr = env->btarget; } /* Disable the MMU. */ @@ -160,7 +160,7 @@ void mb_cpu_do_interrupt(CPUState *cs) if (env->iflags & D_FLAG) { D(qemu_log("D_FLAG set at exception bimm=%d\n", env->bimm)); env->esr |= 1 << 12 ; - env->sregs[SR_BTR] = env->btarget; + env->btr = env->btarget; /* Reexecute the branch. */ env->regs[17] -= 4; diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index c58c49ea8f..469e1f103a 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -1811,7 +1811,7 @@ void mb_cpu_dump_state(CPUState *cs, FILE *f, int flags) "rbtr=%" PRIx64 "\n", env->msr, env->esr, env->ear, env->debug, env->imm, env->iflags, env->fsr, - env->sregs[SR_BTR]); + env->btr); qemu_fprintf(f, "btaken=%d btarget=%" PRIx64 " mode=%s(saved=%s) " "eip=%d ie=%d\n", env->btaken, env->btarget, @@ -1879,8 +1879,10 @@ void mb_tcg_init(void) tcg_global_mem_new_i64(cpu_env, offsetof(CPUMBState, esr), "resr"); cpu_SR[SR_FSR] = tcg_global_mem_new_i64(cpu_env, offsetof(CPUMBState, fsr), "rfsr"); + cpu_SR[SR_BTR] = + tcg_global_mem_new_i64(cpu_env, offsetof(CPUMBState, btr), "rbtr"); - for (i = SR_FSR + 1; i < ARRAY_SIZE(cpu_SR); i++) { + for (i = SR_BTR + 1; i < ARRAY_SIZE(cpu_SR); i++) { cpu_SR[i] = tcg_global_mem_new_i64(cpu_env, offsetof(CPUMBState, sregs[i]), special_regnames[i]);