From patchwork Fri Aug 28 14:18:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 248524 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp1128490ilg; Fri, 28 Aug 2020 07:27:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxEPpHcD4um6CRM9GhYOwjtZoOprsOAuotm4ivEBs+TwXb4nwXiRafg6DymfwtUgy/Doogw X-Received: by 2002:a25:2314:: with SMTP id j20mr2718284ybj.508.1598624823292; Fri, 28 Aug 2020 07:27:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598624823; cv=none; d=google.com; s=arc-20160816; b=QURNeljylb1nOlDCF0de7iDtFzowXaiA7V3auVjK40YevFeKd6tmt2y6LzckgiQRur yIsM44meEck/x/NkFIXy39DFsh/gPRNAJrFJqpzMdvhZIrEVI1/bB+DKulIuODyW18B9 fwRQFCaNkkczYiHvn61TQ4Oui25jqkLrxosICIXzVev89aaWiQVzgOLAh1cJy0w1QFwS KLVx1yFnpqp3rGFW+2YpDQYefT+Nd0T0cO0V4jT5/V97L1pfv6IK8gj53WEVW53WoHln 3NaHNUsQ5Jy0Zflvr2mqpZIqnskyq92sBOrGFcvL6tg6CIzBtlTJzknB3PJUiUCAVZEd RlOQ== 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=KsI7jjY2DSblBjRViCirscdfvNpkyagIB9GNc9p93e072iiwkW/m8aYaF7Myhbtt4D 3RGZcCQEVeDzD4UHzY5jUD/bjUgu+3j0RVhp+/1aJqCe2wxwTfjIpsz2tr+ewfLy1a3A TLYxufj4lj2f8FPO/+TCTx0hxMLgCfiTfPz1bVY8nc9OWhxlwQKXlqJcdLXoReEfEmd9 h8vOHuP5TSGVqqplXKkTP6qXOxeCuPJHC18+1G442FMBzY3/WWrtzwAimdtH4Cp5l20N 3XKMayCwMdDywT2ykuo6aXLGv0HtvWerkqO1CaxS6CmNlxxugCfHMFW8TWwU03RQxsjR 5b5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=J5WX9nTT; 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 128si1100145yba.332.2020.08.28.07.27.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 28 Aug 2020 07:27:03 -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=J5WX9nTT; 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]:53116 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kBfLK-0004kS-Ow for patch@linaro.org; Fri, 28 Aug 2020 10:27:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50978) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kBfEL-0008GA-Ga for qemu-devel@nongnu.org; Fri, 28 Aug 2020 10:19:49 -0400 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]:33812) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kBfEJ-00054Y-JE for qemu-devel@nongnu.org; Fri, 28 Aug 2020 10:19:49 -0400 Received: by mail-pg1-x541.google.com with SMTP id i10so535255pgk.1 for ; Fri, 28 Aug 2020 07:19:47 -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=J5WX9nTT9MdGeM+/nwjYQNebibQDzHizdBLLXGBgD0rkbXpfbee9FTg4Im6d3avgY2 A3lgfgzuCiDKQZAKD0h8FvO3kw+3ZzVqbB6oi2z1qt6581PhlECRIke1MkdxSoj/VY3Y gKBJxsuqRB9C66UsCH/yQ4jXLS58ueRHMPQbKgmUYtJFUEqQGB2sD6pn1Fw1eOonSxmH rqajT/VU402lvvrL+55vL7AbQYMbSXZKT/vWy8pDu6f5/WEd/tK1iTFJ4xmQb+0ZAFRp ZoCzTJ6KIdlxdAc6VMbWgZSZJb2a/O2VoxjLHQ+c6RKYhSHD6gTX/Iv74YizXvGMDka7 reuw== 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=RIjpBiEa5QXVUeqYccLU7uoOG0a39CcspZUYK95BOHyq1nYG25WWItzj9EQU2lrzcU AWRoNhz2ASZNj0Sb6EHgh/3wvxs7rnuLf/+gvThly1fHC4bD8IpZnnmTVca5yh+PcpoQ o9gpOhw2e9AtrZWQGBg3dgKyP588QYPIzNqxXgwY5yiuT6wdEy4NFiWysohrRciPvPSL ocTKekNbhfitVQSuwVwpFK7iDAzj9aGmiLvKhqaZfyQ/jJcEFQASDpDeNfQUV1vKJ1fU i9FNTOCNdtW0MRJn4OUQ1q8NlMAyjJzLF3a2XeWhtk4V67P2sTFnX/HwFSimev6YeWbx puBg== X-Gm-Message-State: AOAM531UyRpo+CFS+HEEtCrXdj2gyox9Dyya5z8K78iZzYzvqAGapTfW 11hI9oo1Qz4Gw8nJ0IKOpCBNGG1LSfZ4Aw== X-Received: by 2002:aa7:9e5d:: with SMTP id z29mr1492151pfq.122.1598624385846; Fri, 28 Aug 2020 07:19:45 -0700 (PDT) Received: from localhost.localdomain ([71.212.141.89]) by smtp.gmail.com with ESMTPSA id j3sm1403080pjw.23.2020.08.28.07.19.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Aug 2020 07:19:45 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 11/76] target/microblaze: Split out EDR from env->sregs Date: Fri, 28 Aug 2020 07:18:24 -0700 Message-Id: <20200828141929.77854-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200828141929.77854-1-richard.henderson@linaro.org> References: <20200828141929.77854-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::541; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x541.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@xilinx.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,