From patchwork Sun Jan 28 23:14:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 866931 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="VleV4hFE"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zV7sJ4NcPz9s75 for ; Mon, 29 Jan 2018 10:20:04 +1100 (AEDT) Received: from localhost ([::1]:44913 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1efwF0-0005AA-Ie for incoming@patchwork.ozlabs.org; Sun, 28 Jan 2018 18:20:02 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51890) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1efwAl-0002Tc-8k for qemu-devel@nongnu.org; Sun, 28 Jan 2018 18:15:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1efwAk-00087e-BW for qemu-devel@nongnu.org; Sun, 28 Jan 2018 18:15:39 -0500 Received: from mail-pg0-x241.google.com ([2607:f8b0:400e:c05::241]:33768) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1efwAk-000875-54 for qemu-devel@nongnu.org; Sun, 28 Jan 2018 18:15:38 -0500 Received: by mail-pg0-x241.google.com with SMTP id u1so3011557pgr.0 for ; Sun, 28 Jan 2018 15:15:38 -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=VleV4hFE6KgW+OTTPuKshR76BBRtxzf6EHJ/F4vifcouEsvfV+qwtEYVDoV+k3gZhL obzIjZeSA8Z9pbSDYiAh5HPWxcUa7CWVIY4XszNGDG0vD4KD17kx1R+Jtz/XgdS52fL0 GalVA+OnM2kBPV/0f2QIdGfxMZsg+617F0/Dg= 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=ZEz3XHnlaVVjHVO3Pp9cU1gqZjLp4Q9Or+NIrDoKHnOMbpuAG3rrozVgmp6y5OIoiq TPzBauqo2e6BhcA67+grcN/Ncg3RwNP1CJ3yfREGLQk7lj+sTw73H3CsKNNn06rFxMkK bhKnO4rpODoZ1+EY96rabFopVSYp3pGHkyaRAy/xkGzEfGIKDdPlxv6kG3DdxX2ERleo /8u5Dtoof20XG7USlxNUjiHA8iE5MesXcKcEqHAMxuqq6JstuoE8PIrI7O9wTn03P3B8 PvitFylXeGR4NwS9pNTu/i0OoNtpUi/CrGFT/GtBsuUqxYlEvf6sEEweMDVGll6pHRpm jL4w== X-Gm-Message-State: AKwxytdLiVx1bGlXBzRIoYlT2pifiWEF9bpoi4A36oC1KiHOVnnxuVmh paKMWTLpDf9taClLWsV47TwhC9T/v/A= X-Google-Smtp-Source: AH8x226VBIKwbSmxwUaH4wtM9xOVu/ZcvdeEmliHhKGbMpW0AOb2Yz6En48kyANiQ8NbEtSFcJzTHQ== X-Received: by 10.99.65.133 with SMTP id o127mr11020513pga.13.1517181336763; Sun, 28 Jan 2018 15:15:36 -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.15.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 28 Jan 2018 15:15:35 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sun, 28 Jan 2018 15:14:48 -0800 Message-Id: <20180128231528.22719-4-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:c05::241 Subject: [Qemu-devel] [PULL v4 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- target/hppa/translate.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) 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 = {