From patchwork Tue Sep 3 07:58:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Borntraeger X-Patchwork-Id: 272148 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 121C72C008C for ; Tue, 3 Sep 2013 17:59:38 +1000 (EST) Received: from localhost ([::1]:43838 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGlWR-0003Yw-Qq for incoming@patchwork.ozlabs.org; Tue, 03 Sep 2013 03:59:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45474) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGlVU-0002h2-7E for qemu-devel@nongnu.org; Tue, 03 Sep 2013 03:58:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VGlVF-0007tM-PH for qemu-devel@nongnu.org; Tue, 03 Sep 2013 03:58:36 -0400 Received: from e06smtp16.uk.ibm.com ([195.75.94.112]:39251) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGlVF-0007pZ-H7 for qemu-devel@nongnu.org; Tue, 03 Sep 2013 03:58:21 -0400 Received: from /spool/local by e06smtp16.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 3 Sep 2013 08:51:23 +0100 Received: from d06dlp01.portsmouth.uk.ibm.com (9.149.20.13) by e06smtp16.uk.ibm.com (192.168.101.146) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 3 Sep 2013 08:51:21 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id B138717D8059 for ; Tue, 3 Sep 2013 08:58:19 +0100 (BST) Received: from d06av05.portsmouth.uk.ibm.com (d06av05.portsmouth.uk.ibm.com [9.149.37.229]) by b06cxnps4075.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r837w5qb47448292 for ; Tue, 3 Sep 2013 07:58:05 GMT Received: from d06av05.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id r837wGRb023329 for ; Tue, 3 Sep 2013 01:58:16 -0600 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id r837wGbs023320; Tue, 3 Sep 2013 01:58:16 -0600 Received: by tuxmaker.boeblingen.de.ibm.com (Postfix, from userid 25651) id 3A580122444F; Tue, 3 Sep 2013 09:58:16 +0200 (CEST) From: Christian Borntraeger To: Alexander Graf Date: Tue, 3 Sep 2013 09:58:36 +0200 Message-Id: <1378195117-60980-6-git-send-email-borntraeger@de.ibm.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1378195117-60980-1-git-send-email-borntraeger@de.ibm.com> References: <1378195117-60980-1-git-send-email-borntraeger@de.ibm.com> X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13090307-3548-0000-0000-0000066E1985 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 195.75.94.112 Cc: Thomas Huth , qemu-devel , Christian Borntraeger , Jens Freimann , Cornelia Huck , =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [Qemu-devel] [PULL 5/6] s390/cpu: Make setcc() function available to other files X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Thomas Huth 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 Signed-off-by: Christian Borntraeger --- 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 /* 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 - #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) {