From nobody Tue Feb 10 02:28:03 2026 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=1709041452; cv=none; d=zohomail.com; s=zohoarc; b=P8chW+f8WvdUY1jE+XxbGhEZdGfhB1AvBV5+R4gw/Q6PeHwYzN3PDk7l2WkIrLTNplo6OPeDfiDR+SKclaKkslLPmSR/iKJw7IgH+LhSuwSUgwd2vcuKUyP30YcwvKau2zH8QeUHA434bAoQUNwgx204FwUOsa3aX/HTXjFkXmA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709041452; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=Ot/DCCzfEEMRuguhLsrlbJKXVHIQGJaIdaEMWlsQRG0=; b=Zxq/6wEuzKT4FmpT5lL9pQXe0CFp3n/wVPwJ7LToPPQpFl6yOSIWU9vwHMFH/w2BXUyvRsQuWMfWltKQJm3Mr2ioiPsN5+QQl976hKdYrKUiOifRD5lPBbTxW6UTZrqjGXoLu+ARyQMdenvZKh+golMM5LMPEfp2ex2OULtp7Oc= 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 1709041452674892.7879413174845; Tue, 27 Feb 2024 05:44:12 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rexap-0000uD-7a; Tue, 27 Feb 2024 08:34:00 -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 1rexaO-0000ki-Os for qemu-devel@nongnu.org; Tue, 27 Feb 2024 08:33:33 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rexaJ-0002sv-QZ for qemu-devel@nongnu.org; Tue, 27 Feb 2024 08:33:32 -0500 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-33aeb088324so2734232f8f.2 for ; Tue, 27 Feb 2024 05:33:27 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id i13-20020adfe48d000000b0033ae7d768b2sm11319552wrm.117.2024.02.27.05.33.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 05:33:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709040806; x=1709645606; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=Ot/DCCzfEEMRuguhLsrlbJKXVHIQGJaIdaEMWlsQRG0=; b=pCudQqdelax8+ox6iak4SBF2V2rVDwKPaTxVXr9RY5xadj/CB6ho0uXE/HDno54h6Y JnX6EHnDq/+sAJXex5jfqET8cVs4vHy9bf5cMwy6FMyRpbOwqOpxyh+zn3HDHcuVkCmz 3Vji4VP1hGWHCC04Pi5drTwFE5c8cqEWkZP775wFMWvD+LPWCIBOlpblr8S83xIG9Ghh hG18Bi9JZH+01c8PkdrpcI1nPy7JDkWp8uuF9HJKrkk+nfV4MeenY3pBNclHwZ5C0DKi rWInY18FVkOJCPbB4eBwFQrBQOIA6FgHd/SFBdg+HhWIhKCm1fsLQRqtawIS7u0JFj7T FI/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709040806; x=1709645606; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ot/DCCzfEEMRuguhLsrlbJKXVHIQGJaIdaEMWlsQRG0=; b=UKfzFobq2Y5J1Syh1vet1IbP6KjX4o4JIxa9mxvydqgTHtS1NRqp+vAt/CKJUtrngj 8JfSh2kMWC6LBiXk5sovhGEessLS2qsJhyHLJwdeUc5+J+zTtqy+Wr9Ry5C5u3jHDW5z L/R0rNfx4eb6aBS9j5VdhS/WmAg1gMe2JsrAuX/mlT4urd7OcvmkYvo+YtgGoeaKR5DE c84p5IvkAcDnIhLrJ9zb9woyzKin0BPr1wRA7u1PInL9i/6e9FmG5k56+73weJADR4lh vioNzT+kNacnfroq+SkmTsv8xdaOULVbyyACgptouYtpygceyUGJpI8SeFL8Dvlpjxep aEwQ== X-Gm-Message-State: AOJu0YzvWqXamI0beG2XbSoZm6p3PqxUalbqXNJtqvGLApoSnkuAoH7+ 3YbvFlq5cjo+H40pVd+zlUBHTbjQjK+LsMER2g5xSG6zjNCVpyFc7yHg9jHTaf/msIR9w6xfMMh X X-Google-Smtp-Source: AGHT+IEzsIWI8ODRFarcZQyXVZ3d1KD4ZTu5j5n0Qm9sxbP9uixV9oj2ZT1fUYRtpX4e63iEGVyEKQ== X-Received: by 2002:adf:d1ca:0:b0:33d:f46f:6384 with SMTP id b10-20020adfd1ca000000b0033df46f6384mr994495wrd.23.1709040806229; Tue, 27 Feb 2024 05:33:26 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 19/45] hw/core/machine: Use qemu_register_resettable for sysbus reset Date: Tue, 27 Feb 2024 13:32:48 +0000 Message-Id: <20240227133314.1721857-20-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240227133314.1721857-1-peter.maydell@linaro.org> References: <20240227133314.1721857-1-peter.maydell@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::42c; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42c.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, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_TEMPERROR=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: 1709041454759100001 Move the reset of the sysbus (and thus all devices and buses anywhere on the qbus tree) from qemu_register_reset() to qemu_register_resettable(). This is a behaviour change: because qemu_register_resettable() is aware of three-phase reset, this now means that: * 'enter' phase reset methods of devices and buses are called before any legacy reset callbacks registered with qemu_register_reset() * 'exit' phase reset methods of devices and buses are called after any legacy qemu_register_reset() callbacks Put another way, a qemu_register_reset() callback is now correctly ordered in the 'hold' phase along with any other 'hold' phase methods. The motivation for doing this is that we will now be able to resolve some reset-ordering issues using the three-phase mechanism, because the 'exit' phase is always after the 'hold' phase, even when the 'hold' phase function was registered with qemu_register_reset(). Signed-off-by: Peter Maydell Reviewed-by: Michael S. Tsirkin Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Daniel P. Berrang=C3=A9 Message-id: 20240220160622.114437-10-peter.maydell@linaro.org Reviewed-by: Zhao Liu --- hw/core/machine.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/core/machine.c b/hw/core/machine.c index fb5afdcae4c..9ac5d5389a6 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -1577,14 +1577,13 @@ void qdev_machine_creation_done(void) /* TODO: once all bus devices are qdevified, this should be done * when bus is created by qdev.c */ /* - * TODO: If we had a main 'reset container' that the whole system - * lived in, we could reset that using the multi-phase reset - * APIs. For the moment, we just reset the sysbus, which will cause + * This is where we arrange for the sysbus to be reset when the + * whole simulation is reset. In turn, resetting the sysbus will cause * all devices hanging off it (and all their child buses, recursively) * to be reset. Note that this will *not* reset any Device objects * which are not attached to some part of the qbus tree! */ - qemu_register_reset(resettable_cold_reset_fn, sysbus_get_default()); + qemu_register_resettable(OBJECT(sysbus_get_default())); =20 notifier_list_notify(&machine_init_done_notifiers, NULL); =20 --=20 2.34.1