From patchwork Wed Jan 24 23:25:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 125724 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp733864ljf; Wed, 24 Jan 2018 15:33:22 -0800 (PST) X-Google-Smtp-Source: AH8x2272mJhOh5pfxEGCFE/THjchwwREU47hCaB+93pf7S4oBhtsy1iisM1Jb479meAn43G3x8qw X-Received: by 10.37.130.8 with SMTP id q8mr6936752ybk.339.1516836802099; Wed, 24 Jan 2018 15:33:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516836802; cv=none; d=google.com; s=arc-20160816; b=J7gMseuVaDRrvYXa3rzsCSrXs47JG2Wyv814a4YiWINMVNlvxT6+ibh78onu5ic3gV uHNfDlqGCsCPuGjc2uSa7qNRv0eEvrJ3o6jZZe78ivUw8e3/bJefTplj/7c1C//0VKe2 gm74Eb5rPqTJCByWTV0zwB1h+/aMV31Zy50ahZQrqV97nh9oGSoWkiC/VTC9QqoqYe18 wGfIk7RdL/9o1zYOFh6TCfhZm6w9lYNlrOVT59n96ZShETIczNVmMQ3NDEmrU5iXIA/P fpUSFhPVZkI1bt8d/K0f5bUXw5pa/zBvuQAg2EHK/myJrUmldQllc3hEUYL5H8T1+4dG l2PA== 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=jWlXGhyGzuQklKuZM0jR3HHQ8HHbSqFzQDbbpF04MmY=; b=b1W03KHa2DDNK5WGSupD2B6cxa0+WB16VSXIRDKL+b/NytgfCmWE8MvMToPIXoCgc9 sJ477iiEKV45o1S+hRVzrT3lh4ndDpLEJoZa96DV7WaowJCbtkzCa0btM3Ligql5/gMx Ib0PvHz534VthQuOYkhc3+oP7CGSLpi9YUgqzwyDzpvAQwflIUqKpwe5Ti9Wxj2vr+Pn yDB66ed/Y3HLIhr29Sw1jFQk0SbW4YanhHvIU3nVPogSYOlgTOi2LSOJGkp/z7GHv4C+ L7zxqu1cxgQlad/fYv4WnWYi3I3zlE1hMmSNbzVO8sjKSC9kvVjumqeOW7IruLL5gs7e XenA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=kJW73X6E; 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 y4si233439ywy.615.2018.01.24.15.33.21 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 24 Jan 2018 15:33: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=kJW73X6E; 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]:54486 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eeUXh-0000zJ-Db for patch@linaro.org; Wed, 24 Jan 2018 18:33:21 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50909) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eeUR9-0004Mc-D3 for qemu-devel@nongnu.org; Wed, 24 Jan 2018 18:26:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eeUR8-0001bG-Aq for qemu-devel@nongnu.org; Wed, 24 Jan 2018 18:26:35 -0500 Received: from mail-pg0-x243.google.com ([2607:f8b0:400e:c05::243]:38590) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eeUR8-0001b3-4G for qemu-devel@nongnu.org; Wed, 24 Jan 2018 18:26:34 -0500 Received: by mail-pg0-x243.google.com with SMTP id y27so3814540pgc.5 for ; Wed, 24 Jan 2018 15:26:33 -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=jWlXGhyGzuQklKuZM0jR3HHQ8HHbSqFzQDbbpF04MmY=; b=kJW73X6EhMLQgSbHd8cyR7bMd/8Myz4xKaZPh10xB0EJa210EaCLsQn3lVdgamg4dd ayG0rixpf5maNtTb9WsHp6XChP9s05lTdqlt/1O5Ixvfn6mAekxCGo98t6l//A4wsg01 TDZ1KKJbabkjA78gjcIF+jIJW4ACVwhi9PBls= 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=jWlXGhyGzuQklKuZM0jR3HHQ8HHbSqFzQDbbpF04MmY=; b=ELyPk1ciMVIWF8w2Ad4/7dAwEDiucfpslqDLb23b2J5dVeHDA1ewzvu/uyLmpRn6Cf t+gE5sBDbHlCjSYzcTrnQzwMZZ74ionnh8NPhie2W1Bxn/gQmPe8LePQpkvNclNe4rys /o6ymF4uquFVQJUjxwVx51fBirEpp2v14PDHS0XfjeMqXJ29UPhfLmpfFynvkgn4UleU KQJ4Ks9ZM9WNSyIzHLRl3lP5cLiIY8FMKElroBNhJrD+E0UlZ0xicbYIi6pY/zMyLw1H ruqhLYuOTEc8+q0CgrwGMcjS9qH0YcUVX4/r2qZe/g0M39TkFjEY5vV5OXskOGlUDj6T 3Xdg== X-Gm-Message-State: AKwxyteaw2mf38E5h8UwaLrJUy//leiTxW2oa8uY3sbZwH6bc0zXfM1B MraV9W80BQ7SEGLehnZueyKn85kCKIE= X-Received: by 2002:a17:902:7244:: with SMTP id c4-v6mr9964386pll.414.1516836392709; Wed, 24 Jan 2018 15:26:32 -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.26.31 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Jan 2018 15:26:31 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 24 Jan 2018 15:25:43 -0800 Message-Id: <20180124232625.30105-4-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::243 Subject: [Qemu-devel] [PATCH v3 03/45] 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: , 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 = {