From nobody Thu Nov 14 06:52:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704916478; cv=none; d=zohomail.com; s=zohoarc; b=WAlck6y/YPeJ715VzBl8F8MXfD6eJNnZb+IOq4konNYMKjdCPOrYm99S3V+2uVSS1Oc+Tvnr8I0GI+My8+oaejUw/sUK4DyuIfKU3fGMY3NrYavWfQK8jI/XpWzmfYxk/udy7H2a9cd/7/ME+sJbYieCOXW2+nByHxt25l3onB8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704916478; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=W5YYwF8QpDX8Jtsvrc0+qop9CxJbiTqbmmnqrqDqyeI=; b=NU531rJi3SbHVVMmMYUjmGB0z5nXoc12Zokl6FNUoC0WbpipFfbGLWgdJ3NhN5ORwZMy+Lvm7CB0YZENdC8mERa4KsCYSjicmWn1bKt+LVQOxEOjuDUvHtcEHK2yaRnkyrgfsYTSmNrnQtLRXK7oVNmowadLaXYoQ3JC87cZlHk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704916478398920.7735684006693; Wed, 10 Jan 2024 11:54:38 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AGHT+IGxC/nnlqKU3ONI5WNDIBxZz59NGE+y4irL+gMYhAm8f5/ZbCysM0p/xD4AuA5tSqpwOHjIUA== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Marcin Juszkiewicz , qemu-arm@nongnu.org, Kevin Wolf , Igor Mitsyanko , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Radoslaw Biernacki , "Edgar E. Iglesias" , Leif Lindholm , Rob Herring , Markus Armbruster , Alistair Francis , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704916479960100009 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=C3=A9 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 **er= rp) { ARMv7MState *s =3D ARMV7M(dev); SysBusDevice *sbd; + DeviceState *cpudev; Error *err =3D NULL; int i; =20 @@ -299,6 +300,7 @@ static void armv7m_realize(DeviceState *dev, Error **er= rp) error_propagate(errp, err); return; } + cpudev =3D DEVICE(s->cpu); =20 object_property_set_link(OBJECT(s->cpu), "memory", OBJECT(&s->containe= r), &error_abort); @@ -356,7 +358,7 @@ static void armv7m_realize(DeviceState *dev, Error **er= rp) s->cpu->env.nvic =3D &s->nvic; s->nvic.cpu =3D s->cpu; =20 - if (!qdev_realize(DEVICE(s->cpu), NULL, errp)) { + if (!qdev_realize(cpudev, NULL, errp)) { return; } =20 @@ -426,8 +428,7 @@ static void armv7m_realize(DeviceState *dev, Error **er= rp) =20 /* Wire the NVIC up to the CPU */ sbd =3D 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)); =20 memory_region_add_subregion(&s->container, 0xe000e000, sysbus_mmio_get_region(sbd, 0)); --=20 2.41.0 From nobody Thu Nov 14 06:52:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704916557; cv=none; d=zohomail.com; s=zohoarc; b=ICl7Tfkjt22KgUxGNkao9ZOvAu9oRE95WxWhL7zcKjN19Ej5PaOi2EeLrEDM45tEM8hkWP/EDOuFdtLSHs/qQUqUyW6GMDPwlX4TZZtlDF/CXOuRwzohLNpJ2l9f4dEfe3hqmCZ2X5qGGIGI2aQOUUAy1PeL0ZwtB5MExs2mHmk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704916557; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=mdirajlt6qC945MCVDYIpUTSXSVbweTZjiyf2mppVOc=; b=iHXQJd1O2QPArCjk/HME/ABP56yGLpzkkqy7VJA2w2EPCRNfNa75cbFpqghTww0tTcZY6oqufFryaxyvYPCv/iFaXF54UuPgEjFj6DabLjMetOzeT2gn9pjUKmAp8h6UTPmcgBj/6AWP9Y8cDund897wtmrII5SXoK4G0UNJ4Rg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704916557811940.2581889980404; Wed, 10 Jan 2024 11:55:57 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AGHT+IEM5mBA0vZDP7an5Du71JWNSy2KsfIX9laU0cGrvyWevak0CP3DGoYOyKFOF1yj1S3cqIiJHw== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Marcin Juszkiewicz , qemu-arm@nongnu.org, Kevin Wolf , Igor Mitsyanko , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Radoslaw Biernacki , "Edgar E. Iglesias" , Leif Lindholm , Rob Herring , Markus Armbruster , Alistair Francis , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704916558323100003 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=C3=A9 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 **e= rrp) 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 =3D DEVICE(s->cpu); =20 object_property_set_link(OBJECT(s->cpu), "memory", OBJECT(&s->containe= r), --=20 2.41.0 From nobody Thu Nov 14 06:52:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704916540; cv=none; d=zohomail.com; s=zohoarc; b=E/UkErUwQYJQ4Wc7owXYCazhU6HzlOpMj/NUwpAhD5I/g7wkplRId6v0lVkTx5uc6DqD2wZku7HW63gU78rArnlitw2VKmS1Qw0kvy+9TC6oM8Z9DTTnFPcVR58mpr/m5wXWbS9EKSKlbeqKLneQ9hDz5371lUKNnxIqcSog0LA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704916540; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=znfL4d0kUd7PQLWgd/IbU4xVCADxWCmjPBLUUJRZlJU=; b=cf3IFVBHHXQRLMuRr8tBCjbuPHafc949U8nbzB2WOdPoF9BlVmqoelvTQO5HP3GRxL2jpwE0qTQNI1ywPJQCeHkmisLAtmmJCjePQaygglE6r3BHJakilOxdsZkwSFD9dRcC6c2zTBQB4EDiBmUv2dzcjofK/zOoD+CREtbg4ao= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704916540486256.59339257363854; Wed, 10 Jan 2024 11:55:40 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AGHT+IEwhsl63YMeMHDE72bK7yDwI/VR1JUfr9Ys0DT8f1XK7IAeXYfMYjPWX4eyCLA2pAjZhuLKiA== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Marcin Juszkiewicz , qemu-arm@nongnu.org, Kevin Wolf , Igor Mitsyanko , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Radoslaw Biernacki , "Edgar E. Iglesias" , Leif Lindholm , Rob Herring , Markus Armbruster , Alistair Francis , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704916542217100003 Reorganize a bit by first setting properties which are not dependent of CPU features (and can not fail). Signed-off-by: Philippe Mathieu-Daud=C3=A9 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 **er= rp) =20 object_property_set_link(OBJECT(s->cpu), "memory", OBJECT(&s->containe= r), &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 **er= rp) return; } } - qdev_prop_set_bit(DEVICE(s->cpu), "start-powered-off", s->start_powere= d_off); =20 /* * Real M-profile hardware can be configured with a different number of --=20 2.41.0 From nobody Thu Nov 14 06:52:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704916552; cv=none; d=zohomail.com; s=zohoarc; b=fwV9CV4Y3TW/jz/IiiZCoSCgF2ExEU2eLW/t0EKZlkQvl+/M+qXUcBO6gKM6TJzKHbVnTsoDA3R8PmLuSuFOOPuTQdnEjdNunRapnWEfGvrjpRSxsrlwDGffYY0Ek4+MBVZhDoJrlrnyuu4IM5Q5gj7PDPrvjIbAbrB8gGlmUf4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704916552; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=fOLjDR/IKNF0Xh0mudwkf1U6/g8RGHkdFKaUB2oy+80=; b=cba308XNY932aUnHGibTIU6N4voJSKlqDb7LiYERkMRudtheUAO9EAPS2nVU5XYwOT+ZCqd999Ujcbnern/BbvJJ8bU0PWM0xlADX0+rIHYy8Hxy+2M5diWol88z1lbNhs1qUX5iu47mAUV0/KV4OgBkh2h6IeOZfrkM3vw4KdA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704916552712638.6355854473801; Wed, 10 Jan 2024 11:55:52 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AGHT+IFVcjqlQhh9IFV2hlFnA4ke87gdFQSLw0a78PKhvCLIBAzbhPLNgdGMZHqNjSOYGEZo/ChByQ== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Marcin Juszkiewicz , qemu-arm@nongnu.org, Kevin Wolf , Igor Mitsyanko , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Radoslaw Biernacki , "Edgar E. Iglesias" , Leif Lindholm , Rob Herring , Markus Armbruster , Alistair Francis , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704916554597100007 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=C3=A9 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 **er= rp) object_property_set_link(OBJECT(s->cpu), "memory", OBJECT(&s->containe= r), &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 **e= rrp) 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; --=20 2.41.0 From nobody Thu Nov 14 06:52:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704916476; cv=none; d=zohomail.com; s=zohoarc; b=f3WoTPTp81OeY7chCe4hLVgnfNUn+TCc0nklOpgVGjv091KQdmcCSduy7s48fwcYYMnr2ibPf/c3zf9CnDrq/ui0dx0B0o7zB2e5Ps3kncuyFVlFFKOGOP0izu/i7uLt5ufQVmUXAkqVMf5Z5alXwZrtZjJv7cKOzyCSnHmfbE4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704916476; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+Lqyw2xeJxP0nadk2efU9Sx5aGl4DyqfaFeDtt0siLg=; b=NHRSq9wINz+F5mU8GUU9QwL+YpnYU0UuWsaQSugS++xjjePQLVAaFsRewwqTEDbhKvdmlIK2emDLv6iQQP2Izl5HRogfbFFqKCytWhqfwfqG5rA1RdTxHqcsE6RrP1R8SVXxTcVsTJYC80ouGTWtl0mRKT+y7wkE/qlaV50xke8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704916476409547.3451248558131; Wed, 10 Jan 2024 11:54:36 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rNeeV-0007Jf-JR; Wed, 10 Jan 2024 14:54:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rNeeS-0007IV-AF for qemu-devel@nongnu.org; Wed, 10 Jan 2024 14:54:12 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rNeeQ-00028e-Ax for qemu-devel@nongnu.org; Wed, 10 Jan 2024 14:54:11 -0500 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-3375a236525so3781994f8f.0 for ; Wed, 10 Jan 2024 11:54:09 -0800 (PST) Received: from m1x-phil.lan (vau06-h02-176-184-43-236.dsl.sta.abo.bbox.fr. [176.184.43.236]) by smtp.gmail.com with ESMTPSA id r4-20020adff104000000b00336a0c083easm5602722wro.53.2024.01.10.11.54.06 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 10 Jan 2024 11:54:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704916448; x=1705521248; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+Lqyw2xeJxP0nadk2efU9Sx5aGl4DyqfaFeDtt0siLg=; b=vfKUCj0xZ78IizDc83HDtt9eOmGXDS/yHioQ4akHNWANy3e+Eh3K8iA6M5LwSURmVp wIvc/MiZrv95scEKQbLmr2T95CRRyigvvPymBHV44EnnGIjrqIg7VqBIg5zsZdOm+Stg sM1t6O7c3hU5voTrRphzR4PHF7f7KXQHvjTe1hVk6qx+fNr15QlnoL0UzV08IWzPuqTc 7wDJeGEj4Rh4AAidu9SZywd0WHTnMM1SfZSuqIDly0dK3U237cl9eIacQ/4073alwRbC SoVsr+9EOyXFypb1xTo0f0ucmYQfOvnCgiZZvAFCM0kFih/Np7NOCrlhhKnRxfZ0ZJ4V LYeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704916448; x=1705521248; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+Lqyw2xeJxP0nadk2efU9Sx5aGl4DyqfaFeDtt0siLg=; b=HohM/GZoWhIO5eFltpU/9EGmuhGH5ra2XfN8LyNHzCuX45rnM+q0+jypSy8uM7kvWv jyqaO4yp5Ug7DIFR/ULwEPrQe2tQe8u7VqGmYtsGbINyegzldfitHjuNkSriDKdIUs3Y IPVDPvWgWhy3fXG1EtzmHY11tNFlZMFEtNI3O0A6f/JkyrhL52pV7WtIjkr8tyVDWii7 GtZcjOwRZwlOSVu9YlG9HZPBdLTRbsk76kwUNtUgQX/+/ialqDj1Qw23BJ9NkPKW4fBk 6gnF672tH9Is2u+KkEyT5j7HoWnDUa5Gv1snD9bKdf2DYrNtFqzUYUgN8hyGv9oLbh6j 4wXA== X-Gm-Message-State: AOJu0YyfJbVRGdfzygBLiwGdp+SefL2WzCWyro/7/ajz6eUcL+ygt/6l jqwpsqDkDjN2VwHZzwnGtB91sz02lc4kSBVURONiomO9SGg= X-Google-Smtp-Source: AGHT+IH7Le0gG0qCcI+8M09SN9A/YfAepwlqDkxfVaho46g9uVvNTxP1ta35tm/cvlgibSAWK/Yc9g== X-Received: by 2002:adf:f102:0:b0:337:6566:f9cf with SMTP id r2-20020adff102000000b003376566f9cfmr2200wro.98.1704916448613; Wed, 10 Jan 2024 11:54:08 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Marcin Juszkiewicz , qemu-arm@nongnu.org, Kevin Wolf , Igor Mitsyanko , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Radoslaw Biernacki , "Edgar E. Iglesias" , Leif Lindholm , Rob Herring , Markus Armbruster , Alistair Francis , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 05/14] hw/arm: Prefer arm_feature(M_SECURITY) over object_property_find() Date: Wed, 10 Jan 2024 20:53:19 +0100 Message-ID: <20240110195329.3995-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240110195329.3995-1-philmd@linaro.org> References: <20240110195329.3995-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=philmd@linaro.org; helo=mail-wr1-x42d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704916478170100004 Both "idau" and "init-svtor" properties are added to ARMCPU when the ARM_FEATURE_M_SECURITY feature is available. Rather than checking whether the QOM properties are present, directly check the feature. Since we are sure the "init-svtor" is present, the object_property_set_uint() can't fail. Instead of using &error_abort, replace: object_property_set_uint(OBJECT(s->cpu), "init-svtor", s->init_svtor, &error_abort); by: qdev_prop_set_uint32(cpudev, "init-svtor", s->init_svtor); which is a one-to-one replacement. Suggested-by: Markus Armbruster Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/arm/armv7m.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c index 530729f42e..8350267d96 100644 --- a/hw/arm/armv7m.c +++ b/hw/arm/armv7m.c @@ -311,16 +311,11 @@ static void armv7m_realize(DeviceState *dev, Error **= errp) qdev_prop_set_bit(cpudev, "start-powered-off", s->start_powered_off); qdev_prop_set_uint32(cpudev, "init-nsvtor", s->init_nsvtor); =20 - if (object_property_find(OBJECT(s->cpu), "idau")) { + if (arm_feature(&s->cpu->env, ARM_FEATURE_M_SECURITY)) { + qdev_prop_set_uint32(cpudev, "init-svtor", s->init_svtor); object_property_set_link(OBJECT(s->cpu), "idau", s->idau, &error_abort); } - if (object_property_find(OBJECT(s->cpu), "init-svtor")) { - if (!object_property_set_uint(OBJECT(s->cpu), "init-svtor", - s->init_svtor, errp)) { - return; - } - } if (object_property_find(OBJECT(s->cpu), "vfp")) { if (!object_property_set_bool(OBJECT(s->cpu), "vfp", s->vfp, errp)= ) { return; --=20 2.41.0 From nobody Thu Nov 14 06:52:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704916490; cv=none; d=zohomail.com; s=zohoarc; b=c8/bptoPdoSFdlXlMZ8/0U19HT50VMI9tmYJAWM84lkwhciTDjMSVYbOvDhp4Z6GxS2zzaKgUHGEhD3Gja60+MorUb7+g+Ny9teseZKR3qcE+WzVF5M2OXqCi7jCFalj8PDC+LkXdLFv1KJ/07bQqcHuzqljIfCGiU3J4a6IJvI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704916490; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=5n6b/Kfb2q1nuszk7kQnrf8+ZzcUeVpd0islGk5jF8M=; b=LtGWvpUFXXQrUt920bPjYfGEjxrfBlHZqzoSxEecJh5LgBdSBjN4Yb59IiFQ628CpK5obduHV84h4k/PKC8MLc0Rx8mV5n9w28fbNLBmzsiQpreCB5sv0KYXNjpQQstXY5tkS5enATgBlouSDa74b9iAJtDG1IB334oQYIUBfG4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704916490719158.8705485149485; Wed, 10 Jan 2024 11:54:50 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AGHT+IH8sOsgTZDUqFMN3Ep1ODw2mDHry8n2BVIQjjK05VVGEZgLbzTvarQBOazX7WqS2O+WNNjfgw== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Marcin Juszkiewicz , qemu-arm@nongnu.org, Kevin Wolf , Igor Mitsyanko , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Radoslaw Biernacki , "Edgar E. Iglesias" , Leif Lindholm , Rob Herring , Markus Armbruster , Alistair Francis , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704916491998100003 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=C3=A9 --- 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 **er= rp) 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; } --=20 2.41.0 From nobody Thu Nov 14 06:52:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704916519; cv=none; d=zohomail.com; s=zohoarc; b=n33ENWA4GBCVUiNpjhlxtGkQ+spZ1Or/UAOdoM2m3cqwchWWPT3X62Mk2JTlUZbv2CNTsKsfWUH9rpbpL12xYwgU6Xoq0OFfvSq/E+dPTuXS/tLe9lHl7ybtjUVEgtzPYhIp39WKSRchKJVwD6iYMjOKu2tefcV+uGoEOIkHjuk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704916519; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=4lFs+peHffZXBVVkShWxuZ7VjcO+rV+nUwkZ0/LL7Zg=; b=Xh2EeZqMgKmIYnzcnFYX9M67q0PQc4nCPutkzaGqHZlktO5mNu1wNWdy8X77MMsEBMmn+NOCswgzgBa2F2Xrur3PZgbnEurhlx/dpA4FuHaq50To11M80BtBAq28k9e2PMByb0zz+7gGI9QPta8Xw5+PVySEbrFzskcf3TF8yHQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704916519330643.6347760624229; Wed, 10 Jan 2024 11:55:19 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AGHT+IGo64vLyi4J8/55MaWl7n5oNPXeGks42EesEkm5PlwaHr8gvTmJY9i7UaNSbV2yJM7TOxalIA== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Marcin Juszkiewicz , qemu-arm@nongnu.org, Kevin Wolf , Igor Mitsyanko , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Radoslaw Biernacki , "Edgar E. Iglesias" , Leif Lindholm , Rob Herring , Markus Armbruster , Alistair Francis , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704916520145100001 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=C3=A9 --- 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 **er= rp) "mpu-ns-regions and mpu-s-regions properties must have = the same value"); return; } - if (s->mpu_ns_regions !=3D UINT_MAX && - object_property_find(OBJECT(s->cpu), "pmsav7-dregion")) { + if (s->mpu_ns_regions !=3D 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; --=20 2.41.0 From nobody Thu Nov 14 06:52:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704916556; cv=none; d=zohomail.com; s=zohoarc; b=hCiR2J6Vgie3GudcOFWGggYosvQbl2OD6caP6v9qj3eZP8s/d1F5/d597HDtVYXEnNiIhF1dUd5yDff85cvUuX8/RoWyxy91QFq6lXQWPs9jIEUV4+g5nXhtXxtLpPuMHMX9qS35EFeEHyZvpgUbZejh9+6XvTi06ZgnX7bO+Bs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704916556; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=OowX4efGlp2L11zIDE/JPwBjb6bv53ZLeGSFw+1liNI=; b=AGLxHG0BwNp2uiRkJebBgiyH/G+CowR9WlVPrOGPEw7T/x3smA658mjPeOGcmQVBXgmmxqjVVTh5VPcdg8fHl3J5hOjNt8R0vKrYG/DvKMUoV5lCTUNnQqHSNwP8fGQTi/xJPJNCuckiqyXmoYb+tWXE0mAlcgtgp8fVXK9q780= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704916556570412.7700909688573; Wed, 10 Jan 2024 11:55:56 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AGHT+IFWby61uJ0ne9sJLI7LEPySlIqlyEyfxcveQWgGiW6+NlQFSatSdvJvgCxT7CD5nZwLtOoy4Q== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Marcin Juszkiewicz , qemu-arm@nongnu.org, Kevin Wolf , Igor Mitsyanko , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Radoslaw Biernacki , "Edgar E. Iglesias" , Leif Lindholm , Rob Herring , Markus Armbruster , Alistair Francis , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704916558360100004 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=C3=A9 --- 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, E= rror **errp) for (n =3D 0; n < EXYNOS4210_NCPUS; n++) { Object *cpuobj =3D object_new(ARM_CPU_TYPE_NAME("cortex-a9")); =20 + s->cpu[n] =3D ARM_CPU(cpuobj); /* By default A9 CPUs have EL3 enabled. This board does not curre= ntly * support EL3 so the CPU EL3 property is disabled before realizat= ion. */ - 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_fata= l); } =20 - s->cpu[n] =3D 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; =20 cpuobj =3D object_new(machine->cpu_type); + cpu =3D ARM_CPU(cpuobj); =20 /* 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); } =20 qdev_realize(DEVICE(cpuobj), NULL, &error_fatal); =20 - cpu =3D 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 disab= led * 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_fata= l); } =20 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) } =20 cpuobj =3D object_new(machine->cpu_type); + cpu =3D ARM_CPU(cpuobj); =20 /* 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); } =20 qdev_realize(DEVICE(cpuobj), NULL, &error_fatal); =20 - cpu =3D 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_fat= al); } =20 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 =3D false; Object *cpuobj; =20 @@ -62,13 +61,18 @@ static void a15mp_priv_realize(DeviceState *dev, Error = **errp) qdev_prop_set_uint32(gicdev, "num-irq", s->num_irq); =20 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 =3D OBJECT(qemu_get_cpu(0)); - has_el3 =3D 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 =3D qemu_get_cpu(0); + cpuobj =3D 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 =3D 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 **e= rrp) SysBusDevice *scubusdev, *gicbusdev, *gtimerbusdev, *mptimerbusdev, *wdtbusdev; int i; - bool has_el3; CPUState *cpu0; Object *cpuobj; =20 @@ -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 =3D 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)); + } =20 if (!sysbus_realize(SYS_BUS_DEVICE(&s->gic), errp)) { return; --=20 2.41.0 From nobody Thu Nov 14 06:52:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704916489; cv=none; d=zohomail.com; s=zohoarc; b=PXxd98EAaQSWGwVN3Af0qHS/Mbh8DJOXoge7Rdaa25l8JuiBaBqpQJakqGfjjQg+1rqHHY9q2OIInPR0dCGbQRq/FUeT3S0dbbYZH2MtAtjgWJL7hOlcag0goGSf8xgGBMpmeGLknXfUANSg2pBbrgq0qeCwMlqoWRwGOAx28ak= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704916489; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=2aLkQ6Ut0DrpuWjeMaf8bgkuaiZex3z3XI0gOydKSEI=; b=oLjSleZlJQ0jv7OtOssanWfOt1lnPya9/4RWQyPcEOdraauFi5PuawwiIQllyHa0INcaGr2ChdJmwNHuYWohfbQ5U3gfXSFkws7IRwMMIK72PyeouyYT3NOmaqD6plfD4aW/WZmBMf7S2O6NCXQqrKHc3MrVX3DFo9fUjEmlJA8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704916489561727.6468295875746; Wed, 10 Jan 2024 11:54:49 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AGHT+IFKUbzd4ecP28gaTWgAI0jnNxOVp9oueGbDldM4JPQ5uZIegpdTaJtARzMAyFP4nZRer9jpnQ== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Marcin Juszkiewicz , qemu-arm@nongnu.org, Kevin Wolf , Igor Mitsyanko , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Radoslaw Biernacki , "Edgar E. Iglesias" , Leif Lindholm , Rob Herring , Markus Armbruster , Alistair Francis , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704916490043100001 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=C3=A9 --- 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 *c= pu_type, /* Create the actual CPUs */ for (n =3D 0; n < smp_cpus; n++) { Object *cpuobj =3D object_new(cpu_type); + ARMCPU *cpu =3D ARM_CPU(cpuobj); =20 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); } =20 - 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); } =20 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 =3D 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 =3D 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)); + } } =20 if (!sysbus_realize(SYS_BUS_DEVICE(&s->gic), errp)) { --=20 2.41.0 From nobody Thu Nov 14 06:52:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704916523; cv=none; d=zohomail.com; s=zohoarc; b=aXCUClmm5WHoPthyyHQX94JSy4D0tf5NdMRUJ+i96FKNPtA36kLZDTBe3xVazr3wemteE6hM7y5d4uIy0kZ8bEpax34PBGE73Ja28Uyhhb0u+3cSS99hVOS6JJAsantVmHnGDZrTuuCKwofx2xhL+VFAvDrVUuNVgWyEcHPaIcw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704916523; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=rKXURkFhsCy0V0ubg/nJYR4pTGn8xQxbtylatTgX1X4=; b=UdVMMjt5XpzJSx4hu5IBbNK0b0B3uIhzCXVrIfRetugNwQ+Z/UsDb1ptht/Sgan/bDtK1c4KzHtMExtnkFke9BzX9rwkYT4R82BPtr4AKp4G4OCQwkPUQx1biPjEQ/WJ4cC805tYdcXk7uRdHIjt2yftvVId9T/24qLYAmRHCig= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704916523345355.99388215640556; Wed, 10 Jan 2024 11:55:23 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AGHT+IFow5aH/cxXlfW34HD3g8cDhzSgk52saCbfY8RrKlXKt9CSLCukyjZ6ZAJolaf+X5S5w2rFiA== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Marcin Juszkiewicz , qemu-arm@nongnu.org, Kevin Wolf , Igor Mitsyanko , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Radoslaw Biernacki , "Edgar E. Iglesias" , Leif Lindholm , Rob Herring , Markus Armbruster , Alistair Francis , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704916524171100001 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=C3=A9 --- 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 cx= machines machine_id) object_property_set_int(cpuobj, "psci-conduit", QEMU_PSCI_CONDUIT_= SMC, &error_abort); =20 - 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_PERIPHBAS= E, &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(cpuo= bj), &error_fatal); =20 - 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, } } =20 - 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); } =20 - 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); --=20 2.41.0 From nobody Thu Nov 14 06:52:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704916502; cv=none; d=zohomail.com; s=zohoarc; b=gg3I2FmqlFRQZ0idQaVI4kJGc8ZcH6UMY2J2kdvnuTZ7ZXlq62eg0Mnxbc5aCvs16cW46bkX2JsAzRlxo2iQeoJj6zlcXYXekjLRsmjkRVPI0uqLNnaYkYpY+qfSFw6lZbnDbC/N9rwyCtnFlJUNJc53dRC83CykzKeivU4dCEo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704916502; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=6/Hk2SmJl7pABngKVtRs+8Jo9OKAAK/e6Yxa8zZeHcw=; b=ehZGETeNKjpJoKKQ4B5CRVVevnz4Ehrmarls9joCFTrhxQgsPy1ei9Vzy/MirVl7GDkN0vxaGZ+h6nH9zlLTJ1y+fNQdBz+GS9VcwV2dZDkQJe9VsHzB79KkzhOTsjt7lYGzLGW84UDriEr+LnAtzRwSey8tOSFkH8U93Gg94zk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704916502824360.3724448330189; Wed, 10 Jan 2024 11:55:02 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AGHT+IE2GGMI/J4dfv9lDf41Ytf3T5IQRShNwrRuISaS+JEFOqfMwQ08EvwJ4Wm4/Cn8jqL/QzWuhw== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Marcin Juszkiewicz , qemu-arm@nongnu.org, Kevin Wolf , Igor Mitsyanko , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Radoslaw Biernacki , "Edgar E. Iglesias" , Leif Lindholm , Rob Herring , Markus Armbruster , Alistair Francis , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704916504041100003 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=C3=A9 --- 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= ); } =20 - 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); } =20 --=20 2.41.0 From nobody Thu Nov 14 06:52:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704916545; cv=none; d=zohomail.com; s=zohoarc; b=Q0rgGaMVh7awgd22f+MaUshRR1XN3NOAKj2qZhfmKvyezuG4i0vk3u2Izjs7dAnG3xwCI41D2aSsczEVw36y4AgUN0wRh0x/+kk6t3OY+lmrJnqcu8s8GxF/3r+8LnHA8l7n9pAFiNF6gXaLxs7PilnihfcVIdBmY4yaf+D6xXk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704916545; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=H2YEvqYxr1jwORUy1H416YdJDByH1Bti5dkUqmMcrho=; b=WIcJk1zLCSEKgw0IRyBDsASRv0u0xPJYkBv+b1ZGMa431NXvr67HIJQbXTWWXOvDx9FoW6rhIBsBVX2V4aZVlCKTHjRePb27eIzzsfE2u5O+nb6JxfZTJl8urNDfG/WDS74aQDqzt+NgU/TA9C9/z13ckAFwXxCVUDeDNRYDjEc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704916545889743.6262845688002; Wed, 10 Jan 2024 11:55:45 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AGHT+IHQIfFBBMTYrGuA2Z7LZ0BoaPN7z/xVJtfC+knKSfqFG55a4WX2lBDF0b0ZD9Mqg27tWGP88w== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Marcin Juszkiewicz , qemu-arm@nongnu.org, Kevin Wolf , Igor Mitsyanko , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Radoslaw Biernacki , "Edgar E. Iglesias" , Leif Lindholm , Rob Herring , Markus Armbruster , Alistair Francis , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704916546242100001 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=C3=A9 --- 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); } =20 - 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); } =20 if (arm_feature(cpu_env(cs), ARM_FEATURE_PMU) && vmc->no_pmu) { --=20 2.41.0 From nobody Thu Nov 14 06:52:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704916578; cv=none; d=zohomail.com; s=zohoarc; b=Fb3Y/HeVf3ol2eLMPiQSFEBcYodtxQGNlg/sVmGC4MVULaZq3w3v4zi8tEp5Gv/HUslU29vmq2EN3FpDESE+7YhbiffN5+JcA68ug9lngiFNbF1uRECjKHfM9T5LbWCwujz7i60nGD+rynN6TN8pSoGt7GzD+R5zxB8buRwjXN8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704916578; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=GdLxkKJBM9/8cO5ervTCmHlXNSnSwQGVSVS04z23rsg=; b=lIj0PaNgRDHD3EwO5YTpGvGsd7Wi9NvjPdwM4qql1gKtL0v6H/TvEOU9yhj/67oZhJO1+cunWnXAye8jqf+NB5WTU/G+WKoZJsEdCHx0o3u8MeiFm56iU75OFpYQ+e1buyAI6kSRO5Ort8tszNouTol6Sdg4dcUwTnRXQwjG4dY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704916578667771.2885594098526; Wed, 10 Jan 2024 11:56:18 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AGHT+IFBq3SIKl//Nr9ItYDR3BjCPPqSfdupmfgRICMthFR5bjiXIpR3ELMN9whuDN7HLjO6jOiNlw== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Marcin Juszkiewicz , qemu-arm@nongnu.org, Kevin Wolf , Igor Mitsyanko , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Radoslaw Biernacki , "Edgar E. Iglesias" , Leif Lindholm , Rob Herring , Markus Armbruster , Alistair Francis , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704916580441100003 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=C3=A9 --- 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(cpuo= bj), &error_fatal); =20 - aarch64 &=3D object_property_get_bool(cpuobj, "aarch64", NULL); + aarch64 &=3D arm_feature(cpu_env(cs), ARM_FEATURE_AARCH64); =20 if (!vms->secure) { object_property_set_bool(cpuobj, "has_el3", false, NULL); --=20 2.41.0 From nobody Thu Nov 14 06:52:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704916551; cv=none; d=zohomail.com; s=zohoarc; b=Tq2ozEdoqHH2eqPCETbe6IP5Jp4ZzO0QADEAti6Aqyn/3WnvWumvXljrf/l01kj8cwajOIax9rD/SKVe7ofhlktG3g6NdHOgcvxMI7R0KSTnKPBqBfOobrBh2Jwe4J7+C0XBmD1ECQkXhbQoy6bp7b+V4TIokOw4tXVom23tMVI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704916551; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=bEBz6KLcksNDKwrjuJDS9F6r+wqfQ84qV7D0vYA4a10=; b=ELLE+alx4xb0XozdSesquRP8D7rML8SV232Ro25qaVxwchH4ZLAuwQEB+hGnilRG/wEfsVT3Ri779tVXt175tNoD2yPGpyO2Gec7Nm/jBZq4s7mCCaZgr/zpA9AgAx0lICepyvWwZgrqSEn4GqtGwdlhR3Tox7NJTkmAaS/yUug= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704916551676389.1661296951603; Wed, 10 Jan 2024 11:55:51 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AGHT+IGQd32Lk+oKb8zN1vlG98owUctcXADDH4Oa7B8063z1oucGBdFgJ+DlBJYIvHCVRrc9BwWp0g== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Marcin Juszkiewicz , qemu-arm@nongnu.org, Kevin Wolf , Igor Mitsyanko , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Radoslaw Biernacki , "Edgar E. Iglesias" , Leif Lindholm , Rob Herring , Markus Armbruster , Alistair Francis , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704916552228100001 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=C3=A9 --- 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); --=20 2.41.0