From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>,
Thomas Huth <thuth@linux.vnet.ibm.com>,
Alexander Graf <agraf@suse.de>,
qemu-devel <qemu-devel@nongnu.org>
Subject: [Qemu-devel] [PULLv2 5/6] s390/cpu: Make setcc() function available to other files
Date: Thu, 12 Sep 2013 21:02:00 +0200 [thread overview]
Message-ID: <1379012521-26750-6-git-send-email-borntraeger@de.ibm.com> (raw)
In-Reply-To: <1379012521-26750-1-git-send-email-borntraeger@de.ibm.com>
From: Thomas Huth <thuth@linux.vnet.ibm.com>
Moved the setcc() function to cpu.h so that it can be used by other
files, too. It now also does not modify the kvm state anymore since
this gets updated during kvm_arch_put_registers() anyway.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
target-s390x/cpu.h | 11 +++++++++--
target-s390x/kvm.c | 12 ------------
2 files changed, 9 insertions(+), 14 deletions(-)
diff --git a/target-s390x/cpu.h b/target-s390x/cpu.h
index 8be5648..a2c077b 100644
--- a/target-s390x/cpu.h
+++ b/target-s390x/cpu.h
@@ -148,6 +148,7 @@ typedef struct CPUS390XState {
} CPUS390XState;
#include "cpu-qom.h"
+#include <sysemu/kvm.h>
/* distinguish between 24 bit and 31 bit addressing */
#define HIGH_ORDER_BIT 0x80000000
@@ -692,6 +693,14 @@ static inline const char *cc_name(int cc_op)
return cc_names[cc_op];
}
+static inline void setcc(S390CPU *cpu, uint64_t cc)
+{
+ CPUS390XState *env = &cpu->env;
+
+ env->psw.mask &= ~(3ull << 44);
+ env->psw.mask |= (cc & 3) << 44;
+}
+
typedef struct LowCore
{
/* prefix area: defined by architecture */
@@ -1058,8 +1067,6 @@ void program_interrupt(CPUS390XState *env, uint32_t code, int ilen);
void QEMU_NORETURN runtime_exception(CPUS390XState *env, int excp,
uintptr_t retaddr);
-#include <sysemu/kvm.h>
-
#ifdef CONFIG_KVM
void kvm_s390_io_interrupt(S390CPU *cpu, uint16_t subchannel_id,
uint16_t subchannel_nr, uint32_t io_int_parm,
diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c
index dc1ed56..3dff6be 100644
--- a/target-s390x/kvm.c
+++ b/target-s390x/kvm.c
@@ -427,18 +427,6 @@ static void enter_pgmcheck(S390CPU *cpu, uint16_t code)
kvm_s390_interrupt(cpu, KVM_S390_PROGRAM_INT, code);
}
-static inline void setcc(S390CPU *cpu, uint64_t cc)
-{
- CPUS390XState *env = &cpu->env;
- CPUState *cs = CPU(cpu);
-
- cs->kvm_run->psw_mask &= ~(3ull << 44);
- cs->kvm_run->psw_mask |= (cc & 3) << 44;
-
- env->psw.mask &= ~(3ul << 44);
- env->psw.mask |= (cc & 3) << 44;
-}
-
static int kvm_sclp_service_call(S390CPU *cpu, struct kvm_run *run,
uint16_t ipbh0)
{
--
1.8.3.1
next prev parent reply other threads:[~2013-09-12 19:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-12 19:01 [Qemu-devel] [PULLv2 0/6] s390: cleanups and fixes Christian Borntraeger
2013-09-12 19:01 ` [Qemu-devel] [PULLv2 1/6] s390/kvm: Add check for priviledged SCLP handler Christian Borntraeger
2013-09-12 19:01 ` [Qemu-devel] [PULLv2 2/6] s390/dump: zero out padding bytes in notes sections Christian Borntraeger
2013-09-12 19:01 ` [Qemu-devel] [PULLv2 3/6] s390/ipl: Fix waiting for virtio processing Christian Borntraeger
2013-09-12 19:01 ` [Qemu-devel] [PULLv2 4/6] s390/ipl: Update the s390-ccw.img rom Christian Borntraeger
2013-09-12 19:02 ` Christian Borntraeger [this message]
2013-09-12 19:02 ` [Qemu-devel] [PULLv2 6/6] s390/ioinst: Moved the CC setting to the IO instruction handlers Christian Borntraeger
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=1379012521-26750-6-git-send-email-borntraeger@de.ibm.com \
--to=borntraeger@de.ibm.com \
--cc=agraf@suse.de \
--cc=anthony@codemonkey.ws \
--cc=qemu-devel@nongnu.org \
--cc=thuth@linux.vnet.ibm.com \
/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).