From: "Andreas Färber" <afaerber@suse.de>
To: qemu-devel@nongnu.org
Cc: "Christian Borntraeger" <borntraeger@de.ibm.com>,
"Andreas Färber" <afaerber@suse.de>,
"Alexander Graf" <agraf@suse.de>
Subject: [Qemu-devel] [PATCH v2 2/4] target-s390x: QOM'ify CPU reset
Date: Mon, 2 Apr 2012 19:09:36 +0200 [thread overview]
Message-ID: <1333386578-29412-3-git-send-email-afaerber@suse.de> (raw)
In-Reply-To: <1333386578-29412-1-git-send-email-afaerber@suse.de>
Move code from cpu_state_reset() to s390_cpu_reset().
Signed-off-by: Andreas Färber <afaerber@suse.de>
Cc: Ulrich Hecht <uli@suse.de>
---
target-s390x/cpu.c | 13 ++++++++++++-
target-s390x/helper.c | 12 ++----------
2 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/target-s390x/cpu.c b/target-s390x/cpu.c
index 94320f2..cae0b18 100644
--- a/target-s390x/cpu.c
+++ b/target-s390x/cpu.c
@@ -1,6 +1,8 @@
/*
* QEMU S/390 CPU
*
+ * Copyright (c) 2009 Ulrich Hecht
+ * Copyright (c) 2011 Alexander Graf
* Copyright (c) 2012 SUSE LINUX Products GmbH
*
* This library is free software; you can redistribute it and/or
@@ -23,15 +25,24 @@
#include "qemu-timer.h"
+/* CPUClass::reset() */
static void s390_cpu_reset(CPUState *s)
{
S390CPU *cpu = S390_CPU(s);
S390CPUClass *scc = S390_CPU_GET_CLASS(cpu);
CPUS390XState *env = &cpu->env;
+ if (qemu_loglevel_mask(CPU_LOG_RESET)) {
+ qemu_log("CPU Reset (CPU %d)\n", env->cpu_index);
+ log_cpu_state(env, 0);
+ }
+
scc->parent_reset(s);
- cpu_state_reset(env);
+ memset(env, 0, offsetof(CPUS390XState, breakpoints));
+ /* FIXME: reset vector? */
+ tlb_flush(env, 1);
+ s390_add_running_cpu(env);
}
static void s390_cpu_class_init(ObjectClass *oc, void *data)
diff --git a/target-s390x/helper.c b/target-s390x/helper.c
index ae57ab3..cd3e8f5 100644
--- a/target-s390x/helper.c
+++ b/target-s390x/helper.c
@@ -97,7 +97,7 @@ CPUS390XState *cpu_s390x_init(const char *cpu_model)
env->cpu_model_str = cpu_model;
env->cpu_num = cpu_num++;
env->ext_index = -1;
- cpu_state_reset(env);
+ cpu_reset(CPU(cpu));
qemu_init_vcpu(env);
return env;
}
@@ -123,15 +123,7 @@ int cpu_s390x_handle_mmu_fault (CPUS390XState *env, target_ulong address, int rw
void cpu_state_reset(CPUS390XState *env)
{
- if (qemu_loglevel_mask(CPU_LOG_RESET)) {
- qemu_log("CPU Reset (CPU %d)\n", env->cpu_index);
- log_cpu_state(env, 0);
- }
-
- memset(env, 0, offsetof(CPUS390XState, breakpoints));
- /* FIXME: reset vector? */
- tlb_flush(env, 1);
- s390_add_running_cpu(env);
+ cpu_reset(ENV_GET_CPU(env));
}
#ifndef CONFIG_USER_ONLY
--
1.7.7
next prev parent reply other threads:[~2012-04-02 17:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-02 17:09 [Qemu-devel] [PATCH v2 0/4] QOM'ify S/390 CPU Andreas Färber
2012-04-02 17:09 ` [Qemu-devel] [PATCH v2 1/4] target-s390x: QOM'ify CPU Andreas Färber
2012-04-02 17:09 ` Andreas Färber [this message]
2012-04-02 17:09 ` [Qemu-devel] [PATCH v2 3/4] target-s390x: QOM'ify CPU init Andreas Färber
2012-04-02 17:09 ` [Qemu-devel] [PATCH v2 4/4] target-s390x: Update s390x_{tod, cpu}_timer to use S390CPU Andreas Färber
2012-04-03 12:38 ` [Qemu-devel] [PATCH v2 0/4] QOM'ify S/390 CPU Christian Borntraeger
2012-04-04 15:38 ` Andreas Färber
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1333386578-29412-3-git-send-email-afaerber@suse.de \
--to=afaerber@suse.de \
--cc=agraf@suse.de \
--cc=borntraeger@de.ibm.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).