From nobody Sat Feb 7 08:28:23 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1512660935134663.6384610928684; Thu, 7 Dec 2017 07:35:35 -0800 (PST) Received: from localhost ([::1]:32888 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eMyCu-0003JQ-PX for importer@patchew.org; Thu, 07 Dec 2017 10:35:28 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41300) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eMy9Z-00009a-P1 for qemu-devel@nongnu.org; Thu, 07 Dec 2017 10:32:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eMy9T-0002Dz-Vd for qemu-devel@nongnu.org; Thu, 07 Dec 2017 10:32:01 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41406) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eMy9T-0002Bl-Mp; Thu, 07 Dec 2017 10:31:55 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B976F48C; Thu, 7 Dec 2017 15:31:53 +0000 (UTC) Received: from t460s.redhat.com (ovpn-116-108.ams2.redhat.com [10.36.116.108]) by smtp.corp.redhat.com (Postfix) with ESMTP id 188587039B; Thu, 7 Dec 2017 15:31:50 +0000 (UTC) From: David Hildenbrand To: qemu-s390x@nongnu.org, qemu-devel@nongnu.org Date: Thu, 7 Dec 2017 16:31:38 +0100 Message-Id: <20171207153141.15523-3-david@redhat.com> In-Reply-To: <20171207153141.15523-1-david@redhat.com> References: <20171207153141.15523-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 07 Dec 2017 15:31:53 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 for-2.12 2/5] s390x/tcg: fix and cleanup mcck injection X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Borntraeger , Cornelia Huck , David Hildenbrand , Alexander Graf , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The architecture mode indication wasn't stored. The split of certain 64bit fields was unnecessary. Also, the complete clock comparator, not just bit 0-55 (starting at byte 1) was stored. We now generate a proper MCIC via the same helper we use for KVM. There is be more to clean up, but we will change the other parts later on either way. Signed-off-by: David Hildenbrand --- target/s390x/excp_helper.c | 12 ++++++------ target/s390x/internal.h | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/target/s390x/excp_helper.c b/target/s390x/excp_helper.c index d831537544..f4697a884d 100644 --- a/target/s390x/excp_helper.c +++ b/target/s390x/excp_helper.c @@ -395,6 +395,9 @@ static void do_mchk_interrupt(CPUS390XState *env) =20 lowcore =3D cpu_map_lowcore(env); =20 + /* we are always in z/Architecture mode */ + lowcore->ar_access_id =3D 1; + for (i =3D 0; i < 16; i++) { lowcore->floating_pt_save_area[i] =3D cpu_to_be64(get_freg(env, i)= ->ll); lowcore->gpregs_save_area[i] =3D cpu_to_be64(env->regs[i]); @@ -404,13 +407,10 @@ static void do_mchk_interrupt(CPUS390XState *env) lowcore->prefixreg_save_area =3D cpu_to_be32(env->psa); lowcore->fpt_creg_save_area =3D cpu_to_be32(env->fpc); lowcore->tod_progreg_save_area =3D cpu_to_be32(env->todpr); - lowcore->cpu_timer_save_area[0] =3D cpu_to_be32(env->cputm >> 32); - lowcore->cpu_timer_save_area[1] =3D cpu_to_be32((uint32_t)env->cputm); - lowcore->clock_comp_save_area[0] =3D cpu_to_be32(env->ckc >> 32); - lowcore->clock_comp_save_area[1] =3D cpu_to_be32((uint32_t)env->ckc); + lowcore->cpu_timer_save_area =3D cpu_to_be64(env->cputm); + lowcore->clock_comp_save_area =3D cpu_to_be64(env->ckc >> 8); =20 - lowcore->mcck_interruption_code[0] =3D cpu_to_be32(0x00400f1d); - lowcore->mcck_interruption_code[1] =3D cpu_to_be32(0x40330000); + lowcore->mcic =3D cpu_to_be64(s390_build_validity_mcic() | MCIC_SC_CP); lowcore->mcck_old_psw.mask =3D cpu_to_be64(get_psw_mask(env)); lowcore->mcck_old_psw.addr =3D cpu_to_be64(env->psw.addr); mask =3D be64_to_cpu(lowcore->mcck_new_psw.mask); diff --git a/target/s390x/internal.h b/target/s390x/internal.h index 6817b2c432..1a88e4beb4 100644 --- a/target/s390x/internal.h +++ b/target/s390x/internal.h @@ -43,7 +43,7 @@ typedef struct LowCore { uint8_t pad3[0xc8 - 0xc4]; /* 0x0c4 */ uint32_t stfl_fac_list; /* 0x0c8 */ uint8_t pad4[0xe8 - 0xcc]; /* 0x0cc */ - uint32_t mcck_interruption_code[2]; /* 0x0e8 */ + uint64_t mcic; /* 0x0e8 */ uint8_t pad5[0xf4 - 0xf0]; /* 0x0f0 */ uint32_t external_damage_code; /* 0x0f4 */ uint64_t failing_storage_address; /* 0x0f8 */ @@ -118,8 +118,8 @@ typedef struct LowCore { uint32_t fpt_creg_save_area; /* 0x131c */ uint8_t pad16[0x1324 - 0x1320]; /* 0x1320 */ uint32_t tod_progreg_save_area; /* 0x1324 */ - uint32_t cpu_timer_save_area[2]; /* 0x1328 */ - uint32_t clock_comp_save_area[2]; /* 0x1330 */ + uint64_t cpu_timer_save_area; /* 0x1328 */ + uint64_t clock_comp_save_area; /* 0x1330 */ uint8_t pad17[0x1340 - 0x1338]; /* 0x1338 */ uint32_t access_regs_save_area[16]; /* 0x1340 */ uint64_t cregs_save_area[16]; /* 0x1380 */ --=20 2.14.3