2009-12-05 14:44:21 +03:00
|
|
|
/*
|
|
|
|
* S/390 helpers
|
|
|
|
*
|
|
|
|
* Copyright (c) 2009 Ulrich Hecht
|
2011-03-23 12:58:07 +03:00
|
|
|
* Copyright (c) 2011 Alexander Graf
|
2009-12-05 14:44:21 +03:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2010-03-07 18:48:43 +03:00
|
|
|
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
2009-12-05 14:44:21 +03:00
|
|
|
*/
|
|
|
|
|
2016-01-26 21:17:00 +03:00
|
|
|
#include "qemu/osdep.h"
|
2009-12-05 14:44:21 +03:00
|
|
|
#include "cpu.h"
|
2017-08-18 14:43:49 +03:00
|
|
|
#include "internal.h"
|
2012-12-17 21:19:49 +04:00
|
|
|
#include "exec/gdbstub.h"
|
2012-12-17 21:20:00 +04:00
|
|
|
#include "qemu/timer.h"
|
2016-03-15 15:18:37 +03:00
|
|
|
#include "exec/exec-all.h"
|
2015-12-04 14:06:26 +03:00
|
|
|
#include "hw/s390x/ioinst.h"
|
2017-09-28 23:36:46 +03:00
|
|
|
#include "sysemu/hw_accel.h"
|
2011-10-07 11:51:50 +04:00
|
|
|
#ifndef CONFIG_USER_ONLY
|
2012-12-17 21:20:04 +04:00
|
|
|
#include "sysemu/sysemu.h"
|
2011-10-07 11:51:50 +04:00
|
|
|
#endif
|
2009-12-05 14:44:21 +03:00
|
|
|
|
2011-03-23 12:58:07 +03:00
|
|
|
#ifndef CONFIG_USER_ONLY
|
2012-04-02 15:56:29 +04:00
|
|
|
void s390x_tod_timer(void *opaque)
|
2011-03-23 12:58:07 +03:00
|
|
|
{
|
2017-09-28 23:36:39 +03:00
|
|
|
cpu_inject_clock_comparator((S390CPU *) opaque);
|
2011-03-23 12:58:07 +03:00
|
|
|
}
|
|
|
|
|
2012-04-02 15:56:29 +04:00
|
|
|
void s390x_cpu_timer(void *opaque)
|
2011-03-23 12:58:07 +03:00
|
|
|
{
|
2017-09-28 23:36:39 +03:00
|
|
|
cpu_inject_cpu_timer((S390CPU *) opaque);
|
2011-03-23 12:58:07 +03:00
|
|
|
}
|
|
|
|
#endif
|
2009-12-05 14:44:26 +03:00
|
|
|
|
2017-07-24 11:52:49 +03:00
|
|
|
#ifndef CONFIG_USER_ONLY
|
2011-03-23 12:58:07 +03:00
|
|
|
|
2013-06-29 20:55:54 +04:00
|
|
|
hwaddr s390_cpu_get_phys_page_debug(CPUState *cs, vaddr vaddr)
|
2011-03-23 12:58:07 +03:00
|
|
|
{
|
2013-06-29 20:55:54 +04:00
|
|
|
S390CPU *cpu = S390_CPU(cs);
|
|
|
|
CPUS390XState *env = &cpu->env;
|
2011-03-23 12:58:07 +03:00
|
|
|
target_ulong raddr;
|
2015-02-12 20:09:22 +03:00
|
|
|
int prot;
|
2011-03-23 12:58:07 +03:00
|
|
|
uint64_t asc = env->psw.mask & PSW_MASK_ASC;
|
|
|
|
|
|
|
|
/* 31-Bit mode */
|
|
|
|
if (!(env->psw.mask & PSW_MASK_64)) {
|
|
|
|
vaddr &= 0x7fffffff;
|
|
|
|
}
|
|
|
|
|
2015-12-09 18:36:42 +03:00
|
|
|
if (mmu_translate(env, vaddr, MMU_INST_FETCH, asc, &raddr, &prot, false)) {
|
|
|
|
return -1;
|
|
|
|
}
|
2011-03-23 12:58:07 +03:00
|
|
|
return raddr;
|
|
|
|
}
|
|
|
|
|
2012-09-03 15:09:10 +04:00
|
|
|
hwaddr s390_cpu_get_phys_addr_debug(CPUState *cs, vaddr vaddr)
|
|
|
|
{
|
|
|
|
hwaddr phys_addr;
|
|
|
|
target_ulong page;
|
|
|
|
|
|
|
|
page = vaddr & TARGET_PAGE_MASK;
|
|
|
|
phys_addr = cpu_get_phys_page_debug(cs, page);
|
|
|
|
phys_addr += (vaddr & ~TARGET_PAGE_MASK);
|
|
|
|
|
|
|
|
return phys_addr;
|
|
|
|
}
|
|
|
|
|
2017-09-28 23:36:46 +03:00
|
|
|
static inline bool is_special_wait_psw(uint64_t psw_addr)
|
|
|
|
{
|
|
|
|
/* signal quiesce */
|
|
|
|
return psw_addr == 0xfffUL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void s390_handle_wait(S390CPU *cpu)
|
|
|
|
{
|
s390x/cpu: expose the guest crash information
This patch is the s390 implementation of guest crash information,
similar to commit d187e08dc4 ("i386/cpu: add crash-information QOM
property") and the related commits. We will detect several crash
reasons, with the "disabled wait" being the most important one, since
this is used by all s390 guests as a "panic like" notification.
Demonstrate these ways with examples as follows.
1. crash-information QOM property;
Run qemu with -qmp unix:qmp-sock,server, then use utility "qmp-shell"
to execute "qom-get" command, and might get the result like,
(QEMU) (QEMU) qom-get path=/machine/unattached/device[0] \
property=crash-information
{"return": {"core": 0, "reason": "disabled-wait", "psw-mask": 562956395872256, \
"type": "s390", "psw-addr": 1102832}}
2. GUEST_PANICKED event reporting;
Run qemu with a socket option, and telnet or nc to that,
-chardev socket,id=qmp,port=4444,host=localhost,server \
-mon chardev=qmp,mode=control,pretty=on \
Negotiating the mode by { "execute": "qmp_capabilities" }, and the crash
information will be reported on a guest crash event like,
{
"timestamp": {
"seconds": 1518004739,
"microseconds": 552563
},
"event": "GUEST_PANICKED",
"data": {
"action": "pause",
"info": {
"core": 0,
"psw-addr": 1102832,
"reason": "disabled-wait",
"psw-mask": 562956395872256,
"type": "s390"
}
}
}
3. log;
Run qemu with the parameters: -D <logfile> -d guest_errors, to
specify the logfile and log item. The results might be,
Guest crashed on cpu 0: disabled-wait
PSW: 0x0002000180000000 0x000000000010d3f0
Co-authored-by: Jing Liu <liujbjl@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Message-Id: <20180209122543.25755-1-borntraeger@de.ibm.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[CH: tweaked qapi comment]
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
2018-02-09 15:25:43 +03:00
|
|
|
CPUState *cs = CPU(cpu);
|
|
|
|
|
2017-09-28 23:36:46 +03:00
|
|
|
if (s390_cpu_halt(cpu) == 0) {
|
|
|
|
#ifndef CONFIG_USER_ONLY
|
|
|
|
if (is_special_wait_psw(cpu->env.psw.addr)) {
|
|
|
|
qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN);
|
|
|
|
} else {
|
s390x/cpu: expose the guest crash information
This patch is the s390 implementation of guest crash information,
similar to commit d187e08dc4 ("i386/cpu: add crash-information QOM
property") and the related commits. We will detect several crash
reasons, with the "disabled wait" being the most important one, since
this is used by all s390 guests as a "panic like" notification.
Demonstrate these ways with examples as follows.
1. crash-information QOM property;
Run qemu with -qmp unix:qmp-sock,server, then use utility "qmp-shell"
to execute "qom-get" command, and might get the result like,
(QEMU) (QEMU) qom-get path=/machine/unattached/device[0] \
property=crash-information
{"return": {"core": 0, "reason": "disabled-wait", "psw-mask": 562956395872256, \
"type": "s390", "psw-addr": 1102832}}
2. GUEST_PANICKED event reporting;
Run qemu with a socket option, and telnet or nc to that,
-chardev socket,id=qmp,port=4444,host=localhost,server \
-mon chardev=qmp,mode=control,pretty=on \
Negotiating the mode by { "execute": "qmp_capabilities" }, and the crash
information will be reported on a guest crash event like,
{
"timestamp": {
"seconds": 1518004739,
"microseconds": 552563
},
"event": "GUEST_PANICKED",
"data": {
"action": "pause",
"info": {
"core": 0,
"psw-addr": 1102832,
"reason": "disabled-wait",
"psw-mask": 562956395872256,
"type": "s390"
}
}
}
3. log;
Run qemu with the parameters: -D <logfile> -d guest_errors, to
specify the logfile and log item. The results might be,
Guest crashed on cpu 0: disabled-wait
PSW: 0x0002000180000000 0x000000000010d3f0
Co-authored-by: Jing Liu <liujbjl@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Message-Id: <20180209122543.25755-1-borntraeger@de.ibm.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[CH: tweaked qapi comment]
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
2018-02-09 15:25:43 +03:00
|
|
|
cpu->env.crash_reason = S390_CRASH_REASON_DISABLED_WAIT;
|
|
|
|
qemu_system_guest_panicked(cpu_get_crash_info(cs));
|
2017-09-28 23:36:46 +03:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-03-14 04:38:22 +04:00
|
|
|
void load_psw(CPUS390XState *env, uint64_t mask, uint64_t addr)
|
2011-03-23 12:58:07 +03:00
|
|
|
{
|
2015-06-13 01:46:00 +03:00
|
|
|
uint64_t old_mask = env->psw.mask;
|
|
|
|
|
2014-09-30 12:57:29 +04:00
|
|
|
env->psw.addr = addr;
|
|
|
|
env->psw.mask = mask;
|
2015-02-24 16:15:29 +03:00
|
|
|
if (tcg_enabled()) {
|
|
|
|
env->cc_op = (mask >> 44) & 3;
|
|
|
|
}
|
2014-09-30 12:57:29 +04:00
|
|
|
|
2015-06-13 01:46:00 +03:00
|
|
|
if ((old_mask ^ mask) & PSW_MASK_PER) {
|
|
|
|
s390_cpu_recompute_watchpoints(CPU(s390_env_get_cpu(env)));
|
|
|
|
}
|
|
|
|
|
2017-09-28 23:36:48 +03:00
|
|
|
/* KVM will handle all WAITs and trigger a WAIT exit on disabled_wait */
|
|
|
|
if (tcg_enabled() && (mask & PSW_MASK_WAIT)) {
|
2017-09-28 23:36:46 +03:00
|
|
|
s390_handle_wait(s390_env_get_cpu(env));
|
2011-03-23 12:58:07 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-07-24 11:52:49 +03:00
|
|
|
uint64_t get_psw_mask(CPUS390XState *env)
|
2011-03-23 12:58:07 +03:00
|
|
|
{
|
2015-02-24 16:15:29 +03:00
|
|
|
uint64_t r = env->psw.mask;
|
2011-03-23 12:58:07 +03:00
|
|
|
|
2015-02-24 16:15:29 +03:00
|
|
|
if (tcg_enabled()) {
|
|
|
|
env->cc_op = calc_cc(env, env->cc_op, env->cc_src, env->cc_dst,
|
|
|
|
env->cc_vr);
|
2011-03-23 12:58:07 +03:00
|
|
|
|
2015-02-24 16:15:29 +03:00
|
|
|
r &= ~PSW_MASK_CC;
|
|
|
|
assert(!(env->cc_op & ~3));
|
|
|
|
r |= (uint64_t)env->cc_op << 44;
|
|
|
|
}
|
2011-03-23 12:58:07 +03:00
|
|
|
|
|
|
|
return r;
|
|
|
|
}
|
|
|
|
|
2017-07-24 11:52:49 +03:00
|
|
|
LowCore *cpu_map_lowcore(CPUS390XState *env)
|
2013-01-24 06:28:01 +04:00
|
|
|
{
|
2013-09-03 19:38:47 +04:00
|
|
|
S390CPU *cpu = s390_env_get_cpu(env);
|
2013-01-24 06:28:01 +04:00
|
|
|
LowCore *lowcore;
|
|
|
|
hwaddr len = sizeof(LowCore);
|
|
|
|
|
|
|
|
lowcore = cpu_physical_memory_map(env->psa, &len, 1);
|
|
|
|
|
|
|
|
if (len < sizeof(LowCore)) {
|
2013-09-03 19:38:47 +04:00
|
|
|
cpu_abort(CPU(cpu), "Could not map lowcore\n");
|
2013-01-24 06:28:01 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
return lowcore;
|
|
|
|
}
|
|
|
|
|
2017-07-24 11:52:49 +03:00
|
|
|
void cpu_unmap_lowcore(LowCore *lowcore)
|
2013-01-24 06:28:01 +04:00
|
|
|
{
|
|
|
|
cpu_physical_memory_unmap(lowcore, sizeof(LowCore), 1, sizeof(LowCore));
|
|
|
|
}
|
|
|
|
|
2015-02-24 16:15:29 +03:00
|
|
|
void do_restart_interrupt(CPUS390XState *env)
|
|
|
|
{
|
|
|
|
uint64_t mask, addr;
|
|
|
|
LowCore *lowcore;
|
|
|
|
|
|
|
|
lowcore = cpu_map_lowcore(env);
|
|
|
|
|
|
|
|
lowcore->restart_old_psw.mask = cpu_to_be64(get_psw_mask(env));
|
|
|
|
lowcore->restart_old_psw.addr = cpu_to_be64(env->psw.addr);
|
|
|
|
mask = be64_to_cpu(lowcore->restart_new_psw.mask);
|
|
|
|
addr = be64_to_cpu(lowcore->restart_new_psw.addr);
|
|
|
|
|
|
|
|
cpu_unmap_lowcore(lowcore);
|
2017-09-28 23:37:02 +03:00
|
|
|
env->pending_int &= ~INTERRUPT_RESTART;
|
2015-02-24 16:15:29 +03:00
|
|
|
|
|
|
|
load_psw(env, mask, addr);
|
|
|
|
}
|
|
|
|
|
2015-06-13 01:46:00 +03:00
|
|
|
void s390_cpu_recompute_watchpoints(CPUState *cs)
|
|
|
|
{
|
|
|
|
const int wp_flags = BP_CPU | BP_MEM_WRITE | BP_STOP_BEFORE_ACCESS;
|
|
|
|
S390CPU *cpu = S390_CPU(cs);
|
|
|
|
CPUS390XState *env = &cpu->env;
|
|
|
|
|
|
|
|
/* We are called when the watchpoints have changed. First
|
|
|
|
remove them all. */
|
|
|
|
cpu_watchpoint_remove_all(cs, BP_CPU);
|
|
|
|
|
|
|
|
/* Return if PER is not enabled */
|
|
|
|
if (!(env->psw.mask & PSW_MASK_PER)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Return if storage-alteration event is not enabled. */
|
|
|
|
if (!(env->cregs[9] & PER_CR9_EVENT_STORE)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (env->cregs[10] == 0 && env->cregs[11] == -1LL) {
|
|
|
|
/* We can't create a watchoint spanning the whole memory range, so
|
|
|
|
split it in two parts. */
|
|
|
|
cpu_watchpoint_insert(cs, 0, 1ULL << 63, wp_flags, NULL);
|
|
|
|
cpu_watchpoint_insert(cs, 1ULL << 63, 1ULL << 63, wp_flags, NULL);
|
|
|
|
} else if (env->cregs[10] > env->cregs[11]) {
|
|
|
|
/* The address range loops, create two watchpoints. */
|
|
|
|
cpu_watchpoint_insert(cs, env->cregs[10], -env->cregs[10],
|
|
|
|
wp_flags, NULL);
|
|
|
|
cpu_watchpoint_insert(cs, 0, env->cregs[11] + 1, wp_flags, NULL);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
/* Default case, create a single watchpoint. */
|
|
|
|
cpu_watchpoint_insert(cs, env->cregs[10],
|
|
|
|
env->cregs[11] - env->cregs[10] + 1,
|
|
|
|
wp_flags, NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-09-28 23:36:51 +03:00
|
|
|
struct sigp_save_area {
|
|
|
|
uint64_t fprs[16]; /* 0x0000 */
|
|
|
|
uint64_t grs[16]; /* 0x0080 */
|
|
|
|
PSW psw; /* 0x0100 */
|
|
|
|
uint8_t pad_0x0110[0x0118 - 0x0110]; /* 0x0110 */
|
|
|
|
uint32_t prefix; /* 0x0118 */
|
|
|
|
uint32_t fpc; /* 0x011c */
|
|
|
|
uint8_t pad_0x0120[0x0124 - 0x0120]; /* 0x0120 */
|
|
|
|
uint32_t todpr; /* 0x0124 */
|
|
|
|
uint64_t cputm; /* 0x0128 */
|
|
|
|
uint64_t ckc; /* 0x0130 */
|
|
|
|
uint8_t pad_0x0138[0x0140 - 0x0138]; /* 0x0138 */
|
|
|
|
uint32_t ars[16]; /* 0x0140 */
|
|
|
|
uint64_t crs[16]; /* 0x0384 */
|
|
|
|
};
|
|
|
|
QEMU_BUILD_BUG_ON(sizeof(struct sigp_save_area) != 512);
|
|
|
|
|
|
|
|
int s390_store_status(S390CPU *cpu, hwaddr addr, bool store_arch)
|
|
|
|
{
|
|
|
|
static const uint8_t ar_id = 1;
|
|
|
|
struct sigp_save_area *sa;
|
|
|
|
hwaddr len = sizeof(*sa);
|
|
|
|
int i;
|
|
|
|
|
|
|
|
sa = cpu_physical_memory_map(addr, &len, 1);
|
|
|
|
if (!sa) {
|
|
|
|
return -EFAULT;
|
|
|
|
}
|
|
|
|
if (len != sizeof(*sa)) {
|
|
|
|
cpu_physical_memory_unmap(sa, len, 1, 0);
|
|
|
|
return -EFAULT;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (store_arch) {
|
|
|
|
cpu_physical_memory_write(offsetof(LowCore, ar_access_id), &ar_id, 1);
|
|
|
|
}
|
|
|
|
for (i = 0; i < 16; ++i) {
|
|
|
|
sa->fprs[i] = cpu_to_be64(get_freg(&cpu->env, i)->ll);
|
|
|
|
}
|
|
|
|
for (i = 0; i < 16; ++i) {
|
|
|
|
sa->grs[i] = cpu_to_be64(cpu->env.regs[i]);
|
|
|
|
}
|
|
|
|
sa->psw.addr = cpu_to_be64(cpu->env.psw.addr);
|
|
|
|
sa->psw.mask = cpu_to_be64(get_psw_mask(&cpu->env));
|
|
|
|
sa->prefix = cpu_to_be32(cpu->env.psa);
|
|
|
|
sa->fpc = cpu_to_be32(cpu->env.fpc);
|
|
|
|
sa->todpr = cpu_to_be32(cpu->env.todpr);
|
|
|
|
sa->cputm = cpu_to_be64(cpu->env.cputm);
|
|
|
|
sa->ckc = cpu_to_be64(cpu->env.ckc >> 8);
|
|
|
|
for (i = 0; i < 16; ++i) {
|
|
|
|
sa->ars[i] = cpu_to_be32(cpu->env.aregs[i]);
|
|
|
|
}
|
|
|
|
for (i = 0; i < 16; ++i) {
|
2017-11-16 20:05:24 +03:00
|
|
|
sa->crs[i] = cpu_to_be64(cpu->env.cregs[i]);
|
2017-09-28 23:36:51 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
cpu_physical_memory_unmap(sa, len, 1, len);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2017-09-28 23:36:52 +03:00
|
|
|
|
|
|
|
#define ADTL_GS_OFFSET 1024 /* offset of GS data in adtl save area */
|
|
|
|
#define ADTL_GS_MIN_SIZE 2048 /* minimal size of adtl save area for GS */
|
|
|
|
int s390_store_adtl_status(S390CPU *cpu, hwaddr addr, hwaddr len)
|
|
|
|
{
|
|
|
|
hwaddr save = len;
|
|
|
|
void *mem;
|
|
|
|
|
|
|
|
mem = cpu_physical_memory_map(addr, &save, 1);
|
|
|
|
if (!mem) {
|
|
|
|
return -EFAULT;
|
|
|
|
}
|
|
|
|
if (save != len) {
|
|
|
|
cpu_physical_memory_unmap(mem, len, 1, 0);
|
|
|
|
return -EFAULT;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* FIXME: as soon as TCG supports these features, convert cpu->be */
|
|
|
|
if (s390_has_feat(S390_FEAT_VECTOR)) {
|
|
|
|
memcpy(mem, &cpu->env.vregs, 512);
|
|
|
|
}
|
|
|
|
if (s390_has_feat(S390_FEAT_GUARDED_STORAGE) && len >= ADTL_GS_MIN_SIZE) {
|
|
|
|
memcpy(mem + ADTL_GS_OFFSET, &cpu->env.gscb, 32);
|
|
|
|
}
|
|
|
|
|
|
|
|
cpu_physical_memory_unmap(mem, len, 1, len);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2011-03-23 12:58:07 +03:00
|
|
|
#endif /* CONFIG_USER_ONLY */
|
2017-07-24 11:52:46 +03:00
|
|
|
|
|
|
|
void s390_cpu_dump_state(CPUState *cs, FILE *f, fprintf_function cpu_fprintf,
|
|
|
|
int flags)
|
|
|
|
{
|
|
|
|
S390CPU *cpu = S390_CPU(cs);
|
|
|
|
CPUS390XState *env = &cpu->env;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
if (env->cc_op > 3) {
|
|
|
|
cpu_fprintf(f, "PSW=mask %016" PRIx64 " addr %016" PRIx64 " cc %15s\n",
|
|
|
|
env->psw.mask, env->psw.addr, cc_name(env->cc_op));
|
|
|
|
} else {
|
|
|
|
cpu_fprintf(f, "PSW=mask %016" PRIx64 " addr %016" PRIx64 " cc %02x\n",
|
|
|
|
env->psw.mask, env->psw.addr, env->cc_op);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < 16; i++) {
|
|
|
|
cpu_fprintf(f, "R%02d=%016" PRIx64, i, env->regs[i]);
|
|
|
|
if ((i % 4) == 3) {
|
|
|
|
cpu_fprintf(f, "\n");
|
|
|
|
} else {
|
|
|
|
cpu_fprintf(f, " ");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < 16; i++) {
|
|
|
|
cpu_fprintf(f, "F%02d=%016" PRIx64, i, get_freg(env, i)->ll);
|
|
|
|
if ((i % 4) == 3) {
|
|
|
|
cpu_fprintf(f, "\n");
|
|
|
|
} else {
|
|
|
|
cpu_fprintf(f, " ");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < 32; i++) {
|
|
|
|
cpu_fprintf(f, "V%02d=%016" PRIx64 "%016" PRIx64, i,
|
|
|
|
env->vregs[i][0].ll, env->vregs[i][1].ll);
|
|
|
|
cpu_fprintf(f, (i % 2) ? "\n" : " ");
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifndef CONFIG_USER_ONLY
|
|
|
|
for (i = 0; i < 16; i++) {
|
|
|
|
cpu_fprintf(f, "C%02d=%016" PRIx64, i, env->cregs[i]);
|
|
|
|
if ((i % 4) == 3) {
|
|
|
|
cpu_fprintf(f, "\n");
|
|
|
|
} else {
|
|
|
|
cpu_fprintf(f, " ");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef DEBUG_INLINE_BRANCHES
|
|
|
|
for (i = 0; i < CC_OP_MAX; i++) {
|
|
|
|
cpu_fprintf(f, " %15s = %10ld\t%10ld\n", cc_name(i),
|
|
|
|
inline_branch_miss[i], inline_branch_hit[i]);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
cpu_fprintf(f, "\n");
|
|
|
|
}
|
2017-08-18 14:43:44 +03:00
|
|
|
|
|
|
|
const char *cc_name(enum cc_op cc_op)
|
|
|
|
{
|
|
|
|
static const char * const cc_names[] = {
|
|
|
|
[CC_OP_CONST0] = "CC_OP_CONST0",
|
|
|
|
[CC_OP_CONST1] = "CC_OP_CONST1",
|
|
|
|
[CC_OP_CONST2] = "CC_OP_CONST2",
|
|
|
|
[CC_OP_CONST3] = "CC_OP_CONST3",
|
|
|
|
[CC_OP_DYNAMIC] = "CC_OP_DYNAMIC",
|
|
|
|
[CC_OP_STATIC] = "CC_OP_STATIC",
|
|
|
|
[CC_OP_NZ] = "CC_OP_NZ",
|
|
|
|
[CC_OP_LTGT_32] = "CC_OP_LTGT_32",
|
|
|
|
[CC_OP_LTGT_64] = "CC_OP_LTGT_64",
|
|
|
|
[CC_OP_LTUGTU_32] = "CC_OP_LTUGTU_32",
|
|
|
|
[CC_OP_LTUGTU_64] = "CC_OP_LTUGTU_64",
|
|
|
|
[CC_OP_LTGT0_32] = "CC_OP_LTGT0_32",
|
|
|
|
[CC_OP_LTGT0_64] = "CC_OP_LTGT0_64",
|
|
|
|
[CC_OP_ADD_64] = "CC_OP_ADD_64",
|
|
|
|
[CC_OP_ADDU_64] = "CC_OP_ADDU_64",
|
|
|
|
[CC_OP_ADDC_64] = "CC_OP_ADDC_64",
|
|
|
|
[CC_OP_SUB_64] = "CC_OP_SUB_64",
|
|
|
|
[CC_OP_SUBU_64] = "CC_OP_SUBU_64",
|
|
|
|
[CC_OP_SUBB_64] = "CC_OP_SUBB_64",
|
|
|
|
[CC_OP_ABS_64] = "CC_OP_ABS_64",
|
|
|
|
[CC_OP_NABS_64] = "CC_OP_NABS_64",
|
|
|
|
[CC_OP_ADD_32] = "CC_OP_ADD_32",
|
|
|
|
[CC_OP_ADDU_32] = "CC_OP_ADDU_32",
|
|
|
|
[CC_OP_ADDC_32] = "CC_OP_ADDC_32",
|
|
|
|
[CC_OP_SUB_32] = "CC_OP_SUB_32",
|
|
|
|
[CC_OP_SUBU_32] = "CC_OP_SUBU_32",
|
|
|
|
[CC_OP_SUBB_32] = "CC_OP_SUBB_32",
|
|
|
|
[CC_OP_ABS_32] = "CC_OP_ABS_32",
|
|
|
|
[CC_OP_NABS_32] = "CC_OP_NABS_32",
|
|
|
|
[CC_OP_COMP_32] = "CC_OP_COMP_32",
|
|
|
|
[CC_OP_COMP_64] = "CC_OP_COMP_64",
|
|
|
|
[CC_OP_TM_32] = "CC_OP_TM_32",
|
|
|
|
[CC_OP_TM_64] = "CC_OP_TM_64",
|
|
|
|
[CC_OP_NZ_F32] = "CC_OP_NZ_F32",
|
|
|
|
[CC_OP_NZ_F64] = "CC_OP_NZ_F64",
|
|
|
|
[CC_OP_NZ_F128] = "CC_OP_NZ_F128",
|
|
|
|
[CC_OP_ICM] = "CC_OP_ICM",
|
|
|
|
[CC_OP_SLA_32] = "CC_OP_SLA_32",
|
|
|
|
[CC_OP_SLA_64] = "CC_OP_SLA_64",
|
|
|
|
[CC_OP_FLOGR] = "CC_OP_FLOGR",
|
|
|
|
};
|
|
|
|
|
|
|
|
return cc_names[cc_op];
|
|
|
|
}
|