From patchwork Tue May 2 12:14:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 678390 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a41:0:0:0:0:0 with SMTP id v1csp475494wrs; Tue, 2 May 2023 05:26:28 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7+VQx7WmhoCZdrWExWkrYHkoDvAWPcv5xxuyT6BautXiz5X6EidGl1UDfbNppLDZUYfB39 X-Received: by 2002:a05:622a:610:b0:3ef:64cb:ab1e with SMTP id z16-20020a05622a061000b003ef64cbab1emr25750255qta.59.1683030388385; Tue, 02 May 2023 05:26:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683030388; cv=none; d=google.com; s=arc-20160816; b=hWKYIvY9ihojwPgiahp6x7e78N2H9NYqMA4NoZJEiKXREoDdPreztVJMa+payaT55j kK8emv5zemiYJursnSx9L5Eh8ic91AcL3jDM8q+IBX9gNM2oM1rC3EBPhTVBusuckUhY bNhXo58KVvONl4SXC1naMdrVpbN8bEZ0Nwi3STa8qdM1Ah5mTvqj96IErvO6EcVBKuOX GlvWqIxR8ZeJFFfWNZzbLIKjkGE3VlG2HdYq9B8jiqcbe8iUe6ovq4I+dfE9EAJPqvjR Z1ZJba2JwjnfglraA3uYvRCZbYs20ISE6RnNKFKGUHMrwJr1XAwSciJaRR13BQsMzkqn vgdg== 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=VLjSO2tP92uiS72acB9fU4Fq4iGZuuT37nE07/dO9r4=; b=fvuV6xhEHMPGg9+z3KFn7lb4CvhNwaYuSDYhjo5C3dwR6JXtc9SrCpyTYGX799x0LZ zJGNGRzKqeYaDls9RW2ACwqrJfee39MU/gQK2jaPyVasqx2xaObF7OJ/6huBneqQQknV 5QogBavuYm+IsQpYhkKkL+naUr8rSGiSMV0/CjGXQLy2OBoUTqSK1FTHLM1qeiTnvA93 nyx6Qpq6aqCOZrqUF2UDj67WDcZgd7YS3lW9XT73Hoh48FvABHR68ktBN7PGwsfn5CPB 1exkL4y0ZmwG5BfmUWxHK8ZN5OEu3XgaJHxovArsGLvodPvcH+hD5gl9wPHbx42OD9zu 2kCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zPQFgk6Z; 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 i17-20020ac85e51000000b003b9a4c0a497si17053035qtx.397.2023.05.02.05.26.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 02 May 2023 05:26:28 -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=zPQFgk6Z; 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 1ptouZ-0003lV-60; Tue, 02 May 2023 08:15:15 -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 1ptouW-0003kT-J9 for qemu-devel@nongnu.org; Tue, 02 May 2023 08:15:12 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ptouO-0002zw-8J for qemu-devel@nongnu.org; Tue, 02 May 2023 08:15:12 -0400 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-2f7db354092so2255405f8f.2 for ; Tue, 02 May 2023 05:15:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683029702; x=1685621702; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=VLjSO2tP92uiS72acB9fU4Fq4iGZuuT37nE07/dO9r4=; b=zPQFgk6ZQGrHHQ35ZncgD1OjMCKWVE7LiruFNzSvSECkT1zMnJk0LI0Rpv7ZeNvFUB VX+C4IsYSNihnRtJGLGAaLbPBAaueA3XgCNaIW+bTt2X1TFEox5pvXSwPqbfQYbmxyg6 iyN8Ilp4vpP3xEDB5mXzH/huI2zJUJIE3k+SP1YYksbC7BzJBlDMYhukhfcQEKBus8kw Z9ggMsTNbjkoYYn6iW7SGV/9re5Tf3ukCOkRplN2usxj+8icoRjfeFY7qIs5TCeUluj5 6VFM2GIuqLIN8y4sV2hZt3criY8VLoXZHnQw2WzILoyUBQJfHPXq3b9qEWZOnBGjxILo DC7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683029702; x=1685621702; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VLjSO2tP92uiS72acB9fU4Fq4iGZuuT37nE07/dO9r4=; b=esaFW6hAl67DN5iz8T67uWFkWMowGgIRJIvBCbvUVDCdeqLfDPRZUf0UYWeTD+PAZm /ux5FZvIjX363EJRx20C+W5gGMGLROTg9r9/B2RMWNjrP/IEHIfuQdSUqRuoAMSbxrJx hfJyBrjUTovtYvbYWYF5SAXzX78zfnK2t+q9zAx8c6FfQaVGYNNsEJyZfO6uBYh6QAdj pyiFx98MnQqNnUOW3wYUnbAoJDAF9DDBWNuJlA9KaH8TlVPiqJqAGLnsZNBy24Cz28A9 MIpZpPErm/hV4uQho0Fvem1uNVC31Ofi2+UH7cKv6ZvbuVQXe9lhQA9RjYQORpIZw3D4 8idA== X-Gm-Message-State: AC+VfDy4ADKgW8sqcR7I4adZUafHP81yQn9sydtn6R0F74lAEYNnKEqz ucfFE99uZxg+A4YS02TjaM1Xp0+JQEZVAYL3nfg= X-Received: by 2002:adf:ed03:0:b0:2ff:321c:dc8c with SMTP id a3-20020adfed03000000b002ff321cdc8cmr11210823wro.63.1683029702531; Tue, 02 May 2023 05:15:02 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id g10-20020a7bc4ca000000b003f171234a08sm35040330wmk.20.2023.05.02.05.15.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 May 2023 05:15:02 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 03/35] target/arm: Extract TCG -cpu max code into a function Date: Tue, 2 May 2023 13:14:27 +0100 Message-Id: <20230502121459.2422303-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230502121459.2422303-1-peter.maydell@linaro.org> References: <20230502121459.2422303-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42c.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-bounces+patch=linaro.org@nongnu.org From: Fabiano Rosas Introduce aarch64_max_tcg_initfn that contains the TCG-only part of -cpu max configuration. We'll need that to be able to restrict this code to a TCG-only config in the next patches. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Signed-off-by: Fabiano Rosas Message-id: 20230426180013.14814-4-farosas@suse.de Signed-off-by: Peter Maydell --- target/arm/cpu64.c | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index fb5e1b69db4..e9161522b8f 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -1178,27 +1178,17 @@ static void aarch64_host_initfn(Object *obj) #endif } -/* -cpu max: if KVM is enabled, like -cpu host (best possible with this host); - * otherwise, a CPU with as many features enabled as our emulation supports. - * The version of '-cpu max' for qemu-system-arm is defined in cpu.c; +/* + * -cpu max: a CPU with as many features enabled as our emulation supports. + * The version of '-cpu max' for qemu-system-arm is defined in cpu_tcg.c; * this only needs to handle 64 bits. */ -static void aarch64_max_initfn(Object *obj) +static void aarch64_max_tcg_initfn(Object *obj) { ARMCPU *cpu = ARM_CPU(obj); uint64_t t; uint32_t u; - if (kvm_enabled() || hvf_enabled()) { - /* With KVM or HVF, '-cpu max' is identical to '-cpu host' */ - aarch64_host_initfn(obj); - return; - } - - /* '-cpu max' for TCG: we currently do this as "A57 with extra things" */ - - aarch64_a57_initfn(obj); - /* * Reset MIDR so the guest doesn't mistake our 'max' CPU type for a real * one and try to apply errata workarounds or use impdef features we @@ -1367,6 +1357,20 @@ static void aarch64_max_initfn(Object *obj) qdev_property_add_static(DEVICE(obj), &arm_cpu_lpa2_property); } +static void aarch64_max_initfn(Object *obj) +{ + if (kvm_enabled() || hvf_enabled()) { + /* With KVM or HVF, '-cpu max' is identical to '-cpu host' */ + aarch64_host_initfn(obj); + return; + } + + /* '-cpu max' for TCG: we currently do this as "A57 with extra things" */ + + aarch64_a57_initfn(obj); + aarch64_max_tcg_initfn(obj); +} + static const ARMCPUInfo aarch64_cpus[] = { { .name = "cortex-a35", .initfn = aarch64_a35_initfn }, { .name = "cortex-a57", .initfn = aarch64_a57_initfn },