From patchwork Tue Feb 12 04:57:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 158078 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3418173jaa; Mon, 11 Feb 2019 21:07:47 -0800 (PST) X-Google-Smtp-Source: AHgI3IaGeoP66zeRAnR87ANSFH9ru5Ua2sjDxWKiKeoPv0vH9oqFlzrvNZbLttCN1BZ3Vz1rq1bb X-Received: by 2002:a25:8211:: with SMTP id q17mr1343187ybk.352.1549948067904; Mon, 11 Feb 2019 21:07:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549948067; cv=none; d=google.com; s=arc-20160816; b=TWMu5OlzwnySJHqGkxeE8TmfdlX5WY37AtxQQ1QXKSXqZ7QDpa8JGpT5dR3Gq3mKW+ jhNhwuCWPye8BBUHsmqYROwvXqHTGgUC4Z/7GSWfSCqJlk/AgjuqXRQEot5NqMQpE2s6 AgevbbC0UQMzHZAQPnuZTmjXyd4ffX2IqIuhyW32EvFa/qwjJOTgEMGDb+WnQfnhuLYJ MzqaVHCtvDLmGi6x4PnCdSOGXlAPCjZrhmtb2Xi+y14P1gz3XiEHloJJY14vvCxMuUJI 4+x3ZMHBBTIh7a2ZNvuxuIWbIwN7LjqMtWlsJPsaypcFlOak0mAbj7cDdOw89vH2Yv1S yxuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=rYVBXaEPMvMChYSm5aILHHxCT6LZ2DhSkqW1hvmMLCQ=; b=LwJnT9X7vahxMt3AcpdHD5Jrb6KLbxywqmw/d6CkTg5GBxQEXKtlrgzDV68+uwOrx2 AvXKBvHr9Lv01hN/jlOTOpHj2inssvMzJxC+t1Okx4ZRKt4d0GrXzFK5XMezkJqySQkt WOrOeRjhkWt7b6W2t3D1dr18AxIf01UP+hUsorpnWKbqr4cjKEhOC0jpmX2PMQMsuuYs LMe0SX+tSwNryjmcOX6621bqMArxPHVTQ4EsKhnjWHu8q5b2iqe2PVIe5xkeAOOJ9eGo SKL1IcJab/AHQuNLetWdaGmcYEKucis8wAikJvaxczYZa1GEWZwYBLv6Jdk/81opp7HC TpfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="SbiK6zz/"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id p125si6854643ywb.202.2019.02.11.21.07.47 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 11 Feb 2019 21:07:47 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="SbiK6zz/"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:33230 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtQIN-0001cd-8j for patch@linaro.org; Tue, 12 Feb 2019 00:07:47 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49764) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtQ95-0002n2-9s for qemu-devel@nongnu.org; Mon, 11 Feb 2019 23:58:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gtQ8o-0001vp-AK for qemu-devel@nongnu.org; Mon, 11 Feb 2019 23:58:01 -0500 Received: from mail-pg1-x531.google.com ([2607:f8b0:4864:20::531]:32919) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gtQ8m-0001hX-IM for qemu-devel@nongnu.org; Mon, 11 Feb 2019 23:57:54 -0500 Received: by mail-pg1-x531.google.com with SMTP id z11so680771pgu.0 for ; Mon, 11 Feb 2019 20:57:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rYVBXaEPMvMChYSm5aILHHxCT6LZ2DhSkqW1hvmMLCQ=; b=SbiK6zz/ngkrlAOcGTihjD5+szhgRzPqbFxtYWPd1un4rUX/e2ug66MBFw8vyj68G/ VizISKGByCKNLe3yOUep59KldzgpKrRO5xA4yKlqd8ZwxKa7n0FgZDnb0/xabjH4a+yB Z6xC6WVuT535ktTIBsRnGBTeqxeQ/ZmwOBe5VkEpypx/Moia0r0PsCjfJ1pq9ysQWq4M pQBf/HhYxQsaB6oreX+mZosZ3TcwOTeK32XJQoxsvrPQP8pKa+szuqNYWSrhWq7iUfXq 1RdHizyBWCOHjnELkL8JYNtRxFXHAoaBEeaW2Mbt7AgbfvtKC+Ws7ioqJbhZcMxgDPu/ 6D8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=rYVBXaEPMvMChYSm5aILHHxCT6LZ2DhSkqW1hvmMLCQ=; b=tX4/RPjKrLJRe17Q/P3ITOpSaVykRUk8uK6oI/CfOcVkMPLXMCeJYhMfrFO9f07Vor jbiA15Vl8zWkCtxqiJnn2snE7Dq3tTR7h7isKlzfbVjx9cbLgVov2cqzrVXMtTMz1coR h6BM7Xe/IcQzFa9XhHdHZEPDHTiF+8gnbItEP6/u7ktPIcxxyUJBd1ypI6cRGRh2K53Q Tx3ZYA/13E21b9zAAopldZN4xfgFVMMXk0SWoktyXtMTJvtJ17sdNcCDId/KsFP7Vrky 1WfeSlfXYm3fzdogPI/1+msuUPTeUnqADqpKun6MqmMVt6yl4aZbzDWQj5bs1VyM+LoX eV6Q== X-Gm-Message-State: AHQUAuYYs20RjRtPuw5nwdcJ/lzG60CMkQqk6+B8BM6WjLRSbdCh5kVx Sn+lRvFxaujaSML/CEBlxbPUEwaP4os= X-Received: by 2002:a62:3603:: with SMTP id d3mr2155580pfa.146.1549947463386; Mon, 11 Feb 2019 20:57:43 -0800 (PST) Received: from cloudburst.twiddle.net (97-113-188-82.tukw.qwest.net. [97.113.188.82]) by smtp.gmail.com with ESMTPSA id a90sm22088923pfj.109.2019.02.11.20.57.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Feb 2019 20:57:42 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 11 Feb 2019 20:57:13 -0800 Message-Id: <20190212045721.28041-17-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190212045721.28041-1-richard.henderson@linaro.org> References: <20190212045721.28041-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::531 Subject: [Qemu-devel] [PULL 16/24] target/hppa: Convert halt/reset insns 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: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Tested-by: Helge Deller Tested-by: Sven Schnelle Signed-off-by: Richard Henderson --- target/hppa/translate.c | 49 ++++++++++++---------------------------- target/hppa/insns.decode | 5 ++++ 2 files changed, 20 insertions(+), 34 deletions(-) -- 2.17.2 diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 4ecd522e51..c73a7ab3db 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2376,20 +2376,27 @@ static bool trans_rfi_r(DisasContext *ctx, arg_rfi_r *a) return do_rfi(ctx, true); } -#ifndef CONFIG_USER_ONLY -static bool gen_hlt(DisasContext *ctx, int reset) +static bool trans_halt(DisasContext *ctx, arg_halt *a) { CHECK_MOST_PRIVILEGED(EXCP_PRIV_OPR); +#ifndef CONFIG_USER_ONLY nullify_over(ctx); - if (reset) { - gen_helper_reset(cpu_env); - } else { - gen_helper_halt(cpu_env); - } + gen_helper_halt(cpu_env); ctx->base.is_jmp = DISAS_NORETURN; return nullify_end(ctx); +#endif +} + +static bool trans_reset(DisasContext *ctx, arg_reset *a) +{ + CHECK_MOST_PRIVILEGED(EXCP_PRIV_OPR); +#ifndef CONFIG_USER_ONLY + nullify_over(ctx); + gen_helper_reset(cpu_env); + ctx->base.is_jmp = DISAS_NORETURN; + return nullify_end(ctx); +#endif } -#endif /* !CONFIG_USER_ONLY */ static bool trans_nop_addrx(DisasContext *ctx, arg_ldst *a) { @@ -4134,32 +4141,6 @@ static void translate_one(DisasContext *ctx, uint32_t insn) case 0x2E: translate_table(ctx, insn, table_fp_fused); return; - - case 0x04: /* spopn */ - case 0x05: /* diag */ - case 0x0F: /* product specific */ - break; - - case 0x07: /* unassigned */ - case 0x15: /* unassigned */ - case 0x1D: /* unassigned */ - case 0x37: /* unassigned */ - break; - case 0x3F: -#ifndef CONFIG_USER_ONLY - /* Unassigned, but use as system-halt. */ - if (insn == 0xfffdead0) { - gen_hlt(ctx, 0); /* halt system */ - return; - } - if (insn == 0xfffdead1) { - gen_hlt(ctx, 1); /* reset system */ - return; - } -#endif - break; - default: - break; } gen_illegal(ctx); } diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index 25ac09d9d6..f564e54f1d 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -103,6 +103,11 @@ ssm 000000 .......... 000 01101011 t:5 i=%sm_imm rfi 000000 ----- ----- --- 01100000 00000 rfi_r 000000 ----- ----- --- 01100101 00000 +# These are artificial instructions used by QEMU firmware. +# They are allocated from the unassigned instruction space. +halt 1111 1111 1111 1101 1110 1010 1101 0000 +reset 1111 1111 1111 1101 1110 1010 1101 0001 + #### # Memory Management ####