From nobody Mon Feb 9 04:47:41 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.zoho.com; dkim=fail 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 1497506161684226.97338907668848; Wed, 14 Jun 2017 22:56:01 -0700 (PDT) Received: from localhost ([::1]:52080 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dLNl9-0001yO-AX for importer@patchew.org; Thu, 15 Jun 2017 01:55:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36120) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dLNjI-0000oE-5C for qemu-devel@nongnu.org; Thu, 15 Jun 2017 01:54:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dLNjG-00017z-Nv for qemu-devel@nongnu.org; Thu, 15 Jun 2017 01:54:04 -0400 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]:35795) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dLNjG-00017m-IG for qemu-devel@nongnu.org; Thu, 15 Jun 2017 01:54:02 -0400 Received: by mail-pf0-x244.google.com with SMTP id s66so713497pfs.2 for ; Wed, 14 Jun 2017 22:54:02 -0700 (PDT) Received: from bigtime.twiddle.net (97-113-165-157.tukw.qwest.net. [97.113.165.157]) by smtp.gmail.com with ESMTPSA id k73sm310058pge.13.2017.06.14.22.54.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Jun 2017 22:54:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=BAzLHG/WPKCjc4+e9bdax3qt0/XVcA7v8x17rK9sQKs=; b=Yff/WrSOMeggIb4sAaK/+Rakwhn/wMOE0qgMRcla+O5Q3pG2SN5yzPfMLrAttd9kqT yXPYR0HSbWLWYh3aX98NW3NwMZrKnKWFct2WZG5KajYAUktLWn3PP+zuOGmCI1WTOuYU 4Q3gGZ4EaXmbwwkXiF6ABE7A3PTF2F+eKsg2OwV+DrUruWPlv1UBvAA891xATsihBtrB HfZZvlSSgcUiBV1gMCwE8lW216tu6r4KC9Yu83HZLxQeeqHZuPaQ17XUSj6n4bqu1JgQ CRsbgMS/K5RMbtx4ZYMpQ4S/xAJocrm7uA27q1c7BFYNxGdB9h82ukvWG+RIkNCPciJG qUaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=BAzLHG/WPKCjc4+e9bdax3qt0/XVcA7v8x17rK9sQKs=; b=i9G/Z6sI73O8hWZyJjTZc2g07/J5t9TLsfZlTDTtMeoDxZjrfAN7Zh5fYkWaxvVLUj 9APsrtoAAnq/rbIzi0+5+gGWYUQy6L3jbO2xckx39/Yj/2X7vLk2q/dqxEoZWxzJqzEd 08jiCHe0dmakxGZcBR6T0mffrrCoa766X3pFx7vg7rrDHLw9IL5x5C2eEgT//y02L8EI qaDlDNNTPgmKeByeeUI1obYlflzo5LUuoJeWcN51/Br6F+aJDNq0mE7UIVVMn4lzLO28 jgwQpHl8ONFM6p8urczMrn7/D96K5fzSud4OH2Dsmtr4QcIneLXMRytSHs6xV2jsFgQ4 4Amg== X-Gm-Message-State: AKS2vOwoy1xWMcqTO1eoIB/bDbESsLZByROF6pt+QwN2v1SiPQcexD9o v16N+m/mWTjY1xW3IfU= X-Received: by 10.101.91.12 with SMTP id y12mr3619203pgq.44.1497506041465; Wed, 14 Jun 2017 22:54:01 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 14 Jun 2017 22:53:53 -0700 Message-Id: <20170615055356.20684-3-rth@twiddle.net> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170615055356.20684-1-rth@twiddle.net> References: <20170615055356.20684-1-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::244 Subject: [Qemu-devel] [PATCH 2/5] target/s390x: Enforce instruction features 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: aurelien@aurel32.net, david@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson --- target/s390x/translate.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/target/s390x/translate.c b/target/s390x/translate.c index af18ffb..48cee25 100644 --- a/target/s390x/translate.c +++ b/target/s390x/translate.c @@ -55,6 +55,7 @@ typedef struct DisasFields DisasFields; =20 struct DisasContext { struct TranslationBlock *tb; + const unsigned long *features; const DisasInsn *insn; DisasFields *fields; uint64_t ex_value; @@ -5600,6 +5601,12 @@ static ExitStatus translate_one(CPUS390XState *env, = DisasContext *s) } #endif =20 + /* Check for insn feature enabled. */ + if (!test_bit(insn->fac, s->features)) { + gen_program_exception(s, PGM_OPERATION); + return EXIT_NORETURN; + } + /* Check for insn specification exceptions. */ if (insn->spec) { int spec =3D insn->spec, excp =3D 0, r; @@ -5726,6 +5733,7 @@ void gen_intermediate_code(CPUS390XState *env, struct= TranslationBlock *tb) } =20 dc.tb =3D tb; + dc.features =3D cpu->model->features; dc.pc =3D pc_start; dc.cc_op =3D CC_OP_DYNAMIC; dc.ex_value =3D tb->cs_base; --=20 2.9.4