From patchwork Wed Jan 24 23:26:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 125747 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp740212ljf; Wed, 24 Jan 2018 15:48:22 -0800 (PST) X-Google-Smtp-Source: AH8x227QcCmXcJRtsb/FMq01JfmTdvGSOFENDRpiLdYllJi/VuupK9SRvJvvb2oHcYySp0AAOMt1 X-Received: by 10.129.60.9 with SMTP id j9mr6707747ywa.315.1516837702835; Wed, 24 Jan 2018 15:48:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516837702; cv=none; d=google.com; s=arc-20160816; b=tlC79A726hFx4vlYZmvjv3tZ3IJF6RG8YKDp4qgxFOz37uf1Kvuj1eQ05M8nifZYHJ PHFus1tgrgHqqYWa+Ei0pr2Z+f8LBDggROFA+HtOYv5rFhyJBlOigPlH35I1owxedCXs RUYXlWceW1BzhxhcjnbVJSIU9UHYHNIGmn7QDz5iUMpe6OLIFwfPszEigPW4z0r5nAOr laoWGZRoXn22O3k7SFHWSfK4Zu5Fr40C9AZ96jeG4WzdF3yhCTO6cywD6bZrPT0ND5h4 0fLtkAqmeuXEFupbpazrxa5V8Lo024PmixOgtXghmNPlZ3rlvFQt8le/f0EgkKf1OcSv O91w== 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=TlXxIZoHiIplbDXZZDFycXiOKS9HrTW99ifnkcnfjHA=; b=vDX36Q/ODLKkrChapYkDj8jaF0aSCJKABWHnw3gLLD7JBSabLIb/ATFAjao/BxhtI2 gFncE/kkl3ZC4Zj5YRek6X4QQpTc/G9sambsaDs2GzNUXARkyvxIWHqVYAf3hQthYVio JJIIauBkR4FAyIre8Cu9+x6A140YHXR5tBgl/G5HdlHASBpITK9XrOQ6K+F5u+rIVVp4 oH44+S+077ZBEC+Gr0jXmDp0yw3L/PgoVk1ZVQ0xX9oM18VZf3bLAHewiq8AYsahCrkE KMk1XZabO3dwteS7W/vbw/tUjZ0+IHEKvvnSzW8dHTnptgGnjEUtr7tCoR0mr5a00Vyb e6uA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=NHSKrktJ; 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 64si281830ybu.369.2018.01.24.15.48.22 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 24 Jan 2018 15:48:22 -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=NHSKrktJ; 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]:54612 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eeUmE-0005Ki-5z for patch@linaro.org; Wed, 24 Jan 2018 18:48:22 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51186) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eeURf-0004qp-0y for qemu-devel@nongnu.org; Wed, 24 Jan 2018 18:27:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eeURb-0001ws-E7 for qemu-devel@nongnu.org; Wed, 24 Jan 2018 18:27:07 -0500 Received: from mail-pg0-x242.google.com ([2607:f8b0:400e:c05::242]:41704) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eeURb-0001wV-8G for qemu-devel@nongnu.org; Wed, 24 Jan 2018 18:27:03 -0500 Received: by mail-pg0-x242.google.com with SMTP id 136so3810326pgd.8 for ; Wed, 24 Jan 2018 15:27: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=TlXxIZoHiIplbDXZZDFycXiOKS9HrTW99ifnkcnfjHA=; b=NHSKrktJmIn5wDCzWlD4S32jj54CErVPuQzsBD2fPNAZf5tQe6HM0hm/DvfxUadMZ4 NJFy0kI0t2AV8pX5Jv46sx0eTvbJ7Gh5yOiC/bK8trWNkKz5EP9g506Sa0fypbH7uXvs ncNOzIr1pU8tv6LPH9r3+5qF9eZ3UeuZT5Vo8= 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=TlXxIZoHiIplbDXZZDFycXiOKS9HrTW99ifnkcnfjHA=; b=AkP/LY5hrBXpFkKQPoHGnsotEWYIThaKC1T63X1u8Zu4D7wNy1s4DsjpA8Q8vhq7+0 RYljxXgVVCFMu3ldu8It7vhDKaL0ZBrSW0WFkBpBzAT+9dO/EFJTyAFeLrv2ajpETpyt bWwvWRej9x14GocNoo9BzYphySH/GtTeeiz/IcwzjmZPIMien/t0P+fIDbTssWsHSDw4 hqVf6R/M3mtxGjUpPfWlSi5xHYdPsJ3Q05ScKjrNM+Vvg8LW65LKuF8kubKXOBdk22T0 VYltJ9Ubmjm0oFYSv2cdW5PzUK1KJWVGIUmGaup04CgHCSuacP6Q/sDtpmngHX2QeaKO Obqg== X-Gm-Message-State: AKwxytezEe0uAScPTgx/V9YeU9knPEWN41ivv5RYX3HCt6r8vHPcrMBc S1EJ/4cjmWlJrOIKd3ZjKTXtbejSF6w= X-Received: by 2002:a17:902:2823:: with SMTP id e32-v6mr7419512plb.44.1516836422003; Wed, 24 Jan 2018 15:27:02 -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 z19sm9760028pfh.185.2018.01.24.15.27.00 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Jan 2018 15:27:01 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 24 Jan 2018 15:26:03 -0800 Message-Id: <20180124232625.30105-24-richard.henderson@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180124232625.30105-1-richard.henderson@linaro.org> References: <20180124232625.30105-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:c05::242 Subject: [Qemu-devel] [PATCH v3 23/45] 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: , 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)