From patchwork Tue Jun 13 13:33:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 691989 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d91:0:0:0:0:0 with SMTP id b17csp424398wru; Tue, 13 Jun 2023 06:36:53 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7B5Ylx9wgu9riJCB7kO6fDYYKU0WP9HmjCcr87IZHIi1vkJtiLGW494fO3Q7Ih3WJVdQpo X-Received: by 2002:a05:620a:888c:b0:75c:c92e:1d1b with SMTP id qk12-20020a05620a888c00b0075cc92e1d1bmr9625472qkn.28.1686663413398; Tue, 13 Jun 2023 06:36:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686663413; cv=none; d=google.com; s=arc-20160816; b=LV72ckzCYUv5Fzu/6AIPCNM7SlBe1UWs11CO9BdUlXG18Cplmk8yDoJ4PJFS68onbx V84GBYp9xRBagKMl+sMDnWFvfhdsIz0MiCgd537bUXWXubET63e4Kzv8BDhNT3JAKHj8 jfsQg+v//f2T1+XYekT3XKu1qLJT6L72mEGGXVn89eVbXZR8PJyY9OkUB3DBwcBh5C9O VaA0sPgmIoXr9fshSk1C8OfkbxvqywL9LvQgiFWmP02gkEZ43tudWkq/0iQgViwyCWWL VPSoO9bVON+3aIhrq6Fri/TAUksKaHXoOUyDdlZ4EnyCHwgpIaPGYImDIvvc1o3myERw k2Vw== 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:cc:to :from:dkim-signature; bh=SeGtfKxhdpWheO+egBSiFEslCB4vsG49Vh7zClsFGyo=; b=virS0H1ew+WkT2yvQZKy8l0ULcrSGZN1Gsna2IaC1aA3fW3Qa+orwa6+xi+LG/C6aQ jaZ/mRCBr2QjwsEJz4F3lNf+AjIsqPA3inKbt5ZGodRF9CJJmyTlcXzSpjwY3AgUU1N7 zyQJdhc2pL7nv9HnPkwNtiJXZMxqiHijF2N5TTS3uOiSLQHnSMsHPx7JFOdzzIgWfdyM IRJlMh37PnpkN/fmdclLFUGVlfHmlyphSfwgbAIP9KFTXOiXaMCSQH1EW7842TDVjZM6 DpFCDPG1BosNRZU82PAse9rLQjUAgHhau+2jltCXtk1AYFF6btpWSU0VQKlCOwivQ/Tl 3hLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IlHROwFR; 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 p4-20020a05620a15e400b00759554bbe31si7281242qkm.82.2023.06.13.06.36.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Jun 2023 06:36:53 -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=IlHROwFR; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q94Bi-0000bX-FG; Tue, 13 Jun 2023 09:35:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q94Bh-0000Qb-63 for qemu-devel@nongnu.org; Tue, 13 Jun 2023 09:35:57 -0400 Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q94Bd-0002Zi-4q for qemu-devel@nongnu.org; Tue, 13 Jun 2023 09:35:56 -0400 Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-4f6195d2b3fso6919924e87.1 for ; Tue, 13 Jun 2023 06:35:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686663351; x=1689255351; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SeGtfKxhdpWheO+egBSiFEslCB4vsG49Vh7zClsFGyo=; b=IlHROwFRuCxhmdEiYIUhY8LY6j4xtaej4vcyiXE7ahwefDqRNhfRaEanCHmpeGaxeK re0iZ8CUIvTY4nK1EMiFWj0+UKTkrHb+RZ5XSbi2Gq6EwbbahtAekcP8ovUZtM2WIU1R dE7hFFBaKdj57Ve0DoH1WOPsZKIMRPDWIAyDJlIPoIuPEzvcn9IuWK7ICRZPwEu+jOsG 0byd6QM3E3wKD4nCx9yKuhwcumAfwnInnHfHWs/XZDQ45oRJGxZjdVF/4kKNxyJ1tPe6 L8LG3+3tG9beryox/aeEpjSreNhIVaQFBcSyLWW8qhceSbMzgZ/AgdpGG/2g3gONhLRj Afjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686663351; x=1689255351; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SeGtfKxhdpWheO+egBSiFEslCB4vsG49Vh7zClsFGyo=; b=N0q8wZ7mbwJGwGL0061TAdtziZ1EHHRt7DHPCwnl3LRuxRk61T6kOrsxNFevLCn6zW q0Gw4fsF1hGFo4QinxMHx59wj6RcYtLvUxVCg4VD7dQLzXysv7277Xr4Rsw9N47SWyEm QKJlkrMe28QT0lFz35CwgUdcxqi7fezEq9ETsn/Au/b7lntEH/ukIgLI+mohH7QepFXz f0037URnyLjVt1lfEuHjx28F68jh6L9YqEDOnUWzbBwdizdRnyLxlFaxCjCeaer/dGI0 UWoXSLlBLL/9iVGb3a1xFKyenqrHkFDLVgOj1RTrUEeWXDuV9/nYhYT8vFq/VratJrvr uAUw== X-Gm-Message-State: AC+VfDxS+2yAVBsug4xd2QFNj9/NlIj1cgKWDA+fKVj6VpKRubsA/WBn LZcufHuFyJSfpPSrKsgmmlKvKB0RdtynVB7TNh0= X-Received: by 2002:ac2:5307:0:b0:4f4:b864:1da0 with SMTP id c7-20020ac25307000000b004f4b8641da0mr6216154lfh.15.1686663351130; Tue, 13 Jun 2023 06:35:51 -0700 (PDT) Received: from localhost.localdomain ([213.235.133.109]) by smtp.gmail.com with ESMTPSA id zo18-20020a170906ff5200b0096ae4451c65sm6755441ejb.157.2023.06.13.06.35.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 13 Jun 2023 06:35:50 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Thomas Huth , qemu-s390x@nongnu.org, qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v3 4/9] target/ppc: Check for USER_ONLY definition instead of SOFTMMU one Date: Tue, 13 Jun 2023 15:33:42 +0200 Message-Id: <20230613133347.82210-5-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230613133347.82210-1-philmd@linaro.org> References: <20230613133347.82210-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12e; envelope-from=philmd@linaro.org; helo=mail-lf1-x12e.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=unavailable 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-bounces+patch=linaro.org@nongnu.org Since we *might* have user emulation with softmmu, replace the system emulation check by !user emulation one. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Nicholas Piggin --- target/ppc/cpu_init.c | 20 ++++++++++---------- target/ppc/helper_regs.c | 6 ++---- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c index 9f97222655..7bce421a7c 100644 --- a/target/ppc/cpu_init.c +++ b/target/ppc/cpu_init.c @@ -5841,7 +5841,7 @@ POWERPC_FAMILY(970)(ObjectClass *oc, void *data) (1ull << MSR_PMM) | (1ull << MSR_RI); pcc->mmu_model = POWERPC_MMU_64B; -#if defined(CONFIG_SOFTMMU) +#if !defined(CONFIG_USER_ONLY) pcc->hash64_opts = &ppc_hash64_opts_basic; #endif pcc->excp_model = POWERPC_EXCP_970; @@ -5920,7 +5920,7 @@ POWERPC_FAMILY(POWER5P)(ObjectClass *oc, void *data) pcc->lpcr_mask = LPCR_RMLS | LPCR_ILE | LPCR_LPES0 | LPCR_LPES1 | LPCR_RMI | LPCR_HDICE; pcc->mmu_model = POWERPC_MMU_2_03; -#if defined(CONFIG_SOFTMMU) +#if !defined(CONFIG_USER_ONLY) pcc->hash64_opts = &ppc_hash64_opts_basic; pcc->lrg_decr_bits = 32; #endif @@ -6037,7 +6037,7 @@ POWERPC_FAMILY(POWER7)(ObjectClass *oc, void *data) LPCR_LPES0 | LPCR_LPES1 | LPCR_HDICE; pcc->lpcr_pm = LPCR_P7_PECE0 | LPCR_P7_PECE1 | LPCR_P7_PECE2; pcc->mmu_model = POWERPC_MMU_2_06; -#if defined(CONFIG_SOFTMMU) +#if !defined(CONFIG_USER_ONLY) pcc->hash64_opts = &ppc_hash64_opts_POWER7; pcc->lrg_decr_bits = 32; #endif @@ -6181,7 +6181,7 @@ POWERPC_FAMILY(POWER8)(ObjectClass *oc, void *data) pcc->lpcr_pm = LPCR_P8_PECE0 | LPCR_P8_PECE1 | LPCR_P8_PECE2 | LPCR_P8_PECE3 | LPCR_P8_PECE4; pcc->mmu_model = POWERPC_MMU_2_07; -#if defined(CONFIG_SOFTMMU) +#if !defined(CONFIG_USER_ONLY) pcc->hash64_opts = &ppc_hash64_opts_POWER7; pcc->lrg_decr_bits = 32; pcc->n_host_threads = 8; @@ -6197,7 +6197,7 @@ POWERPC_FAMILY(POWER8)(ObjectClass *oc, void *data) pcc->l1_icache_size = 0x8000; } -#ifdef CONFIG_SOFTMMU +#ifndef CONFIG_USER_ONLY /* * Radix pg sizes and AP encodings for dt node ibm,processor-radix-AP-encodings * Encoded as array of int_32s in the form: @@ -6214,7 +6214,7 @@ static struct ppc_radix_page_info POWER9_radix_page_info = { 0x4000001e /* 1G - enc: 0x2 */ } }; -#endif /* CONFIG_SOFTMMU */ +#endif /* CONFIG_USER_ONLY */ static void init_proc_POWER9(CPUPPCState *env) { @@ -6371,7 +6371,7 @@ POWERPC_FAMILY(POWER9)(ObjectClass *oc, void *data) LPCR_HEIC | LPCR_LPES0 | LPCR_HVICE | LPCR_HDICE; pcc->lpcr_pm = LPCR_PDEE | LPCR_HDEE | LPCR_EEE | LPCR_DEE | LPCR_OEE; pcc->mmu_model = POWERPC_MMU_3_00; -#if defined(CONFIG_SOFTMMU) +#if !defined(CONFIG_USER_ONLY) /* segment page size remain the same */ pcc->hash64_opts = &ppc_hash64_opts_POWER7; pcc->radix_page_info = &POWER9_radix_page_info; @@ -6389,7 +6389,7 @@ POWERPC_FAMILY(POWER9)(ObjectClass *oc, void *data) pcc->l1_icache_size = 0x8000; } -#ifdef CONFIG_SOFTMMU +#ifndef CONFIG_USER_ONLY /* * Radix pg sizes and AP encodings for dt node ibm,processor-radix-AP-encodings * Encoded as array of int_32s in the form: @@ -6406,7 +6406,7 @@ static struct ppc_radix_page_info POWER10_radix_page_info = { 0x4000001e /* 1G - enc: 0x2 */ } }; -#endif /* CONFIG_SOFTMMU */ +#endif /* !CONFIG_USER_ONLY */ static void init_proc_POWER10(CPUPPCState *env) { @@ -6547,7 +6547,7 @@ POWERPC_FAMILY(POWER10)(ObjectClass *oc, void *data) pcc->lpcr_pm = LPCR_PDEE | LPCR_HDEE | LPCR_EEE | LPCR_DEE | LPCR_OEE; pcc->mmu_model = POWERPC_MMU_3_00; -#if defined(CONFIG_SOFTMMU) +#if !defined(CONFIG_USER_ONLY) /* segment page size remain the same */ pcc->hash64_opts = &ppc_hash64_opts_POWER7; pcc->radix_page_info = &POWER10_radix_page_info; diff --git a/target/ppc/helper_regs.c b/target/ppc/helper_regs.c index bc7e9d7eda..e27f4a75a4 100644 --- a/target/ppc/helper_regs.c +++ b/target/ppc/helper_regs.c @@ -310,7 +310,7 @@ int hreg_store_msr(CPUPPCState *env, target_ulong value, int alter_hv) return excp; } -#ifdef CONFIG_SOFTMMU +#ifndef CONFIG_USER_ONLY void store_40x_sler(CPUPPCState *env, uint32_t val) { /* XXX: TO BE FIXED */ @@ -320,9 +320,7 @@ void store_40x_sler(CPUPPCState *env, uint32_t val) } env->spr[SPR_405_SLER] = val; } -#endif /* CONFIG_SOFTMMU */ -#ifndef CONFIG_USER_ONLY void check_tlb_flush(CPUPPCState *env, bool global) { CPUState *cs = env_cpu(env); @@ -341,7 +339,7 @@ void check_tlb_flush(CPUPPCState *env, bool global) tlb_flush(cs); } } -#endif +#endif /* !CONFIG_USER_ONLY */ /** * _spr_register