From patchwork Mon Jan 22 03:41:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 125296 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp944643ljf; Sun, 21 Jan 2018 19:49:28 -0800 (PST) X-Google-Smtp-Source: AH8x224DzblANfXBYt0FijOTmgdU/jpnf3M60TRgzs1+pZfiklQave1GWu7dSKtBfCbS47RVuSBy X-Received: by 10.129.164.150 with SMTP id b144mr6089684ywh.113.1516592968890; Sun, 21 Jan 2018 19:49:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516592968; cv=none; d=google.com; s=arc-20160816; b=eGFRQSEwoxaU7/isLtw1xfbzPYFeUDOkrw/LrmzU5IE6wi4ZGjjXjJpHoA/TsAgDIz Rh0NEAGJp2KscSFIicDHcKcUYolcaJepK3fjhmTjpGeXKwVgXIrzfqoQ1W7J/5cFM7fv v6FI6NGp7a7StAGqWGh6y+LWXYXBkTfQWZrwmZHqjYPlALCSq+MhdLzM5/iiZSBiLGiO aE4zcLaDB3D+pxYKMhcZ8EkAv9mPIVbep0oIzBsCFa5ZW0sYKSoZqrgh+glZclJ4nwu9 ThXx8MXr6TwwK7ccTYThbPXiBpoS2Fvech2nXfGDPW++CkP+ORCma5Y4Y6t4+S14XFJ4 o6XQ== 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=jWlXGhyGzuQklKuZM0jR3HHQ8HHbSqFzQDbbpF04MmY=; b=lA4JeosY5fSy2W4ensARXTDUXscpDbx75ZeqV4bKuXRv9m/5q7NnvKQ/sYLiJ3poTO 4XAllHXFWtkEKIx3GKNyOE2eLuucDOS2o9+DvYLkvQSsDq0OeRfM76F1A3etJg8SVLlA k1Eqz7/k/54TL6ebhJ9JWr4j76DGMXe+PIG3Zna7o+NYG12kmZdIKs3vPdXHC7TJ+DaB YYw4q+nWaGD/r33zUko8y0Bee3KXb1/NI7HlWcgsDeE9brUpqoMW0pWjL5QciTpRmrJS Tdg6M3xWJ23xRgb5vJUX/vIV3FmVg/zjZC3DSllUThOtZcmN9QRO6ZKF6dVxXTiYvoA4 NVcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ctyEwk30; 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 t138si3360002ywc.390.2018.01.21.19.49.28 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 21 Jan 2018 19:49:28 -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=ctyEwk30; 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]:41666 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edT6u-0000pI-8p for patch@linaro.org; Sun, 21 Jan 2018 22:49:28 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60022) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edT07-0005Fr-Bu for qemu-devel@nongnu.org; Sun, 21 Jan 2018 22:42:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edT05-00060T-Ja for qemu-devel@nongnu.org; Sun, 21 Jan 2018 22:42:27 -0500 Received: from mail-pg0-x241.google.com ([2607:f8b0:400e:c05::241]:37785) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1edT05-00060B-D4 for qemu-devel@nongnu.org; Sun, 21 Jan 2018 22:42:25 -0500 Received: by mail-pg0-x241.google.com with SMTP id z17so6088533pgc.4 for ; Sun, 21 Jan 2018 19:42:25 -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=jWlXGhyGzuQklKuZM0jR3HHQ8HHbSqFzQDbbpF04MmY=; b=ctyEwk304ZAOfua5h+GJPQUjVrVBPwGW93erXU4U2jeVi3GRnvQMTQLb+PkCJqLAYg uZW9sAdw8HD+khguMc2AQdYKyiC5UZ84uVKGr2Cu+odmLr077ZCUC+WME+b1zTM+7KN0 SzhpY3Idg+QmcdCqn98reixryVm4rA6TMS/3g= 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=jWlXGhyGzuQklKuZM0jR3HHQ8HHbSqFzQDbbpF04MmY=; b=DO8L+SPRsTFYGMB2D7TGBzgMUMHTJuQb57AsyDt6ISV1CoK66sQf+Dfqqt/X7o3yiQ qo8spX5HcZjQoUuJd+J/XL1gIScM/9tG0V3c64ETW5aaRfbbBLxtZbwSQjrsQ71vpxvj 5W7/KJKOX6SCXkxeeRv5j8C15raqHE6CehnEysPocu7nSfhZtqPrrXm+pwf3wm4IHdqj df83oKI0eGyDWSasp8D3/sEWPchR2jB1G03CwS7yycZd/RKnxd5qoemtN9uWAluWEdy1 oDcoGIikQsAg+et5Ti0FQOPHaxcgaMJEBwWUnte+2+UrJwaGBZl+O+Znixr1J+yZnvQn unYQ== X-Gm-Message-State: AKwxytfFRlAwv++bTsT8sSE/GGzHtYPaXfZXRcTvf0i13hMLwnV+CgMk ycI/tWCVfq3XnBiXM828Ue+vMmGenqY= X-Received: by 10.99.113.75 with SMTP id b11mr6271697pgn.271.1516592544093; Sun, 21 Jan 2018 19:42:24 -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 z125sm182023pfz.27.2018.01.21.19.42.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 21 Jan 2018 19:42:23 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sun, 21 Jan 2018 19:41:37 -0800 Message-Id: <20180122034217.19593-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180122034217.19593-1-richard.henderson@linaro.org> References: <20180122034217.19593-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::241 Subject: [Qemu-devel] [PULL 03/43] target/hppa: Disable gateway page emulation for system mode 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 | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) -- 2.14.3 diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 31d9a2a31b..8e357cc60c 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -1543,6 +1543,7 @@ static DisasJumpType do_ibranch(DisasContext *ctx, TCGv dest, return DISAS_NEXT; } +#ifdef CONFIG_USER_ONLY /* On Linux, page zero is normally marked execute only + gateway. Therefore normal read or write is supposed to fail, but specific offsets have kernel code mapped to raise permissions to implement @@ -1600,6 +1601,7 @@ static DisasJumpType do_page_zero(DisasContext *ctx) return DISAS_NORETURN; } } +#endif static DisasJumpType trans_nop(DisasContext *ctx, uint32_t insn, const DisasInsn *di) @@ -3787,10 +3789,13 @@ static void hppa_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs) int i, n; /* Execute one insn. */ +#ifdef CONFIG_USER_ONLY if (ctx->iaoq_f < TARGET_PAGE_SIZE) { ret = do_page_zero(ctx); assert(ret != DISAS_NEXT); - } else { + } else +#endif + { /* Always fetch the insn, even if nullified, so that we check the page permissions for execute. */ uint32_t insn = cpu_ldl_code(env, ctx->iaoq_f); @@ -3885,25 +3890,27 @@ static void hppa_tr_tb_stop(DisasContextBase *dcbase, CPUState *cs) static void hppa_tr_disas_log(const DisasContextBase *dcbase, CPUState *cs) { TranslationBlock *tb = dcbase->tb; + target_ulong pc = tb->pc; - switch (tb->pc) { +#ifdef CONFIG_USER_ONLY + switch (pc) { case 0x00: qemu_log("IN:\n0x00000000: (null)\n"); - break; + return; case 0xb0: qemu_log("IN:\n0x000000b0: light-weight-syscall\n"); - break; + return; case 0xe0: qemu_log("IN:\n0x000000e0: set-thread-pointer-syscall\n"); - break; + return; case 0x100: qemu_log("IN:\n0x00000100: syscall\n"); - break; - default: - qemu_log("IN: %s\n", lookup_symbol(tb->pc)); - log_target_disas(cs, tb->pc, tb->size); - break; + return; } +#endif + + qemu_log("IN: %s\n", lookup_symbol(pc)); + log_target_disas(cs, pc, tb->size); } static const TranslatorOps hppa_tr_ops = {