From patchwork Wed Jan 10 19:53:19 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: 761445 Delivered-To: patch@linaro.org Received: by 2002:a5d:6e02:0:b0:337:62d3:c6d5 with SMTP id h2csp2052971wrz; Wed, 10 Jan 2024 11:54:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IEpGTa2rOkcQRLLmG6rBSitTazuxne3HdMxxpR7S5Yx/b1lnBBTObyVNOlAAKf2ed9Oh7kE X-Received: by 2002:a05:6808:1393:b0:3bd:4d14:2386 with SMTP id c19-20020a056808139300b003bd4d142386mr155287oiw.18.1704916476042; Wed, 10 Jan 2024 11:54:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704916476; cv=none; d=google.com; s=arc-20160816; b=dpPIOjLN3Hd8OJ5+YVVVb88iMVEwshYwADBn8stTjGBSK/P7Aw7WoDbEkdLJHltP5t p3mtN0IKIqTFAzwHeWHEZdw/tdm0tX3Y8fxagBP02mBoH41is4oLv4XSTxTqbHU9aFxW tgDA6TzDIAQu/4vfvGwPLItJ9UwNRG+y3fKDLa07L9sWraJmuHeB39zq+Sp8JExArjoj gBoApbIGyiAhxl0pOTjOeuDwrJFCPzevM6q34QanqG+HMOEBpAdaVZWCVa1OxOw6UKff /1yvYbxTqRTK1VHoA7urVE0A4T8xPldxIFXrTAWgbg67GWdDKdK/ozkA48uGtPELt6Vq xjfQ== 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=+Lqyw2xeJxP0nadk2efU9Sx5aGl4DyqfaFeDtt0siLg=; fh=0Bn9ysFO5uhdOoEvdDNDnkwY7yFMuDt2XLw3k0zcWt8=; b=Hm7eHBnEiOcXG5kdLJLK60dNu7TSWaaBAAPh1/YDdjQVCplqPPC1yFP6ZP4VkeSNgT RhNp41m/Zjr6sASTbF8UWXtXzAf6xl3/kflqLM8a/t+e9Ls4Lk90zDwlPEhroyktEYDk gpomkUN/9SN8cTBmXNgrwZY4nyaBBEh1c7QIpzM5iTTi3BxZgUywPwHfeJungfURtXZT cXf5E9ETKWPg1AHQ4OwdWtOhCrXQHTu1xZBwWbWutVlvgY9zRyhgvhl+4XcRlI86cPln SXbbkmeiKvnC86g0eEhnrHnKyLwNAZieNLKheg+/Ck3K1xFTFUeDIAYTW1sDVPMH3u8a Jq8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vfKUCj0x; 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 r3-20020a0cc403000000b0067f9f28533asi4978476qvi.505.2024.01.10.11.54.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Jan 2024 11:54:36 -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=vfKUCj0x; 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 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) 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-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) 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) 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 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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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é --- 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); - 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;