From patchwork Sat Feb 17 20:31:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 128751 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp1902463ljc; Sat, 17 Feb 2018 12:40:47 -0800 (PST) X-Google-Smtp-Source: AH8x2263sa4L2zCTC67nmO+OC+Hl9NT5Z3jG7FNqw+8EUmoNWXTnn1GBqAfxhhE94cklMd/UxJUo X-Received: by 10.37.12.135 with SMTP id 129mr7345361ybm.524.1518900047391; Sat, 17 Feb 2018 12:40:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518900047; cv=none; d=google.com; s=arc-20160816; b=I1K58ONwoRlWZMOwptnPWx3iyJgnkAKwp/tUa5RpfW7at84l+q0DGJfGkdAPT7NpUJ RZ4igxEtes5vrUOFII02vj+Jni7pQrrodP4N8lAzmJN/6ykThC4SQpWEpJPR2j/K3cCA 1B0Uw2lhY4NZGAyK06tiwHD1mCqKKZRAJzoYHhJb1+dA4uc5woVklN/8LByKw+m23EJ0 3wg5BuuFNp5w8V9SGPHAQASdXFnhaFm5MEkvDxdKpd39lJBN2qC+U6D3sHuHmLCnVRsM HQGAORE59th0GsfLxacBU1Vo7r2hJJZAl1dlKtdBweYN8cUp4mfkLoXMFCZmLM6iY6NU 3BeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:arc-authentication-results; bh=oMZG5lPpyZ5JFYcLEUK787hExZZCUqKwUZZkvOMJa0A=; b=UFeHCPhENB7bcy5h0RraVuFZ3fPJbARdPEfEUb2PSbpl6WUPKaF3X0zliNMe1buSLI uFcYM2XbxAM46iGm3qeuH+7xaKowHmeIDQPo6GRk9JieDE/Hpbx1jCTy96vWK1XzSsPc SJ0VS2Z2eXGr6PVUI5UPlKYbc8874AHCC/c738t2miqvabVNvhN46gaKvLbhrqEicgt0 AITbK4YQy3cJMRBI8YDClOkYzNy16gUL2r0upXHfBC4ZBAtWHDBzYFFTMxbFDHoEn39W jcxZOUN2/IVdn98LqycMuC5SeL9WK5/SNI6VzB1E5Q+tWjz9pOyjVXh+mBm1jXhOct2C eo2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=CmkJuChu; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id u129si2697094ywa.639.2018.02.17.12.40.47 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 17 Feb 2018 12:40:47 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=CmkJuChu; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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 ([::1]:60448 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1en9Hq-0007rL-Mr for patch@linaro.org; Sat, 17 Feb 2018 15:40:46 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42052) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1en99Q-0000M7-Fk for qemu-devel@nongnu.org; Sat, 17 Feb 2018 15:32:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1en99P-0000qu-Dg for qemu-devel@nongnu.org; Sat, 17 Feb 2018 15:32:04 -0500 Received: from mail-pl0-x244.google.com ([2607:f8b0:400e:c01::244]:35984) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1en99P-0000qk-7Y for qemu-devel@nongnu.org; Sat, 17 Feb 2018 15:32:03 -0500 Received: by mail-pl0-x244.google.com with SMTP id v3so3541212plg.3 for ; Sat, 17 Feb 2018 12:32:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=oMZG5lPpyZ5JFYcLEUK787hExZZCUqKwUZZkvOMJa0A=; b=CmkJuChulhXcBowv9KDA/w5N2YG3jF7kpSnulGBgpIkkwpU37f1roTg0wCzwf/+1P6 sw3II/l32SWFubrchkISycLftrv+UZEcnX+z7St5tYqAu6D3rmw+U+45Yt0+8ZrgejTG GUdyLg/2cUJrRL/xK0LEKDMQWNEgS614lsp3k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=oMZG5lPpyZ5JFYcLEUK787hExZZCUqKwUZZkvOMJa0A=; b=IRQyPK/8DJm3jzB+uoMw3E1F+o/ZQyOQ7Uz8ZgmgQCq+Y+dKT5RxmWlpeamb47V4Uh vZ6UIMGKNuvPORY3CjuHwPZNjn4PrEulQxdFpE55qBzL7wsG0rCZqyMVrIx6FWV2QSvH zWhpDU4d/zoS6glEtrer9r7/E0uLfMPeSPGrRehgjBqJAyn8nggFC02pxVKzyIwm6Mi+ bySkwbi/wStf9TigM4x5PqDoPWPA+/tqTjXRZ4bVN8gYMnQ5sLb+yqxP8wDBVNIAQ0Hx bMFUqPJfOvGG9T2T2X97d9a6Mmvs5/4yQ6BtaAYDl2lnSs7WkK9iKMYGQgG58hf6unQn 0k3A== X-Gm-Message-State: APf1xPBOHhteuzk1HSkjcDBoBp8F+WBGqCKjCNqc0JK+RIeHmNwsBHQV KtJHDLjyll3yubc3p8w6V9J+Y+hwX00= X-Received: by 2002:a17:902:28c4:: with SMTP id f62-v6mr2235880plb.411.1518899521989; Sat, 17 Feb 2018 12:32:01 -0800 (PST) Received: from cloudburst.twiddle.net ([50.0.192.64]) by smtp.gmail.com with ESMTPSA id y7sm48203797pfe.26.2018.02.17.12.32.00 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 17 Feb 2018 12:32:01 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sat, 17 Feb 2018 12:31:29 -0800 Message-Id: <20180217203132.31780-17-richard.henderson@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180217203132.31780-1-richard.henderson@linaro.org> References: <20180217203132.31780-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c01::244 Subject: [Qemu-devel] [PATCH 16/19] 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- target/hppa/translate.c | 49 +++++++++++++++--------------------------------- target/hppa/insns.decode | 5 +++++ 2 files changed, 20 insertions(+), 34 deletions(-) -- 2.14.3 diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 1973923a18..5abe4cd610 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2384,20 +2384,27 @@ static void trans_rfi_r(DisasContext *ctx, arg_rfi_r *a, uint32_t insn) do_rfi(ctx, true); } -#ifndef CONFIG_USER_ONLY -static void gen_hlt(DisasContext *ctx, int reset) +static void trans_halt(DisasContext *ctx, arg_halt *a, uint32_t insn) { 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; nullify_end(ctx); +#endif +} + +static void trans_reset(DisasContext *ctx, arg_reset *a, uint32_t insn) +{ + CHECK_MOST_PRIVILEGED(EXCP_PRIV_OPR); +#ifndef CONFIG_USER_ONLY + nullify_over(ctx); + gen_helper_reset(cpu_env); + ctx->base.is_jmp = DISAS_NORETURN; + nullify_end(ctx); +#endif } -#endif /* !CONFIG_USER_ONLY */ static void trans_nop_addrx(DisasContext *ctx, arg_ldst *a, uint32_t insn) { @@ -4126,32 +4133,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 1e4579e080..ddbbaefd83 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -101,6 +101,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 ####