From nobody Sun May 5 19:37:46 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1522702710043288.59662117419487; Mon, 2 Apr 2018 13:58:30 -0700 (PDT) Received: from localhost ([::1]:34671 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f36X6-0005oj-Sj for importer@patchew.org; Mon, 02 Apr 2018 16:58:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43415) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f36Vx-0005Dd-CU for qemu-devel@nongnu.org; Mon, 02 Apr 2018 16:57:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f36Vu-0008Bz-En for qemu-devel@nongnu.org; Mon, 02 Apr 2018 16:57:17 -0400 Received: from mail-pl0-x243.google.com ([2607:f8b0:400e:c01::243]:44608) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f36Vu-0008BC-99; Mon, 02 Apr 2018 16:57:14 -0400 Received: by mail-pl0-x243.google.com with SMTP id b6-v6so3772314pla.11; Mon, 02 Apr 2018 13:57:13 -0700 (PDT) Received: from squirtle.westlake.spaceflightindustries.com ([173.226.206.194]) by smtp.gmail.com with ESMTPSA id k185sm1693326pgk.94.2018.04.02.13.57.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Apr 2018 13:57:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=j5hCjwdbgetEvET5j7CHQRxg5xvqGHAqqVaYk9agXn4=; b=gEMk19SykIlxDTNlKQ+8wVahDv9WeJATeSZAS7DpF5oSIj3I2K6fJ8uucHM8S7o+sG bw4IZZQDsWaQra9DrX+qwESAh1wqNbt/5xRMHdiFBOYlclnurZZhoIOHPu9SDcJzYefA lcs8mglB4MOuhefCIVi2JcgI1t4fHKDYN6IUvOFEmXzieHa46SFGFbWVLTUC6llp6own k6rYcUiKpGUReuctIOEw9sWEUGHoRkQ8hsrBOLrKDB1zeskqpTf5nVRProQcD8+LaEvF DmFY+yEmIyzTW0kOlWap9BY68EvcV67cCzLr659/6yt/RMS057KElfKkBX83Fv96bURI YmaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=j5hCjwdbgetEvET5j7CHQRxg5xvqGHAqqVaYk9agXn4=; b=KvjjU2boWDob8YyYWGuOfKmvuID63uwD497gDPyZzjCAAeedqprtII3esvnguXt/Mw yyMHiZTEn6YDiCP08hTBUUcksfZ1mVPi6TUuQ77PYFap4AOc0wSQQE+6oEANqEQEdZCq t7kVMEShxEW0twAe9mXvRi1T6sEGS/V2FPbPiTZ+6GmMK57bjR/hlHFn1Nlugln5qzGv e6uYQtn3nDp2NkZz1MwPbKmw6+r8cK8D91HvWaJXc7UsQNR6yvmx/0Xax4lrO9R5Zgsc claZQCREw6fKFwMEj+a+TCgyfxUGyfP8j+RAunVqEvR3gY7RIXEhHpGY6czOLdHstCuN mKjA== X-Gm-Message-State: AElRT7Him4dm3SShHmAYsWqEkzPc8AcFrtDQh7pJE445KThi7COItiSA vJq22g9EvHJ0aeuWxIrlcOU= X-Google-Smtp-Source: AIpwx4+AhRJwh4T1rtpuiVFF7EnP9Dl5Ke6giiZNyJNUUqI1m87o+feNot2w+NXHjohVnHyEnpMIWQ== X-Received: by 10.99.178.88 with SMTP id t24mr7390121pgo.212.1522702632358; Mon, 02 Apr 2018 13:57:12 -0700 (PDT) From: Andrey Smirnov To: Marc Zyngier Date: Mon, 2 Apr 2018 13:56:54 -0700 Message-Id: <20180402205654.14572-1-andrew.smirnov@gmail.com> X-Mailer: git-send-email 2.14.3 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c01::243 Subject: [Qemu-devel] [PATCH] hw/arm: Allow manually specified /psci node X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrey Smirnov , Peter Maydell , qemu-arm@nongnu.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Change the code to avoid exiting QEMU if user provided DTB contains manually specified /psci node and skip any /psci related fixups instead. Fixes: 4cbca7d9b4 ("hw/arm: Move virt's PSCI DT fixup code to arm/boot.c") Cc: Peter Maydell Cc: Marc Zyngier Cc: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Signed-off-by: Andrey Smirnov Reported-by: Marc Zyngier Tested-by: Marc Zyngier --- Mark: Sorry about the inconvenience, here's the fix (hopefully) to the prolem you reported in [1]. Let me know if skipping all PSCI related DTB fixup if /psic node is present is not the behaviour you had in mind for your suggested fix. Thanks, Andrey Smirnov [1] http://lists.gnu.org/archive/html/qemu-devel/2018-03/msg06914.html hw/arm/boot.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hw/arm/boot.c b/hw/arm/boot.c index 6d0c92ab88..d9f9375cdb 100644 --- a/hw/arm/boot.c +++ b/hw/arm/boot.c @@ -422,6 +422,7 @@ static void fdt_add_psci_node(void *fdt) ARMCPU *armcpu =3D ARM_CPU(qemu_get_cpu(0)); const char *psci_method; int64_t psci_conduit; + int rc; =20 psci_conduit =3D object_property_get_int(OBJECT(armcpu), "psci-conduit", @@ -439,6 +440,15 @@ static void fdt_add_psci_node(void *fdt) g_assert_not_reached(); } =20 + /* + * If /psci node is present in provided DTB, assume that no fixup + * is necessary and all PSCI configuration should be taken as-is + */ + rc =3D fdt_path_offset(fdt, "/psci"); + if (rc >=3D 0) { + return; + } + qemu_fdt_add_subnode(fdt, "/psci"); if (armcpu->psci_version =3D=3D 2) { const char comp[] =3D "arm,psci-0.2\0arm,psci"; --=20 2.14.3