From patchwork Thu Jan 10 12:49:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 155156 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp1861534jaa; Thu, 10 Jan 2019 04:55:50 -0800 (PST) X-Google-Smtp-Source: ALg8bN5krElfzwHBWt0asRLqdovFhZ4FHOC47aoKsqqtRZyabX/4DBeGJYQabNcjlFo7SP1w8aS1 X-Received: by 2002:a5d:488f:: with SMTP id g15mr9044070wrq.15.1547124950095; Thu, 10 Jan 2019 04:55:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547124950; cv=none; d=google.com; s=arc-20160816; b=Q2iVQh+yHZ03fFPJKLEwsMN28W21OXuSvp3w6ykcNHwgDdfVuqHFnaZ1OVsVwDj5QD /Aay7hsP9rjkV657gG8XsxvVzu9vqimzoPiuAnTZHF4TNPOkFRkmS+r2KGBmtuC1AVDs wslqaVopLTct0Zzgz8JMBNsr4gUmU2+OjThwTrxLhZzIxoPa9l8ffUqYu7hz3bBFDo1e r6GFnBQMRvd1QHXwcOWkMNr4BZIMBWpNstJGPkCMxtGzA2lDrEuImqGJQp9ICT0Ge/E5 f1eXUUwbCiTVseHd+gttG+VQAc5Jn82J/itwc0Q9cGjVvhMuuVjsIAXfZ7OEGay1E7RL uBOQ== 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; bh=Lgpz8q+muFznxKLaWMgdH+QvhIvbcK4cjoZjSmcuDjg=; b=t07uukLhRbVLcOzUS86V98A2ad7hWRbEXePRWl5xZcJh7VTPCmi8Hdqus6Frx4UIOI GCIntpJE8vCS76zWBid5oAg29jnoMSRKJEMFxxR7Sx8Ihs4kYMQafY2/K4m1OqTc/Gg2 0LRch6B46vCumkzCPZRkbRZ7sHZrWaBpobX2g+9EfaH2gba4QjmQtnOZDwKCL2hYHXzG +SoaA6rJU06pdYW5+7HoQhVUioctPmjREcpejIRvKH2AccxCyyCtnjTteBJo6Ymeureo tl/XXApVzOJCAZVt8CBKD6K/FZgcImAfVBFNc7owaTGkX9MXotzPhAtdrmw8ve2TP5x5 V5Ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="Uid/lklz"; 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 f15si43039633wrr.220.2019.01.10.04.55.49 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 10 Jan 2019 04:55:50 -0800 (PST) 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="Uid/lklz"; 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]:37692 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghZsC-0007iO-Vs for patch@linaro.org; Thu, 10 Jan 2019 07:55:49 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37349) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghZmh-0003Q4-ST for qemu-devel@nongnu.org; Thu, 10 Jan 2019 07:50:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ghZmh-0007Bs-1z for qemu-devel@nongnu.org; Thu, 10 Jan 2019 07:50:07 -0500 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]:41149) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ghZmg-00079z-Sc for qemu-devel@nongnu.org; Thu, 10 Jan 2019 07:50:06 -0500 Received: by mail-pf1-x444.google.com with SMTP id b7so5263526pfi.8 for ; Thu, 10 Jan 2019 04:50:06 -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=Lgpz8q+muFznxKLaWMgdH+QvhIvbcK4cjoZjSmcuDjg=; b=Uid/lklzKYYOiyR5eu4jRLu3OhCiA1mZLad+uRRHymK+MjTO8DluOYwhYf2RtypCIg bsFwJNHEpMkSERXwNegxN/1CmiGqmcUvmpoTvEZrcCyyA3Fmqur/xVNPlx0wQLuzGvrH kqBvygISLCZeey5lPk/xpoKJdMgaaqPfTBCdM= 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=Lgpz8q+muFznxKLaWMgdH+QvhIvbcK4cjoZjSmcuDjg=; b=IyOGkUeCTlvd37XwWcBJ0iJ4fftvaV1/A4eIirfmseSo3O5oytC6+wtr0ti6w4z/7V W/bmSxiTMt7CLglzVIHiXcTuOJZXALrWYP70L6wGh2ZI6VtlsOs5ao7kmNKv8jS1ZTmQ SZGLGWGncweHoWqY4/laOoZvcC84jrXqKYFMmMQs5BH5XA6frbu6O3rvoMFYVZzeVLhJ GRR+RMCQcZn0aN0d+JOZmXLo71/B0I4KNle28AaTC4DMeIVePVil13kbAXbGaI/VMRsR V83AU6xvEv7yXjyvzNBXHr2v0+zTCXv+tYhn11/whfUl9e8JtksAWB/9pIJPvcGHvaN9 3jPA== X-Gm-Message-State: AJcUukekDqCiLP5zdBJCUsnALUxvQBfXOlyVKEdvLogLImeYcnNka5AG mSESdR1Ql5vyBxIJaWrLUP5MhRQ9gc+ZJw== X-Received: by 2002:a63:6346:: with SMTP id x67mr7060533pgb.183.1547124605250; Thu, 10 Jan 2019 04:50:05 -0800 (PST) Received: from cloudburst.twiddle.net (c220-239-117-135.belrs4.nsw.optusnet.com.au. [220.239.117.135]) by smtp.gmail.com with ESMTPSA id g28sm132656016pfd.100.2019.01.10.04.50.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 10 Jan 2019 04:50:04 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 10 Jan 2019 23:49:50 +1100 Message-Id: <20190110124951.15473-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190110124951.15473-1-richard.henderson@linaro.org> References: <20190110124951.15473-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::444 Subject: [Qemu-devel] [PATCH 3/4] target/arm: Compute TB_FLAGS for TBI for user-only 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" Enables, but does not turn on, TBI for CONFIG_USER_ONLY. Signed-off-by: Richard Henderson --- target/arm/internals.h | 21 --------------------- target/arm/helper.c | 13 ++++++------- 2 files changed, 6 insertions(+), 28 deletions(-) -- 2.17.2 Reviewed-by: Peter Maydell diff --git a/target/arm/internals.h b/target/arm/internals.h index d01a3f9f44..a4bd1becb7 100644 --- a/target/arm/internals.h +++ b/target/arm/internals.h @@ -963,30 +963,9 @@ typedef struct ARMVAParameters { bool using64k : 1; } ARMVAParameters; -#ifdef CONFIG_USER_ONLY -static inline ARMVAParameters aa64_va_parameters_both(CPUARMState *env, - uint64_t va, - ARMMMUIdx mmu_idx) -{ - return (ARMVAParameters) { - /* 48-bit address space */ - .tsz = 16, - /* We can't handle tagged addresses properly in user-only mode */ - .tbi = false, - }; -} - -static inline ARMVAParameters aa64_va_parameters(CPUARMState *env, - uint64_t va, - ARMMMUIdx mmu_idx, bool data) -{ - return aa64_va_parameters_both(env, va, mmu_idx); -} -#else ARMVAParameters aa64_va_parameters_both(CPUARMState *env, uint64_t va, ARMMMUIdx mmu_idx); ARMVAParameters aa64_va_parameters(CPUARMState *env, uint64_t va, ARMMMUIdx mmu_idx, bool data); -#endif #endif diff --git a/target/arm/helper.c b/target/arm/helper.c index 8c28c6d044..0ceb1fa2b8 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -6549,7 +6549,7 @@ uint32_t HELPER(rbit)(uint32_t x) return revbit32(x); } -#if defined(CONFIG_USER_ONLY) +#ifdef CONFIG_USER_ONLY /* These should probably raise undefined insn exceptions. */ void HELPER(v7m_msr)(CPUARMState *env, uint32_t reg, uint32_t val) @@ -8923,6 +8923,7 @@ void arm_cpu_do_interrupt(CPUState *cs) cs->interrupt_request |= CPU_INTERRUPT_EXITTB; } } +#endif /* !CONFIG_USER_ONLY */ /* Return the exception level which controls this address translation regime */ static inline uint32_t regime_el(CPUARMState *env, ARMMMUIdx mmu_idx) @@ -9084,6 +9085,7 @@ static inline bool regime_is_user(CPUARMState *env, ARMMMUIdx mmu_idx) } } +#ifndef CONFIG_USER_ONLY /* Translate section/page access permissions to page * R/W protection flags * @@ -9771,6 +9773,7 @@ static uint8_t convert_stage2_attrs(CPUARMState *env, uint8_t s2attrs) return (hiattr << 6) | (hihint << 4) | (loattr << 2) | lohint; } +#endif /* !CONFIG_USER_ONLY */ ARMVAParameters aa64_va_parameters_both(CPUARMState *env, uint64_t va, ARMMMUIdx mmu_idx) @@ -9841,6 +9844,7 @@ ARMVAParameters aa64_va_parameters(CPUARMState *env, uint64_t va, return ret; } +#ifndef CONFIG_USER_ONLY static ARMVAParameters aa32_va_parameters(CPUARMState *env, uint32_t va, ARMMMUIdx mmu_idx) { @@ -13087,11 +13091,7 @@ void cpu_get_tb_cpu_state(CPUARMState *env, target_ulong *pc, *pc = env->pc; flags = FIELD_DP32(flags, TBFLAG_ANY, AARCH64_STATE, 1); -#ifndef CONFIG_USER_ONLY - /* - * Get control bits for tagged addresses. Note that the - * translator only uses this for instruction addresses. - */ + /* Get control bits for tagged addresses. */ { ARMMMUIdx stage1 = stage_1_mmu_idx(mmu_idx); ARMVAParameters p0 = aa64_va_parameters_both(env, 0, stage1); @@ -13110,7 +13110,6 @@ void cpu_get_tb_cpu_state(CPUARMState *env, target_ulong *pc, flags = FIELD_DP32(flags, TBFLAG_A64, TBII, tbii); flags = FIELD_DP32(flags, TBFLAG_A64, TBID, tbid); } -#endif if (cpu_isar_feature(aa64_sve, cpu)) { int sve_el = sve_exception_el(env, current_el);