From patchwork Thu Jun 9 09:05:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 580283 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:5806:0:0:0:0 with SMTP id j6csp664047max; Thu, 9 Jun 2022 04:02:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzd+Kkh2BEfVRBv63jgqURL5j7JhcljFnyg0zDacK9JFzIxxKQ6CYQTU+As7V6uCgjDxPcW X-Received: by 2002:a05:622a:24c:b0:304:ed45:d89a with SMTP id c12-20020a05622a024c00b00304ed45d89amr16104128qtx.519.1654772544352; Thu, 09 Jun 2022 04:02:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654772544; cv=none; d=google.com; s=arc-20160816; b=fpGKOlIQG9p1n2f2N+jt1owH33gtsKtSNJ8BbjKiiTCgtI2xpoUa/Y+4XBlnPLY0kg KK9BJzvptwskYiGzitMcppMeeKInazIdiFs/dEJ7m3ds9uGxFIQz2Mv0QHsM84LxxQ7i 9z8qRnNaFWYQqjpytEwiRM17QEhbIJ6Z8fg3B0PTKgy2zzDiZntJvXbzVQN9kMR6bB8p tDU5FmQOkOdVXy1XoSkIPuHCrDEITpAsoIGw/AME5HlZTDQwDo/81fMUC1/cZSeHhmd8 zhMpaHutIl+qZ7sPIMGeKicb4TjY2+4ATTtJ4QiLm9hoqyJo2VLpVpTdpYgGbwYApKt6 a/Aw== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=OuhXk6TQyBrgWjcan+zAuS1lnzgYNbegbZMrB1RwcE0=; b=aJYV5JlQIUqXJ7hDhQMkopC+KEC5xsJOhWhcrvfzWjh73sOEfEbdFH8sBBcEt8mkKR ZA2V2hKvJu+WXIKg2gSwyQeA7kZCJljvP3G/A+6X5UhZVjRd/yAg4Nudspye6si3fagd 4JKTpIRVXyicTJ9TpBKbsYoCWSfDF01bki6OqkdkNUFs2sOvsJnW38LZhtBG2oFqF0nO 9VdVfAHSFeeWKQHmH5L9JPG5MPQqziosh8PvZE6g3AiOoBYxPRY5O7ObOn16tVRagWgy SKzWiykaN1ASxyaKuoqL2yFB2AwvT3bIHP4NNmnMEyviP5uxN2jp8tNH0X42yxjwA8k7 bSlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=w2vhU9JB; 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=pass (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 d15-20020a05622a15cf00b003050059df54si2367167qty.771.2022.06.09.04.02.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 09 Jun 2022 04:02:24 -0700 (PDT) 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=pass header.i=@linaro.org header.s=google header.b=w2vhU9JB; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:54310 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzFvj-0002jA-V8 for patch@linaro.org; Thu, 09 Jun 2022 07:02:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39650) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzE7O-0001Z1-DS for qemu-devel@nongnu.org; Thu, 09 Jun 2022 05:06:21 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:33706) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzE7K-000640-NK for qemu-devel@nongnu.org; Thu, 09 Jun 2022 05:06:18 -0400 Received: by mail-wr1-x42f.google.com with SMTP id h5so31518518wrb.0 for ; Thu, 09 Jun 2022 02:06:14 -0700 (PDT) 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:mime-version :content-transfer-encoding; bh=OuhXk6TQyBrgWjcan+zAuS1lnzgYNbegbZMrB1RwcE0=; b=w2vhU9JBzTbWDw98pfYdxQSWlbErFUebQSWz9iiLuQ3NDfXmJ49hhN63seyjgdEjsx G84r55Pe5sUQ+b2TkRu9/m/vAtu0XfCr7EmORUKufRu31WNLLgvE8gpdNbqARb+lqSEw nit7AaiVRoF2HHqFSczbRSY/qjg4GxbraHgdiJKC7kS868dC/Fi4Xnm6SF4xF0vLBr67 XpIqYMFb738A7814FHw+AnGB5EdCnD2D4BHfDJ9NeRiaF7JgOq1iyBYQFzO0c6auk6aJ FX3TfsCy0nzJHlrRldqgu0uEYHBA/LZFuAE/kRpWhcCYrPKvJ+elU7Gg7m58TFF2fyB5 dnPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OuhXk6TQyBrgWjcan+zAuS1lnzgYNbegbZMrB1RwcE0=; b=bHypYM4ad4WPLQqr0pOYT5kPTFA9WKifYxAIBCBDcHy3IDWUpBX3KDltOcKwUU6L8F js31KwFfbGJ3X9O47+YOUdSE4DmBQImCiF/opjHpXikOHW2JmrANJiqdcNNyauz5fNqi XKU6jGFSNdUgW0XSfwRFP8lzpsdZ+zCcsppPTR3dIJsauXOKTFuTlYlwFhjeWLnkGWFc 7S+0Lb9nNTCPXfpNC3vEIzuXu6hcSAwPf3D7EHJrRBdtnfM1dLrghNnSdNXJer6xWccO WpXi+9egpfUfjGks6jRy2aIutzxwSrw0StQpsISWLFaX5HXNcjVR9R4qxsjqZp5P+Qeb klKg== X-Gm-Message-State: AOAM533wkTds1aMaKZOof50rduSXHl7j6xNHB8ohkuuQlsRA83p+GlXJ WMrb9+4RcK4BML1RJWTXjbmwLDp012QEJA== X-Received: by 2002:a05:6000:1888:b0:218:3fab:c510 with SMTP id a8-20020a056000188800b002183fabc510mr19870503wri.473.1654765573417; Thu, 09 Jun 2022 02:06:13 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id c13-20020adffb0d000000b002183cf9cd69sm11349796wrr.15.2022.06.09.02.06.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jun 2022 02:06:12 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 30/55] target/arm: Move regime_is_user to ptw.c Date: Thu, 9 Jun 2022 10:05:12 +0100 Message-Id: <20220609090537.1971756-31-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220609090537.1971756-1-peter.maydell@linaro.org> References: <20220609090537.1971756-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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" From: Richard Henderson Signed-off-by: Richard Henderson Message-id: 20220604040607.269301-24-richard.henderson@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target/arm/ptw.h | 1 - target/arm/helper.c | 24 ------------------------ target/arm/ptw.c | 22 ++++++++++++++++++++++ 3 files changed, 22 insertions(+), 25 deletions(-) diff --git a/target/arm/ptw.h b/target/arm/ptw.h index 85ad5767944..3d3061a4351 100644 --- a/target/arm/ptw.h +++ b/target/arm/ptw.h @@ -11,7 +11,6 @@ #ifndef CONFIG_USER_ONLY -bool regime_is_user(CPUARMState *env, ARMMMUIdx mmu_idx); bool regime_translation_disabled(CPUARMState *env, ARMMMUIdx mmu_idx); uint64_t regime_ttbr(CPUARMState *env, ARMMMUIdx mmu_idx, int ttbrn); diff --git a/target/arm/helper.c b/target/arm/helper.c index e894afcb491..8deb0fa94c1 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -10515,30 +10515,6 @@ ARMMMUIdx stage_1_mmu_idx(ARMMMUIdx mmu_idx) } #endif /* !CONFIG_USER_ONLY */ -#ifndef CONFIG_USER_ONLY -bool regime_is_user(CPUARMState *env, ARMMMUIdx mmu_idx) -{ - switch (mmu_idx) { - case ARMMMUIdx_SE10_0: - case ARMMMUIdx_E20_0: - case ARMMMUIdx_SE20_0: - case ARMMMUIdx_Stage1_E0: - case ARMMMUIdx_Stage1_SE0: - case ARMMMUIdx_MUser: - case ARMMMUIdx_MSUser: - case ARMMMUIdx_MUserNegPri: - case ARMMMUIdx_MSUserNegPri: - return true; - default: - return false; - case ARMMMUIdx_E10_0: - case ARMMMUIdx_E10_1: - case ARMMMUIdx_E10_1_PAN: - g_assert_not_reached(); - } -} -#endif /* !CONFIG_USER_ONLY */ - int aa64_va_parameter_tbi(uint64_t tcr, ARMMMUIdx mmu_idx) { if (regime_has_2_ranges(mmu_idx)) { diff --git a/target/arm/ptw.c b/target/arm/ptw.c index 9ab77c39980..8db4b5edf1a 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -53,6 +53,28 @@ static bool regime_translation_big_endian(CPUARMState *env, ARMMMUIdx mmu_idx) return (regime_sctlr(env, mmu_idx) & SCTLR_EE) != 0; } +static bool regime_is_user(CPUARMState *env, ARMMMUIdx mmu_idx) +{ + switch (mmu_idx) { + case ARMMMUIdx_SE10_0: + case ARMMMUIdx_E20_0: + case ARMMMUIdx_SE20_0: + case ARMMMUIdx_Stage1_E0: + case ARMMMUIdx_Stage1_SE0: + case ARMMMUIdx_MUser: + case ARMMMUIdx_MSUser: + case ARMMMUIdx_MUserNegPri: + case ARMMMUIdx_MSUserNegPri: + return true; + default: + return false; + case ARMMMUIdx_E10_0: + case ARMMMUIdx_E10_1: + case ARMMMUIdx_E10_1_PAN: + g_assert_not_reached(); + } +} + static bool ptw_attrs_are_device(CPUARMState *env, ARMCacheAttrs cacheattrs) { /*