From patchwork Tue Mar 12 16:19:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 160134 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp13335795jad; Tue, 12 Mar 2019 10:03:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqxVWFxVEEKLHcJgEA6w6g+1qHGdKSOPD29JnNFRdEI8X17B6JVq9l84vLbiOBsSKWMx+ExN X-Received: by 2002:a0d:f8c2:: with SMTP id i185mr30837471ywf.372.1552410210490; Tue, 12 Mar 2019 10:03:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552410210; cv=none; d=google.com; s=arc-20160816; b=jPbV+4OM7SKQ93le+r3OtygSBRHcrU5WDseKJdS0F3ZbuCWbvYkJXVwN5aYX9XksSZ xMdZg+ctyBfdqnJXhqSv08Ph4hIzwPtNcadgAXWteiVhQNeJsvaw8FTK/kff02CqMSkQ gvV1oj+GUaQOH1kAKpO4o7BaCKt0boPlNdhGq0eI/qVEcUXOAqKe9L0PIZMITOEHIuPy mj3ZcAxbOD1QhiVbYOiLx3MRysBYOPCJTeU8rLPekBQ1DmXayErJIIPSVIz/+mS85I/Y ncID5/SffoS+ZGaZIiEZ61l5NWw1VuZ/Z7rX4JirMrpHj8UtZ1dfUMX6+7i8nU5pZNSI 8/Fw== 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 :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=HoG29gvhoy6tueA/Y/lrtkLqoQljlEC6sudLJfhyjCY=; b=aLcBrYFsONy8QF2yFq2tVMp2UcGKZ7MRcrfLZ/sebG/qwLTHyhHcbqgjgt+ftw8EB7 t3ml08Hk6n+5941h3PMHLkMDJRlhpA9KpfvBNRkBkbC0iw7LCelQUeiAxxuJwftG/Piv dQ1oqEpf+Zivkopsv13bgAEUefXl7WF5VdZiuL+WuGx31FExK5UUP8z42CNgyaFm1MyZ ghHqc06Mpx8C3xG0oBjkQFK47VqJMs1KPdOgdKYe2/ZRldAFgkXPOHLlPDnOeZEMwsWO 56FnkBi5CGFb4S+Pi8hQiulOXqS2RQ1dYXG+CoYCmCWmP36zGD0OhPI0werlxUr0rJ6a nyMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=IYQxeERR; 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 b205si5224256ybc.339.2019.03.12.10.03.30 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 12 Mar 2019 10:03:30 -0700 (PDT) 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=IYQxeERR; 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]:55948 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3koL-0000sG-U3 for patch@linaro.org; Tue, 12 Mar 2019 13:03:29 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36735) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3k7o-000687-Ph for qemu-devel@nongnu.org; Tue, 12 Mar 2019 12:19:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3k7j-00042F-4m for qemu-devel@nongnu.org; Tue, 12 Mar 2019 12:19:29 -0400 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]:41941) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3k7c-0003vD-Lg for qemu-devel@nongnu.org; Tue, 12 Mar 2019 12:19:22 -0400 Received: by mail-pf1-x42c.google.com with SMTP id d25so2169805pfn.8 for ; Tue, 12 Mar 2019 09:19:19 -0700 (PDT) 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 :mime-version:content-transfer-encoding; bh=HoG29gvhoy6tueA/Y/lrtkLqoQljlEC6sudLJfhyjCY=; b=IYQxeERRfHL9dxA01rG6YUHBA4YibMK2elu5vb8NjSER6/FX7K/RKDcJaHlF+vcvQ0 rh46Ti+F0mlfitTAe8fOEFrRXE7nd9i4R88JI7SnSCVDt70IhKKpHozrvlt6xLWNA4rA +piCCkDScMinkGtipxDh7rRdGxaDOsOcNdr/LvB5aVOA8tX0U8XbLxcwUIQK+3vfx9+M Tk2j9T81eI2aD3vKAndzJ1pWb6ojVdUT7eQPitE0cxjyfMH/kpDHzActgEZOPZqTnWgb MXvo+BzIVtyeMstuL52amBmmejkKi9EgIPeKT9KAmbMYqIg4vi6lYZbvpoMULcnUKMgh cD5A== 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:mime-version:content-transfer-encoding; bh=HoG29gvhoy6tueA/Y/lrtkLqoQljlEC6sudLJfhyjCY=; b=Cx3G6Z58fnfxLVnMdBkB4IMenX//v1ernQkd2FrYlPmhlTSHU8fbIc3BwhIW+D/Xlt GHlY3lTqQDw5IXxH2YS+UZYqifYNOQm8XmA1OJvWzhBG4vP+Vsb8veJ3pJtDxEa5Qqfu bN62WbApdCuTDt01DepUFq2o6sTEThJ99bhlf8Htbo7f/hO5Vnom9G2AsmttzfJZVnA9 qrsQpO6W0Ap73diJ4p3vkD8tz2fR69OqYcKyudnHfQPiiNkjkgm4bSnpginlUAQT1E3a 7Ipig8hJe9jUDnTZYkd/PJwXyzKQ1LGNi/GGq8NIcV5Z7MQYZO48rNihb8vfY4l9G5fT Vy9Q== X-Gm-Message-State: APjAAAW9+mExT+nFZFFftQRithfcQXD3ZL7GATIcaz/y1dO2GdBNpNRT CYmFTOfB+ERVRbfEeO3WtEAU5EmfldE= X-Received: by 2002:a65:43c7:: with SMTP id n7mr23116129pgp.173.1552407558383; Tue, 12 Mar 2019 09:19:18 -0700 (PDT) Received: from cloudburst.twiddle.net (97-113-188-82.tukw.qwest.net. [97.113.188.82]) by smtp.gmail.com with ESMTPSA id q62sm12605644pga.32.2019.03.12.09.19.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Mar 2019 09:19:17 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 12 Mar 2019 09:19:01 -0700 Message-Id: <20190312161904.31130-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190312161904.31130-1-richard.henderson@linaro.org> References: <20190312161904.31130-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::42c Subject: [Qemu-devel] [PULL 08/11] target/hppa: fix b,gate instruction 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, Sven Schnelle Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Sven Schnelle b,gate does GR[t] ← cat(GR[t]{0..29},IAOQ_Front{30..31}); instead of saving the link address to register t. Signed-off-by: Sven Schnelle Message-Id: <20190311191602.25796-8-svens@stackframe.org> [rth: Move link check outside of ifndef CONFIG_USER_ONLY; use ctx->privilege; nullify the insn earlier.] Signed-off-by: Richard Henderson --- target/hppa/translate.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) -- 2.17.2 diff --git a/target/hppa/translate.c b/target/hppa/translate.c index f3e78b8e22..6ac196804b 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -3446,6 +3446,8 @@ static bool trans_b_gate(DisasContext *ctx, arg_b_gate *a) { target_ureg dest = iaoq_dest(ctx, a->disp); + nullify_over(ctx); + /* Make sure the caller hasn't done something weird with the queue. * ??? This is not quite the same as the PSW[B] bit, which would be * expensive to track. Real hardware will trap for @@ -3483,7 +3485,16 @@ static bool trans_b_gate(DisasContext *ctx, arg_b_gate *a) } #endif - return do_dbranch(ctx, dest, a->l, a->n); + if (a->l) { + TCGv_reg tmp = dest_gpr(ctx, a->l); + if (ctx->privilege < 3) { + tcg_gen_andi_reg(tmp, tmp, -4); + } + tcg_gen_ori_reg(tmp, tmp, ctx->privilege); + save_gpr(ctx, a->l, tmp); + } + + return do_dbranch(ctx, dest, 0, a->n); } static bool trans_blr(DisasContext *ctx, arg_blr *a)