From patchwork Tue Aug 25 20:58:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 248278 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:522:0:0:0:0 with SMTP id h2csp3770774ils; Tue, 25 Aug 2020 14:10:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwigUXCjUI36okTQNdEpTFifjR2Q8/x/GWElaYOqIBfUZRPw/uyGlufj8nMxxiseXDuHdcO X-Received: by 2002:a25:8481:: with SMTP id v1mr17291071ybk.203.1598389817315; Tue, 25 Aug 2020 14:10:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598389817; cv=none; d=google.com; s=arc-20160816; b=UYVfEOpDzJeFyK5SmGbJKPSU1uVXF5h8QBe5LiWKWTqxzw9qZ61tr0b44KFFsxfwnt Scq6DCHSzqLNRoTOTuLvUp2qpZb5i3nrGxTD5jpl4NxooL84/LMgZUzIWElrAxBAuua1 pyQ3wRBIs2PZ6X6iouKX4DVcVBFy8pAMdgiyr78z1GMniepOeTDPoYOLVkkJ69w8GmQc OzDniDyn7tP3eYi5EmdFCbQrHYOseoya6BLpHJ16ubC5G9qhPKzedCLxRr6xMLkejd6Y h7W6uEVna/CkoB40qh26W00XjkF2AC4F6WfPHx7kFdF/imfdEDyOf0cTS5fIZkR1leeI HaFA== 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=kxuKPEsnkZdfVwCBdweXYlcCCLoCz5+CGJqBlv/VqWk=; b=A/G2/lvnA1yolEiXCbVpL93vfW2JmNy4z9AKG0uVSc6WUmzmRCCE9ixku4SMSXu1Yo tElVYosUiWNA+SAnYibbnvCXQGCESHPFVNULRAW3snrZOMl0pc34OsSToIRljxM3Uh8I Ylm6KHthhLATXqjwv+jrxEJIkTq8wUYAalVpy02Nk1pymP9bk8k3cQPPLcDkGFjhFcvC 0UZc2JvdmAoBe9AVKkNlsCfHobVCw5CN+DbNtxDp6ojIpTD+LmYieTScQazqXKsCPGog JpYru9Y88Men1J65zonLZ0ieV+FAI0/Dnk4MQwnwz4F9UTdXQ0auEmiKoTVXht/lc4Tv bd8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GD3E5qCk; 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 j134si59557ybg.23.2020.08.25.14.10.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 25 Aug 2020 14:10:17 -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=GD3E5qCk; 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]:46728 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kAgCu-0004IS-P1 for patch@linaro.org; Tue, 25 Aug 2020 17:10:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35474) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAg38-00079f-88 for qemu-devel@nongnu.org; Tue, 25 Aug 2020 17:00:10 -0400 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]:41473) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kAg36-0001fs-85 for qemu-devel@nongnu.org; Tue, 25 Aug 2020 17:00:09 -0400 Received: by mail-pf1-x441.google.com with SMTP id t9so4126129pfq.8 for ; Tue, 25 Aug 2020 14:00:07 -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=kxuKPEsnkZdfVwCBdweXYlcCCLoCz5+CGJqBlv/VqWk=; b=GD3E5qCkYkw51GLIr33M6sGVxn/rVSX/MWl0QOQb2E+cyhWEkZcJD4KDWGnRylaLoR QZu+t7CJgJg+cgJo74sXw+8yZxkg52/Q6Z0IX6etci8Ym+XWdv40WRgygURjL6YliLB0 N0PGY3DYU4A9Tg1nsFHfhwM0dk72Vlq8T2SuNRlsTLhD/UaIl/zEFHPnpSc5QP9rDQro BXmNQ28GOV8kX5+GROm3MSf/nmpo4vC9LR0H5MzQXx3kcTv5djLJ9/x3K1auXx1g0nJE uuuLqmVEQAxc9cB8EyVB0A9EuFGXHJwESg4Z9BrUwVfuIzJku7cjA4MHaTKhh3cAAYGA CJ2w== 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=kxuKPEsnkZdfVwCBdweXYlcCCLoCz5+CGJqBlv/VqWk=; b=rPeeobzl2FagcnvN6A/8gbB6jX1T25Y3CGSQ7u0TqMizA8yv9QOZCUEtIv4ySCNpuI HfBCgV3RSbxrgmyn1t1LXfhaUN6WhmoyQ/9SRER9oH1gFY9bvw2DZf2N+ovb+07IRsPU NycIhuxX2Gr6qV2MYaA/q5PMSbFD0nv1jy80FRKDi2UdYnqAnoGo2mEugAbQITRYdQd8 rQtqpgf6cMRABLVn0YuH0HmItuBdk+ESUGQZOdjAYIr/HQRMmN0Ts1PnUKCZSfnXxeBP QsI6Eb2BnCn/yVfQAfg/w1c/7+h3fA9k5Ep6lQm6hhNUR2ss6iDnmhRhmnqCNUpT1iC+ dUiw== X-Gm-Message-State: AOAM532+E+rZZUuvUiObR/N+UC0j5oH6zeCKC1VvPBzpXa/b1MfXi1Ym zuyU1SGaGXWMemT5jN8PS4a15FfxdTdLaw== X-Received: by 2002:a62:18ce:: with SMTP id 197mr9227929pfy.85.1598389206419; Tue, 25 Aug 2020 14:00:06 -0700 (PDT) Received: from localhost.localdomain (h216-228-167-147.bendor.dedicated.static.tds.net. [216.228.167.147]) by smtp.gmail.com with ESMTPSA id k4sm16074pgr.87.2020.08.25.14.00.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Aug 2020 14:00:05 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 11/77] target/microblaze: Split out EDR from env->sregs Date: Tue, 25 Aug 2020 13:58:44 -0700 Message-Id: <20200825205950.730499-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200825205950.730499-1-richard.henderson@linaro.org> References: <20200825205950.730499-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::441; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x441.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.iglesias@gmail.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Finish eliminating the sregs array in favor of individual members. Does not correct the width of EDR, yet. Signed-off-by: Richard Henderson --- target/microblaze/cpu.h | 2 +- linux-user/elfload.c | 9 ++++++--- target/microblaze/gdbstub.c | 4 ++-- target/microblaze/translate.c | 16 +++------------- 4 files changed, 12 insertions(+), 19 deletions(-) -- 2.25.1 diff --git a/target/microblaze/cpu.h b/target/microblaze/cpu.h index deddb47abb..610ddfb719 100644 --- a/target/microblaze/cpu.h +++ b/target/microblaze/cpu.h @@ -242,7 +242,7 @@ struct CPUMBState { uint64_t esr; uint64_t fsr; uint64_t btr; - uint64_t sregs[14]; + uint64_t edr; float_status fp_status; /* Stack protectors. Yes, it's a hw feature. */ uint32_t slr, shr; diff --git a/linux-user/elfload.c b/linux-user/elfload.c index fe9dfe795d..bbfb665321 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -1032,9 +1032,12 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUMBState *env (*regs)[pos++] = tswapreg(env->regs[i]); } - for (i = 0; i < 6; i++) { - (*regs)[pos++] = tswapreg(env->sregs[i]); - } + (*regs)[pos++] = tswapreg(env->pc); + (*regs)[pos++] = tswapreg(env->msr); + (*regs)[pos++] = 0; + (*regs)[pos++] = tswapreg(env->ear); + (*regs)[pos++] = 0; + (*regs)[pos++] = tswapreg(env->esr); } #endif /* TARGET_MICROBLAZE */ diff --git a/target/microblaze/gdbstub.c b/target/microblaze/gdbstub.c index cde8c169bf..9cba9d2215 100644 --- a/target/microblaze/gdbstub.c +++ b/target/microblaze/gdbstub.c @@ -81,7 +81,7 @@ int mb_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n) val = env->pvr.regs[n - GDB_PVR0]; break; case GDB_EDR: - val = env->sregs[SR_EDR]; + val = env->edr; break; case GDB_SLR: val = env->slr; @@ -137,7 +137,7 @@ int mb_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n) env->pvr.regs[n - GDB_PVR0] = tmp; break; case GDB_EDR: - env->sregs[SR_EDR] = tmp; + env->edr = tmp; break; case GDB_SLR: env->slr = tmp; diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index 469e1f103a..7d307e6b48 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -103,12 +103,6 @@ static const char *regnames[] = "r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31", }; -static const char *special_regnames[] = -{ - "rpc", "rmsr", "sr2", "rear", "sr4", "resr", "sr6", "rfsr", - "sr8", "sr9", "sr10", "rbtr", "sr12", "redr" -}; - static inline void t_sync_flags(DisasContext *dc) { /* Synch the tb dependent flags between translator and runtime. */ @@ -1828,7 +1822,7 @@ void mb_cpu_dump_state(CPUState *cs, FILE *f, int flags) /* Registers that aren't modeled are reported as 0 */ qemu_fprintf(f, "redr=%" PRIx64 " rpid=0 rzpr=0 rtlbx=0 rtlbsx=0 " - "rtlblo=0 rtlbhi=0\n", env->sregs[SR_EDR]); + "rtlblo=0 rtlbhi=0\n", env->edr); qemu_fprintf(f, "slr=%x shr=%x\n", env->slr, env->shr); for (i = 0; i < 32; i++) { qemu_fprintf(f, "r%2.2d=%8.8x ", i, env->regs[i]); @@ -1881,12 +1875,8 @@ void mb_tcg_init(void) 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_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]); - } + cpu_SR[SR_EDR] = + tcg_global_mem_new_i64(cpu_env, offsetof(CPUMBState, edr), "redr"); } void restore_state_to_opc(CPUMBState *env, TranslationBlock *tb,