From patchwork Thu Feb 7 11:53:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 157726 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp562822jaa; Thu, 7 Feb 2019 04:06:41 -0800 (PST) X-Google-Smtp-Source: AHgI3IbrMwjPWyOaVIGaIiWft3Fcfj0Wndd6fMy3c9zqrN/kAxrXnMblyKx4Pj6RV++8BYQSFOqb X-Received: by 2002:adf:eb12:: with SMTP id s18mr11745297wrn.120.1549541201843; Thu, 07 Feb 2019 04:06:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549541201; cv=none; d=google.com; s=arc-20160816; b=sRZTEwFJdSM5T3fae2BHPhjRooDWxmz8BoVFkFQB1mojCp8+XxzYyZbNwfFwEbu6HP 4+GzKMAEXnwxGRzjBQ6RB3LSMfrzzlmxlFL6+kfPz2R3EOf8APkPsiT3piVtfLbSkBk4 tU5AQgfoQxfOY45gEAhkrmu3B/jr6VVauWtNavEIBpnfWfbodtsvcfMK0jm9hgQ7jDU4 qFxBnwQaXa15Dzfyjgum20gCSpupTjKFLQMPouhbzrCRb2a3NiJj6zX8D3lkAPOlQqNk BWhl9k2wSoTy69BfBL8V7ocdBaW0Bo391QGx8TER9ANBwDz3oPTAGyAiD9s50A+2XHw+ jXUA== 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=5eR9KLiIUibEJw+xJwMCc4YWzeNV64NP5eSefPsjlPw=; b=qjsguCRZgHSzxLA33E86Q47Bzg2CgkhWOY9btAxE9U/Ib/2H83jjZYd0jK2i5zZ5nC EXKpnRNvk8RX5BYW9yu7cgRC8cYCSwPo95/79WXpw2MrMc59btv7fdgRgZi9LIqnTBXu E2PHN4cHKE9ixdZzGxZ0nxZoYkwICIQYDGW4R6HoLw8etlIzQhc7m7GZRK5txpcagYf7 FBRRzUSUaqiZMAxyF7SsjI3bFrt9rJ/TiAxwsH8kZfzCeyQZcXTZbhhtsrC6MEOBrIe6 1ZN9yw0NJ1psBEUR5yzYQggD3qP/aw1SxHZEqmO05T3A5n/l3cRVAtSyLGLWQsEinM5B L6jA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=nXG3q0zr; 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 j22si13624077wmh.61.2019.02.07.04.06.41 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 07 Feb 2019 04:06:41 -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=nXG3q0zr; 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]:38596 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1griS0-0000bE-Ox for patch@linaro.org; Thu, 07 Feb 2019 07:06:40 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58336) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1griGJ-0007ZY-AA for qemu-devel@nongnu.org; Thu, 07 Feb 2019 06:54:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1griGI-0001Y4-6l for qemu-devel@nongnu.org; Thu, 07 Feb 2019 06:54:35 -0500 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:34849) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1griGH-0001Uj-S5 for qemu-devel@nongnu.org; Thu, 07 Feb 2019 06:54:34 -0500 Received: by mail-wr1-x430.google.com with SMTP id z18so10469554wrh.2 for ; Thu, 07 Feb 2019 03:54:24 -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=5eR9KLiIUibEJw+xJwMCc4YWzeNV64NP5eSefPsjlPw=; b=nXG3q0zrfxYN/hrC1ArloLDBXJqSJy7DSWJJPqAJqfpNY3iHxW8DHK3OI2Akp5LJte 3dcPXet8BS+B4tHtd+R7tO9nhxSqUNu+msy5Tc0dEG6+NJqT2KjUNy1MwD0jG0WtpLwG 2DoyL9hp0e7+Fam4xsjmSeBzQrtqdtx02APpfaVGAGOompJHEVzTQXPszmqfw98UIzdw +qAzXYI3r+XSCwbIP7LxlCRryfiNwGsb89hUWVBwF366x8nQmj1ZwcB2jV8ELZPLENbm qND6GRbCDmofFmAAVcNS50+AVYbi7EquKR4MgTTp6ioKk7BGLhfvGT//vKT4ecVgDbDR zKrQ== 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=5eR9KLiIUibEJw+xJwMCc4YWzeNV64NP5eSefPsjlPw=; b=AohISiEEHjT70kjFxztbjfov0FHBthFdqZLqA2mNdQ2/fJeCqqodTMYjqY4LG3RXlH kFSo407JeFWFAYls8lhHt9dUIVUmiTieYK6DGHXLxk5J2TNw9zx3fgLT6wdnIJwAskIR y36GOCrsEqiFWKRCr/aebtdPsxhM7rzpteEj+8hn8Ryfz7cSUbsqz+QG9qF3qIAEz0cb FHmJvg+tZcZojR8kBGHcYOXIn4Lw2DfQwzyEK5ucEUE6UBrSR3muowVEFkso9kOGjBDZ CFg6ihnmpHoMUIAoDPCrqjuc1rL5DZUpwKX76j72F/JhgYqHj+ge4YJybZv3e6BT9LbY qtWw== X-Gm-Message-State: AHQUAubBRiJnptS9CZ7wwb2Iw1XsMbVBlgXd8DQAQJTbAy4LBsJsBb05 /eT9B2mwv6GkhDd+df7sTAv0cluaArIulg== X-Received: by 2002:adf:ba8c:: with SMTP id p12mr12245581wrg.146.1549540462955; Thu, 07 Feb 2019 03:54:22 -0800 (PST) Received: from cloudburst.twiddle.net ([37.205.61.206]) by smtp.gmail.com with ESMTPSA id w16sm34030016wrp.1.2019.02.07.03.54.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Feb 2019 03:54:21 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 7 Feb 2019 11:53:57 +0000 Message-Id: <20190207115400.647-17-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190207115400.647-1-richard.henderson@linaro.org> References: <20190207115400.647-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::430 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: , Cc: deller@gmx.de, svens@stackframe.org 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.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 ####