From patchwork Tue Jun 13 21:47:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 775479 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)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wnNgP4tzZz9s8J for ; Wed, 14 Jun 2017 07:48:33 +1000 (AEST) Received: from localhost ([::1]:45405 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dKtfq-0007Qk-Um for incoming@patchwork.ozlabs.org; Tue, 13 Jun 2017 17:48:31 -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) 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 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) 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This allows botting a recent linux kernel (e.g. compiled for z900) and using mvcos for uaccess: qemu-system-s390x ... -cpu qemu,mvcos=on ... 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 dest, uint64_t src, HELPER_LOG("%s dest %" PRIx64 ", src %" PRIx64 ", len %" PRIx64 "\n", __func__, dest, src, len); + 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); }