From patchwork Wed Jan 10 19:53:24 2024 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: 761451 Delivered-To: patch@linaro.org Received: by 2002:a5d:6e02:0:b0:337:62d3:c6d5 with SMTP id h2csp2053184wrz; Wed, 10 Jan 2024 11:55:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IGyVI9FxwSpV675NDxFi8iJq8oFRBxYvx6Ap8NtdFKv4udnae7tkd8sICmZph0RWw7IAVDS X-Received: by 2002:a05:6808:1153:b0:3bc:29b0:7e41 with SMTP id u19-20020a056808115300b003bc29b07e41mr183997oiu.29.1704916523302; Wed, 10 Jan 2024 11:55:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704916523; cv=none; d=google.com; s=arc-20160816; b=kWXXTfSE04GoB1t8CbkkkmeWGjcWq0Lq/2LqfC7nVw2CKeqhbXmWHXbomEnLHLYblP oGtOIcu+uJ6Nyh9R4Uw7ax6StolQUyEDFc4NZNie/+hoOTNS++bA+LWmRBZR5AQnZa+e ODPTfJaQRsOlp6W9UroajzPJHZihubOcz4vfa6G9383gPN8gGIDMHFH5Qu6xo38mJxCQ PZWTTVTJRy2wD20I8Dgr8h4VDKcgIJ8/YJ3a+ycnOm4Mx+d6GeLxZYJzTfP/E9414FFu m/Ep18HWeLs3X3tZtRByKGVeM82bn3CrH9r34iODceq7igD9C8M+6kIJqOiyVV9i8WmQ 2+jQ== 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=rKXURkFhsCy0V0ubg/nJYR4pTGn8xQxbtylatTgX1X4=; fh=0Bn9ysFO5uhdOoEvdDNDnkwY7yFMuDt2XLw3k0zcWt8=; b=CdrgmWgmRMQx9IhIWkw73f11VuAH0u/DbJRPlarwJ6EEpEakyVvmlyWEB2Jm24aPjD Wew658Wie9ZWG7ShVhgSx3i0wly/N/tpvlC+ndBXUkcTAXmV2N/hG9MZUS4gUfzqIND8 EVuKw7v+Qzu21fuw04Ne2l587eejWavHvUlf8/h5/PxPkZ3u6v/UOXbpPxfksnNwHM6Y 1vMSGWczBiENEJyiXy25/j2OPjCcCMLMxxU+XoCr7VP7JMNAuKnAIN1OHhwO6bjBZ8Wl kgVwvHCqimVGIRYU2jKeqO3tLtMuEIpg7LIFNRIHHhBL1IeyqpjHZwtAc39qDuv15wNi TRIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eqPtW453; 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 n11-20020a0ce48b000000b0067a360ada6esi4884724qvl.255.2024.01.10.11.55.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Jan 2024 11:55:23 -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=pass header.i=@linaro.org header.s=google header.b=eqPtW453; 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 1rNef3-0001E0-Oq; Wed, 10 Jan 2024 14:54:49 -0500 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 1rNef2-00010u-6T for qemu-devel@nongnu.org; Wed, 10 Jan 2024 14:54:48 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rNeez-0002ZI-4O for qemu-devel@nongnu.org; Wed, 10 Jan 2024 14:54:47 -0500 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-40e4d515cdeso26628765e9.1 for ; Wed, 10 Jan 2024 11:54:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704916483; x=1705521283; darn=nongnu.org; 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=rKXURkFhsCy0V0ubg/nJYR4pTGn8xQxbtylatTgX1X4=; b=eqPtW453j3KOCZxwasGOPX/zuvvSEhGP40gTW/p54zDVF0uStvojcOPDVtHza4nu/9 jA9VCFSYtSMciBq8aAO6vs9djC2RmWB34cqSsYKY+5dzVb5u6WMeWrvAVg8HJXGZNxqO RbijqU1OihUvKdsy00R1urIWB4QXom9IbIt48CMNFeh0qJ63EHCtXOg0nN+G7kQzMS7X KU7rifRokBtjJ1qAN/be/OKRP+W8evEL4RFKzUV2ZK3r0r6RpbIrpBCvNB8Ybj9zClS3 yBWwMNAHvHuzCPAHbobYmlm6CKfQUqShCalemaimHH836c7ECQzrsWjpYvgz1NAg1rXu Wa2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704916483; x=1705521283; 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=rKXURkFhsCy0V0ubg/nJYR4pTGn8xQxbtylatTgX1X4=; b=qWeQ+QRqrUmQRzVw4vEbApiJPHpStYP34zMjspbE/o5mGaNYOOzonoD2ie9/qgTBvp KYmN1N1agTKHDRV21xBGYnfVTb4i6vV1leE15BRvj4sUtKMGqxt4LPI1M6X/59oi6p/J WhhKf+T+Aq7IRU3+uiYsUDfIa++KOfSOasaiOHLmDfmNrjVlZOV2UTe6vtDbGFOZ3FdY Gpavs4s3xf59jhAoPdY5wN5Ph3XndZS5qzT54hO7ReIwswiIgDgpnqSHdyQpg30MSe2J MZgLtmeQbuD4U8bXiezV6OiD8zr5wYO0nBFheeA8CgsgbAUCmn7H/Jbh5MfHh76b2UhQ nZNw== X-Gm-Message-State: AOJu0YzmLV2fN9Iba8in7wPXy/TOGA6UXqjcFf3NywZhWp+NnfbGPDdG Pu2tf/jKcIRwNnnkJIPcsh+jeHIm2wJDjiKGUNpWuTdh9RU= X-Received: by 2002:a05:600c:1908:b0:40e:44b5:511e with SMTP id j8-20020a05600c190800b0040e44b5511emr830051wmq.99.1704916483457; Wed, 10 Jan 2024 11:54:43 -0800 (PST) Received: from m1x-phil.lan (vau06-h02-176-184-43-236.dsl.sta.abo.bbox.fr. [176.184.43.236]) by smtp.gmail.com with ESMTPSA id m22-20020a05600c4f5600b0040e4561e231sm3234605wmq.17.2024.01.10.11.54.41 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 10 Jan 2024 11:54:43 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Marcin Juszkiewicz , qemu-arm@nongnu.org, Kevin Wolf , Igor Mitsyanko , =?utf-8?q?Alex_Benn=C3=A9e?= , Radoslaw Biernacki , "Edgar E. Iglesias" , Leif Lindholm , Rob Herring , Markus Armbruster , Alistair Francis , Peter Maydell , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH v3 10/14] hw/arm: Prefer arm_feature(CBAR*) over object_property_find(reset-cbar) Date: Wed, 10 Jan 2024 20:53:24 +0100 Message-ID: <20240110195329.3995-11-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240110195329.3995-1-philmd@linaro.org> References: <20240110195329.3995-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.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 The "reset-cbar" property is added to ARMCPU when the ARM_FEATURE_CBAR[_RO] features are available. Rather than checking whether the QOM property is present, directly check the features. Suggested-by: Markus Armbruster Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/highbank.c | 3 ++- hw/arm/sbsa-ref.c | 3 ++- hw/arm/vexpress.c | 3 ++- hw/arm/virt.c | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c index c21e18d08f..b06a727c06 100644 --- a/hw/arm/highbank.c +++ b/hw/arm/highbank.c @@ -211,7 +211,8 @@ static void calxeda_init(MachineState *machine, enum cxmachines machine_id) object_property_set_int(cpuobj, "psci-conduit", QEMU_PSCI_CONDUIT_SMC, &error_abort); - if (object_property_find(cpuobj, "reset-cbar")) { + if (arm_feature(&cpu->env, ARM_FEATURE_CBAR) || + arm_feature(&cpu->env, ARM_FEATURE_CBAR_RO)) { object_property_set_int(cpuobj, "reset-cbar", MPCORE_PERIPHBASE, &error_abort); } diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c index 477dca0637..c073c462c7 100644 --- a/hw/arm/sbsa-ref.c +++ b/hw/arm/sbsa-ref.c @@ -770,7 +770,8 @@ static void sbsa_ref_init(MachineState *machine) numa_cpu_pre_plug(&possible_cpus->cpus[cs->cpu_index], DEVICE(cpuobj), &error_fatal); - if (object_property_find(cpuobj, "reset-cbar")) { + if (arm_feature(cpu_env(cs), ARM_FEATURE_CBAR) || + arm_feature(cpu_env(cs), ARM_FEATURE_CBAR_RO)) { object_property_set_int(cpuobj, "reset-cbar", sbsa_ref_memmap[SBSA_CPUPERIPHS].base, &error_abort); diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c index 753a645c05..ea3c76f3e1 100644 --- a/hw/arm/vexpress.c +++ b/hw/arm/vexpress.c @@ -229,7 +229,8 @@ static void init_cpus(MachineState *ms, const char *cpu_type, } } - if (object_property_find(cpuobj, "reset-cbar")) { + if (arm_feature(&cpu->env, ARM_FEATURE_CBAR) || + arm_feature(&cpu->env, ARM_FEATURE_CBAR_RO)) { object_property_set_int(cpuobj, "reset-cbar", periphbase, &error_abort); } diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 35eb01a3dc..7e7350fec2 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -2168,7 +2168,8 @@ static void machvirt_init(MachineState *machine) object_property_set_bool(cpuobj, "lpa2", false, NULL); } - if (object_property_find(cpuobj, "reset-cbar")) { + if (arm_feature(cpu_env(cs), ARM_FEATURE_CBAR) || + arm_feature(cpu_env(cs), ARM_FEATURE_CBAR_RO)) { object_property_set_int(cpuobj, "reset-cbar", vms->memmap[VIRT_CPUPERIPHS].base, &error_abort);