From patchwork Tue Jan 9 18:09:21 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: 761061 Delivered-To: patch@linaro.org Received: by 2002:a5d:6e02:0:b0:337:62d3:c6d5 with SMTP id h2csp1495443wrz; Tue, 9 Jan 2024 10:11:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IFYfUUlZnepCpY60Q6n5VFw6eBrW3ntIKJqMwQqfCTm0Fc/9JqPX0ndanNFchXp73NsYNn0 X-Received: by 2002:a05:6214:248c:b0:67a:a58f:e364 with SMTP id gi12-20020a056214248c00b0067aa58fe364mr7911218qvb.31.1704823888854; Tue, 09 Jan 2024 10:11:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704823888; cv=none; d=google.com; s=arc-20160816; b=t7imi798mLvFc7r80AdzD2WTjWu7KFubHAu25UuHV7KfjwhBf5otKVFPqKaFcDNISV s3a7kxyyVY+GXWpfM0FgTvucan9L8unEj9OtmRgwnWhcLuPUVUXxksLH7inzt4lCcPjr Ucj50ZWQmh5xtI7WmkglI6E+EugLUfhKBufU62xqLcxcCyluTwuuN2qMfIEd38gMRUiF iu0CAn7MzbRLqRQhK3fwi97rQDjwmEREmO0gPcFTWr8cliK6sIF+kmzjujNigC8fUGIM 7pSqClENJBQ5zcGn2haYX4SkoiZ1BlClBhyC5rr0iCNMll2goOARWQY8cb8qcl295kka jc1w== 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=v69mdd+nxs/0WeTIWzLZOPCx0ynE2o0vtvId2fSwkBY=; b=fZjKIu1LY6eKd1Wp1XtIzDUo2+BMgO4+EltLJ1YW+7Cg8Fdl16qKli0ZsSQWvpA4Dh T+ISOzjyKzA1xU/dEWLiFonnKKlSirya7VuYlt03TK+wyDUF9hgFDSRh+BzTMo7Ko42Z 92u208B0ZdTRy68z4mKRlSdB80Ok8F+zgNFPE17N8SRbHYKj4UXd+GK1OeWjeOG9wYQE QuWf/FDjFQKNAev7jPThDo7Blc858tUBc+FZbEgp/fPPoF4VjMa1CXyW1jrJK/CEuR9S uBcC7Pqqh9sw2dgvi9q4GzWwIx3jacCBdrneWiGCN+6nKn7RtVXXCGJYFHLMcvxtilos 2xLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EerEEoYu; 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 k4-20020a0cf584000000b0067f76abb772si2573857qvm.139.2024.01.09.10.11.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 09 Jan 2024 10:11:28 -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=EerEEoYu; 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 1rNGZ5-0003Sr-7u; Tue, 09 Jan 2024 13:11:03 -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 1rNGYN-0002c0-Hn for qemu-devel@nongnu.org; Tue, 09 Jan 2024 13:10:22 -0500 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rNGYK-0004Fs-4U for qemu-devel@nongnu.org; Tue, 09 Jan 2024 13:10:18 -0500 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-40e4d64a431so11589095e9.0 for ; Tue, 09 Jan 2024 10:10:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704823811; x=1705428611; 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=EerEEoYuJoDs77MtzYbtgkYEkasA17X5iboAQWbZtW6IFrakn6ZAQeZeOsFPn4Fx7d 3YFHeVgDtQjwUY0A1nAl+gnyAvZe3Ok8t6WUkgKT0G9rtx8T2UMEyXW75WkiDW8WTmbi vMsDFZPMN46mWRbSe2NwFXOIXCiYgQtm4+eGih1YrMx4EPPDW0st7JqYO/I0NDmh5u3J TtYdwSTYl6khMbqomSSAydB7IBCFbGf2gVJ+IwmNRsNECRmhsZ4JnU2cR3wyFsCWkKEn ZqKMWD5AIIQUMgiTvxVCZKAIO8NMEndr+LJz6iXz0yELLufwbz7O6542YiY+V3cdCPTB SZ4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704823811; x=1705428611; 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=hn9FR0pZclqEecxY8cR0pLLxv60trRk45aupvxIZy7rcN2zzePfMWrK0p35W+YiqtL cskHZwooposXuFXT4Vm7MHWrauoM+azZnO4qnJMNUhvQa5L/XtkSeinzh9sL/RvbY4LA OrneNujVde9v3wLN8xwSOkgxfH4OjuDJ9x4mBXVHvl6LVJiQ7ukvi0OFyeO4o4yRXm2T IplFo7C9k+c4fobVRUM3EfpKjGFrdeaE7x9rSEKcweI/SLvKLpfqPJALTztX+h4gjaW5 z1141Kxz0JP/zSqPm5QMDt22v9nAr5mqTC3+3PLIgj7TBvUjcRl7uYfQ5X8ACj4p/rDA woWg== X-Gm-Message-State: AOJu0YxNBBc3sv9xxYpOBB1x4Uw0A+hGwJUpUlcexo/Rj3J+zq/HG2AK kEPuSRx/o5bFGXE5uH1bo6DYvw4Ra2lYNugHHm9ihytx+nFDsg== X-Received: by 2002:a05:600c:b97:b0:40e:4985:ba63 with SMTP id fl23-20020a05600c0b9700b0040e4985ba63mr1545900wmb.107.1704823811362; Tue, 09 Jan 2024 10:10:11 -0800 (PST) Received: from m1x-phil.lan (rsa59-h02-176-184-32-47.dsl.sta.abo.bbox.fr. [176.184.32.47]) by smtp.gmail.com with ESMTPSA id gw24-20020a05600c851800b0040d3276ba19sm4549145wmb.25.2024.01.09.10.10.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 09 Jan 2024 10:10:11 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Leif Lindholm , Radoslaw Biernacki , Kevin Wolf , Markus Armbruster , "Edgar E. Iglesias" , Igor Mitsyanko , Rob Herring , Alistair Francis , Peter Maydell , Marcin Juszkiewicz , =?utf-8?q?Philippe_Math?= =?utf-8?q?ieu-Daud=C3=A9?= Subject: [PATCH v2 06/14] hw/arm: Prefer arm_feature(M_SECURITY) over object_property_find() Date: Tue, 9 Jan 2024 19:09:21 +0100 Message-ID: <20240109180930.90793-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240109180930.90793-1-philmd@linaro.org> References: <20240109180930.90793-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.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 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;