From nobody Wed Nov 5 15:50:43 2025 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.zoho.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 (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1497390567453487.1932951327917; Tue, 13 Jun 2017 14:49:27 -0700 (PDT) Received: from localhost ([::1]:45408 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dKtgj-0008S8-Ty for importer@patchew.org; Tue, 13 Jun 2017 17:49:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58055) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dKtfD-0007Oz-0m for qemu-devel@nongnu.org; Tue, 13 Jun 2017 17:47:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dKtfC-0003k1-8D for qemu-devel@nongnu.org; Tue, 13 Jun 2017 17:47:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37988) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dKtfC-0003jY-2e for qemu-devel@nongnu.org; Tue, 13 Jun 2017 17:47:50 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 066247F7CE; Tue, 13 Jun 2017 21:47:49 +0000 (UTC) Received: from t460s.redhat.com (ovpn-116-27.ams2.redhat.com [10.36.116.27]) by smtp.corp.redhat.com (Postfix) with ESMTP id 528AD781EB; Tue, 13 Jun 2017 21:47:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 066247F7CE Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=david@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 066247F7CE From: David Hildenbrand To: qemu-devel@nongnu.org Date: Tue, 13 Jun 2017 23:47:36 +0200 Message-Id: <20170613214736.19963-4-david@redhat.com> In-Reply-To: <20170613214736.19963-1-david@redhat.com> References: <20170613214736.19963-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 13 Jun 2017 21:47:49 +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 v1 3/3] s390x/cpumodel: allow to enable MVCOS for qemu cpu model 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: thuth@redhat.com, david@redhat.com, agraf@suse.de, Miroslav Benes , Aurelien Jarno , rth@twiddle.net 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" This allows botting a recent linux kernel (e.g. compiled for z900) and using mvcos for uaccess: qemu-system-s390x ... -cpu qemu,mvcos=3Don ... While at it, correctly fake its abscence. Signed-off-by: David Hildenbrand --- target/s390x/cpu_models.c | 1 + target/s390x/mem_helper.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index c508ae1..348e760 100644 --- a/target/s390x/cpu_models.c +++ b/target/s390x/cpu_models.c @@ -682,6 +682,7 @@ static void add_qemu_cpu_model_features(S390FeatBitmap = fbm) S390_FEAT_LONG_DISPLACEMENT_FAST, S390_FEAT_ETF2_ENH, S390_FEAT_STORE_CLOCK_FAST, + S390_FEAT_MOVE_WITH_OPTIONAL_SPEC, S390_FEAT_GENERAL_INSTRUCTIONS_EXT, S390_FEAT_EXECUTE_EXT, S390_FEAT_STFLE_45, diff --git a/target/s390x/mem_helper.c b/target/s390x/mem_helper.c index cb27465..e0a5de0 100644 --- a/target/s390x/mem_helper.c +++ b/target/s390x/mem_helper.c @@ -1508,6 +1508,9 @@ uint32_t HELPER(mvcos)(CPUS390XState *env, uint64_t d= est, uint64_t src, HELPER_LOG("%s dest %" PRIx64 ", src %" PRIx64 ", len %" PRIx64 "\n", __func__, dest, src, len); =20 + if (!s390_has_feat(S390_FEAT_MOVE_WITH_OPTIONAL_SPEC)) { + program_interrupt(env, PGM_OPERATION, 6); + } if (!(env->psw.mask & PSW_MASK_DAT)) { program_interrupt(env, PGM_SPECIAL_OP, 6); } --=20 2.9.3