From patchwork Fri Dec 29 06:31:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 122891 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4325528qgn; Thu, 28 Dec 2017 22:37:50 -0800 (PST) X-Google-Smtp-Source: ACJfBouqfGp1/pC2EbE9uATAViGr1PqH3g2RjVPiXJo239UOD+z0OYuTW/GmJiLI+PqUzZinfTQ4 X-Received: by 10.37.25.84 with SMTP id 81mr23392511ybz.261.1514529470434; Thu, 28 Dec 2017 22:37:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514529470; cv=none; d=google.com; s=arc-20160816; b=Gkr/W2WZtEcHHD9luZSuPWL568Mvty9maXODwzaTt6DQGjJlH19G7LNZBrv72OBRYx wR1gkf4iDgzqTjNh3ija/QdmdDPHDJ2AdNkDqGRiFgWsDPLhTldSCiewpAbW64RU03mY 2zMoga5ojrTnwwZLx6VG2O5I9fvCTiXKdwPeIPCKpmPBfXNcAyBbWJLUCSlNY/vpPjw3 Sod9AZD5WtsCeazbaLsEjF4ioOiwBIlOiTW8jSWJ4g5xd14+MHEQ94po47XwnEPkom0P O06JfAXJZZeXYtJeHSpgW2i5rSS10VuTKM88PkDuXmO44gRpKP86z7zsGTKza0kIWp2n 1Ylg== 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=d8CYdcWO2lTNgr5lml7jwgRmKSmVFqC/aDyiwB1nMCxSHDJE96+A+LCVXX6JK20gaG 6JBxlqBnKIP/uGZfEwa/wFBXftgpJH5zxQSyST81CUQFddJ/bPOcBvq3ZptNx9+GPOqy EEPw4EqqoBVBIVf0PpXG5QeyT74pGzZgwM1pMTWje1QvniC+ypwE9QKRTVwLpI84jW+7 RgGNYrT0JnBOLdiGXNK9Z/c/kyX91XrDD5syb5dUKEA5KrvpjqkShq9I1A3tpYK/2aU7 I+IYtenKRpFMQ+eycP9ZteCV6n017bdqxmbBO7ZbOk+WeTJck4tiq5LdDeSNwJvy0Y3q ekiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=BRmcngIm; 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 z139si6674018ywg.449.2017.12.28.22.37.50 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 28 Dec 2017 22:37:50 -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=BRmcngIm; 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]:56955 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eUoIf-0006YJ-QO for patch@linaro.org; Fri, 29 Dec 2017 01:37:49 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50550) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eUoCw-0002js-DJ for qemu-devel@nongnu.org; Fri, 29 Dec 2017 01:31:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eUoCv-0004Vz-Ja for qemu-devel@nongnu.org; Fri, 29 Dec 2017 01:31:54 -0500 Received: from mail-pf0-x241.google.com ([2607:f8b0:400e:c00::241]:38134) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eUoCv-0004VO-EH for qemu-devel@nongnu.org; Fri, 29 Dec 2017 01:31:53 -0500 Received: by mail-pf0-x241.google.com with SMTP id u25so21822902pfg.5 for ; Thu, 28 Dec 2017 22:31:53 -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=BRmcngImp7hZgIBVnlurNzn7Q8ZQjD7hxoGjLoGaH7heWm52T3P0+5weYauLEmNvM2 LRcTiMwQHXOEYh8YfvXkq+kJuOC+IqUWfJeT54NcgfTNPHP+PM8VoOyQyqGT2b/slOMs xOHESlmsVQ43SaA9jfzExXGEZB/80N8q8Z2b0= 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=P+dp/vkMZGPxLoHYn+3QStlqsddwtakGBJjaLQ6qdWFIc4syWwFmvKRvTqVea86ubi F8X/d0kHk1hHSZEkTnIS9UeOWZYLQ178DMVFB0wCY8TXG0kHdn5HpGxTns2AOYCCYOXJ wNRnVZsWDy7Bv275nUaqD3b2leb09TbbG8P0do165NXM/yh5NdcdLbvQQHWDhogOvQrT LputarnUsnEoCL0uGAslQJFCM5FF02CaUoPBfRNWy6AAhMc5xJ2lM2bI9Q0poR1YsJvA MYRelCPQNrtovgXosLaqohbmWULwnnJGFnpf6pJL0kf7mgGpL+xu9uU7Z2wX/4kcqzuD 5rrQ== X-Gm-Message-State: AKGB3mJtR9OgNP4JbDRXRKxGuznzS1u8/wYqxOCprXvWj1gjOrP3RjNL 8342WLHS2gKrpbeO5DE1puyaNI+1tcc= X-Received: by 10.99.66.197 with SMTP id p188mr29466988pga.371.1514529112152; Thu, 28 Dec 2017 22:31:52 -0800 (PST) Received: from cloudburst.twiddle.net (97-113-183-164.tukw.qwest.net. [97.113.183.164]) by smtp.gmail.com with ESMTPSA id c28sm76539063pfe.69.2017.12.28.22.31.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Dec 2017 22:31:51 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 28 Dec 2017 22:31:10 -0800 Message-Id: <20171229063145.29167-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20171229063145.29167-1-richard.henderson@linaro.org> References: <20171229063145.29167-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:c00::241 Subject: [Qemu-devel] [PATCH 03/38] 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: deller@gmx.de 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 = {