From nobody Thu Nov 14 06:57:03 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704916476; cv=none; d=zohomail.com; s=zohoarc; b=f3WoTPTp81OeY7chCe4hLVgnfNUn+TCc0nklOpgVGjv091KQdmcCSduy7s48fwcYYMnr2ibPf/c3zf9CnDrq/ui0dx0B0o7zB2e5Ps3kncuyFVlFFKOGOP0izu/i7uLt5ufQVmUXAkqVMf5Z5alXwZrtZjJv7cKOzyCSnHmfbE4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704916476; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+Lqyw2xeJxP0nadk2efU9Sx5aGl4DyqfaFeDtt0siLg=; b=NHRSq9wINz+F5mU8GUU9QwL+YpnYU0UuWsaQSugS++xjjePQLVAaFsRewwqTEDbhKvdmlIK2emDLv6iQQP2Izl5HRogfbFFqKCytWhqfwfqG5rA1RdTxHqcsE6RrP1R8SVXxTcVsTJYC80ouGTWtl0mRKT+y7wkE/qlaV50xke8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704916476409547.3451248558131; Wed, 10 Jan 2024 11:54:36 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rNeeV-0007Jf-JR; Wed, 10 Jan 2024 14:54:17 -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 1rNeeS-0007IV-AF for qemu-devel@nongnu.org; Wed, 10 Jan 2024 14:54:12 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rNeeQ-00028e-Ax for qemu-devel@nongnu.org; Wed, 10 Jan 2024 14:54:11 -0500 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-3375a236525so3781994f8f.0 for ; Wed, 10 Jan 2024 11:54:09 -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 r4-20020adff104000000b00336a0c083easm5602722wro.53.2024.01.10.11.54.06 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 10 Jan 2024 11:54:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704916448; x=1705521248; 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=+Lqyw2xeJxP0nadk2efU9Sx5aGl4DyqfaFeDtt0siLg=; b=vfKUCj0xZ78IizDc83HDtt9eOmGXDS/yHioQ4akHNWANy3e+Eh3K8iA6M5LwSURmVp wIvc/MiZrv95scEKQbLmr2T95CRRyigvvPymBHV44EnnGIjrqIg7VqBIg5zsZdOm+Stg sM1t6O7c3hU5voTrRphzR4PHF7f7KXQHvjTe1hVk6qx+fNr15QlnoL0UzV08IWzPuqTc 7wDJeGEj4Rh4AAidu9SZywd0WHTnMM1SfZSuqIDly0dK3U237cl9eIacQ/4073alwRbC SoVsr+9EOyXFypb1xTo0f0ucmYQfOvnCgiZZvAFCM0kFih/Np7NOCrlhhKnRxfZ0ZJ4V LYeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704916448; x=1705521248; 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=+Lqyw2xeJxP0nadk2efU9Sx5aGl4DyqfaFeDtt0siLg=; b=HohM/GZoWhIO5eFltpU/9EGmuhGH5ra2XfN8LyNHzCuX45rnM+q0+jypSy8uM7kvWv jyqaO4yp5Ug7DIFR/ULwEPrQe2tQe8u7VqGmYtsGbINyegzldfitHjuNkSriDKdIUs3Y IPVDPvWgWhy3fXG1EtzmHY11tNFlZMFEtNI3O0A6f/JkyrhL52pV7WtIjkr8tyVDWii7 GtZcjOwRZwlOSVu9YlG9HZPBdLTRbsk76kwUNtUgQX/+/ialqDj1Qw23BJ9NkPKW4fBk 6gnF672tH9Is2u+KkEyT5j7HoWnDUa5Gv1snD9bKdf2DYrNtFqzUYUgN8hyGv9oLbh6j 4wXA== X-Gm-Message-State: AOJu0YyfJbVRGdfzygBLiwGdp+SefL2WzCWyro/7/ajz6eUcL+ygt/6l jqwpsqDkDjN2VwHZzwnGtB91sz02lc4kSBVURONiomO9SGg= X-Google-Smtp-Source: AGHT+IH7Le0gG0qCcI+8M09SN9A/YfAepwlqDkxfVaho46g9uVvNTxP1ta35tm/cvlgibSAWK/Yc9g== X-Received: by 2002:adf:f102:0:b0:337:6566:f9cf with SMTP id r2-20020adff102000000b003376566f9cfmr2200wro.98.1704916448613; Wed, 10 Jan 2024 11:54:08 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Marcin Juszkiewicz , qemu-arm@nongnu.org, Kevin Wolf , Igor Mitsyanko , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Radoslaw Biernacki , "Edgar E. Iglesias" , Leif Lindholm , Rob Herring , Markus Armbruster , Alistair Francis , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 05/14] hw/arm: Prefer arm_feature(M_SECURITY) over object_property_find() Date: Wed, 10 Jan 2024 20:53:19 +0100 Message-ID: <20240110195329.3995-6-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=philmd@linaro.org; helo=mail-wr1-x42d.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704916478170100004 Both "idau" and "init-svtor" properties are added to ARMCPU when the ARM_FEATURE_M_SECURITY feature is available. Rather than checking whether the QOM properties are present, directly check the feature. Since we are sure the "init-svtor" is present, the object_property_set_uint() can't fail. Instead of using &error_abort, replace: object_property_set_uint(OBJECT(s->cpu), "init-svtor", s->init_svtor, &error_abort); by: qdev_prop_set_uint32(cpudev, "init-svtor", s->init_svtor); which is a one-to-one replacement. Suggested-by: Markus Armbruster Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/arm/armv7m.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c index 530729f42e..8350267d96 100644 --- a/hw/arm/armv7m.c +++ b/hw/arm/armv7m.c @@ -311,16 +311,11 @@ static void armv7m_realize(DeviceState *dev, Error **= errp) qdev_prop_set_bit(cpudev, "start-powered-off", s->start_powered_off); qdev_prop_set_uint32(cpudev, "init-nsvtor", s->init_nsvtor); =20 - if (object_property_find(OBJECT(s->cpu), "idau")) { + if (arm_feature(&s->cpu->env, ARM_FEATURE_M_SECURITY)) { + qdev_prop_set_uint32(cpudev, "init-svtor", s->init_svtor); object_property_set_link(OBJECT(s->cpu), "idau", s->idau, &error_abort); } - if (object_property_find(OBJECT(s->cpu), "init-svtor")) { - if (!object_property_set_uint(OBJECT(s->cpu), "init-svtor", - s->init_svtor, errp)) { - return; - } - } if (object_property_find(OBJECT(s->cpu), "vfp")) { if (!object_property_set_bool(OBJECT(s->cpu), "vfp", s->vfp, errp)= ) { return; --=20 2.41.0