From patchwork Sun Jan 28 23:15:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 126121 Delivered-To: patch@linaro.org Received: by 10.46.84.92 with SMTP id y28csp1986910ljd; Sun, 28 Jan 2018 15:43:32 -0800 (PST) X-Google-Smtp-Source: AH8x224O810n5BeIBJg6RdefHB3plvpJzrgxE5zS+MUUWrQ1n5Ov5hS9WZ9nY+zh3mh+KTSilDNv X-Received: by 10.37.194.195 with SMTP id s186mr15907816ybf.381.1517183011906; Sun, 28 Jan 2018 15:43:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517183011; cv=none; d=google.com; s=arc-20160816; b=mcq60nACRBHaXNB43a6NVJ6V5tAJJ6YAKG0CeCWkWB00EjYFnhE7KYVvssQq8D6Twv 71HlrjWen+roXiOwiuH8b0nv8ccyIFjhqSzCsQ+HfAk7oRjpdLeFx3yC5ZRI3fIH1RQn kgdA5b/Dp5MIrxDUC5NEcpCaMYYDL6FgVAMPjj64DTIF8rbjUNTVAA4Tq3YCW1uxpz8W UM5ztztO451UKeuUDjMhikfYqpw7ZQu5Y65c/qzQFcC4LXDo0yfmv3jj8AHt+HfVyozO RdmV00vPJX/ly/JHjkLFiMUEv1Duax3PPqfOpoJhqbxvBu+UKkDSGBF6DRgf6yZzkRjP KJBg== 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:arc-authentication-results; bh=TlXxIZoHiIplbDXZZDFycXiOKS9HrTW99ifnkcnfjHA=; b=HcISPjt26jOHZdrSwPpGUXkHDJiKeN30MqUkJvJi4G0E/aGEK2mtb5KObAwXUCgNR8 uFrDn9ZmLM9QP3vbDmxWvaFxy0OcefKraIOSUFpxbsWFET026XDGtFNYS7S2hoCErl+P v691vMzjtO2PFWMZL0OyuE677iBWx0aw6uVThMM0bOI8sNgT+GU5gKmf/dOgTF726szI oEwr8JgoQPpgxKlQGYs7Hfw6Pcx8+hXHQJX2SVONINiFXvDUPz06aiWxDDxHxhtoDS7N P6/GdJgFuIXQ8Hy1WrTijolIu1ZignnGmqrh/nv0jeR2EvCPTRIT0uO+QwAMF1vXII/J SCsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ZNg+gKjP; 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 n186si1753893ywf.531.2018.01.28.15.43.31 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 28 Jan 2018 15:43:31 -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=ZNg+gKjP; 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]:45094 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1efwbj-0007Cj-9k for patch@linaro.org; Sun, 28 Jan 2018 18:43:31 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52207) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1efwBI-0002xb-3q for qemu-devel@nongnu.org; Sun, 28 Jan 2018 18:16:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1efwBE-00007p-Jv for qemu-devel@nongnu.org; Sun, 28 Jan 2018 18:16:12 -0500 Received: from mail-pf0-x241.google.com ([2607:f8b0:400e:c00::241]:44931) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1efwBE-00007J-Df for qemu-devel@nongnu.org; Sun, 28 Jan 2018 18:16:08 -0500 Received: by mail-pf0-x241.google.com with SMTP id 17so1815176pfw.11 for ; Sun, 28 Jan 2018 15:16:08 -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=TlXxIZoHiIplbDXZZDFycXiOKS9HrTW99ifnkcnfjHA=; b=ZNg+gKjP8FRmqIPymVkdhey7Gm54Az+ncD7+9TCA0Qv2fmtlhcV00N+uN+6XAeXS0R jc9Wh3vQywYgvAoJkeyCkCAaqyLQ04qK6UpDDUQ+go8mO5MTGEVU+rum6Ck448jJU9Ac MVnsFMtj1t+pyCTW+0rPSMlziPnUedL8DwVc4= 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=TlXxIZoHiIplbDXZZDFycXiOKS9HrTW99ifnkcnfjHA=; b=JZr2eAKKpZ9aSaZ3Pr8Hi1ovg9gY49lsbupiJh3KatC6eDyWt8t/LQuyWOK8QvzXIj Hh3IvAJdJxxmPlKByGzlbh5fVzqNflj1DmIFSg+AOAKq3ihC4U6ok6e6+rWKBlFZUXvj xH0HQgZ9pjhEvHmptSE1eBw0U6ZsdRwLe9Gx8IA/ojGybZ/H19IthPsC2sOhp+a9O6k6 AcGYkRno/9iFgkVy2pNiPApbPtE4KhgakMbjTnphEnBAiVkk9enahWq0MAp0Zmv4fvFR znu+CJpX89Jbj81kUoHLdSnUpMlPFUHZFtWyqQJhuwWB8xj6rzZWGud+xlntCZSutByx QqHA== X-Gm-Message-State: AKwxytd9ZGumE0pafi8RanlVtr1vg91Fpv3M1zhxtiWs/YQBPIs1B2J5 b6Iwk/IchaU6O/2n6UMOzNI+pp+2StY= X-Received: by 10.98.224.205 with SMTP id d74mr25528885pfm.56.1517181367220; Sun, 28 Jan 2018 15:16:07 -0800 (PST) Received: from cloudburst.twiddle.net (174-21-6-47.tukw.qwest.net. [174.21.6.47]) by smtp.gmail.com with ESMTPSA id r27sm26949344pfj.75.2018.01.28.15.16.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 28 Jan 2018 15:16:06 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sun, 28 Jan 2018 15:15:08 -0800 Message-Id: <20180128231528.22719-24-richard.henderson@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180128231528.22719-1-richard.henderson@linaro.org> References: <20180128231528.22719-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:c00::241 Subject: [Qemu-devel] [PULL v4 23/43] target/hppa: Implement LDWA 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" Signed-off-by: Richard Henderson --- target/hppa/translate.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) -- 2.14.3 diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 5b77688fc0..3d441ef4ac 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2954,12 +2954,50 @@ static DisasJumpType trans_stby(DisasContext *ctx, uint32_t insn, return nullify_end(ctx, DISAS_NEXT); } +#ifndef CONFIG_USER_ONLY +static DisasJumpType trans_ldwa_idx_i(DisasContext *ctx, uint32_t insn, + const DisasInsn *di) +{ + int hold_mmu_idx = ctx->mmu_idx; + DisasJumpType ret; + + CHECK_MOST_PRIVILEGED(EXCP_PRIV_OPR); + + /* ??? needs fixing for hppa64 -- ldda does not follow the same + format wrt the sub-opcode in bits 6:9. */ + ctx->mmu_idx = MMU_PHYS_IDX; + ret = trans_ld_idx_i(ctx, insn, di); + ctx->mmu_idx = hold_mmu_idx; + return ret; +} + +static DisasJumpType trans_ldwa_idx_x(DisasContext *ctx, uint32_t insn, + const DisasInsn *di) +{ + int hold_mmu_idx = ctx->mmu_idx; + DisasJumpType ret; + + CHECK_MOST_PRIVILEGED(EXCP_PRIV_OPR); + + /* ??? needs fixing for hppa64 -- ldda does not follow the same + format wrt the sub-opcode in bits 6:9. */ + ctx->mmu_idx = MMU_PHYS_IDX; + ret = trans_ld_idx_x(ctx, insn, di); + ctx->mmu_idx = hold_mmu_idx; + return ret; +} +#endif + static const DisasInsn table_index_mem[] = { { 0x0c001000u, 0xfc001300, trans_ld_idx_i }, /* LD[BHWD], im */ { 0x0c000000u, 0xfc001300, trans_ld_idx_x }, /* LD[BHWD], rx */ { 0x0c001200u, 0xfc001300, trans_st_idx_i }, /* ST[BHWD] */ { 0x0c0001c0u, 0xfc0003c0, trans_ldcw }, { 0x0c001300u, 0xfc0013c0, trans_stby }, +#ifndef CONFIG_USER_ONLY + { 0x0c001180u, 0xfc00d3c0, trans_ldwa_idx_i }, /* LDWA, im */ + { 0x0c000180u, 0xfc00d3c0, trans_ldwa_idx_x }, /* LDWA, rx */ +#endif }; static DisasJumpType trans_ldil(DisasContext *ctx, uint32_t insn)