From patchwork Wed Jan 10 19:53:15 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: 761446 Delivered-To: patch@linaro.org Received: by 2002:a5d:6e02:0:b0:337:62d3:c6d5 with SMTP id h2csp2052977wrz; Wed, 10 Jan 2024 11:54:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IH05shP+lZ7jiBy09xA2bHHwM4CRyAhTTuN32vrTiQh7zIcvOihDnhQimB8aXDrRrcYu4kJ X-Received: by 2002:a81:c847:0:b0:5f7:10a7:d4ff with SMTP id k7-20020a81c847000000b005f710a7d4ffmr174896ywl.51.1704916476995; 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=WhxDQi3fLJjzMQqE8TW23XX208IHPKAa7brUlqTwJZ8dEwbiEWkLF0j07QZtQiC8ko j1JWQ/0Zu06u7/qMYu2tTG4tGoB34A0zf7b1htrY/0iHBN+xw0r4XC2i0u3uSqjOIiBk qJ7zxh0MfOEbuQHBTNXwObWcjy0gLX9WrOs8w8cTxAPphmw4nlW942w5oFO9DjuUv1Xn wfB9rFRMrpsEudacOuBsOZPl9Zdu2RdROyQFXgASfVZyuAJho1Gygv0zGnrhCe2+d/vo KR9cDPI6X4L3K/8cUzHnRb7GZ5vm2bjM2byBMZQ4ngNyuwHw6bxGZTEe/hGMKlqUZ+JI RMKQ== 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=W5YYwF8QpDX8Jtsvrc0+qop9CxJbiTqbmmnqrqDqyeI=; fh=0Bn9ysFO5uhdOoEvdDNDnkwY7yFMuDt2XLw3k0zcWt8=; b=bHevDv5v4YKobyMUKfAc3LKwmkdFJ95zlGq0gqa6xKE6l9nyK9XiReJj/3U1rEJbud C57SrmLE7d0mvhpjF2+pwV0EM3TPhJAK5PMMzKPL7onpab6bzP/irMcNa12B95tH9Im7 lZ10fBDDN8ZjLtYtWCQQxFV2Rs7VxJbZMmeky9VYnHXg0kptNG6orxN9X8J/VFN7Tbs2 11P2ksypcBfuFOA1BRIbCnk6r6n/Oib35OHB+VKqZzl3rJLnuVqBFRGY3RalAOKQEUwa ohvdrycy/NJms+mP645CT8FKpEJrfKvjdT60m+x68OfQV1B/WxfadKGo3JD+GZlBd2iC n+3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xCoOXTYS; 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 n15-20020a05620a294f00b007833445f72dsi2460647qkp.98.2024.01.10.11.54.36 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=xCoOXTYS; 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 1rNee2-0006uv-GR; Wed, 10 Jan 2024 14:53:46 -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 1rNee0-0006q8-4z for qemu-devel@nongnu.org; Wed, 10 Jan 2024 14:53:44 -0500 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rNedy-0001oE-I6 for qemu-devel@nongnu.org; Wed, 10 Jan 2024 14:53:43 -0500 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-33761e291c1so2714746f8f.0 for ; Wed, 10 Jan 2024 11:53:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704916421; x=1705521221; 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=W5YYwF8QpDX8Jtsvrc0+qop9CxJbiTqbmmnqrqDqyeI=; b=xCoOXTYSU3tG6dOoEPKMBQK0p7U5v6jSUytnCJUQFkM/a7cdrJfXkrf1/g/wxiFOjS 3KcJh6JM/W+uSTbupMu/mK3BG7xP4+/v1ArigX67uEHNPjybHsVqrW648vRGTCmsO8jc 6gnUgAUdrmBbqorxdov8hyBtEK1WLALQPs2zgUfTcPJlUn9XLnqheow3eg26q3tbiDBt qA/1Qt4qRTFJi7Bnq/6OgjWVvXQ2un0nnVpITh7gfGpMUOZLUHlTtGy1+DtMwIFC0lHx NmEwaju5ZJf139zZ27o7a4/JNDgOzHCJZFSY7N7UiL/w0UDduGLOY/IHmN9iU3zSnbJc 5QWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704916421; x=1705521221; 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=W5YYwF8QpDX8Jtsvrc0+qop9CxJbiTqbmmnqrqDqyeI=; b=W9L3VgZQZkgztOaoRQQ8WC/fs3JU+rAJu0Fyo7Dd05LsfoN00S/3riaQz6a1K50Arw ++GW0xfZysjL1Xsp6WqPOkZ1XmCNWCKOsTDTHjEIXl+st18oBABaUyECV3spyRufwSPD OeslzOQSLP4omeytMwiWkOXQpScTnCumMLLgaq+PmKIAma3Wvn30JuDMyKASWYln8zka MIbZEN7sEJva2ZMAvvr8L/6a/W3m1iI3T++0he6r7RSw3V16uBuAY7kmMn0VbvXuly5F c6bRRxvxICpWGBcYphwiEFxRkc1yth3UtfH4YWJhT9SmP91PzbDqTgv+z/cNzmjxJZd7 k3sw== X-Gm-Message-State: AOJu0YxXmCbdTl/qNhwEeCv1n6NhNLjGcNcjy2YWAPbmZ98eF5pzEIiK /p01tIcSQQFXKSNcJGYK+t/utWDpsLIhHPTmgTxg/0hrdrU= X-Received: by 2002:a05:600c:3c9c:b0:40d:5d0a:cf4a with SMTP id bg28-20020a05600c3c9c00b0040d5d0acf4amr370282wmb.34.1704916420849; Wed, 10 Jan 2024 11:53:40 -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 jh3-20020a05600ca08300b0040e50d82af5sm3155192wmb.32.2024.01.10.11.53.38 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 10 Jan 2024 11:53:40 -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 01/14] hw/arm/armv7m: Introduce cpudev variable in armv7m_realize() Date: Wed, 10 Jan 2024 20:53:15 +0100 Message-ID: <20240110195329.3995-2-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::429; envelope-from=philmd@linaro.org; helo=mail-wr1-x429.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 We are going to cast s->cpu as DeviceState multiple times. Add a local 'cpudev' variable to simplify code review, having a single DEVICE(s->cpu) conversion. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell --- hw/arm/armv7m.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c index 50c6c6b1f5..d239468558 100644 --- a/hw/arm/armv7m.c +++ b/hw/arm/armv7m.c @@ -277,6 +277,7 @@ static void armv7m_realize(DeviceState *dev, Error **errp) { ARMv7MState *s = ARMV7M(dev); SysBusDevice *sbd; + DeviceState *cpudev; Error *err = NULL; int i; @@ -299,6 +300,7 @@ static void armv7m_realize(DeviceState *dev, Error **errp) error_propagate(errp, err); return; } + cpudev = DEVICE(s->cpu); object_property_set_link(OBJECT(s->cpu), "memory", OBJECT(&s->container), &error_abort); @@ -356,7 +358,7 @@ static void armv7m_realize(DeviceState *dev, Error **errp) s->cpu->env.nvic = &s->nvic; s->nvic.cpu = s->cpu; - if (!qdev_realize(DEVICE(s->cpu), NULL, errp)) { + if (!qdev_realize(cpudev, NULL, errp)) { return; } @@ -426,8 +428,7 @@ static void armv7m_realize(DeviceState *dev, Error **errp) /* Wire the NVIC up to the CPU */ sbd = SYS_BUS_DEVICE(&s->nvic); - sysbus_connect_irq(sbd, 0, - qdev_get_gpio_in(DEVICE(s->cpu), ARM_CPU_IRQ)); + sysbus_connect_irq(sbd, 0, qdev_get_gpio_in(cpudev, ARM_CPU_IRQ)); memory_region_add_subregion(&s->container, 0xe000e000, sysbus_mmio_get_region(sbd, 0)); From patchwork Wed Jan 10 19:53:16 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: 761457 Delivered-To: patch@linaro.org Received: by 2002:a5d:6e02:0:b0:337:62d3:c6d5 with SMTP id h2csp2053354wrz; Wed, 10 Jan 2024 11:55:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IHGazntN1fxSvW+g7j145yg3pk7KOhxy3twJUA/MRV76ktUBGTNRRv4psIx0Ldo/t5Dim27 X-Received: by 2002:a05:620a:816:b0:783:3290:9b with SMTP id s22-20020a05620a081600b007833290009bmr152245qks.94.1704916557598; Wed, 10 Jan 2024 11:55:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704916557; cv=none; d=google.com; s=arc-20160816; b=hHKKrfk68uDJLDjy2rcwfZy9bsGANX6C7iqSVdSaN8F2+8uqEcDrAH9Ky8Ie8Lyq9p nQxvNhPQDJ/i0+jQLr8ioRP8zF/ckxmB93RQsTZaO0BBSEUj/PTfO3zMb7PdCglifF1a SKMCH/cm4bZkMy4Z2QNastZB15+RkMWi8KpdF8Z4/kUg+kdAZQVyge228ibyXRFJlgCT cNNUzJlaGI42u+bjA8WyI6NMxTggdsNOakRz+ExKl+kJNybqyVGLN7ISebVd7xb9on1D foSgD/SABU99zsLyoN5QWXbyIF34zvWtIC6u2nRl+76Bm960kO3hzE38w6UyB15iLzgm QGbg== 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=mdirajlt6qC945MCVDYIpUTSXSVbweTZjiyf2mppVOc=; fh=0Bn9ysFO5uhdOoEvdDNDnkwY7yFMuDt2XLw3k0zcWt8=; b=Pgih+W/LkSMbN6rkcV/+IjHKZcJE87zgGfnQBpWajadTgUOcXX6vXz98MhdB6wMj6X vm8THs1Js1oxOEug7XPTN5zcWf0wctVkhWeiWIXYYIcNvSJa2q+B+aiYxIpQTTJ2txDM Qqeob8kFr8PeiieQYK9BduAgFIKhjX4d/dyhVRvLQjjlrd+LReCjbjTJGDmEvfg1Vq0M ycVu8hrE5rH+Kxt4r5i/tr1NE9gtkDX6rZSjN2/AOibBSGMKvtvkQcEEjVtCZaHMUkM1 4Awd1NglEquoh4UTTBEdzbp/3P00vlYi6PegY+L7W0tPrNYR749b8VEqIz2MKekX5pk8 +Mfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FtrDxUId; 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 i21-20020a05620a405500b007832f29a421si3951674qko.361.2024.01.10.11.55.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Jan 2024 11:55:57 -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=FtrDxUId; 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 1rNeeP-0007EC-Ae; Wed, 10 Jan 2024 14:54:09 -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 1rNeeI-0007A7-7P for qemu-devel@nongnu.org; Wed, 10 Jan 2024 14:54:05 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rNeeC-0001sx-8B for qemu-devel@nongnu.org; Wed, 10 Jan 2024 14:54:00 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-40e4f71288bso24150755e9.1 for ; Wed, 10 Jan 2024 11:53:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704916428; x=1705521228; 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=mdirajlt6qC945MCVDYIpUTSXSVbweTZjiyf2mppVOc=; b=FtrDxUIdss5ih2QFqGCkUlXq15n0ZxZLNY5lfr2jCFUokq0NTr4P5pdZJZg6C0cGBi hXN0mCyxiOKppkUfvMKGPP/L4/M5tcacu1SDIDd4FuIBpIg8qhPacjcuu4Pa/LTR//DZ SKI3iHVvW8vZdmb5EZiy81qOhteLLgr74JVKpkaopyy7hHPpQP5sjuxmFr1Fj0KzoNLg XSINusudfLTwhz2yCAerLOmXxf4oEHBIW/p6D8s0gRnDD41LuDdtSY6tMz2Zj27BxIrW AS2CixolMaNad8+t39XFF6Fum3XP7cSEDYcJBM4kd0m5mL/IyY3GuYWH4LK5hko40yjh xzPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704916428; x=1705521228; 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=mdirajlt6qC945MCVDYIpUTSXSVbweTZjiyf2mppVOc=; b=eZO6O/3+Y0dttAwd94EVjBL8hDmZvtixDAKq5Kr8QsQscquIhoM1qR10bhcBzlxnjI i4xVtqoozDoZUursvh+YsNM3egMvtUStmYZljhT+ZzxMdT+bqposYkkz3vw6+Hp/ZIE6 +yTxxkPvjP45jTuuuGDqzsWJoSeg915WmXJt2jcemEH25Ufinbcf48nxbGHzGOBLlTtd sK7u58yrA/T37rgtEQgiFzNwkDThHs593+9LChLIFWZGvYX+VbKkfzazEZFdidHWdk2D v/RIsxtYfC8V1GTuwg6L6YZQX+odfCOLwg92WtTE+Li26ZPF3wv/xGOvuZkmRoXGylNy zPCg== X-Gm-Message-State: AOJu0Ywtrs2medQV6dAcizXmNZGSMSYeJubdOF7y6NRRT/acSKt0RySe MM4SQ90zVKsME6XUY8QPtF7hEDGwRBHdjXacLL86Vkm0Lag= X-Received: by 2002:a05:600c:35c9:b0:40e:4557:4d0a with SMTP id r9-20020a05600c35c900b0040e45574d0amr515035wmq.252.1704916427834; Wed, 10 Jan 2024 11:53:47 -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 k20-20020a05600c1c9400b0040e54f15d3dsm3212195wms.31.2024.01.10.11.53.45 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 10 Jan 2024 11:53:47 -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 02/14] hw/arm/armv7m: Ensure requested CPU type implements ARM_FEATURE_M Date: Wed, 10 Jan 2024 20:53:16 +0100 Message-ID: <20240110195329.3995-3-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::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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 ARMV7M container can only accept M-profile CPU types. Check requested type is valid once to allow further simplifications. Suggested-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell --- hw/arm/armv7m.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c index d239468558..8900730e53 100644 --- a/hw/arm/armv7m.c +++ b/hw/arm/armv7m.c @@ -300,6 +300,10 @@ static void armv7m_realize(DeviceState *dev, Error **errp) error_propagate(errp, err); return; } + if (!arm_feature(&s->cpu->env, ARM_FEATURE_M)) { + error_setg(errp, "armv7m: CPU must be of Cortex-M family"); + return; + } cpudev = DEVICE(s->cpu); object_property_set_link(OBJECT(s->cpu), "memory", OBJECT(&s->container), From patchwork Wed Jan 10 19:53:17 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: 761452 Delivered-To: patch@linaro.org Received: by 2002:a5d:6e02:0:b0:337:62d3:c6d5 with SMTP id h2csp2053272wrz; Wed, 10 Jan 2024 11:55:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IF2lB5msotlfJtnR1Q7/U+ylQYF1ZUB8y1RitPgGteDhpleqD/2uAn2uB/Uabet0LWpTh/g X-Received: by 2002:a05:6808:f16:b0:3bd:4cb0:22e1 with SMTP id m22-20020a0568080f1600b003bd4cb022e1mr123758oiw.114.1704916540389; Wed, 10 Jan 2024 11:55:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704916540; cv=none; d=google.com; s=arc-20160816; b=REA7KXqnIhqGgqeOSHYzeCvvCF2Sssckc6W/bRA7LEZC/gLZGSNuydHpOBu4wldACE k9H83oXFFyjuEAsKxvVuELgvw7YuFZ3eA/Z1mIHbbCyGO+Hs5o8LOcpyx96Sd6RYuUUj F6WM8SRTYo7F9JgnHxaplTLGccbUsOkhbt9apyERR6C3x8OK9hLcotKRM+ulalxGd9Dg 6ic0quxzHQwE/rqQl7+RZlhvOuMJ1IyJrLqDoUFmfA420ol25Zv0KUnAeAtC+7Puu+6+ Vh0vcTUHzm5F5g3sKBUWzI7XX6RIIzPTp6u+HOH8VONesW9sladuhrtlC1OUdffOHUCW 8u6Q== 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=znfL4d0kUd7PQLWgd/IbU4xVCADxWCmjPBLUUJRZlJU=; fh=0Bn9ysFO5uhdOoEvdDNDnkwY7yFMuDt2XLw3k0zcWt8=; b=zN0Y9mbaPfi8x0v3mfExBa4zOnSSFm++jc0GhzP8Bh3in6gBidbhGmYJbNLYLlF14F 4D43VSsJSsynrXjTXg6TU5dR8M+mvpbKY93NbN49AreO19QGQNp88+m5dC68/9lrAy6I E4iqe9ZxZzgDRq5Q0fctZmQ0LSynzRYMx/ZpwOUsvOMM8OKeeipzAI05mhDJyWRhjGJ7 yDAOx2TypX3bPWlTKKhtTr4VTXOpHl1pgGTJFjvv+03XG+v/rlRdfre3kJguhvU8aZdW 28PoVBqVaJw2fl2xB6CXypHHpRiGK0a72C9IkzcXN+HcWPHGbq4qIkWmGX64WgGdFoDV A4ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wF3rX38z; 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 x7-20020a0cc507000000b0067f31950499si5014260qvi.276.2024.01.10.11.55.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Jan 2024 11:55:40 -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=wF3rX38z; 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 1rNeeQ-0007Fm-6P; Wed, 10 Jan 2024 14:54:10 -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 1rNeeH-0007A4-PV for qemu-devel@nongnu.org; Wed, 10 Jan 2024 14:54:05 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rNeeD-0001uU-7T for qemu-devel@nongnu.org; Wed, 10 Jan 2024 14:54:00 -0500 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-40e549adb7dso17541575e9.2 for ; Wed, 10 Jan 2024 11:53:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704916434; x=1705521234; 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=znfL4d0kUd7PQLWgd/IbU4xVCADxWCmjPBLUUJRZlJU=; b=wF3rX38z1dsmSloN5abxKFipX8YVQJQI1LygNeteVgdfIsrCuw/rxjwbSHoe0eQIPi +wERr4+0vh+mNS0cu0nFjCBrwOAQTg3HqusFA9UVP9NkJfNijKnkxe8gX85SdYUMGAAK LI8JIoRIHQ0B8JNdQdvlozkMy9nEy+PJULDNILmvgwNO6BfFgcG9ue8hpLnj3RBEu+RN dtKwIhOGgBXHMOu/D7tIMGYeNBFTr6AKmm8zF7RWuf3/jW5whzU004vGI8mLREmflVM8 fhExrvcwK0p4zaCajEyGJBpus9eBVhpQDprAtDbmVDIxjE17+uO42Vmc/Oywp5O2Tknl vKZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704916434; x=1705521234; 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=znfL4d0kUd7PQLWgd/IbU4xVCADxWCmjPBLUUJRZlJU=; b=KhCP0Rt5kpv5fYLgLolz74UZ8m17f+gsVN+38ZpKHeH6ajw+73UwQ4Ldpj0saumeZp J49sdR52R+pu8qMmztpWXPvCVGRcN4y7inNOIqqWF4Q7tP20/f3YOSdDmgBqOFIG4Vn9 lSADameOKFagNhHmV8+vIblrhDxHkaFcrnR7M9yeXI8GXmSs+VkZHQ2vVHGivgNQPelm dx1TEcXiNvPZz28cpIfAlK+0ddmPX3mXpOWv3BrJZNf1QadnOuYX+o5NR5GHZMl1R0yv aWekQBVQrruEaij77yaineJKOlM5uvmkSCjJIswB5CyYabOQd+sK7vpJ8DNKinZW5PLb W51Q== X-Gm-Message-State: AOJu0YxfC0QqI0oXVejUkXF6tGtLiAVs99ooBsBKblhfQuJGuUvS6+pw 5bfz96jU/XbrJ33MXCSK0v2AYoqTjmrX/OPsNOeD/dRbIyQ= X-Received: by 2002:a1c:770b:0:b0:40e:4a5d:67df with SMTP id t11-20020a1c770b000000b0040e4a5d67dfmr856723wmi.4.1704916434808; Wed, 10 Jan 2024 11:53:54 -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 s15-20020a5d424f000000b0033743c2d17dsm5594643wrr.28.2024.01.10.11.53.52 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 10 Jan 2024 11:53:54 -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 03/14] hw/arm/armv7m: Move code setting 'start-powered-off' property around Date: Wed, 10 Jan 2024 20:53:17 +0100 Message-ID: <20240110195329.3995-4-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::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.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 Reorganize a bit by first setting properties which are not dependent of CPU features (and can not fail). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell --- hw/arm/armv7m.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c index 8900730e53..b752049add 100644 --- a/hw/arm/armv7m.c +++ b/hw/arm/armv7m.c @@ -308,6 +308,7 @@ static void armv7m_realize(DeviceState *dev, Error **errp) object_property_set_link(OBJECT(s->cpu), "memory", OBJECT(&s->container), &error_abort); + qdev_prop_set_bit(cpudev, "start-powered-off", s->start_powered_off); if (object_property_find(OBJECT(s->cpu), "idau")) { object_property_set_link(OBJECT(s->cpu), "idau", s->idau, &error_abort); @@ -334,7 +335,6 @@ static void armv7m_realize(DeviceState *dev, Error **errp) return; } } - qdev_prop_set_bit(DEVICE(s->cpu), "start-powered-off", s->start_powered_off); /* * Real M-profile hardware can be configured with a different number of From patchwork Wed Jan 10 19:53:18 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: 761455 Delivered-To: patch@linaro.org Received: by 2002:a5d:6e02:0:b0:337:62d3:c6d5 with SMTP id h2csp2053324wrz; Wed, 10 Jan 2024 11:55:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IExGKMqwf/TlkD0MmLyRKsAz6WvNVa7ye0zrE3YAi68RGnB46eE8Iy0UzhMTcIDyST51WRg X-Received: by 2002:a05:622a:20d:b0:429:bcb8:eb89 with SMTP id b13-20020a05622a020d00b00429bcb8eb89mr75454qtx.103.1704916552382; Wed, 10 Jan 2024 11:55:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704916552; cv=none; d=google.com; s=arc-20160816; b=ThXYPZJl6SU5bNCfwXWcmAEEu8Gz+UpiOhpvZdXFRERtrw+GwdKEmRAz2NKTuqTk+4 JClfOt0KXgqP4OXXs1g6zMHZOUWhPuYtUZ0ZPvFEIyFmqQv37mQTEyfwTPprmjswFdQF zEGhJY3PnwzM5/uik3QDBjcq0A5eTF7am6bat3KT/QU7LB5NveFsFaj9BjcC68RPid/c UYRSEkpUtVvypFiDVS5Jy9qin42vrMbTkej8C1qSTSjPQgOwXk6fJkjur/+f13T7Izj5 r02cE0vmuTGdIOKh3tBYYuZCmkFwrr4fC8f2pY9IdZRmtMamAuftZQHGf3n/Ym1SOma5 fcLg== 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=fOLjDR/IKNF0Xh0mudwkf1U6/g8RGHkdFKaUB2oy+80=; fh=0Bn9ysFO5uhdOoEvdDNDnkwY7yFMuDt2XLw3k0zcWt8=; b=TlmONqKlmfkV6VggH2HD3kTlO+RmbN9F2Uw0icNtdVdgq4OrqtgZQTMzNOW65a7t3O H+vvoNgmOH0sA3nyohS7WbirjQ6bGHjhqIdLdQG+NwuDt8vfX0dMu0JCAxoDwjUiQi+s knOPtQwiA64NXBGvyX5yEyUfRThavww4LiTeHQcIAuOiqa8FCOwbsn3smY9SLZoox8fD 0I/0MFXkRNlY+3b9wz1S1xWkvT4j8ljc4ZWZNdYRUERq6vLoh1IujKzSlZN025m9+OSg eTQT/WVlk20tmc6UZXyLtXeeV1494sl2GMd1Z8mBgt/g5iKMk9VAoff4SSg2GsMHJEtJ x+SA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CcLGUL5M; 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 r12-20020a05622a034c00b00429978cfecfsi4745494qtw.606.2024.01.10.11.55.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Jan 2024 11:55:52 -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=CcLGUL5M; 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 1rNeeR-0007H5-GL; Wed, 10 Jan 2024 14:54:11 -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 1rNeeM-0007CT-LZ for qemu-devel@nongnu.org; Wed, 10 Jan 2024 14:54:07 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rNeeL-00025F-3W for qemu-devel@nongnu.org; Wed, 10 Jan 2024 14:54:06 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-40e5508ecb9so17784425e9.3 for ; Wed, 10 Jan 2024 11:54:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704916441; x=1705521241; 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=fOLjDR/IKNF0Xh0mudwkf1U6/g8RGHkdFKaUB2oy+80=; b=CcLGUL5MS3BHCu1Djy1NDU0zJPL7d8j5QgqdMrg4lfD9c5hIce11HkAjNYvJI8rzI0 jwO8UeIIha7ykzWm9pq4msetSebuzyx5+ury4mSmDi0/eM89TqTFjK1iqHK0ECYV0Tks kiXzrJFIdKrtCkSCPo+95X8r+3ULNowlJYjD/HF1PUMIir1x1r+qPYKoaRt5hDlnJZbp gExq6NhudWjRjC3+Lik3P33/HuO8XsHsD0BfuLMd89l8FRu+iWc46wpq3z0yPfaYFmoi BKYlz28xPatxq5xMgobstLa8braqDjwXkVLVINHal0c5GfMESgy9nAWetfOQdDt/JrTq n+2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704916441; x=1705521241; 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=fOLjDR/IKNF0Xh0mudwkf1U6/g8RGHkdFKaUB2oy+80=; b=lN2jq1qqzMJG89MJ1xQgVfFp49IUPAs4CicYonH98cIOsPWW1hiksJkz4EzBH+QcPD Ve2XmViSDpImZ5D33Muye+r4ZD3pb6k9gwethY3Zf9uitj5Ckz1OcTTwYuJ0Ux9FKDbj XfnOll4VCDYLW6v3npkuw8dACvBuhWEDOvKCubKMGX3rr0ritrPl0D+qPsHc2acYwisY GqqZ4Gqu4vtynIBGN72uWrwiNTfa7t6sYTzvvMyIG0JH4/uaoMlRE3szZPVl13r6TyRN /2R5gKz/dgY/bIW1vZm8sMK5Je6Jffg+VFkNklkCFtSnQwdw13g4zJkWoh6CKRzO2DFO o+PA== X-Gm-Message-State: AOJu0Yw+wOXKSrScii4C2vA74147KwwheV1axkU5SbM7yf52mKrq7lzb lWGuLSyCgIKNJaBmqGnzu6ql9+P5goaIne5VAo6Ap8Cp9vY= X-Received: by 2002:a05:600c:a019:b0:40e:3fa2:213 with SMTP id jg25-20020a05600ca01900b0040e3fa20213mr939693wmb.147.1704916441650; Wed, 10 Jan 2024 11:54:01 -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 n16-20020a05600c4f9000b0040e53f24ceasm3216630wmq.16.2024.01.10.11.53.59 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 10 Jan 2024 11:54:01 -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 04/14] hw/arm/armv7m: Always set 'init-nsvtor' property for Cortex-M CPUs Date: Wed, 10 Jan 2024 20:53:18 +0100 Message-ID: <20240110195329.3995-5-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::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.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 All CPUs implementing ARM_FEATURE_M have the 'init-nsvtor' property. Since setting the property can not fail, replace object_property_set_uint(..., "init-nsvtor", ..., &error_abort); by: qdev_prop_set_uint32(..., "init-nsvtor", ...). which is a one-to-one replacement. Suggested-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell --- hw/arm/armv7m.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c index b752049add..530729f42e 100644 --- a/hw/arm/armv7m.c +++ b/hw/arm/armv7m.c @@ -309,6 +309,8 @@ static void armv7m_realize(DeviceState *dev, Error **errp) object_property_set_link(OBJECT(s->cpu), "memory", OBJECT(&s->container), &error_abort); 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")) { object_property_set_link(OBJECT(s->cpu), "idau", s->idau, &error_abort); @@ -319,12 +321,6 @@ static void armv7m_realize(DeviceState *dev, Error **errp) return; } } - if (object_property_find(OBJECT(s->cpu), "init-nsvtor")) { - if (!object_property_set_uint(OBJECT(s->cpu), "init-nsvtor", - s->init_nsvtor, errp)) { - return; - } - } if (object_property_find(OBJECT(s->cpu), "vfp")) { if (!object_property_set_bool(OBJECT(s->cpu), "vfp", s->vfp, errp)) { return; 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; From patchwork Wed Jan 10 19:53:20 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: 761448 Delivered-To: patch@linaro.org Received: by 2002:a5d:6e02:0:b0:337:62d3:c6d5 with SMTP id h2csp2053026wrz; Wed, 10 Jan 2024 11:54:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IGsOdZ2GEckVrOphmehgdZ1x/a9JCqJqLGwqsBZpZSPRY702rdjp5MY7WTLwEH9pdagggul X-Received: by 2002:a05:622a:1742:b0:429:9e14:2402 with SMTP id l2-20020a05622a174200b004299e142402mr97932qtk.41.1704916486908; Wed, 10 Jan 2024 11:54:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704916486; cv=none; d=google.com; s=arc-20160816; b=bDOx1rBeM8VpxFnmRkWeJXTXZNkmuzNsB390iSXuhMfLPnq45Kc/2T0KuPpAeK7wOg vVKeDKib5uNXfdlSIkuuTIu35jU7VyPPuKxexCEdz+OxCH7So19dxp7rlcl+8R+78FYU KrWcZWuwXy19QqKKkKvfoUASfzz3kKcNw/ylvnStMBVtcFySBhwDXMsHxvZi0b+ctLGB mWgLmmoEFD0FPCikViQggZOphssMF+2WN7sKydfK0FxrP1u9G1wviefdMAvI/OEe803v CkMaafstNn6aMaMeo//Qca0ZdCUkCgDq2hyUhC3MlSX1wtXEkHWcHhPF5fduki/TDggh N1IQ== 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=5n6b/Kfb2q1nuszk7kQnrf8+ZzcUeVpd0islGk5jF8M=; fh=0Bn9ysFO5uhdOoEvdDNDnkwY7yFMuDt2XLw3k0zcWt8=; b=Fy5Joqz65OS7vn7AsBMEERzY4/Wse960rqH/bX0YoO4HJcKiUWUZDz+N7pFnaQ+/un R7CB3Rp4P1oofzxKSeo8bFRe+M4ua68Ifffcqu+E+f7IFwOJHro+KYi9n1TQbmibNEY5 rR4NRHfbObc3PuMllZv7NThHGjQSMhWUDOCr3eGuc+X0oM0O6tF4A5J/eTcOtYCcLs3k C3CL3TRderfguKtrFwuOVH01GxFiqNnJhgzgxDRxC+JEGSZFn72rcjBnPy5lhb0sVl+I no5Yx6FPnEPXycSwaYzp7n3QQ5Rty0hY7s+54z7xwN9VN+r2SLbcnL49TQIPzw3tPx/U 5QzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=P8u2pkKU; 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 g9-20020ac85d49000000b00429836a9ca8si4739108qtx.453.2024.01.10.11.54.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Jan 2024 11:54:46 -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=P8u2pkKU; 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 1rNeeh-0007Ml-JS; Wed, 10 Jan 2024 14:54:27 -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 1rNeeb-0007La-Hr for qemu-devel@nongnu.org; Wed, 10 Jan 2024 14:54:22 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rNeeX-0002Dr-Ei for qemu-devel@nongnu.org; Wed, 10 Jan 2024 14:54:20 -0500 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-40d87df95ddso47091045e9.0 for ; Wed, 10 Jan 2024 11:54:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704916455; x=1705521255; 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=5n6b/Kfb2q1nuszk7kQnrf8+ZzcUeVpd0islGk5jF8M=; b=P8u2pkKUDm9qusYFB0hPOw9BNkL0Mjmv/0Ha9QvvByjTVDjXCg1ziuVuDb6Ritcrj9 y+iZv87SxJgQ+iIbLPazwTsDCUKLnNGHkKkPNFVn673fkaWvsKxAGqeVPTQ9E2TdcLR6 fEFhUcfo1dIZS0sfjeIrRsb1EUYHqlrkLhsu6ycoCmQumFDSeGdoZExWhjjXpzuvZ4m4 nBImjFNrpMZASrMAfHn4MueLbFEIkzBiyXogKtfyCSe56jB44wUO9pQ6/BJnrfCipYIM ZNp8tS5ZLMtV9YwEQ0811Hgqjj2GIDefLVsyHfdwoav6JfuhnuhLiUP3QH4bYSUf+G7c LFGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704916455; x=1705521255; 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=5n6b/Kfb2q1nuszk7kQnrf8+ZzcUeVpd0islGk5jF8M=; b=wkuKAIIgKMpo/PTPOPsJdYNtZsZQKR7c9KAzAzvFYPqaHtgYp6h32qZXfwBqYBIDPp 23UXShk8nhV8qT/kM8Ghh6opv6/nXaobLU5czeH0yt9LJrwyrsYwvQKdU76TbVhrOH5f VouzXNN3lPNUPuivbYFpR+h3L59CGFFhkeH01OC9ooQ+O1SVr81cHq6nd58YKbC6zMCW qgj/PSHcATqXnRCMwHridI8I77e5Zif7JsDTNBqKNtreTN63Ay0Cs6sveBEnGCRmxkHe uwH2jBPtgDItS8VOsZ1lJeTrGe96/HHnjgacjpFus1esatYTSMwGmfobqoTS/BgCg+u3 +JeQ== X-Gm-Message-State: AOJu0YwJ3Y7A4RUJvHeJg07t3mAIzN1DLh4OZIx2wCB7f6Pm8nlnm2gg FM09U01hWU744c43mZT2yJ6zBmITIk2gvryl66h9x4Pv+c8= X-Received: by 2002:a05:600c:538e:b0:40e:5cf9:9826 with SMTP id hg14-20020a05600c538e00b0040e5cf99826mr4786wmb.127.1704916455452; Wed, 10 Jan 2024 11:54:15 -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 z6-20020a05600c0a0600b0040e49045e0asm3209717wmp.48.2024.01.10.11.54.13 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 10 Jan 2024 11:54:15 -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 06/14] hw/arm: Prefer arm_feature(THUMB_DSP) over object_property_find(dsp) Date: Wed, 10 Jan 2024 20:53:20 +0100 Message-ID: <20240110195329.3995-7-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::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.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 The "dsp" property is added to ARMCPU when the ARM_FEATURE_THUMB_DSP feature is available. Rather than checking whether the QOM property is present, directly check the feature. Suggested-by: Markus Armbruster Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/armv7m.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c index 8350267d96..0a7ad2b762 100644 --- a/hw/arm/armv7m.c +++ b/hw/arm/armv7m.c @@ -321,7 +321,7 @@ static void armv7m_realize(DeviceState *dev, Error **errp) return; } } - if (object_property_find(OBJECT(s->cpu), "dsp")) { + if (arm_feature(&s->cpu->env, ARM_FEATURE_THUMB_DSP)) { if (!object_property_set_bool(OBJECT(s->cpu), "dsp", s->dsp, errp)) { return; } From patchwork Wed Jan 10 19:53: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: 761450 Delivered-To: patch@linaro.org Received: by 2002:a5d:6e02:0:b0:337:62d3:c6d5 with SMTP id h2csp2053165wrz; Wed, 10 Jan 2024 11:55:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IHJgceQuADwtjRx4PSwsdpXndnHswBEqx1KeQ8edGtnT15DjW0UFCJyFeczvWrhn1ocV3d1 X-Received: by 2002:ac8:5a49:0:b0:429:a2bc:f921 with SMTP id o9-20020ac85a49000000b00429a2bcf921mr49325qta.117.1704916519059; Wed, 10 Jan 2024 11:55:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704916519; cv=none; d=google.com; s=arc-20160816; b=W9+97cEk7nEeKplMuDeIgEmVUyfqhAD2rcRx1pPNE1EODnfYlfYv/MexPpVBOfn5TN 2oBLPj757imcOjpm3iXMeJDtOZVv2IC5T0XyaUOnkn9RurivpowuBm/PDJYH6w+66VuZ YbnziScNaSyh2hvL9+Or93h9HftssLMck2ua0fiJLCeaPM6O7HeUrR8UgEZtvcHDzzN4 bxTyZuPJ0Q4kq6z/9ta+0L0/HOOfTCOwPgtm8zHCazH3uQAYV+uGQlJx59+BA5cXMYPv aUmUSDf3g0MzQ5UKMdmHa2KLd/TZ9wJkCfN+fBioDBxNlAgRi1A3bXgjmauCkwQfqhJo oWOw== 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=4lFs+peHffZXBVVkShWxuZ7VjcO+rV+nUwkZ0/LL7Zg=; fh=0Bn9ysFO5uhdOoEvdDNDnkwY7yFMuDt2XLw3k0zcWt8=; b=hIDeYjAglTTvj74Plun1f016pDqHn94J8lyy4EasBmNf9ZGmdiOHvkqySP2qHMush1 pbe9sVhR5QdcO14l/i1Zhq1qL2ubf1qjUHBl8Y2/PbV+8mvlqE96m1HSuPAKeGvH8hyw Uc/ekGHgd7soBKBHmgYOK1JcKn4Rz51gcjLi55fY8MPOt1+tfxDlzr6hlHpRNl8qtqV2 6ctJhL+aHsLHNn3o7Yhi3Y0JxIek1t3rMPbNltfSax43I92EJhBSHyDotUmDqiXX3pWk Bjao2+cw+AMlWdJNh2Kp61A/X3/mtW1x0yzcrAELQ1WYGyhGKNsm5Nr4IvFdFtIw7YPH RHZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CI8+bOHD; 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 c8-20020ac85a88000000b00429be9d9f94si295128qtc.411.2024.01.10.11.55.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Jan 2024 11:55:19 -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=CI8+bOHD; 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 1rNeej-0007Oz-8J; Wed, 10 Jan 2024 14:54:29 -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 1rNeeh-0007Np-V8 for qemu-devel@nongnu.org; Wed, 10 Jan 2024 14:54:28 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rNeef-0002Gc-Eb for qemu-devel@nongnu.org; Wed, 10 Jan 2024 14:54:26 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-40e461c1f5bso40919675e9.3 for ; Wed, 10 Jan 2024 11:54:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704916462; x=1705521262; 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=4lFs+peHffZXBVVkShWxuZ7VjcO+rV+nUwkZ0/LL7Zg=; b=CI8+bOHDzSnLg56bZ7TGIOZlof9YHtm1bft1rKMqJh5WVPeuJyDswxW3L15kK/1iAp aRYpp7aj8hsxX8TsNdOX6sONADrxLdIP9B7TIl8EkxL6KAUXm0diYRG1yU/E/LcgxcR1 TYFVhAW+lqpHgvgdcKoYdkn21aEAEgegVd4H2HR2sW1WywQlzauIOcnS6i3LU7AwRmYq ZCazDsBu2Kz6M0UPIZ5vmUZ16ItAnUzlx7HIkODVFTqbksMsp52/fmdy8yjwe7IKgRml HFkKx/EMRs7ptklHijRiypP6mB+FuvdbhS7PjJMHb3GeiWh9WmYifdYG9va1RzN4sqdj CErw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704916462; x=1705521262; 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=4lFs+peHffZXBVVkShWxuZ7VjcO+rV+nUwkZ0/LL7Zg=; b=julp2aa8wLiLeit4w1D6vW7xDB3IGT5r+NZimX2vTT4BNwm96E6XXmCFwut051oNSh lshGmACWZ5TNBVMxKLrTIDhYL/AySDl3/2JDlv/wspaJdQ56rpa2Krq/N21CVC3KnSl/ 5XT5/Ef8RhI+05ZUZCYhFNup96IaleJtaE6SyMcNefJgr2A2T5jgXghp35OLwIvrsqWi u55+myXbzByWpCZ4KqjeVt1DRR95iIUvJIsHbvVZ4GYltbDXnxBa7FASYy+N1bHaPXtr Zvzy0qLYAJxNTvNLWP7q9oh6DTB5rNdMQX8tekpcB5CWywCu+9QCXh7LPN4SLwqg86x+ Na3Q== X-Gm-Message-State: AOJu0Yww1ZstiqnLBn7zr6J/aw5kvq8Kf1QAfTuuXhR5pjtx+mb50Cxq cw/fCS8h+JjzkWo4HLnrmcIOz9fKLifPVGbpdOkzbmzLzDA= X-Received: by 2002:a05:600c:225a:b0:40e:480a:cfa3 with SMTP id a26-20020a05600c225a00b0040e480acfa3mr827220wmm.61.1704916462415; Wed, 10 Jan 2024 11:54:22 -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 bg3-20020a05600c3c8300b0040d91fa270fsm3245344wmb.36.2024.01.10.11.54.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 10 Jan 2024 11:54:22 -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 07/14] hw/arm: Prefer arm_feature(V7) over object_property_find(pmsav7-dregion) Date: Wed, 10 Jan 2024 20:53:21 +0100 Message-ID: <20240110195329.3995-8-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::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.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 The "pmsav7-dregion" property is added to ARMCPU when the ARM_FEATURE_V7 feature is available. Rather than checking whether the QOM property is present, directly check the feature. Suggested-by: Markus Armbruster Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/armv7m.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c index 0a7ad2b762..7f15318ae3 100644 --- a/hw/arm/armv7m.c +++ b/hw/arm/armv7m.c @@ -338,8 +338,8 @@ static void armv7m_realize(DeviceState *dev, Error **errp) "mpu-ns-regions and mpu-s-regions properties must have the same value"); return; } - if (s->mpu_ns_regions != UINT_MAX && - object_property_find(OBJECT(s->cpu), "pmsav7-dregion")) { + if (s->mpu_ns_regions != UINT_MAX && arm_feature(&s->cpu->env, + ARM_FEATURE_V7)) { if (!object_property_set_uint(OBJECT(s->cpu), "pmsav7-dregion", s->mpu_ns_regions, errp)) { return; From patchwork Wed Jan 10 19:53:22 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: 761456 Delivered-To: patch@linaro.org Received: by 2002:a5d:6e02:0:b0:337:62d3:c6d5 with SMTP id h2csp2053347wrz; Wed, 10 Jan 2024 11:55:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IG0ChaE+u5CqZubMux3/Rtqu5ZrKlrt8V3OMsTbB4gBunycGofMPYQGy2C+xPy71HD4W2+8 X-Received: by 2002:a25:ce93:0:b0:dbc:b8ad:a056 with SMTP id x141-20020a25ce93000000b00dbcb8ada056mr152219ybe.53.1704916556538; Wed, 10 Jan 2024 11:55:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704916556; cv=none; d=google.com; s=arc-20160816; b=C9+kLKYvcdqMqSb8gLeMuEAAGPeIo+M6fHAgKsincg2il7WHGTi8iysigH64mwAUvy 3onjnMWDu8mz3jFVtdOLww5QH5ggoXyYbT3WuP2EXV80l8KOp9P1HoEVczTbFmMS11zi Y/BcFmxIiCL/V4NqcMQFFPNi539UpkLmqrSjDUpuUbI9VIEw0FSWfndV3ymBG9THOTf+ iVen7jhtHgOi9OgQL0Ig7+sgfkVtqSa4VTl4jDSll2iFK1T7x7SxQY39lBHl7Y/6bfbg WCsWb2aX2kmHjVMYaRzfywNISmkEYbySdsgpx7h5Lx4AZ7sgjwzIsX4AuRTSzqFbkD9u G2CA== 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=OowX4efGlp2L11zIDE/JPwBjb6bv53ZLeGSFw+1liNI=; fh=0Bn9ysFO5uhdOoEvdDNDnkwY7yFMuDt2XLw3k0zcWt8=; b=M+Jk20m5whhC9cbt8lCtNqDqGcKmxMZjuOZT0G3TiMAPf1h5mhdOLjywtvAj09pe2A 2JKQQGpDvNmj5OlvKRNGiIy8oPwfa+M+440MlPbmfhSskSD5KlDVASTbCFD8T0QcmoTX /3shSw7OOcuXDdx2djjYxUiKcrMNXysdQjuvy6ify+cD0eKKTbLx+x9aoUzlksOuUscq EXjSuAa9w1NNx/Fj4LyC1d/sGPFqdUpR6FM+nA8P9ljCiHQpXh4MB9F0JYSPRBaeEhvY T0G6TtFPVoz93qcZWpH7cTtvdbWrUqgVqi6gijc9tTVME4gXNqlctjSdFwVHWXKrcD3k 7gQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oLscmG8x; 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 f6-20020ac85d06000000b004297dfc4920si5048260qtx.588.2024.01.10.11.55.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Jan 2024 11:55:56 -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=oLscmG8x; 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 1rNeeq-0007qz-K8; Wed, 10 Jan 2024 14:54:36 -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 1rNeen-0007Zs-DH for qemu-devel@nongnu.org; Wed, 10 Jan 2024 14:54:33 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rNeel-0002Mw-9Z for qemu-devel@nongnu.org; Wed, 10 Jan 2024 14:54:32 -0500 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-3374e332124so3641910f8f.2 for ; Wed, 10 Jan 2024 11:54:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704916469; x=1705521269; 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=OowX4efGlp2L11zIDE/JPwBjb6bv53ZLeGSFw+1liNI=; b=oLscmG8xYLmDR3xZC9UGHIBAd/A/5v4x6KhvbReF5J3Z0z7WBbSolwRjFVA5m1tX7t t0j40DM93z6hrYCt35bb3yVyMcR6TxFozvfBekw4/G5aznJ935IJVuyjDrz65k7SNvs3 Qbjfjv9iXiHcD1zsq1GyvAI5vsyjOXU4LFL02TeMun/V4zNvpHizMgZZuN01Oe2alRML 3yIDMoZfjTWJ8C0BsWYohSxHYkm9+o621TwzMfYN/wRIscZQEjlhTp3beQ0ne78intD6 z5HWjY3+zKgQCOWJyCmE7YFJPPv74tpgkkGrwOeu5oMbYNJRMxkBO+4VnZS2+kkg5FMC zDgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704916469; x=1705521269; 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=OowX4efGlp2L11zIDE/JPwBjb6bv53ZLeGSFw+1liNI=; b=AUznf9+yCDGrwKpzr/sDxzEGOu7mDn32W0M8Lo+s0UEb1wossa91SdzQeRVejDpoyQ 4WmK0LLLSbpDiMWrk5wz6nn1AZZDSkKGyCHx1cY6WCAaZSU4m3cBFfLysLtO64PwbigV CkYvWenbdaMkJYP+ZxYqxE3CS5wV7UC/6AnKYnhF0X/yPJlv48KhEktmBNkKDrjQXycY +MBlugGHCnTQ2bqXAOur2ZxIKcny+EBSTxlCidoQyzyICGkpQa12vgdvg4qQ39VQuTb0 A/J2YqWhoP6p/4SDOm6WjzPFtUcq6mjD8FYTXMFu/KagvdmwJ78qx1RGyy7huUxucDZJ ftmw== X-Gm-Message-State: AOJu0YwDc20B40Scj5ULBa862AsxCu/Fn9D7XexrsPER3ox9eD/+IfGR hfolikLn9x2LnKnsikCd53FGBzN9o8hLBTfnQNKsugdeI1Q= X-Received: by 2002:a5d:5150:0:b0:337:6f4a:1238 with SMTP id u16-20020a5d5150000000b003376f4a1238mr3581wrt.103.1704916469496; Wed, 10 Jan 2024 11:54:29 -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 c6-20020adfed86000000b00336751cd4ebsm5631000wro.72.2024.01.10.11.54.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 10 Jan 2024 11:54:29 -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 08/14] hw/arm: Prefer arm_feature(EL3) over object_property_find(has_el3) Date: Wed, 10 Jan 2024 20:53:22 +0100 Message-ID: <20240110195329.3995-9-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::434; envelope-from=philmd@linaro.org; helo=mail-wr1-x434.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 "has_el3" property is added to ARMCPU when the ARM_FEATURE_EL3 feature is available. Rather than checking whether the QOM property is present, directly check the feature. Suggested-by: Markus Armbruster Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/exynos4210.c | 4 ++-- hw/arm/integratorcp.c | 5 ++--- hw/arm/realview.c | 2 +- hw/arm/versatilepb.c | 5 ++--- hw/arm/xilinx_zynq.c | 2 +- hw/cpu/a15mpcore.c | 14 +++++++++----- hw/cpu/a9mpcore.c | 9 +++++---- 7 files changed, 22 insertions(+), 19 deletions(-) diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c index de39fb0ece..5efaa538cd 100644 --- a/hw/arm/exynos4210.c +++ b/hw/arm/exynos4210.c @@ -554,14 +554,14 @@ static void exynos4210_realize(DeviceState *socdev, Error **errp) for (n = 0; n < EXYNOS4210_NCPUS; n++) { Object *cpuobj = object_new(ARM_CPU_TYPE_NAME("cortex-a9")); + s->cpu[n] = ARM_CPU(cpuobj); /* By default A9 CPUs have EL3 enabled. This board does not currently * support EL3 so the CPU EL3 property is disabled before realization. */ - if (object_property_find(cpuobj, "has_el3")) { + if (arm_feature(&s->cpu[n]->env, ARM_FEATURE_EL3)) { object_property_set_bool(cpuobj, "has_el3", false, &error_fatal); } - s->cpu[n] = ARM_CPU(cpuobj); object_property_set_int(cpuobj, "mp-affinity", exynos4210_calc_affinity(n), &error_abort); object_property_set_int(cpuobj, "reset-cbar", diff --git a/hw/arm/integratorcp.c b/hw/arm/integratorcp.c index 1830e1d785..7685527eb2 100644 --- a/hw/arm/integratorcp.c +++ b/hw/arm/integratorcp.c @@ -596,19 +596,18 @@ static void integratorcp_init(MachineState *machine) int i; cpuobj = object_new(machine->cpu_type); + cpu = ARM_CPU(cpuobj); /* By default ARM1176 CPUs have EL3 enabled. This board does not * currently support EL3 so the CPU EL3 property is disabled before * realization. */ - if (object_property_find(cpuobj, "has_el3")) { + if (arm_feature(&cpu->env, ARM_FEATURE_EL3)) { object_property_set_bool(cpuobj, "has_el3", false, &error_fatal); } qdev_realize(DEVICE(cpuobj), NULL, &error_fatal); - cpu = ARM_CPU(cpuobj); - /* ??? On a real system the first 1Mb is mapped as SSRAM or boot flash. */ /* ??? RAM should repeat to fill physical memory space. */ /* SDRAM at address zero*/ diff --git a/hw/arm/realview.c b/hw/arm/realview.c index 132217b2ed..433fe72ced 100644 --- a/hw/arm/realview.c +++ b/hw/arm/realview.c @@ -123,7 +123,7 @@ static void realview_init(MachineState *machine, * does not currently support EL3 so the CPU EL3 property is disabled * before realization. */ - if (object_property_find(cpuobj, "has_el3")) { + if (arm_feature(&cpu->env, ARM_FEATURE_EL3)) { object_property_set_bool(cpuobj, "has_el3", false, &error_fatal); } diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c index 4b2257787b..1969bb4608 100644 --- a/hw/arm/versatilepb.c +++ b/hw/arm/versatilepb.c @@ -208,19 +208,18 @@ static void versatile_init(MachineState *machine, int board_id) } cpuobj = object_new(machine->cpu_type); + cpu = ARM_CPU(cpuobj); /* By default ARM1176 CPUs have EL3 enabled. This board does not * currently support EL3 so the CPU EL3 property is disabled before * realization. */ - if (object_property_find(cpuobj, "has_el3")) { + if (arm_feature(&cpu->env, ARM_FEATURE_EL3)) { object_property_set_bool(cpuobj, "has_el3", false, &error_fatal); } qdev_realize(DEVICE(cpuobj), NULL, &error_fatal); - cpu = ARM_CPU(cpuobj); - /* ??? RAM should repeat to fill physical memory space. */ /* SDRAM at address zero. */ memory_region_add_subregion(sysmem, 0, machine->ram); diff --git a/hw/arm/xilinx_zynq.c b/hw/arm/xilinx_zynq.c index dbb9793aa1..33e57dceef 100644 --- a/hw/arm/xilinx_zynq.c +++ b/hw/arm/xilinx_zynq.c @@ -198,7 +198,7 @@ static void zynq_init(MachineState *machine) * currently support EL3 so the CPU EL3 property is disabled before * realization. */ - if (object_property_find(OBJECT(cpu), "has_el3")) { + if (arm_feature(&cpu->env, ARM_FEATURE_EL3)) { object_property_set_bool(OBJECT(cpu), "has_el3", false, &error_fatal); } diff --git a/hw/cpu/a15mpcore.c b/hw/cpu/a15mpcore.c index bfd8aa5644..afe3897901 100644 --- a/hw/cpu/a15mpcore.c +++ b/hw/cpu/a15mpcore.c @@ -53,7 +53,6 @@ static void a15mp_priv_realize(DeviceState *dev, Error **errp) DeviceState *gicdev; SysBusDevice *busdev; int i; - bool has_el3; bool has_el2 = false; Object *cpuobj; @@ -62,13 +61,18 @@ static void a15mp_priv_realize(DeviceState *dev, Error **errp) qdev_prop_set_uint32(gicdev, "num-irq", s->num_irq); if (!kvm_irqchip_in_kernel()) { + CPUState *cpu; + /* Make the GIC's TZ support match the CPUs. We assume that * either all the CPUs have TZ, or none do. */ - cpuobj = OBJECT(qemu_get_cpu(0)); - has_el3 = object_property_find(cpuobj, "has_el3") && - object_property_get_bool(cpuobj, "has_el3", &error_abort); - qdev_prop_set_bit(gicdev, "has-security-extensions", has_el3); + cpu = qemu_get_cpu(0); + cpuobj = OBJECT(cpu); + if (arm_feature(cpu_env(cpu), ARM_FEATURE_EL3)) { + qdev_prop_set_bit(gicdev, "has-security-extensions", + object_property_get_bool(cpuobj, "has_el3", + &error_abort)); + } /* Similarly for virtualization support */ has_el2 = object_property_find(cpuobj, "has_el2") && object_property_get_bool(cpuobj, "has_el2", &error_abort); diff --git a/hw/cpu/a9mpcore.c b/hw/cpu/a9mpcore.c index d03f57e579..3e1fef149f 100644 --- a/hw/cpu/a9mpcore.c +++ b/hw/cpu/a9mpcore.c @@ -52,7 +52,6 @@ static void a9mp_priv_realize(DeviceState *dev, Error **errp) SysBusDevice *scubusdev, *gicbusdev, *gtimerbusdev, *mptimerbusdev, *wdtbusdev; int i; - bool has_el3; CPUState *cpu0; Object *cpuobj; @@ -81,9 +80,11 @@ static void a9mp_priv_realize(DeviceState *dev, Error **errp) /* Make the GIC's TZ support match the CPUs. We assume that * either all the CPUs have TZ, or none do. */ - has_el3 = object_property_find(cpuobj, "has_el3") && - object_property_get_bool(cpuobj, "has_el3", &error_abort); - qdev_prop_set_bit(gicdev, "has-security-extensions", has_el3); + if (arm_feature(cpu_env(cpu0), ARM_FEATURE_EL3)) { + qdev_prop_set_bit(gicdev, "has-security-extensions", + object_property_get_bool(cpuobj, "has_el3", + &error_abort)); + } if (!sysbus_realize(SYS_BUS_DEVICE(&s->gic), errp)) { return; From patchwork Wed Jan 10 19:53:23 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: 761447 Delivered-To: patch@linaro.org Received: by 2002:a5d:6e02:0:b0:337:62d3:c6d5 with SMTP id h2csp2053021wrz; Wed, 10 Jan 2024 11:54:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IHaiXAPlcQo89fjguPUJ/KqtuWtFRzNIkNSr6+BM648KhQgHN7wHWjbF8NWFQDLdNyEQ/JV X-Received: by 2002:a05:6214:301e:b0:681:127f:8369 with SMTP id ke30-20020a056214301e00b00681127f8369mr7587qvb.35.1704916486092; Wed, 10 Jan 2024 11:54:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704916486; cv=none; d=google.com; s=arc-20160816; b=F3zGqj+2bJKGA6pDzF71QwiR3lJRFwfjGMLConfikNiZ5/M77RFQ6pyMPP+U7P8YnT /kAHtLawrNnTBVFewfWVjR5rQ29ooXqMb6w1ZTVAtX+3eu/xVirqZHCmDcjHbJfFfEB3 /qs/vOwB8nkyNcJYRN8JsEIjEpIRud2OdULcNfP1pAu1r0hL5yPsM7lWcgoxjdhk+gnt 8wztHt4VsoD9bc/nk+IoCJ9XPnf3M25WFKmZ1agNafGmEqB8Zk0Kz8CDmHYiJgIbUPSr 6wdcRODj5Yk1ClFL/flv9pk/XHzEif9M3hoKfcw3zCAgQtn01nGHZ2U5zhFufhYAIPtT /C9g== 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=2aLkQ6Ut0DrpuWjeMaf8bgkuaiZex3z3XI0gOydKSEI=; fh=0Bn9ysFO5uhdOoEvdDNDnkwY7yFMuDt2XLw3k0zcWt8=; b=aOWhlvPjAvRwlTWufr2mmTHeGwTFIQ9wdf0HGonu7RCc0gnmf7WvMMssoK5T2EAawx Szfx8VbIThdGkaHIBXOwaOhZ+LH/4EO8uhDABgtXU6DYylgAOIjjQtMGL1LVg7hVbo1R LctB+G58SuXjB/BvD8AZJG8KF9bufPLVWGop5NditUtEQWS2TB+r0t8Mtdsm2hyOJWjk IjWZ9PS1z6fWM9YASDylUy43u4jEPtfyi8eG0SEX95AkdkN3TZ8lEL+4cZ8kM/xkw+Wq Bxm3dGU6mXfcMd/fGXOr0M7PWgsWmr8iZ+8BYi8kXNWNf1wudgXEveriyGwhL83ea2lc P36Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="M9s/nf1n"; 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 oo3-20020a05620a530300b00781c523ebfasi4439809qkn.93.2024.01.10.11.54.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Jan 2024 11:54:46 -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="M9s/nf1n"; 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 1rNeew-0000QH-PS; Wed, 10 Jan 2024 14:54:42 -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 1rNeeu-0008Se-Cu for qemu-devel@nongnu.org; Wed, 10 Jan 2024 14:54:40 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rNees-0002TT-If for qemu-devel@nongnu.org; Wed, 10 Jan 2024 14:54:40 -0500 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-40e4d515cdeso26627585e9.1 for ; Wed, 10 Jan 2024 11:54:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704916476; x=1705521276; 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=2aLkQ6Ut0DrpuWjeMaf8bgkuaiZex3z3XI0gOydKSEI=; b=M9s/nf1nMpIU3t5O5i6mBaKfW4RnMdTuo4w8N0xJCe/8PedQHllF2y+be3LAEt+V2G UPwE896s2tqPYmUXlC+7ifcHRFReei2zygSIucksMA5SX4YXKggCrNESbJwNX2IIFF6S M4oGdZp+uuMWoBNkv/URqdlbpqCacAtFte/V4KKGt3mN0O8lQQLlder9WygGPy8uNxzF V23O+oK8+FdOSafpOXX0Jlw+iDiA+65POjR1jT1wSZO4ixwMMnLjsZyljfYm8hA2NPIb 5HjDJavOwNntjpMXYERGqsVpDDw3tH57lRq9MnE8PnWGdlAll7FeWvCo9NfljJZ5xyIT 41Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704916476; x=1705521276; 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=2aLkQ6Ut0DrpuWjeMaf8bgkuaiZex3z3XI0gOydKSEI=; b=bjPEsUNr9WRIcWxgGhBRcDNmFdcLjda1/7Mn1Vdi0EZGPhBj2guKV4JfdZQTFl1wXw JGVMaa6g8H3do2qbioxPr1mypROgbakuRXKzHEx8ECI3ClrwbH22oC46CZxNseLGaLRp 2XqBmuJALpBqBSJy8HfP1o2Qdc0e+FtNaSMFdZzLI2o+OkWnYrAe6yZU/BzWJ+p6ORaN BGCjwgcoYUVnf1VuVx5uEm8hmp3/I/1CsPiacPj7c4WbNcM6LHwYKYuaVL1D0ImtnT70 PrdFW3kbGZ5gd4aNQeZhaxjbcxufBw1wrnrxOaxUwPc1As8n9taqPN6Ubvx+oaCrngEI 5eOg== X-Gm-Message-State: AOJu0YyTppRal3MVRPjmFs3ghtK/+AWsVMZ+73ed1t9vAK6ewbeBGs2V CBVKvjIGJFINuw1AYX0eCKKSc+UuM8NQsy65fK4faRguu5Y= X-Received: by 2002:a05:600c:500e:b0:40e:47c2:1b5a with SMTP id n14-20020a05600c500e00b0040e47c21b5amr860534wmr.4.1704916476525; Wed, 10 Jan 2024 11:54:36 -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 fc19-20020a05600c525300b0040d839e7bb3sm3267484wmb.19.2024.01.10.11.54.34 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 10 Jan 2024 11:54:36 -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 09/14] hw/arm: Prefer arm_feature(EL2) over object_property_find(has_el2) Date: Wed, 10 Jan 2024 20:53:23 +0100 Message-ID: <20240110195329.3995-10-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::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.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 "has_el2" property is added to ARMCPU when the ARM_FEATURE_EL2 feature is available. Rather than checking whether the QOM property is present, directly check the feature. Suggested-by: Markus Armbruster Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/vexpress.c | 3 ++- hw/arm/virt.c | 2 +- hw/cpu/a15mpcore.c | 9 ++++++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c index fd981f4c33..753a645c05 100644 --- a/hw/arm/vexpress.c +++ b/hw/arm/vexpress.c @@ -218,12 +218,13 @@ static void init_cpus(MachineState *ms, const char *cpu_type, /* Create the actual CPUs */ for (n = 0; n < smp_cpus; n++) { Object *cpuobj = object_new(cpu_type); + ARMCPU *cpu = ARM_CPU(cpuobj); if (!secure) { object_property_set_bool(cpuobj, "has_el3", false, NULL); } if (!virt) { - if (object_property_find(cpuobj, "has_el2")) { + if (arm_feature(&cpu->env, ARM_FEATURE_EL2)) { object_property_set_bool(cpuobj, "has_el2", false, NULL); } } diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 2793121cb4..35eb01a3dc 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -2146,7 +2146,7 @@ static void machvirt_init(MachineState *machine) object_property_set_bool(cpuobj, "has_el3", false, NULL); } - if (!vms->virt && object_property_find(cpuobj, "has_el2")) { + if (!vms->virt && arm_feature(cpu_env(cs), ARM_FEATURE_EL2)) { object_property_set_bool(cpuobj, "has_el2", false, NULL); } diff --git a/hw/cpu/a15mpcore.c b/hw/cpu/a15mpcore.c index afe3897901..7e456375e3 100644 --- a/hw/cpu/a15mpcore.c +++ b/hw/cpu/a15mpcore.c @@ -74,9 +74,12 @@ static void a15mp_priv_realize(DeviceState *dev, Error **errp) &error_abort)); } /* Similarly for virtualization support */ - has_el2 = object_property_find(cpuobj, "has_el2") && - object_property_get_bool(cpuobj, "has_el2", &error_abort); - qdev_prop_set_bit(gicdev, "has-virtualization-extensions", has_el2); + has_el2 = arm_feature(cpu_env(cpu), ARM_FEATURE_EL2); + if (has_el2) { + qdev_prop_set_bit(gicdev, "has-virtualization-extensions", + object_property_get_bool(cpuobj, "has_el2", + &error_abort)); + } } if (!sysbus_realize(SYS_BUS_DEVICE(&s->gic), errp)) { 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); From patchwork Wed Jan 10 19:53:25 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: 761449 Delivered-To: patch@linaro.org Received: by 2002:a5d:6e02:0:b0:337:62d3:c6d5 with SMTP id h2csp2053086wrz; Wed, 10 Jan 2024 11:55:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IEoLPinwjn+EJb6obyOIfldEJ8pCWoVFqwlvcbUS0Rj/mnrqCtmpS2vu92l8uVBboY3/Ldu X-Received: by 2002:a05:6830:2aac:b0:6dc:10f:8da0 with SMTP id s44-20020a0568302aac00b006dc010f8da0mr178735otu.63.1704916502483; Wed, 10 Jan 2024 11:55:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704916502; cv=none; d=google.com; s=arc-20160816; b=KSSZJ6wbKInqnXMv7cXARGL9rPWUOtPdRxyxiOAl1f4w2TkRwmStYfONARVz3D2kL9 LX/QJDUseTV5/zBPkF3wpyePFXULQpW5sen2YRIk+wn5XBcWZGRHyzbNWT3VUht37N1j oeriWM82gSZwVK5SqefA9w82ZXVS66HQksxo0sZ9K0fT2sldt5O4KHeMrxJChTX7OR32 I7PPNaAGdtwAPjJWntQ9DM8POyRAW1zCuDm5RuDxx02WCWAds68LBfA59RW2iMj//lna CetdOYKfa3OOD8NE+qI2u243tL5rX/ztED48wA7aDijH6TLO6SuyiSNwYNeEkNKf5bPF gF9g== 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=6/Hk2SmJl7pABngKVtRs+8Jo9OKAAK/e6Yxa8zZeHcw=; fh=0Bn9ysFO5uhdOoEvdDNDnkwY7yFMuDt2XLw3k0zcWt8=; b=pQ2YKq/T+RfbGC3BE3/whTGfV0++LPzIxMi6+OLIkgbUkrxEP/f3vHuBJHZmIJQnvY TEgwI8xMgvy4HriTBY5PdRJ1ZOfNb2SV8QZA0jjSg8jmQLqT8vVpgkqg5uF9gVNQz8mj c8BFSs0GTcUSZQZcORcwSIcHaJ8me6u0qBrGt6i2jUO3RK+wAR+XvXwwvY3ksHgjyqbj CRGS3BKIkCPYpNWxGlvyUOwoqk8zbB40LfX+Qx3/SjI7CLlQHXJvkGm9FxqlKT2SGdHa KAYjTqsTDRqevN6ZEHTp53L+IeXXARizzEHjxGMnTgrDas3VRsxAgpbdstTFIFuLO5Ia ibrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=quuyPhhe; 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 4-20020ac85904000000b0042991c9e3c9si4900659qty.423.2024.01.10.11.55.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Jan 2024 11:55:02 -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=quuyPhhe; 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 1rNef9-0001pO-JZ; Wed, 10 Jan 2024 14:54:55 -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 1rNef7-0001gj-MF for qemu-devel@nongnu.org; Wed, 10 Jan 2024 14:54:53 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rNef6-0002dB-1X for qemu-devel@nongnu.org; Wed, 10 Jan 2024 14:54:53 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-40e5508ecb9so17794965e9.3 for ; Wed, 10 Jan 2024 11:54:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704916490; x=1705521290; 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=6/Hk2SmJl7pABngKVtRs+8Jo9OKAAK/e6Yxa8zZeHcw=; b=quuyPhheOx7P2sVv5vBD7IAouYsfyt119BXc7g8v2AqoTdORDHzSTZvUU/zn3fKVYw 03HrO1SyGBdQQKIRdGnuSu0COF3eq17EBr5TKmbBAWfqj+2mWryKcZF5C8mlqm0XD8Vv 0fmPJqhyp4kMZ4vIsyWa8WpXdCUIpZXZAFdVFcjKLj449O7d6u4Zc1VSvupP6w/P2RxY XD3mjiPVwtXbYE+oZWU+0eopzZxHZf6K1phZ8U6murfd8T+TlwytR0vbFVQsW1oNviMr KWqfUYUK3/rBTjxkk6Jqf00VC5yH91dJ5OY2GgqxmUDHWgJ3tJDtCtxB/3bOsP88/cyw 0tAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704916490; x=1705521290; 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=6/Hk2SmJl7pABngKVtRs+8Jo9OKAAK/e6Yxa8zZeHcw=; b=xFHPfBvMcNAEvWv/HyV/VzauCKkEeWcF8jVcXyBlSN6Mcid4GxhhIAznynX7jJ6TJN KO+OQuFuFwTlfZfTxaUGPM78DGHVzmMgUt12LlWQ8kMeeHdnCHdKydLX3yMZH77/wdCL /6/V11xVUgLq75El7q7m9pOY+BBbL+QkI77MOPkCTjm0AbcUpbNU7ggGzxDMRtWZCuJ3 coDMuct3eZLQilKI7s8ugShz9jr0dz5ukt0tf3FKR2GGnCqRW3hFTv28jCfg8t/rUl/A 0DJY1HxTpxk/Rp9H1X4MUnmcjVeVrkN5nUKT5Xh7n/8HAfXSU10Do6b5vFoJJ4MR6a6k ZNCA== X-Gm-Message-State: AOJu0Yzq5Tt/BQA5eIX82C1hBAHUSdo8RhyT/RCQKVHsxbUW5Vel5zpt nig4WZRZyw9k4f4nRclV9EA4SbRO6ZCSzuEp4jhSZQ/esFo= X-Received: by 2002:a05:600c:2102:b0:40e:5598:be43 with SMTP id u2-20020a05600c210200b0040e5598be43mr984802wml.29.1704916490381; Wed, 10 Jan 2024 11:54:50 -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 n10-20020a5d420a000000b0033719111458sm5550921wrq.36.2024.01.10.11.54.48 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 10 Jan 2024 11:54:50 -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 11/14] hw/arm: Prefer arm_feature(PMU) over object_property_find(pmu) Date: Wed, 10 Jan 2024 20:53:25 +0100 Message-ID: <20240110195329.3995-12-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::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.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 "pmu" property is added to ARMCPU when the ARM_FEATURE_PMU feature is available. Rather than checking whether the QOM property is present, directly check the feature. Suggested-by: Markus Armbruster Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/virt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 7e7350fec2..6d1cb24a6e 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -2160,7 +2160,7 @@ static void machvirt_init(MachineState *machine) object_property_set_bool(cpuobj, "kvm-steal-time", false, NULL); } - if (vmc->no_pmu && object_property_find(cpuobj, "pmu")) { + if (arm_feature(cpu_env(cs), ARM_FEATURE_PMU) && vmc->no_pmu) { object_property_set_bool(cpuobj, "pmu", false, NULL); } From patchwork Wed Jan 10 19:53:26 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: 761453 Delivered-To: patch@linaro.org Received: by 2002:a5d:6e02:0:b0:337:62d3:c6d5 with SMTP id h2csp2053290wrz; Wed, 10 Jan 2024 11:55:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IHR/PoPWz774uqeWlked0h9hchOb+OkLagu8LlzFFU56KyVK5TLVswdTZQJwx0c0bkxf8GQ X-Received: by 2002:a05:690c:fc9:b0:5f6:b57e:5e62 with SMTP id dg9-20020a05690c0fc900b005f6b57e5e62mr193946ywb.56.1704916545560; Wed, 10 Jan 2024 11:55:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704916545; cv=none; d=google.com; s=arc-20160816; b=AyCJRwCGWR/0UV7B/aRXo2qW7gDtvXfBIDSKDcjwASbvpmMTDvPQLAUDe1GVFPZJ+u Tsw+9rF3LjJrk/KhhRkpjivaNZrYrhTxpuh+zkAVN1LgMsIhPy5bOz6XcswO3opovSuE IotO4uKqzE4CyvObWzd+Zy/x5Pvnb7NYZq2zevhWrRVVgj3Hba+DWEFvtlaPd4Rxw174 YREkr7KUfDU5xBUNGWQx3o4GJ6EVP93IFF78t47nsqtGapQkvL3IdzGyN/QD4i5U0QHG E0Hl7Hqhh/4Cn/GsvGntItVSSi6KcproRpDh5pCfXvLPxYkIdzLw6NAguG9vIJkl6CQW pDyw== 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=H2YEvqYxr1jwORUy1H416YdJDByH1Bti5dkUqmMcrho=; fh=0Bn9ysFO5uhdOoEvdDNDnkwY7yFMuDt2XLw3k0zcWt8=; b=CtTAkEdtCTqX0rDHjJWsQN923ePjfAZD+0YFZiwmhFVuI77RiJFgVHeKIn9cTPYHA8 oPNVUB5xmq8w+3l7sFxzXYZTxu2p1bpU70rK5yhlk3znwI++ziYA//8qGWfKnoLXoz4f aLUsYA+xuyKvCn1zqiMQkaF3keokICZQzZOA8JbAmmx2gbdNBs75wGFAcow/TkiBPGPC xqCpZXg9dVyD3QJqVJIZGh80jdrDis4bgoA2fRDML+Klk5G8M55T8fznZEl58Pme4ylG NJrgzuZ1+0sqlSBJOVm+GpW/4eRoKd0LMD/iS7xo1+AhKRm01bdZMWPbMTU/GCJwphtL De9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SNPeznJK; 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 pj5-20020a05620a1d8500b0078328b79d39si4595925qkn.427.2024.01.10.11.55.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Jan 2024 11:55:45 -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=SNPeznJK; 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 1rNefL-00027Q-T7; Wed, 10 Jan 2024 14:55:08 -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 1rNefE-00021X-KA for qemu-devel@nongnu.org; Wed, 10 Jan 2024 14:55:00 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rNefD-0002ig-0f for qemu-devel@nongnu.org; Wed, 10 Jan 2024 14:55:00 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-40b5155e154so58940585e9.3 for ; Wed, 10 Jan 2024 11:54:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704916497; x=1705521297; 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=H2YEvqYxr1jwORUy1H416YdJDByH1Bti5dkUqmMcrho=; b=SNPeznJKdn3spxrTaB/AgPVwyQuPeNcrCnHPi81o/HfLc+xiYhsQz5fp3uGPXTBA3d uBmkj3nyh6b/YGz1f034feoQCOvVxWKe7dIOsu7yJMCzAi3rxHN7d5G+AOneAQBMdZFU w/75oQumnLZJRzBMfFD/nS6w8luD02RdEuQBBAS0mCZfGe6+AVrpK1JNsHrdPB10khIo hj3mfjCTt5Qbd/5F0m+uJ+9yzBvlBHwYWiyz256VPSgSEVHn6ZWeR0rDrthgFxpbGG4d 9xlxbE156JeIlv+SXcHfKQtBEYgPFljSSiFX/kEw4WsK13UYprGKhO4WPIOkDQ3BnNfU kdRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704916497; x=1705521297; 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=H2YEvqYxr1jwORUy1H416YdJDByH1Bti5dkUqmMcrho=; b=raPBtt5OczUEwVZDyTFYrUkQKo+dLFxBonOM+q8vHSc6SGkgG+9V30Mapy1WD8h+2P EnOf2CNx+fRIQHadFUWorA4L+Ox74RdBtYzuoQsBe05KkPtrzEUeW6TSsXcskC8cPU5S TFIbWZU1HuSYM1rkzxYEtsS1nSSPmAeDrrKOUGX+qL0BVhnYGavclFBAyrg3Ez4kWfyf qqb2FfxXjnj4KlH4NmVcPp0joL0sOnhs9y7ksvgHvjtBjavixgGgdQ5MuaxTCXxYjHqh rG9mxvAwMfnSW7Z3yeJFaX0LyUQK645WkrdoGA9s/iwCV9j+pyLvFn1R2uRoKS1vCOKn y+NQ== X-Gm-Message-State: AOJu0YxOVrB2Es19zFMivDD5clKFYDOjoCQhhkXbqrB71NwXY9qYkZXd ODWbmFsOJPji2TsWHKZfo2aCCW3RqW1qlKF6+ypwxkS/9A0= X-Received: by 2002:a05:600c:4387:b0:40e:511c:ce85 with SMTP id e7-20020a05600c438700b0040e511cce85mr866737wmn.57.1704916497248; Wed, 10 Jan 2024 11:54:57 -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 l17-20020a05600c1d1100b0040e4a2b36bfsm3188298wms.22.2024.01.10.11.54.55 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 10 Jan 2024 11:54:56 -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 12/14] hw/arm: Prefer arm_feature(GENERIC_TMR) over 'kvm-no-adjvtime' property Date: Wed, 10 Jan 2024 20:53:26 +0100 Message-ID: <20240110195329.3995-13-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::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.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 First, the "kvm-no-adjvtime" and "kvm-steal-time" are only available when KVM is available, so guard this block within a 'kvm_enabled()' check. Since the "kvm-steal-time" property is always available under KVM, directly set it. Then, the "kvm-no-adjvtime" property is added to ARMCPU when the ARM_FEATURE_GENERIC_TIMER feature is available. Rather than checking whether the QOM property is present, directly check the feature. Finally, since we are sure the properties are available, we can use &error_abort instead of NULL error. Replace: object_property_set_bool(..., PROPERTY, ..., &error_abort); by: qdev_prop_set_bit(..., PROPERTY, ...); which is a one-to-one replacement. Suggested-by: Markus Armbruster Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/virt.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 6d1cb24a6e..49ed5309ff 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -2150,14 +2150,13 @@ static void machvirt_init(MachineState *machine) object_property_set_bool(cpuobj, "has_el2", false, NULL); } - if (vmc->kvm_no_adjvtime && - object_property_find(cpuobj, "kvm-no-adjvtime")) { - object_property_set_bool(cpuobj, "kvm-no-adjvtime", true, NULL); - } - - if (vmc->no_kvm_steal_time && - object_property_find(cpuobj, "kvm-steal-time")) { - object_property_set_bool(cpuobj, "kvm-steal-time", false, NULL); + if (kvm_enabled()) { + if (arm_feature(cpu_env(cs), ARM_FEATURE_GENERIC_TIMER)) { + qdev_prop_set_bit(DEVICE(cs), "kvm-no-adjvtime", + vmc->kvm_no_adjvtime); + } + qdev_prop_set_bit(DEVICE(cs), "kvm-steal-time", + !vmc->no_kvm_steal_time); } if (arm_feature(cpu_env(cs), ARM_FEATURE_PMU) && vmc->no_pmu) { From patchwork Wed Jan 10 19:53:27 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: 761458 Delivered-To: patch@linaro.org Received: by 2002:a5d:6e02:0:b0:337:62d3:c6d5 with SMTP id h2csp2053455wrz; Wed, 10 Jan 2024 11:56:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IE1yGDT2232IdYLXkn1o4ahpVj1AgrQ6RErmQK6gziZb42l+0Wj5iqTJnQ73qhjcXecqh27 X-Received: by 2002:a0c:f394:0:b0:681:2253:f4f1 with SMTP id i20-20020a0cf394000000b006812253f4f1mr831806qvk.8.1704916578421; Wed, 10 Jan 2024 11:56:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704916578; cv=none; d=google.com; s=arc-20160816; b=Id0zw3G0Iodt/eLgnXpbuVSZOHnOl+RMj4g5L2gnYLmj8hsaqOkFjbDrSwIf4Diube y0zk+xwvsXt1ohL5jrV4l9gWlpwhHI6JNXQ5lQl0wBeHD6/KnnNBoruNbrqJ5Td5OR4v gTUkLIxOoxIeLJBcFEsIkVbTQijZOowP1VvviQiILskUFoANdQoj8qrC+xV6KZJqcSNx EItmbxDfgK+MBj/NKRAkFCqBPomMU8hKd2Q3uW2Kn/7u/aQJO/nrX8R34tranbuWSSte VZsfhOPoqnb/wDrjCX7FfXP+EhXwWbGFA2zHNb49RHvvaNCk+6025euslIB8sSsEnMhr hJGQ== 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=GdLxkKJBM9/8cO5ervTCmHlXNSnSwQGVSVS04z23rsg=; fh=0Bn9ysFO5uhdOoEvdDNDnkwY7yFMuDt2XLw3k0zcWt8=; b=nhEVLKLfFBq/Q4C5xpKIefw4efb3ex05g/FfLOSVrM4u3u9rA4zDm17KWU3VBuMw3e ot6KI0hwB7HBl+kTYjsv7ywUL3zBl4I/shmgx2yad79xTYyHooYBoClC/VMYZBikIYrJ buG0Sb3Q3a7TEXCz1UExno7hBY7TOle2LQN4164quBOE/+0tAwYK/qL/ZsdEbRQ+jR12 FhXuHyqfQ7zA9oqN/k/DnCkx68ormzcKmbaPT8frb+ThLKT0rC/y3ztH877a8vOZ+mbD Z6+uv1+9IEoHy1JS6FEuFXCbW2wwX4c3CAXDNFmoKvGZrtj6TyfUGbKBb3Q73QYvKqWL F8vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EKj+67dz; 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 t7-20020a0c8d87000000b0067a90d3023esi4985535qvb.279.2024.01.10.11.56.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Jan 2024 11:56:18 -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=EKj+67dz; 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 1rNefQ-0002hh-Tz; Wed, 10 Jan 2024 14:55:12 -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 1rNefO-0002Xh-Bf for qemu-devel@nongnu.org; Wed, 10 Jan 2024 14:55:10 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rNefL-0002k5-Ec for qemu-devel@nongnu.org; Wed, 10 Jan 2024 14:55:10 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-40e461c1f5bso40927795e9.3 for ; Wed, 10 Jan 2024 11:55:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704916504; x=1705521304; 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=GdLxkKJBM9/8cO5ervTCmHlXNSnSwQGVSVS04z23rsg=; b=EKj+67dzGGcJEktekhv03Zfd9BBbQzSSHDeFy/cruLN3+OBpYmqK3djCAi3MVre7Mb 8axhWD1eU/DaLnIrHveid3oimut5Q4bn+tP6LHutXZiy4LkVr3FENhEII1iH0Y6gFckl AMuhm6GqqSbUAe/JRyFcaXFhJDUCZ/iCsWoopt87ixMd/ewGndMkLIpWt4QTxAK7/Gj7 YNOG9jJZWnya07JrrSl1OexPOHPu1DzCFUexEOPG6tZdlz1M4GeN1qahtinITcwFRF9e CJpDefS4feWllaF0hww//we1AkVyujGSyR61DgswvoD67b1Hnu8aP3k6WKkK1WABGMly QrGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704916504; x=1705521304; 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=GdLxkKJBM9/8cO5ervTCmHlXNSnSwQGVSVS04z23rsg=; b=nK8Bmr2YjfoW645q63R+tCb4+lyh47v96ZqZZ0DyKhPwOAJZXC37nN2qt63Ft13IHJ +ETKKzpEzyryYTMZF/7m4JsbfBK4B+6EvTiJEU+LgYzkGCTJRwSWLj2z1nvxKsjyzH72 15K/HYnFWIsKSngJaqD2UNacWo88z29AxTJrx+UFAwuOd0EgPnTEsgcpQw46NdfwTE0W VPe0Lt2b1l946EP2NYIsUOCi/6ldscLzIpiSX3dFY/unGu1gpSZH9VMuV8O6ZKRuGWoF gP9CJH1iMIbDm2Qgq9Dh7FjZY4OTFShoXQxc1aBG9yESuc3NJ6rLm2WMz2IpyIUB5GrL +M7w== X-Gm-Message-State: AOJu0Ywy++AF9OB2pRh07OWJcAu57W4T0F68jymvlfqbsP9M6HNQkIGy Hi+AR4g1K3JoUM0wzd/KbZIh7ljd3+J5kK1m5n1m8rQGIyg= X-Received: by 2002:a05:600c:4f85:b0:40d:4e28:43e8 with SMTP id n5-20020a05600c4f8500b0040d4e2843e8mr783060wmq.167.1704916503990; Wed, 10 Jan 2024 11:55:03 -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 w4-20020adfec44000000b0033662fb321esm5583482wrn.33.2024.01.10.11.55.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 10 Jan 2024 11:55:03 -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 13/14] hw/arm: Prefer arm_feature(AARCH64) over object_property_find(aarch64) Date: Wed, 10 Jan 2024 20:53:27 +0100 Message-ID: <20240110195329.3995-14-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::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.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 "aarch64" property is added to ARMCPU when the ARM_FEATURE_AARCH64 feature is available. Rather than checking whether the QOM property is present, directly check the feature. Suggested-by: Markus Armbruster Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/virt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 49ed5309ff..a43e87874c 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -2140,7 +2140,7 @@ static void machvirt_init(MachineState *machine) numa_cpu_pre_plug(&possible_cpus->cpus[cs->cpu_index], DEVICE(cpuobj), &error_fatal); - aarch64 &= object_property_get_bool(cpuobj, "aarch64", NULL); + aarch64 &= arm_feature(cpu_env(cs), ARM_FEATURE_AARCH64); if (!vms->secure) { object_property_set_bool(cpuobj, "has_el3", false, NULL); From patchwork Wed Jan 10 19:53:28 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: 761454 Delivered-To: patch@linaro.org Received: by 2002:a5d:6e02:0:b0:337:62d3:c6d5 with SMTP id h2csp2053313wrz; Wed, 10 Jan 2024 11:55:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IFsNJNgireCmHPLRMYkiwzX97X0iYIcYnZto3et0FF5xOvueH36WSbfox5plP7gmHqRdvqm X-Received: by 2002:ad4:5bcc:0:b0:680:a521:c54 with SMTP id t12-20020ad45bcc000000b00680a5210c54mr1594963qvt.122.1704916550429; Wed, 10 Jan 2024 11:55:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704916550; cv=none; d=google.com; s=arc-20160816; b=02H5tABu4zkNtgztmzA6oINGm4BMcdX51GxxYfx4DBZ8kbv4HedT77qLCDBaFo5zcq 7IVPSgLmNZd/7yMFcIbRaa8HM/ZWy3VhLtcsQnfawtmqQ8RL3nHfp4psFffU4rWh3vFf oycPdI6FM9k3MvqQVHaZckYDYhM2K30IP5b6M9idaYDi+YWl3VugOQSYthVp9c6t/Rhf xPGdPoTutZJd1y5Hxhc9RTPeGJQg6MVs+j3OsvxAV0YE1NwBkotrQ2UwHYrVVX8rYo81 cwQCFjqAvgbx3Ss8IsCD9OsbK4ru/ZFPWSpvIlFnVgdQV+DeLnMaCbHJXumTk+9x0vvq /+Eg== 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=bEBz6KLcksNDKwrjuJDS9F6r+wqfQ84qV7D0vYA4a10=; fh=0Bn9ysFO5uhdOoEvdDNDnkwY7yFMuDt2XLw3k0zcWt8=; b=aYUUPJ1Zz4P3ay4uL6wEPIfs2aB11oqZnZcDHkK2FbhfHsoNyTpxKt8KanEt4c8Bin 4Mrr7V54jO8uPGj5gbgqjnmmZOUvq4hSkxPDznpFR0TULiXtSEd0jTorAVERqowwk1IK sMBudNtGR94Jm4XkdA9i7xA6laIgg6WQq6VNUSzdNOfFTegBZWzRZTa+D5c7DI8lpbBb Kr0vHzSIKHVfHy0h55vc3eXK48jLCPaevpS2/vYN+2Dcz02rQMAK3edJQBkZJj9ORRDG pg6WKRuD4w9Ea35vlKf897lzIE2f89JJtu6aoUt2hMoaekUcufWCzxSzcTNA9xXVC5cw 0CZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XrJiYCcw; 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 az42-20020a05620a172a00b007812e5a9151si5139023qkb.549.2024.01.10.11.55.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Jan 2024 11:55:50 -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=XrJiYCcw; 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 1rNefV-0003VV-Fa; Wed, 10 Jan 2024 14:55: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 1rNefS-0002se-8w for qemu-devel@nongnu.org; Wed, 10 Jan 2024 14:55:14 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rNefQ-0002wK-Eb for qemu-devel@nongnu.org; Wed, 10 Jan 2024 14:55:13 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-40e4d515cdeso26633025e9.1 for ; Wed, 10 Jan 2024 11:55:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704916511; x=1705521311; 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=bEBz6KLcksNDKwrjuJDS9F6r+wqfQ84qV7D0vYA4a10=; b=XrJiYCcwuxBjHgJKBtqCAqZzUiSxTC3hAjGrAP40kNnNEkoOQ63w8Y8bjJTnXToUxv JVZvJUJDj4wDFpjpr31S4eaemvdpAhZtTItVjJCTdU4EA7eujJPvPqTlr6vWKziVYOdM fXUptefHKkZ3mXO9xcJ7HtCOQsx50hxu31q657my5y1dXKToUx0vbj6lhRdH1W0y93n3 hNxsXUCwoH+Gi2uaCP3Q6hWKIWv6o/6lji8YU3TeQtryGCJxNDVcOz/a0bM/QqcFlgtV oF8gDiSkk4/0qyrLzQUUMCcgo1RJosEZDjY5freoXEZh/6skRuSpH0LY2eNKCXnuMQ3x ffLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704916511; x=1705521311; 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=bEBz6KLcksNDKwrjuJDS9F6r+wqfQ84qV7D0vYA4a10=; b=O0LmRnbH7X5tQPBTIWr28fXzfli+W8G/pAZsV390CJxlG4thrRpFEerKihpysdQha9 MbkR0ZHYpcnmfzGZ4Q2Yz/3nk/RoNs7gyOWfmyGydDRfwQpQi/rpIAQr8bwEIR7Jcu97 ZKPklDSJH9VfHLrItGot4rnlec/qamt50GTiQaOQmJALQ11Tsf4QV4eUoa4DbCafMNcf 1jUFLT8UOBvVCB8I6DYKWR2wbHNVW0mKDLovlfEHJzz11ET6yrJr5t3HWCrQ0qwgUhhx DFQqMRfcaFiLNHdB0SBF7TlPTvtb6NgwOnlDXenWDsppKlUfKscicJrHx0xW0cB3xQjO WxLw== X-Gm-Message-State: AOJu0Yycs0U153k7OZv7y9d6xGQrpvc7eTcEg70NZSJ7lKXyaCdH8eTv RN5tYqHO8qqpDOHdFm/BSUxNcHG2x/eapHira/QBOg37PtU= X-Received: by 2002:a05:600c:74a:b0:40e:4cae:a3d4 with SMTP id j10-20020a05600c074a00b0040e4caea3d4mr858800wmn.184.1704916510871; Wed, 10 Jan 2024 11:55:10 -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 c3-20020a05600c0a4300b0040e47dc2e8fsm3234850wmq.6.2024.01.10.11.55.08 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 10 Jan 2024 11:55:10 -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 14/14] hw/arm: Prefer cpu_isar_feature(aa64_mte) over property_find(tag-memory) Date: Wed, 10 Jan 2024 20:53:28 +0100 Message-ID: <20240110195329.3995-15-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::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.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 "tag-memory" property is added to ARMCPU when the A64_MTE bit is set in the feature ID register. Rather than checking whether the QOM property is present, directly check the feature bit. Since when ARM_FEATURE_AARCH64 is disabled the isar_aa64_mte register is invalid, also check for it (see the 'aarch64' variable set in the previous commit). Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/virt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index a43e87874c..7fd7173b5b 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -2188,7 +2188,7 @@ static void machvirt_init(MachineState *machine) * The property exists only if MemTag is supported. * If it is, we must allocate the ram to back that up. */ - if (!object_property_find(cpuobj, "tag-memory")) { + if (!aarch64 || !cpu_isar_feature(aa64_mte, ARM_CPU(cs))) { error_report("MTE requested, but not supported " "by the guest CPU"); exit(1);